allyhub 0.19.0 → 0.20.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 (699) 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 +1 -1
  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/blocks.js +2 -0
  95. package/dist/node_modules/@allyhub/doc/dist/chart.js +1 -1
  96. package/dist/node_modules/@allyhub/doc/dist/color.js +1 -1
  97. package/dist/node_modules/@allyhub/doc/dist/docx-read.js +12 -0
  98. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -4
  99. package/dist/node_modules/@allyhub/doc/dist/html.js +83 -48
  100. package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
  101. package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
  102. package/dist/node_modules/@allyhub/doc/dist/merges.js +2 -0
  103. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  104. package/dist/node_modules/@allyhub/doc/dist/numbering.js +2 -0
  105. package/dist/node_modules/@allyhub/doc/dist/omml.js +3 -0
  106. package/dist/node_modules/@allyhub/doc/dist/page.js +2 -1
  107. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  108. package/dist/node_modules/@allyhub/doc/dist/parse.js +5 -4
  109. package/dist/node_modules/@allyhub/doc/dist/redline.js +2 -0
  110. package/dist/node_modules/@allyhub/doc/dist/revisions.js +2 -0
  111. package/dist/node_modules/@allyhub/doc/dist/shapes.js +4 -0
  112. package/dist/node_modules/@allyhub/doc/dist/styles.js +2 -0
  113. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  114. package/dist/node_modules/@allyhub/doc/dist/write.js +65 -39
  115. package/dist/node_modules/@allyhub/doc/package.json +5 -1
  116. package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
  117. package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
  118. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +3 -0
  119. package/dist/node_modules/@allyhub/doc-extension/dist/cli/index.js +1 -1
  120. package/dist/node_modules/@allyhub/doc-extension/dist/cli/styles.js +4 -0
  121. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  122. package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
  123. package/dist/node_modules/@allyhub/doc-extension/dist/project-tools.js +1 -1
  124. package/dist/node_modules/@allyhub/doc-extension/dist/tools.js +1 -1
  125. package/dist/node_modules/@allyhub/doc-extension/package.json +22 -2
  126. package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
  127. package/dist/node_modules/@allyhub/doc-print/dist/index.js +1 -1
  128. package/dist/node_modules/@allyhub/doc-print/dist/layout.js +8 -7
  129. package/dist/node_modules/@allyhub/doc-print/dist/print.js +22 -16
  130. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  131. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  132. package/dist/node_modules/@allyhub/export/package.json +1 -1
  133. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  134. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  135. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  136. package/dist/node_modules/@allyhub/formats/dist/data/blocks-flow.js +2 -0
  137. package/dist/node_modules/@allyhub/formats/dist/data/blocks.d.ts +146 -0
  138. package/dist/node_modules/@allyhub/formats/dist/data/blocks.js +2 -0
  139. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.d.ts +9 -0
  140. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.js +2 -0
  141. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +47 -40
  142. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
  143. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.d.ts +6 -0
  144. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.js +2 -0
  145. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.d.ts +29 -0
  146. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.js +2 -0
  147. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +18 -0
  148. package/dist/node_modules/@allyhub/formats/dist/data/faces.js +1 -1
  149. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +59 -0
  150. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +2 -0
  151. package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +1 -1
  152. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +698 -258
  153. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  154. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +14104 -2167
  155. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  156. package/dist/node_modules/@allyhub/formats/dist/data/themes.d.ts +82 -0
  157. package/dist/node_modules/@allyhub/formats/dist/data/themes.js +2 -0
  158. package/dist/node_modules/@allyhub/formats/dist/data/tokens.d.ts +67 -0
  159. package/dist/node_modules/@allyhub/formats/dist/data/tokens.js +2 -0
  160. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
  161. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  162. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +7 -0
  163. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  164. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +12 -3
  165. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +3260 -290
  166. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  167. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +45 -0
  168. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +2 -0
  169. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  170. package/dist/node_modules/@allyhub/html-extension/dist/project-tools.js +21 -9
  171. package/dist/node_modules/@allyhub/html-extension/dist/tools.js +1 -1
  172. package/dist/node_modules/@allyhub/html-extension/markup/allyhub.yaml +2 -0
  173. package/dist/node_modules/@allyhub/html-extension/markup/markup.json +14 -4
  174. package/dist/node_modules/@allyhub/html-extension/markup/pages/budget.html +22 -1
  175. package/dist/node_modules/@allyhub/html-extension/package.json +9 -1
  176. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  177. package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +1 -1
  178. package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +2 -2
  179. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  180. package/dist/node_modules/@allyhub/image-extension/dist/build-plugins.js +1 -1
  181. package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
  182. package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
  183. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
  184. package/dist/node_modules/@allyhub/image-measure/dist/layout.js +2 -2
  185. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  186. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  187. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  188. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  189. package/dist/node_modules/@allyhub/image-sdk/dist/block.js +2 -0
  190. package/dist/node_modules/@allyhub/image-sdk/dist/blocks.js +2 -0
  191. package/dist/node_modules/@allyhub/image-sdk/dist/index.js +1 -1
  192. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  193. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  194. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -3
  195. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +3 -3
  196. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  197. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  198. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  199. package/dist/node_modules/@allyhub/media/package.json +1 -1
  200. package/dist/node_modules/@allyhub/media-extension/dist/analyses/faces.js +1 -1
  201. package/dist/node_modules/@allyhub/media-extension/dist/asr/transcribe.js +1 -1
  202. package/dist/node_modules/@allyhub/media-extension/dist/ocr/text.js +1 -1
  203. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  204. package/dist/node_modules/@allyhub/media-extension/dist/vision/index-media.js +3 -2
  205. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  206. package/dist/node_modules/@allyhub/model/package.json +1 -1
  207. package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
  208. package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +1 -1
  209. package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
  210. package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
  211. package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
  212. package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +1 -1
  213. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  214. package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
  215. package/dist/node_modules/@allyhub/ooxml/dist/mce.js +1 -1
  216. package/dist/node_modules/@allyhub/ooxml/dist/node.js +1 -1
  217. package/dist/node_modules/@allyhub/ooxml/dist/ns.js +1 -1
  218. package/dist/node_modules/@allyhub/ooxml/dist/opc.js +1 -1
  219. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  220. package/dist/node_modules/@allyhub/piece/dist/export.d.ts +1 -1
  221. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +2 -0
  222. package/dist/node_modules/@allyhub/piece/dist/look.d.ts +10 -2
  223. package/dist/node_modules/@allyhub/piece/dist/look.js +1 -1
  224. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +8 -2
  225. package/dist/node_modules/@allyhub/piece/dist/script.js +1 -1
  226. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +3 -0
  227. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  228. package/dist/node_modules/@allyhub/project/dist/media-index.js +1 -1
  229. package/dist/node_modules/@allyhub/project/package.json +1 -1
  230. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  231. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  232. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  233. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  234. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  235. package/dist/node_modules/@allyhub/protocol/dist/page-frame.js +2 -0
  236. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  237. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  238. package/dist/node_modules/@allyhub/render/package.json +1 -1
  239. package/dist/node_modules/@allyhub/runtime/dist/footage.js +1 -1
  240. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  241. package/dist/node_modules/@allyhub/runtimes/dist/packages.js +2 -2
  242. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +3 -3
  243. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  244. package/dist/node_modules/@allyhub/scaffold/dist/index.js +12 -8
  245. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  246. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  247. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  248. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  249. package/dist/node_modules/@allyhub/sheet/dist/api/charts.js +1 -1
  250. package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
  251. package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
  252. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  253. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  254. package/dist/node_modules/@allyhub/sheet/dist/calc/server.js +1 -1
  255. package/dist/node_modules/@allyhub/sheet/dist/cell-styles.js +2 -0
  256. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  257. package/dist/node_modules/@allyhub/sheet/dist/check.js +1 -1
  258. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  259. package/dist/node_modules/@allyhub/sheet/dist/heatmap.js +2 -0
  260. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  261. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  262. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  263. package/dist/node_modules/@allyhub/sheet/dist/paginate.js +1 -1
  264. package/dist/node_modules/@allyhub/sheet/dist/printed.js +1 -1
  265. package/dist/node_modules/@allyhub/sheet/dist/sdk.js +1 -1
  266. package/dist/node_modules/@allyhub/sheet/dist/sparklines.js +2 -0
  267. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  268. package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
  269. package/dist/node_modules/@allyhub/sheet/dist/theme.js +2 -0
  270. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +2 -0
  271. package/dist/node_modules/@allyhub/sheet/dist/units.js +2 -0
  272. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  273. package/dist/node_modules/@allyhub/sheet/dist/write.js +14 -14
  274. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  275. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  276. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  277. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  278. package/dist/node_modules/@allyhub/sheet/dist/xlsx/theme.js +1 -1
  279. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  280. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  281. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  282. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +7 -7
  283. package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
  284. package/dist/node_modules/@allyhub/sheet-extension/dist/evaluate.js +2 -2
  285. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
  286. package/dist/node_modules/@allyhub/sheet-extension/dist/inspect.js +2 -2
  287. package/dist/node_modules/@allyhub/sheet-extension/dist/migrations.js +4 -0
  288. package/dist/node_modules/@allyhub/sheet-extension/dist/project-tools.js +1 -1
  289. package/dist/node_modules/@allyhub/sheet-extension/dist/tools.js +1 -1
  290. package/dist/node_modules/@allyhub/sheet-extension/package.json +7 -3
  291. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  292. package/dist/node_modules/@allyhub/slides-core/dist/blocks.js +2 -0
  293. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  294. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  295. package/dist/node_modules/@allyhub/slides-core/dist/code.js +1 -1
  296. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  297. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  298. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  300. package/dist/node_modules/@allyhub/slides-core/dist/model.js +1 -1
  301. package/dist/node_modules/@allyhub/slides-core/dist/office-layouts.js +2 -0
  302. package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
  303. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  304. package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
  305. package/dist/node_modules/@allyhub/slides-core/dist/styles/brief.js +2 -0
  306. package/dist/node_modules/@allyhub/slides-core/dist/styles/editorial.js +2 -0
  307. package/dist/node_modules/@allyhub/slides-core/dist/styles/index.js +2 -0
  308. package/dist/node_modules/@allyhub/slides-core/dist/styles/kit.js +2 -0
  309. package/dist/node_modules/@allyhub/slides-core/dist/styles/layouts.js +2 -0
  310. package/dist/node_modules/@allyhub/slides-core/dist/styles/pitch.js +2 -0
  311. package/dist/node_modules/@allyhub/slides-core/dist/styles/stage.js +2 -0
  312. package/dist/node_modules/@allyhub/slides-core/dist/styles/tiles.js +2 -0
  313. package/dist/node_modules/@allyhub/slides-core/dist/theme.js +1 -1
  314. package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
  315. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  316. package/dist/node_modules/@allyhub/slides-extension/dist/check.js +1 -1
  317. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
  318. package/dist/node_modules/@allyhub/slides-extension/dist/deck-fonts.js +1 -1
  319. package/dist/node_modules/@allyhub/slides-extension/dist/project-tools.js +1 -1
  320. package/dist/node_modules/@allyhub/slides-extension/package.json +24 -1
  321. package/dist/node_modules/@allyhub/slides-pptx/dist/charts.js +1 -1
  322. package/dist/node_modules/@allyhub/slides-pptx/dist/fonts.js +1 -1
  323. package/dist/node_modules/@allyhub/slides-pptx/dist/image-size.js +2 -0
  324. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +3 -3
  325. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +7 -2
  326. package/dist/node_modules/@allyhub/slides-pptx/dist/import/names.js +1 -1
  327. package/dist/node_modules/@allyhub/slides-pptx/dist/import/script.js +1 -1
  328. package/dist/node_modules/@allyhub/slides-pptx/dist/index.js +1 -1
  329. package/dist/node_modules/@allyhub/slides-pptx/dist/mtx.js +2 -0
  330. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +3 -2
  331. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chartex.js +3 -0
  332. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  333. package/dist/node_modules/@allyhub/slides-pptx/dist/read/index.js +2 -2
  334. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  335. package/dist/node_modules/@allyhub/slides-pptx/dist/read/table.js +1 -1
  336. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  337. package/dist/node_modules/@allyhub/slides-pptx/dist/read/timing.js +1 -1
  338. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  339. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  340. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  341. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +3 -2
  342. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  343. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  344. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +1 -1
  345. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  346. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  347. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/LICENSE +93 -0
  348. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-italic.woff2 +0 -0
  349. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-normal.woff2 +0 -0
  350. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-italic.woff2 +0 -0
  351. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-normal.woff2 +0 -0
  352. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-italic.woff2 +0 -0
  353. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-normal.woff2 +0 -0
  354. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-italic.woff2 +0 -0
  355. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-normal.woff2 +0 -0
  356. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400-italic.css +1 -0
  357. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400.css +1 -0
  358. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700-italic.css +1 -0
  359. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700.css +1 -0
  360. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400-italic.css +1 -0
  361. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400.css +1 -0
  362. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700-italic.css +1 -0
  363. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700.css +1 -0
  364. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/LICENSE +93 -0
  365. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-400-normal.woff2 +0 -0
  366. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-ext-400-normal.woff2 +0 -0
  367. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-400.css +1 -0
  368. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-ext-400.css +1 -0
  369. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/LICENSE +93 -0
  370. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-italic.woff2 +0 -0
  371. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  372. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-italic.woff2 +0 -0
  373. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2 +0 -0
  374. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-italic.woff2 +0 -0
  375. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
  376. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-italic.woff2 +0 -0
  377. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-normal.woff2 +0 -0
  378. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400-italic.css +1 -0
  379. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400.css +1 -0
  380. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700-italic.css +1 -0
  381. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700.css +1 -0
  382. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400-italic.css +1 -0
  383. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400.css +1 -0
  384. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700-italic.css +1 -0
  385. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700.css +1 -0
  386. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/LICENSE +93 -0
  387. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-italic.woff2 +0 -0
  388. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-normal.woff2 +0 -0
  389. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-italic.woff2 +0 -0
  390. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-normal.woff2 +0 -0
  391. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-italic.woff2 +0 -0
  392. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-normal.woff2 +0 -0
  393. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-italic.woff2 +0 -0
  394. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-normal.woff2 +0 -0
  395. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400-italic.css +1 -0
  396. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400.css +1 -0
  397. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700-italic.css +1 -0
  398. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700.css +1 -0
  399. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400-italic.css +1 -0
  400. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400.css +1 -0
  401. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700-italic.css +1 -0
  402. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700.css +1 -0
  403. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/LICENSE +93 -0
  404. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-italic.woff2 +0 -0
  405. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-normal.woff2 +0 -0
  406. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-italic.woff2 +0 -0
  407. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-normal.woff2 +0 -0
  408. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-italic.woff2 +0 -0
  409. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-normal.woff2 +0 -0
  410. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-italic.woff2 +0 -0
  411. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-normal.woff2 +0 -0
  412. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400-italic.css +1 -0
  413. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400.css +1 -0
  414. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700-italic.css +1 -0
  415. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700.css +1 -0
  416. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400-italic.css +1 -0
  417. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400.css +1 -0
  418. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700-italic.css +1 -0
  419. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700.css +1 -0
  420. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/LICENSE +93 -0
  421. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-italic.woff2 +0 -0
  422. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-normal.woff2 +0 -0
  423. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-italic.woff2 +0 -0
  424. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-normal.woff2 +0 -0
  425. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-italic.woff2 +0 -0
  426. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-normal.woff2 +0 -0
  427. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-italic.woff2 +0 -0
  428. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-normal.woff2 +0 -0
  429. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400-italic.css +1 -0
  430. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400.css +1 -0
  431. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700-italic.css +1 -0
  432. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700.css +1 -0
  433. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400-italic.css +1 -0
  434. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400.css +1 -0
  435. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700-italic.css +1 -0
  436. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700.css +1 -0
  437. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  438. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +42 -0
  439. package/dist/node_modules/@allyhub/stage-page/dist/style-faces.js +2 -0
  440. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  441. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +96 -92
  442. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  443. package/dist/node_modules/@allyhub/telemetry/dist/limit.js +2 -0
  444. package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
  445. package/dist/node_modules/@allyhub/text-extension/markup/allyhub.yaml +2 -0
  446. package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
  447. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  448. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
  449. package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -1
  450. package/dist/node_modules/@allyhub/video-core/dist/seams.js +1 -1
  451. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  452. package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +1 -1
  453. package/dist/node_modules/@allyhub/video-extension/dist/inspect/index.js +1 -1
  454. package/dist/node_modules/@allyhub/video-extension/dist/inspect/joins.js +1 -1
  455. package/dist/node_modules/@allyhub/video-extension/dist/inspect/loop.js +3 -0
  456. package/dist/node_modules/@allyhub/video-extension/package.json +2 -25
  457. package/dist/node_modules/@allyhub/video-measure/dist/check.js +2 -2
  458. package/dist/node_modules/@allyhub/video-measure/dist/index.js +1 -1
  459. package/dist/node_modules/@allyhub/video-measure/dist/seams.js +1 -1
  460. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  461. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  462. package/dist/node_modules/@allyhub/video-sdk/dist/free.js +1 -1
  463. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  464. package/dist/node_modules/@allyhub/website/dist/index.js +1 -1
  465. package/dist/node_modules/@allyhub/website/dist/website.js +2 -2
  466. package/dist/node_modules/@allyhub/website/package.json +1 -1
  467. package/dist/node_modules/@allyhub/website-extension/package.json +3 -3
  468. package/dist/node_modules/@allyhub/x-extension/package.json +1 -3
  469. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +3 -3
  470. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  471. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  472. package/dist/package.json +14 -14
  473. package/dist/self-upgrade.js +2 -0
  474. package/dist/text/batch-text.js +1 -1
  475. package/dist/text/facts-text.js +5 -5
  476. package/dist/text/format.js +2 -2
  477. package/dist/update-notice.js +3 -0
  478. package/dist/version.js +1 -1
  479. package/dist/works.js +1 -1
  480. package/editor-web/assets/{abnfDiagram-WEYOIA3C-DYaMS_BB.js → abnfDiagram-WEYOIA3C-BkVJMd53.js} +1 -1
  481. package/editor-web/assets/{architecture-WOLXFQ4H-g_Tjfl_y.js → architecture-WOLXFQ4H-C6rnaynZ.js} +1 -1
  482. package/editor-web/assets/{architectureDiagram-ZHVYKT53-CqdhofOL.js → architectureDiagram-ZHVYKT53-D3vrh8LK.js} +1 -1
  483. package/editor-web/assets/arrow-down-D-QZrqcz.js +1 -0
  484. package/editor-web/assets/arrow-up-B1zjKUHX.js +1 -0
  485. package/editor-web/assets/article-DHf6mOY_.js +7 -0
  486. package/editor-web/assets/article-Dns1-Xh-.js +3 -0
  487. package/editor-web/assets/{audio-lines-PZj77e7t.js → audio-lines-BFoW_IeO.js} +1 -1
  488. package/editor-web/assets/bar-button-CKPfx2AB.js +1 -0
  489. package/editor-web/assets/{blockDiagram-RJAE7QA3-Bc-28Bci.js → blockDiagram-RJAE7QA3-BKngt8H7.js} +1 -1
  490. package/editor-web/assets/{browser-C9NP0ZYz.js → browser-DEGNhKTV.js} +1 -1
  491. package/editor-web/assets/{c4Diagram-XDPPPE54-CTGJb8FB.js → c4Diagram-XDPPPE54-j7sUELqF.js} +1 -1
  492. package/editor-web/assets/calc-worker-Cr4a0xmt.js +168 -0
  493. package/editor-web/assets/channel-CVWSV3su.js +1 -0
  494. package/editor-web/assets/{chart-no-axes-column-Be0lFcGF.js → chart-no-axes-column-Dyy25XZ_.js} +1 -1
  495. package/editor-web/assets/chip-Bn_9JRRG.js +1 -0
  496. package/editor-web/assets/{chunk-2E7WHVMD-B2MPOVTU.js → chunk-2E7WHVMD-BXa-uRSi.js} +1 -1
  497. package/editor-web/assets/{chunk-4EMNKR2T-BUV1ZHP0.js → chunk-4EMNKR2T-B3ntcsZN.js} +1 -1
  498. package/editor-web/assets/{chunk-55XCU76K-BZlpspL5.js → chunk-55XCU76K-AMvnFwUg.js} +1 -1
  499. package/editor-web/assets/{chunk-7S6XSTFO-CpKeisWE.js → chunk-7S6XSTFO-BA6esfFu.js} +1 -1
  500. package/editor-web/assets/{chunk-AQDTSKZB-BJqwAPyo.js → chunk-AQDTSKZB-BT_vANXs.js} +1 -1
  501. package/editor-web/assets/{chunk-DSNLSHJZ-D6oPWl_W.js → chunk-DSNLSHJZ-DoUgmzGB.js} +1 -1
  502. package/editor-web/assets/{chunk-HAGFOTED-B5pk4MZF.js → chunk-HAGFOTED-DtnIrCZb.js} +1 -1
  503. package/editor-web/assets/{chunk-HNE4Q36P-DHbSPvxQ.js → chunk-HNE4Q36P-BlPwQx3_.js} +1 -1
  504. package/editor-web/assets/{chunk-NQOKRVIF-CcL_GcRA.js → chunk-NQOKRVIF-D2r7jp2r.js} +1 -1
  505. package/editor-web/assets/{chunk-UHW7PFBP-YgiOL6XE.js → chunk-UHW7PFBP-Cmc0_F5o.js} +1 -1
  506. package/editor-web/assets/{chunk-VQ5W62QI-p14b4UYc.js → chunk-VQ5W62QI-nJSMqAr0.js} +1 -1
  507. package/editor-web/assets/{chunk-WQQL4CDK-BWW0x-XH.js → chunk-WQQL4CDK-Btq2nbF6.js} +1 -1
  508. package/editor-web/assets/{chunk-YZO67HFG-oG3qd68C.js → chunk-YZO67HFG-DTbcCoGt.js} +1 -1
  509. package/editor-web/assets/{chunk-ZAUX2LTX-CpcheH0u.js → chunk-ZAUX2LTX-DVwkg-2N.js} +1 -1
  510. package/editor-web/assets/{chunk-ZCHMQSOR-cWQvLl1w.js → chunk-ZCHMQSOR-BV39jOOE.js} +1 -1
  511. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-7PG7YcdU.js → classDiagram-v2-4MYWR3UA-Cj74-fhM.js} +1 -1
  512. package/editor-web/assets/code-Ch6AB5bZ.js +1 -0
  513. package/editor-web/assets/collaborator-XiHOxwGM.js +1 -0
  514. package/editor-web/assets/{copy-CuJSs0nI.js → copy-SoaMYqsN.js} +1 -1
  515. package/editor-web/assets/{createLucideIcon-lm_6n8YT.js → createLucideIcon-euu7Wcd9.js} +1 -1
  516. package/editor-web/assets/{cynefin-EF2NZ3EQ-CtcknEQ_.js → cynefin-EF2NZ3EQ-C0CkiipV.js} +1 -1
  517. package/editor-web/assets/{cynefinDiagram-WF24UDRP-Ca7VIsjN.js → cynefinDiagram-WF24UDRP-hdsnJ4cI.js} +1 -1
  518. package/editor-web/assets/{dagre-NK4GIZVX-BzcSLtsr.js → dagre-NK4GIZVX-CC7WSgaK.js} +1 -1
  519. package/editor-web/assets/deck-DQpNIS2p.js +1 -0
  520. package/editor-web/assets/{diagram-CBK3MWTC-DpRmTGlG.js → diagram-CBK3MWTC-DmaVm13J.js} +1 -1
  521. package/editor-web/assets/{diagram-I5XIIV2D-BTrs_AX8.js → diagram-I5XIIV2D-De8jqp7b.js} +1 -1
  522. package/editor-web/assets/{diagram-ODIL2UCW-CkIVjPqH.js → diagram-ODIL2UCW-B5pBTulX.js} +1 -1
  523. package/editor-web/assets/{diagram-PFBEJUXE-BlFMbAG1.js → diagram-PFBEJUXE-BYsXg5_w.js} +1 -1
  524. package/editor-web/assets/{diagram-RJA3I4VV-D3f8VJ-D.js → diagram-RJA3I4VV-DZ8f6bYe.js} +1 -1
  525. package/editor-web/assets/{diagram-TYUNFSNR-Bbpngj6F.js → diagram-TYUNFSNR-qXHUsauD.js} +1 -1
  526. package/editor-web/assets/dist--z0ZHp4T.js +16 -0
  527. package/editor-web/assets/dist-9kuRjUTN.js +41 -0
  528. package/editor-web/assets/dist-B3rd02Cg.js +6 -0
  529. package/editor-web/assets/dist-B5GOGGEe.js +1 -0
  530. package/editor-web/assets/dist-Bx6q9kCu.js +1 -0
  531. package/editor-web/assets/dist-C4hHtrJr.js +1 -0
  532. package/editor-web/assets/dist-CCXJewsi.js +19 -0
  533. package/editor-web/assets/dist-CfK2BLl8.js +4 -0
  534. package/editor-web/assets/dist-Cmux3oJ_.js +1 -0
  535. package/editor-web/assets/dist-Cspf85KV.js +6 -0
  536. package/editor-web/assets/dist-DA72-4WB.js +82 -0
  537. package/editor-web/assets/{dist-DruvDNQe.js → dist-DAhe-kFC.js} +5 -5
  538. package/editor-web/assets/dist-DIJnhQFK.js +9 -0
  539. package/editor-web/assets/dist-DOrGo1GD.js +19 -0
  540. package/editor-web/assets/{dist-Bd8IxQPP.js → dist-DQ6RpEJD.js} +2 -2
  541. package/editor-web/assets/dist-DjiCHlSu.js +35 -0
  542. package/editor-web/assets/dist-Do4a40Wn.js +19 -0
  543. package/editor-web/assets/dist-FKEWS3Co.js +547 -0
  544. package/editor-web/assets/dist-QKd2i6kG.js +5 -0
  545. package/editor-web/assets/dist-SGnOfLhx.js +24 -0
  546. package/editor-web/assets/dist-VmVB7tl4.js +3 -0
  547. package/editor-web/assets/{docx-draw-CoK1oqQD.js → docx-draw-L54blreB.js} +1 -1
  548. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BaKj-yL6.js → ebnfDiagram-V4P3TTPT-B7-IfVI-.js} +1 -1
  549. package/editor-web/assets/{elk-QONTBCTQ-Cn2qv1_U.js → elk-QONTBCTQ-Gj_WaeBn.js} +1 -1
  550. package/editor-web/assets/{erDiagram-KYQIGQAA-Bd7AEIDo.js → erDiagram-KYQIGQAA-BDF6Qoqx.js} +1 -1
  551. package/editor-web/assets/esm-PQD5Pn8a.js +21 -0
  552. package/editor-web/assets/{eventmodeling-K75KTNOO-Sfp7_461.js → eventmodeling-K75KTNOO-elxVXXEe.js} +1 -1
  553. package/editor-web/assets/{file-question-mark-DlIjUK37.js → file-question-mark-PeZgyqkK.js} +1 -1
  554. package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +1 -0
  555. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CBqcGdHI.js → ganttDiagram-R7GPNTJY-CEogW3jW.js} +1 -1
  556. package/editor-web/assets/{gitGraph-VSP46ZUC-WTokXKTW.js → gitGraph-VSP46ZUC-Bh9cRWFa.js} +1 -1
  557. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BIWZHD9q.js → gitGraphDiagram-PDYL7XHY-BQAvdM_V.js} +1 -1
  558. package/editor-web/assets/{group-BdrTp7gi.js → group-DwM2yqU8.js} +1 -1
  559. package/editor-web/assets/hint-CbwoSBMw.js +1 -0
  560. package/editor-web/assets/index-CXisi0Cj.css +2 -0
  561. package/editor-web/assets/index-wMlfx8aT.js +28 -0
  562. package/editor-web/assets/{info-OHQRW6UA-COC6G-_J.js → info-OHQRW6UA-CdPrqere.js} +1 -1
  563. package/editor-web/assets/{infoDiagram-MVDRKAX5-DpaqdKBD.js → infoDiagram-MVDRKAX5-uwIMeP44.js} +1 -1
  564. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js → ishikawaDiagram-HPEHV2GE-rtfvqK7E.js} +1 -1
  565. package/editor-web/assets/iso-UwGLGD3F.js +1 -0
  566. package/editor-web/assets/{italic-zw4_eUNF.js → italic-BV7iHxoP.js} +1 -1
  567. package/editor-web/assets/{journeyDiagram-BOSHW7O7-DeSVfmm7.js → journeyDiagram-BOSHW7O7-mmhfIyVG.js} +1 -1
  568. package/editor-web/assets/{kanban-definition-FNSA4HC5-Bfg0lj7B.js → kanban-definition-FNSA4HC5-Fe7jBsi-.js} +1 -1
  569. package/editor-web/assets/{link-DopSU3aa.js → link-CFOv3nz-.js} +1 -1
  570. package/editor-web/assets/{mermaid-parser.core-CyhovuYE.js → mermaid-parser.core-BxOSjBH9.js} +3 -3
  571. package/editor-web/assets/{mermaid.core-Dx1fBVUG.js → mermaid.core-BOln9YdH.js} +4 -4
  572. package/editor-web/assets/{mindmap-definition-6OY57UG3-QEU2HF_m.js → mindmap-definition-6OY57UG3-M3Q1LOtO.js} +1 -1
  573. package/editor-web/assets/minus-ngE8owxs.js +1 -0
  574. package/editor-web/assets/{packet-JDAUHWVQ-ReJTa_hw.js → packet-JDAUHWVQ-Dbb0TUG6.js} +1 -1
  575. package/editor-web/assets/{pegDiagram-ECIUJNBX-Bo1jFrvb.js → pegDiagram-ECIUJNBX-BZMRpSFC.js} +1 -1
  576. package/editor-web/assets/{pie-XZMESJXO-BrtYafNA.js → pie-XZMESJXO-Ctm9XdKp.js} +1 -1
  577. package/editor-web/assets/{pieDiagram-GNMPY74T-Cj0zQqs_.js → pieDiagram-GNMPY74T-cGbs5ZTl.js} +1 -1
  578. package/editor-web/assets/progress-DZQTiRLv.js +6 -0
  579. package/editor-web/assets/{quadrantDiagram-D57K4MC3-D5npDAVn.js → quadrantDiagram-D57K4MC3-BUe_zsxT.js} +1 -1
  580. package/editor-web/assets/{radar-ABXABTNO-C8RDrRqi.js → radar-ABXABTNO-CCmKtqLs.js} +1 -1
  581. package/editor-web/assets/{railroad-I3PHUGI6-ebDrmYTK.js → railroad-I3PHUGI6-k-yhjhjA.js} +1 -1
  582. package/editor-web/assets/{railroad-abnf-LNEFI6M7-BxKuqg6V.js → railroad-abnf-LNEFI6M7-B-PvntB3.js} +1 -1
  583. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DOclnfpr.js → railroad-ebnf-DWYD2UWJ-Ds2rua1h.js} +1 -1
  584. package/editor-web/assets/{railroad-peg-JR7BVNR7-DN0A1fpq.js → railroad-peg-JR7BVNR7-jNZ2wEp2.js} +1 -1
  585. package/editor-web/assets/{railroadDiagram-Y72NRBL7-B3PjoVWw.js → railroadDiagram-Y72NRBL7-CTqSQ15w.js} +1 -1
  586. package/editor-web/assets/react-Byupo4pA.js +1 -0
  587. package/editor-web/assets/replace-CLLMtF4e.js +1 -0
  588. package/editor-web/assets/{requirementDiagram-EQYSW5RA-DLdzkQk5.js → requirementDiagram-EQYSW5RA-CUblhR5M.js} +1 -1
  589. package/editor-web/assets/ribbon-DajdQ_Ya.js +1 -0
  590. package/editor-web/assets/row-Bei9HNEe.js +1 -0
  591. package/editor-web/assets/{sankeyDiagram-SY24JHO5-Dip4Piv_.js → sankeyDiagram-SY24JHO5-nSz6zDX3.js} +1 -1
  592. package/editor-web/assets/schemas-C21MyseF.js +1 -0
  593. package/editor-web/assets/{iso-DoC-ZoBr.js → schemas-DlRAoVtq.js} +1 -1
  594. package/editor-web/assets/{scissors-B_xOiUhd.js → scissors-m6QcoEf2.js} +1 -1
  595. package/editor-web/assets/search-D75Bi2GU.js +1 -0
  596. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-QnPcoybL.js → sequenceDiagram-BLEHNHQU-DxTpOYuo.js} +1 -1
  597. package/editor-web/assets/{session-DMlLCFWg.js → session-BhClkDyr.js} +1 -1
  598. package/editor-web/assets/{sigma-DSUsJhMn.js → sigma-B4AWtnVA.js} +1 -1
  599. package/editor-web/assets/snapshots-DwGHDN3t.js +1 -0
  600. package/editor-web/assets/sound-DkR3qxSt.js +1 -0
  601. package/editor-web/assets/split-DBAbwPZ5.js +3 -0
  602. package/editor-web/assets/{square-arrow-out-up-right-DF5dvsSp.js → square-arrow-out-up-right-1NqFsNDe.js} +1 -1
  603. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-D103CiMX.js → stateDiagram-v2-A6IESKWZ-C3e14iHY.js} +1 -1
  604. package/editor-web/assets/{sticky-note-BdkIu5_D.js → sticky-note-s4QfzaBB.js} +1 -1
  605. package/editor-web/assets/surface-CIF0Ae0z.js +1 -0
  606. package/editor-web/assets/swatch-BUzr_XmH.js +1 -0
  607. package/editor-web/assets/{swimlanes-B3ENRKFQ-y4gCqEoa.js → swimlanes-B3ENRKFQ-DPPdzNzu.js} +1 -1
  608. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +8 -0
  609. package/editor-web/assets/switch-DrZxoPQS.js +1 -0
  610. package/editor-web/assets/{syntax-CU_WPKxt.js → syntax-emXV4DnN.js} +1 -1
  611. package/editor-web/assets/table-BW43XXVd.js +1 -0
  612. package/editor-web/assets/tabs-BwU2E7bU.js +1 -0
  613. package/editor-web/assets/text-wrap-Baus6l-V.js +1 -0
  614. package/editor-web/assets/textarea-BX_ax3X8.js +1 -0
  615. package/editor-web/assets/{timeline-definition-JXYKGLGB-BMp76v4V.js → timeline-definition-JXYKGLGB-DRTJ1_Er.js} +1 -1
  616. package/editor-web/assets/tolerant-DM9s0Mt1.js +1 -0
  617. package/editor-web/assets/{treeView-D4JQ5SDB-Q_GYyk0b.js → treeView-D4JQ5SDB-BYJ_m-i5.js} +1 -1
  618. package/editor-web/assets/{treemap-SAJKECNS-B5lRWdQB.js → treemap-SAJKECNS-BcU6I6Rg.js} +1 -1
  619. package/editor-web/assets/type-CvZ0HZsV.js +41 -0
  620. package/editor-web/assets/{undo-2-C47jrRp5.js → undo-2-DCbMWoug.js} +1 -1
  621. package/editor-web/assets/{usecaseDiagram-WPOLBNNX--QRllA-U.js → usecaseDiagram-WPOLBNNX-YV92pS4o.js} +1 -1
  622. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CzkATPA3.js → vennDiagram-Q3Y3IDCW-oAvfHZtf.js} +1 -1
  623. package/editor-web/assets/video-SJvDRCJK.js +1 -0
  624. package/editor-web/assets/{wardley-7MLQ67FV-BXzwcdJa.js → wardley-7MLQ67FV-BLNiqxtt.js} +1 -1
  625. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BQvC8Agx.js → wardleyDiagram-IVAIDKWA-SppgC6xW.js} +1 -1
  626. package/editor-web/assets/{whole-word-D3ZAtnkw.js → whole-word-C9TkGBCY.js} +1 -1
  627. package/editor-web/assets/{words-CaUHhQHf.js → words-BUlNNuH2.js} +3 -3
  628. package/editor-web/assets/words-zMedmPWc.js +3 -0
  629. package/editor-web/assets/workbook-BZKYx4WB.js +41 -0
  630. package/editor-web/assets/{xychartDiagram-4URNHDU4-aY-lsD5o.js → xychartDiagram-4URNHDU4-BHMn_jwJ.js} +1 -1
  631. package/editor-web/assets/{zoom-in-PgsC94hP.js → zoom-in-yAGKspfC.js} +1 -1
  632. package/editor-web/index.html +9 -8
  633. package/package.json +3 -3
  634. package/CHANGELOG.md +0 -251
  635. package/dist/commands/render.js +0 -3
  636. package/dist/node_modules/@allyhub/video-extension/dist/inspect/motion.js +0 -4
  637. package/dist/node_modules/@allyhub/video-measure/dist/still.js +0 -2
  638. package/editor-web/assets/arrow-down-B8VUPCGi.js +0 -1
  639. package/editor-web/assets/arrow-up-Ds4juY8X.js +0 -1
  640. package/editor-web/assets/article-8evPh712.js +0 -3
  641. package/editor-web/assets/article-BhRtWYMd.js +0 -7
  642. package/editor-web/assets/bar-button-J9vbfzTx.js +0 -1
  643. package/editor-web/assets/calc-worker-oEIqrrTM.js +0 -45
  644. package/editor-web/assets/channel-wIj_OqDm.js +0 -1
  645. package/editor-web/assets/chart-amT4lgX3.js +0 -2
  646. package/editor-web/assets/chart-file-dGiRgFcH.js +0 -1
  647. package/editor-web/assets/code-CD-CbJG9.js +0 -1
  648. package/editor-web/assets/collaborator-BU4qU7O3.js +0 -1
  649. package/editor-web/assets/deck-C7fN0Qtn.js +0 -1
  650. package/editor-web/assets/dist-3iovns9K.js +0 -16
  651. package/editor-web/assets/dist-BkHnbOEj.js +0 -4
  652. package/editor-web/assets/dist-BvOrNcK-.js +0 -19
  653. package/editor-web/assets/dist-CEIszq39.js +0 -1
  654. package/editor-web/assets/dist-CU5RbLNH.js +0 -1
  655. package/editor-web/assets/dist-CWZj8IAm.js +0 -1
  656. package/editor-web/assets/dist-C_Mtrnif.js +0 -17
  657. package/editor-web/assets/dist-CdqpwdCV.js +0 -24
  658. package/editor-web/assets/dist-CjT76RAw.js +0 -43
  659. package/editor-web/assets/dist-CpzEn9T8.js +0 -6
  660. package/editor-web/assets/dist-CrFYWl5-.js +0 -3
  661. package/editor-web/assets/dist-D3C6FyrO.js +0 -82
  662. package/editor-web/assets/dist-D4eBFGVL.js +0 -1
  663. package/editor-web/assets/dist-DTcjb3cP.js +0 -18
  664. package/editor-web/assets/dist-D_WSM29I.js +0 -17
  665. package/editor-web/assets/dist-Dp_9ISjP.js +0 -531
  666. package/editor-web/assets/dist-J-tPYKGS.js +0 -5
  667. package/editor-web/assets/dist-YW8hS4IM.js +0 -9
  668. package/editor-web/assets/esm-Cjv8ogpP.js +0 -21
  669. package/editor-web/assets/file-exclamation-point-_L3ElCJ5.js +0 -1
  670. package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +0 -1
  671. package/editor-web/assets/hint-rlht0uxG.js +0 -1
  672. package/editor-web/assets/index-BQWZnyAQ.js +0 -28
  673. package/editor-web/assets/index-Dvh1t1om.css +0 -2
  674. package/editor-web/assets/minus-CbPnUIOy.js +0 -1
  675. package/editor-web/assets/progress-CwKcXARv.js +0 -6
  676. package/editor-web/assets/props-form-BpSXbrSF.js +0 -1
  677. package/editor-web/assets/react-Edyoga_4.js +0 -1
  678. package/editor-web/assets/row-C_svyL8o.js +0 -1
  679. package/editor-web/assets/schemas-CQ_UU8-Z.js +0 -1
  680. package/editor-web/assets/search-Ba2BbT6T.js +0 -1
  681. package/editor-web/assets/slides-7xWhREpt.js +0 -1
  682. package/editor-web/assets/snapshots-BLX4NTQC.js +0 -1
  683. package/editor-web/assets/sound-bTlco_K3.js +0 -1
  684. package/editor-web/assets/split-tFGKk-x8.js +0 -3
  685. package/editor-web/assets/strikethrough-BwXWi4zg.js +0 -1
  686. package/editor-web/assets/surface-DtCjIlrq.js +0 -1
  687. package/editor-web/assets/svg-CWIBMIQ9.js +0 -1
  688. package/editor-web/assets/swatch-DhztHwPU.js +0 -1
  689. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +0 -8
  690. package/editor-web/assets/switch-8MU4Nfxe.js +0 -1
  691. package/editor-web/assets/table-DRbddzx0.js +0 -1
  692. package/editor-web/assets/tabs-CuEawka3.js +0 -1
  693. package/editor-web/assets/tag-CIfWT8B_.js +0 -1
  694. package/editor-web/assets/text-align-start-Cic2-TLh.js +0 -1
  695. package/editor-web/assets/textarea-D7TnPwv1.js +0 -1
  696. package/editor-web/assets/video-D0uTbHWx.js +0 -1
  697. package/editor-web/assets/words-XlXG79Ur.js +0 -3
  698. package/editor-web/assets/workbook-CiCXkjmN.js +0 -45
  699. package/editor-web/assets/x-DlhyIKuu.js +0 -41
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as ge}from"node:crypto";import{zipSync as Ae}from"fflate";import{AUTOSHAPE_STYLE as Ne,colorOfFile as xe,spaceOfFile as ye,CONNECTOR_STYLE as Fe,isConnectorGeometry as re,joinPath as ne,placeholderFrame as ze,plainLevels as He,Pt as Ue,DEFAULT_TABLE_STYLE as Ge,TABLE_STYLES as Xe}from"@allyhub/slides-core";import{AUDIO_ICON as Ye}from"./audio-icon.js";import{chartBook as Je,chartXml as We}from"./charts.js";import{asFace as Ze,fontInfo as qe,eotOf as Ke}from"./fonts.js";import{NO_PARAGRAPHS as Ve,shapeXml as _e,treeXml as de}from"./shapes.js";import{bodyOfStyle as Qe,bodyProps as ie,bodyUnder as se,LINK as et,SLIDE_LINK as tt,SLIDE_NUMBER as nt,levelOf as be,listStyle as F,txBody as Y}from"./text.js";import{tableStyleXml as it}from"./table-styles.js";import{themeXml as ke}from"./theme.js";import{timingXml as at,transitionXml as ot}from"./timing.js";import{HEAD as v,NS as rt,PML as j,color as dt,el as i,esc as st,fill as Se,gradientFill as lt,unesc as we}from"./xml.js";const q={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",emf:"image/x-emf",wmf:"image/x-wmf"},$e={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime"},ve={mp3:"audio/mpeg",m4a:"audio/mp4",wav:"audio/wav",aac:"audio/aac"},M=e=>(e.split(".").pop()??"").toLowerCase(),pt=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],c={hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",audio:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},S={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class R{list=[];linked(t,o){return t.replaceAll(new RegExp(`r:id="${et}([^"]*)"`,"gu"),(n,d)=>`r:id="${this.add(c.hyperlink,we(d),!0)}"`).replaceAll(new RegExp(`r:id="${tt}([^"]*)"`,"gu"),(n,d)=>{const r=o?.(we(d));return`r:id="${r===void 0?"":this.add(c.slide,r)}"`})}add(t,o,n=!1){const d=this.list.find(s=>s.type===t&&s.target===o);if(d)return d.id;const r=`rId${String(this.list.length+1)}`;return this.list.push({id:r,type:t,target:o,...n?{external:n}:{}}),r}xml(){return v+i("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>i("Relationship",{Id:t.id,Type:t.type,Target:t.target,TargetMode:t.external?"External":void 0})))}}class ct{list=[];add(t,o){return this.list.push({chart:t,frame:o}),`../charts/chart${String(this.list.length)}.xml`}}class mt{parts=new Map;byHash=new Map;add(t,o,n,d){const r=ge("sha256").update(t).digest("hex"),s=this.byHash.get(`${n}:${r}`);if(s)return s;const l=d?.split("/").pop()?.replace(/\.[^.]*$/u,"").replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,""),f=l===void 0||l===""?void 0:l;let g=`${f??`${n}${String(this.parts.size+1)}`}.${o}`;for(let P=2;this.parts.has(`ppt/media/${g}`);P++)g=`${f??n}-${String(P)}.${o}`;return this.parts.set(`ppt/media/${g}`,t),this.byHash.set(`${n}:${r}`,`../media/${g}`),`../media/${g}`}}function Me(e){return e.kind==="component"||e.kind==="movie"||e.kind==="audio"||e.kind==="item"?!1:e.kind==="picture"?q[M(e.media?.path??"")]!==void 0:!0}function le(e){return e.kind==="component"||e.kind==="movie"||e.kind==="item"?!0:e.kind==="picture"?q[M(e.media?.path??"")]===void 0:!1}export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(o=>le(o)).map(o=>({key:`${t.id}/${o.name}`,slide:t.id,shape:o.name,frame:o.frame})))}export function filesOf(e){const t=new Set;for(const o of e.masters)for(const n of[...o.shapes,...o.layouts.flatMap(d=>d.shapes)])n.media&&Me(n)&&t.add(ne(n.media.base,n.media.path)),n.picture_fill&&t.add(ne(n.picture_fill.base,n.picture_fill.path));for(const o of e.slides){o.background_picture!==void 0&&t.add(o.background_picture);for(const n of o.shapes)n.media&&(n.kind==="picture"||n.kind==="movie"||n.kind==="audio")&&t.add(n.media.path),n.picture_fill&&t.add(n.picture_fill.path)}return[...t].sort()}const ft=i("p:nvGrpSpPr",{},i("p:cNvPr",{id:1,name:""}),i("p:cNvGrpSpPr"),i("p:nvPr")),ut=i("p:grpSpPr",{},i("a:xfrm",{},i("a:off",{x:0,y:0}),i("a:ext",{cx:0,cy:0}),i("a:chOff",{x:0,y:0}),i("a:chExt",{cx:0,cy:0}))),K=e=>i("p:spTree",{},ft,ut,...e),pe={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},ae=e=>i("p:bg",{},i("p:bgPr",{},i("a:solidFill",{},dt(e)),i("a:effectLst")));function ht(e,t,o){if(e.background_picture!==void 0){const n=o(e.background_picture);if(n!==void 0)return i("p:bg",{},i("p:bgPr",{},i("a:blipFill",{dpi:0,rotWithShape:1},i("a:blip",{"r:embed":n}),i("a:srcRect"),i("a:stretch",{},i("a:fillRect"))),i("a:effectLst")))}return e.background_gradient?i("p:bg",{},i("p:bgPr",{},lt(e.background_gradient),i("a:effectLst"))):ce(e.background,t)?"":ae(e.background)}const ce=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Pe(e){return{...e.inner_shadow?{innerShadow:e.inner_shadow}:{},...e.glow?{glow:e.glow}:{},...e.reflection?{reflection:e.reflection}:{},...e.soft_edges===void 0?{}:{softEdges:e.soft_edges},...e.pattern?{pattern:e.pattern}:{},...e.fill_transparency===void 0?{}:{fillTransparency:e.fill_transparency,...e.fill===void 0?{}:{fill:e.fill}},...e.gradient?{gradient:e.gradient}:{},...e.shadow===void 0?{}:{shadow:e.shadow}}}function Le(e,t,o,n,d){if(!e)return{};const r=n(e.path);return!r||q[M(e.path)]===void 0?(d(`${e.path} ${r?"is of a kind PowerPoint does not read":"is not in the project"}, so the file leaves the shape's picture fill out`),{}):{pictureFill:{image:t.add(c.image,o.add(r,M(e.path),"image",e.path)),...e.tile?{tile:e.tile}:{},...e.transparency===void 0?{}:{transparency:e.transparency}}}}function oe(e){const t=o=>({...e.fill===void 0||"fill"in o&&ce(e.fill,o.fill)?{}:{fill:e.fill},...e.line===void 0||ce(e.line,o.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===o.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?re(e.geometry)?{style:"connector",...t(Fe)}:{style:"shape",...t(Ne)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const gt=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(o,n)=>{const d=e[n]??{},r=t[n]??{},s={...d.font,...r.font};return{...d,...r,...Object.keys(s).length>0?{font:s}:{}}});function Ee(e,t,o,n,d,r,s,l){const f=n!==void 0&&d!==void 0&&JSON.stringify(n.text_styles.other)!==JSON.stringify(d.text_styles.other);return Y("p:txBody",ie(se(t,l),s,e==="autoshape"?{rtlCol:0}:{}),F(f?gt(n.text_styles.other,t.levels):t.levels),o,r,l)}const xt="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",yt=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function Ie(e,t){const o=new Map;return e.rows.forEach((n,d)=>{n.cells.forEach((r,s)=>{if(!r.spanned)for(let l=0;l<(r.span_height??1);l++)for(let f=0;f<(r.span_width??1);f++)(l>0||f>0)&&o.set(`${String(d+l)},${String(s+f)}`,{row:d,col:s})})}),i("a:tbl",{},i("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},i("a:tableStyleId",{},e.style??xt)),i("a:tblGrid",{},...e.columns.map(n=>i("a:gridCol",{w:n}))),...e.rows.map((n,d)=>i("a:tr",{h:n.height},...n.cells.map((r,s)=>{const l=r.text.own??r.text,f=Ce(r.fileText,r.text.style),g=r.spanned?o.get(`${String(d)},${String(s)}`):void 0;return i("a:tc",{gridSpan:r.span_width,rowSpan:r.span_height,hMerge:g&&s>g.col?1:void 0,vMerge:g&&d>g.row?1:void 0},Y("a:txBody",i("a:bodyPr"),i("a:lstStyle"),r.text.paragraphs,t,f),i("a:tcPr",{marL:l.margin_left,marR:l.margin_right,marT:l.margin_top,marB:l.margin_bottom,anchor:se(l,f).vertical_anchor},...yt.map(([P,z])=>{const H=r.borders?.[P];return H?i(z,{w:H.width},Se(H.color)):""}),r.fill===void 0?"":Se(r.fill)))}))))}const me=e=>e.group===void 0?{}:{group:e.group},V=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_cap===void 0?{}:{lineCap:e.line_cap},...e.line_join===void 0?{}:{lineJoin:e.line_join},...e.line_compound===void 0?{}:{lineCompound:e.line_compound},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end},...e.line_begin_size===void 0?{}:{lineBeginSize:e.line_begin_size},...e.line_end_size===void 0?{}:{lineEndSize:e.line_end_size}});function fe(e,t,o){return e.map(n=>{const d=n.kind==="cxn"?t.get(n.id)?.connect:void 0;if(!d)return n;const r=f=>{const g=f&&o(f.shape);return f&&g!==void 0?{id:g,idx:f.site}:void 0},s=r(d.begin),l=r(d.end);return s||l?{...n,connect:{...s?{begin:s}:{},...l?{end:l}:{}}}:n})}const Te=e=>new Map(e.map((t,o)=>[o+2,t])),De=e=>t=>e.find(o=>o.name===t)?.id;function Oe(e,t,o,n,d,r,s){const l={...Pe(e),...Le(e.picture_fill&&{...e.picture_fill,path:ne(e.picture_fill.base,e.picture_fill.path)},o,n,d,f=>{s.left(`${s.where} › ${e.name}: ${f}`)}),id:t,name:e.name,...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation},...e.flip?{flip:e.flip}:{}};if(e.kind==="placeholder"&&e.placeholder){const f=s.on==="master"?{...ze(e.placeholder.type),...e.text}:e.text;return{...l,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...V(e),...e.fill===void 0&&e.line===void 0?{}:{geometry:e.geometry??"rect"},text:Y("p:txBody",f?ie(f):i("a:bodyPr"),F(f?.levels??[]),e.placeholder.type==="sldNum"?nt:Ve,r)}}if(Me(e)){if(e.table)return{...l,kind:"table",table:Ie(e.table,r)};if(e.kind==="picture"&&e.media){const f=ne(e.media.base,e.media.path),g=d(f);if(!g){s.left(`${s.where} › ${e.name}: ${f} is not in the project, so the file leaves the picture out`);return}return{...l,kind:"pic",picture:{image:o.add(c.image,n.add(g,M(e.media.path),"image",e.media.path))},descr:e.media.path.split("/").pop()??""}}return!e.path&&re(e.geometry)?{...l,kind:"cxn",geometry:e.geometry??"line",...e.adjustments?{adjustments:e.adjustments}:{},...oe(e),...V(e)}:{...l,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...oe(e),...V(e),...e.text?{text:Ee(e.kind,e.text,e.text.paragraphs,s.master,s.first,r)}:{}}}}function Ce(e,t){if(!e)return;const o=e.numbered!==void 0||e.bullet!==void 0&&e.bullet!==!1;return{font:{...e.size===void 0?{}:{size:Ue(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline},...e.strike===void 0?{}:{strike:e.strike},...e.caps===void 0?{}:{caps:e.caps},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:{color:xe(e.color)}},paragraph:{...e.align===void 0?{}:{alignment:e.align},...e.line_spacing===void 0?{}:{line_spacing:{lines:e.line_spacing}},...e.space_before===void 0?{}:{space_before:ye(e.space_before)},...e.space_after===void 0?{}:{space_after:ye(e.space_after)},...e.bullet_color===void 0?{}:{bullet_color:xe(e.bullet_color)},...e.bullet_size===void 0?{}:{bullet_size:e.bullet_size},...e.start_at===void 0?{}:{start_at:e.start_at},...e.numbered!==void 0?{numbered:e.numbered}:e.bullet===void 0?{}:{bullet:e.bullet===!1?null:e.bullet}},...o&&t?{levels:t.levels.map(n=>({margin_left:n.margin_left,indent:n.indent}))}:{},...e.anchor===void 0?{}:{anchor:e.anchor},...e.orientation===void 0?{}:{orientation:e.orientation}}}function _t(e,t,o,n,d,r,s,l,f){const g=`${e.id}/${t.name}`,P=r.deck.fitted[g];if(t.level!=="slide"&&!le(t))return;const z=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},Q=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},w={...Pe(t),...Le(t.picture_fill,n,d,r.file,u=>{r.left?.(`slide ${e.id} › ${t.name}: ${u}`)}),id:o,name:t.name,...z,...Q,...t.rotation===void 0?{}:{rotation:t.rotation},...t.flip?{flip:t.flip}:{},...t.alt===void 0?{}:{descr:t.alt},...t.locked?{locked:!0}:{},...t.link===void 0?{}:{link:t.link}},J=()=>{const u=r.pictures.get(g);return u?{image:n.add(c.image,d.add(u,"png","image"))}:void 0};if(t.table)return{...w,kind:"table",table:Ie(t.table,s)};if(t.chart)return{...w,frame:t.frame,kind:"chart",chart:n.add(c.chart,f.add(t.chart,t.frame))};const B=u=>r.left?.(`${g}: ${u}`);if(t.kind==="audio"&&t.media){const u=ve[M(t.media.path)]!==void 0,I=u?r.file(t.media.path):void 0;if(!I){B(u?`${t.media.path} is not in the project, so the file leaves the sound out`:`${t.media.path} is a sound PowerPoint does not play, so the file leaves it out`);return}const T=d.add(I,M(t.media.path),"media",t.media.path),D=t.media.playback;return l.push({spid:o,name:t.name,playback:D,sound:!0}),{...w,frame:t.frame,kind:"pic",picture:{image:n.add(c.image,d.add(Ye,"png","image"))},video:{link:n.add(c.audio,T),media:n.add(c.media,T),sound:!0,...D?.trim?{trim:D.trim}:{}}}}if(t.kind==="movie"&&t.media){const u=J(),I=$e[M(t.media.path)]!==void 0,T=I?r.file(t.media.path):void 0;if(!u){B("no picture of the video was drawn, so the file leaves it out");return}if(!T)return B(I?`${t.media.path} is not in the project, so the file holds the video's picture alone`:`${t.media.path} is a video PowerPoint does not play, so the file holds its picture alone`),{...w,frame:t.frame,kind:"pic",picture:u};const D=d.add(T,M(t.media.path),"media",t.media.path),E=t.media.playback;return l.push({spid:o,name:t.name,playback:E}),{...w,frame:t.frame,kind:"pic",picture:{image:u.image},video:{link:n.add(c.video,D),media:n.add(c.media,D),...E?.trim?{trim:E.trim}:{}}}}if(le(t)){const u=J(),I=r.movies?.get(g);if(u&&I){const T=d.add(I.bytes,"mp4","media");return l.push({spid:o,name:t.name}),{...w,frame:t.frame,kind:"pic",picture:{image:u.image},video:{link:n.add(c.video,T),media:n.add(c.media,T)}}}return u||B("no picture of it was drawn, so the file leaves it out"),u?{...w,frame:t.frame,kind:"pic",picture:u}:void 0}if(t.kind==="picture"&&t.media){const u=r.file(t.media.path);if(!u){B(`${t.media.path} is not in the project, so the file leaves the picture out`);return}return{...w,kind:"pic",picture:{image:n.add(c.image,d.add(u,M(t.media.path),"image",t.media.path)),...t.media.crop?{crop:t.media.crop}:{}},descr:t.alt??t.media.path.split("/").pop()??""}}if(!t.path&&re(t.geometry))return{...w,kind:"cxn",geometry:t.geometry??"line",...t.adjustments?{adjustments:t.adjustments}:{},...oe(t),...V(t)};const L=t.text,ee=r.deck.masters.find(u=>u.name===e.master),U=Ce(t.fileText,L?.style),W=L?t.placeholder?Y("p:txBody",ie(se({},U),P),i("a:lstStyle"),L.paragraphs,s,U):L.own?Ee(t.kind,L.own,L.paragraphs,ee,r.deck.masters[0],s,P,U):Y("p:txBody",ie(Qe(L.style),P),F(L.style.levels.map(be)),L.paragraphs,s):void 0,Z=t.sources.frame.from==="code",te=t.fill!==void 0&&(Z||t.sources.fill?.from==="slide"),A=t.line!==void 0&&(Z||t.sources.line?.from==="slide");return{...w,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||te||A?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...V(t),...t.placeholder?{...te?{fill:t.fill}:{},...A?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:oe(t),...W?{text:W}:{}}}const bt={cx:6858e3,cy:9144e3};function je(e,t){const o=_e({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),n=_e({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:Y("p:txBody",i("a:bodyPr"),i("a:lstStyle"),(e??"").split(`
3
- `).map(d=>({runs:[{text:d}],level:0})),t)});return[o,n]}export function pptxParts(e){const{deck:t}=e,o=t.lang?.split("-").map((a,m)=>m===0?a.toLowerCase():a.toUpperCase()).join("-"),n=new Map,d=new mt,r=new ct,s=[],l=new R,f=[],g=new Map;let P=2147483648;const z=a=>{const m=t.slides.findIndex(x=>x.id===a);return m<0?void 0:`../slides/slide${String(m+1)}.xml`};t.masters.forEach((a,m)=>{const x=m+1,$=P++,y=`ppt/slideMasters/slideMaster${String(x)}.xml`,_=`ppt/theme/theme${String(x)}.xml`;n.set(_,ke(t.theme)),s.push([_,S.theme]);const k=new R,C=[];a.layouts.forEach(b=>{const N=g.size+1,p=`ppt/slideLayouts/slideLayout${String(N)}.xml`;g.set(b,p);const h=new R;h.add(c.slideMaster,`../slideMasters/slideMaster${String(x)}.xml`);const O=b.shapes.flatMap((ue,Re)=>{const he=Oe(ue,Re+2,h,d,e.file,o,{master:a,first:e.deck.masters[0],on:"layout",where:`layout "${b.name}"`,left:Be=>e.left?.(Be)});return he?[{...he,...me(ue)}]:[]});n.set(p,v+i("p:sldLayout",{...j,...b.display_master_shapes===!1?{showMasterSp:0}:{},preserve:1},i("p:cSld",{name:b.name},b.background===void 0?"":ae(b.background),h.linked(K(de(fe(O,Te(b.shapes),De(O)))),z)),i("p:clrMapOvr",{},b.color_map&&Object.keys(b.color_map).length>0?i("a:overrideClrMapping",{...pe,...a.color_map,...b.color_map}):i("a:masterClrMapping")))),n.set(`ppt/slideLayouts/_rels/slideLayout${String(N)}.xml.rels`,h.xml()),s.push([p,S.slideLayout]),C.push(i("p:sldLayoutId",{id:P++,"r:id":k.add(c.slideLayout,`../slideLayouts/slideLayout${String(N)}.xml`)}))}),k.add(c.theme,`../theme/theme${String(x)}.xml`);const G=a.shapes.flatMap((b,N)=>{const p=Oe(b,N+2,k,d,e.file,o,{master:a,first:e.deck.masters[0],on:"master",where:`master "${a.name}"`,left:h=>e.left?.(h)});return p?[{...p,...me(b)}]:[]}),X=a.text_styles;n.set(y,v+i("p:sldMaster",j,i("p:cSld",{name:a.name},ae(a.background),k.linked(K(de(fe(G,Te(a.shapes),De(G)))),z)),i("p:clrMap",{...pe,...a.color_map}),i("p:sldLayoutIdLst",{},...C),i("p:txStyles",{},F(X.title,"p:titleStyle"),F(X.body,"p:bodyStyle"),F(X.other,"p:otherStyle")))),n.set(`ppt/slideMasters/_rels/slideMaster${String(x)}.xml.rels`,k.xml()),s.push([y,S.slideMaster]),f.push(i("p:sldMasterId",{id:$,"r:id":l.add(c.slideMaster,`slideMasters/slideMaster${String(x)}.xml`)}))});const H=t.slides.some(a=>a.notes!==void 0),Q=`ppt/theme/theme${String(t.masters.length+1)}.xml`;let w="";if(H){n.set(Q,ke(t.theme)),s.push([Q,S.theme]);const a=new R;a.add(c.theme,`../theme/theme${String(t.masters.length+1)}.xml`),n.set("ppt/notesMasters/notesMaster1.xml",v+i("p:notesMaster",j,i("p:cSld",{},ae("lt1"),K(je(void 0,o))),i("p:clrMap",pe))),n.set("ppt/notesMasters/_rels/notesMaster1.xml.rels",a.xml()),s.push(["ppt/notesMasters/notesMaster1.xml",S.notesMaster]),w=l.add(c.notesMaster,"notesMasters/notesMaster1.xml")}const J=[],B=new Map(t.masters.flatMap(a=>a.layouts.map(m=>[m.name,m]))),L=a=>{const m=new Set,x=t.slides[a];for(const[$,y]of[[t.slides[a-1],x],[x,t.slides[a+1]]])if($&&y&&y.transition?.type==="morph")for(const _ of $.shapes)_.level==="slide"&&y.shapes.some(k=>k.name===_.name)&&m.add(_.name);return m};t.slides.forEach((a,m)=>{const x=m+1,$=`ppt/slides/slide${String(x)}.xml`,y=new R,_=B.get(a.layout),k=_?g.get(_):void 0;k&&y.add(c.slideLayout,`../${k.slice(4)}`);const C=[],G=new Map,X=new Map;let b=1;const N=a.shapes.flatMap(p=>{const h=_t(a,p,++b,y,d,e,o,C,r);if(!h)return b--,[];G.set(p.name,h.id),X.set(h.id,p);const O=L(m).has(p.name)?{name:`!!${h.name}`}:{};return[{...h,...me(p),...O}]});if(a.notes!==void 0){const p=`ppt/notesSlides/notesSlide${String(x)}.xml`,h=new R;h.add(c.notesMaster,"../notesMasters/notesMaster1.xml"),h.add(c.slide,`../slides/slide${String(x)}.xml`),n.set(p,v+i("p:notes",j,i("p:cSld",{},K(je(a.notes,o))),i("p:clrMapOvr",{},i("a:masterClrMapping")))),n.set(`ppt/notesSlides/_rels/notesSlide${String(x)}.xml.rels`,h.xml()),s.push([p,S.notesSlide]),y.add(c.notesSlide,`../notesSlides/notesSlide${String(x)}.xml`)}n.set($,v+i("p:sld",{...j,show:a.hidden?0:void 0},i("p:cSld",{name:a.id},ht(a,_?.background??t.masters.find(p=>p.name===a.master)?.background,p=>{const h=e.file(p);if(h&&q[M(p)]!==void 0)return y.add(c.image,d.add(h,M(p),"image",p));e.left?.(`${a.id}: its background picture ${p} ${h?"is of a kind PowerPoint does not read":"is not in the project"}, so the slide has its layout's background`)}),y.linked(K(de(fe(N,X,p=>G.get(p)))),p=>{const h=t.slides.findIndex(O=>O.id===p);return h<0?void 0:`slide${String(h+1)}.xml`})),i("p:clrMapOvr",{},i("a:masterClrMapping")),ot(a.transition,a.advance),at(a.animations,C,p=>G.get(p),p=>a.shapes.find(h=>h.name===p)?.text!==void 0,t,new Map(a.shapes.flatMap(p=>{const h=e.movies?.get(`${a.id}/${p.name}`),O=(p.kind==="movie"||p.kind==="audio")&&p.media?e.lengths?.get(p.media.path):h?.seconds;return O===void 0?[]:[[p.name,O]]}))))),n.set(`ppt/slides/_rels/slide${String(x)}.xml.rels`,y.xml()),s.push([$,S.slide]),J.push(i("p:sldId",{id:256+m,"r:id":l.add(c.slide,`slides/slide${String(x)}.xml`)}))}),l.add(c.theme,"theme/theme1.xml"),l.add(c.presProps,"presProps.xml"),l.add(c.viewProps,"viewProps.xml"),l.add(c.tableStyles,"tableStyles.xml");const ee=new Map;let U=0;const W=(e.fonts??[]).flatMap(a=>{const m=pt.flatMap(([x,$,y])=>{const _=a[x]&&Ze(a[x],a.typeface,y),k=_&&qe(_);if(!_||!k)return[];const C=`fonts/font${String(++U)}.fntdata`;return ee.set(`ppt/${C}`,Ke(_,k,a.typeface,y)),[i($,{"r:id":l.add(c.font,C)})]});return m.length===0?[]:[i("p:embeddedFont",{},i("p:font",{typeface:a.typeface}),...m)]}),Z=W.length===0?"":i("p:embeddedFontLst",{},...W);n.set("ppt/presentation.xml",v+i("p:presentation",{...j,...Z===""?{}:{embedTrueTypeFonts:1},saveSubsetFonts:1},i("p:sldMasterIdLst",{},...f),w===""?"":i("p:notesMasterIdLst",{},i("p:notesMasterId",{"r:id":w})),i("p:sldIdLst",{},...J),i("p:sldSz",{cx:t.width,cy:t.height}),i("p:notesSz",bt),Z,e.deck.masters[0]?F(He(e.deck.masters[0]).map(be),"p:defaultTextStyle"):"",sectionsXml(t.slides))),n.set("ppt/_rels/presentation.xml.rels",l.xml()),s.push(["ppt/presentation.xml",S.presentation]),n.set("ppt/presProps.xml",v+i("p:presentationPr",j)),n.set("ppt/viewProps.xml",v+i("p:viewPr",j));const te=new Set([...t.slides.flatMap(a=>a.shapes),...e.deck.masters.flatMap(a=>[...a.shapes,...a.layouts.flatMap(m=>m.shapes)])].flatMap(a=>a.table?.style===void 0?[]:[a.table.style]));n.set("ppt/tableStyles.xml",v+i("a:tblStyleLst",{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main",def:Ge},...Xe.filter(a=>te.has(a.id)).map(it))),s.push(["ppt/presProps.xml",S.presProps]),s.push(["ppt/viewProps.xml",S.viewProps]),s.push(["ppt/tableStyles.xml",S.tableStyles]),n.set("docProps/core.xml",v+i("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":`<dc:title>${st(e.title)}</dc:title>`)),n.set("docProps/app.xml",v+i("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},i("Application",{},"AllyHub"),i("Slides",{},String(t.slides.length)),i("Notes",{},String(t.slides.filter(a=>a.notes!==void 0).length)),i("HiddenSlides",{},String(t.slides.filter(a=>a.hidden).length)))),s.push(["docProps/core.xml",S.core]),s.push(["docProps/app.xml",S.app]);const A=new R;A.add(c.officeDocument,"ppt/presentation.xml"),A.add(c.core,"docProps/core.xml"),A.add(c.app,"docProps/app.xml");const u=new Map;r.list.forEach(({chart:a,frame:m},x)=>{const $=String(x+1),y=`ppt/charts/chart${$}.xml`,_=new R,k=`Microsoft_Excel_Sheet${$}.xlsx`;u.set(`ppt/embeddings/${k}`,Je(a)),n.set(y,We(a,m,_.add(c.package,`../embeddings/${k}`))),n.set(`ppt/charts/_rels/chart${$}.xml.rels`,_.xml()),s.push([y,S.chart])});const I=new Set([...d.parts.keys(),...u.keys()].map(M)),T=v+i("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},i("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),i("Default",{Extension:"xml",ContentType:"application/xml"}),U>0?i("Default",{Extension:"fntdata",ContentType:"application/x-fontdata"}):"",...[...I].sort().map(a=>i("Default",{Extension:a,ContentType:a==="xlsx"?S.workbook:q[a]??$e[a]??ve[a]??"application/octet-stream"})),...s.map(([a,m])=>i("Override",{PartName:`/${a}`,ContentType:m}))),D=new TextEncoder,E=new Map;E.set("[Content_Types].xml",D.encode(T)),E.set("_rels/.rels",D.encode(A.xml()));for(const[a,m]of n)E.set(a,D.encode(m));for(const[a,m]of d.parts)E.set(a,m);for(const[a,m]of u)E.set(a,m);for(const[a,m]of ee)E.set(a,m);return E}const kt=new Date(1980,0,1);export function writePptx(e){const t={};for(const[o,n]of pptxParts(e))t[o]=[n,{level:/\.(png|jpe?g|gif|mp4|m4v|mov)$/u.test(o)?0:6,mtime:kt}];return Ae(t)}const St="{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";function wt(e,t){const o=ge("sha256").update(`${String(e)}:${t}`).digest("hex").toUpperCase();return`{${o.slice(0,8)}-${o.slice(8,12)}-4${o.slice(13,16)}-8${o.slice(17,20)}-${o.slice(20,32)}}`}export function sectionsXml(e){if(!e.some(o=>o.section!==void 0))return"";const t=[];return e.forEach((o,n)=>{(o.section!==void 0||t.length===0)&&t.push({name:o.section??"Default Section",ids:[]}),t.at(-1)?.ids.push(256+n)}),i("p:extLst",{},i("p:ext",{uri:St},i("p14:sectionLst",{"xmlns:p14":rt.p14},...t.map((o,n)=>i("p14:section",{name:o.name,id:wt(n,o.name)},i("p14:sldIdLst",{},...o.ids.map(d=>i("p14:sldId",{id:d}))))))))}
2
+ import{createHash as ke}from"node:crypto";import{zipSync as Ue}from"fflate";import{fitCrop as Se,imageSize as Ye,svgSize as Ge}from"./image-size.js";import{AUTOSHAPE_STYLE as Je,colorOfFile as pe,spaceOfFile as we,lineSpacingOfFile as We,paragraphLookKeys as qe,bodyOfFile as Ke,CONNECTOR_STYLE as Ze,isConnectorGeometry as ce,joinPath as J,hasBackgroundFill as Ve,placeholderFrame as Qe,plainLevels as et,Pt as ve,DEFAULT_TABLE_STYLE as tt,TABLE_STYLES as nt,CHARTEX_COLORS_REL as it,CHARTEX_COLORS_TYPE as at,CHARTEX_REL as ot,CHARTEX_STYLE_REL as rt,CHARTEX_STYLE_TYPE as dt,CHARTEX_TYPE as lt,chartExColorsXml as st,chartExRequires as pt,chartExStyleXml as ct,isExtended as Q}from"@allyhub/slides-core";import{AUDIO_ICON as mt}from"./audio-icon.js";import{chartBook as ft,chartExXml as ut,chartXml as ht}from"./charts.js";import{asFace as gt,fontInfo as xt,eotOf as yt}from"./fonts.js";import{NO_PARAGRAPHS as _t,shapeXml as $e,treeXml as me}from"./shapes.js";import{bodyOfStyle as bt,bodyProps as de,bodyUnder as fe,LINK as kt,SLIDE_LINK as St,SLIDE_NUMBER as wt,levelOf as Me,listStyle as Y,txBody as W}from"./text.js";import{tableStyleXml as vt}from"./table-styles.js";import{themeXml as Pe}from"./theme.js";import{timingXml as $t,transitionXml as Mt}from"./timing.js";import{HEAD as E,NS as Pt,PML as A,color as Et,el as r,esc as Lt,fill as Ee,gradientFill as Tt,patternFill as Ot,pictureFill as Ct,unesc as Le}from"./xml.js";const ee={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",emf:"image/x-emf",wmf:"image/x-wmf"},jt="image/svg+xml",Te={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime",wmv:"video/x-ms-wmv",avi:"video/x-msvideo",mpg:"video/mpeg",mpeg:"video/mpeg"},Oe={mp3:"audio/mpeg",m4a:"audio/mp4",wav:"audio/wav",aac:"audio/aac"},v=e=>(e.split(".").pop()??"").toLowerCase(),It=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],p={hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",chartEx:ot,package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",audio:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},$={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",chartEx:lt,workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class z{list=[];linked(t,i){return t.replaceAll(new RegExp(`r:id="${kt}([^"]*)"`,"gu"),(n,d)=>`r:id="${this.add(p.hyperlink,Le(d),!0)}"`).replaceAll(new RegExp(`r:id="${St}([^"]*)"`,"gu"),(n,d)=>{const l=i?.(Le(d));return`r:id="${l===void 0?"":this.add(p.slide,l)}"`})}add(t,i,n=!1){const d=this.list.find(o=>o.type===t&&o.target===i);if(d)return d.id;const l=`rId${String(this.list.length+1)}`;return this.list.push({id:l,type:t,target:i,...n?{external:n}:{}}),l}xml(){return E+r("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>r("Relationship",{Id:t.id,Type:t.type,Target:t.target,TargetMode:t.external?"External":void 0})))}}class Dt{list=[];add(t,i){const n=Q(t.type),d=this.list.filter(o=>Q(o.chart.type)===n).length,l=`${n?"chartEx":"chart"}${String(d+1)}.xml`;return this.list.push({chart:t,frame:i,part:l}),`../charts/${l}`}}class Rt{parts=new Map;byHash=new Map;add(t,i,n,d){const l=ke("sha256").update(t).digest("hex"),o=this.byHash.get(`${n}:${l}`);if(o)return o;const s=d?.split("/").pop()?.replace(/\.[^.]*$/u,"").replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,""),m=s===void 0||s===""?void 0:s;let g=`${m??`${n}${String(this.parts.size+1)}`}.${i}`;for(let L=2;this.parts.has(`ppt/media/${g}`);L++)g=`${m??n}-${String(L)}.${i}`;return this.parts.set(`ppt/media/${g}`,t),this.byHash.set(`${n}:${l}`,`../media/${g}`),`../media/${g}`}}function Ce(e){return e.kind==="component"||e.kind==="block"||e.kind==="movie"||e.kind==="audio"||e.kind==="item"?!1:e.kind==="picture"?ee[v(e.media?.path??"")]!==void 0:!0}function ue(e){return e.kind==="component"||e.kind==="block"||e.kind==="movie"||e.kind==="item"?!0:e.kind==="picture"?ee[v(e.media?.path??"")]===void 0:!1}const Ft=e=>e.picture_fill!==void 0&&v(e.picture_fill.path)==="svg";export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(i=>ue(i)||Ft(i)||i.chart!==void 0&&Q(i.chart.type)).map(i=>({key:`${t.id}/${i.name}`,slide:t.id,shape:i.name,frame:i.frame})))}export function filesOf(e){const t=new Set;for(const i of e.masters){for(const n of[i,...i.layouts].map(d=>d.background_fill?.picture_fill))n&&t.add(J(n.base,n.path));for(const n of[...i.shapes,...i.layouts.flatMap(d=>d.shapes)])n.media&&Ce(n)&&t.add(J(n.media.base,n.media.path)),n.picture_fill&&t.add(J(n.picture_fill.base,n.picture_fill.path))}for(const i of e.slides){i.background_picture!==void 0&&t.add(i.background_picture);for(const n of i.shapes)n.media&&(n.kind==="picture"||n.kind==="movie"||n.kind==="audio")&&t.add(n.media.path),n.picture_fill&&t.add(n.picture_fill.path)}return[...t].sort()}const At=r("p:nvGrpSpPr",{},r("p:cNvPr",{id:1,name:""}),r("p:cNvGrpSpPr"),r("p:nvPr")),zt=r("p:grpSpPr",{},r("a:xfrm",{},r("a:off",{x:0,y:0}),r("a:ext",{cx:0,cy:0}),r("a:chOff",{x:0,y:0}),r("a:chExt",{cx:0,cy:0}))),te=e=>r("p:spTree",{},At,zt,...e),le={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},ne=(e,t)=>r("p:bg",{},r("p:bgPr",{},t?.picture?Ct(t.picture):t?.pattern?Ot(t.pattern):t?.gradient?Tt(t.gradient):r("a:solidFill",{},Et(e)),r("a:effectLst")));function je(e,t,i,n,d,l){const o=t?.picture_fill,s=o?ge({...o,path:J(o.base,o.path)},i,n,d,l).pictureFill:void 0;return ne(e,{gradient:t?.gradient,pattern:t?.pattern,picture:s})}function Bt(e,t,i){const n=e.background_inherited!==!0;if(n&&e.background_picture!==void 0){const d=i(e.background_picture);if(d!==void 0)return ne(e.background,{picture:{image:d,...e.background_tile?{tile:e.background_tile}:{},...e.background_transparency===void 0?{}:{transparency:e.background_transparency}}})}return n&&(e.background_pattern||e.background_gradient)?ne(e.background,{pattern:e.background_pattern,gradient:e.background_gradient}):e.background_own!==!0&&he(e.background,t)?"":ne(e.background)}const he=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Ie(e){return{...e.inner_shadow?{innerShadow:e.inner_shadow}:{},...e.glow?{glow:e.glow}:{},...e.reflection?{reflection:e.reflection}:{},...e.soft_edges===void 0?{}:{softEdges:e.soft_edges},...e.pattern?{pattern:e.pattern}:{},...e.fill_transparency===void 0?{}:{fillTransparency:e.fill_transparency,...e.fill===void 0?{}:{fill:e.fill}},...e.gradient?{gradient:e.gradient}:{},...e.shadow===void 0?{}:{shadow:e.shadow}}}function Nt(e){const t=e.find(n=>n.runs.length>0),i=t?.runs.find(n=>n.field!==void 0)??t?.runs[0];return!t||!i?wt:[{...t,runs:[{...i,text:"‹#›",field:"slidenum"}]}]}function ge(e,t,i,n,d,l){if(!e)return{};const o=n(e.path);return o&&v(e.path)==="svg"&&l?{pictureFill:{image:t.add(p.image,i.add(l,"png","image",`${e.path}.png`)),svg:t.add(p.image,i.add(o,"svg","image",e.path)),...e.tile?{tile:e.tile}:{},...e.transparency===void 0?{}:{transparency:e.transparency}}}:!o||ee[v(e.path)]===void 0?(d(`${e.path} ${o?"is of a kind PowerPoint does not read":"is not in the project"}, so the file leaves the shape's picture fill out`),{}):{pictureFill:{image:t.add(p.image,i.add(o,v(e.path),"image",e.path)),...e.tile?{tile:e.tile}:{},...e.transparency===void 0?{}:{transparency:e.transparency}}}}function se(e){const t=i=>({...e.fill===void 0||"fill"in i&&he(e.fill,i.fill)?{}:{fill:e.fill},...e.line===void 0||he(e.line,i.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===i.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?ce(e.geometry)?{style:"connector",...t(Ze)}:{style:"shape",...t(Je)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const Ht=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(i,n)=>{const d=e[n]??{},l=t[n]??{},o={...d.font,...l.font};return{...d,...l,...Object.keys(o).length>0?{font:o}:{}}});function De(e,t,i,n,d,l,o,s){const m=n!==void 0&&d!==void 0&&JSON.stringify(n.text_styles.other)!==JSON.stringify(d.text_styles.other);return W("p:txBody",de(fe(t,s),o,e==="autoshape"?{rtlCol:0}:{}),Y(m?Ht(n.text_styles.other,t.levels):t.levels),i,l,s)}const Xt="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",Ut=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function Re(e,t){const i=new Map;return e.rows.forEach((n,d)=>{n.cells.forEach((l,o)=>{if(!l.spanned)for(let s=0;s<(l.span_height??1);s++)for(let m=0;m<(l.span_width??1);m++)(s>0||m>0)&&i.set(`${String(d+s)},${String(o+m)}`,{row:d,col:o})})}),r("a:tbl",{},r("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},r("a:tableStyleId",{},e.style??Xt)),r("a:tblGrid",{},...e.columns.map(n=>r("a:gridCol",{w:n}))),...e.rows.map((n,d)=>r("a:tr",{h:n.height},...n.cells.map((l,o)=>{const s=Be(l.fileText,l.text.style),m=fe(l.text.own??l.text,s),g=l.spanned?i.get(`${String(d)},${String(o)}`):void 0;return r("a:tc",{gridSpan:l.span_width,rowSpan:l.span_height,hMerge:g&&o>g.col?1:void 0,vMerge:g&&d>g.row?1:void 0},W("a:txBody",r("a:bodyPr"),r("a:lstStyle"),l.text.paragraphs,t,s),r("a:tcPr",{marL:m.margin_left,marR:m.margin_right,marT:m.margin_top,marB:m.margin_bottom,anchor:m.vertical_anchor},...Ut.map(([L,B])=>{const N=l.borders?.[L];return N===null?r(B,{w:12700},r("a:noFill")):N?r(B,{w:N.width},Ee(N.color)):""}),l.fill===void 0?"":Ee(l.fill)))}))))}const xe=e=>e.group===void 0?{}:{group:e.group},q=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_cap===void 0?{}:{lineCap:e.line_cap},...e.line_join===void 0?{}:{lineJoin:e.line_join},...e.line_compound===void 0?{}:{lineCompound:e.line_compound},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end},...e.line_begin_size===void 0?{}:{lineBeginSize:e.line_begin_size},...e.line_end_size===void 0?{}:{lineEndSize:e.line_end_size}}),ye=e=>e.line===void 0?{}:{line:e.line,...e.line_width===void 0?{}:{lineWidth:e.line_width},...q(e)};function _e(e,t,i){return e.map(n=>{const d=n.kind==="cxn"?t.get(n.id)?.connect:void 0;if(!d)return n;const l=m=>{const g=m&&i(m.shape);return m&&g!==void 0?{id:g,idx:m.site}:void 0},o=l(d.begin),s=l(d.end);return o||s?{...n,connect:{...o?{begin:o}:{},...s?{end:s}:{}}}:n})}const Fe=e=>new Map(e.map((t,i)=>[i+2,t])),Ae=e=>t=>e.find(i=>i.name===t)?.id;function ze(e,t,i,n,d,l,o){const s={...Ie(e),...ge(e.picture_fill&&{...e.picture_fill,path:J(e.picture_fill.base,e.picture_fill.path)},i,n,d,m=>{o.left(`${o.where} › ${e.name}: ${m}`)}),id:t,name:e.name,...e.decorative?{decorative:!0}:{},...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation},...e.flip?{flip:e.flip}:{}};if(e.kind==="placeholder"&&e.placeholder){const m=o.on==="master"?{...Qe(e.placeholder.type),...e.text}:e.text;return{...s,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...q(e),...e.fill===void 0&&e.line===void 0&&(e.geometry===void 0||e.geometry==="rect")?{}:{geometry:e.geometry??"rect",...e.adjustments?{adjustments:e.adjustments}:{}},text:W("p:txBody",m?de(m):r("a:bodyPr"),Y(m?.levels??[]),e.placeholder.type==="sldNum"?Nt(m?.paragraphs??[]):_t,l)}}if(Ce(e)){if(e.table)return{...s,kind:"table",table:Re(e.table,l)};if(e.kind==="picture"&&e.media){const m=J(e.media.base,e.media.path),g=d(m);if(!g){o.left(`${o.where} › ${e.name}: ${m} is not in the project, so the file leaves the picture out`);return}return{...s,kind:"pic",...e.geometry===void 0||e.geometry==="rect"?{}:{geometry:e.geometry},...e.adjustments?{adjustments:e.adjustments}:{},...ye(e),picture:{image:i.add(p.image,n.add(g,v(e.media.path),"image",e.media.path)),...e.media.look?{look:e.media.look}:{}},descr:e.media.path.split("/").pop()??""}}return!e.path&&ce(e.geometry)?{...s,kind:"cxn",geometry:e.geometry??"line",...e.adjustments?{adjustments:e.adjustments}:{},...se(e),...q(e)}:{...s,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...se(e),...q(e),...e.text?{text:De(e.kind,e.text,e.text.paragraphs,o.master,o.first,l)}:{}}}}function Be(e,t){if(!e)return;const i=e.numbered!==void 0||e.bullet!==void 0&&e.bullet!==!1,n=Math.max(0,...(e.paragraphs??[]).map(d=>d.paragraph+(d.paragraphs??1)));return{...n>0?{paragraphs:Array.from({length:n},(d,l)=>qe(e,l))}:{},font:{...e.size===void 0?{}:{size:ve(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline},...e.strike===void 0?{}:{strike:e.strike},...e.caps===void 0?{}:{caps:e.caps},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:{color:pe(e.color)}},paragraph:{...e.align===void 0?{}:{alignment:e.align},...e.line_spacing===void 0?{}:{line_spacing:We(e.line_spacing)},...e.space_before===void 0?{}:{space_before:we(e.space_before)},...e.space_after===void 0?{}:{space_after:we(e.space_after)},...e.bullet_color===void 0?{}:{bullet_color:pe(e.bullet_color)},...e.bullet_size===void 0?{}:{bullet_size:e.bullet_size},...e.start_at===void 0?{}:{start_at:e.start_at},...e.numbered!==void 0?{numbered:e.numbered}:e.bullet===void 0?{}:{bullet:e.bullet===!1?null:e.bullet}},...t&&(i||e.levels!==void 0)?{levels:t.levels.map((d,l)=>{const o=e.levels?.[l],s=o?.numbered!==void 0||o?.bullet!==void 0;return{...i||s||o?.margin_left!==void 0||o?.indent!==void 0?{margin_left:d.margin_left,indent:d.indent}:{},...o?.numbered!==void 0?{numbered:o.numbered}:o?.bullet!==void 0?{bullet:o.bullet===!1?null:o.bullet}:{},...o&&(o.size!==void 0||o.bold!==void 0||o.italic!==void 0||o.color!==void 0)?{font:{...o.size===void 0?{}:{size:ve(o.size)},...o.bold===void 0?{}:{bold:o.bold},...o.italic===void 0?{}:{italic:o.italic},...o.color===void 0?{}:{color:pe(o.color)}}}:{}}})}:{},body:Ke(e)}}function Yt(e,t,i,n,d,l,o,s,m){const g=`${e.id}/${t.name}`,L=l.deck.fitted[g];if(t.level!=="slide"&&!ue(t))return;const B=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},ie=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},w={...Ie(t),...ge(t.picture_fill,n,d,l.file,f=>{l.left?.(`slide ${e.id} › ${t.name}: ${f}`)},l.pictures.get(`${e.id}/${t.name}`)),id:i,name:t.name,...B,...ie,...t.rotation===void 0?{}:{rotation:t.rotation},...t.flip?{flip:t.flip}:{},...t.alt===void 0?{}:{descr:t.alt},...t.locked?{locked:!0}:{},...t.decorative?{decorative:!0}:{},...t.link===void 0?{}:{link:t.link}},G=()=>{const f=l.pictures.get(g);return f?{image:n.add(p.image,d.add(f,"png","image"))}:void 0};if(t.table)return{...w,kind:"table",table:Re(t.table,o)};if(t.chart){const f=Q(t.chart.type),k=f?G():void 0;return{...w,frame:t.frame,kind:"chart",chart:n.add(f?p.chartEx:p.chart,m.add(t.chart,t.frame)),...f?{chartEx:{...k?{fallback:k.image}:{},requires:pt(t.chart.type)}}:{}}}const H=f=>l.left?.(`${g}: ${f}`);if(t.kind==="audio"&&t.media){const f=Oe[v(t.media.path)]!==void 0,k=f?l.file(t.media.path):void 0;if(!k){H(f?`${t.media.path} is not in the project, so the file leaves the sound out`:`${t.media.path} is a sound PowerPoint does not play, so the file leaves it out`);return}const M=d.add(k,v(t.media.path),"media",t.media.path),P=t.media.playback;return s.push({spid:i,name:t.name,playback:P,sound:!0}),{...w,frame:t.frame,kind:"pic",picture:{image:n.add(p.image,d.add(mt,"png","image"))},video:{link:n.add(p.audio,M),media:n.add(p.media,M),sound:!0,...P?.trim?{trim:P.trim}:{}}}}if(t.kind==="movie"&&t.media){const f=G(),k=Te[v(t.media.path)]!==void 0,M=k?l.file(t.media.path):void 0;if(!f){H("no picture of the video was drawn, so the file leaves it out");return}if(!M)return H(k?`${t.media.path} is not in the project, so the file holds the video's picture alone`:`${t.media.path} is a video PowerPoint does not play, so the file holds its picture alone`),{...w,frame:t.frame,kind:"pic",picture:f};const P=d.add(M,v(t.media.path),"media",t.media.path),j=t.media.playback;return s.push({spid:i,name:t.name,playback:j}),{...w,frame:t.frame,kind:"pic",picture:{image:f.image},video:{link:n.add(p.video,P),media:n.add(p.media,P),...j?.trim?{trim:j.trim}:{}}}}if(ue(t)){const f=G(),k=l.movies?.get(g);if(f&&k){const P=d.add(k.bytes,"mp4","media");return s.push({spid:i,name:t.name}),{...w,frame:t.frame,kind:"pic",picture:{image:f.image},video:{link:n.add(p.video,P),media:n.add(p.media,P)}}}f||H("no picture of it was drawn, so the file leaves it out");const M=f&&t.kind==="picture"&&t.media&&v(t.media.path)==="svg"?l.file(t.media.path):void 0;return M&&t.media?{...w,kind:"pic",...t.geometry===void 0||t.geometry==="rect"?{}:{geometry:t.geometry},...t.adjustments?{adjustments:t.adjustments}:{},...ye(t),picture:{image:f?.image??"",svg:n.add(p.image,d.add(M,"svg","image",t.media.path)),...(()=>{const P=t.media.fit===void 0?void 0:Ge(M),j=t.media.fit!==void 0&&P?Se(P,t.frame,t.media.fit):t.media.crop;return j?{crop:j}:{}})(),...t.media.look?{look:t.media.look}:{}},descr:t.alt??t.media.path.split("/").pop()??""}:f?{...w,frame:t.frame,kind:"pic",picture:f}:void 0}if(t.kind==="picture"&&t.media){const f=l.file(t.media.path);if(!f){H(`${t.media.path} is not in the project, so the file leaves the picture out`);return}const k=t.media.fit===void 0?void 0:Ye(f),M=t.media.fit!==void 0&&k?Se(k,t.frame,t.media.fit):t.media.crop;return{...w,...w.placeholder?.type==="body"?{placeholder:{...w.placeholder,type:"obj"}}:{},kind:"pic",...t.geometry===void 0||t.geometry==="rect"?{}:{geometry:t.geometry},...t.adjustments?{adjustments:t.adjustments}:{},...ye(t),picture:{image:n.add(p.image,d.add(f,v(t.media.path),"image",t.media.path)),...M?{crop:M}:{},...t.media.look?{look:t.media.look}:{}},descr:t.alt??t.media.path.split("/").pop()??""}}if(!t.path&&ce(t.geometry))return{...w,kind:"cxn",geometry:t.geometry??"line",...t.adjustments?{adjustments:t.adjustments}:{},...se(t),...q(t)};const T=t.text,ae=l.deck.masters.find(f=>f.name===e.master),X=Be(t.fileText,T?.style),K=T?t.placeholder?W("p:txBody",de(fe({},X),L),r("a:lstStyle"),T.paragraphs,o,X):T.own?De(t.kind,T.own,T.paragraphs,ae,l.deck.masters[0],o,L,X):W("p:txBody",de(bt(T.style),L),Y(T.style.levels.map(Me)),T.paragraphs,o):void 0,Z=t.sources.frame.from==="code",V=t.fill!==void 0&&(Z||t.sources.fill?.from==="slide"),oe=t.line!==void 0&&(Z||t.sources.line?.from==="slide");return{...w,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||V||oe||t.sources.geometry?.from==="slide"?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...q(t),...t.placeholder?{...V?{fill:t.fill}:{},...oe?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:se(t),...K?{text:K}:{}}}const Gt={cx:6858e3,cy:9144e3};function Ne(e,t){const i=$e({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),n=$e({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:W("p:txBody",r("a:bodyPr"),r("a:lstStyle"),(e??"").split(`
3
+ `).map(d=>({runs:[{text:d}],level:0})),t)});return[i,n]}export function pptxParts(e){const{deck:t}=e,i=t.lang?.split("-").map((a,u)=>u===0?a.toLowerCase():a.toUpperCase()).join("-"),n=new Map,d=new Rt,l=new Dt,o=[],s=new z,m=[],g=new Map;let L=2147483648;const B=a=>{const u=t.slides.findIndex(x=>x.id===a);return u<0?void 0:`../slides/slide${String(u+1)}.xml`};t.masters.forEach((a,u)=>{const x=u+1,O=L++,_=`ppt/slideMasters/slideMaster${String(x)}.xml`,S=`ppt/theme/theme${String(x)}.xml`;n.set(S,Pe(t.theme)),o.push([S,$.theme]);const b=new z,C=[];a.layouts.forEach(y=>{const D=g.size+1,c=`ppt/slideLayouts/slideLayout${String(D)}.xml`;g.set(y,c);const h=new z;h.add(p.slideMaster,`../slideMasters/slideMaster${String(x)}.xml`);const F=y.shapes.flatMap((re,He)=>{const be=ze(re,He+2,h,d,e.file,i,{master:a,first:e.deck.masters[0],on:"layout",where:`layout "${y.name}"`,left:Xe=>e.left?.(Xe)});return be?[{...be,...xe(re)}]:[]});n.set(c,E+r("p:sldLayout",{...A,...y.display_master_shapes===!1?{showMasterSp:0}:{},preserve:1},r("p:cSld",{name:y.name},y.background===void 0&&!Ve(y.background_fill)?"":je(y.background??a.background,y.background_fill,h,d,e.file,re=>e.left?.(`layout "${y.name}": ${re}`)),h.linked(te(me(_e(F,Fe(y.shapes),Ae(F)))),B)),r("p:clrMapOvr",{},y.color_map&&Object.keys(y.color_map).length>0?r("a:overrideClrMapping",{...le,...a.color_map,...y.color_map}):r("a:masterClrMapping")))),n.set(`ppt/slideLayouts/_rels/slideLayout${String(D)}.xml.rels`,h.xml()),o.push([c,$.slideLayout]),C.push(r("p:sldLayoutId",{id:L++,"r:id":b.add(p.slideLayout,`../slideLayouts/slideLayout${String(D)}.xml`)}))}),b.add(p.theme,`../theme/theme${String(x)}.xml`);const R=a.shapes.flatMap((y,D)=>{const c=ze(y,D+2,b,d,e.file,i,{master:a,first:e.deck.masters[0],on:"master",where:`master "${a.name}"`,left:h=>e.left?.(h)});return c?[{...c,...xe(y)}]:[]}),I=a.text_styles;n.set(_,E+r("p:sldMaster",A,r("p:cSld",{name:a.name},je(a.background,a.background_fill,b,d,e.file,y=>e.left?.(`master "${a.name}": ${y}`)),b.linked(te(me(_e(R,Fe(a.shapes),Ae(R)))),B)),r("p:clrMap",{...le,...a.color_map}),r("p:sldLayoutIdLst",{},...C),r("p:txStyles",{},Y(I.title,"p:titleStyle"),Y(I.body,"p:bodyStyle"),Y(I.other,"p:otherStyle")))),n.set(`ppt/slideMasters/_rels/slideMaster${String(x)}.xml.rels`,b.xml()),o.push([_,$.slideMaster]),m.push(r("p:sldMasterId",{id:O,"r:id":s.add(p.slideMaster,`slideMasters/slideMaster${String(x)}.xml`)}))});const N=t.slides.some(a=>a.notes!==void 0),ie=`ppt/theme/theme${String(t.masters.length+1)}.xml`;let w="";if(N){n.set(ie,Pe(t.theme)),o.push([ie,$.theme]);const a=new z;a.add(p.theme,`../theme/theme${String(t.masters.length+1)}.xml`),n.set("ppt/notesMasters/notesMaster1.xml",E+r("p:notesMaster",A,r("p:cSld",{},ne("lt1"),te(Ne(void 0,i))),r("p:clrMap",le))),n.set("ppt/notesMasters/_rels/notesMaster1.xml.rels",a.xml()),o.push(["ppt/notesMasters/notesMaster1.xml",$.notesMaster]),w=s.add(p.notesMaster,"notesMasters/notesMaster1.xml")}const G=[],H=new Map(t.masters.flatMap(a=>a.layouts.map(u=>[u.name,u]))),T=a=>{const u=new Set,x=t.slides[a];for(const[O,_]of[[t.slides[a-1],x],[x,t.slides[a+1]]])if(O&&_&&_.transition?.type==="morph")for(const S of O.shapes)S.level==="slide"&&_.shapes.some(b=>b.name===S.name)&&u.add(S.name);return u};t.slides.forEach((a,u)=>{const x=u+1,O=`ppt/slides/slide${String(x)}.xml`,_=new z,S=H.get(a.layout),b=S?g.get(S):void 0;b&&_.add(p.slideLayout,`../${b.slice(4)}`);const C=[],R=new Map,I=new Map;let y=1;const D=a.shapes.flatMap(c=>{const h=Yt(a,c,++y,_,d,e,i,C,l);if(!h)return y--,[];R.set(c.name,h.id),I.set(h.id,c);const F=T(u).has(c.name)?{name:`!!${h.name}`}:{};return[{...h,...xe(c),...F}]});if(a.notes!==void 0){const c=`ppt/notesSlides/notesSlide${String(x)}.xml`,h=new z;h.add(p.notesMaster,"../notesMasters/notesMaster1.xml"),h.add(p.slide,`../slides/slide${String(x)}.xml`),n.set(c,E+r("p:notes",A,r("p:cSld",{},te(Ne(a.notes,i))),r("p:clrMapOvr",{},r("a:masterClrMapping")))),n.set(`ppt/notesSlides/_rels/notesSlide${String(x)}.xml.rels`,h.xml()),o.push([c,$.notesSlide]),_.add(p.notesSlide,`../notesSlides/notesSlide${String(x)}.xml`)}n.set(O,E+r("p:sld",{...A,show:a.hidden?0:void 0},r("p:cSld",{name:a.id},Bt(a,S?.background??t.masters.find(c=>c.name===a.master)?.background,c=>{const h=e.file(c);if(h&&ee[v(c)]!==void 0)return _.add(p.image,d.add(h,v(c),"image",c));e.left?.(`${a.id}: its background picture ${c} ${h?"is of a kind PowerPoint does not read":"is not in the project"}, so the slide has its layout's background`)}),_.linked(te(me(_e(D,I,c=>R.get(c)))),c=>{const h=t.slides.findIndex(F=>F.id===c);return h<0?void 0:`slide${String(h+1)}.xml`})),r("p:clrMapOvr",{},a.color_map_own===!0&&a.color_map!==void 0?r("a:overrideClrMapping",{...le,...a.color_map}):r("a:masterClrMapping")),Mt(a.transition,a.advance),$t(a.animations,C,c=>R.get(c),c=>a.shapes.find(h=>h.name===c)?.text!==void 0,t,new Map(a.shapes.flatMap(c=>{const h=e.movies?.get(`${a.id}/${c.name}`),F=(c.kind==="movie"||c.kind==="audio")&&c.media?e.lengths?.get(c.media.path):h?.seconds;return F===void 0?[]:[[c.name,F]]}))))),n.set(`ppt/slides/_rels/slide${String(x)}.xml.rels`,_.xml()),o.push([O,$.slide]),G.push(r("p:sldId",{id:256+u,"r:id":s.add(p.slide,`slides/slide${String(x)}.xml`)}))}),s.add(p.theme,"theme/theme1.xml"),s.add(p.presProps,"presProps.xml"),s.add(p.viewProps,"viewProps.xml"),s.add(p.tableStyles,"tableStyles.xml");const ae=new Map,X=new Map;let K=0;const Z=(e.fonts??[]).flatMap(a=>{const u=It.flatMap(([x,O,_])=>{const S=a[x]&&gt(a[x],a.typeface,_),b=S&&xt(S);if(!S||!b)return[];X.has(a.typeface)||X.set(a.typeface,faceHint({...b,family:a.typeface}));const C=`fonts/font${String(++K)}.fntdata`;return ae.set(`ppt/${C}`,yt(S,b,a.typeface,_)),[r(O,{"r:id":s.add(p.font,C)})]});return u.length===0?[]:[r("p:embeddedFont",{},r("p:font",{typeface:a.typeface}),...u)]}),V=Z.length===0?"":r("p:embeddedFontLst",{},...Z);n.set("ppt/presentation.xml",E+r("p:presentation",{...A,...V===""?{}:{embedTrueTypeFonts:1},saveSubsetFonts:1},r("p:sldMasterIdLst",{},...m),w===""?"":r("p:notesMasterIdLst",{},r("p:notesMasterId",{"r:id":w})),r("p:sldIdLst",{},...G),r("p:sldSz",{cx:t.width,cy:t.height}),r("p:notesSz",Gt),V,e.deck.masters[0]?Y(et(e.deck.masters[0]).map(Me),"p:defaultTextStyle"):"",sectionsXml(t.slides))),n.set("ppt/_rels/presentation.xml.rels",s.xml()),o.push(["ppt/presentation.xml",$.presentation]),n.set("ppt/presProps.xml",E+r("p:presentationPr",A)),n.set("ppt/viewProps.xml",E+r("p:viewPr",A));const oe=new Set([...t.slides.flatMap(a=>a.shapes),...e.deck.masters.flatMap(a=>[...a.shapes,...a.layouts.flatMap(u=>u.shapes)])].flatMap(a=>a.table?.style===void 0?[]:[a.table.style]));n.set("ppt/tableStyles.xml",E+r("a:tblStyleLst",{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main",def:tt},...nt.filter(a=>oe.has(a.id)).map(vt))),o.push(["ppt/presProps.xml",$.presProps]),o.push(["ppt/viewProps.xml",$.viewProps]),o.push(["ppt/tableStyles.xml",$.tableStyles]),n.set("docProps/core.xml",E+r("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":`<dc:title>${Lt(e.title)}</dc:title>`)),n.set("docProps/app.xml",E+r("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},r("Application",{},"AllyHub"),r("Slides",{},String(t.slides.length)),r("Notes",{},String(t.slides.filter(a=>a.notes!==void 0).length)),r("HiddenSlides",{},String(t.slides.filter(a=>a.hidden).length)))),o.push(["docProps/core.xml",$.core]),o.push(["docProps/app.xml",$.app]);const f=new z;f.add(p.officeDocument,"ppt/presentation.xml"),f.add(p.core,"docProps/core.xml"),f.add(p.app,"docProps/app.xml");const k=new Map;l.list.forEach(({chart:a,frame:u,part:x},O)=>{const _=String(O+1),S=`ppt/charts/${x}`,b=new z,C=`Microsoft_Excel_Sheet${_}.xlsx`;k.set(`ppt/embeddings/${C}`,ft(a));const R=b.add(p.package,`../embeddings/${C}`),I=Q(a.type);if(I){const y=`ppt/charts/style${_}.xml`,D=`ppt/charts/colors${_}.xml`;n.set(y,ct(a.type)),n.set(D,st()),b.add(rt,`style${_}.xml`),b.add(it,`colors${_}.xml`),o.push([y,dt]),o.push([D,at])}n.set(S,I?ut(a,R):ht(a,u,R)),n.set(`ppt/charts/_rels/${x}.rels`,b.xml()),o.push([S,I?$.chartEx:$.chart])});const M=new Set([...d.parts.keys(),...k.keys()].map(v)),P=E+r("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},r("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),r("Default",{Extension:"xml",ContentType:"application/xml"}),K>0?r("Default",{Extension:"fntdata",ContentType:"application/x-fontdata"}):"",...[...M].sort().map(a=>r("Default",{Extension:a,ContentType:a==="xlsx"?$.workbook:ee[a]??(a==="svg"?jt:void 0)??Te[a]??Oe[a]??"application/octet-stream"})),...o.map(([a,u])=>r("Override",{PartName:`/${a}`,ContentType:u}))),j=new TextEncoder,U=new Map;U.set("[Content_Types].xml",j.encode(P)),U.set("_rels/.rels",j.encode(f.xml()));for(const[a,u]of n)U.set(a,j.encode(Jt(u,X)));for(const[a,u]of d.parts)U.set(a,u);for(const[a,u]of k)U.set(a,u);for(const[a,u]of ae)U.set(a,u);return U}export function faceHint(e){const t=[...e.panose],i=t.some(o=>o!==0),n=t[1]??0,d=e.familyClass>>8,l=i&&t[0]===2&&n>=2?n>=11&&n<=15:d!==0?d===8:!/serif|roman|times|garamond|georgia|newsreader|playfair|merriweather|lora|caslon|baskerville/iu.test(e.family.replace(/sans/giu,""));return{...i?{panose:t.map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase()}:{},pitchFamily:(l?32:16)|2}}function Jt(e,t){return t.size===0||!e.includes("<a:latin ")?e:e.replace(/<a:latin typeface="([^"]*)"\/>/gu,(i,n)=>{const d=t.get(n.replaceAll("&amp;","&"));return d===void 0?i:`<a:latin typeface="${n}"${d.panose===void 0?"":` panose="${d.panose}"`} pitchFamily="${String(d.pitchFamily)}" charset="0"/>`})}const Wt=new Date(1980,0,1);export function writePptx(e){const t={};for(const[i,n]of pptxParts(e))t[i]=[n,{level:/\.(png|jpe?g|gif|mp4|m4v|mov)$/u.test(i)?0:6,mtime:Wt}];return Ue(t)}const qt="{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";function Kt(e,t){const i=ke("sha256").update(`${String(e)}:${t}`).digest("hex").toUpperCase();return`{${i.slice(0,8)}-${i.slice(8,12)}-4${i.slice(13,16)}-8${i.slice(17,20)}-${i.slice(20,32)}}`}export function sectionsXml(e){if(!e.some(i=>i.section!==void 0))return"";const t=[];return e.forEach((i,n)=>{(i.section!==void 0||t.length===0)&&t.push({name:i.section??"Default Section",ids:[]}),t.at(-1)?.ids.push(256+n)}),r("p:extLst",{},r("p:ext",{uri:qt},r("p14:sectionLst",{"xmlns:p14":Pt.p14},...t.map((i,n)=>r("p14:section",{name:i.name,id:Kt(n,i.name)},r("p14:sldIdLst",{},...i.ids.map(d=>r("p14:sldId",{id:d}))))))))}
@@ -1,3 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{colorXml as i}from"@allyhub/slides-core";const c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},d=t=>{const o=t.charCodeAt(0);return o<32&&o!==9&&o!==10&&o!==13||o===65534||o===65535};export const esc=t=>Array.from(t,o=>d(o)?"":c[o]??o).join(""),unesc=t=>t.replaceAll("&quot;",'"').replaceAll("&gt;",">").replaceAll("&lt;","<").replaceAll("&amp;","&");export function el(t,o={},...n){const e=Object.entries(o).filter(([,a])=>a!==void 0).map(([a,r])=>` ${a}="${esc(typeof r=="boolean"?r?"1":"0":String(r))}"`).join(""),l=n.join("");return l===""?`<${t}${e}/>`:`<${t}${e}>${l}</${t}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- `,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(t,o=0){return i(t,o>0?el("a:alpha",{val:Math.round((1-o)*1e5)}):"")}export const fill=(t,o=0)=>t===null?el("a:noFill"):el("a:solidFill",{},color(t,o)),gradientFill=t=>el("a:gradFill",{rotWithShape:1},el("a:gsLst",{},...[...t.stops].sort((o,n)=>o.at-n.at).map(o=>el("a:gs",{pos:Math.round(o.at*1e5)},color(o.color,o.transparency)))),t.path===void 0?el("a:lin",{ang:Math.round(t.angle*6e4),scaled:0}):el("a:path",{path:t.path},el("a:fillToRect",{l:Math.round((t.focus?.left??.5)*1e5),t:Math.round((t.focus?.top??.5)*1e5),r:Math.round((t.focus?.right??.5)*1e5),b:Math.round((t.focus?.bottom??.5)*1e5)}))),patternFill=t=>el("a:pattFill",{prst:t.preset},el("a:fgClr",{},color(t.fg)),el("a:bgClr",{},color(t.bg))),pictureFill=t=>el("a:blipFill",{dpi:0,rotWithShape:1},el("a:blip",{"r:embed":t.image},t.transparency===void 0?"":el("a:alphaModFix",{amt:Math.round((1-t.transparency)*1e5)})),el("a:srcRect"),t.tile?el("a:tile",{tx:Math.round(t.tile.offset_x),ty:Math.round(t.tile.offset_y),sx:Math.round(t.tile.scale_x*1e5),sy:Math.round(t.tile.scale_y*1e5),flip:"none",algn:t.tile.align}):el("a:stretch",{},el("a:fillRect")));const s=t=>({blurRad:t.blur,dist:t.distance,dir:Math.round(t.angle*6e4)});export function effects(t){const o=[t.glow?el("a:glow",{rad:t.glow.size},color(t.glow.color,t.glow.transparency)):"",t.innerShadow?el("a:innerShdw",s(t.innerShadow),color(t.innerShadow.color,t.innerShadow.transparency)):"",t.shadow?el("a:outerShdw",{...s(t.shadow),algn:"ctr",rotWithShape:0},color(t.shadow.color,t.shadow.transparency)):"",t.reflection?el("a:reflection",{blurRad:t.reflection.blur,stA:Math.round((1-t.reflection.transparency)*1e5),endA:300,endPos:Math.round(t.reflection.size*1e5),dist:t.reflection.distance,dir:54e5,sy:-1e5,algn:"bl",rotWithShape:0}):"",t.softEdges===void 0?"":el("a:softEdge",{rad:t.softEdges})].filter(n=>n!=="");return o.length===0&&t.shadow===void 0?"":el("a:effectLst",{},...o)}export const centipoints=t=>Math.round(t/127);
2
+ import{colorXml as i}from"@allyhub/slides-core";const c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},d=t=>{const o=t.charCodeAt(0);return o<32&&o!==9&&o!==10&&o!==13||o===65534||o===65535};export const esc=t=>Array.from(t,o=>d(o)?"":c[o]??o).join("");const p={" ":"&#9;","\n":"&#10;","\r":"&#13;"};export const escAttr=t=>esc(t).replace(/[\t\n\r]/gu,o=>p[o]??o),unesc=t=>t.replaceAll("&#9;"," ").replaceAll("&#10;",`
3
+ `).replaceAll("&#13;","\r").replaceAll("&quot;",'"').replaceAll("&gt;",">").replaceAll("&lt;","<").replaceAll("&amp;","&");export function el(t,o={},...a){const e=Object.entries(o).filter(([,n])=>n!==void 0).map(([n,r])=>` ${n}="${escAttr(typeof r=="boolean"?r?"1":"0":String(r))}"`).join(""),l=a.join("");return l===""?`<${t}${e}/>`:`<${t}${e}>${l}</${t}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
4
+ `,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(t,o=0){return i(t,o>0?el("a:alpha",{val:Math.round((1-o)*1e5)}):"")}export const fill=(t,o=0)=>t===null?el("a:noFill"):el("a:solidFill",{},color(t,o)),gradientFill=t=>el("a:gradFill",{rotWithShape:1},el("a:gsLst",{},...[...t.stops].sort((o,a)=>o.at-a.at).map(o=>el("a:gs",{pos:Math.round(o.at*1e5)},color(o.color,o.transparency)))),t.path===void 0?el("a:lin",{ang:Math.round(t.angle*6e4),scaled:0}):el("a:path",{path:t.path},el("a:fillToRect",{l:Math.round((t.focus?.left??.5)*1e5),t:Math.round((t.focus?.top??.5)*1e5),r:Math.round((t.focus?.right??.5)*1e5),b:Math.round((t.focus?.bottom??.5)*1e5)}))),patternFill=t=>el("a:pattFill",{prst:t.preset},el("a:fgClr",{},color(t.fg)),el("a:bgClr",{},color(t.bg))),pictureFill=t=>el("a:blipFill",{dpi:0,rotWithShape:1},el("a:blip",{"r:embed":t.image},t.transparency===void 0?"":el("a:alphaModFix",{amt:Math.round((1-t.transparency)*1e5)}),t.svg===void 0?"":el("a:extLst",{},el("a:ext",{uri:"{96DAC541-7B7A-43D3-8B79-37D633B846F1}"},el("asvg:svgBlip",{"xmlns:asvg":"http://schemas.microsoft.com/office/drawing/2016/SVG/main","r:embed":t.svg})))),el("a:srcRect"),t.tile?el("a:tile",{tx:Math.round(t.tile.offset_x),ty:Math.round(t.tile.offset_y),sx:Math.round(t.tile.scale_x*1e5),sy:Math.round(t.tile.scale_y*1e5),flip:"none",algn:t.tile.align}):el("a:stretch",{},el("a:fillRect")));const s=t=>({blurRad:t.blur,dist:t.distance,dir:Math.round(t.angle*6e4)});export function effects(t){const o=[t.glow?el("a:glow",{rad:t.glow.size},color(t.glow.color,t.glow.transparency)):"",t.innerShadow?el("a:innerShdw",s(t.innerShadow),color(t.innerShadow.color,t.innerShadow.transparency)):"",t.shadow?el("a:outerShdw",{...s(t.shadow),algn:"ctr",rotWithShape:0},color(t.shadow.color,t.shadow.transparency)):"",t.reflection?el("a:reflection",{blurRad:t.reflection.blur,stA:Math.round((1-t.reflection.transparency)*1e5),endA:300,endPos:Math.round(t.reflection.size*1e5),dist:t.reflection.distance,dir:54e5,sy:-1e5,algn:"bl",rotWithShape:0}):"",t.softEdges===void 0?"":el("a:softEdge",{rad:t.softEdges})].filter(a=>a!=="");return o.length===0&&t.shadow===void 0?"":el("a:effectLst",{},...o)}export const centipoints=t=>Math.round(t/127);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-pptx",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{adjustmentDefaults as Q,cellLook as X,chartDrawing as tt,colorRgb as et,CONNECTOR_STYLE as nt,DECK_FONTS as it,EMU_PER_PT as k,Inches as ot,isConnectorGeometry as rt,LINE_DEFAULTS as $,mappedColors as st,Pt as at,bulletLookOver as lt,numberText as dt,runLang as ct,SINGLE_SPACING as E,spaceLength as I,PATTERN_CELL as j,patternPath as ut,tableStyleOf as ft}from"@allyhub/slides-core";import{presetOutline as H}from"@allyhub/ooxml/geometry";export{SLIDE_CSS,slideStyle}from"./slide-css.js";export const SHAPE_ATTR="data-ak-shape",LINE_WIDTH=at(.75);export{E as SINGLE_SPACING};export const MIN_FONT_SCALE=.25;export function themeCss(e){const t={};for(const[i,o]of Object.entries(e.colors))t[`--ak-theme-${i}`]=o;return t["--ak-theme-major"]=v(e.fonts.major,O),t["--ak-theme-minor"]=v(e.fonts.minor,O),t["--ak-theme-major-ea"]=v(e.fonts.major_east_asian,M),t["--ak-theme-minor-ea"]=v(e.fonts.minor_east_asian,M),t}const M='"Noto Sans SC", sans-serif',O=`"${it.minor}", ${M}`,v=(e,t)=>e.includes(",")||e.includes('"')?e:`"${e}", ${t}`;export const colorCss=(e,t)=>e==null?"transparent":et(e,t);const B=e=>e===void 0?void 0:e==="+mj-lt"?"var(--ak-theme-major)":e==="+mn-lt"?"var(--ak-theme-minor)":v(e,O),gt={l:"start",ctr:"center",r:"end",just:"justify"},pt={t:"flex-start",ctr:"center",b:"flex-end"},mt=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u2E80-\u2FDF\u3000-\u303F\uFF00-\uFFEF]/u,bt=/[\u2018\u2019\u201C\u201D\u2026\u2014\u2013\u2025\u00B7]/u;export function eastAsianRuns(e,t){const i=[];for(const o of e){const r=mt.test(o)||t&&bt.test(o),n=i.at(-1);n?.ea===r?n.text+=o:i.push({text:o,ea:r})}return i}const ht=e=>!e.startsWith("#")&&!e.startsWith("ppaction:"),w=e=>`calc(${String(e)}px * var(--ak-fit, 1))`;function R(e,t,i,o){if(!t)return;const r=B(t.name);r&&(e.style.fontFamily=r),t.size!==void 0&&(e.style.fontSize=w(t.size*i)),t.bold!==void 0&&(e.style.fontWeight=t.bold?"700":"400"),t.italic!==void 0&&(e.style.fontStyle=t.italic?"italic":"normal"),(t.underline!==void 0||t.strike!==void 0||t.link)&&Object.assign(e.style,decorationCss(t)),t.caps!==void 0&&Object.assign(e.style,capsCss(t.caps)),t.highlight!==void 0&&(e.style.backgroundColor=t.highlight),t.baseline!==void 0&&t.baseline!==0&&(e.style.fontSize=t.size===void 0?"0.66em":w(t.size*i*.66),e.style.verticalAlign=`${String(t.baseline/.66)}em`),t.spacing!==void 0&&(e.style.letterSpacing=w(t.spacing*i)),t.link!==void 0?e.style.color=colorCss("hlink",o):t.color!==void 0&&(e.style.color=colorCss(t.color,o))}const St={sng:{style:"solid"},dbl:{style:"double"},heavy:{style:"solid",heavy:!0},dotted:{style:"dotted"},dottedHeavy:{style:"dotted",heavy:!0},dash:{style:"dashed"},dashHeavy:{style:"dashed",heavy:!0},dashLong:{style:"dashed"},dashLongHeavy:{style:"dashed",heavy:!0},dotDash:{style:"dashed"},dotDashHeavy:{style:"dashed",heavy:!0},dotDotDash:{style:"dashed"},dotDotDashHeavy:{style:"dashed",heavy:!0},wavy:{style:"wavy"},wavyHeavy:{style:"wavy",heavy:!0},wavyDbl:{style:"wavy"},words:{style:"solid"}};export function decorationCss(e){const t=typeof e.underline=="string"?e.underline:e.underline===!0||e.link!==void 0?"sng":void 0,i=e.strike===!0?"sngStrike":e.strike===!1?void 0:e.strike,o=t?St[t]:{style:i==="dblStrike"?"double":"solid"};return{textDecorationLine:[t?"underline":"",i?"line-through":""].filter(r=>r!=="").join(" ")||"none",textDecorationStyle:o.style,textDecorationThickness:"heavy"in o?"0.1em":"auto"}}export const capsCss=e=>({textTransform:e==="all"?"uppercase":"none",fontVariantCaps:e==="small"?"small-caps":"normal"});function yt(){if(document.adoptedStyleSheets.some(t=>t.allyhubBullets))return;const e=new CSSStyleSheet;e.replaceSync("[data-ak-bullet]::before{content:attr(data-ak-bullet)}"),Object.assign(e,{allyhubBullets:!0}),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}export function paragraphStyle(e,t){const i=t[e.level]??t[0];if(!i)throw new Error("A text style has nine levels.");return lt({...i,...e.alignment===void 0?{}:{alignment:e.alignment},...e.line_spacing===void 0?{}:{line_spacing:e.line_spacing},...e.space_before===void 0?{}:{space_before:e.space_before},...e.space_after===void 0?{}:{space_after:e.space_after},...e.margin_left===void 0?{}:{margin_left:e.margin_left},...e.indent===void 0?{}:{indent:e.indent},...e.numbered===void 0?{}:{numbered:e.numbered},font:{...i.font,...e.font}},e)}export function paragraphLabels(e,t){const i=[];return e.map(o=>{if(!o.runs.some(n=>n.text!==""&&n.text!=="\v"))return;const r=paragraphStyle(o,t);return i.length=o.level+1,r.numbered===void 0?i[o.level]=0:i[o.level]=i[o.level]?(i[o.level]??0)+1:r.start_at??1,r.numbered===void 0?r.bullet?.char:dt(r.numbered,i[o.level]??1)})}export function paragraphElement(e,t,i,o,r,n){const s=paragraphStyle(e,i),l=document.createElement("div");l.dataset.akParagraph=String(t),l.dataset.akLevel=String(e.level);const c=e.runs.map(a=>a.font?.size??s.font.size),u=(c.length>0?Math.max(...c):s.font.size)*r,p="lines"in s.line_spacing?String(s.line_spacing.lines*E):w(s.line_spacing.fixed*r),d=o!==void 0;if(Object.assign(l.style,{position:"relative",textAlign:gt[s.alignment],paddingInlineStart:`${String(s.margin_left*r)}px`,textIndent:d?"0px":`${String(s.indent*r)}px`,marginBlockStart:t===0?"0px":w(I(s.space_before,u/r)*r),marginBlockEnd:w(I(s.space_after,u/r)*r),lineHeight:p,fontSize:w(u),minBlockSize:"lines"in s.line_spacing?w(u*s.line_spacing.lines*E):p}),R(l,s.font,r,n),l.style.fontSize=w(u),o!==void 0){yt();const a=document.createElement("span");Object.assign(a.style,{position:"absolute",insetInlineStart:`${String((s.margin_left+s.indent)*r)}px`,textIndent:"0px"}),a.dataset.akLabel=String((s.margin_left+s.indent)*r),a.dataset.akMargin=String(s.margin_left*r),a.dataset.akTab=String(DEFAULT_TAB_STOP*r);const g=document.createElement("span");g.dataset.akBullet=o;const m=s.numbered===void 0?s.bullet?.font:void 0,S=(e.runs[0]?.font?.size??s.font.size)*r;Object.assign(g.style,{lineHeight:"0",...m===void 0?{}:{fontFamily:B(m)},...s.bullet_size===void 0?{}:{fontSize:w(S*s.bullet_size)},...s.bullet_color===void 0?{}:{color:colorCss(s.bullet_color,n)}}),a.append(g),l.append(a)}return l}export const DEFAULT_TAB_STOP=ot(1);export function hangLabels(e){for(const t of e.querySelectorAll("[data-ak-label]")){const i=t.parentElement,o=t.firstElementChild;if(!i||!(o instanceof HTMLElement))continue;const r=Number(t.dataset.akLabel),n=Number(t.dataset.akMargin),s=Number(t.dataset.akTab),l=getComputedStyle(i).writingMode.startsWith("vertical"),c=r+(l?o.offsetHeight:o.offsetWidth);i.style.textIndent=c<=n+.5||!(s>0)?"0px":`${String((Math.floor(c/s)+1)*s-n)}px`}}export const exactSpacing=(e,t)=>!("lines"in paragraphStyle(e,t).line_spacing);export function runElement(e,t,i,o=!1,r){const n=document.createElement("span");R(n,e.font,t,i);const s=e.text===void 0?r:ct(e.text,r);return s!==void 0&&s!==r&&(n.lang=s),o&&(n.style.lineHeight="0"),e.font?.link!==void 0&&ht(e.font.link)&&(n.dataset.akLink=e.font.link),n}export function eastAsianFace(e,t){return`var(--ak-theme-${(e.font?.name??t)==="+mj-lt"?"major":"minor"}-ea)`}function xt(e,t,i,o,r){const n=isCjk(o);e.replaceChildren();const s=t.paragraphs.length>0?t.paragraphs:[{runs:[],level:0}],l=paragraphLabels(s,t.style.levels);s.forEach((c,u)=>{const p=paragraphElement(c,u,t.style.levels,l[u],i,r),d=paragraphStyle(c,t.style.levels).font.name,a=exactSpacing(c,t.style.levels);for(const g of c.runs){const m=runElement(g,i,r,a,o),S=eastAsianFace(g,d);for(const f of eastAsianRuns(g.text.replaceAll("\v",`
3
- `),n)){if(!f.ea){m.append(f.text);continue}const b=document.createElement("span");b.style.fontFamily=S,b.textContent=f.text,m.append(b)}p.append(m)}e.append(p)})}export const isCjk=e=>e!==void 0&&/^(zh|ja|ko)(-|$)/iu.test(e);function A(e,t,i,o,r){const{style:n}=e,s=n.auto_size==="shape"&&n.orientation==="horz",l=document.createElement("div");l.dataset.akText="",l.dataset.akAutofit=n.auto_size,n.orientation!=="horz"&&(l.dataset.akOrientation=n.orientation);const c=s?void 0:r;Object.assign(l.style,{position:s?"relative":"absolute",inset:s?"auto":c?`${String(c.top)}px calc(100% - ${String(c.right)}px) calc(100% - ${String(c.bottom)}px) ${String(c.left)}px`:"0px",minHeight:c?`${String(c.bottom-c.top)}px`:"100%",display:"flex",flexDirection:"column",justifyContent:pt[n.vertical_anchor],padding:`${String(n.margins.top*t)}px ${String(n.margins.right*t)}px ${String(n.margins.bottom*t)}px ${String(n.margins.left*t)}px`,whiteSpace:n.word_wrap?"pre-wrap":"pre",overflowWrap:"break-word",boxSizing:"border-box",...orientationCss(n.orientation)});const u=document.createElement("div");if(u.dataset.akBody="",l.append(u),xt(u,e,t,i,o),!n.word_wrap){Object.assign(u.style,{display:"flex",flexDirection:"column"});for(const p of u.children){if(!(p instanceof HTMLElement))continue;const d=p.style.textAlign;Object.assign(p.style,{inlineSize:"max-content",minInlineSize:"100%",boxSizing:"border-box",alignSelf:d==="center"?"center":d==="end"?"flex-end":"flex-start"})}}return i!==void 0&&(l.lang=i),isCjk(i)&&(l.dataset.akCjk=""),l}export function orientationCss(e){switch(e){case"horz":return{writingMode:"horizontal-tb",textOrientation:"mixed"};case"vert":return{writingMode:"sideways-rl",textOrientation:"mixed"};case"vert270":return{writingMode:"sideways-lr",textOrientation:"mixed"};case"eaVert":return{writingMode:"vertical-rl",textOrientation:"mixed"};case"wordArtVert":return{writingMode:"vertical-lr",textOrientation:"upright"};case"wordArtVertRtl":return{writingMode:"vertical-rl",textOrientation:"upright"};case"mongolianVert":return{writingMode:"vertical-lr",textOrientation:"mixed"}}}export function fitText(e){const t=e.querySelector("[data-ak-body]");if(!t||e.dataset.akAutofit!=="text")return 1;const i=e.dataset.akOrientation!==void 0,o=getComputedStyle(e),r=i?e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight):e.clientHeight-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom),n=c=>(e.style.setProperty("--ak-fit",String(c)),hangLabels(e),(i?t.scrollWidth:t.scrollHeight)<=r+.5);if(n(1))return delete e.dataset.akFontScale,1;let s=MIN_FONT_SCALE,l=1;if(!n(s))return e.dataset.akFontScale=s.toFixed(2),s;for(;l-s>.01;){const c=(s+l)/2;n(c)?s=c:l=c}return n(s),e.dataset.akFontScale=s.toFixed(2),s}function C(e,t,i,o){const r=e.split(" "),n=[],s=l=>{const c=Number(r[l]),u=Number(r[l+1]);return[o?.h?t-c:c,o?.v?i-u:u]};for(let l=0;l<r.length;){const c=r[l++];c==="M"||c==="L"?(n.push({op:c,at:[s(l)]}),l+=2):c==="C"?(n.push({op:c,at:[s(l),s(l+2),s(l+4)]}),l+=6):c==="Z"&&n.push({op:c})}return n}const N=e=>e.map(t=>t.op==="Z"?"Z":`${t.op}${t.at.map(([i,o])=>`${String(i)} ${String(o)}`).join(" ")}`).join(" ");function wt(e,t){const i=e.flatMap(n=>n.op==="Z"?[]:n.at),o=t?[...i].reverse():i,r=o[0];if(r)for(const n of o.slice(1)){const s=Math.hypot(r[0]-n[0],r[1]-n[1]);if(s>1e-6)return{at:r,out:[(r[0]-n[0])/s,(r[1]-n[1])/s]}}}function vt(e,t,i,o){const r=e.filter(l=>l.op!=="Z"),n=t?r[r.length-1]:r[0];if(!n)return;const s=t?n.at.slice(n.op==="C"?-2:-1):[...n.at,...r[1]?.op==="C"?r[1].at.slice(0,1):[]];for(const l of s)l[0]+=i,l[1]+=o}function $t(e,t,i,o,r){if(t.line===null)return;const n=t.frame.width*i,s=t.frame.height*i,l=(H(t.geometry??"line",n,s,t.adjustments)?.paths??[]).filter(m=>m.stroke).map(m=>C(m.d,n,s,t.flip)),c=l[0],u=l[l.length-1];if(!c||!u)return;const p="http://www.w3.org/2000/svg",d=document.createElementNS(p,"svg");d.setAttribute("width",String(Math.max(n,1))),d.setAttribute("height",String(Math.max(s,1))),Object.assign(d.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const a=colorCss(t.line??nt.line,r),g=U(t,c,u,o,i,a);for(const m of l){const S=document.createElementNS(p,"path");S.setAttribute("d",N(m)),S.setAttribute("fill","none"),D(S,t,a,o),d.append(S),G(d,S,t,o,!1)}d.append(...g),e.append(d)}const At={flat:"butt",rnd:"round",sq:"square"};function D(e,t,i,o){e.setAttribute("stroke",i),e.setAttribute("stroke-width",String(o)),e.setAttribute("stroke-linecap",At[t.line_cap??$.cap]);const r=t.line_join??$.join;e.setAttribute("stroke-linejoin",r),r==="miter"&&e.setAttribute("stroke-miterlimit","8");const n=Et(t.line_dash,o,t.line_cap);n&&e.setAttribute("stroke-dasharray",n)}const P={dbl:[1/3,1/3,1/3],thickThin:[.6,.2,.2],thinThick:[.2,.2,.6],tri:[1/6,1/6,2/6,1/6,1/6]};let _t=0;function G(e,t,i,o,r){const n=i.line_compound;if(n===void 0||n==="sng")return;const s=t.getAttribute("d")??"",l="http://www.w3.org/2000/svg",c=!r&&(n==="thickThin"||n==="thinThick")?P.dbl:P[n],u=`ak-compound-${String(_t++)}`,p=document.createElementNS(l,"defs"),d=document.createElementNS(l,"mask");d.id=u,d.setAttribute("maskUnits","userSpaceOnUse");for(const[f,b]of Object.entries({x:"-100000",y:"-100000",width:"200000",height:"200000"}))d.setAttribute(f,b);const a=(f,b,h)=>{if(f<=0)return;const y=document.createElementNS(l,"path");y.setAttribute("d",s),y.setAttribute("fill","none"),y.setAttribute("stroke",b),y.setAttribute("stroke-width",String(f*2)),y.setAttribute("stroke-linejoin",t.getAttribute("stroke-linejoin")??$.join),y.setAttribute("stroke-linecap",t.getAttribute("stroke-linecap")??"butt"),h.append(y)},g=[.5];for(const f of c)g.push((g[g.length-1]??0)-f);const m=c.flatMap((f,b)=>b%2===1?[[g[b+1]??0,g[b]??0]]:[]);if(a(o/2,"white",d),m.every(([f,b])=>m.some(([h,y])=>Math.abs(h+b)<1e-6&&Math.abs(y+f)<1e-6)))for(const[f,b]of m)b>0&&(a(b*o,"black",d),a(Math.max(0,f)*o,"white",d));else{const f=document.createElementNS(l,"clipPath");f.id=`${u}-in`;const b=document.createElementNS(l,"path");b.setAttribute("d",s),b.setAttribute("clip-rule","evenodd"),f.append(b),p.append(f);for(const[h,y]of m)if(h>=0){a(y*o,"black",d),a(h*o,"white",d);const x=document.createElementNS(l,"g");x.setAttribute("clip-path",`url(#${f.id})`),a(o/2,"white",x),d.append(x)}else{const x=document.createElementNS(l,"g");x.setAttribute("clip-path",`url(#${f.id})`),a(-h*o,"black",x),a(Math.max(0,-y)*o,"white",x),d.append(x)}}p.append(d),e.insertBefore(p,e.firstChild),t.setAttribute("mask",`url(#${u})`)}const kt={sysDash:[3,1],sysDot:[1,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3],dot:[1,3],sysDashDot:[3,1,1,1],sysDashDotDot:[3,1,1,1,1,1]},Et=(e,t,i="flat")=>e&&kt[e]?.map((o,r)=>String((i==="flat"?o:r%2===0?Math.max(.001,o-1):o+1)*t)).join(" "),jt=25200,W={sm:2,med:3,lg:5};function U(e,t,i,o,r,n,s={begin:!0,end:!0}){const l=Math.max(o,jt*r),c=[];for(const[u,p,d,a,g]of[[e.line_begin,e.line_begin_size,t,!1,s.begin],[e.line_end,e.line_end_size,i,!0,s.end]]){if(!g||u===void 0||u==="none")continue;const m=wt(d,a);if(!m)continue;const S=u==="arrow"?.5:0,f=l*(W[p?.len??"med"]+S),b=l*(W[p?.w??"med"]+S);c.push(Mt(u,m.at,m.out,f,b,o,n)),u!=="arrow"&&vt(d,a,-m.out[0]*f/2,-m.out[1]*f/2)}return c}function Mt(e,[t,i],[o,r],n,s,l,c){const u="http://www.w3.org/2000/svg",p=(m,S)=>`${String(t-o*m-r*S)},${String(i-r*m+o*S)}`;if(e==="oval"){const m=document.createElementNS(u,"ellipse");return m.setAttribute("cx",String(t)),m.setAttribute("cy",String(i)),m.setAttribute("rx",String(n/2)),m.setAttribute("ry",String(s/2)),m.setAttribute("transform",`rotate(${String(Math.atan2(r,o)*180/Math.PI)} ${String(t)} ${String(i)})`),m.setAttribute("fill",c),m}const d=e==="arrow",a=document.createElementNS(u,d?"polyline":"polygon"),g={triangle:[p(0,0),p(n,s/2),p(n,-s/2)],stealth:[p(0,0),p(n,s/2),p(n*.7,0),p(n,-s/2)],diamond:[p(-n/2,0),p(0,s/2),p(n/2,0),p(0,-s/2)],arrow:[p(n,s/2),p(0,0),p(n,-s/2)]}[e];return a.setAttribute("points",g.join(" ")),d?(a.setAttribute("fill","none"),a.setAttribute("stroke",c),a.setAttribute("stroke-width",String(l))):a.setAttribute("fill",c),a}function Z(e,t,i,o,r,n){const s=t.frame.width*o,l=t.frame.height*o,c="http://www.w3.org/2000/svg",u=document.createElementNS(c,"svg");u.setAttribute("width",String(Math.max(s,1))),u.setAttribute("height",String(Math.max(l,1))),Object.assign(u.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"}),z(u,t);let p=colorCss(t.fill,n);if(t.gradient){const f=`ak-gradient-${String(Dt++)}`;u.append(zt(c,f,t.gradient,t.frame,n)),p=`url(#${f})`}const d=i.map(f=>f.d),a=[],g=i.flatMap((f,b)=>f.stroke?[b]:[]),m=g[0],S=g[g.length-1];if(t.line!==void 0&&t.line!==null&&m!==void 0&&S!==void 0&&((t.line_begin??"none")!=="none"||(t.line_end??"none")!=="none")){const f=C(d[m]??"",s,l,void 0),b=m===S?f:C(d[S]??"",s,l,void 0),h=y=>y.at(-1)?.op!=="Z";a.push(...U(t,f,b,r,o,colorCss(t.line,n),{begin:h(f),end:h(b)})),d[m]=N(f),d[S]=N(b)}i.forEach((f,b)=>{const h=document.createElementNS(c,"path");if(h.setAttribute("d",d[b]??f.d),h.setAttribute("fill-rule","evenodd"),h.setAttribute("fill",f.fill==="none"||t.fill===null||t.fill===void 0?f.fill==="none"||!t.gradient?"none":p:f.fill==="norm"?p:Ot[f.fill](colorCss(t.fill,n))),t.fill_transparency!==void 0&&h.setAttribute("fill-opacity",String(1-t.fill_transparency)),f.stroke&&t.line!==void 0&&t.line!==null){const y=d[b]??f.d;if(t.line_compound!==void 0&&t.line_compound!=="sng"){u.append(h);const x=document.createElementNS(c,"path");x.setAttribute("d",y),x.setAttribute("fill","none"),D(x,t,colorCss(t.line,n),r),u.append(x),G(u,x,t,r,/Z\s*$/u.test(y.trim()));return}D(h,t,colorCss(t.line,n),r)}u.append(h)}),u.append(...a),e.append(u)}const Ot={darken:e=>`color-mix(in srgb, ${e} 60%, black)`,darkenLess:e=>`color-mix(in srgb, ${e} 80%, black)`,lighten:e=>`color-mix(in srgb, ${e} 60%, white)`,lightenLess:e=>`color-mix(in srgb, ${e} 80%, white)`};function V(e,t){const i=e.path;if(!i)return[];const o=i.w===0?0:e.frame.width*t/i.w,r=i.h===0?0:e.frame.height*t/i.h;return[{d:i.steps.map(s=>s.op==="close"?"Z":s.op==="move"?`M ${String(s.x*o)} ${String(s.y*r)}`:s.op==="line"?`L ${String(s.x*o)} ${String(s.y*r)}`:`C ${String(s.x1*o)} ${String(s.y1*r)} ${String(s.x2*o)} ${String(s.y2*r)} ${String(s.x*o)} ${String(s.y*r)}`).join(" "),fill:"norm",stroke:!0}]}function z(e,t){!t.flip?.h&&!t.flip?.v||(e.style.transform=`scale(${t.flip.h?"-1":"1"}, ${t.flip.v?"-1":"1"})`)}const Ct={tl:[0,0],t:[50,0],tr:[100,0],l:[0,50],ctr:[50,50],r:[100,50],bl:[0,100],b:[50,100],br:[100,100]},q=e=>e.picture_fill!==void 0||e.pattern!==void 0||e.gradient?.path!==void 0;function K(e,t,i,o,r){const n=document.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0px",overflow:"hidden",pointerEvents:"none"}),r!==void 0&&(n.style.clipPath=`path(evenodd, "${r}")`),z(n,e);const s=e.picture_fill;if(s){const c=JSON.stringify(o(s.path));s.transparency!==void 0&&(n.style.opacity=String(1-s.transparency));const u=s.tile,p=document.createElement("img");if(p.alt="",p.src=o(s.path),Object.assign(p.style,{position:"absolute",inset:"0px",width:"100%",height:"100%",maxWidth:"none",objectFit:"fill",...u?{visibility:"hidden"}:{}}),n.append(p),u){const d=j*t*u.scale_x,a=j*t*u.scale_y,[g,m]=Ct[u.align],S=document.createElement("div");Object.assign(S.style,{position:"absolute",left:"0px",top:"0px",width:`${String(e.frame.width*t/d)}px`,height:`${String(e.frame.height*t/a)}px`,transform:`scale(${String(d)}, ${String(a)})`,transformOrigin:"0 0",background:`url(${c}) calc(${String(g)}% + ${String(u.offset_x*t/d)}px) calc(${String(m)}% + ${String(u.offset_y*t/a)}px) / auto repeat`}),n.append(S)}return n}if(!e.pattern&&e.gradient)return n.style.background=T(e.gradient,i),n;const l=e.pattern;if(l){const c=`<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" shape-rendering="crispEdges"><rect width="8" height="8" fill="${colorCss(l.bg,i)}"/><path d="${ut(l.preset)}" fill="${colorCss(l.fg,i)}"/></svg>`,u=8*j*t;n.style.background=`url("data:image/svg+xml,${encodeURIComponent(c)}") 0 0 / ${String(u)}px ${String(u)}px repeat`,n.style.imageRendering="pixelated"}return n}const Nt=new Set(["rect","roundRect","ellipse"]),L=(e,t,i)=>t===void 0||t===0?colorCss(e,i):`color-mix(in srgb, ${colorCss(e,i)} ${String((1-t)*100)}%, transparent)`,T=(e,t)=>{const i=e.stops.map(l=>`${L(l.color,l.transparency,t)} ${String(l.at*100)}%`).join(", ");if(e.path===void 0)return`linear-gradient(${String(e.angle+90)}deg, ${i})`;const o=e.focus??{left:.5,top:.5,right:.5,bottom:.5},r=(o.left+1-o.right)/2*100,n=(o.top+1-o.bottom)/2*100;return`radial-gradient(${e.path==="circle"?"circle farthest-corner":"farthest-side"} at ${String(r)}% ${String(n)}%, ${i})`},J=(e,t)=>e.gradient?T(e.gradient,t):e.fill===null||e.fill===void 0?"transparent":L(e.fill,e.fill_transparency,t);let Dt=0;function zt(e,t,i,o,r){const n=document.createElementNS(e,"linearGradient");n.id=t;const s=i.angle*Math.PI/180,l=Math.cos(s),c=Math.sin(s),u=(Math.abs(o.width*l)+Math.abs(o.height*c))/Math.max(o.width,o.height,1)/2;n.setAttribute("x1",String(.5-l*u)),n.setAttribute("y1",String(.5-c*u)),n.setAttribute("x2",String(.5+l*u)),n.setAttribute("y2",String(.5+c*u));for(const p of i.stops){const d=document.createElementNS(e,"stop");d.setAttribute("offset",String(p.at)),d.setAttribute("stop-color",colorCss(p.color,r)),p.transparency!==void 0&&d.setAttribute("stop-opacity",String(1-p.transparency)),n.append(d)}return n}let Lt=0;function Tt(e,t,i,o){const r=[],n="http://www.w3.org/2000/svg",s=[],l=t.frame.width*i,c=t.frame.height*i,u=(t.line_width??LINE_WIDTH)*i*5,p=(f,b)=>{const h=document.createElementNS(n,"filter");h.id=`ak-effect-${String(Lt++)}`;const y=b+u;for(const[x,_]of Object.entries({filterUnits:"userSpaceOnUse",x:String(-y),y:String(-y),width:String(l+2*y),height:String(c+2*y),"color-interpolation-filters":"sRGB"}))h.setAttribute(x,_);f(h),s.push(h),r.push(`url(#${h.id})`)},d=(f,b,h)=>{const y=document.createElementNS(n,b);for(const[x,_]of Object.entries(h))y.setAttribute(x,_);return f.append(y),y};if(t.soft_edges!==void 0&&t.soft_edges>0){const f=t.soft_edges*i;p(b=>{d(b,"feMorphology",{in:"SourceAlpha",operator:"erode",radius:String(f/2),result:"in"}),d(b,"feGaussianBlur",{in:"in",stdDeviation:String(f/4),result:"soft"}),d(b,"feComposite",{in:"SourceGraphic",in2:"soft",operator:"in"})},f)}const a=t.inner_shadow;if(a){const f=a.angle*Math.PI/180,b=a.distance*i;p(h=>{const y=d(h,"feComponentTransfer",{in:"SourceAlpha",result:"out"});d(y,"feFuncA",{type:"table",tableValues:"1 0"}),d(h,"feGaussianBlur",{in:"out",stdDeviation:String(a.blur*i/2),result:"blur"}),d(h,"feOffset",{in:"blur",dx:String(b*Math.cos(f)),dy:String(b*Math.sin(f)),result:"moved"}),d(h,"feFlood",{"flood-color":colorCss(a.color,o),"flood-opacity":String(1-a.transparency),result:"ink"}),d(h,"feComposite",{in:"ink",in2:"moved",operator:"in",result:"shadow"}),d(h,"feComposite",{in:"shadow",in2:"SourceAlpha",operator:"in",result:"inside"});const x=d(h,"feMerge",{});d(x,"feMergeNode",{in:"SourceGraphic"}),d(x,"feMergeNode",{in:"inside"})},(a.blur*2+a.distance)*i)}const g=t.shadow,m=t.glow&&t.glow.size>0?t.glow:void 0;if(g&&!m){const f=g.angle*Math.PI/180,b=g.distance*i;r.push(`drop-shadow(${String(b*Math.cos(f))}px ${String(b*Math.sin(f))}px ${String(g.blur*i)}px ${L(g.color,g.transparency,o)})`)}if(m){const f=m.size*i;p(b=>{d(b,"feMorphology",{in:"SourceAlpha",operator:"dilate",radius:String(f/2),result:"wide"}),d(b,"feGaussianBlur",{in:"wide",stdDeviation:String(f/4),result:"halo"}),d(b,"feFlood",{"flood-color":colorCss(m.color,o),"flood-opacity":String(1-m.transparency),result:"ink"}),d(b,"feComposite",{in:"ink",in2:"halo",operator:"in",result:"glow"});const h=d(b,"feMerge",{});if(g){const y=g.angle*Math.PI/180,x=g.distance*i;d(b,"feGaussianBlur",{in:"SourceAlpha",stdDeviation:String(g.blur*i/2),result:"cast"}),d(b,"feOffset",{in:"cast",dx:String(x*Math.cos(y)),dy:String(x*Math.sin(y)),result:"moved"}),d(b,"feFlood",{"flood-color":colorCss(g.color,o),"flood-opacity":String(1-g.transparency),result:"dark"}),d(b,"feComposite",{in:"dark",in2:"moved",operator:"in",result:"shadow"}),b.append(h),d(h,"feMergeNode",{in:"shadow"})}d(h,"feMergeNode",{in:"glow"}),d(h,"feMergeNode",{in:"SourceGraphic"})},Math.max(f*2,g?(g.blur*1.5+g.distance)*i:0))}if(s.length>0){const f=document.createElementNS(n,"svg");f.setAttribute("width","0"),f.setAttribute("height","0"),Object.assign(f.style,{position:"absolute"}),f.setAttribute("aria-hidden","true"),f.append(...s),e.append(f)}r.length>0&&(e.style.filter=r.join(" "));const S=t.reflection;S&&e.style.setProperty("-webkit-box-reflect",`below ${String(S.distance*i)}px linear-gradient(to bottom, transparent ${String((1-S.size)*100)}%, rgba(0, 0, 0, ${String(1-S.transparency)}))`)}function Ft(e,t,i){const o=t.geometry??"rect",r=t.frame.width*i,n=t.frame.height*i;o==="roundRect"?e.style.borderRadius=`${String(Math.min(r,n)*Math.min(.5,Math.max(0,t.adjustments?.[0]??Q("roundRect")[0]??0)))}px`:o==="ellipse"&&(e.style.borderRadius="50%")}const It={left:"borderLeft",right:"borderRight",top:"borderTop",bottom:"borderBottom"},Y="http://www.w3.org/2000/svg";function Ht(e,t,i,o,r){const n=i.width/k,s=i.height/k,l=o*k,c=tt(t,n,s),u=document.createElementNS(Y,"svg");u.setAttribute("viewBox",`0 0 ${String(n)} ${String(s)}`),u.setAttribute("width","100%"),u.setAttribute("height","100%"),Object.assign(u.style,{position:"absolute",inset:"0px",overflow:"visible"});const p=(a,g)=>{const m=document.createElementNS(Y,a);for(const[S,f]of Object.entries(g))m.setAttribute(S,String(f));u.append(m)},d=a=>{p("path",{d:a.d,fill:a.fill===void 0?"none":colorCss(a.fill,r),stroke:a.width>0?colorCss(a.color,r):"none","stroke-width":a.width,"stroke-linejoin":"round"})};for(const a of[...c.grid,...c.shapes])d(a);for(const a of[...c.boxes,...c.keys])p("rect",{x:a.x,y:a.y,width:a.width,height:a.height,fill:colorCss(a.color,r)});for(const a of[...c.axes,...c.lines])d(a);for(const a of c.dots)p("circle",{cx:a.x,cy:a.y,r:a.r,fill:colorCss(a.color,r)});e.append(u);for(const a of c.words){const g=document.createElement("div");g.textContent=a.text,Object.assign(g.style,{position:"absolute",left:`${String(a.x*l)}px`,top:`${String(a.y*l)}px`,transform:`translate(${{start:"0",middle:"-50%",end:"-100%"}[a.anchor]}, -50%)${a.rotate===void 0?"":` rotate(${String(a.rotate)}deg)`}`,transformOrigin:`${{start:"0%",middle:"50%",end:"100%"}[a.anchor]} 50%`,fontSize:`${String(a.size*l)}px`,lineHeight:"1",whiteSpace:"nowrap",color:colorCss(a.color,r),fontFamily:"var(--ak-theme-minor)"}),e.append(g)}}function Bt(e,t,i,o,r){const n=ft(t.style),s=document.createElement("table");n?.background!==void 0&&(s.style.background=colorCss(n.background,r)),Object.assign(s.style,{borderCollapse:"collapse",tableLayout:"fixed",width:`${String(t.columns.reduce((c,u)=>c+u,0)*i)}px`});const l=document.createElement("colgroup");for(const c of t.columns){const u=document.createElement("col");u.style.width=`${String(c*i)}px`,l.append(u)}s.append(l);for(const[c,u]of t.rows.entries()){const p=document.createElement("tr");p.style.height=`${String(u.height*i)}px`;for(const[d,a]of u.cells.entries()){if(a.spanned)continue;const g=document.createElement("td");g.dataset.akCell=`${String(c)},${String(d)}`,a.span_width&&(g.colSpan=a.span_width),a.span_height&&(g.rowSpan=a.span_height),g.style.padding="0px",g.style.verticalAlign={t:"top",ctr:"middle",b:"bottom"}[a.text.style.vertical_anchor];const m=n?X(n,t,c,d,t.rows.length,t.columns.length,c+(a.span_height??1)-1,d+(a.span_width??1)-1):void 0,S=a.fill!==void 0?a.fill:m?.fill;S!==void 0&&(g.style.background=colorCss(S,r));for(const[b,h]of Object.entries(It)){const y=b,x=a.borders?.[y]??m?.borders[y];x&&(g.style[h]=`${String(x.width*i)}px solid ${colorCss(x.color,r)}`)}const f=A(a.text,i,o,r);f.style.minHeight="0px",g.append(f),p.append(g)}s.append(p)}e.style.height="auto",e.append(s)}export function drawShape(e,t,i){const{k:o,colors:r}=i;if(t.kind==="placeholder"&&t.text?.empty===!0&&!i.editing)return;const n=document.createElement("div");n.setAttribute(SHAPE_ATTR,`${e}/${t.name}`);const{left:s,top:l,width:c,height:u}=t.frame;Object.assign(n.style,{position:"absolute",left:`${String(s*o)}px`,top:`${String(l*o)}px`,width:`${String(c*o)}px`,height:`${String(u*o)}px`}),t.rotation!==void 0&&(n.style.transform=`rotate(${String(t.rotation)}deg)`);const p=(t.line_width??LINE_WIDTH)*o;if(t.chart)Ht(n,t.chart,t.frame,o,r);else if(t.table)return Bt(n,t.table,o,i.lang,r),n;Tt(n,t,o,r),t.alt!==void 0&&n.setAttribute("aria-label",t.alt);let d;if(t.kind==="autoshape"){if(!t.path&&rt(t.geometry))return $t(n,t,o,p,r),n;const a=t.path?void 0:H(t.geometry??"rect",t.frame.width*o,t.frame.height*o,t.adjustments),g=t.line!==void 0&&t.line!==null&&(t.line_dash!==void 0&&t.line_dash!=="solid"||t.line_compound!==void 0&&t.line_compound!=="sng"||t.line_join!==void 0&&t.line_join!==$.join);if(q(t)){const S=t.path?V(t,o):a?.paths??[],f=S.filter(h=>h.fill!=="none").map(h=>h.d).join(" ");n.append(K(t,o,r,i.url,f));const b={...t,fill:null};return delete b.gradient,Z(n,b,S,o,p,r),t.text&&n.append(A(t.text,o,i.lang,r,a?.text)),n}const m=t.path?V(t,o):Nt.has(t.geometry??"rect")&&!g?void 0:a?.paths;if(m)return Z(n,t,m,o,p,r),t.text&&n.append(A(t.text,o,i.lang,r,a?.text)),n;n.style.background=J(t,r),Ft(n,t,o),d=a?.text}else q(t)?n.append(K(t,o,r,i.url,void 0)):(t.fill!==void 0||t.gradient)&&(n.style.background=J(t,r));if(t.line!==void 0&&t.line!==null&&(n.style.outline=`${String(p)}px ${t.line_dash===void 0||t.line_dash==="solid"?"solid":"dashed"} ${colorCss(t.line,r)}`,n.style.outlineOffset=`${String(-p/2)}px`),t.text?.style.auto_size==="shape"&&t.text.style.orientation==="horz"&&(n.style.height="auto",n.style.minHeight="0px"),t.kind==="picture"&&t.media){n.style.overflow="hidden";const a=document.createElement("img");a.alt=t.alt??"",a.src=i.url(t.media.path),z(a,t);const g=t.media.crop??{left:0,top:0,right:0,bottom:0},m=1-g.left-g.right,S=1-g.top-g.bottom;Object.assign(a.style,{position:"absolute",width:`${String(100/m)}%`,height:`${String(100/S)}%`,left:`${String(-g.left/m*100)}%`,top:`${String(-g.top/S*100)}%`,maxWidth:"none"}),t.flip&&(a.style.transformOrigin=`${String(50/m-g.left/m*100)}% ${String(50/S-g.top/S*100)}%`),n.append(a)}else if(t.kind==="movie"&&t.media&&!i.playing&&i.poster!==!0)n.dataset.akFilm="";else if(t.kind==="movie"&&t.media){const a=document.createElement("video");a.src=i.url(t.media.path),a.muted=!0,a.playsInline=!0,a.preload="auto",t.media.poster!==void 0&&(a.currentTime=t.media.poster),Object.assign(a.style,{width:"100%",height:"100%",objectFit:"fill",...i.playing?{}:{pointerEvents:"none"}}),n.append(a)}if(t.kind==="item"&&t.item&&(n.dataset.akItem=t.item.path,i.editing)){const a=document.createElement("div");a.textContent=t.item.path,Object.assign(a.style,{position:"absolute",inset:"0px",display:"grid",placeItems:"center",padding:`${String(8*o)}px`,font:`${String(Math.max(10,14*o))}px/1.3 system-ui, sans-serif`,color:"#595959",background:"rgba(127, 127, 127, 0.12)",overflowWrap:"anywhere",textAlign:"center"}),n.append(a)}if(t.kind==="audio"&&t.media&&(!i.editing&&t.media.playback?.hide===!0&&(n.style.visibility="hidden"),n.append(Rt()),i.playing)){const a=document.createElement("audio");a.src=i.url(t.media.path),a.preload="auto",n.append(a)}return t.text&&n.append(A(t.text,o,i.lang,r,d)),n}const F="http://www.w3.org/2000/svg";function Rt(){const e=document.createElementNS(F,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","#595959"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linejoin","round"),Object.assign(e.style,{width:"100%",height:"100%",display:"block"});const t=document.createElementNS(F,"polygon");t.setAttribute("points","11 5 6 9 2 9 2 15 6 15 11 19 11 5"),t.setAttribute("fill","#595959"),e.append(t);for(const i of["M15.54 8.46a5 5 0 0 1 0 7.07","M19.07 4.93a10 10 0 0 1 0 14.14"]){const o=document.createElementNS(F,"path");o.setAttribute("d",i),e.append(o)}return e}export function slideBackgroundCss(e,t,i){return e.background_picture!==void 0?`${colorCss(e.background,t)} url(${JSON.stringify(i(e.background_picture))}) center / 100% 100% no-repeat`:e.background_gradient?T(e.background_gradient,t):colorCss(e.background,t)}export function drawSlide(e,t){const i=document.createElement("div");i.dataset.akSlide=e.id;const o={...t,colors:st(t.colors,e.color_map)};Object.assign(i.style,{position:"absolute",inset:"0px",background:slideBackgroundCss(e,o.colors,t.url),overflow:"hidden"});for(const r of e.shapes){const n=drawShape(e.id,r,o);n&&i.append(n)}return i}
2
+ import{blockSvg as it,paletteOfColors as ot}from"@allyhub/blocks";import{adjustmentDefaults as rt,cellLook as st,chartDrawing as at,colorRgb as lt,colorRgba as dt,CONNECTOR_STYLE as ct,DECK_FONTS as ut,EMU_PER_PT as k,Inches as ft,isConnectorGeometry as gt,LINE_DEFAULTS as A,mappedColors as pt,Pt as mt,bulletLookOver as bt,numberText as ht,runLang as yt,SINGLE_SPACING as j,spaceLength as R,PATTERN_CELL as v,patternPath as B,tableStyleOf as St}from"@allyhub/slides-core";import{presetOutline as M}from"@allyhub/ooxml/geometry";export{SLIDE_CSS,slideStyle}from"./slide-css.js";export const SHAPE_ATTR="data-ak-shape",LINE_WIDTH=mt(.75);export{j as SINGLE_SPACING};export const MIN_FONT_SCALE=.25;export function themeCss(e){const t={};for(const[i,r]of Object.entries(e.colors))t[`--ak-theme-${i}`]=r;return t["--ak-theme-major"]=_(e.fonts.major,C),t["--ak-theme-minor"]=_(e.fonts.minor,C),t["--ak-theme-major-ea"]=_(e.fonts.major_east_asian,O),t["--ak-theme-minor-ea"]=_(e.fonts.minor_east_asian,O),t}const O='"Noto Sans SC", sans-serif',C=`"${ut.minor}", ${O}`,_=(e,t)=>e.includes(",")||e.includes('"')?e:`"${e}", ${t}`;export const colorCss=(e,t)=>e==null?"transparent":lt(e,t);const G=e=>e===void 0?void 0:e==="+mj-lt"?"var(--ak-theme-major)":e==="+mn-lt"?"var(--ak-theme-minor)":_(e,C),xt={l:"start",ctr:"center",r:"end",just:"justify"},wt={t:"flex-start",ctr:"center",b:"flex-end"},$t=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u2E80-\u2FDF\u3000-\u303F\uFF00-\uFFEF]/u,vt=/[\u2018\u2019\u201C\u201D\u2026\u2014\u2013\u2025\u00B7]/u;export function eastAsianRuns(e,t){const i=[];for(const r of e){const s=$t.test(r)||t&&vt.test(r),n=i.at(-1);n?.ea===s?n.text+=r:i.push({text:r,ea:s})}return i}const kt=e=>!e.startsWith("#")&&!e.startsWith("ppaction:"),w=e=>`calc(${String(e)}px * var(--ak-fit, 1))`;function P(e,t,i,r){if(!t)return;const s=G(t.name);s&&(e.style.fontFamily=s),t.size!==void 0&&(e.style.fontSize=w(t.size*i)),t.bold!==void 0&&(e.style.fontWeight=t.bold?"700":"400"),t.italic!==void 0&&(e.style.fontStyle=t.italic?"italic":"normal"),(t.underline!==void 0||t.strike!==void 0||t.link)&&Object.assign(e.style,decorationCss(t)),t.caps!==void 0&&Object.assign(e.style,capsCss(t.caps)),t.highlight!==void 0&&(e.style.backgroundColor=t.highlight),t.baseline!==void 0&&t.baseline!==0&&(e.style.fontSize=t.size===void 0?"0.66em":w(t.size*i*.66),e.style.verticalAlign=`${String(t.baseline/.66)}em`),t.spacing!==void 0&&(e.style.letterSpacing=w(t.spacing*i)),t.link!==void 0?e.style.color=colorCss("hlink",r):t.color!==void 0&&(e.style.color=colorCss(t.color,r))}const _t={sng:{style:"solid"},dbl:{style:"double"},heavy:{style:"solid",heavy:!0},dotted:{style:"dotted"},dottedHeavy:{style:"dotted",heavy:!0},dash:{style:"dashed"},dashHeavy:{style:"dashed",heavy:!0},dashLong:{style:"dashed"},dashLongHeavy:{style:"dashed",heavy:!0},dotDash:{style:"dashed"},dotDashHeavy:{style:"dashed",heavy:!0},dotDotDash:{style:"dashed"},dotDotDashHeavy:{style:"dashed",heavy:!0},wavy:{style:"wavy"},wavyHeavy:{style:"wavy",heavy:!0},wavyDbl:{style:"wavy"},words:{style:"solid"}};export function decorationCss(e){const t=typeof e.underline=="string"?e.underline:e.underline===!0||e.link!==void 0?"sng":void 0,i=e.strike===!0?"sngStrike":e.strike===!1?void 0:e.strike,r=t?_t[t]:{style:i==="dblStrike"?"double":"solid"};return{textDecorationLine:[t?"underline":"",i?"line-through":""].filter(s=>s!=="").join(" ")||"none",textDecorationStyle:r.style,textDecorationThickness:"heavy"in r?"0.1em":"auto"}}export const capsCss=e=>({textTransform:e==="all"?"uppercase":"none",fontVariantCaps:e==="small"?"small-caps":"normal"});function At(){if(document.adoptedStyleSheets.some(t=>t.allyhubBullets))return;const e=new CSSStyleSheet;e.replaceSync("[data-ak-bullet]::before{content:attr(data-ak-bullet)}"),Object.assign(e,{allyhubBullets:!0}),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}export function paragraphStyle(e,t){const i=t[e.level]??t[0];if(!i)throw new Error("A text style has nine levels.");const r={...i};return e.numbered!==void 0?delete r.bullet:e.bullet===null?(delete r.bullet,delete r.numbered):e.bullet!==void 0&&(delete r.numbered,r.bullet={char:e.bullet,...e.bullet_font===void 0?{}:{font:e.bullet_font}}),bt({...r,...e.alignment===void 0?{}:{alignment:e.alignment},...e.line_spacing===void 0?{}:{line_spacing:e.line_spacing},...e.space_before===void 0?{}:{space_before:e.space_before},...e.space_after===void 0?{}:{space_after:e.space_after},...e.margin_left===void 0?{}:{margin_left:e.margin_left},...e.indent===void 0?{}:{indent:e.indent},...e.numbered===void 0?{}:{numbered:e.numbered},font:{...i.font,...e.font}},e)}export function paragraphLabels(e,t){const i=[];return e.map(r=>{if(!r.runs.some(n=>n.text!==""&&n.text!=="\v"))return;const s=paragraphStyle(r,t);return i.length=r.level+1,s.numbered===void 0?i[r.level]=0:i[r.level]=i[r.level]?(i[r.level]??0)+1:s.start_at??1,s.numbered===void 0?s.bullet?.char:ht(s.numbered,i[r.level]??1)})}export function paragraphElement(e,t,i,r,s,n){const a=paragraphStyle(e,i),l=document.createElement("div");l.dataset.akParagraph=String(t),l.dataset.akLevel=String(e.level);const d=e.runs.map(o=>o.font?.size??a.font.size),c=(d.length>0?Math.max(...d):a.font.size)*s,g="lines"in a.line_spacing?String(a.line_spacing.lines*j):w(a.line_spacing.fixed*s),u=r!==void 0;if(Object.assign(l.style,{position:"relative",textAlign:xt[a.alignment],paddingInlineStart:`${String(a.margin_left*s)}px`,textIndent:u?"0px":`${String(a.indent*s)}px`,marginBlockStart:t===0?"0px":w(R(a.space_before,c/s)*s),marginBlockEnd:w(R(a.space_after,c/s)*s),lineHeight:g,fontSize:w(c),minBlockSize:"lines"in a.line_spacing?w(c*a.line_spacing.lines*j):g}),P(l,a.font,s,n),l.style.fontSize=w(c),r!==void 0){At();const o=document.createElement("span");Object.assign(o.style,{position:"absolute",insetInlineStart:`${String((a.margin_left+a.indent)*s)}px`,textIndent:"0px"}),o.dataset.akLabel=String((a.margin_left+a.indent)*s),o.dataset.akMargin=String(a.margin_left*s),o.dataset.akTab=String(DEFAULT_TAB_STOP*s);const p=document.createElement("span");p.dataset.akBullet=r;const m=a.numbered===void 0?a.bullet?.font:void 0,h=(e.runs[0]?.font?.size??a.font.size)*s;Object.assign(p.style,{lineHeight:"0",...m===void 0?{}:{fontFamily:G(m)},...a.bullet_size===void 0?{}:{fontSize:w(h*a.bullet_size)},...a.bullet_color===void 0?{}:{color:colorCss(a.bullet_color,n)}}),o.append(p),l.append(o)}return l}export const DEFAULT_TAB_STOP=ft(1);export function hangLabels(e){for(const t of e.querySelectorAll("[data-ak-label]")){const i=t.parentElement,r=t.firstElementChild;if(!i||!(r instanceof HTMLElement))continue;const s=Number(t.dataset.akLabel),n=Number(t.dataset.akMargin),a=Number(t.dataset.akTab),l=getComputedStyle(i).writingMode.startsWith("vertical"),d=s+(l?r.offsetHeight:r.offsetWidth);i.style.textIndent=d<=n+.5||!(a>0)?"0px":`${String((Math.floor(d/a)+1)*a-n)}px`}}export const exactSpacing=(e,t)=>!("lines"in paragraphStyle(e,t).line_spacing);export function runElement(e,t,i,r=!1,s){const n=document.createElement("span");P(n,e.font,t,i);const a=e.text===void 0?s:yt(e.text,s);return a!==void 0&&a!==s&&(n.lang=a),r&&(n.style.lineHeight="0"),e.font?.link!==void 0&&kt(e.font.link)&&(n.dataset.akLink=e.font.link),n}export function eastAsianFace(e,t){return`var(--ak-theme-${(e.font?.name??t)==="+mj-lt"?"major":"minor"}-ea)`}function Et(e,t,i,r,s){const n=isCjk(r);e.replaceChildren();const a=t.paragraphs.length>0?t.paragraphs:[{runs:[],level:0}],l=paragraphLabels(a,t.style.levels);a.forEach((d,c)=>{const g=paragraphElement(d,c,t.style.levels,l[c],i,s),u=paragraphStyle(d,t.style.levels).font.name,o=exactSpacing(d,t.style.levels);for(const p of d.runs){const m=runElement(p,i,s,o,r),h=eastAsianFace(p,u);for(const f of eastAsianRuns(p.text.replaceAll("\v",`
3
+ `),n)){if(!f.ea){m.append(f.text);continue}const b=document.createElement("span");b.style.fontFamily=h,b.textContent=f.text,m.append(b)}g.append(m)}e.append(g)})}export const isCjk=e=>e!==void 0&&/^(zh|ja|ko)(-|$)/iu.test(e);function E(e,t,i,r,s){const{style:n}=e,a=n.auto_size==="shape"&&n.orientation==="horz",l=document.createElement("div");l.dataset.akText="",l.dataset.akAutofit=n.auto_size,n.orientation!=="horz"&&(l.dataset.akOrientation=n.orientation);const d=a?void 0:s;Object.assign(l.style,{position:a?"relative":"absolute",inset:a?"auto":d?`${String(d.top)}px calc(100% - ${String(d.right)}px) calc(100% - ${String(d.bottom)}px) ${String(d.left)}px`:"0px",minHeight:d?`${String(d.bottom-d.top)}px`:"100%",display:"flex",flexDirection:"column",justifyContent:wt[n.vertical_anchor],padding:`${String(n.margins.top*t)}px ${String(n.margins.right*t)}px ${String(n.margins.bottom*t)}px ${String(n.margins.left*t)}px`,whiteSpace:n.word_wrap?"pre-wrap":"pre",overflowWrap:"break-word",boxSizing:"border-box",...orientationCss(n.orientation)});const c=document.createElement("div");if(c.dataset.akBody="",l.append(c),Et(c,e,t,i,r),n.columns&&n.columns.count>1&&Object.assign(c.style,{columnCount:String(n.columns.count),columnGap:`${String(n.columns.spacing*t)}px`,columnFill:a?"balance":"auto",...a?{}:{flex:"1 1 auto",minHeight:"0"}}),!n.word_wrap){Object.assign(c.style,{display:"flex",flexDirection:"column"});for(const g of c.children){if(!(g instanceof HTMLElement))continue;const u=g.style.textAlign;Object.assign(g.style,{inlineSize:"max-content",minInlineSize:"100%",boxSizing:"border-box",alignSelf:u==="center"?"center":u==="end"?"flex-end":"flex-start"})}}return i!==void 0&&(l.lang=i),isCjk(i)&&(l.dataset.akCjk=""),l}export function orientationCss(e){switch(e){case"horz":return{writingMode:"horizontal-tb",textOrientation:"mixed"};case"vert":return{writingMode:"sideways-rl",textOrientation:"mixed"};case"vert270":return{writingMode:"sideways-lr",textOrientation:"mixed"};case"eaVert":return{writingMode:"vertical-rl",textOrientation:"mixed"};case"wordArtVert":return{writingMode:"vertical-lr",textOrientation:"upright"};case"wordArtVertRtl":return{writingMode:"vertical-rl",textOrientation:"upright"};case"mongolianVert":return{writingMode:"vertical-lr",textOrientation:"mixed"}}}export function fitText(e){const t=e.querySelector("[data-ak-body]");if(!t||e.dataset.akAutofit!=="text")return 1;const i=e.dataset.akOrientation!==void 0,r=getComputedStyle(e),s=i?e.clientWidth-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight):e.clientHeight-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom),n=d=>(e.style.setProperty("--ak-fit",String(d)),hangLabels(e),!(t.style.columnCount!==""&&t.scrollWidth>t.clientWidth+.5)&&(i?t.scrollWidth:t.scrollHeight)<=s+.5);if(n(1))return delete e.dataset.akFontScale,1;let a=MIN_FONT_SCALE,l=1;if(!n(a))return e.dataset.akFontScale=a.toFixed(2),a;for(;l-a>.01;){const d=(a+l)/2;n(d)?a=d:l=d}return n(a),e.dataset.akFontScale=a.toFixed(2),a}function N(e,t,i,r){const s=e.split(" "),n=[],a=l=>{const d=Number(s[l]),c=Number(s[l+1]);return[r?.h?t-d:d,r?.v?i-c:c]};for(let l=0;l<s.length;){const d=s[l++];d==="M"||d==="L"?(n.push({op:d,at:[a(l)]}),l+=2):d==="C"?(n.push({op:d,at:[a(l),a(l+2),a(l+4)]}),l+=6):d==="Z"&&n.push({op:d})}return n}const T=e=>e.map(t=>t.op==="Z"?"Z":`${t.op}${t.at.map(([i,r])=>`${String(i)} ${String(r)}`).join(" ")}`).join(" ");function jt(e,t){const i=e.flatMap(n=>n.op==="Z"?[]:n.at),r=t?[...i].reverse():i,s=r[0];if(s)for(const n of r.slice(1)){const a=Math.hypot(s[0]-n[0],s[1]-n[1]);if(a>1e-6)return{at:s,out:[(s[0]-n[0])/a,(s[1]-n[1])/a]}}}function Mt(e,t,i,r){const s=e.filter(l=>l.op!=="Z"),n=t?s[s.length-1]:s[0];if(!n)return;const a=t?n.at.slice(n.op==="C"?-2:-1):[...n.at,...s[1]?.op==="C"?s[1].at.slice(0,1):[]];for(const l of a)l[0]+=i,l[1]+=r}function Ot(e,t,i,r,s){if(t.line===null)return;const n=t.frame.width*i,a=t.frame.height*i,l=(M(t.geometry??"line",n,a,t.adjustments)?.paths??[]).filter(m=>m.stroke).map(m=>N(m.d,n,a,t.flip)),d=l[0],c=l[l.length-1];if(!d||!c)return;const g="http://www.w3.org/2000/svg",u=document.createElementNS(g,"svg");u.setAttribute("width",String(Math.max(n,1))),u.setAttribute("height",String(Math.max(a,1))),Object.assign(u.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const o=colorCss(t.line??ct.line,s),p=Z(t,d,c,r,i,o);for(const m of l){const h=document.createElementNS(g,"path");h.setAttribute("d",T(m)),h.setAttribute("fill","none"),D(h,t,o,r),u.append(h),U(u,h,t,r,!1)}u.append(...p),e.append(u)}const Ct={flat:"butt",rnd:"round",sq:"square"};function D(e,t,i,r){e.setAttribute("stroke",i),e.setAttribute("stroke-width",String(r)),e.setAttribute("stroke-linecap",Ct[t.line_cap??A.cap]);const s=t.line_join??A.join;e.setAttribute("stroke-linejoin",s),s==="miter"&&e.setAttribute("stroke-miterlimit","8");const n=Dt(t.line_dash,r,t.line_cap);n&&e.setAttribute("stroke-dasharray",n)}const W={dbl:[1/3,1/3,1/3],thickThin:[.6,.2,.2],thinThick:[.2,.2,.6],tri:[1/6,1/6,2/6,1/6,1/6]};let Nt=0;function U(e,t,i,r,s){const n=i.line_compound;if(n===void 0||n==="sng")return;const a=t.getAttribute("d")??"",l="http://www.w3.org/2000/svg",d=!s&&(n==="thickThin"||n==="thinThick")?W.dbl:W[n],c=`ak-compound-${String(Nt++)}`,g=document.createElementNS(l,"defs"),u=document.createElementNS(l,"mask");u.id=c,u.setAttribute("maskUnits","userSpaceOnUse");for(const[f,b]of Object.entries({x:"-100000",y:"-100000",width:"200000",height:"200000"}))u.setAttribute(f,b);const o=(f,b,y)=>{if(f<=0)return;const S=document.createElementNS(l,"path");S.setAttribute("d",a),S.setAttribute("fill","none"),S.setAttribute("stroke",b),S.setAttribute("stroke-width",String(f*2)),S.setAttribute("stroke-linejoin",t.getAttribute("stroke-linejoin")??A.join),S.setAttribute("stroke-linecap",t.getAttribute("stroke-linecap")??"butt"),y.append(S)},p=[.5];for(const f of d)p.push((p[p.length-1]??0)-f);const m=d.flatMap((f,b)=>b%2===1?[[p[b+1]??0,p[b]??0]]:[]);if(o(r/2,"white",u),m.every(([f,b])=>m.some(([y,S])=>Math.abs(y+b)<1e-6&&Math.abs(S+f)<1e-6)))for(const[f,b]of m)b>0&&(o(b*r,"black",u),o(Math.max(0,f)*r,"white",u));else{const f=document.createElementNS(l,"clipPath");f.id=`${c}-in`;const b=document.createElementNS(l,"path");b.setAttribute("d",a),b.setAttribute("clip-rule","evenodd"),f.append(b),g.append(f);for(const[y,S]of m)if(y>=0){o(S*r,"black",u),o(y*r,"white",u);const x=document.createElementNS(l,"g");x.setAttribute("clip-path",`url(#${f.id})`),o(r/2,"white",x),u.append(x)}else{const x=document.createElementNS(l,"g");x.setAttribute("clip-path",`url(#${f.id})`),o(-y*r,"black",x),o(Math.max(0,-S)*r,"white",x),u.append(x)}}g.append(u),e.insertBefore(g,e.firstChild),t.setAttribute("mask",`url(#${c})`)}const Tt={sysDash:[3,1],sysDot:[1,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3],dot:[1,3],sysDashDot:[3,1,1,1],sysDashDotDot:[3,1,1,1,1,1]},Dt=(e,t,i="flat")=>e&&Tt[e]?.map((r,s)=>String((i==="flat"?r:s%2===0?Math.max(.001,r-1):r+1)*t)).join(" "),Lt=25200,V={sm:2,med:3,lg:5};function Z(e,t,i,r,s,n,a={begin:!0,end:!0}){const l=Math.max(r,Lt*s),d=[];for(const[c,g,u,o,p]of[[e.line_begin,e.line_begin_size,t,!1,a.begin],[e.line_end,e.line_end_size,i,!0,a.end]]){if(!p||c===void 0||c==="none")continue;const m=jt(u,o);if(!m)continue;const h=c==="arrow"?.5:0,f=l*(V[g?.len??"med"]+h),b=l*(V[g?.w??"med"]+h);d.push(zt(c,m.at,m.out,f,b,r,n)),c!=="arrow"&&Mt(u,o,-m.out[0]*f/2,-m.out[1]*f/2)}return d}function zt(e,[t,i],[r,s],n,a,l,d){const c="http://www.w3.org/2000/svg",g=(m,h)=>`${String(t-r*m-s*h)},${String(i-s*m+r*h)}`;if(e==="oval"){const m=document.createElementNS(c,"ellipse");return m.setAttribute("cx",String(t)),m.setAttribute("cy",String(i)),m.setAttribute("rx",String(n/2)),m.setAttribute("ry",String(a/2)),m.setAttribute("transform",`rotate(${String(Math.atan2(s,r)*180/Math.PI)} ${String(t)} ${String(i)})`),m.setAttribute("fill",d),m}const u=e==="arrow",o=document.createElementNS(c,u?"polyline":"polygon"),p={triangle:[g(0,0),g(n,a/2),g(n,-a/2)],stealth:[g(0,0),g(n,a/2),g(n*.7,0),g(n,-a/2)],diamond:[g(-n/2,0),g(0,a/2),g(n/2,0),g(0,-a/2)],arrow:[g(n,a/2),g(0,0),g(n,-a/2)]}[e];return o.setAttribute("points",p.join(" ")),u?(o.setAttribute("fill","none"),o.setAttribute("stroke",d),o.setAttribute("stroke-width",String(l))):o.setAttribute("fill",d),o}function L(e,t,i,r,s,n){const a=t.frame.width*r,l=t.frame.height*r,d="http://www.w3.org/2000/svg",c=document.createElementNS(d,"svg");c.setAttribute("width",String(Math.max(a,1))),c.setAttribute("height",String(Math.max(l,1))),Object.assign(c.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"}),z(c,t);let g=colorCss(t.fill,n);if(t.gradient){const f=`ak-gradient-${String(Ht++)}`;c.append(Rt(d,f,t.gradient,t.frame,n)),g=`url(#${f})`}const u=i.map(f=>f.d),o=[],p=i.flatMap((f,b)=>f.stroke?[b]:[]),m=p[0],h=p[p.length-1];if(t.line!==void 0&&t.line!==null&&m!==void 0&&h!==void 0&&((t.line_begin??"none")!=="none"||(t.line_end??"none")!=="none")){const f=N(u[m]??"",a,l,void 0),b=m===h?f:N(u[h]??"",a,l,void 0),y=S=>S.at(-1)?.op!=="Z";o.push(...Z(t,f,b,s,r,colorCss(t.line,n),{begin:y(f),end:y(b)})),u[m]=T(f),u[h]=T(b)}i.forEach((f,b)=>{const y=document.createElementNS(d,"path");if(y.setAttribute("d",u[b]??f.d),y.setAttribute("fill-rule","evenodd"),y.setAttribute("fill",f.fill==="none"||t.fill===null||t.fill===void 0?f.fill==="none"||!t.gradient?"none":g:f.fill==="norm"?g:Ft[f.fill](colorCss(t.fill,n))),t.fill_transparency!==void 0&&y.setAttribute("fill-opacity",String(1-t.fill_transparency)),f.stroke&&t.line!==void 0&&t.line!==null){const S=u[b]??f.d;if(t.line_compound!==void 0&&t.line_compound!=="sng"){c.append(y);const x=document.createElementNS(d,"path");x.setAttribute("d",S),x.setAttribute("fill","none"),D(x,t,colorCss(t.line,n),s),c.append(x),U(c,x,t,s,/Z\s*$/u.test(S.trim()));return}D(y,t,colorCss(t.line,n),s)}c.append(y)}),c.append(...o),e.append(c)}const Ft={darken:e=>`color-mix(in srgb, ${e} 60%, black)`,darkenLess:e=>`color-mix(in srgb, ${e} 80%, black)`,lighten:e=>`color-mix(in srgb, ${e} 60%, white)`,lightenLess:e=>`color-mix(in srgb, ${e} 80%, white)`};function q(e,t){const i=e.path;if(!i)return[];const r=i.w===0?0:e.frame.width*t/i.w,s=i.h===0?0:e.frame.height*t/i.h;return[{d:i.steps.map(a=>a.op==="close"?"Z":a.op==="move"?`M ${String(a.x*r)} ${String(a.y*s)}`:a.op==="line"?`L ${String(a.x*r)} ${String(a.y*s)}`:`C ${String(a.x1*r)} ${String(a.y1*s)} ${String(a.x2*r)} ${String(a.y2*s)} ${String(a.x*r)} ${String(a.y*s)}`).join(" "),fill:"norm",stroke:!0}]}function z(e,t){!t.flip?.h&&!t.flip?.v||(e.style.transform=`scale(${t.flip.h?"-1":"1"}, ${t.flip.v?"-1":"1"})`)}const K={tl:[0,0],t:[50,0],tr:[100,0],l:[0,50],ctr:[50,50],r:[100,50],bl:[0,100],b:[50,100],br:[100,100]},J=e=>e.picture_fill!==void 0||e.pattern!==void 0||e.gradient?.path!==void 0;function Y(e,t,i,r,s){const n=document.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0px",overflow:"hidden",pointerEvents:"none"}),s!==void 0&&(n.style.clipPath=`path(evenodd, "${s}")`),z(n,e);const a=e.picture_fill;if(a){const d=JSON.stringify(r(a.path));a.transparency!==void 0&&(n.style.opacity=String(1-a.transparency));const c=a.tile,g=document.createElement("img");if(g.alt="",g.src=r(a.path),Object.assign(g.style,{position:"absolute",inset:"0px",width:"100%",height:"100%",maxWidth:"none",objectFit:"fill",...c?{visibility:"hidden"}:{}}),n.append(g),c){const u=v*t*c.scale_x,o=v*t*c.scale_y,[p,m]=K[c.align],h=document.createElement("div");Object.assign(h.style,{position:"absolute",left:"0px",top:"0px",width:`${String(e.frame.width*t/u)}px`,height:`${String(e.frame.height*t/o)}px`,transform:`scale(${String(u)}, ${String(o)})`,transformOrigin:"0 0",background:`url(${d}) calc(${String(p)}% + ${String(c.offset_x*t/u)}px) calc(${String(m)}% + ${String(c.offset_y*t/o)}px) / auto repeat`}),n.append(h)}return n}if(!e.pattern&&e.gradient)return n.style.background=I(e.gradient,i),n;const l=e.pattern;if(l){const d=`<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" shape-rendering="crispEdges"><rect width="8" height="8" fill="${colorCss(l.bg,i)}"/><path d="${B(l.preset)}" fill="${colorCss(l.fg,i)}"/></svg>`,c=8*v*t;n.style.background=`url("data:image/svg+xml,${encodeURIComponent(d)}") 0 0 / ${String(c)}px ${String(c)}px repeat`,n.style.imageRendering="pixelated"}return n}const It=new Set(["rect","roundRect","ellipse"]),F=(e,t,i)=>t===void 0||t===0?colorCss(e,i):`color-mix(in srgb, ${colorCss(e,i)} ${String((1-t)*100)}%, transparent)`,I=(e,t)=>{const i=e.stops.map(l=>`${F(l.color,l.transparency,t)} ${String(l.at*100)}%`).join(", ");if(e.path===void 0)return`linear-gradient(${String(e.angle+90)}deg, ${i})`;const r=e.focus??{left:.5,top:.5,right:.5,bottom:.5},s=(r.left+1-r.right)/2*100,n=(r.top+1-r.bottom)/2*100;return`radial-gradient(${e.path==="circle"?"circle farthest-corner":"farthest-side"} at ${String(s)}% ${String(n)}%, ${i})`},Q=(e,t)=>e.gradient?I(e.gradient,t):e.fill===null||e.fill===void 0?"transparent":F(e.fill,e.fill_transparency,t);let Ht=0;function Rt(e,t,i,r,s){const n=document.createElementNS(e,"linearGradient");n.id=t;const a=i.angle*Math.PI/180,l=Math.cos(a),d=Math.sin(a),c=(Math.abs(r.width*l)+Math.abs(r.height*d))/Math.max(r.width,r.height,1)/2;n.setAttribute("x1",String(.5-l*c)),n.setAttribute("y1",String(.5-d*c)),n.setAttribute("x2",String(.5+l*c)),n.setAttribute("y2",String(.5+d*c));for(const g of i.stops){const u=document.createElementNS(e,"stop");u.setAttribute("offset",String(g.at)),u.setAttribute("stop-color",colorCss(g.color,s)),g.transparency!==void 0&&u.setAttribute("stop-opacity",String(1-g.transparency)),n.append(u)}return n}let Bt=0;function Gt(e,t,i,r){const s=[],n="http://www.w3.org/2000/svg",a=[],l=t.frame.width*i,d=t.frame.height*i,c=(t.line_width??LINE_WIDTH)*i*5,g=(f,b)=>{const y=document.createElementNS(n,"filter");y.id=`ak-effect-${String(Bt++)}`;const S=b+c;for(const[x,$]of Object.entries({filterUnits:"userSpaceOnUse",x:String(-S),y:String(-S),width:String(l+2*S),height:String(d+2*S),"color-interpolation-filters":"sRGB"}))y.setAttribute(x,$);f(y),a.push(y),s.push(`url(#${y.id})`)},u=(f,b,y)=>{const S=document.createElementNS(n,b);for(const[x,$]of Object.entries(y))S.setAttribute(x,$);return f.append(S),S};if(t.soft_edges!==void 0&&t.soft_edges>0){const f=t.soft_edges*i;g(b=>{u(b,"feMorphology",{in:"SourceAlpha",operator:"erode",radius:String(f/2),result:"in"}),u(b,"feGaussianBlur",{in:"in",stdDeviation:String(f/4),result:"soft"}),u(b,"feComposite",{in:"SourceGraphic",in2:"soft",operator:"in"})},f)}const o=t.inner_shadow;if(o){const f=o.angle*Math.PI/180,b=o.distance*i;g(y=>{const S=u(y,"feComponentTransfer",{in:"SourceAlpha",result:"out"});u(S,"feFuncA",{type:"table",tableValues:"1 0"}),u(y,"feGaussianBlur",{in:"out",stdDeviation:String(o.blur*i/2),result:"blur"}),u(y,"feOffset",{in:"blur",dx:String(b*Math.cos(f)),dy:String(b*Math.sin(f)),result:"moved"}),u(y,"feFlood",{"flood-color":colorCss(o.color,r),"flood-opacity":String(1-o.transparency),result:"ink"}),u(y,"feComposite",{in:"ink",in2:"moved",operator:"in",result:"shadow"}),u(y,"feComposite",{in:"shadow",in2:"SourceAlpha",operator:"in",result:"inside"});const x=u(y,"feMerge",{});u(x,"feMergeNode",{in:"SourceGraphic"}),u(x,"feMergeNode",{in:"inside"})},(o.blur*2+o.distance)*i)}const p=t.shadow,m=t.glow&&t.glow.size>0?t.glow:void 0;if(p&&!m){const f=p.angle*Math.PI/180,b=p.distance*i;s.push(`drop-shadow(${String(b*Math.cos(f))}px ${String(b*Math.sin(f))}px ${String(p.blur*i)}px ${F(p.color,p.transparency,r)})`)}if(m){const f=m.size*i;g(b=>{u(b,"feMorphology",{in:"SourceAlpha",operator:"dilate",radius:String(f/2),result:"wide"}),u(b,"feGaussianBlur",{in:"wide",stdDeviation:String(f/4),result:"halo"}),u(b,"feFlood",{"flood-color":colorCss(m.color,r),"flood-opacity":String(1-m.transparency),result:"ink"}),u(b,"feComposite",{in:"ink",in2:"halo",operator:"in",result:"glow"});const y=u(b,"feMerge",{});if(p){const S=p.angle*Math.PI/180,x=p.distance*i;u(b,"feGaussianBlur",{in:"SourceAlpha",stdDeviation:String(p.blur*i/2),result:"cast"}),u(b,"feOffset",{in:"cast",dx:String(x*Math.cos(S)),dy:String(x*Math.sin(S)),result:"moved"}),u(b,"feFlood",{"flood-color":colorCss(p.color,r),"flood-opacity":String(1-p.transparency),result:"dark"}),u(b,"feComposite",{in:"dark",in2:"moved",operator:"in",result:"shadow"}),b.append(y),u(y,"feMergeNode",{in:"shadow"})}u(y,"feMergeNode",{in:"glow"}),u(y,"feMergeNode",{in:"SourceGraphic"})},Math.max(f*2,p?(p.blur*1.5+p.distance)*i:0))}if(a.length>0){const f=document.createElementNS(n,"svg");f.setAttribute("width","0"),f.setAttribute("height","0"),Object.assign(f.style,{position:"absolute"}),f.setAttribute("aria-hidden","true"),f.append(...a),e.append(f)}s.length>0&&(e.style.filter=s.join(" "));const h=t.reflection;h&&e.style.setProperty("-webkit-box-reflect",`below ${String(h.distance*i)}px linear-gradient(to bottom, transparent ${String((1-h.size)*100)}%, rgba(0, 0, 0, ${String(1-h.transparency)}))`)}function Pt(e,t,i){const r=t.geometry??"rect",s=t.frame.width*i,n=t.frame.height*i;r==="roundRect"?e.style.borderRadius=`${String(Math.min(s,n)*Math.min(.5,Math.max(0,t.adjustments?.[0]??rt("roundRect")[0]??0)))}px`:r==="ellipse"&&(e.style.borderRadius="50%")}const Wt={left:"borderLeft",right:"borderRight",top:"borderTop",bottom:"borderBottom"},X="http://www.w3.org/2000/svg";function Ut(e,t,i,r,s){const n=i.width/k,a=i.height/k,l=r*k,d=at(t,n,a),c=document.createElementNS(X,"svg");c.setAttribute("viewBox",`0 0 ${String(n)} ${String(a)}`),c.setAttribute("width","100%"),c.setAttribute("height","100%"),Object.assign(c.style,{position:"absolute",inset:"0px",overflow:"visible"});const g=(o,p)=>{const m=document.createElementNS(X,o);for(const[h,f]of Object.entries(p))m.setAttribute(h,String(f));c.append(m)},u=o=>{g("path",{d:o.d,fill:o.fill===void 0?"none":colorCss(o.fill,s),stroke:o.width>0?colorCss(o.color,s):"none","stroke-width":o.width,"stroke-linejoin":"round",...o.dash===void 0?{}:{"stroke-dasharray":o.dash}})};for(const o of[...d.grid,...d.shapes])u(o);for(const o of[...d.boxes,...d.keys]){if(o.line!==void 0||o.marker===!0){o.line&&g("path",{d:`M${String(o.x)} ${String(o.y+o.height/2)} H${String(o.x+o.width)}`,fill:"none",stroke:colorCss(o.color,s),"stroke-width":o.line.width,...o.line.dash===void 0?{}:{"stroke-dasharray":o.line.dash}}),o.marker===!0&&g("circle",{cx:o.x+o.width/2,cy:o.y+o.height/2,r:Math.min(o.height/2,3),fill:colorCss(o.color,s)});continue}g("rect",{x:o.x,y:o.y,width:o.width,height:o.height,...o.hollow===!0?{fill:"none",stroke:colorCss(o.color,s),"stroke-width":1.5}:{fill:colorCss(o.color,s)}})}for(const o of[...d.axes,...d.lines])u(o);for(const o of d.dots)o.d===void 0?g("circle",{cx:o.x,cy:o.y,r:o.r,fill:colorCss(o.color,s)}):g("path",{d:o.d,fill:colorCss(o.color,s)});e.append(c);for(const o of d.words){const p=document.createElement("div");p.textContent=o.text,Object.assign(p.style,{position:"absolute",left:`${String(o.x*l)}px`,top:`${String(o.y*l)}px`,transform:`translate(${{start:"0",middle:"-50%",end:"-100%"}[o.anchor]}, -50%)${o.rotate===void 0?"":` rotate(${String(o.rotate)}deg)`}`,transformOrigin:`${{start:"0%",middle:"50%",end:"100%"}[o.anchor]} 50%`,fontSize:`${String(o.size*l)}px`,lineHeight:"1",whiteSpace:"nowrap",color:colorCss(o.color,s),fontFamily:"var(--ak-theme-minor)",...o.bold?{fontWeight:"700"}:{}}),e.append(p)}}function Vt(e,t,i,r,s){const n=St(t.style),a=document.createElement("table");n?.background!==void 0&&(a.style.background=colorCss(n.background,s)),Object.assign(a.style,{borderCollapse:"collapse",tableLayout:"fixed",width:`${String(t.columns.reduce((d,c)=>d+c,0)*i)}px`});const l=document.createElement("colgroup");for(const d of t.columns){const c=document.createElement("col");c.style.width=`${String(d*i)}px`,l.append(c)}a.append(l);for(const[d,c]of t.rows.entries()){const g=document.createElement("tr");g.style.height=`${String(c.height*i)}px`;for(const[u,o]of c.cells.entries()){if(o.spanned)continue;const p=document.createElement("td");p.dataset.akCell=`${String(d)},${String(u)}`,o.span_width&&(p.colSpan=o.span_width),o.span_height&&(p.rowSpan=o.span_height),p.style.padding="0px",p.style.verticalAlign={t:"top",ctr:"middle",b:"bottom"}[o.text.style.vertical_anchor];const m=n?st(n,t,d,u,t.rows.length,t.columns.length,d+(o.span_height??1)-1,u+(o.span_width??1)-1):void 0,h=o.fill!==void 0?o.fill:m?.fill;h!==void 0&&(p.style.background=colorCss(h,s));for(const[b,y]of Object.entries(Wt)){const S=b,x=o.borders?.[S],$=x!==void 0?x:m?.borders[S];$?p.style[y]=`${String($.width*i)}px solid ${colorCss($.color,s)}`:x===null&&(p.style[y]="none")}const f=E(o.text,i,r,s);f.style.minHeight="0px",p.append(f),g.append(p)}a.append(g)}e.style.height="auto",e.append(a)}function Zt(e,t){return e.kind==="person"&&e.photo!==void 0?{...e,photo:t(e.photo)}:e.kind==="people"?{...e,items:e.items.map(i=>i.photo===void 0?i:{...i,photo:t(i.photo)})}:e}function qt(e,t,i,r,s){const n=i.frame.width/k,a=i.frame.height/k;e.innerHTML=it(Zt(r,s.url),{width:n,height:a},ot(s.colors),{...s.lang===void 0?{}:{lang:s.lang},...i.alt===void 0?{}:{label:i.alt},id:`${t}-${i.name}`.replace(/[^\w-]/gu,"_")});const l=e.firstElementChild;l instanceof SVGElement&&(l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.style.display="block",l.style.overflow="visible")}export function drawShape(e,t,i){const{k:r,colors:s}=i;if(t.kind==="placeholder"&&t.text?.empty===!0&&!i.editing)return;const n=document.createElement("div");n.setAttribute(SHAPE_ATTR,`${e}/${t.name}`);const{left:a,top:l,width:d,height:c}=t.frame;Object.assign(n.style,{position:"absolute",left:`${String(a*r)}px`,top:`${String(l*r)}px`,width:`${String(d*r)}px`,height:`${String(c*r)}px`}),t.rotation!==void 0&&(n.style.transform=`rotate(${String(t.rotation)}deg)`);const g=(t.line_width??LINE_WIDTH)*r;if(t.chart)Ut(n,t.chart,t.frame,r,s);else{if(t.block)return qt(n,e,t,t.block,i),n;if(t.table)return Vt(n,t.table,r,i.lang,s),n}Gt(n,t,r,s),t.alt!==void 0&&n.setAttribute("aria-label",t.alt);let u;if(t.kind==="autoshape"){if(!t.path&&gt(t.geometry))return Ot(n,t,r,g,s),n;const o=t.path?void 0:M(t.geometry??"rect",t.frame.width*r,t.frame.height*r,t.adjustments),p=t.line!==void 0&&t.line!==null&&(t.line_dash!==void 0&&t.line_dash!=="solid"||t.line_compound!==void 0&&t.line_compound!=="sng"||t.line_join!==void 0&&t.line_join!==A.join);if(J(t)){const h=t.path?q(t,r):o?.paths??[],f=h.filter(y=>y.fill!=="none").map(y=>y.d).join(" ");n.append(Y(t,r,s,i.url,f));const b={...t,fill:null};return delete b.gradient,L(n,b,h,r,g,s),t.text&&n.append(E(t.text,r,i.lang,s,o?.text)),n}const m=t.path?q(t,r):It.has(t.geometry??"rect")&&!p?void 0:o?.paths;if(m)return L(n,t,m,r,g,s),t.text&&n.append(E(t.text,r,i.lang,s,o?.text)),n;n.style.background=Q(t,s),Pt(n,t,r),u=o?.text}else J(t)?n.append(Y(t,r,s,i.url,void 0)):(t.fill!==void 0||t.gradient)&&(n.style.background=Q(t,s));if(t.line!==void 0&&t.line!==null&&(n.style.outline=`${String(g)}px ${t.line_dash===void 0||t.line_dash==="solid"?"solid":"dashed"} ${colorCss(t.line,s)}`,n.style.outlineOffset=`${String(-g/2)}px`),t.text?.style.auto_size==="shape"&&t.text.style.orientation==="horz"&&(n.style.height="auto",n.style.minHeight="0px"),t.kind==="picture"&&t.media){n.style.overflow="hidden";const o=document.createElement("img");o.alt=t.alt??"",o.src=i.url(t.media.path),z(o,t);const p=t.media.fit;if(p!==void 0)Object.assign(o.style,{position:"absolute",inset:"0px",width:"100%",height:"100%",maxWidth:"none",objectFit:p==="fill"?"cover":"contain"});else{const h=t.media.crop??{left:0,top:0,right:0,bottom:0},f=1-h.left-h.right,b=1-h.top-h.bottom;Object.assign(o.style,{position:"absolute",width:`${String(100/f)}%`,height:`${String(100/b)}%`,left:`${String(-h.left/f*100)}%`,top:`${String(-h.top/b*100)}%`,maxWidth:"none"}),t.flip&&(o.style.transformOrigin=`${String(50/f-h.left/f*100)}% ${String(50/b-h.top/b*100)}%`)}const m=t.geometry===void 0||t.geometry==="rect"?void 0:M(t.geometry,t.frame.width*r,t.frame.height*r,t.adjustments);if(m){const h=document.createElement("div");if(Object.assign(h.style,{position:"absolute",inset:"0px",overflow:"hidden",clipPath:`path(evenodd, "${m.paths.filter(f=>f.fill!=="none").map(f=>f.d).join(" ")}")`}),et(n,o,t.media.look,s),h.append(o),n.append(h),n.style.overflow="visible",t.line!==void 0&&t.line!==null){const f={...t,fill:null};L(n,f,m.paths,r,g,s)}return n}et(n,o,t.media.look,s),n.append(o)}else if(t.kind==="movie"&&t.media&&!i.playing&&i.poster!==!0)n.dataset.akFilm="";else if(t.kind==="movie"&&t.media){const o=document.createElement("video");o.src=i.url(t.media.path),o.muted=!0,o.playsInline=!0,o.preload="auto",t.media.poster!==void 0&&(o.currentTime=t.media.poster),Object.assign(o.style,{width:"100%",height:"100%",objectFit:"fill",...i.playing?{}:{pointerEvents:"none"}}),n.append(o)}if(t.kind==="item"&&t.item&&(n.dataset.akItem=t.item.path,i.editing)){const o=document.createElement("div");o.textContent=t.item.path,Object.assign(o.style,{position:"absolute",inset:"0px",display:"grid",placeItems:"center",padding:`${String(8*r)}px`,font:`${String(Math.max(10,14*r))}px/1.3 system-ui, sans-serif`,color:"#595959",background:"rgba(127, 127, 127, 0.12)",overflowWrap:"anywhere",textAlign:"center"}),n.append(o)}if(t.kind==="audio"&&t.media&&(!i.editing&&t.media.playback?.hide===!0&&(n.style.visibility="hidden"),n.append(Kt()),i.playing)){const o=document.createElement("audio");o.src=i.url(t.media.path),o.preload="auto",n.append(o)}return t.text&&n.append(E(t.text,r,i.lang,s,u)),n}const H="http://www.w3.org/2000/svg";function Kt(){const e=document.createElementNS(H,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","#595959"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linejoin","round"),Object.assign(e.style,{width:"100%",height:"100%",display:"block"});const t=document.createElementNS(H,"polygon");t.setAttribute("points","11 5 6 9 2 9 2 15 6 15 11 19 11 5"),t.setAttribute("fill","#595959"),e.append(t);for(const i of["M15.54 8.46a5 5 0 0 1 0 7.07","M19.07 4.93a10 10 0 0 1 0 14.14"]){const r=document.createElementNS(H,"path");r.setAttribute("d",i),e.append(r)}return e}let tt=0;function et(e,t,i,r){if(!i)return;i.transparency!==void 0&&(t.style.opacity=String(1-i.transparency));const s=[],n=i.brightness??0,a=i.contrast??0;if(n!==0||a!==0){const g=a>=0?1/Math.max(.001,1-a):1+a,u=1-Math.abs(n),o=g*u,p=(.5-.5*g)*u+Math.max(n,0),m=h=>`<feFunc${h} type="linear" slope="${String(o)}" intercept="${String(p)}"/>`;s.push(`<feComponentTransfer>${m("R")}${m("G")}${m("B")}</feComponentTransfer>`)}const l='<feColorMatrix type="saturate" values="0"/>';if(i.grayscale===!0&&s.push(l),i.duotone){const[g,u]=i.duotone.map(p=>dt(p,r).rgb),o=(p,m)=>`<feFunc${p} type="table" tableValues="${String(g?.[m]??0)} ${String(u?.[m]??1)}"/>`;s.push(l,`<feComponentTransfer>${o("R",0)}${o("G",1)}${o("B",2)}</feComponentTransfer>`)}if(i.black_white!==void 0){const g=Math.round(i.black_white*100),u=Array.from({length:100},(p,m)=>m<g?0:1).join(" "),o=p=>`<feFunc${p} type="discrete" tableValues="${u}"/>`;s.push(l,`<feComponentTransfer>${o("R")}${o("G")}${o("B")}</feComponentTransfer>`)}if(s.length===0)return;tt+=1;const d=`ak-look-${String(tt)}`,c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("width","0"),c.setAttribute("height","0"),c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.innerHTML=`<filter id="${d}" color-interpolation-filters="sRGB">${s.join("")}</filter>`,e.append(c),t.style.filter=`url(#${d})`}export function slideBackgroundCss(e,t,i){return nt(e)?colorCss(e.background,t):e.background_picture!==void 0?`${colorCss(e.background,t)} url(${JSON.stringify(i(e.background_picture))}) center / 100% 100% no-repeat`:e.background_gradient?I(e.background_gradient,t):colorCss(e.background,t)}const nt=e=>e.background_pattern!==void 0||e.background_picture!==void 0&&(e.background_tile!==void 0||e.background_transparency!==void 0);export function slideBackgroundLayer(e,t,i,r){if(!nt(e))return;const s=document.createElement("div");s.dataset.akGround="",Object.assign(s.style,{position:"absolute",inset:"0px",overflow:"hidden",pointerEvents:"none"});const n=e.background_picture;if(n!==void 0){e.background_transparency!==void 0&&(s.style.opacity=String(1-e.background_transparency));const l=JSON.stringify(i(n)),d=e.background_tile;if(!d)return s.style.background=`url(${l}) center / 100% 100% no-repeat`,s;const c=v*r*d.scale_x,g=v*r*d.scale_y,[u,o]=K[d.align],p=document.createElement("div");return Object.assign(p.style,{position:"absolute",left:"0px",top:"0px",width:`${String(100/c)}%`,height:`${String(100/g)}%`,transform:`scale(${String(c)}, ${String(g)})`,transformOrigin:"0 0",background:`url(${l}) calc(${String(u)}% + ${String(d.offset_x*r/c)}px) calc(${String(o)}% + ${String(d.offset_y*r/g)}px) / auto repeat`}),s.append(p),s}const a=e.background_pattern;if(a){const l=`<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" shape-rendering="crispEdges"><rect width="8" height="8" fill="${colorCss(a.bg,t)}"/><path d="${B(a.preset)}" fill="${colorCss(a.fg,t)}"/></svg>`,d=8*v*r;s.style.background=`url("data:image/svg+xml,${encodeURIComponent(l)}") 0 0 / ${String(d)}px ${String(d)}px repeat`,s.style.imageRendering="pixelated"}return s}export function drawSlide(e,t){const i=document.createElement("div");i.dataset.akSlide=e.id;const r={...t,colors:pt(t.colors,e.color_map)};Object.assign(i.style,{position:"absolute",inset:"0px",background:slideBackgroundCss(e,r.colors,t.url),overflow:"hidden"});const s=slideBackgroundLayer(e,r.colors,t.url,t.k);s&&i.append(s);for(const n of e.shapes){const a=drawShape(e.id,n,r);a&&i.append(a)}return i}
@@ -1,6 +1,6 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
2
  import{consoleAt as Q,consoleAtAsync as wt}from"@allyhub/piece/page";import{inkOfBlock as bt}from"@allyhub/image-draw/contrast";import{createEnv as Ge}from"@allyhub/image-draw/env";import{LoadFailure as pe}from"@allyhub/image-draw/errors";import{families as kt,loadTextFonts as St,localFamily as xt,pageFaces as vt}from"@allyhub/image-draw/fonts";import{realTimers as Mt}from"@allyhub/image-draw/guards";import{domHash as Ue}from"@allyhub/image-draw/hash";import{textBlocks as Je}from"@allyhub/image-draw/inspect";import{pictureWaiter as $t}from"@allyhub/image-draw/pictures";import{answerFilm as Ot,playFilm as At}from"@allyhub/runtime/stage";import{joinPath as Et,animationTargets as Ct,clockOf as Dt,DECK_FPS as z,deckCode as Ye,drawnAt as Ve,morphFrame as Pt,inTransition as Xe,transitionAt as Tt,unitsAcross as jt,isEntrance as _t,EMU_PER_INCH as Qe,EMU_PER_PT as Ze,evaluateDeck as Ft,fontFace as be,connectorEnds as Lt,isConnectorGeometry as Pe,isDeck as qt,isDeckCode as Nt,resolveDeck as Rt,slideSign as It,themeOfLook as Ht}from"@allyhub/slides-core";import{problem as et}from"@allyhub/diagnostics";import{CLEAN_LOOK as tt,LAYER_BRAND as Bt,SEEK_LIMIT as Te,countWords as Wt,framedComponent as zt,lookCss as Kt,measureMoment as Gt,messagePrefix as Ut}from"@allyhub/piece";import{shownOf as Jt}from"@allyhub/formats";import{filmSummary as Yt}from"@allyhub/video-core";import{drawSlide as Vt,fitText as Xt,hangLabels as Qt,SHAPE_ATTR as G,themeCss as Zt}from"./draw.js";import{inkLines as nt,union as je}from"./ink.js";import{itemLayer as en,itemSounds as tn,itemsRead as ot}from"./item.js";export const SLIDE_LAYER="slide",SLIDES_KEPT=5;const nn=.5,on=.3,at={top:0,bottom:0,left:0,right:0};async function an(i,y=!0){i.muted=!y,await i.play().catch(async()=>{i.muted=!0,await i.play().catch(()=>{})})}function sn(i){const y=d=>{if(i.peek(d)!==void 0)return i.s(d);const u=[...new Set(i.keysUnder(d).map(m=>m.slice(d.length+1).split(".")[0]).filter(m=>m!==void 0&&/^\d+$/u.test(m)))].sort((m,C)=>Number(m)-Number(C));if(u.length!==0)return u.map(m=>y(`${d}.${m}`)).filter(m=>m!==void 0)};return y}function rn(i,y){for(let d=i;d;d=d.parentElement){const u=getComputedStyle(d);if(u.textDecorationLine!=="none"&&u.textDecorationLine!=="")return{textDecorationLine:u.textDecorationLine,textDecorationStyle:u.textDecorationStyle,textDecorationThickness:u.textDecorationThickness,textDecorationColor:u.textDecorationColor};if(d===y)break}}const st=i=>!(i.kind==="placeholder"&&i.text?.empty===!0),cn=i=>typeof i=="object"&&i!==null&&i[Bt]==="graphic";export async function loadStyles(i){const y=new Set([...document.querySelectorAll("link[rel=stylesheet]")].map(d=>d.href));for(const d of i.styles??[]){if(y.has(new URL(d,document.baseURI).href))continue;const u=document.createElement("link");u.rel="stylesheet",u.href=d;const m=new Promise(C=>{u.onload=C,u.onerror=C});document.head.append(u),await m}}export async function importDeck(i){await loadStyles(i);let y;try{y=await wt({phase:"module"},()=>import(i.module))}catch(m){const C=m instanceof Error?m:new Error(String(m));throw new pe("load_failed",`Failed to load the deck's module: ${C.message}
3
- ${C.stack??""}`)}const d=y.default;if(!qt(d))throw new pe("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);let u;try{u=Q({phase:"build"},()=>Ft(d))}catch(m){throw new pe("load_failed",`The deck's code failed: ${m instanceof Error?m.message:String(m)}`)}for(const[m,C]of Object.entries(moduleComponents(y)))Object.hasOwn(u.components,m)||(u.components[m]=C);return u}export function moduleComponents(i){const y=i.components,d={};if(typeof y!="object"||y===null)return d;for(const[u,m]of Object.entries(y)){const C=zt(u,m);C&&(d[u]=C)}return d}export async function deckCodeOf(i,y){const{log:d}=Ge(i,y,void 0,"slides"),u=await importDeck(i);return{code:Q({phase:"build"},()=>Ye(u,C=>d.readData(C))),theme:lookTheme(i)}}export const lookTheme=i=>Ht(i.looks?.clean??tt);export async function loadDeck(i,y,d){const u=Ge(i,y,void 0,"slides"),{log:m,ledger:C,guards:W}=u,[D,I]=i.format.split("x").map(Number);if(!(D>0&&I>0))throw new pe("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);const oe=await importDeck(i),U=i.kindData,J=Nt(U?.code)?U.code:Q({phase:"build"},()=>Ye(oe,e=>m.readData(e))),Y=Ut(i.piece),ae=i.looks?.clean??tt,Z=i.file.split("/").slice(0,-1).join("/"),fe={file:U?.slidesFile??i.file},{deck:se}=Rt({code:J,file:U?.slides??{slides:[]},words:sn(m),prefix:Y,base:Z,theme:lookTheme(i),data:e=>{const t=Jt(e);return t===void 0?m.readData(e):i.data?.[Et(Z,t)]?.shown}});let v=se;if(v.slides.length===0)throw new pe("no_parts","The deck has no slides to draw (AK-K003).");const x=D/v.width;Object.assign(d.style,{position:"relative",width:`${String(D)}px`,height:`${String(I)}px`,overflow:"hidden"});const ie=()=>{for(const[e,t]of Object.entries({...Kt(ae),...Zt(v.theme)}))d.style.setProperty(e,t)};ie(),d.replaceChildren();const he=y.purpose==="play";y.purpose==="render"&&y.inside===void 0&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const _e=new Map,me=e=>_e.get(e)??m.mediaAt(e),it=e=>me(e)?.url??"",V=e=>Math.round(e*z)/z,ue=u.combo.lang,ke=new Map,Se=new Map,xe=new Map;let ve;const rt=(e,t,n)=>{const o=Dt(e,t===0),{rests:a,comesOn:s,goesOff:f,playsAt:h}=o,b=n+(a.at(-1)??0),l=e.shapes.flatMap(c=>{if(c.kind!=="movie"&&c.kind!=="audio"||!c.media)return[];const O=c.media.playback,A=me(c.media.path)?.duration??0,q=Math.min(A,O?.trim?.end??A);return[{shape:c.name,from:h(c.name),poster:c.media.poster??0,length:q,rest:a.at(-1)??0,begin:O?.trim?.start??c.media.poster??0,loop:O?.loop===!0,volume:O?.volume??1,hide:O?.hide===!0,fullscreen:O?.fullscreen===!0}]}),p=Math.max(b+1/z,...l.map(c=>n+c.from+c.length-c.begin)),r=[],P=[],w=l.flatMap(c=>{const O=e.shapes.find(F=>F.name===c.shape);if(O?.kind!=="audio"||!O.media||c.volume===0||he)return[];const A=O.media,q=f(O.name),S=q===void 0?p:n+V(q),g=n+V(c.from),_=(F,T)=>({t:F,sound:A.path,part:e.id,file:A.path,...c.volume===1?{}:{gainDb:20*Math.log10(c.volume)},...c.begin>0?{from:c.begin}:{},...T===void 0?{}:{length:T}}),E=c.length-c.begin;if(E<=0)return[_(g)];const R=[];for(let F=g;F<S&&(R.length===0||c.loop)&&R.length<1e3;F+=E){const T=Math.min(E,S-F);R.push(_(F,A.playback?.trim?.end!==void 0||T<E?T:void 0))}return R}),k=new Map,$=[!1];for(const c of e.shapes){st(c)&&(k.set(c.name,$.length-1),$[$.length-1]=!0);const O=c.component&&st(c)?oe.components[c.component.name]:void 0;if(O){const A=Q({phase:"build",part:e.id},()=>O.layers(c.component?.props??{},{width:c.frame.width*x,height:c.frame.height*x,slide:e.id}));for(const q of A)cn(q)?r.push({shape:c.name,layer:q}):C.problems.push(et("AK-M011",`Component ${O.name} on slide ${e.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:e.id,where:fe}))}if(c.kind==="item"&&c.item&&r.push({shape:c.name,layer:en({source:i,options:y,shape:{path:c.item.path,playback:c.item.playback,delay:Math.max(0,h(c.name)-s(c.name))},lengths:ke,drawn:Se,kept:xe})}),c.kind==="movie"&&c.media&&!he&&me(c.media.path)){const A=[c.frame.left*x,c.frame.top*x,c.frame.width*x,c.frame.height*x],q=c.media.playback,S=me(c.media.path),g=l.find(T=>T.shape===c.name),_=f(c.name),E=_===void 0?p:n+V(_),R=g!==void 0&&g.volume>0&&S?.audio===!0,F={gainDb:R?20*Math.log10(g.volume):0,audio:R};if(!q||!g){const T=V(s(c.name));P.push({part:e.id,file:c.media.path,start:n+T,end:E,from:(c.media.poster??0)-((a.at(-1)??0)-T),speed:1,...F,fit:"cover",box:A,picture:A,over:$.length})}else{const T=V(g.hide||g.loop?g.from:s(c.name)),K=V(g.from),ne=Math.max(1/z,g.length-g.begin),Ke=g.loop?E:Math.min(E,n+K+ne),we=[];for(let De=n+K+ne;g.loop&&De<Ke&&we.length<1e3;De+=ne)we.push({at:De,from:g.begin});P.push({part:e.id,file:c.media.path,start:n+T,end:Ke,from:g.begin-(K-T),speed:1,...F,...we.length>0?{cuts:[{at:n+T,from:g.begin},...we]}:{},fit:"cover",box:A,picture:A,over:$.length})}$.push(!1)}}for(;$.length>1&&$.at(-1)===!1;)$.pop();const L=$.length,j=V(b),N=c=>r.filter(O=>O.shape===c).map(O=>O.layer.component);return{slide:e,sign:It(v,e),clock:o,movies:l,footage:P,cues:w,planeOf:k,planes:L,made:r,part:{key:e.id,layers:[...new Set(r.map(c=>c.layer.component))],start:n,end:p,planes:Array.from({length:L},(c,O)=>({layers:[{component:SLIDE_LAYER,start:n,end:p},...e.shapes.filter(A=>k.get(A.name)===O).flatMap(A=>N(A.name)).map(A=>({component:A,start:n,end:p}))]})),still:j,...a.length>1?{steps:a.map(c=>Math.round((n+c)*z)/z)}:{},...ln(e),...e.hidden?{hidden:!0}:{}}}},Fe=e=>{let t=0;return e.slides.map((n,o)=>{const a=rt(n,o,t);return t=a.part.end,a})};let M=Fe(v);const Me=M.at(-1)?.part.end??0,Le={fps:z,width:D,height:I,paper:`${String(v.width/Qe)}in ${String(v.height/Qe)}in`,duration:Me,background:v.theme.colors.lt1,parts:M.map(e=>e.part),cues:M.flatMap(e=>e.cues),...M.some(e=>e.footage.length>0)?{footage:M.flatMap(e=>e.footage)}:{},audio:{}},H=new Map,$e=new Map;let ee,re;const ct=async e=>{const{slide:t,part:n}=e,o=Vt(t,{k:x,url:it,editing:!1,playing:he,...ue===void 0?{}:{lang:ue},colors:v.theme.colors});o.style.visibility="hidden",d.append(o);const a=Array.from({length:e.planes},()=>[]),s=[],f=[];for(const h of t.shapes){const b=o.querySelector(`[${G}="${CSS.escape(`${t.id}/${h.name}`)}"]`);if(b){a[e.planeOf.get(h.name)??0]?.push(b);for(const[l,{layer:p}]of e.made.filter(r=>r.shape===h.name).entries()){const r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0px"}),b.append(r);const P=stageContext({look:ae,width:h.frame.width*x,height:h.frame.height*x,start:n.start,end:n.end,combo:u.combo,format:i.format,asset:w=>m.asset(w),wait:w=>(ve??f).push(w),report:w=>C.problems.push(et(w.code,w.message,{part:t.id,where:fe}))});s.push({layer:p,el:r,ctx:P,props:p.props,from:e.clock.comesOn(h.name)}),Q({phase:"mount",part:t.id,layer:p.component,index:l},()=>{p.mount(r,p.props,P)})}}}await St(o),o.style.visibility="visible",Qt(o);for(const h of o.querySelectorAll("[data-ak-autofit='text']"))Xt(h);return o.style.visibility="hidden",await Promise.all(f),{slide:t,slot:e,el:o,part:n,layers:s,targets:Ct(e.clock.timed),lead:e.clock.lead,movies:e.movies,planes:a,pictures:$t(o)}},ge=e=>{H.delete(e.slide.id);for(const[t,n]of e.layers.entries())Q({phase:"mount",part:e.slide.id,layer:n.layer.component,index:t},()=>{n.layer.unmount?.(n.el,n.props,n.ctx)});e.el.remove(),ee===e&&(ee=void 0),re===e&&(re=void 0)},ce=async e=>{const t=e.slide.id,n=H.get(t);if(n?.slot===e)return H.delete(t),H.set(t,n),n;n&&ge(n);let o=$e.get(t);o||(o=ct(e).finally(()=>$e.delete(t)),$e.set(t,o));const a=await o,s=Ae(t);return s&&s!==e?(a.el.remove(),ce(s)):(H.set(t,a),a)},Oe=()=>{for(const e of[...H.values()]){if(H.size<=SLIDES_KEPT)return;e!==ee&&e!==re&&ge(e)}},Ae=e=>M.find(t=>t.slide.id===e),lt=e=>{let t=0,n=M.length-1;for(;t<n;){const o=t+n>>1,a=M[o];a&&e<a.part.end-1e-6?n=o:t=o+1}return M[t]},dt=e=>M.slice(0,M.indexOf(e)).reverse().find(t=>!t.slide.hidden),qe=new WeakMap,le=[],B=(e,t)=>{const n={...t};for(const o of Object.keys(t))n[o]=e.style[o];le.push(()=>{Object.assign(e.style,n)}),Object.assign(e.style,t)},ye=(e,t)=>e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${t}`)}"]`);let Ne;const Re=(e,t)=>ye(e,t)?.querySelector("video, audio")??void 0,Ee=new Set,pt=(e,t)=>{const n=Ne;if(n&&n.m!==e){for(const a of n.m.movies)Re(n.m,a.shape)?.pause();Ee.clear()}const o=n?.m===e&&t>n.t&&t-n.t<nn;Ne={m:e,t};for(const a of e.movies){const s=Re(e,a.shape);if(!s)continue;s.volume=a.volume;const f=a.length-a.begin;let h=a.begin+Math.max(0,t-a.from);a.loop&&f>0&&h>=a.length&&(h=a.begin+(h-a.begin)%f);const b=o&&t>=a.from&&h<a.length;a.hide&&(s.style.visibility=b?"":"hidden");const l=a.fullscreen?ye(e,a.shape):null;if(l){const r=l.dataset.akFull;b&&r===void 0?(l.dataset.akFull=l.style.cssText,Object.assign(l.style,{left:"0px",top:"0px",width:"100%",height:"100%",transform:"none",zIndex:"1000"})):!b&&r!==void 0&&(l.style.cssText=r,delete l.dataset.akFull)}if(b){Math.abs(s.currentTime-h)>on&&(s.currentTime=h),s.paused&&(a.volume===0&&(s.muted=!0),an(s,a.volume>0));continue}s.pause(),o&&h>=a.length&&Ee.add(a.shape);const p=Ee.has(a.shape)?a.length:Math.max(a.begin===a.poster?0:a.begin,a.poster-(a.rest-t));Math.abs(s.currentTime-p)>1/z&&(s.currentTime=p)}},ft=(e,t)=>{const n=e.slide.transition;if(!n||!Xe(t,e.lead))return;const o=re;if(!o)return;Ie(o,o.part.still-o.part.start),o.el.style.visibility="visible";const a=Math.min(1,t/e.lead);if(n.type!=="morph"){const l=Tt(n,a),p=r=>{const P=r.x!==0||r.y!==0?`translate(${String(r.x*100)}%, ${String(r.y*100)}%)`:"",w=[r.scale===1?"":`scale(${String(r.scale)})`,r.rotate===0?"":`rotate(${String(r.rotate)}deg)`],k=r.clip;return{opacity:String(r.opacity),transform:[P,...w].filter($=>$!=="").join(" "),clipPath:r.polygon?`polygon(${r.polygon.map(([$,L])=>`${String($*100)}% ${String(L*100)}%`).join(", ")})`:k?`inset(${String(k.top*100)}% ${String(k.right*100)}% ${String(k.bottom*100)}% ${String(k.left*100)}%)`:""}};B(e.el,{...p(l.incoming),zIndex:l.outgoingOver?"0":"1"}),B(o.el,{...p(l.outgoing),zIndex:l.outgoingOver?"1":"0"}),l.black&&B(d,{background:"#000"});return}const s=new Map(o.slide.shapes.map(l=>[l.name,l]));B(e.el,{background:`color-mix(in srgb, ${getComputedStyle(e.el).backgroundColor} ${String(a*100)}%, transparent)`});const f=(l,p,r)=>{B(l,{left:`${String(r.left*x)}px`,top:`${String(r.top*x)}px`,width:`${String(r.width*x)}px`,height:`${String(r.height*x)}px`});const P=p.width>0?r.width/p.width:1,w=p.height>0?r.height/p.height:1;for(const k of l.querySelectorAll(":scope > svg:not([viewBox])"))B(k,{transformOrigin:"0 0",transform:`scale(${String(P)}, ${String(w)})`})},h=l=>JSON.stringify({...l,frame:void 0,sources:void 0}),b=new Map;for(const l of e.slide.shapes){const p=ye(e,l.name);if(!p)continue;const r=s.get(l.name);if(!r){B(p,{opacity:String(a)});continue}const P=Pt(r.frame,l.frame,a),w=h(r)===h(l);b.set(l.name,{frame:P,same:w}),f(p,l.frame,P),w||B(p,{opacity:String(a)})}for(const l of o.slide.shapes){const p=ye(o,l.name);if(!p)continue;const r=b.get(l.name);r?r.same?B(p,{visibility:"hidden"}):(f(p,l.frame,r.frame),B(p,{opacity:String(1-a)})):B(p,{opacity:String(1-a)})}},Ie=(e,t)=>{for(const n of e.targets){const o=e.slide.shapes.find(k=>k.name===n.shape),a=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${n.shape}`)}"]`);if(!o||!a)continue;const s=n.paragraph===void 0?a:a.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!s)continue;const f=qe.get(s)??{transform:s.style.transform,clipPath:s.style.clipPath};qe.set(s,f);const h={width:v.width,height:v.height},b=n.animations.filter(k=>k.iterate),l=n.animations.filter(k=>!k.iterate),p=Ve(l,t,o.frame,h),[r]=n.animations,P=r?.iterate!==void 0&&_t(r.effect)&&t<r.from-1e-6;He(s,P?{...p,hidden:!0}:p,f);const w=b[0]?.iterate?.by;if(w!==void 0)for(const[k,$]of ht(s,w).entries()){const L=Ve(b,t,o.frame,h,k);for(const j of $)He(j,L,{transform:"",clipPath:""})}}},He=(e,t,n)=>{e.style.visibility=t.hidden?"hidden":"",e.style.opacity=t.opacity===1?"":String(t.opacity);const o=t.x!==0||t.y!==0?`translate(${String(t.x*x)}px, ${String(t.y*x)}px)`:"",a=t.scale*t.sx,s=t.scale*t.sy,f=a===1&&s===1?"":a===s?`scale(${String(a)})`:`scale(${String(a)}, ${String(s)})`,h=t.rotate===0?"":`rotate(${String(t.rotate)}deg)`;e.style.transform=[o,f,h,n.transform].filter(b=>b!=="").join(" "),e.style.clipPath=t.polygon?`polygon(${t.polygon.map(([b,l])=>`${String(b*100)}% ${String(l*100)}%`).join(", ")})`:t.clip?`inset(${String(t.clip.top*100)}% ${String(t.clip.right*100)}% ${String(t.clip.bottom*100)}% ${String(t.clip.left*100)}%)`:n.clipPath},Be=new WeakMap,ht=(e,t)=>{const n=Be.get(e);if(n)return n.of;const o=[],a=e.matches("[data-ak-paragraph]")?[e]:[...e.querySelectorAll("[data-ak-paragraph]")];for(const s of a){const f=document.createTreeWalker(s,NodeFilter.SHOW_TEXT),h=[];for(;f.nextNode();)h.push(f.currentNode);const b=jt(h.map(p=>p.data),t),l=o.length;o.push(...b.map(()=>[])),h.forEach((p,r)=>{const P=b.flatMap((j,N)=>j.filter(c=>c.piece===r).map(c=>({...c,unit:N})));if(P.length===0)return;const w=rn(p.parentElement,s),k=document.createDocumentFragment();let $=0,L;for(const j of P){j.start>$&&(k.append(p.data.slice($,j.start)),L=void 0);const N=document.createElement("span");N.dataset.akUnit="",N.style.display="inline-block",w&&Object.assign(N.style,w),N.textContent=p.data.slice(j.start,j.end),o[l+j.unit]?.push(N),t==="letter"?(L||(L=document.createElement("span"),L.style.whiteSpace="nowrap",k.append(L)),L.append(N)):k.append(N),$=j.end}$<p.data.length&&k.append(p.data.slice($)),p.replaceWith(k)})}return Be.set(e,{by:t,of:o}),o},mt=(e,t)=>{if(t>0){const n=e.el.style.background;e.el.style.background="none",le.push(()=>{e.el.style.background=n})}for(const[n,o]of e.planes.entries())for(const a of n===t?[]:o){const s=a.style.visibility;a.style.visibility="hidden",le.push(()=>{a.style.visibility=s})}};let de;const X=async(e,t)=>{de={t:e,plane:t};const n=Math.min(Math.max(0,e),Me-1/z),o=lt(n);if(!o)return;const a=n-o.part.start,s=await ce(o),f=o.slide.transition&&Xe(a,o.clock.lead)?dt(o):void 0,h=f?await ce(f):void 0;if(de.t!==e)return;for(const l of H.values())l.el.style.visibility=l===s?"visible":"hidden";for(ee=s,re=h,W.setMoment(n,`${u.seedBase}:${s.slide.id}`);le.length>0;)le.pop()?.();Ie(s,a),ft(s,a),pt(s,a);const b=[];ve=b;try{for(const[l,p]of s.layers.entries())Q({phase:"render",part:s.slide.id,layer:p.layer.component,index:l,t:a},()=>{p.layer.render(p.el,Math.max(0,a-p.from),p.props,p.ctx)})}finally{ve=void 0}if(t!==void 0&&mt(s,t),await Promise.all([...b,s.pictures(Te*1e3),...h?[h.pictures(Te*1e3)]:[]]),Oe(),he){const l=M[M.indexOf(o)+1];l&&!H.has(l.slide.id)&&ce(l).then(Oe,()=>{})}},Ce=()=>ee,We=async e=>{await X(e);const t=Ce(),n=d.getBoundingClientRect(),o=n.width>0?D/n.width:1;return{m:t,blocks:t?Je(t.el,d,D):[],scale:o}},ut=()=>{const e=new Map,t=new Map,n=(f,h)=>{e.has(be(f))||e.set(be(f),h),t.set(be(f),(t.get(be(f))??new Set).add(f))},o=v.theme.fonts;for(const f of[o.major,o.minor,o.major_east_asian,o.minor_east_asian])n(f,"theme");for(const f of v.slides)for(const h of f.shapes){const b=[...h.text?.style.levels.map(l=>l.font.name)??[],...h.text?.paragraphs.flatMap(l=>[l.font?.name,...l.runs.map(p=>p.font?.name)])??[]];for(const l of b)l!==void 0&&!l.startsWith("+")&&n(l,"text")}const a=new Set(vt().map(f=>f.family)),s=f=>{const h=kt(f)[0]??f;return a.has(h)||xt(h)};return[...e].map(([f,h])=>({name:f,where:h,drawn:[...t.get(f)??[]].some(s)}))},gt=e=>{const t=e.text?.paragraphs[0],n=t?.alignment??e.text?.style.levels[t?.level??0]?.alignment;return n===void 0?{}:{align:n}},yt=(e,t)=>{const n=d.getBoundingClientRect(),o=n.width>0?D/n.width:1,a=[],s=[],f=[],h=[],b=[],l=[],p=x*Ze;return e.slide.shapes.forEach((r,P)=>{const w=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${r.name}`)}"]`);if(!w)return;const k=w.getBoundingClientRect(),$=[Math.round((k.left-n.left)*o),Math.round((k.top-n.top)*o),Math.round(k.width*o),Math.round(k.height*o)],L=getComputedStyle(w).visibility==="hidden",j=Je(w,d,D).filter(S=>S.ink!==null&&S.runs.some(g=>getComputedStyle(g.el).visibility!=="hidden")),N=j.map(S=>nt([...new Set(S.runs.map(g=>g.el))],d,D));j.forEach((S,g)=>{const _=N[g]??[],E=je(_);E&&(a.push({layer:r.name,z:"front",text:S.text,box:E,...S.opacity<1?{opacity:S.opacity}:{}}),s.push(P),f.push(S.containers),h.push(E),b.push(_))});const c={name:r.name,kind:Pe(r.geometry)?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*x),Math.round(r.frame.top*x),Math.round(r.frame.width*x),Math.round(r.frame.height*x)],box:$,...L?{hidden:L}:{},opaque:r.kind==="picture"||r.kind==="movie"||!Pe(r.geometry)&&r.fill!==void 0&&r.fill!==null},O=pn(r,x);if(O&&(c.ends=O),r.chart){const S=r.chart.series.flatMap(g=>g.values.filter(_=>_!==null));c.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...S.length>0?{low:Math.min(...S),high:Math.max(...S)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const S=[...w.querySelectorAll("tr")];c.rows=r.table.rows.map((g,_)=>({set:Math.round(g.height*x),drawn:Math.round((S[_]?.getBoundingClientRect().height??0)*o)}))}const A=N.flat();if(A.length>0){const S=new Map;for(const E of j)for(const R of E.runs){const F=getComputedStyle(R.el),T=Math.round(parseFloat(F.fontSize)/p*10)/10,K=parseInt(F.fontWeight,10)||400,ne=`${String(T)}/${String(K)}`;S.has(ne)||S.set(ne,{size:T,weight:K,...E.xHeight===void 0?{}:{xHeight:Math.round(E.xHeight/p*10)/10}})}const g=j.map(E=>E.text).join(`
3
+ ${C.stack??""}`)}const d=y.default;if(!qt(d))throw new pe("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);let u;try{u=Q({phase:"build"},()=>Ft(d))}catch(m){throw new pe("load_failed",`The deck's code failed: ${m instanceof Error?m.message:String(m)}`)}for(const[m,C]of Object.entries(moduleComponents(y)))Object.hasOwn(u.components,m)||(u.components[m]=C);return u}export function moduleComponents(i){const y=i.components,d={};if(typeof y!="object"||y===null)return d;for(const[u,m]of Object.entries(y)){const C=zt(u,m);C&&(d[u]=C)}return d}export async function deckCodeOf(i,y){const{log:d}=Ge(i,y,void 0,"slides"),u=await importDeck(i);return{code:Q({phase:"build"},()=>Ye(u,C=>d.readData(C))),theme:lookTheme(i)}}export const lookTheme=i=>Ht(i.looks?.clean??tt,i.theme);export async function loadDeck(i,y,d){const u=Ge(i,y,void 0,"slides"),{log:m,ledger:C,guards:W}=u,[D,I]=i.format.split("x").map(Number);if(!(D>0&&I>0))throw new pe("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);const oe=await importDeck(i),U=i.kindData,J=Nt(U?.code)?U.code:Q({phase:"build"},()=>Ye(oe,e=>m.readData(e))),Y=Ut(i.piece),ae=i.looks?.clean??tt,Z=i.file.split("/").slice(0,-1).join("/"),fe={file:U?.slidesFile??i.file},{deck:se}=Rt({code:J,file:U?.slides??{slides:[]},words:sn(m),prefix:Y,base:Z,theme:lookTheme(i),data:e=>{const t=Jt(e);return t===void 0?m.readData(e):i.data?.[Et(Z,t)]?.shown}});let v=se;if(v.slides.length===0)throw new pe("no_parts","The deck has no slides to draw (AK-K003).");const x=D/v.width;Object.assign(d.style,{position:"relative",width:`${String(D)}px`,height:`${String(I)}px`,overflow:"hidden"});const ie=()=>{for(const[e,t]of Object.entries({...Kt(ae),...Zt(v.theme)}))d.style.setProperty(e,t)};ie(),d.replaceChildren();const he=y.purpose==="play";y.purpose==="render"&&y.inside===void 0&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const _e=new Map,me=e=>_e.get(e)??m.mediaAt(e),it=e=>me(e)?.url??"",V=e=>Math.round(e*z)/z,ue=u.combo.lang,ke=new Map,Se=new Map,xe=new Map;let ve;const rt=(e,t,n)=>{const o=Dt(e,t===0),{rests:a,comesOn:s,goesOff:f,playsAt:h}=o,b=n+(a.at(-1)??0),l=e.shapes.flatMap(c=>{if(c.kind!=="movie"&&c.kind!=="audio"||!c.media)return[];const O=c.media.playback,A=me(c.media.path)?.duration??0,q=Math.min(A,O?.trim?.end??A);return[{shape:c.name,from:h(c.name),poster:c.media.poster??0,length:q,rest:a.at(-1)??0,begin:O?.trim?.start??c.media.poster??0,loop:O?.loop===!0,volume:O?.volume??1,hide:O?.hide===!0,fullscreen:O?.fullscreen===!0}]}),p=Math.max(b+1/z,...l.map(c=>n+c.from+c.length-c.begin)),r=[],P=[],w=l.flatMap(c=>{const O=e.shapes.find(F=>F.name===c.shape);if(O?.kind!=="audio"||!O.media||c.volume===0||he)return[];const A=O.media,q=f(O.name),S=q===void 0?p:n+V(q),g=n+V(c.from),_=(F,T)=>({t:F,sound:A.path,part:e.id,file:A.path,...c.volume===1?{}:{gainDb:20*Math.log10(c.volume)},...c.begin>0?{from:c.begin}:{},...T===void 0?{}:{length:T}}),E=c.length-c.begin;if(E<=0)return[_(g)];const R=[];for(let F=g;F<S&&(R.length===0||c.loop)&&R.length<1e3;F+=E){const T=Math.min(E,S-F);R.push(_(F,A.playback?.trim?.end!==void 0||T<E?T:void 0))}return R}),k=new Map,$=[!1];for(const c of e.shapes){st(c)&&(k.set(c.name,$.length-1),$[$.length-1]=!0);const O=c.component&&st(c)?oe.components[c.component.name]:void 0;if(O){const A=Q({phase:"build",part:e.id},()=>O.layers(c.component?.props??{},{width:c.frame.width*x,height:c.frame.height*x,slide:e.id}));for(const q of A)cn(q)?r.push({shape:c.name,layer:q}):C.problems.push(et("AK-M011",`Component ${O.name} on slide ${e.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:e.id,where:fe}))}if(c.kind==="item"&&c.item&&r.push({shape:c.name,layer:en({source:i,options:y,shape:{path:c.item.path,playback:c.item.playback,delay:Math.max(0,h(c.name)-s(c.name))},lengths:ke,drawn:Se,kept:xe})}),c.kind==="movie"&&c.media&&!he&&me(c.media.path)){const A=[c.frame.left*x,c.frame.top*x,c.frame.width*x,c.frame.height*x],q=c.media.playback,S=me(c.media.path),g=l.find(T=>T.shape===c.name),_=f(c.name),E=_===void 0?p:n+V(_),R=g!==void 0&&g.volume>0&&S?.audio===!0,F={gainDb:R?20*Math.log10(g.volume):0,audio:R};if(!q||!g){const T=V(s(c.name));P.push({part:e.id,file:c.media.path,start:n+T,end:E,from:(c.media.poster??0)-((a.at(-1)??0)-T),speed:1,...F,fit:"cover",box:A,picture:A,over:$.length})}else{const T=V(g.hide||g.loop?g.from:s(c.name)),K=V(g.from),ne=Math.max(1/z,g.length-g.begin),Ke=g.loop?E:Math.min(E,n+K+ne),we=[];for(let De=n+K+ne;g.loop&&De<Ke&&we.length<1e3;De+=ne)we.push({at:De,from:g.begin});P.push({part:e.id,file:c.media.path,start:n+T,end:Ke,from:g.begin-(K-T),speed:1,...F,...we.length>0?{cuts:[{at:n+T,from:g.begin},...we]}:{},fit:"cover",box:A,picture:A,over:$.length})}$.push(!1)}}for(;$.length>1&&$.at(-1)===!1;)$.pop();const L=$.length,j=V(b),N=c=>r.filter(O=>O.shape===c).map(O=>O.layer.component);return{slide:e,sign:It(v,e),clock:o,movies:l,footage:P,cues:w,planeOf:k,planes:L,made:r,part:{key:e.id,layers:[...new Set(r.map(c=>c.layer.component))],start:n,end:p,planes:Array.from({length:L},(c,O)=>({layers:[{component:SLIDE_LAYER,start:n,end:p},...e.shapes.filter(A=>k.get(A.name)===O).flatMap(A=>N(A.name)).map(A=>({component:A,start:n,end:p}))]})),still:j,...a.length>1?{steps:a.map(c=>Math.round((n+c)*z)/z)}:{},...ln(e),...e.hidden?{hidden:!0}:{}}}},Fe=e=>{let t=0;return e.slides.map((n,o)=>{const a=rt(n,o,t);return t=a.part.end,a})};let M=Fe(v);const Me=M.at(-1)?.part.end??0,Le={fps:z,width:D,height:I,paper:`${String(v.width/Qe)}in ${String(v.height/Qe)}in`,duration:Me,background:v.theme.colors.lt1,parts:M.map(e=>e.part),cues:M.flatMap(e=>e.cues),...M.some(e=>e.footage.length>0)?{footage:M.flatMap(e=>e.footage)}:{},audio:{}},H=new Map,$e=new Map;let ee,re;const ct=async e=>{const{slide:t,part:n}=e,o=Vt(t,{k:x,url:it,editing:!1,playing:he,...ue===void 0?{}:{lang:ue},colors:v.theme.colors});o.style.visibility="hidden",d.append(o);const a=Array.from({length:e.planes},()=>[]),s=[],f=[];for(const h of t.shapes){const b=o.querySelector(`[${G}="${CSS.escape(`${t.id}/${h.name}`)}"]`);if(b){a[e.planeOf.get(h.name)??0]?.push(b);for(const[l,{layer:p}]of e.made.filter(r=>r.shape===h.name).entries()){const r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0px"}),b.append(r);const P=stageContext({look:ae,width:h.frame.width*x,height:h.frame.height*x,start:n.start,end:n.end,combo:u.combo,format:i.format,asset:w=>m.asset(w),wait:w=>(ve??f).push(w),report:w=>C.problems.push(et(w.code,w.message,{part:t.id,where:fe}))});s.push({layer:p,el:r,ctx:P,props:p.props,from:e.clock.comesOn(h.name)}),Q({phase:"mount",part:t.id,layer:p.component,index:l},()=>{p.mount(r,p.props,P)})}}}await St(o),o.style.visibility="visible",Qt(o);for(const h of o.querySelectorAll("[data-ak-autofit='text']"))Xt(h);return o.style.visibility="hidden",await Promise.all(f),{slide:t,slot:e,el:o,part:n,layers:s,targets:Ct(e.clock.timed),lead:e.clock.lead,movies:e.movies,planes:a,pictures:$t(o)}},ge=e=>{H.delete(e.slide.id);for(const[t,n]of e.layers.entries())Q({phase:"mount",part:e.slide.id,layer:n.layer.component,index:t},()=>{n.layer.unmount?.(n.el,n.props,n.ctx)});e.el.remove(),ee===e&&(ee=void 0),re===e&&(re=void 0)},ce=async e=>{const t=e.slide.id,n=H.get(t);if(n?.slot===e)return H.delete(t),H.set(t,n),n;n&&ge(n);let o=$e.get(t);o||(o=ct(e).finally(()=>$e.delete(t)),$e.set(t,o));const a=await o,s=Ae(t);return s&&s!==e?(a.el.remove(),ce(s)):(H.set(t,a),a)},Oe=()=>{for(const e of[...H.values()]){if(H.size<=SLIDES_KEPT)return;e!==ee&&e!==re&&ge(e)}},Ae=e=>M.find(t=>t.slide.id===e),lt=e=>{let t=0,n=M.length-1;for(;t<n;){const o=t+n>>1,a=M[o];a&&e<a.part.end-1e-6?n=o:t=o+1}return M[t]},dt=e=>M.slice(0,M.indexOf(e)).reverse().find(t=>!t.slide.hidden),qe=new WeakMap,le=[],B=(e,t)=>{const n={...t};for(const o of Object.keys(t))n[o]=e.style[o];le.push(()=>{Object.assign(e.style,n)}),Object.assign(e.style,t)},ye=(e,t)=>e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${t}`)}"]`);let Ne;const Re=(e,t)=>ye(e,t)?.querySelector("video, audio")??void 0,Ee=new Set,pt=(e,t)=>{const n=Ne;if(n&&n.m!==e){for(const a of n.m.movies)Re(n.m,a.shape)?.pause();Ee.clear()}const o=n?.m===e&&t>n.t&&t-n.t<nn;Ne={m:e,t};for(const a of e.movies){const s=Re(e,a.shape);if(!s)continue;s.volume=a.volume;const f=a.length-a.begin;let h=a.begin+Math.max(0,t-a.from);a.loop&&f>0&&h>=a.length&&(h=a.begin+(h-a.begin)%f);const b=o&&t>=a.from&&h<a.length;a.hide&&(s.style.visibility=b?"":"hidden");const l=a.fullscreen?ye(e,a.shape):null;if(l){const r=l.dataset.akFull;b&&r===void 0?(l.dataset.akFull=l.style.cssText,Object.assign(l.style,{left:"0px",top:"0px",width:"100%",height:"100%",transform:"none",zIndex:"1000"})):!b&&r!==void 0&&(l.style.cssText=r,delete l.dataset.akFull)}if(b){Math.abs(s.currentTime-h)>on&&(s.currentTime=h),s.paused&&(a.volume===0&&(s.muted=!0),an(s,a.volume>0));continue}s.pause(),o&&h>=a.length&&Ee.add(a.shape);const p=Ee.has(a.shape)?a.length:Math.max(a.begin===a.poster?0:a.begin,a.poster-(a.rest-t));Math.abs(s.currentTime-p)>1/z&&(s.currentTime=p)}},ft=(e,t)=>{const n=e.slide.transition;if(!n||!Xe(t,e.lead))return;const o=re;if(!o)return;Ie(o,o.part.still-o.part.start),o.el.style.visibility="visible";const a=Math.min(1,t/e.lead);if(n.type!=="morph"){const l=Tt(n,a),p=r=>{const P=r.x!==0||r.y!==0?`translate(${String(r.x*100)}%, ${String(r.y*100)}%)`:"",w=[r.scale===1?"":`scale(${String(r.scale)})`,r.rotate===0?"":`rotate(${String(r.rotate)}deg)`],k=r.clip;return{opacity:String(r.opacity),transform:[P,...w].filter($=>$!=="").join(" "),clipPath:r.polygon?`polygon(${r.polygon.map(([$,L])=>`${String($*100)}% ${String(L*100)}%`).join(", ")})`:k?`inset(${String(k.top*100)}% ${String(k.right*100)}% ${String(k.bottom*100)}% ${String(k.left*100)}%)`:""}};B(e.el,{...p(l.incoming),zIndex:l.outgoingOver?"0":"1"}),B(o.el,{...p(l.outgoing),zIndex:l.outgoingOver?"1":"0"}),l.black&&B(d,{background:"#000"});return}const s=new Map(o.slide.shapes.map(l=>[l.name,l]));B(e.el,{background:`color-mix(in srgb, ${getComputedStyle(e.el).backgroundColor} ${String(a*100)}%, transparent)`});const f=(l,p,r)=>{B(l,{left:`${String(r.left*x)}px`,top:`${String(r.top*x)}px`,width:`${String(r.width*x)}px`,height:`${String(r.height*x)}px`});const P=p.width>0?r.width/p.width:1,w=p.height>0?r.height/p.height:1;for(const k of l.querySelectorAll(":scope > svg:not([viewBox])"))B(k,{transformOrigin:"0 0",transform:`scale(${String(P)}, ${String(w)})`})},h=l=>JSON.stringify({...l,frame:void 0,sources:void 0}),b=new Map;for(const l of e.slide.shapes){const p=ye(e,l.name);if(!p)continue;const r=s.get(l.name);if(!r){B(p,{opacity:String(a)});continue}const P=Pt(r.frame,l.frame,a),w=h(r)===h(l);b.set(l.name,{frame:P,same:w}),f(p,l.frame,P),w||B(p,{opacity:String(a)})}for(const l of o.slide.shapes){const p=ye(o,l.name);if(!p)continue;const r=b.get(l.name);r?r.same?B(p,{visibility:"hidden"}):(f(p,l.frame,r.frame),B(p,{opacity:String(1-a)})):B(p,{opacity:String(1-a)})}},Ie=(e,t)=>{for(const n of e.targets){const o=e.slide.shapes.find(k=>k.name===n.shape),a=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${n.shape}`)}"]`);if(!o||!a)continue;const s=n.paragraph===void 0?a:a.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!s)continue;const f=qe.get(s)??{transform:s.style.transform,clipPath:s.style.clipPath};qe.set(s,f);const h={width:v.width,height:v.height},b=n.animations.filter(k=>k.iterate),l=n.animations.filter(k=>!k.iterate),p=Ve(l,t,o.frame,h),[r]=n.animations,P=r?.iterate!==void 0&&_t(r.effect)&&t<r.from-1e-6;He(s,P?{...p,hidden:!0}:p,f);const w=b[0]?.iterate?.by;if(w!==void 0)for(const[k,$]of ht(s,w).entries()){const L=Ve(b,t,o.frame,h,k);for(const j of $)He(j,L,{transform:"",clipPath:""})}}},He=(e,t,n)=>{e.style.visibility=t.hidden?"hidden":"",e.style.opacity=t.opacity===1?"":String(t.opacity);const o=t.x!==0||t.y!==0?`translate(${String(t.x*x)}px, ${String(t.y*x)}px)`:"",a=t.scale*t.sx,s=t.scale*t.sy,f=a===1&&s===1?"":a===s?`scale(${String(a)})`:`scale(${String(a)}, ${String(s)})`,h=t.rotate===0?"":`rotate(${String(t.rotate)}deg)`;e.style.transform=[o,f,h,n.transform].filter(b=>b!=="").join(" "),e.style.clipPath=t.polygon?`polygon(${t.polygon.map(([b,l])=>`${String(b*100)}% ${String(l*100)}%`).join(", ")})`:t.clip?`inset(${String(t.clip.top*100)}% ${String(t.clip.right*100)}% ${String(t.clip.bottom*100)}% ${String(t.clip.left*100)}%)`:n.clipPath},Be=new WeakMap,ht=(e,t)=>{const n=Be.get(e);if(n)return n.of;const o=[],a=e.matches("[data-ak-paragraph]")?[e]:[...e.querySelectorAll("[data-ak-paragraph]")];for(const s of a){const f=document.createTreeWalker(s,NodeFilter.SHOW_TEXT),h=[];for(;f.nextNode();)h.push(f.currentNode);const b=jt(h.map(p=>p.data),t),l=o.length;o.push(...b.map(()=>[])),h.forEach((p,r)=>{const P=b.flatMap((j,N)=>j.filter(c=>c.piece===r).map(c=>({...c,unit:N})));if(P.length===0)return;const w=rn(p.parentElement,s),k=document.createDocumentFragment();let $=0,L;for(const j of P){j.start>$&&(k.append(p.data.slice($,j.start)),L=void 0);const N=document.createElement("span");N.dataset.akUnit="",N.style.display="inline-block",w&&Object.assign(N.style,w),N.textContent=p.data.slice(j.start,j.end),o[l+j.unit]?.push(N),t==="letter"?(L||(L=document.createElement("span"),L.style.whiteSpace="nowrap",k.append(L)),L.append(N)):k.append(N),$=j.end}$<p.data.length&&k.append(p.data.slice($)),p.replaceWith(k)})}return Be.set(e,{by:t,of:o}),o},mt=(e,t)=>{if(t>0){const n=e.el.style.background;e.el.style.background="none",le.push(()=>{e.el.style.background=n})}for(const[n,o]of e.planes.entries())for(const a of n===t?[]:o){const s=a.style.visibility;a.style.visibility="hidden",le.push(()=>{a.style.visibility=s})}};let de;const X=async(e,t)=>{de={t:e,plane:t};const n=Math.min(Math.max(0,e),Me-1/z),o=lt(n);if(!o)return;const a=n-o.part.start,s=await ce(o),f=o.slide.transition&&Xe(a,o.clock.lead)?dt(o):void 0,h=f?await ce(f):void 0;if(de.t!==e)return;for(const l of H.values())l.el.style.visibility=l===s?"visible":"hidden";for(ee=s,re=h,W.setMoment(n,`${u.seedBase}:${s.slide.id}`);le.length>0;)le.pop()?.();Ie(s,a),ft(s,a),pt(s,a);const b=[];ve=b;try{for(const[l,p]of s.layers.entries())Q({phase:"render",part:s.slide.id,layer:p.layer.component,index:l,t:a},()=>{p.layer.render(p.el,Math.max(0,a-p.from),p.props,p.ctx)})}finally{ve=void 0}if(t!==void 0&&mt(s,t),await Promise.all([...b,s.pictures(Te*1e3),...h?[h.pictures(Te*1e3)]:[]]),Oe(),he){const l=M[M.indexOf(o)+1];l&&!H.has(l.slide.id)&&ce(l).then(Oe,()=>{})}},Ce=()=>ee,We=async e=>{await X(e);const t=Ce(),n=d.getBoundingClientRect(),o=n.width>0?D/n.width:1;return{m:t,blocks:t?Je(t.el,d,D):[],scale:o}},ut=()=>{const e=new Map,t=new Map,n=(f,h)=>{e.has(be(f))||e.set(be(f),h),t.set(be(f),(t.get(be(f))??new Set).add(f))},o=v.theme.fonts;for(const f of[o.major,o.minor,o.major_east_asian,o.minor_east_asian])n(f,"theme");for(const f of v.slides)for(const h of f.shapes){const b=[...h.text?.style.levels.map(l=>l.font.name)??[],...h.text?.paragraphs.flatMap(l=>[l.font?.name,...l.runs.map(p=>p.font?.name)])??[]];for(const l of b)l!==void 0&&!l.startsWith("+")&&n(l,"text")}const a=new Set(vt().map(f=>f.family)),s=f=>{const h=kt(f)[0]??f;return a.has(h)||xt(h)};return[...e].map(([f,h])=>({name:f,where:h,drawn:[...t.get(f)??[]].some(s)}))},gt=e=>{const t=e.text?.paragraphs[0],n=t?.alignment??e.text?.style.levels[t?.level??0]?.alignment;return n===void 0?{}:{align:n}},yt=(e,t)=>{const n=d.getBoundingClientRect(),o=n.width>0?D/n.width:1,a=[],s=[],f=[],h=[],b=[],l=[],p=x*Ze;return e.slide.shapes.forEach((r,P)=>{const w=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${r.name}`)}"]`);if(!w)return;const k=w.getBoundingClientRect(),$=[Math.round((k.left-n.left)*o),Math.round((k.top-n.top)*o),Math.round(k.width*o),Math.round(k.height*o)],L=getComputedStyle(w).visibility==="hidden",j=Je(w,d,D).filter(S=>S.ink!==null&&S.runs.some(g=>getComputedStyle(g.el).visibility!=="hidden")),N=j.map(S=>nt([...new Set(S.runs.map(g=>g.el))],d,D));j.forEach((S,g)=>{const _=N[g]??[],E=je(_);E&&(a.push({layer:r.name,z:"front",text:S.text,box:E,...S.opacity<1?{opacity:S.opacity}:{}}),s.push(P),f.push(S.containers),h.push(E),b.push(_))});const c={name:r.name,kind:Pe(r.geometry)?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*x),Math.round(r.frame.top*x),Math.round(r.frame.width*x),Math.round(r.frame.height*x)],box:$,...L?{hidden:L}:{},...r.decorative?{decorative:!0}:{},opaque:r.kind==="picture"||r.kind==="movie"||!Pe(r.geometry)&&r.fill!==void 0&&r.fill!==null},O=pn(r,x);if(O&&(c.ends=O),r.chart){const S=r.chart.series.flatMap(g=>g.values.filter(_=>_!==null));c.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...S.length>0?{low:Math.min(...S),high:Math.max(...S)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const S=[...w.querySelectorAll("tr")];c.rows=r.table.rows.map((g,_)=>({set:Math.round(g.height*x),drawn:Math.round((S[_]?.getBoundingClientRect().height??0)*o)}))}const A=N.flat();if(A.length>0){const S=new Map;for(const E of j)for(const R of E.runs){const F=getComputedStyle(R.el),T=Math.round(parseFloat(F.fontSize)/p*10)/10,K=parseInt(F.fontWeight,10)||400,ne=`${String(T)}/${String(K)}`;S.has(ne)||S.set(ne,{size:T,weight:K,...E.xHeight===void 0?{}:{xHeight:Math.round(E.xHeight/p*10)/10}})}const g=j.map(E=>E.text).join(`
4
4
  `),_=w.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;if(c.text={text:g,words:Wt(g).words,lines:A,glyphs:je(A),type:[...S.values()],..._===void 0?{}:{scale:Number(_)},...gt(r)},r.rotation!==void 0){const E=w.style.transform;w.style.transform="none";const R=w.getBoundingClientRect(),F=j.flatMap(T=>nt([...new Set(T.runs.map(K=>K.el))],d,D));w.style.transform=E,c.text.own={box:[Math.round((R.left-n.left)*o),Math.round((R.top-n.top)*o),Math.round(R.width*o),Math.round(R.height*o)],glyphs:je(F),lines:F}}}const q=w.querySelector("img");if(q&&q.naturalWidth>0){const S=r.media?.crop??{left:0,top:0,right:0,bottom:0},g=(_,E)=>1-Math.max(0,_)-Math.max(0,E);c.picture={source:[q.naturalWidth,q.naturalHeight],shown:[Math.round(q.naturalWidth*g(S.left,S.right)),Math.round(q.naturalHeight*g(S.top,S.bottom))]}}l.push(c)}),{moment:Gt({t,part:e.slide.id,texts:a,safe:at,width:D,height:I,owner:s,containers:f,seen:h,glyphs:b}),slide:{slide:e.slide.id,steps:e.part.steps?.length??1,t,layout:e.slide.layout,hidden:e.slide.hidden,...e.slide.notes===void 0?{}:{notes:e.slide.notes},shapes:l}}},ze=e=>JSON.stringify(e.map(t=>[t.part.key,t.part.start,t.part.end,t.part.still,t.part.steps,t.part.hidden,t.part.layers,t.footage])),te={kind:"slides",get timeline(){return Le},async ready(){await X(M[0]?.part.still??0)},summary:()=>Yt(te),seek:(e,t)=>X(e,t?.plane),async update(e,t){for(const[s,f]of Object.entries(t??{}))_e.set(s,f);const n=v;v=e;const o=Fe(e);if(e.width!==n.width||e.height!==n.height||ze(o)!==ze(M))return v=n,{redrawn:[],reload:!0};const a=[];M=o.map((s,f)=>{const h=M[f];return h?.sign===s.sign?h:(a.push(s.slide.id),s)}),Le.parts=M.map(s=>s.part),ie();for(const s of[...H.values()])Ae(s.slide.id)!==s.slot&&ge(s);return de&&a.length>0&&await X(de.t,de.plane),{redrawn:a}},sheet:()=>ee?.el,words:()=>[],lines:()=>[],captionOptions:()=>null,setPlaying:()=>{},text:()=>M.map(({slide:e})=>({key:e.id,...e.notes===void 0?{}:{notes:e.notes},onScreen:e.shapes.flatMap(t=>t.text&&!t.text.empty?[t.text.paragraphs.map(n=>n.runs.map(o=>o.text).join("")).join(`
5
5
  `)]:[])})),reads:()=>{const e=m.reads(Y,M.map(n=>n.slide.id)),t=(n,o)=>[...new Map(n.map(a=>[o(a),a])).values()];return ot(Se,xe).reduce((n,{reads:o})=>({messages:t([...n.messages,...o.messages],a=>a.key),media:t([...n.media,...o.media],a=>a.path),data:t([...n.data,...o.data],a=>a.path)}),e)},problems:()=>[...m.problems,...C.problems,...m.translationProblems(),...ot(Se,xe).flatMap(({path:e,problems:t})=>t.map(n=>({...n,message:`In ${e}: ${n.message}`})))],stuck:()=>{},seekLimit:Te,facts:()=>[],says:()=>[],signs:()=>Object.fromEntries(M.map(e=>[e.slide.id,JSON.stringify({slide:JSON.parse(e.sign),width:D})])),mixPlan:()=>({duration:Me,speech:[],footage:[],sfx:[]}),covers:()=>[],drawCover:()=>Promise.resolve(),async measure(e){const t=[],n=[];for(const o of e??M.flatMap(a=>a.part.steps??[a.part.still])){await X(o);const a=Ce();if(!a)continue;const s=yt(a,o);t.push(s.moment),n.push(s.slide)}return{width:D,height:I,deck:{pxPerPt:x*Ze,slides:n,fonts:ut()},safe:at,moments:t,footage:[]}},tracks:()=>Promise.resolve([]),async deck(){const e={};for(const t of M){const n=await ce(t);for(const o of n.el.querySelectorAll("[data-ak-font-scale]")){const a=o.closest(`[${G}]`)?.getAttribute(G),s=Number(o.dataset.akFontScale);a&&s<1&&(e[a]=s)}Oe()}return{width:v.width,height:v.height,theme:v.theme,masters:J.masters,slides:v.slides,...ke.size>0?{items:Object.fromEntries(ke)}:{},fitted:e,...ue===void 0?{}:{lang:ue}}},async inks(e){const{blocks:t,scale:n}=await We(e);return t.flatMap(o=>o.ink===null?[]:[{text:{layer:"slide",z:"front",text:o.text,box:o.box},...bt(o,n)}])},async objects(e){const{m:t,blocks:n}=await We(e),o=d.getBoundingClientRect(),a=o.width>0?D/o.width:1;return{t:e,elements:t?[...t.el.querySelectorAll(`[${G}]`)].map(s=>{const f=s.getBoundingClientRect();return{id:s.getAttribute(G)??"",box:[(f.left-o.left)*a,(f.top-o.top)*a,f.width*a,f.height*a]}}):[],texts:n.map(s=>({text:s.text,box:[s.box[0],s.box[1],s.box[2],s.box[3]],size:s.size,keys:m.keysShowing(s.text)}))}},signature:()=>{const e=Ce();if(!(!e||e.el.querySelector("canvas, video, iframe")))return Ue(JSON.stringify(v.theme)+e.el.outerHTML)},async signatureAt(e){return await X(e),te.signature()},async partSignature(e,t){const n=Ae(e);if(!n)return{unknown:`no slide ${e}`};const o=[];for(const a of t){await X(a);const s=H.get(e);if(!s)return{unknown:`slide ${e} is not at ${String(a)}`};if(s.el.querySelector("canvas, video, iframe"))return{unknown:"a canvas, a video or a frame on the slide"};o.push(s.el.outerHTML)}return{sign:Ue(o.join(`
6
6
  `)),owners:[...new Set(n.made.map(a=>a.layer.component))]}},ask:()=>Promise.resolve([]),play:async(e,t)=>At(te,e,t,await tn({source:i,options:{combo:u.combo,purpose:"play"},items:M.flatMap(n=>n.slide.shapes.flatMap(o=>o.kind==="item"&&o.item?[{path:o.item.path,at:n.part.start+n.clock.playsAt(o.name),begin:o.item.playback?.trim?.start,end:o.item.playback?.trim?.end,loop:o.item.playback?.loop===!0,until:n.part.end}]:[]))})),answer(e){return e.type!=="deck-update"?Ot(te,e):te.update(e.deck,e.media).then(t=>({type:"deck-updated",...t}))},dispose(){for(const e of[...H.values()])ge(e);d.replaceChildren()}};return te}const ln=i=>{const y=dn(i);return y===void 0?{}:{title:y}};function dn(i){const d=i.shapes.find(u=>u.placeholder?.type==="title"||u.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(u=>u.runs.map(m=>m.text).join("")).join(" ").trim();return d===void 0||d===""?void 0:d}export function stageContext(i){const y=d=>()=>{throw new Error(`${d} is a video's: a slide has no speech.`)};return{look:i.look,format:i.format,dims:{width:i.width,height:i.height,orient:i.width>i.height?"landscape":i.width<i.height?"portrait":"square",safe:{top:0,bottom:0,left:0,right:0}},combo:i.combo,dur:i.end-i.start,asset:i.asset,words:()=>[],at:y("ctx.at()"),layer:{start:0,end:i.end-i.start},wait:i.wait,report:i.report,captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[],covered:[],content:[0,0,i.width,i.height],realTimers:Mt}}function pn(i,y){const d=i.frame,u=i.rotation??0;let m;if(Pe(i.geometry))m=Lt(d,i.flip,u);else{const W=i.path?.steps??[];if(W.length<2||W.some(Z=>Z.op==="close"))return;const D=W[0],I=W[W.length-1];if(!D||!I||D.op==="close"||I.op==="close")return;const oe=i.path?.w??0,U=i.path?.h??0,J=[d.left+d.width/2,d.top+d.height/2],Y=u*Math.PI/180,ae=(Z,fe)=>{let se=oe>0?Z/oe*d.width:0,v=U>0?fe/U*d.height:0;i.flip?.h&&(se=d.width-se),i.flip?.v&&(v=d.height-v);const x=d.left+se-J[0],ie=d.top+v-J[1];return[J[0]+x*Math.cos(Y)-ie*Math.sin(Y),J[1]+x*Math.sin(Y)+ie*Math.cos(Y)]};m=[ae(D.x,D.y),ae(I.x,I.y)]}const C=(W,D,I)=>({at:[Math.round(W[0]*y),Math.round(W[1]*y)],head:D??"none",...I===void 0?{}:{glued:I}});return[C(m[0],i.line_begin,i.connect?.begin?.shape),C(m[1],i.line_end,i.connect?.end?.shape)]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-runtime",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/stage",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {