solana-docs 0.0.0 → 1.0.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.

Potentially problematic release.


This version of solana-docs might be problematic. Click here for more details.

Files changed (925) hide show
  1. package/index.js +47 -0
  2. package/package.json +7 -45
  3. package/.eslintignore +0 -8
  4. package/.eslintrc +0 -21
  5. package/.prettierignore +0 -7
  6. package/.travis/before_install.sh +0 -9
  7. package/.travis/script.sh +0 -4
  8. package/README.md +0 -59
  9. package/art/data-plane-fanout.bob +0 -19
  10. package/art/data-plane-neighborhood.bob +0 -25
  11. package/art/data-plane-seeding.bob +0 -15
  12. package/art/data-plane.bob +0 -18
  13. package/art/fork-generation.bob +0 -13
  14. package/art/forks-pruned.bob +0 -9
  15. package/art/forks-pruned2.bob +0 -11
  16. package/art/forks.bob +0 -13
  17. package/art/passive-staking-callflow.msc +0 -30
  18. package/art/retransmit_stage.bob +0 -45
  19. package/art/runtime.bob +0 -10
  20. package/art/sdk-tools.bob +0 -20
  21. package/art/spv-bank-hash.bob +0 -19
  22. package/art/spv-block-merkle.bob +0 -19
  23. package/art/tpu.bob +0 -19
  24. package/art/tvu.bob +0 -37
  25. package/art/validator-proposal.bob +0 -60
  26. package/art/validator.bob +0 -30
  27. package/babel.config.js +0 -3
  28. package/build-cli-usage.sh +0 -42
  29. package/build.sh +0 -40
  30. package/convert-ascii-to-svg.sh +0 -21
  31. package/crowdin.yml +0 -16
  32. package/docusaurus.config.js +0 -161
  33. package/offline-cmd-md-links.sh +0 -11
  34. package/publish-docs.sh +0 -56
  35. package/set-solana-release-tag.sh +0 -20
  36. package/sidebars.js +0 -210
  37. package/src/cli/.usage.md.header +0 -59
  38. package/src/cli/choose-a-cluster.md +0 -43
  39. package/src/cli/conventions.md +0 -80
  40. package/src/cli/delegate-stake.md +0 -206
  41. package/src/cli/deploy-a-program.md +0 -302
  42. package/src/cli/install-solana-cli-tools.md +0 -164
  43. package/src/cli/transfer-tokens.md +0 -158
  44. package/src/cli.md +0 -22
  45. package/src/cluster/bench-tps.md +0 -129
  46. package/src/cluster/fork-generation.md +0 -64
  47. package/src/cluster/leader-rotation.md +0 -88
  48. package/src/cluster/managing-forks.md +0 -36
  49. package/src/cluster/overview.md +0 -39
  50. package/src/cluster/performance-metrics.md +0 -25
  51. package/src/cluster/rpc-endpoints.md +0 -50
  52. package/src/cluster/stake-delegation-and-rewards.md +0 -197
  53. package/src/cluster/synchronization.md +0 -28
  54. package/src/cluster/turbine-block-propagation.md +0 -101
  55. package/src/cluster/vote-signing.md +0 -59
  56. package/src/clusters.md +0 -173
  57. package/src/css/custom.css +0 -73
  58. package/src/developing/backwards-compatibility.md +0 -151
  59. package/src/developing/clients/javascript-api.md +0 -332
  60. package/src/developing/clients/javascript-reference.md +0 -750
  61. package/src/developing/clients/jsonrpc-api.md +0 -5173
  62. package/src/developing/clients/rust-api.md +0 -36
  63. package/src/developing/on-chain-programs/debugging.md +0 -110
  64. package/src/developing/on-chain-programs/deploying.md +0 -24
  65. package/src/developing/on-chain-programs/developing-c.md +0 -202
  66. package/src/developing/on-chain-programs/developing-rust.md +0 -406
  67. package/src/developing/on-chain-programs/examples.md +0 -61
  68. package/src/developing/on-chain-programs/faq.md +0 -81
  69. package/src/developing/on-chain-programs/overview.md +0 -218
  70. package/src/developing/plugins/accountsdb_plugin.md +0 -360
  71. package/src/developing/programming-model/accounts.md +0 -231
  72. package/src/developing/programming-model/calling-between-programs.md +0 -351
  73. package/src/developing/programming-model/overview.md +0 -17
  74. package/src/developing/programming-model/runtime.md +0 -131
  75. package/src/developing/programming-model/transactions.md +0 -210
  76. package/src/developing/runtime-facilities/programs.md +0 -168
  77. package/src/developing/runtime-facilities/sysvars.md +0 -142
  78. package/src/developing/test-validator.md +0 -153
  79. package/src/economics_overview.md +0 -20
  80. package/src/history.md +0 -60
  81. package/src/icons/Archivers.inline.svg +0 -11
  82. package/src/icons/Bulb.inline.svg +0 -13
  83. package/src/icons/Chat.inline.svg +0 -10
  84. package/src/icons/Clipboard.inline.svg +0 -13
  85. package/src/icons/Cloudbreak.inline.svg +0 -11
  86. package/src/icons/Code.inline.svg +0 -11
  87. package/src/icons/Fire.inline.svg +0 -10
  88. package/src/icons/Gamepad.inline.svg +0 -11
  89. package/src/icons/Globe.inline.svg +0 -1
  90. package/src/icons/Gulfstream.inline.svg +0 -11
  91. package/src/icons/History.inline.svg +0 -11
  92. package/src/icons/Money.inline.svg +0 -11
  93. package/src/icons/Pipeline.inline.svg +0 -15
  94. package/src/icons/PoH.inline.svg +0 -11
  95. package/src/icons/Sealevel.inline.svg +0 -11
  96. package/src/icons/Tools.inline.svg +0 -11
  97. package/src/icons/Tower.inline.svg +0 -11
  98. package/src/icons/Turbine.inline.svg +0 -12
  99. package/src/icons/duotone-icons/Clothes/Brassiere.svg +0 -10
  100. package/src/icons/duotone-icons/Clothes/Briefcase.svg +0 -11
  101. package/src/icons/duotone-icons/Clothes/Cap.svg +0 -11
  102. package/src/icons/duotone-icons/Clothes/Crown.svg +0 -11
  103. package/src/icons/duotone-icons/Clothes/Dress.svg +0 -11
  104. package/src/icons/duotone-icons/Clothes/Hanger.svg +0 -10
  105. package/src/icons/duotone-icons/Clothes/Hat.svg +0 -11
  106. package/src/icons/duotone-icons/Clothes/Panties.svg +0 -10
  107. package/src/icons/duotone-icons/Clothes/Shirt.svg +0 -11
  108. package/src/icons/duotone-icons/Clothes/Shoes.svg +0 -11
  109. package/src/icons/duotone-icons/Clothes/Shorts.svg +0 -10
  110. package/src/icons/duotone-icons/Clothes/Sneakers.svg +0 -11
  111. package/src/icons/duotone-icons/Clothes/Socks.svg +0 -11
  112. package/src/icons/duotone-icons/Clothes/Sun-glasses.svg +0 -11
  113. package/src/icons/duotone-icons/Clothes/T-Shirt.svg +0 -10
  114. package/src/icons/duotone-icons/Clothes/Tie.svg +0 -11
  115. package/src/icons/duotone-icons/Code/Backspace.svg +0 -11
  116. package/src/icons/duotone-icons/Code/CMD.svg +0 -10
  117. package/src/icons/duotone-icons/Code/Code.inline.svg +0 -11
  118. package/src/icons/duotone-icons/Code/Commit.svg +0 -11
  119. package/src/icons/duotone-icons/Code/Compiling.inline.svg +0 -11
  120. package/src/icons/duotone-icons/Code/Control.svg +0 -10
  121. package/src/icons/duotone-icons/Code/Done-circle.svg +0 -11
  122. package/src/icons/duotone-icons/Code/Error-circle.svg +0 -11
  123. package/src/icons/duotone-icons/Code/Git#1.svg +0 -12
  124. package/src/icons/duotone-icons/Code/Git#2.svg +0 -15
  125. package/src/icons/duotone-icons/Code/Git#3.svg +0 -13
  126. package/src/icons/duotone-icons/Code/Git#4.svg +0 -13
  127. package/src/icons/duotone-icons/Code/Github.svg +0 -11
  128. package/src/icons/duotone-icons/Code/Info-circle.svg +0 -12
  129. package/src/icons/duotone-icons/Code/Left-circle.svg +0 -11
  130. package/src/icons/duotone-icons/Code/Loading.svg +0 -12
  131. package/src/icons/duotone-icons/Code/Lock-circle.svg +0 -11
  132. package/src/icons/duotone-icons/Code/Lock-overturning.svg +0 -11
  133. package/src/icons/duotone-icons/Code/Minus.svg +0 -11
  134. package/src/icons/duotone-icons/Code/Option.svg +0 -11
  135. package/src/icons/duotone-icons/Code/Plus.svg +0 -11
  136. package/src/icons/duotone-icons/Code/Puzzle.svg +0 -10
  137. package/src/icons/duotone-icons/Code/Question-circle.svg +0 -11
  138. package/src/icons/duotone-icons/Code/Right-circle.svg +0 -11
  139. package/src/icons/duotone-icons/Code/Settings#4.svg +0 -11
  140. package/src/icons/duotone-icons/Code/Shift.svg +0 -10
  141. package/src/icons/duotone-icons/Code/Spy.svg +0 -11
  142. package/src/icons/duotone-icons/Code/Stop.svg +0 -10
  143. package/src/icons/duotone-icons/Code/Terminal.svg +0 -11
  144. package/src/icons/duotone-icons/Code/Thunder-circle.svg +0 -11
  145. package/src/icons/duotone-icons/Code/Time-schedule.svg +0 -11
  146. package/src/icons/duotone-icons/Code/Warning-1-circle.svg +0 -12
  147. package/src/icons/duotone-icons/Code/Warning-2.svg +0 -12
  148. package/src/icons/duotone-icons/Communication/Active-call.svg +0 -11
  149. package/src/icons/duotone-icons/Communication/Add-user.svg +0 -11
  150. package/src/icons/duotone-icons/Communication/Address-card.svg +0 -10
  151. package/src/icons/duotone-icons/Communication/Adress-book#1.svg +0 -11
  152. package/src/icons/duotone-icons/Communication/Adress-book#2.svg +0 -11
  153. package/src/icons/duotone-icons/Communication/Archive.svg +0 -10
  154. package/src/icons/duotone-icons/Communication/Call#1.svg +0 -10
  155. package/src/icons/duotone-icons/Communication/Call.svg +0 -10
  156. package/src/icons/duotone-icons/Communication/Chat#1.svg +0 -11
  157. package/src/icons/duotone-icons/Communication/Chat#2.svg +0 -11
  158. package/src/icons/duotone-icons/Communication/Chat#4.svg +0 -10
  159. package/src/icons/duotone-icons/Communication/Chat#5.svg +0 -11
  160. package/src/icons/duotone-icons/Communication/Chat#6.svg +0 -11
  161. package/src/icons/duotone-icons/Communication/Chat-check.svg +0 -11
  162. package/src/icons/duotone-icons/Communication/Chat-error.svg +0 -11
  163. package/src/icons/duotone-icons/Communication/Chat-locked.svg +0 -11
  164. package/src/icons/duotone-icons/Communication/Chat-smile.svg +0 -11
  165. package/src/icons/duotone-icons/Communication/Clipboard-check.svg +0 -12
  166. package/src/icons/duotone-icons/Communication/Clipboard-list.svg +0 -17
  167. package/src/icons/duotone-icons/Communication/Contact#1.svg +0 -11
  168. package/src/icons/duotone-icons/Communication/Delete-user.svg +0 -11
  169. package/src/icons/duotone-icons/Communication/Dial-numbers.svg +0 -18
  170. package/src/icons/duotone-icons/Communication/Flag.svg +0 -11
  171. package/src/icons/duotone-icons/Communication/Forward.svg +0 -10
  172. package/src/icons/duotone-icons/Communication/Group-chat.svg +0 -11
  173. package/src/icons/duotone-icons/Communication/Group.svg +0 -11
  174. package/src/icons/duotone-icons/Communication/Incoming-box.svg +0 -12
  175. package/src/icons/duotone-icons/Communication/Incoming-call.svg +0 -11
  176. package/src/icons/duotone-icons/Communication/Incoming-mail.svg +0 -11
  177. package/src/icons/duotone-icons/Communication/Mail-@.svg +0 -10
  178. package/src/icons/duotone-icons/Communication/Mail-attachment.svg +0 -11
  179. package/src/icons/duotone-icons/Communication/Mail-box.svg +0 -11
  180. package/src/icons/duotone-icons/Communication/Mail-error.svg +0 -11
  181. package/src/icons/duotone-icons/Communication/Mail-heart.svg +0 -11
  182. package/src/icons/duotone-icons/Communication/Mail-locked.svg +0 -11
  183. package/src/icons/duotone-icons/Communication/Mail-notification.svg +0 -11
  184. package/src/icons/duotone-icons/Communication/Mail-opened.svg +0 -11
  185. package/src/icons/duotone-icons/Communication/Mail-unocked.svg +0 -11
  186. package/src/icons/duotone-icons/Communication/Mail.svg +0 -10
  187. package/src/icons/duotone-icons/Communication/Missed-call.svg +0 -11
  188. package/src/icons/duotone-icons/Communication/Outgoing-box.svg +0 -12
  189. package/src/icons/duotone-icons/Communication/Outgoing-call.svg +0 -11
  190. package/src/icons/duotone-icons/Communication/Outgoing-mail.svg +0 -11
  191. package/src/icons/duotone-icons/Communication/RSS.svg +0 -12
  192. package/src/icons/duotone-icons/Communication/Readed-mail.svg +0 -11
  193. package/src/icons/duotone-icons/Communication/Reply-all.svg +0 -11
  194. package/src/icons/duotone-icons/Communication/Reply.svg +0 -10
  195. package/src/icons/duotone-icons/Communication/Right.svg +0 -10
  196. package/src/icons/duotone-icons/Communication/Safe-chat.svg +0 -11
  197. package/src/icons/duotone-icons/Communication/Send.svg +0 -10
  198. package/src/icons/duotone-icons/Communication/Sending mail.svg +0 -11
  199. package/src/icons/duotone-icons/Communication/Sending.svg +0 -11
  200. package/src/icons/duotone-icons/Communication/Share.svg +0 -11
  201. package/src/icons/duotone-icons/Communication/Shield-thunder.svg +0 -11
  202. package/src/icons/duotone-icons/Communication/Shield-user.svg +0 -12
  203. package/src/icons/duotone-icons/Communication/Snoozed-mail.svg +0 -11
  204. package/src/icons/duotone-icons/Communication/Spam.svg +0 -10
  205. package/src/icons/duotone-icons/Communication/Thumbtack.svg +0 -11
  206. package/src/icons/duotone-icons/Communication/Urgent-mail.svg +0 -11
  207. package/src/icons/duotone-icons/Communication/Write.svg +0 -11
  208. package/src/icons/duotone-icons/Cooking/Baking-glove.svg +0 -11
  209. package/src/icons/duotone-icons/Cooking/Bowl.svg +0 -11
  210. package/src/icons/duotone-icons/Cooking/Chef.svg +0 -11
  211. package/src/icons/duotone-icons/Cooking/Cooking-book.svg +0 -17
  212. package/src/icons/duotone-icons/Cooking/Cooking-pot.svg +0 -11
  213. package/src/icons/duotone-icons/Cooking/Cutting board.svg +0 -11
  214. package/src/icons/duotone-icons/Cooking/Dinner.svg +0 -14
  215. package/src/icons/duotone-icons/Cooking/Dish.svg +0 -11
  216. package/src/icons/duotone-icons/Cooking/Dishes.svg +0 -11
  217. package/src/icons/duotone-icons/Cooking/Fork-spoon-knife.svg +0 -15
  218. package/src/icons/duotone-icons/Cooking/Fork-spoon.svg +0 -13
  219. package/src/icons/duotone-icons/Cooking/Fork.svg +0 -11
  220. package/src/icons/duotone-icons/Cooking/Frying-pan.svg +0 -11
  221. package/src/icons/duotone-icons/Cooking/Grater.svg +0 -11
  222. package/src/icons/duotone-icons/Cooking/Kitchen-scale.svg +0 -11
  223. package/src/icons/duotone-icons/Cooking/Knife#1.svg +0 -11
  224. package/src/icons/duotone-icons/Cooking/Knife#2.svg +0 -11
  225. package/src/icons/duotone-icons/Cooking/Knife&fork#1.svg +0 -13
  226. package/src/icons/duotone-icons/Cooking/Knife&fork#2.svg +0 -13
  227. package/src/icons/duotone-icons/Cooking/Ladle.svg +0 -11
  228. package/src/icons/duotone-icons/Cooking/Rolling-pin.svg +0 -11
  229. package/src/icons/duotone-icons/Cooking/Saucepan.svg +0 -11
  230. package/src/icons/duotone-icons/Cooking/Shovel.svg +0 -11
  231. package/src/icons/duotone-icons/Cooking/Sieve.svg +0 -11
  232. package/src/icons/duotone-icons/Cooking/Spoon.svg +0 -12
  233. package/src/icons/duotone-icons/Design/Adjust.svg +0 -10
  234. package/src/icons/duotone-icons/Design/Anchor-center-down.svg +0 -14
  235. package/src/icons/duotone-icons/Design/Anchor-center-up.svg +0 -14
  236. package/src/icons/duotone-icons/Design/Anchor-center.svg +0 -11
  237. package/src/icons/duotone-icons/Design/Anchor-left-down.svg +0 -14
  238. package/src/icons/duotone-icons/Design/Anchor-left-up.svg +0 -14
  239. package/src/icons/duotone-icons/Design/Anchor-left.svg +0 -14
  240. package/src/icons/duotone-icons/Design/Anchor-right-down.svg +0 -14
  241. package/src/icons/duotone-icons/Design/Anchor-right-up.svg +0 -14
  242. package/src/icons/duotone-icons/Design/Anchor-right.svg +0 -14
  243. package/src/icons/duotone-icons/Design/Arrows.svg +0 -11
  244. package/src/icons/duotone-icons/Design/Bezier-curve.svg +0 -11
  245. package/src/icons/duotone-icons/Design/Border.svg +0 -10
  246. package/src/icons/duotone-icons/Design/Brush.svg +0 -11
  247. package/src/icons/duotone-icons/Design/Bucket.svg +0 -11
  248. package/src/icons/duotone-icons/Design/Cap-1.svg +0 -11
  249. package/src/icons/duotone-icons/Design/Cap-2.svg +0 -10
  250. package/src/icons/duotone-icons/Design/Cap-3.svg +0 -11
  251. package/src/icons/duotone-icons/Design/Circle.svg +0 -10
  252. package/src/icons/duotone-icons/Design/Color-profile.svg +0 -11
  253. package/src/icons/duotone-icons/Design/Color.svg +0 -10
  254. package/src/icons/duotone-icons/Design/Component.svg +0 -10
  255. package/src/icons/duotone-icons/Design/Crop.svg +0 -11
  256. package/src/icons/duotone-icons/Design/Difference.svg +0 -11
  257. package/src/icons/duotone-icons/Design/Edit.svg +0 -11
  258. package/src/icons/duotone-icons/Design/Eraser.svg +0 -10
  259. package/src/icons/duotone-icons/Design/Flatten.svg +0 -11
  260. package/src/icons/duotone-icons/Design/Flip-horizontal.svg +0 -12
  261. package/src/icons/duotone-icons/Design/Flip-vertical.svg +0 -12
  262. package/src/icons/duotone-icons/Design/Horizontal.svg +0 -11
  263. package/src/icons/duotone-icons/Design/Image.svg +0 -10
  264. package/src/icons/duotone-icons/Design/Interselect.svg +0 -11
  265. package/src/icons/duotone-icons/Design/Join-1.svg +0 -11
  266. package/src/icons/duotone-icons/Design/Join-2.svg +0 -11
  267. package/src/icons/duotone-icons/Design/Join-3.svg +0 -11
  268. package/src/icons/duotone-icons/Design/Layers.svg +0 -11
  269. package/src/icons/duotone-icons/Design/Line.svg +0 -12
  270. package/src/icons/duotone-icons/Design/Magic.svg +0 -11
  271. package/src/icons/duotone-icons/Design/Mask.svg +0 -11
  272. package/src/icons/duotone-icons/Design/Patch.svg +0 -12
  273. package/src/icons/duotone-icons/Design/Pen&ruller.svg +0 -11
  274. package/src/icons/duotone-icons/Design/Pen-tool-vector.svg +0 -11
  275. package/src/icons/duotone-icons/Design/Pencil.svg +0 -11
  276. package/src/icons/duotone-icons/Design/Picker.svg +0 -11
  277. package/src/icons/duotone-icons/Design/Pixels.svg +0 -15
  278. package/src/icons/duotone-icons/Design/Polygon.svg +0 -10
  279. package/src/icons/duotone-icons/Design/Position.svg +0 -10
  280. package/src/icons/duotone-icons/Design/Rectangle.svg +0 -10
  281. package/src/icons/duotone-icons/Design/Saturation.svg +0 -11
  282. package/src/icons/duotone-icons/Design/Select.svg +0 -11
  283. package/src/icons/duotone-icons/Design/Sketch.svg +0 -11
  284. package/src/icons/duotone-icons/Design/Stamp.svg +0 -11
  285. package/src/icons/duotone-icons/Design/Substract.svg +0 -11
  286. package/src/icons/duotone-icons/Design/Target.svg +0 -11
  287. package/src/icons/duotone-icons/Design/Triangle.svg +0 -10
  288. package/src/icons/duotone-icons/Design/Union.svg +0 -10
  289. package/src/icons/duotone-icons/Design/Vertical.svg +0 -11
  290. package/src/icons/duotone-icons/Design/Zoom minus.svg +0 -12
  291. package/src/icons/duotone-icons/Design/Zoom plus.svg +0 -12
  292. package/src/icons/duotone-icons/Devices/Airpods.svg +0 -13
  293. package/src/icons/duotone-icons/Devices/Android.svg +0 -11
  294. package/src/icons/duotone-icons/Devices/Apple-Watch.svg +0 -11
  295. package/src/icons/duotone-icons/Devices/Battery-charging.svg +0 -12
  296. package/src/icons/duotone-icons/Devices/Battery-empty.svg +0 -11
  297. package/src/icons/duotone-icons/Devices/Battery-full.svg +0 -11
  298. package/src/icons/duotone-icons/Devices/Battery-half.svg +0 -11
  299. package/src/icons/duotone-icons/Devices/Bluetooth.svg +0 -11
  300. package/src/icons/duotone-icons/Devices/CPU#1.svg +0 -17
  301. package/src/icons/duotone-icons/Devices/CPU#2.svg +0 -23
  302. package/src/icons/duotone-icons/Devices/Camera.svg +0 -12
  303. package/src/icons/duotone-icons/Devices/Cardboard-vr.svg +0 -11
  304. package/src/icons/duotone-icons/Devices/Cassete.svg +0 -12
  305. package/src/icons/duotone-icons/Devices/Diagnostics.svg +0 -12
  306. package/src/icons/duotone-icons/Devices/Display#1.svg +0 -11
  307. package/src/icons/duotone-icons/Devices/Display#2.svg +0 -12
  308. package/src/icons/duotone-icons/Devices/Display#3.svg +0 -12
  309. package/src/icons/duotone-icons/Devices/Gameboy.svg +0 -11
  310. package/src/icons/duotone-icons/Devices/Gamepad#1.svg +0 -11
  311. package/src/icons/duotone-icons/Devices/Gamepad#2.svg +0 -11
  312. package/src/icons/duotone-icons/Devices/Generator.svg +0 -13
  313. package/src/icons/duotone-icons/Devices/Hard-drive.svg +0 -11
  314. package/src/icons/duotone-icons/Devices/Headphones.svg +0 -11
  315. package/src/icons/duotone-icons/Devices/Homepod.svg +0 -11
  316. package/src/icons/duotone-icons/Devices/Keyboard.svg +0 -11
  317. package/src/icons/duotone-icons/Devices/LTE#1.svg +0 -11
  318. package/src/icons/duotone-icons/Devices/LTE#2.svg +0 -11
  319. package/src/icons/duotone-icons/Devices/Laptop-macbook.svg +0 -11
  320. package/src/icons/duotone-icons/Devices/Laptop.svg +0 -11
  321. package/src/icons/duotone-icons/Devices/Mic.svg +0 -11
  322. package/src/icons/duotone-icons/Devices/Midi.svg +0 -16
  323. package/src/icons/duotone-icons/Devices/Mouse.svg +0 -12
  324. package/src/icons/duotone-icons/Devices/Phone.svg +0 -12
  325. package/src/icons/duotone-icons/Devices/Printer.svg +0 -11
  326. package/src/icons/duotone-icons/Devices/Radio.svg +0 -14
  327. package/src/icons/duotone-icons/Devices/Router#1.svg +0 -11
  328. package/src/icons/duotone-icons/Devices/Router#2.svg +0 -11
  329. package/src/icons/duotone-icons/Devices/SD-card.svg +0 -10
  330. package/src/icons/duotone-icons/Devices/Server.svg +0 -12
  331. package/src/icons/duotone-icons/Devices/Speaker.svg +0 -11
  332. package/src/icons/duotone-icons/Devices/TV#1.svg +0 -12
  333. package/src/icons/duotone-icons/Devices/TV#2.svg +0 -11
  334. package/src/icons/duotone-icons/Devices/Tablet.svg +0 -11
  335. package/src/icons/duotone-icons/Devices/USB.svg +0 -12
  336. package/src/icons/duotone-icons/Devices/Usb-storage.svg +0 -11
  337. package/src/icons/duotone-icons/Devices/Video-camera.svg +0 -11
  338. package/src/icons/duotone-icons/Devices/Watch#1.svg +0 -13
  339. package/src/icons/duotone-icons/Devices/Watch#2.svg +0 -13
  340. package/src/icons/duotone-icons/Devices/Wi-fi.svg +0 -11
  341. package/src/icons/duotone-icons/Devices/iMac.svg +0 -12
  342. package/src/icons/duotone-icons/Devices/iPhone-X.svg +0 -11
  343. package/src/icons/duotone-icons/Devices/iPhone-back.svg +0 -10
  344. package/src/icons/duotone-icons/Devices/iPhone-x-back.svg +0 -10
  345. package/src/icons/duotone-icons/Electric/Air-conditioning.svg +0 -11
  346. package/src/icons/duotone-icons/Electric/Blender.svg +0 -10
  347. package/src/icons/duotone-icons/Electric/Fan.svg +0 -12
  348. package/src/icons/duotone-icons/Electric/Fridge.svg +0 -10
  349. package/src/icons/duotone-icons/Electric/Gas-stove.svg +0 -11
  350. package/src/icons/duotone-icons/Electric/Hair-dryer.svg +0 -11
  351. package/src/icons/duotone-icons/Electric/Highvoltage.svg +0 -10
  352. package/src/icons/duotone-icons/Electric/Iron.svg +0 -11
  353. package/src/icons/duotone-icons/Electric/Kettle.svg +0 -11
  354. package/src/icons/duotone-icons/Electric/Mixer.svg +0 -11
  355. package/src/icons/duotone-icons/Electric/Outlet.svg +0 -11
  356. package/src/icons/duotone-icons/Electric/Range-hood.svg +0 -11
  357. package/src/icons/duotone-icons/Electric/Shutdown.svg +0 -11
  358. package/src/icons/duotone-icons/Electric/Socket-eu.svg +0 -10
  359. package/src/icons/duotone-icons/Electric/Socket-us.svg +0 -10
  360. package/src/icons/duotone-icons/Electric/Washer.svg +0 -11
  361. package/src/icons/duotone-icons/Files/Cloud-download.svg +0 -11
  362. package/src/icons/duotone-icons/Files/Cloud-upload.svg +0 -11
  363. package/src/icons/duotone-icons/Files/Compilation.svg +0 -14
  364. package/src/icons/duotone-icons/Files/Compiled-file.svg +0 -14
  365. package/src/icons/duotone-icons/Files/Deleted-file.svg +0 -11
  366. package/src/icons/duotone-icons/Files/Deleted-folder.svg +0 -11
  367. package/src/icons/duotone-icons/Files/Download.inline.svg +0 -12
  368. package/src/icons/duotone-icons/Files/Downloaded file.svg +0 -11
  369. package/src/icons/duotone-icons/Files/Downloads-folder.svg +0 -11
  370. package/src/icons/duotone-icons/Files/Export.svg +0 -12
  371. package/src/icons/duotone-icons/Files/File-cloud.svg +0 -11
  372. package/src/icons/duotone-icons/Files/File-done.svg +0 -11
  373. package/src/icons/duotone-icons/Files/File-minus.svg +0 -11
  374. package/src/icons/duotone-icons/Files/File-plus.svg +0 -11
  375. package/src/icons/duotone-icons/Files/File.svg +0 -12
  376. package/src/icons/duotone-icons/Files/Folder-check.svg +0 -11
  377. package/src/icons/duotone-icons/Files/Folder-cloud.svg +0 -11
  378. package/src/icons/duotone-icons/Files/Folder-error.svg +0 -11
  379. package/src/icons/duotone-icons/Files/Folder-heart.svg +0 -11
  380. package/src/icons/duotone-icons/Files/Folder-minus.svg +0 -11
  381. package/src/icons/duotone-icons/Files/Folder-plus.svg +0 -11
  382. package/src/icons/duotone-icons/Files/Folder-solid.svg +0 -10
  383. package/src/icons/duotone-icons/Files/Folder-star.svg +0 -11
  384. package/src/icons/duotone-icons/Files/Folder-thunder.svg +0 -11
  385. package/src/icons/duotone-icons/Files/Folder.svg +0 -10
  386. package/src/icons/duotone-icons/Files/Group-folders.svg +0 -11
  387. package/src/icons/duotone-icons/Files/Import.svg +0 -12
  388. package/src/icons/duotone-icons/Files/Locked-folder.svg +0 -11
  389. package/src/icons/duotone-icons/Files/Media-folder.svg +0 -11
  390. package/src/icons/duotone-icons/Files/Media.svg +0 -11
  391. package/src/icons/duotone-icons/Files/Music.svg +0 -11
  392. package/src/icons/duotone-icons/Files/Pictures#1.svg +0 -13
  393. package/src/icons/duotone-icons/Files/Pictures#2.svg +0 -15
  394. package/src/icons/duotone-icons/Files/Protected-file.svg +0 -11
  395. package/src/icons/duotone-icons/Files/Selected-file.svg +0 -11
  396. package/src/icons/duotone-icons/Files/Share.svg +0 -13
  397. package/src/icons/duotone-icons/Files/Upload-folder.svg +0 -11
  398. package/src/icons/duotone-icons/Files/Upload.svg +0 -12
  399. package/src/icons/duotone-icons/Files/Uploaded-file.svg +0 -11
  400. package/src/icons/duotone-icons/Files/User-folder.svg +0 -12
  401. package/src/icons/duotone-icons/Food/Beer.svg +0 -14
  402. package/src/icons/duotone-icons/Food/Bottle#1.svg +0 -11
  403. package/src/icons/duotone-icons/Food/Bottle#2.svg +0 -11
  404. package/src/icons/duotone-icons/Food/Bread.svg +0 -11
  405. package/src/icons/duotone-icons/Food/Bucket.svg +0 -11
  406. package/src/icons/duotone-icons/Food/Burger.svg +0 -12
  407. package/src/icons/duotone-icons/Food/Cake.svg +0 -12
  408. package/src/icons/duotone-icons/Food/Carrot.svg +0 -13
  409. package/src/icons/duotone-icons/Food/Cheese.svg +0 -11
  410. package/src/icons/duotone-icons/Food/Chicken.svg +0 -13
  411. package/src/icons/duotone-icons/Food/Coffee#1.svg +0 -14
  412. package/src/icons/duotone-icons/Food/Coffee#2.svg +0 -12
  413. package/src/icons/duotone-icons/Food/Cookie.svg +0 -13
  414. package/src/icons/duotone-icons/Food/Dinner.svg +0 -11
  415. package/src/icons/duotone-icons/Food/Fish.svg +0 -11
  416. package/src/icons/duotone-icons/Food/French Bread.svg +0 -10
  417. package/src/icons/duotone-icons/Food/Glass-martini.svg +0 -11
  418. package/src/icons/duotone-icons/Food/Ice-cream#1.svg +0 -11
  419. package/src/icons/duotone-icons/Food/Ice-cream#2.svg +0 -11
  420. package/src/icons/duotone-icons/Food/Miso-soup.svg +0 -11
  421. package/src/icons/duotone-icons/Food/Orange.svg +0 -11
  422. package/src/icons/duotone-icons/Food/Pizza.svg +0 -13
  423. package/src/icons/duotone-icons/Food/Sushi.svg +0 -11
  424. package/src/icons/duotone-icons/Food/Two-bottles.svg +0 -11
  425. package/src/icons/duotone-icons/Food/Wine.svg +0 -11
  426. package/src/icons/duotone-icons/General/Attachment#1.svg +0 -11
  427. package/src/icons/duotone-icons/General/Attachment#2.svg +0 -13
  428. package/src/icons/duotone-icons/General/Binocular.svg +0 -10
  429. package/src/icons/duotone-icons/General/Bookmark.svg +0 -10
  430. package/src/icons/duotone-icons/General/Clip.svg +0 -10
  431. package/src/icons/duotone-icons/General/Clipboard.svg +0 -13
  432. package/src/icons/duotone-icons/General/Cursor.svg +0 -10
  433. package/src/icons/duotone-icons/General/Dislike.svg +0 -11
  434. package/src/icons/duotone-icons/General/Duplicate.svg +0 -11
  435. package/src/icons/duotone-icons/General/Edit.svg +0 -10
  436. package/src/icons/duotone-icons/General/Expand-arrows.svg +0 -11
  437. package/src/icons/duotone-icons/General/Fire.svg +0 -10
  438. package/src/icons/duotone-icons/General/Folder.svg +0 -10
  439. package/src/icons/duotone-icons/General/Half-heart.svg +0 -11
  440. package/src/icons/duotone-icons/General/Half-star.svg +0 -11
  441. package/src/icons/duotone-icons/General/Heart.svg +0 -10
  442. package/src/icons/duotone-icons/General/Hidden.svg +0 -12
  443. package/src/icons/duotone-icons/General/Like.svg +0 -11
  444. package/src/icons/duotone-icons/General/Lock.svg +0 -16
  445. package/src/icons/duotone-icons/General/Notification#2.svg +0 -11
  446. package/src/icons/duotone-icons/General/Notifications#1.svg +0 -10
  447. package/src/icons/duotone-icons/General/Other#1.svg +0 -12
  448. package/src/icons/duotone-icons/General/Other#2.svg +0 -12
  449. package/src/icons/duotone-icons/General/Sad.svg +0 -11
  450. package/src/icons/duotone-icons/General/Save.svg +0 -11
  451. package/src/icons/duotone-icons/General/Scale.svg +0 -11
  452. package/src/icons/duotone-icons/General/Scissors.svg +0 -11
  453. package/src/icons/duotone-icons/General/Search.svg +0 -11
  454. package/src/icons/duotone-icons/General/Settings#3.svg +0 -11
  455. package/src/icons/duotone-icons/General/Settings-1.inline.svg +0 -11
  456. package/src/icons/duotone-icons/General/Settings-2.svg +0 -10
  457. package/src/icons/duotone-icons/General/Shield-check.svg +0 -11
  458. package/src/icons/duotone-icons/General/Shield-disabled.svg +0 -11
  459. package/src/icons/duotone-icons/General/Shield-protected.svg +0 -11
  460. package/src/icons/duotone-icons/General/Size.svg +0 -11
  461. package/src/icons/duotone-icons/General/Smile.svg +0 -11
  462. package/src/icons/duotone-icons/General/Star.svg +0 -10
  463. package/src/icons/duotone-icons/General/Thunder-move.svg +0 -11
  464. package/src/icons/duotone-icons/General/Thunder.svg +0 -10
  465. package/src/icons/duotone-icons/General/Trash.svg +0 -11
  466. package/src/icons/duotone-icons/General/Unlock.svg +0 -16
  467. package/src/icons/duotone-icons/General/Update.svg +0 -10
  468. package/src/icons/duotone-icons/General/User.svg +0 -11
  469. package/src/icons/duotone-icons/General/Visible.svg +0 -11
  470. package/src/icons/duotone-icons/Home/Air-ballon.svg +0 -11
  471. package/src/icons/duotone-icons/Home/Alarm-clock.svg +0 -12
  472. package/src/icons/duotone-icons/Home/Armchair.svg +0 -11
  473. package/src/icons/duotone-icons/Home/Bag-chair.svg +0 -11
  474. package/src/icons/duotone-icons/Home/Bath.svg +0 -11
  475. package/src/icons/duotone-icons/Home/Bed.svg +0 -12
  476. package/src/icons/duotone-icons/Home/Book-open.svg +0 -11
  477. package/src/icons/duotone-icons/Home/Book.svg +0 -16
  478. package/src/icons/duotone-icons/Home/Box.svg +0 -11
  479. package/src/icons/duotone-icons/Home/Broom.svg +0 -11
  480. package/src/icons/duotone-icons/Home/Building.svg +0 -12
  481. package/src/icons/duotone-icons/Home/Bulb#1.svg +0 -13
  482. package/src/icons/duotone-icons/Home/Bulb#2.svg +0 -13
  483. package/src/icons/duotone-icons/Home/Chair#1.svg +0 -11
  484. package/src/icons/duotone-icons/Home/Chair#2.svg +0 -11
  485. package/src/icons/duotone-icons/Home/Clock.svg +0 -11
  486. package/src/icons/duotone-icons/Home/Commode#1.svg +0 -11
  487. package/src/icons/duotone-icons/Home/Commode#2.svg +0 -11
  488. package/src/icons/duotone-icons/Home/Couch.svg +0 -11
  489. package/src/icons/duotone-icons/Home/Cupboard.svg +0 -11
  490. package/src/icons/duotone-icons/Home/Curtains.svg +0 -11
  491. package/src/icons/duotone-icons/Home/Deer.svg +0 -11
  492. package/src/icons/duotone-icons/Home/Door-open.svg +0 -11
  493. package/src/icons/duotone-icons/Home/Earth.svg +0 -11
  494. package/src/icons/duotone-icons/Home/Fireplace.svg +0 -11
  495. package/src/icons/duotone-icons/Home/Flashlight.svg +0 -11
  496. package/src/icons/duotone-icons/Home/Flower#1.svg +0 -13
  497. package/src/icons/duotone-icons/Home/Flower#2.svg +0 -14
  498. package/src/icons/duotone-icons/Home/Flower#3.svg +0 -12
  499. package/src/icons/duotone-icons/Home/Globe.svg +0 -11
  500. package/src/icons/duotone-icons/Home/Home-heart.svg +0 -11
  501. package/src/icons/duotone-icons/Home/Home.svg +0 -10
  502. package/src/icons/duotone-icons/Home/Key.svg +0 -11
  503. package/src/icons/duotone-icons/Home/Ladder.svg +0 -11
  504. package/src/icons/duotone-icons/Home/Lamp#1.svg +0 -13
  505. package/src/icons/duotone-icons/Home/Lamp#2.svg +0 -12
  506. package/src/icons/duotone-icons/Home/Library.svg +0 -11
  507. package/src/icons/duotone-icons/Home/Mailbox.svg +0 -11
  508. package/src/icons/duotone-icons/Home/Mirror.svg +0 -11
  509. package/src/icons/duotone-icons/Home/Picture.svg +0 -13
  510. package/src/icons/duotone-icons/Home/Ruller.svg +0 -10
  511. package/src/icons/duotone-icons/Home/Stairs.svg +0 -10
  512. package/src/icons/duotone-icons/Home/Timer.svg +0 -13
  513. package/src/icons/duotone-icons/Home/Toilet.svg +0 -11
  514. package/src/icons/duotone-icons/Home/Towel.svg +0 -10
  515. package/src/icons/duotone-icons/Home/Trash.svg +0 -11
  516. package/src/icons/duotone-icons/Home/Water-mixer.svg +0 -12
  517. package/src/icons/duotone-icons/Home/Weight#1.svg +0 -11
  518. package/src/icons/duotone-icons/Home/Weight#2.svg +0 -11
  519. package/src/icons/duotone-icons/Home/Wood#1.svg +0 -11
  520. package/src/icons/duotone-icons/Home/Wood#2.svg +0 -11
  521. package/src/icons/duotone-icons/Home/Wood-horse.svg +0 -10
  522. package/src/icons/duotone-icons/Layout/Layout-3d.svg +0 -11
  523. package/src/icons/duotone-icons/Layout/Layout-4-blocks.svg +0 -11
  524. package/src/icons/duotone-icons/Layout/Layout-arrange.inline.svg +0 -11
  525. package/src/icons/duotone-icons/Layout/Layout-grid.svg +0 -11
  526. package/src/icons/duotone-icons/Layout/Layout-horizontal.svg +0 -11
  527. package/src/icons/duotone-icons/Layout/Layout-left-panel-1.svg +0 -11
  528. package/src/icons/duotone-icons/Layout/Layout-left-panel-2.svg +0 -11
  529. package/src/icons/duotone-icons/Layout/Layout-right-panel-1.svg +0 -11
  530. package/src/icons/duotone-icons/Layout/Layout-right-panel-2.svg +0 -11
  531. package/src/icons/duotone-icons/Layout/Layout-top-panel-1.svg +0 -11
  532. package/src/icons/duotone-icons/Layout/Layout-top-panel-2.svg +0 -11
  533. package/src/icons/duotone-icons/Layout/Layout-top-panel-3.svg +0 -11
  534. package/src/icons/duotone-icons/Layout/Layout-top-panel-4.svg +0 -11
  535. package/src/icons/duotone-icons/Layout/Layout-top-panel-5.svg +0 -11
  536. package/src/icons/duotone-icons/Layout/Layout-top-panel-6.svg +0 -11
  537. package/src/icons/duotone-icons/Layout/Layout-vertical.svg +0 -11
  538. package/src/icons/duotone-icons/Map/Compass.svg +0 -10
  539. package/src/icons/duotone-icons/Map/Direction#1.svg +0 -10
  540. package/src/icons/duotone-icons/Map/Direction#2.svg +0 -10
  541. package/src/icons/duotone-icons/Map/Location-arrow.svg +0 -10
  542. package/src/icons/duotone-icons/Map/Marker#1.svg +0 -10
  543. package/src/icons/duotone-icons/Map/Marker#2.svg +0 -10
  544. package/src/icons/duotone-icons/Map/Position.svg +0 -12
  545. package/src/icons/duotone-icons/Media/Add-music.svg +0 -11
  546. package/src/icons/duotone-icons/Media/Airplay-video.svg +0 -11
  547. package/src/icons/duotone-icons/Media/Airplay.svg +0 -11
  548. package/src/icons/duotone-icons/Media/Back.svg +0 -11
  549. package/src/icons/duotone-icons/Media/Backward.svg +0 -11
  550. package/src/icons/duotone-icons/Media/CD.svg +0 -11
  551. package/src/icons/duotone-icons/Media/DVD.svg +0 -11
  552. package/src/icons/duotone-icons/Media/Eject.svg +0 -11
  553. package/src/icons/duotone-icons/Media/Equalizer.svg +0 -13
  554. package/src/icons/duotone-icons/Media/Forward.svg +0 -11
  555. package/src/icons/duotone-icons/Media/Media-library#1.svg +0 -13
  556. package/src/icons/duotone-icons/Media/Media-library#2.svg +0 -11
  557. package/src/icons/duotone-icons/Media/Media-library#3.svg +0 -17
  558. package/src/icons/duotone-icons/Media/Movie-Lane #2.svg +0 -11
  559. package/src/icons/duotone-icons/Media/Movie-lane#1.svg +0 -11
  560. package/src/icons/duotone-icons/Media/Music-cloud.svg +0 -11
  561. package/src/icons/duotone-icons/Media/Music-note.svg +0 -10
  562. package/src/icons/duotone-icons/Media/Music.svg +0 -10
  563. package/src/icons/duotone-icons/Media/Mute.svg +0 -11
  564. package/src/icons/duotone-icons/Media/Next.svg +0 -11
  565. package/src/icons/duotone-icons/Media/Pause.svg +0 -10
  566. package/src/icons/duotone-icons/Media/Play.svg +0 -10
  567. package/src/icons/duotone-icons/Media/Playlist#1.svg +0 -11
  568. package/src/icons/duotone-icons/Media/Playlist#2.svg +0 -11
  569. package/src/icons/duotone-icons/Media/Rec.svg +0 -10
  570. package/src/icons/duotone-icons/Media/Repeat-one.svg +0 -11
  571. package/src/icons/duotone-icons/Media/Repeat.svg +0 -11
  572. package/src/icons/duotone-icons/Media/Shuffle.svg +0 -11
  573. package/src/icons/duotone-icons/Media/Volume-down.svg +0 -11
  574. package/src/icons/duotone-icons/Media/Volume-full.svg +0 -11
  575. package/src/icons/duotone-icons/Media/Volume-half.svg +0 -11
  576. package/src/icons/duotone-icons/Media/Volume-up.svg +0 -11
  577. package/src/icons/duotone-icons/Media/Vynil.svg +0 -11
  578. package/src/icons/duotone-icons/Media/Youtube.svg +0 -11
  579. package/src/icons/duotone-icons/Navigation/Angle-double-down.svg +0 -11
  580. package/src/icons/duotone-icons/Navigation/Angle-double-left.svg +0 -11
  581. package/src/icons/duotone-icons/Navigation/Angle-double-right.svg +0 -11
  582. package/src/icons/duotone-icons/Navigation/Angle-double-up.svg +0 -11
  583. package/src/icons/duotone-icons/Navigation/Angle-down.svg +0 -10
  584. package/src/icons/duotone-icons/Navigation/Angle-left.svg +0 -10
  585. package/src/icons/duotone-icons/Navigation/Angle-right.svg +0 -10
  586. package/src/icons/duotone-icons/Navigation/Angle-up.svg +0 -10
  587. package/src/icons/duotone-icons/Navigation/Arrow-down.svg +0 -11
  588. package/src/icons/duotone-icons/Navigation/Arrow-from-bottom.svg +0 -12
  589. package/src/icons/duotone-icons/Navigation/Arrow-from-left.svg +0 -12
  590. package/src/icons/duotone-icons/Navigation/Arrow-from-right.svg +0 -12
  591. package/src/icons/duotone-icons/Navigation/Arrow-from-top.svg +0 -12
  592. package/src/icons/duotone-icons/Navigation/Arrow-left.svg +0 -11
  593. package/src/icons/duotone-icons/Navigation/Arrow-right.svg +0 -11
  594. package/src/icons/duotone-icons/Navigation/Arrow-to-bottom.svg +0 -12
  595. package/src/icons/duotone-icons/Navigation/Arrow-to-left.svg +0 -12
  596. package/src/icons/duotone-icons/Navigation/Arrow-to-right.svg +0 -12
  597. package/src/icons/duotone-icons/Navigation/Arrow-to-up.svg +0 -12
  598. package/src/icons/duotone-icons/Navigation/Arrow-up.svg +0 -11
  599. package/src/icons/duotone-icons/Navigation/Arrows-h.svg +0 -12
  600. package/src/icons/duotone-icons/Navigation/Arrows-v.svg +0 -12
  601. package/src/icons/duotone-icons/Navigation/Check.svg +0 -10
  602. package/src/icons/duotone-icons/Navigation/Close.svg +0 -12
  603. package/src/icons/duotone-icons/Navigation/Double-check.svg +0 -11
  604. package/src/icons/duotone-icons/Navigation/Down-2.svg +0 -11
  605. package/src/icons/duotone-icons/Navigation/Down-left.svg +0 -11
  606. package/src/icons/duotone-icons/Navigation/Down-right.svg +0 -11
  607. package/src/icons/duotone-icons/Navigation/Exchange.svg +0 -13
  608. package/src/icons/duotone-icons/Navigation/Left 3.svg +0 -11
  609. package/src/icons/duotone-icons/Navigation/Left-2.svg +0 -11
  610. package/src/icons/duotone-icons/Navigation/Minus.svg +0 -9
  611. package/src/icons/duotone-icons/Navigation/Plus.svg +0 -10
  612. package/src/icons/duotone-icons/Navigation/Right 3.svg +0 -11
  613. package/src/icons/duotone-icons/Navigation/Right-2.svg +0 -11
  614. package/src/icons/duotone-icons/Navigation/Route.svg +0 -12
  615. package/src/icons/duotone-icons/Navigation/Sign-in.svg +0 -12
  616. package/src/icons/duotone-icons/Navigation/Sign-out.svg +0 -12
  617. package/src/icons/duotone-icons/Navigation/Up-2.svg +0 -11
  618. package/src/icons/duotone-icons/Navigation/Up-down.svg +0 -13
  619. package/src/icons/duotone-icons/Navigation/Up-left.svg +0 -11
  620. package/src/icons/duotone-icons/Navigation/Up-right.svg +0 -11
  621. package/src/icons/duotone-icons/Navigation/Waiting.svg +0 -10
  622. package/src/icons/duotone-icons/Shopping/ATM.svg +0 -11
  623. package/src/icons/duotone-icons/Shopping/Bag#1.svg +0 -11
  624. package/src/icons/duotone-icons/Shopping/Bag#2.svg +0 -11
  625. package/src/icons/duotone-icons/Shopping/Barcode-read.svg +0 -11
  626. package/src/icons/duotone-icons/Shopping/Barcode-scan.svg +0 -12
  627. package/src/icons/duotone-icons/Shopping/Barcode.svg +0 -11
  628. package/src/icons/duotone-icons/Shopping/Bitcoin.svg +0 -12
  629. package/src/icons/duotone-icons/Shopping/Box#1.svg +0 -11
  630. package/src/icons/duotone-icons/Shopping/Box#3.svg +0 -11
  631. package/src/icons/duotone-icons/Shopping/Box2.inline.svg +0 -11
  632. package/src/icons/duotone-icons/Shopping/Calculator.svg +0 -11
  633. package/src/icons/duotone-icons/Shopping/Cart#1.svg +0 -11
  634. package/src/icons/duotone-icons/Shopping/Cart#2.svg +0 -11
  635. package/src/icons/duotone-icons/Shopping/Cart#3.svg +0 -11
  636. package/src/icons/duotone-icons/Shopping/Chart-bar#1.svg +0 -13
  637. package/src/icons/duotone-icons/Shopping/Chart-bar#2.svg +0 -13
  638. package/src/icons/duotone-icons/Shopping/Chart-bar#3.svg +0 -13
  639. package/src/icons/duotone-icons/Shopping/Chart-line#1.svg +0 -11
  640. package/src/icons/duotone-icons/Shopping/Chart-line#2.svg +0 -11
  641. package/src/icons/duotone-icons/Shopping/Chart-pie.svg +0 -11
  642. package/src/icons/duotone-icons/Shopping/Credit-card.svg +0 -12
  643. package/src/icons/duotone-icons/Shopping/Dollar.svg +0 -12
  644. package/src/icons/duotone-icons/Shopping/Euro.svg +0 -11
  645. package/src/icons/duotone-icons/Shopping/Gift.svg +0 -11
  646. package/src/icons/duotone-icons/Shopping/Loader.svg +0 -12
  647. package/src/icons/duotone-icons/Shopping/MC.svg +0 -11
  648. package/src/icons/duotone-icons/Shopping/Money.svg +0 -11
  649. package/src/icons/duotone-icons/Shopping/Pound.svg +0 -11
  650. package/src/icons/duotone-icons/Shopping/Price #1.svg +0 -10
  651. package/src/icons/duotone-icons/Shopping/Price #2.svg +0 -14
  652. package/src/icons/duotone-icons/Shopping/Rouble.svg +0 -11
  653. package/src/icons/duotone-icons/Shopping/Safe.svg +0 -11
  654. package/src/icons/duotone-icons/Shopping/Sale#1.svg +0 -11
  655. package/src/icons/duotone-icons/Shopping/Sale#2.svg +0 -13
  656. package/src/icons/duotone-icons/Shopping/Settings.svg +0 -11
  657. package/src/icons/duotone-icons/Shopping/Sort#1.svg +0 -11
  658. package/src/icons/duotone-icons/Shopping/Sort#2.svg +0 -10
  659. package/src/icons/duotone-icons/Shopping/Sort#3.svg +0 -10
  660. package/src/icons/duotone-icons/Shopping/Ticket.svg +0 -10
  661. package/src/icons/duotone-icons/Shopping/Wallet#2.svg +0 -11
  662. package/src/icons/duotone-icons/Shopping/Wallet#3.svg +0 -12
  663. package/src/icons/duotone-icons/Shopping/Wallet.svg +0 -12
  664. package/src/icons/duotone-icons/Text/Align-auto.svg +0 -11
  665. package/src/icons/duotone-icons/Text/Align-center.svg +0 -11
  666. package/src/icons/duotone-icons/Text/Align-justify.svg +0 -11
  667. package/src/icons/duotone-icons/Text/Align-left.svg +0 -12
  668. package/src/icons/duotone-icons/Text/Align-right.svg +0 -11
  669. package/src/icons/duotone-icons/Text/Article.svg +0 -11
  670. package/src/icons/duotone-icons/Text/Bold.svg +0 -10
  671. package/src/icons/duotone-icons/Text/Bullet-list.svg +0 -11
  672. package/src/icons/duotone-icons/Text/Code.svg +0 -10
  673. package/src/icons/duotone-icons/Text/Edit-text.svg +0 -11
  674. package/src/icons/duotone-icons/Text/Filter.svg +0 -10
  675. package/src/icons/duotone-icons/Text/Font.svg +0 -11
  676. package/src/icons/duotone-icons/Text/H1.svg +0 -11
  677. package/src/icons/duotone-icons/Text/H2.svg +0 -11
  678. package/src/icons/duotone-icons/Text/Itallic.svg +0 -10
  679. package/src/icons/duotone-icons/Text/Menu.svg +0 -11
  680. package/src/icons/duotone-icons/Text/Paragraph.svg +0 -10
  681. package/src/icons/duotone-icons/Text/Quote#1.svg +0 -11
  682. package/src/icons/duotone-icons/Text/Quote#2.svg +0 -11
  683. package/src/icons/duotone-icons/Text/Redo.svg +0 -10
  684. package/src/icons/duotone-icons/Text/Strikethrough.svg +0 -11
  685. package/src/icons/duotone-icons/Text/Text-height.svg +0 -11
  686. package/src/icons/duotone-icons/Text/Text-width.svg +0 -11
  687. package/src/icons/duotone-icons/Text/Text.svg +0 -10
  688. package/src/icons/duotone-icons/Text/Underline.svg +0 -11
  689. package/src/icons/duotone-icons/Text/Undo.svg +0 -10
  690. package/src/icons/duotone-icons/Tools/Angle Grinder.svg +0 -12
  691. package/src/icons/duotone-icons/Tools/Axe.svg +0 -11
  692. package/src/icons/duotone-icons/Tools/Brush.svg +0 -11
  693. package/src/icons/duotone-icons/Tools/Compass.svg +0 -11
  694. package/src/icons/duotone-icons/Tools/Hummer#2.svg +0 -12
  695. package/src/icons/duotone-icons/Tools/Hummer.svg +0 -11
  696. package/src/icons/duotone-icons/Tools/Pantone.svg +0 -12
  697. package/src/icons/duotone-icons/Tools/Road-Cone.svg +0 -11
  698. package/src/icons/duotone-icons/Tools/Roller.svg +0 -12
  699. package/src/icons/duotone-icons/Tools/Roulette.svg +0 -11
  700. package/src/icons/duotone-icons/Tools/Screwdriver.svg +0 -11
  701. package/src/icons/duotone-icons/Tools/Shovel.svg +0 -11
  702. package/src/icons/duotone-icons/Tools/Spatula.svg +0 -11
  703. package/src/icons/duotone-icons/Tools/Swiss-knife.svg +0 -11
  704. package/src/icons/duotone-icons/Tools/Tools.svg +0 -11
  705. package/src/icons/duotone-icons/Weather/Celcium.svg +0 -11
  706. package/src/icons/duotone-icons/Weather/Cloud#1.svg +0 -10
  707. package/src/icons/duotone-icons/Weather/Cloud#2.svg +0 -11
  708. package/src/icons/duotone-icons/Weather/Cloud-fog.svg +0 -11
  709. package/src/icons/duotone-icons/Weather/Cloud-sun.svg +0 -11
  710. package/src/icons/duotone-icons/Weather/Cloud-wind.svg +0 -12
  711. package/src/icons/duotone-icons/Weather/Cloudy-night.svg +0 -11
  712. package/src/icons/duotone-icons/Weather/Cloudy.svg +0 -11
  713. package/src/icons/duotone-icons/Weather/Day-rain.svg +0 -11
  714. package/src/icons/duotone-icons/Weather/Fahrenheit.svg +0 -11
  715. package/src/icons/duotone-icons/Weather/Fog.svg +0 -15
  716. package/src/icons/duotone-icons/Weather/Moon.svg +0 -10
  717. package/src/icons/duotone-icons/Weather/Night-fog.svg +0 -11
  718. package/src/icons/duotone-icons/Weather/Night-rain.svg +0 -11
  719. package/src/icons/duotone-icons/Weather/Rain#1.svg +0 -11
  720. package/src/icons/duotone-icons/Weather/Rain#2.svg +0 -11
  721. package/src/icons/duotone-icons/Weather/Rain#5.svg +0 -11
  722. package/src/icons/duotone-icons/Weather/Rainbow.svg +0 -12
  723. package/src/icons/duotone-icons/Weather/Snow#1.svg +0 -11
  724. package/src/icons/duotone-icons/Weather/Snow#2.svg +0 -11
  725. package/src/icons/duotone-icons/Weather/Snow#3.svg +0 -11
  726. package/src/icons/duotone-icons/Weather/Snow.svg +0 -11
  727. package/src/icons/duotone-icons/Weather/Storm.svg +0 -11
  728. package/src/icons/duotone-icons/Weather/Sun-fog.svg +0 -11
  729. package/src/icons/duotone-icons/Weather/Sun.svg +0 -11
  730. package/src/icons/duotone-icons/Weather/Suset#1.svg +0 -11
  731. package/src/icons/duotone-icons/Weather/Suset#2.svg +0 -11
  732. package/src/icons/duotone-icons/Weather/Temperature-empty.svg +0 -10
  733. package/src/icons/duotone-icons/Weather/Temperature-full.svg +0 -10
  734. package/src/icons/duotone-icons/Weather/Temperature-half.svg +0 -10
  735. package/src/icons/duotone-icons/Weather/Thunder-night.svg +0 -11
  736. package/src/icons/duotone-icons/Weather/Thunder.svg +0 -11
  737. package/src/icons/duotone-icons/Weather/Umbrella.svg +0 -11
  738. package/src/icons/duotone-icons/Weather/Wind.svg +0 -11
  739. package/src/icons/social/facebook.svg +0 -10
  740. package/src/icons/social/instagram.svg +0 -10
  741. package/src/icons/social/pinterest.svg +0 -3
  742. package/src/icons/social/twitter.svg +0 -10
  743. package/src/implemented-proposals/abi-management.md +0 -161
  744. package/src/implemented-proposals/bank-timestamp-correction.md +0 -77
  745. package/src/implemented-proposals/commitment.md +0 -92
  746. package/src/implemented-proposals/durable-tx-nonces.md +0 -131
  747. package/src/implemented-proposals/ed_overview/ed_economic_sustainability.md +0 -9
  748. package/src/implemented-proposals/ed_overview/ed_mvp.md +0 -24
  749. package/src/implemented-proposals/ed_overview/ed_overview.md +0 -19
  750. package/src/implemented-proposals/ed_overview/ed_references.md +0 -7
  751. package/src/implemented-proposals/ed_overview/ed_storage_rent_economics.md +0 -17
  752. package/src/implemented-proposals/ed_overview/ed_validation_client_economics/ed_vce_overview.md +0 -9
  753. package/src/implemented-proposals/ed_overview/ed_validation_client_economics/ed_vce_state_validation_protocol_based_rewards.md +0 -64
  754. package/src/implemented-proposals/ed_overview/ed_validation_client_economics/ed_vce_state_validation_transaction_fees.md +0 -20
  755. package/src/implemented-proposals/ed_overview/ed_validation_client_economics/ed_vce_validation_stake_delegation.md +0 -28
  756. package/src/implemented-proposals/implemented-proposals.md +0 -9
  757. package/src/implemented-proposals/installer.md +0 -216
  758. package/src/implemented-proposals/instruction_introspection.md +0 -28
  759. package/src/implemented-proposals/leader-leader-transition.md +0 -55
  760. package/src/implemented-proposals/leader-validator-transition.md +0 -52
  761. package/src/implemented-proposals/persistent-account-storage.md +0 -83
  762. package/src/implemented-proposals/readonly-accounts.md +0 -25
  763. package/src/implemented-proposals/reliable-vote-transmission.md +0 -60
  764. package/src/implemented-proposals/rent.md +0 -69
  765. package/src/implemented-proposals/repair-service.md +0 -108
  766. package/src/implemented-proposals/rpc-transaction-history.md +0 -107
  767. package/src/implemented-proposals/snapshot-verification.md +0 -56
  768. package/src/implemented-proposals/staking-rewards.md +0 -33
  769. package/src/implemented-proposals/testing-programs.md +0 -53
  770. package/src/implemented-proposals/tower-bft.md +0 -138
  771. package/src/implemented-proposals/transaction-fees.md +0 -32
  772. package/src/implemented-proposals/validator-timestamp-oracle.md +0 -107
  773. package/src/inflation/adjusted_staking_yield.md +0 -118
  774. package/src/inflation/inflation_schedule.md +0 -40
  775. package/src/inflation/terminology.md +0 -54
  776. package/src/integrations/exchange.md +0 -753
  777. package/src/introduction.md +0 -33
  778. package/src/offline-signing/durable-nonce.md +0 -247
  779. package/src/offline-signing.md +0 -174
  780. package/src/pages/index.js +0 -160
  781. package/src/pages/styles.module.css +0 -41
  782. package/src/proposals/accepted-design-proposals.md +0 -11
  783. package/src/proposals/accounts-db-replication.md +0 -185
  784. package/src/proposals/bankless-leader.md +0 -57
  785. package/src/proposals/block-confirmation.md +0 -85
  786. package/src/proposals/cluster-test-framework.md +0 -102
  787. package/src/proposals/comprehensive-compute-fees.md +0 -164
  788. package/src/proposals/embedding-move.md +0 -37
  789. package/src/proposals/interchain-transaction-verification.md +0 -105
  790. package/src/proposals/ledger-replication-to-implement.md +0 -417
  791. package/src/proposals/log_data.md +0 -146
  792. package/src/proposals/optimistic-confirmation-and-slashing.md +0 -89
  793. package/src/proposals/optimistic-transaction-propagation-signal.md +0 -109
  794. package/src/proposals/optimistic_confirmation.md +0 -408
  795. package/src/proposals/program-instruction-macro.md +0 -226
  796. package/src/proposals/return-data.md +0 -144
  797. package/src/proposals/rip-curl.md +0 -56
  798. package/src/proposals/rust-clients.md +0 -54
  799. package/src/proposals/simple-payment-and-state-verification.md +0 -258
  800. package/src/proposals/slashing.md +0 -60
  801. package/src/proposals/snapshot-verification.md +0 -11
  802. package/src/proposals/tick-verification.md +0 -70
  803. package/src/proposals/transactions-v2.md +0 -334
  804. package/src/proposals/validator-proposal.md +0 -54
  805. package/src/proposals/vote-signing-to-implement.md +0 -116
  806. package/src/running-validator/restart-cluster.md +0 -117
  807. package/src/running-validator/validator-failover.md +0 -146
  808. package/src/running-validator/validator-info.md +0 -64
  809. package/src/running-validator/validator-monitor.md +0 -47
  810. package/src/running-validator/validator-reqs.md +0 -115
  811. package/src/running-validator/validator-stake.md +0 -132
  812. package/src/running-validator/validator-start.md +0 -492
  813. package/src/running-validator/validator-troubleshoot.md +0 -17
  814. package/src/running-validator/vote-accounts.md +0 -219
  815. package/src/running-validator.md +0 -7
  816. package/src/staking/stake-accounts.md +0 -141
  817. package/src/staking/stake-programming.md +0 -27
  818. package/src/staking.md +0 -117
  819. package/src/storage_rent_economics.md +0 -17
  820. package/src/terminology.md +0 -346
  821. package/src/theme/Footer/index.js +0 -126
  822. package/src/theme/Footer/styles.module.css +0 -15
  823. package/src/transaction_fees.md +0 -21
  824. package/src/validator/anatomy.md +0 -13
  825. package/src/validator/blockstore.md +0 -91
  826. package/src/validator/gossip.md +0 -90
  827. package/src/validator/runtime.md +0 -69
  828. package/src/validator/tpu.md +0 -5
  829. package/src/validator/tvu.md +0 -9
  830. package/src/wallet-guide/apps.md +0 -74
  831. package/src/wallet-guide/cli.md +0 -67
  832. package/src/wallet-guide/file-system-wallet.md +0 -65
  833. package/src/wallet-guide/hardware-wallets/ledger.md +0 -219
  834. package/src/wallet-guide/hardware-wallets.md +0 -53
  835. package/src/wallet-guide/ledger-live.md +0 -77
  836. package/src/wallet-guide/paper-wallet.md +0 -203
  837. package/src/wallet-guide/solflare.md +0 -201
  838. package/src/wallet-guide/support.md +0 -16
  839. package/src/wallet-guide/web-wallets.md +0 -52
  840. package/src/wallet-guide.md +0 -63
  841. package/static/.nojekyll +0 -0
  842. package/static/img/favicon.ico +0 -0
  843. package/static/katex/README.md +0 -91
  844. package/static/katex/contrib/auto-render.js +0 -350
  845. package/static/katex/contrib/auto-render.min.js +0 -1
  846. package/static/katex/contrib/auto-render.mjs +0 -226
  847. package/static/katex/contrib/copy-tex.css +0 -13
  848. package/static/katex/contrib/copy-tex.js +0 -213
  849. package/static/katex/contrib/copy-tex.min.css +0 -1
  850. package/static/katex/contrib/copy-tex.min.js +0 -1
  851. package/static/katex/contrib/copy-tex.mjs +0 -85
  852. package/static/katex/contrib/mathtex-script-type.js +0 -137
  853. package/static/katex/contrib/mathtex-script-type.min.js +0 -1
  854. package/static/katex/contrib/mathtex-script-type.mjs +0 -24
  855. package/static/katex/contrib/mhchem.js +0 -3241
  856. package/static/katex/contrib/mhchem.min.js +0 -1
  857. package/static/katex/contrib/mhchem.mjs +0 -3109
  858. package/static/katex/contrib/render-a11y-string.js +0 -870
  859. package/static/katex/contrib/render-a11y-string.min.js +0 -1
  860. package/static/katex/contrib/render-a11y-string.mjs +0 -753
  861. package/static/katex/fonts/KaTeX_AMS-Regular.ttf +0 -0
  862. package/static/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
  863. package/static/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  864. package/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  865. package/static/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  866. package/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  867. package/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  868. package/static/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  869. package/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  870. package/static/katex/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  871. package/static/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  872. package/static/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  873. package/static/katex/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  874. package/static/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  875. package/static/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  876. package/static/katex/fonts/KaTeX_Main-Bold.ttf +0 -0
  877. package/static/katex/fonts/KaTeX_Main-Bold.woff +0 -0
  878. package/static/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  879. package/static/katex/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  880. package/static/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  881. package/static/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  882. package/static/katex/fonts/KaTeX_Main-Italic.ttf +0 -0
  883. package/static/katex/fonts/KaTeX_Main-Italic.woff +0 -0
  884. package/static/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  885. package/static/katex/fonts/KaTeX_Main-Regular.ttf +0 -0
  886. package/static/katex/fonts/KaTeX_Main-Regular.woff +0 -0
  887. package/static/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  888. package/static/katex/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  889. package/static/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  890. package/static/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  891. package/static/katex/fonts/KaTeX_Math-Italic.ttf +0 -0
  892. package/static/katex/fonts/KaTeX_Math-Italic.woff +0 -0
  893. package/static/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  894. package/static/katex/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  895. package/static/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  896. package/static/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  897. package/static/katex/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  898. package/static/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  899. package/static/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  900. package/static/katex/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  901. package/static/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  902. package/static/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  903. package/static/katex/fonts/KaTeX_Script-Regular.ttf +0 -0
  904. package/static/katex/fonts/KaTeX_Script-Regular.woff +0 -0
  905. package/static/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  906. package/static/katex/fonts/KaTeX_Size1-Regular.ttf +0 -0
  907. package/static/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
  908. package/static/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  909. package/static/katex/fonts/KaTeX_Size2-Regular.ttf +0 -0
  910. package/static/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
  911. package/static/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  912. package/static/katex/fonts/KaTeX_Size3-Regular.ttf +0 -0
  913. package/static/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
  914. package/static/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  915. package/static/katex/fonts/KaTeX_Size4-Regular.ttf +0 -0
  916. package/static/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
  917. package/static/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  918. package/static/katex/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  919. package/static/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  920. package/static/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  921. package/static/katex/katex.css +0 -1034
  922. package/static/katex/katex.js +0 -17308
  923. package/static/katex/katex.min.css +0 -1
  924. package/static/katex/katex.min.js +0 -1
  925. package/static/katex/katex.mjs +0 -16911
