@heycys/gallery 0.0.0-stage → 0.1.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 (785) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/THIRD-PARTY-NOTICES.md +3253 -0
  4. package/assets/writing-preferences.md +107 -0
  5. package/bin/gallery.mjs +10 -0
  6. package/browser/editor/components/bookmark/icons.mjs +6 -0
  7. package/browser/editor/components/bookmark/index.mjs +80 -0
  8. package/browser/editor/components/bookmark/page.mjs +147 -0
  9. package/browser/editor/components/builders.mjs +19 -0
  10. package/browser/editor/components/callout/index.mjs +39 -0
  11. package/browser/editor/components/callout/page.mjs +13 -0
  12. package/browser/editor/components/code/index.mjs +327 -0
  13. package/browser/editor/components/code/page.mjs +561 -0
  14. package/browser/editor/components/colors.mjs +50 -0
  15. package/browser/editor/components/columns/index.mjs +104 -0
  16. package/browser/editor/components/columns/page.mjs +297 -0
  17. package/browser/editor/components/details/index.mjs +72 -0
  18. package/browser/editor/components/details/page.mjs +86 -0
  19. package/browser/editor/components/dialog/index.mjs +83 -0
  20. package/browser/editor/components/dialog/page.mjs +219 -0
  21. package/browser/editor/components/divider/index.mjs +48 -0
  22. package/browser/editor/components/embed/icons.mjs +11 -0
  23. package/browser/editor/components/embed/index.mjs +123 -0
  24. package/browser/editor/components/embed/page.mjs +309 -0
  25. package/browser/editor/components/figure/index.mjs +87 -0
  26. package/browser/editor/components/figure/page.mjs +33 -0
  27. package/browser/editor/components/file/icons.mjs +14 -0
  28. package/browser/editor/components/file/index.mjs +77 -0
  29. package/browser/editor/components/file/page.mjs +114 -0
  30. package/browser/editor/components/flowchart/add.mjs +123 -0
  31. package/browser/editor/components/flowchart/index.mjs +246 -0
  32. package/browser/editor/components/flowchart/page.mjs +453 -0
  33. package/browser/editor/components/heading/index.mjs +51 -0
  34. package/browser/editor/components/highlight/index.mjs +79 -0
  35. package/browser/editor/components/icon/index.mjs +57 -0
  36. package/browser/editor/components/icon/page.mjs +286 -0
  37. package/browser/editor/components/icons.mjs +45 -0
  38. package/browser/editor/components/image/crop.mjs +189 -0
  39. package/browser/editor/components/image/index.mjs +104 -0
  40. package/browser/editor/components/image/page.mjs +385 -0
  41. package/browser/editor/components/image/viewer.mjs +213 -0
  42. package/browser/editor/components/installed/index.mjs +133 -0
  43. package/browser/editor/components/installed/page.mjs +422 -0
  44. package/browser/editor/components/installed/served.mjs +35 -0
  45. package/browser/editor/components/kit.mjs +64 -0
  46. package/browser/editor/components/list/index.mjs +194 -0
  47. package/browser/editor/components/list/join.mjs +68 -0
  48. package/browser/editor/components/list/numbers.mjs +107 -0
  49. package/browser/editor/components/list/page.mjs +632 -0
  50. package/browser/editor/components/math/index.mjs +88 -0
  51. package/browser/editor/components/math/page.mjs +236 -0
  52. package/browser/editor/components/math/tex-logo.mjs +6 -0
  53. package/browser/editor/components/media/icons.mjs +19 -0
  54. package/browser/editor/components/media/page.mjs +162 -0
  55. package/browser/editor/components/media/parts.mjs +60 -0
  56. package/browser/editor/components/media/size.mjs +20 -0
  57. package/browser/editor/components/media/toolbar.mjs +37 -0
  58. package/browser/editor/components/media/write.mjs +7 -0
  59. package/browser/editor/components/pages.mjs +46 -0
  60. package/browser/editor/components/paragraph/index.mjs +43 -0
  61. package/browser/editor/components/paragraph/page.mjs +52 -0
  62. package/browser/editor/components/placeholder-bar.mjs +17 -0
  63. package/browser/editor/components/placeholder.mjs +128 -0
  64. package/browser/editor/components/quote/index.mjs +33 -0
  65. package/browser/editor/components/registry.mjs +833 -0
  66. package/browser/editor/components/rows.mjs +16 -0
  67. package/browser/editor/components/section/index.mjs +41 -0
  68. package/browser/editor/components/section/page.mjs +141 -0
  69. package/browser/editor/components/sheets/index.mjs +137 -0
  70. package/browser/editor/components/sheets/page.mjs +227 -0
  71. package/browser/editor/components/sheets/pills.mjs +226 -0
  72. package/browser/editor/components/table/grid.mjs +73 -0
  73. package/browser/editor/components/table/index.mjs +306 -0
  74. package/browser/editor/components/table/page.mjs +672 -0
  75. package/browser/editor/components/table/slots.mjs +41 -0
  76. package/browser/editor/components/widget/index.mjs +50 -0
  77. package/browser/editor/page/annotate/anchors.mjs +229 -0
  78. package/browser/editor/page/annotate/card.mjs +102 -0
  79. package/browser/editor/page/annotate/index.mjs +1629 -0
  80. package/browser/editor/page/at-menu/index.mjs +317 -0
  81. package/browser/editor/page/autosave.mjs +977 -0
  82. package/browser/editor/page/beside.mjs +21 -0
  83. package/browser/editor/page/block-info.mjs +63 -0
  84. package/browser/editor/page/block-menu/colors.mjs +82 -0
  85. package/browser/editor/page/block-menu/index.mjs +215 -0
  86. package/browser/editor/page/blocks.mjs +246 -0
  87. package/browser/editor/page/caret.mjs +679 -0
  88. package/browser/editor/page/chip-fills.mjs +126 -0
  89. package/browser/editor/page/clipboard/import/colors.mjs +192 -0
  90. package/browser/editor/page/clipboard/import/html.mjs +792 -0
  91. package/browser/editor/page/clipboard/import/inline.mjs +232 -0
  92. package/browser/editor/page/clipboard/import/languages.mjs +42 -0
  93. package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
  94. package/browser/editor/page/clipboard/import/math.mjs +100 -0
  95. package/browser/editor/page/clipboard/import/office.mjs +245 -0
  96. package/browser/editor/page/clipboard/import/read.mjs +120 -0
  97. package/browser/editor/page/clipboard/import/rich.mjs +29 -0
  98. package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
  99. package/browser/editor/page/clipboard/index.mjs +797 -0
  100. package/browser/editor/page/clipboard/own/blocks.mjs +202 -0
  101. package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
  102. package/browser/editor/page/clipboard/own/describe.mjs +115 -0
  103. package/browser/editor/page/clipboard/own/export.mjs +167 -0
  104. package/browser/editor/page/clipboard/own/ids.mjs +39 -0
  105. package/browser/editor/page/clipboard/own/index.mjs +13 -0
  106. package/browser/editor/page/clipboard/own/rules.mjs +44 -0
  107. package/browser/editor/page/clipboard/own/selection.mjs +159 -0
  108. package/browser/editor/page/clipboard/own/writers.mjs +326 -0
  109. package/browser/editor/page/columns/index.mjs +360 -0
  110. package/browser/editor/page/commit.mjs +1798 -0
  111. package/browser/editor/page/conflicts.mjs +269 -0
  112. package/browser/editor/page/convert.mjs +830 -0
  113. package/browser/editor/page/core.mjs +1655 -0
  114. package/browser/editor/page/drag/drop.mjs +307 -0
  115. package/browser/editor/page/drag/index.mjs +335 -0
  116. package/browser/editor/page/drag/preview.mjs +121 -0
  117. package/browser/editor/page/edge-scroll.mjs +50 -0
  118. package/browser/editor/page/editor.mjs +1725 -0
  119. package/browser/editor/page/emoji-picker/emoji-tab.mjs +278 -0
  120. package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
  121. package/browser/editor/page/emoji-picker/grid.mjs +79 -0
  122. package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
  123. package/browser/editor/page/emoji-picker/icons.mjs +32 -0
  124. package/browser/editor/page/emoji-picker/index.mjs +164 -0
  125. package/browser/editor/page/emoji-picker/styles.mjs +2 -0
  126. package/browser/editor/page/emoji-picker/support.mjs +202 -0
  127. package/browser/editor/page/emoji-picker/upload.mjs +235 -0
  128. package/browser/editor/page/export-report.mjs +23 -0
  129. package/browser/editor/page/fills.mjs +60 -0
  130. package/browser/editor/page/find/index.mjs +107 -0
  131. package/browser/editor/page/flags.mjs +70 -0
  132. package/browser/editor/page/format-bar/bar.mjs +448 -0
  133. package/browser/editor/page/format-bar/brush.mjs +77 -0
  134. package/browser/editor/page/format-bar/colors.mjs +46 -0
  135. package/browser/editor/page/format-bar/index.mjs +404 -0
  136. package/browser/editor/page/formula/index.mjs +236 -0
  137. package/browser/editor/page/formula/panel.mjs +336 -0
  138. package/browser/editor/page/formula/symbols.mjs +156 -0
  139. package/browser/editor/page/frame.mjs +74 -0
  140. package/browser/editor/page/frames.mjs +196 -0
  141. package/browser/editor/page/geometry.mjs +400 -0
  142. package/browser/editor/page/gesture.mjs +45 -0
  143. package/browser/editor/page/handle/index.mjs +639 -0
  144. package/browser/editor/page/handle-sizes.mjs +14 -0
  145. package/browser/editor/page/hints/index.mjs +84 -0
  146. package/browser/editor/page/history.mjs +401 -0
  147. package/browser/editor/page/insert/index.mjs +243 -0
  148. package/browser/editor/page/kept.mjs +38 -0
  149. package/browser/editor/page/links/address.mjs +40 -0
  150. package/browser/editor/page/links/index.mjs +866 -0
  151. package/browser/editor/page/links/pages.mjs +131 -0
  152. package/browser/editor/page/links/views.mjs +369 -0
  153. package/browser/editor/page/look.mjs +65 -0
  154. package/browser/editor/page/made.mjs +24 -0
  155. package/browser/editor/page/margin.mjs +352 -0
  156. package/browser/editor/page/markdown/index.mjs +88 -0
  157. package/browser/editor/page/markdown/rules.mjs +33 -0
  158. package/browser/editor/page/marks.mjs +377 -0
  159. package/browser/editor/page/media-menu/index.mjs +158 -0
  160. package/browser/editor/page/menu.mjs +500 -0
  161. package/browser/editor/page/merge.mjs +100 -0
  162. package/browser/editor/page/notices.mjs +142 -0
  163. package/browser/editor/page/offered.mjs +32 -0
  164. package/browser/editor/page/outline/folds.mjs +52 -0
  165. package/browser/editor/page/outline/index.mjs +697 -0
  166. package/browser/editor/page/outline/list.mjs +172 -0
  167. package/browser/editor/page/outline/read.mjs +201 -0
  168. package/browser/editor/page/outline/strip.mjs +281 -0
  169. package/browser/editor/page/outline/tree.mjs +248 -0
  170. package/browser/editor/page/overlay-layer.mjs +227 -0
  171. package/browser/editor/page/overlays.mjs +205 -0
  172. package/browser/editor/page/own.mjs +28 -0
  173. package/browser/editor/page/pads.mjs +71 -0
  174. package/browser/editor/page/page-objects.mjs +105 -0
  175. package/browser/editor/page/panel.mjs +64 -0
  176. package/browser/editor/page/placement.mjs +58 -0
  177. package/browser/editor/page/post.mjs +41 -0
  178. package/browser/editor/page/present-links.mjs +50 -0
  179. package/browser/editor/page/quiet.mjs +48 -0
  180. package/browser/editor/page/resize/index.mjs +327 -0
  181. package/browser/editor/page/select-all/index.mjs +262 -0
  182. package/browser/editor/page/selection/delete.mjs +59 -0
  183. package/browser/editor/page/selection/index.mjs +157 -0
  184. package/browser/editor/page/selection/marquee.mjs +174 -0
  185. package/browser/editor/page/session.mjs +117 -0
  186. package/browser/editor/page/slash-menu/index.mjs +291 -0
  187. package/browser/editor/page/storage.mjs +48 -0
  188. package/browser/editor/page/sync-state.mjs +267 -0
  189. package/browser/editor/page/table/aligns.mjs +29 -0
  190. package/browser/editor/page/table/cell-bar.mjs +138 -0
  191. package/browser/editor/page/table/cells.mjs +527 -0
  192. package/browser/editor/page/table/icons.mjs +40 -0
  193. package/browser/editor/page/table/index.mjs +985 -0
  194. package/browser/editor/page/table/lists.mjs +187 -0
  195. package/browser/editor/page/table/widths.mjs +308 -0
  196. package/browser/editor/page/tex.mjs +32 -0
  197. package/browser/editor/page/text-select/index.mjs +656 -0
  198. package/browser/editor/page/tooltip.mjs +98 -0
  199. package/browser/editor/page/type-grid.mjs +82 -0
  200. package/browser/editor/page/typing/code-edges.mjs +228 -0
  201. package/browser/editor/page/typing/index.mjs +276 -0
  202. package/browser/editor/page/typing/leave.mjs +68 -0
  203. package/browser/editor/page/ui.mjs +160 -0
  204. package/browser/shared/annotations.mjs +571 -0
  205. package/browser/shared/code-folds.mjs +10 -0
  206. package/browser/shared/code-languages.mjs +70 -0
  207. package/browser/shared/code-lines.mjs +30 -0
  208. package/browser/shared/colors.mjs +28 -0
  209. package/browser/shared/component-catalog.mjs +559 -0
  210. package/browser/shared/components/bookmark.mjs +26 -0
  211. package/browser/shared/components/callout.mjs +7 -0
  212. package/browser/shared/components/chart.mjs +20 -0
  213. package/browser/shared/components/code.mjs +37 -0
  214. package/browser/shared/components/columns.mjs +16 -0
  215. package/browser/shared/components/details.mjs +15 -0
  216. package/browser/shared/components/dialog.mjs +28 -0
  217. package/browser/shared/components/diff.mjs +18 -0
  218. package/browser/shared/components/divider.mjs +6 -0
  219. package/browser/shared/components/embed.mjs +25 -0
  220. package/browser/shared/components/figure.mjs +14 -0
  221. package/browser/shared/components/file.mjs +23 -0
  222. package/browser/shared/components/heading.mjs +6 -0
  223. package/browser/shared/components/highlight.mjs +9 -0
  224. package/browser/shared/components/icon.mjs +18 -0
  225. package/browser/shared/components/image.mjs +39 -0
  226. package/browser/shared/components/index.mjs +342 -0
  227. package/browser/shared/components/installed.mjs +162 -0
  228. package/browser/shared/components/list.mjs +146 -0
  229. package/browser/shared/components/math.mjs +49 -0
  230. package/browser/shared/components/mention.mjs +33 -0
  231. package/browser/shared/components/page.mjs +37 -0
  232. package/browser/shared/components/paragraph.mjs +9 -0
  233. package/browser/shared/components/quote.mjs +6 -0
  234. package/browser/shared/components/section.mjs +8 -0
  235. package/browser/shared/components/sheets.mjs +80 -0
  236. package/browser/shared/components/state.mjs +20 -0
  237. package/browser/shared/components/table.mjs +49 -0
  238. package/browser/shared/components/text.mjs +14 -0
  239. package/browser/shared/components/widget.mjs +10 -0
  240. package/browser/shared/copy-ids.mjs +72 -0
  241. package/browser/shared/css-references.mjs +110 -0
  242. package/browser/shared/emoji/custom.mjs +91 -0
  243. package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
  244. package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
  245. package/browser/shared/emoji/data/README.md +26 -0
  246. package/browser/shared/emoji/data/categories.json +1 -0
  247. package/browser/shared/emoji/data/icons.json +1 -0
  248. package/browser/shared/emoji/data/keywords-en.json +1 -0
  249. package/browser/shared/emoji/data/keywords-zh.json +1 -0
  250. package/browser/shared/emoji/data/names.json +1 -0
  251. package/browser/shared/emoji/data/positions.json +1 -0
  252. package/browser/shared/emoji/data/twemoji-index.json +1 -0
  253. package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
  254. package/browser/shared/emoji/data.mjs +196 -0
  255. package/browser/shared/emoji/emoji.mjs +37 -0
  256. package/browser/shared/emoji/glyphs.mjs +134 -0
  257. package/browser/shared/emoji/icon-value.mjs +90 -0
  258. package/browser/shared/escape.mjs +20 -0
  259. package/browser/shared/export-wrap.mjs +89 -0
  260. package/browser/shared/files.mjs +33 -0
  261. package/browser/shared/html-tree.mjs +53 -0
  262. package/browser/shared/http.mjs +22 -0
  263. package/browser/shared/i18n/en.mjs +1164 -0
  264. package/browser/shared/i18n/index.mjs +132 -0
  265. package/browser/shared/ids.mjs +24 -0
  266. package/browser/shared/import-types.mjs +23 -0
  267. package/browser/shared/inline-spacing.mjs +97 -0
  268. package/browser/shared/layers.mjs +42 -0
  269. package/browser/shared/media.mjs +162 -0
  270. package/browser/shared/new-names.mjs +64 -0
  271. package/browser/shared/number-reading.mjs +92 -0
  272. package/browser/shared/old-names.mjs +143 -0
  273. package/browser/shared/page-address.mjs +140 -0
  274. package/browser/shared/page-links.mjs +86 -0
  275. package/browser/shared/paths.mjs +73 -0
  276. package/browser/shared/preferences.mjs +110 -0
  277. package/browser/shared/preview-server.mjs +247 -0
  278. package/browser/shared/qa-levels.mjs +93 -0
  279. package/browser/shared/reading-place.mjs +91 -0
  280. package/browser/shared/renamed-storage.mjs +220 -0
  281. package/browser/shared/reports.mjs +46 -0
  282. package/browser/shared/search.mjs +85 -0
  283. package/browser/shared/session.mjs +76 -0
  284. package/browser/shared/table-chart.mjs +113 -0
  285. package/browser/shared/table-hides.mjs +120 -0
  286. package/browser/shared/table-slots.mjs +75 -0
  287. package/browser/shared/words.mjs +23 -0
  288. package/browser/shared/workspace.mjs +535 -0
  289. package/browser/shared/writing-preferences.mjs +68 -0
  290. package/browser/shared/zoom.mjs +57 -0
  291. package/dist/chunk-2B5E4CDJ.mjs +2 -0
  292. package/dist/chunk-2PBALTR3.mjs +57 -0
  293. package/dist/chunk-342HXE3Q.mjs +2 -0
  294. package/dist/chunk-3LA3EMDE.mjs +15 -0
  295. package/dist/chunk-43B75J5T.mjs +2 -0
  296. package/dist/chunk-4K5KC6V2.mjs +2 -0
  297. package/dist/chunk-5FRMCDPY.mjs +16 -0
  298. package/dist/chunk-5L7RYZCL.mjs +2 -0
  299. package/dist/chunk-5LEK2CBS.mjs +2 -0
  300. package/dist/chunk-5OFN5AHC.mjs +2 -0
  301. package/dist/chunk-5SIYS5HN.mjs +2 -0
  302. package/dist/chunk-5TEK3RAD.mjs +2 -0
  303. package/dist/chunk-6CYG3Z4V.mjs +2 -0
  304. package/dist/chunk-6U2SLSDN.mjs +3 -0
  305. package/dist/chunk-742D2WWJ.mjs +19 -0
  306. package/dist/chunk-7GHT2UCA.mjs +15 -0
  307. package/dist/chunk-7QQBR7PB.mjs +2 -0
  308. package/dist/chunk-A55HN5OK.mjs +2 -0
  309. package/dist/chunk-ACOPDCNB.mjs +2 -0
  310. package/dist/chunk-AGDILNWB.mjs +2 -0
  311. package/dist/chunk-ATCJYAR4.mjs +2 -0
  312. package/dist/chunk-B3VTYBYR.mjs +960 -0
  313. package/dist/chunk-C564NU2H.mjs +77 -0
  314. package/dist/chunk-C7HWOBIF.mjs +2 -0
  315. package/dist/chunk-DB4WKGYF.mjs +7 -0
  316. package/dist/chunk-E7VYDG2X.mjs +2 -0
  317. package/dist/chunk-EUX7IC5J.mjs +48 -0
  318. package/dist/chunk-EVJ3BX3M.mjs +2 -0
  319. package/dist/chunk-EZY3WC6Z.mjs +15 -0
  320. package/dist/chunk-FQGQH4KM.mjs +2 -0
  321. package/dist/chunk-G7TOXONE.mjs +6 -0
  322. package/dist/chunk-GPF4YWWB.mjs +9 -0
  323. package/dist/chunk-GRAXKKG4.mjs +2 -0
  324. package/dist/chunk-GYQV7Y4J.mjs +120 -0
  325. package/dist/chunk-HMHK3EQ6.mjs +2 -0
  326. package/dist/chunk-HQQMJCQJ.mjs +10 -0
  327. package/dist/chunk-HYMEEXKN.mjs +4 -0
  328. package/dist/chunk-IERUOGC3.mjs +6 -0
  329. package/dist/chunk-ITNLYXXV.mjs +3 -0
  330. package/dist/chunk-L4DVONOG.mjs +2 -0
  331. package/dist/chunk-LAE5NQ4B.mjs +2 -0
  332. package/dist/chunk-LC7YNQFG.mjs +2 -0
  333. package/dist/chunk-LHTFLRB6.mjs +4 -0
  334. package/dist/chunk-LKX55H76.mjs +2 -0
  335. package/dist/chunk-MAFIGVXY.mjs +2 -0
  336. package/dist/chunk-NFIBI4IP.mjs +26 -0
  337. package/dist/chunk-NSKUTQ5J.mjs +5 -0
  338. package/dist/chunk-O52JMOCZ.mjs +2 -0
  339. package/dist/chunk-P2CAZPDP.mjs +3 -0
  340. package/dist/chunk-QAIHRH3I.mjs +13 -0
  341. package/dist/chunk-QMQUXTU4.mjs +12 -0
  342. package/dist/chunk-QR6A54KJ.mjs +3 -0
  343. package/dist/chunk-QVWVFC5K.mjs +6 -0
  344. package/dist/chunk-QYKCJ7FG.mjs +8 -0
  345. package/dist/chunk-QZY6Q64C.mjs +2 -0
  346. package/dist/chunk-TDQP3DKQ.mjs +10 -0
  347. package/dist/chunk-TMYZB6AV.mjs +2 -0
  348. package/dist/chunk-TX6JH7TR.mjs +2 -0
  349. package/dist/chunk-U3SSPL4K.mjs +8 -0
  350. package/dist/chunk-UH4SIXTR.mjs +2 -0
  351. package/dist/chunk-UNUEWH4S.mjs +2 -0
  352. package/dist/chunk-UXUK4PMC.mjs +27 -0
  353. package/dist/chunk-V4CPWKMZ.mjs +2 -0
  354. package/dist/chunk-V6XZ4VIR.mjs +2 -0
  355. package/dist/chunk-VACRB2NE.mjs +3 -0
  356. package/dist/chunk-W63L7367.mjs +7 -0
  357. package/dist/chunk-W7CXPCRV.mjs +6 -0
  358. package/dist/chunk-W7XHE4CT.mjs +2 -0
  359. package/dist/chunk-XINNG4F2.mjs +4 -0
  360. package/dist/chunk-Y34NR5JL.mjs +2 -0
  361. package/dist/chunk-YEY3RSFQ.mjs +2 -0
  362. package/dist/chunk-YL2DPWVS.mjs +4 -0
  363. package/dist/chunk-YXAUQPVK.mjs +8 -0
  364. package/dist/chunk-YZ5Z6H4W.mjs +4 -0
  365. package/dist/chunk-Z52HTUW7.mjs +4 -0
  366. package/dist/chunk-ZBIM6ARY.mjs +216 -0
  367. package/dist/cli.mjs +2 -0
  368. package/dist/server.mjs +2 -0
  369. package/dist/worker.mjs +5 -0
  370. package/kit/charts.js +355 -0
  371. package/kit/code.js +164 -0
  372. package/kit/dialogs.js +157 -0
  373. package/kit/math.js +1988 -0
  374. package/kit/report.css +2821 -0
  375. package/kit/runtime.js +1707 -0
  376. package/kit/sheets.js +123 -0
  377. package/kit/state.js +217 -0
  378. package/kit/tables.js +1449 -0
  379. package/kit/tokens.js +29 -0
  380. package/kit/ui.js +561 -0
  381. package/package.json +41 -4
  382. package/release.json +25 -0
  383. package/sdk/column-widths.d.ts +56 -0
  384. package/sdk/doc-charts.d.ts +82 -0
  385. package/sdk/doc-code.d.ts +28 -0
  386. package/sdk/doc-dialogs.d.ts +4 -0
  387. package/sdk/doc-kit.d.ts +141 -0
  388. package/sdk/doc-math.d.ts +3 -0
  389. package/sdk/doc-sheets.d.ts +15 -0
  390. package/sdk/doc-state.d.ts +41 -0
  391. package/sdk/doc-tables.d.ts +24 -0
  392. package/sdk/doc-tokens.d.ts +22 -0
  393. package/sdk/index.d.ts +30 -0
  394. package/skill/SKILL.md +138 -0
  395. package/skill/agents/openai.yaml +5 -0
  396. package/skill/references/building-components.md +327 -0
  397. package/skill/references/example-report.html +356 -0
  398. package/skill/references/writing-html.md +187 -0
  399. package/skill/sdk/column-widths.d.ts +56 -0
  400. package/skill/sdk/doc-charts.d.ts +82 -0
  401. package/skill/sdk/doc-code.d.ts +28 -0
  402. package/skill/sdk/doc-dialogs.d.ts +4 -0
  403. package/skill/sdk/doc-kit.d.ts +141 -0
  404. package/skill/sdk/doc-math.d.ts +3 -0
  405. package/skill/sdk/doc-sheets.d.ts +15 -0
  406. package/skill/sdk/doc-state.d.ts +41 -0
  407. package/skill/sdk/doc-tables.d.ts +24 -0
  408. package/skill/sdk/doc-tokens.d.ts +22 -0
  409. package/skill/sdk/index.d.ts +30 -0
  410. package/starter/doc.html +21 -0
  411. package/starter/doc.json +5 -0
  412. package/vendor/d3.v7.9.0.min.js +2 -0
  413. package/vendor/katex/auto-render.min.js +1 -0
  414. package/vendor/katex/contrib/mhchem.min.js +1 -0
  415. package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  416. package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  417. package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  418. package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  419. package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  420. package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  421. package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  422. package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  423. package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  424. package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  425. package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  426. package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  427. package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  428. package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  429. package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  430. package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  431. package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  432. package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  433. package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  434. package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  435. package/vendor/katex/katex.min.css +1 -0
  436. package/vendor/katex/katex.min.js +1 -0
  437. package/vendor/pdfjs/LICENSE +177 -0
  438. package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  439. package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  440. package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  441. package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  442. package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  443. package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  444. package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  445. package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  446. package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  447. package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  448. package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  449. package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  450. package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  451. package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  452. package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  453. package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  454. package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  455. package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  456. package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  457. package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  458. package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  459. package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  460. package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  461. package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  462. package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  463. package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  464. package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  465. package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  466. package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  467. package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  468. package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  469. package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  470. package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  471. package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  472. package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  473. package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  474. package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  475. package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  476. package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  477. package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  478. package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  479. package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  480. package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  481. package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  482. package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  483. package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  484. package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  485. package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  486. package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  487. package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  488. package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  489. package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  490. package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  491. package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  492. package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  493. package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  494. package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  495. package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  496. package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  497. package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  498. package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  499. package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  500. package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  501. package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  502. package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  503. package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  504. package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  505. package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  506. package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  507. package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  508. package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
  509. package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  510. package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  511. package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  512. package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  513. package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  514. package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  515. package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  516. package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  517. package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  518. package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  519. package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  520. package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  521. package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  522. package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  523. package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  524. package/vendor/pdfjs/cmaps/H.bcmap +0 -0
  525. package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  526. package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  527. package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  528. package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  529. package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  530. package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  531. package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  532. package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  533. package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  534. package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  535. package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  536. package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  537. package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  538. package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  539. package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  540. package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  541. package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  542. package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  543. package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  544. package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  545. package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  546. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  547. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  548. package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  549. package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  550. package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  551. package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  552. package/vendor/pdfjs/cmaps/LICENSE +36 -0
  553. package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  554. package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  555. package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  556. package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  557. package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  558. package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  559. package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  560. package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  561. package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  562. package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  563. package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  564. package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  565. package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  566. package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  567. package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  568. package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  569. package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  570. package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  571. package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  572. package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  573. package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  574. package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  575. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  576. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  577. package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  578. package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  579. package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  580. package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  581. package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  582. package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  583. package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  584. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  585. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  586. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  587. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  588. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  589. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  590. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  591. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  592. package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  593. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  594. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  595. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  596. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  597. package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  598. package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  599. package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  600. package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  601. package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  602. package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  603. package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  604. package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  605. package/vendor/pdfjs/cmaps/V.bcmap +0 -0
  606. package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  607. package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
  608. package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
  609. package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  610. package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  611. package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  612. package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  613. package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  614. package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  615. package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  616. package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  617. package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  618. package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  619. package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  620. package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  621. package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  622. package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  623. package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  624. package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  625. package/vendor/types/@types/d3/LICENSE +21 -0
  626. package/vendor/types/@types/d3/index.d.ts +39 -0
  627. package/vendor/types/@types/d3/package.json +81 -0
  628. package/vendor/types/@types/d3-array/LICENSE +21 -0
  629. package/vendor/types/@types/d3-array/index.d.ts +1118 -0
  630. package/vendor/types/@types/d3-array/package.json +56 -0
  631. package/vendor/types/@types/d3-axis/LICENSE +21 -0
  632. package/vendor/types/@types/d3-axis/index.d.ts +293 -0
  633. package/vendor/types/@types/d3-axis/package.json +47 -0
  634. package/vendor/types/@types/d3-brush/LICENSE +21 -0
  635. package/vendor/types/@types/d3-brush/index.d.ts +255 -0
  636. package/vendor/types/@types/d3-brush/package.json +42 -0
  637. package/vendor/types/@types/d3-chord/LICENSE +21 -0
  638. package/vendor/types/@types/d3-chord/index.d.ts +471 -0
  639. package/vendor/types/@types/d3-chord/package.json +40 -0
  640. package/vendor/types/@types/d3-color/LICENSE +21 -0
  641. package/vendor/types/@types/d3-color/index.d.ts +669 -0
  642. package/vendor/types/@types/d3-color/package.json +55 -0
  643. package/vendor/types/@types/d3-contour/LICENSE +21 -0
  644. package/vendor/types/@types/d3-contour/index.d.ts +222 -0
  645. package/vendor/types/@types/d3-contour/package.json +38 -0
  646. package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
  647. package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
  648. package/vendor/types/@types/d3-delaunay/package.json +30 -0
  649. package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
  650. package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
  651. package/vendor/types/@types/d3-dispatch/package.json +51 -0
  652. package/vendor/types/@types/d3-drag/LICENSE +21 -0
  653. package/vendor/types/@types/d3-drag/index.d.ts +395 -0
  654. package/vendor/types/@types/d3-drag/package.json +42 -0
  655. package/vendor/types/@types/d3-dsv/LICENSE +21 -0
  656. package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
  657. package/vendor/types/@types/d3-dsv/package.json +45 -0
  658. package/vendor/types/@types/d3-ease/LICENSE +21 -0
  659. package/vendor/types/@types/d3-ease/index.d.ts +316 -0
  660. package/vendor/types/@types/d3-ease/package.json +40 -0
  661. package/vendor/types/@types/d3-fetch/LICENSE +21 -0
  662. package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
  663. package/vendor/types/@types/d3-fetch/package.json +37 -0
  664. package/vendor/types/@types/d3-force/LICENSE +21 -0
  665. package/vendor/types/@types/d3-force/index.d.ts +899 -0
  666. package/vendor/types/@types/d3-force/package.json +45 -0
  667. package/vendor/types/@types/d3-format/LICENSE +21 -0
  668. package/vendor/types/@types/d3-format/index.d.ts +337 -0
  669. package/vendor/types/@types/d3-format/package.json +45 -0
  670. package/vendor/types/@types/d3-geo/LICENSE +21 -0
  671. package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
  672. package/vendor/types/@types/d3-geo/package.json +48 -0
  673. package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
  674. package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
  675. package/vendor/types/@types/d3-hierarchy/package.json +50 -0
  676. package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
  677. package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
  678. package/vendor/types/@types/d3-interpolate/package.json +47 -0
  679. package/vendor/types/@types/d3-path/LICENSE +21 -0
  680. package/vendor/types/@types/d3-path/index.d.ts +108 -0
  681. package/vendor/types/@types/d3-path/package.json +41 -0
  682. package/vendor/types/@types/d3-polygon/LICENSE +21 -0
  683. package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
  684. package/vendor/types/@types/d3-polygon/package.json +40 -0
  685. package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
  686. package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
  687. package/vendor/types/@types/d3-quadtree/package.json +45 -0
  688. package/vendor/types/@types/d3-random/LICENSE +21 -0
  689. package/vendor/types/@types/d3-random/index.d.ts +313 -0
  690. package/vendor/types/@types/d3-random/package.json +41 -0
  691. package/vendor/types/@types/d3-scale/LICENSE +21 -0
  692. package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
  693. package/vendor/types/@types/d3-scale/package.json +53 -0
  694. package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
  695. package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
  696. package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
  697. package/vendor/types/@types/d3-selection/LICENSE +21 -0
  698. package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
  699. package/vendor/types/@types/d3-selection/package.json +56 -0
  700. package/vendor/types/@types/d3-shape/LICENSE +21 -0
  701. package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
  702. package/vendor/types/@types/d3-shape/package.json +53 -0
  703. package/vendor/types/@types/d3-time/LICENSE +21 -0
  704. package/vendor/types/@types/d3-time/index.d.ts +697 -0
  705. package/vendor/types/@types/d3-time/package.json +46 -0
  706. package/vendor/types/@types/d3-time-format/LICENSE +21 -0
  707. package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
  708. package/vendor/types/@types/d3-time-format/package.json +40 -0
  709. package/vendor/types/@types/d3-timer/LICENSE +21 -0
  710. package/vendor/types/@types/d3-timer/index.d.ts +68 -0
  711. package/vendor/types/@types/d3-timer/package.json +45 -0
  712. package/vendor/types/@types/d3-transition/LICENSE +21 -0
  713. package/vendor/types/@types/d3-transition/index.d.ts +664 -0
  714. package/vendor/types/@types/d3-transition/package.json +47 -0
  715. package/vendor/types/@types/d3-zoom/LICENSE +21 -0
  716. package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
  717. package/vendor/types/@types/d3-zoom/package.json +48 -0
  718. package/vendor/types/@types/geojson/LICENSE +21 -0
  719. package/vendor/types/@types/geojson/index.d.ts +202 -0
  720. package/vendor/types/@types/geojson/package.json +46 -0
  721. package/vendor/typescript/LICENSE.txt +55 -0
  722. package/vendor/typescript/lib.decorators.d.ts +384 -0
  723. package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
  724. package/vendor/typescript/lib.dom.d.ts +39429 -0
  725. package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
  726. package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
  727. package/vendor/typescript/lib.es2015.core.d.ts +597 -0
  728. package/vendor/typescript/lib.es2015.d.ts +28 -0
  729. package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
  730. package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
  731. package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
  732. package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
  733. package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
  734. package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
  735. package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
  736. package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
  737. package/vendor/typescript/lib.es2016.d.ts +21 -0
  738. package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
  739. package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
  740. package/vendor/typescript/lib.es2017.d.ts +26 -0
  741. package/vendor/typescript/lib.es2017.date.d.ts +31 -0
  742. package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
  743. package/vendor/typescript/lib.es2017.object.d.ts +49 -0
  744. package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
  745. package/vendor/typescript/lib.es2017.string.d.ts +45 -0
  746. package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
  747. package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
  748. package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
  749. package/vendor/typescript/lib.es2018.d.ts +24 -0
  750. package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
  751. package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
  752. package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
  753. package/vendor/typescript/lib.es2019.array.d.ts +79 -0
  754. package/vendor/typescript/lib.es2019.d.ts +24 -0
  755. package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
  756. package/vendor/typescript/lib.es2019.object.d.ts +33 -0
  757. package/vendor/typescript/lib.es2019.string.d.ts +37 -0
  758. package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
  759. package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
  760. package/vendor/typescript/lib.es2020.d.ts +27 -0
  761. package/vendor/typescript/lib.es2020.date.d.ts +42 -0
  762. package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
  763. package/vendor/typescript/lib.es2020.number.d.ts +28 -0
  764. package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
  765. package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
  766. package/vendor/typescript/lib.es2020.string.d.ts +44 -0
  767. package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
  768. package/vendor/typescript/lib.es2021.d.ts +23 -0
  769. package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
  770. package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
  771. package/vendor/typescript/lib.es2021.string.d.ts +33 -0
  772. package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
  773. package/vendor/typescript/lib.es2022.array.d.ts +121 -0
  774. package/vendor/typescript/lib.es2022.d.ts +25 -0
  775. package/vendor/typescript/lib.es2022.error.d.ts +75 -0
  776. package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
  777. package/vendor/typescript/lib.es2022.object.d.ts +26 -0
  778. package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
  779. package/vendor/typescript/lib.es2022.string.d.ts +25 -0
  780. package/vendor/typescript/lib.es5.d.ts +4601 -0
  781. package/vendor/typescript/package.json +4 -0
  782. package/vendor/typescript/typescript.js +446 -0
  783. package/web/assets/index-B6Ai3wsa.js +13 -0
  784. package/web/assets/index-SYPC3EZy.css +1 -0
  785. package/web/index.html +14 -0
