allyhub 0.9.0 → 0.11.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 (582) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/commands/auth.js +4 -4
  3. package/dist/commands/cloud-tools.js +11 -11
  4. package/dist/commands/dev.js +2 -2
  5. package/dist/commands/frames/compare.js +2 -2
  6. package/dist/commands/frames/piece.js +1 -1
  7. package/dist/commands/frames/report.js +2 -0
  8. package/dist/commands/frames.js +11 -9
  9. package/dist/commands/index.js +1 -1
  10. package/dist/commands/inspect/common.js +4 -2
  11. package/dist/commands/inspect/facts.js +3 -3
  12. package/dist/commands/inspect/layout.js +1 -1
  13. package/dist/commands/orgs.js +2 -2
  14. package/dist/commands/render.js +2 -2
  15. package/dist/help.js +4 -4
  16. package/dist/main.js +8 -7
  17. package/dist/node_modules/@allyhub/3d-extension/dist/stage-routes.js +1 -1
  18. package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
  19. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  20. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +29 -0
  21. package/dist/node_modules/@allyhub/browser/dist/emoji.js +57 -0
  22. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +18 -0
  23. package/dist/node_modules/@allyhub/browser/dist/picture.js +2 -0
  24. package/dist/node_modules/@allyhub/browser/package.json +9 -1
  25. package/dist/node_modules/@allyhub/build/dist/index.d.ts +1 -0
  26. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  27. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +7 -0
  28. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +9 -0
  29. package/dist/node_modules/@allyhub/build/dist/made-notes.js +2 -0
  30. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +17 -0
  31. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +7 -0
  32. package/dist/node_modules/@allyhub/build/package.json +1 -1
  33. package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
  34. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
  35. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  36. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  38. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  39. package/dist/node_modules/@allyhub/check/package.json +1 -1
  40. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +10 -0
  41. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  42. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
  43. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  44. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
  45. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
  46. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
  47. package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
  48. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  49. package/dist/node_modules/@allyhub/components/package.json +1 -1
  50. package/dist/node_modules/@allyhub/components/r/callout.json +1 -1
  51. package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
  52. package/dist/node_modules/@allyhub/dev-server/dist/exports.js +1 -1
  53. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  54. package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +2 -0
  55. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  56. package/dist/node_modules/@allyhub/dev-server/dist/pages.js +2 -0
  57. package/dist/node_modules/@allyhub/dev-server/dist/ports.js +2 -0
  58. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  59. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  60. package/dist/node_modules/@allyhub/dev-server/dist/respond.js +2 -0
  61. package/dist/node_modules/@allyhub/dev-server/dist/reveal.js +1 -1
  62. package/dist/node_modules/@allyhub/dev-server/dist/routes.js +1 -1
  63. package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
  64. package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
  65. package/dist/node_modules/@allyhub/dev-server/dist/watcher.js +1 -1
  66. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  67. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
  68. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  69. package/dist/node_modules/@allyhub/doc/dist/captions.js +1 -1
  70. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  71. package/dist/node_modules/@allyhub/doc/dist/html.js +51 -92
  72. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  73. package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
  74. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  75. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  76. package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
  77. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  78. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  79. package/dist/node_modules/@allyhub/doc-extension/package.json +19 -6
  80. package/dist/node_modules/@allyhub/doc-print/dist/pages.js +5 -5
  81. package/dist/node_modules/@allyhub/doc-print/dist/print.js +10 -10
  82. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  83. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  84. package/dist/node_modules/@allyhub/export/package.json +1 -1
  85. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  86. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  87. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  88. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  89. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  90. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  91. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  92. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  93. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  94. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  95. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  96. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  97. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  98. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  99. package/dist/node_modules/@allyhub/image-extension/dist/export.js +4 -1
  100. package/dist/node_modules/@allyhub/image-extension/package.json +16 -6
  101. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
  102. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  103. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  104. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  105. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  106. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  107. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  108. package/dist/node_modules/@allyhub/linkedin-extension/LICENSE +241 -0
  109. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-build.js +2 -0
  110. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-kind.js +2 -0
  111. package/dist/node_modules/@allyhub/linkedin-extension/dist/build-plugins.js +2 -0
  112. package/dist/node_modules/@allyhub/linkedin-extension/dist/build.js +5 -0
  113. package/dist/node_modules/@allyhub/linkedin-extension/dist/media.js +2 -0
  114. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage-module.js +82 -0
  115. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage.js +2 -0
  116. package/dist/node_modules/@allyhub/linkedin-extension/dist/workspace.js +2 -0
  117. package/dist/node_modules/@allyhub/linkedin-extension/package.json +287 -0
  118. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +12 -0
  119. package/dist/node_modules/@allyhub/linkedin-model/LICENSE +241 -0
  120. package/dist/node_modules/@allyhub/linkedin-model/dist/article-check.js +5 -0
  121. package/dist/node_modules/@allyhub/linkedin-model/dist/article.js +3 -0
  122. package/dist/node_modules/@allyhub/linkedin-model/dist/check.js +2 -0
  123. package/dist/node_modules/@allyhub/linkedin-model/dist/count.js +3 -0
  124. package/dist/node_modules/@allyhub/linkedin-model/dist/edit.js +3 -0
  125. package/dist/node_modules/@allyhub/linkedin-model/dist/html.js +19 -0
  126. package/dist/node_modules/@allyhub/linkedin-model/dist/index.js +2 -0
  127. package/dist/node_modules/@allyhub/linkedin-model/dist/limits.js +2 -0
  128. package/dist/node_modules/@allyhub/linkedin-model/dist/little.js +2 -0
  129. package/dist/node_modules/@allyhub/linkedin-model/dist/post.js +2 -0
  130. package/dist/node_modules/@allyhub/linkedin-model/dist/requests.js +2 -0
  131. package/dist/node_modules/@allyhub/linkedin-model/package.json +14 -0
  132. package/dist/node_modules/@allyhub/linkedin-view/LICENSE +241 -0
  133. package/dist/node_modules/@allyhub/linkedin-view/dist/article.js +2 -0
  134. package/dist/node_modules/@allyhub/linkedin-view/dist/fold.js +3 -0
  135. package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -0
  136. package/dist/node_modules/@allyhub/linkedin-view/dist/post.js +2 -0
  137. package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +2 -0
  138. package/dist/node_modules/@allyhub/linkedin-view/dist/text.js +2 -0
  139. package/dist/node_modules/@allyhub/linkedin-view/package.json +21 -0
  140. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +600 -0
  141. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  142. package/dist/node_modules/@allyhub/media/package.json +1 -1
  143. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  144. package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
  145. package/dist/node_modules/@allyhub/model/package.json +1 -1
  146. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  147. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  148. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  149. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  150. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  151. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  152. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  153. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  154. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -0
  155. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  156. package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
  157. package/dist/node_modules/@allyhub/project/package.json +1 -1
  158. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
  159. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  160. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  161. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  162. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
  163. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  164. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
  165. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  166. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
  167. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  168. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  169. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  170. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
  171. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  172. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  173. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  174. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  175. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  176. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
  177. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  178. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  179. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  180. package/dist/node_modules/@allyhub/render/dist/encode.js +1 -1
  181. package/dist/node_modules/@allyhub/render/dist/index.js +1 -1
  182. package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
  183. package/dist/node_modules/@allyhub/render/dist/render.js +2 -2
  184. package/dist/node_modules/@allyhub/render/package.json +1 -1
  185. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  186. package/dist/node_modules/@allyhub/report-extension/dist/build.js +2 -0
  187. package/dist/node_modules/@allyhub/report-extension/dist/check.js +3 -0
  188. package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +2 -0
  189. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +5 -0
  190. package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +2 -0
  191. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  192. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  193. package/dist/node_modules/@allyhub/report-extension/dist/page.js +21 -0
  194. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +21 -0
  195. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +5 -0
  196. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  197. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  198. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  199. package/dist/node_modules/@allyhub/report-extension/package.json +182 -0
  200. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +132 -0
  201. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +105 -0
  202. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +17 -0
  203. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +38 -0
  204. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  205. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  206. package/dist/node_modules/@allyhub/runtime/dist/player/clips.js +1 -1
  207. package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
  208. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  209. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  210. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  211. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  212. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  213. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  214. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  215. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  216. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  217. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  218. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
  219. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
  220. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
  221. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
  222. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
  223. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
  224. package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
  225. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
  226. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +1 -1
  227. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +6 -0
  228. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.js +1 -1
  229. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  230. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  231. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  232. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  233. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  234. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  235. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  236. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  237. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  238. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  239. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  240. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  241. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  242. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  243. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  244. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  245. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  246. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  247. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  248. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  249. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  250. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  251. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  252. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  253. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  254. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  255. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  256. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  257. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  258. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  259. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  260. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  261. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  262. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -6
  263. package/dist/node_modules/@allyhub/sheet-extension/package.json +24 -9
  264. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  265. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  266. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  267. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  268. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  269. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  270. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  271. package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
  272. package/dist/node_modules/@allyhub/slides-extension/package.json +22 -16
  273. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
  274. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
  275. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  276. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  277. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  278. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  279. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  280. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  281. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
  282. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  283. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  284. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  285. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  286. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  287. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +19 -0
  288. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
  289. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
  290. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
  291. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
  292. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
  293. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
  294. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
  295. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
  296. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
  297. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
  298. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
  299. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
  300. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
  301. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
  302. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
  303. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
  304. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
  305. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
  306. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
  307. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
  308. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
  309. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
  310. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
  311. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
  312. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
  313. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
  314. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
  315. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
  316. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
  317. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
  318. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
  319. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
  320. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
  321. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
  322. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
  323. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
  324. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
  325. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
  326. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
  327. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
  328. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
  329. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
  330. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
  331. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
  332. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
  333. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
  334. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
  335. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
  336. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
  337. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
  338. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
  339. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
  340. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
  341. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
  342. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
  343. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
  344. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
  345. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
  346. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
  347. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
  348. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
  349. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
  350. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
  351. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
  352. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
  353. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
  354. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
  355. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
  356. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
  357. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
  358. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
  359. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
  360. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
  361. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
  362. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
  363. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
  364. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
  365. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
  366. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
  367. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
  368. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
  369. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
  370. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
  371. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
  372. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
  373. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
  374. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
  375. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
  376. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
  377. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  378. package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
  379. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
  380. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +1 -1
  381. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  382. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +18 -18
  383. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  384. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  385. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  386. package/dist/node_modules/@allyhub/video-extension/dist/export.js +1 -1
  387. package/dist/node_modules/@allyhub/video-extension/package.json +17 -4
  388. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  389. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  390. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  391. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  392. package/dist/node_modules/@allyhub/website/package.json +1 -1
  393. package/dist/node_modules/@allyhub/website-extension/dist/held.js +2 -0
  394. package/dist/node_modules/@allyhub/website-extension/dist/preview.js +5 -5
  395. package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
  396. package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
  397. package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
  398. package/dist/node_modules/@allyhub/x-extension/dist/build.js +4 -3
  399. package/dist/node_modules/@allyhub/x-extension/package.json +43 -15
  400. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
  401. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  402. package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
  403. package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
  404. package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
  405. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  406. package/dist/package.json +12 -10
  407. package/dist/text/facts-text.js +5 -5
  408. package/dist/text/index.js +1 -1
  409. package/dist/text/long-text.js +4 -0
  410. package/dist/works.js +1 -1
  411. package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-BKmMA6gn.js} +1 -1
  412. package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-BEFBgb4k.js} +1 -1
  413. package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-_u5YfCjY.js} +1 -1
  414. package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-B5rJbBv0.js} +1 -1
  415. package/editor-web/assets/article-BUmD3xtR.js +8 -0
  416. package/editor-web/assets/article-DNioBb3p.js +7 -0
  417. package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-CzuzsGjI.js} +1 -1
  418. package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-DybfaO3Z.js} +1 -1
  419. package/editor-web/assets/bookmark-Dsd3kHJJ.js +1 -0
  420. package/editor-web/assets/button-eGxLxbv9.js +41 -0
  421. package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BfqLHB5i.js} +1 -1
  422. package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
  423. package/editor-web/assets/channel-TNPgFDrw.js +1 -0
  424. package/editor-web/assets/chart-C37xvZT2.js +1 -0
  425. package/editor-web/assets/chart-no-axes-column-BVkeF_Mr.js +1 -0
  426. package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-BVp1I_d0.js} +1 -1
  427. package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-CTdgWEMr.js} +1 -1
  428. package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-7pnsxeaP.js} +1 -1
  429. package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-Dc0Dvkq7.js} +1 -1
  430. package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-VAILIsfx.js} +1 -1
  431. package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-CUDx1Rv5.js} +1 -1
  432. package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DAoEe-dJ.js} +1 -1
  433. package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g0akya12.js} +1 -1
  434. package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-hTGjzXdJ.js} +1 -1
  435. package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BgLV8BIJ.js} +1 -1
  436. package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-Bw19OOSD.js} +1 -1
  437. package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-CMST9dyE.js} +1 -1
  438. package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-Bbpu36XF.js} +1 -1
  439. package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-C48Ri0Gs.js} +1 -1
  440. package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-DN1g01Oe.js} +1 -1
  441. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-U6jbPr2d.js} +1 -1
  442. package/editor-web/assets/collaborator-B1u2td9m.js +1 -0
  443. package/editor-web/assets/createLucideIcon-GFZ_fxLc.js +1 -0
  444. package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-gzkai_7-.js} +1 -1
  445. package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-DtSekSr6.js} +1 -1
  446. package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-CiUwYVT6.js} +1 -1
  447. package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-r9XHCV-k.js} +1 -1
  448. package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-DxVsDZ34.js} +1 -1
  449. package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-B0eNQoHV.js} +1 -1
  450. package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-C7f2MfJT.js} +1 -1
  451. package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-CSXcnvct.js} +1 -1
  452. package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-DXzOD_ii.js} +1 -1
  453. package/editor-web/assets/dist-BGRwhCQO.js +1 -0
  454. package/editor-web/assets/{dist-9ymlIMhr.js → dist-BW4X7BrF.js} +1 -1
  455. package/editor-web/assets/dist-BgDRE85b.js +2 -0
  456. package/editor-web/assets/dist-Blq5nJnU.js +24 -0
  457. package/editor-web/assets/dist-BuWaZ3Y4.js +274 -0
  458. package/editor-web/assets/dist-C1emZ9wX.js +37 -0
  459. package/editor-web/assets/dist-CC7OeU1e.js +6 -0
  460. package/editor-web/assets/dist-CX-fiPSn.js +38 -0
  461. package/editor-web/assets/dist-C_VvG-_9.js +5 -0
  462. package/editor-web/assets/dist-Ce7HrBxv.js +3 -0
  463. package/editor-web/assets/dist-D2k6w-_a.js +1 -0
  464. package/editor-web/assets/dist-DDv_SbKw.js +84 -0
  465. package/editor-web/assets/dist-DEoEO4zs.js +1 -0
  466. package/editor-web/assets/dist-DlDxxPIP.js +16 -0
  467. package/editor-web/assets/dist-Gz6NDS0J.js +4 -0
  468. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-Cs4YRvDD.js} +1 -1
  469. package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Bh3LZ9WI.js} +1 -1
  470. package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-C4vYTYXp.js} +1 -1
  471. package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-BN1kkHWS.js} +1 -1
  472. package/editor-web/assets/flowDiagram-IUGLLWBU-B04NGsyi.js +1 -0
  473. package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-CA1LkkC5.js} +1 -1
  474. package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-Dy5tA7dG.js} +1 -1
  475. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-hJIB8EkH.js} +1 -1
  476. package/editor-web/assets/hint-B8JpEypy.js +1 -0
  477. package/editor-web/assets/index-CgB5osVc.js +28 -0
  478. package/editor-web/assets/index-Daytem9N.css +2 -0
  479. package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvzSf7rQ.js} +1 -1
  480. package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-BjIMm4Af.js} +1 -1
  481. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bpz71S40.js} +1 -1
  482. package/editor-web/assets/{italic-CDhZKo_q.js → italic-D10w8n6C.js} +1 -1
  483. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-DAB-pZjD.js} +1 -1
  484. package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-cYeyh3P6.js} +1 -1
  485. package/editor-web/assets/katex-5Z2zF-9g.js +257 -0
  486. package/editor-web/assets/link-BC5xK1-1.js +1 -0
  487. package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-req5LE0X.js} +3 -3
  488. package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-zFwZug4C.js} +4 -4
  489. package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-TStWb7DG.js} +1 -1
  490. package/editor-web/assets/minus-DaWs5i8B.js +1 -0
  491. package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-smFhVKcB.js} +1 -1
  492. package/editor-web/assets/palette-BIOudGkm.js +1 -0
  493. package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DvSNRv0-.js} +1 -1
  494. package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-qjaGsBZG.js} +1 -1
  495. package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-Dd9P-Pdc.js} +1 -1
  496. package/editor-web/assets/play-CrMmPghG.js +1 -0
  497. package/editor-web/assets/progress-DE4C5_3x.js +6 -0
  498. package/editor-web/assets/props-form-CsmDBqzy.js +1 -0
  499. package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-h2IIKUUA.js} +1 -1
  500. package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-DlVrSA1d.js} +1 -1
  501. package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-nFbuLAtc.js} +1 -1
  502. package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Daj8h2iV.js} +1 -1
  503. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-eYJyl5PH.js} +1 -1
  504. package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-BTRhKZQq.js} +1 -1
  505. package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-CeLGUjdp.js} +1 -1
  506. package/editor-web/assets/react-WA6wlt8S.js +1 -0
  507. package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-VQP1EVOZ.js} +1 -1
  508. package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-Dmk9XRM5.js} +1 -1
  509. package/editor-web/assets/row-BRlEWRrK.js +1 -0
  510. package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-Yn4zlrAM.js} +1 -1
  511. package/editor-web/assets/schemas-VikZYZIK.js +1 -0
  512. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-BTRnp_PW.js} +1 -1
  513. package/editor-web/assets/session-Do9AqS38.js +1 -0
  514. package/editor-web/assets/slides-diTEQ3C5.js +1 -0
  515. package/editor-web/assets/snapshots-BUGlKQIB.js +56 -0
  516. package/editor-web/assets/sound-Bj3o9_Fa.js +1 -0
  517. package/editor-web/assets/split-CNU1RHcX.js +3 -0
  518. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-kstrRKv2.js} +1 -1
  519. package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CfXx6IYH.js} +1 -1
  520. package/editor-web/assets/{svg-BjM9RazX.js → svg-Cx50MpxK.js} +1 -1
  521. package/editor-web/assets/swatch-WeJD41aW.js +1 -0
  522. package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-DaZsZkeP.js} +1 -1
  523. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CBZAujYY.js +8 -0
  524. package/editor-web/assets/switch-N0G_sbqt.js +1 -0
  525. package/editor-web/assets/syntax-BVsgRJ4I.js +66 -0
  526. package/editor-web/assets/syntax-oWsKBWFw.js +1 -0
  527. package/editor-web/assets/table-B6hVZAMi.js +1 -0
  528. package/editor-web/assets/tabs-DIFDqj-l.js +1 -0
  529. package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-tEWvBY9p.js} +1 -1
  530. package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-CLCvY-Yf.js} +1 -1
  531. package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BP6nqpg2.js} +1 -1
  532. package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-BmN0gwdC.js} +1 -1
  533. package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DN29G_E_.js} +1 -1
  534. package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-CHR0nvWL.js} +1 -1
  535. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-DTRS54cB.js} +1 -1
  536. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-DAAc11Hx.js} +1 -1
  537. package/editor-web/assets/video-BlvmR8BK.js +1 -0
  538. package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-B-UYkmdB.js} +1 -1
  539. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-BmbwCaky.js} +1 -1
  540. package/editor-web/assets/words-D_4T9Adq.js +3 -0
  541. package/editor-web/assets/words-WgdEQdYP.js +2 -0
  542. package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-ChAfAq1U.js} +1 -1
  543. package/editor-web/index.html +6 -5
  544. package/package.json +8 -2
  545. package/editor-web/assets/alt-BOVao_9S.js +0 -4
  546. package/editor-web/assets/article-B6YCzhj8.js +0 -73
  547. package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
  548. package/editor-web/assets/channel-C26aBI4o.js +0 -1
  549. package/editor-web/assets/chart-BOnxneyw.js +0 -1
  550. package/editor-web/assets/choice-O5nwc2N0.js +0 -1
  551. package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
  552. package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
  553. package/editor-web/assets/dist-C6NqUEG4.js +0 -16
  554. package/editor-web/assets/dist-C9UGmCG9.js +0 -6
  555. package/editor-web/assets/dist-CAk5bjBm.js +0 -1
  556. package/editor-web/assets/dist-CKyfo5RM.js +0 -340
  557. package/editor-web/assets/dist-CRaWqNwq.js +0 -37
  558. package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
  559. package/editor-web/assets/dist-DXRmkezB.js +0 -38
  560. package/editor-web/assets/dist-EKK5i0dG.js +0 -219
  561. package/editor-web/assets/dist-hHJlpLWo.js +0 -5
  562. package/editor-web/assets/dist-oYKcwWUj.js +0 -4
  563. package/editor-web/assets/dist-shKo7XVN.js +0 -2
  564. package/editor-web/assets/dist-wrKxBrVu.js +0 -24
  565. package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
  566. package/editor-web/assets/hint-_AQWCDMj.js +0 -1
  567. package/editor-web/assets/index-BsstP-cI.js +0 -28
  568. package/editor-web/assets/index-DQRcmxBO.css +0 -2
  569. package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
  570. package/editor-web/assets/progress-0B_TVsPi.js +0 -6
  571. package/editor-web/assets/react-BP46yLMB.js +0 -1
  572. package/editor-web/assets/react-pgBZqVxJ.js +0 -96
  573. package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
  574. package/editor-web/assets/session-DiI9KYRI.js +0 -1
  575. package/editor-web/assets/slides-CCwgBcGH.js +0 -1
  576. package/editor-web/assets/sound-CqryteNl.js +0 -1
  577. package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
  578. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
  579. package/editor-web/assets/switch-DltnKqN-.js +0 -1
  580. package/editor-web/assets/syntax-CC6QYhCz.js +0 -1
  581. package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
  582. package/editor-web/assets/video-DXFiCNGc.js +0 -1
