@allyhub/sdk 0.4.0 → 0.6.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 (561) hide show
  1. package/{node_modules → dist/node_modules}/@allyhub-next/audio/package.json +1 -1
  2. package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.d.ts +31 -0
  3. package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +3 -0
  4. package/{node_modules/@allyhub-next/slides-core → dist/node_modules/@allyhub-next/chart}/dist/chart.d.ts +26 -15
  5. package/dist/node_modules/@allyhub-next/chart/dist/chart.js +2 -0
  6. package/dist/node_modules/@allyhub-next/chart/dist/index.d.ts +3 -0
  7. package/dist/node_modules/@allyhub-next/chart/dist/index.js +2 -0
  8. package/dist/node_modules/@allyhub-next/chart/package.json +14 -0
  9. package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/reference.d.ts +0 -86
  10. package/dist/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
  11. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +5087 -0
  12. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
  13. package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/slides.d.ts +306 -11
  14. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +2 -0
  15. package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/index.d.ts +2 -0
  16. package/dist/node_modules/@allyhub-next/formats/dist/index.js +2 -0
  17. package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/items.d.ts +1 -1
  18. package/dist/node_modules/@allyhub-next/formats/dist/items.js +2 -0
  19. package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +2278 -0
  20. package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
  21. package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +28 -0
  22. package/dist/node_modules/@allyhub-next/formats/dist/strict.js +2 -0
  23. package/dist/node_modules/@allyhub-next/formats/dist/zip.d.ts +17 -0
  24. package/dist/node_modules/@allyhub-next/formats/dist/zip.js +2 -0
  25. package/{node_modules → dist/node_modules}/@allyhub-next/formats/package.json +1 -1
  26. package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/editor.d.ts +20 -0
  27. package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
  28. package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/notes.d.ts +4 -0
  29. package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +2 -0
  30. package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/tools.d.ts +6 -0
  31. package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
  32. package/{node_modules → dist/node_modules}/@allyhub-next/protocol/package.json +1 -1
  33. package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/lock.d.ts +2 -0
  34. package/dist/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
  35. package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/runtimes.d.ts +6 -0
  36. package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.js +4 -0
  37. package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/package.json +1 -1
  38. package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/moire.d.ts +7 -0
  39. package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/phone.d.ts +3 -1
  40. package/dist/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
  41. package/{node_modules → dist/node_modules}/@allyhub-next/scenery/package.json +1 -1
  42. package/dist/node_modules/@allyhub-next/sheet/dist/address.d.ts +32 -0
  43. package/dist/node_modules/@allyhub-next/sheet/dist/address.js +2 -0
  44. package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.d.ts +23 -0
  45. package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +2 -0
  46. package/dist/node_modules/@allyhub-next/sheet/dist/api/charts.d.ts +204 -0
  47. package/dist/node_modules/@allyhub-next/sheet/dist/api/charts.js +2 -0
  48. package/dist/node_modules/@allyhub-next/sheet/dist/api/code.d.ts +19 -0
  49. package/dist/node_modules/@allyhub-next/sheet/dist/api/code.js +2 -0
  50. package/dist/node_modules/@allyhub-next/sheet/dist/api/hint.d.ts +3 -0
  51. package/dist/node_modules/@allyhub-next/sheet/dist/api/hint.js +2 -0
  52. package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +8 -0
  53. package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +2 -0
  54. package/dist/node_modules/@allyhub-next/sheet/dist/api/page.d.ts +83 -0
  55. package/dist/node_modules/@allyhub-next/sheet/dist/api/page.js +2 -0
  56. package/dist/node_modules/@allyhub-next/sheet/dist/api/rectangles.d.ts +4 -0
  57. package/dist/node_modules/@allyhub-next/sheet/dist/api/rectangles.js +2 -0
  58. package/dist/node_modules/@allyhub-next/sheet/dist/api/rules.d.ts +170 -0
  59. package/dist/node_modules/@allyhub-next/sheet/dist/api/rules.js +2 -0
  60. package/dist/node_modules/@allyhub-next/sheet/dist/api/styles.d.ts +117 -0
  61. package/dist/node_modules/@allyhub-next/sheet/dist/api/styles.js +2 -0
  62. package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +362 -0
  63. package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +2 -0
  64. package/dist/node_modules/@allyhub-next/sheet/dist/arrange.d.ts +68 -0
  65. package/dist/node_modules/@allyhub-next/sheet/dist/arrange.js +2 -0
  66. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +21 -0
  67. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +2 -0
  68. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +19 -0
  69. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +2 -0
  70. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +152 -0
  71. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +2 -0
  72. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.d.ts +2 -0
  73. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +2 -0
  74. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.d.ts +15 -0
  75. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +2 -0
  76. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.d.ts +2 -0
  77. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +2 -0
  78. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.d.ts +2 -0
  79. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +2 -0
  80. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +69 -0
  81. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +2 -0
  82. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/distributions.d.ts +2 -0
  83. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/distributions.js +2 -0
  84. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +2 -0
  85. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +2 -0
  86. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.d.ts +2 -0
  87. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +2 -0
  88. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +15 -0
  89. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +2 -0
  90. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.d.ts +2 -0
  91. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +2 -0
  92. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.d.ts +2 -0
  93. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +2 -0
  94. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.d.ts +2 -0
  95. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +2 -0
  96. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.d.ts +2 -0
  97. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +2 -0
  98. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.d.ts +2 -0
  99. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +2 -0
  100. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/special.d.ts +29 -0
  101. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/special.js +2 -0
  102. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.d.ts +2 -0
  103. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +2 -0
  104. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +50 -0
  105. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +2 -0
  106. package/dist/node_modules/@allyhub-next/sheet/dist/chart.d.ts +58 -0
  107. package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +2 -0
  108. package/dist/node_modules/@allyhub-next/sheet/dist/check.d.ts +15 -0
  109. package/dist/node_modules/@allyhub-next/sheet/dist/check.js +2 -0
  110. package/dist/node_modules/@allyhub-next/sheet/dist/csv.d.ts +62 -0
  111. package/dist/node_modules/@allyhub-next/sheet/dist/csv.js +12 -0
  112. package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +64 -0
  113. package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +2 -0
  114. package/dist/node_modules/@allyhub-next/sheet/dist/edit.d.ts +154 -0
  115. package/dist/node_modules/@allyhub-next/sheet/dist/edit.js +2 -0
  116. package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +11 -0
  117. package/dist/node_modules/@allyhub-next/sheet/dist/export.js +6 -0
  118. package/dist/node_modules/@allyhub-next/sheet/dist/file.d.ts +19 -0
  119. package/dist/node_modules/@allyhub-next/sheet/dist/file.js +3 -0
  120. package/dist/node_modules/@allyhub-next/sheet/dist/files.d.ts +24 -0
  121. package/dist/node_modules/@allyhub-next/sheet/dist/files.js +2 -0
  122. package/dist/node_modules/@allyhub-next/sheet/dist/fill.d.ts +30 -0
  123. package/dist/node_modules/@allyhub-next/sheet/dist/fill.js +2 -0
  124. package/dist/node_modules/@allyhub-next/sheet/dist/filter.d.ts +29 -0
  125. package/dist/node_modules/@allyhub-next/sheet/dist/filter.js +2 -0
  126. package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +9 -0
  127. package/dist/node_modules/@allyhub-next/sheet/dist/format.js +2 -0
  128. package/dist/node_modules/@allyhub-next/sheet/dist/formula/ast.d.ts +113 -0
  129. package/dist/node_modules/@allyhub-next/sheet/dist/formula/ast.js +2 -0
  130. package/dist/node_modules/@allyhub-next/sheet/dist/formula/move.d.ts +6 -0
  131. package/dist/node_modules/@allyhub-next/sheet/dist/formula/move.js +2 -0
  132. package/dist/node_modules/@allyhub-next/sheet/dist/formula/parse.d.ts +4 -0
  133. package/dist/node_modules/@allyhub-next/sheet/dist/formula/parse.js +2 -0
  134. package/dist/node_modules/@allyhub-next/sheet/dist/formula/print.d.ts +6 -0
  135. package/dist/node_modules/@allyhub-next/sheet/dist/formula/print.js +2 -0
  136. package/dist/node_modules/@allyhub-next/sheet/dist/formula/rewrite.d.ts +65 -0
  137. package/dist/node_modules/@allyhub-next/sheet/dist/formula/rewrite.js +2 -0
  138. package/dist/node_modules/@allyhub-next/sheet/dist/formula/walk.d.ts +6 -0
  139. package/dist/node_modules/@allyhub-next/sheet/dist/formula/walk.js +2 -0
  140. package/dist/node_modules/@allyhub-next/sheet/dist/generated.d.ts +46 -0
  141. package/dist/node_modules/@allyhub-next/sheet/dist/generated.js +2 -0
  142. package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +34 -0
  143. package/dist/node_modules/@allyhub-next/sheet/dist/html.js +20 -0
  144. package/dist/node_modules/@allyhub-next/sheet/dist/import.d.ts +11 -0
  145. package/dist/node_modules/@allyhub-next/sheet/dist/import.js +2 -0
  146. package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +38 -0
  147. package/dist/node_modules/@allyhub-next/sheet/dist/index.js +2 -0
  148. package/dist/node_modules/@allyhub-next/sheet/dist/inspect.d.ts +25 -0
  149. package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +2 -0
  150. package/dist/node_modules/@allyhub-next/sheet/dist/patch.d.ts +4 -0
  151. package/dist/node_modules/@allyhub-next/sheet/dist/patch.js +2 -0
  152. package/dist/node_modules/@allyhub-next/sheet/dist/profile.d.ts +30 -0
  153. package/dist/node_modules/@allyhub-next/sheet/dist/profile.js +2 -0
  154. package/dist/node_modules/@allyhub-next/sheet/dist/rules.d.ts +56 -0
  155. package/dist/node_modules/@allyhub-next/sheet/dist/rules.js +2 -0
  156. package/dist/node_modules/@allyhub-next/sheet/dist/scenario.d.ts +42 -0
  157. package/dist/node_modules/@allyhub-next/sheet/dist/scenario.js +2 -0
  158. package/dist/node_modules/@allyhub-next/sheet/dist/series.d.ts +10 -0
  159. package/dist/node_modules/@allyhub-next/sheet/dist/series.js +2 -0
  160. package/dist/node_modules/@allyhub-next/sheet/dist/sort.d.ts +24 -0
  161. package/dist/node_modules/@allyhub-next/sheet/dist/sort.js +2 -0
  162. package/dist/node_modules/@allyhub-next/sheet/dist/structure.d.ts +38 -0
  163. package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +2 -0
  164. package/dist/node_modules/@allyhub-next/sheet/dist/validate.d.ts +26 -0
  165. package/dist/node_modules/@allyhub-next/sheet/dist/validate.js +2 -0
  166. package/dist/node_modules/@allyhub-next/sheet/dist/values.d.ts +67 -0
  167. package/dist/node_modules/@allyhub-next/sheet/dist/values.js +2 -0
  168. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +315 -0
  169. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +2 -0
  170. package/dist/node_modules/@allyhub-next/sheet/dist/write.d.ts +5 -0
  171. package/dist/node_modules/@allyhub-next/sheet/dist/write.js +21 -0
  172. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +44 -0
  173. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +2 -0
  174. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/colors.d.ts +19 -0
  175. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/colors.js +2 -0
  176. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +21 -0
  177. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +4 -0
  178. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +5 -0
  179. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +17 -0
  180. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +47 -0
  181. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +2 -0
  182. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/index.d.ts +5 -0
  183. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/index.js +2 -0
  184. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/numfmt.d.ts +8 -0
  185. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/numfmt.js +2 -0
  186. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +118 -0
  187. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -0
  188. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +23 -0
  189. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +2 -0
  190. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/theme.d.ts +3 -0
  191. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/theme.js +2 -0
  192. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +17 -0
  193. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +2 -0
  194. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/xml.d.ts +28 -0
  195. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/xml.js +3 -0
  196. package/dist/node_modules/@allyhub-next/sheet/package.json +21 -0
  197. package/dist/node_modules/@allyhub-next/slides-core/LICENSE +241 -0
  198. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/api.d.ts +64 -7
  199. package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +4 -0
  200. package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +2 -0
  201. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/chart-api.d.ts +24 -1
  202. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +2 -0
  203. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/chart-file.d.ts +1 -1
  204. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +2 -0
  205. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/enums.d.ts +20 -0
  206. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +2 -0
  207. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/index.d.ts +2 -1
  208. package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +2 -0
  209. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/model.d.ts +39 -6
  210. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/office.d.ts +10 -0
  211. package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +2 -0
  212. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.d.ts +5 -0
  213. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +2 -0
  214. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/resolve.d.ts +8 -3
  215. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +2 -0
  216. package/dist/node_modules/@allyhub-next/slides-core/dist/strict.d.ts +7 -0
  217. package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +2 -0
  218. package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/package.json +1 -1
  219. package/dist/node_modules/@allyhub-next/video-core/LICENSE +241 -0
  220. package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/fact.d.ts +8 -2
  221. package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
  222. package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/formats.d.ts +0 -28
  223. package/dist/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
  224. package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/measure.d.ts +10 -0
  225. package/dist/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
  226. package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/problem.d.ts +5 -1
  227. package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
  228. package/{node_modules → dist/node_modules}/@allyhub-next/video-core/package.json +1 -1
  229. package/dist/phone.js +1 -1
  230. package/dist/sheets.d.ts +2 -0
  231. package/dist/sheets.js +2 -0
  232. package/docs/README.md +2 -2
  233. package/docs/defaults.md +24 -0
  234. package/docs/project.md +1 -1
  235. package/docs/scenery.md +1 -1
  236. package/docs/sheets.md +402 -84
  237. package/docs/slides.md +5 -5
  238. package/docs/speech.md +1 -1
  239. package/package.json +11 -19
  240. package/node_modules/@allyhub-next/formats/dist/data/reference.js +0 -2
  241. package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +0 -214
  242. package/node_modules/@allyhub-next/formats/dist/data/sheet.js +0 -2
  243. package/node_modules/@allyhub-next/formats/dist/data/slides.js +0 -2
  244. package/node_modules/@allyhub-next/formats/dist/index.js +0 -2
  245. package/node_modules/@allyhub-next/formats/dist/items.js +0 -2
  246. package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +0 -719
  247. package/node_modules/@allyhub-next/formats/dist/schemas.js +0 -2
  248. package/node_modules/@allyhub-next/protocol/dist/editor.js +0 -2
  249. package/node_modules/@allyhub-next/protocol/dist/notes.js +0 -2
  250. package/node_modules/@allyhub-next/protocol/dist/tools.js +0 -2
  251. package/node_modules/@allyhub-next/runtimes/dist/lock.js +0 -2
  252. package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +0 -3
  253. package/node_modules/@allyhub-next/runtimes/pins/exceljs/package-lock.json +0 -2533
  254. package/node_modules/@allyhub-next/runtimes/pins/exceljs/package.json +0 -8
  255. package/node_modules/@allyhub-next/scenery/dist/phone.js +0 -2
  256. package/node_modules/@allyhub-next/slides-core/dist/api.js +0 -4
  257. package/node_modules/@allyhub-next/slides-core/dist/capabilities.js +0 -2
  258. package/node_modules/@allyhub-next/slides-core/dist/chart-api.js +0 -2
  259. package/node_modules/@allyhub-next/slides-core/dist/chart-file.js +0 -2
  260. package/node_modules/@allyhub-next/slides-core/dist/chart.js +0 -2
  261. package/node_modules/@allyhub-next/slides-core/dist/enums.js +0 -2
  262. package/node_modules/@allyhub-next/slides-core/dist/index.js +0 -2
  263. package/node_modules/@allyhub-next/slides-core/dist/office.js +0 -2
  264. package/node_modules/@allyhub-next/slides-core/dist/resolve.js +0 -2
  265. package/node_modules/@allyhub-next/slides-core/dist/strict.d.ts +0 -23
  266. package/node_modules/@allyhub-next/slides-core/dist/strict.js +0 -2
  267. package/node_modules/@allyhub-next/video-core/dist/fact.js +0 -2
  268. package/node_modules/@allyhub-next/video-core/dist/formats.js +0 -2
  269. package/node_modules/@allyhub-next/video-core/dist/measure.js +0 -5
  270. package/node_modules/@allyhub-next/video-core/dist/problem.js +0 -2
  271. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/LICENSE +0 -0
  272. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/at-cut.d.ts +0 -0
  273. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/at-cut.js +0 -0
  274. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/decode.d.ts +0 -0
  275. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/decode.js +0 -0
  276. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/envelope.d.ts +0 -0
  277. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/envelope.js +0 -0
  278. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/index.d.ts +0 -0
  279. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/index.js +0 -0
  280. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/levels.d.ts +0 -0
  281. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/levels.js +0 -0
  282. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/master.d.ts +0 -0
  283. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/master.js +0 -0
  284. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/music.d.ts +0 -0
  285. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/music.js +0 -0
  286. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/decode.d.ts +0 -0
  287. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/decode.js +0 -0
  288. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -0
  289. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ebur128.js +0 -0
  290. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -0
  291. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/ffmpeg.js +0 -0
  292. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/index.d.ts +0 -0
  293. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/index.js +0 -0
  294. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/loudness.d.ts +0 -0
  295. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/loudness.js +0 -0
  296. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/master.d.ts +0 -0
  297. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/master.js +0 -0
  298. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/measure.d.ts +0 -0
  299. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/measure.js +0 -0
  300. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/mix.d.ts +0 -0
  301. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/node/mix.js +0 -0
  302. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/plan.d.ts +0 -0
  303. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/plan.js +0 -0
  304. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recorded.d.ts +0 -0
  305. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recorded.js +0 -0
  306. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -0
  307. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/bandwidth.js +0 -0
  308. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/chain.d.ts +0 -0
  309. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/chain.js +0 -0
  310. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -0
  311. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/dynamics.js +0 -0
  312. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fft.d.ts +0 -0
  313. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fft.js +0 -0
  314. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/filters.d.ts +0 -0
  315. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/filters.js +0 -0
  316. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fit.d.ts +0 -0
  317. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/fit.js +0 -0
  318. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/index.d.ts +0 -0
  319. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/index.js +0 -0
  320. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -0
  321. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/loudness.js +0 -0
  322. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/measure.d.ts +0 -0
  323. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/measure.js +0 -0
  324. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/mic.d.ts +0 -0
  325. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/mic.js +0 -0
  326. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/noise.d.ts +0 -0
  327. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/noise.js +0 -0
  328. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/presets.d.ts +0 -0
  329. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/presets.js +0 -0
  330. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/room.d.ts +0 -0
  331. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/room.js +0 -0
  332. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/setup.d.ts +0 -0
  333. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/setup.js +0 -0
  334. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/vec.d.ts +0 -0
  335. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/recording/vec.js +0 -0
  336. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/render.d.ts +0 -0
  337. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/render.js +0 -0
  338. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/sfx.d.ts +0 -0
  339. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/sfx.js +0 -0
  340. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/shape.d.ts +0 -0
  341. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/shape.js +0 -0
  342. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/voice.d.ts +0 -0
  343. /package/{node_modules → dist/node_modules}/@allyhub-next/audio/dist/voice.js +0 -0
  344. /package/{node_modules/@allyhub-next/formats → dist/node_modules/@allyhub-next/chart}/LICENSE +0 -0
  345. /package/{node_modules/@allyhub-next/protocol → dist/node_modules/@allyhub-next/formats}/LICENSE +0 -0
  346. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/comments.d.ts +0 -0
  347. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/comments.js +0 -0
  348. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/config.d.ts +0 -0
  349. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/config.js +0 -0
  350. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/edits.d.ts +0 -0
  351. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/edits.js +0 -0
  352. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/elements.d.ts +0 -0
  353. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/elements.js +0 -0
  354. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/faces.d.ts +0 -0
  355. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/faces.js +0 -0
  356. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/file.d.ts +0 -0
  357. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/file.js +0 -0
  358. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/gen.d.ts +0 -0
  359. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/gen.js +0 -0
  360. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/messages.d.ts +0 -0
  361. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/messages.js +0 -0
  362. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/script.d.ts +0 -0
  363. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/script.js +0 -0
  364. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/words.d.ts +0 -0
  365. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/data/words.js +0 -0
  366. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/layout.d.ts +0 -0
  367. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/layout.js +0 -0
  368. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/note-shape.d.ts +0 -0
  369. /package/{node_modules → dist/node_modules}/@allyhub-next/formats/dist/note-shape.js +0 -0
  370. /package/{node_modules/@allyhub-next/runtimes → dist/node_modules/@allyhub-next/protocol}/LICENSE +0 -0
  371. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/app.d.ts +0 -0
  372. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/app.js +0 -0
  373. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/auth.d.ts +0 -0
  374. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/auth.js +0 -0
  375. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cli.d.ts +0 -0
  376. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cli.js +0 -0
  377. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cloud.d.ts +0 -0
  378. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/cloud.js +0 -0
  379. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/files.d.ts +0 -0
  380. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/files.js +0 -0
  381. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/index.d.ts +0 -0
  382. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/index.js +0 -0
  383. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/jsonrpc.d.ts +0 -0
  384. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/jsonrpc.js +0 -0
  385. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/registry.d.ts +0 -0
  386. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/registry.js +0 -0
  387. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/routes.d.ts +0 -0
  388. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/routes.js +0 -0
  389. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/runtimes.d.ts +0 -0
  390. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/runtimes.js +0 -0
  391. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/teams.d.ts +0 -0
  392. /package/{node_modules → dist/node_modules}/@allyhub-next/protocol/dist/teams.js +0 -0
  393. /package/{node_modules/@allyhub-next/scenery → dist/node_modules/@allyhub-next/runtimes}/LICENSE +0 -0
  394. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/bundled.d.ts +0 -0
  395. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/bundled.js +0 -0
  396. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/download.d.ts +0 -0
  397. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/download.js +0 -0
  398. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/errors.d.ts +0 -0
  399. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/errors.js +0 -0
  400. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/home.d.ts +0 -0
  401. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/home.js +0 -0
  402. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/index.d.ts +0 -0
  403. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/index.js +0 -0
  404. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/manifest.d.ts +0 -0
  405. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/manifest.js +0 -0
  406. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/node-program.d.ts +0 -0
  407. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/node-program.js +0 -0
  408. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/packages.d.ts +0 -0
  409. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/packages.js +0 -0
  410. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/unpack.d.ts +0 -0
  411. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/dist/unpack.js +0 -0
  412. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/manifest.json +0 -0
  413. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/docx/package-lock.json +0 -0
  414. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/docx/package.json +0 -0
  415. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/gltf-tools/package-lock.json +0 -0
  416. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/gltf-tools/package.json +0 -0
  417. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/manifold-3d/package-lock.json +0 -0
  418. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/manifold-3d/package.json +0 -0
  419. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/onnxruntime-node/package-lock.json +0 -0
  420. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/onnxruntime-node/package.json +0 -0
  421. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -0
  422. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/sherpa-onnx-node/package.json +0 -0
  423. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/tesseract.js/package-lock.json +0 -0
  424. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/pins/tesseract.js/package.json +0 -0
  425. /package/{node_modules → dist/node_modules}/@allyhub-next/runtimes/schemas/runtimes.schema.json +0 -0
  426. /package/{node_modules/@allyhub-next/slides-core → dist/node_modules/@allyhub-next/scenery}/LICENSE +0 -0
  427. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/NOTICE +0 -0
  428. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/aim.d.ts +0 -0
  429. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/aim.js +0 -0
  430. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/bake.d.ts +0 -0
  431. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/bake.js +0 -0
  432. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/camera.d.ts +0 -0
  433. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/camera.js +0 -0
  434. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/curve.d.ts +0 -0
  435. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/curve.js +0 -0
  436. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/define.d.ts +0 -0
  437. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/define.js +0 -0
  438. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/fit.d.ts +0 -0
  439. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/fit.js +0 -0
  440. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/glass.d.ts +0 -0
  441. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/glass.js +0 -0
  442. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/handheld.d.ts +0 -0
  443. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/handheld.js +0 -0
  444. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/hull.d.ts +0 -0
  445. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/hull.js +0 -0
  446. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/index.d.ts +0 -0
  447. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/index.js +0 -0
  448. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/lens.d.ts +0 -0
  449. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/lens.js +0 -0
  450. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/moire.js +0 -0
  451. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/motion.d.ts +0 -0
  452. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/motion.js +0 -0
  453. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/move.d.ts +0 -0
  454. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/move.js +0 -0
  455. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/noise.d.ts +0 -0
  456. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/noise.js +0 -0
  457. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/report.d.ts +0 -0
  458. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/report.js +0 -0
  459. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen-focus.d.ts +0 -0
  460. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen-focus.js +0 -0
  461. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen.d.ts +0 -0
  462. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/screen.js +0 -0
  463. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/solve.d.ts +0 -0
  464. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/solve.js +0 -0
  465. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/timing.d.ts +0 -0
  466. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/timing.js +0 -0
  467. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/vec.d.ts +0 -0
  468. /package/{node_modules → dist/node_modules}/@allyhub-next/scenery/dist/vec.js +0 -0
  469. /package/{node_modules/@allyhub-next/video-core → dist/node_modules/@allyhub-next/sheet}/LICENSE +0 -0
  470. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/animation.d.ts +0 -0
  471. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/animation.js +0 -0
  472. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/capabilities.d.ts +0 -0
  473. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/check.d.ts +0 -0
  474. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/check.js +0 -0
  475. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/file.d.ts +0 -0
  476. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/file.js +0 -0
  477. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/measure.d.ts +0 -0
  478. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/measure.js +0 -0
  479. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/model.js +0 -0
  480. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/path.d.ts +0 -0
  481. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/path.js +0 -0
  482. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/placeholders.d.ts +0 -0
  483. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/placeholders.js +0 -0
  484. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/script.d.ts +0 -0
  485. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/script.js +0 -0
  486. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/stage.d.ts +0 -0
  487. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/stage.js +0 -0
  488. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/theme.d.ts +0 -0
  489. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/theme.js +0 -0
  490. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/units.d.ts +0 -0
  491. /package/{node_modules → dist/node_modules}/@allyhub-next/slides-core/dist/units.js +0 -0
  492. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/anchors.d.ts +0 -0
  493. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/anchors.js +0 -0
  494. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/audio-types.d.ts +0 -0
  495. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/audio-types.js +0 -0
  496. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/backdrop.d.ts +0 -0
  497. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/backdrop.js +0 -0
  498. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/captions.d.ts +0 -0
  499. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/captions.js +0 -0
  500. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/console.d.ts +0 -0
  501. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/console.js +0 -0
  502. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/contrast.d.ts +0 -0
  503. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/contrast.js +0 -0
  504. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/cut-report.d.ts +0 -0
  505. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/cut-report.js +0 -0
  506. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edit.d.ts +0 -0
  507. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edit.js +0 -0
  508. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edits.d.ts +0 -0
  509. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/edits.js +0 -0
  510. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/export.d.ts +0 -0
  511. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/export.js +0 -0
  512. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/footage-motion.d.ts +0 -0
  513. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/footage-motion.js +0 -0
  514. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/gen.d.ts +0 -0
  515. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/gen.js +0 -0
  516. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/index.d.ts +0 -0
  517. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/index.js +0 -0
  518. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/look.d.ts +0 -0
  519. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/look.js +0 -0
  520. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/marks.d.ts +0 -0
  521. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/marks.js +0 -0
  522. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/matrix.d.ts +0 -0
  523. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/matrix.js +0 -0
  524. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/media.d.ts +0 -0
  525. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/media.js +0 -0
  526. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/messages.d.ts +0 -0
  527. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/messages.js +0 -0
  528. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/motion.d.ts +0 -0
  529. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/motion.js +0 -0
  530. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/music.d.ts +0 -0
  531. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/music.js +0 -0
  532. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/piece.d.ts +0 -0
  533. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/piece.js +0 -0
  534. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/placement.d.ts +0 -0
  535. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/placement.js +0 -0
  536. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/render-types.d.ts +0 -0
  537. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/render-types.js +0 -0
  538. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/schema.d.ts +0 -0
  539. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/schema.js +0 -0
  540. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script-edit.d.ts +0 -0
  541. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script-edit.js +0 -0
  542. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script.d.ts +0 -0
  543. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/script.js +0 -0
  544. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/seams.d.ts +0 -0
  545. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/seams.js +0 -0
  546. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/sound-under.d.ts +0 -0
  547. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/sound-under.js +0 -0
  548. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/speech.d.ts +0 -0
  549. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/speech.js +0 -0
  550. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timeline.d.ts +0 -0
  551. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timeline.js +0 -0
  552. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timing.d.ts +0 -0
  553. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/timing.js +0 -0
  554. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transcript.d.ts +0 -0
  555. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transcript.js +0 -0
  556. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transition.d.ts +0 -0
  557. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/transition.js +0 -0
  558. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/voice.d.ts +0 -0
  559. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/voice.js +0 -0
  560. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/words.d.ts +0 -0
  561. /package/{node_modules → dist/node_modules}/@allyhub-next/video-core/dist/words.js +0 -0
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{CellError as a,ERR as l,Matrix as R}from"../../values.js";import{toBool as q,toNumber as A}from"../coerce.js";import{Reference as P,Union as ot}from"../types.js";import{FUNCTIONS as ct,alias as O,cellsOf as B,eachRow as ft,many as y,number as U,numbersOf as T,raw as N,scalar as S}from"./define.js";import{besselI as it,besselJ as at,besselK as ut,besselY as lt,betaI as K,gammaQ as ht,normalCdf as mt}from"./special.js";const X=2**48;function H(e,r){const[t="0",n="0"]=e.toExponential().split("e");return+`${t}e${String(Number(n)+r)}`}const Mt=e=>Number(e.toPrecision(15));function G(e,r,t){const n=Math.trunc(r),s=Math.abs(Mt(e)),o=H(s,n);if(o>=2**53)return e;const c=H(t(o),-n);return e<0?-c:c}S("ROUND",2,2,U((e=0,r=0)=>G(e,r,t=>Math.floor(t+.5)))),S("ROUNDUP",2,2,U((e=0,r=0)=>G(e,r,Math.ceil))),S("ROUNDDOWN",2,2,U((e=0,r=0)=>G(e,r,Math.floor))),S("MOD",2,2,U((e=0,r=0)=>{if(r===0)return l.DIV0;const t=e%r;return t!==0&&t<0!=r<0?t+r:t})),S("QUOTIENT",2,2,U((e=0,r=0)=>r===0?l.DIV0:Math.trunc(e/r))),S("POWER",2,2,U((e=0,r=0)=>{if(e===0&&r===0)return l.NUM;if(e===0&&r<0)return l.DIV0;const t=e**r;return Number.isFinite(t)?t:l.NUM})),S("LOG",1,2,(e,r)=>{const t=A(e),n=r==null?10:A(r);return t instanceof a?t:n instanceof a?n:t<=0||n<=0?l.NUM:n===1?l.DIV0:n===10?Math.log10(t):n===2?Math.log2(t):Math.log(t)/Math.log(n)});function v(e,r){let[t,n]=[e,r];for(;n!==0;)[t,n]=[n,t%n];return t}function Y(e,r){const t=T(e,r);if(t instanceof a)return t;const n=t.map(Math.trunc);return n.some(s=>s<0||s>=2**53)?l.NUM:n}N("GCD",1,y,(e,r)=>{const t=Y(e,r);return t instanceof a?t:t.reduce(v,0)}),N("LCM",1,y,(e,r)=>{const t=Y(e,r);if(t instanceof a)return t;if(t.includes(0))return 0;const n=t.reduce((s,o)=>s*o/v(s,o),1);return Number.isFinite(n)?n:l.NUM}),S("BASE",2,3,U((e=0,r=0,t=Number.NaN)=>{const n=Math.trunc(e),s=Math.trunc(r),o=Number.isNaN(t)?0:Math.trunc(t);return n<0||n>=2**53||s<2||s>36||o<0||o>255?l.NUM:n.toString(s).toUpperCase().padStart(o,"0")}));const dt="MDCLXVI",z=[1e3,500,100,50,10,5,1];function Nt(e,r){const t=i=>z[i]??1,n=i=>dt.charAt(i),s=z.length-1;let o=e,c="";for(let i=0;i<=s/2;i++){const f=2*i,u=Math.floor(o/t(f));if(u%5===4){const h=u===4?f-1:f-2;let m=f,M=0;for(;M<r&&m<s;)M+=1,t(h)-t(m+1)<=o?m+=1:M=r;c+=n(m)+n(h),o+=t(m)-t(h)}else u>4&&(c+=n(f-1)),c+=n(f).repeat(u%5),o%=t(f)}return c}S("ROMAN",1,2,(e,r)=>{const t=A(e);if(t instanceof a)return t;let n=0;if(typeof r=="boolean")n=r?0:4;else if(r!=null){const o=A(r);if(o instanceof a)return o;n=Math.trunc(o)}const s=Math.trunc(t);return s<0||s>3999||n<0||n>4?l.VALUE:Nt(s,n)});function k(e){return!Number.isInteger(e)||e<0||e>=X?l.NUM:BigInt(e)}for(const[e,r]of[["BITAND",(t,n)=>t&n],["BITOR",(t,n)=>t|n],["BITXOR",(t,n)=>t^n]])S(e,2,2,U((t=0,n=0)=>{const s=k(t),o=k(n);return s instanceof a?s:o instanceof a?o:Number(r(s,o))}));for(const[e,r]of[["BITLSHIFT",1],["BITRSHIFT",-1]])S(e,2,2,U((t=0,n=0)=>{const s=k(t);if(s instanceof a)return s;const o=Math.trunc(n)*r;if(Math.abs(o)>53)return l.NUM;const c=o>=0?s<<BigInt(o):s>>BigInt(-o);return c>=BigInt(X)?l.NUM:Number(c)}));for(const[e,r,t]of[["BESSELJ",at,!1],["BESSELI",it,!1],["BESSELY",lt,!0],["BESSELK",ut,!0]])S(e,2,2,U((n=0,s=0)=>{const o=Math.trunc(s);if(o<0||t&&n<=0)return l.NUM;const c=r(o,n);return Number.isFinite(c)?c:l.NUM}));S("SLN",3,3,U((e=0,r=0,t=0)=>t===0?l.DIV0:(e-r)/t)),N("GEOMEAN",1,y,(e,r)=>{const t=T(e,r);return t instanceof a?t:t.length===0||t.some(n=>n<=0)?l.NUM:Math.exp(t.reduce((n,s)=>n+Math.log(s),0)/t.length)}),N("HARMEAN",1,y,(e,r)=>{const t=T(e,r);return t instanceof a?t:t.length===0||t.some(n=>n<=0)?l.NUM:t.length/t.reduce((n,s)=>n+1/s,0)}),N("KURT",1,y,(e,r)=>{const t=T(e,r);if(t instanceof a)return t;const n=t.length;if(n<4)return l.DIV0;const s=t.reduce((i,f)=>i+f,0)/n,o=t.reduce((i,f)=>i+(f-s)**2,0)/(n-1);if(o===0)return l.DIV0;const c=t.reduce((i,f)=>i+(f-s)**4,0)/o**2;return n*(n+1)/((n-1)*(n-2)*(n-3))*c-3*(n-1)**2/((n-2)*(n-3))});function W(e,r){const t=[];let n;return ft(e,r,(s,o)=>{if(!n){if(s instanceof a)n=s;else if(typeof s=="number")t.push(s);else if(o&&s!==null){const c=A(s);c instanceof a?n=c:t.push(c)}}}),n??t}N("MODE.SNGL",1,y,(e,r)=>{const t=W(e,r);if(t instanceof a)return t;const n=new Map;for(const c of t)n.set(c,(n.get(c)??0)+1);let s,o=1;for(const[c,i]of n)i>o&&(s=c,o=i);return s??l.NA}),O("MODE","MODE.SNGL"),N("MODE.MULT",1,y,(e,r)=>{const t=W(e,r);if(t instanceof a)return t;const n=new Map;for(const c of t)n.set(c,(n.get(c)??0)+1);let s=0;for(const c of n.values())s=Math.max(s,c);if(s<2)return l.NA;const o=[...n].filter(([,c])=>c===s).map(([c])=>c);return new R(o.length,1,o)});function pt(e,r){const t=r*(e.length-1),n=Math.floor(t),s=e[n]??0,o=e[n+1]??s;return s+(t-n)*(o-s)}N("QUARTILE.INC",2,2,(e,r)=>{const t=T([e[0]],r);if(t instanceof a)return t;const n=A(r.calc.scalar(e[1],r.frame));if(n instanceof a)return n;const s=Math.trunc(n);return t.length===0||s<0||s>4?l.NUM:pt([...t].sort((o,c)=>o-c),s/4)}),O("QUARTILE","QUARTILE.INC");function Z(e,r){const t=A(r.calc.scalar(e[0],r.frame));if(t instanceof a)return t;const n=T([e[1]],r);if(n instanceof a)return n;const s=e[2]===void 0?0:A(r.calc.scalar(e[2],r.frame));if(s instanceof a)return s;const o=n.filter(c=>c===t).length;return o===0?l.NA:{before:n.filter(c=>s===0?c>t:c<t).length,ties:o}}N("RANK.EQ",2,3,(e,r)=>{const t=Z(e,r);return t instanceof a?t:t.before+1}),N("RANK.AVG",2,3,(e,r)=>{const t=Z(e,r);return t instanceof a?t:t.before+(t.ties+1)/2}),O("RANK","RANK.EQ");function w(e,r){const t=B(e,r);if(t instanceof a)return t;const n=[];for(let s=0;s<t.rows;s++){const o=[];for(let c=0;c<t.cols;c++){const i=t.at(s,c);if(i instanceof a)return i;if(typeof i!="number")return l.VALUE;o.push(i)}n.push(o)}return n}const _=e=>new R(e.length,e[0]?.length??0,e.flat());function Et(e,r){const t=r[0]?.length??0;return e.map(n=>Array.from({length:t},(s,o)=>n.reduce((c,i,f)=>c+i*(r[f]?.[o]??0),0)))}N("MMULT",2,2,(e,r)=>{const t=w(e[0],r),n=w(e[1],r);return t instanceof a?t:n instanceof a?n:(t[0]?.length??0)!==n.length?l.VALUE:_(Et(t,n))});function x(e){const r=e.length,t=e.map((o,c)=>[...o,...Array.from({length:r},(i,f)=>c===f?1:0)]),n=(o,c)=>t[o]?.[c]??0;let s=1;for(let o=0;o<r;o++){let c=o;for(let f=o+1;f<r;f++)Math.abs(n(f,o))>Math.abs(n(c,o))&&(c=f);if(n(c,o)===0)return{determinant:0};if(c!==o){const[f=[],u=[]]=[t[o],t[c]];t[o]=u,t[c]=f,s=-s}const i=n(o,o);s*=i,t[o]=(t[o]??[]).map(f=>f/i);for(let f=0;f<r;f++){if(f===o)continue;const u=n(f,o),h=t[o]??[];t[f]=(t[f]??[]).map((m,M)=>m-u*(h[M]??0))}}return{determinant:s,inverse:t.map(o=>o.slice(r))}}const J=e=>e.length>0&&e.every(r=>r.length===e.length);N("MDETERM",1,1,(e,r)=>{const t=w(e[0],r);return t instanceof a?t:J(t)?x(t).determinant:l.VALUE}),N("MINVERSE",1,1,(e,r)=>{const t=w(e[0],r);if(t instanceof a)return t;if(!J(t))return l.VALUE;const{inverse:n}=x(t);return n?_(n):l.NUM}),S("MUNIT",1,1,U((e=0)=>{const r=Math.trunc(e);return r<1||r>73?l.VALUE:_(Array.from({length:r},(t,n)=>Array.from({length:r},(s,o)=>n===o?1:0)))}));function F(e,r,t){const n=B(e,t),s=B(r,t);if(n instanceof a)return n;if(s instanceof a)return s;if(n.rows*n.cols!==s.rows*s.cols)return l.NA;const o=[],c=[];for(let i=0;i<n.rows;i++)for(let f=0;f<n.cols;f++){const u=n.at(i,f),h=s.rows===n.rows?s.at(i,f):s.at(f,i);if(u instanceof a)return u;if(h instanceof a)return h;typeof u=="number"&&typeof h=="number"&&(o.push(u),c.push(h))}return{xs:o,ys:c}}for(const[e,r]of[["SUMX2MY2",(t,n)=>t*t-n*n],["SUMX2PY2",(t,n)=>t*t+n*n],["SUMXMY2",(t,n)=>(t-n)**2]])N(e,2,2,(t,n)=>{const s=F(t[0],t[1],n);return s instanceof a?s:s.xs.length===0?l.DIV0:s.xs.reduce((o,c,i)=>o+r(c,s.ys[i]??0),0)});N("SERIESSUM",4,4,(e,r)=>{const[t,n,s]=e.slice(0,3).map(c=>A(r.calc.scalar(c,r.frame)));if(t instanceof a)return t;if(n instanceof a)return n;if(s instanceof a)return s;const o=T([e[3]],r);return o instanceof a?o:o.reduce((c,i,f)=>c+i*(t??0)**((n??0)+f*(s??0)),0)}),N("FREQUENCY",2,2,(e,r)=>{const t=T([e[0]],r),n=T([e[1]],r);if(t instanceof a)return t;if(n instanceof a)return n;const s=n.map((c,i)=>({b:c,i})).sort((c,i)=>c.b-i.b),o=new Array(n.length+1).fill(0);for(const c of t){const i=s.find(u=>c<=u.b),f=i?i.i:n.length;o[f]=(o[f]??0)+1}return new R(o.length,1,o)}),N("PROB",3,4,(e,r)=>{const t=F(e[0],e[1],r);if(t instanceof a)return t;const n=A(r.calc.scalar(e[2],r.frame));if(n instanceof a)return n;const s=e[3]===void 0?n:A(r.calc.scalar(e[3],r.frame));if(s instanceof a)return s;const o=t.ys.reduce((c,i)=>c+i,0);return t.ys.some(c=>c<=0||c>1)||Math.abs(o-1)>1e-12?l.NUM:t.xs.reduce((c,i,f)=>i>=n&&i<=s?c+(t.ys[f]??0):c,0)});const $=e=>e.reduce((r,t)=>r+t,0);function j(e,r,t){const n=r.map(u=>t?[...u,1]:[...u]),s=n[0]?.length??0,o=Array.from({length:s},(u,h)=>Array.from({length:s},(m,M)=>n.reduce((E,g)=>E+(g[h]??0)*(g[M]??0),0))),{inverse:c}=x(o);if(!c)return;const i=Array.from({length:s},(u,h)=>n.reduce((m,M,E)=>m+(M[h]??0)*(e[E]??0),0)),f=c.map(u=>u.reduce((h,m,M)=>h+m*(i[M]??0),0));return t?f:[...f,0]}function tt(e,r,t){const n=w(e[0],r);if(n instanceof a)return n;const s=n.length===1,o=n.flat();if(t&&o.some(h=>h<=0))return l.NUM;const c=t?o.map(Math.log):o,i=e[1];if(i===void 0||!C(i))return{ys:c,xs:o.map((h,m)=>[m+1]),byRow:s};const f=w(i,r);if(f instanceof a)return f;const u=f[0]?.length??0;return s?u!==c.length?l.REF:{ys:c,xs:Array.from({length:u},(h,m)=>f.map(M=>M[m]??0)),byRow:s}:f.length!==c.length?l.REF:{ys:c,xs:f,byRow:s}}const C=e=>e instanceof P||e instanceof R||typeof e=="number",nt=(e,r)=>e===void 0||!C(e)&&typeof e!="boolean"?!0:q(r.calc.scalar(e,r.frame));function et(e){return(r,t)=>{const n=tt(r,t,e);if(n instanceof a)return n;const s=nt(r[3],t);if(s instanceof a)return s;const o=j(n.ys,n.xs,s);if(!o)return l.NUM;const c=r[2];let i=n.xs;if(c!==void 0&&C(c)){const u=w(c,t);if(u instanceof a)return u;const h=n.xs[0]?.length??1,m=u[0]?.length??0;i=n.byRow||h===1&&u.length===1?Array.from({length:m},(M,E)=>u.map(g=>g[E]??0)):u}const f=i.map(u=>{const h=u.reduce((m,M,E)=>m+M*(o[E]??0),0)+(o[u.length]??0);return e?Math.exp(h):h});return n.byRow?new R(1,f.length,f):new R(f.length,1,f)}}N("TREND",1,4,et(!1)),N("GROWTH",1,4,et(!0));function gt(e,r,t,n){const s=r.map(p=>n?[...p,1]:[...p]),o=s[0]?.length??0,{inverse:c}=x(Array.from({length:o},(p,d)=>Array.from({length:o},(b,D)=>s.reduce((st,Q)=>st+(Q[d]??0)*(Q[D]??0),0))));if(!c)return;const i=r.map(p=>p.reduce((d,b,D)=>d+b*(t[D]??0),0)+(t[p.length]??0)),f=e.reduce((p,d,b)=>p+(d-(i[b]??0))**2,0),u=n?$(e)/e.length:0,h=e.reduce((p,d)=>p+(d-u)**2,0),m=h-f,M=e.length-o,E=M>0?f/M:0,g=c.map((p,d)=>Math.sqrt(Math.max(0,(p[d]??0)*E))),I=r[0]?.length??0;return{errors:g,r2:h===0?1:m/h,sey:Math.sqrt(E),f:M>0&&f>0?m/I/(f/M):0,df:M,ssreg:m,ssresid:f}}function rt(e){return(r,t)=>{const n=tt(r,t,e);if(n instanceof a)return n;const s=nt(r[2],t);if(s instanceof a)return s;const o=j(n.ys,n.xs,s);if(!o)return l.NUM;const i=[...o.slice(0,-1).reverse(),o[o.length-1]??0],f=e?i.map(Math.exp):i,u=r[3],h=u===void 0||!At(u)?!1:q(t.calc.scalar(u,t.frame));if(h instanceof a)return h;if(!h)return new R(1,f.length,f);const m=gt(n.ys,n.xs,o,s);if(!m)return l.NUM;const M=f.length,E=I=>[...I,...new Array(M-I.length).fill(l.NA)],g=s?[...m.errors.slice(0,-1).reverse(),m.errors[m.errors.length-1]??0]:[...[...m.errors].reverse(),l.NA];return new R(5,M,[...f,...g,...E([m.r2,m.sey]),...E([m.f,m.df]),...E([m.ssreg,m.ssresid])])}}const At=e=>C(e)||typeof e=="boolean";N("LINEST",1,4,rt(!1)),N("LOGEST",1,4,rt(!0));const V=e=>$(e)/e.length,L=e=>{const r=V(e);return e.reduce((t,n)=>t+(n-r)**2,0)/(e.length-1)};N("CHISQ.TEST",2,2,(e,r)=>{const t=w(e[0],r),n=w(e[1],r);if(t instanceof a)return t;if(n instanceof a)return n;const s=t.length,o=t[0]?.length??0;if(n.length!==s||(n[0]?.length??0)!==o)return l.NA;if(s*o<2)return l.NA;let c=0;for(let f=0;f<s;f++)for(let u=0;u<o;u++){const h=n[f]?.[u]??0;if(h<0)return l.NUM;if(h===0)return l.DIV0;c+=((t[f]?.[u]??0)-h)**2/h}const i=s>1&&o>1?(s-1)*(o-1):s>1?s-1:o-1;return ht(i/2,c/2)}),O("CHITEST","CHISQ.TEST"),N("T.TEST",4,4,(e,r)=>{const t=A(r.calc.scalar(e[2],r.frame)),n=A(r.calc.scalar(e[3],r.frame));if(t instanceof a)return t;if(n instanceof a)return n;const s=Math.trunc(t),o=Math.trunc(n);if(s!==1&&s!==2||o<1||o>3)return l.NUM;let c,i;if(o===1){const u=F(e[0],e[1],r);if(u instanceof a)return u;const h=u.xs.map((m,M)=>m-(u.ys[M]??0));if(h.length<2)return l.DIV0;c=V(h)/Math.sqrt(L(h)/h.length),i=h.length-1}else{const u=T([e[0]],r),h=T([e[1]],r);if(u instanceof a)return u;if(h instanceof a)return h;if(u.length<2||h.length<2)return l.DIV0;const[m,M,E,g]=[L(u),L(h),u.length,h.length],I=Math.abs(V(u)-V(h));if(o===2){i=E+g-2;const p=((E-1)*m+(g-1)*M)/i;c=I/Math.sqrt(p*(1/E+1/g))}else{const p=m/E,d=M/g;c=I/Math.sqrt(p+d),i=(p+d)**2/(p**2/(E-1)+d**2/(g-1))}}return Number.isFinite(c)?K(i/2,.5,i/(i+c*c))*s/2:l.DIV0}),O("TTEST","T.TEST"),N("F.TEST",2,2,(e,r)=>{const t=T([e[0]],r),n=T([e[1]],r);if(t instanceof a)return t;if(n instanceof a)return n;if(t.length<2||n.length<2)return l.DIV0;const[s,o]=[L(t),L(n)];if(s===0||o===0)return l.DIV0;const c=s/o,[i,f]=[t.length-1,n.length-1],u=K(f/2,i/2,f/(i*c+f));return 2*Math.min(u,1-u)}),O("FTEST","F.TEST"),N("Z.TEST",2,3,(e,r)=>{const t=T([e[0]],r);if(t instanceof a)return t;const n=A(r.calc.scalar(e[1],r.frame));if(n instanceof a)return n;if(t.length===0)return l.NA;const s=e[2]===void 0?t.length<2?l.DIV0:Math.sqrt(L(t)):A(r.calc.scalar(e[2],r.frame));return s instanceof a?s:s===0?l.DIV0:1-mt((V(t)-n)/(s/Math.sqrt(t.length)))}),O("ZTEST","Z.TEST");const Tt={1:"AVERAGE",2:"COUNT",3:"COUNTA",4:"MAX",5:"MIN",6:"PRODUCT",7:"STDEV.S",8:"STDEV.P",9:"SUM",10:"VAR.S",11:"VAR.P",12:"MEDIAN",13:"MODE.SNGL",14:"LARGE",15:"SMALL",16:"PERCENTILE.INC",17:"QUARTILE.INC",18:"PERCENTILE.EXC",19:"QUARTILE.EXC"};N("AGGREGATE",3,y,(e,r)=>{const t=A(r.calc.scalar(e[0],r.frame)),n=A(r.calc.scalar(e[1],r.frame));if(t instanceof a)return t;if(n instanceof a)return n;const s=Tt[Math.trunc(t)],o=s===void 0?void 0:ct.get(s);if(o?.kind!=="raw")return l.VALUE;const c=![2,3,6,7].includes(Math.trunc(n)),i=[1,3,5,7].includes(Math.trunc(n)),f=M=>{const E=M instanceof ot?M.parts:[M],g=[];for(const p of E)if(p instanceof P){const d=p;for(let b=d.top;b<=Math.min(d.bottom,d.sheet.lastRow);b++)if(!(i&&(d.sheet.spec.rows?.[String(b+1)]?.hidden===!0||r.calc.filtered(d.sheet).has(b))))for(let D=d.left;D<=d.right;D++)g.push(r.calc.read(d.sheet,b,D))}else{const d=r.calc.flat(p);d instanceof R?g.push(...d.data):g.push(d)}const I=c?g:g.filter(p=>!(p instanceof a));return new R(I.length,1,I)},u=Math.trunc(t)>=14,h=e.slice(2),m=u?[f(h[0]),...h.slice(1)]:h.map(f);return o.call(m,r)});
@@ -0,0 +1,29 @@
1
+ /** log Γ(x), x > 0. */
2
+ export declare function logGamma(x: number): number;
3
+ /** Γ(x); NaN at 0 and the negative integers. */
4
+ export declare function gamma(x: number): number;
5
+ /** The regularized lower incomplete gamma function P(a, x). */
6
+ export declare function gammaP(a: number, x: number): number;
7
+ /** The regularized upper incomplete gamma function Q(a, x). */
8
+ export declare function gammaQ(a: number, x: number): number;
9
+ /** The regularized incomplete beta function I_x(a, b). */
10
+ export declare function betaI(a: number, b: number, x: number): number;
11
+ export declare const erf: (x: number) => number;
12
+ export declare const erfc: (x: number) => number;
13
+ /** The standard normal density. */
14
+ export declare const normalPdf: (z: number) => number;
15
+ /** The standard normal distribution function. */
16
+ export declare const normalCdf: (z: number) => number;
17
+ /** The standard normal quantile, 0 < p < 1. */
18
+ export declare function normalInv(p: number): number;
19
+ /** Where a rising function of x reaches `target`: bisection on a bracket found from `start`. */
20
+ export declare function solve(f: (x: number) => number, target: number, low: number, start: number, high?: number): number;
21
+ /** J_n(x), n ≥ 0: Bessel's integral, on which the trapezoid rule converges at once. */
22
+ export declare function besselJ(n: number, x: number): number;
23
+ /** Y_n(x), n ≥ 0, x > 0. */
24
+ export declare function besselY(n: number, x: number): number;
25
+ /** I_n(x), n ≥ 0. */
26
+ export declare function besselI(n: number, x: number): number;
27
+ /** K_n(x), n ≥ 0, x > 0. */
28
+ export declare function besselK(n: number, x: number): number;
29
+ //# sourceMappingURL=special.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ const m=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.00016431823292116355,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],S=607/128,T=.5*Math.log(2*Math.PI);export function logGamma(t){if(Number.isInteger(t)&&t<=171)return Math.log(gamma(t));let e=m[0]??0;for(let s=1;s<m.length;s++)e+=(m[s]??0)/(t+s);const o=t+S+.5;return T+Math.log(e/t)+(t+.5)*Math.log(o)-o}export function gamma(t){if(t<=0&&Number.isInteger(t))return Number.NaN;if(Number.isInteger(t)&&t<=171){let e=1;for(let o=2;o<t;o++)e*=o;return e}return t<.5?Math.PI/(Math.sin(Math.PI*t)*gamma(1-t)):Math.exp(logGamma(t))}const I=1e-16,c=1e-300,b=1e5;export function gammaP(t,e){if(e<=0)return 0;if(e<t+1){let o=1/t,s=o,r=t;for(let a=0;a<b&&(r+=1,o*=e/r,s+=o,!(Math.abs(o)<Math.abs(s)*I));a++);return s*Math.exp(-e+t*Math.log(e)-logGamma(t))}return 1-gammaQ(t,e)}export function gammaQ(t,e){if(e<=0)return 1;if(e<t+1)return 1-gammaP(t,e);let o=e+1-t,s=1/c,r=1/o,a=r;for(let n=1;n<b;n++){const h=-n*(n-t);o+=2,r=h*r+o,Math.abs(r)<c&&(r=c),s=o+h/s,Math.abs(s)<c&&(s=c),r=1/r;const M=r*s;if(a*=M,Math.abs(M-1)<I)break}return Math.exp(-e+t*Math.log(e)-logGamma(t))*a}function g(t,e,o){const s=t+e,r=t+1,a=t-1;let n=1,h=1-s*o/r;Math.abs(h)<c&&(h=c),h=1/h;let M=h;for(let i=1;i<b;i++){const p=2*i;let u=i*(e-i)*o/((a+p)*(t+p));h=1+u*h,Math.abs(h)<c&&(h=c),n=1+u/n,Math.abs(n)<c&&(n=c),h=1/h,M*=h*n,u=-(t+i)*(s+i)*o/((t+p)*(r+p)),h=1+u*h,Math.abs(h)<c&&(h=c),n=1+u/n,Math.abs(n)<c&&(n=c),h=1/h;const P=h*n;if(M*=P,Math.abs(P-1)<I)break}return M}export function betaI(t,e,o){if(o<=0)return 0;if(o>=1)return 1;const s=Math.exp(logGamma(t+e)-logGamma(t)-logGamma(e)+t*Math.log(o)+e*Math.log1p(-o));return o<(t+1)/(t+e+2)?s*g(t,e,o)/t:1-s*g(e,t,1-o)/e}export const erf=t=>t===0?0:(t<0?-1:1)*gammaP(.5,t*t),erfc=t=>t<0?2-erfc(-t):gammaQ(.5,t*t),normalPdf=t=>Math.exp(-t*t/2)/Math.sqrt(2*Math.PI),normalCdf=t=>erfc(-t/Math.SQRT2)/2;const l=(t,e)=>t.reduce((o,s)=>o*e+s,0),f={a:[2509.0859296330846,33430.57558358813,67265.7709270087,45921.95393154987,13731.69376550946,1971.5909503065513,133.14166789178438,3.3871328727963665],b:[5226.495278852854,28729.085735721943,39307.89580009271,21213.794301586597,5394.196021424751,687.1870074920579,42.31333070160091,1],c:[.0007745450142783414,.022723844989269184,.2417807251774506,1.2704582524523684,3.6478483247632045,5.769497221460691,4.630337846156546,1.4234371107496837],d:[10507500716444169e-25,.0005475938084995344,.015198666563616457,.14810397642748008,.6897673349851,1.6763848301838038,2.053191626637759,1],e:[20103343992922881e-23,27115555687434876e-21,.0012426609473880784,.026532189526576124,.29656057182850487,1.7848265399172913,5.463784911164114,6.657904643501104],f:[20442631033899397e-31,1421511758316446e-22,18463183175100548e-21,.0007868691311456133,.014875361290850615,.1369298809227358,.599832206555888,1]};export function normalInv(t){const e=t-.5;if(e===0)return 0;if(Math.abs(e)<=.425){const a=.180625-e*e;return e*l(f.a,a)/l(f.b,a)}const o=e<0?t:1-t,s=Math.sqrt(-Math.log(o)),r=s<=5?l(f.c,s-1.6)/l(f.d,s-1.6):l(f.e,s-5)/l(f.f,s-5);return e<0?-r:r}export function solve(t,e,o,s,r=Number.POSITIVE_INFINITY){let a=o,n=Math.min(s,r);for(;t(n)<e&&n<r;)a=n,n=Math.min(n*2+1,r);for(let h=0;h<400;h++){const M=(a+n)/2;if(M===a||M===n)return M;t(M)<e?a=M:n=M}return(a+n)/2}function N(t,e,o,s){const r=(o-e)/s;let a=t(e)+t(o);for(let n=1;n<s;n++)a+=t(e+n*r)*(n%2===1?4:2);return a*r/3}const d=4e4;export function besselJ(t,e){const o=Math.max(256,4*Math.ceil(Math.abs(e)+t)+256),s=Math.PI/o;let r=.5*(Math.cos(0)+Math.cos(t*Math.PI));for(let a=1;a<o;a++){const n=a*s;r+=Math.cos(t*n-e*Math.sin(n))}return r*s/Math.PI}export function besselY(t,e){const o=N(n=>Math.sin(e*Math.sin(n)-t*n),0,Math.PI,d),s=Math.asinh((760+2*t*t)/e)+2,r=t%2===0?1:-1,a=N(n=>(Math.exp(t*n)+r*Math.exp(-t*n))*Math.exp(-e*Math.sinh(n)),0,s,d);return(o-a)/Math.PI}export function besselI(t,e){const o=Math.max(256,4*Math.ceil(Math.abs(e)+t)+256),s=Math.PI/o;let r=.5*(Math.exp(e)+Math.exp(-e)*Math.cos(t*Math.PI));for(let a=1;a<o;a++){const n=a*s;r+=Math.exp(e*Math.cos(n))*Math.cos(t*n)}return r*s/Math.PI}export function besselK(t,e){const o=Math.acosh(760/e+1)+2+t,s=4096,r=o/s;let a=.5*Math.exp(-e);for(let n=1;n<=s;n++){const h=n*r;a+=Math.exp(-e*Math.cosh(h))*Math.cosh(t*h)}return a*r}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=text.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{format as M,isValidFormat as D}from"numfmt";import{CellError as i,ERR as d}from"../../values.js";import{numberOfText as V,toBool as $,toNumber as h,toText as l}from"../coerce.js";import{alias as F,cellsOf as H,eachRow as N,many as C,number as x,raw as b,scalar as u}from"./define.js";import{wildcard as S}from"./criteria.js";const p=n=>r=>{const t=l(r);return t instanceof i?t:n(t)},m=(n,r)=>{if(n===void 0)return r;const t=h(n);return t instanceof i?t:t<0?d.VALUE:Math.trunc(t)},O=(n,r)=>Array.from(n,t=>{const e=r(t);return e.length===t.length?e:t}).join(""),I=n=>O(n,r=>r.toUpperCase()),R=n=>O(n,r=>r.toLowerCase());u("LEFT",1,2,(n,r)=>{const t=l(n),e=m(r,1);return t instanceof i?t:e instanceof i?e:t.slice(0,e)}),u("RIGHT",1,2,(n,r)=>{const t=l(n),e=m(r,1);return t instanceof i?t:e instanceof i?e:e===0?"":t.slice(-e)}),u("MID",3,3,(n,r,t)=>{const e=l(n),s=h(r),o=m(t,0);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;if(s<1)return d.VALUE;const c=Math.trunc(s)-1;return e.slice(c,c+o)}),u("LEN",1,1,p(n=>n.length)),u("LOWER",1,1,p(R)),u("UPPER",1,1,p(I)),u("PROPER",1,1,p(n=>R(n).replace(/(^|[^\p{L}])(\p{L})/gu,(r,t,e)=>`${t}${I(e)}`))),u("TRIM",1,1,p(n=>n.replace(/ +/gu," ").replace(/^ | $/gu,""))),u("CLEAN",1,1,p(n=>n.replace(/[\u0000-\u001f]/gu,""))),u("T",1,1,n=>typeof n=="string"?n:""),u("EXACT",2,2,(n,r)=>{const t=l(n),e=l(r);return t instanceof i?t:e instanceof i?e:t===e}),u("REPT",2,2,(n,r)=>{const t=l(n),e=m(r,0);return t instanceof i?t:e instanceof i?e:t.length*e>32767?d.VALUE:t.repeat(e)}),u("CHAR",1,1,x(n=>{const r=Math.trunc(n);return r<1||r>255?d.VALUE:X(r)})),u("UNICHAR",1,1,x(n=>{const r=Math.trunc(n);return r<1||r>1114111?d.VALUE:String.fromCodePoint(r)})),u("CODE",1,1,p(n=>n===""?d.VALUE:n.charCodeAt(0))),u("UNICODE",1,1,p(n=>n.codePointAt(0)??d.VALUE));const B="€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ";function X(n){return n>=128&&n<160?B.charAt(n-128):String.fromCharCode(n)}b("CONCAT",1,C,(n,r)=>{let t="",e;return N(n,r,s=>{if(e)return;const o=l(s);o instanceof i?e=o:t+=o}),e??t}),u("CONCATENATE",1,C,(...n)=>{let r="";for(const t of n){const e=l(t);if(e instanceof i)return e;r+=e}return r}),b("TEXTJOIN",3,C,(n,r)=>{const[t,e,...s]=n,o=H(t??"",r);if(o instanceof i)return o;const c=[];for(let E=0;E<o.rows;E++)for(let L=0;L<o.cols;L++){const g=l(o.at(E,L));if(g instanceof i)return g;c.push(g)}const a=$(r.calc.scalar(e??!0,r.frame));if(a instanceof i)return a;const f=[];let A;if(N(s,r,E=>{if(A)return;const L=l(E);L instanceof i?A=L:(!a||L!=="")&&f.push(L)}),A)return A;let U=f[0]??"";for(let E=1;E<f.length;E++)U+=`${c.length>0?c[(E-1)%c.length]??"":""}${f[E]??""}`;return U}),u("SUBSTITUTE",3,4,(n,r,t,e)=>{const s=l(n),o=l(r),c=l(t);if(s instanceof i)return s;if(o instanceof i)return o;if(c instanceof i)return c;if(o==="")return s;if(e===void 0)return s.split(o).join(c);const a=h(e);if(a instanceof i)return a;if(a<1)return d.VALUE;let f=-1;for(let A=0;A<Math.trunc(a);A++)if(f=s.indexOf(o,f+1),f<0)return s;return`${s.slice(0,f)}${c}${s.slice(f+o.length)}`}),u("REPLACE",4,4,(n,r,t,e)=>{const s=l(n),o=h(r),c=m(t,0),a=l(e);if(s instanceof i)return s;if(o instanceof i)return o;if(c instanceof i)return c;if(a instanceof i)return a;if(o<1)return d.VALUE;const f=Math.trunc(o)-1;return`${s.slice(0,f)}${a}${s.slice(f+c)}`}),u("FIND",2,3,(n,r,t)=>{const e=l(n),s=l(r),o=t===void 0?1:h(t);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;if(o<1||o>s.length+1)return d.VALUE;const c=s.indexOf(e,Math.trunc(o)-1);return c<0?d.VALUE:c+1}),u("SEARCH",2,3,(n,r,t)=>{const e=l(n),s=l(r),o=t===void 0?1:h(t);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;if(o<1||o>s.length+1)return d.VALUE;const c=Math.trunc(o)-1,a=S(`${e}*`);for(let f=c;f<=s.length;f++)if(a(s.slice(f)))return f+1;return d.VALUE}),u("VALUE",1,1,n=>typeof n=="number"?n:n==null?0:typeof n!="string"?d.VALUE:V(n)??d.VALUE),u("NUMBERVALUE",1,3,(n,r,t)=>{const e=l(n),s=l(r??"."),o=l(t??",");if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;const c=e.replace(/\s/gu,"").split(o).join("").replace(s,".");if(c==="")return 0;const a=/%*$/u.exec(c)?.[0].length??0,f=Number(c.slice(0,c.length-a));return Number.isNaN(f)?d.VALUE:f/100**a}),u("TEXT",2,2,(n,r)=>{const t=l(r);if(t instanceof i)return t;if(!D(t))return d.VALUE;if(typeof n=="boolean")return n?"TRUE":"FALSE";const e=typeof n=="string"?V(n)??n:n??0;if(e instanceof i)return e;try{return M(t,e)}catch{return d.VALUE}});function y(n,r,t){const e=t?"#,##0":"0",s=r>0?`.${"0".repeat(r)}`:"";return M(`${e}${s}`,n)}const P=(n,r)=>{const t=10**r;return Math.sign(n)*Math.round(Math.abs(n)*t+1e-9)/t};u("FIXED",1,3,(n,r,t)=>{const e=h(n),s=r==null?2:h(r),o=t===void 0?!1:$(t);if(e instanceof i)return e;if(s instanceof i)return s;if(o instanceof i)return o;const c=Math.trunc(s);return y(P(e,c),Math.max(0,c),!o)}),u("DOLLAR",1,2,(n,r)=>{const t=h(n),e=r==null?2:h(r);if(t instanceof i)return t;if(e instanceof i)return e;const s=Math.trunc(e),o=y(Math.abs(P(t,s)),Math.max(0,s),!0);return t<0?`($${o})`:`$${o}`});function j(n,r,t,e,s){const o=e?R(n):n,c=e?R(r):r,a=[];for(let f=o.indexOf(c);f>=0&&c!=="";)a.push({at:f,length:c.length}),f=o.indexOf(c,f+c.length);return t>0?(s&&a.push({at:n.length,length:0}),a[t-1]):(s&&a.unshift({at:0,length:0}),a[a.length+t])}function w(n){return(...r)=>{const[t,e,s,o,c,a]=r,f=l(t),A=l(e),U=s==null?1:h(s),E=o==null?0:h(o),L=c==null?0:h(c);if(f instanceof i)return f;if(A instanceof i)return A;if(U instanceof i)return U;if(E instanceof i)return E;if(L instanceof i)return L;const g=Math.trunc(U);if(g===0||Math.abs(g)>Math.max(f.length,1))return d.VALUE;if(A==="")return g>0===(n==="before")?"":f;const T=j(f,A,g,E===1,L===1);return T?n==="before"?f.slice(0,T.at):f.slice(T.at+T.length):a===void 0?d.NA:a}}u("TEXTBEFORE",2,6,w("before"),{errors:!0}),u("TEXTAFTER",2,6,w("after"),{errors:!0}),u("HYPERLINK",1,2,(n,r)=>r===void 0?n??null:r),u("ENCODEURL",1,1,p(n=>encodeURIComponent(n)));for(const n of["LEN","LEFT","RIGHT","MID","FIND","SEARCH","REPLACE"])F(`${n}B`,n);
@@ -0,0 +1,50 @@
1
+ import type { Node } from "../formula/ast.js";
2
+ import type { Matrix, Scalar } from "../values.js";
3
+ import type { Worksheet } from "../workbook.js";
4
+ export declare class Reference {
5
+ readonly sheet: Worksheet;
6
+ readonly top: number;
7
+ readonly left: number;
8
+ readonly bottom: number;
9
+ readonly right: number;
10
+ constructor(sheet: Worksheet, top: number, left: number, bottom: number, right: number);
11
+ get rows(): number;
12
+ get cols(): number;
13
+ get single(): boolean;
14
+ /** The same place, as a key. */
15
+ get key(): string;
16
+ }
17
+ /** Several places at once: (A1,C3), or a 3D reference. */
18
+ export declare class Union {
19
+ readonly parts: readonly Reference[];
20
+ constructor(parts: readonly Reference[]);
21
+ }
22
+ /** A LAMBDA, with what it closes over. */
23
+ export declare class Lambda {
24
+ readonly params: readonly string[];
25
+ readonly body: Node;
26
+ readonly frame: Frame;
27
+ constructor(params: readonly string[], body: Node, frame: Frame);
28
+ }
29
+ /** A function's argument left empty. */
30
+ export declare class Missing {
31
+ readonly missing = true;
32
+ }
33
+ export declare const MISSING: Missing;
34
+ export type Value = Scalar | Matrix | Reference | Union | Lambda | Missing;
35
+ /** LET's and a LAMBDA's names. */
36
+ export interface Scope {
37
+ names: ReadonlyMap<string, Value>;
38
+ parent?: Scope;
39
+ }
40
+ /** Where a formula is being evaluated. */
41
+ export interface Frame {
42
+ sheet: Worksheet;
43
+ row: number;
44
+ col: number;
45
+ /** How far it is from where it was written. */
46
+ dr: number;
47
+ dc: number;
48
+ scope?: Scope;
49
+ }
50
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export class Reference{sheet;top;left;bottom;right;constructor(t,i,r,e,o){this.sheet=t,this.top=i,this.left=r,this.bottom=e,this.right=o}get rows(){return this.bottom-this.top+1}get cols(){return this.right-this.left+1}get single(){return this.top===this.bottom&&this.left===this.right}get key(){return`${String(this.sheet.index)}!${String(this.top)},${String(this.left)}:${String(this.bottom)},${String(this.right)}`}}export class Union{parts;constructor(t){this.parts=t}}export class Lambda{params;body;frame;constructor(t,i,r){this.params=t,this.body=i,this.frame=r}}export class Missing{missing=!0}export const MISSING=new Missing;
@@ -0,0 +1,58 @@
1
+ import { type ChartDef } from "@allyhub-next/chart";
2
+ import type { SheetChart, SheetChartType } from "@allyhub-next/formats";
3
+ import { type Area } from "./address.js";
4
+ import type { Calc } from "./calc/engine.js";
5
+ import type { Chart, Worksheet } from "./workbook.js";
6
+ /** What a chart is unless it says otherwise: Excel's new chart. */
7
+ export declare const SHEET_CHART_DEFAULTS: {
8
+ /** Pixels. */
9
+ readonly width: 480;
10
+ readonly height: 288;
11
+ /** Points. */
12
+ readonly size: 9;
13
+ readonly titleSize: 14;
14
+ readonly ink: "#595959";
15
+ /** Pixels to the point, at 96 to the inch. */
16
+ readonly pixelsToPoints: 0.75;
17
+ };
18
+ /** A chart as it is drawn now: what its cells compute, from the sheet it is on. */
19
+ export declare function chartDef(calc: Calc, sheet: Worksheet, chart: Chart): ChartDef;
20
+ /** A chart's size on the sheet, pixels. */
21
+ export declare const chartSize: (spec: SheetChart) => {
22
+ width: number;
23
+ height: number;
24
+ };
25
+ export interface ChartSvgOptions {
26
+ /** The chart's ground. */
27
+ paper?: string;
28
+ /** Its edge; none for no edge. */
29
+ edge?: string;
30
+ font?: string;
31
+ }
32
+ /** A chart as an SVG of `width` × `height` pixels: the one drawing the grid, a PDF and a picture show. */
33
+ export declare function chartSvg(def: ChartDef, width: number, height: number, o?: ChartSvgOptions): string;
34
+ /** Every reference a chart holds through a change. */
35
+ export declare function chartAfter(chart: SheetChart, again: (text: string) => string): SheetChart;
36
+ export type NewChart = Pick<SheetChart, "type" | "categories" | "series" | "legend" | "title">;
37
+ /**
38
+ * What a chart of a range reads, as Excel's Insert Chart lays a selection
39
+ * out: a first row of text names the series, a first column of text or dates
40
+ * is the categories, and with more columns than rows each row is a series. A
41
+ * scatter's first column is its places across.
42
+ */
43
+ export declare function chartOfRange(calc: Calc, sheet: Worksheet, from: Worksheet, area: Area, type: SheetChartType): NewChart | undefined;
44
+ /** The range a chart reads as one (Select Data's), when its pieces make one. */
45
+ export declare function chartDataRange(calc: Calc, sheet: Worksheet, chart: Chart): string | undefined;
46
+ /** A range typed in Select Data: its sheet and area. */
47
+ export declare function readDataRange(calc: Calc, sheet: Worksheet, text: string): {
48
+ sheet: Worksheet;
49
+ area: Area;
50
+ } | undefined;
51
+ /** Where a chart's top left is, in pixels from the sheet's, given each row's and column's start. */
52
+ export declare function chartPlace(spec: SheetChart, rowTop: (row: number) => number, columnLeft: (col: number) => number): {
53
+ left: number;
54
+ top: number;
55
+ width: number;
56
+ height: number;
57
+ };
58
+ //# sourceMappingURL=chart.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{chartDrawing as B,isRound as F,isScatter as R}from"@allyhub-next/chart";import{cellName as U,columnLetter as q,contains as I,rangeName as j,readAddress as V,readArea as W}from"./address.js";import{Reference as N,Union as G}from"./calc/types.js";import{shownValue as J}from"./format.js";import{sheetPrefix as D}from"./formula/print.js";import{CellError as K,Matrix as T}from"./values.js";export const SHEET_CHART_DEFAULTS={width:480,height:288,size:9,titleSize:14,ink:"#595959",pixelsToPoints:.75};const Q={dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"},k=e=>typeof e=="string"?Q[e]??"#000000":e.rgb;function z(e,o,n){const{node:t}=n;if(!t)return[];const i=e.eval(t,{sheet:o,row:0,col:0,dr:0,dc:0}),s=u=>{const a=u.sheet,h=e.filtered(a),m=[],x=Math.min(u.bottom,a.lastRow),g=Math.min(u.right,a.columnsUsed-1);for(let c=u.top;c<=x;c++)if(!(h.has(c)||a.spec.rows?.[String(c+1)]?.hidden===!0))for(let l=u.left;l<=g;l++)a.spec.columns?.[q(l)]?.hidden!==!0&&m.push({value:e.value(a,c,l),sheet:a,row:c,col:l});return m};if(i instanceof N)return s(i);if(i instanceof G)return i.parts.flatMap(s);if(i instanceof T)return i.data.map(u=>({value:u}));const r=e.flat(i);return r instanceof T?r.data.map(u=>({value:u})):[{value:r}]}const E=e=>{if(e.value===null)return"";const o=e.sheet&&e.row!==void 0&&e.col!==void 0?e.sheet.lookAt(e.row,e.col).format:void 0;return J(e.value,o)};function H(e){return typeof e=="number"?Number.isFinite(e)?e:null:e===null||e instanceof K?null:typeof e=="boolean"&&e?1:0}const P=e=>e&&{...e.min===void 0?{}:{minimum_scale:e.min},...e.max===void 0?{}:{maximum_scale:e.max},...e.major===void 0?{}:{major_unit:e.major},...e.gridlines===void 0?{}:{has_major_gridlines:e.gridlines},...e.visible===void 0?{}:{visible:e.visible},...e.format===void 0?{}:{number_format:e.format},...e.reverse===void 0?{}:{reverse_order:e.reverse},...e.title===void 0||e.title===""?{}:{title:e.title}},C=e=>e===void 0?void 0:{rgb:e};function X(e){if(e===void 0||e===!1)return;if(e===!0)return{show_value:!0};const o=typeof e.color=="string"?C(e.color):void 0;return{...e.value===void 0?{}:{show_value:e.value},...e.percentage===void 0?{}:{show_percentage:e.percentage},...e.category===void 0?{}:{show_category_name:e.category},...e.series===void 0?{}:{show_series_name:e.series},...e.format===void 0?{}:{number_format:e.format},...e.position===void 0?{}:{position:e.position},...e.size===void 0?{}:{size:e.size},...o?{color:o}:{}}}const Y=e=>{const o=e.find(n=>n.sheet);return o?.sheet&&o.row!==void 0&&o.col!==void 0?o.sheet.lookAt(o.row,o.col).format:void 0};export function chartDef(e,o,n){const{spec:t}=n,i=R(t.type),s=n.categories?z(e,o,n.categories):void 0,r=n.series.map((l,b)=>{const p=t.series[b],v=z(e,o,l.values),$=l.name?z(e,o,l.name)[0]:void 0,A=l.x?z(e,o,l.x):i?s:void 0,w=p.format??Y(v),y=C(p.color);return{name:($?E($):p.name)??`Series${String(b+1)}`,values:v.map(f=>H(f.value)),...A?{x:A.map(f=>H(f.value))}:{},...w===void 0?{}:{number_format:w},...y?{color:y}:{},...p.smooth===void 0?{}:{smooth:p.smooth},...p.line_width===void 0?{}:{line_width:p.line_width},...p.marker_size===void 0?{}:{marker_size:p.marker_size}}}),u=Math.max(0,...r.map(l=>l.values.length)),a=s?s.map(E):Array.from({length:u},(l,b)=>String(b+1)),h=n.title?z(e,o,n.title)[0]:void 0,m=h?E(h):t.title,x=X(t.labels),g=P(t.value_axis),c=P(t.category_axis);return{type:t.type,categories:a,series:r,...m===void 0||m===""?{}:{title:m},...t.legend===void 0?{}:{legend:t.legend},...x?{labels:x}:{},...t.gap_width===void 0?{}:{gap_width:t.gap_width},...t.overlap===void 0?{}:{overlap:t.overlap},...t.vary_by_categories===void 0?{}:{vary_by_categories:t.vary_by_categories},...t.hole_size===void 0?{}:{hole_size:t.hole_size},...g?{value_axis:g}:{},...c?{category_axis:c}:{},font_size:t.size??SHEET_CHART_DEFAULTS.size,title_size:t.title_size??SHEET_CHART_DEFAULTS.titleSize,font_color:C(t.color)??{rgb:SHEET_CHART_DEFAULTS.ink}}}export const chartSize=e=>({width:e.width??SHEET_CHART_DEFAULTS.width,height:e.height??SHEET_CHART_DEFAULTS.height});const Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},O=e=>e.replace(/[&<>"]/gu,o=>Z[o]??o),d=e=>String(Number(e.toFixed(3)));function L(e){const o=e.fill===void 0?"none":k(e.fill),n=e.width>0?k(e.color):"none";return`<path d="${O(e.d)}" fill="${o}" stroke="${n}" stroke-width="${d(e.width)}" stroke-linejoin="round"/>`}function ee(e){const o=[];for(const n of[...e.grid,...e.shapes])o.push(L(n));for(const n of[...e.boxes,...e.keys])o.push(`<rect x="${d(n.x)}" y="${d(n.y)}" width="${d(n.width)}" height="${d(n.height)}" fill="${k(n.color)}"/>`);for(const n of[...e.axes,...e.lines])o.push(L(n));for(const n of e.dots)o.push(`<circle cx="${d(n.x)}" cy="${d(n.y)}" r="${d(n.r)}" fill="${k(n.color)}"/>`);for(const n of e.words){const t=n.rotate===void 0?"":` transform="rotate(${d(n.rotate)} ${d(n.x)} ${d(n.y)})"`;o.push(`<text x="${d(n.x)}" y="${d(n.y)}" font-size="${d(n.size)}" text-anchor="${n.anchor}" dominant-baseline="central" fill="${k(n.color)}"${t}>${O(n.text)}</text>`)}return o.join("")}export function chartSvg(e,o,n,t={}){const i=SHEET_CHART_DEFAULTS.pixelsToPoints,s=o*i,r=n*i,u=t.font??"Carlito, Calibri, Arial, sans-serif",a=t.paper??"#FFFFFF",h=t.edge??"#D9D9D9";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${d(s)} ${d(r)}" width="${d(o)}" height="${d(n)}" font-family="${O(u)}"><rect x="0.375" y="0.375" width="${d(s-.75)}" height="${d(r-.75)}" fill="${a}" stroke="${h==="none"?"none":h}" stroke-width="0.75"/>${ee(B(e,s,r))}</svg>`}export function chartAfter(e,o){const n=i=>i?.startsWith("=")===!0?o(i):i,t=n(e.title);return{...e,...t===void 0?{}:{title:t},...e.categories===void 0?{}:{categories:o(e.categories)},series:e.series.map(i=>{const s=n(i.name);return{...i,values:o(i.values),...i.x===void 0?{}:{x:o(i.x)},...s===void 0?{}:{name:s}}})}}function te(e,o,n,t){if(t){const i=t.data;if(n.top===i.top&&n.bottom===i.bottom&&n.left===n.right){const s=t.columns[n.left-t.at.col];if(s)return`${t.name}[${s.name}]`}}return`${o===e?"":D(o.name)}${j(n)}`}const ne=(e,o,n,t)=>typeof e.value(o,n,t)=="number",oe=(e,o,n,t)=>{const i=e.value(o,n,t);if(typeof i=="string")return!0;const s=o.lookAt(n,t).format;return typeof i=="number"&&s!==void 0&&/[ymd]/iu.test(s)};export function chartOfRange(e,o,n,t,i){const s=t.bottom-t.top+1,r=t.right-t.left+1,u=o.tables.find(f=>I(f.area,t.top,t.left)),a=f=>te(n,o,f,u),h=R(i),m=s>1&&Array.from({length:r},(f,_)=>t.left+_).some(f=>!ne(e,o,t.top,f)),x=r>1&&(h||Array.from({length:s-(m?1:0)},(f,_)=>_).every(f=>oe(e,o,t.top+(m?1:0)+f,t.left)||e.value(o,t.top+(m?1:0)+f,t.left)===null)),g=t.top+(m?1:0),c=t.left+(x?1:0);if(g>t.bottom||c>t.right)return;const l=!h&&!F(i)&&t.right-c>t.bottom-g,b=[],p=(f,_)=>e.value(o,f,_)===null?void 0:`=${o===n?"":D(o.name)}${U({row:f,col:_})}`,v=l?{first:g,last:t.bottom}:{first:c,last:t.right};for(let f=v.first;f<=v.last;f++){const _=l?{top:f,left:c,bottom:f,right:t.right}:{top:g,left:f,bottom:t.bottom,right:f},M=l?x?p(f,t.left):void 0:m?p(t.top,f):void 0;b.push({values:a(_),...M===void 0?{}:{name:M}})}const $=l?m?{top:t.top,left:c,bottom:t.top,right:t.right}:void 0:x?{top:g,left:t.left,bottom:t.bottom,right:t.left}:void 0,A=b.length>1&&!F(i),w=F(i)?b.slice(0,1):b,y=w.length===1?w[0]?.name:void 0;return{type:i,...$?{categories:a($)}:{},series:w,...A||F(i)?{legend:"bottom"}:{},...y===void 0?{}:{title:y}}}function S(e,o,n){if(!n?.node)return;const t=e.eval(n.node,{sheet:o,row:0,col:0,dr:0,dc:0});return t instanceof N?{sheet:t.sheet,area:{top:t.top,left:t.left,bottom:Math.min(t.bottom,Math.max(t.top,t.sheet.lastRow)),right:t.right}}:void 0}export function chartDataRange(e,o,n){const t=[S(e,o,n.categories),...n.series.flatMap(r=>[S(e,o,r.values),S(e,o,r.name),S(e,o,r.x)])].filter(r=>r!==void 0),i=t[0];if(!i||t.some(r=>r.sheet!==i.sheet))return;const s={top:Math.min(...t.map(r=>r.area.top)),left:Math.min(...t.map(r=>r.area.left)),bottom:Math.max(...t.map(r=>r.area.bottom)),right:Math.max(...t.map(r=>r.area.right))};return`${i.sheet===o?"":D(i.sheet.name)}${j(s)}`}export function readDataRange(e,o,n){const t=n.lastIndexOf("!"),i=t<0?void 0:n.slice(0,t).replace(/^'|'$/gu,""),s=i===void 0?o:e.wb.sheet(i.replaceAll("''","'")),r=W(n.slice(t+1).replaceAll("$",""));return s&&r?{sheet:s,area:r}:void 0}export function chartPlace(e,o,n){const t=V(e.at)??{row:0,col:0};return{left:n(t.col)+(e.x??0),top:o(t.row)+(e.y??0),...chartSize(e)}}
@@ -0,0 +1,15 @@
1
+ import { Calc, type CalcOptions } from "./calc/engine.js";
2
+ import { type SheetProblem } from "./file.js";
3
+ import { type Workbook, type WorkbookFiles, type Worksheet } from "./workbook.js";
4
+ export interface CheckedWorkbook {
5
+ workbook?: Workbook;
6
+ calc?: Calc;
7
+ problems: SheetProblem[];
8
+ }
9
+ /** A workbook read, computed and checked. */
10
+ export declare function checkWorkbook(files: WorkbookFiles, o?: CalcOptions & {
11
+ scenario?: string | undefined;
12
+ }): CheckedWorkbook;
13
+ /** A place as a problem or a table names it. */
14
+ export declare const placeName: (sheet: Worksheet, row: number, col: number) => string;
15
+ //# sourceMappingURL=check.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{cellName as d,rangeName as b}from"./address.js";import{ERR as p,Matrix as w,CellError as m}from"./values.js";import{analyse as $}from"./calc/analyse.js";import{Calc as k}from"./calc/engine.js";import{toBool as g}from"./calc/coerce.js";import{ENTRY as l}from"./file.js";import{fileCells as x}from"./files.js";import{applyScenario as y}from"./scenario.js";import{readWorkbook as S}from"./workbook.js";class O{problems;wb;lineOf;constructor(t,o){this.wb=t,this.problems=[...o.problems],this.lineOf=o.lineOf}at(t,o){const e=t.line??(t.path===void 0?void 0:this.lineOf(t.path));this.problems.push({file:t.file===""?l:t.file,...e===void 0?{}:{line:e},message:o})}formulas(){const t=new Map;for(const o of this.wb.sheets){for(const e of o.formulas)t.set(e.shared,o);for(const e of o.tables)for(const s of e.columns)s.formula&&t.set(s.formula,o);for(const e of o.conditions)for(const s of e.formulas)t.set(s,o);for(const e of o.validations)for(const s of e.formulas)s&&t.set(s,o);for(const e of o.charts){e.title&&t.set(e.title,o),e.categories&&t.set(e.categories,o);for(const s of e.series)t.set(s.values,o),s.x&&t.set(s.x,o),s.name&&t.set(s.name,o)}}for(const o of this.wb.names.values())o.formula&&t.set(o.formula,void 0);for(const o of this.wb.checks)t.set(o.formula,void 0);return t}formulaProblems(){for(const[t,o]of this.formulas()){const e=n=>{this.at(t.source,`${t.text}: ${n}`)};if(t.error){e(`does not parse: ${t.error.message}`);continue}const s=$(this.wb,t);t.analysis=s;for(const n of new Set(s.unknownNames))e(`there is no name ${n}`);for(const n of new Set(s.unknownFunctions))e(`there is no function ${n}`);for(const n of s.arguments)e(`${n.name} takes ${n.min===n.max?String(n.min):`${String(n.min)} to ${String(n.max)}`} arguments and is given ${String(n.given)}`);for(const n of s.reads){if(n.kind==="ref"){for(const r of[n.sheet,n.lastSheet])r!==void 0&&!this.wb.sheet(r)&&e(`there is no sheet ${r}`);continue}const f=n.table===void 0?o?.tableAt(t.row,t.col):this.wb.table(n.table);if(!f){e(n.table===void 0?"a column named with no table, outside a table":`there is no table ${n.table}`);continue}for(const r of n.columns)f.column(r)||e(`table ${f.name} has no column ${r}; it has ${f.columns.map(c=>c.name).join(", ")}`)}}}cycles(t){for(const o of t.cycles){const e=o.reduce((r,c,u)=>{const a=o[r];return a&&(c.row<a.row||c.row===a.row&&c.col<a.col)?u:r},0),s=[...o.slice(e),...o.slice(0,e)],n=s[0];if(!n)continue;const f=[...s,n].map(r=>`${r.sheet.name}!${d(r)}`).join(" → ");this.at(n.shared.source,`a circular reference: ${f}`)}}scenarios(){const{scenarios:t}=this.wb.file;for(const[o,e]of Object.entries(t??{}))for(const s of Object.keys(e))this.wb.name(s)||this.at({file:l,path:["scenarios",o,s]},`scenario ${o} sets ${s}, and there is no name ${s}`)}files(t,o){for(const e of this.wb.sheets)for(const{row:s,col:n,paths:f}of x(e,t))for(const r of f)o(r)||this.at(this.wb.sourceOf(e,s,n)??{file:l},`${placeName(e,s,n)} names ${r}, which is not there`);for(const e of this.wb.sheets)for(const s of e.spec.pictures??[])o(s.file)||this.at({file:l},`${e.name} has a picture ${s.file}, which is not there`)}checks(t){const o=this.wb.sheets[0];if(o)for(const e of this.wb.checks){if(!e.formula.node)continue;const s=t.evaluate(e.formula,o),n=h(s);n!==void 0&&this.at(e.source,`check "${e.name}" does not hold: ${e.formula.text} is ${n}`)}}}function h(i){if(i instanceof w){for(const o of i.data){const e=h(o);if(e!==void 0)return e}return}if(i instanceof m)return i.code;const t=g(i);return t instanceof m?p.VALUE.code:t?void 0:"FALSE"}export function checkWorkbook(i,t={}){const o=S(i),{workbook:e}=o;if(!e)return{problems:o.problems};const s=new O(e,o);s.scenarios(),t.scenario!==void 0&&y(e,t.scenario);const n=new k(e,t);return s.formulaProblems(),n.calculate(),s.cycles(n),s.checks(n),i.exists&&s.files(n,i.exists),{workbook:e,calc:n,problems:s.problems}}export const placeName=(i,t,o)=>`${i.name}!${b({top:t,left:o,bottom:t,right:o})}`;
@@ -0,0 +1,62 @@
1
+ /** How a file writes its records: what the sheet's own writes keep. */
2
+ export interface CsvDialect {
3
+ /** "," for a sheet's file, "\t" for the clipboard. */
4
+ delimiter: string;
5
+ /** The line ending the file uses most: "\n" or "\r\n". */
6
+ newline: "\n" | "\r\n";
7
+ /** The file starts with a byte-order mark. */
8
+ bom: boolean;
9
+ /** The last record is followed by a line ending. */
10
+ finalNewline: boolean;
11
+ }
12
+ /** One record of the file, and where it is. */
13
+ export interface CsvRecord {
14
+ fields: string[];
15
+ /** The record's text in the file, from its first character to its line ending (not included). */
16
+ start: number;
17
+ end: number;
18
+ /** The line it starts on, from 1. */
19
+ line: number;
20
+ }
21
+ /** What is wrong with a file as CSV, whatever is in it. */
22
+ export interface CsvProblem {
23
+ line: number;
24
+ message: string;
25
+ }
26
+ export interface ParsedCsv {
27
+ /** The text as read, the byte-order mark included. */
28
+ source: string;
29
+ records: CsvRecord[];
30
+ dialect: CsvDialect;
31
+ problems: CsvProblem[];
32
+ }
33
+ export declare const DEFAULT_DIALECT: CsvDialect;
34
+ /**
35
+ * Reads CSV (or, with "\t", tab-separated text) into records. A line with
36
+ * nothing on it is a record of one empty field; a line ending at the very
37
+ * end of the text is not a record. A quote that is never closed is a
38
+ * problem, and the record runs to the end of the text.
39
+ */
40
+ export declare function readCsv(text: string, delimiter?: string): ParsedCsv;
41
+ /**
42
+ * The records of CSV text as rows, leaving out lines with nothing in them:
43
+ * what a reader of data wants (ctx.data). A sheet keeps every record.
44
+ */
45
+ export declare function csvRows(text: string, delimiter?: string): string[][];
46
+ /** A field as CSV writes it: quoted only when it has to be. */
47
+ export declare function csvField(value: string, delimiter?: string): string;
48
+ /** A record as CSV writes it, without its line ending. */
49
+ export declare function csvRecord(fields: readonly string[], delimiter?: string): string;
50
+ /** Rows as a CSV file in a dialect. */
51
+ export declare function writeCsv(rows: readonly (readonly string[])[], dialect?: CsvDialect): string;
52
+ /**
53
+ * Cells as tab-separated text, the way a spreadsheet puts a range on the
54
+ * clipboard: a field with a tab, a line ending or a quote in it is quoted.
55
+ */
56
+ export declare function toTsv(rows: readonly (readonly string[])[]): string;
57
+ /**
58
+ * Tab-separated text from the clipboard as rows. One line ending at the
59
+ * end is not a row (spreadsheets add one).
60
+ */
61
+ export declare function fromTsv(text: string): string[][];
62
+ //# sourceMappingURL=csv.d.ts.map
@@ -0,0 +1,12 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export const DEFAULT_DIALECT={delimiter:",",newline:`
3
+ `,bom:!1,finalNewline:!0};export function readCsv(n,e=","){const s=n.startsWith("\uFEFF"),o=[],a=[];let h=0,m=0,t=s?1:0,u=1;const c=n.length;for(;t<c;){const b=t,p=u,l=[];let r="",f=!1,d=!1,g=!1;for(;t<c;){const i=n.charAt(t);if(f){if(i==='"'){if(n.charAt(t+1)==='"'){r+='"',t+=2;continue}f=!1,t+=1;continue}i===`
4
+ `&&(u+=1),r+=i,t+=1;continue}if(i==='"'&&r===""&&!d){f=!0,d=!0,t+=1;continue}if(i===e){l.push(r),r="",d=!1,t+=1;continue}if(i==="\r"||i===`
5
+ `){const A=t;i==="\r"&&n.charAt(t+1)===`
6
+ `?(h+=1,t+=2):(i===`
7
+ `&&(m+=1),t+=1),u+=1,l.push(r),o.push({fields:l,start:b,end:A,line:p}),g=!0;break}r+=i,t+=1}g||(f&&a.push({line:p,message:'a quoted field is never closed: a " is missing'}),l.push(r),o.push({fields:l,start:b,end:c,line:p}))}const w=n.charAt(c-1);return{source:n,records:o,dialect:{delimiter:e,newline:h>m?`\r
8
+ `:`
9
+ `,bom:s,finalNewline:c>(s?1:0)&&(w===`
10
+ `||w==="\r")},problems:a}}export function csvRows(n,e=","){return readCsv(n,e).records.map(s=>s.fields).filter(s=>s.some(o=>o!==""))}export function csvField(n,e=","){return n.includes(e)||n.includes('"')||n.includes(`
11
+ `)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}export function csvRecord(n,e=","){return n.length===1&&n[0]===""?'""':n.map(s=>csvField(s,e)).join(e)}export function writeCsv(n,e=DEFAULT_DIALECT){const s=n.map(o=>csvRecord(o,e.delimiter)).join(e.newline);return`${e.bom?"\uFEFF":""}${s}${e.finalNewline&&n.length>0?e.newline:""}`}export function toTsv(n){return n.map(e=>csvRecord(e," ")).join(`
12
+ `)}export function fromTsv(n){return readCsv(n," ").records.map(e=>e.fields)}
@@ -0,0 +1,64 @@
1
+ import type { Calc } from "./calc/engine.js";
2
+ export type DiffKind =
3
+ /** It computes or holds something else, its formula the same. */
4
+ "value"
5
+ /** Its formula changed, and what it computes did not. */
6
+ | "formula"
7
+ /** Its formula changed, and what it computes. */
8
+ | "both" | "added" | "removed";
9
+ export interface DiffSide {
10
+ /** Its address in this version. */
11
+ cell: string;
12
+ value: string | number | boolean | null;
13
+ shown: string;
14
+ formula?: string;
15
+ }
16
+ export interface CellChange {
17
+ kind: DiffKind;
18
+ sheet: string;
19
+ /** Its table and column, and its row's key when rows are lined up by one. */
20
+ table?: string;
21
+ column?: string;
22
+ key?: string;
23
+ was?: DiffSide;
24
+ now?: DiffSide;
25
+ }
26
+ export interface SheetDiff {
27
+ name: string;
28
+ added: boolean;
29
+ removed: boolean;
30
+ }
31
+ export interface TableDiff {
32
+ sheet: string;
33
+ name: string;
34
+ /** How rows were lined up. */
35
+ by: "key" | "position";
36
+ key?: string;
37
+ rowsAdded: string[];
38
+ rowsRemoved: string[];
39
+ columnsAdded: string[];
40
+ columnsRemoved: string[];
41
+ }
42
+ export interface WorkbookDiff {
43
+ sheets: SheetDiff[];
44
+ tables: TableDiff[];
45
+ names: {
46
+ name: string;
47
+ was?: string;
48
+ now?: string;
49
+ }[];
50
+ /** Sheets whose charts differ. */
51
+ charts: string[];
52
+ cells: CellChange[];
53
+ counts: Record<DiffKind, number>;
54
+ }
55
+ export interface DiffOptions {
56
+ /** How far apart numbers may be, as a share of the larger, and be the same. */
57
+ tolerance?: number;
58
+ }
59
+ export declare const DIFF_DEFAULTS: {
60
+ readonly tolerance: 0;
61
+ };
62
+ /** What changed from one version of a workbook to another, both computed. */
63
+ export declare function diffWorkbooks(was: Calc, now: Calc, o?: DiffOptions): WorkbookDiff;
64
+ //# sourceMappingURL=diff.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{cellName as N}from"./address.js";import{dataValue as D,shownValue as b}from"./format.js";import{CellError as y}from"./values.js";import{FormulaCell as M}from"./workbook.js";export const DIFF_DEFAULTS={tolerance:0};const J=(a,e)=>{if(a!=="written")return e};function U(a){const{row:e,col:t}=a;return JSON.stringify(a.moved,(s,c)=>(s==="col"||s==="col2"||s==="row"||s==="row2")&&typeof c=="object"&&c!==null&&c.abs===!1?[c.index-(s.startsWith("col")?t:e)]:J(s,c))}function j(a,e,t){if(a===e)return!0;if(typeof a=="number"&&typeof e=="number"){const s=Math.max(Math.abs(a),Math.abs(e));return Math.abs(a-e)<=t*s}return a instanceof y&&e instanceof y?a.code===e.code:!1}function A(a,e,t,s){const c=a.value(e,t,s),r=e.lookAt(t,s).format,o=e.at(t,s);return{cell:N({row:t,col:s}),value:D(c,r),shown:b(c,r),...o instanceof M?{formula:o.text}:{}}}const S=(a,e,t)=>{const s=a.at(e,t);return s instanceof M&&s.shared.node?U(s):void 0},O=(a,e,t)=>a.at(e,t)!==void 0||a.spillAt(e,t)!==void 0;class C{out={sheets:[],tables:[],names:[],charts:[],cells:[],counts:{value:0,formula:0,both:0,added:0,removed:0}};a;b;tolerance;constructor(e,t,s){this.a=e,this.b=t,this.tolerance=s}push(e){this.out.counts[e.kind]+=1,this.out.cells.push(e)}cell(e,t,s){const c=this.a.value(e.sheet,e.row,e.col),r=this.b.value(t.sheet,t.row,t.col),o=O(e.sheet,e.row,e.col),i=O(t.sheet,t.row,t.col);if(!o&&!i)return;const u=t.sheet.name,l=()=>({was:A(this.a,e.sheet,e.row,e.col),now:A(this.b,t.sheet,t.row,t.col)});if(!o){this.push({...s,sheet:u,kind:"added",now:l().now});return}if(!i){this.push({...s,sheet:u,kind:"removed",was:l().was});return}const h=j(c,r,this.tolerance),w=S(e.sheet,e.row,e.col)===S(t.sheet,t.row,t.col);if(h&&w)return;const v=w?"value":h?"formula":"both";this.push({...s,sheet:u,kind:v,...l()})}loose(e,t){const s=(o,i,u)=>o.tableAt(i,u)!==void 0,c=Math.max(e.lastRow,t.lastRow),r=Math.max(e.columnsUsed,t.columnsUsed)-1;for(let o=0;o<=r;o++){const[i,u]=E(e,t,o,c);for(let l=i;l<=u;l++)s(e,l,o)||s(t,l,o)||this.cell({sheet:e,row:l,col:o},{sheet:t,row:l,col:o},{})}}table(e,t){const s=t.spec.key??e.spec.key,c=e.column(s??""),r=t.column(s??""),o=(n,f,p)=>{const d=new Map;if(p){for(let m=0;m<n.rows;m++){const F=f.value(n.sheet,n.at.row+1+m,n.at.col+p.index),x=b(F);if(x===""||d.has(x))return;d.set(x,m)}return d}},i=o(e,this.a,c),u=o(t,this.b,r),l=i&&u?{from:i,to:u}:void 0,h=[];if(l){for(const[n,f]of l.from)h.push([f,l.to.get(n),n]);for(const[n,f]of l.to)l.from.has(n)||h.push([void 0,f,n])}else for(let n=0;n<Math.max(e.rows,t.rows);n++)h.push([n<e.rows?n:void 0,n<t.rows?n:void 0,String(n+1)]);const w=[],v=[],R=t.columns.filter(n=>e.column(n.name));for(const[n,f,p]of h)if(n===void 0)w.push(p);else if(f===void 0)v.push(p);else for(const d of R){const m=e.column(d.name);m&&this.cell({sheet:e.sheet,row:e.at.row+1+n,col:e.at.col+m.index},{sheet:t.sheet,row:t.at.row+1+f,col:t.at.col+d.index},{table:t.name,column:d.name,...l?{key:p}:{}})}const k=t.columns.filter(n=>!e.column(n.name)).map(n=>n.name),g=e.columns.filter(n=>!t.column(n.name)).map(n=>n.name);(w.length+v.length+k.length+g.length>0||l)&&this.out.tables.push({sheet:t.sheet.name,name:t.name,by:l?"key":"position",...l&&s!==void 0?{key:s}:{},rowsAdded:w,rowsRemoved:v,columnsAdded:k,columnsRemoved:g})}names(e,t){const s=(r,o)=>{const i=r.name(o);if(i)return i.formula?.text??b(i.value??null)},c=new Set([...e.names.values(),...t.names.values()].map(r=>r.name));for(const r of[...c].sort()){const o=s(e,r),i=s(t,r);o!==i&&this.out.names.push({name:r,...o===void 0?{}:{was:o},...i===void 0?{}:{now:i}})}}run(){const{wb:e}=this.a,{wb:t}=this.b;this.names(e,t);for(const s of e.sheets)t.sheet(s.name)||this.out.sheets.push({name:s.name,added:!1,removed:!0});for(const s of t.sheets){const c=e.sheet(s.name);if(!c){this.out.sheets.push({name:s.name,added:!0,removed:!1});continue}this.loose(c,s);for(const r of s.tables){const o=e.table(r.name);o?this.table(o,r):this.out.tables.push({sheet:s.name,name:r.name,by:"position",rowsAdded:[String(r.rows)],rowsRemoved:[],columnsAdded:r.columns.map(i=>i.name),columnsRemoved:[]})}JSON.stringify(c.spec.charts??[])!==JSON.stringify(s.spec.charts??[])&&this.out.charts.push(s.name)}return this.out}}function E(a,e,t,s){const[c,r]=a.span(t,0,s),[o,i]=e.span(t,0,s);return[Math.min(c,o),Math.max(r,i)]}export function diffWorkbooks(a,e,t={}){return new C(a,e,t.tolerance??DIFF_DEFAULTS.tolerance).run()}
@@ -0,0 +1,154 @@
1
+ import type { SheetFile, SheetTable, SheetWorksheet } from "@allyhub-next/formats";
2
+ import { type Area } from "./address.js";
3
+ import { restructure, type RefusedEdit } from "./structure.js";
4
+ import { type CellLook, type CsvRows, type SharedFormula, type Table, type Workbook, type Worksheet } from "./workbook.js";
5
+ /** What an edit reads: the files, and the workbook read from them. */
6
+ export interface EditBook {
7
+ file: SheetFile;
8
+ rows: ReadonlyMap<string, CsvRows>;
9
+ workbook: Workbook;
10
+ }
11
+ /** A cell an edit changed, for a model that takes it in as it is. */
12
+ export interface ChangedCell {
13
+ sheet: Worksheet;
14
+ row: number;
15
+ col: number;
16
+ /** What it now holds, as typed; nothing: empty. */
17
+ input?: string;
18
+ /** Its column's formula, as it is again when the exception goes. */
19
+ column?: SharedFormula;
20
+ /** sheet.yaml's key for it, now; null: it has none now. */
21
+ key?: string | null;
22
+ /** The CSV record of a table's row, now. */
23
+ record?: {
24
+ table: Table;
25
+ index: number;
26
+ fields: string[];
27
+ };
28
+ }
29
+ /** What an edit changed. */
30
+ export interface BookEdit {
31
+ /** sheet.yaml, when it changed. */
32
+ file?: SheetFile;
33
+ /** The CSV files that changed. */
34
+ rows: Map<string, CsvRows>;
35
+ /** Cells changed, each one that did, when nothing else did. */
36
+ cells: ChangedCell[];
37
+ /** Tables, sheets or fills changed: the model is read again. */
38
+ whole: boolean;
39
+ /** Why nothing was done. */
40
+ refused?: EditRefused;
41
+ /** A formula went in one cell of a column of typed values: it can go over all of them. */
42
+ offer?: {
43
+ sheet: string;
44
+ row: number;
45
+ col: number;
46
+ text: string;
47
+ };
48
+ /** CSV files no sheet names any more. */
49
+ removed?: string[];
50
+ }
51
+ export type EditRefused = RefusedEdit | "column-name" | "sheet-name" | "sheet-taken" | "name-invalid" | "merge-table" | "no-data" | "table-move";
52
+ /** The most typed cells written as keys of `cells`: more go in a CSV file of their own, as a script's do. */
53
+ export declare const BLOCK_CELLS = 100;
54
+ export declare const blankEdit: () => BookEdit;
55
+ export declare const refused: (why: EditRefused) => BookEdit;
56
+ export declare class Draft {
57
+ private readonly book;
58
+ private readonly specs;
59
+ private file;
60
+ private fileChanged;
61
+ /** Rows each table has in this edit: a paste may write several under it. */
62
+ private readonly grown;
63
+ /** The records of the rows added in this edit, by table and row. */
64
+ private readonly added;
65
+ readonly edit: BookEdit;
66
+ constructor(book: EditBook);
67
+ /** The sheet's entry, to change: its own copy from the first change on. */
68
+ spec(sheet: Worksheet): SheetWorksheet;
69
+ /** A table's entry, to change. */
70
+ table(sheet: Worksheet, table: Table): SheetTable;
71
+ /** A file's rows for this edit, to change: its own copy from the first change on. */
72
+ rows(path: string): (readonly string[])[];
73
+ setField(path: string, record: number, field: number, text: string): string[];
74
+ rowsOf(table: Table): number;
75
+ grow(table: Table, row: number, record: number): void;
76
+ /** The table a row added in this edit is in, and that row's record. */
77
+ addedAt(sheet: Worksheet, row: number, col: number): {
78
+ table: Table;
79
+ record: number;
80
+ } | undefined;
81
+ finish(): BookEdit;
82
+ }
83
+ export declare const movedTo: (text: string, rows: number, columns: number) => string;
84
+ export declare function writeOne(d: Draft, book: EditBook, sheet: Worksheet, row: number, col: number, text: string): BookEdit | undefined;
85
+ /** One cell written as typed, or several: `text` is what a person types there. */
86
+ export interface CellWrite {
87
+ row: number;
88
+ col: number;
89
+ text: string;
90
+ }
91
+ /** Cells of a sheet written, each in the file that holds it. */
92
+ export declare function writeCells(book: EditBook, sheetName: string, writes: readonly CellWrite[]): BookEdit;
93
+ /** Every cell of a column's rows takes the formula: what Excel's "overwrite all cells" does. */
94
+ export declare function overwriteColumn(book: EditBook, sheetName: string, row: number, col: number, text: string): BookEdit;
95
+ /** What an area holds taken out; a calculated column whose every row is taken loses its formula. */
96
+ export declare function clearCells(book: EditBook, sheetName: string, area: Area): BookEdit;
97
+ /** Keys a fill takes the place of: the cells in it, and ranges it covers. */
98
+ export declare function dropKeys(spec: SheetWorksheet, area: Area): void;
99
+ /**
100
+ * What a cell holds filled over an area, as Cmd+D and Cmd+R do. In a file of
101
+ * rows each cell takes it; loose, a formula is one key over the range.
102
+ */
103
+ export declare function fillCells(book: EditBook, sheetName: string, from: {
104
+ row: number;
105
+ col: number;
106
+ }, area: Area, input: string): BookEdit;
107
+ /** Many typed cells in empty places: a CSV file of their own, as a script's are. */
108
+ export declare function writeBlockOf(book: EditBook, sheetName: string, at: {
109
+ row: number;
110
+ col: number;
111
+ }, rows: readonly (readonly string[])[], path: string): BookEdit;
112
+ /**
113
+ * A look given to an area: sheet.yaml's `format`, or the column, row or
114
+ * table's column it covers, whichever says it plainest. What said otherwise
115
+ * of those cells and would win gives way: a key's own field goes, and a range
116
+ * key's moves to `format`, which the new look then follows. A field set to
117
+ * undefined is taken away, and written as off only where the file says it
118
+ * elsewhere.
119
+ */
120
+ export declare function setLook(book: EditBook, sheetName: string, area: Area, patch: CellLook): BookEdit;
121
+ /** The same in an edit under way. */
122
+ export declare function applyLook(d: Draft, sheet: Worksheet, area: Area, patch: CellLook): void;
123
+ /** What an edit left empty goes. */
124
+ export declare function tidied(spec: SheetWorksheet): void;
125
+ /** A column's width, in pixels; undefined: as tall or wide as nothing sets. */
126
+ export declare function setColumnWidth(book: EditBook, sheetName: string, col: number, width: number | undefined): BookEdit;
127
+ export declare function setRowHeight(book: EditBook, sheetName: string, row: number, height: number | undefined): BookEdit;
128
+ /** Excel's rules for a sheet's name. */
129
+ export declare function sheetNameProblem(book: Pick<EditBook, "workbook">, name: string, own?: string): EditRefused | undefined;
130
+ export declare function renameSheet(book: EditBook, from: string, to: string): BookEdit;
131
+ /** A new sheet, after the one named. */
132
+ export declare function addSheet(book: EditBook, name: string, after: string | undefined): BookEdit;
133
+ /** Excel's name for a copy of a sheet: "Orders (2)", cut to fit the 31 a name may hold. */
134
+ export declare function copyName(book: EditBook, name: string): string;
135
+ /** A copy of a sheet right after it, under Excel's name for one. */
136
+ export declare function duplicateSheet(book: EditBook, name: string): BookEdit;
137
+ /** A sheet taken out; what named it says #REF!. */
138
+ export declare function deleteSheet(book: EditBook, name: string): BookEdit;
139
+ /** A sheet moved to `to` among the sheets. */
140
+ export declare function moveSheet(book: EditBook, name: string, to: number): BookEdit;
141
+ /** Rows or columns put in or taken out. */
142
+ export declare function bandEdit(book: EditBook, edit: Parameters<typeof restructure>[1]): BookEdit;
143
+ /** A name given to a place, as the name box does when it holds a new one. */
144
+ export declare function defineName(book: EditBook, name: string, sheetName: string, area: Area): BookEdit;
145
+ /** What a cell holds, as a person would type it again: its formula, or its value as the file writes it. */
146
+ export declare function inputOf(book: Pick<EditBook, "rows">, sheet: Worksheet, row: number, col: number): string;
147
+ /** The cells of a table's calculated columns set apart from their formula: facts, never problems. */
148
+ export declare function exceptionsOf(table: Table): {
149
+ row: number;
150
+ col: number;
151
+ column: string;
152
+ text: string;
153
+ }[];
154
+ //# sourceMappingURL=edit.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{MAX_COLUMNS as K,MAX_ROWS as R,cellName as N,columnLetter as C,contains as q,overlaps as O,rangeName as M,readAddress as X,readArea as j}from"./address.js";import{moveFormula as z}from"./formula/move.js";import{parseFormula as D}from"./formula/parse.js";import{printFormula as G}from"./formula/print.js";import{freeColumn as B,duplicated as H,restructure as F,uniqueColumn as I,withColumnsUpTo as A}from"./structure.js";import{readTyped as T}from"./values.js";import{FormulaCell as P,placeKey as V,validName as J}from"./workbook.js";export const BLOCK_CELLS=100;const _=(n,o)=>n.top<=o.top&&n.left<=o.left&&n.bottom>=o.bottom&&n.right>=o.right,S=(n,o)=>Object.fromEntries(Object.entries(n).filter(([e])=>e!==o)),Q=n=>S(n,"formula"),b=(n,o)=>Object.fromEntries(Object.entries(n).filter(([e])=>e!==o));export const blankEdit=()=>({rows:new Map,cells:[],whole:!1}),refused=n=>({...blankEdit(),refused:n});const v=n=>T(n).formula!==void 0;function Y(n){const o=T(n);return o.formula!==void 0?n:o.value===null?null:o.format!==void 0?n:typeof o.value=="number"||typeof o.value=="boolean"?o.value:n}const Z=n=>n!==null&&typeof n=="object"?Object.fromEntries(Object.entries(n).filter(([o])=>o!=="value"&&o!=="formula")):{};export class Draft{book;specs=new Map;file;fileChanged=!1;grown=new Map;added=new Map;edit=blankEdit();constructor(o){this.book=o,this.file=o.file}spec(o){let e=this.specs.get(o.index);if(!e){const t=this.file.sheets.findIndex(s=>s.name===o.name);e={...this.file.sheets[t]??{name:o.name}},this.specs.set(o.index,e),this.fileChanged||(this.file={...this.file,sheets:[...this.file.sheets]},this.fileChanged=!0),this.file.sheets[t]=e}return e}table(o,e){const t=this.spec(o),s=[...t.tables??[]],r=s.findIndex(l=>l.name===e.name),i={...s[r]??e.spec};return s[r]=i,t.tables=s,i}rows(o){const e=this.edit.rows.get(o);if(e)return e;const t=[...this.book.rows.get(o)??[]];return this.edit.rows.set(o,t),t}setField(o,e,t,s){const r=this.rows(o),i=[...r[e]??[]];for(;i.length<=t;)i.push("");return i[t]=s,r[e]=i,i}rowsOf(o){return this.grown.get(o)??o.rows}grow(o,e,t){this.grown.set(o,this.rowsOf(o)+1);const s=this.added.get(o)??new Map;s.set(e,t),this.added.set(o,s)}addedAt(o,e,t){for(const[s,r]of this.added){const i=r.get(e);if(i!==void 0&&s.sheet===o&&t>=s.at.col&&t<s.at.col+s.columns.length)return{table:s,record:i}}}finish(){return this.fileChanged&&(this.edit.file=this.file),this.edit}}function ee(n,o,e,t){return o.tables.find(s=>{const r=s.at.row+n.rowsOf(s)+1;if(e!==r)return!1;const i=s.at.col+s.columns.length-1;if(t<s.at.col||t>i)return!1;for(let l=s.at.col;l<=i;l++)if(o.at(e,l)!==void 0)return!1;return!0})}function te(n,o,e){return n.tables.find(t=>{const{top:s,bottom:r,right:i}=t.area;if(e!==i+1||o<s||o>r)return!1;for(let l=s;l<=r;l++)if(n.at(l,e)!==void 0)return!1;return!0})}export const movedTo=(n,o,e)=>{const t=D(n);return t.ok?G(z(t.node,o,e)):n};function E(n,o,e,t,s,r){const i=e.at.row+1,l=n.table(o,e),f=movedTo(r,i-s,0);if(l.columns={...l.columns,[t.name]:{...l.columns?.[t.name],formula:f}},t.csv!==void 0){const c=e.places[s-i];c!==void 0&&n.setField(e.file,c,t.csv,"")}n.edit.whole=!0}function ne(n,o,e,t){const{csv:s}=e;if(s===void 0)return!1;const r=n.rows(o.file);return o.places.some((i,l)=>l!==t&&(r[i]?.[s]??"")!=="")}function oe(n,o,e,t,s){const r=s.trim();if(r==="")return refused("column-name");if(r===t.name)return n.finish();const i=e.columns.filter(c=>c!==t).map(c=>c.name),l=I(i,r),f=F(o,{op:"rename-column",table:e.name,from:t.name,to:l});return{...blankEdit(),file:f.file,rows:new Map(f.rows),whole:!0}}function se(n,o,e,t,s,r){const i=e.columns[s-e.at.col];if(!i)return;const l=t-e.at.row-1;if(v(r)){if(i.formula){E(n,o,e,i,t,r);return}if(!ne(n,e,i,l)){E(n,o,e,i,t,r);return}n.edit.offer={sheet:o.name,row:t,col:s,text:r}}const c=e.places[l];if(c===void 0)return;let d=i.csv;if(d===void 0){if(r==="")return;const w=e.columns.map(p=>p.name);n.edit.rows.set(e.file,A(n.rows(e.file),w,i.index)),n.edit.whole=!0,d=i.index}const a=n.setField(e.file,c,d,r);n.edit.cells.push({sheet:o,row:t,col:s,...r===""&&i.formula?{column:i.formula}:{input:r},record:{table:e,index:l,fields:a}})}function re(n,o,e,t,s){const r=n.rows(o.file),i=Math.max(r[0]?.length??1,1),l=new Array(i).fill(""),f=o.columns[t-o.at.col];f?.csv!==void 0&&(l[f.csv]=s),r.push(l),n.grow(o,e,r.length-1),n.edit.whole=!0}function ie(n,o,e,t,s){const r=n.table(o,e),i=e.columns.map(w=>w.name),l=t===e.at.row,f=l?I(i,s.trim()===""?B(i):s.trim()):B(i);if(n.edit.whole=!0,!l&&v(s)){r.columns={...r.columns,[f]:{formula:movedTo(s,e.at.row+1-t,0)}};return}const c=i.length,d=A(n.rows(e.file),i,c-1),a=d[0];if(a&&a.push(f),d.forEach((w,p)=>{p>0&&w.length>0&&w.push("")}),!l){const w=e.places[t-e.at.row-1],p=w===void 0?void 0:d[w];p&&(p[c]=s)}n.edit.rows.set(e.file,d)}function le(n,o,e,t,s,r,i){n.setField(e,s-t.top,r-t.left,i),n.edit.cells.push({sheet:o,row:s,col:r,input:i})}function fe(n,o,e){return Object.keys(n.spec.cells??{}).some(t=>{if(!t.includes(":"))return!1;const s=j(t);return s!==void 0&&q(s,o,e)})}function ce(n,o,e,t,s){const r=n.spec(o),i=N({row:e,col:t});let l={...r.cells};const f=l[i],c=f===void 0?{}:Z(f),d=Y(s),a=Object.keys(c).length===0;let w;if(d===null){const p=fe(o,e,t);w=!a||p,a&&!p?l=b(l,i):l[i]=a?null:c}else w=!0,l[i]=a?d:{...c,...v(s)?{formula:s}:{value:d}};r.cells=l,Object.keys(l).length===0&&delete r.cells,n.edit.cells.push({sheet:o,row:e,col:t,input:s,key:w?i:null})}export function writeOne(n,o,e,t,s,r){const i=n.addedAt(e,t,s);if(i){const{csv:c}=i.table.columns[s-i.table.at.col]??{};c!==void 0&&n.setField(i.table.file,i.record,c,r);return}const l=e.tableAt(t,s);if(l){const c=l.columns[s-l.at.col];if(t===l.at.row)return c?oe(n,o,l,c,r):void 0;se(n,e,l,t,s,r);return}if(r!==""){const c=ee(n,e,t,s);if(c){re(n,c,t,s,r);return}const d=te(e,t,s);if(d){ie(n,e,d,t,r);return}}const f=e.blockAt(t,s);f?le(n,e,f.file,f.area,t,s,r):ce(n,e,t,s,r)}export function writeCells(n,o,e){const t=n.workbook.sheet(o);if(!t)return refused("no-sheet");const s=new Draft(n);for(const{row:r,col:i,text:l}of[...e].sort((f,c)=>f.row-c.row||f.col-c.col)){const f=writeOne(s,n,t,r,i,l);if(f)return f}return s.finish()}export function overwriteColumn(n,o,e,t,s){const r=n.workbook.sheet(o),i=r?.tableAt(e,t);if(!r||!i)return refused("no-sheet");const l=i.columns[t-i.at.col];if(!l)return refused("no-sheet");const f=new Draft(n);E(f,r,i,l,e,s);const{csv:c}=l;if(c!==void 0)for(const d of i.places)f.setField(i.file,d,c,"");return f.finish()}function*ue(n,o){const e=Math.min(o.right,n.columnsUsed-1);for(let t=o.left;t<=e;t++){const[s,r]=n.span(t,o.top,o.bottom);for(let i=s;i<=r;i++)n.at(i,t)!==void 0&&(yield[i,t])}}export function clearCells(n,o,e){const t=n.workbook.sheet(o);if(!t)return refused("no-sheet");const s=new Draft(n);for(const r of t.tables){const{top:i,bottom:l}=r.data;if(!(l<i||e.top>i||e.bottom<l))for(const f of r.columns){const c=r.at.col+f.index;if(c<e.left||c>e.right||!f.formula)continue;const d=s.table(t,r),a=r.columns.map(L=>L.name);f.csv===void 0&&s.edit.rows.set(r.file,A(s.rows(r.file),a,f.index));const w=Q(d.columns?.[f.name]??{}),p=b(d.columns??{},f.name);d.columns=Object.keys(w).length>0?{...p,[f.name]:w}:p,Object.keys(d.columns).length===0&&delete d.columns,s.edit.whole=!0}}for(const[r,i]of ue(t,e)){if(t.tableAt(r,i)?.at.row===r)continue;const l=writeOne(s,n,t,r,i,"");if(l)return l}return s.finish()}export function dropKeys(n,o){n.cells&&(n.cells=Object.fromEntries(Object.entries(n.cells).filter(([e])=>{const t=j(e);return!t||!_(o,t)})))}export function fillCells(n,o,e,t,s){const r=n.workbook.sheet(o);if(!r)return refused("no-sheet");if(!r.tables.some(f=>O(f.area,t))&&!r.blocks.some(f=>O(f.area,t))&&v(s)){const f=new Draft(n),c=f.spec(r);dropKeys(c,t);const d=movedTo(s,t.top-e.row,t.left-e.col),a=M(t);return c.cells={...c.cells,[a]:d},f.edit.whole=!0,f.finish()}const l=[];for(let f=t.top;f<=t.bottom;f++)for(let c=t.left;c<=t.right;c++)f===e.row&&c===e.col||l.push({row:f,col:c,text:v(s)?movedTo(s,f-e.row,c-e.col):s});return writeCells(n,o,l)}export function writeBlockOf(n,o,e,t,s){const r=n.workbook.sheet(o);if(!r)return refused("no-sheet");const i=new Draft(n),l=i.spec(r);return l.blocks=[...l.blocks??[],{at:N(e),rows:s}],i.edit.rows.set(s,t),i.edit.whole=!0,i.finish()}const $=(n,o)=>Object.keys(o).some(e=>e in n),x=(n,o)=>Object.fromEntries(Object.entries(n).filter(([e])=>!(e in o)));function de(n){if(n===null||typeof n!="object")return n;const o=Object.keys(n);return o.length===1&&o[0]==="value"?n.value??null:o.length===1&&o[0]==="formula"?n.formula??null:n}const me={bold:!1,italic:!1,underline:!1,strike:!1,wrap:!1,align:"general",format:"General",color:"#000000",fill:"#FFFFFF",font:"Calibri",size:11,border:{left:{style:"none"},right:{style:"none"},top:{style:"none"},bottom:{style:"none"}}};function ae(n,o,e,t){for(const[s,r]of Object.entries(n.columns??{})){const i=X(`${s}1`)?.col;if(i!==void 0&&i>=e.left&&i<=e.right&&t in r)return!0}for(const[s,r]of Object.entries(n.rows??{})){const i=Number(s)-1;if(i>=e.top&&i<=e.bottom&&t in r)return!0}return o.tables.some(s=>O(s.area,e)&&s.columns.some(r=>r.spec!==void 0&&t in r.spec&&s.at.col+r.index>=e.left&&s.at.col+r.index<=e.right))}export function setLook(n,o,e,t){const s=n.workbook.sheet(o);if(!s)return refused("no-sheet");const r=new Draft(n);return applyLook(r,s,e,t),r.finish()}export function applyLook(n,o,e,t){const s=n.spec(o);he(n,o,s,e,t),tidied(s)}function he(n,o,e,t,s){if(e.cells){const u={...e.cells},m=[];for(const[g,h]of Object.entries(u)){if(h===null||typeof h!="object"||!$(h,s))continue;const y=j(g);!y||!O(y,t)||(g.includes(":")&&!_(t,y)&&m.push({range:g,...Object.fromEntries(Object.entries(h).filter(([W])=>W in s))}),u[g]=de(x(h,s)))}e.cells=u,m.length>0&&(e.format=[...e.format??[],...m])}const r=e.format??[],i=u=>{const m=j(u.range);return m!==void 0&&O(m,t)},l=r.some(u=>i(u)&&$(u,s)),f=Object.fromEntries(Object.entries(s).filter(([,u])=>u!==void 0)),c=t.top===0&&t.bottom===R-1,d=t.left===0&&t.right===K-1;if(c&&!d&&!l){let u={...e.columns};for(let m=t.left;m<=t.right;m++){const g=C(m),h={...x(u[g]??{},s),...f};u=Object.keys(h).length===0?b(u,g):{...u,[g]:h}}e.columns=u;return}if(d&&!c&&!l){let u={...e.rows};for(let m=t.top;m<=t.bottom;m++){const g=String(m+1),h={...x(u[g]??{},s),...f};u=Object.keys(h).length===0?b(u,g):{...u,[g]:h}}e.rows=u;return}const a=o.tables.find(u=>u.rows>0&&t.top===u.data.top&&t.bottom===u.data.bottom&&t.left>=u.area.left&&t.right<=u.area.right);if(a&&!l){const u=n.table(o,a);let m={...u.columns};for(let g=t.left;g<=t.right;g++){const h=a.columns[g-a.at.col]?.name;if(h===void 0)continue;const y={...x(m[h]??{},s),...f};m=Object.keys(y).length===0?b(m,h):{...m,[h]:y}}u.columns=m,Object.keys(m).length===0&&delete u.columns,n.edit.whole=!0;return}const w=M(t),p=r.find(u=>{const m=j(u.range);return m!==void 0&&M(m)===w}),U=(p?r.slice(r.indexOf(p)+1):[]).some(u=>i(u)&&$(u,s)),k={};for(const[u,m]of Object.entries(s)){const g=r.some(h=>h!==p&&i(h)&&u in h)||ae(e,o,t,u);m!==void 0?k[u]=m:g&&(k[u]=me[u])}if(p&&!U){const u={...x(p,s),...k};e.format=r.flatMap(m=>m!==p?[m]:Object.keys(u).length>1?[u]:[])}else Object.keys(k).length>0&&(e.format=[...r,{range:w,...k}])}export function tidied(n){n.format?.length===0&&delete n.format,n.columns&&Object.keys(n.columns).length===0&&delete n.columns,n.rows&&Object.keys(n.rows).length===0&&delete n.rows,n.cells&&Object.keys(n.cells).length===0&&delete n.cells}export function setColumnWidth(n,o,e,t){const s=n.workbook.sheet(o);if(!s)return refused("no-sheet");const r=new Draft(n),i=r.spec(s),l=C(e),f=S(i.columns?.[l]??{},"width"),c=t===void 0?f:{...f,width:t},d=b(i.columns??{},l);return i.columns=Object.keys(c).length===0?d:{...d,[l]:c},tidied(i),r.finish()}export function setRowHeight(n,o,e,t){const s=n.workbook.sheet(o);if(!s)return refused("no-sheet");const r=new Draft(n),i=r.spec(s),l=String(e+1),f=S(i.rows?.[l]??{},"height"),c=t===void 0?f:{...f,height:t},d=b(i.rows??{},l);return i.rows=Object.keys(c).length===0?d:{...d,[l]:c},tidied(i),r.finish()}export function sheetNameProblem(n,o,e){if(o.trim()===""||o.length>31||/[\\/?*[\]:]/u.test(o)||o.startsWith("'")||o.endsWith("'"))return"sheet-name";const t=n.workbook.sheet(o);if(t&&t.name!==e)return"sheet-taken"}export function renameSheet(n,o,e){const t=sheetNameProblem(n,e,o);if(t)return refused(t);const s=F(n,{op:"rename-sheet",from:o,to:e});return{...blankEdit(),file:s.file,rows:new Map(s.rows),whole:!0}}export function addSheet(n,o,e){const t=sheetNameProblem(n,o);if(t)return refused(t);const s=[...n.file.sheets],r=s.findIndex(i=>i.name===e);return s.splice(r<0?s.length:r+1,0,{name:o}),{...blankEdit(),file:{...n.file,sheets:s},whole:!0}}export function copyName(n,o){for(let e=2;;e++){const t=` (${String(e)})`,s=o.slice(0,31-t.length).trimEnd()+t;if(!n.workbook.sheet(s))return s}}export function duplicateSheet(n,o){const e=H(n,o,copyName(n,o));return e.refused?refused(e.refused):{...blankEdit(),file:e.file,rows:new Map(e.rows),whole:!0}}export function deleteSheet(n,o){const e=F(n,{op:"delete-sheet",name:o});if(e.refused)return refused(e.refused);const t=we(n.file,e.file);for(const s of t)e.rows.delete(s);return{...blankEdit(),file:e.file,rows:new Map(e.rows),whole:!0,...t.length===0?{}:{removed:t}}}function we(n,o){const e=s=>s.sheets.flatMap(r=>[...(r.tables??[]).map(i=>i.rows),...(r.blocks??[]).map(i=>i.rows)]),t=new Set(e(o));return[...new Set(e(n))].filter(s=>!t.has(s))}export function moveSheet(n,o,e){const t=[...n.file.sheets],s=t.findIndex(i=>i.name===o),[r]=t.splice(s,1);return r?(t.splice(e,0,r),{...blankEdit(),file:{...n.file,sheets:t},whole:!0}):refused("no-sheet")}export function bandEdit(n,o){const e=F(n,o);return e.refused?refused(e.refused):{...blankEdit(),file:e.file,rows:new Map(e.rows),whole:!0}}export function defineName(n,o,e,t){if(!J(o)||n.workbook.name(o)||n.workbook.table(o))return refused("name-invalid");const s=(l,f)=>`$${C(f)}$${String(l+1)}`,r=t.top===t.bottom&&t.left===t.right?s(t.top,t.left):`${s(t.top,t.left)}:${s(t.bottom,t.right)}`,i=/^[\p{L}_][\p{L}\p{N}_.]*$/u.test(e)?e:`'${e.replaceAll("'","''")}'`;return{...blankEdit(),file:{...n.file,names:{...n.file.names,[o]:`=${i}!${r}`}},whole:!0}}export function inputOf(n,o,e,t){const s=o.at(e,t);if(s===void 0)return"";if(s instanceof P)return s.text;const r=o.tableAt(e,t);if(r){const d=r.columns[t-r.at.col];if(e===r.at.row)return d?.name??"";const a=d?.csv===void 0?void 0:r.records[e-r.at.row-1]?.[d.csv];if(a!==void 0)return a}const i=o.blockAt(e,t);if(i){const d=n.rows.get(i.file)?.[e-i.area.top]?.[t-i.area.left];if(d!==void 0)return d}const l=o.keys.get(V(e,t)),f=l===void 0?void 0:o.spec.cells?.[l],c=f!==null&&typeof f=="object"?f.value:f;return c!=null?String(c):typeof s=="object"?s.code:String(s)}export function exceptionsOf(n){const o=[];for(const e of n.columns){const{csv:t}=e;!e.formula||t===void 0||n.records.forEach((s,r)=>{const i=s[t]??"";i!==""&&o.push({row:n.at.row+1+r,col:n.at.col+e.index,column:e.name,text:i})})}return o}