@@ -1,3109 +0,0 @@
1
- import katex from '../katex.mjs';
2
-
3
- /* eslint-disable */
4
-
5
- /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
6
-
7
- /* vim: set ts=2 et sw=2 tw=80: */
8
-
9
- /*************************************************************
10
- *
11
- * KaTeX mhchem.js
12
- *
13
- * This file implements a KaTeX version of mhchem version 3.3.0.
14
- * It is adapted from MathJax/extensions/TeX/mhchem.js
15
- * It differs from the MathJax version as follows:
16
- * 1. The interface is changed so that it can be called from KaTeX, not MathJax.
17
- * 2. \rlap and \llap are replaced with \mathrlap and \mathllap.
18
- * 3. Four lines of code are edited in order to use \raisebox instead of \raise.
19
- * 4. The reaction arrow code is simplified. All reaction arrows are rendered
20
- * using KaTeX extensible arrows instead of building non-extensible arrows.
21
- * 5. \tripledash vertical alignment is slightly adjusted.
22
- *
23
- * This code, as other KaTeX code, is released under the MIT license.
24
- *
25
- * /*************************************************************
26
- *
27
- * MathJax/extensions/TeX/mhchem.js
28
- *
29
- * Implements the \ce command for handling chemical formulas
30
- * from the mhchem LaTeX package.
31
- *
32
- * ---------------------------------------------------------------------
33
- *
34
- * Copyright (c) 2011-2015 The MathJax Consortium
35
- * Copyright (c) 2015-2018 Martin Hensel
36
- *
37
- * Licensed under the Apache License, Version 2.0 (the "License");
38
- * you may not use this file except in compliance with the License.
39
- * You may obtain a copy of the License at
40
- *
41
- * http://www.apache.org/licenses/LICENSE-2.0
42
- *
43
- * Unless required by applicable law or agreed to in writing, software
44
- * distributed under the License is distributed on an "AS IS" BASIS,
45
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46
- * See the License for the specific language governing permissions and
47
- * limitations under the License.
48
- */
49
- //
50
- // Coding Style
51
- // - use '' for identifiers that can by minified/uglified
52
- // - use "" for strings that need to stay untouched
53
- // version: "3.3.0" for MathJax and KaTeX
54
- // Add \ce, \pu, and \tripledash to the KaTeX macros.
55
- katex.__defineMacro("\\ce", function (context) {
56
- return chemParse(context.consumeArgs(1)[0], "ce");
57
- });
58
-
59
- katex.__defineMacro("\\pu", function (context) {
60
- return chemParse(context.consumeArgs(1)[0], "pu");
61
- }); // Needed for \bond for the ~ forms
62
- // Raise by 2.56mu, not 2mu. We're raising a hyphen-minus, U+002D, not
63
- // a mathematical minus, U+2212. So we need that extra 0.56.
64
-
65
-
66
- katex.__defineMacro("\\tripledash", "{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu" + "\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");
67
- // This is the main function for handing the \ce and \pu commands.
68
- // It takes the argument to \ce or \pu and returns the corresponding TeX string.
69
- //
70
-
71
- var chemParse = function chemParse(tokens, stateMachine) {
72
- // Recreate the argument string from KaTeX's array of tokens.
73
- var str = "";
74
- var expectedLoc = tokens[tokens.length - 1].loc.start;
75
-
76
- for (var i = tokens.length - 1; i >= 0; i--) {
77
- if (tokens[i].loc.start > expectedLoc) {
78
- // context.consumeArgs has eaten a space.
79
- str += " ";
80
- expectedLoc = tokens[i].loc.start;
81
- }
82
-
83
- str += tokens[i].text;
84
- expectedLoc += tokens[i].text.length;
85
- }
86
-
87
- var tex = texify.go(mhchemParser.go(str, stateMachine));
88
- return tex;
89
- }; //
90
- // Core parser for mhchem syntax (recursive)
91
- //
92
-
93
- /** @type {MhchemParser} */
94
-
95
-
96
- var mhchemParser = {
97
- //
98
- // Parses mchem \ce syntax
99
- //
100
- // Call like
101
- // go("H2O");
102
- //
103
- go: function go(input, stateMachine) {
104
- if (!input) {
105
- return [];
106
- }
107
-
108
- if (stateMachine === undefined) {
109
- stateMachine = 'ce';
110
- }
111
-
112
- var state = '0'; //
113
- // String buffers for parsing:
114
- //
115
- // buffer.a == amount
116
- // buffer.o == element
117
- // buffer.b == left-side superscript
118
- // buffer.p == left-side subscript
119
- // buffer.q == right-side subscript
120
- // buffer.d == right-side superscript
121
- //
122
- // buffer.r == arrow
123
- // buffer.rdt == arrow, script above, type
124
- // buffer.rd == arrow, script above, content
125
- // buffer.rqt == arrow, script below, type
126
- // buffer.rq == arrow, script below, content
127
- //
128
- // buffer.text_
129
- // buffer.rm
130
- // etc.
131
- //
132
- // buffer.parenthesisLevel == int, starting at 0
133
- // buffer.sb == bool, space before
134
- // buffer.beginsWithBond == bool
135
- //
136
- // These letters are also used as state names.
137
- //
138
- // Other states:
139
- // 0 == begin of main part (arrow/operator unlikely)
140
- // 1 == next entity
141
- // 2 == next entity (arrow/operator unlikely)
142
- // 3 == next atom
143
- // c == macro
144
- //
145
-
146
- /** @type {Buffer} */
147
-
148
- var buffer = {};
149
- buffer['parenthesisLevel'] = 0;
150
- input = input.replace(/\n/g, " ");
151
- input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
152
- input = input.replace(/[\u2026]/g, "..."); //
153
- // Looks through mhchemParser.transitions, to execute a matching action
154
- // (recursive)
155
- //
156
-
157
- var lastInput;
158
- var watchdog = 10;
159
- /** @type {ParserOutput[]} */
160
-
161
- var output = [];
162
-
163
- while (true) {
164
- if (lastInput !== input) {
165
- watchdog = 10;
166
- lastInput = input;
167
- } else {
168
- watchdog--;
169
- } //
170
- // Find actions in transition table
171
- //
172
-
173
-
174
- var machine = mhchemParser.stateMachines[stateMachine];
175
- var t = machine.transitions[state] || machine.transitions['*'];
176
-
177
- iterateTransitions: for (var i = 0; i < t.length; i++) {
178
- var matches = mhchemParser.patterns.match_(t[i].pattern, input);
179
-
180
- if (matches) {
181
- //
182
- // Execute actions
183
- //
184
- var task = t[i].task;
185
-
186
- for (var iA = 0; iA < task.action_.length; iA++) {
187
- var o; //
188
- // Find and execute action
189
- //
190
-
191
- if (machine.actions[task.action_[iA].type_]) {
192
- o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
193
- } else if (mhchemParser.actions[task.action_[iA].type_]) {
194
- o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
195
- } else {
196
- throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"]; // Trying to use non-existing action
197
- } //
198
- // Add output
199
- //
200
-
201
-
202
- mhchemParser.concatArray(output, o);
203
- } //
204
- // Set next state,
205
- // Shorten input,
206
- // Continue with next character
207
- // (= apply only one transition per position)
208
- //
209
-
210
-
211
- state = task.nextState || state;
212
-
213
- if (input.length > 0) {
214
- if (!task.revisit) {
215
- input = matches.remainder;
216
- }
217
-
218
- if (!task.toContinue) {
219
- break iterateTransitions;
220
- }
221
- } else {
222
- return output;
223
- }
224
- }
225
- } //
226
- // Prevent infinite loop
227
- //
228
-
229
-
230
- if (watchdog <= 0) {
231
- throw ["MhchemBugU", "mhchem bug U. Please report."]; // Unexpected character
232
- }
233
- }
234
- },
235
- concatArray: function concatArray(a, b) {
236
- if (b) {
237
- if (Array.isArray(b)) {
238
- for (var iB = 0; iB < b.length; iB++) {
239
- a.push(b[iB]);
240
- }
241
- } else {
242
- a.push(b);
243
- }
244
- }
245
- },
246
- patterns: {
247
- //
248
- // Matching patterns
249
- // either regexps or function that return null or {match_:"a", remainder:"bc"}
250
- //
251
- patterns: {
252
- // property names must not look like integers ("2") for correct property traversal order, later on
253
- 'empty': /^$/,
254
- 'else': /^./,
255
- 'else2': /^./,
256
- 'space': /^\s/,
257
- 'space A': /^\s(?=[A-Z\\$])/,
258
- 'space$': /^\s$/,
259
- 'a-z': /^[a-z]/,
260
- 'x': /^x/,
261
- 'x$': /^x$/,
262
- 'i$': /^i$/,
263
- '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]))))+/,
264
- '\\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]))/,
265
- 'one lowercase latin letter $': /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
266
- '$one lowercase latin letter$ $': /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
267
- '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]))$/,
268
- 'digits': /^[0-9]+/,
269
- '-9.,9': /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
270
- '-9.,9 no missing 0': /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
271
- '(-)(9.,9)(e)(99)': function e99(input) {
272
- 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]+\}))?/);
273
-
274
- if (m && m[0]) {
275
- return {
276
- match_: m.splice(1),
277
- remainder: input.substr(m[0].length)
278
- };
279
- }
280
-
281
- return null;
282
- },
283
- '(-)(9)^(-9)': function _(input) {
284
- var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);
285
-
286
- if (m && m[0]) {
287
- return {
288
- match_: m.splice(1),
289
- remainder: input.substr(m[0].length)
290
- };
291
- }
292
-
293
- return null;
294
- },
295
- 'state of aggregation $': function stateOfAggregation$(input) {
296
- // ... or crystal system
297
- var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", ""); // (aq), (aq,$\infty$), (aq, sat)
298
-
299
- if (a && a.remainder.match(/^($|[\s,;\)\]\}])/)) {
300
- return a;
301
- } // AND end of 'phrase'
302
-
303
-
304
- var m = input.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/); // OR crystal system ($o$) (\ca$c$)
305
-
306
- if (m) {
307
- return {
308
- match_: m[0],
309
- remainder: input.substr(m[0].length)
310
- };
311
- }
312
-
313
- return null;
314
- },
315
- '_{(state of aggregation)}$': /^_\{(\([a-z]{1,3}\))\}/,
316
- '{[(': /^(?:\\\{|\[|\()/,
317
- ')]}': /^(?:\)|\]|\\\})/,
318
- ', ': /^[,;]\s*/,
319
- ',': /^[,;]/,
320
- '.': /^[.]/,
321
- '. ': /^([.\u22C5\u00B7\u2022])\s*/,
322
- '...': /^\.\.\.(?=$|[^.])/,
323
- '* ': /^([*])\s*/,
324
- '^{(...)}': function _(input) {
325
- return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}");
326
- },
327
- '^($...$)': function $$(input) {
328
- return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", "");
329
- },
330
- '^a': /^\^([0-9]+|[^\\_])/,
331
- '^\\x{}{}': function x(input) {
332
- return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
333
- },
334
- '^\\x{}': function x(input) {
335
- return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "");
336
- },
337
- '^\\x': /^\^(\\[a-zA-Z]+)\s*/,
338
- '^(-1)': /^\^(-?\d+)/,
339
- '\'': /^'/,
340
- '_{(...)}': function _(input) {
341
- return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}");
342
- },
343
- '_($...$)': function _$$(input) {
344
- return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", "");
345
- },
346
- '_9': /^_([+\-]?[0-9]+|[^\\])/,
347
- '_\\x{}{}': function _X(input) {
348
- return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
349
- },
350
- '_\\x{}': function _X(input) {
351
- return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "");
352
- },
353
- '_\\x': /^_(\\[a-zA-Z]+)\s*/,
354
- '^_': /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
355
- '{}': /^\{\}/,
356
- '{...}': function _(input) {
357
- return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", "");
358
- },
359
- '{(...)}': function _(input) {
360
- return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}");
361
- },
362
- '$...$': function $$(input) {
363
- return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
364
- },
365
- '${(...)}$': function $$(input) {
366
- return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$");
367
- },
368
- '$(...)$': function $$(input) {
369
- return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$");
370
- },
371
- '=<>': /^[=<>]/,
372
- '#': /^[#\u2261]/,
373
- '+': /^\+/,
374
- '-$': /^-(?=[\s_},;\]/]|$|\([a-z]+\))/,
375
- // -space -, -; -] -/ -$ -state-of-aggregation
376
- '-9': /^-(?=[0-9])/,
377
- '- orbital overlap': /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
378
- '-': /^-/,
379
- 'pm-operator': /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
380
- 'operator': /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
381
- 'arrowUpDown': /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
382
- '\\bond{(...)}': function bond(input) {
383
- return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}");
384
- },
385
- '->': /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
386
- 'CMT': /^[CMT](?=\[)/,
387
- '[(...)]': function _(input) {
388
- return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]");
389
- },
390
- '1st-level escape': /^(&|\\\\|\\hline)\s*/,
391
- '\\,': /^(?:\\[,\ ;:])/,
392
- // \\x - but output no space before
393
- '\\x{}{}': function x(input) {
394
- return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
395
- },
396
- '\\x{}': function x(input) {
397
- return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "");
398
- },
399
- '\\ca': /^\\ca(?:\s+|(?![a-zA-Z]))/,
400
- '\\x': /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
401
- 'orbital': /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,
402
- // only those with numbers in front, because the others will be formatted correctly anyway
403
- 'others': /^[\/~|]/,
404
- '\\frac{(...)}': function frac(input) {
405
- return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}");
406
- },
407
- '\\overset{(...)}': function overset(input) {
408
- return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}");
409
- },
410
- '\\underset{(...)}': function underset(input) {
411
- return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}");
412
- },
413
- '\\underbrace{(...)}': function underbrace(input) {
414
- return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}");
415
- },
416
- '\\color{(...)}0': function color0(input) {
417
- return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}");
418
- },
419
- '\\color{(...)}{(...)}1': function color1(input) {
420
- return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}");
421
- },
422
- '\\color(...){(...)}2': function color2(input) {
423
- return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}");
424
- },
425
- '\\ce{(...)}': function ce(input) {
426
- return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}");
427
- },
428
- 'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
429
- 'd-oxidation$': /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
430
- // 0 could be oxidation or charge
431
- 'roman numeral': /^[IVX]+/,
432
- '1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
433
- 'amount': function amount(input) {
434
- var match; // e.g. 2, 0.5, 1/2, -2, n/2, +; $a$ could be added later in parsing
435
-
436
- 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))/);
437
-
438
- if (match) {
439
- return {
440
- match_: match[0],
441
- remainder: input.substr(match[0].length)
442
- };
443
- }
444
-
445
- var a = mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
446
-
447
- if (a) {
448
- // e.g. $2n-1$, $-$
449
- match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
450
-
451
- if (match) {
452
- return {
453
- match_: match[0],
454
- remainder: input.substr(match[0].length)
455
- };
456
- }
457
- }
458
-
459
- return null;
460
- },
461
- 'amount2': function amount2(input) {
462
- return this['amount'](input);
463
- },
464
- '(KV letters),': /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
465
- 'formula$': function formula$(input) {
466
- if (input.match(/^\([a-z]+\)$/)) {
467
- return null;
468
- } // state of aggregation = no formula
469
-
470
-
471
- var match = input.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
472
-
473
- if (match) {
474
- return {
475
- match_: match[0],
476
- remainder: input.substr(match[0].length)
477
- };
478
- }
479
-
480
- return null;
481
- },
482
- 'uprightEntities': /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
483
- '/': /^\s*(\/)\s*/,
484
- '//': /^\s*(\/\/)\s*/,
485
- '*': /^\s*[*.]\s*/
486
- },
487
- findObserveGroups: function findObserveGroups(input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
488
- /** @type {{(input: string, pattern: string | RegExp): string | string[] | null;}} */
489
- var _match = function _match(input, pattern) {
490
- if (typeof pattern === "string") {
491
- if (input.indexOf(pattern) !== 0) {
492
- return null;
493
- }
494
-
495
- return pattern;
496
- } else {
497
- var match = input.match(pattern);
498
-
499
- if (!match) {
500
- return null;
501
- }
502
-
503
- return match[0];
504
- }
505
- };
506
- /** @type {{(input: string, i: number, endChars: string | RegExp): {endMatchBegin: number, endMatchEnd: number} | null;}} */
507
-
508
-
509
- var _findObserveGroups = function _findObserveGroups(input, i, endChars) {
510
- var braces = 0;
511
-
512
- while (i < input.length) {
513
- var a = input.charAt(i);
514
-
515
- var match = _match(input.substr(i), endChars);
516
-
517
- if (match !== null && braces === 0) {
518
- return {
519
- endMatchBegin: i,
520
- endMatchEnd: i + match.length
521
- };
522
- } else if (a === "{") {
523
- braces++;
524
- } else if (a === "}") {
525
- if (braces === 0) {
526
- throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
527
- } else {
528
- braces--;
529
- }
530
- }
531
-
532
- i++;
533
- }
534
-
535
- if (braces > 0) {
536
- return null;
537
- }
538
-
539
- return null;
540
- };
541
-
542
- var match = _match(input, begExcl);
543
-
544
- if (match === null) {
545
- return null;
546
- }
547
-
548
- input = input.substr(match.length);
549
- match = _match(input, begIncl);
550
-
551
- if (match === null) {
552
- return null;
553
- }
554
-
555
- var e = _findObserveGroups(input, match.length, endIncl || endExcl);
556
-
557
- if (e === null) {
558
- return null;
559
- }
560
-
561
- var match1 = input.substring(0, endIncl ? e.endMatchEnd : e.endMatchBegin);
562
-
563
- if (!(beg2Excl || beg2Incl)) {
564
- return {
565
- match_: match1,
566
- remainder: input.substr(e.endMatchEnd)
567
- };
568
- } else {
569
- var group2 = this.findObserveGroups(input.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
570
-
571
- if (group2 === null) {
572
- return null;
573
- }
574
- /** @type {string[]} */
575
-
576
-
577
- var matchRet = [match1, group2.match_];
578
- return {
579
- match_: combine ? matchRet.join("") : matchRet,
580
- remainder: group2.remainder
581
- };
582
- }
583
- },
584
- //
585
- // Matching function
586
- // e.g. match("a", input) will look for the regexp called "a" and see if it matches
587
- // returns null or {match_:"a", remainder:"bc"}
588
- //
589
- match_: function match_(m, input) {
590
- var pattern = mhchemParser.patterns.patterns[m];
591
-
592
- if (pattern === undefined) {
593
- throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"]; // Trying to use non-existing pattern
594
- } else if (typeof pattern === "function") {
595
- return mhchemParser.patterns.patterns[m](input); // cannot use cached var pattern here, because some pattern functions need this===mhchemParser
596
- } else {
597
- // RegExp
598
- var match = input.match(pattern);
599
-
600
- if (match) {
601
- var mm;
602
-
603
- if (match[2]) {
604
- mm = [match[1], match[2]];
605
- } else if (match[1]) {
606
- mm = match[1];
607
- } else {
608
- mm = match[0];
609
- }
610
-
611
- return {
612
- match_: mm,
613
- remainder: input.substr(match[0].length)
614
- };
615
- }
616
-
617
- return null;
618
- }
619
- }
620
- },
621
- //
622
- // Generic state machine actions
623
- //
624
- actions: {
625
- 'a=': function a(buffer, m) {
626
- buffer.a = (buffer.a || "") + m;
627
- },
628
- 'b=': function b(buffer, m) {
629
- buffer.b = (buffer.b || "") + m;
630
- },
631
- 'p=': function p(buffer, m) {
632
- buffer.p = (buffer.p || "") + m;
633
- },
634
- 'o=': function o(buffer, m) {
635
- buffer.o = (buffer.o || "") + m;
636
- },
637
- 'q=': function q(buffer, m) {
638
- buffer.q = (buffer.q || "") + m;
639
- },
640
- 'd=': function d(buffer, m) {
641
- buffer.d = (buffer.d || "") + m;
642
- },
643
- 'rm=': function rm(buffer, m) {
644
- buffer.rm = (buffer.rm || "") + m;
645
- },
646
- 'text=': function text(buffer, m) {
647
- buffer.text_ = (buffer.text_ || "") + m;
648
- },
649
- 'insert': function insert(buffer, m, a) {
650
- return {
651
- type_: a
652
- };
653
- },
654
- 'insert+p1': function insertP1(buffer, m, a) {
655
- return {
656
- type_: a,
657
- p1: m
658
- };
659
- },
660
- 'insert+p1+p2': function insertP1P2(buffer, m, a) {
661
- return {
662
- type_: a,
663
- p1: m[0],
664
- p2: m[1]
665
- };
666
- },
667
- 'copy': function copy(buffer, m) {
668
- return m;
669
- },
670
- 'rm': function rm(buffer, m) {
671
- return {
672
- type_: 'rm',
673
- p1: m || ""
674
- };
675
- },
676
- 'text': function text(buffer, m) {
677
- return mhchemParser.go(m, 'text');
678
- },
679
- '{text}': function text(buffer, m) {
680
- var ret = ["{"];
681
- mhchemParser.concatArray(ret, mhchemParser.go(m, 'text'));
682
- ret.push("}");
683
- return ret;
684
- },
685
- 'tex-math': function texMath(buffer, m) {
686
- return mhchemParser.go(m, 'tex-math');
687
- },
688
- 'tex-math tight': function texMathTight(buffer, m) {
689
- return mhchemParser.go(m, 'tex-math tight');
690
- },
691
- 'bond': function bond(buffer, m, k) {
692
- return {
693
- type_: 'bond',
694
- kind_: k || m
695
- };
696
- },
697
- 'color0-output': function color0Output(buffer, m) {
698
- return {
699
- type_: 'color0',
700
- color: m[0]
701
- };
702
- },
703
- 'ce': function ce(buffer, m) {
704
- return mhchemParser.go(m);
705
- },
706
- '1/2': function _(buffer, m) {
707
- /** @type {ParserOutput[]} */
708
- var ret = [];
709
-
710
- if (m.match(/^[+\-]/)) {
711
- ret.push(m.substr(0, 1));
712
- m = m.substr(1);
713
- }
714
-
715
- var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
716
- n[1] = n[1].replace(/\$/g, "");
717
- ret.push({
718
- type_: 'frac',
719
- p1: n[1],
720
- p2: n[2]
721
- });
722
-
723
- if (n[3]) {
724
- n[3] = n[3].replace(/\$/g, "");
725
- ret.push({
726
- type_: 'tex-math',
727
- p1: n[3]
728
- });
729
- }
730
-
731
- return ret;
732
- },
733
- '9,9': function _(buffer, m) {
734
- return mhchemParser.go(m, '9,9');
735
- }
736
- },
737
- //
738
- // createTransitions
739
- // convert { 'letter': { 'state': { action_: 'output' } } } to { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] }
740
- // with expansion of 'a|b' to 'a' and 'b' (at 2 places)
741
- //
742
- createTransitions: function createTransitions(o) {
743
- var pattern, state;
744
- /** @type {string[]} */
745
-
746
- var stateArray;
747
- var i; //
748
- // 1. Collect all states
749
- //
750
-
751
- /** @type {Transitions} */
752
-
753
- var transitions = {};
754
-
755
- for (pattern in o) {
756
- for (state in o[pattern]) {
757
- stateArray = state.split("|");
758
- o[pattern][state].stateArray = stateArray;
759
-
760
- for (i = 0; i < stateArray.length; i++) {
761
- transitions[stateArray[i]] = [];
762
- }
763
- }
764
- } //
765
- // 2. Fill states
766
- //
767
-
768
-
769
- for (pattern in o) {
770
- for (state in o[pattern]) {
771
- stateArray = o[pattern][state].stateArray || [];
772
-
773
- for (i = 0; i < stateArray.length; i++) {
774
- //
775
- // 2a. Normalize actions into array: 'text=' ==> [{type_:'text='}]
776
- // (Note to myself: Resolving the function here would be problematic. It would need .bind (for *this*) and currying (for *option*).)
777
- //
778
-
779
- /** @type {any} */
780
- var p = o[pattern][state];
781
-
782
- if (p.action_) {
783
- p.action_ = [].concat(p.action_);
784
-
785
- for (var k = 0; k < p.action_.length; k++) {
786
- if (typeof p.action_[k] === "string") {
787
- p.action_[k] = {
788
- type_: p.action_[k]
789
- };
790
- }
791
- }
792
- } else {
793
- p.action_ = [];
794
- } //
795
- // 2.b Multi-insert
796
- //
797
-
798
-
799
- var patternArray = pattern.split("|");
800
-
801
- for (var j = 0; j < patternArray.length; j++) {
802
- if (stateArray[i] === '*') {
803
- // insert into all
804
- for (var t in transitions) {
805
- transitions[t].push({
806
- pattern: patternArray[j],
807
- task: p
808
- });
809
- }
810
- } else {
811
- transitions[stateArray[i]].push({
812
- pattern: patternArray[j],
813
- task: p
814
- });
815
- }
816
- }
817
- }
818
- }
819
- }
820
-
821
- return transitions;
822
- },
823
- stateMachines: {}
824
- }; //
825
- // Definition of state machines
826
- //
827
-
828
- mhchemParser.stateMachines = {
829
- //
830
- // \ce state machines
831
- //
832
- //#region ce
833
- 'ce': {
834
- // main parser
835
- transitions: mhchemParser.createTransitions({
836
- 'empty': {
837
- '*': {
838
- action_: 'output'
839
- }
840
- },
841
- 'else': {
842
- '0|1|2': {
843
- action_: 'beginsWithBond=false',
844
- revisit: true,
845
- toContinue: true
846
- }
847
- },
848
- 'oxidation$': {
849
- '0': {
850
- action_: 'oxidation-output'
851
- }
852
- },
853
- 'CMT': {
854
- 'r': {
855
- action_: 'rdt=',
856
- nextState: 'rt'
857
- },
858
- 'rd': {
859
- action_: 'rqt=',
860
- nextState: 'rdt'
861
- }
862
- },
863
- 'arrowUpDown': {
864
- '0|1|2|as': {
865
- action_: ['sb=false', 'output', 'operator'],
866
- nextState: '1'
867
- }
868
- },
869
- 'uprightEntities': {
870
- '0|1|2': {
871
- action_: ['o=', 'output'],
872
- nextState: '1'
873
- }
874
- },
875
- 'orbital': {
876
- '0|1|2|3': {
877
- action_: 'o=',
878
- nextState: 'o'
879
- }
880
- },
881
- '->': {
882
- '0|1|2|3': {
883
- action_: 'r=',
884
- nextState: 'r'
885
- },
886
- 'a|as': {
887
- action_: ['output', 'r='],
888
- nextState: 'r'
889
- },
890
- '*': {
891
- action_: ['output', 'r='],
892
- nextState: 'r'
893
- }
894
- },
895
- '+': {
896
- 'o': {
897
- action_: 'd= kv',
898
- nextState: 'd'
899
- },
900
- 'd|D': {
901
- action_: 'd=',
902
- nextState: 'd'
903
- },
904
- 'q': {
905
- action_: 'd=',
906
- nextState: 'qd'
907
- },
908
- 'qd|qD': {
909
- action_: 'd=',
910
- nextState: 'qd'
911
- },
912
- 'dq': {
913
- action_: ['output', 'd='],
914
- nextState: 'd'
915
- },
916
- '3': {
917
- action_: ['sb=false', 'output', 'operator'],
918
- nextState: '0'
919
- }
920
- },
921
- 'amount': {
922
- '0|2': {
923
- action_: 'a=',
924
- nextState: 'a'
925
- }
926
- },
927
- 'pm-operator': {
928
- '0|1|2|a|as': {
929
- action_: ['sb=false', 'output', {
930
- type_: 'operator',
931
- option: '\\pm'
932
- }],
933
- nextState: '0'
934
- }
935
- },
936
- 'operator': {
937
- '0|1|2|a|as': {
938
- action_: ['sb=false', 'output', 'operator'],
939
- nextState: '0'
940
- }
941
- },
942
- '-$': {
943
- 'o|q': {
944
- action_: ['charge or bond', 'output'],
945
- nextState: 'qd'
946
- },
947
- 'd': {
948
- action_: 'd=',
949
- nextState: 'd'
950
- },
951
- 'D': {
952
- action_: ['output', {
953
- type_: 'bond',
954
- option: "-"
955
- }],
956
- nextState: '3'
957
- },
958
- 'q': {
959
- action_: 'd=',
960
- nextState: 'qd'
961
- },
962
- 'qd': {
963
- action_: 'd=',
964
- nextState: 'qd'
965
- },
966
- 'qD|dq': {
967
- action_: ['output', {
968
- type_: 'bond',
969
- option: "-"
970
- }],
971
- nextState: '3'
972
- }
973
- },
974
- '-9': {
975
- '3|o': {
976
- action_: ['output', {
977
- type_: 'insert',
978
- option: 'hyphen'
979
- }],
980
- nextState: '3'
981
- }
982
- },
983
- '- orbital overlap': {
984
- 'o': {
985
- action_: ['output', {
986
- type_: 'insert',
987
- option: 'hyphen'
988
- }],
989
- nextState: '2'
990
- },
991
- 'd': {
992
- action_: ['output', {
993
- type_: 'insert',
994
- option: 'hyphen'
995
- }],
996
- nextState: '2'
997
- }
998
- },
999
- '-': {
1000
- '0|1|2': {
1001
- action_: [{
1002
- type_: 'output',
1003
- option: 1
1004
- }, 'beginsWithBond=true', {
1005
- type_: 'bond',
1006
- option: "-"
1007
- }],
1008
- nextState: '3'
1009
- },
1010
- '3': {
1011
- action_: {
1012
- type_: 'bond',
1013
- option: "-"
1014
- }
1015
- },
1016
- 'a': {
1017
- action_: ['output', {
1018
- type_: 'insert',
1019
- option: 'hyphen'
1020
- }],
1021
- nextState: '2'
1022
- },
1023
- 'as': {
1024
- action_: [{
1025
- type_: 'output',
1026
- option: 2
1027
- }, {
1028
- type_: 'bond',
1029
- option: "-"
1030
- }],
1031
- nextState: '3'
1032
- },
1033
- 'b': {
1034
- action_: 'b='
1035
- },
1036
- 'o': {
1037
- action_: {
1038
- type_: '- after o/d',
1039
- option: false
1040
- },
1041
- nextState: '2'
1042
- },
1043
- 'q': {
1044
- action_: {
1045
- type_: '- after o/d',
1046
- option: false
1047
- },
1048
- nextState: '2'
1049
- },
1050
- 'd|qd|dq': {
1051
- action_: {
1052
- type_: '- after o/d',
1053
- option: true
1054
- },
1055
- nextState: '2'
1056
- },
1057
- 'D|qD|p': {
1058
- action_: ['output', {
1059
- type_: 'bond',
1060
- option: "-"
1061
- }],
1062
- nextState: '3'
1063
- }
1064
- },
1065
- 'amount2': {
1066
- '1|3': {
1067
- action_: 'a=',
1068
- nextState: 'a'
1069
- }
1070
- },
1071
- 'letters': {
1072
- '0|1|2|3|a|as|b|p|bp|o': {
1073
- action_: 'o=',
1074
- nextState: 'o'
1075
- },
1076
- 'q|dq': {
1077
- action_: ['output', 'o='],
1078
- nextState: 'o'
1079
- },
1080
- 'd|D|qd|qD': {
1081
- action_: 'o after d',
1082
- nextState: 'o'
1083
- }
1084
- },
1085
- 'digits': {
1086
- 'o': {
1087
- action_: 'q=',
1088
- nextState: 'q'
1089
- },
1090
- 'd|D': {
1091
- action_: 'q=',
1092
- nextState: 'dq'
1093
- },
1094
- 'q': {
1095
- action_: ['output', 'o='],
1096
- nextState: 'o'
1097
- },
1098
- 'a': {
1099
- action_: 'o=',
1100
- nextState: 'o'
1101
- }
1102
- },
1103
- 'space A': {
1104
- 'b|p|bp': {}
1105
- },
1106
- 'space': {
1107
- 'a': {
1108
- nextState: 'as'
1109
- },
1110
- '0': {
1111
- action_: 'sb=false'
1112
- },
1113
- '1|2': {
1114
- action_: 'sb=true'
1115
- },
1116
- 'r|rt|rd|rdt|rdq': {
1117
- action_: 'output',
1118
- nextState: '0'
1119
- },
1120
- '*': {
1121
- action_: ['output', 'sb=true'],
1122
- nextState: '1'
1123
- }
1124
- },
1125
- '1st-level escape': {
1126
- '1|2': {
1127
- action_: ['output', {
1128
- type_: 'insert+p1',
1129
- option: '1st-level escape'
1130
- }]
1131
- },
1132
- '*': {
1133
- action_: ['output', {
1134
- type_: 'insert+p1',
1135
- option: '1st-level escape'
1136
- }],
1137
- nextState: '0'
1138
- }
1139
- },
1140
- '[(...)]': {
1141
- 'r|rt': {
1142
- action_: 'rd=',
1143
- nextState: 'rd'
1144
- },
1145
- 'rd|rdt': {
1146
- action_: 'rq=',
1147
- nextState: 'rdq'
1148
- }
1149
- },
1150
- '...': {
1151
- 'o|d|D|dq|qd|qD': {
1152
- action_: ['output', {
1153
- type_: 'bond',
1154
- option: "..."
1155
- }],
1156
- nextState: '3'
1157
- },
1158
- '*': {
1159
- action_: [{
1160
- type_: 'output',
1161
- option: 1
1162
- }, {
1163
- type_: 'insert',
1164
- option: 'ellipsis'
1165
- }],
1166
- nextState: '1'
1167
- }
1168
- },
1169
- '. |* ': {
1170
- '*': {
1171
- action_: ['output', {
1172
- type_: 'insert',
1173
- option: 'addition compound'
1174
- }],
1175
- nextState: '1'
1176
- }
1177
- },
1178
- 'state of aggregation $': {
1179
- '*': {
1180
- action_: ['output', 'state of aggregation'],
1181
- nextState: '1'
1182
- }
1183
- },
1184
- '{[(': {
1185
- 'a|as|o': {
1186
- action_: ['o=', 'output', 'parenthesisLevel++'],
1187
- nextState: '2'
1188
- },
1189
- '0|1|2|3': {
1190
- action_: ['o=', 'output', 'parenthesisLevel++'],
1191
- nextState: '2'
1192
- },
1193
- '*': {
1194
- action_: ['output', 'o=', 'output', 'parenthesisLevel++'],
1195
- nextState: '2'
1196
- }
1197
- },
1198
- ')]}': {
1199
- '0|1|2|3|b|p|bp|o': {
1200
- action_: ['o=', 'parenthesisLevel--'],
1201
- nextState: 'o'
1202
- },
1203
- 'a|as|d|D|q|qd|qD|dq': {
1204
- action_: ['output', 'o=', 'parenthesisLevel--'],
1205
- nextState: 'o'
1206
- }
1207
- },
1208
- ', ': {
1209
- '*': {
1210
- action_: ['output', 'comma'],
1211
- nextState: '0'
1212
- }
1213
- },
1214
- '^_': {
1215
- // ^ and _ without a sensible argument
1216
- '*': {}
1217
- },
1218
- '^{(...)}|^($...$)': {
1219
- '0|1|2|as': {
1220
- action_: 'b=',
1221
- nextState: 'b'
1222
- },
1223
- 'p': {
1224
- action_: 'b=',
1225
- nextState: 'bp'
1226
- },
1227
- '3|o': {
1228
- action_: 'd= kv',
1229
- nextState: 'D'
1230
- },
1231
- 'q': {
1232
- action_: 'd=',
1233
- nextState: 'qD'
1234
- },
1235
- 'd|D|qd|qD|dq': {
1236
- action_: ['output', 'd='],
1237
- nextState: 'D'
1238
- }
1239
- },
1240
- '^a|^\\x{}{}|^\\x{}|^\\x|\'': {
1241
- '0|1|2|as': {
1242
- action_: 'b=',
1243
- nextState: 'b'
1244
- },
1245
- 'p': {
1246
- action_: 'b=',
1247
- nextState: 'bp'
1248
- },
1249
- '3|o': {
1250
- action_: 'd= kv',
1251
- nextState: 'd'
1252
- },
1253
- 'q': {
1254
- action_: 'd=',
1255
- nextState: 'qd'
1256
- },
1257
- 'd|qd|D|qD': {
1258
- action_: 'd='
1259
- },
1260
- 'dq': {
1261
- action_: ['output', 'd='],
1262
- nextState: 'd'
1263
- }
1264
- },
1265
- '_{(state of aggregation)}$': {
1266
- 'd|D|q|qd|qD|dq': {
1267
- action_: ['output', 'q='],
1268
- nextState: 'q'
1269
- }
1270
- },
1271
- '_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x': {
1272
- '0|1|2|as': {
1273
- action_: 'p=',
1274
- nextState: 'p'
1275
- },
1276
- 'b': {
1277
- action_: 'p=',
1278
- nextState: 'bp'
1279
- },
1280
- '3|o': {
1281
- action_: 'q=',
1282
- nextState: 'q'
1283
- },
1284
- 'd|D': {
1285
- action_: 'q=',
1286
- nextState: 'dq'
1287
- },
1288
- 'q|qd|qD|dq': {
1289
- action_: ['output', 'q='],
1290
- nextState: 'q'
1291
- }
1292
- },
1293
- '=<>': {
1294
- '0|1|2|3|a|as|o|q|d|D|qd|qD|dq': {
1295
- action_: [{
1296
- type_: 'output',
1297
- option: 2
1298
- }, 'bond'],
1299
- nextState: '3'
1300
- }
1301
- },
1302
- '#': {
1303
- '0|1|2|3|a|as|o': {
1304
- action_: [{
1305
- type_: 'output',
1306
- option: 2
1307
- }, {
1308
- type_: 'bond',
1309
- option: "#"
1310
- }],
1311
- nextState: '3'
1312
- }
1313
- },
1314
- '{}': {
1315
- '*': {
1316
- action_: {
1317
- type_: 'output',
1318
- option: 1
1319
- },
1320
- nextState: '1'
1321
- }
1322
- },
1323
- '{...}': {
1324
- '0|1|2|3|a|as|b|p|bp': {
1325
- action_: 'o=',
1326
- nextState: 'o'
1327
- },
1328
- 'o|d|D|q|qd|qD|dq': {
1329
- action_: ['output', 'o='],
1330
- nextState: 'o'
1331
- }
1332
- },
1333
- '$...$': {
1334
- 'a': {
1335
- action_: 'a='
1336
- },
1337
- // 2$n$
1338
- '0|1|2|3|as|b|p|bp|o': {
1339
- action_: 'o=',
1340
- nextState: 'o'
1341
- },
1342
- // not 'amount'
1343
- 'as|o': {
1344
- action_: 'o='
1345
- },
1346
- 'q|d|D|qd|qD|dq': {
1347
- action_: ['output', 'o='],
1348
- nextState: 'o'
1349
- }
1350
- },
1351
- '\\bond{(...)}': {
1352
- '*': {
1353
- action_: [{
1354
- type_: 'output',
1355
- option: 2
1356
- }, 'bond'],
1357
- nextState: "3"
1358
- }
1359
- },
1360
- '\\frac{(...)}': {
1361
- '*': {
1362
- action_: [{
1363
- type_: 'output',
1364
- option: 1
1365
- }, 'frac-output'],
1366
- nextState: '3'
1367
- }
1368
- },
1369
- '\\overset{(...)}': {
1370
- '*': {
1371
- action_: [{
1372
- type_: 'output',
1373
- option: 2
1374
- }, 'overset-output'],
1375
- nextState: '3'
1376
- }
1377
- },
1378
- '\\underset{(...)}': {
1379
- '*': {
1380
- action_: [{
1381
- type_: 'output',
1382
- option: 2
1383
- }, 'underset-output'],
1384
- nextState: '3'
1385
- }
1386
- },
1387
- '\\underbrace{(...)}': {
1388
- '*': {
1389
- action_: [{
1390
- type_: 'output',
1391
- option: 2
1392
- }, 'underbrace-output'],
1393
- nextState: '3'
1394
- }
1395
- },
1396
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
1397
- '*': {
1398
- action_: [{
1399
- type_: 'output',
1400
- option: 2
1401
- }, 'color-output'],
1402
- nextState: '3'
1403
- }
1404
- },
1405
- '\\color{(...)}0': {
1406
- '*': {
1407
- action_: [{
1408
- type_: 'output',
1409
- option: 2
1410
- }, 'color0-output']
1411
- }
1412
- },
1413
- '\\ce{(...)}': {
1414
- '*': {
1415
- action_: [{
1416
- type_: 'output',
1417
- option: 2
1418
- }, 'ce'],
1419
- nextState: '3'
1420
- }
1421
- },
1422
- '\\,': {
1423
- '*': {
1424
- action_: [{
1425
- type_: 'output',
1426
- option: 1
1427
- }, 'copy'],
1428
- nextState: '1'
1429
- }
1430
- },
1431
- '\\x{}{}|\\x{}|\\x': {
1432
- '0|1|2|3|a|as|b|p|bp|o|c0': {
1433
- action_: ['o=', 'output'],
1434
- nextState: '3'
1435
- },
1436
- '*': {
1437
- action_: ['output', 'o=', 'output'],
1438
- nextState: '3'
1439
- }
1440
- },
1441
- 'others': {
1442
- '*': {
1443
- action_: [{
1444
- type_: 'output',
1445
- option: 1
1446
- }, 'copy'],
1447
- nextState: '3'
1448
- }
1449
- },
1450
- 'else2': {
1451
- 'a': {
1452
- action_: 'a to o',
1453
- nextState: 'o',
1454
- revisit: true
1455
- },
1456
- 'as': {
1457
- action_: ['output', 'sb=true'],
1458
- nextState: '1',
1459
- revisit: true
1460
- },
1461
- 'r|rt|rd|rdt|rdq': {
1462
- action_: ['output'],
1463
- nextState: '0',
1464
- revisit: true
1465
- },
1466
- '*': {
1467
- action_: ['output', 'copy'],
1468
- nextState: '3'
1469
- }
1470
- }
1471
- }),
1472
- actions: {
1473
- 'o after d': function oAfterD(buffer, m) {
1474
- var ret;
1475
-
1476
- if ((buffer.d || "").match(/^[0-9]+$/)) {
1477
- var tmp = buffer.d;
1478
- buffer.d = undefined;
1479
- ret = this['output'](buffer);
1480
- buffer.b = tmp;
1481
- } else {
1482
- ret = this['output'](buffer);
1483
- }
1484
-
1485
- mhchemParser.actions['o='](buffer, m);
1486
- return ret;
1487
- },
1488
- 'd= kv': function dKv(buffer, m) {
1489
- buffer.d = m;
1490
- buffer.dType = 'kv';
1491
- },
1492
- 'charge or bond': function chargeOrBond(buffer, m) {
1493
- if (buffer['beginsWithBond']) {
1494
- /** @type {ParserOutput[]} */
1495
- var ret = [];
1496
- mhchemParser.concatArray(ret, this['output'](buffer));
1497
- mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
1498
- return ret;
1499
- } else {
1500
- buffer.d = m;
1501
- }
1502
- },
1503
- '- after o/d': function afterOD(buffer, m, isAfterD) {
1504
- var c1 = mhchemParser.patterns.match_('orbital', buffer.o || "");
1505
- var c2 = mhchemParser.patterns.match_('one lowercase greek letter $', buffer.o || "");
1506
- var c3 = mhchemParser.patterns.match_('one lowercase latin letter $', buffer.o || "");
1507
- var c4 = mhchemParser.patterns.match_('$one lowercase latin letter$ $', buffer.o || "");
1508
- var hyphenFollows = m === "-" && (c1 && c1.remainder === "" || c2 || c3 || c4);
1509
-
1510
- if (hyphenFollows && !buffer.a && !buffer.b && !buffer.p && !buffer.d && !buffer.q && !c1 && c3) {
1511
- buffer.o = '$' + buffer.o + '$';
1512
- }
1513
- /** @type {ParserOutput[]} */
1514
-
1515
-
1516
- var ret = [];
1517
-
1518
- if (hyphenFollows) {
1519
- mhchemParser.concatArray(ret, this['output'](buffer));
1520
- ret.push({
1521
- type_: 'hyphen'
1522
- });
1523
- } else {
1524
- c1 = mhchemParser.patterns.match_('digits', buffer.d || "");
1525
-
1526
- if (isAfterD && c1 && c1.remainder === '') {
1527
- mhchemParser.concatArray(ret, mhchemParser.actions['d='](buffer, m));
1528
- mhchemParser.concatArray(ret, this['output'](buffer));
1529
- } else {
1530
- mhchemParser.concatArray(ret, this['output'](buffer));
1531
- mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
1532
- }
1533
- }
1534
-
1535
- return ret;
1536
- },
1537
- 'a to o': function aToO(buffer) {
1538
- buffer.o = buffer.a;
1539
- buffer.a = undefined;
1540
- },
1541
- 'sb=true': function sbTrue(buffer) {
1542
- buffer.sb = true;
1543
- },
1544
- 'sb=false': function sbFalse(buffer) {
1545
- buffer.sb = false;
1546
- },
1547
- 'beginsWithBond=true': function beginsWithBondTrue(buffer) {
1548
- buffer['beginsWithBond'] = true;
1549
- },
1550
- 'beginsWithBond=false': function beginsWithBondFalse(buffer) {
1551
- buffer['beginsWithBond'] = false;
1552
- },
1553
- 'parenthesisLevel++': function parenthesisLevel(buffer) {
1554
- buffer['parenthesisLevel']++;
1555
- },
1556
- 'parenthesisLevel--': function parenthesisLevel(buffer) {
1557
- buffer['parenthesisLevel']--;
1558
- },
1559
- 'state of aggregation': function stateOfAggregation(buffer, m) {
1560
- return {
1561
- type_: 'state of aggregation',
1562
- p1: mhchemParser.go(m, 'o')
1563
- };
1564
- },
1565
- 'comma': function comma(buffer, m) {
1566
- var a = m.replace(/\s*$/, '');
1567
- var withSpace = a !== m;
1568
-
1569
- if (withSpace && buffer['parenthesisLevel'] === 0) {
1570
- return {
1571
- type_: 'comma enumeration L',
1572
- p1: a
1573
- };
1574
- } else {
1575
- return {
1576
- type_: 'comma enumeration M',
1577
- p1: a
1578
- };
1579
- }
1580
- },
1581
- 'output': function output(buffer, m, entityFollows) {
1582
- // entityFollows:
1583
- // undefined = if we have nothing else to output, also ignore the just read space (buffer.sb)
1584
- // 1 = an entity follows, never omit the space if there was one just read before (can only apply to state 1)
1585
- // 2 = 1 + the entity can have an amount, so output a\, instead of converting it to o (can only apply to states a|as)
1586
-
1587
- /** @type {ParserOutput | ParserOutput[]} */
1588
- var ret;
1589
-
1590
- if (!buffer.r) {
1591
- ret = [];
1592
-
1593
- if (!buffer.a && !buffer.b && !buffer.p && !buffer.o && !buffer.q && !buffer.d && !entityFollows) ; else {
1594
- if (buffer.sb) {
1595
- ret.push({
1596
- type_: 'entitySkip'
1597
- });
1598
- }
1599
-
1600
- if (!buffer.o && !buffer.q && !buffer.d && !buffer.b && !buffer.p && entityFollows !== 2) {
1601
- buffer.o = buffer.a;
1602
- buffer.a = undefined;
1603
- } else if (!buffer.o && !buffer.q && !buffer.d && (buffer.b || buffer.p)) {
1604
- buffer.o = buffer.a;
1605
- buffer.d = buffer.b;
1606
- buffer.q = buffer.p;
1607
- buffer.a = buffer.b = buffer.p = undefined;
1608
- } else {
1609
- if (buffer.o && buffer.dType === 'kv' && mhchemParser.patterns.match_('d-oxidation$', buffer.d || "")) {
1610
- buffer.dType = 'oxidation';
1611
- } else if (buffer.o && buffer.dType === 'kv' && !buffer.q) {
1612
- buffer.dType = undefined;
1613
- }
1614
- }
1615
-
1616
- ret.push({
1617
- type_: 'chemfive',
1618
- a: mhchemParser.go(buffer.a, 'a'),
1619
- b: mhchemParser.go(buffer.b, 'bd'),
1620
- p: mhchemParser.go(buffer.p, 'pq'),
1621
- o: mhchemParser.go(buffer.o, 'o'),
1622
- q: mhchemParser.go(buffer.q, 'pq'),
1623
- d: mhchemParser.go(buffer.d, buffer.dType === 'oxidation' ? 'oxidation' : 'bd'),
1624
- dType: buffer.dType
1625
- });
1626
- }
1627
- } else {
1628
- // r
1629
-
1630
- /** @type {ParserOutput[]} */
1631
- var rd;
1632
-
1633
- if (buffer.rdt === 'M') {
1634
- rd = mhchemParser.go(buffer.rd, 'tex-math');
1635
- } else if (buffer.rdt === 'T') {
1636
- rd = [{
1637
- type_: 'text',
1638
- p1: buffer.rd || ""
1639
- }];
1640
- } else {
1641
- rd = mhchemParser.go(buffer.rd);
1642
- }
1643
- /** @type {ParserOutput[]} */
1644
-
1645
-
1646
- var rq;
1647
-
1648
- if (buffer.rqt === 'M') {
1649
- rq = mhchemParser.go(buffer.rq, 'tex-math');
1650
- } else if (buffer.rqt === 'T') {
1651
- rq = [{
1652
- type_: 'text',
1653
- p1: buffer.rq || ""
1654
- }];
1655
- } else {
1656
- rq = mhchemParser.go(buffer.rq);
1657
- }
1658
-
1659
- ret = {
1660
- type_: 'arrow',
1661
- r: buffer.r,
1662
- rd: rd,
1663
- rq: rq
1664
- };
1665
- }
1666
-
1667
- for (var p in buffer) {
1668
- if (p !== 'parenthesisLevel' && p !== 'beginsWithBond') {
1669
- delete buffer[p];
1670
- }
1671
- }
1672
-
1673
- return ret;
1674
- },
1675
- 'oxidation-output': function oxidationOutput(buffer, m) {
1676
- var ret = ["{"];
1677
- mhchemParser.concatArray(ret, mhchemParser.go(m, 'oxidation'));
1678
- ret.push("}");
1679
- return ret;
1680
- },
1681
- 'frac-output': function fracOutput(buffer, m) {
1682
- return {
1683
- type_: 'frac-ce',
1684
- p1: mhchemParser.go(m[0]),
1685
- p2: mhchemParser.go(m[1])
1686
- };
1687
- },
1688
- 'overset-output': function oversetOutput(buffer, m) {
1689
- return {
1690
- type_: 'overset',
1691
- p1: mhchemParser.go(m[0]),
1692
- p2: mhchemParser.go(m[1])
1693
- };
1694
- },
1695
- 'underset-output': function undersetOutput(buffer, m) {
1696
- return {
1697
- type_: 'underset',
1698
- p1: mhchemParser.go(m[0]),
1699
- p2: mhchemParser.go(m[1])
1700
- };
1701
- },
1702
- 'underbrace-output': function underbraceOutput(buffer, m) {
1703
- return {
1704
- type_: 'underbrace',
1705
- p1: mhchemParser.go(m[0]),
1706
- p2: mhchemParser.go(m[1])
1707
- };
1708
- },
1709
- 'color-output': function colorOutput(buffer, m) {
1710
- return {
1711
- type_: 'color',
1712
- color1: m[0],
1713
- color2: mhchemParser.go(m[1])
1714
- };
1715
- },
1716
- 'r=': function r(buffer, m) {
1717
- buffer.r = m;
1718
- },
1719
- 'rdt=': function rdt(buffer, m) {
1720
- buffer.rdt = m;
1721
- },
1722
- 'rd=': function rd(buffer, m) {
1723
- buffer.rd = m;
1724
- },
1725
- 'rqt=': function rqt(buffer, m) {
1726
- buffer.rqt = m;
1727
- },
1728
- 'rq=': function rq(buffer, m) {
1729
- buffer.rq = m;
1730
- },
1731
- 'operator': function operator(buffer, m, p1) {
1732
- return {
1733
- type_: 'operator',
1734
- kind_: p1 || m
1735
- };
1736
- }
1737
- }
1738
- },
1739
- 'a': {
1740
- transitions: mhchemParser.createTransitions({
1741
- 'empty': {
1742
- '*': {}
1743
- },
1744
- '1/2$': {
1745
- '0': {
1746
- action_: '1/2'
1747
- }
1748
- },
1749
- 'else': {
1750
- '0': {
1751
- nextState: '1',
1752
- revisit: true
1753
- }
1754
- },
1755
- '$(...)$': {
1756
- '*': {
1757
- action_: 'tex-math tight',
1758
- nextState: '1'
1759
- }
1760
- },
1761
- ',': {
1762
- '*': {
1763
- action_: {
1764
- type_: 'insert',
1765
- option: 'commaDecimal'
1766
- }
1767
- }
1768
- },
1769
- 'else2': {
1770
- '*': {
1771
- action_: 'copy'
1772
- }
1773
- }
1774
- }),
1775
- actions: {}
1776
- },
1777
- 'o': {
1778
- transitions: mhchemParser.createTransitions({
1779
- 'empty': {
1780
- '*': {}
1781
- },
1782
- '1/2$': {
1783
- '0': {
1784
- action_: '1/2'
1785
- }
1786
- },
1787
- 'else': {
1788
- '0': {
1789
- nextState: '1',
1790
- revisit: true
1791
- }
1792
- },
1793
- 'letters': {
1794
- '*': {
1795
- action_: 'rm'
1796
- }
1797
- },
1798
- '\\ca': {
1799
- '*': {
1800
- action_: {
1801
- type_: 'insert',
1802
- option: 'circa'
1803
- }
1804
- }
1805
- },
1806
- '\\x{}{}|\\x{}|\\x': {
1807
- '*': {
1808
- action_: 'copy'
1809
- }
1810
- },
1811
- '${(...)}$|$(...)$': {
1812
- '*': {
1813
- action_: 'tex-math'
1814
- }
1815
- },
1816
- '{(...)}': {
1817
- '*': {
1818
- action_: '{text}'
1819
- }
1820
- },
1821
- 'else2': {
1822
- '*': {
1823
- action_: 'copy'
1824
- }
1825
- }
1826
- }),
1827
- actions: {}
1828
- },
1829
- 'text': {
1830
- transitions: mhchemParser.createTransitions({
1831
- 'empty': {
1832
- '*': {
1833
- action_: 'output'
1834
- }
1835
- },
1836
- '{...}': {
1837
- '*': {
1838
- action_: 'text='
1839
- }
1840
- },
1841
- '${(...)}$|$(...)$': {
1842
- '*': {
1843
- action_: 'tex-math'
1844
- }
1845
- },
1846
- '\\greek': {
1847
- '*': {
1848
- action_: ['output', 'rm']
1849
- }
1850
- },
1851
- '\\,|\\x{}{}|\\x{}|\\x': {
1852
- '*': {
1853
- action_: ['output', 'copy']
1854
- }
1855
- },
1856
- 'else': {
1857
- '*': {
1858
- action_: 'text='
1859
- }
1860
- }
1861
- }),
1862
- actions: {
1863
- 'output': function output(buffer) {
1864
- if (buffer.text_) {
1865
- /** @type {ParserOutput} */
1866
- var ret = {
1867
- type_: 'text',
1868
- p1: buffer.text_
1869
- };
1870
-
1871
- for (var p in buffer) {
1872
- delete buffer[p];
1873
- }
1874
-
1875
- return ret;
1876
- }
1877
- }
1878
- }
1879
- },
1880
- 'pq': {
1881
- transitions: mhchemParser.createTransitions({
1882
- 'empty': {
1883
- '*': {}
1884
- },
1885
- 'state of aggregation $': {
1886
- '*': {
1887
- action_: 'state of aggregation'
1888
- }
1889
- },
1890
- 'i$': {
1891
- '0': {
1892
- nextState: '!f',
1893
- revisit: true
1894
- }
1895
- },
1896
- '(KV letters),': {
1897
- '0': {
1898
- action_: 'rm',
1899
- nextState: '0'
1900
- }
1901
- },
1902
- 'formula$': {
1903
- '0': {
1904
- nextState: 'f',
1905
- revisit: true
1906
- }
1907
- },
1908
- '1/2$': {
1909
- '0': {
1910
- action_: '1/2'
1911
- }
1912
- },
1913
- 'else': {
1914
- '0': {
1915
- nextState: '!f',
1916
- revisit: true
1917
- }
1918
- },
1919
- '${(...)}$|$(...)$': {
1920
- '*': {
1921
- action_: 'tex-math'
1922
- }
1923
- },
1924
- '{(...)}': {
1925
- '*': {
1926
- action_: 'text'
1927
- }
1928
- },
1929
- 'a-z': {
1930
- 'f': {
1931
- action_: 'tex-math'
1932
- }
1933
- },
1934
- 'letters': {
1935
- '*': {
1936
- action_: 'rm'
1937
- }
1938
- },
1939
- '-9.,9': {
1940
- '*': {
1941
- action_: '9,9'
1942
- }
1943
- },
1944
- ',': {
1945
- '*': {
1946
- action_: {
1947
- type_: 'insert+p1',
1948
- option: 'comma enumeration S'
1949
- }
1950
- }
1951
- },
1952
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
1953
- '*': {
1954
- action_: 'color-output'
1955
- }
1956
- },
1957
- '\\color{(...)}0': {
1958
- '*': {
1959
- action_: 'color0-output'
1960
- }
1961
- },
1962
- '\\ce{(...)}': {
1963
- '*': {
1964
- action_: 'ce'
1965
- }
1966
- },
1967
- '\\,|\\x{}{}|\\x{}|\\x': {
1968
- '*': {
1969
- action_: 'copy'
1970
- }
1971
- },
1972
- 'else2': {
1973
- '*': {
1974
- action_: 'copy'
1975
- }
1976
- }
1977
- }),
1978
- actions: {
1979
- 'state of aggregation': function stateOfAggregation(buffer, m) {
1980
- return {
1981
- type_: 'state of aggregation subscript',
1982
- p1: mhchemParser.go(m, 'o')
1983
- };
1984
- },
1985
- 'color-output': function colorOutput(buffer, m) {
1986
- return {
1987
- type_: 'color',
1988
- color1: m[0],
1989
- color2: mhchemParser.go(m[1], 'pq')
1990
- };
1991
- }
1992
- }
1993
- },
1994
- 'bd': {
1995
- transitions: mhchemParser.createTransitions({
1996
- 'empty': {
1997
- '*': {}
1998
- },
1999
- 'x$': {
2000
- '0': {
2001
- nextState: '!f',
2002
- revisit: true
2003
- }
2004
- },
2005
- 'formula$': {
2006
- '0': {
2007
- nextState: 'f',
2008
- revisit: true
2009
- }
2010
- },
2011
- 'else': {
2012
- '0': {
2013
- nextState: '!f',
2014
- revisit: true
2015
- }
2016
- },
2017
- '-9.,9 no missing 0': {
2018
- '*': {
2019
- action_: '9,9'
2020
- }
2021
- },
2022
- '.': {
2023
- '*': {
2024
- action_: {
2025
- type_: 'insert',
2026
- option: 'electron dot'
2027
- }
2028
- }
2029
- },
2030
- 'a-z': {
2031
- 'f': {
2032
- action_: 'tex-math'
2033
- }
2034
- },
2035
- 'x': {
2036
- '*': {
2037
- action_: {
2038
- type_: 'insert',
2039
- option: 'KV x'
2040
- }
2041
- }
2042
- },
2043
- 'letters': {
2044
- '*': {
2045
- action_: 'rm'
2046
- }
2047
- },
2048
- '\'': {
2049
- '*': {
2050
- action_: {
2051
- type_: 'insert',
2052
- option: 'prime'
2053
- }
2054
- }
2055
- },
2056
- '${(...)}$|$(...)$': {
2057
- '*': {
2058
- action_: 'tex-math'
2059
- }
2060
- },
2061
- '{(...)}': {
2062
- '*': {
2063
- action_: 'text'
2064
- }
2065
- },
2066
- '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
2067
- '*': {
2068
- action_: 'color-output'
2069
- }
2070
- },
2071
- '\\color{(...)}0': {
2072
- '*': {
2073
- action_: 'color0-output'
2074
- }
2075
- },
2076
- '\\ce{(...)}': {
2077
- '*': {
2078
- action_: 'ce'
2079
- }
2080
- },
2081
- '\\,|\\x{}{}|\\x{}|\\x': {
2082
- '*': {
2083
- action_: 'copy'
2084
- }
2085
- },
2086
- 'else2': {
2087
- '*': {
2088
- action_: 'copy'
2089
- }
2090
- }
2091
- }),
2092
- actions: {
2093
- 'color-output': function colorOutput(buffer, m) {
2094
- return {
2095
- type_: 'color',
2096
- color1: m[0],
2097
- color2: mhchemParser.go(m[1], 'bd')
2098
- };
2099
- }
2100
- }
2101
- },
2102
- 'oxidation': {
2103
- transitions: mhchemParser.createTransitions({
2104
- 'empty': {
2105
- '*': {}
2106
- },
2107
- 'roman numeral': {
2108
- '*': {
2109
- action_: 'roman-numeral'
2110
- }
2111
- },
2112
- '${(...)}$|$(...)$': {
2113
- '*': {
2114
- action_: 'tex-math'
2115
- }
2116
- },
2117
- 'else': {
2118
- '*': {
2119
- action_: 'copy'
2120
- }
2121
- }
2122
- }),
2123
- actions: {
2124
- 'roman-numeral': function romanNumeral(buffer, m) {
2125
- return {
2126
- type_: 'roman numeral',
2127
- p1: m || ""
2128
- };
2129
- }
2130
- }
2131
- },
2132
- 'tex-math': {
2133
- transitions: mhchemParser.createTransitions({
2134
- 'empty': {
2135
- '*': {
2136
- action_: 'output'
2137
- }
2138
- },
2139
- '\\ce{(...)}': {
2140
- '*': {
2141
- action_: ['output', 'ce']
2142
- }
2143
- },
2144
- '{...}|\\,|\\x{}{}|\\x{}|\\x': {
2145
- '*': {
2146
- action_: 'o='
2147
- }
2148
- },
2149
- 'else': {
2150
- '*': {
2151
- action_: 'o='
2152
- }
2153
- }
2154
- }),
2155
- actions: {
2156
- 'output': function output(buffer) {
2157
- if (buffer.o) {
2158
- /** @type {ParserOutput} */
2159
- var ret = {
2160
- type_: 'tex-math',
2161
- p1: buffer.o
2162
- };
2163
-
2164
- for (var p in buffer) {
2165
- delete buffer[p];
2166
- }
2167
-
2168
- return ret;
2169
- }
2170
- }
2171
- }
2172
- },
2173
- 'tex-math tight': {
2174
- transitions: mhchemParser.createTransitions({
2175
- 'empty': {
2176
- '*': {
2177
- action_: 'output'
2178
- }
2179
- },
2180
- '\\ce{(...)}': {
2181
- '*': {
2182
- action_: ['output', 'ce']
2183
- }
2184
- },
2185
- '{...}|\\,|\\x{}{}|\\x{}|\\x': {
2186
- '*': {
2187
- action_: 'o='
2188
- }
2189
- },
2190
- '-|+': {
2191
- '*': {
2192
- action_: 'tight operator'
2193
- }
2194
- },
2195
- 'else': {
2196
- '*': {
2197
- action_: 'o='
2198
- }
2199
- }
2200
- }),
2201
- actions: {
2202
- 'tight operator': function tightOperator(buffer, m) {
2203
- buffer.o = (buffer.o || "") + "{" + m + "}";
2204
- },
2205
- 'output': function output(buffer) {
2206
- if (buffer.o) {
2207
- /** @type {ParserOutput} */
2208
- var ret = {
2209
- type_: 'tex-math',
2210
- p1: buffer.o
2211
- };
2212
-
2213
- for (var p in buffer) {
2214
- delete buffer[p];
2215
- }
2216
-
2217
- return ret;
2218
- }
2219
- }
2220
- }
2221
- },
2222
- '9,9': {
2223
- transitions: mhchemParser.createTransitions({
2224
- 'empty': {
2225
- '*': {}
2226
- },
2227
- ',': {
2228
- '*': {
2229
- action_: 'comma'
2230
- }
2231
- },
2232
- 'else': {
2233
- '*': {
2234
- action_: 'copy'
2235
- }
2236
- }
2237
- }),
2238
- actions: {
2239
- 'comma': function comma() {
2240
- return {
2241
- type_: 'commaDecimal'
2242
- };
2243
- }
2244
- }
2245
- },
2246
- //#endregion
2247
- //
2248
- // \pu state machines
2249
- //
2250
- //#region pu
2251
- 'pu': {
2252
- transitions: mhchemParser.createTransitions({
2253
- 'empty': {
2254
- '*': {
2255
- action_: 'output'
2256
- }
2257
- },
2258
- 'space$': {
2259
- '*': {
2260
- action_: ['output', 'space']
2261
- }
2262
- },
2263
- '{[(|)]}': {
2264
- '0|a': {
2265
- action_: 'copy'
2266
- }
2267
- },
2268
- '(-)(9)^(-9)': {
2269
- '0': {
2270
- action_: 'number^',
2271
- nextState: 'a'
2272
- }
2273
- },
2274
- '(-)(9.,9)(e)(99)': {
2275
- '0': {
2276
- action_: 'enumber',
2277
- nextState: 'a'
2278
- }
2279
- },
2280
- 'space': {
2281
- '0|a': {}
2282
- },
2283
- 'pm-operator': {
2284
- '0|a': {
2285
- action_: {
2286
- type_: 'operator',
2287
- option: '\\pm'
2288
- },
2289
- nextState: '0'
2290
- }
2291
- },
2292
- 'operator': {
2293
- '0|a': {
2294
- action_: 'copy',
2295
- nextState: '0'
2296
- }
2297
- },
2298
- '//': {
2299
- 'd': {
2300
- action_: 'o=',
2301
- nextState: '/'
2302
- }
2303
- },
2304
- '/': {
2305
- 'd': {
2306
- action_: 'o=',
2307
- nextState: '/'
2308
- }
2309
- },
2310
- '{...}|else': {
2311
- '0|d': {
2312
- action_: 'd=',
2313
- nextState: 'd'
2314
- },
2315
- 'a': {
2316
- action_: ['space', 'd='],
2317
- nextState: 'd'
2318
- },
2319
- '/|q': {
2320
- action_: 'q=',
2321
- nextState: 'q'
2322
- }
2323
- }
2324
- }),
2325
- actions: {
2326
- 'enumber': function enumber(buffer, m) {
2327
- /** @type {ParserOutput[]} */
2328
- var ret = [];
2329
-
2330
- if (m[0] === "+-" || m[0] === "+/-") {
2331
- ret.push("\\pm ");
2332
- } else if (m[0]) {
2333
- ret.push(m[0]);
2334
- }
2335
-
2336
- if (m[1]) {
2337
- mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
2338
-
2339
- if (m[2]) {
2340
- if (m[2].match(/[,.]/)) {
2341
- mhchemParser.concatArray(ret, mhchemParser.go(m[2], 'pu-9,9'));
2342
- } else {
2343
- ret.push(m[2]);
2344
- }
2345
- }
2346
-
2347
- m[3] = m[4] || m[3];
2348
-
2349
- if (m[3]) {
2350
- m[3] = m[3].trim();
2351
-
2352
- if (m[3] === "e" || m[3].substr(0, 1) === "*") {
2353
- ret.push({
2354
- type_: 'cdot'
2355
- });
2356
- } else {
2357
- ret.push({
2358
- type_: 'times'
2359
- });
2360
- }
2361
- }
2362
- }
2363
-
2364
- if (m[3]) {
2365
- ret.push("10^{" + m[5] + "}");
2366
- }
2367
-
2368
- return ret;
2369
- },
2370
- 'number^': function number(buffer, m) {
2371
- /** @type {ParserOutput[]} */
2372
- var ret = [];
2373
-
2374
- if (m[0] === "+-" || m[0] === "+/-") {
2375
- ret.push("\\pm ");
2376
- } else if (m[0]) {
2377
- ret.push(m[0]);
2378
- }
2379
-
2380
- mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
2381
- ret.push("^{" + m[2] + "}");
2382
- return ret;
2383
- },
2384
- 'operator': function operator(buffer, m, p1) {
2385
- return {
2386
- type_: 'operator',
2387
- kind_: p1 || m
2388
- };
2389
- },
2390
- 'space': function space() {
2391
- return {
2392
- type_: 'pu-space-1'
2393
- };
2394
- },
2395
- 'output': function output(buffer) {
2396
- /** @type {ParserOutput | ParserOutput[]} */
2397
- var ret;
2398
- var md = mhchemParser.patterns.match_('{(...)}', buffer.d || "");
2399
-
2400
- if (md && md.remainder === '') {
2401
- buffer.d = md.match_;
2402
- }
2403
-
2404
- var mq = mhchemParser.patterns.match_('{(...)}', buffer.q || "");
2405
-
2406
- if (mq && mq.remainder === '') {
2407
- buffer.q = mq.match_;
2408
- }
2409
-
2410
- if (buffer.d) {
2411
- buffer.d = buffer.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
2412
- buffer.d = buffer.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
2413
- }
2414
-
2415
- if (buffer.q) {
2416
- // fraction
2417
- buffer.q = buffer.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
2418
- buffer.q = buffer.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
2419
- var b5 = {
2420
- d: mhchemParser.go(buffer.d, 'pu'),
2421
- q: mhchemParser.go(buffer.q, 'pu')
2422
- };
2423
-
2424
- if (buffer.o === '//') {
2425
- ret = {
2426
- type_: 'pu-frac',
2427
- p1: b5.d,
2428
- p2: b5.q
2429
- };
2430
- } else {
2431
- ret = b5.d;
2432
-
2433
- if (b5.d.length > 1 || b5.q.length > 1) {
2434
- ret.push({
2435
- type_: ' / '
2436
- });
2437
- } else {
2438
- ret.push({
2439
- type_: '/'
2440
- });
2441
- }
2442
-
2443
- mhchemParser.concatArray(ret, b5.q);
2444
- }
2445
- } else {
2446
- // no fraction
2447
- ret = mhchemParser.go(buffer.d, 'pu-2');
2448
- }
2449
-
2450
- for (var p in buffer) {
2451
- delete buffer[p];
2452
- }
2453
-
2454
- return ret;
2455
- }
2456
- }
2457
- },
2458
- 'pu-2': {
2459
- transitions: mhchemParser.createTransitions({
2460
- 'empty': {
2461
- '*': {
2462
- action_: 'output'
2463
- }
2464
- },
2465
- '*': {
2466
- '*': {
2467
- action_: ['output', 'cdot'],
2468
- nextState: '0'
2469
- }
2470
- },
2471
- '\\x': {
2472
- '*': {
2473
- action_: 'rm='
2474
- }
2475
- },
2476
- 'space': {
2477
- '*': {
2478
- action_: ['output', 'space'],
2479
- nextState: '0'
2480
- }
2481
- },
2482
- '^{(...)}|^(-1)': {
2483
- '1': {
2484
- action_: '^(-1)'
2485
- }
2486
- },
2487
- '-9.,9': {
2488
- '0': {
2489
- action_: 'rm=',
2490
- nextState: '0'
2491
- },
2492
- '1': {
2493
- action_: '^(-1)',
2494
- nextState: '0'
2495
- }
2496
- },
2497
- '{...}|else': {
2498
- '*': {
2499
- action_: 'rm=',
2500
- nextState: '1'
2501
- }
2502
- }
2503
- }),
2504
- actions: {
2505
- 'cdot': function cdot() {
2506
- return {
2507
- type_: 'tight cdot'
2508
- };
2509
- },
2510
- '^(-1)': function _(buffer, m) {
2511
- buffer.rm += "^{" + m + "}";
2512
- },
2513
- 'space': function space() {
2514
- return {
2515
- type_: 'pu-space-2'
2516
- };
2517
- },
2518
- 'output': function output(buffer) {
2519
- /** @type {ParserOutput | ParserOutput[]} */
2520
- var ret = [];
2521
-
2522
- if (buffer.rm) {
2523
- var mrm = mhchemParser.patterns.match_('{(...)}', buffer.rm || "");
2524
-
2525
- if (mrm && mrm.remainder === '') {
2526
- ret = mhchemParser.go(mrm.match_, 'pu');
2527
- } else {
2528
- ret = {
2529
- type_: 'rm',
2530
- p1: buffer.rm
2531
- };
2532
- }
2533
- }
2534
-
2535
- for (var p in buffer) {
2536
- delete buffer[p];
2537
- }
2538
-
2539
- return ret;
2540
- }
2541
- }
2542
- },
2543
- 'pu-9,9': {
2544
- transitions: mhchemParser.createTransitions({
2545
- 'empty': {
2546
- '0': {
2547
- action_: 'output-0'
2548
- },
2549
- 'o': {
2550
- action_: 'output-o'
2551
- }
2552
- },
2553
- ',': {
2554
- '0': {
2555
- action_: ['output-0', 'comma'],
2556
- nextState: 'o'
2557
- }
2558
- },
2559
- '.': {
2560
- '0': {
2561
- action_: ['output-0', 'copy'],
2562
- nextState: 'o'
2563
- }
2564
- },
2565
- 'else': {
2566
- '*': {
2567
- action_: 'text='
2568
- }
2569
- }
2570
- }),
2571
- actions: {
2572
- 'comma': function comma() {
2573
- return {
2574
- type_: 'commaDecimal'
2575
- };
2576
- },
2577
- 'output-0': function output0(buffer) {
2578
- /** @type {ParserOutput[]} */
2579
- var ret = [];
2580
- buffer.text_ = buffer.text_ || "";
2581
-
2582
- if (buffer.text_.length > 4) {
2583
- var a = buffer.text_.length % 3;
2584
-
2585
- if (a === 0) {
2586
- a = 3;
2587
- }
2588
-
2589
- for (var i = buffer.text_.length - 3; i > 0; i -= 3) {
2590
- ret.push(buffer.text_.substr(i, 3));
2591
- ret.push({
2592
- type_: '1000 separator'
2593
- });
2594
- }
2595
-
2596
- ret.push(buffer.text_.substr(0, a));
2597
- ret.reverse();
2598
- } else {
2599
- ret.push(buffer.text_);
2600
- }
2601
-
2602
- for (var p in buffer) {
2603
- delete buffer[p];
2604
- }
2605
-
2606
- return ret;
2607
- },
2608
- 'output-o': function outputO(buffer) {
2609
- /** @type {ParserOutput[]} */
2610
- var ret = [];
2611
- buffer.text_ = buffer.text_ || "";
2612
-
2613
- if (buffer.text_.length > 4) {
2614
- var a = buffer.text_.length - 3;
2615
-
2616
- for (var i = 0; i < a; i += 3) {
2617
- ret.push(buffer.text_.substr(i, 3));
2618
- ret.push({
2619
- type_: '1000 separator'
2620
- });
2621
- }
2622
-
2623
- ret.push(buffer.text_.substr(i));
2624
- } else {
2625
- ret.push(buffer.text_);
2626
- }
2627
-
2628
- for (var p in buffer) {
2629
- delete buffer[p];
2630
- }
2631
-
2632
- return ret;
2633
- }
2634
- } //#endregion
2635
-
2636
- }
2637
- }; //
2638
- // texify: Take MhchemParser output and convert it to TeX
2639
- //
2640
-
2641
- /** @type {Texify} */
2642
-
2643
- var texify = {
2644
- go: function go(input, isInner) {
2645
- // (recursive, max 4 levels)
2646
- if (!input) {
2647
- return "";
2648
- }
2649
-
2650
- var res = "";
2651
- var cee = false;
2652
-
2653
- for (var i = 0; i < input.length; i++) {
2654
- var inputi = input[i];
2655
-
2656
- if (typeof inputi === "string") {
2657
- res += inputi;
2658
- } else {
2659
- res += texify._go2(inputi);
2660
-
2661
- if (inputi.type_ === '1st-level escape') {
2662
- cee = true;
2663
- }
2664
- }
2665
- }
2666
-
2667
- if (!isInner && !cee && res) {
2668
- res = "{" + res + "}";
2669
- }
2670
-
2671
- return res;
2672
- },
2673
- _goInner: function _goInner(input) {
2674
- if (!input) {
2675
- return input;
2676
- }
2677
-
2678
- return texify.go(input, true);
2679
- },
2680
- _go2: function _go2(buf) {
2681
- /** @type {undefined | string} */
2682
- var res;
2683
-
2684
- switch (buf.type_) {
2685
- case 'chemfive':
2686
- res = "";
2687
- var b5 = {
2688
- a: texify._goInner(buf.a),
2689
- b: texify._goInner(buf.b),
2690
- p: texify._goInner(buf.p),
2691
- o: texify._goInner(buf.o),
2692
- q: texify._goInner(buf.q),
2693
- d: texify._goInner(buf.d)
2694
- }; //
2695
- // a
2696
- //
2697
-
2698
- if (b5.a) {
2699
- if (b5.a.match(/^[+\-]/)) {
2700
- b5.a = "{" + b5.a + "}";
2701
- }
2702
-
2703
- res += b5.a + "\\,";
2704
- } //
2705
- // b and p
2706
- //
2707
-
2708
-
2709
- if (b5.b || b5.p) {
2710
- res += "{\\vphantom{X}}";
2711
- res += "^{\\hphantom{" + (b5.b || "") + "}}_{\\hphantom{" + (b5.p || "") + "}}";
2712
- res += "{\\vphantom{X}}";
2713
- res += "^{\\smash[t]{\\vphantom{2}}\\mathllap{" + (b5.b || "") + "}}";
2714
- res += "_{\\vphantom{2}\\mathllap{\\smash[t]{" + (b5.p || "") + "}}}";
2715
- } //
2716
- // o
2717
- //
2718
-
2719
-
2720
- if (b5.o) {
2721
- if (b5.o.match(/^[+\-]/)) {
2722
- b5.o = "{" + b5.o + "}";
2723
- }
2724
-
2725
- res += b5.o;
2726
- } //
2727
- // q and d
2728
- //
2729
-
2730
-
2731
- if (buf.dType === 'kv') {
2732
- if (b5.d || b5.q) {
2733
- res += "{\\vphantom{X}}";
2734
- }
2735
-
2736
- if (b5.d) {
2737
- res += "^{" + b5.d + "}";
2738
- }
2739
-
2740
- if (b5.q) {
2741
- res += "_{\\smash[t]{" + b5.q + "}}";
2742
- }
2743
- } else if (buf.dType === 'oxidation') {
2744
- if (b5.d) {
2745
- res += "{\\vphantom{X}}";
2746
- res += "^{" + b5.d + "}";
2747
- }
2748
-
2749
- if (b5.q) {
2750
- res += "{\\vphantom{X}}";
2751
- res += "_{\\smash[t]{" + b5.q + "}}";
2752
- }
2753
- } else {
2754
- if (b5.q) {
2755
- res += "{\\vphantom{X}}";
2756
- res += "_{\\smash[t]{" + b5.q + "}}";
2757
- }
2758
-
2759
- if (b5.d) {
2760
- res += "{\\vphantom{X}}";
2761
- res += "^{" + b5.d + "}";
2762
- }
2763
- }
2764
-
2765
- break;
2766
-
2767
- case 'rm':
2768
- res = "\\mathrm{" + buf.p1 + "}";
2769
- break;
2770
-
2771
- case 'text':
2772
- if (buf.p1.match(/[\^_]/)) {
2773
- buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
2774
- res = "\\mathrm{" + buf.p1 + "}";
2775
- } else {
2776
- res = "\\text{" + buf.p1 + "}";
2777
- }
2778
-
2779
- break;
2780
-
2781
- case 'roman numeral':
2782
- res = "\\mathrm{" + buf.p1 + "}";
2783
- break;
2784
-
2785
- case 'state of aggregation':
2786
- res = "\\mskip2mu " + texify._goInner(buf.p1);
2787
- break;
2788
-
2789
- case 'state of aggregation subscript':
2790
- res = "\\mskip1mu " + texify._goInner(buf.p1);
2791
- break;
2792
-
2793
- case 'bond':
2794
- res = texify._getBond(buf.kind_);
2795
-
2796
- if (!res) {
2797
- throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
2798
- }
2799
-
2800
- break;
2801
-
2802
- case 'frac':
2803
- var c = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
2804
- res = "\\mathchoice{\\textstyle" + c + "}{" + c + "}{" + c + "}{" + c + "}";
2805
- break;
2806
-
2807
- case 'pu-frac':
2808
- var d = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
2809
- res = "\\mathchoice{\\textstyle" + d + "}{" + d + "}{" + d + "}{" + d + "}";
2810
- break;
2811
-
2812
- case 'tex-math':
2813
- res = buf.p1 + " ";
2814
- break;
2815
-
2816
- case 'frac-ce':
2817
- res = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
2818
- break;
2819
-
2820
- case 'overset':
2821
- res = "\\overset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
2822
- break;
2823
-
2824
- case 'underset':
2825
- res = "\\underset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
2826
- break;
2827
-
2828
- case 'underbrace':
2829
- res = "\\underbrace{" + texify._goInner(buf.p1) + "}_{" + texify._goInner(buf.p2) + "}";
2830
- break;
2831
-
2832
- case 'color':
2833
- res = "{\\color{" + buf.color1 + "}{" + texify._goInner(buf.color2) + "}}";
2834
- break;
2835
-
2836
- case 'color0':
2837
- res = "\\color{" + buf.color + "}";
2838
- break;
2839
-
2840
- case 'arrow':
2841
- var b6 = {
2842
- rd: texify._goInner(buf.rd),
2843
- rq: texify._goInner(buf.rq)
2844
- };
2845
-
2846
- var arrow = "\\x" + texify._getArrow(buf.r);
2847
-
2848
- if (b6.rq) {
2849
- arrow += "[{" + b6.rq + "}]";
2850
- }
2851
-
2852
- if (b6.rd) {
2853
- arrow += "{" + b6.rd + "}";
2854
- } else {
2855
- arrow += "{}";
2856
- }
2857
-
2858
- res = arrow;
2859
- break;
2860
-
2861
- case 'operator':
2862
- res = texify._getOperator(buf.kind_);
2863
- break;
2864
-
2865
- case '1st-level escape':
2866
- res = buf.p1 + " "; // &, \\\\, \\hlin
2867
-
2868
- break;
2869
-
2870
- case 'space':
2871
- res = " ";
2872
- break;
2873
-
2874
- case 'entitySkip':
2875
- res = "~";
2876
- break;
2877
-
2878
- case 'pu-space-1':
2879
- res = "~";
2880
- break;
2881
-
2882
- case 'pu-space-2':
2883
- res = "\\mkern3mu ";
2884
- break;
2885
-
2886
- case '1000 separator':
2887
- res = "\\mkern2mu ";
2888
- break;
2889
-
2890
- case 'commaDecimal':
2891
- res = "{,}";
2892
- break;
2893
-
2894
- case 'comma enumeration L':
2895
- res = "{" + buf.p1 + "}\\mkern6mu ";
2896
- break;
2897
-
2898
- case 'comma enumeration M':
2899
- res = "{" + buf.p1 + "}\\mkern3mu ";
2900
- break;
2901
-
2902
- case 'comma enumeration S':
2903
- res = "{" + buf.p1 + "}\\mkern1mu ";
2904
- break;
2905
-
2906
- case 'hyphen':
2907
- res = "\\text{-}";
2908
- break;
2909
-
2910
- case 'addition compound':
2911
- res = "\\,{\\cdot}\\,";
2912
- break;
2913
-
2914
- case 'electron dot':
2915
- res = "\\mkern1mu \\bullet\\mkern1mu ";
2916
- break;
2917
-
2918
- case 'KV x':
2919
- res = "{\\times}";
2920
- break;
2921
-
2922
- case 'prime':
2923
- res = "\\prime ";
2924
- break;
2925
-
2926
- case 'cdot':
2927
- res = "\\cdot ";
2928
- break;
2929
-
2930
- case 'tight cdot':
2931
- res = "\\mkern1mu{\\cdot}\\mkern1mu ";
2932
- break;
2933
-
2934
- case 'times':
2935
- res = "\\times ";
2936
- break;
2937
-
2938
- case 'circa':
2939
- res = "{\\sim}";
2940
- break;
2941
-
2942
- case '^':
2943
- res = "uparrow";
2944
- break;
2945
-
2946
- case 'v':
2947
- res = "downarrow";
2948
- break;
2949
-
2950
- case 'ellipsis':
2951
- res = "\\ldots ";
2952
- break;
2953
-
2954
- case '/':
2955
- res = "/";
2956
- break;
2957
-
2958
- case ' / ':
2959
- res = "\\,/\\,";
2960
- break;
2961
-
2962
- default:
2963
- throw ["MhchemBugT", "mhchem bug T. Please report."];
2964
- // Missing texify rule or unknown MhchemParser output
2965
- }
2966
- return res;
2967
- },
2968
- _getArrow: function _getArrow(a) {
2969
- switch (a) {
2970
- case "->":
2971
- return "rightarrow";
2972
-
2973
- case "\u2192":
2974
- return "rightarrow";
2975
-
2976
- case "\u27F6":
2977
- return "rightarrow";
2978
-
2979
- case "<-":
2980
- return "leftarrow";
2981
-
2982
- case "<->":
2983
- return "leftrightarrow";
2984
-
2985
- case "<-->":
2986
- return "rightleftarrows";
2987
-
2988
- case "<=>":
2989
- return "rightleftharpoons";
2990
-
2991
- case "\u21CC":
2992
- return "rightleftharpoons";
2993
-
2994
- case "<=>>":
2995
- return "rightequilibrium";
2996
-
2997
- case "<<=>":
2998
- return "leftequilibrium";
2999
-
3000
- default:
3001
- throw ["MhchemBugT", "mhchem bug T. Please report."];
3002
- }
3003
- },
3004
- _getBond: function _getBond(a) {
3005
- switch (a) {
3006
- case "-":
3007
- return "{-}";
3008
-
3009
- case "1":
3010
- return "{-}";
3011
-
3012
- case "=":
3013
- return "{=}";
3014
-
3015
- case "2":
3016
- return "{=}";
3017
-
3018
- case "#":
3019
- return "{\\equiv}";
3020
-
3021
- case "3":
3022
- return "{\\equiv}";
3023
-
3024
- case "~":
3025
- return "{\\tripledash}";
3026
-
3027
- case "~-":
3028
- return "{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";
3029
-
3030
- case "~=":
3031
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
3032
-
3033
- case "~--":
3034
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
3035
-
3036
- case "-~-":
3037
- return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";
3038
-
3039
- case "...":
3040
- return "{{\\cdot}{\\cdot}{\\cdot}}";
3041
-
3042
- case "....":
3043
- return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
3044
-
3045
- case "->":
3046
- return "{\\rightarrow}";
3047
-
3048
- case "<-":
3049
- return "{\\leftarrow}";
3050
-
3051
- case "<":
3052
- return "{<}";
3053
-
3054
- case ">":
3055
- return "{>}";
3056
-
3057
- default:
3058
- throw ["MhchemBugT", "mhchem bug T. Please report."];
3059
- }
3060
- },
3061
- _getOperator: function _getOperator(a) {
3062
- switch (a) {
3063
- case "+":
3064
- return " {}+{} ";
3065
-
3066
- case "-":
3067
- return " {}-{} ";
3068
-
3069
- case "=":
3070
- return " {}={} ";
3071
-
3072
- case "<":
3073
- return " {}<{} ";
3074
-
3075
- case ">":
3076
- return " {}>{} ";
3077
-
3078
- case "<<":
3079
- return " {}\\ll{} ";
3080
-
3081
- case ">>":
3082
- return " {}\\gg{} ";
3083
-
3084
- case "\\pm":
3085
- return " {}\\pm{} ";
3086
-
3087
- case "\\approx":
3088
- return " {}\\approx{} ";
3089
-
3090
- case "$\\approx$":
3091
- return " {}\\approx{} ";
3092
-
3093
- case "v":
3094
- return " \\downarrow{} ";
3095
-
3096
- case "(v)":
3097
- return " \\downarrow{} ";
3098
-
3099
- case "^":
3100
- return " \\uparrow{} ";
3101
-
3102
- case "(^)":
3103
- return " \\uparrow{} ";
3104
-
3105
- default:
3106
- throw ["MhchemBugT", "mhchem bug T. Please report."];
3107
- }
3108
- }
3109
- }; //