@@ -0,0 +1,38 @@
1
+ // The report style's tokens for code that cannot read CSS (a canvas chart):
2
+ // read from style.css as the page draws it, so they follow the theme on
3
+ // <html data-theme> and any change made to style.css.
4
+ (() => {
5
+ const NAMES = [
6
+ "outer-bg",
7
+ "page-bg",
8
+ "surface",
9
+ "border",
10
+ "divider",
11
+ "text-primary",
12
+ "text-body",
13
+ "text-secondary",
14
+ "hero-bg",
15
+ "hero-deco",
16
+ "hero-deco2",
17
+ "success-bg",
18
+ "success-fg",
19
+ "warning-bg",
20
+ "warning-fg",
21
+ "info-bg",
22
+ "info-fg",
23
+ "error-bg",
24
+ "error-fg",
25
+ "neutral-bg",
26
+ "neutral-fg",
27
+ "font-sans",
28
+ "font-serif",
29
+ ];
30
+ /** A token's value now, by its name without `--` ("hero-deco2"). */
31
+ window.reportToken = (name) =>
32
+ getComputedStyle(document.documentElement)
33
+ .getPropertyValue(`--${name}`)
34
+ .trim();
35
+ /** Every token's value now, by name. */
36
+ window.reportTokens = () =>
37
+ Object.fromEntries(NAMES.map((n) => [n, window.reportToken(n)]));
38
+ })();
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{isRule as Le,problem as ve}from"@allyhub/diagnostics";import{contentEdges as Be,STRUCTURE as xe,toFrame as Pe,LAYER_NAME as Ue,showLayer as Ae}from"@allyhub/piece";import{fact as Ee,intersect as He}from"@allyhub/video-core";import{backdropRoot as Ke,contentOf as We,holdsAdjustment as Ie}from"@allyhub/image-draw/layer-style";import{isFootage as ie,layerNames as Oe,planStack as Me,resolveTimes as $e,windowOf as je,zOf as Se}from"@allyhub/image-draw/plan";import{realTimers as Xe}from"@allyhub/image-draw/guards";const Ye={captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[]};export{ie as isFootage,Oe as layerNames,Me as planStack,$e as resolveTimes,je as windowOf,Se as zOf};export function layerContexts(b,V,Z,ee,k){const{log:K,ledger:N,embed:m,combo:R}=b,{look:F,format:te,dims:c}=V,G=[[0,0,c.width,c.safe.top],[0,c.height-c.safe.bottom,c.width,c.safe.bottom],[0,0,c.safe.left,c.height],[c.width-c.safe.right,0,c.safe.right,c.height]].filter(n=>n[2]>0&&n[3]>0),w=Be(c),v=[w.left,w.top,w.right-w.left,w.bottom-w.top],se=n=>{if(!k)throw new Error(`"${n}": a page has no film to find it in.`);return k.filmAt(n)};return n=>{const C=n.reads??Ye,L=n.record??(()=>{}),x=n.place,B=n.answers,P={look:F,format:te,dims:c,combo:n.combo??R,dur:n.dur,asset:o=>K.asset(o),optionalAsset:o=>K.optionalAsset(o),words:n.words,at:n.at,layer:{start:n.start,end:n.end},...n.enter?{enter:n.enter}:{},...n.exit?{exit:n.exit}:{},wait:o=>{N.wait(o)},report:o=>{const u=N.running,W=Le(o.code)?o.code:"AK-R001",I=u?.part??x?.part;N.ran(ve(W,o.message,{...o.level?{level:o.level}:{},...I?{part:I}:{},...u?.t===void 0?{}:{t:u.t}}))},captions:o=>C.captions(o),face:(o,u)=>C.face(o,u),faces:o=>C.faces(o),texts:o=>C.texts(o),covered:G,content:v,video:(o,u)=>Z.video(o,u,L),cameraFor:o=>m?.cameras?.[o]??m?.cameras?.["*"],...m?.sceneryScale===void 0?{}:{sceneryScale:m.sceneryScale},embedded:m!==void 0,get layoutOnly(){return ee.mode==="layout"},realTimers:Xe,...B?{answer:(o,u)=>{B.set(o,u)}}:{}};return x&&Object.defineProperty(P,"film",{enumerable:!0,get:()=>(L("film",String(x.start)),{start:x.start,part:x.part,at:se,...m?.shown?{outer:m.shown}:{}})}),P}}const _e=b=>Math.max(0,b-.4),de=b=>Math.round(b*1e3)/1e3,Ne=b=>Math.round(b*1e6)/1e6;export function compose(b){const{env:V,piece:Z,stage:ee,takes:k,film:K,captions:N,footage:m,sound:R}=b,{source:F,options:te,combo:c,picked:G,ledger:w}=V,{fps:v,format:se,dims:n}=Z,{specs:C}=k,{timing:L,windows:x}=K,B=[],P=[],o=[],u=te.purpose==="play",W=new Set,I=(l,s)=>{const a={};for(const[i,g]of Object.entries(c)){if(!G.has(i)||i===s){a[i]=g;continue}Object.defineProperty(a,i,{enumerable:!0,get:()=>(W.has(`${l}:${i}`)||(W.add(`${l}:${i}`),w.problems.push(ve("AK-X005",`A layer of part ${l} reads ctx.combo.${i}, ${i===xe?"the combo's structure":`the pick of the slot ${i}`}. A part is rendered once and reused in every combo that has it, so it may read only the dimensions${s===void 0?"":` and its own slot (${s})`}. Choose in the output's function instead, and pass the result as a prop.`,{part:l,where:{file:F.file}}))),g)})}return a};for(const[l,s]of C.entries()){const a=L.parts[l];if(!a)continue;const i=a.end-a.start,g=e=>L.at(l,e),Re=N.partWords(s.key),Ce=k.results[l]?.speech,fe=k.inputs[l],le=fe?.placed??[],pe=[...le,...(fe?.anchors??[]).filter(e=>!le.some(t=>t.name===e.name))],X=k.speechFor(l,a),M=x.get(l),$=x.get(l+1),Te={...M&&M.before+M.after>0?{enter:{start:-M.before/v,end:M.after/v}}:{},...$&&$.before+$.after>0?{exit:{start:i-$.before/v,end:i+$.after/v}}:{}};let T;if(typeof s.still=="function")T=s.still(i);else if(s.still===void 0){if(T=_e(i),M||$){const e=(M?.after??0)/v,t=i-(($?.before??0)+1)/v;T=Math.max(e,Math.min(T,t))}}else T=g(s.still);let Y=Pe(a.start+T,v);(Y<a.start||Y>=a.end)&&(Y=a.start);const oe=s.slot??(G.has(s.key)&&s.key!==xe?s.key:void 0),ze=G.size>0?I(s.key,oe):c,ne={reads:new Map,captioned:!1},ae=Me(s.layers),{takeAt:re,planes:U,planeOf:ce,overOf:me,order:ue}=ae,_=s.layers,he=s.post??_.map(e=>"props"in e?e.props.sensor?.grade:void 0).find(Boolean),A=k.videoTakes[l],d={key:s.key,...s.title===void 0?{}:{title:s.title},...oe===void 0?{}:{slot:oe},layers:Oe(_),start:a.start,end:a.end,planes:U,still:Y,...X.speech?{speech:X.speech}:{},...pe.length>0?{anchors:pe.map(e=>({name:e.name,at:de(a.start+g(`@${e.name}`)),...e.end===void 0?{}:{end:de(a.start+g(`@/${e.name}`))}}))}:{},...s.tags?.length?{tags:[...s.tags]}:{},...he?{post:{filter:he.filter}}:{},...s.speechGainDb!==void 0&&s.speechGainDb!==0?{speechGainDb:s.speechGainDb}:{},...A?{plays:{video:A.id,from:A.from,to:A.to}}:{}};B.push(d),R.addSpeech(X.clips,X.room);const h=document.createElement("section");h.className="ak-part",h.dataset.key=s.key,h.dataset.format=se,Object.assign(h.style,{position:"absolute",inset:"0",overflow:"hidden"}),Ae(h,!1),ee.el.append(h);const q=new Map;u&&_.forEach((e,t)=>{if(!ie(e))return;const f=document.createElement("div");f.className="ak-footage-plane",Object.assign(f.style,{position:"absolute",inset:"0",...(me.get(t)??0)>0?{pointerEvents:"none"}:{}}),q.set(t,f)});let E;q.size>0&&re>=0&&(E=document.createElement("div"),E.className="ak-cutout-plane",Object.assign(E.style,{position:"absolute",inset:"0",pointerEvents:"none"}));const De={captions:e=>(ne.captioned=!0,N.partCues(a.start,a.end,e)),face:(e,t)=>m.faceAt(s.key,a.start+e,t),faces:e=>m.facesAt(s.key,a.start+e)},H=[],ye=new Map;for(const[e,t]of _.entries()){const[f,y]=je(t,i,g);if(ie(t)){const D=e===re,Q=m.plan(t,d,Ce,a.speechAt,f,y,{at:g,cutout:D,over:me.get(e)??0,person:D&&E!==void 0});if(Q&&u){const we=q.get(e)??h,{matteUrl:ke,personOver:Fe,...Ge}=Q;o.push({...Ge,host:we,...ke===void 0?{}:{cutoutIn:{host:Fe&&E?E:we,matte:ke}}})}continue}if(t.visible===!1)continue;const r=Se(t),O=ce.get(e)??0;U[O]?.layers.push({component:t.component,start:Ne(d.start+f),end:Ne(d.start+Math.max(f,y))});const p=document.createElement("div");p.className="ak-layer",p.dataset.component=t.component,t.key!==void 0&&p.setAttribute(Ue,t.key),Object.assign(p.style,{position:"absolute",inset:"0"}),Ae(p,!1),ye.set(e,p);const S=t.times?$e(t.props,t.times,g):t.props,J=H.slice(),be=new Map,ge=b.contexts({dur:i,words:()=>Re,at:g,start:f,end:y,combo:ze,reads:{...De,texts:D=>b.texts({part:d,el:h},J,D)},record:(D,Q)=>ne.reads.set(D,Q),place:{start:d.start,part:s.key},answers:be,...Te});H.push({spec:t,index:e,props:S,el:p,content:We(p,t,ge.dims),ctx:ge,start:f,end:y,z:r,plane:O,answers:be})}H.some(e=>Ie(e.spec))&&Ke(h);let z=h,j;if(U.some(e=>e.overlay===!0)){z=document.createElement("div"),j=document.createElement("div"),z.className="ak-picture",j.className="ak-overlays";for(const e of[z,j])Object.assign(e.style,{position:"absolute",inset:"0",overflow:"hidden"}),h.append(e)}ue.forEach((e,t)=>{const f=q.get(e)??ye.get(e);f&&(j&&ae.overlaid(e)?j:z).append(f);const y=ce.get(e),r=ue[t+1];E&&y!==void 0&&U[y]?.behindPerson===!0&&(r===void 0||ce.get(r)!==y)&&z.append(E)}),R.sfx(s,d,g),A&&R.carry(A.inner,A.from,A.to,d.start,d.key,0);for(const e of H){const t=k.shownBy.get(e.spec);t&&(t.shown.start=d.start+e.start,t.shown.partStart=d.start,t.shown.from=t.from,t.shown.to=t.from+(e.end-e.start)*t.speed,t.shown.speed=t.speed,t.audio!==void 0&&t.speed===1&&R.carry(t.inner,t.from,t.shown.to,d.start+e.start,d.key,t.audio))}U.forEach((e,t)=>{const f=e.layers.filter(r=>r.end>r.start),y=m.placed.flatMap(r=>{if(r.part!==d.key||(r.over??0)<=t)return[];if(!f.some(p=>p.end>r.start&&p.start<r.end))return[];let O;for(const p of r.boxes?r.boxes.map(S=>S.box):[r.box]){const S=He(p,[0,0,n.width,n.height]),J=S?de(S[2]*S[3]/(n.width*n.height)):0;(!O||J>O.frame)&&(O={box:p,frame:J})}return O?[{file:r.file,start:r.start,end:r.end,...O}]:[]});y.length!==0&&w.facts.push(Ee("graphics-under-footage",{piece:F.piece,part:s.key,t:d.start},{layers:f,footage:y,covered:Math.max(...y.map(r=>r.frame))}))}),ae.hasBehind&&re<0&&w.facts.push(Ee("fallback",{piece:F.piece,part:s.key},{missing:"own-footage",for:"behind-person",fallback:"in-front"})),P.push({part:d,spec:s,n:l,el:h,picture:z,...j?{overlays:j}:{},layers:H,record:ne})}return{parts:B,mounted:P,clips:o}}
2
+ import{isRule as Ge,problem as ve}from"@allyhub/diagnostics";import{contentEdges as Le,STRUCTURE as xe,toFrame as Ue,LAYER_NAME as Be,showLayer as Ae}from"@allyhub/piece";import{fact as Ee,intersect as He}from"@allyhub/video-core";import{backdropRoot as Ke,contentOf as We,holdsAdjustment as Ie}from"@allyhub/image-draw/layer-style";import{isFootage as ie,layerNames as Oe,planStack as Me,resolveTimes as $e,windowOf as je,zOf as Se}from"@allyhub/image-draw/plan";import{realTimers as Xe}from"@allyhub/image-draw/guards";const Ye={captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[]};export{ie as isFootage,Oe as layerNames,Me as planStack,$e as resolveTimes,je as windowOf,Se as zOf};export function layerContexts(g,Q,V,Z,k){const{log:K,ledger:N,embed:m,combo:R}=g,{look:D,format:ee,dims:c}=Q,F=[[0,0,c.width,c.safe.top],[0,c.height-c.safe.bottom,c.width,c.safe.bottom],[0,0,c.safe.left,c.height],[c.width-c.safe.right,0,c.safe.right,c.height]].filter(n=>n[2]>0&&n[3]>0),w=Le(c),v=[w.left,w.top,w.right-w.left,w.bottom-w.top],te=n=>{if(!k)throw new Error(`"${n}": a page has no film to find it in.`);return k.filmAt(n)};return n=>{const C=n.reads??Ye,G=n.record??(()=>{}),x=n.place,L=n.answers,U={look:D,format:ee,dims:c,combo:n.combo??R,dur:n.dur,asset:o=>K.asset(o),optionalAsset:o=>K.optionalAsset(o),words:n.words,at:n.at,layer:{start:n.start,end:n.end},...n.enter?{enter:n.enter}:{},...n.exit?{exit:n.exit}:{},wait:o=>{N.wait(o)},report:o=>{const u=N.running,W=Ge(o.code)?o.code:"AK-R001",I=u?.part??x?.part;N.ran(ve(W,o.message,{...o.level?{level:o.level}:{},...o.ofPage?{ofPage:!0}:{},...I?{part:I}:{},...u?.t===void 0?{}:{t:u.t}}))},captions:o=>C.captions(o),face:(o,u)=>C.face(o,u),faces:o=>C.faces(o),texts:o=>C.texts(o),covered:F,content:v,video:(o,u)=>V.video(o,u,G),cameraFor:o=>m?.cameras?.[o]??m?.cameras?.["*"],...m?.sceneryScale===void 0?{}:{sceneryScale:m.sceneryScale},embedded:m!==void 0,get layoutOnly(){return Z.mode==="layout"},realTimers:Xe,...L?{answer:(o,u)=>{L.set(o,u)}}:{}};return x&&Object.defineProperty(U,"film",{enumerable:!0,get:()=>(G("film",String(x.start)),{start:x.start,part:x.part,at:te,...m?.shown?{outer:m.shown}:{}})}),U}}const _e=g=>Math.max(0,g-.4),de=g=>Math.round(g*1e3)/1e3,Ne=g=>Math.round(g*1e6)/1e6;export function compose(g){const{env:Q,piece:V,stage:Z,takes:k,film:K,captions:N,footage:m,sound:R}=g,{source:D,options:ee,combo:c,picked:F,ledger:w}=Q,{fps:v,format:te,dims:n}=V,{specs:C}=k,{timing:G,windows:x}=K,L=[],U=[],o=[],u=ee.purpose==="play",W=new Set,I=(l,s)=>{const a={};for(const[i,b]of Object.entries(c)){if(!F.has(i)||i===s){a[i]=b;continue}Object.defineProperty(a,i,{enumerable:!0,get:()=>(W.has(`${l}:${i}`)||(W.add(`${l}:${i}`),w.problems.push(ve("AK-X005",`A layer of part ${l} reads ctx.combo.${i}, ${i===xe?"the combo's structure":`the pick of the slot ${i}`}. A part is rendered once and reused in every combo that has it, so it may read only the dimensions${s===void 0?"":` and its own slot (${s})`}. Choose in the output's function instead, and pass the result as a prop.`,{part:l,where:{file:D.file}}))),b)})}return a};for(const[l,s]of C.entries()){const a=G.parts[l];if(!a)continue;const i=a.end-a.start,b=e=>G.at(l,e),Re=N.partWords(s.key),Ce=k.results[l]?.speech,fe=k.inputs[l],le=fe?.placed??[],pe=[...le,...(fe?.anchors??[]).filter(e=>!le.some(t=>t.name===e.name))],X=k.speechFor(l,a),M=x.get(l),$=x.get(l+1),Pe={...M&&M.before+M.after>0?{enter:{start:-M.before/v,end:M.after/v}}:{},...$&&$.before+$.after>0?{exit:{start:i-$.before/v,end:i+$.after/v}}:{}};let P;if(typeof s.still=="function")P=s.still(i);else if(s.still===void 0){if(P=_e(i),M||$){const e=(M?.after??0)/v,t=i-(($?.before??0)+1)/v;P=Math.max(e,Math.min(P,t))}}else P=b(s.still);let Y=Ue(a.start+P,v);(Y<a.start||Y>=a.end)&&(Y=a.start);const se=s.slot??(F.has(s.key)&&s.key!==xe?s.key:void 0),Te=F.size>0?I(s.key,se):c,oe={reads:new Map,captioned:!1},ne=Me(s.layers),{takeAt:ae,planes:B,planeOf:re,overOf:me,order:ue}=ne,ce=s.layers,he=s.post,A=k.videoTakes[l],d={key:s.key,...s.title===void 0?{}:{title:s.title},...se===void 0?{}:{slot:se},layers:Oe(ce),start:a.start,end:a.end,planes:B,still:Y,...X.speech?{speech:X.speech}:{},...pe.length>0?{anchors:pe.map(e=>({name:e.name,at:de(a.start+b(`@${e.name}`)),...e.end===void 0?{}:{end:de(a.start+b(`@/${e.name}`))}}))}:{},...s.tags?.length?{tags:[...s.tags]}:{},...he?{post:{filter:he.filter}}:{},...s.speechGainDb!==void 0&&s.speechGainDb!==0?{speechGainDb:s.speechGainDb}:{},...A?{plays:{video:A.id,from:A.from,to:A.to}}:{}};L.push(d),R.addSpeech(X.clips,X.room);const h=document.createElement("section");h.className="ak-part",h.dataset.key=s.key,h.dataset.format=te,Object.assign(h.style,{position:"absolute",inset:"0",overflow:"hidden"}),Ae(h,!1),Z.el.append(h);const _=new Map;u&&ce.forEach((e,t)=>{if(!ie(e))return;const f=document.createElement("div");f.className="ak-footage-plane",Object.assign(f.style,{position:"absolute",inset:"0",...(me.get(t)??0)>0?{pointerEvents:"none"}:{}}),_.set(t,f)});let E;_.size>0&&ae>=0&&(E=document.createElement("div"),E.className="ak-cutout-plane",Object.assign(E.style,{position:"absolute",inset:"0",pointerEvents:"none"}));const ze={captions:e=>(oe.captioned=!0,N.partCues(a.start,a.end,e)),face:(e,t)=>m.faceAt(s.key,a.start+e,t),faces:e=>m.facesAt(s.key,a.start+e)},H=[],ye=new Map;for(const[e,t]of ce.entries()){const[f,y]=je(t,i,b);if(ie(t)){const z=e===ae,J=m.plan(t,d,Ce,a.speechAt,f,y,{at:b,cutout:z,over:me.get(e)??0,person:z&&E!==void 0});if(J&&u){const we=_.get(e)??h,{matteUrl:ke,personOver:De,...Fe}=J;o.push({...Fe,host:we,...ke===void 0?{}:{cutoutIn:{host:De&&E?E:we,matte:ke}}})}continue}if(t.visible===!1)continue;const r=Se(t),O=re.get(e)??0;B[O]?.layers.push({component:t.component,start:Ne(d.start+f),end:Ne(d.start+Math.max(f,y))});const p=document.createElement("div");p.className="ak-layer",p.dataset.component=t.component,t.key!==void 0&&p.setAttribute(Be,t.key),Object.assign(p.style,{position:"absolute",inset:"0"}),Ae(p,!1),ye.set(e,p);const S=t.times?$e(t.props,t.times,b):t.props,q=H.slice(),ge=new Map,be=g.contexts({dur:i,words:()=>Re,at:b,start:f,end:y,combo:Te,reads:{...ze,texts:z=>g.texts({part:d,el:h},q,z)},record:(z,J)=>oe.reads.set(z,J),place:{start:d.start,part:s.key},answers:ge,...Pe});H.push({spec:t,index:e,props:S,el:p,content:We(p,t,be.dims),ctx:be,start:f,end:y,z:r,plane:O,answers:ge})}H.some(e=>Ie(e.spec))&&Ke(h);let T=h,j;if(B.some(e=>e.overlay===!0)){T=document.createElement("div"),j=document.createElement("div"),T.className="ak-picture",j.className="ak-overlays";for(const e of[T,j])Object.assign(e.style,{position:"absolute",inset:"0",overflow:"hidden"}),h.append(e)}ue.forEach((e,t)=>{const f=_.get(e)??ye.get(e);f&&(j&&ne.overlaid(e)?j:T).append(f);const y=re.get(e),r=ue[t+1];E&&y!==void 0&&B[y]?.behindPerson===!0&&(r===void 0||re.get(r)!==y)&&T.append(E)}),R.sfx(s,d,b),A&&R.carry(A.inner,A.from,A.to,d.start,d.key,0);for(const e of H){const t=k.shownBy.get(e.spec);t&&(t.shown.start=d.start+e.start,t.shown.partStart=d.start,t.shown.from=t.from,t.shown.to=t.from+(e.end-e.start)*t.speed,t.shown.speed=t.speed,t.audio!==void 0&&t.speed===1&&R.carry(t.inner,t.from,t.shown.to,d.start+e.start,d.key,t.audio))}B.forEach((e,t)=>{const f=e.layers.filter(r=>r.end>r.start),y=m.placed.flatMap(r=>{if(r.part!==d.key||(r.over??0)<=t)return[];if(!f.some(p=>p.end>r.start&&p.start<r.end))return[];let O;for(const p of r.boxes?r.boxes.map(S=>S.box):[r.box]){const S=He(p,[0,0,n.width,n.height]),q=S?de(S[2]*S[3]/(n.width*n.height)):0;(!O||q>O.frame)&&(O={box:p,frame:q})}return O?[{file:r.file,start:r.start,end:r.end,...O}]:[]});y.length!==0&&w.facts.push(Ee("graphics-under-footage",{piece:D.piece,part:s.key,t:d.start},{layers:f,footage:y,covered:Math.max(...y.map(r=>r.frame))}))}),ne.hasBehind&&ae<0&&w.facts.push(Ee("fallback",{piece:D.piece,part:s.key},{missing:"own-footage",for:"behind-person",fallback:"in-front"})),U.push({part:d,spec:s,n:l,el:h,picture:T,...j?{overlays:j}:{},layers:H,record:oe})}return{parts:L,mounted:U,clips:o}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{LAYER_BRAND as _}from"@allyhub/piece";import{forOrient as N,isPieceDefinition as E,momentOf as M,outputName as q}from"@allyhub/video-core";import{LoadFailure as $}from"@allyhub/image-draw/errors";export const momentIn=(t,e)=>typeof e=="number"?e:M(t.timeline,e),camerasOf=t=>t?.cameras??(t?.camera===void 0?void 0:{"*":t.camera});function B(t,e){const l=e.written?.file;if(!(l===void 0||l===""))return Object.entries(t.pieces??{}).find(([,m])=>m.file===l)}export function createEmbedder(t,e,l){const{source:m,options:v,embed:h,combo:g}=t,y=[],u=[...h?.chain??[],m.piece],w={loaded:y,async load(s,o,i={}){const f=E(s)?B(m,s):void 0;if(!E(s)||!f)throw new $("bad_video",'A video item of the project is shown by its piece, imported (import demo from "../demo/video") and passed as it is.');const[c,r]=f;if(u.includes(c))throw new $("video_cycle",`${[...u,c].join(" → ")}: a video item that shows itself, through the videos it shows (AK-M010). A source cannot reach itself.`);const a=q(s.kind),n=i.frame===!0?m.format:r.format,p=Object.fromEntries(Object.entries(r.dims).map(([j,A])=>{const S=g[j];return[j,S!==void 0&&A.includes(S)?S:A[0]??""]})),d=o.parentNode,b=o.nextSibling,x=document.createElement("div");x.dataset.akHolder="",Object.assign(x.style,{position:"absolute",left:"0px",top:"0px",visibility:"hidden",pointerEvents:"none"}),e.el.append(x),x.append(o);let O;try{O=await l({...m,piece:c,file:r.file,module:"",styles:[],dims:r.dims,format:n,...r.matrix?{matrix:r.matrix}:{}},{combo:p,purpose:v.purpose},o,{def:s,chain:u,...i.cameras?{cameras:i.cameras}:{},...i.shown?{shown:i.shown}:{},...i.sceneryScale===void 0?{}:{sceneryScale:i.sceneryScale}}),await O.ready()}finally{e.takeOutside(),d?d.insertBefore(o,b):o.remove(),e.takeOutside(),x.remove()}const k={id:c,output:a,format:n,inner:O};return y.push(k),k},async video(s,o,i){const{id:f,output:c,format:r,inner:a}=await w.load(s,o);return i(`video:${f}:${c}:${r}`,JSON.stringify(a.signs())),{id:f,duration:a.timeline.duration,width:a.timeline.width,height:a.timeline.height,seek:(n,p)=>a.seek(n,{mode:p===!0?"layout":"picture"}),at:n=>M(a.timeline,n)}}};return w}export const isBoxKeys=t=>Array.isArray(t)&&t.length>0&&typeof t[0]=="object";export function videoLayer(t,e,l,m,v){const{inner:h,host:g}=l,y=h.timeline.width,u=h.timeline.height,w=N(e.box,t.orient);if(isBoxKeys(w))throw new $("bad_footage",'footage() of a video item takes one box (or "full"), not keyframes.');const[s,o,i,f]=w===void 0||w==="full"?[0,0,1,1]:w,c=e.fit??"cover",r=e.cameras??(e.camera===void 0?void 0:e.camera);return{[_]:"graphic",component:"video",...e.at===void 0?{}:{at:e.at},...e.until===void 0?{}:{until:e.until},...e.dur===void 0?{}:{dur:e.dur},props:{...v,box:[s,o,i,f],fit:c,...r===void 0?{}:{camera:r},...e.quality?{quality:e.quality}:{},parts:h.signs()},mount(a){const n={x:s*t.width,y:o*t.height,w:i*t.width,h:f*t.height},p=c==="contain"?Math.min(n.w/y,n.h/u):Math.max(n.w/y,n.h/u),d=document.createElement("div");Object.assign(d.style,{position:"absolute",left:`${String(n.x)}px`,top:`${String(n.y)}px`,width:`${String(n.w)}px`,height:`${String(n.h)}px`,overflow:"hidden"}),Object.assign(g.style,{position:"absolute",left:`${String((n.w-y*p)/2)}px`,top:`${String((n.h-u*p)/2)}px`,width:`${String(y)}px`,height:`${String(u)}px`,transformOrigin:"0 0",transform:`scale(${String(p)})`}),d.appendChild(g),a.appendChild(d)},render(a,n,p,d){const b=Math.min(Math.max(m(n,d),0),Math.max(0,h.timeline.duration-.001)),x=d.layoutOnly===!0?"layout":"picture";d.wait(Promise.resolve().then(()=>h.seek(b,{mode:x})))}}}
2
+ import{LAYER_BRAND as _}from"@allyhub/piece";import{forOrient as N,isPieceDefinition as E,momentOf as M,outputName as q}from"@allyhub/video-core";import{LoadFailure as $}from"@allyhub/image-draw/errors";export const momentIn=(t,e)=>typeof e=="number"?e:M(t.timeline,e),camerasOf=t=>t?.cameras??(t?.camera===void 0?void 0:{"*":t.camera});function B(t,e){const l=e.written?.file;if(!(l===void 0||l===""))return Object.entries(t.pieces??{}).find(([,m])=>m.file===l)}export function createEmbedder(t,e,l){const{source:m,options:v,embed:h,combo:g}=t,y=[],u=[...h?.chain??[],m.piece],w={loaded:y,async load(s,i,o={}){const f=E(s)?B(m,s):void 0;if(!E(s)||!f)throw new $("bad_video",'A video item of the project is shown by its piece, imported (import demo from "../demo/video") and passed as it is.');const[c,r]=f;if(u.includes(c))throw new $("video_cycle",`${[...u,c].join(" → ")}: a video item that shows itself, through the videos it shows (AK-M010). A source cannot reach itself.`);const a=q(s.kind),n=o.frame===!0?m.format:r.format,p=Object.fromEntries(Object.entries(r.dims).map(([j,A])=>{const S=g[j];return[j,S!==void 0&&A.includes(S)?S:A[0]??""]})),d=i.parentNode,b=i.nextSibling,x=document.createElement("div");x.dataset.akHolder="",Object.assign(x.style,{position:"absolute",left:"0px",top:"0px",visibility:"hidden",pointerEvents:"none"}),e.el.append(x),x.append(i),i.dataset.akPiece=r.file;let O;try{O=await l({...m,piece:c,file:r.file,module:"",styles:[],dims:r.dims,format:n,...r.matrix?{matrix:r.matrix}:{}},{combo:p,purpose:v.purpose},i,{def:s,chain:u,...o.cameras?{cameras:o.cameras}:{},...o.shown?{shown:o.shown}:{},...o.sceneryScale===void 0?{}:{sceneryScale:o.sceneryScale}}),await O.ready()}finally{e.takeOutside(),d?d.insertBefore(i,b):i.remove(),e.takeOutside(),x.remove()}const k={id:c,output:a,format:n,inner:O};return y.push(k),k},async video(s,i,o){const{id:f,output:c,format:r,inner:a}=await w.load(s,i);return o(`video:${f}:${c}:${r}`,JSON.stringify(a.signs())),{id:f,duration:a.timeline.duration,width:a.timeline.width,height:a.timeline.height,seek:(n,p)=>a.seek(n,{mode:p===!0?"layout":"picture"}),at:n=>M(a.timeline,n)}}};return w}export const isBoxKeys=t=>Array.isArray(t)&&t.length>0&&typeof t[0]=="object";export function videoLayer(t,e,l,m,v){const{inner:h,host:g}=l,y=h.timeline.width,u=h.timeline.height,w=N(e.box,t.orient);if(isBoxKeys(w))throw new $("bad_footage",'footage() of a video item takes one box (or "full"), not keyframes.');const[s,i,o,f]=w===void 0||w==="full"?[0,0,1,1]:w,c=e.fit??"cover",r=e.cameras??(e.camera===void 0?void 0:e.camera);return{[_]:"graphic",component:"video",...e.at===void 0?{}:{at:e.at},...e.until===void 0?{}:{until:e.until},...e.dur===void 0?{}:{dur:e.dur},props:{...v,box:[s,i,o,f],fit:c,...r===void 0?{}:{camera:r},...e.quality?{quality:e.quality}:{},parts:h.signs()},mount(a){const n={x:s*t.width,y:i*t.height,w:o*t.width,h:f*t.height},p=c==="contain"?Math.min(n.w/y,n.h/u):Math.max(n.w/y,n.h/u),d=document.createElement("div");Object.assign(d.style,{position:"absolute",left:`${String(n.x)}px`,top:`${String(n.y)}px`,width:`${String(n.w)}px`,height:`${String(n.h)}px`,overflow:"hidden"}),Object.assign(g.style,{position:"absolute",left:`${String((n.w-y*p)/2)}px`,top:`${String((n.h-u*p)/2)}px`,width:`${String(y)}px`,height:`${String(u)}px`,transformOrigin:"0 0",transform:`scale(${String(p)})`}),d.appendChild(g),a.appendChild(d)},render(a,n,p,d){const b=Math.min(Math.max(m(n,d),0),Math.max(0,h.timeline.duration-.001)),x=d.layoutOnly===!0?"layout":"picture";d.wait(Promise.resolve().then(()=>h.seek(b,{mode:x})))}}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{intersect as S,placementAt as m,sourceAt as b}from"@allyhub/video-core";import{Cutout as R}from"./cutout.js";const M=.5,A=.04,T=.01,$=.03,F=.02,l=r=>`${String(r)}px`;function f(r,e){Object.assign(r.style,{position:"absolute",left:l(e[0]),top:l(e[1]),width:l(e[2]),height:l(e[3])})}function g(r,e){if(r.shape==="circle"){e.style.borderRadius="50%";return}if(!r.radius)return;const[,,o,t]=r.boxes?.[0]?.box??r.box,s=n=>`${String(Math.round((r.radius??0)/n*1e5)/1e3)}%`;e.style.borderRadius=`${s(o)} / ${s(t)}`}function h(r,e,o,t){f(o,e.box);const[s,n,i,c]=e.picture,[a,u]=e.box;if(e.crop&&r.source){const[d,w,k,E]=e.crop,p=i/k,y=c/E;f(t,[s-a-d*p,n-u-w*y,r.source.width*p,r.source.height*y]),t.style.objectFit="fill"}else f(t,[s-a,n-u,i,c]),t.style.objectFit=r.fit}function I(r){return[r.blur?`blur(${String(r.blur)}px)`:"",r.desaturate?`saturate(${String(1-r.desaturate)})`:"",r.dim?`brightness(${String(1-r.dim)})`:""].filter(e=>e!=="").join(" ")}function j(r,e,o,t){const s=I(e);if(e.color===void 0&&e.image===void 0){t.style.filter=s;return}if(t.style.opacity="0",e.color==="transparent")return;let n;if(e.image!==void 0&&r.imageUrl){const i=document.createElement("img");i.src=r.imageUrl,i.alt="",i.style.objectFit="cover",i.style.maxWidth="none",i.style.filter=s,n=i}else n=document.createElement("div"),n.style.background=e.color??"transparent";return n.className="ak-backdrop",o.prepend(n),n}function x(r,e){const o=S(e.picture,e.box)??e.box;f(r,[o[0]-e.box[0],o[1]-e.box[1],o[2],o[3]])}export class Clips{drawn;fps;playing=!1;constructor(e,o){this.fps=o,this.drawn=e.map(t=>{const s=document.createElement("div");s.className="ak-footage",s.style.overflow="hidden",g(t,s);const n=document.createElement("video");n.muted=!0,n.playsInline=!0,n.preload="auto",n.src=t.url,n.style.maxWidth="none",n.style.visibility="hidden";const i=m(t,t.start);h(t,i,s,n),s.append(n),t.host.append(s);const c=(t.pan?.length??0)>1||(t.zoom?.length??0)>0||(t.boxes?.length??0)>1;let a,u;if(t.cutoutIn){const d=t.background;a=new R({take:n,matte:t.cutoutIn.matte,host:t.cutoutIn.host,...t.source?{source:t.source}:{},...d?{edge:{feather:d.feather,shrink:d.shrink},onFail:()=>{n.style.filter="",n.style.opacity="",u?.remove()}}:{}}),g(t,a.box),h(t,i,a.box,a.canvas),d&&(u=j(t,d,s,n),u&&x(u,i))}return{clip:t,el:n,box:s,moving:c,...a?{cutout:a}:{},...u?{backdrop:u}:{}}})}sourceAt(e,o){const t=b(e,o),s=e.duration===void 0?1/0:e.duration-1/this.fps;return Math.max(0,Math.min(t,s))}setPlaying(e){if(this.playing=e,!e)for(const o of this.drawn)o.el.pause(),o.cutout?.sync()}draw(e,o){for(const t of this.drawn){const s=t.clip;if(!(e>=s.start&&e<s.end)){t.el.style.visibility="hidden",t.el.paused||t.el.pause(),t.cutout?.show(!1);continue}if(t.moving){const a=m(s,e);h(s,a,t.box,t.el),t.cutout&&h(s,a,t.cutout.box,t.cutout.canvas),t.backdrop&&x(t.backdrop,a)}t.el.style.visibility="visible";let i;s.cuts&&(i=0,s.cuts.forEach((a,u)=>{a.at<=e+1e-9&&(i=u)}));const c=i!==t.cut;t.cut=i,this.follow(t,t.el,e,o||c),t.cutout&&(t.cutout.show(!0),t.cutout.sync(),t.cutout.draw())}}follow(e,o,t,s){const n=e.clip,i=this.sourceAt(n,t),c=o.currentTime-i,a=b(n,t),u=a<0||n.duration!==void 0&&a>=n.duration-1/this.fps;if(!this.playing||u){o.paused||o.pause(),Math.abs(c)>F&&(o.currentTime=i);return}if(s||o.paused||Math.abs(c)>M*n.speed){o.currentTime=i,o.playbackRate=n.speed,e.steering=void 0,o.paused&&o.play().catch(()=>{});return}const d=c<0?1:-1;Math.abs(c)>A?e.steering=d:Math.abs(c)<=T&&(e.steering=void 0),o.playbackRate=n.speed*(e.steering===void 0?1:1+e.steering*$)}dispose(){for(const e of this.drawn)e.cutout?.dispose(),e.el.pause(),e.el.removeAttribute("src"),e.el.load()}}
2
+ import{intersect as S,placementAt as m,sourceAt as b}from"@allyhub/video-core";import{Cutout as R}from"./cutout.js";const M=.5,A=.04,F=.01,T=.03,$=.02,l=r=>`${String(r)}px`;function f(r,e){Object.assign(r.style,{position:"absolute",left:l(e[0]),top:l(e[1]),width:l(e[2]),height:l(e[3])})}function g(r,e){if(r.shape==="circle"){e.style.borderRadius="50%";return}if(!r.radius)return;const[,,s,t]=r.boxes?.[0]?.box??r.box,o=n=>`${String(Math.round((r.radius??0)/n*1e5)/1e3)}%`;e.style.borderRadius=`${o(s)} / ${o(t)}`}function h(r,e,s,t){f(s,e.box);const[o,n,i,c]=e.picture,[a,u]=e.box;if(e.crop&&r.source){const[d,w,k,E]=e.crop,p=i/k,y=c/E;f(t,[o-a-d*p,n-u-w*y,r.source.width*p,r.source.height*y]),t.style.objectFit="fill"}else f(t,[o-a,n-u,i,c]),t.style.objectFit=r.fit}function I(r){return[r.blur?`blur(${String(r.blur)}px)`:"",r.desaturate?`saturate(${String(1-r.desaturate)})`:"",r.dim?`brightness(${String(1-r.dim)})`:""].filter(e=>e!=="").join(" ")}function j(r,e,s,t){const o=I(e);if(e.color===void 0&&e.image===void 0){t.style.filter=o;return}if(t.style.opacity="0",e.color==="transparent")return;let n;if(e.image!==void 0&&r.imageUrl){const i=document.createElement("img");i.src=r.imageUrl,i.alt="",i.style.objectFit="cover",i.style.maxWidth="none",i.style.filter=o,n=i}else n=document.createElement("div"),n.style.background=e.color??"transparent";return n.className="ak-backdrop",s.prepend(n),n}function x(r,e){const s=S(e.picture,e.box)??e.box;f(r,[s[0]-e.box[0],s[1]-e.box[1],s[2],s[3]])}export class Clips{drawn;fps;playing=!1;constructor(e,s){this.fps=s,this.drawn=e.map(t=>{const o=document.createElement("div");o.className="ak-footage",o.dataset.akFile=t.file,o.dataset.akPart=t.part,o.style.overflow="hidden",g(t,o);const n=document.createElement("video");n.muted=!0,n.playsInline=!0,n.preload="auto",n.src=t.url,n.style.maxWidth="none",n.style.visibility="hidden";const i=m(t,t.start);h(t,i,o,n),o.append(n),t.host.append(o);const c=(t.pan?.length??0)>1||(t.zoom?.length??0)>0||(t.boxes?.length??0)>1;let a,u;if(t.cutoutIn){const d=t.background;a=new R({take:n,matte:t.cutoutIn.matte,host:t.cutoutIn.host,...t.source?{source:t.source}:{},...d?{edge:{feather:d.feather,shrink:d.shrink},onFail:()=>{n.style.filter="",n.style.opacity="",u?.remove()}}:{}}),g(t,a.box),h(t,i,a.box,a.canvas),d&&(u=j(t,d,o,n),u&&x(u,i))}return{clip:t,el:n,box:o,moving:c,...a?{cutout:a}:{},...u?{backdrop:u}:{}}})}sourceAt(e,s){const t=b(e,s),o=e.duration===void 0?1/0:e.duration-1/this.fps;return Math.max(0,Math.min(t,o))}setPlaying(e){if(this.playing=e,!e)for(const s of this.drawn)s.el.pause(),s.cutout?.sync()}draw(e,s){for(const t of this.drawn){const o=t.clip;if(!(e>=o.start&&e<o.end)){t.el.style.visibility="hidden",t.el.paused||t.el.pause(),t.cutout?.show(!1);continue}if(t.moving){const a=m(o,e);h(o,a,t.box,t.el),t.cutout&&h(o,a,t.cutout.box,t.cutout.canvas),t.backdrop&&x(t.backdrop,a)}t.el.style.visibility="visible";let i;o.cuts&&(i=0,o.cuts.forEach((a,u)=>{a.at<=e+1e-9&&(i=u)}));const c=i!==t.cut;t.cut=i,this.follow(t,t.el,e,s||c),t.cutout&&(t.cutout.show(!0),t.cutout.sync(),t.cutout.draw())}}follow(e,s,t,o){const n=e.clip,i=this.sourceAt(n,t),c=s.currentTime-i,a=b(n,t),u=a<0||n.duration!==void 0&&a>=n.duration-1/this.fps;if(!this.playing||u){s.paused||s.pause(),Math.abs(c)>$&&(s.currentTime=i);return}if(o||s.paused||Math.abs(c)>M*n.speed){s.currentTime=i,s.playbackRate=n.speed,e.steering=void 0,s.paused&&s.play().catch(()=>{});return}const d=c<0?1:-1;Math.abs(c)>A?e.steering=d:Math.abs(c)<=F&&(e.steering=void 0),s.playbackRate=n.speed*(e.steering===void 0?1:1+e.steering*T)}dispose(){for(const e of this.drawn)e.cutout?.dispose(),e.el.pause(),e.el.removeAttribute("src"),e.el.load()}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{decodeKey as J,decodings as Le,MASTER_DEFAULTS as Ne,previewMaster as Oe,renderMix as Be}from"@allyhub/audio";import{mixPlan as De,partOnScreen as Ue,subtitleCues as Ie}from"@allyhub/video-core";import{realNow as R,realRaf as Me,realTimeout as Ke}from"@allyhub/image-draw/guards";export const RESUME_WAIT_MS=400;const le=r=>`${String(Math.floor(r/60))}:${String(Math.floor(r%60)).padStart(2,"0")}`;export async function startPlayer(r){const{output:k,stage:d}=r,s=k.timeline,f=s.fps,B=s.duration,M=B-1/f,a=new AudioContext,Q=r.media??{},Se=r.seed??"",V=De(s,Q,{seed:Se}),Y=async e=>{if(e)try{const t=await fetch(e);return t.ok?await a.decodeAudioData(await t.arrayBuffer()):void 0}catch{return}},$e=(e,t)=>{const n=Q[e]?.denoisedUrl,i=[...t.denoise?[`db=${t.denoise.toFixed(2)}`]:[],...t.speed===void 0?[]:[`speed=${t.speed.toFixed(6)}`],...t.filter===void 0?[]:[`filter=${encodeURIComponent(t.filter)}`]];return n===void 0||i.length===0?void 0:`${n}?${i.join("&")}`},ee=new Map,D=new Map,te=[],ce=Le(V);for(const{file:e,how:t}of ce){const n=$e(e,t);if(n){const i=await Y(`${n}&wait=0`);i?D.set(J(e,t),i):te.push({key:J(e,t),url:n})}}for(const{file:e,how:t}of ce)ee.has(e)||D.has(J(e,t))||ee.set(e,await Y(Q[e]?.url));const de=e=>{const t=e.getChannelData(0);return[t,e.numberOfChannels>1?e.getChannelData(1):t]},Ae=(e,t)=>{const n=D.get(J(e,t));if(n)return{src:de(n),made:t};const i=ee.get(e);return i?{src:de(i),made:{}}:void 0},Ce=s.audio.master??{...Ne};let S;const ue=()=>{const e=Oe(Be(V,Ae,a.sampleRate),a.sampleRate,Ce);if(!e){S=void 0;return}const[t,n]=e,i=a.createBuffer(2,Math.max(1,t.length),a.sampleRate);i.getChannelData(0).set(t),i.getChannelData(1).set(n),S=i};ue();const $=Ie({lines:k.lines(),fps:s.fps},k.captionOptions()??void 0);let l=!1,x=Math.min(Math.max(r.start??s.parts[0]?.still??0,0),M),b=0,U=0,I=0,F=0,K=[],ne=[],A=!1,H={ctx:0,real:0};const u=()=>l?A?b+(a.currentTime-U):b+(R()-I)/1e3:x,Ee=()=>{if(!A)return;const e=R();if(a.currentTime!==H.ctx)H={ctx:a.currentTime,real:e};else if(e-H.real>300){const t=u();A=!1,b=t,I=e}},pe=r.chrome!==!1,L="#141210",C="#ece6da",Te="#a39a8b",fe='ui-monospace,"SF Mono",Menlo,monospace';document.documentElement.style.background=L,document.body.style.cssText=`margin:0;background:${L};overflow:hidden;font:13px/1 system-ui,-apple-system,"PingFang SC","Noto Sans SC",sans-serif;color:${C}`;const g=document.createElement("div");g.style.cssText=`position:fixed;left:0;right:0;top:0;bottom:${pe?"48px":"0"};overflow:hidden;cursor:pointer`,d.parentElement?.insertBefore(g,d),g.append(d),d.style.position="absolute",d.style.transformOrigin="0 0";const N=document.createElement("div");N.style.cssText=`position:fixed;left:0;right:0;bottom:0;height:48px;display:flex;align-items:center;gap:12px;padding:0 10px;background:${L};border-top:1px solid #2a2622`;const E=document.createElement("button");E.style.cssText=`width:32px;height:32px;border:0;border-radius:4px;background:${C};color:${L};cursor:pointer;display:flex;align-items:center;justify-content:center;flex:none`,E.setAttribute("aria-label","play");const c=document.createElement("input");c.type="range",c.min="0",c.max=String(Math.round(B*f)),c.step="1",c.style.cssText=`flex:1;min-width:0;accent-color:${C};cursor:pointer`;const se=document.createElement("span");se.style.cssText=`font:12px/1 ${fe};font-variant-numeric:tabular-nums;min-width:86px;text-align:right;color:${Te}`;const ge=`height:28px;padding:0 9px;border:1px solid #3a352e;border-radius:4px;background:transparent;color:${C};font:12px/1 ${fe};cursor:pointer;flex:none`,v=document.createElement("button");v.textContent="CC",v.style.cssText=ge,v.setAttribute("aria-label","captions"),v.setAttribute("aria-pressed","false");const m=document.createElement("button");m.textContent="Pages",m.style.cssText=ge,m.setAttribute("aria-label","page by page"),m.setAttribute("aria-pressed","false"),N.setAttribute("role","toolbar"),c.setAttribute("aria-label","seek"),N.append(E,c,se,m),$.length&&N.append(v),pe&&document.body.append(N);const Pe=()=>{const e=Math.min(g.clientWidth/s.width,g.clientHeight/s.height);d.style.transform=`scale(${String(e)})`,d.style.left=`${String((g.clientWidth-s.width*e)/2)}px`,d.style.top=`${String((g.clientHeight-s.height*e)/2)}px`},W=s.width,_=s.height,j=Math.min(W,_)/1080,T=document.createElement("div");T.style.cssText=`position:absolute;left:0;top:0;width:${String(W)}px;height:${String(_)}px;transform-origin:0 0;pointer-events:none`;const h=document.createElement("div");h.setAttribute("role","status"),h.setAttribute("aria-live","polite"),h.style.cssText=`position:absolute;left:50%;transform:translateX(-50%);bottom:${String((_>W?.2:.08)*_)}px;max-width:${String(W*.84)}px;padding:${String(10*j)}px ${String(22*j)}px;border-radius:${String(12*j)}px;background:rgba(0,0,0,.66);color:#fff;font:600 ${String(44*j)}px/1.3 system-ui,-apple-system,"PingFang SC","Noto Sans SC",sans-serif;text-align:center;display:none`,T.append(h),g.append(T);let w=!1;const me=e=>{const t=w?$.find(n=>e>=n.start&&e<n.end):void 0;t?(h.textContent!==t.text&&(h.textContent=t.text),h.style.display="block"):h.style.display="none"},he=()=>{Pe(),T.style.transform=d.style.transform,T.style.left=d.style.left,T.style.top=d.style.top};new ResizeObserver(he).observe(g),he();let p=k.kind==="slides"?"page":"play",o=0,y;const q=e=>Math.max(0,s.parts.findIndex(t=>e>=t.start&&e<t.end));p==="page"&&(o=q(x),m.setAttribute("aria-pressed","true"),m.textContent="Play all");let ie=-1,ye=0,xe=0;const Re=e=>Ue(s.parts,s.transitions,e,f),z=async(e,t=!1)=>{const n=Math.min(Math.floor(e*f+1e-9),Math.round(M*f));(n!==ie||t)&&(ie=n,await k.seek(n/f),c.value=String(n),c.setAttribute("aria-valuetext",le(e)),se.textContent=`${le(e)} / ${le(B)}`),me(e);const i=R();(t||i-xe>250)&&(xe=i,r.post?.({type:"time",t:e,part:Re(e),playing:l,mode:p}))},be={play:'<svg width="12" height="14" viewBox="0 0 12 14" aria-hidden="true"><path d="M1 1.2v11.6a.6.6 0 0 0 .9.5l9.6-5.8a.6.6 0 0 0 0-1L1.9.7a.6.6 0 0 0-.9.5Z" fill="currentColor"/></svg>',pause:'<svg width="12" height="14" viewBox="0 0 12 14" aria-hidden="true"><rect x="1" y="1" width="3.5" height="12" rx=".6" fill="currentColor"/><rect x="7.5" y="1" width="3.5" height="12" rx=".6" fill="currentColor"/></svg>'},ae=()=>{E.innerHTML=l?be.pause:be.play,E.setAttribute("aria-label",l?"pause":"play")},ve=()=>{for(const e of K)try{e.stop()}catch{}K=[];for(const e of ne)e.disconnect();ne=[]},Fe=e=>U+Math.max(0,e-b);function we(){if(!S||b>=S.duration)return;const e=a.createGain();e.connect(a.destination),ne.push(e);const t=a.createBufferSource();t.buffer=S,t.connect(e),K.push(t),t.start(Fe(b),b)}function P(e=u()){F++,l=!1,k.setPlaying(!1),x=Math.min(Math.max(e,0),M),ve(),ae(),z(x,!0)}async function oe(){const e=++F;if(x>=M&&(x=0),await Promise.race([a.resume().catch(()=>{}),new Promise(n=>{Ke(n,RESUME_WAIT_MS)})]),e!==F)return;b=x,U=a.currentTime+.05,I=R()+50,A=S!==void 0&&a.state==="running",!A&&$.length&&!X&&Z(!0),H={ctx:a.currentTime,real:R()},l=!0,k.setPlaying(!0),ae(),we();const t=()=>{if(ye++,!l||e!==F)return;Ee();const n=u();if(n>=M){P(M);return}if(y!==void 0&&n>=y){const i=s.parts[o]?.still??y;y=void 0,P(i);return}z(n),Me(t)};Me(t)}function G(e){const t=l;y=void 0,P(e),t&&oe()}let X=!1;function Z(e){w=e&&$.length>0,v.setAttribute("aria-pressed",String(w)),v.style.background=w?C:"transparent",v.style.color=w?L:C,me(u())}function ke(e){p=e,m.setAttribute("aria-pressed",String(e==="page")),m.textContent=e==="page"?"Play all":"Pages",y=void 0,e==="page"?O(q(u())):z(u(),!0)}function O(e){o=Math.min(Math.max(e,0),s.parts.length-1),y=void 0,P(s.parts[o]?.still??0)}function re(){if(l){y=void 0,P();return}if(p==="page"){const e=s.parts[o];e&&(x=e.start,y=e.end-1/f)}oe()}return E.addEventListener("click",e=>{e.stopPropagation(),re()}),g.addEventListener("click",re),c.addEventListener("input",()=>{G(Number(c.value)/f),p==="page"&&(o=q(Number(c.value)/f))}),v.addEventListener("click",e=>{e.stopPropagation(),X=!0,Z(!w)}),m.addEventListener("click",e=>{e.stopPropagation(),ke(p==="page"?"play":"page")}),addEventListener("keydown",e=>{if(!(e.metaKey||e.ctrlKey||e.altKey)){if(e.key===" "||e.key==="k")re();else if(e.key==="ArrowRight")p==="page"?O(o+1):G(u()+5);else if(e.key==="ArrowLeft")p==="page"?O(o-1):G(u()-5);else if(e.key==="c"&&$.length)X=!0,Z(!w);else if(e.key==="f")document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(()=>{});else return;e.preventDefault()}}),ae(),await z(x,!0),r.post?.({type:"ready",duration:B,parts:s.parts}),te.length>0&&(r.post?.({type:"sound",denoising:!0}),Promise.all(te.map(async({key:e,url:t})=>{const n=await Y(t);if(!n||(D.set(e,n),ue(),!l))return;const i=u();ve(),b=i,U=a.currentTime,I=R(),we()})).then(()=>{r.post?.({type:"sound",denoising:!1})})),{command(e){if(e.type==="play"){if(!l){if(p==="page"){const t=s.parts[o];t&&(y=t.end-1/f)}oe()}}else e.type==="pause"?P():e.type==="seek"&&Number.isFinite(e.t)?(G(e.t),p==="page"&&(o=q(e.t))):e.type==="mode"?ke(e.mode):e.type==="next"?O(o+1):e.type==="prev"?O(o-1):e.type==="captions"&&(X=!0,Z(e.on))},now:u,state:()=>({playing:l,audioClock:A,audio:a.state,t:u(),frame:ie,ticks:ye,generation:F,sounds:K.length,sfx:V.sfx.length,mode:p,page:o,captions:w,caption:h.style.display==="none"?"":h.textContent,cues:$.length})}}
2
+ import{decodeKey as J,decodings as Le,MASTER_DEFAULTS as Oe,previewMaster as Be,renderMix as De}from"@allyhub/audio";import{mixPlan as Ue,partOnScreen as Ie,subtitleCues as Ke}from"@allyhub/video-core";import{realNow as F,realRaf as Se,realTimeout as He}from"@allyhub/image-draw/guards";export const RESUME_WAIT_MS=400;const ce=r=>`${String(Math.floor(r/60))}:${String(Math.floor(r%60)).padStart(2,"0")}`;export async function startPlayer(r){const{output:M,stage:d}=r,s=M.timeline,f=s.fps,B=s.duration,k=B-1/f,a=new AudioContext,Q=a.createGain();Q.connect(a.destination);const V=r.media??{},$e=r.seed??"",Y=Ue(s,V,{seed:$e}),ee=async e=>{if(e)try{const t=await fetch(e);return t.ok?await a.decodeAudioData(await t.arrayBuffer()):void 0}catch{return}},Ae=(e,t)=>{const n=V[e]?.denoisedUrl,i=[...t.denoise?[`db=${t.denoise.toFixed(2)}`]:[],...t.speed===void 0?[]:[`speed=${t.speed.toFixed(6)}`],...t.filter===void 0?[]:[`filter=${encodeURIComponent(t.filter)}`]];return n===void 0||i.length===0?void 0:`${n}?${i.join("&")}`},te=new Map,D=new Map,ne=[],de=Le(Y);for(const{file:e,how:t}of de){const n=Ae(e,t);if(n){const i=await ee(`${n}&wait=0`);i?D.set(J(e,t),i):ne.push({key:J(e,t),url:n})}}for(const{file:e,how:t}of de)te.has(e)||D.has(J(e,t))||te.set(e,await ee(V[e]?.url));const ue=e=>{const t=e.getChannelData(0);return[t,e.numberOfChannels>1?e.getChannelData(1):t]},Ce=(e,t)=>{const n=D.get(J(e,t));if(n)return{src:ue(n),made:t};const i=te.get(e);return i?{src:ue(i),made:{}}:void 0},Ee=s.audio.master??{...Oe};let S;const pe=()=>{const e=Be(De(Y,Ce,a.sampleRate),a.sampleRate,Ee);if(!e){S=void 0;return}const[t,n]=e,i=a.createBuffer(2,Math.max(1,t.length),a.sampleRate);i.getChannelData(0).set(t),i.getChannelData(1).set(n),S=i};pe();const $=Ke({lines:M.lines(),fps:s.fps},M.captionOptions()??void 0);let l=!1,x=Math.min(Math.max(r.start??s.parts[0]?.still??0,0),k),b=0,U=0,I=0,N=0,K=[],se=[],A=!1,H={ctx:0,real:0};const u=()=>l?A?b+(a.currentTime-U):b+(F()-I)/1e3:x,Te=()=>{if(!A)return;const e=F();if(a.currentTime!==H.ctx)H={ctx:a.currentTime,real:e};else if(e-H.real>300){const t=u();A=!1,b=t,I=e}},fe=r.chrome!==!1,R="#141210",C="#ece6da",Pe="#a39a8b",ge='ui-monospace,"SF Mono",Menlo,monospace';document.documentElement.style.background=R,document.body.style.cssText=`margin:0;background:${R};overflow:hidden;font:13px/1 system-ui,-apple-system,"PingFang SC","Noto Sans SC",sans-serif;color:${C}`;const g=document.createElement("div");g.style.cssText=`position:fixed;left:0;right:0;top:0;bottom:${fe?"48px":"0"};overflow:hidden;cursor:pointer;font:initial;color:initial`,d.parentElement?.insertBefore(g,d),g.append(d),d.style.position="absolute",d.style.transformOrigin="0 0";const L=document.createElement("div");L.style.cssText=`position:fixed;left:0;right:0;bottom:0;height:48px;display:flex;align-items:center;gap:12px;padding:0 10px;background:${R};border-top:1px solid #2a2622`;const E=document.createElement("button");E.style.cssText=`width:32px;height:32px;border:0;border-radius:4px;background:${C};color:${R};cursor:pointer;display:flex;align-items:center;justify-content:center;flex:none`,E.setAttribute("aria-label","play");const c=document.createElement("input");c.type="range",c.min="0",c.max=String(Math.round(B*f)),c.step="1",c.style.cssText=`flex:1;min-width:0;accent-color:${C};cursor:pointer`;const ie=document.createElement("span");ie.style.cssText=`font:12px/1 ${ge};font-variant-numeric:tabular-nums;min-width:86px;text-align:right;color:${Pe}`;const me=`height:28px;padding:0 9px;border:1px solid #3a352e;border-radius:4px;background:transparent;color:${C};font:12px/1 ${ge};cursor:pointer;flex:none`,v=document.createElement("button");v.textContent="CC",v.style.cssText=me,v.setAttribute("aria-label","captions"),v.setAttribute("aria-pressed","false");const m=document.createElement("button");m.textContent="Pages",m.style.cssText=me,m.setAttribute("aria-label","page by page"),m.setAttribute("aria-pressed","false"),L.setAttribute("role","toolbar"),c.setAttribute("aria-label","seek"),L.append(E,c,ie,m),$.length&&L.append(v),fe&&document.body.append(L);const Fe=()=>{const e=Math.min(g.clientWidth/s.width,g.clientHeight/s.height);d.style.transform=`scale(${String(e)})`,d.style.left=`${String((g.clientWidth-s.width*e)/2)}px`,d.style.top=`${String((g.clientHeight-s.height*e)/2)}px`},W=s.width,_=s.height,j=Math.min(W,_)/1080,T=document.createElement("div");T.style.cssText=`position:absolute;left:0;top:0;width:${String(W)}px;height:${String(_)}px;transform-origin:0 0;pointer-events:none`;const h=document.createElement("div");h.setAttribute("role","status"),h.setAttribute("aria-live","polite"),h.style.cssText=`position:absolute;left:50%;transform:translateX(-50%);bottom:${String((_>W?.2:.08)*_)}px;max-width:${String(W*.84)}px;padding:${String(10*j)}px ${String(22*j)}px;border-radius:${String(12*j)}px;background:rgba(0,0,0,.66);color:#fff;font:600 ${String(44*j)}px/1.3 system-ui,-apple-system,"PingFang SC","Noto Sans SC",sans-serif;text-align:center;display:none`,T.append(h),g.append(T);let w=!1;const he=e=>{const t=w?$.find(n=>e>=n.start&&e<n.end):void 0;t?(h.textContent!==t.text&&(h.textContent=t.text),h.style.display="block"):h.style.display="none"},ye=()=>{Fe(),T.style.transform=d.style.transform,T.style.left=d.style.left,T.style.top=d.style.top};new ResizeObserver(ye).observe(g),ye();let p=M.kind==="slides"?"page":"play",o=0,y;const q=e=>Math.max(0,s.parts.findIndex(t=>e>=t.start&&e<t.end));p==="page"&&(o=q(x),m.setAttribute("aria-pressed","true"),m.textContent="Play all");let ae=-1,xe=0,be=0;const Ne=e=>Ie(s.parts,s.transitions,e,f),G=async(e,t=!1)=>{const n=Math.min(Math.floor(e*f+1e-9),Math.round(k*f));(n!==ae||t)&&(ae=n,await M.seek(n/f),c.value=String(n),c.setAttribute("aria-valuetext",ce(e)),ie.textContent=`${ce(e)} / ${ce(B)}`),he(e);const i=F();(t||i-be>250)&&(be=i,r.post?.({type:"time",t:e,part:Ne(e),playing:l,mode:p}))},ve={play:'<svg width="12" height="14" viewBox="0 0 12 14" aria-hidden="true"><path d="M1 1.2v11.6a.6.6 0 0 0 .9.5l9.6-5.8a.6.6 0 0 0 0-1L1.9.7a.6.6 0 0 0-.9.5Z" fill="currentColor"/></svg>',pause:'<svg width="12" height="14" viewBox="0 0 12 14" aria-hidden="true"><rect x="1" y="1" width="3.5" height="12" rx=".6" fill="currentColor"/><rect x="7.5" y="1" width="3.5" height="12" rx=".6" fill="currentColor"/></svg>'},oe=()=>{E.innerHTML=l?ve.pause:ve.play,E.setAttribute("aria-label",l?"pause":"play")},we=()=>{for(const e of K)try{e.stop()}catch{}K=[];for(const e of se)e.disconnect();se=[]},Re=e=>U+Math.max(0,e-b);function Me(){if(!S||b>=S.duration)return;const e=a.createGain();e.connect(Q),se.push(e);const t=a.createBufferSource();t.buffer=S,t.connect(e),K.push(t),t.start(Re(b),b)}function P(e=u()){N++,l=!1,M.setPlaying(!1),x=Math.min(Math.max(e,0),k),we(),oe(),G(x,!0)}async function re(){const e=++N;if(x>=k&&(x=0),await Promise.race([a.resume().catch(()=>{}),new Promise(n=>{He(n,RESUME_WAIT_MS)})]),e!==N)return;b=x,U=a.currentTime+.05,I=F()+50,A=S!==void 0&&a.state==="running",!A&&$.length&&!X&&Z(!0),H={ctx:a.currentTime,real:F()},l=!0,M.setPlaying(!0),oe(),Me();const t=()=>{if(xe++,!l||e!==N)return;Te();const n=u();if(n>=k){P(k);return}if(y!==void 0&&n>=y){const i=s.parts[o]?.still??y;y=void 0,P(i);return}G(n),Se(t)};Se(t)}function z(e){const t=l;y=void 0,P(e),t&&re()}let X=!1;function Z(e){w=e&&$.length>0,v.setAttribute("aria-pressed",String(w)),v.style.background=w?C:"transparent",v.style.color=w?R:C,he(u())}function ke(e){p=e,m.setAttribute("aria-pressed",String(e==="page")),m.textContent=e==="page"?"Play all":"Pages",y=void 0,e==="page"?O(q(u())):G(u(),!0)}function O(e){o=Math.min(Math.max(e,0),s.parts.length-1),y=void 0,P(s.parts[o]?.still??0)}function le(){if(l){y=void 0,P();return}if(p==="page"){const e=s.parts[o];e&&(x=e.start,y=e.end-1/f)}re()}return E.addEventListener("click",e=>{e.stopPropagation(),le()}),g.addEventListener("click",le),c.addEventListener("input",()=>{z(Number(c.value)/f),p==="page"&&(o=q(Number(c.value)/f))}),v.addEventListener("click",e=>{e.stopPropagation(),X=!0,Z(!w)}),m.addEventListener("click",e=>{e.stopPropagation(),ke(p==="page"?"play":"page")}),addEventListener("keydown",e=>{if(!(e.metaKey||e.ctrlKey||e.altKey)){if(e.key===" "||e.key==="k")le();else if(e.key==="ArrowRight")p==="page"?O(o+1):z(u()+5);else if(e.key==="ArrowLeft")p==="page"?O(o-1):z(u()-5);else if(e.key==="c"&&$.length)X=!0,Z(!w);else if(e.key==="f")document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(()=>{});else return;e.preventDefault()}}),oe(),await G(x,!0),r.post?.({type:"ready",duration:B,parts:s.parts}),ne.length>0&&(r.post?.({type:"sound",denoising:!0}),Promise.all(ne.map(async({key:e,url:t})=>{const n=await ee(t);if(!n||(D.set(e,n),pe(),!l))return;const i=u();we(),b=i,U=a.currentTime,I=F(),Me()})).then(()=>{r.post?.({type:"sound",denoising:!1})})),{command(e){if(e.type==="play"){if(!l){if(p==="page"){const t=s.parts[o];t&&(y=t.end-1/f)}re()}}else e.type==="pause"?P():e.type==="seek"&&Number.isFinite(e.t)?(z(e.t),p==="page"&&(o=q(e.t))):e.type==="mode"?ke(e.mode):e.type==="next"?O(o+1):e.type==="prev"?O(o-1):e.type==="captions"?(X=!0,Z(e.on)):e.type==="volume"&&Number.isFinite(e.level)&&(Q.gain.value=Math.min(1,Math.max(0,e.level)))},now:u,state:()=>({playing:l,audioClock:A,audio:a.state,t:u(),frame:ae,ticks:xe,generation:N,sounds:K.length,sfx:Y.sfx.length,mode:p,page:o,captions:w,caption:h.style.display==="none"?"":h.textContent,cues:$.length})}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/runtime",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/runtimes",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/scaffold",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -11,9 +11,9 @@ export { AUTO_EXPOSURE_DEFAULTS, AUTOFOCUS_DEFAULTS, handheld, HANDHELD_DEFAULTS
11
11
  export { bandNoise, gauss3, hash3, powerNoise, swellOf, unit3, type Band, type Slope, } from "./noise.js";
12
12
  export { convexHull, floorRect, type Floor, type FloorRect } from "./hull.js";
13
13
  export { solveCamera, SOLVE_DEFAULTS, SOLVE_PARAMS, type SolveLine, type SolveOptions, type SolveParam, type SolvePoint, type SolveResidual, type SolveResult, } from "./solve.js";
14
- export { invert3, moireAt, moireBand, moireCamera, moireProblems, moireScreen, MOIRE_GLSL, MOIRE_SCREENS, PANEL_DEFAULTS, SENSOR_DEFAULTS, STRIPE_DEPTH, type MoireCamera, type MoireScreen, type PanelOptions, type SensorOptions, } from "./moire.js";
14
+ export { invert3, moireAt, moireBand, moireCamera, moireProblems, screenGradeWeight, moireScreen, MOIRE_GLSL, MOIRE_SCREENS, PANEL_DEFAULTS, SENSOR_DEFAULTS, STRIPE_DEPTH, type MoireCamera, type MoireScreen, type PanelOptions, type Grade, type SensorGrade, type SensorOptions, } from "./moire.js";
15
15
  export { screenFocus, SCREEN_FOCUS_DEFAULTS, type ScreenFocus, type ScreenFocusOptions, } from "./screen-focus.js";
16
- export { apply, homography, matrix3d, screenOnFrame, shownCentre, SCREEN_LIGHT_DEFAULTS, screenLightBaseProblem, type Px, type ScreenLightBase, type ScreenOnFrame, } from "./screen.js";
16
+ export { apply, homography, matrix3d, clipToFrame, screenOnFrame, shownCentre, SCREEN_LIGHT_DEFAULTS, screenLightBaseProblem, type Px, type ScreenLightBase, type ScreenOnFrame, } from "./screen.js";
17
17
  export { AROUND_DEFAULTS, FLOOR_DEFAULTS, INVENTORY_FRAME, MAP_DEFAULTS, MAP_VIEWS, MEASURE_DEFAULTS, MOTION_DEFAULTS, SIDES, type AxisBox, type CameraClearance, type CameraSource, type Channel, type ClearAhead, type Contact, type FreeFloor, type Levels, type MeasureRequest, type MeasureResult, type MeshHealth, type Motion, type MotionRequest, type SeeRequest, type SeeResult, type SeeTile, type Sight, type Support, type DrawnCamera, type Footprint, type MapPath, type MapRequest, type MapResult, type MapView, type MapViewResult, type OwnBox, type PointRef, type PointsRequest, type Seen, type Side, type UprightBox, type ViewRequest, type ViewResult, type ViewTile, type ViewTileResult, type SceneryInventory, type SceneryLight, type SceneryObject, topObjects, } from "./report.js";
18
18
  export { channel, motionOf, type CameraSample, type MotionNumbers, } from "./motion.js";
19
19
  export { easeValue, timedNumber, type Ease, type NumberKey } from "./timing.js";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{blurDiameter,CAMERA_DEFAULTS,CameraError,cameraProblems,directionOf,exposureOf,project,resolveCamera,yawPitchOf}from"./camera.js";export{BAKE_CPU,BAKE_DEFAULTS,BAKE_MIN_SIZE,bakeProblems,bakeRenderer,resolveBake}from"./bake.js";export{Curve,SAME_POINT}from"./curve.js";export{defineScenery,isScenery,SCENERY_RENDERER_DEFAULTS}from"./define.js";export{FIT_DEFAULTS,fitCamera}from"./fit.js";export{diagonalLens,fieldOfView,fieldOfViewFromVertical,FULL_FRAME_DIAGONAL,lensForVertical,lensFrameProblem}from"./lens.js";export{blend,cutsOf,focusScreen,keys,mixCameras,momentOf,orbit,path,PATH_DEFAULTS,pathCurve,shots,stateOf,withCuts,NeedsTimeError}from"./move.js";export{GLASS_DEFAULTS,glassIor,glassProblems}from"./glass.js";export{aimAt,aimed,AIM_DEFAULTS,aimProblem,aimShape,rise}from"./aim.js";export{AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,handheld,HANDHELD_DEFAULTS,handheldProblem,STABILIZER_DEFAULTS}from"./handheld.js";export{bandNoise,gauss3,hash3,powerNoise,swellOf,unit3}from"./noise.js";export{convexHull,floorRect}from"./hull.js";export{solveCamera,SOLVE_DEFAULTS,SOLVE_PARAMS}from"./solve.js";export{invert3,moireAt,moireBand,moireCamera,moireProblems,moireScreen,MOIRE_GLSL,MOIRE_SCREENS,PANEL_DEFAULTS,SENSOR_DEFAULTS,STRIPE_DEPTH}from"./moire.js";export{screenFocus,SCREEN_FOCUS_DEFAULTS}from"./screen-focus.js";export{apply,homography,matrix3d,screenOnFrame,shownCentre,SCREEN_LIGHT_DEFAULTS,screenLightBaseProblem}from"./screen.js";export{AROUND_DEFAULTS,FLOOR_DEFAULTS,INVENTORY_FRAME,MAP_DEFAULTS,MAP_VIEWS,MEASURE_DEFAULTS,MOTION_DEFAULTS,SIDES,topObjects}from"./report.js";export{channel,motionOf}from"./motion.js";export{easeValue,timedNumber}from"./timing.js";export{PHONE_CAMERA,phoneCamera}from"./phone.js";
2
+ export{blurDiameter,CAMERA_DEFAULTS,CameraError,cameraProblems,directionOf,exposureOf,project,resolveCamera,yawPitchOf}from"./camera.js";export{BAKE_CPU,BAKE_DEFAULTS,BAKE_MIN_SIZE,bakeProblems,bakeRenderer,resolveBake}from"./bake.js";export{Curve,SAME_POINT}from"./curve.js";export{defineScenery,isScenery,SCENERY_RENDERER_DEFAULTS}from"./define.js";export{FIT_DEFAULTS,fitCamera}from"./fit.js";export{diagonalLens,fieldOfView,fieldOfViewFromVertical,FULL_FRAME_DIAGONAL,lensForVertical,lensFrameProblem}from"./lens.js";export{blend,cutsOf,focusScreen,keys,mixCameras,momentOf,orbit,path,PATH_DEFAULTS,pathCurve,shots,stateOf,withCuts,NeedsTimeError}from"./move.js";export{GLASS_DEFAULTS,glassIor,glassProblems}from"./glass.js";export{aimAt,aimed,AIM_DEFAULTS,aimProblem,aimShape,rise}from"./aim.js";export{AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,handheld,HANDHELD_DEFAULTS,handheldProblem,STABILIZER_DEFAULTS}from"./handheld.js";export{bandNoise,gauss3,hash3,powerNoise,swellOf,unit3}from"./noise.js";export{convexHull,floorRect}from"./hull.js";export{solveCamera,SOLVE_DEFAULTS,SOLVE_PARAMS}from"./solve.js";export{invert3,moireAt,moireBand,moireCamera,moireProblems,screenGradeWeight,moireScreen,MOIRE_GLSL,MOIRE_SCREENS,PANEL_DEFAULTS,SENSOR_DEFAULTS,STRIPE_DEPTH}from"./moire.js";export{screenFocus,SCREEN_FOCUS_DEFAULTS}from"./screen-focus.js";export{apply,homography,matrix3d,clipToFrame,screenOnFrame,shownCentre,SCREEN_LIGHT_DEFAULTS,screenLightBaseProblem}from"./screen.js";export{AROUND_DEFAULTS,FLOOR_DEFAULTS,INVENTORY_FRAME,MAP_DEFAULTS,MAP_VIEWS,MEASURE_DEFAULTS,MOTION_DEFAULTS,SIDES,topObjects}from"./report.js";export{channel,motionOf}from"./motion.js";export{easeValue,timedNumber}from"./timing.js";export{PHONE_CAMERA,phoneCamera}from"./phone.js";
@@ -22,19 +22,58 @@ export interface SensorOptions {
22
22
  */
23
23
  distortion?: number;
24
24
  /**
25
- * How the phone grades what it films: the part's `post` wherever a part
26
- * sets none. null for no grade.
25
+ * How the phone grades what it films, by what fills its frame: the room's
26
+ * grade, and as a screen comes to fill the frame, the grade it gives a lit
27
+ * screen (it exposes for the screen's light), eased between them frame by
28
+ * frame. On the scenery layer's picture alone, not on what is laid over
29
+ * it. null for no grade.
27
30
  */
28
- grade?: {
29
- filter: string;
30
- } | null;
31
+ grade?: SensorGrade | null;
31
32
  }
33
+ /**
34
+ * A grade: the picture's brightness through a curve, every colour moved
35
+ * with it so hues stay (a grade of luma alone), then the colours' strength,
36
+ * a turn of their hue, and a white balance.
37
+ */
38
+ export interface Grade {
39
+ /** [brightness in, brightness out] points, 0–1, from in 0 to in 1 in order, joined by straight lines. */
40
+ curve: [number, number][];
41
+ /** How strong the colours are after it (1: as they were; 0: grey). */
42
+ saturation?: number;
43
+ /** The colours' hue turned this many degrees. */
44
+ hue?: number;
45
+ /** Each channel's gain last, red, green and blue (a white balance; [1, 1, 1] none). */
46
+ balance?: [number, number, number];
47
+ }
48
+ /** How a phone grades what it films, by how much of its frame a screen fills (SensorOptions.grade). */
49
+ export interface SensorGrade {
50
+ /** What it films when no screen fills much of the frame: the room, a person. */
51
+ room: Grade;
52
+ /** A lit screen filmed close: the phone exposes for its light. */
53
+ screen: Grade;
54
+ /**
55
+ * The nearest screen's share of the frame where the room's grade starts
56
+ * to give way to the screen's, and where the screen's is whole (0–1).
57
+ */
58
+ share: [number, number];
59
+ }
60
+ /** How much of the screen's grade a frame takes (0–1): eased between share[0] and share[1] of the frame filled. */
61
+ export declare function screenGradeWeight(share: number, [from, to]: readonly [number, number]): number;
32
62
  /** A screen's physical pixels (screen({ pixels })). */
33
63
  export interface PanelOptions {
34
64
  /** Physical pixels per content pixel each way (a Retina laptop: 2). */
35
65
  density?: number;
36
66
  /** How much the dark lines between rows of pixels darken them (0–1). */
37
67
  rows?: number;
68
+ /**
69
+ * The pixel mesh a phone's camera close to a screen shows (0–1, 0: none):
70
+ * a fine grid of faint dark lines, every three of the panel's pixels,
71
+ * drawn on the screen's picture. At a video's resolution the panel's own
72
+ * pixels are too fine to resolve (the moiré above is what is left of
73
+ * them), yet phone footage of a screen close up is never clean: this is
74
+ * that texture, as phone photos of a laptop's screen show it.
75
+ */
76
+ mesh?: number;
38
77
  }
39
78
  export declare const SENSOR_DEFAULTS: {
40
79
  photosites: number;
@@ -46,6 +85,7 @@ export declare const SENSOR_DEFAULTS: {
46
85
  export declare const PANEL_DEFAULTS: {
47
86
  density: number;
48
87
  rows: number;
88
+ mesh: number;
49
89
  };
50
90
  /**
51
91
  * The depth a stripe a third of a pixel wide gives its fundamental,
@@ -1,5 +1,5 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{blurDiameter as z}from"./camera.js";import{homography as C}from"./screen.js";export const SENSOR_DEFAULTS={photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03},PANEL_DEFAULTS={density:2,rows:.15},STRIPE_DEPTH=2*Math.sin(Math.PI/3)/(Math.PI/3)/2;const g=2*Math.PI,P=o=>Math.abs(o)<1e-6?1:Math.sin(Math.PI*o)/(Math.PI*o);function R(o,n){if(n===1){const i=Math.round(o[0]+o[1]),t=Math.round(o[0]-o[1]);return[(i+t)/2,(i-t)/2]}return[Math.round(2*o[0])/2,Math.round(2*o[1])/2]}const T={0:[0,0],1:[1,0],2:[1,1]};function D(o,n,i,t,f,s,e){return E(o,n,i,t,f,s,e).factor}function E(o,n,i,t,f,s,e){const r=s.pitch,c=[i[0]*r,i[1]*r],d=F(t,s),h=[d[0]/r,d[1]/r],u=R(c,o),p=T[o],a=[(c[0]-u[0])/r,(c[1]-u[1])/r],m=Math.hypot(a[0],a[1]);if(m>=.5)return{factor:1,depth:0,period:1/0};const w=c[0]*c[0]+c[1]*c[1],S=Math.exp(-2*Math.PI**2*s.lens**2*w),x=e/4,b=Math.exp(-2*Math.PI**2*x**2*(i[0]*i[0]+i[1]*i[1])),y=Math.abs(P(c[0])*P(c[1])),M=Math.abs(P(a[0])*P(a[1]))*(1-2*m),l=Math.min(1,s.strength*f*S*b*y*M),v=n-g*(u[0]*h[0]+u[1]*h[1])+g*(u[0]*p[0]+u[1]*p[1]);return{factor:1-l*(1-Math.cos(v))/2,depth:l,period:m>0?1/m:1/0}}function F(o,n){const{k1:i,centre:t,radius:f}=n.distortion,s=o[0]-t[0],e=o[1]-t[1],r=(s*s+e*e)/(f*f),c=1+i*r;return[t[0]+s*c,t[1]+e*c]}const I=[.299,.587,.114];export function moireAt(o,n,i){const t=o.inverse,[f,s]=i,e=(t[6]??0)*f+(t[7]??0)*s+(t[8]??1);if(e<=0)return;const r=((t[0]??0)*f+(t[1]??0)*s+(t[2]??0))/e,c=((t[3]??0)*f+(t[4]??0)*s+(t[5]??0))/e,[d,h]=o.size;if(r<0||c<0||r>d||c>h)return;const u=[((t[0]??0)-(t[6]??0)*r)/e,((t[1]??0)-(t[7]??0)*r)/e],p=[((t[3]??0)-(t[6]??0)*c)/e,((t[4]??0)-(t[7]??0)*c)/e],a=o.density,[m,w,S]=o.depth,x=m+w*r+S*c,b=n.blur?n.blur.k*Math.abs(x-n.blur.focus)/Math.max(x,n.blur.near):0,y=[a*u[0],a*u[1]],M=[a*p[0],a*p[1]],l=[1,1,1];for(const k of[0,1,2]){const A=D(k,g*(a*r-k/3),y,i,STRIPE_DEPTH,n,b),N=D(k,g*a*c,M,i,o.rows*STRIPE_DEPTH,n,b);l[k]=A*N}const v=I[0]*l[0]+I[1]*l[1]+I[2]*l[2];return[v+n.chroma*(l[0]-v),v+n.chroma*(l[1]-v),v+n.chroma*(l[2]-v)]}export function moireBand(o,n,i){const t=o.inverse,[f,s]=i,e=(t[6]??0)*f+(t[7]??0)*s+(t[8]??1);if(e<=0)return;const r=((t[0]??0)*f+(t[1]??0)*s+(t[2]??0))/e,c=((t[3]??0)*f+(t[4]??0)*s+(t[5]??0))/e,[d,h]=o.size;if(r<0||c<0||r>d||c>h)return;const u=[((t[0]??0)-(t[6]??0)*r)/e,((t[1]??0)-(t[7]??0)*r)/e],p=[((t[3]??0)-(t[6]??0)*c)/e,((t[4]??0)-(t[7]??0)*c)/e],a=o.density,[m,w,S]=o.depth,x=m+w*r+S*c,b=n.blur?n.blur.k*Math.abs(x-n.blur.focus)/Math.max(x,n.blur.near):0;let y={depth:0,period:1/0};for(const M of[0,1,2])for(const l of[E(M,g*(a*r-M/3),[a*u[0],a*u[1]],i,STRIPE_DEPTH,n,b),E(M,g*a*c,[a*p[0],a*p[1]],i,o.rows*STRIPE_DEPTH,n,b)])l.depth>y.depth&&(y={depth:l.depth,period:l.period});return y}export const MOIRE_SCREENS=4,MOIRE_GLSL=`#version 300 es
2
+ import{blurDiameter as $}from"./camera.js";import{homography as z}from"./screen.js";export function screenGradeWeight(o,[e,s]){if(o<=e)return 0;if(o>=s)return 1;const t=(o-e)/(s-e);return t*t*(3-2*t)}function I(o,e){if(!o)return[`${e} is missing.`];const s=[],t=o.curve,u=n=>Number.isFinite(n)&&n>=0&&n<=1;(!Array.isArray(t)||t.length<2||t.some(n=>!u(n[0])||!u(n[1]))||t.some((n,i)=>i>0&&n[0]<=(t[i-1]?.[0]??-1))||t[0]?.[0]!==0||t[t.length-1]?.[0]!==1)&&s.push(`${e}.curve is [in, out] points from 0 to 1, in order, from in 0 to in 1.`),o.saturation!==void 0&&!(Number.isFinite(o.saturation)&&o.saturation>=0)&&s.push(`${e}.saturation is 0 or more, not ${String(o.saturation)}.`);const r=o.balance;return r!==void 0&&!(Array.isArray(r)&&r.length===3&&r.every(n=>Number.isFinite(n)&&n>=0&&n<=2))&&s.push(`${e}.balance is three gains from 0 to 2, red, green and blue.`),o.hue!==void 0&&!Number.isFinite(o.hue)&&s.push(`${e}.hue is a number of degrees, not ${String(o.hue)}.`),s}export const SENSOR_DEFAULTS={photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03},PANEL_DEFAULTS={density:2,rows:.15,mesh:.09},STRIPE_DEPTH=2*Math.sin(Math.PI/3)/(Math.PI/3)/2;const M=2*Math.PI,P=o=>Math.abs(o)<1e-6?1:Math.sin(Math.PI*o)/(Math.PI*o);function C(o,e){if(e===1){const s=Math.round(o[0]+o[1]),t=Math.round(o[0]-o[1]);return[(s+t)/2,(s-t)/2]}return[Math.round(2*o[0])/2,Math.round(2*o[1])/2]}const R={0:[0,0],1:[1,0],2:[1,1]};function A(o,e,s,t,u,r,n){return N(o,e,s,t,u,r,n).factor}function N(o,e,s,t,u,r,n){const i=r.pitch,c=[s[0]*i,s[1]*i],d=T(t,r),l=[d[0]/i,d[1]/i],f=C(c,o),p=R[o],a=[(c[0]-f[0])/i,(c[1]-f[1])/i],m=Math.hypot(a[0],a[1]);if(m>=.5)return{factor:1,depth:0,period:1/0};const S=c[0]*c[0]+c[1]*c[1],k=Math.exp(-2*Math.PI**2*r.lens**2*S),v=n/4,x=Math.exp(-2*Math.PI**2*v**2*(s[0]*s[0]+s[1]*s[1])),y=Math.abs(P(c[0])*P(c[1])),g=Math.abs(P(a[0])*P(a[1]))*(1-2*m),h=Math.min(1,r.strength*u*k*x*y*g),b=e-M*(f[0]*l[0]+f[1]*l[1])+M*(f[0]*p[0]+f[1]*p[1]);return{factor:1-h*(1-Math.cos(b))/2,depth:h,period:m>0?1/m:1/0}}function T(o,e){const{k1:s,centre:t,radius:u}=e.distortion,r=o[0]-t[0],n=o[1]-t[1],i=(r*r+n*n)/(u*u),c=1+s*i;return[t[0]+r*c,t[1]+n*c]}const E=[.299,.587,.114];export function moireAt(o,e,s){const t=o.inverse,[u,r]=s,n=(t[6]??0)*u+(t[7]??0)*r+(t[8]??1);if(n<=0)return;const i=((t[0]??0)*u+(t[1]??0)*r+(t[2]??0))/n,c=((t[3]??0)*u+(t[4]??0)*r+(t[5]??0))/n,[d,l]=o.size;if(i<0||c<0||i>d||c>l)return;const f=[((t[0]??0)-(t[6]??0)*i)/n,((t[1]??0)-(t[7]??0)*i)/n],p=[((t[3]??0)-(t[6]??0)*c)/n,((t[4]??0)-(t[7]??0)*c)/n],a=o.density,[m,S,k]=o.depth,v=m+S*i+k*c,x=e.blur?e.blur.k*Math.abs(v-e.blur.focus)/Math.max(v,e.blur.near):0,y=[a*f[0],a*f[1]],g=[a*p[0],a*p[1]],h=[1,1,1];for(const w of[0,1,2]){const D=A(w,M*(a*i-w/3),y,s,STRIPE_DEPTH,e,x),F=A(w,M*a*c,g,s,o.rows*STRIPE_DEPTH,e,x);h[w]=D*F}const b=E[0]*h[0]+E[1]*h[1]+E[2]*h[2];return[b+e.chroma*(h[0]-b),b+e.chroma*(h[1]-b),b+e.chroma*(h[2]-b)]}export function moireBand(o,e,s){const t=o.inverse,[u,r]=s,n=(t[6]??0)*u+(t[7]??0)*r+(t[8]??1);if(n<=0)return;const i=((t[0]??0)*u+(t[1]??0)*r+(t[2]??0))/n,c=((t[3]??0)*u+(t[4]??0)*r+(t[5]??0))/n,[d,l]=o.size;if(i<0||c<0||i>d||c>l)return;const f=[((t[0]??0)-(t[6]??0)*i)/n,((t[1]??0)-(t[7]??0)*i)/n],p=[((t[3]??0)-(t[6]??0)*c)/n,((t[4]??0)-(t[7]??0)*c)/n],a=o.density,[m,S,k]=o.depth,v=m+S*i+k*c,x=e.blur?e.blur.k*Math.abs(v-e.blur.focus)/Math.max(v,e.blur.near):0;let y={depth:0,period:1/0};for(const g of[0,1,2])for(const h of[N(g,M*(a*i-g/3),[a*f[0],a*f[1]],s,STRIPE_DEPTH,e,x),N(g,M*a*c,[a*p[0],a*p[1]],s,o.rows*STRIPE_DEPTH,e,x)])h.depth>y.depth&&(y={depth:h.depth,period:h.period});return y}export const MOIRE_SCREENS=4,MOIRE_GLSL=`#version 300 es
3
3
  precision highp float;
4
4
  #define SCREENS ${String(MOIRE_SCREENS)}
5
5
  uniform int count;
@@ -90,4 +90,4 @@ void main() {
90
90
  }
91
91
  // Off every screen: nothing (premultiplied).
92
92
  colour = on ? vec4(factor, 1.0) : vec4(0.0);
93
- }`;export function invert3(o){const[n=0,i=0,t=0,f=0,s=0,e=0,r=0,c=0,d=1]=o,h=s*d-e*c,u=-(f*d-e*r),p=f*c-s*r,a=n*h+i*u+t*p;if(!(Math.abs(a)<1e-18))return[h/a,-(i*d-t*c)/a,(i*e-t*s)/a,u/a,(n*d-t*r)/a,-(n*e-t*f)/a,p/a,-(n*c-i*r)/a,(n*s-i*f)/a]}export function moireScreen(o){const[n,i]=o.size,t=C(n,i,o.quad),f=t?invert3(t):void 0;if(!f)return;const s=o.camera,e=u=>(u[0]-s.position[0])*s.forward[0]+(u[1]-s.position[1])*s.forward[1]+(u[2]-s.position[2])*s.forward[2],[r,c,,d]=o.corners,h=e(r);return{inverse:f,size:[n,i],density:o.panel?.density??PANEL_DEFAULTS.density,rows:o.panel?.rows??PANEL_DEFAULTS.rows,depth:[h,(e(c)-h)/n,(e(d)-h)/i]}}export function moireCamera(o,n,i,t={},f=[0,0]){const s=t.photosites??SENSOR_DEFAULTS.photosites,e={pitch:Math.max(n[0],n[1])/s,lens:t.lens??SENSOR_DEFAULTS.lens,strength:t.moire??SENSOR_DEFAULTS.moire,chroma:t.chroma??SENSOR_DEFAULTS.chroma,distortion:{k1:t.distortion??SENSOR_DEFAULTS.distortion,centre:[n[0]/2-f[0],n[1]/2-f[1]],radius:Math.hypot(n[0],n[1])/2}},r=o.dof;if(r){const c=2*r.focus,d=z(o,c,i)*Math.max(c,o.near)/Math.abs(c-r.focus);e.blur={k:d,focus:r.focus,near:o.near}}return e}export function moireProblems(o,n){const i=[],t=(s,e)=>{s!==void 0&&!(Number.isFinite(s)&&s>0)&&i.push(`${e} is a positive number, not ${String(s)}.`)};t(o?.photosites,"sensor.photosites"),t(o?.lens,"sensor.lens"),t(n?.density,"pixels.density");const f=(s,e,r)=>{s!==void 0&&!(Number.isFinite(s)&&s>=0&&s<=r)&&i.push(`${e} is from 0 to ${String(r)}, not ${String(s)}.`)};return f(o?.moire,"sensor.moire",4),f(o?.chroma,"sensor.chroma",1),o?.distortion!==void 0&&!(Number.isFinite(o.distortion)&&Math.abs(o.distortion)<=.5)&&i.push(`sensor.distortion is from -0.5 to 0.5, not ${String(o.distortion)}.`),f(n?.rows,"pixels.rows",1),i}
93
+ }`;export function invert3(o){const[e=0,s=0,t=0,u=0,r=0,n=0,i=0,c=0,d=1]=o,l=r*d-n*c,f=-(u*d-n*i),p=u*c-r*i,a=e*l+s*f+t*p;if(!(Math.abs(a)<1e-18))return[l/a,-(s*d-t*c)/a,(s*n-t*r)/a,f/a,(e*d-t*i)/a,-(e*n-t*u)/a,p/a,-(e*c-s*i)/a,(e*r-s*u)/a]}export function moireScreen(o){const[e,s]=o.size,t=z(e,s,o.quad),u=t?invert3(t):void 0;if(!u)return;const r=o.camera,n=f=>(f[0]-r.position[0])*r.forward[0]+(f[1]-r.position[1])*r.forward[1]+(f[2]-r.position[2])*r.forward[2],[i,c,,d]=o.corners,l=n(i);return{inverse:u,size:[e,s],density:o.panel?.density??PANEL_DEFAULTS.density,rows:o.panel?.rows??PANEL_DEFAULTS.rows,depth:[l,(n(c)-l)/e,(n(d)-l)/s]}}export function moireCamera(o,e,s,t={},u=[0,0]){const r=t.photosites??SENSOR_DEFAULTS.photosites,n={pitch:Math.max(e[0],e[1])/r,lens:t.lens??SENSOR_DEFAULTS.lens,strength:t.moire??SENSOR_DEFAULTS.moire,chroma:t.chroma??SENSOR_DEFAULTS.chroma,distortion:{k1:t.distortion??SENSOR_DEFAULTS.distortion,centre:[e[0]/2-u[0],e[1]/2-u[1]],radius:Math.hypot(e[0],e[1])/2}},i=o.dof;if(i){const c=2*i.focus,d=$(o,c,s)*Math.max(c,o.near)/Math.abs(c-i.focus);n.blur={k:d,focus:i.focus,near:o.near}}return n}export function moireProblems(o,e){const s=[],t=(n,i)=>{n!==void 0&&!(Number.isFinite(n)&&n>0)&&s.push(`${i} is a positive number, not ${String(n)}.`)};t(o?.photosites,"sensor.photosites"),t(o?.lens,"sensor.lens"),t(e?.density,"pixels.density");const u=(n,i,c)=>{n!==void 0&&!(Number.isFinite(n)&&n>=0&&n<=c)&&s.push(`${i} is from 0 to ${String(c)}, not ${String(n)}.`)};u(o?.moire,"sensor.moire",4),u(o?.chroma,"sensor.chroma",1),o?.distortion!==void 0&&!(Number.isFinite(o.distortion)&&Math.abs(o.distortion)<=.5)&&s.push(`sensor.distortion is from -0.5 to 0.5, not ${String(o.distortion)}.`),u(e?.rows,"pixels.rows",1),u(e?.mesh,"pixels.mesh",1);const r=o?.grade;if(r){s.push(...I(r.room,"sensor.grade.room")),s.push(...I(r.screen,"sensor.grade.screen"));const[n=Number.NaN,i=Number.NaN]=r.share;Number.isFinite(n)&&Number.isFinite(i)&&n>=0&&n<i&&i<=1||s.push("sensor.grade.share is [from, to], 0 ≤ from < to ≤ 1.")}return s}
@@ -19,9 +19,10 @@ export interface PhoneCamera {
19
19
  * hand: a 26 mm lens on its 4:3 frame at f/8 equivalent (f/1.8 on its
20
20
  * small sensor), a 12 MP sensor, a hand whose tremor its stabiliser mostly
21
21
  * takes out, focus that hunts after a cut, a reframe or a jolt, exposure
22
- * that follows a new framing late, and a grade that takes a render's flat,
23
- * pale, cool picture to the contrast and colour of a phone filming a screen:
24
- * a screen's white stays near white, and what is dark goes darker.
22
+ * that follows a new framing late, and a grade by what fills the frame:
23
+ * a phone's gentle contrast and colour on a room, and as a screen comes to
24
+ * fill the frame, the phone exposing for its light (its white a neutral
25
+ * light grey, its middle tones much darker, its colours deep).
25
26
  */
26
27
  export declare const PHONE_CAMERA: PhoneCamera;
27
28
  /** Something with every field optional, all the way down. */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export const PHONE_CAMERA={lens:{lens:26,lensFrame:"phone",aperture:8},sensor:{photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03,grade:{filter:"curves=all='0/0 0.2/0.07 0.5/0.38 0.78/0.82 1/1',eq=saturation=1.5,colortemperature=temperature=6000"}},hand:{angle:.25,roll:.6,shift:.001,sway:.65,tremor:{angle:.1,frequency:8.5},drift:{angle:.15,shift:.001,period:8},stabilizer:{strength:.7,cutoff:1.5},autofocus:{},exposure:{}}};const s=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function i(e,r){if(!s(e)||!s(r))return r===void 0?e:r;const n={...e};for(const[t,o]of Object.entries(r))n[t]=o===void 0?e[t]:i(e[t],o);return n}export function phoneCamera(e={}){return i(PHONE_CAMERA,e)}
2
+ export const PHONE_CAMERA={lens:{lens:26,lensFrame:"phone",aperture:8},sensor:{photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03,grade:{room:{curve:[[0,0],[.25,.21],[.5,.47],[.75,.78],[1,1]],saturation:1.08},screen:{curve:[[0,0],[.36,.1],[.51,.16],[.67,.46],[.8,.84],[1,1]],saturation:1.25,hue:5,balance:[1,.97,1]},share:[.5,.8]}},hand:{angle:.25,roll:.6,shift:.001,sway:.65,tremor:{angle:.1,frequency:8.5},drift:{angle:.15,shift:.001,period:8},stabilizer:{strength:.7,cutoff:1.5},autofocus:{},exposure:{}}};const s=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function i(e,r){if(!s(e)||!s(r))return r===void 0?e:r;const t={...e};for(const[n,o]of Object.entries(r))t[n]=o===void 0?e[n]:i(e[n],o);return t}export function phoneCamera(e={}){return i(PHONE_CAMERA,e)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/scenery",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -0,0 +1,7 @@
1
+ import { type SensorGrade } from "@allyhub/scenery";
2
+ import type { Drawn } from "./state.js";
3
+ /** The filter: the room's grade, the screen's, or the two mixed by `weight` (the screen's share of it). */
4
+ export declare function gradeFilterMarkup(id: string, grade: SensorGrade, weight: number): string;
5
+ /** Grades the layer's picture for this frame, or takes its grade off when its sensor has none. */
6
+ export declare function gradeLayer(d: Drawn, grade: SensorGrade | null | undefined, share: number): void;
7
+ //# sourceMappingURL=grade.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{screenGradeWeight as h}from"@allyhub/scenery";const m="http://www.w3.org/2000/svg",c=32;let $=0;const s=e=>{const t=Math.round(e*1e4)/1e4;return String(Object.is(t,-0)?0:t)};function b(e,t){for(let n=1;n<e.length;n++){const[r,l]=e[n-1]??[0,0],[o,i]=e[n]??[1,1];if(t<=o)return o===r?i:l+(i-l)*(t-r)/(o-r)}return e[e.length-1]?.[1]??t}function u(e,t){const n=Array.from({length:c+1},(a,p)=>s(Math.min(1,Math.max(0,b(e.curve,p/c)-p/c+.5)))).join(" "),r="0.2126 0.7152 0.0722 0 0",[l,o,i]=e.balance??[1,1,1];return[`<feColorMatrix in="SourceGraphic" type="matrix" values="${r} ${r} ${r} 0 0 0 1 0" result="${t}-luma"/>`,`<feComponentTransfer in="${t}-luma" result="${t}-change">`,`<feFuncR type="table" tableValues="${n}"/><feFuncG type="table" tableValues="${n}"/><feFuncB type="table" tableValues="${n}"/><feFuncA type="table" tableValues="1 1"/>`,"</feComponentTransfer>",`<feComposite in="SourceGraphic" in2="${t}-change" operator="arithmetic" k1="0" k2="1" k3="1" k4="-0.5" result="${t}-lit"/>`,`<feComposite in="${t}-lit" in2="SourceGraphic" operator="in" result="${t}-toned"/>`,`<feColorMatrix in="${t}-toned" type="saturate" values="${s(e.saturation??1)}" result="${t}-strong"/>`,`<feColorMatrix in="${t}-strong" type="hueRotate" values="${s(e.hue??0)}" result="${t}-turned"/>`,`<feColorMatrix in="${t}-turned" type="matrix" values="${s(l)} 0 0 0 0 0 ${s(o)} 0 0 0 0 0 ${s(i)} 0 0 0 0 0 1 0" result="${t}"/>`].join("")}export function gradeFilterMarkup(e,t,n){const r=n<=0?u(t.room,"room"):n>=1?u(t.screen,"screen"):u(t.room,"room")+u(t.screen,"screen")+`<feComposite in="room" in2="screen" operator="arithmetic" k1="0" k2="${s(1-n)}" k3="${s(n)}" k4="0"/>`;return`<filter id="${e}" x="0" y="0" width="1" height="1" color-interpolation-filters="sRGB">${r}</filter>`}const f=new WeakMap;export function gradeLayer(e,t,n){let r=f.get(e);if(!t){r&&(r.svg.remove(),f.delete(e),e.el.style.filter="");return}const l=e.el.parentElement;if(!l)return;if(!r){const a=document.createElementNS(m,"svg");a.setAttribute("width","0"),a.setAttribute("height","0"),a.setAttribute("aria-hidden","true"),Object.assign(a.style,{position:"absolute",left:"0",top:"0"}),l.appendChild(a),$+=1,r={svg:a,id:`ak-sensor-grade-${String($)}`,markup:""},f.set(e,r)}const o=Math.round(h(n,t.share)*100)/100,i=gradeFilterMarkup(r.id,t,o);i!==r.markup&&(r.svg.innerHTML=i,r.markup=i),e.el.style.filter=`url(#${r.id})`,e.el.dataset.akGrade=`${String(Math.round(n*1e3)/1e3)}:${String(o)}`}
@@ -24,9 +24,10 @@ export declare const SCREEN_DEFAULTS: {
24
24
  */
25
25
  export declare function screen(content: Piece | readonly GraphicLayer[], opts?: ScreenOptions): Screen;
26
26
  /**
27
- * A scenery layer's defaults. The fastest drawing is the default: half the
28
- * frame's size each way (a quarter of the pixels), drawn larger; a piece
29
- * that wants more asks for quality.scale 1 (or above, supersampled).
27
+ * A scenery layer's defaults. It is drawn at the frame's own pixels: at half
28
+ * each way (the old default), a laptop's words filmed close went soft, and
29
+ * the full size cost a phone-filmed short about 8% more time. A draft may
30
+ * ask for quality.scale 0.5; above 1 is supersampled.
30
31
  */
31
32
  export declare const SCENERY_LAYER_DEFAULTS: {
32
33
  scale: number;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{glassProblems as _,moireCamera as C,moireProblems as A,PANEL_DEFAULTS as D,project as R,resolveCamera as M,SCREEN_FOCUS_DEFAULTS as j,SCREEN_LIGHT_DEFAULTS as x,screenLightBaseProblem as P}from"@allyhub/scenery";import{isPiece as z,LAYER_BRAND as L}from"@allyhub/piece";import{bakeFile as B,DRAWN_OVER_RULE as I,ruleOf as J,SCENERY_RULES as H}from"../allyhub.js";import{sceneryFileOf as W}from"../module.js";import{drawMoire as G}from"./moire.js";import{answerFor as q}from"./queries.js";import{blurScreen as V,drawScreen as Y,mountScreen as K,placeInScenery as X,screenEdge as Z,screenFocusOf as Q,screenTo as ee,stackByDepth as ne}from"./screens.js";import{cameraOf as re,coded as O,refScenery as $,registry as v,ruled as k,sceneryAtFilm as se,sceneryTime as F}from"./state.js";import{SCREEN as te}from"./types.js";export{stackByDepth}from"./screens.js";export{markScenery,sceneryFileOf}from"../module.js";export{PHONE_CAMERA,phoneCamera,aimAt,aimed,AIM_DEFAULTS,AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,BAKE_DEFAULTS,blend,CAMERA_DEFAULTS,cameraProblems,cutsOf,defineScenery,diagonalLens,directionOf,easeValue,exposureOf,fieldOfView,FIT_DEFAULTS,fitCamera,focusScreen,GLASS_DEFAULTS,handheld,HANDHELD_DEFAULTS,keys,lensForVertical,mixCameras,orbit,PANEL_DEFAULTS,path,PATH_DEFAULTS,project,resolveCamera,rise,SCREEN_LIGHT_DEFAULTS,SENSOR_DEFAULTS,shots,STABILIZER_DEFAULTS,withCuts,SCENERY_RENDERER_DEFAULTS,yawPitchOf}from"@allyhub/scenery";export const SCREEN_DEFAULTS={size:[1920,1080],background:"#000000"};function ie(t){if(t===!1)return!1;const n=typeof t=="object"?t:{},e=n.brightness??1;if(!(Number.isFinite(e)&&e>=0))throw new Error(`screen()'s inScenery brightness ${String(e)} is not a number of 0 or more.`);const o=n.light??!0;if(o===!1)return{brightness:e,light:!1};const s=(typeof o=="object"?o.cells:void 0)??[...x.cells];if(s.length!==2||!s.every(a=>Number.isInteger(a)&&a>=1&&a<=32))throw new Error(`screen()'s inScenery light cells ${JSON.stringify(s)} are not two whole numbers from 1 to 32 (across, down).`);const c=(typeof o=="object"?o.specular:void 0)??x.specular;if(typeof c!="boolean")throw new Error(`screen()'s inScenery light specular ${JSON.stringify(c)} is not true or false.`);const i=(typeof o=="object"?o.base:void 0)??x.base;if(i!==null){const a=P(i);if(a!==void 0)throw new Error(`screen()'s inScenery light base: ${a}.`)}const l=i;return{brightness:e,light:{cells:[s[0]??1,s[1]??1],specular:c,base:l?{brightness:l.brightness??e,color:typeof l.color=="string"?l.color:l.color?[...l.color]:"#ffffff"}:null}}}export function screen(t,n={}){if((n.start!==void 0||n.cue!==void 0)&&n.time!==void 0)throw new Error("screen() takes start and cue, or time, not both.");if(n.cues!==void 0){if(n.start!==void 0||n.cue!==void 0||n.time!==void 0)throw new Error("screen() takes cues, or start and cue, or time: one way to time it.");if(Object.keys(n.cues).length===0)throw new Error(`screen()'s cues is empty: give the screen's moments and where each plays, { "@click": "@press" }.`);for(const[a,h]of Object.entries(n.cues)){if(!(a.trim().startsWith("@")?!0:Number.isFinite(Number(a)))||Array.isArray(t)&&a.trim().startsWith("@"))throw new Error(`screen()'s cue key ${JSON.stringify(a)}: ${Array.isArray(t)?`layers' moments are seconds of the screen's time, as a string ("2.5")`:`a video's own reference ("@click") or seconds of its time as a string ("2.5")`}.`);if(!(typeof h=="number"&&Number.isFinite(h))&&!(typeof h=="string"&&h.trim()!==""))throw new Error(`screen()'s cue ${JSON.stringify(a)} plays at ${JSON.stringify(h)}: a reference of the film ("@press") or a scenery time in seconds.`)}}if(typeof n.cue=="number"&&!Number.isFinite(n.cue))throw new Error(`screen()'s cue ${String(n.cue)} is not a number of seconds.`);if(typeof n.cue=="string"&&Array.isArray(t))throw new Error(`screen()'s cue "${n.cue}" is a reference: only a video has references of its own. Give layers' cue in seconds of the screen's time.`);const e=n.background??SCREEN_DEFAULTS.background,o={[te]:!0,time:n.time??{},...n.start!==void 0?{start:n.start}:{},...n.cue!==void 0?{cue:n.cue}:{},...n.cues!==void 0?{cues:{...n.cues}}:{},background:e==="transparent"?null:e,...n.pixels?{pixels:{...n.pixels}}:{},...n.glass?{glass:{...n.glass}}:{},inScenery:ie(n.inScenery)},s=A(void 0,n.pixels);if(s.length>0)throw new Error(`screen()'s ${s.join(" ")}`);const c=_(n.glass);if(c.length>0)throw new Error(`screen()'s ${c.join(" ")}`);if(!Array.isArray(t)){if(!z(t))throw new Error('screen() shows a video item (its piece, imported: import demo from "../demo/video") or graphic layers.');if(n.size!==void 0||n.dur!==void 0)throw new Error("screen() with a video takes its size and length from the video: its own format, and its length.");return{...o,video:t,layers:[],size:SCREEN_DEFAULTS.size}}const i=t;for(const a of i)if(a[L]!=="graphic")throw new Error("screen() takes graphic layers (components, custom()), or a video item whose own layers include footage.");const l=n.size??SCREEN_DEFAULTS.size;if(!(l[0]>0&&l[1]>0))throw new Error(`screen()'s size ${JSON.stringify(l)} is not two sizes in px.`);return{...o,layers:i,size:l,...n.dur!==void 0?{dur:n.dur}:{}}}export const SCENERY_LAYER_DEFAULTS={scale:.5,name:"scenery",focusLevels:j.levels};const N=new WeakMap,T=new WeakMap,U=new WeakMap,oe=()=>{const t=import.meta.url;return new URL("../three-libs/",t).href};function ae(t,n,e){const o=W(t);return{assetUrl:s=>n.asset(`/${s.replace(/^\/+/,"")}`).url,...o===void 0?{}:{module:o},decoders:oe(),seed:e,onProblem:s=>{n.report?.({code:J(s.kind),level:s.level,message:s.message})},bakeUrl:(s,c)=>n.optionalAsset?.(`/${B(s,c)}`)?.url,...n.realTimers?{timers:n.realTimers}:{}}}function ce(t,n,e){let o=T.get(t);return o||(o=Promise.all([import("../page/page.js"),import("../signature.js")]).then(async([{SceneryPage:s},{signatureOf:c}])=>{const i={page:await s.open(t,ae(t,n,e)),sign:c};return U.set(t,i),i}),T.set(t,o)),o}function le(t,n){const e=n.canvas;e.parentNode!==t.el&&t.el.insertBefore(e,t.canvas),e.dataset.akSign="the scenery's renderer",Object.assign(e.style,{position:"absolute",left:t.canvas.style.left,top:t.canvas.style.top,width:t.canvas.style.width,height:t.canvas.style.height,clipPath:"inset(0 calc(100% - 1px) calc(100% - 1px) 0)",pointerEvents:"none"})}export function scenery(t,n){const{at:e,until:o,dur:s,z:c,...i}=n,l={...e===void 0?{}:{at:e},...o===void 0?{}:{until:o},...s===void 0?{}:{dur:s},...c===void 0?{}:{z:c}},a=i.box===void 0||i.box==="full"?[0,0,1,1]:i.box;if(a.some(p=>!Number.isFinite(p))||a[2]<=0||a[3]<=0||a[0]+a[2]>1+1e-9||a[1]+a[3]>1+1e-9)throw new Error(`scenery()'s box ${JSON.stringify(a)} is not inside the frame: [x, y, width, height] as fractions, x + width and y + height at most 1.`);const h=i.quality?.scale??SCENERY_LAYER_DEFAULTS.scale;if(!(h>0&&h<=4))throw new Error(`scenery()'s quality.scale ${String(h)} is outside (0, 4].`);const u=i.quality?.focusLevels??SCENERY_LAYER_DEFAULTS.focusLevels;if(!(Number.isInteger(u)&&u>=1&&u<=16))throw new Error(`scenery()'s quality.focusLevels ${String(u)} is not a whole number from 1 to 16.`);const d=A(i.sensor,void 0);if(d.length>0)throw new Error(`scenery()'s ${d.join(" ")}`);const f=i.background;return{[L]:"graphic",...l,component:"scenery",props:{scenery:t,camera:i.camera,box:a,...f===void 0?{}:{background:f==="transparent"?null:f},time:i.time??{},scale:h,focusLevels:u,...i.sensor?{sensor:{...i.sensor}}:{},name:i.name??SCENERY_LAYER_DEFAULTS.name,screens:i.screens??{},props:i.props??[]},mount(p,y,w){k(()=>{de(p,y,w)})},render(p,y){k(()=>{fe(p,y)})}}}function de(t,n,e){const{width:o,height:s}=e.dims,c={x:Math.round(n.box[0]*o),y:Math.round(n.box[1]*s),w:Math.max(1,Math.round(n.box[2]*o)),h:Math.max(1,Math.round(n.box[3]*s))},i=document.createElement("canvas"),l=e.sceneryScale??n.scale;i.width=Math.max(1,Math.round(c.w*l)),i.height=Math.max(1,Math.round(c.h*l)),Object.assign(i.style,{position:"absolute",left:`${String(c.x)}px`,top:`${String(c.y)}px`,width:`${String(c.w)}px`,height:`${String(c.h)}px`});const a=document.createElement("div");Object.assign(a.style,{position:"absolute",left:i.style.left,top:i.style.top,width:i.style.width,height:i.style.height,overflow:"hidden",isolation:"isolate"});const h=g=>se(n,(e.film?.start??0)+g);t.appendChild(a);const u=Object.entries(n.screens).map(([g,r])=>K(a,g,r,e,h,m=>$(n,e,m)));let d;n.sensor&&u.length>0&&(d=document.createElement("canvas"),d.width=c.w,d.height=c.h,d.dataset.akSign="the scenery's moiré",Object.assign(d.style,{position:"absolute",left:"0px",top:"0px",width:`${String(c.w)}px`,height:`${String(c.h)}px`,zIndex:"100000",mixBlendMode:"multiply",pointerEvents:"none"}),a.appendChild(d)),u.length===0&&a.remove(),t.appendChild(i);const f={props:n,ctx:e,el:t,canvas:i,px:c,screens:u,time:g=>$(n,e,g),...d?{moire:d}:{}};N.set(t,f),q(f);const p=v.get(n.name)??[];p.push(f),v.set(n.name,p);const y=g=>Promise.all(n.props.map(r=>g.props.add(r))),w=g=>{throw O(g)},E=U.get(n.scenery);if(E){f.page=E.page,f.sign=E.sign,n.props.length>0&&e.wait(y(E.page).catch(w));return}e.wait(ce(n.scenery,e,n.name).then(async({page:g,sign:r})=>{await y(g),f.page=g,f.sign=r}).catch(w))}function fe(t,n){const e=N.get(t);if(!e?.page)return;const o=e.page,s=F(e,n),c=e.px.w/e.px.h,i=o.stateFrom(re(e),s,c,e.time);o.props.show(e.props.props,s);const l=o.aim(i,c),{width:a,height:h}=e.canvas,u=o.screens.drawsElements,d=u?e.screens.filter(r=>r.spec.inScenery!==!1):[];if(!u&&!e.fellBack){const r=e.screens.filter(m=>m.spec.inScenery!==!1);r.length>0&&(e.fellBack=!0,e.ctx.report?.({code:I,level:"warn",message:`The screens ${r.map(m=>`"${m.mesh}"`).join(", ")} of the scenery layer "${e.props.name}" are drawn over the scenery, unlit and untoned, not in it: this page cannot draw an element into the scenery's canvas (Chrome's HTML-in-Canvas is missing or turned off, or the scenery draws with WebGPU). AllyHub's own Chrome, which allyhub frames, check and exports use, has it: when allyhub check does not report this, only this page's preview is affected, so change nothing. screen(…, { inScenery: false }) would take the scenery's light and a sensor's moiré out of the export too.`}))}const f=e.screens.filter(r=>!d.includes(r)).map(r=>r.mesh),p=e.screens.map(r=>o.screens.quad(r.mesh,l.resolved,[e.px.w,e.px.h])),y=Math.ceil(2/(e.canvas.height/e.px.h))+1;d.length>0&&le(e,o);const w=[];if(e.screens.forEach((r,m)=>{if(d.includes(r)){const b=r.spec.pixels?.density??D.density,S=r.spec.inScenery;o.screens.show(r.mesh,r.el,{brightness:S===!1?1:S.brightness,light:S===!1?!1:S.light,...e.moire&&e.props.sensor?{factor:e.moire}:{}}),X(r,p[m],b),w.push(ee(r,s));return}Y(r,s,p[m]),Z(r,p[m],y),V(r,Q(e,r,p[m],l.resolved))}),ne(e.screens.map((r,m)=>({el:r.el,depth:p[m]?.depth}))),e.sign&&(e.canvas.dataset.akSign=e.sign(o.scene,l.camera,[a,h],`${e.props.background===void 0?"the scenery's":e.props.background??"none"}|${f.join(",")}${l.resolved.dof?`|f/${String(l.resolved.dof.aperture)}@${String(l.resolved.dof.focus)}:${String(l.resolved.dof.lens)}`:""}${e.props.sensor?`|sensor ${JSON.stringify(e.props.sensor)} ${JSON.stringify(e.screens.map(r=>r.spec.pixels??null))}`:""}${e.screens.some(r=>r.spec.glass)?`|glass ${JSON.stringify(e.screens.map(r=>r.spec.glass??null))}`:""}${d.length>0?`|in scenery ${JSON.stringify(d.map(r=>[r.mesh,r.spec.inScenery]))}`:""}`)),e.ctx.layoutOnly===!0)return;e.moire&&e.props.sensor&&G(e,p,l.resolved,C(l.resolved,[e.ctx.dims.width,e.ctx.dims.height],e.px.h,e.props.sensor,[e.px.x,e.px.y]));const E=new Map(e.screens.flatMap(r=>r.spec.glass?[[r.mesh,r.spec.glass]]:[])),g=()=>{const r=o.drawer.inPlace(l.camera,a,h,e.props.background,f,l.resolved.dof,E.size>0?E:void 0,d.map(b=>b.mesh)),m=e.canvas.getContext("2d");if(m&&(m.clearRect(0,0,a,h),m.drawImage(r,0,0,a,h),o.lost))throw Object.assign(new Error(`The scenery's WebGL context was lost (the browser's GPU process failed): its picture at ${n.toFixed(3)} s is empty.`),{code:H.renderer})};if(d.length===0){g();return}e.ctx.wait(Promise.all(w).then(()=>o.screens.paint([a,h])).then(g).catch(r=>{throw O(r)}))}export function projectScenery(t,n,e,o){const s=v.get(t)?.find(f=>f.el.parentElement===o.parentElement&&f.ctx.layer.start<=e&&e<f.ctx.layer.end&&f.page),c=s?.page;if(!s||!c)return;const i=F(s,e),l=s.px.w/s.px.h,a=c.stateFrom(s.props.camera,i,l,s.time);c.props.show(s.props.props,i);const h=M(a,l,f=>c.pointOf(f)),u=typeof n=="string"?c.pointOf(n):n,d=R(h,u);return{x:s.px.x+(d.x+1)/2*s.px.w,y:s.px.y+(1-d.y)/2*s.px.h,inView:d.inView,depth:d.depth}}
2
+ import{glassProblems as D,moireCamera as R,moireProblems as A,PANEL_DEFAULTS as L,project as M,resolveCamera as P,SCREEN_FOCUS_DEFAULTS as j,SCREEN_LIGHT_DEFAULTS as x,screenLightBaseProblem as z}from"@allyhub/scenery";import{isPiece as B,LAYER_BRAND as O}from"@allyhub/piece";import{bakeFile as I,DRAWN_OVER_RULE as J,ruleOf as H,SCENERY_RULES as W}from"../allyhub.js";import{sceneryFileOf as G}from"../module.js";import{gradeLayer as q}from"./grade.js";import{drawMoire as V}from"./moire.js";import{answerFor as Y}from"./queries.js";import{blurScreen as K,drawScreen as X,mountScreen as Z,placeInScenery as Q,screenEdge as ee,screenFocusOf as re,screenTo as ne,stackByDepth as se}from"./screens.js";import{cameraOf as te,coded as $,refScenery as k,registry as v,ruled as F,sceneryAtFilm as oe,sceneryTime as N}from"./state.js";import{SCREEN as ie}from"./types.js";export{stackByDepth}from"./screens.js";export{markScenery,sceneryFileOf}from"../module.js";export{PHONE_CAMERA,phoneCamera,aimAt,aimed,AIM_DEFAULTS,AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,BAKE_DEFAULTS,blend,CAMERA_DEFAULTS,cameraProblems,cutsOf,defineScenery,diagonalLens,directionOf,easeValue,exposureOf,fieldOfView,FIT_DEFAULTS,fitCamera,focusScreen,GLASS_DEFAULTS,handheld,HANDHELD_DEFAULTS,keys,lensForVertical,mixCameras,orbit,PANEL_DEFAULTS,path,PATH_DEFAULTS,project,resolveCamera,rise,SCREEN_LIGHT_DEFAULTS,SENSOR_DEFAULTS,shots,STABILIZER_DEFAULTS,withCuts,SCENERY_RENDERER_DEFAULTS,yawPitchOf}from"@allyhub/scenery";export const SCREEN_DEFAULTS={size:[1920,1080],background:"#000000"};function ae(t){if(t===!1)return!1;const r=typeof t=="object"?t:{},e=r.brightness??1;if(!(Number.isFinite(e)&&e>=0))throw new Error(`screen()'s inScenery brightness ${String(e)} is not a number of 0 or more.`);const o=r.light??!0;if(o===!1)return{brightness:e,light:!1};const s=(typeof o=="object"?o.cells:void 0)??[...x.cells];if(s.length!==2||!s.every(a=>Number.isInteger(a)&&a>=1&&a<=32))throw new Error(`screen()'s inScenery light cells ${JSON.stringify(s)} are not two whole numbers from 1 to 32 (across, down).`);const c=(typeof o=="object"?o.specular:void 0)??x.specular;if(typeof c!="boolean")throw new Error(`screen()'s inScenery light specular ${JSON.stringify(c)} is not true or false.`);const i=(typeof o=="object"?o.base:void 0)??x.base;if(i!==null){const a=z(i);if(a!==void 0)throw new Error(`screen()'s inScenery light base: ${a}.`)}const l=i;return{brightness:e,light:{cells:[s[0]??1,s[1]??1],specular:c,base:l?{brightness:l.brightness??e,color:typeof l.color=="string"?l.color:l.color?[...l.color]:"#ffffff"}:null}}}export function screen(t,r={}){if((r.start!==void 0||r.cue!==void 0)&&r.time!==void 0)throw new Error("screen() takes start and cue, or time, not both.");if(r.cues!==void 0){if(r.start!==void 0||r.cue!==void 0||r.time!==void 0)throw new Error("screen() takes cues, or start and cue, or time: one way to time it.");if(Object.keys(r.cues).length===0)throw new Error(`screen()'s cues is empty: give the screen's moments and where each plays, { "@click": "@press" }.`);for(const[a,h]of Object.entries(r.cues)){if(!(a.trim().startsWith("@")?!0:Number.isFinite(Number(a)))||Array.isArray(t)&&a.trim().startsWith("@"))throw new Error(`screen()'s cue key ${JSON.stringify(a)}: ${Array.isArray(t)?`layers' moments are seconds of the screen's time, as a string ("2.5")`:`a video's own reference ("@click") or seconds of its time as a string ("2.5")`}.`);if(!(typeof h=="number"&&Number.isFinite(h))&&!(typeof h=="string"&&h.trim()!==""))throw new Error(`screen()'s cue ${JSON.stringify(a)} plays at ${JSON.stringify(h)}: a reference of the film ("@press") or a scenery time in seconds.`)}}if(typeof r.cue=="number"&&!Number.isFinite(r.cue))throw new Error(`screen()'s cue ${String(r.cue)} is not a number of seconds.`);if(typeof r.cue=="string"&&Array.isArray(t))throw new Error(`screen()'s cue "${r.cue}" is a reference: only a video has references of its own. Give layers' cue in seconds of the screen's time.`);const e=r.background??SCREEN_DEFAULTS.background,o={[ie]:!0,time:r.time??{},...r.start!==void 0?{start:r.start}:{},...r.cue!==void 0?{cue:r.cue}:{},...r.cues!==void 0?{cues:{...r.cues}}:{},background:e==="transparent"?null:e,...r.pixels?{pixels:{...r.pixels}}:{},...r.glass?{glass:{...r.glass}}:{},inScenery:ae(r.inScenery)},s=A(void 0,r.pixels);if(s.length>0)throw new Error(`screen()'s ${s.join(" ")}`);const c=D(r.glass);if(c.length>0)throw new Error(`screen()'s ${c.join(" ")}`);if(!Array.isArray(t)){if(!B(t))throw new Error('screen() shows a video item (its piece, imported: import demo from "../demo/video") or graphic layers.');if(r.size!==void 0||r.dur!==void 0)throw new Error("screen() with a video takes its size and length from the video: its own format, and its length.");return{...o,video:t,layers:[],size:SCREEN_DEFAULTS.size}}const i=t;for(const a of i)if(a[O]!=="graphic")throw new Error("screen() takes graphic layers (components, custom()), or a video item whose own layers include footage.");const l=r.size??SCREEN_DEFAULTS.size;if(!(l[0]>0&&l[1]>0))throw new Error(`screen()'s size ${JSON.stringify(l)} is not two sizes in px.`);return{...o,layers:i,size:l,...r.dur!==void 0?{dur:r.dur}:{}}}export const SCENERY_LAYER_DEFAULTS={scale:1,name:"scenery",focusLevels:j.levels};const T=new WeakMap,U=new WeakMap,_=new WeakMap,ce=()=>{const t=import.meta.url;return new URL("../three-libs/",t).href};function le(t,r,e){const o=G(t);return{assetUrl:s=>r.asset(`/${s.replace(/^\/+/,"")}`).url,...o===void 0?{}:{module:o},decoders:ce(),seed:e,onProblem:s=>{r.report?.({code:H(s.kind),level:s.level,message:s.message})},bakeUrl:(s,c)=>r.optionalAsset?.(`/${I(s,c)}`)?.url,...r.realTimers?{timers:r.realTimers}:{}}}function de(t,r,e){let o=U.get(t);return o||(o=Promise.all([import("../page/page.js"),import("../signature.js")]).then(async([{SceneryPage:s},{signatureOf:c}])=>{const i={page:await s.open(t,le(t,r,e)),sign:c};return _.set(t,i),i}),U.set(t,o)),o}function fe(t,r){const e=r.canvas;e.parentNode!==t.el&&t.el.insertBefore(e,t.canvas),e.dataset.akSign="the scenery's renderer",Object.assign(e.style,{position:"absolute",left:t.canvas.style.left,top:t.canvas.style.top,width:t.canvas.style.width,height:t.canvas.style.height,clipPath:"inset(0 calc(100% - 1px) calc(100% - 1px) 0)",pointerEvents:"none"})}export function scenery(t,r){const{at:e,until:o,dur:s,z:c,...i}=r,l={...e===void 0?{}:{at:e},...o===void 0?{}:{until:o},...s===void 0?{}:{dur:s},...c===void 0?{}:{z:c}},a=i.box===void 0||i.box==="full"?[0,0,1,1]:i.box;if(a.some(p=>!Number.isFinite(p))||a[2]<=0||a[3]<=0||a[0]+a[2]>1+1e-9||a[1]+a[3]>1+1e-9)throw new Error(`scenery()'s box ${JSON.stringify(a)} is not inside the frame: [x, y, width, height] as fractions, x + width and y + height at most 1.`);const h=i.quality?.scale??SCENERY_LAYER_DEFAULTS.scale;if(!(h>0&&h<=4))throw new Error(`scenery()'s quality.scale ${String(h)} is outside (0, 4].`);const u=i.quality?.focusLevels??SCENERY_LAYER_DEFAULTS.focusLevels;if(!(Number.isInteger(u)&&u>=1&&u<=16))throw new Error(`scenery()'s quality.focusLevels ${String(u)} is not a whole number from 1 to 16.`);const d=A(i.sensor,void 0);if(d.length>0)throw new Error(`scenery()'s ${d.join(" ")}`);const f=i.background;return{[O]:"graphic",...l,component:"scenery",props:{scenery:t,camera:i.camera,box:a,...f===void 0?{}:{background:f==="transparent"?null:f},time:i.time??{},scale:h,focusLevels:u,...i.sensor?{sensor:{...i.sensor}}:{},name:i.name??SCENERY_LAYER_DEFAULTS.name,screens:i.screens??{},props:i.props??[]},mount(p,y,w){F(()=>{he(p,y,w)})},render(p,y){F(()=>{me(p,y)})}}}function he(t,r,e){const{width:o,height:s}=e.dims,c={x:Math.round(r.box[0]*o),y:Math.round(r.box[1]*s),w:Math.max(1,Math.round(r.box[2]*o)),h:Math.max(1,Math.round(r.box[3]*s))},i=document.createElement("canvas"),l=e.sceneryScale??r.scale;i.width=Math.max(1,Math.round(c.w*l)),i.height=Math.max(1,Math.round(c.h*l)),Object.assign(i.style,{position:"absolute",left:`${String(c.x)}px`,top:`${String(c.y)}px`,width:`${String(c.w)}px`,height:`${String(c.h)}px`});const a=document.createElement("div");Object.assign(a.style,{position:"absolute",left:i.style.left,top:i.style.top,width:i.style.width,height:i.style.height,overflow:"hidden",isolation:"isolate"});const h=g=>oe(r,(e.film?.start??0)+g);t.appendChild(a);const u=Object.entries(r.screens).map(([g,n])=>Z(a,g,n,e,h,m=>k(r,e,m)));let d;r.sensor&&u.length>0&&(d=document.createElement("canvas"),d.width=c.w,d.height=c.h,d.dataset.akSign="the scenery's moiré",Object.assign(d.style,{position:"absolute",left:"0px",top:"0px",width:`${String(c.w)}px`,height:`${String(c.h)}px`,zIndex:"100000",mixBlendMode:"multiply",pointerEvents:"none"}),a.appendChild(d)),u.length===0&&a.remove(),t.appendChild(i);const f={props:r,ctx:e,el:t,canvas:i,px:c,screens:u,time:g=>k(r,e,g),...d?{moire:d}:{}};T.set(t,f),Y(f);const p=v.get(r.name)??[];p.push(f),v.set(r.name,p);const y=g=>Promise.all(r.props.map(n=>g.props.add(n))),w=g=>{throw $(g)},E=_.get(r.scenery);if(E){f.page=E.page,f.sign=E.sign,r.props.length>0&&e.wait(y(E.page).catch(w));return}e.wait(de(r.scenery,e,r.name).then(async({page:g,sign:n})=>{await y(g),f.page=g,f.sign=n}).catch(w))}function me(t,r){const e=T.get(t);if(!e?.page)return;const o=e.page,s=N(e,r),c=e.px.w/e.px.h,i=o.stateFrom(te(e),s,c,e.time);o.props.show(e.props.props,s);const l=o.aim(i,c),{width:a,height:h}=e.canvas,u=o.screens.drawsElements,d=u?e.screens.filter(n=>n.spec.inScenery!==!1):[];if(!u&&!e.fellBack){const n=e.screens.filter(m=>m.spec.inScenery!==!1);n.length>0&&(e.fellBack=!0,e.ctx.report?.({code:J,level:"warn",ofPage:!0,message:`The screens ${n.map(m=>`"${m.mesh}"`).join(", ")} of the scenery layer "${e.props.name}" are drawn over the scenery, unlit and untoned, not in it: this page cannot draw an element into the scenery's canvas (Chrome's HTML-in-Canvas is missing or turned off, or the scenery draws with WebGPU). AllyHub's own Chrome, which allyhub frames, check and exports use, has it: when allyhub check does not report this, only this page's preview is affected, so change nothing. screen(…, { inScenery: false }) would take the scenery's light and a sensor's moiré out of the export too.`}))}const f=e.screens.filter(n=>!d.includes(n)).map(n=>n.mesh),p=e.screens.map(n=>o.screens.quad(n.mesh,l.resolved,[e.px.w,e.px.h]));q(e,e.props.sensor?.grade,Math.max(0,...e.screens.map(n=>o.screens.share(n.mesh,l.resolved,[e.px.w,e.px.h]))));const y=Math.ceil(2/(e.canvas.height/e.px.h))+1;d.length>0&&fe(e,o);const w=[];if(e.screens.forEach((n,m)=>{if(d.includes(n)){const b=n.spec.pixels?.density??L.density,C=n.spec.pixels?.mesh??L.mesh,S=n.spec.inScenery;o.screens.show(n.mesh,n.el,{brightness:S===!1?1:S.brightness,light:S===!1?!1:S.light,...e.moire&&e.props.sensor?{factor:e.moire}:{}}),Q(n,p[m],b,C),w.push(ne(n,s));return}X(n,s,p[m]),ee(n,p[m],y),K(n,re(e,n,p[m],l.resolved))}),se(e.screens.map((n,m)=>({el:n.el,depth:p[m]?.depth}))),e.sign&&(e.canvas.dataset.akSign=e.sign(o.scene,l.camera,[a,h],`${e.props.background===void 0?"the scenery's":e.props.background??"none"}|${f.join(",")}${l.resolved.dof?`|f/${String(l.resolved.dof.aperture)}@${String(l.resolved.dof.focus)}:${String(l.resolved.dof.lens)}`:""}${e.props.sensor?`|sensor ${JSON.stringify(e.props.sensor)} ${JSON.stringify(e.screens.map(n=>n.spec.pixels??null))}`:""}${e.screens.some(n=>n.spec.glass)?`|glass ${JSON.stringify(e.screens.map(n=>n.spec.glass??null))}`:""}${d.length>0?`|in scenery ${JSON.stringify(d.map(n=>[n.mesh,n.spec.inScenery]))}`:""}`)),e.ctx.layoutOnly===!0)return;e.moire&&e.props.sensor&&V(e,p,l.resolved,R(l.resolved,[e.ctx.dims.width,e.ctx.dims.height],e.px.h,e.props.sensor,[e.px.x,e.px.y]));const E=new Map(e.screens.flatMap(n=>n.spec.glass?[[n.mesh,n.spec.glass]]:[])),g=()=>{const n=o.drawer.inPlace(l.camera,a,h,e.props.background,f,l.resolved.dof,E.size>0?E:void 0,d.map(b=>b.mesh)),m=e.canvas.getContext("2d");if(m&&(m.clearRect(0,0,a,h),m.drawImage(n,0,0,a,h),o.lost))throw Object.assign(new Error(`The scenery's WebGL context was lost (the browser's GPU process failed): its picture at ${r.toFixed(3)} s is empty.`),{code:W.renderer})};if(d.length===0){g();return}e.ctx.wait(Promise.all(w).then(()=>o.screens.paint([a,h])).then(g).catch(n=>{throw $(n)}))}export function projectScenery(t,r,e,o){const s=v.get(t)?.find(f=>f.el.parentElement===o.parentElement&&f.ctx.layer.start<=e&&e<f.ctx.layer.end&&f.page),c=s?.page;if(!s||!c)return;const i=N(s,e),l=s.px.w/s.px.h,a=c.stateFrom(s.props.camera,i,l,s.time);c.props.show(s.props.props,i);const h=P(a,l,f=>c.pointOf(f)),u=typeof r=="string"?c.pointOf(r):r,d=M(h,u);return{x:s.px.x+(d.x+1)/2*s.px.w,y:s.px.y+(1-d.y)/2*s.px.h,inView:d.inView,depth:d.depth}}
@@ -38,7 +38,7 @@ export declare function stackByDepth(screens: readonly {
38
38
  export declare function placeInScenery(sc: MountedScreen, quad: {
39
39
  corners: [Px, Px, Px, Px];
40
40
  angle: number;
41
- } | undefined, density: number): void;
41
+ } | undefined, density: number, mesh?: number): void;
42
42
  /** A screen's content at scenery time t, without placing it: a screen drawn in the scenery. */
43
43
  export declare function screenTo(sc: MountedScreen, sceneryT: number): Promise<unknown>;
44
44
  /** A screen at scenery time: its content drawn, its picture mapped onto its quad. */