package/kit/math.js ADDED
@@ -0,0 +1,1988 @@
1
+ "use strict";
2
+ (() => {
3
+ // src/render/kit/page-katex.js
4
+ var page_katex_default = globalThis.katex;
5
+
6
+ // ../../../node_modules/katex/contrib/mhchem/mhchem.js
7
+ page_katex_default.__defineMacro("\\ce", function(context) {
8
+ return chemParse(context.consumeArgs(1)[0], "ce");
9
+ });
10
+ page_katex_default.__defineMacro("\\pu", function(context) {
11
+ return chemParse(context.consumeArgs(1)[0], "pu");
12
+ });
13
+ page_katex_default.__defineMacro("\\tripledash", "{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");
14
+ var chemParse = function(tokens, stateMachine) {
15
+ var str = "";
16
+ var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start;
17
+ for (var i = tokens.length - 1; i >= 0; i--) {
18
+ if (tokens[i].loc.start > expectedLoc) {
19
+ str += " ";
20
+ expectedLoc = tokens[i].loc.start;
21
+ }
22
+ str += tokens[i].text;
23
+ expectedLoc += tokens[i].text.length;
24
+ }
25
+ var tex = texify.go(mhchemParser.go(str, stateMachine));
26
+ return tex;
27
+ };
28
+ var mhchemParser = {
29
+ //
30
+ // Parses mchem \ce syntax
31
+ //
32
+ // Call like
33
+ // go("H2O");
34
+ //
35
+ go: function(input, stateMachine) {
36
+ if (!input) {
37
+ return [];
38
+ }
39
+ if (stateMachine === void 0) {
40
+ stateMachine = "ce";
41
+ }
42
+ var state = "0";
43
+ var buffer = {};
44
+ buffer["parenthesisLevel"] = 0;
45
+ input = input.replace(/\n/g, " ");
46
+ input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
47
+ input = input.replace(/[\u2026]/g, "...");
48
+ var lastInput;
49
+ var watchdog = 10;
50
+ var output = [];
51
+ while (true) {
52
+ if (lastInput !== input) {
53
+ watchdog = 10;
54
+ lastInput = input;
55
+ } else {
56
+ watchdog--;
57
+ }
58
+ var machine = mhchemParser.stateMachines[stateMachine];
59
+ var t = machine.transitions[state] || machine.transitions["*"];
60
+ iterateTransitions:
61
+ for (var i = 0; i < t.length; i++) {
62
+ var matches = mhchemParser.patterns.match_(t[i].pattern, input);
63
+ if (matches) {
64
+ var task = t[i].task;
65
+ for (var iA = 0; iA < task.action_.length; iA++) {
66
+ var o;
67
+ if (machine.actions[task.action_[iA].type_]) {
68
+ o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
69
+ } else if (mhchemParser.actions[task.action_[iA].type_]) {
70
+ o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
71
+ } else {
72
+ throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"];
73
+ }
74
+ mhchemParser.concatArray(output, o);
75
+ }
76
+ state = task.nextState || state;
77
+ if (input.length > 0) {
78
+ if (!task.revisit) {
79
+ input = matches.remainder;
80
+ }
81
+ if (!task.toContinue) {
82
+ break iterateTransitions;
83
+ }
84
+ } else {
85
+ return output;
86
+ }
87
+ }
88
+ }
89
+ if (watchdog <= 0) {
90
+ throw ["MhchemBugU", "mhchem bug U. Please report."];
91
+ }
92
+ }
93
+ },
94
+ concatArray: function(a, b) {
95
+ if (b) {
96
+ if (Array.isArray(b)) {
97
+ for (var iB = 0; iB < b.length; iB++) {
98
+ a.push(b[iB]);
99
+ }
100
+ } else {
101
+ a.push(b);
102
+ }
103
+ }
104
+ },
105
+ patterns: {
106
+ //
107
+ // Matching patterns
108
+ // either regexps or function that return null or {match_:"a", remainder:"bc"}
109
+ //
110
+ patterns: {
111
+ // property names must not look like integers ("2") for correct property traversal order, later on
112
+ "empty": /^$/,
113
+ "else": /^./,
114
+ "else2": /^./,
115
+ "space": /^\s/,
116
+ "space A": /^\s(?=[A-Z\\$])/,
117
+ "space$": /^\s$/,
118
+ "a-z": /^[a-z]/,
119
+ "x": /^x/,
120
+ "x$": /^x$/,
121
+ "i$": /^i$/,
122
+ "letters": /^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,
123
+ "\\greek": /^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,
124
+ "one lowercase latin letter $": /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
125
+ "$one lowercase latin letter$ $": /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
126
+ "one lowercase greek letter $": /^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,
127
+ "digits": /^[0-9]+/,
128
+ "-9.,9": /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
129
+ "-9.,9 no missing 0": /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
130
+ "(-)(9.,9)(e)(99)": function(input) {
131
+ var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);
132
+ if (m && m[0]) {
133
+ return { match_: m.splice(1), remainder: input.substr(m[0].length) };
134
+ }
135
+ return null;
136
+ },
137
+ "(-)(9)^(-9)": function(input) {
138
+ var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);
139
+ if (m && m[0]) {
140
+ return { match_: m.splice(1), remainder: input.substr(m[0].length) };
141
+ }
142
+ return null;
143
+ },
144
+ "state of aggregation $": function(input) {
145
+ var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", "");
146
+ if (a && a.remainder.match(/^($|[\s,;\)\]\}])/)) {
147
+ return a;
148
+ }
149
+ var m = input.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);
150
+ if (m) {
151
+ return { match_: m[0], remainder: input.substr(m[0].length) };
152
+ }
153
+ return null;
154
+ },
155
+ "_{(state of aggregation)}$": /^_\{(\([a-z]{1,3}\))\}/,
156
+ "{[(": /^(?:\\\{|\[|\()/,
157
+ ")]}": /^(?:\)|\]|\\\})/,
158
+ ", ": /^[,;]\s*/,
159
+ ",": /^[,;]/,
160
+ ".": /^[.]/,
161
+ ". ": /^([.\u22C5\u00B7\u2022])\s*/,
162
+ "...": /^\.\.\.(?=$|[^.])/,
163
+ "* ": /^([*])\s*/,
164
+ "^{(...)}": function(input) {
165
+ return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}");
166
+ },
167
+ "^($...$)": function(input) {
168
+ return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", "");
169
+ },
170
+ "^a": /^\^([0-9]+|[^\\_])/,
171
+ "^\\x{}{}": function(input) {
172
+ return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
173
+ },
174
+ "^\\x{}": function(input) {
175
+ return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "");
176
+ },
177
+ "^\\x": /^\^(\\[a-zA-Z]+)\s*/,
178
+ "^(-1)": /^\^(-?\d+)/,
179
+ "'": /^'/,
180
+ "_{(...)}": function(input) {
181
+ return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}");
182
+ },
183
+ "_($...$)": function(input) {
184
+ return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", "");
185
+ },
186
+ "_9": /^_([+\-]?[0-9]+|[^\\])/,
187
+ "_\\x{}{}": function(input) {
188
+ return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
189
+ },
190
+ "_\\x{}": function(input) {
191
+ return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "");
192
+ },
193
+ "_\\x": /^_(\\[a-zA-Z]+)\s*/,
194
+ "^_": /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
195
+ "{}": /^\{\}/,
196
+ "{...}": function(input) {
197
+ return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", "");
198
+ },
199
+ "{(...)}": function(input) {
200
+ return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}");
201
+ },
202
+ "$...$": function(input) {
203
+ return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
204
+ },
205
+ "${(...)}$": function(input) {
206
+ return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$");
207
+ },
208
+ "$(...)$": function(input) {
209
+ return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$");
210
+ },
211
+ "=<>": /^[=<>]/,
212
+ "#": /^[#\u2261]/,
213
+ "+": /^\+/,
214
+ "-$": /^-(?=[\s_},;\]/]|$|\([a-z]+\))/,
215
+ // -space -, -; -] -/ -$ -state-of-aggregation
216
+ "-9": /^-(?=[0-9])/,
217
+ "- orbital overlap": /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
218
+ "-": /^-/,
219
+ "pm-operator": /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
220
+ "operator": /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
221
+ "arrowUpDown": /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
222
+ "\\bond{(...)}": function(input) {
223
+ return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}");
224
+ },
225
+ "->": /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
226
+ "CMT": /^[CMT](?=\[)/,
227
+ "[(...)]": function(input) {
228
+ return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]");
229
+ },
230
+ "1st-level escape": /^(&|\\\\|\\hline)\s*/,
231
+ "\\,": /^(?:\\[,\ ;:])/,
232
+ // \\x - but output no space before
233
+ "\\x{}{}": function(input) {
234
+ return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
235
+ },
236
+ "\\x{}": function(input) {
237
+ return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "");
238
+ },
239
+ "\\ca": /^\\ca(?:\s+|(?![a-zA-Z]))/,
240
+ "\\x": /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
241
+ "orbital": /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,
242
+ // only those with numbers in front, because the others will be formatted correctly anyway
243
+ "others": /^[\/~|]/,
244
+ "\\frac{(...)}": function(input) {
245
+ return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}");
246
+ },
247
+ "\\overset{(...)}": function(input) {
248
+ return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}");
249
+ },
250
+ "\\underset{(...)}": function(input) {
251
+ return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}");
252
+ },
253
+ "\\underbrace{(...)}": function(input) {
254
+ return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}");
255
+ },
256
+ "\\color{(...)}0": function(input) {
257
+ return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}");
258
+ },
259
+ "\\color{(...)}{(...)}1": function(input) {
260
+ return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}");
261
+ },
262
+ "\\color(...){(...)}2": function(input) {
263
+ return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}");
264
+ },
265
+ "\\ce{(...)}": function(input) {
266
+ return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}");
267
+ },
268
+ "oxidation$": /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
269
+ "d-oxidation$": /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
270
+ // 0 could be oxidation or charge
271
+ "roman numeral": /^[IVX]+/,
272
+ "1/2$": /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
273
+ "amount": function(input) {
274
+ var match;
275
+ match = input.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/);
276
+ if (match) {
277
+ return { match_: match[0], remainder: input.substr(match[0].length) };
278
+ }
279
+ var a = mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
280
+ if (a) {
281
+ match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
282
+ if (match) {
283
+ return { match_: match[0], remainder: input.substr(match[0].length) };
284
+ }
285
+ }
286
+ return null;
287
+ },
288
+ "amount2": function(input) {
289
+ return this["amount"](input);
290
+ },
291
+ "(KV letters),": /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
292
+ "formula$": function(input) {
293
+ if (input.match(/^\([a-z]+\)$/)) {
294
+ return null;
295
+ }
296
+ var match = input.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
297
+ if (match) {
298
+ return { match_: match[0], remainder: input.substr(match[0].length) };
299
+ }
300
+ return null;
301
+ },
302
+ "uprightEntities": /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
303
+ "/": /^\s*(\/)\s*/,
304
+ "//": /^\s*(\/\/)\s*/,
305
+ "*": /^\s*[*.]\s*/
306
+ },
307
+ findObserveGroups: function(input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
308
+ var _match = function(input2, pattern) {
309
+ if (typeof pattern === "string") {
310
+ if (input2.indexOf(pattern) !== 0) {
311
+ return null;
312
+ }
313
+ return pattern;
314
+ } else {
315
+ var match2 = input2.match(pattern);
316
+ if (!match2) {
317
+ return null;
318
+ }
319
+ return match2[0];
320
+ }
321
+ };
322
+ var _findObserveGroups = function(input2, i, endChars) {
323
+ var braces = 0;
324
+ while (i < input2.length) {
325
+ var a = input2.charAt(i);
326
+ var match2 = _match(input2.substr(i), endChars);
327
+ if (match2 !== null && braces === 0) {
328
+ return { endMatchBegin: i, endMatchEnd: i + match2.length };
329
+ } else if (a === "{") {
330
+ braces++;
331
+ } else if (a === "}") {
332
+ if (braces === 0) {
333
+ throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
334
+ } else {
335
+ braces--;
336
+ }
337
+ }
338
+ i++;
339
+ }
340
+ if (braces > 0) {
341
+ return null;
342
+ }
343
+ return null;
344
+ };
345
+ var match = _match(input, begExcl);
346
+ if (match === null) {
347
+ return null;
348
+ }
349
+ input = input.substr(match.length);
350
+ match = _match(input, begIncl);
351
+ if (match === null) {
352
+ return null;
353
+ }
354
+ var e = _findObserveGroups(input, match.length, endIncl || endExcl);
355
+ if (e === null) {
356
+ return null;
357
+ }
358
+ var match1 = input.substring(0, endIncl ? e.endMatchEnd : e.endMatchBegin);
359
+ if (!(beg2Excl || beg2Incl)) {
360
+ return {
361
+ match_: match1,
362
+ remainder: input.substr(e.endMatchEnd)
363
+ };
364
+ } else {
365
+ var group2 = this.findObserveGroups(input.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
366
+ if (group2 === null) {
367
+ return null;
368
+ }
369
+ var matchRet = [match1, group2.match_];
370
+ return {
371
+ match_: combine ? matchRet.join("") : matchRet,
372
+ remainder: group2.remainder
373
+ };
374
+ }
375
+ },
376
+ //
377
+ // Matching function
378
+ // e.g. match("a", input) will look for the regexp called "a" and see if it matches
379
+ // returns null or {match_:"a", remainder:"bc"}
380
+ //
381
+ match_: function(m, input) {
382
+ var pattern = mhchemParser.patterns.patterns[m];
383
+ if (pattern === void 0) {
384
+ throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"];
385
+ } else if (typeof pattern === "function") {
386
+ return mhchemParser.patterns.patterns[m](input);
387
+ } else {
388
+ var match = input.match(pattern);
389
+ if (match) {
390
+ var mm;
391
+ if (match[2]) {
392
+ mm = [match[1], match[2]];
393
+ } else if (match[1]) {
394
+ mm = match[1];
395
+ } else {
396
+ mm = match[0];
397
+ }
398
+ return { match_: mm, remainder: input.substr(match[0].length) };
399
+ }
400
+ return null;
401
+ }
402
+ }
403
+ },
404
+ //
405
+ // Generic state machine actions
406
+ //
407
+ actions: {
408
+ "a=": function(buffer, m) {
409
+ buffer.a = (buffer.a || "") + m;
410
+ },
411
+ "b=": function(buffer, m) {
412
+ buffer.b = (buffer.b || "") + m;
413
+ },
414
+ "p=": function(buffer, m) {
415
+ buffer.p = (buffer.p || "") + m;
416
+ },
417
+ "o=": function(buffer, m) {
418
+ buffer.o = (buffer.o || "") + m;
419
+ },
420
+ "q=": function(buffer, m) {
421
+ buffer.q = (buffer.q || "") + m;
422
+ },
423
+ "d=": function(buffer, m) {
424
+ buffer.d = (buffer.d || "") + m;
425
+ },
426
+ "rm=": function(buffer, m) {
427
+ buffer.rm = (buffer.rm || "") + m;
428
+ },
429
+ "text=": function(buffer, m) {
430
+ buffer.text_ = (buffer.text_ || "") + m;
431
+ },
432
+ "insert": function(buffer, m, a) {
433
+ return { type_: a };
434
+ },
435
+ "insert+p1": function(buffer, m, a) {
436
+ return { type_: a, p1: m };
437
+ },
438
+ "insert+p1+p2": function(buffer, m, a) {
439
+ return { type_: a, p1: m[0], p2: m[1] };
440
+ },
441
+ "copy": function(buffer, m) {
442
+ return m;
443
+ },
444
+ "rm": function(buffer, m) {
445
+ return { type_: "rm", p1: m || "" };
446
+ },
447
+ "text": function(buffer, m) {
448
+ return mhchemParser.go(m, "text");
449
+ },
450
+ "{text}": function(buffer, m) {
451
+ var ret = ["{"];
452
+ mhchemParser.concatArray(ret, mhchemParser.go(m, "text"));
453
+ ret.push("}");
454
+ return ret;
455
+ },
456
+ "tex-math": function(buffer, m) {
457
+ return mhchemParser.go(m, "tex-math");
458
+ },
459
+ "tex-math tight": function(buffer, m) {
460
+ return mhchemParser.go(m, "tex-math tight");
461
+ },
462
+ "bond": function(buffer, m, k) {
463
+ return { type_: "bond", kind_: k || m };
464
+ },
465
+ "color0-output": function(buffer, m) {
466
+ return { type_: "color0", color: m[0] };
467
+ },
468
+ "ce": function(buffer, m) {
469
+ return mhchemParser.go(m);
470
+ },
471
+ "1/2": function(buffer, m) {
472
+ var ret = [];
473
+ if (m.match(/^[+\-]/)) {
474
+ ret.push(m.substr(0, 1));
475
+ m = m.substr(1);
476
+ }
477
+ var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
478
+ n[1] = n[1].replace(/\$/g, "");
479
+ ret.push({ type_: "frac", p1: n[1], p2: n[2] });
480
+ if (n[3]) {
481
+ n[3] = n[3].replace(/\$/g, "");
482
+ ret.push({ type_: "tex-math", p1: n[3] });
483
+ }
484
+ return ret;
485
+ },
486
+ "9,9": function(buffer, m) {
487
+ return mhchemParser.go(m, "9,9");
488
+ }
489
+ },
490
+ //
491
+ // createTransitions
492
+ // convert { 'letter': { 'state': { action_: 'output' } } } to { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] }
493
+ // with expansion of 'a|b' to 'a' and 'b' (at 2 places)
494
+ //
495
+ createTransitions: function(o) {
496
+ var pattern, state;
497
+ var stateArray;
498
+ var i;
499
+ var transitions = {};
500
+ for (pattern in o) {
501
+ for (state in o[pattern]) {
502
+ stateArray = state.split("|");
503
+ o[pattern][state].stateArray = stateArray;
504
+ for (i = 0; i < stateArray.length; i++) {
505
+ transitions[stateArray[i]] = [];
506
+ }
507
+ }
508
+ }
509
+ for (pattern in o) {
510
+ for (state in o[pattern]) {
511
+ stateArray = o[pattern][state].stateArray || [];
512
+ for (i = 0; i < stateArray.length; i++) {
513
+ var p = o[pattern][state];
514
+ if (p.action_) {
515
+ p.action_ = [].concat(p.action_);
516
+ for (var k = 0; k < p.action_.length; k++) {
517
+ if (typeof p.action_[k] === "string") {
518
+ p.action_[k] = { type_: p.action_[k] };
519
+ }
520
+ }
521
+ } else {
522
+ p.action_ = [];
523
+ }
524
+ var patternArray = pattern.split("|");
525
+ for (var j = 0; j < patternArray.length; j++) {
526
+ if (stateArray[i] === "*") {
527
+ for (var t in transitions) {
528
+ transitions[t].push({ pattern: patternArray[j], task: p });
529
+ }
530
+ } else {
531
+ transitions[stateArray[i]].push({ pattern: patternArray[j], task: p });
532
+ }
533
+ }
534
+ }
535
+ }
536
+ }
537
+ return transitions;
538
+ },
539
+ stateMachines: {}
540
+ };
541
+ mhchemParser.stateMachines = {
542
+ //
543
+ // \ce state machines
544
+ //
545
+ //#region ce
546
+ "ce": {
547
+ // main parser
548
+ transitions: mhchemParser.createTransitions({
549
+ "empty": {
550
+ "*": { action_: "output" }
551
+ },
552
+ "else": {
553
+ "0|1|2": { action_: "beginsWithBond=false", revisit: true, toContinue: true }
554
+ },
555
+ "oxidation$": {
556
+ "0": { action_: "oxidation-output" }
557
+ },
558
+ "CMT": {
559
+ "r": { action_: "rdt=", nextState: "rt" },
560
+ "rd": { action_: "rqt=", nextState: "rdt" }
561
+ },
562
+ "arrowUpDown": {
563
+ "0|1|2|as": { action_: ["sb=false", "output", "operator"], nextState: "1" }
564
+ },
565
+ "uprightEntities": {
566
+ "0|1|2": { action_: ["o=", "output"], nextState: "1" }
567
+ },
568
+ "orbital": {
569
+ "0|1|2|3": { action_: "o=", nextState: "o" }
570
+ },
571
+ "->": {
572
+ "0|1|2|3": { action_: "r=", nextState: "r" },
573
+ "a|as": { action_: ["output", "r="], nextState: "r" },
574
+ "*": { action_: ["output", "r="], nextState: "r" }
575
+ },
576
+ "+": {
577
+ "o": { action_: "d= kv", nextState: "d" },
578
+ "d|D": { action_: "d=", nextState: "d" },
579
+ "q": { action_: "d=", nextState: "qd" },
580
+ "qd|qD": { action_: "d=", nextState: "qd" },
581
+ "dq": { action_: ["output", "d="], nextState: "d" },
582
+ "3": { action_: ["sb=false", "output", "operator"], nextState: "0" }
583
+ },
584
+ "amount": {
585
+ "0|2": { action_: "a=", nextState: "a" }
586
+ },
587
+ "pm-operator": {
588
+ "0|1|2|a|as": { action_: ["sb=false", "output", { type_: "operator", option: "\\pm" }], nextState: "0" }
589
+ },
590
+ "operator": {
591
+ "0|1|2|a|as": { action_: ["sb=false", "output", "operator"], nextState: "0" }
592
+ },
593
+ "-$": {
594
+ "o|q": { action_: ["charge or bond", "output"], nextState: "qd" },
595
+ "d": { action_: "d=", nextState: "d" },
596
+ "D": { action_: ["output", { type_: "bond", option: "-" }], nextState: "3" },
597
+ "q": { action_: "d=", nextState: "qd" },
598
+ "qd": { action_: "d=", nextState: "qd" },
599
+ "qD|dq": { action_: ["output", { type_: "bond", option: "-" }], nextState: "3" }
600
+ },
601
+ "-9": {
602
+ "3|o": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "3" }
603
+ },
604
+ "- orbital overlap": {
605
+ "o": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "2" },
606
+ "d": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "2" }
607
+ },
608
+ "-": {
609
+ "0|1|2": { action_: [{ type_: "output", option: 1 }, "beginsWithBond=true", { type_: "bond", option: "-" }], nextState: "3" },
610
+ "3": { action_: { type_: "bond", option: "-" } },
611
+ "a": { action_: ["output", { type_: "insert", option: "hyphen" }], nextState: "2" },
612
+ "as": { action_: [{ type_: "output", option: 2 }, { type_: "bond", option: "-" }], nextState: "3" },
613
+ "b": { action_: "b=" },
614
+ "o": { action_: { type_: "- after o/d", option: false }, nextState: "2" },
615
+ "q": { action_: { type_: "- after o/d", option: false }, nextState: "2" },
616
+ "d|qd|dq": { action_: { type_: "- after o/d", option: true }, nextState: "2" },
617
+ "D|qD|p": { action_: ["output", { type_: "bond", option: "-" }], nextState: "3" }
618
+ },
619
+ "amount2": {
620
+ "1|3": { action_: "a=", nextState: "a" }
621
+ },
622
+ "letters": {
623
+ "0|1|2|3|a|as|b|p|bp|o": { action_: "o=", nextState: "o" },
624
+ "q|dq": { action_: ["output", "o="], nextState: "o" },
625
+ "d|D|qd|qD": { action_: "o after d", nextState: "o" }
626
+ },
627
+ "digits": {
628
+ "o": { action_: "q=", nextState: "q" },
629
+ "d|D": { action_: "q=", nextState: "dq" },
630
+ "q": { action_: ["output", "o="], nextState: "o" },
631
+ "a": { action_: "o=", nextState: "o" }
632
+ },
633
+ "space A": {
634
+ "b|p|bp": {}
635
+ },
636
+ "space": {
637
+ "a": { nextState: "as" },
638
+ "0": { action_: "sb=false" },
639
+ "1|2": { action_: "sb=true" },
640
+ "r|rt|rd|rdt|rdq": { action_: "output", nextState: "0" },
641
+ "*": { action_: ["output", "sb=true"], nextState: "1" }
642
+ },
643
+ "1st-level escape": {
644
+ "1|2": { action_: ["output", { type_: "insert+p1", option: "1st-level escape" }] },
645
+ "*": { action_: ["output", { type_: "insert+p1", option: "1st-level escape" }], nextState: "0" }
646
+ },
647
+ "[(...)]": {
648
+ "r|rt": { action_: "rd=", nextState: "rd" },
649
+ "rd|rdt": { action_: "rq=", nextState: "rdq" }
650
+ },
651
+ "...": {
652
+ "o|d|D|dq|qd|qD": { action_: ["output", { type_: "bond", option: "..." }], nextState: "3" },
653
+ "*": { action_: [{ type_: "output", option: 1 }, { type_: "insert", option: "ellipsis" }], nextState: "1" }
654
+ },
655
+ ". |* ": {
656
+ "*": { action_: ["output", { type_: "insert", option: "addition compound" }], nextState: "1" }
657
+ },
658
+ "state of aggregation $": {
659
+ "*": { action_: ["output", "state of aggregation"], nextState: "1" }
660
+ },
661
+ "{[(": {
662
+ "a|as|o": { action_: ["o=", "output", "parenthesisLevel++"], nextState: "2" },
663
+ "0|1|2|3": { action_: ["o=", "output", "parenthesisLevel++"], nextState: "2" },
664
+ "*": { action_: ["output", "o=", "output", "parenthesisLevel++"], nextState: "2" }
665
+ },
666
+ ")]}": {
667
+ "0|1|2|3|b|p|bp|o": { action_: ["o=", "parenthesisLevel--"], nextState: "o" },
668
+ "a|as|d|D|q|qd|qD|dq": { action_: ["output", "o=", "parenthesisLevel--"], nextState: "o" }
669
+ },
670
+ ", ": {
671
+ "*": { action_: ["output", "comma"], nextState: "0" }
672
+ },
673
+ "^_": {
674
+ // ^ and _ without a sensible argument
675
+ "*": {}
676
+ },
677
+ "^{(...)}|^($...$)": {
678
+ "0|1|2|as": { action_: "b=", nextState: "b" },
679
+ "p": { action_: "b=", nextState: "bp" },
680
+ "3|o": { action_: "d= kv", nextState: "D" },
681
+ "q": { action_: "d=", nextState: "qD" },
682
+ "d|D|qd|qD|dq": { action_: ["output", "d="], nextState: "D" }
683
+ },
684
+ "^a|^\\x{}{}|^\\x{}|^\\x|'": {
685
+ "0|1|2|as": { action_: "b=", nextState: "b" },
686
+ "p": { action_: "b=", nextState: "bp" },
687
+ "3|o": { action_: "d= kv", nextState: "d" },
688
+ "q": { action_: "d=", nextState: "qd" },
689
+ "d|qd|D|qD": { action_: "d=" },
690
+ "dq": { action_: ["output", "d="], nextState: "d" }
691
+ },
692
+ "_{(state of aggregation)}$": {
693
+ "d|D|q|qd|qD|dq": { action_: ["output", "q="], nextState: "q" }
694
+ },
695
+ "_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x": {
696
+ "0|1|2|as": { action_: "p=", nextState: "p" },
697
+ "b": { action_: "p=", nextState: "bp" },
698
+ "3|o": { action_: "q=", nextState: "q" },
699
+ "d|D": { action_: "q=", nextState: "dq" },
700
+ "q|qd|qD|dq": { action_: ["output", "q="], nextState: "q" }
701
+ },
702
+ "=<>": {
703
+ "0|1|2|3|a|as|o|q|d|D|qd|qD|dq": { action_: [{ type_: "output", option: 2 }, "bond"], nextState: "3" }
704
+ },
705
+ "#": {
706
+ "0|1|2|3|a|as|o": { action_: [{ type_: "output", option: 2 }, { type_: "bond", option: "#" }], nextState: "3" }
707
+ },
708
+ "{}": {
709
+ "*": { action_: { type_: "output", option: 1 }, nextState: "1" }
710
+ },
711
+ "{...}": {
712
+ "0|1|2|3|a|as|b|p|bp": { action_: "o=", nextState: "o" },
713
+ "o|d|D|q|qd|qD|dq": { action_: ["output", "o="], nextState: "o" }
714
+ },
715
+ "$...$": {
716
+ "a": { action_: "a=" },
717
+ // 2$n$
718
+ "0|1|2|3|as|b|p|bp|o": { action_: "o=", nextState: "o" },
719
+ // not 'amount'
720
+ "as|o": { action_: "o=" },
721
+ "q|d|D|qd|qD|dq": { action_: ["output", "o="], nextState: "o" }
722
+ },
723
+ "\\bond{(...)}": {
724
+ "*": { action_: [{ type_: "output", option: 2 }, "bond"], nextState: "3" }
725
+ },
726
+ "\\frac{(...)}": {
727
+ "*": { action_: [{ type_: "output", option: 1 }, "frac-output"], nextState: "3" }
728
+ },
729
+ "\\overset{(...)}": {
730
+ "*": { action_: [{ type_: "output", option: 2 }, "overset-output"], nextState: "3" }
731
+ },
732
+ "\\underset{(...)}": {
733
+ "*": { action_: [{ type_: "output", option: 2 }, "underset-output"], nextState: "3" }
734
+ },
735
+ "\\underbrace{(...)}": {
736
+ "*": { action_: [{ type_: "output", option: 2 }, "underbrace-output"], nextState: "3" }
737
+ },
738
+ "\\color{(...)}{(...)}1|\\color(...){(...)}2": {
739
+ "*": { action_: [{ type_: "output", option: 2 }, "color-output"], nextState: "3" }
740
+ },
741
+ "\\color{(...)}0": {
742
+ "*": { action_: [{ type_: "output", option: 2 }, "color0-output"] }
743
+ },
744
+ "\\ce{(...)}": {
745
+ "*": { action_: [{ type_: "output", option: 2 }, "ce"], nextState: "3" }
746
+ },
747
+ "\\,": {
748
+ "*": { action_: [{ type_: "output", option: 1 }, "copy"], nextState: "1" }
749
+ },
750
+ "\\x{}{}|\\x{}|\\x": {
751
+ "0|1|2|3|a|as|b|p|bp|o|c0": { action_: ["o=", "output"], nextState: "3" },
752
+ "*": { action_: ["output", "o=", "output"], nextState: "3" }
753
+ },
754
+ "others": {
755
+ "*": { action_: [{ type_: "output", option: 1 }, "copy"], nextState: "3" }
756
+ },
757
+ "else2": {
758
+ "a": { action_: "a to o", nextState: "o", revisit: true },
759
+ "as": { action_: ["output", "sb=true"], nextState: "1", revisit: true },
760
+ "r|rt|rd|rdt|rdq": { action_: ["output"], nextState: "0", revisit: true },
761
+ "*": { action_: ["output", "copy"], nextState: "3" }
762
+ }
763
+ }),
764
+ actions: {
765
+ "o after d": function(buffer, m) {
766
+ var ret;
767
+ if ((buffer.d || "").match(/^[0-9]+$/)) {
768
+ var tmp = buffer.d;
769
+ buffer.d = void 0;
770
+ ret = this["output"](buffer);
771
+ buffer.b = tmp;
772
+ } else {
773
+ ret = this["output"](buffer);
774
+ }
775
+ mhchemParser.actions["o="](buffer, m);
776
+ return ret;
777
+ },
778
+ "d= kv": function(buffer, m) {
779
+ buffer.d = m;
780
+ buffer.dType = "kv";
781
+ },
782
+ "charge or bond": function(buffer, m) {
783
+ if (buffer["beginsWithBond"]) {
784
+ var ret = [];
785
+ mhchemParser.concatArray(ret, this["output"](buffer));
786
+ mhchemParser.concatArray(ret, mhchemParser.actions["bond"](buffer, m, "-"));
787
+ return ret;
788
+ } else {
789
+ buffer.d = m;
790
+ }
791
+ },
792
+ "- after o/d": function(buffer, m, isAfterD) {
793
+ var c1 = mhchemParser.patterns.match_("orbital", buffer.o || "");
794
+ var c2 = mhchemParser.patterns.match_("one lowercase greek letter $", buffer.o || "");
795
+ var c3 = mhchemParser.patterns.match_("one lowercase latin letter $", buffer.o || "");
796
+ var c4 = mhchemParser.patterns.match_("$one lowercase latin letter$ $", buffer.o || "");
797
+ var hyphenFollows = m === "-" && (c1 && c1.remainder === "" || c2 || c3 || c4);
798
+ if (hyphenFollows && !buffer.a && !buffer.b && !buffer.p && !buffer.d && !buffer.q && !c1 && c3) {
799
+ buffer.o = "$" + buffer.o + "$";
800
+ }
801
+ var ret = [];
802
+ if (hyphenFollows) {
803
+ mhchemParser.concatArray(ret, this["output"](buffer));
804
+ ret.push({ type_: "hyphen" });
805
+ } else {
806
+ c1 = mhchemParser.patterns.match_("digits", buffer.d || "");
807
+ if (isAfterD && c1 && c1.remainder === "") {
808
+ mhchemParser.concatArray(ret, mhchemParser.actions["d="](buffer, m));
809
+ mhchemParser.concatArray(ret, this["output"](buffer));
810
+ } else {
811
+ mhchemParser.concatArray(ret, this["output"](buffer));
812
+ mhchemParser.concatArray(ret, mhchemParser.actions["bond"](buffer, m, "-"));
813
+ }
814
+ }
815
+ return ret;
816
+ },
817
+ "a to o": function(buffer) {
818
+ buffer.o = buffer.a;
819
+ buffer.a = void 0;
820
+ },
821
+ "sb=true": function(buffer) {
822
+ buffer.sb = true;
823
+ },
824
+ "sb=false": function(buffer) {
825
+ buffer.sb = false;
826
+ },
827
+ "beginsWithBond=true": function(buffer) {
828
+ buffer["beginsWithBond"] = true;
829
+ },
830
+ "beginsWithBond=false": function(buffer) {
831
+ buffer["beginsWithBond"] = false;
832
+ },
833
+ "parenthesisLevel++": function(buffer) {
834
+ buffer["parenthesisLevel"]++;
835
+ },
836
+ "parenthesisLevel--": function(buffer) {
837
+ buffer["parenthesisLevel"]--;
838
+ },
839
+ "state of aggregation": function(buffer, m) {
840
+ return { type_: "state of aggregation", p1: mhchemParser.go(m, "o") };
841
+ },
842
+ "comma": function(buffer, m) {
843
+ var a = m.replace(/\s*$/, "");
844
+ var withSpace = a !== m;
845
+ if (withSpace && buffer["parenthesisLevel"] === 0) {
846
+ return { type_: "comma enumeration L", p1: a };
847
+ } else {
848
+ return { type_: "comma enumeration M", p1: a };
849
+ }
850
+ },
851
+ "output": function(buffer, m, entityFollows) {
852
+ var ret;
853
+ if (!buffer.r) {
854
+ ret = [];
855
+ if (!buffer.a && !buffer.b && !buffer.p && !buffer.o && !buffer.q && !buffer.d && !entityFollows) {
856
+ } else {
857
+ if (buffer.sb) {
858
+ ret.push({ type_: "entitySkip" });
859
+ }
860
+ if (!buffer.o && !buffer.q && !buffer.d && !buffer.b && !buffer.p && entityFollows !== 2) {
861
+ buffer.o = buffer.a;
862
+ buffer.a = void 0;
863
+ } else if (!buffer.o && !buffer.q && !buffer.d && (buffer.b || buffer.p)) {
864
+ buffer.o = buffer.a;
865
+ buffer.d = buffer.b;
866
+ buffer.q = buffer.p;
867
+ buffer.a = buffer.b = buffer.p = void 0;
868
+ } else {
869
+ if (buffer.o && buffer.dType === "kv" && mhchemParser.patterns.match_("d-oxidation$", buffer.d || "")) {
870
+ buffer.dType = "oxidation";
871
+ } else if (buffer.o && buffer.dType === "kv" && !buffer.q) {
872
+ buffer.dType = void 0;
873
+ }
874
+ }
875
+ ret.push({
876
+ type_: "chemfive",
877
+ a: mhchemParser.go(buffer.a, "a"),
878
+ b: mhchemParser.go(buffer.b, "bd"),
879
+ p: mhchemParser.go(buffer.p, "pq"),
880
+ o: mhchemParser.go(buffer.o, "o"),
881
+ q: mhchemParser.go(buffer.q, "pq"),
882
+ d: mhchemParser.go(buffer.d, buffer.dType === "oxidation" ? "oxidation" : "bd"),
883
+ dType: buffer.dType
884
+ });
885
+ }
886
+ } else {
887
+ var rd;
888
+ if (buffer.rdt === "M") {
889
+ rd = mhchemParser.go(buffer.rd, "tex-math");
890
+ } else if (buffer.rdt === "T") {
891
+ rd = [{ type_: "text", p1: buffer.rd || "" }];
892
+ } else {
893
+ rd = mhchemParser.go(buffer.rd);
894
+ }
895
+ var rq;
896
+ if (buffer.rqt === "M") {
897
+ rq = mhchemParser.go(buffer.rq, "tex-math");
898
+ } else if (buffer.rqt === "T") {
899
+ rq = [{ type_: "text", p1: buffer.rq || "" }];
900
+ } else {
901
+ rq = mhchemParser.go(buffer.rq);
902
+ }
903
+ ret = {
904
+ type_: "arrow",
905
+ r: buffer.r,
906
+ rd,
907
+ rq
908
+ };
909
+ }
910
+ for (var p in buffer) {
911
+ if (p !== "parenthesisLevel" && p !== "beginsWithBond") {
912
+ delete buffer[p];
913
+ }
914
+ }
915
+ return ret;
916
+ },
917
+ "oxidation-output": function(buffer, m) {
918
+ var ret = ["{"];
919
+ mhchemParser.concatArray(ret, mhchemParser.go(m, "oxidation"));
920
+ ret.push("}");
921
+ return ret;
922
+ },
923
+ "frac-output": function(buffer, m) {
924
+ return { type_: "frac-ce", p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
925
+ },
926
+ "overset-output": function(buffer, m) {
927
+ return { type_: "overset", p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
928
+ },
929
+ "underset-output": function(buffer, m) {
930
+ return { type_: "underset", p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
931
+ },
932
+ "underbrace-output": function(buffer, m) {
933
+ return { type_: "underbrace", p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
934
+ },
935
+ "color-output": function(buffer, m) {
936
+ return { type_: "color", color1: m[0], color2: mhchemParser.go(m[1]) };
937
+ },
938
+ "r=": function(buffer, m) {
939
+ buffer.r = m;
940
+ },
941
+ "rdt=": function(buffer, m) {
942
+ buffer.rdt = m;
943
+ },
944
+ "rd=": function(buffer, m) {
945
+ buffer.rd = m;
946
+ },
947
+ "rqt=": function(buffer, m) {
948
+ buffer.rqt = m;
949
+ },
950
+ "rq=": function(buffer, m) {
951
+ buffer.rq = m;
952
+ },
953
+ "operator": function(buffer, m, p1) {
954
+ return { type_: "operator", kind_: p1 || m };
955
+ }
956
+ }
957
+ },
958
+ "a": {
959
+ transitions: mhchemParser.createTransitions({
960
+ "empty": {
961
+ "*": {}
962
+ },
963
+ "1/2$": {
964
+ "0": { action_: "1/2" }
965
+ },
966
+ "else": {
967
+ "0": { nextState: "1", revisit: true }
968
+ },
969
+ "$(...)$": {
970
+ "*": { action_: "tex-math tight", nextState: "1" }
971
+ },
972
+ ",": {
973
+ "*": { action_: { type_: "insert", option: "commaDecimal" } }
974
+ },
975
+ "else2": {
976
+ "*": { action_: "copy" }
977
+ }
978
+ }),
979
+ actions: {}
980
+ },
981
+ "o": {
982
+ transitions: mhchemParser.createTransitions({
983
+ "empty": {
984
+ "*": {}
985
+ },
986
+ "1/2$": {
987
+ "0": { action_: "1/2" }
988
+ },
989
+ "else": {
990
+ "0": { nextState: "1", revisit: true }
991
+ },
992
+ "letters": {
993
+ "*": { action_: "rm" }
994
+ },
995
+ "\\ca": {
996
+ "*": { action_: { type_: "insert", option: "circa" } }
997
+ },
998
+ "\\x{}{}|\\x{}|\\x": {
999
+ "*": { action_: "copy" }
1000
+ },
1001
+ "${(...)}$|$(...)$": {
1002
+ "*": { action_: "tex-math" }
1003
+ },
1004
+ "{(...)}": {
1005
+ "*": { action_: "{text}" }
1006
+ },
1007
+ "else2": {
1008
+ "*": { action_: "copy" }
1009
+ }
1010
+ }),
1011
+ actions: {}
1012
+ },
1013
+ "text": {
1014
+ transitions: mhchemParser.createTransitions({
1015
+ "empty": {
1016
+ "*": { action_: "output" }
1017
+ },
1018
+ "{...}": {
1019
+ "*": { action_: "text=" }
1020
+ },
1021
+ "${(...)}$|$(...)$": {
1022
+ "*": { action_: "tex-math" }
1023
+ },
1024
+ "\\greek": {
1025
+ "*": { action_: ["output", "rm"] }
1026
+ },
1027
+ "\\,|\\x{}{}|\\x{}|\\x": {
1028
+ "*": { action_: ["output", "copy"] }
1029
+ },
1030
+ "else": {
1031
+ "*": { action_: "text=" }
1032
+ }
1033
+ }),
1034
+ actions: {
1035
+ "output": function(buffer) {
1036
+ if (buffer.text_) {
1037
+ var ret = { type_: "text", p1: buffer.text_ };
1038
+ for (var p in buffer) {
1039
+ delete buffer[p];
1040
+ }
1041
+ return ret;
1042
+ }
1043
+ }
1044
+ }
1045
+ },
1046
+ "pq": {
1047
+ transitions: mhchemParser.createTransitions({
1048
+ "empty": {
1049
+ "*": {}
1050
+ },
1051
+ "state of aggregation $": {
1052
+ "*": { action_: "state of aggregation" }
1053
+ },
1054
+ "i$": {
1055
+ "0": { nextState: "!f", revisit: true }
1056
+ },
1057
+ "(KV letters),": {
1058
+ "0": { action_: "rm", nextState: "0" }
1059
+ },
1060
+ "formula$": {
1061
+ "0": { nextState: "f", revisit: true }
1062
+ },
1063
+ "1/2$": {
1064
+ "0": { action_: "1/2" }
1065
+ },
1066
+ "else": {
1067
+ "0": { nextState: "!f", revisit: true }
1068
+ },
1069
+ "${(...)}$|$(...)$": {
1070
+ "*": { action_: "tex-math" }
1071
+ },
1072
+ "{(...)}": {
1073
+ "*": { action_: "text" }
1074
+ },
1075
+ "a-z": {
1076
+ "f": { action_: "tex-math" }
1077
+ },
1078
+ "letters": {
1079
+ "*": { action_: "rm" }
1080
+ },
1081
+ "-9.,9": {
1082
+ "*": { action_: "9,9" }
1083
+ },
1084
+ ",": {
1085
+ "*": { action_: { type_: "insert+p1", option: "comma enumeration S" } }
1086
+ },
1087
+ "\\color{(...)}{(...)}1|\\color(...){(...)}2": {
1088
+ "*": { action_: "color-output" }
1089
+ },
1090
+ "\\color{(...)}0": {
1091
+ "*": { action_: "color0-output" }
1092
+ },
1093
+ "\\ce{(...)}": {
1094
+ "*": { action_: "ce" }
1095
+ },
1096
+ "\\,|\\x{}{}|\\x{}|\\x": {
1097
+ "*": { action_: "copy" }
1098
+ },
1099
+ "else2": {
1100
+ "*": { action_: "copy" }
1101
+ }
1102
+ }),
1103
+ actions: {
1104
+ "state of aggregation": function(buffer, m) {
1105
+ return { type_: "state of aggregation subscript", p1: mhchemParser.go(m, "o") };
1106
+ },
1107
+ "color-output": function(buffer, m) {
1108
+ return { type_: "color", color1: m[0], color2: mhchemParser.go(m[1], "pq") };
1109
+ }
1110
+ }
1111
+ },
1112
+ "bd": {
1113
+ transitions: mhchemParser.createTransitions({
1114
+ "empty": {
1115
+ "*": {}
1116
+ },
1117
+ "x$": {
1118
+ "0": { nextState: "!f", revisit: true }
1119
+ },
1120
+ "formula$": {
1121
+ "0": { nextState: "f", revisit: true }
1122
+ },
1123
+ "else": {
1124
+ "0": { nextState: "!f", revisit: true }
1125
+ },
1126
+ "-9.,9 no missing 0": {
1127
+ "*": { action_: "9,9" }
1128
+ },
1129
+ ".": {
1130
+ "*": { action_: { type_: "insert", option: "electron dot" } }
1131
+ },
1132
+ "a-z": {
1133
+ "f": { action_: "tex-math" }
1134
+ },
1135
+ "x": {
1136
+ "*": { action_: { type_: "insert", option: "KV x" } }
1137
+ },
1138
+ "letters": {
1139
+ "*": { action_: "rm" }
1140
+ },
1141
+ "'": {
1142
+ "*": { action_: { type_: "insert", option: "prime" } }
1143
+ },
1144
+ "${(...)}$|$(...)$": {
1145
+ "*": { action_: "tex-math" }
1146
+ },
1147
+ "{(...)}": {
1148
+ "*": { action_: "text" }
1149
+ },
1150
+ "\\color{(...)}{(...)}1|\\color(...){(...)}2": {
1151
+ "*": { action_: "color-output" }
1152
+ },
1153
+ "\\color{(...)}0": {
1154
+ "*": { action_: "color0-output" }
1155
+ },
1156
+ "\\ce{(...)}": {
1157
+ "*": { action_: "ce" }
1158
+ },
1159
+ "\\,|\\x{}{}|\\x{}|\\x": {
1160
+ "*": { action_: "copy" }
1161
+ },
1162
+ "else2": {
1163
+ "*": { action_: "copy" }
1164
+ }
1165
+ }),
1166
+ actions: {
1167
+ "color-output": function(buffer, m) {
1168
+ return { type_: "color", color1: m[0], color2: mhchemParser.go(m[1], "bd") };
1169
+ }
1170
+ }
1171
+ },
1172
+ "oxidation": {
1173
+ transitions: mhchemParser.createTransitions({
1174
+ "empty": {
1175
+ "*": {}
1176
+ },
1177
+ "roman numeral": {
1178
+ "*": { action_: "roman-numeral" }
1179
+ },
1180
+ "${(...)}$|$(...)$": {
1181
+ "*": { action_: "tex-math" }
1182
+ },
1183
+ "else": {
1184
+ "*": { action_: "copy" }
1185
+ }
1186
+ }),
1187
+ actions: {
1188
+ "roman-numeral": function(buffer, m) {
1189
+ return { type_: "roman numeral", p1: m || "" };
1190
+ }
1191
+ }
1192
+ },
1193
+ "tex-math": {
1194
+ transitions: mhchemParser.createTransitions({
1195
+ "empty": {
1196
+ "*": { action_: "output" }
1197
+ },
1198
+ "\\ce{(...)}": {
1199
+ "*": { action_: ["output", "ce"] }
1200
+ },
1201
+ "{...}|\\,|\\x{}{}|\\x{}|\\x": {
1202
+ "*": { action_: "o=" }
1203
+ },
1204
+ "else": {
1205
+ "*": { action_: "o=" }
1206
+ }
1207
+ }),
1208
+ actions: {
1209
+ "output": function(buffer) {
1210
+ if (buffer.o) {
1211
+ var ret = { type_: "tex-math", p1: buffer.o };
1212
+ for (var p in buffer) {
1213
+ delete buffer[p];
1214
+ }
1215
+ return ret;
1216
+ }
1217
+ }
1218
+ }
1219
+ },
1220
+ "tex-math tight": {
1221
+ transitions: mhchemParser.createTransitions({
1222
+ "empty": {
1223
+ "*": { action_: "output" }
1224
+ },
1225
+ "\\ce{(...)}": {
1226
+ "*": { action_: ["output", "ce"] }
1227
+ },
1228
+ "{...}|\\,|\\x{}{}|\\x{}|\\x": {
1229
+ "*": { action_: "o=" }
1230
+ },
1231
+ "-|+": {
1232
+ "*": { action_: "tight operator" }
1233
+ },
1234
+ "else": {
1235
+ "*": { action_: "o=" }
1236
+ }
1237
+ }),
1238
+ actions: {
1239
+ "tight operator": function(buffer, m) {
1240
+ buffer.o = (buffer.o || "") + "{" + m + "}";
1241
+ },
1242
+ "output": function(buffer) {
1243
+ if (buffer.o) {
1244
+ var ret = { type_: "tex-math", p1: buffer.o };
1245
+ for (var p in buffer) {
1246
+ delete buffer[p];
1247
+ }
1248
+ return ret;
1249
+ }
1250
+ }
1251
+ }
1252
+ },
1253
+ "9,9": {
1254
+ transitions: mhchemParser.createTransitions({
1255
+ "empty": {
1256
+ "*": {}
1257
+ },
1258
+ ",": {
1259
+ "*": { action_: "comma" }
1260
+ },
1261
+ "else": {
1262
+ "*": { action_: "copy" }
1263
+ }
1264
+ }),
1265
+ actions: {
1266
+ "comma": function() {
1267
+ return { type_: "commaDecimal" };
1268
+ }
1269
+ }
1270
+ },
1271
+ //#endregion
1272
+ //
1273
+ // \pu state machines
1274
+ //
1275
+ //#region pu
1276
+ "pu": {
1277
+ transitions: mhchemParser.createTransitions({
1278
+ "empty": {
1279
+ "*": { action_: "output" }
1280
+ },
1281
+ "space$": {
1282
+ "*": { action_: ["output", "space"] }
1283
+ },
1284
+ "{[(|)]}": {
1285
+ "0|a": { action_: "copy" }
1286
+ },
1287
+ "(-)(9)^(-9)": {
1288
+ "0": { action_: "number^", nextState: "a" }
1289
+ },
1290
+ "(-)(9.,9)(e)(99)": {
1291
+ "0": { action_: "enumber", nextState: "a" }
1292
+ },
1293
+ "space": {
1294
+ "0|a": {}
1295
+ },
1296
+ "pm-operator": {
1297
+ "0|a": { action_: { type_: "operator", option: "\\pm" }, nextState: "0" }
1298
+ },
1299
+ "operator": {
1300
+ "0|a": { action_: "copy", nextState: "0" }
1301
+ },
1302
+ "//": {
1303
+ "d": { action_: "o=", nextState: "/" }
1304
+ },
1305
+ "/": {
1306
+ "d": { action_: "o=", nextState: "/" }
1307
+ },
1308
+ "{...}|else": {
1309
+ "0|d": { action_: "d=", nextState: "d" },
1310
+ "a": { action_: ["space", "d="], nextState: "d" },
1311
+ "/|q": { action_: "q=", nextState: "q" }
1312
+ }
1313
+ }),
1314
+ actions: {
1315
+ "enumber": function(buffer, m) {
1316
+ var ret = [];
1317
+ if (m[0] === "+-" || m[0] === "+/-") {
1318
+ ret.push("\\pm ");
1319
+ } else if (m[0]) {
1320
+ ret.push(m[0]);
1321
+ }
1322
+ if (m[1]) {
1323
+ mhchemParser.concatArray(ret, mhchemParser.go(m[1], "pu-9,9"));
1324
+ if (m[2]) {
1325
+ if (m[2].match(/[,.]/)) {
1326
+ mhchemParser.concatArray(ret, mhchemParser.go(m[2], "pu-9,9"));
1327
+ } else {
1328
+ ret.push(m[2]);
1329
+ }
1330
+ }
1331
+ m[3] = m[4] || m[3];
1332
+ if (m[3]) {
1333
+ m[3] = m[3].trim();
1334
+ if (m[3] === "e" || m[3].substr(0, 1) === "*") {
1335
+ ret.push({ type_: "cdot" });
1336
+ } else {
1337
+ ret.push({ type_: "times" });
1338
+ }
1339
+ }
1340
+ }
1341
+ if (m[3]) {
1342
+ ret.push("10^{" + m[5] + "}");
1343
+ }
1344
+ return ret;
1345
+ },
1346
+ "number^": function(buffer, m) {
1347
+ var ret = [];
1348
+ if (m[0] === "+-" || m[0] === "+/-") {
1349
+ ret.push("\\pm ");
1350
+ } else if (m[0]) {
1351
+ ret.push(m[0]);
1352
+ }
1353
+ mhchemParser.concatArray(ret, mhchemParser.go(m[1], "pu-9,9"));
1354
+ ret.push("^{" + m[2] + "}");
1355
+ return ret;
1356
+ },
1357
+ "operator": function(buffer, m, p1) {
1358
+ return { type_: "operator", kind_: p1 || m };
1359
+ },
1360
+ "space": function() {
1361
+ return { type_: "pu-space-1" };
1362
+ },
1363
+ "output": function(buffer) {
1364
+ var ret;
1365
+ var md = mhchemParser.patterns.match_("{(...)}", buffer.d || "");
1366
+ if (md && md.remainder === "") {
1367
+ buffer.d = md.match_;
1368
+ }
1369
+ var mq = mhchemParser.patterns.match_("{(...)}", buffer.q || "");
1370
+ if (mq && mq.remainder === "") {
1371
+ buffer.q = mq.match_;
1372
+ }
1373
+ if (buffer.d) {
1374
+ buffer.d = buffer.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
1375
+ buffer.d = buffer.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
1376
+ }
1377
+ if (buffer.q) {
1378
+ buffer.q = buffer.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
1379
+ buffer.q = buffer.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
1380
+ var b5 = {
1381
+ d: mhchemParser.go(buffer.d, "pu"),
1382
+ q: mhchemParser.go(buffer.q, "pu")
1383
+ };
1384
+ if (buffer.o === "//") {
1385
+ ret = { type_: "pu-frac", p1: b5.d, p2: b5.q };
1386
+ } else {
1387
+ ret = b5.d;
1388
+ if (b5.d.length > 1 || b5.q.length > 1) {
1389
+ ret.push({ type_: " / " });
1390
+ } else {
1391
+ ret.push({ type_: "/" });
1392
+ }
1393
+ mhchemParser.concatArray(ret, b5.q);
1394
+ }
1395
+ } else {
1396
+ ret = mhchemParser.go(buffer.d, "pu-2");
1397
+ }
1398
+ for (var p in buffer) {
1399
+ delete buffer[p];
1400
+ }
1401
+ return ret;
1402
+ }
1403
+ }
1404
+ },
1405
+ "pu-2": {
1406
+ transitions: mhchemParser.createTransitions({
1407
+ "empty": {
1408
+ "*": { action_: "output" }
1409
+ },
1410
+ "*": {
1411
+ "*": { action_: ["output", "cdot"], nextState: "0" }
1412
+ },
1413
+ "\\x": {
1414
+ "*": { action_: "rm=" }
1415
+ },
1416
+ "space": {
1417
+ "*": { action_: ["output", "space"], nextState: "0" }
1418
+ },
1419
+ "^{(...)}|^(-1)": {
1420
+ "1": { action_: "^(-1)" }
1421
+ },
1422
+ "-9.,9": {
1423
+ "0": { action_: "rm=", nextState: "0" },
1424
+ "1": { action_: "^(-1)", nextState: "0" }
1425
+ },
1426
+ "{...}|else": {
1427
+ "*": { action_: "rm=", nextState: "1" }
1428
+ }
1429
+ }),
1430
+ actions: {
1431
+ "cdot": function() {
1432
+ return { type_: "tight cdot" };
1433
+ },
1434
+ "^(-1)": function(buffer, m) {
1435
+ buffer.rm += "^{" + m + "}";
1436
+ },
1437
+ "space": function() {
1438
+ return { type_: "pu-space-2" };
1439
+ },
1440
+ "output": function(buffer) {
1441
+ var ret = [];
1442
+ if (buffer.rm) {
1443
+ var mrm = mhchemParser.patterns.match_("{(...)}", buffer.rm || "");
1444
+ if (mrm && mrm.remainder === "") {
1445
+ ret = mhchemParser.go(mrm.match_, "pu");
1446
+ } else {
1447
+ ret = { type_: "rm", p1: buffer.rm };
1448
+ }
1449
+ }
1450
+ for (var p in buffer) {
1451
+ delete buffer[p];
1452
+ }
1453
+ return ret;
1454
+ }
1455
+ }
1456
+ },
1457
+ "pu-9,9": {
1458
+ transitions: mhchemParser.createTransitions({
1459
+ "empty": {
1460
+ "0": { action_: "output-0" },
1461
+ "o": { action_: "output-o" }
1462
+ },
1463
+ ",": {
1464
+ "0": { action_: ["output-0", "comma"], nextState: "o" }
1465
+ },
1466
+ ".": {
1467
+ "0": { action_: ["output-0", "copy"], nextState: "o" }
1468
+ },
1469
+ "else": {
1470
+ "*": { action_: "text=" }
1471
+ }
1472
+ }),
1473
+ actions: {
1474
+ "comma": function() {
1475
+ return { type_: "commaDecimal" };
1476
+ },
1477
+ "output-0": function(buffer) {
1478
+ var ret = [];
1479
+ buffer.text_ = buffer.text_ || "";
1480
+ if (buffer.text_.length > 4) {
1481
+ var a = buffer.text_.length % 3;
1482
+ if (a === 0) {
1483
+ a = 3;
1484
+ }
1485
+ for (var i = buffer.text_.length - 3; i > 0; i -= 3) {
1486
+ ret.push(buffer.text_.substr(i, 3));
1487
+ ret.push({ type_: "1000 separator" });
1488
+ }
1489
+ ret.push(buffer.text_.substr(0, a));
1490
+ ret.reverse();
1491
+ } else {
1492
+ ret.push(buffer.text_);
1493
+ }
1494
+ for (var p in buffer) {
1495
+ delete buffer[p];
1496
+ }
1497
+ return ret;
1498
+ },
1499
+ "output-o": function(buffer) {
1500
+ var ret = [];
1501
+ buffer.text_ = buffer.text_ || "";
1502
+ if (buffer.text_.length > 4) {
1503
+ var a = buffer.text_.length - 3;
1504
+ for (var i = 0; i < a; i += 3) {
1505
+ ret.push(buffer.text_.substr(i, 3));
1506
+ ret.push({ type_: "1000 separator" });
1507
+ }
1508
+ ret.push(buffer.text_.substr(i));
1509
+ } else {
1510
+ ret.push(buffer.text_);
1511
+ }
1512
+ for (var p in buffer) {
1513
+ delete buffer[p];
1514
+ }
1515
+ return ret;
1516
+ }
1517
+ }
1518
+ }
1519
+ //#endregion
1520
+ };
1521
+ var texify = {
1522
+ go: function(input, isInner) {
1523
+ if (!input) {
1524
+ return "";
1525
+ }
1526
+ var res = "";
1527
+ var cee = false;
1528
+ for (var i = 0; i < input.length; i++) {
1529
+ var inputi = input[i];
1530
+ if (typeof inputi === "string") {
1531
+ res += inputi;
1532
+ } else {
1533
+ res += texify._go2(inputi);
1534
+ if (inputi.type_ === "1st-level escape") {
1535
+ cee = true;
1536
+ }
1537
+ }
1538
+ }
1539
+ if (!isInner && !cee && res) {
1540
+ res = "{" + res + "}";
1541
+ }
1542
+ return res;
1543
+ },
1544
+ _goInner: function(input) {
1545
+ if (!input) {
1546
+ return input;
1547
+ }
1548
+ return texify.go(input, true);
1549
+ },
1550
+ _go2: function(buf) {
1551
+ var res;
1552
+ switch (buf.type_) {
1553
+ case "chemfive":
1554
+ res = "";
1555
+ var b5 = {
1556
+ a: texify._goInner(buf.a),
1557
+ b: texify._goInner(buf.b),
1558
+ p: texify._goInner(buf.p),
1559
+ o: texify._goInner(buf.o),
1560
+ q: texify._goInner(buf.q),
1561
+ d: texify._goInner(buf.d)
1562
+ };
1563
+ if (b5.a) {
1564
+ if (b5.a.match(/^[+\-]/)) {
1565
+ b5.a = "{" + b5.a + "}";
1566
+ }
1567
+ res += b5.a + "\\,";
1568
+ }
1569
+ if (b5.b || b5.p) {
1570
+ res += "{\\vphantom{X}}";
1571
+ res += "^{\\hphantom{" + (b5.b || "") + "}}_{\\hphantom{" + (b5.p || "") + "}}";
1572
+ res += "{\\vphantom{X}}";
1573
+ res += "^{\\smash[t]{\\vphantom{2}}\\mathllap{" + (b5.b || "") + "}}";
1574
+ res += "_{\\vphantom{2}\\mathllap{\\smash[t]{" + (b5.p || "") + "}}}";
1575
+ }
1576
+ if (b5.o) {
1577
+ if (b5.o.match(/^[+\-]/)) {
1578
+ b5.o = "{" + b5.o + "}";
1579
+ }
1580
+ res += b5.o;
1581
+ }
1582
+ if (buf.dType === "kv") {
1583
+ if (b5.d || b5.q) {
1584
+ res += "{\\vphantom{X}}";
1585
+ }
1586
+ if (b5.d) {
1587
+ res += "^{" + b5.d + "}";
1588
+ }
1589
+ if (b5.q) {
1590
+ res += "_{\\smash[t]{" + b5.q + "}}";
1591
+ }
1592
+ } else if (buf.dType === "oxidation") {
1593
+ if (b5.d) {
1594
+ res += "{\\vphantom{X}}";
1595
+ res += "^{" + b5.d + "}";
1596
+ }
1597
+ if (b5.q) {
1598
+ res += "{\\vphantom{X}}";
1599
+ res += "_{\\smash[t]{" + b5.q + "}}";
1600
+ }
1601
+ } else {
1602
+ if (b5.q) {
1603
+ res += "{\\vphantom{X}}";
1604
+ res += "_{\\smash[t]{" + b5.q + "}}";
1605
+ }
1606
+ if (b5.d) {
1607
+ res += "{\\vphantom{X}}";
1608
+ res += "^{" + b5.d + "}";
1609
+ }
1610
+ }
1611
+ break;
1612
+ case "rm":
1613
+ res = "\\mathrm{" + buf.p1 + "}";
1614
+ break;
1615
+ case "text":
1616
+ if (buf.p1.match(/[\^_]/)) {
1617
+ buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
1618
+ res = "\\mathrm{" + buf.p1 + "}";
1619
+ } else {
1620
+ res = "\\text{" + buf.p1 + "}";
1621
+ }
1622
+ break;
1623
+ case "roman numeral":
1624
+ res = "\\mathrm{" + buf.p1 + "}";
1625
+ break;
1626
+ case "state of aggregation":
1627
+ res = "\\mskip2mu " + texify._goInner(buf.p1);
1628
+ break;
1629
+ case "state of aggregation subscript":
1630
+ res = "\\mskip1mu " + texify._goInner(buf.p1);
1631
+ break;
1632
+ case "bond":
1633
+ res = texify._getBond(buf.kind_);
1634
+ if (!res) {
1635
+ throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
1636
+ }
1637
+ break;
1638
+ case "frac":
1639
+ var c = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
1640
+ res = "\\mathchoice{\\textstyle" + c + "}{" + c + "}{" + c + "}{" + c + "}";
1641
+ break;
1642
+ case "pu-frac":
1643
+ var d = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
1644
+ res = "\\mathchoice{\\textstyle" + d + "}{" + d + "}{" + d + "}{" + d + "}";
1645
+ break;
1646
+ case "tex-math":
1647
+ res = buf.p1 + " ";
1648
+ break;
1649
+ case "frac-ce":
1650
+ res = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
1651
+ break;
1652
+ case "overset":
1653
+ res = "\\overset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
1654
+ break;
1655
+ case "underset":
1656
+ res = "\\underset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
1657
+ break;
1658
+ case "underbrace":
1659
+ res = "\\underbrace{" + texify._goInner(buf.p1) + "}_{" + texify._goInner(buf.p2) + "}";
1660
+ break;
1661
+ case "color":
1662
+ res = "{\\color{" + buf.color1 + "}{" + texify._goInner(buf.color2) + "}}";
1663
+ break;
1664
+ case "color0":
1665
+ res = "\\color{" + buf.color + "}";
1666
+ break;
1667
+ case "arrow":
1668
+ var b6 = {
1669
+ rd: texify._goInner(buf.rd),
1670
+ rq: texify._goInner(buf.rq)
1671
+ };
1672
+ var arrow = "\\x" + texify._getArrow(buf.r);
1673
+ if (b6.rq) {
1674
+ arrow += "[{" + b6.rq + "}]";
1675
+ }
1676
+ if (b6.rd) {
1677
+ arrow += "{" + b6.rd + "}";
1678
+ } else {
1679
+ arrow += "{}";
1680
+ }
1681
+ res = arrow;
1682
+ break;
1683
+ case "operator":
1684
+ res = texify._getOperator(buf.kind_);
1685
+ break;
1686
+ case "1st-level escape":
1687
+ res = buf.p1 + " ";
1688
+ break;
1689
+ case "space":
1690
+ res = " ";
1691
+ break;
1692
+ case "entitySkip":
1693
+ res = "~";
1694
+ break;
1695
+ case "pu-space-1":
1696
+ res = "~";
1697
+ break;
1698
+ case "pu-space-2":
1699
+ res = "\\mkern3mu ";
1700
+ break;
1701
+ case "1000 separator":
1702
+ res = "\\mkern2mu ";
1703
+ break;
1704
+ case "commaDecimal":
1705
+ res = "{,}";
1706
+ break;
1707
+ case "comma enumeration L":
1708
+ res = "{" + buf.p1 + "}\\mkern6mu ";
1709
+ break;
1710
+ case "comma enumeration M":
1711
+ res = "{" + buf.p1 + "}\\mkern3mu ";
1712
+ break;
1713
+ case "comma enumeration S":
1714
+ res = "{" + buf.p1 + "}\\mkern1mu ";
1715
+ break;
1716
+ case "hyphen":
1717
+ res = "\\text{-}";
1718
+ break;
1719
+ case "addition compound":
1720
+ res = "\\,{\\cdot}\\,";
1721
+ break;
1722
+ case "electron dot":
1723
+ res = "\\mkern1mu \\bullet\\mkern1mu ";
1724
+ break;
1725
+ case "KV x":
1726
+ res = "{\\times}";
1727
+ break;
1728
+ case "prime":
1729
+ res = "\\prime ";
1730
+ break;
1731
+ case "cdot":
1732
+ res = "\\cdot ";
1733
+ break;
1734
+ case "tight cdot":
1735
+ res = "\\mkern1mu{\\cdot}\\mkern1mu ";
1736
+ break;
1737
+ case "times":
1738
+ res = "\\times ";
1739
+ break;
1740
+ case "circa":
1741
+ res = "{\\sim}";
1742
+ break;
1743
+ case "^":
1744
+ res = "uparrow";
1745
+ break;
1746
+ case "v":
1747
+ res = "downarrow";
1748
+ break;
1749
+ case "ellipsis":
1750
+ res = "\\ldots ";
1751
+ break;
1752
+ case "/":
1753
+ res = "/";
1754
+ break;
1755
+ case " / ":
1756
+ res = "\\,/\\,";
1757
+ break;
1758
+ default:
1759
+ assertNever(buf);
1760
+ throw ["MhchemBugT", "mhchem bug T. Please report."];
1761
+ }
1762
+ assertString(res);
1763
+ return res;
1764
+ },
1765
+ _getArrow: function(a) {
1766
+ switch (a) {
1767
+ case "->":
1768
+ return "rightarrow";
1769
+ case "\u2192":
1770
+ return "rightarrow";
1771
+ case "\u27F6":
1772
+ return "rightarrow";
1773
+ case "<-":
1774
+ return "leftarrow";
1775
+ case "<->":
1776
+ return "leftrightarrow";
1777
+ case "<-->":
1778
+ return "rightleftarrows";
1779
+ case "<=>":
1780
+ return "rightleftharpoons";
1781
+ case "\u21CC":
1782
+ return "rightleftharpoons";
1783
+ case "<=>>":
1784
+ return "rightequilibrium";
1785
+ case "<<=>":
1786
+ return "leftequilibrium";
1787
+ default:
1788
+ assertNever(a);
1789
+ throw ["MhchemBugT", "mhchem bug T. Please report."];
1790
+ }
1791
+ },
1792
+ _getBond: function(a) {
1793
+ switch (a) {
1794
+ case "-":
1795
+ return "{-}";
1796
+ case "1":
1797
+ return "{-}";
1798
+ case "=":
1799
+ return "{=}";
1800
+ case "2":
1801
+ return "{=}";
1802
+ case "#":
1803
+ return "{\\equiv}";
1804
+ case "3":
1805
+ return "{\\equiv}";
1806
+ case "~":
1807
+ return "{\\tripledash}";
1808
+ case "~-":
1809
+ return "{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";
1810
+ case "~=":
1811
+ return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
1812
+ case "~--":
1813
+ return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
1814
+ case "-~-":
1815
+ return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";
1816
+ case "...":
1817
+ return "{{\\cdot}{\\cdot}{\\cdot}}";
1818
+ case "....":
1819
+ return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
1820
+ case "->":
1821
+ return "{\\rightarrow}";
1822
+ case "<-":
1823
+ return "{\\leftarrow}";
1824
+ case "<":
1825
+ return "{<}";
1826
+ case ">":
1827
+ return "{>}";
1828
+ default:
1829
+ assertNever(a);
1830
+ throw ["MhchemBugT", "mhchem bug T. Please report."];
1831
+ }
1832
+ },
1833
+ _getOperator: function(a) {
1834
+ switch (a) {
1835
+ case "+":
1836
+ return " {}+{} ";
1837
+ case "-":
1838
+ return " {}-{} ";
1839
+ case "=":
1840
+ return " {}={} ";
1841
+ case "<":
1842
+ return " {}<{} ";
1843
+ case ">":
1844
+ return " {}>{} ";
1845
+ case "<<":
1846
+ return " {}\\ll{} ";
1847
+ case ">>":
1848
+ return " {}\\gg{} ";
1849
+ case "\\pm":
1850
+ return " {}\\pm{} ";
1851
+ case "\\approx":
1852
+ return " {}\\approx{} ";
1853
+ case "$\\approx$":
1854
+ return " {}\\approx{} ";
1855
+ case "v":
1856
+ return " \\downarrow{} ";
1857
+ case "(v)":
1858
+ return " \\downarrow{} ";
1859
+ case "^":
1860
+ return " \\uparrow{} ";
1861
+ case "(^)":
1862
+ return " \\uparrow{} ";
1863
+ default:
1864
+ assertNever(a);
1865
+ throw ["MhchemBugT", "mhchem bug T. Please report."];
1866
+ }
1867
+ }
1868
+ };
1869
+ function assertNever(a) {
1870
+ }
1871
+ function assertString(a) {
1872
+ }
1873
+
1874
+ // src/shared/components/installed.mjs
1875
+ var ATTRIBUTE = "data-doc-component";
1876
+ var INSTANCE = `div[${ATTRIBUTE}], section[${ATTRIBUTE}]`;
1877
+ var DATA_MOST = 1024 * 1024;
1878
+
1879
+ // src/shared/components/math.mjs
1880
+ var MATH_IGNORED_TAGS = Object.freeze(["script", "noscript", "style", "textarea", "pre", "code", "option"]);
1881
+ var gobble = (count) => (context) => {
1882
+ context.consumeArgs(count);
1883
+ return "";
1884
+ };
1885
+ var MATH_MACROS = Object.freeze({
1886
+ "\\mathbbm": "\\mathbb{#1}",
1887
+ "\\mathds": "\\mathbb{#1}",
1888
+ "\\mbox": "\\text{#1}",
1889
+ "\\textsc": "\\text{#1}",
1890
+ "\\label": gobble(1),
1891
+ "\\require": gobble(1),
1892
+ "\\vspace": gobble(1),
1893
+ "\\abs": "\\left\\lvert #1\\right\\rvert",
1894
+ "\\norm": "\\left\\lVert #1\\right\\rVert",
1895
+ "\\dv": "\\frac{\\mathrm{d}#1}{\\mathrm{d}#2}",
1896
+ "\\pdv": "\\frac{\\partial #1}{\\partial #2}",
1897
+ "\\dd": "\\mathop{}\\!\\mathrm{d}",
1898
+ "\\tr": "\\operatorname{tr}",
1899
+ "\\Tr": "\\operatorname{Tr}",
1900
+ "\\diag": "\\operatorname{diag}",
1901
+ "\\sgn": "\\operatorname{sgn}",
1902
+ "\\rank": "\\operatorname{rank}",
1903
+ "\\C": "\\mathbb{C}",
1904
+ "\\Q": "\\mathbb{Q}",
1905
+ "\\celsius": "{}^{\\circ}\\mathrm{C}",
1906
+ "\\SI": "#1\\,\\mathrm{#2}",
1907
+ "\\si": "\\mathrm{#1}",
1908
+ "\\num": "#1",
1909
+ "\\unit": "\\mathrm{#1}",
1910
+ "\\DeclareMathOperator": "\\gdef#1{\\operatorname{#2}}"
1911
+ });
1912
+
1913
+ // src/shared/inline-spacing.mjs
1914
+ var UNITS = /* @__PURE__ */ new Set([..."\u4E2A\u4E07\u4EBF\u5343\u767E\u5341\u5143\u89D2\u5206\u5398\u6BDB\u500D\u5E74\u6708\u65E5\u53F7\u65F6\u70B9\u79D2\u5929\u5468\u5C81\u4EBA\u4F4D\u540D\u6B21\u5BB6\u6761\u9879\u79CD\u53F0\u53EA\u4EF6\u7BC7\u9875\u5F20\u5957\u4EFD\u7EC4\u6279\u671F\u5C4A\u4EE3\u7EA7\u5C42\u8F6E\u6B65\u7C73\u514B\u65A4\u5428\u5EA6\u91CC\u516C\u6BEB\u5FAE\u5BF8\u5C3A\u4E24\u5347\u6237\u6240\u5EA7\u680B\u8F86\u67B6\u8258\u672C\u90E8\u7AE0\u8282\u573A\u5C40\u9996\u53E5\u5B57\u884C\u5217\u904D\u56DE\u756A\u6210"]);
1915
+ var ZWSP = String.fromCharCode(8203);
1916
+
1917
+ // src/render/kit/runtime/spacing.js
1918
+ var NUMBER = String.raw`\d(?:[\d.,]*\d)?(?:%|[A-Za-z]{1,3})?`;
1919
+ var DASH = "[\u2013\u2014~\uFF5E]";
1920
+ var CLOSING = new RegExp(String.raw`^(?:${DASH}${NUMBER})?[,。、;:!?)」』》】〉〕”’,.;:!?)\]]*`);
1921
+ var RANGE = new RegExp(`${NUMBER} ?${DASH} ?${NUMBER}`);
1922
+ function untie(tie) {
1923
+ tie.querySelectorAll(":scope > .doc-math-joiner, .doc-math-break").forEach((added) => added.remove());
1924
+ const parent = tie.parentNode;
1925
+ tie.replaceWith(...tie.childNodes);
1926
+ parent?.normalize();
1927
+ }
1928
+
1929
+ // src/render/kit/math.js
1930
+ (function initDocMath(global) {
1931
+ "use strict";
1932
+ const flows = () => [...global.DocKit.flows, "[data-doc-math]"].join(", ");
1933
+ const SKIPPED = "doc-math-skip";
1934
+ const MACROS = MATH_MACROS;
1935
+ function targetsWithin(root) {
1936
+ const targets = /* @__PURE__ */ new Set();
1937
+ const selector = flows();
1938
+ if (root instanceof Element && root.matches(selector)) targets.add(root);
1939
+ root.querySelectorAll?.(selector).forEach((element) => targets.add(element));
1940
+ const all = [...targets].filter((element) => !element.closest(INSTANCE));
1941
+ const dollar = all.filter((candidate) => candidate.hasAttribute("data-doc-math-dollar"));
1942
+ const outermost = all.filter((candidate) => !candidate.hasAttribute("data-doc-math-dollar") && !all.some((other) => other !== candidate && other.contains(candidate) && !other.hasAttribute("data-doc-math-dollar")));
1943
+ return [...dollar, ...outermost];
1944
+ }
1945
+ function render(root = document) {
1946
+ if (typeof global.renderMathInElement !== "function") {
1947
+ throw new Error("DocMath requires KaTeX and its auto-render extension.");
1948
+ }
1949
+ const instances = [...root.querySelectorAll?.(INSTANCE) ?? []];
1950
+ instances.forEach((instance) => instance.classList.add(SKIPPED));
1951
+ for (const target of targetsWithin(root)) {
1952
+ const delimiters = [
1953
+ { left: "$$", right: "$$", display: true },
1954
+ { left: "\\[", right: "\\]", display: true },
1955
+ { left: "\\(", right: "\\)", display: false }
1956
+ ];
1957
+ if (target.hasAttribute("data-doc-math-dollar")) {
1958
+ delimiters.push({ left: "$", right: "$", display: false });
1959
+ }
1960
+ global.renderMathInElement(target, {
1961
+ delimiters,
1962
+ throwOnError: false,
1963
+ strict: "warn",
1964
+ trust: false,
1965
+ macros: { ...MACROS },
1966
+ // a copy: \gdef and \DeclareMathOperator write into it
1967
+ ignoredTags: [...MATH_IGNORED_TAGS],
1968
+ ignoredClasses: ["katex", "katex-display", SKIPPED],
1969
+ errorCallback(message, error) {
1970
+ console.warn("[DocMath]", message, error);
1971
+ }
1972
+ });
1973
+ }
1974
+ for (const instance of instances) {
1975
+ instance.classList.remove(SKIPPED);
1976
+ if (instance.classList.length === 0) instance.removeAttribute("class");
1977
+ }
1978
+ }
1979
+ global.DocMath = Object.freeze({ render, macros: MACROS });
1980
+ global.ReportMath = global.DocMath;
1981
+ if (!global.DocKit) throw new Error("DocMath requires /kit/runtime.js to be loaded first.");
1982
+ global.DocKit.component({ id: "math", selector: "body", added: false, mount() {
1983
+ render();
1984
+ return null;
1985
+ } });
1986
+ global.DocKit.component({ id: "math-tie", selector: ".doc-math-tie", added: false, mount: () => null, dehydrate: untie });
1987
+ })(globalThis);
1988
+ })();