solve-engine 2.32.0 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/dist/{EngineError-CqGtaT_v.d.cts → EngineError-Bm4OYmw8.d.cts} +6 -0
  2. package/dist/{EngineError-CqGtaT_v.d.ts → EngineError-Bm4OYmw8.d.ts} +6 -0
  3. package/dist/{Lexer-CqFjYoRA.d.ts → Lexer-DPn5dfCH.d.ts} +1 -13
  4. package/dist/{Lexer-sCI05tqO.d.cts → Lexer-DaWkCu84.d.cts} +1 -13
  5. package/dist/{PackageCompatibility-phvSFP4f.d.ts → PackageCompatibility-CkzZfoJ3.d.ts} +1 -1
  6. package/dist/{PackageCompatibility-Bn-T_xKW.d.cts → PackageCompatibility-E_5GtcQW.d.cts} +1 -1
  7. package/dist/{PackageRegistry-C78jVkI9.d.ts → PackageRegistry-DSqic8kz.d.ts} +132 -23
  8. package/dist/{PackageRegistry-B-C1duZw.d.cts → PackageRegistry-js47hr28.d.cts} +132 -23
  9. package/dist/{Parselet-Dgymjxzd.d.ts → Parselet-CQjcHOKw.d.ts} +13 -6
  10. package/dist/{Parselet-DF3864la.d.cts → Parselet-s1sRRn8H.d.cts} +13 -6
  11. package/dist/{TokenNormalizer-Pe3_390t.d.cts → TokenNormalizer-D382VSYh.d.cts} +4 -1
  12. package/dist/{TokenNormalizer-IF7nPRMp.d.ts → TokenNormalizer-DAzPp-j1.d.ts} +4 -1
  13. package/dist/{VMBuiltins-BkKzhj6C.d.cts → VMBuiltins-JCavlQUj.d.cts} +53 -18
  14. package/dist/{VMBuiltins-Du9y8sEo.d.ts → VMBuiltins-qgzA6qGi.d.ts} +53 -18
  15. package/dist/{VMCheckpoints-WdUQrdc9.d.cts → VMCheckpoints-BxPzmdu0.d.cts} +2 -2
  16. package/dist/{VMCheckpoints-gvy_yxYh.d.ts → VMCheckpoints-DjjE92mf.d.ts} +2 -2
  17. package/dist/{Value-BYHw-x7q.d.cts → Value-2TIKi-YL.d.cts} +19 -0
  18. package/dist/{Value-BYHw-x7q.d.ts → Value-2TIKi-YL.d.ts} +19 -0
  19. package/dist/{WorkerError-DTrl3Jag.d.ts → WorkerError-BaN8_eok.d.ts} +1 -1
  20. package/dist/{WorkerError-CRoM8Ju1.d.cts → WorkerError-CexHHmbb.d.cts} +1 -1
  21. package/dist/{chunk-IJE4AEDX.js → chunk-24OW3AAU.js} +3 -3
  22. package/dist/{chunk-IJE4AEDX.js.map → chunk-24OW3AAU.js.map} +1 -1
  23. package/dist/{chunk-CAJTDZ5B.cjs → chunk-2XOLAHW6.cjs} +2 -2
  24. package/dist/{chunk-CAJTDZ5B.cjs.map → chunk-2XOLAHW6.cjs.map} +1 -1
  25. package/dist/{chunk-AGCNMEP2.cjs → chunk-3MG7VIPL.cjs} +2 -2
  26. package/dist/{chunk-AGCNMEP2.cjs.map → chunk-3MG7VIPL.cjs.map} +1 -1
  27. package/dist/chunk-4ASM522I.js +2 -0
  28. package/dist/chunk-4ASM522I.js.map +1 -0
  29. package/dist/{chunk-KH4QXKLT.js → chunk-4MD5L23F.js} +2 -2
  30. package/dist/{chunk-KH4QXKLT.js.map → chunk-4MD5L23F.js.map} +1 -1
  31. package/dist/{chunk-IQVSCL2R.js → chunk-4XWZXP6I.js} +3 -3
  32. package/dist/{chunk-IQVSCL2R.js.map → chunk-4XWZXP6I.js.map} +1 -1
  33. package/dist/{chunk-RELMEWY6.js → chunk-6G2NES2I.js} +2 -2
  34. package/dist/chunk-6G2NES2I.js.map +1 -0
  35. package/dist/{chunk-CDE2ZUGG.js → chunk-6NL7RBAG.js} +2 -2
  36. package/dist/{chunk-CDE2ZUGG.js.map → chunk-6NL7RBAG.js.map} +1 -1
  37. package/dist/{chunk-SUAGBRQ7.cjs → chunk-6SYU4MH7.cjs} +2 -2
  38. package/dist/chunk-6SYU4MH7.cjs.map +1 -0
  39. package/dist/chunk-72J5V7SN.cjs +2 -0
  40. package/dist/chunk-72J5V7SN.cjs.map +1 -0
  41. package/dist/{chunk-TSJ4RQLZ.js → chunk-AENL3Z66.js} +2 -2
  42. package/dist/{chunk-TSJ4RQLZ.js.map → chunk-AENL3Z66.js.map} +1 -1
  43. package/dist/chunk-APYRNAU2.js +2 -0
  44. package/dist/chunk-APYRNAU2.js.map +1 -0
  45. package/dist/{chunk-AXTYQFIV.cjs → chunk-D7URPV5Z.cjs} +3 -3
  46. package/dist/{chunk-AXTYQFIV.cjs.map → chunk-D7URPV5Z.cjs.map} +1 -1
  47. package/dist/chunk-DB5ISONG.js +2 -0
  48. package/dist/chunk-DB5ISONG.js.map +1 -0
  49. package/dist/chunk-DGDVY6XI.js +3 -0
  50. package/dist/chunk-DGDVY6XI.js.map +1 -0
  51. package/dist/chunk-EOKHRS2T.js +2 -0
  52. package/dist/chunk-EOKHRS2T.js.map +1 -0
  53. package/dist/{chunk-NQFCXLEF.js → chunk-EOO6M65F.js} +2 -2
  54. package/dist/{chunk-NQFCXLEF.js.map → chunk-EOO6M65F.js.map} +1 -1
  55. package/dist/{chunk-A764BY7L.cjs → chunk-EQNKDTMX.cjs} +2 -2
  56. package/dist/{chunk-A764BY7L.cjs.map → chunk-EQNKDTMX.cjs.map} +1 -1
  57. package/dist/chunk-FESR6PZI.cjs +2 -0
  58. package/dist/chunk-FESR6PZI.cjs.map +1 -0
  59. package/dist/chunk-G2LCDR52.cjs +3 -0
  60. package/dist/chunk-G2LCDR52.cjs.map +1 -0
  61. package/dist/chunk-G5TZ6TDA.js +2 -0
  62. package/dist/chunk-G5TZ6TDA.js.map +1 -0
  63. package/dist/chunk-GDLYXRMA.cjs +2 -0
  64. package/dist/chunk-GDLYXRMA.cjs.map +1 -0
  65. package/dist/{chunk-7DJYS5PO.cjs → chunk-HSTGWWU2.cjs} +2 -2
  66. package/dist/{chunk-7DJYS5PO.cjs.map → chunk-HSTGWWU2.cjs.map} +1 -1
  67. package/dist/{chunk-OE2DBN4K.js → chunk-INMJ7ZXL.js} +2 -2
  68. package/dist/chunk-INMJ7ZXL.js.map +1 -0
  69. package/dist/chunk-ITH2RLRG.js +5 -0
  70. package/dist/chunk-ITH2RLRG.js.map +1 -0
  71. package/dist/{chunk-5AKT36UK.cjs → chunk-K3PZ66XR.cjs} +2 -2
  72. package/dist/{chunk-5AKT36UK.cjs.map → chunk-K3PZ66XR.cjs.map} +1 -1
  73. package/dist/chunk-LI6LYJDA.cjs +2 -0
  74. package/dist/chunk-LI6LYJDA.cjs.map +1 -0
  75. package/dist/{chunk-WQGHJAW2.cjs → chunk-M4UC2PB6.cjs} +2 -2
  76. package/dist/{chunk-WQGHJAW2.cjs.map → chunk-M4UC2PB6.cjs.map} +1 -1
  77. package/dist/chunk-O7HF345B.js +2 -0
  78. package/dist/chunk-O7HF345B.js.map +1 -0
  79. package/dist/{chunk-CM2WM5CM.cjs → chunk-OBZJKZ2F.cjs} +2 -2
  80. package/dist/{chunk-CM2WM5CM.cjs.map → chunk-OBZJKZ2F.cjs.map} +1 -1
  81. package/dist/{chunk-Q7TBBV62.cjs → chunk-P5YWBIIU.cjs} +2 -2
  82. package/dist/chunk-P5YWBIIU.cjs.map +1 -0
  83. package/dist/chunk-PICFFFJV.js +3 -0
  84. package/dist/chunk-PICFFFJV.js.map +1 -0
  85. package/dist/{chunk-P43SV4NJ.cjs → chunk-QOOTRUY7.cjs} +3 -3
  86. package/dist/{chunk-P43SV4NJ.cjs.map → chunk-QOOTRUY7.cjs.map} +1 -1
  87. package/dist/chunk-R3W53ZMP.cjs +2 -0
  88. package/dist/chunk-R3W53ZMP.cjs.map +1 -0
  89. package/dist/chunk-RMDCGYZM.js +2 -0
  90. package/dist/chunk-RMDCGYZM.js.map +1 -0
  91. package/dist/{chunk-CB3EXUM2.js → chunk-RU3KGJRA.js} +2 -2
  92. package/dist/chunk-RU3KGJRA.js.map +1 -0
  93. package/dist/chunk-S3SPDK6N.cjs +2 -0
  94. package/dist/chunk-S3SPDK6N.cjs.map +1 -0
  95. package/dist/chunk-SF5QVUEI.cjs +3 -0
  96. package/dist/chunk-SF5QVUEI.cjs.map +1 -0
  97. package/dist/{chunk-FXB5GCBT.js → chunk-TJKN466F.js} +2 -2
  98. package/dist/{chunk-FXB5GCBT.js.map → chunk-TJKN466F.js.map} +1 -1
  99. package/dist/{chunk-VLX7ZVK4.js → chunk-U5MESNRT.js} +2 -2
  100. package/dist/{chunk-VLX7ZVK4.js.map → chunk-U5MESNRT.js.map} +1 -1
  101. package/dist/chunk-WCVPXBCW.cjs +5 -0
  102. package/dist/chunk-WCVPXBCW.cjs.map +1 -0
  103. package/dist/{chunk-YWF6C2IO.cjs → chunk-WFT3XUSH.cjs} +2 -2
  104. package/dist/{chunk-YWF6C2IO.cjs.map → chunk-WFT3XUSH.cjs.map} +1 -1
  105. package/dist/{chunk-3ZGFAE3Q.js → chunk-X2GQAKL2.js} +2 -2
  106. package/dist/{chunk-3ZGFAE3Q.js.map → chunk-X2GQAKL2.js.map} +1 -1
  107. package/dist/{chunk-G3POUURF.js → chunk-YID47OPR.js} +2 -2
  108. package/dist/{chunk-G3POUURF.js.map → chunk-YID47OPR.js.map} +1 -1
  109. package/dist/chunk-YV4GDW5A.cjs +2 -0
  110. package/dist/chunk-YV4GDW5A.cjs.map +1 -0
  111. package/dist/chunk-ZSXQP7PD.cjs +2 -0
  112. package/dist/chunk-ZSXQP7PD.cjs.map +1 -0
  113. package/dist/constants.cjs +1 -1
  114. package/dist/constants.js +1 -1
  115. package/dist/engine.cjs +1 -1
  116. package/dist/engine.d.cts +10 -10
  117. package/dist/engine.d.ts +10 -10
  118. package/dist/engine.js +1 -1
  119. package/dist/engine.worker.cjs +1 -1
  120. package/dist/engine.worker.cjs.map +1 -1
  121. package/dist/engine.worker.js +1 -1
  122. package/dist/engine.worker.js.map +1 -1
  123. package/dist/errors.cjs +1 -1
  124. package/dist/errors.d.cts +3 -3
  125. package/dist/errors.d.ts +3 -3
  126. package/dist/errors.js +1 -1
  127. package/dist/format.cjs +1 -1
  128. package/dist/format.d.cts +1 -1
  129. package/dist/format.d.ts +1 -1
  130. package/dist/format.js +1 -1
  131. package/dist/index.cjs +1 -1
  132. package/dist/index.cjs.map +1 -1
  133. package/dist/index.d.cts +10 -10
  134. package/dist/index.d.ts +10 -10
  135. package/dist/index.js +1 -1
  136. package/dist/index.js.map +1 -1
  137. package/dist/language.d.cts +9 -9
  138. package/dist/language.d.ts +9 -9
  139. package/dist/lexer.cjs +1 -1
  140. package/dist/lexer.d.cts +3 -3
  141. package/dist/lexer.d.ts +3 -3
  142. package/dist/lexer.js +1 -1
  143. package/dist/normalizer.cjs +1 -1
  144. package/dist/normalizer.d.cts +2 -2
  145. package/dist/normalizer.d.ts +2 -2
  146. package/dist/normalizer.js +1 -1
  147. package/dist/packages.cjs +1 -1
  148. package/dist/packages.d.cts +8 -8
  149. package/dist/packages.d.ts +8 -8
  150. package/dist/packages.js +1 -1
  151. package/dist/parser.cjs +1 -1
  152. package/dist/parser.d.cts +3 -3
  153. package/dist/parser.d.ts +3 -3
  154. package/dist/parser.js +1 -1
  155. package/dist/{pipeline-BYkKNpql.d.cts → pipeline-Bum6y1B9.d.cts} +1 -1
  156. package/dist/{pipeline-Cl7KW8CB.d.ts → pipeline-DOo3KHaq.d.ts} +1 -1
  157. package/dist/resolvers.cjs +1 -1
  158. package/dist/resolvers.d.cts +69 -3
  159. package/dist/resolvers.d.ts +69 -3
  160. package/dist/resolvers.js +1 -1
  161. package/dist/temporal.cjs +1 -1
  162. package/dist/temporal.js +1 -1
  163. package/dist/testing.cjs +2 -2
  164. package/dist/testing.cjs.map +1 -1
  165. package/dist/testing.d.cts +9 -9
  166. package/dist/testing.d.ts +9 -9
  167. package/dist/testing.js +1 -1
  168. package/dist/testing.js.map +1 -1
  169. package/dist/uom.cjs +1 -1
  170. package/dist/uom.d.cts +35 -2
  171. package/dist/uom.d.ts +35 -2
  172. package/dist/uom.js +1 -1
  173. package/dist/vm.cjs +1 -1
  174. package/dist/vm.d.cts +6 -6
  175. package/dist/vm.d.ts +6 -6
  176. package/dist/vm.js +1 -1
  177. package/dist/worker.cjs +2 -2
  178. package/dist/worker.cjs.map +1 -1
  179. package/dist/worker.d.cts +9 -9
  180. package/dist/worker.d.ts +9 -9
  181. package/dist/worker.js +1 -1
  182. package/dist/worker.js.map +1 -1
  183. package/package.json +1 -1
  184. package/dist/chunk-4DR5RBHQ.cjs +0 -2
  185. package/dist/chunk-4DR5RBHQ.cjs.map +0 -1
  186. package/dist/chunk-4IC5OARK.js +0 -3
  187. package/dist/chunk-4IC5OARK.js.map +0 -1
  188. package/dist/chunk-7ODHPWQC.js +0 -5
  189. package/dist/chunk-7ODHPWQC.js.map +0 -1
  190. package/dist/chunk-A755LVPT.cjs +0 -2
  191. package/dist/chunk-A755LVPT.cjs.map +0 -1
  192. package/dist/chunk-AF6NDOIE.js +0 -2
  193. package/dist/chunk-AF6NDOIE.js.map +0 -1
  194. package/dist/chunk-B2NL65FI.js +0 -2
  195. package/dist/chunk-B2NL65FI.js.map +0 -1
  196. package/dist/chunk-CB3EXUM2.js.map +0 -1
  197. package/dist/chunk-DUFEONVN.cjs +0 -3
  198. package/dist/chunk-DUFEONVN.cjs.map +0 -1
  199. package/dist/chunk-IJHL3LMH.js +0 -2
  200. package/dist/chunk-IJHL3LMH.js.map +0 -1
  201. package/dist/chunk-LCYQQFUH.cjs +0 -2
  202. package/dist/chunk-LCYQQFUH.cjs.map +0 -1
  203. package/dist/chunk-LP3JYC3A.js +0 -2
  204. package/dist/chunk-LP3JYC3A.js.map +0 -1
  205. package/dist/chunk-OE2DBN4K.js.map +0 -1
  206. package/dist/chunk-OKKGPINQ.cjs +0 -5
  207. package/dist/chunk-OKKGPINQ.cjs.map +0 -1
  208. package/dist/chunk-OM7NOHJF.cjs +0 -2
  209. package/dist/chunk-OM7NOHJF.cjs.map +0 -1
  210. package/dist/chunk-PTXUWGRR.js +0 -3
  211. package/dist/chunk-PTXUWGRR.js.map +0 -1
  212. package/dist/chunk-Q7TBBV62.cjs.map +0 -1
  213. package/dist/chunk-RELMEWY6.js.map +0 -1
  214. package/dist/chunk-SFM4XFGJ.js +0 -2
  215. package/dist/chunk-SFM4XFGJ.js.map +0 -1
  216. package/dist/chunk-SRAU3BLV.cjs +0 -3
  217. package/dist/chunk-SRAU3BLV.cjs.map +0 -1
  218. package/dist/chunk-SUAGBRQ7.cjs.map +0 -1
  219. package/dist/chunk-UNKZ5XRC.cjs +0 -2
  220. package/dist/chunk-UNKZ5XRC.cjs.map +0 -1
  221. package/dist/chunk-WU7SBKVU.cjs +0 -2
  222. package/dist/chunk-WU7SBKVU.cjs.map +0 -1
  223. package/dist/chunk-X5K72MBV.js +0 -2
  224. package/dist/chunk-X5K72MBV.js.map +0 -1
  225. package/dist/chunk-ZVPZQ66D.cjs +0 -2
  226. package/dist/chunk-ZVPZQ66D.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk5AKT36UK_cjs=require('./chunk-5AKT36UK.cjs'),chunkA764BY7L_cjs=require('./chunk-A764BY7L.cjs'),chunkE4HAKNBQ_cjs=require('./chunk-E4HAKNBQ.cjs'),chunkWU7SBKVU_cjs=require('./chunk-WU7SBKVU.cjs'),chunkYBQOQTVL_cjs=require('./chunk-YBQOQTVL.cjs'),chunkSUAGBRQ7_cjs=require('./chunk-SUAGBRQ7.cjs');var C=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(67),e.emitIndex(1);}};var S=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(68),e.emitIndex(1);}};function R(r,t){let o=r.peek();if(!o||o.type!=="IDENT"&&o.type!=="UNIT")throw chunkSUAGBRQ7_cjs.c.parsing("SYMBOLIC_REQUIRES_VARIABLE_NAME",`${t} needs the name of an unknown here, as in ${t}(x^2, x).`,{found:o?.type??"end of input"});return r.consume(),o.value}function A(r,t){r.emitOpcode(13),r.emitString(t);}function _(r,t,o){let e=new chunk5AKT36UK_cjs.d(t.pluginIndexMap);r.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),r.setBuilder(t);let n=e.build();if(n.hasAsync)throw chunkSUAGBRQ7_cjs.c.parsing("SYMBOLIC_ARGUMENT_MUST_BE_SYNCHRONOUS",`${o}'s expression must be synchronous (no weather/stocks/currency calls).`);return n}function g(r,t,o){let e=r.emitAnonymousBody([o],t);r.emitOpcode(159),r.emitIndex(e);}var k=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"solve"),i=t.match("EQUALS")?_(t,e,"solve"):null;t.consume("COMMA");let a=t.peek();if(!a||a.type!=="IDENT"&&a.type!=="UNIT")throw chunkSUAGBRQ7_cjs.c.parsing("SOLVE_REQUIRES_VARIABLE_NAME","solve's second argument must be the name of the unknown to solve for, as in solve(x^2-4=0, x).",{found:a?.type??"end of input"});t.consume(),g(e,n,a.value),i?g(e,i,a.value):(e.emitOpcode(10),e.emitNumber(0)),A(e,a.value),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(69),e.emitIndex(3);}};var b=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"der");t.consume("COMMA");let i=R(t,"der");g(e,n,i),A(e,i),t.match("COMMA")?t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e):(e.emitOpcode(10),e.emitNumber(1)),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(70),e.emitIndex(3);}};var F=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"integral");t.consume("COMMA");let i=R(t,"integral");g(e,n,i),A(e,i),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(71),e.emitIndex(2);}};var w=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"taylor");t.consume("COMMA");let i=R(t,"taylor");g(e,n,i),A(e,i),t.consume("EQUALS"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("COMMA"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(72),e.emitIndex(4);}};var Y=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=0;do t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),n++;while(t.match("COMMA"));t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(73),e.emitIndex(n);}};var v=class{constructor(){this.category="Symbolic";}parse(t,o,e){e.emitOpcode(10),e.emitNumber(Number(o.value)),e.emitOpcode(51),e.emitIndex(74),e.emitIndex(1);}};var U=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(75),e.emitIndex(1);}};var $=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(76),e.emitIndex(1);}};var z=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(77),e.emitIndex(1);}};var j=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(78),e.emitIndex(1);}};var G=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunk5AKT36UK_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(79),e.emitIndex(1);}};function ne(r=75){return {name:"symbolic:imaginary-literal",priority:r,shape:[{types:["NUMBER"]},{types:["IDENT"],values:["i"]}],match(t,o){let e=t[o];if(!e||e.type!=="NUMBER")return null;let n=t[o+1];return !n||n.type!=="IDENT"||n.value!=="i"||n.offset!==e.offset+e.value.length||t[o+2]?.type==="LPAREN"?null:{consumed:2,replacement:[new chunkWU7SBKVU_cjs.a("IMAGINARY",chunkYBQOQTVL_cjs.c("IMAGINARY"),e.value,e.value,e.offset,0,e.line,e.col)],ruleName:"symbolic:imaginary-literal"}}}}var ie={expand:"EXPAND_FN",factor:"FACTOR_FN",solve:"SOLVE_FN",der:"DER_FN",derivative:"DER_FN",integral:"INTEGRAL_FN",taylor:"TAYLOR_FN",jacobian:"JACOBIAN_FN",conj:"CONJ_FN",re:"RE_FN",im:"IM_FN",cancel:"CANCEL_FN",apart:"APART_FN"};function ae(r=80){return {name:"symbolic:call",priority:r,shape:[{types:["IDENT"],values:Object.keys(ie)},{types:["LPAREN"]}],match(t,o){let e=t[o];if(!e||e.type!=="IDENT")return null;let n=ie[e.value.toLowerCase()];return !n||t[o+1]?.type!=="LPAREN"?null:{consumed:1,replacement:[new chunkWU7SBKVU_cjs.a(n,chunkYBQOQTVL_cjs.c(n),e.value,e.value,e.offset,0,e.line,e.col)],ruleName:"symbolic:call"}}}}var se=[{word:"expand",tokenType:"EXPAND_FN",builtinIndex:67,example:"expand((x+1)*(x+2))",expected:"x^2+3x+2",docPage:"expanding.md"},{word:"factor",tokenType:"FACTOR_FN",builtinIndex:68,example:"factor(x^2-4)",expected:"(x-2)*(x+2)",docPage:"factoring.md"},{word:"solve",tokenType:"SOLVE_FN",builtinIndex:69,example:"solve(x^2-4=0, x)",expected:"= [-2, 2]",docPage:"solving-equations.md"},{word:"der",tokenType:"DER_FN",builtinIndex:70,example:"der(x^3, x)",expected:"3x^2",docPage:"calculus.md"},{word:"integral",tokenType:"INTEGRAL_FN",builtinIndex:71,example:"integral(x^2, x)",expected:"1/3x^3",docPage:"calculus.md"},{word:"taylor",tokenType:"TAYLOR_FN",builtinIndex:72,example:"taylor(exp(x), x=0, 3)",expected:"1/6x^3+0.5x^2+x+1",docPage:"calculus.md"},{word:"jacobian",tokenType:"JACOBIAN_FN",builtinIndex:73,example:"jacobian(x*y, x+y)",expected:"= [y, x; 1, 1]",docPage:"calculus.md"},{word:"conj",tokenType:"CONJ_FN",builtinIndex:75,example:"conj(2+3i)",expected:"2-3i",docPage:"complex.md"},{word:"re",tokenType:"RE_FN",builtinIndex:76,example:"re(2+3i)",expected:"= 2",docPage:"complex.md"},{word:"im",tokenType:"IM_FN",builtinIndex:77,example:"im(2+3i)",expected:"= 3",docPage:"complex.md"},{word:"cancel",tokenType:"CANCEL_FN",builtinIndex:78,example:"cancel((x^2-1)/(x-1))",expected:"x+1",docPage:"cancelling-fractions.md"},{word:"apart",tokenType:"APART_FN",builtinIndex:79,example:"apart((3x+5)/(x^2-1))",expected:"4/(x-1)-1/(x+1)",docPage:"splitting-fractions.md"}],Ce={name:"solve-symbolic",normalizerRules:[ae(),ne()],prefixParselets:{EXPAND_FN:new C,FACTOR_FN:new S,SOLVE_FN:new k,DER_FN:new b,INTEGRAL_FN:new F,TAYLOR_FN:new w,JACOBIAN_FN:new Y,IMAGINARY:new v,CONJ_FN:new U,RE_FN:new $,IM_FN:new z,CANCEL_FN:new j,APART_FN:new G},tokenCategories:{EXPAND_FN:"keyword",FACTOR_FN:"keyword",SOLVE_FN:"keyword",DER_FN:"keyword",INTEGRAL_FN:"keyword",TAYLOR_FN:"keyword",JACOBIAN_FN:"keyword",IMAGINARY:"number",CONJ_FN:"keyword",RE_FN:"keyword",IM_FN:"keyword",CANCEL_FN:"keyword",APART_FN:"keyword"}},Se=new Set(se.map(r=>r.tokenType));function ke(r){return r.some(t=>Se.has(t.type))}var be=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;function me(r,t){let o=r.trim();if(o.length>=2&&o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),!be.test(o))return null;let e=t.parseIso8601(o);return Number.isNaN(e)?null:e}var Fe=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;function mr(r){let t=Fe.exec(r.trim());if(t===null||t[1]===void 0)return {grain:"date"};let o=t[2];if(o===void 0)return {grain:"datetime"};if(o==="Z")return {grain:"instant",zone:chunkE4HAKNBQ_cjs.f(0)};let e=o[0]==="-"?-1:1,n=o.slice(1).replace(":",""),i=Number(n.slice(0,2))*60+Number(n.slice(2));return {grain:"instant",zone:chunkE4HAKNBQ_cjs.f(e*i)}}function lr(r,t){let o=t.fields(r),e=N=>String(N).padStart(2,"0"),n=o.year,i=e(o.month0+1),a=e(o.day),m=e(o.hour),d=e(o.minute),f=e(o.second),l=t.utcOffsetMinutes(r),p=l>=0?"+":"-",y=Math.abs(l),u=e(Math.floor(y/60)),s=e(y%60);return `${n}-${i}-${a}T${m}:${d}:${f}${p}${u}:${s}`}var we=1e12;function dr(r){return Math.abs(r)>=we?r:r*1e3}var Ye=Date.UTC(2026,3,3),le,h,K=new Map;function ve(){return typeof Intl=="object"&&Intl!==null?Intl.DateTimeFormat:void 0}function de(){let r=ve();r!==le&&(le=r,h=void 0,K.clear());}function Ue(){if(de(),h!==void 0)return h;try{let r=new Intl.DateTimeFormat("ja-JP").resolvedOptions().locale;h=typeof r=="string"&&r.startsWith("ja");}catch{h=false;}return h}function ce(){if(typeof Intl!="object"||Intl===null||typeof Intl.DateTimeFormat!="function")return null;try{let r=new Intl.DateTimeFormat().resolvedOptions().locale;return typeof r=="string"&&r.length>0?r:null}catch{return null}}function ue(r){de();let t=K.get(r);if(t!==void 0)return t;let o=$e(r);return K.set(r,o),o}function $e(r){if(typeof Intl!="object"||Intl===null||typeof Intl.DateTimeFormat!="function"||!Ue())return null;try{if(typeof Intl.DateTimeFormat.supportedLocalesOf=="function"&&Intl.DateTimeFormat.supportedLocalesOf([r]).length===0)return null;let t=new Intl.DateTimeFormat(r,{calendar:"gregory",numberingSystem:"latn",timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(Ye);if(!Array.isArray(t))return null;let o=t.filter(e=>e.type==="year"||e.type==="month"||e.type==="day").map(e=>e.type[0].toUpperCase()).join("");return o==="DMY"||o==="MDY"||o==="YMD"?o:null}catch{return null}}var M={DATE_INPUT_LOCALE_INVALID:"DATE_INPUT_LOCALE_INVALID",DATE_ORDER_MISMATCH:"DATE_ORDER_MISMATCH",DATE_NOT_A_CALENDAR_DAY:"DATE_NOT_A_CALENDAR_DAY"};function ze(r){if(typeof Intl!="object"||Intl===null||typeof Intl.getCanonicalLocales!="function")return true;try{return Intl.getCanonicalLocales(r),!0}catch{return false}}function Nr(r){let t=r.inputLocale;if(t!==void 0&&!ze(t))throw chunkSUAGBRQ7_cjs.c.config(M.DATE_INPUT_LOCALE_INVALID,`date.inputLocale "${t}" is not a BCP-47 locale tag. Use a tag Intl accepts, for example "en-US".`,{inputLocale:t});let o=r.onAmbiguous,e=r.inputOrder;if(e==="DMY"||e==="MDY"||e==="YMD")return Object.freeze({order:e,orderSource:"config",onAmbiguous:o});if(e==="locale"){let n=t??ce();if(n!=null){let i=ue(n);if(i!==null)return Object.freeze({order:i,orderSource:t!==void 0?"locale":"host-locale",locale:n,onAmbiguous:o})}return Object.freeze({order:"auto",orderSource:"fallback",onAmbiguous:o})}return Object.freeze({order:"auto",orderSource:"separator",onAmbiguous:o})}var fe=["January","February","March","April","May","June","July","August","September","October","November","December"],X=/^\d{1,2}$/,Z=/^\d{4}$/;function je(r,t,o,e){let n=X.test(r),i=X.test(t),a=X.test(o);return e==="hyphen"&&Z.test(r)&&i&&a?"iso":n&&i&&Z.test(o)?"year-last-4":e==="slash"&&Z.test(r)&&i&&a?"year-first-4":n&&i&&a?"short":"none"}function Ge(r){if(r.length===4)return Number(r);if(r.length===2){let t=Number(r);return t<=68?2e3+t:1900+t}return null}function O(r,t,o){return t<1||t>12||r<1?false:r<=chunkE4HAKNBQ_cjs.b(o,t-1)}function ye(r,t,o){return t<1||t>12?`there is no month ${t}`:r<1?`there is no day ${r}`:`${fe[t-1]} ${o} has ${chunkE4HAKNBQ_cjs.b(o,t-1)} days`}function P(r,t,o){return `${r} ${fe[t-1]} ${o}`}function Q(r,t,o){let e=n=>String(n).padStart(2,"0");return `${String(o).padStart(4,"0")}-${e(t)}-${e(r)}`}function V(r,t,o){return r==="DMY"?{day:Number(t),month:Number(o)}:{day:Number(o),month:Number(t)}}function D(r){return r==="DMY"?"day first":r==="MDY"?"month first":"year first"}function Ve(r){return r==="hyphen"?"MDY":"DMY"}function ee(r,t,o,e){let[n,i,a]=r.groups,m=je(n,i,a,r.separator),d=r.separator!=="dot",f=o==="refuse"||!d;if(m==="none")return {kind:"arithmetic"};if(m==="iso"){let T=Number(n),x=Number(i),I=Number(a);return O(I,x,T)?{kind:"date",day:I,month:x,year:T,order:"ISO",shortYear:false}:f?q(r.text,I,x,T):{kind:"arithmetic"}}if(m==="year-first-4"){if(t!=="YMD")return {kind:"arithmetic"};let T=Number(n),x=Number(i),I=Number(a);return O(I,x,T)?{kind:"date",day:I,month:x,year:T,order:"YMD",shortYear:false}:{kind:"arithmetic"}}let l=Ge(a);if(l===null)return {kind:"arithmetic"};let p=a.length===2;if(t==="YMD")return !f||m==="short"&&d?{kind:"arithmetic"}:He(r.text,n,i,l);let y=t==="auto"?Ve(r.separator):t,u=y==="DMY"?"MDY":"DMY",s=V(y,n,i),N=V(u,n,i);if(O(s.day,s.month,l)){let x=(N.day!==s.day||N.month!==s.month)&&O(N.day,N.month,l)?Q(N.day,N.month,l):void 0;return {kind:"date",day:s.day,month:s.month,year:l,order:y,shortYear:p,alternative:x}}return !f||m==="short"&&d?{kind:"arithmetic"}:O(N.day,N.month,l)?{kind:"refuse",code:M.DATE_ORDER_MISMATCH,message:`"${r.text}" is not a date read ${D(y)}: ${ye(s.day,s.month,l)}. Read ${D(u)} it is ${P(N.day,N.month,l)}. Set date.inputOrder to "${u}" to read numeric dates ${D(u)}.`}:q(r.text,s.day,s.month,l)}function q(r,t,o,e){return {kind:"refuse",code:M.DATE_NOT_A_CALENDAR_DAY,message:`"${r}" is not a real date: ${ye(t,o,e)}.`}}function He(r,t,o,e,n){let i=V("DMY",t,o),a=V("MDY",t,o),m=O(i.day,i.month,e),d=O(a.day,a.month,e);if(!m&&!d)return q(r,i.day,i.month,e);let f=`"${r}" is not a date read year first.`,l=i.day===a.day&&i.month===a.month;if(m&&d&&!l)return {kind:"refuse",code:M.DATE_ORDER_MISMATCH,message:`${f} Read day first it is ${P(i.day,i.month,e)} and month first ${P(a.day,a.month,e)}. Write it as ${Q(i.day,i.month,e)}, or set date.inputOrder to "DMY" or "MDY".`};let p=m?i:a,y=m?"DMY":"MDY";return {kind:"refuse",code:M.DATE_ORDER_MISMATCH,message:`${f} Read ${D(y)} it is ${P(p.day,p.month,e)}. Write it as ${Q(p.day,p.month,e)}, or set date.inputOrder to "${y}".`}}function Je(r,t){if(r.orderSource==="iso")return "ISO";if(r.orderSource==="spelled")return "with the month spelled out";let o=r.order===null||r.order==="ISO"||r.order==="spelled"?"as written":D(r.order);switch(r.orderSource){case "config":return `${o}, from date.inputOrder`;case "locale":return `${o}, from the locale ${r.locale}`;case "host-locale":return `${o}, from the host locale ${r.locale}`;case "fallback":return `${o}, the default for a ${t} date, because the host locale could not be read`;default:return `${o}, the default for a ${t} date`}}function pe(r){let[t,o,e]=r.split("-").map(Number);return P(e,o,t)}function We(r,t,o){if(r.iso===null)return o??`"${r.text}" is not a date this engine can read.`;let e=`${r.text} read as ${pe(r.iso)}, ${Je(r,t)}.`;if(r.alternative!==void 0&&r.order!==null&&r.order!=="ISO"&&r.order!=="spelled"){let n=r.order==="DMY"?"Month first":"Day first";e+=` ${n} would be ${pe(r.alternative)}.`;}return r.shortYear&&(e+=` The two-digit year ${r.text.slice(-2)} was read as ${r.iso.slice(0,4)}.`),e}function Ir(r,t,o){return {...r,note:We(r,t,o),needsNote:r.contested||r.shortYear||r.iso===null}}function xr(r){let t=/^(\d+)([/-])(\d+)\2(\d+)$/.exec(r);if(t!==null)return {text:r,groups:[t[1],t[3],t[4]],separator:t[2]==="-"?"hyphen":"slash"};let o=/^(\d{1,2})\.(\d{1,2})\.(\d{2}|\d{4})$/.exec(r);return o!==null?{text:r,groups:[o[1],o[2],o[3]],separator:"dot"}:null}var te="DATETIME_LITERAL",xe=chunkYBQOQTVL_cjs.c(te),Te="DATETIME_LITERAL_UNREADABLE",Ke=chunkYBQOQTVL_cjs.c(Te),H=/^\d+$/,Xe=/^\d{1,2}\.\d{1,2}$/,Ze=/^\.(\d{2}|\d{4})$/;function Qe(r){for(let t=0;t<r.length-1;t++){let o=r[t];if((o.sourceEnd??o.offset+o.text.length)!==r[t+1].offset)return false}return true}function Ne(r,t,o,e,n,i){if(t<1||t>12||r<1||r>31)return null;let a=i.localMidnight(o,t-1,r),m=i.fields(a);if(m.year!==o||m.month0!==t-1||m.day!==r)return null;let d=e[0],f=e.map(p=>p.value).join(""),l=new chunkWU7SBKVU_cjs.a(te,xe,String(a),f,d.offset,0,d.line,d.col);return {consumed:e.length,replacement:[l],ruleName:n}}function qe(r){let t="",o=-1;for(let e of r){let n=e.text??e.value;o>=0&&e.offset>o&&(t+=" "),t+=n,o=e.sourceEnd??e.offset+n.length;}return t}function Ie(r,t,o,e){let n=o[0],i=qe(o),a=new chunkWU7SBKVU_cjs.a(Te,Ke,i,i,n.offset,0,n.line,n.col);return a.fault={code:r,message:t},{consumed:o.length,replacement:[a],ruleName:e}}var et=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?/,tt=new Set(["NUMBER","MINUS","PLUS","COLON","IDENT"]),rt=16;function ot(r,t,o,e){let n=r[t];if(n.sourceEnd!==void 0)return null;let i=n.text,a=n.offset+n.text.length,m=[n];for(let u=t+1;u<r.length&&m.length<rt;u++){let s=r[u];if(s.sourceEnd!==void 0||s.offset!==a||!tt.has(s.type))break;i+=s.text,a=s.offset+s.text.length,m.push(s);}let d=et.exec(i);if(d===null)return null;let f=0,l=0;for(let u of m)if(l+=u.text.length,f++,l>=d[0].length)break;if(l!==d[0].length)return null;let p=me(d[0],e);if(p===null)return null;let y=new chunkWU7SBKVU_cjs.a(te,xe,String(p),d[0],n.offset,0,n.line,n.col,n.offset+d[0].length);return {consumed:f,replacement:[y],ruleName:o}}function Br(r=()=>"auto",t=()=>chunkA764BY7L_cjs.b,o=()=>"refuse"){return {name:"datetime:date-literal",priority:70,shape:[{types:["NUMBER"]}],match(e,n){let i=e[n];if(i.type!=="NUMBER")return null;let a=t();if(Xe.test(i.value)){let s=e[n+1];if(s&&s.type==="NUMBER"&&Ze.test(s.value)){let[N,T]=i.value.split("."),x={text:`${i.value}${s.value}`,groups:[N,T,s.value.slice(1)],separator:"dot"},I=ee(x,r(),o());if(I.kind==="date")return Ne(I.day,I.month,I.year,[i,s],"datetime:date-literal:dot",a);if(I.kind==="refuse")return Ie(I.code,I.message,[i,s],"datetime:date-literal:dot:unreadable")}return null}if(i.value.length===4&&H.test(i.value)){let s=ot(e,n,"datetime:date-literal:iso-timestamp",a);if(s)return s}if(!H.test(i.value))return null;let m=e[n+1];if(!m||m.type!=="SLASH"&&m.type!=="MINUS")return null;let d=e[n+2],f=e[n+3],l=e[n+4];if(!d||d.type!=="NUMBER"||!H.test(d.value)||!f||f.type!==m.type||!l||l.type!=="NUMBER"||!H.test(l.value))return null;let p=[i,m,d,f,l];if(!Qe(p))return null;let y={text:p.map(s=>s.value).join(""),groups:[i.value,d.value,l.value],separator:m.type==="MINUS"?"hyphen":"slash"},u=ee(y,r(),o());return u.kind==="arithmetic"?null:u.kind==="refuse"?Ie(u.code,u.message,p,"datetime:date-literal:unreadable"):Ne(u.day,u.month,u.year,p,`datetime:date-literal:${u.order.toLowerCase()}`,a)}}}exports.a=Ce;exports.b=ke;exports.c=me;exports.d=mr;exports.e=lr;exports.f=dr;exports.g=M;exports.h=Nr;exports.i=je;exports.j=ye;exports.k=Q;exports.l=ee;exports.m=Ir;exports.n=xr;exports.o=te;exports.p=Te;exports.q=Ne;exports.r=qe;exports.s=Ie;exports.t=Br;//# sourceMappingURL=chunk-WQGHJAW2.cjs.map
2
- //# sourceMappingURL=chunk-WQGHJAW2.cjs.map
1
+ 'use strict';var chunkK3PZ66XR_cjs=require('./chunk-K3PZ66XR.cjs'),chunkEQNKDTMX_cjs=require('./chunk-EQNKDTMX.cjs'),chunkE4HAKNBQ_cjs=require('./chunk-E4HAKNBQ.cjs'),chunk72J5V7SN_cjs=require('./chunk-72J5V7SN.cjs'),chunkYBQOQTVL_cjs=require('./chunk-YBQOQTVL.cjs'),chunk6SYU4MH7_cjs=require('./chunk-6SYU4MH7.cjs');var C=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(67),e.emitIndex(1);}};var S=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(68),e.emitIndex(1);}};function R(r,t){let o=r.peek();if(!o||o.type!=="IDENT"&&o.type!=="UNIT")throw chunk6SYU4MH7_cjs.c.parsing("SYMBOLIC_REQUIRES_VARIABLE_NAME",`${t} needs the name of an unknown here, as in ${t}(x^2, x).`,{found:o?.type??"end of input"});return r.consume(),o.value}function A(r,t){r.emitOpcode(13),r.emitString(t);}function _(r,t,o){let e=new chunkK3PZ66XR_cjs.d(t.pluginIndexMap);r.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),r.setBuilder(t);let n=e.build();if(n.hasAsync)throw chunk6SYU4MH7_cjs.c.parsing("SYMBOLIC_ARGUMENT_MUST_BE_SYNCHRONOUS",`${o}'s expression must be synchronous (no weather/stocks/currency calls).`);return n}function g(r,t,o){let e=r.emitAnonymousBody([o],t);r.emitOpcode(159),r.emitIndex(e);}var k=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"solve"),i=t.match("EQUALS")?_(t,e,"solve"):null;t.consume("COMMA");let a=t.peek();if(!a||a.type!=="IDENT"&&a.type!=="UNIT")throw chunk6SYU4MH7_cjs.c.parsing("SOLVE_REQUIRES_VARIABLE_NAME","solve's second argument must be the name of the unknown to solve for, as in solve(x^2-4=0, x).",{found:a?.type??"end of input"});t.consume(),g(e,n,a.value),i?g(e,i,a.value):(e.emitOpcode(10),e.emitNumber(0)),A(e,a.value),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(69),e.emitIndex(3);}};var b=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"der");t.consume("COMMA");let i=R(t,"der");g(e,n,i),A(e,i),t.match("COMMA")?t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e):(e.emitOpcode(10),e.emitNumber(1)),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(70),e.emitIndex(3);}};var F=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"integral");t.consume("COMMA");let i=R(t,"integral");g(e,n,i),A(e,i),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(71),e.emitIndex(2);}};var w=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=_(t,e,"taylor");t.consume("COMMA");let i=R(t,"taylor");g(e,n,i),A(e,i),t.consume("EQUALS"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("COMMA"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(72),e.emitIndex(4);}};var Y=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN");let n=0;do t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),n++;while(t.match("COMMA"));t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(73),e.emitIndex(n);}};var v=class{constructor(){this.category="Symbolic";}parse(t,o,e){e.emitOpcode(10),e.emitNumber(Number(o.value)),e.emitOpcode(51),e.emitIndex(74),e.emitIndex(1);}};var U=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(75),e.emitIndex(1);}};var $=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(76),e.emitIndex(1);}};var z=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(77),e.emitIndex(1);}};var j=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(78),e.emitIndex(1);}};var G=class{constructor(){this.category="Symbolic";}parse(t,o,e){t.consume("LPAREN"),t.parseExpression(chunkK3PZ66XR_cjs.a.Lowest,e),t.consume("RPAREN"),e.emitOpcode(51),e.emitIndex(79),e.emitIndex(1);}};function ne(r=75){return {name:"symbolic:imaginary-literal",priority:r,shape:[{types:["NUMBER"]},{types:["IDENT"],values:["i"]}],match(t,o){let e=t[o];if(!e||e.type!=="NUMBER")return null;let n=t[o+1];return !n||n.type!=="IDENT"||n.value!=="i"||n.offset!==e.offset+e.value.length||t[o+2]?.type==="LPAREN"?null:{consumed:2,replacement:[new chunk72J5V7SN_cjs.a("IMAGINARY",chunkYBQOQTVL_cjs.c("IMAGINARY"),e.value,e.value,e.offset,0,e.line,e.col)],ruleName:"symbolic:imaginary-literal"}}}}var ie={expand:"EXPAND_FN",factor:"FACTOR_FN",solve:"SOLVE_FN",der:"DER_FN",derivative:"DER_FN",integral:"INTEGRAL_FN",taylor:"TAYLOR_FN",jacobian:"JACOBIAN_FN",conj:"CONJ_FN",re:"RE_FN",im:"IM_FN",cancel:"CANCEL_FN",apart:"APART_FN"};function ae(r=80){return {name:"symbolic:call",priority:r,shape:[{types:["IDENT"],values:Object.keys(ie)},{types:["LPAREN"]}],match(t,o){let e=t[o];if(!e||e.type!=="IDENT")return null;let n=ie[e.value.toLowerCase()];return !n||t[o+1]?.type!=="LPAREN"?null:{consumed:1,replacement:[new chunk72J5V7SN_cjs.a(n,chunkYBQOQTVL_cjs.c(n),e.value,e.value,e.offset,0,e.line,e.col)],ruleName:"symbolic:call"}}}}var se=[{word:"expand",tokenType:"EXPAND_FN",builtinIndex:67,example:"expand((x+1)*(x+2))",expected:"x^2+3x+2",docPage:"expanding.md"},{word:"factor",tokenType:"FACTOR_FN",builtinIndex:68,example:"factor(x^2-4)",expected:"(x-2)*(x+2)",docPage:"factoring.md"},{word:"solve",tokenType:"SOLVE_FN",builtinIndex:69,example:"solve(x^2-4=0, x)",expected:"= [-2, 2]",docPage:"solving-equations.md"},{word:"der",tokenType:"DER_FN",builtinIndex:70,example:"der(x^3, x)",expected:"3x^2",docPage:"calculus.md"},{word:"integral",tokenType:"INTEGRAL_FN",builtinIndex:71,example:"integral(x^2, x)",expected:"1/3x^3",docPage:"calculus.md"},{word:"taylor",tokenType:"TAYLOR_FN",builtinIndex:72,example:"taylor(exp(x), x=0, 3)",expected:"1/6x^3+0.5x^2+x+1",docPage:"calculus.md"},{word:"jacobian",tokenType:"JACOBIAN_FN",builtinIndex:73,example:"jacobian(x*y, x+y)",expected:"= [y, x; 1, 1]",docPage:"calculus.md"},{word:"conj",tokenType:"CONJ_FN",builtinIndex:75,example:"conj(2+3i)",expected:"2-3i",docPage:"complex.md"},{word:"re",tokenType:"RE_FN",builtinIndex:76,example:"re(2+3i)",expected:"= 2",docPage:"complex.md"},{word:"im",tokenType:"IM_FN",builtinIndex:77,example:"im(2+3i)",expected:"= 3",docPage:"complex.md"},{word:"cancel",tokenType:"CANCEL_FN",builtinIndex:78,example:"cancel((x^2-1)/(x-1))",expected:"x+1",docPage:"cancelling-fractions.md"},{word:"apart",tokenType:"APART_FN",builtinIndex:79,example:"apart((3x+5)/(x^2-1))",expected:"4/(x-1)-1/(x+1)",docPage:"splitting-fractions.md"}],Ce={name:"solve-symbolic",normalizerRules:[ae(),ne()],prefixParselets:{EXPAND_FN:new C,FACTOR_FN:new S,SOLVE_FN:new k,DER_FN:new b,INTEGRAL_FN:new F,TAYLOR_FN:new w,JACOBIAN_FN:new Y,IMAGINARY:new v,CONJ_FN:new U,RE_FN:new $,IM_FN:new z,CANCEL_FN:new j,APART_FN:new G},tokenCategories:{EXPAND_FN:"keyword",FACTOR_FN:"keyword",SOLVE_FN:"keyword",DER_FN:"keyword",INTEGRAL_FN:"keyword",TAYLOR_FN:"keyword",JACOBIAN_FN:"keyword",IMAGINARY:"number",CONJ_FN:"keyword",RE_FN:"keyword",IM_FN:"keyword",CANCEL_FN:"keyword",APART_FN:"keyword"}},Se=new Set(se.map(r=>r.tokenType));function ke(r){return r.some(t=>Se.has(t.type))}var be=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;function me(r,t){let o=r.trim();if(o.length>=2&&o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),!be.test(o))return null;let e=t.parseIso8601(o);return Number.isNaN(e)?null:e}var Fe=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;function mr(r){let t=Fe.exec(r.trim());if(t===null||t[1]===void 0)return {grain:"date"};let o=t[2];if(o===void 0)return {grain:"datetime"};if(o==="Z")return {grain:"instant",zone:chunkE4HAKNBQ_cjs.f(0)};let e=o[0]==="-"?-1:1,n=o.slice(1).replace(":",""),i=Number(n.slice(0,2))*60+Number(n.slice(2));return {grain:"instant",zone:chunkE4HAKNBQ_cjs.f(e*i)}}function lr(r,t){let o=t.fields(r),e=N=>String(N).padStart(2,"0"),n=o.year,i=e(o.month0+1),a=e(o.day),m=e(o.hour),d=e(o.minute),f=e(o.second),l=t.utcOffsetMinutes(r),p=l>=0?"+":"-",y=Math.abs(l),u=e(Math.floor(y/60)),s=e(y%60);return `${n}-${i}-${a}T${m}:${d}:${f}${p}${u}:${s}`}var we=1e12;function dr(r){return Math.abs(r)>=we?r:r*1e3}var Ye=Date.UTC(2026,3,3),le,h,K=new Map;function ve(){return typeof Intl=="object"&&Intl!==null?Intl.DateTimeFormat:void 0}function de(){let r=ve();r!==le&&(le=r,h=void 0,K.clear());}function Ue(){if(de(),h!==void 0)return h;try{let r=new Intl.DateTimeFormat("ja-JP").resolvedOptions().locale;h=typeof r=="string"&&r.startsWith("ja");}catch{h=false;}return h}function ce(){if(typeof Intl!="object"||Intl===null||typeof Intl.DateTimeFormat!="function")return null;try{let r=new Intl.DateTimeFormat().resolvedOptions().locale;return typeof r=="string"&&r.length>0?r:null}catch{return null}}function ue(r){de();let t=K.get(r);if(t!==void 0)return t;let o=$e(r);return K.set(r,o),o}function $e(r){if(typeof Intl!="object"||Intl===null||typeof Intl.DateTimeFormat!="function"||!Ue())return null;try{if(typeof Intl.DateTimeFormat.supportedLocalesOf=="function"&&Intl.DateTimeFormat.supportedLocalesOf([r]).length===0)return null;let t=new Intl.DateTimeFormat(r,{calendar:"gregory",numberingSystem:"latn",timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(Ye);if(!Array.isArray(t))return null;let o=t.filter(e=>e.type==="year"||e.type==="month"||e.type==="day").map(e=>e.type[0].toUpperCase()).join("");return o==="DMY"||o==="MDY"||o==="YMD"?o:null}catch{return null}}var M={DATE_INPUT_LOCALE_INVALID:"DATE_INPUT_LOCALE_INVALID",DATE_ORDER_MISMATCH:"DATE_ORDER_MISMATCH",DATE_NOT_A_CALENDAR_DAY:"DATE_NOT_A_CALENDAR_DAY"};function ze(r){if(typeof Intl!="object"||Intl===null||typeof Intl.getCanonicalLocales!="function")return true;try{return Intl.getCanonicalLocales(r),!0}catch{return false}}function Nr(r){let t=r.inputLocale;if(t!==void 0&&!ze(t))throw chunk6SYU4MH7_cjs.c.config(M.DATE_INPUT_LOCALE_INVALID,`date.inputLocale "${t}" is not a BCP-47 locale tag. Use a tag Intl accepts, for example "en-US".`,{inputLocale:t});let o=r.onAmbiguous,e=r.inputOrder;if(e==="DMY"||e==="MDY"||e==="YMD")return Object.freeze({order:e,orderSource:"config",onAmbiguous:o});if(e==="locale"){let n=t??ce();if(n!=null){let i=ue(n);if(i!==null)return Object.freeze({order:i,orderSource:t!==void 0?"locale":"host-locale",locale:n,onAmbiguous:o})}return Object.freeze({order:"auto",orderSource:"fallback",onAmbiguous:o})}return Object.freeze({order:"auto",orderSource:"separator",onAmbiguous:o})}var fe=["January","February","March","April","May","June","July","August","September","October","November","December"],X=/^\d{1,2}$/,Z=/^\d{4}$/;function je(r,t,o,e){let n=X.test(r),i=X.test(t),a=X.test(o);return e==="hyphen"&&Z.test(r)&&i&&a?"iso":n&&i&&Z.test(o)?"year-last-4":e==="slash"&&Z.test(r)&&i&&a?"year-first-4":n&&i&&a?"short":"none"}function Ge(r){if(r.length===4)return Number(r);if(r.length===2){let t=Number(r);return t<=68?2e3+t:1900+t}return null}function O(r,t,o){return t<1||t>12||r<1?false:r<=chunkE4HAKNBQ_cjs.b(o,t-1)}function ye(r,t,o){return t<1||t>12?`there is no month ${t}`:r<1?`there is no day ${r}`:`${fe[t-1]} ${o} has ${chunkE4HAKNBQ_cjs.b(o,t-1)} days`}function P(r,t,o){return `${r} ${fe[t-1]} ${o}`}function Q(r,t,o){let e=n=>String(n).padStart(2,"0");return `${String(o).padStart(4,"0")}-${e(t)}-${e(r)}`}function V(r,t,o){return r==="DMY"?{day:Number(t),month:Number(o)}:{day:Number(o),month:Number(t)}}function D(r){return r==="DMY"?"day first":r==="MDY"?"month first":"year first"}function Ve(r){return r==="hyphen"?"MDY":"DMY"}function ee(r,t,o,e){let[n,i,a]=r.groups,m=je(n,i,a,r.separator),d=r.separator!=="dot",f=o==="refuse"||!d;if(m==="none")return {kind:"arithmetic"};if(m==="iso"){let T=Number(n),x=Number(i),I=Number(a);return O(I,x,T)?{kind:"date",day:I,month:x,year:T,order:"ISO",shortYear:false}:f?q(r.text,I,x,T):{kind:"arithmetic"}}if(m==="year-first-4"){if(t!=="YMD")return {kind:"arithmetic"};let T=Number(n),x=Number(i),I=Number(a);return O(I,x,T)?{kind:"date",day:I,month:x,year:T,order:"YMD",shortYear:false}:{kind:"arithmetic"}}let l=Ge(a);if(l===null)return {kind:"arithmetic"};let p=a.length===2;if(t==="YMD")return !f||m==="short"&&d?{kind:"arithmetic"}:He(r.text,n,i,l);let y=t==="auto"?Ve(r.separator):t,u=y==="DMY"?"MDY":"DMY",s=V(y,n,i),N=V(u,n,i);if(O(s.day,s.month,l)){let x=(N.day!==s.day||N.month!==s.month)&&O(N.day,N.month,l)?Q(N.day,N.month,l):void 0;return {kind:"date",day:s.day,month:s.month,year:l,order:y,shortYear:p,alternative:x}}return !f||m==="short"&&d?{kind:"arithmetic"}:O(N.day,N.month,l)?{kind:"refuse",code:M.DATE_ORDER_MISMATCH,message:`"${r.text}" is not a date read ${D(y)}: ${ye(s.day,s.month,l)}. Read ${D(u)} it is ${P(N.day,N.month,l)}. Set date.inputOrder to "${u}" to read numeric dates ${D(u)}.`}:q(r.text,s.day,s.month,l)}function q(r,t,o,e){return {kind:"refuse",code:M.DATE_NOT_A_CALENDAR_DAY,message:`"${r}" is not a real date: ${ye(t,o,e)}.`}}function He(r,t,o,e,n){let i=V("DMY",t,o),a=V("MDY",t,o),m=O(i.day,i.month,e),d=O(a.day,a.month,e);if(!m&&!d)return q(r,i.day,i.month,e);let f=`"${r}" is not a date read year first.`,l=i.day===a.day&&i.month===a.month;if(m&&d&&!l)return {kind:"refuse",code:M.DATE_ORDER_MISMATCH,message:`${f} Read day first it is ${P(i.day,i.month,e)} and month first ${P(a.day,a.month,e)}. Write it as ${Q(i.day,i.month,e)}, or set date.inputOrder to "DMY" or "MDY".`};let p=m?i:a,y=m?"DMY":"MDY";return {kind:"refuse",code:M.DATE_ORDER_MISMATCH,message:`${f} Read ${D(y)} it is ${P(p.day,p.month,e)}. Write it as ${Q(p.day,p.month,e)}, or set date.inputOrder to "${y}".`}}function Je(r,t){if(r.orderSource==="iso")return "ISO";if(r.orderSource==="spelled")return "with the month spelled out";let o=r.order===null||r.order==="ISO"||r.order==="spelled"?"as written":D(r.order);switch(r.orderSource){case "config":return `${o}, from date.inputOrder`;case "locale":return `${o}, from the locale ${r.locale}`;case "host-locale":return `${o}, from the host locale ${r.locale}`;case "fallback":return `${o}, the default for a ${t} date, because the host locale could not be read`;default:return `${o}, the default for a ${t} date`}}function pe(r){let[t,o,e]=r.split("-").map(Number);return P(e,o,t)}function We(r,t,o){if(r.iso===null)return o??`"${r.text}" is not a date this engine can read.`;let e=`${r.text} read as ${pe(r.iso)}, ${Je(r,t)}.`;if(r.alternative!==void 0&&r.order!==null&&r.order!=="ISO"&&r.order!=="spelled"){let n=r.order==="DMY"?"Month first":"Day first";e+=` ${n} would be ${pe(r.alternative)}.`;}return r.shortYear&&(e+=` The two-digit year ${r.text.slice(-2)} was read as ${r.iso.slice(0,4)}.`),e}function Ir(r,t,o){return {...r,note:We(r,t,o),needsNote:r.contested||r.shortYear||r.iso===null}}function xr(r){let t=/^(\d+)([/-])(\d+)\2(\d+)$/.exec(r);if(t!==null)return {text:r,groups:[t[1],t[3],t[4]],separator:t[2]==="-"?"hyphen":"slash"};let o=/^(\d{1,2})\.(\d{1,2})\.(\d{2}|\d{4})$/.exec(r);return o!==null?{text:r,groups:[o[1],o[2],o[3]],separator:"dot"}:null}var te="DATETIME_LITERAL",xe=chunkYBQOQTVL_cjs.c(te),Te="DATETIME_LITERAL_UNREADABLE",Ke=chunkYBQOQTVL_cjs.c(Te),H=/^\d+$/,Xe=/^\d{1,2}\.\d{1,2}$/,Ze=/^\.(\d{2}|\d{4})$/;function Qe(r){for(let t=0;t<r.length-1;t++){let o=r[t];if((o.sourceEnd??o.offset+o.text.length)!==r[t+1].offset)return false}return true}function Ne(r,t,o,e,n,i){if(t<1||t>12||r<1||r>31)return null;let a=i.localMidnight(o,t-1,r),m=i.fields(a);if(m.year!==o||m.month0!==t-1||m.day!==r)return null;let d=e[0],f=e.map(p=>p.value).join(""),l=new chunk72J5V7SN_cjs.a(te,xe,String(a),f,d.offset,0,d.line,d.col);return {consumed:e.length,replacement:[l],ruleName:n}}function qe(r){let t="",o=-1;for(let e of r){let n=e.text??e.value;o>=0&&e.offset>o&&(t+=" "),t+=n,o=e.sourceEnd??e.offset+n.length;}return t}function Ie(r,t,o,e){let n=o[0],i=qe(o),a=new chunk72J5V7SN_cjs.a(Te,Ke,i,i,n.offset,0,n.line,n.col);return a.fault={code:r,message:t},{consumed:o.length,replacement:[a],ruleName:e}}var et=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?/,tt=new Set(["NUMBER","MINUS","PLUS","COLON","IDENT"]),rt=16;function ot(r,t,o,e){let n=r[t];if(n.sourceEnd!==void 0)return null;let i=n.text,a=n.offset+n.text.length,m=[n];for(let u=t+1;u<r.length&&m.length<rt;u++){let s=r[u];if(s.sourceEnd!==void 0||s.offset!==a||!tt.has(s.type))break;i+=s.text,a=s.offset+s.text.length,m.push(s);}let d=et.exec(i);if(d===null)return null;let f=0,l=0;for(let u of m)if(l+=u.text.length,f++,l>=d[0].length)break;if(l!==d[0].length)return null;let p=me(d[0],e);if(p===null)return null;let y=new chunk72J5V7SN_cjs.a(te,xe,String(p),d[0],n.offset,0,n.line,n.col,n.offset+d[0].length);return {consumed:f,replacement:[y],ruleName:o}}function Br(r=()=>"auto",t=()=>chunkEQNKDTMX_cjs.b,o=()=>"refuse"){return {name:"datetime:date-literal",priority:70,shape:[{types:["NUMBER"]}],match(e,n){let i=e[n];if(i.type!=="NUMBER")return null;let a=t();if(Xe.test(i.value)){let s=e[n+1];if(s&&s.type==="NUMBER"&&Ze.test(s.value)){let[N,T]=i.value.split("."),x={text:`${i.value}${s.value}`,groups:[N,T,s.value.slice(1)],separator:"dot"},I=ee(x,r(),o());if(I.kind==="date")return Ne(I.day,I.month,I.year,[i,s],"datetime:date-literal:dot",a);if(I.kind==="refuse")return Ie(I.code,I.message,[i,s],"datetime:date-literal:dot:unreadable")}return null}if(i.value.length===4&&H.test(i.value)){let s=ot(e,n,"datetime:date-literal:iso-timestamp",a);if(s)return s}if(!H.test(i.value))return null;let m=e[n+1];if(!m||m.type!=="SLASH"&&m.type!=="MINUS")return null;let d=e[n+2],f=e[n+3],l=e[n+4];if(!d||d.type!=="NUMBER"||!H.test(d.value)||!f||f.type!==m.type||!l||l.type!=="NUMBER"||!H.test(l.value))return null;let p=[i,m,d,f,l];if(!Qe(p))return null;let y={text:p.map(s=>s.value).join(""),groups:[i.value,d.value,l.value],separator:m.type==="MINUS"?"hyphen":"slash"},u=ee(y,r(),o());return u.kind==="arithmetic"?null:u.kind==="refuse"?Ie(u.code,u.message,p,"datetime:date-literal:unreadable"):Ne(u.day,u.month,u.year,p,`datetime:date-literal:${u.order.toLowerCase()}`,a)}}}exports.a=Ce;exports.b=ke;exports.c=me;exports.d=mr;exports.e=lr;exports.f=dr;exports.g=M;exports.h=Nr;exports.i=je;exports.j=ye;exports.k=Q;exports.l=ee;exports.m=Ir;exports.n=xr;exports.o=te;exports.p=Te;exports.q=Ne;exports.r=qe;exports.s=Ie;exports.t=Br;//# sourceMappingURL=chunk-M4UC2PB6.cjs.map
2
+ //# sourceMappingURL=chunk-M4UC2PB6.cjs.map