allyhub 0.19.0 → 0.21.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 (717) hide show
  1. package/dist/commands/align.js +1 -1
  2. package/dist/commands/check.js +1 -1
  3. package/dist/commands/cloud-tools.js +5 -5
  4. package/dist/commands/cloud.js +1 -1
  5. package/dist/commands/dev.js +5 -5
  6. package/dist/commands/export.js +3 -0
  7. package/dist/commands/frames/doc.js +1 -1
  8. package/dist/commands/frames/piece.js +1 -1
  9. package/dist/commands/frames/sheet.js +1 -1
  10. package/dist/commands/frames.js +9 -9
  11. package/dist/commands/index.js +1 -1
  12. package/dist/commands/inspect/combos.js +1 -1
  13. package/dist/commands/inspect/common.js +2 -2
  14. package/dist/commands/inspect/facts.js +2 -2
  15. package/dist/commands/migrate.js +3 -0
  16. package/dist/commands/skills.js +3 -3
  17. package/dist/commands/upgrade.js +5 -0
  18. package/dist/commands.json +1 -1
  19. package/dist/help.js +3 -3
  20. package/dist/main.js +8 -7
  21. package/dist/node_modules/@allyhub/3d-extension/package.json +2 -2
  22. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  23. package/dist/node_modules/@allyhub/blocks/LICENSE +241 -0
  24. package/dist/node_modules/@allyhub/blocks/dist/alt.js +2 -0
  25. package/dist/node_modules/@allyhub/blocks/dist/elements.js +2 -0
  26. package/dist/node_modules/@allyhub/blocks/dist/flow-resolve.js +2 -0
  27. package/dist/node_modules/@allyhub/blocks/dist/flow-table.js +2 -0
  28. package/dist/node_modules/@allyhub/blocks/dist/format.js +2 -0
  29. package/dist/node_modules/@allyhub/blocks/dist/gantt.js +2 -0
  30. package/dist/node_modules/@allyhub/blocks/dist/grids.js +2 -0
  31. package/dist/node_modules/@allyhub/blocks/dist/html.js +75 -0
  32. package/dist/node_modules/@allyhub/blocks/dist/icons.generated.js +2 -0
  33. package/dist/node_modules/@allyhub/blocks/dist/icons.js +2 -0
  34. package/dist/node_modules/@allyhub/blocks/dist/index.js +2 -0
  35. package/dist/node_modules/@allyhub/blocks/dist/layout.js +2 -0
  36. package/dist/node_modules/@allyhub/blocks/dist/look.js +2 -0
  37. package/dist/node_modules/@allyhub/blocks/dist/measure.js +3 -0
  38. package/dist/node_modules/@allyhub/blocks/dist/model.js +2 -0
  39. package/dist/node_modules/@allyhub/blocks/dist/page.js +2 -0
  40. package/dist/node_modules/@allyhub/blocks/dist/palette.js +2 -0
  41. package/dist/node_modules/@allyhub/blocks/dist/path.js +2 -0
  42. package/dist/node_modules/@allyhub/blocks/dist/resolve.js +2 -0
  43. package/dist/node_modules/@allyhub/blocks/dist/samples.js +2 -0
  44. package/dist/node_modules/@allyhub/blocks/dist/sankey.js +2 -0
  45. package/dist/node_modules/@allyhub/blocks/dist/svg.js +2 -0
  46. package/dist/node_modules/@allyhub/blocks/dist/tidy.js +2 -0
  47. package/dist/node_modules/@allyhub/blocks/dist/trees.js +2 -0
  48. package/dist/node_modules/@allyhub/blocks/package.json +19 -0
  49. package/dist/node_modules/@allyhub/browser/dist/html.js +1 -1
  50. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  51. package/dist/node_modules/@allyhub/build/dist/fonts.js +9 -3
  52. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  53. package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
  54. package/dist/node_modules/@allyhub/build/dist/migrate.js +2 -0
  55. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  56. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  57. package/dist/node_modules/@allyhub/build/package.json +5 -1
  58. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  59. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  60. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +2 -1
  61. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +4 -3
  62. package/dist/node_modules/@allyhub/chart/dist/chart.js +4 -2
  63. package/dist/node_modules/@allyhub/chart/dist/chartex-xml.js +4 -0
  64. package/dist/node_modules/@allyhub/chart/dist/classic.js +2 -0
  65. package/dist/node_modules/@allyhub/chart/dist/embedded.js +2 -2
  66. package/dist/node_modules/@allyhub/chart/dist/extended.js +2 -0
  67. package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
  68. package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
  69. package/dist/node_modules/@allyhub/chart/dist/tree.js +2 -0
  70. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  71. package/dist/node_modules/@allyhub/check/dist/check.js +1 -1
  72. package/dist/node_modules/@allyhub/check/package.json +1 -1
  73. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  74. package/dist/node_modules/@allyhub/cloud/dist/call.js +4 -4
  75. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  76. package/dist/node_modules/@allyhub/cloud/dist/storage.js +2 -0
  77. package/dist/node_modules/@allyhub/cloud/dist/uploads.js +2 -2
  78. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  79. package/dist/node_modules/@allyhub/components/package.json +1 -1
  80. package/dist/node_modules/@allyhub/dev-server/dist/background.js +1 -1
  81. package/dist/node_modules/@allyhub/dev-server/dist/item-process.js +2 -0
  82. package/dist/node_modules/@allyhub/dev-server/dist/item-worker.js +2 -0
  83. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  84. package/dist/node_modules/@allyhub/dev-server/dist/pages.js +20 -1
  85. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  86. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  87. package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
  88. package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
  89. package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
  90. package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -3
  91. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  92. package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +1 -1
  93. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  94. package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
  95. package/dist/node_modules/@allyhub/doc/dist/blocks.js +2 -0
  96. package/dist/node_modules/@allyhub/doc/dist/chart.js +1 -1
  97. package/dist/node_modules/@allyhub/doc/dist/color.js +1 -1
  98. package/dist/node_modules/@allyhub/doc/dist/docx-read.js +12 -0
  99. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -4
  100. package/dist/node_modules/@allyhub/doc/dist/html.js +83 -48
  101. package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
  102. package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
  103. package/dist/node_modules/@allyhub/doc/dist/merges.js +2 -0
  104. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  105. package/dist/node_modules/@allyhub/doc/dist/numbering.js +2 -0
  106. package/dist/node_modules/@allyhub/doc/dist/omml.js +3 -0
  107. package/dist/node_modules/@allyhub/doc/dist/page.js +2 -1
  108. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  109. package/dist/node_modules/@allyhub/doc/dist/parse.js +5 -4
  110. package/dist/node_modules/@allyhub/doc/dist/redline.js +2 -0
  111. package/dist/node_modules/@allyhub/doc/dist/revisions.js +2 -0
  112. package/dist/node_modules/@allyhub/doc/dist/shapes.js +4 -0
  113. package/dist/node_modules/@allyhub/doc/dist/styles.js +2 -0
  114. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  115. package/dist/node_modules/@allyhub/doc/dist/write.js +65 -39
  116. package/dist/node_modules/@allyhub/doc/package.json +5 -1
  117. package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
  118. package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
  119. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +3 -0
  120. package/dist/node_modules/@allyhub/doc-extension/dist/cli/index.js +1 -1
  121. package/dist/node_modules/@allyhub/doc-extension/dist/cli/styles.js +4 -0
  122. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  123. package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
  124. package/dist/node_modules/@allyhub/doc-extension/dist/project-tools.js +1 -1
  125. package/dist/node_modules/@allyhub/doc-extension/dist/tools.js +1 -1
  126. package/dist/node_modules/@allyhub/doc-extension/package.json +22 -2
  127. package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
  128. package/dist/node_modules/@allyhub/doc-print/dist/index.js +1 -1
  129. package/dist/node_modules/@allyhub/doc-print/dist/layout.js +8 -7
  130. package/dist/node_modules/@allyhub/doc-print/dist/print.js +22 -16
  131. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  132. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  133. package/dist/node_modules/@allyhub/export/package.json +1 -1
  134. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  135. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  136. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  137. package/dist/node_modules/@allyhub/formats/dist/data/blocks-flow.js +2 -0
  138. package/dist/node_modules/@allyhub/formats/dist/data/blocks.d.ts +146 -0
  139. package/dist/node_modules/@allyhub/formats/dist/data/blocks.js +2 -0
  140. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.d.ts +9 -0
  141. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.js +2 -0
  142. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +47 -40
  143. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
  144. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.d.ts +6 -0
  145. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.js +2 -0
  146. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.d.ts +29 -0
  147. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.js +2 -0
  148. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +18 -0
  149. package/dist/node_modules/@allyhub/formats/dist/data/faces.js +1 -1
  150. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +67 -0
  151. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +2 -0
  152. package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +1 -1
  153. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +698 -258
  154. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  155. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +14104 -2167
  156. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  157. package/dist/node_modules/@allyhub/formats/dist/data/themes.d.ts +82 -0
  158. package/dist/node_modules/@allyhub/formats/dist/data/themes.js +2 -0
  159. package/dist/node_modules/@allyhub/formats/dist/data/tokens.d.ts +67 -0
  160. package/dist/node_modules/@allyhub/formats/dist/data/tokens.js +2 -0
  161. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
  162. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  163. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +7 -0
  164. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  165. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +12 -3
  166. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +3260 -290
  167. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  168. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +45 -0
  169. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +2 -0
  170. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  171. package/dist/node_modules/@allyhub/html-extension/dist/project-tools.js +21 -9
  172. package/dist/node_modules/@allyhub/html-extension/dist/tools.js +1 -1
  173. package/dist/node_modules/@allyhub/html-extension/markup/allyhub.yaml +2 -0
  174. package/dist/node_modules/@allyhub/html-extension/markup/markup.json +14 -4
  175. package/dist/node_modules/@allyhub/html-extension/markup/pages/budget.html +22 -1
  176. package/dist/node_modules/@allyhub/html-extension/package.json +9 -1
  177. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  178. package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +1 -1
  179. package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +2 -2
  180. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  181. package/dist/node_modules/@allyhub/image-extension/dist/build-plugins.js +1 -1
  182. package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
  183. package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
  184. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +2 -2
  185. package/dist/node_modules/@allyhub/image-measure/dist/layout.js +2 -2
  186. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  187. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  188. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  189. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  190. package/dist/node_modules/@allyhub/image-sdk/dist/block.js +2 -0
  191. package/dist/node_modules/@allyhub/image-sdk/dist/blocks.js +2 -0
  192. package/dist/node_modules/@allyhub/image-sdk/dist/index.js +1 -1
  193. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  194. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  195. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -3
  196. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +3 -3
  197. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  198. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  199. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
  200. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  201. package/dist/node_modules/@allyhub/media/package.json +1 -1
  202. package/dist/node_modules/@allyhub/media-extension/dist/analyses/faces.js +1 -1
  203. package/dist/node_modules/@allyhub/media-extension/dist/asr/transcribe.js +1 -1
  204. package/dist/node_modules/@allyhub/media-extension/dist/ocr/text.js +1 -1
  205. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  206. package/dist/node_modules/@allyhub/media-extension/dist/vision/index-media.js +3 -2
  207. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  208. package/dist/node_modules/@allyhub/model/package.json +1 -1
  209. package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
  210. package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +1 -1
  211. package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
  212. package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
  213. package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
  214. package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +1 -1
  215. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  216. package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
  217. package/dist/node_modules/@allyhub/ooxml/dist/mce.js +1 -1
  218. package/dist/node_modules/@allyhub/ooxml/dist/node.js +1 -1
  219. package/dist/node_modules/@allyhub/ooxml/dist/ns.js +1 -1
  220. package/dist/node_modules/@allyhub/ooxml/dist/opc.js +1 -1
  221. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  222. package/dist/node_modules/@allyhub/piece/dist/export.d.ts +1 -1
  223. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +2 -0
  224. package/dist/node_modules/@allyhub/piece/dist/look.d.ts +10 -2
  225. package/dist/node_modules/@allyhub/piece/dist/look.js +1 -1
  226. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +8 -2
  227. package/dist/node_modules/@allyhub/piece/dist/script.js +1 -1
  228. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +3 -0
  229. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  230. package/dist/node_modules/@allyhub/project/dist/media-index.js +1 -1
  231. package/dist/node_modules/@allyhub/project/package.json +1 -1
  232. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  233. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  234. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  235. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  236. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  237. package/dist/node_modules/@allyhub/protocol/dist/page-frame.js +2 -0
  238. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  239. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  240. package/dist/node_modules/@allyhub/render/package.json +1 -1
  241. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  242. package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
  243. package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
  244. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
  245. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  246. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  247. package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
  248. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
  249. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
  250. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  251. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  252. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  253. package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
  254. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
  255. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
  256. package/dist/node_modules/@allyhub/runtime/dist/footage.js +1 -1
  257. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  258. package/dist/node_modules/@allyhub/runtimes/dist/packages.js +2 -2
  259. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +3 -3
  260. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  261. package/dist/node_modules/@allyhub/scaffold/dist/index.js +12 -8
  262. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  263. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  264. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  265. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  266. package/dist/node_modules/@allyhub/sheet/dist/api/charts.js +1 -1
  267. package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
  268. package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
  269. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  270. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  271. package/dist/node_modules/@allyhub/sheet/dist/calc/server.js +1 -1
  272. package/dist/node_modules/@allyhub/sheet/dist/cell-styles.js +2 -0
  273. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  274. package/dist/node_modules/@allyhub/sheet/dist/check.js +1 -1
  275. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  276. package/dist/node_modules/@allyhub/sheet/dist/heatmap.js +2 -0
  277. package/dist/node_modules/@allyhub/sheet/dist/html.js +8 -8
  278. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  279. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  280. package/dist/node_modules/@allyhub/sheet/dist/paginate.js +1 -1
  281. package/dist/node_modules/@allyhub/sheet/dist/printed.js +1 -1
  282. package/dist/node_modules/@allyhub/sheet/dist/sdk.js +1 -1
  283. package/dist/node_modules/@allyhub/sheet/dist/sparklines.js +2 -0
  284. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  285. package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
  286. package/dist/node_modules/@allyhub/sheet/dist/theme.js +2 -0
  287. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +2 -0
  288. package/dist/node_modules/@allyhub/sheet/dist/units.js +2 -0
  289. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  290. package/dist/node_modules/@allyhub/sheet/dist/write.js +14 -14
  291. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  292. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  293. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  294. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  295. package/dist/node_modules/@allyhub/sheet/dist/xlsx/theme.js +1 -1
  296. package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
  297. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  298. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  299. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  300. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +7 -7
  301. package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
  302. package/dist/node_modules/@allyhub/sheet-extension/dist/evaluate.js +2 -2
  303. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
  304. package/dist/node_modules/@allyhub/sheet-extension/dist/inspect.js +2 -2
  305. package/dist/node_modules/@allyhub/sheet-extension/dist/migrations.js +4 -0
  306. package/dist/node_modules/@allyhub/sheet-extension/dist/project-tools.js +1 -1
  307. package/dist/node_modules/@allyhub/sheet-extension/dist/tools.js +1 -1
  308. package/dist/node_modules/@allyhub/sheet-extension/package.json +7 -3
  309. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  310. package/dist/node_modules/@allyhub/slides-core/dist/blocks.js +2 -0
  311. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  312. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  313. package/dist/node_modules/@allyhub/slides-core/dist/code.js +1 -1
  314. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  315. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  316. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  317. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  318. package/dist/node_modules/@allyhub/slides-core/dist/model.js +1 -1
  319. package/dist/node_modules/@allyhub/slides-core/dist/office-layouts.js +2 -0
  320. package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
  321. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  322. package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
  323. package/dist/node_modules/@allyhub/slides-core/dist/styles/brief.js +2 -0
  324. package/dist/node_modules/@allyhub/slides-core/dist/styles/editorial.js +2 -0
  325. package/dist/node_modules/@allyhub/slides-core/dist/styles/index.js +2 -0
  326. package/dist/node_modules/@allyhub/slides-core/dist/styles/kit.js +2 -0
  327. package/dist/node_modules/@allyhub/slides-core/dist/styles/layouts.js +2 -0
  328. package/dist/node_modules/@allyhub/slides-core/dist/styles/pitch.js +2 -0
  329. package/dist/node_modules/@allyhub/slides-core/dist/styles/stage.js +2 -0
  330. package/dist/node_modules/@allyhub/slides-core/dist/styles/tiles.js +2 -0
  331. package/dist/node_modules/@allyhub/slides-core/dist/theme.js +1 -1
  332. package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
  333. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  334. package/dist/node_modules/@allyhub/slides-extension/dist/check.js +1 -1
  335. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
  336. package/dist/node_modules/@allyhub/slides-extension/dist/deck-fonts.js +1 -1
  337. package/dist/node_modules/@allyhub/slides-extension/dist/project-tools.js +1 -1
  338. package/dist/node_modules/@allyhub/slides-extension/package.json +24 -1
  339. package/dist/node_modules/@allyhub/slides-pptx/dist/charts.js +1 -1
  340. package/dist/node_modules/@allyhub/slides-pptx/dist/fonts.js +1 -1
  341. package/dist/node_modules/@allyhub/slides-pptx/dist/image-size.js +2 -0
  342. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +3 -3
  343. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +7 -2
  344. package/dist/node_modules/@allyhub/slides-pptx/dist/import/names.js +1 -1
  345. package/dist/node_modules/@allyhub/slides-pptx/dist/import/script.js +1 -1
  346. package/dist/node_modules/@allyhub/slides-pptx/dist/index.js +1 -1
  347. package/dist/node_modules/@allyhub/slides-pptx/dist/mtx.js +2 -0
  348. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +3 -2
  349. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chartex.js +3 -0
  350. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  351. package/dist/node_modules/@allyhub/slides-pptx/dist/read/index.js +2 -2
  352. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  353. package/dist/node_modules/@allyhub/slides-pptx/dist/read/table.js +1 -1
  354. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  355. package/dist/node_modules/@allyhub/slides-pptx/dist/read/timing.js +1 -1
  356. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  357. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  358. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  359. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +3 -2
  360. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  361. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  362. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +1 -1
  363. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  364. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  365. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/LICENSE +93 -0
  366. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-italic.woff2 +0 -0
  367. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-normal.woff2 +0 -0
  368. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-italic.woff2 +0 -0
  369. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-normal.woff2 +0 -0
  370. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-italic.woff2 +0 -0
  371. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-normal.woff2 +0 -0
  372. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-italic.woff2 +0 -0
  373. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-normal.woff2 +0 -0
  374. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400-italic.css +1 -0
  375. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400.css +1 -0
  376. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700-italic.css +1 -0
  377. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700.css +1 -0
  378. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400-italic.css +1 -0
  379. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400.css +1 -0
  380. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700-italic.css +1 -0
  381. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700.css +1 -0
  382. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/LICENSE +93 -0
  383. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-400-normal.woff2 +0 -0
  384. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-ext-400-normal.woff2 +0 -0
  385. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-400.css +1 -0
  386. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-ext-400.css +1 -0
  387. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/LICENSE +93 -0
  388. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-italic.woff2 +0 -0
  389. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  390. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-italic.woff2 +0 -0
  391. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2 +0 -0
  392. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-italic.woff2 +0 -0
  393. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
  394. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-italic.woff2 +0 -0
  395. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-normal.woff2 +0 -0
  396. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400-italic.css +1 -0
  397. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400.css +1 -0
  398. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700-italic.css +1 -0
  399. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700.css +1 -0
  400. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400-italic.css +1 -0
  401. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400.css +1 -0
  402. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700-italic.css +1 -0
  403. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700.css +1 -0
  404. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/LICENSE +93 -0
  405. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-italic.woff2 +0 -0
  406. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-normal.woff2 +0 -0
  407. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-italic.woff2 +0 -0
  408. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-normal.woff2 +0 -0
  409. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-italic.woff2 +0 -0
  410. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-normal.woff2 +0 -0
  411. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-italic.woff2 +0 -0
  412. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-normal.woff2 +0 -0
  413. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400-italic.css +1 -0
  414. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400.css +1 -0
  415. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700-italic.css +1 -0
  416. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700.css +1 -0
  417. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400-italic.css +1 -0
  418. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400.css +1 -0
  419. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700-italic.css +1 -0
  420. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700.css +1 -0
  421. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/LICENSE +93 -0
  422. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-italic.woff2 +0 -0
  423. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-normal.woff2 +0 -0
  424. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-italic.woff2 +0 -0
  425. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-normal.woff2 +0 -0
  426. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-italic.woff2 +0 -0
  427. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-normal.woff2 +0 -0
  428. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-italic.woff2 +0 -0
  429. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-normal.woff2 +0 -0
  430. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400-italic.css +1 -0
  431. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400.css +1 -0
  432. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700-italic.css +1 -0
  433. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700.css +1 -0
  434. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400-italic.css +1 -0
  435. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400.css +1 -0
  436. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700-italic.css +1 -0
  437. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700.css +1 -0
  438. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/LICENSE +93 -0
  439. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-italic.woff2 +0 -0
  440. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-normal.woff2 +0 -0
  441. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-italic.woff2 +0 -0
  442. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-normal.woff2 +0 -0
  443. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-italic.woff2 +0 -0
  444. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-normal.woff2 +0 -0
  445. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-italic.woff2 +0 -0
  446. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-normal.woff2 +0 -0
  447. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400-italic.css +1 -0
  448. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400.css +1 -0
  449. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700-italic.css +1 -0
  450. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700.css +1 -0
  451. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400-italic.css +1 -0
  452. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400.css +1 -0
  453. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700-italic.css +1 -0
  454. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700.css +1 -0
  455. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  456. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +42 -0
  457. package/dist/node_modules/@allyhub/stage-page/dist/style-faces.js +2 -0
  458. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  459. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +96 -92
  460. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  461. package/dist/node_modules/@allyhub/telemetry/dist/limit.js +2 -0
  462. package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
  463. package/dist/node_modules/@allyhub/text-extension/markup/allyhub.yaml +2 -0
  464. package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
  465. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  466. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
  467. package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -1
  468. package/dist/node_modules/@allyhub/video-core/dist/seams.js +1 -1
  469. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  470. package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +1 -1
  471. package/dist/node_modules/@allyhub/video-extension/dist/inspect/index.js +1 -1
  472. package/dist/node_modules/@allyhub/video-extension/dist/inspect/joins.js +1 -1
  473. package/dist/node_modules/@allyhub/video-extension/dist/inspect/loop.js +3 -0
  474. package/dist/node_modules/@allyhub/video-extension/package.json +2 -25
  475. package/dist/node_modules/@allyhub/video-measure/dist/check.js +2 -2
  476. package/dist/node_modules/@allyhub/video-measure/dist/index.js +1 -1
  477. package/dist/node_modules/@allyhub/video-measure/dist/seams.js +1 -1
  478. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  479. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  480. package/dist/node_modules/@allyhub/video-sdk/dist/free.js +1 -1
  481. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  482. package/dist/node_modules/@allyhub/website/dist/index.js +1 -1
  483. package/dist/node_modules/@allyhub/website/dist/website.js +2 -2
  484. package/dist/node_modules/@allyhub/website/package.json +1 -1
  485. package/dist/node_modules/@allyhub/website-extension/package.json +3 -3
  486. package/dist/node_modules/@allyhub/x-extension/package.json +1 -3
  487. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +3 -3
  488. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  489. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  490. package/dist/package.json +15 -14
  491. package/dist/self-upgrade.js +2 -0
  492. package/dist/text/batch-text.js +1 -1
  493. package/dist/text/facts-text.js +5 -5
  494. package/dist/text/format.js +2 -2
  495. package/dist/update-notice.js +3 -0
  496. package/dist/version.js +1 -1
  497. package/dist/works.js +1 -1
  498. package/editor-web/assets/{abnfDiagram-WEYOIA3C-DYaMS_BB.js → abnfDiagram-WEYOIA3C-B4tvwU6C.js} +1 -1
  499. package/editor-web/assets/{architecture-WOLXFQ4H-g_Tjfl_y.js → architecture-WOLXFQ4H-V2fA0vY2.js} +1 -1
  500. package/editor-web/assets/{architectureDiagram-ZHVYKT53-CqdhofOL.js → architectureDiagram-ZHVYKT53-B6B7XN0M.js} +1 -1
  501. package/editor-web/assets/arrow-down-D-QZrqcz.js +1 -0
  502. package/editor-web/assets/arrow-up-B1zjKUHX.js +1 -0
  503. package/editor-web/assets/article-DW4eD_8K.js +3 -0
  504. package/editor-web/assets/article-Dm2dIEwc.js +7 -0
  505. package/editor-web/assets/{audio-lines-PZj77e7t.js → audio-lines-BFoW_IeO.js} +1 -1
  506. package/editor-web/assets/{bar-button-J9vbfzTx.js → bar-button-CJmpgNg4.js} +1 -1
  507. package/editor-web/assets/{blockDiagram-RJAE7QA3-Bc-28Bci.js → blockDiagram-RJAE7QA3-BizcUGOM.js} +1 -1
  508. package/editor-web/assets/{browser-C9NP0ZYz.js → browser-DEGNhKTV.js} +1 -1
  509. package/editor-web/assets/{c4Diagram-XDPPPE54-CTGJb8FB.js → c4Diagram-XDPPPE54-CBHS0dQ0.js} +1 -1
  510. package/editor-web/assets/calc-worker-Cr4a0xmt.js +168 -0
  511. package/editor-web/assets/channel-dyUtlVPg.js +1 -0
  512. package/editor-web/assets/{chart-no-axes-column-Be0lFcGF.js → chart-no-axes-column-Dyy25XZ_.js} +1 -1
  513. package/editor-web/assets/chip-BdQRH3FL.js +1 -0
  514. package/editor-web/assets/{chunk-2E7WHVMD-B2MPOVTU.js → chunk-2E7WHVMD-CMPBck_Q.js} +1 -1
  515. package/editor-web/assets/{chunk-4EMNKR2T-BUV1ZHP0.js → chunk-4EMNKR2T-Df22Adpt.js} +1 -1
  516. package/editor-web/assets/{chunk-55XCU76K-BZlpspL5.js → chunk-55XCU76K-CYrZ6_Q7.js} +1 -1
  517. package/editor-web/assets/{chunk-7S6XSTFO-CpKeisWE.js → chunk-7S6XSTFO-BfdG9NNW.js} +1 -1
  518. package/editor-web/assets/{chunk-AQDTSKZB-BJqwAPyo.js → chunk-AQDTSKZB-BCzZMoTJ.js} +1 -1
  519. package/editor-web/assets/{chunk-DSNLSHJZ-D6oPWl_W.js → chunk-DSNLSHJZ-DT0xT8Wf.js} +1 -1
  520. package/editor-web/assets/{chunk-HAGFOTED-B5pk4MZF.js → chunk-HAGFOTED-Bg3-EotU.js} +1 -1
  521. package/editor-web/assets/{chunk-HNE4Q36P-DHbSPvxQ.js → chunk-HNE4Q36P-BrSym24V.js} +1 -1
  522. package/editor-web/assets/{chunk-NQOKRVIF-CcL_GcRA.js → chunk-NQOKRVIF-CMxgkJWF.js} +1 -1
  523. package/editor-web/assets/{chunk-UHW7PFBP-YgiOL6XE.js → chunk-UHW7PFBP-DWEwoyPy.js} +1 -1
  524. package/editor-web/assets/{chunk-VQ5W62QI-p14b4UYc.js → chunk-VQ5W62QI-eTFh5_T9.js} +1 -1
  525. package/editor-web/assets/{chunk-WQQL4CDK-BWW0x-XH.js → chunk-WQQL4CDK-4PTupr9T.js} +1 -1
  526. package/editor-web/assets/{chunk-YZO67HFG-oG3qd68C.js → chunk-YZO67HFG-D5XAAFWm.js} +1 -1
  527. package/editor-web/assets/{chunk-ZAUX2LTX-CpcheH0u.js → chunk-ZAUX2LTX-CPsdaisO.js} +1 -1
  528. package/editor-web/assets/{chunk-ZCHMQSOR-cWQvLl1w.js → chunk-ZCHMQSOR-ClnuUyfy.js} +1 -1
  529. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-7PG7YcdU.js → classDiagram-v2-4MYWR3UA-CM21waNF.js} +1 -1
  530. package/editor-web/assets/code-Ch6AB5bZ.js +1 -0
  531. package/editor-web/assets/{collaborator-BU4qU7O3.js → collaborator-CbTacvkB.js} +1 -1
  532. package/editor-web/assets/color-picker-BmKFn2ww.js +1 -0
  533. package/editor-web/assets/{copy-CuJSs0nI.js → copy-SoaMYqsN.js} +1 -1
  534. package/editor-web/assets/{createLucideIcon-lm_6n8YT.js → createLucideIcon-euu7Wcd9.js} +1 -1
  535. package/editor-web/assets/{cynefin-EF2NZ3EQ-CtcknEQ_.js → cynefin-EF2NZ3EQ-CJUHTgee.js} +1 -1
  536. package/editor-web/assets/{cynefinDiagram-WF24UDRP-Ca7VIsjN.js → cynefinDiagram-WF24UDRP-C9RIfuIV.js} +1 -1
  537. package/editor-web/assets/{dagre-NK4GIZVX-BzcSLtsr.js → dagre-NK4GIZVX-g-01KdpO.js} +1 -1
  538. package/editor-web/assets/deck-C0VxrlzX.js +1 -0
  539. package/editor-web/assets/{diagram-CBK3MWTC-DpRmTGlG.js → diagram-CBK3MWTC-CbOjWUu-.js} +1 -1
  540. package/editor-web/assets/{diagram-I5XIIV2D-BTrs_AX8.js → diagram-I5XIIV2D-C6psNS8J.js} +1 -1
  541. package/editor-web/assets/{diagram-ODIL2UCW-CkIVjPqH.js → diagram-ODIL2UCW-C9PUE46P.js} +1 -1
  542. package/editor-web/assets/{diagram-PFBEJUXE-BlFMbAG1.js → diagram-PFBEJUXE-vJ_pnB33.js} +1 -1
  543. package/editor-web/assets/{diagram-RJA3I4VV-D3f8VJ-D.js → diagram-RJA3I4VV-FwYlEfJ-.js} +1 -1
  544. package/editor-web/assets/{diagram-TYUNFSNR-Bbpngj6F.js → diagram-TYUNFSNR-FKpIxeUc.js} +1 -1
  545. package/editor-web/assets/{dist-DruvDNQe.js → dist-B8_6sJ_V.js} +5 -5
  546. package/editor-web/assets/dist-BI_BaYhO.js +19 -0
  547. package/editor-web/assets/dist-BaWFMuvr.js +1 -0
  548. package/editor-web/assets/dist-BdmMT8fP.js +5 -0
  549. package/editor-web/assets/dist-BgKyM9U6.js +3 -0
  550. package/editor-web/assets/dist-BqijryYd.js +1 -0
  551. package/editor-web/assets/dist-ByguWp3a.js +16 -0
  552. package/editor-web/assets/dist-CB-_0-X4.js +41 -0
  553. package/editor-web/assets/dist-CCP24Lel.js +19 -0
  554. package/editor-web/assets/dist-Cg0Z26Kv.js +6 -0
  555. package/editor-web/assets/dist-CtYjYJdv.js +1 -0
  556. package/editor-web/assets/dist-D07Kj8GR.js +1 -0
  557. package/editor-web/assets/dist-D2rGVz9C.js +1 -0
  558. package/editor-web/assets/dist-D3DwRF1k.js +547 -0
  559. package/editor-web/assets/dist-DCI21ljp.js +6 -0
  560. package/editor-web/assets/dist-DH8oJJw9.js +35 -0
  561. package/editor-web/assets/dist-DIJnhQFK.js +9 -0
  562. package/editor-web/assets/dist-DJvfQvM7.js +24 -0
  563. package/editor-web/assets/{dist-Bd8IxQPP.js → dist-DQ6RpEJD.js} +2 -2
  564. package/editor-web/assets/dist-DmCDcb2_.js +4 -0
  565. package/editor-web/assets/dist-H0z_DXDz.js +19 -0
  566. package/editor-web/assets/dist-QLXI7XGS.js +82 -0
  567. package/editor-web/assets/{docx-draw-CoK1oqQD.js → docx-draw-Dxb67W2d.js} +1 -1
  568. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BaKj-yL6.js → ebnfDiagram-V4P3TTPT-DBymUM-F.js} +1 -1
  569. package/editor-web/assets/{elk-QONTBCTQ-Cn2qv1_U.js → elk-QONTBCTQ-BNYR3OlS.js} +1 -1
  570. package/editor-web/assets/{erDiagram-KYQIGQAA-Bd7AEIDo.js → erDiagram-KYQIGQAA-cTNyOqW6.js} +1 -1
  571. package/editor-web/assets/esm-Cl3GKSDd.js +21 -0
  572. package/editor-web/assets/{eventmodeling-K75KTNOO-Sfp7_461.js → eventmodeling-K75KTNOO-C6FUZeXP.js} +1 -1
  573. package/editor-web/assets/eye-DwfE1USj.js +1 -0
  574. package/editor-web/assets/{file-question-mark-DlIjUK37.js → file-question-mark-PeZgyqkK.js} +1 -1
  575. package/editor-web/assets/flowDiagram-IUGLLWBU-ukTovy07.js +1 -0
  576. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CBqcGdHI.js → ganttDiagram-R7GPNTJY-LD9mqQ1x.js} +1 -1
  577. package/editor-web/assets/{gitGraph-VSP46ZUC-WTokXKTW.js → gitGraph-VSP46ZUC-CtCBcQFl.js} +1 -1
  578. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BIWZHD9q.js → gitGraphDiagram-PDYL7XHY-DYQpOozz.js} +1 -1
  579. package/editor-web/assets/{group-BdrTp7gi.js → group-DwM2yqU8.js} +1 -1
  580. package/editor-web/assets/{hint-rlht0uxG.js → hint-F4fIBnVU.js} +1 -1
  581. package/editor-web/assets/index-Cah2zchD.css +2 -0
  582. package/editor-web/assets/index-omhSywJb.js +28 -0
  583. package/editor-web/assets/{info-OHQRW6UA-COC6G-_J.js → info-OHQRW6UA-IXInKPRO.js} +1 -1
  584. package/editor-web/assets/{infoDiagram-MVDRKAX5-DpaqdKBD.js → infoDiagram-MVDRKAX5-Ds7Cei7T.js} +1 -1
  585. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js → ishikawaDiagram-HPEHV2GE-DWs3qtAX.js} +1 -1
  586. package/editor-web/assets/iso-UwGLGD3F.js +1 -0
  587. package/editor-web/assets/{italic-zw4_eUNF.js → italic-BV7iHxoP.js} +1 -1
  588. package/editor-web/assets/{journeyDiagram-BOSHW7O7-DeSVfmm7.js → journeyDiagram-BOSHW7O7-BkNKVYBA.js} +1 -1
  589. package/editor-web/assets/{kanban-definition-FNSA4HC5-Bfg0lj7B.js → kanban-definition-FNSA4HC5-D3dMswnI.js} +1 -1
  590. package/editor-web/assets/{link-DopSU3aa.js → link-CFOv3nz-.js} +1 -1
  591. package/editor-web/assets/{mermaid-parser.core-CyhovuYE.js → mermaid-parser.core-D_W_0X0N.js} +3 -3
  592. package/editor-web/assets/{mermaid.core-Dx1fBVUG.js → mermaid.core-Bkirj-s5.js} +4 -4
  593. package/editor-web/assets/{mindmap-definition-6OY57UG3-QEU2HF_m.js → mindmap-definition-6OY57UG3-CMKkAAvI.js} +1 -1
  594. package/editor-web/assets/minus-ngE8owxs.js +1 -0
  595. package/editor-web/assets/{packet-JDAUHWVQ-ReJTa_hw.js → packet-JDAUHWVQ-CzCkgCfg.js} +1 -1
  596. package/editor-web/assets/palette-DchDLJj6.js +1 -0
  597. package/editor-web/assets/panes-BexRuZd2.js +3 -0
  598. package/editor-web/assets/{pegDiagram-ECIUJNBX-Bo1jFrvb.js → pegDiagram-ECIUJNBX-C8qHkx7M.js} +1 -1
  599. package/editor-web/assets/{pie-XZMESJXO-BrtYafNA.js → pie-XZMESJXO-BJqgxMrD.js} +1 -1
  600. package/editor-web/assets/{pieDiagram-GNMPY74T-Cj0zQqs_.js → pieDiagram-GNMPY74T-DyNntV5y.js} +1 -1
  601. package/editor-web/assets/{progress-CwKcXARv.js → progress-D1Uv3d1b.js} +1 -1
  602. package/editor-web/assets/{quadrantDiagram-D57K4MC3-D5npDAVn.js → quadrantDiagram-D57K4MC3-BHa-69ir.js} +1 -1
  603. package/editor-web/assets/{radar-ABXABTNO-C8RDrRqi.js → radar-ABXABTNO-BeRPjBBR.js} +1 -1
  604. package/editor-web/assets/{railroad-I3PHUGI6-ebDrmYTK.js → railroad-I3PHUGI6-BaRQqRsK.js} +1 -1
  605. package/editor-web/assets/{railroad-abnf-LNEFI6M7-BxKuqg6V.js → railroad-abnf-LNEFI6M7-BZfwomxZ.js} +1 -1
  606. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DOclnfpr.js → railroad-ebnf-DWYD2UWJ-DbgqpEF5.js} +1 -1
  607. package/editor-web/assets/{railroad-peg-JR7BVNR7-DN0A1fpq.js → railroad-peg-JR7BVNR7-BYOf3PsQ.js} +1 -1
  608. package/editor-web/assets/{railroadDiagram-Y72NRBL7-B3PjoVWw.js → railroadDiagram-Y72NRBL7-B5OAzOsD.js} +1 -1
  609. package/editor-web/assets/react-Byupo4pA.js +1 -0
  610. package/editor-web/assets/replace-CLLMtF4e.js +1 -0
  611. package/editor-web/assets/{requirementDiagram-EQYSW5RA-DLdzkQk5.js → requirementDiagram-EQYSW5RA-wqYNoqO0.js} +1 -1
  612. package/editor-web/assets/ribbon-tabs-B3IC9WOt.js +1 -0
  613. package/editor-web/assets/row-DqS4-5b1.js +1 -0
  614. package/editor-web/assets/{sankeyDiagram-SY24JHO5-Dip4Piv_.js → sankeyDiagram-SY24JHO5-Crf6GRsa.js} +1 -1
  615. package/editor-web/assets/schemas-C21MyseF.js +1 -0
  616. package/editor-web/assets/{iso-DoC-ZoBr.js → schemas-DlRAoVtq.js} +1 -1
  617. package/editor-web/assets/{scissors-B_xOiUhd.js → scissors-m6QcoEf2.js} +1 -1
  618. package/editor-web/assets/search-D75Bi2GU.js +1 -0
  619. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-QnPcoybL.js → sequenceDiagram-BLEHNHQU-DUcHz4_d.js} +1 -1
  620. package/editor-web/assets/{session-DMlLCFWg.js → session--OJYv_B7.js} +1 -1
  621. package/editor-web/assets/{sigma-DSUsJhMn.js → sigma-B4AWtnVA.js} +1 -1
  622. package/editor-web/assets/snapshots-DYooVfOx.js +1 -0
  623. package/editor-web/assets/sound-DkR3qxSt.js +1 -0
  624. package/editor-web/assets/{square-arrow-out-up-right-DF5dvsSp.js → square-arrow-out-up-right-1NqFsNDe.js} +1 -1
  625. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-D103CiMX.js → stateDiagram-v2-A6IESKWZ-DbeLdnpS.js} +1 -1
  626. package/editor-web/assets/{sticky-note-BdkIu5_D.js → sticky-note-s4QfzaBB.js} +1 -1
  627. package/editor-web/assets/{surface-DtCjIlrq.js → surface-BUoi7cmR.js} +1 -1
  628. package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
  629. package/editor-web/assets/{swimlanes-B3ENRKFQ-y4gCqEoa.js → swimlanes-B3ENRKFQ-BDi6AeJI.js} +1 -1
  630. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-2wwOmxbv.js +8 -0
  631. package/editor-web/assets/{switch-8MU4Nfxe.js → switch-b6GCy_ix.js} +1 -1
  632. package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
  633. package/editor-web/assets/table-BW43XXVd.js +1 -0
  634. package/editor-web/assets/tablet-C6oePHEW.js +1 -0
  635. package/editor-web/assets/text-wrap-Baus6l-V.js +1 -0
  636. package/editor-web/assets/{textarea-D7TnPwv1.js → textarea-Bu6uPEqT.js} +1 -1
  637. package/editor-web/assets/{timeline-definition-JXYKGLGB-BMp76v4V.js → timeline-definition-JXYKGLGB-B0awa2hh.js} +1 -1
  638. package/editor-web/assets/tolerant-DM9s0Mt1.js +1 -0
  639. package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
  640. package/editor-web/assets/{treeView-D4JQ5SDB-Q_GYyk0b.js → treeView-D4JQ5SDB-C91G0IGm.js} +1 -1
  641. package/editor-web/assets/{treemap-SAJKECNS-B5lRWdQB.js → treemap-SAJKECNS-CiOWiwl2.js} +1 -1
  642. package/editor-web/assets/{undo-2-C47jrRp5.js → undo-2-DCbMWoug.js} +1 -1
  643. package/editor-web/assets/updating-D0GEtwnJ.js +1 -0
  644. package/editor-web/assets/{usecaseDiagram-WPOLBNNX--QRllA-U.js → usecaseDiagram-WPOLBNNX-DMYM1MRe.js} +1 -1
  645. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CzkATPA3.js → vennDiagram-Q3Y3IDCW-DQIJ5vvN.js} +1 -1
  646. package/editor-web/assets/video-mMOFXHYK.js +1 -0
  647. package/editor-web/assets/{wardley-7MLQ67FV-BXzwcdJa.js → wardley-7MLQ67FV-C3H9HG8r.js} +1 -1
  648. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BQvC8Agx.js → wardleyDiagram-IVAIDKWA-DgsjqY1Y.js} +1 -1
  649. package/editor-web/assets/{whole-word-D3ZAtnkw.js → whole-word-C9TkGBCY.js} +1 -1
  650. package/editor-web/assets/{words-CaUHhQHf.js → words-B2jQwWpp.js} +3 -3
  651. package/editor-web/assets/words-DgMuEmDO.js +3 -0
  652. package/editor-web/assets/workbook-NtMEyLgf.js +41 -0
  653. package/editor-web/assets/{x-DlhyIKuu.js → x-BAJilkKD.js} +1 -1
  654. package/editor-web/assets/{xychartDiagram-4URNHDU4-aY-lsD5o.js → xychartDiagram-4URNHDU4-DzsGI527.js} +1 -1
  655. package/editor-web/assets/{zoom-in-PgsC94hP.js → zoom-in-yAGKspfC.js} +1 -1
  656. package/editor-web/index.html +9 -9
  657. package/package.json +6 -3
  658. package/CHANGELOG.md +0 -251
  659. package/dist/commands/render.js +0 -3
  660. package/dist/node_modules/@allyhub/video-extension/dist/inspect/motion.js +0 -4
  661. package/dist/node_modules/@allyhub/video-measure/dist/still.js +0 -2
  662. package/editor-web/assets/arrow-down-B8VUPCGi.js +0 -1
  663. package/editor-web/assets/arrow-up-Ds4juY8X.js +0 -1
  664. package/editor-web/assets/article-8evPh712.js +0 -3
  665. package/editor-web/assets/article-BhRtWYMd.js +0 -7
  666. package/editor-web/assets/calc-worker-oEIqrrTM.js +0 -45
  667. package/editor-web/assets/channel-wIj_OqDm.js +0 -1
  668. package/editor-web/assets/chart-amT4lgX3.js +0 -2
  669. package/editor-web/assets/chart-file-dGiRgFcH.js +0 -1
  670. package/editor-web/assets/code-CD-CbJG9.js +0 -1
  671. package/editor-web/assets/deck-C7fN0Qtn.js +0 -1
  672. package/editor-web/assets/dist-3iovns9K.js +0 -16
  673. package/editor-web/assets/dist-BkHnbOEj.js +0 -4
  674. package/editor-web/assets/dist-BvOrNcK-.js +0 -19
  675. package/editor-web/assets/dist-CEIszq39.js +0 -1
  676. package/editor-web/assets/dist-CU5RbLNH.js +0 -1
  677. package/editor-web/assets/dist-CWZj8IAm.js +0 -1
  678. package/editor-web/assets/dist-C_Mtrnif.js +0 -17
  679. package/editor-web/assets/dist-CdqpwdCV.js +0 -24
  680. package/editor-web/assets/dist-CjT76RAw.js +0 -43
  681. package/editor-web/assets/dist-CpzEn9T8.js +0 -6
  682. package/editor-web/assets/dist-CrFYWl5-.js +0 -3
  683. package/editor-web/assets/dist-D3C6FyrO.js +0 -82
  684. package/editor-web/assets/dist-D4eBFGVL.js +0 -1
  685. package/editor-web/assets/dist-DTcjb3cP.js +0 -18
  686. package/editor-web/assets/dist-D_WSM29I.js +0 -17
  687. package/editor-web/assets/dist-Dp_9ISjP.js +0 -531
  688. package/editor-web/assets/dist-J-tPYKGS.js +0 -5
  689. package/editor-web/assets/dist-YW8hS4IM.js +0 -9
  690. package/editor-web/assets/esm-Cjv8ogpP.js +0 -21
  691. package/editor-web/assets/file-exclamation-point-_L3ElCJ5.js +0 -1
  692. package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +0 -1
  693. package/editor-web/assets/index-BQWZnyAQ.js +0 -28
  694. package/editor-web/assets/index-Dvh1t1om.css +0 -2
  695. package/editor-web/assets/layout-SWqqA0yV.js +0 -1
  696. package/editor-web/assets/minus-CbPnUIOy.js +0 -1
  697. package/editor-web/assets/props-form-BpSXbrSF.js +0 -1
  698. package/editor-web/assets/react-Edyoga_4.js +0 -1
  699. package/editor-web/assets/row-C_svyL8o.js +0 -1
  700. package/editor-web/assets/schemas-CQ_UU8-Z.js +0 -1
  701. package/editor-web/assets/search-Ba2BbT6T.js +0 -1
  702. package/editor-web/assets/slides-7xWhREpt.js +0 -1
  703. package/editor-web/assets/snapshots-BLX4NTQC.js +0 -1
  704. package/editor-web/assets/sound-bTlco_K3.js +0 -1
  705. package/editor-web/assets/split-tFGKk-x8.js +0 -3
  706. package/editor-web/assets/strikethrough-BwXWi4zg.js +0 -1
  707. package/editor-web/assets/svg-CWIBMIQ9.js +0 -1
  708. package/editor-web/assets/swatch-DhztHwPU.js +0 -1
  709. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +0 -8
  710. package/editor-web/assets/syntax-CU_WPKxt.js +0 -1
  711. package/editor-web/assets/table-DRbddzx0.js +0 -1
  712. package/editor-web/assets/tabs-CuEawka3.js +0 -1
  713. package/editor-web/assets/tag-CIfWT8B_.js +0 -1
  714. package/editor-web/assets/text-align-start-Cic2-TLh.js +0 -1
  715. package/editor-web/assets/video-D0uTbHWx.js +0 -1
  716. package/editor-web/assets/words-XlXG79Ur.js +0 -3
  717. package/editor-web/assets/workbook-CiCXkjmN.js +0 -45
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{randomBytes as q}from"node:crypto";import{mkdir as $,readFile as O,readdir as I,rename as x,rm as N,stat as j,writeFile as A}from"node:fs/promises";import{dirname as g,extname as B,join as h,posix as C}from"node:path";import D from"write-file-atomic";import{listWork as H,moveEdits as z,movedPath as P,unlistedWork as M}from"@allyhub/build";import{CACHE_DIR as K,TRASH_DIR as f,WORK_FILE as S,WorkItemSchema as X}from"@allyhub/formats";import{RPC_ERROR as d,RpcError as p}from"@allyhub/protocol";import{DELETED_FILE as Y,emptyTrashOlderThan as G,hasErrorCode as Q,shortNameOf as V,utcStampOf as Z}from"./deletion.js";import{current as F,fileIn as m,pathProblem as J,versionOf as b}from"./paths.js";import{writeProblems as tt}from"./validate.js";export const UPLOAD_MAX_BYTES=200*1024*1024,LIST_LIMIT=5e3;const et=[K,f];function it(v){const i=(v.split(/[/\\]/u).pop()??"").replace(/\p{Cc}/gu,"").replace(/^\.+/u,"").trim();return i===""?"file":i}export class Writer{root;kinds;wrote;writable;queue=Promise.resolve();constructor(t,i,n=()=>{},o=()=>Promise.resolve()){this.root=t,this.kinds=i,this.wrote=n,this.writable=o}serial(t){const i=async()=>(await this.writable(),t()),n=this.queue.then(i,i);return this.queue=n.catch(()=>{}),n}async read(t){const i=await F(await m(this.root,t));return i?{text:i.bytes.toString("utf8"),version:i.version}:{text:"",version:null}}write(t,i,n,o){return this.serial(async()=>{const s=await m(this.root,t,{write:!0}),a=await F(s),w=a?.version??null;if(w!==n)throw new p(d.conflict,`${t} changed since it was read.`,{text:a?.bytes.toString("utf8")??"",version:w});const c=await tt(t,i,this.kinds,this.root);if(c.length>0)throw new p(d.invalid,`${t} would not be a file AllyHub can read: ${c[0]??""}`,{problems:c});const r=b(i);return r===w||(await $(g(s),{recursive:!0}),await D(s,i),this.wrote([{path:t,version:r,text:i}],o)),r})}upload(t,i,n,o){return n.length>UPLOAD_MAX_BYTES?Promise.reject(new p(d.invalid,`${i} is larger than ${String(UPLOAD_MAX_BYTES/1024/1024)} MB.`)):this.serial(async()=>{const s=it(i),a=B(s),w=s.slice(0,s.length-a.length);for(let c=1;;c++){const r=c===1?s:`${w}-${String(c)}${a}`,e=t===""?r:`${t}/${r}`,u=await m(this.root,e,{write:!0});if(!await y(u))return await $(g(u),{recursive:!0}),await A(u,n,{flag:"wx"}),this.wrote([{path:e,version:b(n)}],o),e}})}move(t,i,n){return this.serial(async()=>{const o=await m(this.root,t,{write:!0}),s=await m(this.root,i,{write:!0});if(i===t||i.startsWith(`${t}/`))throw new p(d.invalid,`${t} cannot move into itself.`);if(!await y(o))throw new p(d.notFound,`There is no ${t}.`);if(await y(s))throw new p(d.conflict,`${i} is taken.`,{text:"",version:null});const a=await z(this.root,t,i);for(const e of a)await D(h(this.root,e.path),e.text);const w=await R(t,o);await $(g(s),{recursive:!0}),await x(o,s);const c=w.map(e=>({path:e,version:null}));for(const e of w){const u=P(e,t,i);c.push({path:u,version:(await F(h(this.root,u)))?.version??null})}const r=a.map(e=>P(e.path,t,i));for(const e of a)P(e.path,t,i)===e.path&&c.push({path:e.path,version:b(e.text)});return this.wrote(c,n),r})}remove(t,i){return this.serial(async()=>{const n=await m(this.root,t,{write:!0});if(!await y(n))throw new p(d.notFound,`There is no ${t}.`);const o=await R(t,n),s=`${String(Date.now())}-${q(4).toString("hex")}`,a=h(this.root,f,s,...t.split("/"));await $(g(a),{recursive:!0}),await x(n,a);const w=o.map(k=>({path:k,version:null})),c=h(this.root,S),r=await O(c,"utf8").catch(()=>{}),e=r===void 0?void 0:M(r,t);e!==void 0&&(await D(c,e.text),w.push({path:S,version:b(e.text)}));const u={path:t,removed:Date.now(),...e===void 0?{}:{listed:e.items}};return await A(h(this.root,f,`${s}.json`),`${JSON.stringify(u)}
3
- `),this.wrote(w,i),s})}moveToTrashAndUnlist(t,i){return this.serial(async()=>{const n=await t.planNow(),{item:o,name:s,kind:a,entry:w}=n,c=(t.now??(()=>new Date))();await G(this.root,t.keptDays,c);const r=`${Z(c)}-${V(o)}`;let e=`${f}/${r}`;for(let l=2;await y(h(this.root,e));l++)e=`${f}/${r}-${String(l)}`;const u=h(this.root,S),k=await O(u,"utf8").catch(l=>{if(!Q(l,"ENOENT"))throw l}),T=k===void 0?void 0:M(k,w),W=[];try{for(const l of n.moves){const E=await m(this.root,l,{write:!0}),L=h(this.root,e,...l.split("/"));await $(g(L),{recursive:!0}),await x(E,L),W.push(l)}}catch(l){for(const E of W.reverse())await x(h(this.root,e,...E.split("/")),h(this.root,...E.split("/")));throw await N(h(this.root,e),{recursive:!0,force:!0}),l}const U={deletedAt:c.toISOString(),item:o,name:s,...a===void 0?{}:{kind:a},listed:T?.entries??[],files:n.moves.map(l=>({path:l}))};await $(h(this.root,e),{recursive:!0}),await A(h(this.root,e,Y),`${JSON.stringify(U,null,2)}
4
- `);const _=n.moves.map(l=>({path:l,version:null}));return T!==void 0&&(await D(u,T.text),_.push({path:S,version:b(T.text)})),this.wrote(_,i),{plan:n,trash:e,moved:n.moves}})}async trash(){const t=h(this.root,f),i=await I(t).catch(()=>[]),n=[];for(const o of i){if(!o.endsWith(".json"))continue;const s=await O(h(t,o),"utf8").then(a=>JSON.parse(a)).catch(()=>{});typeof s?.path!="string"||typeof s.removed!="number"||J(s.path)!==void 0||n.push({id:o.slice(0,-5),path:s.path,removed:s.removed})}return n.sort((o,s)=>s.removed-o.removed)}restore(t,i){return this.serial(async()=>{const n=(await this.trash()).find(e=>e.id===t);if(!n)throw new p(d.notFound,`Nothing in the bin is ${t}.`);const o=await m(this.root,n.path,{write:!0});if(await y(o))throw new p(d.conflict,`${n.path} is there again: move it before putting this back.`,{text:"",version:null});const s=h(this.root,f,t,...n.path.split("/")),a=await O(h(this.root,f,`${t}.json`),"utf8").then(e=>JSON.parse(e).listed).catch(()=>{});await $(g(o),{recursive:!0}),await x(s,o),await N(h(this.root,f,t),{recursive:!0,force:!0}),await N(h(this.root,f,`${t}.json`),{force:!0});const w=await R(n.path,o),c=(Array.isArray(a)?a:[]).flatMap(e=>{const u=X.safeParse(e);return u.success?[u.data]:[]});for(const e of c)await H(this.root,e);c.length>0&&w.push(S);const r=[];for(const e of w)r.push({path:e,version:(await F(h(this.root,e)))?.version??null});return this.wrote(r,i),n.path})}async list(t){const i=t===""?this.root:await m(this.root,t),n=[],o=[],s=async(a,w)=>{const c=await I(a,{withFileTypes:!0}).catch(()=>[]);for(const r of c.sort((e,u)=>e.name.localeCompare(u.name))){if(n.length>=LIST_LIMIT)return;const e=w===""?r.name:`${w}/${r.name}`;if(J(e)===void 0&&!(et.some(u=>e===u)&&!(t===e||t.startsWith(`${e}/`)))){if(r.isDirectory())o.push(e),await s(h(a,r.name),e);else if(r.isFile()){const u=await j(h(a,r.name)).catch(()=>{});u&&n.push({path:e,size:u.size,modified:u.mtimeMs})}}}};return await s(i,t),{files:n,dirs:o}}}const y=v=>j(v).then(()=>!0,()=>!1);async function R(v,t){const i=await j(t).catch(()=>{});if(!i)return[];if(!i.isDirectory())return[v];const n=[],o=await I(t,{recursive:!0,withFileTypes:!0});for(const s of o)s.isFile()&&n.push(C.join(v,C.relative(t.split("\\").join("/"),h(s.parentPath,s.name).split("\\").join("/"))));return n}
2
+ import{randomBytes as q}from"node:crypto";import{mkdir as $,readFile as I,readdir as F,rename as b,rm as N,stat as j,writeFile as A}from"node:fs/promises";import{dirname as g,extname as B,join as h,posix as C}from"node:path";import O from"write-file-atomic";import{listWork as H,moveEdits as z,movedPath as P,unlistedWork as M}from"@allyhub/build";import{CACHE_DIR as K,TRASH_DIR as f,WORK_FILE as x,WorkItemSchema as X}from"@allyhub/formats";import{RPC_ERROR as d,RpcError as p}from"@allyhub/protocol";import{DELETED_FILE as Y,emptyTrashOlderThan as G,hasErrorCode as Q,shortNameOf as V,utcStampOf as Z}from"./deletion.js";import{current as D,fileIn as m,pathProblem as J,versionOf as S}from"./paths.js";import{writeProblems as tt}from"./validate.js";export const UPLOAD_MAX_BYTES=200*1024*1024,LIST_LIMIT=5e3;const et=[K,f];function it(v){const i=(v.split(/[/\\]/u).pop()??"").replace(/\p{Cc}/gu,"").replace(/^\.+/u,"").trim();return i===""?"file":i}export class Writer{root;kinds;wrote;writable;unreadableIn;queue=Promise.resolve();constructor(t,i,n=()=>{},r=()=>Promise.resolve(),s){this.root=t,this.kinds=i,this.wrote=n,this.writable=r,this.unreadableIn=s}serial(t){const i=async()=>(await this.writable(),t()),n=this.queue.then(i,i);return this.queue=n.catch(()=>{}),n}async read(t){const i=await D(await m(this.root,t));return i?{text:i.bytes.toString("utf8"),version:i.version}:{text:"",version:null}}write(t,i,n,r){return this.serial(async()=>{const s=await m(this.root,t,{write:!0}),a=await D(s),l=a?.version??null;if(l!==n)throw new p(d.conflict,`${t} changed since it was read.`,{text:a?.bytes.toString("utf8")??"",version:l});const c=await tt(t,i,this.kinds,this.root,this.unreadableIn);if(c.length>0)throw new p(d.invalid,`${t} would not be a file AllyHub can read: ${c[0]??""}`,{problems:c});const o=S(i);return o===l||(await $(g(s),{recursive:!0}),await O(s,i),this.wrote([{path:t,version:o,text:i}],r)),o})}upload(t,i,n,r){return n.length>UPLOAD_MAX_BYTES?Promise.reject(new p(d.invalid,`${i} is larger than ${String(UPLOAD_MAX_BYTES/1024/1024)} MB.`)):this.serial(async()=>{const s=it(i),a=B(s),l=s.slice(0,s.length-a.length);for(let c=1;;c++){const o=c===1?s:`${l}-${String(c)}${a}`,e=t===""?o:`${t}/${o}`,u=await m(this.root,e,{write:!0});if(!await y(u))return await $(g(u),{recursive:!0}),await A(u,n,{flag:"wx"}),this.wrote([{path:e,version:S(n)}],r),e}})}move(t,i,n){return this.serial(async()=>{const r=await m(this.root,t,{write:!0}),s=await m(this.root,i,{write:!0});if(i===t||i.startsWith(`${t}/`))throw new p(d.invalid,`${t} cannot move into itself.`);if(!await y(r))throw new p(d.notFound,`There is no ${t}.`);if(await y(s))throw new p(d.conflict,`${i} is taken.`,{text:"",version:null});const a=await z(this.root,t,i);for(const e of a)await O(h(this.root,e.path),e.text);const l=await R(t,r);await $(g(s),{recursive:!0}),await b(r,s);const c=l.map(e=>({path:e,version:null}));for(const e of l){const u=P(e,t,i);c.push({path:u,version:(await D(h(this.root,u)))?.version??null})}const o=a.map(e=>P(e.path,t,i));for(const e of a)P(e.path,t,i)===e.path&&c.push({path:e.path,version:S(e.text)});return this.wrote(c,n),o})}remove(t,i){return this.serial(async()=>{const n=await m(this.root,t,{write:!0});if(!await y(n))throw new p(d.notFound,`There is no ${t}.`);const r=await R(t,n),s=`${String(Date.now())}-${q(4).toString("hex")}`,a=h(this.root,f,s,...t.split("/"));await $(g(a),{recursive:!0}),await b(n,a);const l=r.map(k=>({path:k,version:null})),c=h(this.root,x),o=await I(c,"utf8").catch(()=>{}),e=o===void 0?void 0:M(o,t);e!==void 0&&(await O(c,e.text),l.push({path:x,version:S(e.text)}));const u={path:t,removed:Date.now(),...e===void 0?{}:{listed:e.items}};return await A(h(this.root,f,`${s}.json`),`${JSON.stringify(u)}
3
+ `),this.wrote(l,i),s})}moveToTrashAndUnlist(t,i){return this.serial(async()=>{const n=await t.planNow(),{item:r,name:s,kind:a,entry:l}=n,c=(t.now??(()=>new Date))();await G(this.root,t.keptDays,c);const o=`${Z(c)}-${V(r)}`;let e=`${f}/${o}`;for(let w=2;await y(h(this.root,e));w++)e=`${f}/${o}-${String(w)}`;const u=h(this.root,x),k=await I(u,"utf8").catch(w=>{if(!Q(w,"ENOENT"))throw w}),T=k===void 0?void 0:M(k,l),W=[];try{for(const w of n.moves){const E=await m(this.root,w,{write:!0}),L=h(this.root,e,...w.split("/"));await $(g(L),{recursive:!0}),await b(E,L),W.push(w)}}catch(w){for(const E of W.reverse())await b(h(this.root,e,...E.split("/")),h(this.root,...E.split("/")));throw await N(h(this.root,e),{recursive:!0,force:!0}),w}const U={deletedAt:c.toISOString(),item:r,name:s,...a===void 0?{}:{kind:a},listed:T?.entries??[],files:n.moves.map(w=>({path:w}))};await $(h(this.root,e),{recursive:!0}),await A(h(this.root,e,Y),`${JSON.stringify(U,null,2)}
4
+ `);const _=n.moves.map(w=>({path:w,version:null}));return T!==void 0&&(await O(u,T.text),_.push({path:x,version:S(T.text)})),this.wrote(_,i),{plan:n,trash:e,moved:n.moves}})}async trash(){const t=h(this.root,f),i=await F(t).catch(()=>[]),n=[];for(const r of i){if(!r.endsWith(".json"))continue;const s=await I(h(t,r),"utf8").then(a=>JSON.parse(a)).catch(()=>{});typeof s?.path!="string"||typeof s.removed!="number"||J(s.path)!==void 0||n.push({id:r.slice(0,-5),path:s.path,removed:s.removed})}return n.sort((r,s)=>s.removed-r.removed)}restore(t,i){return this.serial(async()=>{const n=(await this.trash()).find(e=>e.id===t);if(!n)throw new p(d.notFound,`Nothing in the bin is ${t}.`);const r=await m(this.root,n.path,{write:!0});if(await y(r))throw new p(d.conflict,`${n.path} is there again: move it before putting this back.`,{text:"",version:null});const s=h(this.root,f,t,...n.path.split("/")),a=await I(h(this.root,f,`${t}.json`),"utf8").then(e=>JSON.parse(e).listed).catch(()=>{});await $(g(r),{recursive:!0}),await b(s,r),await N(h(this.root,f,t),{recursive:!0,force:!0}),await N(h(this.root,f,`${t}.json`),{force:!0});const l=await R(n.path,r),c=(Array.isArray(a)?a:[]).flatMap(e=>{const u=X.safeParse(e);return u.success?[u.data]:[]});for(const e of c)await H(this.root,e,this.kinds);c.length>0&&l.push(x);const o=[];for(const e of l)o.push({path:e,version:(await D(h(this.root,e)))?.version??null});return this.wrote(o,i),n.path})}async list(t){const i=t===""?this.root:await m(this.root,t),n=[],r=[],s=async(a,l)=>{const c=await F(a,{withFileTypes:!0}).catch(()=>[]);for(const o of c.sort((e,u)=>e.name.localeCompare(u.name))){if(n.length>=LIST_LIMIT)return;const e=l===""?o.name:`${l}/${o.name}`;if(J(e)===void 0&&!(et.some(u=>e===u)&&!(t===e||t.startsWith(`${e}/`)))){if(o.isDirectory())r.push(e),await s(h(a,o.name),e);else if(o.isFile()){const u=await j(h(a,o.name)).catch(()=>{});u&&n.push({path:e,size:u.size,modified:u.mtimeMs})}}}};return await s(i,t),{files:n,dirs:r}}}const y=v=>j(v).then(()=>!0,()=>!1);async function R(v,t){const i=await j(t).catch(()=>{});if(!i)return[];if(!i.isDirectory())return[v];const n=[],r=await F(t,{recursive:!0,withFileTypes:!0});for(const s of r)s.isFile()&&n.push(C.join(v,C.relative(t.split("\\").join("/"),h(s.parentPath,s.name).split("\\").join("/"))));return n}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/dev-server",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export const CORE="allyhub",CORE_RULES=[{code:"AK-M001",level:"error",rule:"The fields of video(), presentation() or defineComponent do not match the format"},{code:"AK-M002",level:"error",rule:"The project's list (allyhub.yaml) cannot be read, or names a kind not loaded or a file not there"},{code:"AK-M003",level:"error",rule:"The project's list names two pieces by one id"},{code:"AK-M004",level:"error",rule:"The project has no pieces"},{code:"AK-M006",level:"error",rule:"A messages file does not match the format"},{code:"AK-M007",level:"error",rule:"A script file does not match the format"},{code:"AK-M011",level:"error",rule:"A deck names no slides file or script, or its slides file is not there, does not match the format, or names a layout, a prop, a file or a video item the deck does not have"},{code:"AK-M012",level:"error",rule:"A sheet's code reads the clock or a random number, reaches outside the project, or does not make the same sheets twice"},{code:"AK-M016",level:"error",rule:"An item uses another item's made file that is not there: no such item in the work list, no type both kinds take, or an item using itself"},{code:"AK-B001",level:"error",rule:"Two pieces have the same id"},{code:"AK-B003",level:"error",rule:"The build made a network request"},{code:"AK-B004",level:"error",rule:"The build timed out, or its result is over the size limit"},{code:"AK-B005",level:"error",rule:"An import of a file outside the project, or of a package not declared in package.json"},{code:"AK-B006",level:"error",rule:"An import of an @allyhub/sdk entry point that does not exist"},{code:"AK-B008",level:"error",rule:"The project's @allyhub/sdk is another version than the allyhub that builds it"},{code:"AK-B009",level:"error",rule:"The project's package.json declares AllyHub, but its packages are not installed"},{code:"AK-D002",level:"error",rule:"The same frame has different pixels when drawn in order and out of order"},{code:"AK-N003",level:"error",rule:"The sandbox blocked a request at run time"},{code:"AK-A001",level:"error",rule:"A referenced media or data file does not exist"},{code:"AK-P003",level:"error",rule:"A moment did not finish drawing within the piece's seekLimit (default 30 seconds): work a layer waits for (ctx.wait) or a picture it shows never settled"},{code:"AK-R001",level:"error",rule:"An unhandled exception was thrown at run time"},{code:"AK-X001",level:"error",rule:"The matrix's slots, structures, rules or combos name something that does not exist, or a combo lacks a slot of its structure"},{code:"AK-X002",level:"error",rule:"The matrix's rules leave no combination to make, or rule out a combo matrix.combos names"},{code:"AK-X004",level:"error",rule:"Two chosen combos are the same, or more alike than the matrix's differ allows"},{code:"AK-X006",level:"error",rule:"A combo is longer than its output's maxDuration"},{code:"AK-L002",level:"warn",rule:"Text overflows the frame or is clipped"},{code:"AK-L006",level:"warn",rule:"Text is drawn in a fallback font, or in a bold or italic the font does not have"}];const r=new Map(CORE_RULES.map(e=>[e.code,{extension:CORE,...e}]));export function declareRules(e,t){const s=[];for(const o of t){const l=r.get(o.code);if(l&&l.extension!==e){s.push(`${o.code} is ${l.extension===CORE?"the core's":`${l.extension}'s`} rule already.`);continue}r.set(o.code,{extension:e,code:o.code,level:o.level,rule:o.rule})}return s}export function declareAll(e){return e.flatMap(t=>declareRules(t.extension,[t]))}export const ruleOf=e=>r.get(e),isRule=e=>r.has(e),declaredRules=()=>[...r.values()];
2
+ export const CORE="allyhub",CORE_RULES=[{code:"AK-M001",level:"error",rule:"The fields of video(), presentation() or defineComponent do not match the format"},{code:"AK-M002",level:"error",rule:"The project's list (allyhub.yaml) cannot be read, records no versions or a format older than its kind's, or names a kind not loaded or a file not there"},{code:"AK-M003",level:"error",rule:"The project's list names two pieces by one id"},{code:"AK-M004",level:"error",rule:"The project has no pieces"},{code:"AK-M006",level:"error",rule:"A messages file does not match the format"},{code:"AK-M007",level:"error",rule:"A script file does not match the format"},{code:"AK-M011",level:"error",rule:"A deck names no slides file or script, or its slides file is not there, does not match the format, or names a layout, a prop, a file or a video item the deck does not have"},{code:"AK-M012",level:"error",rule:"A sheet's code reads the clock or a random number, reaches outside the project, or does not make the same sheets twice"},{code:"AK-M016",level:"error",rule:"An item uses another item's made file that is not there: no such item in the work list, no type both kinds take, or an item using itself"},{code:"AK-B001",level:"error",rule:"Two pieces have the same id"},{code:"AK-B003",level:"error",rule:"The build made a network request"},{code:"AK-B004",level:"error",rule:"The build timed out, or its result is over the size limit"},{code:"AK-B005",level:"error",rule:"An import of a file outside the project, or of a package not declared in package.json"},{code:"AK-B006",level:"error",rule:"An import of an @allyhub/sdk entry point that does not exist"},{code:"AK-B008",level:"error",rule:"The project's @allyhub/sdk is another version than the allyhub that builds it"},{code:"AK-B009",level:"error",rule:"The project's package.json declares AllyHub, but its packages are not installed"},{code:"AK-D002",level:"error",rule:"The same frame has different pixels when drawn in order and out of order"},{code:"AK-N003",level:"error",rule:"The sandbox blocked a request at run time"},{code:"AK-A001",level:"error",rule:"A referenced media or data file does not exist"},{code:"AK-P003",level:"error",rule:"A moment did not finish drawing within the piece's seekLimit (default 30 seconds): work a layer waits for (ctx.wait) or a picture it shows never settled"},{code:"AK-R001",level:"error",rule:"An unhandled exception was thrown at run time"},{code:"AK-X001",level:"error",rule:"The matrix's slots, structures, rules or combos name something that does not exist, or a combo lacks a slot of its structure"},{code:"AK-X002",level:"error",rule:"The matrix's rules leave no combination to make, or rule out a combo matrix.combos names"},{code:"AK-X004",level:"error",rule:"Two chosen combos are the same, or more alike than the matrix's differ allows"},{code:"AK-X006",level:"error",rule:"A combo is longer than its output's maxDuration"},{code:"AK-L002",level:"warn",rule:"Text overflows the frame or is clipped"},{code:"AK-L006",level:"warn",rule:"Text is drawn in a fallback font, or in a bold or italic the font does not have"}];const r=new Map(CORE_RULES.map(e=>[e.code,{extension:CORE,...e}]));export function declareRules(e,t){const s=[];for(const o of t){const l=r.get(o.code);if(l&&l.extension!==e){s.push(`${o.code} is ${l.extension===CORE?"the core's":`${l.extension}'s`} rule already.`);continue}r.set(o.code,{extension:e,code:o.code,level:o.level,rule:o.rule})}return s}export function declareAll(e){return e.flatMap(t=>declareRules(t.extension,[t]))}export const ruleOf=e=>r.get(e),isRule=e=>r.has(e),declaredRules=()=>[...r.values()];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/diagnostics",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{absolutePath as R,connectorPath as W,paintRgb as M,pathTip as O,segsD as j}from"@allyhub/blocks";const P=4/3,v=new Set(["rect","ellipse","line","text","poly","path","trend","connector","icon","arc"]),w=t=>t*P;function $(t,o,e=1){const s=M(t,o);if(!s)return"none";const i=(s.alpha??1)*e;return i<1?{color:s.hex,transparency:Math.round((1-i)*100)}:s.hex}function d(t,o,e,s={}){const i=M(t,e);return o<=0||!i?"none":{color:i.hex,width:o,...i.alpha===void 0||i.alpha>=1?{}:{transparency:Math.round((1-i.alpha)*100)},...s.dash===!0?{dash:"dash"}:{},...s.round===!0?{cap:"round",join:"round"}:{},...s.arrow===!0?{endArrow:"triangle"}:{}}}const p=(t,o,e,s)=>({offset:{left:w(t),top:w(o)},width:w(Math.max(0,e)),height:w(Math.max(0,s))});function y(t,o,e,s,i){return{type:"custom",transformation:p(o.x,o.y,o.w,o.h),paths:[{path:`M0 0L${String(o.w)} ${String(o.h)}`,fill:!1,line:!1},...e.map(n=>({path:n}))],fill:s,line:i,altText:{name:t}}}function z(t,o){const e=[o.x,o.x+o.w],s=[o.y,o.y+o.h];for(const r of t)if(r[0]!=="Z")for(let a=1;a+1<r.length;a+=2)e.push(r[a]),s.push(r[a+1]);const i=Math.min(...e),n=Math.min(...s);return{x:i,y:n,w:Math.max(...e)-i,h:Math.max(...s)-n}}function k(t,o,e){const s=t.match(/[MLHVCAZ]|-?[\d.]+(?:e-?\d+)?/giu)??[];let i="",n=0;const r=[];for(const a of s){if(/^[A-Z]$/iu.test(a)){i=a.toUpperCase(),n=0,r.push(i);continue}const h=Number(a),c=i==="H"?"x":i==="V"?"y":i==="A"?n%7===5?"x":n%7===6?"y":"":n%2===0?"x":"y";r.push(String(c==="x"?h-o:c==="y"?h-e:h)),n+=1}return r.join(" ")}function C(t,o,e){const s=t.align==="center"?e.AlignmentType.CENTER:t.align==="right"?e.AlignmentType.RIGHT:e.AlignmentType.LEFT;return t.lines.map(i=>new e.Paragraph({alignment:s,spacing:{before:0,after:0,line:Math.round(t.lineHeight*20),lineRule:"exact"},children:i.runs.map(n=>{const r={text:n.text,size:Math.round(t.size*2),bold:n.bold===!0||(n.weight??t.weight)>=600,...n.italic===!0?{italics:!0}:{},color:M(n.color??t.color,o)?.hex??"000000",...t.caps===!0?{allCaps:!0}:{},...t.tracking===void 0?{}:{characterSpacing:Math.round(t.tracking*t.size*20)}};return new e.TextRun(r)})}))}function H(t,o,e,s){const i=t.part===""?`Shape ${String(o+1)}`:t.part;switch(t.type){case"rect":{const n=M(t.line,e)&&t.lineWidth>0?t.lineWidth/2:0,r=Math.max(0,t.w-2*n),a=Math.max(0,t.h-2*n),h=Math.min(t.r,r/2,a/2),c={transformation:p(t.x+n,t.y+n,r,a),fill:$(t.fill,e),line:d(t.line,t.lineWidth,e),altText:{name:i}};return[h>0?{type:"roundedRectangle",adjustments:{cornerRadius:h/Math.max(.01,Math.min(r,a))*100},...c}:{type:"rectangle",...c}]}case"ellipse":return[{type:"ellipse",transformation:p(t.x,t.y,t.w,t.h),fill:$(t.fill,e),line:d(t.line,t.lineWidth,e),altText:{name:i}}];case"line":{const n=Math.min(t.x1,t.x2),r=Math.min(t.y1,t.y2);return[y(i,{x:n,y:r,w:Math.abs(t.x2-t.x1),h:Math.abs(t.y2-t.y1)},[`M${String(t.x1-n)} ${String(t.y1-r)}L${String(t.x2-n)} ${String(t.y2-r)}`],"none",d(t.color,t.width,e,{dash:t.dash,round:!0}))]}case"connector":{const n=Math.min(t.x1,t.x2),r=Math.min(t.y1,t.y2);return[y(i,{x:n,y:r,w:Math.abs(t.x2-t.x1),h:Math.abs(t.y2-t.y1)},[k(W(t),n,r)],"none",d(t.color,t.width,e))]}case"text":return[{type:"rectangle",transformation:p(t.x,t.y,t.w,t.lines.length*t.lineHeight),fill:"none",line:"none",children:C(t,e,s),textOptions:{verticalAlignment:"top",margins:{top:0,right:0,bottom:0,left:0},wrap:!1},altText:{name:i}}];case"poly":{if(t.points.length===0)return;const n=`${t.points.map(([r,a],h)=>`${h===0?"M":"L"}${String(r)} ${String(a)}`).join("")}Z`;return[y(i,{x:t.x,y:t.y,w:t.w,h:t.h},[n],$(t.fill,e),d(t.line,t.lineWidth,e))]}case"path":{const n=z(t.segs,t),r=M(t.fill,e)!==void 0,a=[y(i,n,[k(j(t.segs,String),n.x,n.y)],r?$(t.fill,e,t.opacity??1):"none",d(t.line,t.lineWidth,e,{round:!0}))],h=t.arrow===!0?O(t.segs):void 0;if(h&&M(t.line,e)){const c=Math.max(3,t.lineWidth*3.5),x=h.x-h.dx*c,S=h.y-h.dy*c,b=-h.dy*c*.55,T=h.dx*c*.55,f=[[h.x,h.y],[x+b,S+T],[x-b,S-T]],g=Math.min(...f.map(l=>l[0])),u=Math.min(...f.map(l=>l[1]));a.push(y(`${i} arrowhead`,{x:g,y:u,w:Math.max(...f.map(l=>l[0]))-g,h:Math.max(...f.map(l=>l[1]))-u},[`${f.map(([l,A],L)=>`${L===0?"M":"L"}${String(l-g)} ${String(A-u)}`).join("")}Z`],$(t.line,e),"none"))}return a}case"trend":{const n=t.values;if(n.length<2)return;const r=t.target===void 0?n:[...n,t.target],a=Math.min(...r),c=Math.max(...r)-a||1,x=u=>t.h-(u-a)/c*t.h,S=u=>u/(n.length-1)*t.w,b=n.map((u,l)=>`${l===0?"M":"L"}${String(S(l))} ${String(x(u))}`).join(""),T=n.length-1,f=t.width*1.4,g=[];if(t.target!==void 0){const u=t.y+x(t.target);g.push(y(`${i} target`,{x:t.x,y:u,w:t.w,h:0},[`M0 0L${String(t.w)} 0`],"none",d("rule-strong",t.width/2,e,{dash:!0})))}return g.push(y(i,{x:t.x,y:t.y,w:t.w,h:t.h},[b],"none",d(t.color,t.width,e,{round:!0})),{type:"ellipse",transformation:p(t.x+S(T)-f,t.y+x(n[T]??0)-f,2*f,2*f),fill:$(t.color,e),line:"none",altText:{name:`${i} last`}}),g}case"icon":return[{type:"custom",transformation:p(t.x,t.y,t.size,t.size),paths:[{path:"M0 0L24 24",fill:!1,line:!1},...t.paths.map(n=>({path:R(n),fill:!1}))],fill:"none",line:d(t.color,t.stroke,e,{round:!0}),altText:{name:i}}];case"arc":{const n=Math.max(0,Math.min(1,t.share));if(n<=0)return[];const r={x:t.cx-t.r,y:t.cy-t.r,w:2*t.r,h:2*t.r},a=d(t.color,t.width,e,{round:!0});if(n>=.9999)return[{type:"ellipse",transformation:p(r.x,r.y,r.w,r.h),fill:"none",line:a,altText:{name:i}}];const h=2*Math.PI*n-Math.PI/2,c=t.r+t.r*Math.cos(h),x=t.r+t.r*Math.sin(h);return[y(i,r,[`M${String(t.r)} 0A${String(t.r)} ${String(t.r)} 0 ${n>.5?"1":"0"} 1 ${String(c)} ${String(x)}`],"none",a)]}default:return}}export function blockShapeGroup(t,o,e,s,i){if(t.marks.some(a=>!v.has(a.type)))return;const n=[{type:"rectangle",transformation:p(0,0,t.width,t.height),fill:"none",line:"none",altText:{name:"Frame"}}];for(const[a,h]of t.marks.entries()){const c=H(h,a,o,e);if(c===void 0)return;n.push(...c)}const r=i.width/w(t.width);return new s.ShapeGroupRun({children:n,transformation:{width:i.width,height:w(t.height)*r},altText:{name:i.name,title:i.name,description:i.description}})}
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{blockAlt as s,blockDataTable as g,blockFromFile as l,blockLayout as p,blockSvg as u,iconPaths as m,paletteOf as k}from"@allyhub/blocks";import{shownPath as c,TONE_COLORS as b,toneOf as h}from"@allyhub/formats";import{chartTheme as f}from"./chart.js";import{PAPER as o,tint as w}from"./paper.js";export const LIBRARY_TAGS={Icon:{kind:"icon"},Progress:{kind:"progress"},Timeline:{kind:"timeline",item:"Milestone"},Steps:{kind:"steps",item:"Step"},Person:{kind:"person"},People:{kind:"people",item:"Person"},RiskMatrix:{kind:"risk_matrix",item:"Entry"},Sankey:{kind:"sankey",item:"Flow"},Gantt:{kind:"gantt",item:"Task"},OrgChart:{kind:"org_chart"},IssueTree:{kind:"issue_tree"},DecisionTree:{kind:"decision_tree"},Fishbone:{kind:"fishbone"},Matrix:{kind:"matrix"},Marimekko:{kind:"marimekko"},Heatmap:{kind:"heatmap"},SmallMultiples:{kind:"small_multiples"}};export function libraryBlockTable(i,r={}){const{def:e}=libraryDef(i,r),t=e===void 0?void 0:g(e,r.lang);if(!(t===void 0||t.rows.length===0))return{type:"table",rows:[t.columns,...t.rows].map(n=>n.map(d=>[{text:d,styles:{}}]))}}export const DOC_BLOCK_SCALE=.75;export function docBlockPalette(i={}){return k({text:o.ink,body:o.ink,muted:o.lead,ground:o.sheet,surface:o.sheet,well:o.stone,rule:o.rule,"rule-strong":o.ruleStrong},{theme:f(i),font:"Carlito, Calibri, Arial, sans-serif"})}export function libraryFields(i){return i.items===void 0?{...i.props}:{...i.props,items:i.items.map(r=>({...r.props}))}}export function libraryDef(i,r={}){const e=LIBRARY_TAGS[i.tag];if(e===void 0)return{problems:[`<${i.tag}> is not a block`]};const t=r.data,n=l(e.kind,libraryFields(i),{...t===void 0?{}:{data:t,shown:a=>t(c(a))},...r.base===void 0?{}:{base:r.base}}),d=n.problems.map(a=>`${a.path.length>0?`${a.path.join(".")}: `:""}${a.message}`);return n.block===void 0?{problems:d}:{def:n.block,problems:d}}export function libraryBlockDrawing(i,r,e={}){const{def:t,problems:n}=libraryDef(i,e);return t===void 0?{problems:n}:{drawing:p(t,{width:r*.75},{flow:!0,scale:DOC_BLOCK_SCALE,...e.lang===void 0?{}:{lang:e.lang}}),alt:s(t,e.lang),problems:n}}export function libraryBlockSvg(i,r,e={}){const{def:t,problems:n}=libraryDef(i,e);if(t===void 0)return{problems:n};const d=s(t,e.lang);return{svg:u(t,{width:r*.75},docBlockPalette(e.page),{flow:!0,scale:DOC_BLOCK_SCALE,label:d,...e.id===void 0?{}:{id:e.id},...e.lang===void 0?{}:{lang:e.lang}}),alt:d,problems:n}}export function docStatsDef(i,r={}){const e=i.stats.map(n=>({value:n.value,label:n.label,...n.delta===void 0?{}:{delta:n.delta},...n.note===void 0?{}:{note:n.note},...n.downIsGood===!0?{good:"down"}:{},...n.status===void 0?{}:{status:n.status},...n.target===void 0?{}:{target:n.target},...n.trend===void 0?{}:{trend:n.trend},...n.icon===void 0?{}:{icon:n.icon}})),t=r.data;return l("stats",e,{...t===void 0?{}:{data:t,shown:n=>t(c(n))}}).block}export function docStatsSvg(i,r,e={}){const t=docStatsDef(i,e);if(t!==void 0)return u(t,{width:r*.75},docBlockPalette(e.page),{flow:!0,scale:DOC_BLOCK_SCALE,...e.id===void 0?{}:{id:e.id},...e.lang===void 0?{}:{lang:e.lang}})}export function inlineIconSvg(i,r){if(!/^[a-z][a-z0-9-]*$/iu.test(i))return;const e=m(i);if(e!==void 0)return`<svg class="icon" viewBox="0 0 24 24" width="1.15em" height="1.15em" fill="none" stroke="${r}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e.map(t=>`<path d="${t}"/>`).join("")}</svg>`}export function calloutTone(i,r={}){if(i===void 0)return;const e=h(i,"callout");if(e===void 0)return;if(e==="accent1"){const d=f(r).accent1;return{bg:w(d,.14),fg:o.ink,mark:d,icon:"message-square-warning"}}const t=b[e],n={info:"info",good:"circle-check",warning:"triangle-alert",bad:"octagon-alert"};return{bg:t.tint,fg:t.ink,mark:t.mark,...n[e]===void 0?{}:{icon:n[e]}}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{chartOfFile as R,chartSvg as F,isBar as S,isRound as A,isScatter as C,variesOf as D}from"@allyhub/chart";import{hex as H}from"./color.js";import{CHART_PALETTE as N,PAPER as v,accentPalette as B,tint as M}from"./paper.js";import{COMPONENT_ASPECT as P,COMPONENT_WIDTH as $}from"./component.js";export{CHART_PALETTE}from"./paper.js";const z={gray:"#8B8A85",brown:"#9A6B4B",red:"#D6403A",orange:"#EB6834",yellow:"#EDA100",green:"#1BAF7A",blue:"#2A78D6",purple:"#8A5CD6",pink:"#E87BA4"},w=v.lead,O={grid:v.rule,axis:v.ruleMid};export const CHART_BARS={gap:80,overlap:-8},CHART_TEXT={size:10,title:13},chartColor=e=>{const t=H(e,z);return t===void 0?void 0:`#${t}`},CHART_SECOND_TONE=.55;export function chartTheme(e={},t=[]){const[r=N[0],...i]=B(e.accent===void 0?void 0:chartColor(e.accent)),n=[r,r,...i];t.slice(0,n.length).forEach((m,s)=>{const u=chartColor(m);u!==void 0&&(n[s]=u)}),t.length<2&&(n[1]=M(n[0]??r,CHART_SECOND_TONE));const[a,d,f,g,o,h]=n;return{dk1:w,lt1:"#FFFFFF",dk2:"#37352F",lt2:"#EFEFED",accent1:a,accent2:d,accent3:f,accent4:g,accent5:o,accent6:h,hlink:a,folHlink:a}}export const SMOOTHED=new Set(["line","line-markers","scatter-lines"]),ROUND_FRAME={width:560,aspect:.6};export function chartFrame(e,t=$){const r=e.kind!==void 0&&A(e.kind),i=e.width??(r?Math.min(t,ROUND_FRAME.width):t);return{width:i,height:e.height??Math.round(i*(r?ROUND_FRAME.aspect:P))}}function L(e){const t=e.trim().replace(/,/gu,"");if(t==="")return null;const r=Number(t);return Number.isFinite(r)?r:void 0}function W(e,t){const r=C(e.kind),i=e.labels,n=e.min!==void 0||e.max!==void 0||e.format!==void 0?{...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.format===void 0?{}:{format:e.format}}:void 0,a={...i===void 0?{}:{labels:{...i.includes("value")?{value:!0}:{},...i.includes("percentage")?{percentage:!0}:{},...i.includes("category")?{category:!0}:{},...i.includes("series")?{series:!0}:{},...e.format===void 0?{}:{format:e.format}}},...n===void 0?{}:{value_axis:n},...A(e.kind)?{vary_by_categories:!0}:{}};if(e.table===void 0)return e.data===void 0||e.categories===void 0?void 0:{type:e.kind,data:e.data,categories:e.categories,series:e.series??[],...a};const[d=[],...f]=e.table,g=Math.max(0,...e.table.map(s=>s.length)),o=(s,u)=>s[u]??"",h=s=>f.map((u,l)=>{const x=L(o(u,s));return x===void 0?(t.push(`row ${String(l+1)} of its table: "${o(u,s)}" under ${o(d,s)||`column ${String(s+1)}`} is not a number`),null):x}),m=Array.from({length:Math.max(0,g-1)},(s,u)=>{const l=u+1;return{name:o(d,l)||`Series ${String(l)}`,values:h(l),...r?{x:h(0)}:{}}});if(m.length!==0)return{type:e.kind,...r?{}:{categories:f.map(s=>o(s,0))},series:m,...a}}function j(e,t){if(e.legend!=="none")return e.legend!==void 0?e.legend:A(e.kind)?"right":t.series.length>1?"top":void 0}export function docChart(e,t={}){const r=[],i=W(e,r);if(!i)return{problems:[...r,"it has no numbers to draw"]};const n=R(i,{title:e.title,base:t.base??"",rows:c=>{const p=t.data?.(c);if(p===void 0)throw new Error("there is no such file or table");return p},problem:c=>r.push(c)});if(!n)return{problems:r};const a=j(e,n),d=chartTheme(t.page,e.colors),f=[d.accent1,d.accent2,d.accent3,d.accent4,d.accent5,d.accent6],g=c=>({rgb:f[c%f.length]??"#000000"}),o=n.series.length===1&&!A(e.kind)&&(e.colors?.length??0)>1?(e.colors??[]).map(chartColor):void 0,h=o!==void 0||D(n),m=C(e.kind),s=e.table===void 0?e.categories:e.table[0]?.[0],u=n.series.length===1?n.series[0]?.name:void 0,l={gridline_color:{rgb:O.grid},line_color:{rgb:O.axis}},x=S(e.kind),y=e.kind.endsWith("-clustered"),T={...n,category_axis:{...l,...n.category_axis,...m&&s!==void 0&&s!==""?{title:s}:{}},value_axis:{...l,...n.value_axis,...m&&u!==void 0&&u!==""?{title:u}:{}},...x&&n.gap_width===void 0?{gap_width:CHART_BARS.gap}:{},...y&&n.series.length>1&&n.overlap===void 0?{overlap:CHART_BARS.overlap}:{},series:n.series.map((c,p)=>{const _=h||c.color!==void 0?c:{...c,color:g(p)};return e.smooth&&SMOOTHED.has(e.kind)?{..._,smooth:!0}:_}),...o!==void 0?{vary_by_categories:!0}:{},...h?{category_colors:n.categories.map((c,p)=>{const _=o?.[p%o.length];return _===void 0?g(o===void 0?p:0):{rgb:_}})}:{},...a===void 0?{}:{legend:a},font_size:CHART_TEXT.size,title_size:CHART_TEXT.title,font_color:{rgb:w}};return a===void 0&&delete T.legend,{chart:T,problems:r}}export function chartWords(e,t){if(e.alt!==void 0)return e.alt;const r=t?.series.map(n=>n.name).join(", ")??"",i=[e.title,r].filter(n=>n!==void 0&&n!=="");return i.length>0?i.join(": "):"Chart"}const E={ink:"#D4D3CF",grid:"#3A3936",axis:"#5C5B57"};export function docChartSvg(e,t={}){const r=docChart(e,t),{problems:i}=r;if(!r.chart)return{problems:i};const n=g=>({...g,gridline_color:{rgb:E.grid},line_color:{rgb:E.axis}}),a=t.dark===!0?{...r.chart,font_color:{rgb:E.ink},value_axis:n(r.chart.value_axis),category_axis:n(r.chart.category_axis)}:r.chart,{width:d,height:f}=chartFrame(e,t.room);return{svg:F(a,d,f,{colors:chartTheme(t.page,e.colors),paper:"none",edge:"none",...t.font===void 0?{}:{font:t.font},label:chartWords(e,a)}),problems:i}}
2
+ import{chartOfFile as R,chartSvg as S,isBar as F,isHierarchical as D,isRound as E,isScatter as y,variesOf as H}from"@allyhub/chart";import{colorsOfTheme as N}from"@allyhub/formats";import{hex as B}from"./color.js";import{CHART_PALETTE as M,PAPER as T,accentPalette as P,tint as $}from"./paper.js";import{COMPONENT_ASPECT as z,COMPONENT_WIDTH as L}from"./component.js";export{CHART_PALETTE}from"./paper.js";const q={gray:"#8B8A85",brown:"#9A6B4B",red:"#D6403A",orange:"#EB6834",yellow:"#EDA100",green:"#1BAF7A",blue:"#2A78D6",purple:"#8A5CD6",pink:"#E87BA4"},C=T.lead,O={grid:T.rule,axis:T.ruleMid};export const CHART_BARS={gap:80,overlap:-8},CHART_TEXT={size:10,title:13},chartColor=e=>{const t=B(e,q);return t===void 0?void 0:`#${t}`},CHART_SECOND_TONE=.55;export function chartTheme(e={},t=[]){if(e.theme!==void 0){const f={...N(e.theme)},i=e.accent===void 0?void 0:f[e.accent.trim()]??chartColor(e.accent);i!==void 0&&(f.accent1=i);const a=["accent1","accent2","accent3","accent4","accent5","accent6"];return t.slice(0,a.length).forEach((l,_)=>{const v=chartColor(l),x=a[_];v!==void 0&&x!==void 0&&(f[x]=v)}),{...f,dk1:C}}const[r=M[0],...s]=P(e.accent===void 0?void 0:chartColor(e.accent)),n=[r,r,...s];t.slice(0,n.length).forEach((f,i)=>{const a=chartColor(f);a!==void 0&&(n[i]=a)}),t.length<2&&(n[1]=$(n[0]??r,CHART_SECOND_TONE));const[u,c,g,o,d,h]=n;return{dk1:C,lt1:"#FFFFFF",dk2:"#37352F",lt2:"#EFEFED",accent1:u,accent2:c,accent3:g,accent4:o,accent5:d,accent6:h,hlink:u,folHlink:u}}export const SMOOTHED=new Set(["line","line-markers","scatter-lines"]),ROUND_FRAME={width:560,aspect:.6};export function chartFrame(e,t=L){const r=e.kind!==void 0&&E(e.kind),s=e.width??(r?Math.min(t,ROUND_FRAME.width):t);return{width:s,height:e.height??Math.round(s*(r?ROUND_FRAME.aspect:z))}}function W(e){const t=e.trim().replace(/,/gu,"");if(t==="")return null;const r=Number(t);return Number.isFinite(r)?r:void 0}function j(e,t){const r=y(e.kind),s=e.labels,n=e.min!==void 0||e.max!==void 0||e.format!==void 0?{...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.format===void 0?{}:{format:e.format}}:void 0,u={...s===void 0?{}:{labels:{...s.includes("value")?{value:!0}:{},...s.includes("percentage")?{percentage:!0}:{},...s.includes("category")?{category:!0}:{},...s.includes("series")?{series:!0}:{},...e.format===void 0?{}:{format:e.format}}},...n===void 0?{}:{value_axis:n},...E(e.kind)?{vary_by_categories:!0}:{},...e.totals===void 0?{}:{totals:e.totals},...e.quartiles===void 0?{}:{quartiles:e.quartiles}};if(e.table===void 0)return e.data===void 0||e.categories===void 0?void 0:{type:e.kind,data:e.data,categories:e.categories,series:e.series??[],...u};const[c=[],...g]=e.table,o=Math.max(0,...e.table.map(i=>i.length)),d=(i,a)=>i[a]??"",h=i=>g.map((a,l)=>{const _=W(d(a,i));return _===void 0?(t.push(`row ${String(l+1)} of its table: "${d(a,i)}" under ${d(c,i)||`column ${String(i+1)}`} is not a number`),null):_});if(e.kind==="bubble"&&o>=3)return{type:e.kind,series:[{name:d(c,1)||"Series 1",x:h(0),values:h(1),sizes:h(2)}],...u};if(D(e.kind)&&o>=2)return{type:e.kind,categories:g.map(i=>Array.from({length:o-1},(a,l)=>d(i,l))),series:[{name:d(c,o-1)||"Series 1",values:h(o-1)}],...u};const f=Array.from({length:Math.max(0,o-1)},(i,a)=>{const l=a+1;return{name:d(c,l)||`Series ${String(l)}`,values:h(l),...r?{x:h(0)}:{}}});if(f.length!==0)return{type:e.kind,...r?{}:{categories:g.map(i=>d(i,0))},series:f,...u}}function I(e,t){if(e.legend!=="none")return e.legend!==void 0?e.legend:E(e.kind)?"right":t.series.length>1?"top":void 0}export function docChart(e,t={}){const r=[],s=j(e,r);if(!s)return{problems:[...r,"it has no numbers to draw"]};const n=R(s,{title:e.title,base:t.base??"",rows:m=>{const p=t.data?.(m);if(p===void 0)throw new Error("there is no such file or table");return p},problem:m=>r.push(m)});if(!n)return{problems:r};const u=I(e,n),c=chartTheme(t.page,e.colors),g=[c.accent1,c.accent2,c.accent3,c.accent4,c.accent5,c.accent6],o=m=>({rgb:g[m%g.length]??"#000000"}),d=n.series.length===1&&!E(e.kind)&&(e.colors?.length??0)>1?(e.colors??[]).map(chartColor):void 0,h=d!==void 0||H(n),f=y(e.kind),i=e.table===void 0?e.categories:e.table[0]?.[0],a=n.series.length===1?n.series[0]?.name:void 0,l={gridline_color:{rgb:O.grid},line_color:{rgb:O.axis}},_=F(e.kind),v=e.kind.endsWith("-clustered"),x={...n,category_axis:{...l,...n.category_axis,...f&&i!==void 0&&i!==""?{title:i}:{}},value_axis:{...l,...n.value_axis,...f&&a!==void 0&&a!==""?{title:a}:{}},..._&&n.gap_width===void 0?{gap_width:CHART_BARS.gap}:{},...v&&n.series.length>1&&n.overlap===void 0?{overlap:CHART_BARS.overlap}:{},series:n.series.map((m,p)=>{const A=h||m.color!==void 0?m:{...m,color:o(p)};return e.smooth&&SMOOTHED.has(e.kind)?{...A,smooth:!0}:A}),...d!==void 0?{vary_by_categories:!0}:{},...h?{category_colors:n.categories.map((m,p)=>{const A=d?.[p%d.length];return A===void 0?o(d===void 0?p:0):{rgb:A}})}:{},...u===void 0?{}:{legend:u},font_size:CHART_TEXT.size,title_size:CHART_TEXT.title,font_color:{rgb:C}};return u===void 0&&delete x.legend,{chart:x,problems:r}}export function chartWords(e,t){if(e.alt!==void 0)return e.alt;const r=t?.series.map(n=>n.name).join(", ")??"",s=[e.title,r].filter(n=>n!==void 0&&n!=="");return s.length>0?s.join(": "):"Chart"}const w={ink:"#D4D3CF",grid:"#3A3936",axis:"#5C5B57"};export function docChartSvg(e,t={}){const r=docChart(e,t),{problems:s}=r;if(!r.chart)return{problems:s};const n=o=>({...o,gridline_color:{rgb:w.grid},line_color:{rgb:w.axis}}),u=t.dark===!0?{...r.chart,font_color:{rgb:w.ink},value_axis:n(r.chart.value_axis),category_axis:n(r.chart.category_axis)}:r.chart,{width:c,height:g}=chartFrame(e,t.room);return{svg:S(u,c,g,{colors:chartTheme(t.page,e.colors),paper:"none",edge:"none",...t.font===void 0?{}:{font:t.font},label:chartWords(e,u)}),problems:s}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export const TEXT_COLORS={gray:"#9b9a97",brown:"#64473a",red:"#e03e3e",orange:"#d9730d",yellow:"#dfab01",green:"#4d6461",blue:"#0b6e99",purple:"#6940a5",pink:"#ad1a72"},BACKGROUNDS={gray:"#ebeced",brown:"#e9e5e3",red:"#fbe4e4",orange:"#f6e9d9",yellow:"#fbf3db",green:"#ddedea",blue:"#ddebf1",purple:"#eae4f2",pink:"#f4dfeb"};function p(r,f,e){const o=f*Math.min(e,1-e),n=t=>{const a=(t+r/30)%12;return 255*(e-o*Math.max(-1,Math.min(a-3,9-a,1)))};return[n(0),n(8),n(4)]}export function hex(r,f){if(r===void 0)return;const e=(f[r]??r).trim().toLowerCase(),o=/^#([0-9a-f])([0-9a-f])([0-9a-f])f?$/.exec(e);if(o)return o.slice(1).map(s=>s+s).join("").toUpperCase();const n=/^#([0-9a-f]{6})([0-9a-f]{2})?$/.exec(e);if(n?.[1]!==void 0)return n[1].toUpperCase();const t=/^(rgb|hsl)a?\(([^)]*)\)$/.exec(e),[a=NaN,d=NaN,i=NaN]=(t?.[2]??"").split(/[\s,/]+/).filter(Boolean).map(Number.parseFloat);return!t||[a,d,i].some(Number.isNaN)?void 0:(t[1]==="rgb"?[a,d,i]:p(a,d/100,i/100)).map(s=>Math.round(Math.min(255,Math.max(0,s))).toString(16).padStart(2,"0")).join("").toUpperCase()}
2
+ import{NAMED_COLORS as m,namedColorColors as p}from"@allyhub/formats";export const TEXT_COLORS=Object.fromEntries(m.map(t=>[t,p(t).mark])),BACKGROUNDS=Object.fromEntries(m.map(t=>[t,p(t).tint]));function u(t,i,e){const a=i*Math.min(e,1-e),n=o=>{const r=(o+t/30)%12;return 255*(e-a*Math.max(-1,Math.min(r-3,9-r,1)))};return[n(0),n(8),n(4)]}export function hex(t,i){if(t===void 0)return;const e=(i[t]??t).trim().toLowerCase(),a=/^#([0-9a-f])([0-9a-f])([0-9a-f])f?$/.exec(e);if(a)return a.slice(1).map(s=>s+s).join("").toUpperCase();const n=/^#([0-9a-f]{6})([0-9a-f]{2})?$/.exec(e);if(n?.[1]!==void 0)return n[1].toUpperCase();const o=/^(rgb|hsl)a?\(([^)]*)\)$/.exec(e),[r=NaN,c=NaN,f=NaN]=(o?.[2]??"").split(/[\s,/]+/).filter(Boolean).map(Number.parseFloat);return!o||[r,c,f].some(Number.isNaN)?void 0:(o[1]==="rgb"?[r,c,f]:u(r,c/100,f/100)).map(s=>Math.round(Math.min(255,Math.max(0,s))).toString(16).padStart(2,"0")).join("").toUpperCase()}
@@ -0,0 +1,12 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{strFromU8 as bn,unzipSync as kn}from"fflate";import{withinZip as Sn}from"@allyhub/formats";import{Package as On,applyMce as vn,NAMESPACES as Ke,attrOf as f,parseXml as Pn}from"@allyhub/ooxml";import{FORMAT_KEYS as xn}from"./model.js";import{CHINESE_SIZES as Mn,PAGE_FONTS as Cn,PAPERS as En,WATERMARK_COLOR as Nn}from"./page.js";import{BUILT_IN_STYLES as Tn,NORMAL as Ce,TABLE_GRID as en,TITLE_STYLE as Le,headingStyle as nn,pickProps as $n}from"./styles.js";import{alignsOf as In,columnLetters as Rn}from"./merges.js";import{imageSize as An}from"image-size";import{laidWidths as Ln}from"./table.js";import{chartFrame as Fn}from"./chart.js";import{PAPER as jn}from"./paper.js";import{DRAWN_CODE as _e}from"./math.js";import{headingAnchors as _n}from"./html.js";import{drawShapes as zn}from"./shapes.js";import{ommlParaToLatex as tn,ommlToLatex as Dn}from"./omml.js";import{LIST_NUMBERING as Un,NUMBER_FORMATS as Bn}from"./numbering.js";import{frontMatterOf as Hn,writeBlocks as Jn}from"./write.js";export const GATHER_DEFAULT=3;const ze=1440/25.4,ve=9525,Wn=new Map([["normal",Ce],["title",Le],["quote","Quote"],["intense quote","Quote"],["list paragraph","List Paragraph"],["caption","Caption"],...[1,2,3,4,5,6].map(d=>[`heading ${String(d)}`,nn(d)])]),sn=new Map(Object.entries(Bn).map(([d,t])=>[t,d])),on=new Map([["calibri","sans"],["calibri light","sans"],["aptos","sans"],["cambria","serif"],["times new roman","times"],["courier new","mono"],["consolas","mono"],["simsun","song"],["宋体","song"],["simhei","hei"],["黑体","hei"],["fangsong","fangsong"],["仿宋","fangsong"],["仿宋_gb2312","fangsong"],["kaiti","kai"],["楷体","kai"],["楷体_gb2312","kai"],["方正小标宋简体","xiaobiaosong"]]),Gn={yellow:"yellow",green:"green",cyan:"blue",magenta:"pink",blue:"blue",red:"red",darkBlue:"blue",darkCyan:"blue",darkGreen:"green",darkMagenta:"purple",darkRed:"red",darkYellow:"brown",darkGray:"gray",lightGray:"gray",black:"gray"},Z=(d,t)=>d?.children.filter(n=>n.key===t)??[],r=(d,t)=>d?.children.find(n=>n.key===t),A=d=>d===void 0?void 0:f(d,"w:val"),Pe=d=>{if(d===void 0)return;const t=A(d);return t===void 0||!["0","false","off","none"].includes(t)},De=d=>{const t=Y(d,"asvg:svgBlip");return t===void 0?void 0:f(t,"r:embed")},ae=(d,t)=>d===void 0?void 0:f(d,t),T=d=>{if(d===void 0)return;const t=Number(d);return Number.isFinite(t)?t:void 0};class rn{pkg;doc;styles=new Map;numbering=new Map;footnotes=new Map;lost=new Map;files=new Map;theme={};used=new Set;normalSize=11;pictures=0;saved=new Map;made=new Map;numberedLists=new Map;tableStyles=new Map;tableStyle(t){const n=this.styles.get(t);if(n?.type==="table")return n.name===en?en:(this.tableStyles.has(n.name)||this.tableStyles.set(n.name,{type:"table",...this.tableProps(n)}),n.name)}tableProps(t){const n=[];let e=t;for(;e!==void 0&&!n.includes(e);)n.push(e),e=e.basedOn===void 0?void 0:this.styles.get(e.basedOn);const i={},s=(o,a)=>{const c=o===void 0?void 0:f(o,a);return c===void 0||c==="auto"||!/^[0-9a-f]{6}$/iu.test(c)?void 0:`#${c.toUpperCase()}`};for(const o of n.reverse()){const a=r(r(o.el,"w:tblPr"),"w:tblBorders");if(a!==void 0){const c=g=>{const m=ae(r(a,g),"w:val");return m!==void 0&&!["nil","none"].includes(m)};i.borders=c("w:insideV")?"all":c("w:insideH")?"rows":["w:top","w:bottom","w:left","w:right"].some(c)?"outside":"none";const l=["w:top","w:insideH","w:bottom","w:left"].map(g=>s(r(a,g),"w:color")).find(g=>g!==void 0);l!==void 0&&(i.borderColor=l)}for(const c of Z(o.el,"w:tblStylePr")){const l=f(c,"w:type"),g=s(r(r(c,"w:tcPr"),"w:shd"),"w:fill");if(l==="firstRow"){g!==void 0&&(i.headBg=g);const m=r(c,"w:rPr"),x=Pe(r(m,"w:b"));x!==void 0&&(i.headBold=x);const p=s(r(m,"w:color"),"w:val");p!==void 0&&(i.headColor=p)}else l==="band1Horz"&&g!==void 0&&(i.banded=g)}}return i}notes=new Map;toc=!1;openComments=new Set;options;constructor(t,n,e){if(this.options=n,this.pkg=new On(kn(t,{filter:Sn(e)})),this.doc=this.pkg.relOfType("","officeDocument")?.target??"word/document.xml",this.pkg.parts[this.doc]===void 0)throw new Error(`it has no document (${this.doc})`)}xml(t,{mce:n=!0}={}){if(t===void 0)return;const e=this.pkg.parts[t];if(e===void 0)return;const i=Pn(bn(e));return n&&vn(i,{understood:[Ke.wps,Ke.wpg]}),i}partOf(t){return this.pkg.relOfType(this.doc,t)?.target}commentIds;commentId(t){if(this.commentIds===void 0){this.commentIds=new Map;const s=this.partOf("comments");for(const o of Z(s===void 0?void 0:this.xml(s,{mce:!1}),"w:comment")){const a=f(o,"w:id")??"";this.commentIds.has(a)||this.commentIds.set(a,`c${String(this.commentIds.size)}`)}}const n=t??"",e=this.commentIds.get(n);if(e!==void 0)return e;const i=`c${String(this.commentIds.size)}`;return this.commentIds.set(n,i),i}lose(t,n=1){this.lost.set(t,(this.lost.get(t)??0)+n)}readStyles(){const t=this.xml(this.partOf("styles"));for(const o of Z(t,"w:style")){const a=f(o,"w:styleId")??"",c=A(r(o,"w:name"))??a,l=f(o,"w:type")??"paragraph",g=A(r(o,"w:basedOn")),m=A(r(o,"w:next")),x=r(o,"w:pPr"),p=r(o,"w:rPr");this.styles.set(a,{id:a,name:Wn.get(c.toLowerCase())??c,type:l,...g===void 0?{}:{basedOn:g},...m===void 0?{}:{next:m},...x===void 0?{}:{pPr:x},...p===void 0?{}:{rPr:p},el:o})}const n=r(t,"w:docDefaults"),e=T(A(r(r(r(n,"w:rPrDefault"),"w:rPr"),"w:sz"))),i=[...this.styles.values()].find(o=>o.name===Ce),s=T(A(r(i?.rPr,"w:sz")));this.normalSize=(s??e??22)/2,this.defaults=n}defaults;readTheme(){const t=this.xml(this.partOf("theme")),n=r(r(t,"a:themeElements"),"a:fontScheme"),e=a=>ae(r(r(n,a),"a:latin"),"typeface"),i=n===void 0?void 0:e("a:majorFont"),s=n===void 0?void 0:e("a:minorFont");i!==void 0&&(this.theme.major=i),s!==void 0&&(this.theme.minor=s);const o=r(r(t,"a:themeElements"),"a:clrScheme");for(const a of o?.children??[]){const c=a.key.replace(/^a:/u,""),l=r(a,"a:srgbClr"),g=r(a,"a:sysClr"),m=l!==void 0?f(l,"val"):g!==void 0?f(g,"lastClr"):void 0;m!==void 0&&this.colors.set(c,m)}}styledParagraph(t){const n=[...this.styles.entries()].find(([,o])=>o.name==="Normal"&&o.type==="paragraph")?.[0],e=[],i=new Set;for(let o=t??n;o!==void 0&&!i.has(o);o=this.styles.get(o)?.basedOn){i.add(o);const a=this.styles.get(o);a!==void 0&&e.unshift(a)}const s={...this.paragraphProps(r(r(this.defaults,"w:pPrDefault"),"w:pPr"))};for(const o of e)Object.assign(s,this.paragraphProps(o.pPr));return s}styledRun(t){const n=[...this.styles.entries()].find(([,a])=>a.name==="Normal"&&a.type==="paragraph")?.[0],e=[],i=new Set;for(let a=t??n;a!==void 0&&!i.has(a);a=this.styles.get(a)?.basedOn)i.add(a),e.unshift(this.styles.get(a)?.rPr);e.unshift(r(r(this.defaults,"w:rPrDefault"),"w:rPr"));const s={},o=new Set;for(const a of e){Object.assign(s,this.runProps(a));const c=r(a,"w:rFonts");for(const l of["w:ascii","w:hAnsi","w:eastAsia","w:cs"]){const g=c===void 0?void 0:f(c,l);g!==void 0&&o.add(g)}}return{...typeof s.font=="string"?{font:s.font}:{},...s.color===void 0?{}:{color:s.color},faces:o}}colors=new Map;watermark;keep(t,n){let e=++this.pictures,i=`${this.options.name}-${String(e)}.${n}`;for(;this.options.taken?.(i)===!0||this.files.has(i);)e=++this.pictures,i=`${this.options.name}-${String(e)}.${n}`;return this.files.set(i,t),i}pictureBytes(t,n){const e=this.pkg.rel(n,t)?.target;if(e===void 0)return;const i=this.pkg.bytes(e),s=(e.split(".").pop()??"").toLowerCase(),o=s==="jpg"||s==="jpeg"?"image/jpeg":s==="svg"?"image/svg+xml":["png","gif","webp","bmp"].includes(s)?`image/${s}`:void 0;return i===void 0||o===void 0?void 0:{bytes:i,type:o}}readNumbering(){const t=this.xml(this.partOf("numbering")),n=new Map;for(const e of Z(t,"w:abstractNum")){const i=new Map;for(const s of Z(e,"w:lvl")){const o=A(r(s,"w:numFmt"))??"decimal";i.set(T(f(s,"w:ilvl"))??0,{bullet:o==="bullet"||o==="none",start:T(A(r(s,"w:start")))??1,format:o,text:A(r(s,"w:lvlText"))??"",legal:Pe(r(s,"w:isLgl"))===!0})}n.set(f(e,"w:abstractNumId")??"",i)}for(const e of Z(t,"w:num")){const i=n.get(A(r(e,"w:abstractNumId"))??"");i&&this.numbering.set(f(e,"w:numId")??"",i)}}readNotes(){for(const[t,n]of[["footnotes","w:footnote"],["endnotes","w:endnote"]]){const e=this.xml(this.partOf(t));for(const i of Z(e,n)){const s=f(i,"w:type");s==="separator"||s==="continuationSeparator"||this.footnotes.set(`${t==="endnotes"?"e":""}${f(i,"w:id")??""}`,Z(i,"w:p"))}}}styleName(t){if(t!==void 0)return this.styles.get(t)?.name}headingLevel(t){const n=new Set;let e=t;for(;e!==void 0&&!n.has(e);){n.add(e);const i=this.styles.get(e);if(i===void 0)return;const s=/^Heading ([1-9])$/u.exec(i.name);if(s)return Number(s[1]);const o=T(A(r(i.pPr,"w:outlineLvl")));if(o!==void 0&&o>=0&&o<9)return o+1;e=i.basedOn}}fontOf(t){if(t===void 0)return;const n=c=>{const l=f(t,c);return l===void 0?void 0:l.startsWith("major")?this.theme.major:this.theme.minor},e=f(t,"w:ascii")??f(t,"w:hAnsi")??n("w:asciiTheme"),i=f(t,"w:eastAsia")??n("w:eastAsiaTheme"),s=c=>c?.split(";")[0],o=c=>c===void 0?void 0:on.get(c.toLowerCase()),a=[s(e),s(i)].find(c=>c!==void 0&&c.trim()!=="");return o(s(e))??o(s(i))??a?.trim()}runProps(t){if(t===void 0)return{};const n={},e=this.fontOf(r(t,"w:rFonts"));e!==void 0&&(n.font=e);const i=T(A(r(t,"w:sz")));i!==void 0&&(n.size=Yn(i/2));const s=D=>Pe(r(t,D)),o=s("w:b");o!==void 0&&(n.bold=o);const a=s("w:i");a!==void 0&&(n.italic=a);const c=r(t,"w:u");c!==void 0&&(n.underline=A(c)!=="none");const l=s("w:strike")??s("w:dstrike");l!==void 0&&(n.strike=l);const g=s("w:caps");g!==void 0&&(n.caps=g);const m=s("w:smallCaps");m!==void 0&&(n.smallCaps=m);const x=A(r(t,"w:color"));x!==void 0&&x!=="auto"&&/^[0-9a-f]{6}$/iu.test(x)&&(n.color=`#${x.toUpperCase()}`);const p=A(r(t,"w:highlight")),k=ae(r(t,"w:shd"),"w:fill");p!==void 0&&p!=="none"?n.background=Gn[p]??p:k!==void 0&&k!=="auto"&&/^[0-9a-f]{6}$/iu.test(k)&&(n.background=`#${k.toUpperCase()}`);const y=T(A(r(t,"w:spacing")));return y!==void 0&&y!==0&&(n.letterSpacing=y/20),n}paragraphProps(t){if(t===void 0)return{};const n={},e=A(r(t,"w:jc"));e==="center"?n.align="center":e==="right"||e==="end"?n.align="right":e==="both"||e==="distribute"?n.align="justify":(e==="left"||e==="start")&&(n.align="left");const i=m=>Math.round(m/(this.normalSize*20)*100)/100,s=r(t,"w:ind");if(s!==void 0){const m=T(f(s,"w:left")??f(s,"w:start")),x=T(f(s,"w:right")??f(s,"w:end")),p=T(f(s,"w:firstLine")),k=T(f(s,"w:hanging")),y=T(f(s,"w:firstLineChars"));m!==void 0&&m!==0&&(n.indent=i(m)),x!==void 0&&x!==0&&(n.indentRight=i(x)),y!==void 0&&y!==0?n.firstLine=y/100:p!==void 0&&p!==0?n.firstLine=i(p):k!==void 0&&k!==0&&(n.firstLine=-i(k))}const o=r(t,"w:spacing");if(o!==void 0){const m=T(f(o,"w:before")),x=T(f(o,"w:after")),p=T(f(o,"w:line")),k=f(o,"w:lineRule")??"auto";m!==void 0&&(n.spaceBefore=m/20),x!==void 0&&(n.spaceAfter=x/20),p!==void 0&&p>0&&(n.lineHeight=k==="auto"?Math.round(p/240*100)/100:`${String(p/20)}pt`)}const a=m=>Pe(r(t,m)),c=a("w:keepNext");c!==void 0&&(n.keepNext=c);const l=a("w:keepLines");l!==void 0&&(n.keepLines=l);const g=a("w:pageBreakBefore");return g!==void 0&&(n.pageBreakBefore=g),n}revisionOf(t){const n=f(t,"w:author")?.trim()??"",e=n===""?"Unknown":n,i=f(t,"w:date"),s=i!==void 0&&!Number.isNaN(Date.parse(i)),o=i?.replace(/\.0+Z$/u,"Z"),a=this.moves.get(t);return{author:e,...s&&o!==void 0?{date:o}:{},...a===void 0?{}:{move:a}}}moves=new WeakMap;nameMoves(t){const n=new Map,e={from:void 0,to:void 0},i=[...t.children].reverse();for(let s=i.pop();s!==void 0;s=i.pop()){const o=s.key==="w:moveFromRangeStart"||s.key==="w:moveFromRangeEnd"?"from":s.key==="w:moveToRangeStart"||s.key==="w:moveToRangeEnd"?"to":void 0;if(o!==void 0){const a=f(s,"w:id")??"";if(s.key.endsWith("Start")){const c=f(s,"w:name")??`move${a}`;n.set(`${o}:${a}`,c),e[o]=c}else n.has(`${o}:${a}`)&&(n.delete(`${o}:${a}`),e[o]=void 0);continue}s.key==="w:moveFrom"&&e.from!==void 0&&this.moves.set(s,e.from),s.key==="w:moveTo"&&e.to!==void 0&&this.moves.set(s,e.to);for(let a=s.children.length-1;a>=0;a--){const c=s.children[a];c!==void 0&&i.push(c)}}}picture(t,n){const e=this.pkg.rel(n,t)?.target;if(e===void 0)return;const i=this.saved.get(e);if(i!==void 0)return i;const s=this.pkg.bytes(e),o=(e.split(".").pop()??"").toLowerCase();if(s===void 0)return;if(!["png","jpg","jpeg","gif","svg","webp","bmp"].includes(o)){this.lose(`a picture as ${o.toUpperCase()}, which a page cannot show`);return}let a=++this.pictures,c=`${this.options.name}-${String(a)}.${o}`;for(;this.options.taken?.(c)===!0||this.files.has(c);)a=++this.pictures,c=`${this.options.name}-${String(a)}.${o}`;return this.files.set(c,s),this.saved.set(e,c),c}}function Yn(d){const t=Object.entries(Mn).find(([,n])=>n===d)?.[0];return d===12||d===11||d===10.5||t===void 0?d:t}const Vn=/^(Frame Contents|Table Contents|Table Heading)$/u,qn=/^(.+ Char|line number|Bibliography|Default Paragraph Font|No List|Table Normal|Normal Table|Hyperlink|FollowedHyperlink|(foot|end)note (reference|text)|annotation (reference|text|subject)|Balloon Text|header|footer|toc \d|TOC Heading|caption|List Paragraph)$/iu;export function templateStyles(d,t){const n=new rn(d,{name:"template"},t);n.readStyles(),n.readTheme(),n.readNumbering();for(const[e,i]of n.styles)qn.test(i.name)||(i.type==="table"?n.tableStyle(e):(i.type==="paragraph"||i.type==="character")&&n.used.add(i.name));return{styles:ln(n),lost:[...n.lost].map(([e,i])=>i===1?e:`${e} (${String(i)})`)}}export function importDocx(d,t,n){const e=new rn(d,t,n);e.readStyles(),e.readTheme(),e.readNumbering(),e.readNotes();const i=e.xml(e.doc),s=r(i,"w:body");if(s===void 0)throw new Error("its document has no body");e.nameMoves(s);const o=[];let a;const c=[],l=new Map,g=new Map,m=new Set,x=(u,h,w,v,N)=>{const F=(b,O,E)=>{if(b===""||a!==void 0&&!a.result||a?.toc===!0)return;const C=[a,...c].find(I=>I?.run!==void 0);if(C?.run!==void 0){C.run.text+=b;return}const P=w.at(-1);if(P!==void 0&&P.note===void 0&&P.field===void 0&&P.href===E&&JSON.stringify(P.styles)===JSON.stringify(O)){P.text+=b;return}w.push({text:b,styles:{...O},...E===void 0?{}:{href:E}})};for(const b of u)switch(b.key){case"w:r":{const O={...dn(e,r(b,"w:rPr")),...e.openComments.size>0?{comments:[...e.openComments]}:{}};h.href!==void 0&&(delete O.color,delete O.underline);const E={...h.styles,...O};for(const C of b.children)switch(C.key){case"w:t":case"w:delText":F(C.text,E,h.href);break;case"w:tab":F(" ",E,h.href);break;case"w:br":case"w:cr":f(C,"w:type")==="page"?v.push({type:"pagebreak"}):F(`
3
+ `,E,h.href);break;case"w:noBreakHyphen":F("‑",E,h.href);break;case"w:softHyphen":F("­",E,h.href);break;case"w:sym":{const P=f(C,"w:char");P!==void 0&&F(String.fromCodePoint(parseInt(P,16)&65535),E,h.href);break}case"w:footnoteReference":case"w:endnoteReference":{const P=`${C.key==="w:endnoteReference"?"e":""}${f(C,"w:id")??""}`,I=`n${String(e.notes.size+1)}`;e.notes.set(P,e.notes.get(P)??I),w.push({text:e.notes.get(P)??I,styles:{},note:e.notes.get(P)??I});break}case"w:drawing":case"w:pict":p(C,v,N);break;case"w:fldChar":{const P=f(C,"w:fldCharType");if(P==="begin")c.push(a),a={instr:"",result:!1,toc:!1};else if(P==="separate"&&a!==void 0){if(a.result=!0,a.toc=/^\s*TOC\b/u.test(a.instr),a.toc&&!e.toc){e.toc=!0;const Q=Number(/\\o\s+"\d+-(\d+)"/u.exec(a.instr)?.[1]),z=Math.min(Q,6);v.push({type:"toc",...Number.isInteger(z)&&z>=1&&z!==3?{levels:z}:{}})}const I=Ue(a.instr);I!==void 0&&!c.some(Q=>Q?.run)&&(a.run={text:"",styles:{...E},field:I},w.push(a.run))}else if(P==="end"){const I=a===void 0||a.result?void 0:Ue(a.instr);I!==void 0&&!c.some(Q=>Q?.run)&&w.push({text:"",styles:{...E},field:I}),a=c.pop()}break}case"w:instrText":a!==void 0&&(a.instr+=C.text);break;case"w:rPr":case"w:lastRenderedPageBreak":break;case"w:object":e.lose("an embedded object (OLE)");break;default:break}break}case"w:hyperlink":{const O=f(b,"r:id"),E=f(b,"w:anchor"),P=(O===void 0?void 0:e.pkg.rel(N,O)?.target)??(E===void 0?void 0:`#${E}`);x(b.children,{...h,...P===void 0?{}:{href:P}},w,v,N);break}case"w:ins":case"w:moveTo":x(b.children,{...h,styles:{...h.styles,inserted:e.revisionOf(b)}},w,v,N);break;case"w:del":case"w:moveFrom":x(b.children,{...h,styles:{...h.styles,deleted:e.revisionOf(b)}},w,v,N);break;case"w:fldSimple":{const O=f(b,"w:instr")??"",E=Ue(O);if(/^\s*TOC\b/u.test(O))e.toc||(e.toc=!0,v.push({type:"toc"}));else if(E!==void 0&&a===void 0){const C=[];x(b.children,h,C,v,N),w.push({text:C.map(P=>P.text).join(""),styles:{...h.styles,...C[0]?.styles??{}},field:E})}else x(b.children,h,w,v,N);break}case"w:smartTag":case"w:customXml":case"w:dir":case"w:bdo":x(b.children,h,w,v,N);break;case"w:sdt":x(r(b,"w:sdtContent")?.children??[],h,w,v,N);break;case"m:oMathPara":v.push({type:"code",language:_e.math,code:tn(b)});break;case"m:oMath":{const O={type:"code",language:_e.math,code:Dn(b)};m.add(O),v.push(O);break}case"w:commentRangeStart":e.openComments.add(e.commentId(f(b,"w:id")));break;case"w:commentRangeEnd":e.openComments.delete(e.commentId(f(b,"w:id")));break;case"w:pPr":case"w:bookmarkStart":case"w:bookmarkEnd":case"w:proofErr":case"w:permStart":case"w:permEnd":break;default:break}},p=(u,h,w)=>{const v=Y(u,"wp:anchor")!==void 0,N=Y(u,"a:blip")??Y(u,"v:imagedata"),F=N===void 0?void 0:De(N)??f(N,"r:embed")??f(N,"r:id"),b=Y(u,"c:chart");if(b!==void 0){const ie=e.pkg.rel(w,f(b,"r:id"))?.target,W=ie===void 0?void 0:et(e,ie);if(W===void 0||typeof W=="string"){e.lose(W??"a chart, left out (its numbers are in the file's workbook)");return}const R=Y(u,"wp:extent"),se=T(R===void 0?void 0:f(R,"cx")),re=T(R===void 0?void 0:f(R,"cy")),he=Y(u,"wp:docPr"),G=he===void 0?void 0:f(he,"descr"),Se=[W.title,W.table?.[0]?.slice(1).join(", ")].filter(Me=>Me!==void 0&&Me!==""),M=Se.length>0?Se.join(": "):"Chart",X=G===void 0||G.trim()===M?void 0:G,de=se===void 0?void 0:Math.round(se/ve),ye=re===void 0?void 0:Math.round(re/ve),ce=Fn(W,y()),xe=de!==void 0&&ye!==void 0&&Math.abs(de-ce.width)<=1&&Math.abs(ye-ce.height)<=1;h.push({...W,...de===void 0||xe?{}:{width:de},...ye===void 0||xe?{}:{height:ye},...X===void 0||X.trim()===""?{}:{alt:X.replace(/\s+/gu," ").trim()}});return}const O=Y(u,"wpg:wgp")!==void 0,E=Y(u,"wps:wsp")!==void 0&&Y(u,"w:txbxContent")===void 0;let C;if(O||E){const ie=zn(u,{scheme:W=>e.colors.get(W),picture:W=>e.pictureBytes(W,w),textSize:e.normalSize,lose:W=>{e.lose(W)}});if(ie===void 0){e.lose(O?"a group of shapes, left out":"a shape, left out");return}C=e.keep(new TextEncoder().encode(ie.svg),"svg")}const P=C===void 0?Y(u,"w:txbxContent"):void 0;if(P===void 0&&F===void 0&&C===void 0)return;const I=Y(u,"wp:anchor"),Q=I!==void 0&&["wp:wrapSquare","wp:wrapTight","wp:wrapThrough"].some(ie=>r(I,ie)!==void 0),z=I!==void 0&&!Q&&(r(I,"wp:wrapNone")!==void 0||f(I,"behindDoc")==="1")?k(I):void 0;let ee;if(I!==void 0&&Q){const ie=r(I,"wp:positionH"),W=r(ie,"wp:align")?.text.trim(),R=T(r(ie,"wp:posOffset")?.text.trim());ee=W==="right"||W==="outside"?"right":W==="left"||W==="inside"?"left":R!==void 0&&R>27e5?"right":"left"}else v&&z===void 0&&e.lose(P===void 0?"a picture in front of, behind or between the words, set in its line":"a text box in front of, behind or between the words, set in its line");const ne=Y(u,"wp:extent"),U=T(ne===void 0?void 0:f(ne,"cx"));if(P!==void 0){const ie=D(P.children,w),W=U===void 0?void 0:Math.round(U/ve),R=ee===void 0&&z===void 0&&W!==void 0&&W>=y()*.95;h.push({type:"textbox",...ee===void 0?{}:{float:ee},...z,...W===void 0||W<1||R?{}:{width:W},...ie.length>0?{children:ie}:{}});return}const le=C??(F===void 0?void 0:e.picture(F,w));if(le===void 0)return;const j=Y(u,"wp:docPr"),ge=(j===void 0?void 0:f(j,"descr")??f(j,"title"))?.replace(/\s+/gu," ").trim();h.push({type:"image",src:`./${le}`,...ge===void 0||ge===""?{}:{alt:ge},...U===void 0||st(e,le,Math.round(U/ve),y())?{}:{width:Math.max(1,Math.round(U/ve))},...ee===void 0?{}:{float:ee},...z})},k=u=>{const h=r(s,"w:sectPr"),w=r(h,"w:pgMar"),v=te=>Math.abs(T(ae(w,te))??1440)/15,N=(T(ae(r(h,"w:pgSz"),"w:w"))??12240)/15,F=r(u,"wp:extent"),b=(T(ae(F,"cx"))??0)/ve,O=y(),E=r(u,"wp:positionH"),C=ae(E,"relativeFrom"),P=r(E,"wp:align")?.text.trim(),I=(T(r(E,"wp:posOffset")?.text.trim())??0)/ve,Q=C==="page"?N:O,z=C==="page"?0:v("w:left"),ee=P==="center"?z+(Q-b)/2:P==="right"||P==="outside"?z+Q-b:P==="left"||P==="inside"?z:z+I,ne=r(u,"wp:positionV"),U=ae(ne,"relativeFrom"),le=T(r(ne,"wp:posOffset")?.text.trim()),j=(U==="paragraph"||U==="line")&&r(ne,"wp:align")===void 0;return j||e.lose("a picture over or under the words placed down the page, not from its paragraph: set at its paragraph's top"),{wrap:f(u,"behindDoc")==="1"?"behind":"front",x:Math.round(ee-v("w:left")),y:j&&le!==void 0?Math.round(le/ve):0}},y=()=>{const u=r(s,"w:sectPr"),h=T(ae(r(u,"w:pgSz"),"w:w"))??12240,w=r(u,"w:pgMar"),v=N=>Math.abs(T(ae(w,N))??1440);return(h-v("w:left")-v("w:right"))/15},D=(u,h)=>{const w=[];for(const v of u)v.key==="w:p"?w.push(..._(v,h)):v.key==="w:tbl"?w.push({block:H(v,h)}):v.key==="w:sdt"&&w.push(...D(r(v,"w:sdtContent")?.children??[],h).map(N=>({block:N})));return un(w,e)},_=(u,h)=>{const w=r(u,"w:pPr"),v=A(r(w,"w:pStyle")),N=r(w,"w:rPr"),F=r(N,"w:ins")??r(N,"w:moveTo"),b=r(N,"w:del")??r(N,"w:moveFrom"),O=r(w,"w:pPrChange"),E=[],C=[],P=a?.toc===!0;x(u.children,{styles:{}},E,C,h);const I=e.styledRun(v);for(const M of E){const X=M.styles.font;X!==void 0&&(X===I.font||I.faces.has(X))&&delete M.styles.font,M.styles.color!==void 0&&M.styles.color.toUpperCase()===I.color?.toUpperCase()&&delete M.styles.color}if(P&&(a?.toc===!0||E.every(M=>M.text.trim()==="")))return C.map(M=>({block:M}));const Q=e.paragraphProps(w),z=e.styleName(v),ee=e.headingLevel(v),ne=r(w,"w:numPr")??Qn(e,v),U=A(r(ne,"w:numId")),le=T(A(r(ne,"w:ilvl")))??0;let j;const te=Fe(E);if(te.some(M=>M.text.trim()!==""))for(const M of C)m.has(M)&&e.lose("an equation in a line of words, set on a line of its own");if(ee!==void 0)ee>6&&e.lose("a heading below level 6, read as a heading 6"),j={type:"heading",level:Math.min(ee,6),content:te};else if(z===Le&&o.length===0)j={type:"heading",level:1,content:te};else if(z==="Quote")j={type:"quote",content:te};else if(U!==void 0&&U!=="0"&&e.numbering.has(U)){const M=e.numbering.get(U)?.get(le);M?.bullet===!1&&e.numberedLists.set(U,(e.numberedLists.get(U)??0)+1),j=M?.bullet===!1?{type:"numbered",content:te}:{type:"bullet",content:te}}else j={type:"paragraph",content:te};const ge=z===void 0||z===Ce||Vn.test(z)||ee!==void 0||z==="Quote"||z==="List Paragraph"||z===Le&&j.type==="heading"?void 0:z;ge!==void 0&&e.used.add(ge);const ie={align:"left",spaceBefore:0,spaceAfter:0,...e.styledParagraph(v)},R={...Object.fromEntries(Object.entries(Q).filter(([M,X])=>JSON.stringify(X)!==JSON.stringify(ie[M]))),...ge===void 0?{}:{style:ge}};if(Object.keys(R).length>0&&"content"in j&&(j={...j,look:R}),O!==void 0&&"content"in j){const M=r(O,"w:pPr"),X=e.styleName(A(r(M,"w:pStyle"))),de=X===void 0||X===Ce||X==="Quote"||X==="List Paragraph"||e.headingLevel(A(r(M,"w:pStyle")))!==void 0?void 0:X;j={...j,formatted:{...e.revisionOf(O),was:{...e.paragraphProps(M),...de===void 0?{}:{style:de}}}}}const se=M=>te.length>0&&te.every(X=>X.styles[M]!==void 0);if(F!==void 0&&se("inserted"))j={...an(j,"inserted"),revision:{kind:"inserted",...e.revisionOf(F)}};else if(b!==void 0&&se("deleted"))j={...an(j,"deleted"),revision:{kind:"deleted",...e.revisionOf(b)}};else if((F!==void 0||b!==void 0)&&["paragraph","heading","bullet","numbered","check"].includes(j.type)){const M=b??F;M!==void 0&&(j={...j,mark:{kind:b===void 0?"inserted":"deleted",...e.revisionOf(M)}})}const re=[],he=te.length===0,G=typeof Q.lineHeight=="string"&&parseFloat(Q.lineHeight)<2;if(he&&G&&C.length===0)return[];(!he||C.length===0)&&re.push({block:j,...U!==void 0&&j.type!=="paragraph"&&(j.type==="bullet"||j.type==="numbered")?{list:{numId:U,level:le}}:{}});const Se=M=>(M.type==="image"||M.type==="textbox")&&(M.float!==void 0||M.wrap!==void 0);re.unshift(...C.filter(Se).map(M=>({block:M})));for(const M of C.filter(X=>!Se(X)))re.push({block:M});return re},H=(u,h)=>{const w=Z(r(u,"w:tblGrid"),"w:gridCol").map(R=>T(f(R,"w:w"))??0),v={nested:!1},N={},F=[],b=new Map,O=[],E=[],C=Z(u,"w:tr").map((R,se)=>{let re=0;const he=r(r(R,"w:trPr"),"w:trHeight"),G=T(ae(he,"w:val"));E.push(G!==void 0&&G>0&&ae(he,"w:hRule")!=="auto"?Math.round(G/15):null);const Se=[];return O.push(Se),Z(R,"w:tc").flatMap(M=>{const X=r(M,"w:tcPr"),de=Math.max(1,T(A(r(X,"w:gridSpan")))??1),ye=r(X,"w:vMerge"),ce=re;re+=de;const xe=A(r(X,"w:vAlign")),Me=ye!==void 0&&A(ye)!=="restart"?b.get(ce):void 0,yn=Me!==void 0?O[Me.row]?.[Me.col]??"top":xe==="center"||xe==="both"?"center":xe==="bottom"?"bottom":"top";for(let B=ce;B<ce+de;B++)Se[B]=yn;const Re=()=>Array.from({length:de},()=>[]);if(ye!==void 0&&A(ye)!=="restart"){const B=b.get(ce);if(B!==void 0)return B.rows+=1,Re()}if(ye!==void 0&&A(ye)==="restart"){const B={row:se,col:ce,rows:1,cols:de};F.push(B);for(let Oe=ce;Oe<ce+de;Oe++)b.set(Oe,B)}else{for(let B=ce;B<ce+de;B++)b.delete(B);de>1&&F.push({row:se,col:ce,rows:1,cols:de})}if(M.children.some(B=>B.key==="w:tbl"||B.key==="w:p"&&(Y(B,"w:drawing")!==void 0||Y(B,"w:pict")!==void 0||Y(B,"m:oMathPara")!==void 0||r(r(B,"w:pPr"),"w:numPr")!==void 0))){const B=D(M.children,h).filter(me=>me.type!=="pagebreak"?!0:(e.lose("a page break in a table's cell, left out"),!1));if(B.every(me=>me.type==="paragraph"&&(me.children?.length??0)===0)){const me=[];for(const je of B)je.type==="paragraph"&&je.content.length>0&&(me.length>0&&me.push({text:`
4
+ `,styles:{}}),me.push(...je.content));return[me,...Re().slice(1)]}return N[`${Rn(ce)}${String(se+1)}`]=B,[[],...Re().slice(1)]}const Ae=[];return M.children.forEach(B=>{if(B.key==="w:tbl"&&(v.nested=!0),B.key!=="w:p")return;const Oe=[],me=[];x(B.children,{styles:{}},Oe,me,h),me.length>0&&e.lose("a picture or break in a table's cell, left out"),Ae.length>0&&Oe.length>0&&Ae.push({text:`
5
+ `,styles:{}}),Ae.push(...Fe(Oe))}),[Ae,...Re().slice(1)]})}),P=F.filter(R=>R.rows*R.cols>1);v.nested&&e.lose("a table in a table's cell, left out");const I=A(r(r(u,"w:tblPr"),"w:tblStyle")),Q=I===void 0?void 0:e.tableStyle(I),z=Pe(r(r(Z(u,"w:tr")[0],"w:trPr"),"w:tblHeader"))===!0,ee=w.reduce((R,se)=>R+se,0),ne=Math.round(e.normalSize*.9*2)/2,U=Q===void 0?void 0:e.tableStyles.get(Q),le=e.styledRun(),te={type:"table",rows:C.map((R,se)=>R.map(re=>re.map(he=>{const G={...he.styles};return G.size===ne&&delete G.size,G.font!==void 0&&(G.font===le.font||le.faces.has(G.font))&&delete G.font,G.color!==void 0&&G.color.toUpperCase()===le.color?.toUpperCase()&&delete G.color,se===0&&z&&(G.bold===!0&&delete G.bold,U?.headColor!==void 0&&G.color?.toUpperCase()===U.headColor.toUpperCase()&&delete G.color),{...he,styles:G}}))),...z?{}:{head:"none"},...P.length>0?{merges:P}:{},...E.some(R=>R!==null)?{heights:E}:{},...(()=>{const R=Math.max(0,...O.map(re=>re.length)),se=In(O.map(re=>Array.from({length:R},(he,G)=>re[G]??"top")));return se.length>0?{valign:se}:{}})(),...Object.keys(N).length>0?{cells:N}:{},...Q===void 0?{}:{style:Q}};if(w.length===0||ee<=0)return te;const ge=w.map(R=>Math.round(R/15)),ie=Ln(te,ee/15,ne,ht);return ge.some((R,se)=>Math.abs(R-(ie[se]??0))>2)?{...te,widths:ge}:te};let K="portrait";const V=r(s,"w:sectPr"),q=u=>ae(r(u,"w:pgSz"),"w:orient")==="landscape"?"landscape":"portrait";K=Xn(s,q)??q(V);const pe=s.children.filter(u=>u.key==="w:p").map(u=>r(r(u,"w:pPr"),"w:sectPr")).find(u=>u!==void 0)??V;let fe=fn(pe);const J=u=>hn(u).margins,L=J(pe);let S=JSON.stringify(L);const $=[],oe=u=>{for(const h of u)if(h.key==="w:p"){const w=r(r(h,"w:pPr"),"w:sectPr");w!==void 0&&$.push(w)}else h.key==="w:sdt"?oe(r(h,"w:sdtContent")?.children??[]):h.key==="w:customXml"&&oe(h.children)};oe(s.children),V!==void 0&&$.push(V);const be=bt(e,$),we=pe===void 0?void 0:be.get(pe),ue={header:JSON.stringify(we?.header),footer:JSON.stringify(we?.footer)};fe>1&&o.push({block:{type:"pagebreak",columns:fe,continuous:!0}});const ke=u=>{for(const h of u)switch(h.key){case"w:p":{const w=_(h,e.doc);r(r(h,"w:pPr"),"w:sectPr")!==void 0&&w.every(O=>O.block.type==="paragraph"&&O.block.content.length===0)||o.push(...w);const N=w.find(O=>O.block.type==="heading")?.block;if(N!==void 0)for(const O of cn(h))l.set(O,N);const F=w.find(O=>O.block.type==="paragraph"&&O.block.look?.style==="Caption")?.block;if(F!==void 0)for(const O of cn(h))g.set(O,F);const b=r(r(h,"w:pPr"),"w:sectPr");if(b!==void 0){const O=ct(h)??V,E=q(O),C=fn(O),P=ae(r(O,"w:type"),"w:val")==="continuous",I=J(O),Q=JSON.stringify(I)!==S&&I!==void 0;Q&&P&&e.lose("a continuous section's own margins, read as the section's before it");const z=be.get(O??b),ee={};for(const ne of["header","footer"]){const U=z?.[ne];U===void 0||JSON.stringify(U)===ue[ne]||U!==!1&&U.first===void 0&&JSON.stringify(U)===it(ue[ne])||(P?e.lose(`a continuous section's own ${ne}, read as the section's before it`):(ee[ne]=U,ue[ne]=JSON.stringify(U)))}o.push({block:{type:"pagebreak",...E===K||P?{}:{orientation:E},...C!==fe?{columns:C}:{},...P?{continuous:!0}:{},...Q&&!P?{margins:I}:{},...ee}}),P||(S=JSON.stringify(I)),P&&E!==K&&e.lose("a continuous section break that turns the page, read on the same page"),K=E,fe=C}break}case"w:tbl":o.push({block:H(h,e.doc)});break;case"w:sdt":ke(r(h,"w:sdtContent")?.children??[]);break;case"w:customXml":ke(h.children);break;case"w:sectPr":case"w:bookmarkStart":case"w:bookmarkEnd":case"w:proofErr":break;case"m:oMathPara":o.push({block:{type:"code",language:_e.math,code:tn(h)}});break;default:break}};ke(s.children);const Ee=[];for(const[u,h]of e.notes){const w=e.footnotes.get(u)??[],v=[];for(const F of w){const b=[];x(F.children,{styles:{}},b,[],e.partOf(u.startsWith("e")?"endnotes":"footnotes")??e.doc),v.length>0&&b.length>0&&v.push({text:`
6
+ `,styles:{}}),v.push(...Fe(b.filter(O=>O.note===void 0)))}const N=v.map(F=>{const b={...F.styles};return(b.size===9||b.size==="小五")&&delete b.size,b.color?.toUpperCase()===pt&&delete b.color,{...F,styles:b}});Ee.push({type:"note",label:h,content:N})}const Be=new Map,$e=rt(dt(un(o,e),Be));ft($e,e,t.gather??GATHER_DEFAULT);const mn=_n($e),Ie=new Map;for(const[u,h]of l){const w=mn.get(h);w!==void 0&&Ie.set(u,w)}for(const[u,h]of g){const w=Be.get(h);if(w===void 0||!/^(b_|_Ref)/u.test(u))continue;const v=u.startsWith("b_")?u.slice(2):u.slice(1);(w.type==="table"||w.type==="image"||w.type==="chart")&&w.id===void 0&&(w.id=v,Ie.set(u,v))}Ie.size>0&&at($e,Ie);const Ne=[...$e,...Ee],He=new Map;for(const u of Z(e.xml(e.partOf("commentsExtended"),{mce:!1}),"w15:commentEx")){const h=f(u,"w15:paraId");if(h===void 0)continue;const w=f(u,"w15:paraIdParent");He.set(h,{...w===void 0?{}:{parent:w},done:f(u,"w15:done")==="1"})}const Je=e.partOf("comments"),We=Z(e.xml(Je,{mce:!1}),"w:comment"),Ge=new Map;for(const u of We){const h=Z(u,"w:p").at(-1),w=h===void 0?void 0:f(h,"w14:paraId");w!==void 0&&Ge.set(w,e.commentId(f(u,"w:id")))}for(const u of We){const h=e.commentId(f(u,"w:id")),w=Z(u,"w:p").at(-1),v=He.get(w===void 0?"":f(w,"w14:paraId")??""),N=v?.parent===void 0?void 0:Ge.get(v.parent),F=Z(u,"w:p").flatMap(O=>{const E=[];x(O.children,{styles:{}},E,[],Je??e.doc);const C=Fe(E.filter(P=>P.text!==""));return C.length===0?[]:[{type:"paragraph",content:C}]}),b=e.revisionOf(u);Ne.push({type:"comment",id:h,author:b.author,...b.date===void 0?{}:{date:b.date},...N===void 0?{}:{replyTo:N},...v?.done===!0?{done:!0}:{},blocks:F})}const Ye=new Set(Ne.flatMap(u=>u.type==="comment"&&u.replyTo!==void 0?[u.id]:[]));Ye.size>0&&ot(Ne,Ye);const wn=hn(V),Ve=ln(e),Te=[...e.notes.keys()].filter(u=>u.startsWith("e")).length;Te>0&&Te<e.notes.size&&e.lose("an endnote beside footnotes, read as a footnote",Te);const qe=e.partOf("settings"),gn=Pe(r(qe===void 0?void 0:e.xml(qe),"w:trackRevisions"))===!0,Qe=Kn(e),Xe={...wn,...L===void 0?{}:{margins:L},...we===void 0?{}:{header:we.header,footer:we.footer},...Te>0&&Te===e.notes.size?{notes:"end"}:{},...Qe===void 0?{}:{lists:Qe},...e.watermark===void 0?{}:{watermark:e.watermark},...gn?{track:!0}:{},...Object.keys(Ve).length>0?{styles:Ve}:{}},Ze=Hn(Xe);return{mdx:`${Ze===""?"":`---
7
+ ${Ze}
8
+ ---
9
+
10
+ `}${Jn(Ne)}
11
+ `,blocks:Ne,page:Xe,files:e.files,lost:[...e.lost].map(([u,h])=>h===1?u:`${u} (${String(h)})`)}}function Y(d,t){for(const n of d.children){if(n.key===t)return n;const e=Y(n,t);if(e)return e}}function Qn(d,t){const n=new Set;let e=t;for(;e!==void 0&&!n.has(e);){n.add(e);const i=d.styles.get(e),s=r(i?.pPr,"w:numPr");if(s!==void 0)return s;e=i?.basedOn}}function dn(d,t){if(t===void 0)return{};const n=d.runProps(t),e=d.styleName(A(r(t,"w:rStyle"))),i=A(r(t,"w:vertAlign")),s=r(t,"w:rPrChange"),o=s===void 0?void 0:dn(d,r(s,"w:rPr")),a=e!==void 0&&!/^(Default Paragraph Font|Hyperlink|footnote reference|endnote reference)$/iu.test(e);return a&&d.used.add(e),{...n.bold===!0?{bold:!0}:{},...n.italic===!0?{italic:!0}:{},...n.underline===!0?{underline:!0}:{},...n.strike===!0?{strike:!0}:{},...n.color===void 0?{}:{color:n.color},...n.background===void 0?{}:{background:n.background},...n.font===void 0?{}:{font:n.font},...n.size===void 0?{}:{size:n.size},...n.caps===!0?{caps:!0}:{},...n.smallCaps===!0?{smallCaps:!0}:{},...n.letterSpacing===void 0?{}:{letterSpacing:n.letterSpacing},...i==="superscript"?{superscript:!0}:{},...i==="subscript"?{subscript:!0}:{},...a?{style:e}:{},...s===void 0||o===void 0?{}:{formatted:{...d.revisionOf(s),was:Object.fromEntries(xn.flatMap(l=>o[l]===void 0?[]:[[l,o[l]]]))}}}}function Fe(d){const t=d.map(i=>({...i})),n=t[0];n!==void 0&&n.note===void 0&&n.field===void 0&&(n.text=n.text.replace(/^[ \t\n]+/u,""));const e=t.at(-1);return e!==void 0&&e.note===void 0&&e.field===void 0&&(e.text=e.text.replace(/[ \t\n]+$/u,"")),t.filter(i=>i.text!==""||i.note!==void 0||i.field!==void 0)}function an(d,t){return!("content"in d)||!Array.isArray(d.content)?d:{...d,content:d.content.map(n=>{const e={...n.styles};return t==="inserted"?delete e.inserted:delete e.deleted,{...n,styles:e}})}}function Xn(d,t){for(const n of d.children){if(n.key!=="w:p")continue;const e=r(r(n,"w:pPr"),"w:sectPr");if(e!==void 0)return t(e)}}const Zn=new Set(["PAGE","NUMPAGES","SECTIONPAGES","SECTION","PAGEREF","REF","NOTEREF","STYLEREF","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","LASTSAVEDBY","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","DOCPROPERTY","DOCVARIABLE","NUMWORDS","NUMCHARS","USERNAME","USERINITIALS","MERGEFIELD","FILLIN"]);function Ue(d){const t=d.trim().replace(/\s+/gu," "),n=t.split(" ")[0]?.toUpperCase()??"";return Zn.has(n)?t:void 0}function Kn(d){const[t]=[...d.numberedLists].sort((i,s)=>s[1]-i[1])[0]??[],n=t===void 0?void 0:d.numbering.get(t);if(n===void 0)return;const e=[];for(let i=0;i<6;i++){const s=n.get(i);if(s===void 0||s.bullet)break;const o=s.text.replace(/%([1-9])/gu,(a,c)=>{const l=Number(c),g=s.legal&&l!==i+1?"decimal":n.get(l-1)?.format??"decimal",m=sn.get(g)??"decimal";return m==="decimal"?`{${c}}`:`{${c}:${m}}`});if(!o.includes(`{${String(i+1)}`))break;e.push(o.replace(/%%/gu,"%"))}for(;e.length>0&&e.at(-1)===Un[e.length-1];)e.pop();return e.length===0?void 0:{numbered:e}}function et(d,t){const n="a chart, left out (its numbers are in the file's workbook)",e=(S,$)=>S===void 0?void 0:Y(S,$),i=S=>S===void 0?void 0:f(S,"val"),o=d.xml(t)?.children.find(S=>S.key==="c:chart"),a=r(o,"c:plotArea"),c=a?.children.find(S=>S.key.endsWith("Chart"));if(c===void 0)return n;(a?.children.filter(S=>S.key.endsWith("Chart")).length??0)>1&&d.lose("a chart of two kinds, read as its first");const l=i(r(c,"c:grouping")),g=l==="stacked"?"-stacked":l==="percentStacked"?"-stacked-100":"";let m;const x=c.key.replace(/3DChart$/u,"Chart");switch(x!==c.key&&d.lose("a 3D chart, read flat"),x){case"c:barChart":{const S=i(r(c,"c:barDir"))==="bar"?"bar":"column";m=g===""?`${S}-clustered`:`${S}${g}`;break}case"c:lineChart":{m=Z(c,"c:ser").some($=>i(r(r($,"c:marker"),"c:symbol"))!=="none")?"line-markers":"line";break}case"c:areaChart":m=`area${g}`;break;case"c:pieChart":m="pie";break;case"c:doughnutChart":m="doughnut";break;case"c:scatterChart":{const S=i(r(c,"c:scatterStyle"));m=S==="smoothMarker"||S==="smooth"?"scatter-smooth":S==="lineMarker"||S==="line"?"scatter-lines":"scatter";break}default:return`a chart of Word's ${c.key.slice(2,-5)} kind, left out`}const p=S=>{const $=e(S,"c:strCache")??e(S,"c:numCache"),oe=[];for(const be of Z($,"c:pt")){const we=T(f(be,"idx")),ue=r(be,"c:v")?.text??"",ke=Number(ue);we!==void 0&&(oe[we]=$?.key==="c:numCache"&&ue.trim()!==""&&Number.isFinite(ke)?String(ke):ue)}return Array.from(oe,be=>be??"")},k=Z(c,"c:ser"),y=k[0];if(y===void 0)return n;const D=c.key==="c:scatterChart",_=p(r(y,D?"c:xVal":"c:cat")),H=k.map((S,$)=>({name:p(r(S,"c:tx"))[0]??`Series ${String($+1)}`,values:p(r(S,D?"c:yVal":"c:val"))}));if(H.every(S=>S.values.length===0))return n;const K=Math.max(_.length,...H.map(S=>S.values.length)),V=[["",...H.map(S=>S.name)],...Array.from({length:K},(S,$)=>[_[$]??String($+1),...H.map(oe=>oe.values[$]??"")])],q=e(r(o,"c:title"),"c:rich"),pe=q===void 0?"":nt(q).join("").trim(),fe=r(o,"c:legend"),J=i(r(fe,"c:legendPos")),L=fe===void 0?"none":J==="r"?"right":J==="l"?"left":J==="t"?"top":J==="b"?"bottom":void 0;return{type:"chart",kind:m,table:V,...pe===""?{}:{title:pe},...L===void 0||L===(m==="pie"||m==="doughnut"?"right":H.length>1?"top":"none")?{}:{legend:L}}}function nt(d){const t=[],n=e=>{for(const i of e.children)i.key==="a:t"||i.key==="w:t"?t.push(i.text):n(i)};return n(d),t}const tt=/^\s*(?:figure|fig\.?|table|chart|图|表|圖)\s*[\d.\-–]+\s*[.::、—–-]?\s*/iu;function st(d,t,n,e){const i=d.files.get(t);if(i===void 0)return!1;let s;try{s=An(i).width}catch(o){if(o instanceof TypeError)return!1;throw o}return Math.abs(n-Math.min(s,e))<=1}function ot(d,t){const n=e=>{if(Array.isArray(e))for(const i of e)n(i);else if(e!==null&&typeof e=="object"){const i=e;if(typeof i.text=="string"&&i.styles!==void 0){const s=i.styles.comments;if(s!==void 0){const o=s.filter(a=>!t.has(a));o.length===0?delete i.styles.comments:i.styles.comments=o}return}for(const s of Object.values(e))n(s)}};n(d)}function it(d){if(d===void 0)return;const t=JSON.parse(d);if(t===null||typeof t!="object")return d;const n={...t};return delete n.first,JSON.stringify(n)}function rt(d){const t=[];for(const n of d){const e=t.at(-1);if(n.type==="toc"&&e?.type==="paragraph"&&e.look?.style==="TOC Heading"){t.pop();const i=e.content.map(s=>s.text).join("").trim();t.push(i===""||i==="Contents"||i==="目录"?n:{...n,title:i});continue}t.push(n)}return t}function dt(d,t=new Map){const n=s=>s?.type==="paragraph"&&s.look?.style==="Caption"&&s.content.length>0&&s.content.every(o=>o.note===void 0),e=s=>"content"in s&&Array.isArray(s.content)?s.content.map(o=>o.text).join("").replace(tt,"").trim():"",i=[];for(let s=0;s<d.length;s++){const o=d[s];if(o===void 0)continue;const a=d[s+1];if(n(o)&&a?.type==="table"&&a.caption===void 0){const c=e(o);if(c!==""){const l={...a,caption:c};t.set(o,l),i.push(l),s++;continue}}if(n(a)&&a!==void 0&&(o.type==="image"&&o.caption===void 0||o.type==="chart"&&o.title===void 0)){const c=e(a);if(c!==""){if(o.type==="image"){const l={...o,caption:c};t.set(a,l),i.push(l)}else{const l=[c,o.table?.[0]?.slice(1).join(", ")].filter(m=>m!==void 0&&m!=="").join(": "),g={...o,title:c};g.alt===l&&delete g.alt,t.set(a,g),i.push(g)}s++;continue}}i.push(o)}return i}function cn(d){const t=[],n=e=>{for(const i of e.children)if(i.key==="w:bookmarkStart"){const s=f(i,"w:name");s!==void 0&&s!==""&&t.push(s)}else n(i)};return n(d),t}function at(d,t){const n=e=>{if(Array.isArray(e))for(const i of e)n(i);else if(e!==null&&typeof e=="object"){const i=e;if(typeof i.text=="string"&&typeof i.styles=="object"){const s=i.href?.startsWith("#")===!0?t.get(i.href.slice(1)):void 0;if(s!==void 0&&(i.href=`#${s}`),i.field!==void 0){const[o="",a,...c]=i.field.split(" "),l=a===void 0?void 0:t.get(a);l!==void 0&&["REF","PAGEREF","NOTEREF"].includes(o.toUpperCase())&&(i.field=[o,l,...c].join(" "))}return}for(const s of Object.values(e))n(s)}};n(d)}function ct(d){const t=d.parent;if(t===void 0)return;const n=t.children.indexOf(d);for(const e of t.children.slice(n+1)){if(e.key!=="w:p")continue;const i=r(r(e,"w:pPr"),"w:sectPr");if(i!==void 0)return i}}const fn=d=>Math.min(9,Math.max(1,T(ae(r(d,"w:cols"),"w:num"))??1));function un(d,t){const n=[];let e=[];const i=new Set;for(const s of d){if(s.list===void 0){n.push(s.block),e=[];continue}const{numId:o,level:a}=s.list;let c=s.block;const l=`${o}:${String(a)}`;if(c.type==="numbered"&&!i.has(l)){i.add(l);const m=t.numbering.get(o)?.get(a)?.start??1;m!==1&&(c={...c,start:m})}for(;e.length>0&&(e.at(-1)?.level??0)>=a;)e.pop();const g=e.at(-1);if(g===void 0)n.push(c);else{const m=g.block;m.children=[...m.children??[],c]}e.push({level:a,block:c})}return n}function ft(d,t,n){const e=new Map,i=c=>{if(c.type!=="paragraph"||c.revision!==void 0)return;const l=c.look??{},g=$n(l,"paragraph"),m=ut(c.content);if(!(Object.keys(g).length===0&&Object.keys(m).length===0))return JSON.stringify([l.style??"",g,m])},s=c=>{for(const l of c){const g=i(l);g!==void 0&&e.set(g,[...e.get(g)??[],l]);const m="children"in l?l.children??[]:[];m.length>0&&s(m)}};s(d);let o=0;const a=new Map;for(const[c,l]of e){if(l.length<n)continue;const[g,m,x]=JSON.parse(c);let p;do p=`Style${String(++o)}`;while(t.styles.has(p)||[...t.styles.values()].some(k=>k.name===p));a.set(p,{...g===""?{}:{basedOn:g},...m,...x});for(const k of l){if(k.type!=="paragraph")continue;const y={...k.look?.color===void 0?{}:{color:k.look.color},style:p};k.look=y,k.content=k.content.map(D=>({...D,styles:lt(D.styles,x)}))}}t.made=a}function ut(d){const t=d.filter(o=>o.note===void 0&&o.text.trim()!==""),n=t[0];if(n===void 0)return{};const e=o=>({...o.font===void 0?{}:{font:o.font},...o.size===void 0?{}:{size:o.size},...o.bold===!0?{bold:!0}:{},...o.italic===!0?{italic:!0}:{},...o.color===void 0?{}:{color:o.color}}),i=e(n.styles),s=JSON.stringify(i);return t.every(o=>JSON.stringify(e(o.styles))===s)?i:{}}function lt(d,t){const n={...d};return t.font!==void 0&&delete n.font,t.size!==void 0&&delete n.size,t.bold===!0&&delete n.bold,t.italic===!0&&delete n.italic,t.color!==void 0&&delete n.color,n}function ln(d){const t={},n=new Map([...d.styles.values()].map(s=>[s.name,s])),e=s=>{if(Object.hasOwn(t,s))return;const o=n.get(s);if(o===void 0)return;const c=d.styles.get(o.basedOn??"")?.type===o.type?d.styleName(o.basedOn):void 0,l=d.styleName(o.next),g={...o.type==="character"?{type:"character"}:{},...c===void 0||c==="Default Paragraph Font"||c===s?{}:{basedOn:c},...l===void 0||l===s||o.type==="character"?{}:{next:l},...d.runProps(o.rPr),...o.type==="character"?{}:d.paragraphProps(o.pPr)};if(s===Ce){const p=d.defaults;Object.assign(g,{...d.runProps(r(r(p,"w:rPrDefault"),"w:rPr")),...d.runProps(o.rPr)},{...d.paragraphProps(r(r(p,"w:pPrDefault"),"w:pPr")),...d.paragraphProps(o.pPr)})}const m=/^Heading ([1-6])$/u.exec(s)?.[1],x=A(r(r(o.pPr,"w:numPr"),"w:numId"));if(m!==void 0&&x!==void 0){const p=d.numbering.get(x),k=p?.get(Number(m)-1);if(p!==void 0&&k!==void 0&&!k.bullet){const y=k.text.replace(/%([1-9])/gu,(D,_)=>{const H=Number(_),K=k.legal&&H!==Number(m)?"decimal":p.get(H-1)?.format??"decimal",V=sn.get(K);V===void 0&&d.lose(`a heading's number in Word's ${K}, read as a decimal`);const q=V??"decimal";return q==="decimal"?`{${_}}`:`{${_}:${q}}`});/\{[1-6]/u.test(y)&&Number(/\{([1-6])/u.exec(y)?.[1]??7)<=Number(m)&&(g.numbering=y.replace(/%%/gu,"%"))}}t[s]=g,c!==void 0&&c!==s&&e(c),l!==void 0&&l!==s&&e(l)};e(Ce);for(const s of[1,2,3,4,5,6])e(nn(s));e(Le);for(const s of d.used)e(s);for(const[s,o]of d.made)t[s]=o;for(const[s,o]of d.tableStyles)t[s]=o;const i=Object.fromEntries(Object.entries(t).filter(([s,o])=>Object.keys(o).length>0||!Tn.includes(s)));for(const s of Object.values(i))if(s.font!==void 0&&!Cn.includes(s.font)){const o=on.get(s.font.toLowerCase());o!==void 0&&(s.font=o)}return i}const pt=jn.lead.toUpperCase(),ht=7,mt={silver:"#C0C0C0",gray:"#808080",black:"#000000",white:"#FFFFFF",red:"#FF0000",maroon:"#800000",blue:"#0000FF",navy:"#000080",green:"#008000",yellow:"#FFFF00"};function wt(d){const t=d?.trim().split(/\s/u)[0]?.toLowerCase();if(!(t===void 0||t===""))return/^#[0-9a-f]{6}$/u.test(t)?t.toUpperCase():/^#[0-9a-f]{3}$/u.test(t)?t.replace(/[0-9a-f]/gu,n=>n+n).toUpperCase():mt[t]}function pn(d,t){return d==="center"?"center":d==="right"||d==="outside"?"right":d==="left"||d==="inside"?"left":t!==void 0&&t>36e5?"right":t!==void 0&&t>18e5?"center":"left"}function gt(d){const t=i=>new RegExp(`${i}\\s*:\\s*([^;]+)`,"u").exec(d??"")?.[1]?.trim(),n=t("margin-left"),e=n===void 0?void 0:n.endsWith("in")?Number.parseFloat(n)*72:Number.parseFloat(n);return pn(t("mso-position-horizontal"),e===void 0||Number.isNaN(e)?void 0:e*12700)}function yt(d,t,n){const e=d.xml(t);if(e===void 0)return;const i={left:[],center:[],right:[]},s={left:[],center:[],right:[]},o=p=>{const k=p.trim().split(/\s+/u)[0]?.toUpperCase()??"";return k==="PAGE"?"{page}":k==="NUMPAGES"||k==="SECTIONPAGES"?"{pages}":k==="TITLE"?"{title}":k==="STYLEREF"?"{section}":""},a=(p,k)=>{const y=p===void 0?void 0:d.picture(p,t);if(y===void 0)return;const D=k===void 0?void 0:Math.round(k/18e3)/2;return{picture:`./${y}`,...D===void 0||D<=0?{}:{height:D}}},c=(p,k)=>{if(p.key==="w:drawing"){const J=r(p,"wp:anchor");if(J!==void 0&&f(J,"behindDoc")==="1"){const ue=Y(p,"a:blip"),ke=ue===void 0?void 0:De(ue)??f(ue,"r:embed"),Ee=ke===void 0?void 0:d.picture(ke,t);if(Ee===void 0||d.watermark!==void 0){d.lose(`a picture behind the ${n}'s words, left out`);return}d.watermark={picture:`./${Ee}`,...ue!==void 0&&r(ue,"a:lum")!==void 0?{washout:!0}:{}};return}const L=r(J,"wp:positionH"),S=J===void 0?k:pn(r(L,"wp:align")?.text.trim(),T(r(L,"wp:posOffset")?.text.trim())),$=Y(p,"w:txbxContent");if($!==void 0){m($.children,S);return}const oe=Y(p,"a:blip"),be=Y(p,"wp:extent"),we=a(oe===void 0?void 0:De(oe)??f(oe,"r:embed"),T(be===void 0?void 0:f(be,"cy")));we!==void 0?s[S].push(we):oe===void 0&&d.lose(`a shape in the ${n}, left out`);return}const y=p.children.find(J=>J.key==="v:shape"),D=y===void 0?void 0:r(y,"v:textpath");if(D!==void 0||Y(p,"v:textpath")!==void 0){const J=(D===void 0?void 0:f(D,"string"))?.trim()??"";if(J==="")return;const L=y===void 0?"":f(y,"style")??"",S=wt(y===void 0?void 0:f(y,"fillcolor")),$=/rotation\s*:\s*(\d+)/u.exec(L)?.[1];d.watermark??={text:J,...S===void 0||S===Nn?{}:{color:S},...$===void 0||$==="0"?{layout:"horizontal"}:{}};return}const _=p.children.find(J=>J.key.startsWith("v:")),H=_===void 0?void 0:f(_,"style"),K=/position\s*:\s*absolute/u.test(H??"")?gt(H):k,V=Y(p,"w:txbxContent");if(V!==void 0){m(V.children,K);return}const q=Y(p,"v:imagedata");if(q===void 0)return;if(/z-index\s*:\s*-/u.test(H??"")){const J=f(q,"r:id"),L=J===void 0?void 0:d.picture(J,t);if(L===void 0||d.watermark!==void 0){d.lose(`a picture behind the ${n}'s words, left out`);return}d.watermark={picture:`./${L}`,...f(q,"gain")!==void 0||f(q,"blacklevel")!==void 0?{washout:!0}:{}};return}const pe=/(?:^|;)\s*height\s*:\s*([\d.]+)pt/u.exec(H??"")?.[1],fe=a(f(q,"r:id"),pe===void 0?void 0:Number(pe)*12700);fe!==void 0&&s[K].push(fe)},l=(p,k)=>{const y=[""],D=[];let _,H=!0;const K=L=>{y[y.length-1]=`${y.at(-1)??""}${L}`},V=L=>{for(const S of L){if(S.key==="w:fldSimple"){K(o(f(S,"w:instr")??""));continue}if(S.key==="w:r"){for(const $ of S.children)if($.key==="w:fldChar"){const oe=f($,"w:fldCharType");oe==="begin"?_="":oe==="separate"?(K(o(_??"")),H=!1):oe==="end"&&(H&&K(o(_??"")),_=void 0,H=!0)}else $.key==="w:instrText"&&_!==void 0?_+=$.text:$.key==="w:t"&&H&&_===void 0?K($.text):$.key==="w:tab"?y.push(""):($.key==="w:drawing"||$.key==="w:pict")&&D.push({el:$,piece:y.length-1});continue}S.key!=="w:pPr"&&V(S.children)}};V(p.children);const q=A(r(r(p,"w:pPr"),"w:jc")),pe=k??(q==="center"?"center":q==="right"||q==="end"?"right":"left"),fe=L=>k!==void 0||y.length===1?pe:y.length===2?L===0?"left":"right":L===0?"left":L===1?"center":"right",J={left:[],center:[],right:[]};y.forEach((L,S)=>{const $=L.trim();$!==""&&J[fe(S)].push($)});for(const L of["left","center","right"])J[L].length>0&&i[L].push(J[L].join(" "));for(const{el:L,piece:S}of D)c(L,fe(S))},g=p=>{for(const k of Z(p,"w:tr")){const y=Z(k,"w:tc");y.length>3&&d.lose(`a ${n}'s table of more than three columns, read as three`),y.forEach((D,_)=>{const H=y.length===1?"center":y.length===2?_===0?"left":"right":_===0?"left":_===y.length-1?"right":"center";m(D.children,y.length===1?void 0:H)})}},m=(p,k)=>{for(const y of p)y.key==="w:p"?l(y,k):y.key==="w:tbl"?g(y):y.key==="w:sdt"&&m(r(y,"w:sdtContent")?.children??[],k)};m(e.children,void 0);const x={};for(const p of["left","center","right"]){const[k,...y]=s[p];k!==void 0?(x[p]=k,y.length>0&&d.lose(`a ${n}'s pictures after its first at one place, left out`),i[p].length>0&&d.lose(`a ${n}'s words beside its picture at one place, left out`)):i[p].length>0&&(x[p]=i[p].join(`
12
+ `))}return Object.keys(x).length===0?void 0:x}function bt(d,t){const n=d.partOf("settings"),e=Pe(r(n===void 0?void 0:d.xml(n),"w:evenAndOddHeaders"))===!0,i=new Map,s=(c,l)=>(i.has(c)||i.set(c,yt(d,c,l)),i.get(c)),o=new Map,a={header:new Map,footer:new Map};for(const c of t){const l=Pe(r(c,"w:titlePg"))===!0,g={};for(const[m,x]of[["w:headerReference","header"],["w:footerReference","footer"]]){for(const V of Z(c,m)){const q=d.pkg.rel(d.doc,f(V,"r:id"))?.target;q!==void 0&&a[x].set(f(V,"w:type")??"default",q)}const p=V=>{const q=a[x].get(V);return q===void 0?void 0:s(q,x)},k=p("default"),y=V=>V!==void 0&&JSON.stringify(V)===JSON.stringify(k),D=l?p("first"):void 0,_=!l||y(D)?void 0:D??!1,H=e?p("even"):void 0,K=!e||y(H)?void 0:H??!1;g[x]=k===void 0&&(_===void 0||_===!1)&&(K===void 0||K===!1)?!1:{...k??{},..._===void 0?{}:{first:_},...K===void 0?{}:{even:K}}}o.set(c,g)}return o}function hn(d){if(d===void 0)return{};const t={},n=r(d,"w:pgSz"),e=T(n===void 0?void 0:f(n,"w:w")),i=T(n===void 0?void 0:f(n,"w:h"));if(e!==void 0&&i!==void 0){const o=[e/ze,i/ze].sort((c,l)=>c-l),a=Object.entries(En).find(([,c])=>Math.abs(c[0]-o[0])<1.5&&Math.abs(c[1]-o[1])<1.5)?.[0];a===void 0?t.paper=[Math.round(o[0]*10)/10,Math.round(o[1]*10)/10]:a!=="letter"&&(t.paper=a),n!==void 0&&f(n,"w:orient")==="landscape"&&(t.orientation="landscape")}const s=r(d,"w:pgMar");if(s!==void 0){const o=c=>Math.round(Math.abs(T(f(s,c))??1440)/ze*10)/10,a=[o("w:top"),o("w:right"),o("w:bottom"),o("w:left")];t.margins=a.every(c=>c===a[0])?a[0]:a[0]===a[2]&&a[1]===a[3]?[a[0],a[1]]:[...a]}return t}