solve-engine 2.25.0 → 2.26.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 (240) hide show
  1. package/dist/CalendarBackend-MdS3Bb4P.d.cts +181 -0
  2. package/dist/CalendarBackend-MdS3Bb4P.d.ts +181 -0
  3. package/dist/{Configuration-DnzYPmoK.d.cts → Configuration-BxriK9Kw.d.cts} +63 -4
  4. package/dist/{Configuration-DnzYPmoK.d.ts → Configuration-BxriK9Kw.d.ts} +63 -4
  5. package/dist/DateCalendar-B85t6Vk6.d.ts +90 -0
  6. package/dist/DateCalendar-CUGI1fT4.d.cts +90 -0
  7. package/dist/{EngineError-fR1K1rvx.d.cts → EngineError-C-kBwYlN.d.cts} +31 -4
  8. package/dist/{EngineError-fR1K1rvx.d.ts → EngineError-C-kBwYlN.d.ts} +31 -4
  9. package/dist/{FormattingSettings-bRKjU7wI.d.ts → FormattingSettings-ByO-4wiM.d.cts} +14 -0
  10. package/dist/{FormattingSettings-bRKjU7wI.d.cts → FormattingSettings-CvCzAfsz.d.ts} +14 -0
  11. package/dist/{Lexer-aB95pjoX.d.cts → Lexer-DhGhoAa2.d.cts} +13 -3
  12. package/dist/{Lexer-Bmctxl0n.d.ts → Lexer-DqtnZMC5.d.ts} +13 -3
  13. package/dist/{PackageCompatibility-CUVg8tmt.d.cts → PackageCompatibility-CNiTtC6S.d.cts} +1 -1
  14. package/dist/{PackageCompatibility-BludTs7v.d.ts → PackageCompatibility-fj_f7uqC.d.ts} +1 -1
  15. package/dist/{PackageRegistry-Dvn4i2QK.d.cts → PackageRegistry-BHBCFswo.d.cts} +328 -14
  16. package/dist/{PackageRegistry-DT-x32OM.d.ts → PackageRegistry-CNZUwWHJ.d.ts} +328 -14
  17. package/dist/{Parselet-BawfGuTF.d.cts → Parselet-DF3864la.d.cts} +19 -3
  18. package/dist/{Parselet-DqTbbtWA.d.ts → Parselet-Dgymjxzd.d.ts} +19 -3
  19. package/dist/{Token-CbP_OutD.d.cts → Token-D8f7yaz1.d.cts} +17 -0
  20. package/dist/{Token-CbP_OutD.d.ts → Token-D8f7yaz1.d.ts} +17 -0
  21. package/dist/{TokenNormalizer-CLBtiE8M.d.ts → TokenNormalizer-IF7nPRMp.d.ts} +1 -1
  22. package/dist/{TokenNormalizer-CjTDmHgB.d.cts → TokenNormalizer-Pe3_390t.d.cts} +1 -1
  23. package/dist/{ScopeManager-B636am7Y.d.ts → VMBuiltins-CZiZRKn-.d.ts} +91 -9
  24. package/dist/{ScopeManager-CdwX0VTw.d.cts → VMBuiltins-kv4rr0y5.d.cts} +91 -9
  25. package/dist/{VMCheckpoints-DDlxNssY.d.ts → VMCheckpoints-DXze6ypg.d.ts} +2 -2
  26. package/dist/{VMCheckpoints-CYqeq8IV.d.cts → VMCheckpoints-yun4ocSv.d.cts} +2 -2
  27. package/dist/{Value-Ds3Gy07C.d.cts → Value-BYHw-x7q.d.cts} +57 -1
  28. package/dist/{Value-Ds3Gy07C.d.ts → Value-BYHw-x7q.d.ts} +57 -1
  29. package/dist/{WorkerError-B1dF3VYT.d.cts → WorkerError-BLZyNq6M.d.cts} +1 -1
  30. package/dist/{WorkerError-dneODN-u.d.ts → WorkerError-CfBJYueR.d.ts} +1 -1
  31. package/dist/chunk-2SYYKQ4Q.cjs +2 -0
  32. package/dist/chunk-2SYYKQ4Q.cjs.map +1 -0
  33. package/dist/chunk-6EYKVQT3.cjs +2 -0
  34. package/dist/chunk-6EYKVQT3.cjs.map +1 -0
  35. package/dist/chunk-7RC6RBS6.cjs +2 -0
  36. package/dist/chunk-7RC6RBS6.cjs.map +1 -0
  37. package/dist/chunk-AZX4NTYN.cjs +3 -0
  38. package/dist/chunk-AZX4NTYN.cjs.map +1 -0
  39. package/dist/{chunk-JFZ5SLF7.js → chunk-BCR53EIL.js} +2 -2
  40. package/dist/{chunk-JFZ5SLF7.js.map → chunk-BCR53EIL.js.map} +1 -1
  41. package/dist/chunk-BLJ6E577.js +2 -0
  42. package/dist/chunk-BLJ6E577.js.map +1 -0
  43. package/dist/{chunk-4BAUQE6A.cjs → chunk-C5GEMKUY.cjs} +3 -3
  44. package/dist/{chunk-4BAUQE6A.cjs.map → chunk-C5GEMKUY.cjs.map} +1 -1
  45. package/dist/chunk-CL7DM2FX.js +2 -0
  46. package/dist/chunk-CL7DM2FX.js.map +1 -0
  47. package/dist/{chunk-BMXYR5LI.cjs → chunk-CQLCTKMX.cjs} +2 -2
  48. package/dist/{chunk-BMXYR5LI.cjs.map → chunk-CQLCTKMX.cjs.map} +1 -1
  49. package/dist/chunk-CQY23OF5.cjs +5 -0
  50. package/dist/chunk-CQY23OF5.cjs.map +1 -0
  51. package/dist/chunk-D4VBWPWN.js +2 -0
  52. package/dist/chunk-D4VBWPWN.js.map +1 -0
  53. package/dist/chunk-E4HAKNBQ.cjs +2 -0
  54. package/dist/chunk-E4HAKNBQ.cjs.map +1 -0
  55. package/dist/{chunk-XHQYHXRE.js → chunk-ESZNJQ2C.js} +3 -3
  56. package/dist/{chunk-XHQYHXRE.js.map → chunk-ESZNJQ2C.js.map} +1 -1
  57. package/dist/{chunk-IJMNVBIS.js → chunk-FAO6DQ74.js} +2 -2
  58. package/dist/chunk-FAO6DQ74.js.map +1 -0
  59. package/dist/{chunk-WGP4UUO5.cjs → chunk-FDKTESBC.cjs} +2 -2
  60. package/dist/{chunk-WGP4UUO5.cjs.map → chunk-FDKTESBC.cjs.map} +1 -1
  61. package/dist/{chunk-NEGZZB7F.cjs → chunk-G2V33LFM.cjs} +2 -2
  62. package/dist/{chunk-NEGZZB7F.cjs.map → chunk-G2V33LFM.cjs.map} +1 -1
  63. package/dist/chunk-GJZIJK2Q.cjs +2 -0
  64. package/dist/chunk-GJZIJK2Q.cjs.map +1 -0
  65. package/dist/chunk-GQM6ICDM.js +2 -0
  66. package/dist/chunk-GQM6ICDM.js.map +1 -0
  67. package/dist/chunk-GVL3ZMS7.cjs +2 -0
  68. package/dist/chunk-GVL3ZMS7.cjs.map +1 -0
  69. package/dist/{chunk-YBQPEWT7.cjs → chunk-GXO7TSXQ.cjs} +3 -3
  70. package/dist/chunk-GXO7TSXQ.cjs.map +1 -0
  71. package/dist/{chunk-OONQ3V3I.js → chunk-HANGBVEE.js} +2 -2
  72. package/dist/{chunk-OONQ3V3I.js.map → chunk-HANGBVEE.js.map} +1 -1
  73. package/dist/chunk-J4K72CQN.js +2 -0
  74. package/dist/chunk-J4K72CQN.js.map +1 -0
  75. package/dist/{chunk-72PYPENZ.js → chunk-LE6WZLJ4.js} +2 -2
  76. package/dist/{chunk-72PYPENZ.js.map → chunk-LE6WZLJ4.js.map} +1 -1
  77. package/dist/chunk-LMZDTQS5.js +3 -0
  78. package/dist/chunk-LMZDTQS5.js.map +1 -0
  79. package/dist/chunk-LQIRBP4Q.js +2 -0
  80. package/dist/chunk-LQIRBP4Q.js.map +1 -0
  81. package/dist/{chunk-RDYXH7ML.js → chunk-LTUYWJGO.js} +2 -2
  82. package/dist/{chunk-RDYXH7ML.js.map → chunk-LTUYWJGO.js.map} +1 -1
  83. package/dist/chunk-MCU7UYKG.js +3 -0
  84. package/dist/{chunk-ZDCZ5IDD.js.map → chunk-MCU7UYKG.js.map} +1 -1
  85. package/dist/chunk-MTN53APQ.js +5 -0
  86. package/dist/chunk-MTN53APQ.js.map +1 -0
  87. package/dist/chunk-OPKJ2WWB.cjs +3 -0
  88. package/dist/chunk-OPKJ2WWB.cjs.map +1 -0
  89. package/dist/chunk-QQHHZPEW.cjs +2 -0
  90. package/dist/chunk-QQHHZPEW.cjs.map +1 -0
  91. package/dist/chunk-RRUGQ6DM.js +2 -0
  92. package/dist/chunk-RRUGQ6DM.js.map +1 -0
  93. package/dist/chunk-S3ODNMJS.js +2 -0
  94. package/dist/chunk-S3ODNMJS.js.map +1 -0
  95. package/dist/{chunk-SAF3B3AX.cjs → chunk-SE6ZCGZ5.cjs} +2 -2
  96. package/dist/{chunk-SAF3B3AX.cjs.map → chunk-SE6ZCGZ5.cjs.map} +1 -1
  97. package/dist/chunk-TC23XEAV.js +2 -0
  98. package/dist/chunk-TC23XEAV.js.map +1 -0
  99. package/dist/{chunk-FYAMQFZZ.cjs → chunk-TMQ37JQY.cjs} +3 -3
  100. package/dist/{chunk-FYAMQFZZ.cjs.map → chunk-TMQ37JQY.cjs.map} +1 -1
  101. package/dist/chunk-TPPM4QSS.cjs +2 -0
  102. package/dist/chunk-TPPM4QSS.cjs.map +1 -0
  103. package/dist/{chunk-57PSJQQW.js → chunk-VB6QMU2W.js} +3 -3
  104. package/dist/chunk-VB6QMU2W.js.map +1 -0
  105. package/dist/chunk-VQO54ZMA.js +2 -0
  106. package/dist/chunk-VQO54ZMA.js.map +1 -0
  107. package/dist/{chunk-7DP57BA7.js → chunk-Y7XRA2EV.js} +2 -2
  108. package/dist/{chunk-7DP57BA7.js.map → chunk-Y7XRA2EV.js.map} +1 -1
  109. package/dist/{chunk-5IJD5L3O.cjs → chunk-YBQOQTVL.cjs} +2 -2
  110. package/dist/chunk-YBQOQTVL.cjs.map +1 -0
  111. package/dist/{chunk-EL2XUOWX.js → chunk-YG7UWQFV.js} +2 -2
  112. package/dist/{chunk-EL2XUOWX.js.map → chunk-YG7UWQFV.js.map} +1 -1
  113. package/dist/chunk-YS2OW75C.cjs +2 -0
  114. package/dist/chunk-YS2OW75C.cjs.map +1 -0
  115. package/dist/chunk-ZC2NPRLO.js +3 -0
  116. package/dist/chunk-ZC2NPRLO.js.map +1 -0
  117. package/dist/{chunk-FYTB7SDP.cjs → chunk-ZDJTDFTR.cjs} +2 -2
  118. package/dist/{chunk-FYTB7SDP.cjs.map → chunk-ZDJTDFTR.cjs.map} +1 -1
  119. package/dist/chunk-ZE5KKMBV.cjs +2 -0
  120. package/dist/chunk-ZE5KKMBV.cjs.map +1 -0
  121. package/dist/{chunk-GBCN7FNV.cjs → chunk-ZSLVLMO5.cjs} +2 -2
  122. package/dist/{chunk-GBCN7FNV.cjs.map → chunk-ZSLVLMO5.cjs.map} +1 -1
  123. package/dist/constants.cjs +1 -1
  124. package/dist/constants.d.cts +1 -1
  125. package/dist/constants.d.ts +1 -1
  126. package/dist/constants.js +1 -1
  127. package/dist/engine.cjs +1 -1
  128. package/dist/engine.d.cts +14 -12
  129. package/dist/engine.d.ts +14 -12
  130. package/dist/engine.js +1 -1
  131. package/dist/errors.cjs +1 -1
  132. package/dist/errors.d.cts +3 -3
  133. package/dist/errors.d.ts +3 -3
  134. package/dist/errors.js +1 -1
  135. package/dist/format.cjs +1 -1
  136. package/dist/format.d.cts +4 -3
  137. package/dist/format.d.ts +4 -3
  138. package/dist/format.js +1 -1
  139. package/dist/index.cjs +1 -1
  140. package/dist/index.cjs.map +1 -1
  141. package/dist/index.d.cts +15 -13
  142. package/dist/index.d.ts +15 -13
  143. package/dist/index.js +1 -1
  144. package/dist/index.js.map +1 -1
  145. package/dist/language.d.cts +12 -11
  146. package/dist/language.d.ts +12 -11
  147. package/dist/lexer.cjs +1 -1
  148. package/dist/lexer.d.cts +4 -4
  149. package/dist/lexer.d.ts +4 -4
  150. package/dist/lexer.js +1 -1
  151. package/dist/normalizer.cjs +1 -1
  152. package/dist/normalizer.d.cts +3 -3
  153. package/dist/normalizer.d.ts +3 -3
  154. package/dist/normalizer.js +1 -1
  155. package/dist/packages.cjs +1 -1
  156. package/dist/packages.d.cts +11 -10
  157. package/dist/packages.d.ts +11 -10
  158. package/dist/packages.js +1 -1
  159. package/dist/parser.cjs +1 -1
  160. package/dist/parser.d.cts +5 -4
  161. package/dist/parser.d.ts +5 -4
  162. package/dist/parser.js +1 -1
  163. package/dist/{pipeline-69q2tsLE.d.cts → pipeline-BYkKNpql.d.cts} +1 -1
  164. package/dist/{pipeline-DTqGLPsV.d.ts → pipeline-Cl7KW8CB.d.ts} +1 -1
  165. package/dist/resolvers.d.cts +2 -2
  166. package/dist/resolvers.d.ts +2 -2
  167. package/dist/temporal.cjs +2 -0
  168. package/dist/temporal.cjs.map +1 -0
  169. package/dist/temporal.d.cts +201 -0
  170. package/dist/temporal.d.ts +201 -0
  171. package/dist/temporal.js +2 -0
  172. package/dist/temporal.js.map +1 -0
  173. package/dist/testing.cjs +2 -2
  174. package/dist/testing.cjs.map +1 -1
  175. package/dist/testing.d.cts +12 -11
  176. package/dist/testing.d.ts +12 -11
  177. package/dist/testing.js +1 -1
  178. package/dist/testing.js.map +1 -1
  179. package/dist/uom.cjs +1 -1
  180. package/dist/uom.d.cts +2 -2
  181. package/dist/uom.d.ts +2 -2
  182. package/dist/uom.js +1 -1
  183. package/dist/vm.cjs +1 -1
  184. package/dist/vm.cjs.map +1 -1
  185. package/dist/vm.d.cts +8 -56
  186. package/dist/vm.d.ts +8 -56
  187. package/dist/vm.js +1 -1
  188. package/dist/vm.js.map +1 -1
  189. package/dist/worker.cjs +2 -2
  190. package/dist/worker.cjs.map +1 -1
  191. package/dist/worker.d.cts +35 -13
  192. package/dist/worker.d.ts +35 -13
  193. package/dist/worker.js +2 -2
  194. package/dist/worker.js.map +1 -1
  195. package/package.json +12 -1
  196. package/dist/chunk-4BRTUFTH.js +0 -2
  197. package/dist/chunk-4BRTUFTH.js.map +0 -1
  198. package/dist/chunk-4NZXCHQL.cjs +0 -2
  199. package/dist/chunk-4NZXCHQL.cjs.map +0 -1
  200. package/dist/chunk-57PSJQQW.js.map +0 -1
  201. package/dist/chunk-5IJD5L3O.cjs.map +0 -1
  202. package/dist/chunk-634ILVMP.cjs +0 -2
  203. package/dist/chunk-634ILVMP.cjs.map +0 -1
  204. package/dist/chunk-63ZOOUOL.js +0 -2
  205. package/dist/chunk-63ZOOUOL.js.map +0 -1
  206. package/dist/chunk-77KI7AKJ.cjs +0 -2
  207. package/dist/chunk-77KI7AKJ.cjs.map +0 -1
  208. package/dist/chunk-7N3IJSWF.js +0 -5
  209. package/dist/chunk-7N3IJSWF.js.map +0 -1
  210. package/dist/chunk-DUYTXLO2.js +0 -2
  211. package/dist/chunk-DUYTXLO2.js.map +0 -1
  212. package/dist/chunk-IJMNVBIS.js.map +0 -1
  213. package/dist/chunk-JSM3O7EM.cjs +0 -2
  214. package/dist/chunk-JSM3O7EM.cjs.map +0 -1
  215. package/dist/chunk-MZMA32NE.js +0 -3
  216. package/dist/chunk-MZMA32NE.js.map +0 -1
  217. package/dist/chunk-N4SSR7Q6.js +0 -2
  218. package/dist/chunk-N4SSR7Q6.js.map +0 -1
  219. package/dist/chunk-NMU5E7W7.js +0 -2
  220. package/dist/chunk-NMU5E7W7.js.map +0 -1
  221. package/dist/chunk-OB2VX4IL.js +0 -2
  222. package/dist/chunk-OB2VX4IL.js.map +0 -1
  223. package/dist/chunk-RAPEZR5L.cjs +0 -2
  224. package/dist/chunk-RAPEZR5L.cjs.map +0 -1
  225. package/dist/chunk-SPOVFRZO.cjs +0 -5
  226. package/dist/chunk-SPOVFRZO.cjs.map +0 -1
  227. package/dist/chunk-SQHBOWES.cjs +0 -2
  228. package/dist/chunk-SQHBOWES.cjs.map +0 -1
  229. package/dist/chunk-UF5XMZTT.js +0 -2
  230. package/dist/chunk-UF5XMZTT.js.map +0 -1
  231. package/dist/chunk-UV3EUIBT.cjs +0 -3
  232. package/dist/chunk-UV3EUIBT.cjs.map +0 -1
  233. package/dist/chunk-VMSCRVNX.cjs +0 -2
  234. package/dist/chunk-VMSCRVNX.cjs.map +0 -1
  235. package/dist/chunk-XBGK3TTU.cjs +0 -3
  236. package/dist/chunk-XBGK3TTU.cjs.map +0 -1
  237. package/dist/chunk-XX55RR4Q.js +0 -3
  238. package/dist/chunk-XX55RR4Q.js.map +0 -1
  239. package/dist/chunk-YBQPEWT7.cjs.map +0 -1
  240. package/dist/chunk-ZDCZ5IDD.js +0 -3
package/dist/lexer.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkBMXYR5LI_cjs=require('./chunk-BMXYR5LI.cjs');require('./chunk-Y7O4D3BJ.cjs');var chunk77KI7AKJ_cjs=require('./chunk-77KI7AKJ.cjs'),chunk5IJD5L3O_cjs=require('./chunk-5IJD5L3O.cjs'),chunkS3DFU33X_cjs=require('./chunk-S3DFU33X.cjs'),chunkJ4LSAHCY_cjs=require('./chunk-J4LSAHCY.cjs');require('./chunk-EZKR44MA.cjs'),require('./chunk-YBQPEWT7.cjs');var i=class{constructor(){this.classes=[];this.localeKeywordMap=null;this.localePhraseMap=null;this.unitNames=null;}register(e){this.classes.push(e);}unregister(e){this.classes=this.classes.filter(r=>r.tokenType!==e);}setLocale(e,r){this.localeKeywordMap=e,this.localePhraseMap=r??null;}setUnits(e){this.unitNames=e;}build(){let e=new Map;if(this.localeKeywordMap)for(let[s,t]of Object.entries(this.localeKeywordMap))e.set(s.toLowerCase(),t);let r=[...this.classes].sort((s,t)=>(s.priority??0)-(t.priority??0));for(let s of r)for(let t of Object.keys(s.keywords))e.set(t.toLowerCase(),s.tokenType);let o=this.buildPhraseTrie(),n=this.buildPhraseStartWords();return {keywordToType:e,phraseTrie:o,phraseStartWords:n,unitNames:this.unitNames??new Set}}buildPhraseTrie(){let e={children:new Map};if(this.localePhraseMap)for(let[r,o]of Object.entries(this.localePhraseMap))this.insertPhrase(e,r.toLowerCase(),o);for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases))this.insertPhrase(e,o.toLowerCase(),r.tokenType);return e.children.size>0?e:null}insertPhrase(e,r,o){let n=r.split(" "),s=e;for(let t of n)s.children.has(t)||s.children.set(t,{children:new Map}),s=s.children.get(t);s.type||(s.type=o);}buildPhraseStartWords(){let e=new Set;if(this.localePhraseMap)for(let r of Object.keys(this.localePhraseMap)){let o=r.split(" ")[0].toLowerCase();e.add(o);}for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases)){let n=o.split(" ")[0].toLowerCase();e.add(n);}return e}};function m(p="en"){let e=chunkS3DFU33X_cjs.a(p),r=new i;return r.setLocale(e.keywordMap,chunk77KI7AKJ_cjs.c),r.setUnits(chunkJ4LSAHCY_cjs.a),r.build()}Object.defineProperty(exports,"Lexer",{enumerable:true,get:function(){return chunkBMXYR5LI_cjs.b}});Object.defineProperty(exports,"LexerState",{enumerable:true,get:function(){return chunkBMXYR5LI_cjs.a}});Object.defineProperty(exports,"sharedLexer",{enumerable:true,get:function(){return chunkBMXYR5LI_cjs.c}});Object.defineProperty(exports,"ExpressionLexer",{enumerable:true,get:function(){return chunk77KI7AKJ_cjs.b}});Object.defineProperty(exports,"LexerToken",{enumerable:true,get:function(){return chunk77KI7AKJ_cjs.a}});Object.defineProperty(exports,"TokenTypes",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.a}});Object.defineProperty(exports,"registerAllTokenTypes",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.e}});Object.defineProperty(exports,"registerTokenType",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.b}});Object.defineProperty(exports,"tokenTypeId",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.c}});Object.defineProperty(exports,"tokenTypeName",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.d}});Object.defineProperty(exports,"knownUnits",{enumerable:true,get:function(){return chunkJ4LSAHCY_cjs.a}});exports.buildTokenLookup=m;//# sourceMappingURL=lexer.cjs.map
1
+ 'use strict';var chunkCQLCTKMX_cjs=require('./chunk-CQLCTKMX.cjs');require('./chunk-Y7O4D3BJ.cjs');var chunk6EYKVQT3_cjs=require('./chunk-6EYKVQT3.cjs'),chunkYBQOQTVL_cjs=require('./chunk-YBQOQTVL.cjs'),chunkS3DFU33X_cjs=require('./chunk-S3DFU33X.cjs'),chunkJ4LSAHCY_cjs=require('./chunk-J4LSAHCY.cjs');require('./chunk-EZKR44MA.cjs'),require('./chunk-GXO7TSXQ.cjs');var i=class{constructor(){this.classes=[];this.localeKeywordMap=null;this.localePhraseMap=null;this.unitNames=null;}register(e){this.classes.push(e);}unregister(e){this.classes=this.classes.filter(r=>r.tokenType!==e);}setLocale(e,r){this.localeKeywordMap=e,this.localePhraseMap=r??null;}setUnits(e){this.unitNames=e;}build(){let e=new Map;if(this.localeKeywordMap)for(let[s,t]of Object.entries(this.localeKeywordMap))e.set(s.toLowerCase(),t);let r=[...this.classes].sort((s,t)=>(s.priority??0)-(t.priority??0));for(let s of r)for(let t of Object.keys(s.keywords))e.set(t.toLowerCase(),s.tokenType);let o=this.buildPhraseTrie(),n=this.buildPhraseStartWords();return {keywordToType:e,phraseTrie:o,phraseStartWords:n,unitNames:this.unitNames??new Set}}buildPhraseTrie(){let e={children:new Map};if(this.localePhraseMap)for(let[r,o]of Object.entries(this.localePhraseMap))this.insertPhrase(e,r.toLowerCase(),o);for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases))this.insertPhrase(e,o.toLowerCase(),r.tokenType);return e.children.size>0?e:null}insertPhrase(e,r,o){let n=r.split(" "),s=e;for(let t of n)s.children.has(t)||s.children.set(t,{children:new Map}),s=s.children.get(t);s.type||(s.type=o);}buildPhraseStartWords(){let e=new Set;if(this.localePhraseMap)for(let r of Object.keys(this.localePhraseMap)){let o=r.split(" ")[0].toLowerCase();e.add(o);}for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases)){let n=o.split(" ")[0].toLowerCase();e.add(n);}return e}};function m(p="en"){let e=chunkS3DFU33X_cjs.a(p),r=new i;return r.setLocale(e.keywordMap,chunk6EYKVQT3_cjs.c),r.setUnits(chunkJ4LSAHCY_cjs.a),r.build()}Object.defineProperty(exports,"Lexer",{enumerable:true,get:function(){return chunkCQLCTKMX_cjs.b}});Object.defineProperty(exports,"LexerState",{enumerable:true,get:function(){return chunkCQLCTKMX_cjs.a}});Object.defineProperty(exports,"sharedLexer",{enumerable:true,get:function(){return chunkCQLCTKMX_cjs.c}});Object.defineProperty(exports,"ExpressionLexer",{enumerable:true,get:function(){return chunk6EYKVQT3_cjs.b}});Object.defineProperty(exports,"LexerToken",{enumerable:true,get:function(){return chunk6EYKVQT3_cjs.a}});Object.defineProperty(exports,"TokenTypes",{enumerable:true,get:function(){return chunkYBQOQTVL_cjs.a}});Object.defineProperty(exports,"registerAllTokenTypes",{enumerable:true,get:function(){return chunkYBQOQTVL_cjs.e}});Object.defineProperty(exports,"registerTokenType",{enumerable:true,get:function(){return chunkYBQOQTVL_cjs.b}});Object.defineProperty(exports,"tokenTypeId",{enumerable:true,get:function(){return chunkYBQOQTVL_cjs.c}});Object.defineProperty(exports,"tokenTypeName",{enumerable:true,get:function(){return chunkYBQOQTVL_cjs.d}});Object.defineProperty(exports,"knownUnits",{enumerable:true,get:function(){return chunkJ4LSAHCY_cjs.a}});exports.buildTokenLookup=m;//# sourceMappingURL=lexer.cjs.map
2
2
  //# sourceMappingURL=lexer.cjs.map
package/dist/lexer.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { T as TokenLookup } from './Lexer-aB95pjoX.cjs';
2
- export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-aB95pjoX.cjs';
3
- export { T as Token, a as TokenType, b as TokenTypes, r as registerAllTokenTypes, c as registerTokenType, t as tokenTypeId, d as tokenTypeName } from './Token-CbP_OutD.cjs';
4
- import './EngineError-fR1K1rvx.cjs';
1
+ import { T as TokenLookup } from './Lexer-DhGhoAa2.cjs';
2
+ export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-DhGhoAa2.cjs';
3
+ export { T as Token, a as TokenType, b as TokenTypes, r as registerAllTokenTypes, c as registerTokenType, t as tokenTypeId, d as tokenTypeName } from './Token-D8f7yaz1.cjs';
4
+ import './EngineError-C-kBwYlN.cjs';
5
5
 
6
6
  /**
7
7
  * The set of unit identifiers the lexer will turn into a UNIT token.
package/dist/lexer.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { T as TokenLookup } from './Lexer-Bmctxl0n.js';
2
- export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-Bmctxl0n.js';
3
- export { T as Token, a as TokenType, b as TokenTypes, r as registerAllTokenTypes, c as registerTokenType, t as tokenTypeId, d as tokenTypeName } from './Token-CbP_OutD.js';
4
- import './EngineError-fR1K1rvx.js';
1
+ import { T as TokenLookup } from './Lexer-DqtnZMC5.js';
2
+ export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-DqtnZMC5.js';
3
+ export { T as Token, a as TokenType, b as TokenTypes, r as registerAllTokenTypes, c as registerTokenType, t as tokenTypeId, d as tokenTypeName } from './Token-D8f7yaz1.js';
4
+ import './EngineError-C-kBwYlN.js';
5
5
 
6
6
  /**
7
7
  * The set of unit identifiers the lexer will turn into a UNIT token.
package/dist/lexer.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as Lexer,a as LexerState,c as sharedLexer}from'./chunk-7DP57BA7.js';import'./chunk-JPFCXLJV.js';import {c}from'./chunk-OB2VX4IL.js';export{b as ExpressionLexer,a as LexerToken}from'./chunk-OB2VX4IL.js';export{a as TokenTypes,e as registerAllTokenTypes,b as registerTokenType,c as tokenTypeId,d as tokenTypeName}from'./chunk-IJMNVBIS.js';import {a}from'./chunk-LHLW7JLS.js';import {a as a$1}from'./chunk-CHVGFTO3.js';export{a as knownUnits}from'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-57PSJQQW.js';var i=class{constructor(){this.classes=[];this.localeKeywordMap=null;this.localePhraseMap=null;this.unitNames=null;}register(e){this.classes.push(e);}unregister(e){this.classes=this.classes.filter(r=>r.tokenType!==e);}setLocale(e,r){this.localeKeywordMap=e,this.localePhraseMap=r??null;}setUnits(e){this.unitNames=e;}build(){let e=new Map;if(this.localeKeywordMap)for(let[s,t]of Object.entries(this.localeKeywordMap))e.set(s.toLowerCase(),t);let r=[...this.classes].sort((s,t)=>(s.priority??0)-(t.priority??0));for(let s of r)for(let t of Object.keys(s.keywords))e.set(t.toLowerCase(),s.tokenType);let o=this.buildPhraseTrie(),n=this.buildPhraseStartWords();return {keywordToType:e,phraseTrie:o,phraseStartWords:n,unitNames:this.unitNames??new Set}}buildPhraseTrie(){let e={children:new Map};if(this.localePhraseMap)for(let[r,o]of Object.entries(this.localePhraseMap))this.insertPhrase(e,r.toLowerCase(),o);for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases))this.insertPhrase(e,o.toLowerCase(),r.tokenType);return e.children.size>0?e:null}insertPhrase(e,r,o){let n=r.split(" "),s=e;for(let t of n)s.children.has(t)||s.children.set(t,{children:new Map}),s=s.children.get(t);s.type||(s.type=o);}buildPhraseStartWords(){let e=new Set;if(this.localePhraseMap)for(let r of Object.keys(this.localePhraseMap)){let o=r.split(" ")[0].toLowerCase();e.add(o);}for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases)){let n=o.split(" ")[0].toLowerCase();e.add(n);}return e}};function m(p="en"){let e=a(p),r=new i;return r.setLocale(e.keywordMap,c),r.setUnits(a$1),r.build()}export{m as buildTokenLookup};//# sourceMappingURL=lexer.js.map
1
+ export{b as Lexer,a as LexerState,c as sharedLexer}from'./chunk-Y7XRA2EV.js';import'./chunk-JPFCXLJV.js';import {c}from'./chunk-RRUGQ6DM.js';export{b as ExpressionLexer,a as LexerToken}from'./chunk-RRUGQ6DM.js';export{a as TokenTypes,e as registerAllTokenTypes,b as registerTokenType,c as tokenTypeId,d as tokenTypeName}from'./chunk-FAO6DQ74.js';import {a}from'./chunk-LHLW7JLS.js';import {a as a$1}from'./chunk-CHVGFTO3.js';export{a as knownUnits}from'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-VB6QMU2W.js';var i=class{constructor(){this.classes=[];this.localeKeywordMap=null;this.localePhraseMap=null;this.unitNames=null;}register(e){this.classes.push(e);}unregister(e){this.classes=this.classes.filter(r=>r.tokenType!==e);}setLocale(e,r){this.localeKeywordMap=e,this.localePhraseMap=r??null;}setUnits(e){this.unitNames=e;}build(){let e=new Map;if(this.localeKeywordMap)for(let[s,t]of Object.entries(this.localeKeywordMap))e.set(s.toLowerCase(),t);let r=[...this.classes].sort((s,t)=>(s.priority??0)-(t.priority??0));for(let s of r)for(let t of Object.keys(s.keywords))e.set(t.toLowerCase(),s.tokenType);let o=this.buildPhraseTrie(),n=this.buildPhraseStartWords();return {keywordToType:e,phraseTrie:o,phraseStartWords:n,unitNames:this.unitNames??new Set}}buildPhraseTrie(){let e={children:new Map};if(this.localePhraseMap)for(let[r,o]of Object.entries(this.localePhraseMap))this.insertPhrase(e,r.toLowerCase(),o);for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases))this.insertPhrase(e,o.toLowerCase(),r.tokenType);return e.children.size>0?e:null}insertPhrase(e,r,o){let n=r.split(" "),s=e;for(let t of n)s.children.has(t)||s.children.set(t,{children:new Map}),s=s.children.get(t);s.type||(s.type=o);}buildPhraseStartWords(){let e=new Set;if(this.localePhraseMap)for(let r of Object.keys(this.localePhraseMap)){let o=r.split(" ")[0].toLowerCase();e.add(o);}for(let r of this.classes)if(r.phrases)for(let o of Object.keys(r.phrases)){let n=o.split(" ")[0].toLowerCase();e.add(n);}return e}};function m(p="en"){let e=a(p),r=new i;return r.setLocale(e.keywordMap,c),r.setUnits(a$1),r.build()}export{m as buildTokenLookup};//# sourceMappingURL=lexer.js.map
2
2
  //# sourceMappingURL=lexer.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';require('./chunk-NGBBNL4K.cjs');var chunkGBCN7FNV_cjs=require('./chunk-GBCN7FNV.cjs'),chunk77KI7AKJ_cjs=require('./chunk-77KI7AKJ.cjs');require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-YBQPEWT7.cjs');Object.defineProperty(exports,"PhraseTrie",{enumerable:true,get:function(){return chunkGBCN7FNV_cjs.a}});Object.defineProperty(exports,"TokenNormalizer",{enumerable:true,get:function(){return chunkGBCN7FNV_cjs.c}});Object.defineProperty(exports,"createBuiltinNormalizerRules",{enumerable:true,get:function(){return chunkGBCN7FNV_cjs.f}});Object.defineProperty(exports,"createFusedToken",{enumerable:true,get:function(){return chunkGBCN7FNV_cjs.b}});Object.defineProperty(exports,"implicitMultiplyRule",{enumerable:true,get:function(){return chunkGBCN7FNV_cjs.d}});Object.defineProperty(exports,"BUILTIN_PHRASES",{enumerable:true,get:function(){return chunk77KI7AKJ_cjs.c}});//# sourceMappingURL=normalizer.cjs.map
1
+ 'use strict';require('./chunk-NGBBNL4K.cjs');var chunkZSLVLMO5_cjs=require('./chunk-ZSLVLMO5.cjs'),chunk6EYKVQT3_cjs=require('./chunk-6EYKVQT3.cjs');require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-GXO7TSXQ.cjs');Object.defineProperty(exports,"PhraseTrie",{enumerable:true,get:function(){return chunkZSLVLMO5_cjs.a}});Object.defineProperty(exports,"TokenNormalizer",{enumerable:true,get:function(){return chunkZSLVLMO5_cjs.c}});Object.defineProperty(exports,"createBuiltinNormalizerRules",{enumerable:true,get:function(){return chunkZSLVLMO5_cjs.f}});Object.defineProperty(exports,"createFusedToken",{enumerable:true,get:function(){return chunkZSLVLMO5_cjs.b}});Object.defineProperty(exports,"implicitMultiplyRule",{enumerable:true,get:function(){return chunkZSLVLMO5_cjs.d}});Object.defineProperty(exports,"BUILTIN_PHRASES",{enumerable:true,get:function(){return chunk6EYKVQT3_cjs.c}});//# sourceMappingURL=normalizer.cjs.map
2
2
  //# sourceMappingURL=normalizer.cjs.map
@@ -1,6 +1,6 @@
1
- import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-CjTDmHgB.cjs';
2
- export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-CjTDmHgB.cjs';
3
- import { T as Token } from './Token-CbP_OutD.cjs';
1
+ import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-Pe3_390t.cjs';
2
+ export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-Pe3_390t.cjs';
3
+ import { T as Token } from './Token-D8f7yaz1.cjs';
4
4
 
5
5
  /**
6
6
  * PhraseTrie, optimized word-level trie for multi-word phrase fusion.
@@ -1,6 +1,6 @@
1
- import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-CLBtiE8M.js';
2
- export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-CLBtiE8M.js';
3
- import { T as Token } from './Token-CbP_OutD.js';
1
+ import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-IF7nPRMp.js';
2
+ export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-IF7nPRMp.js';
3
+ import { T as Token } from './Token-D8f7yaz1.js';
4
4
 
5
5
  /**
6
6
  * PhraseTrie, optimized word-level trie for multi-word phrase fusion.
@@ -1,2 +1,2 @@
1
- import'./chunk-2RWAXT6O.js';export{a as PhraseTrie,c as TokenNormalizer,f as createBuiltinNormalizerRules,b as createFusedToken,d as implicitMultiplyRule}from'./chunk-72PYPENZ.js';export{c as BUILTIN_PHRASES}from'./chunk-OB2VX4IL.js';import'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-57PSJQQW.js';//# sourceMappingURL=normalizer.js.map
1
+ import'./chunk-2RWAXT6O.js';export{a as PhraseTrie,c as TokenNormalizer,f as createBuiltinNormalizerRules,b as createFusedToken,d as implicitMultiplyRule}from'./chunk-LE6WZLJ4.js';export{c as BUILTIN_PHRASES}from'./chunk-RRUGQ6DM.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-VB6QMU2W.js';//# sourceMappingURL=normalizer.js.map
2
2
  //# sourceMappingURL=normalizer.js.map
package/dist/packages.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkUV3EUIBT_cjs=require('./chunk-UV3EUIBT.cjs');require('./chunk-NEGZZB7F.cjs');var chunkRAPEZR5L_cjs=require('./chunk-RAPEZR5L.cjs');require('./chunk-FYTB7SDP.cjs'),require('./chunk-GBCN7FNV.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-634ILVMP.cjs'),require('./chunk-FYAMQFZZ.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-WGP4UUO5.cjs'),require('./chunk-SQHBOWES.cjs'),require('./chunk-ZKFCKAIX.cjs'),require('./chunk-77KI7AKJ.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-YBQPEWT7.cjs');Object.defineProperty(exports,"ARITHMETIC_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.a}});Object.defineProperty(exports,"BIGINT_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.n}});Object.defineProperty(exports,"BUILTIN_PACKAGES",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.z}});Object.defineProperty(exports,"CONDITIONALS_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.o}});Object.defineProperty(exports,"CONVERTERS_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.p}});Object.defineProperty(exports,"CURRENCY_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.j}});Object.defineProperty(exports,"DATETIME_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.d}});Object.defineProperty(exports,"DICE_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.f}});Object.defineProperty(exports,"FINANCE_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.r}});Object.defineProperty(exports,"FUNCTION_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.c}});Object.defineProperty(exports,"LINES_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.w}});Object.defineProperty(exports,"MAPREDUCE_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.m}});Object.defineProperty(exports,"MATHPHRASES_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.q}});Object.defineProperty(exports,"MATRIX_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.l}});Object.defineProperty(exports,"PERCENTAGE_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.b}});Object.defineProperty(exports,"TABLES_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.x}});Object.defineProperty(exports,"TAGS_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.y}});Object.defineProperty(exports,"TIME_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.e}});Object.defineProperty(exports,"UOM_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.h}});Object.defineProperty(exports,"VARIABLES_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.g}});Object.defineProperty(exports,"VECTOR_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.k}});Object.defineProperty(exports,"WEATHER_PACKAGE",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.s}});Object.defineProperty(exports,"createCryptoPackage",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.u}});Object.defineProperty(exports,"createCurrencyPackage",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.i}});Object.defineProperty(exports,"createKnowledgePackage",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.v}});Object.defineProperty(exports,"createStocksPackage",{enumerable:true,get:function(){return chunkUV3EUIBT_cjs.t}});Object.defineProperty(exports,"SYMBOLIC_PACKAGE",{enumerable:true,get:function(){return chunkRAPEZR5L_cjs.a}});//# sourceMappingURL=packages.cjs.map
1
+ 'use strict';var chunkOPKJ2WWB_cjs=require('./chunk-OPKJ2WWB.cjs');require('./chunk-G2V33LFM.cjs');var chunk7RC6RBS6_cjs=require('./chunk-7RC6RBS6.cjs');require('./chunk-ZDJTDFTR.cjs'),require('./chunk-ZSLVLMO5.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-QQHHZPEW.cjs'),require('./chunk-ZE5KKMBV.cjs'),require('./chunk-TMQ37JQY.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-FDKTESBC.cjs'),require('./chunk-TPPM4QSS.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-GJZIJK2Q.cjs'),require('./chunk-ZKFCKAIX.cjs'),require('./chunk-6EYKVQT3.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-GXO7TSXQ.cjs');Object.defineProperty(exports,"ARITHMETIC_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.a}});Object.defineProperty(exports,"BIGINT_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.n}});Object.defineProperty(exports,"BUILTIN_PACKAGES",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.z}});Object.defineProperty(exports,"CONDITIONALS_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.o}});Object.defineProperty(exports,"CONVERTERS_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.p}});Object.defineProperty(exports,"CURRENCY_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.j}});Object.defineProperty(exports,"DATETIME_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.d}});Object.defineProperty(exports,"DICE_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.f}});Object.defineProperty(exports,"FINANCE_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.r}});Object.defineProperty(exports,"FUNCTION_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.c}});Object.defineProperty(exports,"LINES_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.w}});Object.defineProperty(exports,"MAPREDUCE_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.m}});Object.defineProperty(exports,"MATHPHRASES_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.q}});Object.defineProperty(exports,"MATRIX_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.l}});Object.defineProperty(exports,"PERCENTAGE_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.b}});Object.defineProperty(exports,"TABLES_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.x}});Object.defineProperty(exports,"TAGS_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.y}});Object.defineProperty(exports,"TIME_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.e}});Object.defineProperty(exports,"UOM_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.h}});Object.defineProperty(exports,"VARIABLES_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.g}});Object.defineProperty(exports,"VECTOR_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.k}});Object.defineProperty(exports,"WEATHER_PACKAGE",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.s}});Object.defineProperty(exports,"createCryptoPackage",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.u}});Object.defineProperty(exports,"createCurrencyPackage",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.i}});Object.defineProperty(exports,"createKnowledgePackage",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.v}});Object.defineProperty(exports,"createStocksPackage",{enumerable:true,get:function(){return chunkOPKJ2WWB_cjs.t}});Object.defineProperty(exports,"SYMBOLIC_PACKAGE",{enumerable:true,get:function(){return chunk7RC6RBS6_cjs.a}});//# sourceMappingURL=packages.cjs.map
2
2
  //# sourceMappingURL=packages.cjs.map
@@ -1,16 +1,17 @@
1
- import { I as IEnginePackage } from './PackageRegistry-Dvn4i2QK.cjs';
2
- import './Parselet-BawfGuTF.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-BHBCFswo.cjs';
2
+ import './Parselet-DF3864la.cjs';
3
3
  import './BytecodeBuilder-DSWKZi4f.cjs';
4
- import './Token-CbP_OutD.cjs';
5
- import './pipeline-69q2tsLE.cjs';
6
- import './Value-Ds3Gy07C.cjs';
7
- import './Lexer-aB95pjoX.cjs';
8
- import './EngineError-fR1K1rvx.cjs';
4
+ import './Token-D8f7yaz1.cjs';
5
+ import './pipeline-BYkKNpql.cjs';
6
+ import './Value-BYHw-x7q.cjs';
7
+ import './CalendarBackend-MdS3Bb4P.cjs';
8
+ import './Lexer-DhGhoAa2.cjs';
9
+ import './EngineError-C-kBwYlN.cjs';
9
10
  import './resolvers.cjs';
10
11
  import '@tanstack/query-core';
11
- import './TokenNormalizer-CjTDmHgB.cjs';
12
- import './ScopeManager-CdwX0VTw.cjs';
13
- import './Configuration-DnzYPmoK.cjs';
12
+ import './TokenNormalizer-Pe3_390t.cjs';
13
+ import './VMBuiltins-kv4rr0y5.cjs';
14
+ import './Configuration-BxriK9Kw.cjs';
14
15
 
15
16
  /** Core arithmetic: numbers, `()` grouping, `pi`/`e` constants, `+ - * / % ^`, bitwise `<< >> & | ^`, and their `*_by` word forms. */
16
17
  declare const ARITHMETIC_PACKAGE: IEnginePackage;
@@ -1,16 +1,17 @@
1
- import { I as IEnginePackage } from './PackageRegistry-DT-x32OM.js';
2
- import './Parselet-DqTbbtWA.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-CNZUwWHJ.js';
2
+ import './Parselet-Dgymjxzd.js';
3
3
  import './BytecodeBuilder-DSWKZi4f.js';
4
- import './Token-CbP_OutD.js';
5
- import './pipeline-DTqGLPsV.js';
6
- import './Value-Ds3Gy07C.js';
7
- import './Lexer-Bmctxl0n.js';
8
- import './EngineError-fR1K1rvx.js';
4
+ import './Token-D8f7yaz1.js';
5
+ import './pipeline-Cl7KW8CB.js';
6
+ import './Value-BYHw-x7q.js';
7
+ import './CalendarBackend-MdS3Bb4P.js';
8
+ import './Lexer-DqtnZMC5.js';
9
+ import './EngineError-C-kBwYlN.js';
9
10
  import './resolvers.js';
10
11
  import '@tanstack/query-core';
11
- import './TokenNormalizer-CLBtiE8M.js';
12
- import './ScopeManager-B636am7Y.js';
13
- import './Configuration-DnzYPmoK.js';
12
+ import './TokenNormalizer-IF7nPRMp.js';
13
+ import './VMBuiltins-CZiZRKn-.js';
14
+ import './Configuration-BxriK9Kw.js';
14
15
 
15
16
  /** Core arithmetic: numbers, `()` grouping, `pi`/`e` constants, `+ - * / % ^`, bitwise `<< >> & | ^`, and their `*_by` word forms. */
16
17
  declare const ARITHMETIC_PACKAGE: IEnginePackage;
package/dist/packages.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as ARITHMETIC_PACKAGE,n as BIGINT_PACKAGE,z as BUILTIN_PACKAGES,o as CONDITIONALS_PACKAGE,p as CONVERTERS_PACKAGE,j as CURRENCY_PACKAGE,d as DATETIME_PACKAGE,f as DICE_PACKAGE,r as FINANCE_PACKAGE,c as FUNCTION_PACKAGE,w as LINES_PACKAGE,m as MAPREDUCE_PACKAGE,q as MATHPHRASES_PACKAGE,l as MATRIX_PACKAGE,b as PERCENTAGE_PACKAGE,x as TABLES_PACKAGE,y as TAGS_PACKAGE,e as TIME_PACKAGE,h as UOM_PACKAGE,g as VARIABLES_PACKAGE,k as VECTOR_PACKAGE,s as WEATHER_PACKAGE,u as createCryptoPackage,i as createCurrencyPackage,v as createKnowledgePackage,t as createStocksPackage}from'./chunk-MZMA32NE.js';import'./chunk-OONQ3V3I.js';export{a as SYMBOLIC_PACKAGE}from'./chunk-63ZOOUOL.js';import'./chunk-EL2XUOWX.js';import'./chunk-72PYPENZ.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-UF5XMZTT.js';import'./chunk-XHQYHXRE.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-RDYXH7ML.js';import'./chunk-NMU5E7W7.js';import'./chunk-4CNYGIND.js';import'./chunk-OB2VX4IL.js';import'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-57PSJQQW.js';//# sourceMappingURL=packages.js.map
1
+ export{a as ARITHMETIC_PACKAGE,n as BIGINT_PACKAGE,z as BUILTIN_PACKAGES,o as CONDITIONALS_PACKAGE,p as CONVERTERS_PACKAGE,j as CURRENCY_PACKAGE,d as DATETIME_PACKAGE,f as DICE_PACKAGE,r as FINANCE_PACKAGE,c as FUNCTION_PACKAGE,w as LINES_PACKAGE,m as MAPREDUCE_PACKAGE,q as MATHPHRASES_PACKAGE,l as MATRIX_PACKAGE,b as PERCENTAGE_PACKAGE,x as TABLES_PACKAGE,y as TAGS_PACKAGE,e as TIME_PACKAGE,h as UOM_PACKAGE,g as VARIABLES_PACKAGE,k as VECTOR_PACKAGE,s as WEATHER_PACKAGE,u as createCryptoPackage,i as createCurrencyPackage,v as createKnowledgePackage,t as createStocksPackage}from'./chunk-LMZDTQS5.js';import'./chunk-HANGBVEE.js';export{a as SYMBOLIC_PACKAGE}from'./chunk-S3ODNMJS.js';import'./chunk-YG7UWQFV.js';import'./chunk-LE6WZLJ4.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-CL7DM2FX.js';import'./chunk-D4VBWPWN.js';import'./chunk-ESZNJQ2C.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-LTUYWJGO.js';import'./chunk-BLJ6E577.js';import'./chunk-J4K72CQN.js';import'./chunk-LQIRBP4Q.js';import'./chunk-4CNYGIND.js';import'./chunk-RRUGQ6DM.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-VB6QMU2W.js';//# sourceMappingURL=packages.js.map
2
2
  //# sourceMappingURL=packages.js.map
package/dist/parser.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkVMSCRVNX_cjs=require('./chunk-VMSCRVNX.cjs');require('./chunk-HG4NPDN5.cjs');var chunkFYTB7SDP_cjs=require('./chunk-FYTB7SDP.cjs'),chunkABVDKMNF_cjs=require('./chunk-ABVDKMNF.cjs');require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-YBQPEWT7.cjs');Object.defineProperty(exports,"ParseletRegistry",{enumerable:true,get:function(){return chunkVMSCRVNX_cjs.b}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function(){return chunkVMSCRVNX_cjs.a}});Object.defineProperty(exports,"PrecedenceParser",{enumerable:true,get:function(){return chunkVMSCRVNX_cjs.a}});Object.defineProperty(exports,"sharedParseletRegistry",{enumerable:true,get:function(){return chunkVMSCRVNX_cjs.c}});Object.defineProperty(exports,"BindingPower",{enumerable:true,get:function(){return chunkFYTB7SDP_cjs.a}});Object.defineProperty(exports,"BytecodeBuilder",{enumerable:true,get:function(){return chunkFYTB7SDP_cjs.d}});Object.defineProperty(exports,"buildBindingPowerTable",{enumerable:true,get:function(){return chunkFYTB7SDP_cjs.b}});Object.defineProperty(exports,"invalidateBindingPowerTable",{enumerable:true,get:function(){return chunkFYTB7SDP_cjs.c}});Object.defineProperty(exports,"OpCode",{enumerable:true,get:function(){return chunkABVDKMNF_cjs.a}});Object.defineProperty(exports,"getOpCodeName",{enumerable:true,get:function(){return chunkABVDKMNF_cjs.b}});//# sourceMappingURL=parser.cjs.map
1
+ 'use strict';var chunk2SYYKQ4Q_cjs=require('./chunk-2SYYKQ4Q.cjs');require('./chunk-HG4NPDN5.cjs');var chunkZDJTDFTR_cjs=require('./chunk-ZDJTDFTR.cjs'),chunkABVDKMNF_cjs=require('./chunk-ABVDKMNF.cjs');require('./chunk-TPPM4QSS.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-GXO7TSXQ.cjs');Object.defineProperty(exports,"ParseletRegistry",{enumerable:true,get:function(){return chunk2SYYKQ4Q_cjs.b}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function(){return chunk2SYYKQ4Q_cjs.a}});Object.defineProperty(exports,"PrecedenceParser",{enumerable:true,get:function(){return chunk2SYYKQ4Q_cjs.a}});Object.defineProperty(exports,"sharedParseletRegistry",{enumerable:true,get:function(){return chunk2SYYKQ4Q_cjs.c}});Object.defineProperty(exports,"BindingPower",{enumerable:true,get:function(){return chunkZDJTDFTR_cjs.a}});Object.defineProperty(exports,"BytecodeBuilder",{enumerable:true,get:function(){return chunkZDJTDFTR_cjs.d}});Object.defineProperty(exports,"buildBindingPowerTable",{enumerable:true,get:function(){return chunkZDJTDFTR_cjs.b}});Object.defineProperty(exports,"invalidateBindingPowerTable",{enumerable:true,get:function(){return chunkZDJTDFTR_cjs.c}});Object.defineProperty(exports,"OpCode",{enumerable:true,get:function(){return chunkABVDKMNF_cjs.a}});Object.defineProperty(exports,"getOpCodeName",{enumerable:true,get:function(){return chunkABVDKMNF_cjs.b}});//# sourceMappingURL=parser.cjs.map
2
2
  //# sourceMappingURL=parser.cjs.map
package/dist/parser.d.cts CHANGED
@@ -1,8 +1,9 @@
1
- export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-BawfGuTF.cjs';
1
+ export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-DF3864la.cjs';
2
2
  export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-DSWKZi4f.cjs';
3
- import './Token-CbP_OutD.cjs';
4
- import './pipeline-69q2tsLE.cjs';
5
- import './Value-Ds3Gy07C.cjs';
3
+ import './Token-D8f7yaz1.cjs';
4
+ import './pipeline-BYkKNpql.cjs';
5
+ import './Value-BYHw-x7q.cjs';
6
+ import './CalendarBackend-MdS3Bb4P.cjs';
6
7
 
7
8
  /**
8
9
  * Named precedence levels for the Pratt parser, from loosest (`Lowest`) to
package/dist/parser.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-DqTbbtWA.js';
1
+ export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-Dgymjxzd.js';
2
2
  export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-DSWKZi4f.js';
3
- import './Token-CbP_OutD.js';
4
- import './pipeline-DTqGLPsV.js';
5
- import './Value-Ds3Gy07C.js';
3
+ import './Token-D8f7yaz1.js';
4
+ import './pipeline-Cl7KW8CB.js';
5
+ import './Value-BYHw-x7q.js';
6
+ import './CalendarBackend-MdS3Bb4P.js';
6
7
 
7
8
  /**
8
9
  * Named precedence levels for the Pratt parser, from loosest (`Lowest`) to
package/dist/parser.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as ParseletRegistry,a as Parser,a as PrecedenceParser,c as sharedParseletRegistry}from'./chunk-4BRTUFTH.js';import'./chunk-JP4JMQOG.js';export{a as BindingPower,d as BytecodeBuilder,b as buildBindingPowerTable,c as invalidateBindingPowerTable}from'./chunk-EL2XUOWX.js';export{a as OpCode,b as getOpCodeName}from'./chunk-TZYMXNIB.js';import'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';import'./chunk-57PSJQQW.js';//# sourceMappingURL=parser.js.map
1
+ export{b as ParseletRegistry,a as Parser,a as PrecedenceParser,c as sharedParseletRegistry}from'./chunk-VQO54ZMA.js';import'./chunk-JP4JMQOG.js';export{a as BindingPower,d as BytecodeBuilder,b as buildBindingPowerTable,c as invalidateBindingPowerTable}from'./chunk-YG7UWQFV.js';export{a as OpCode,b as getOpCodeName}from'./chunk-TZYMXNIB.js';import'./chunk-BLJ6E577.js';import'./chunk-J4K72CQN.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-VB6QMU2W.js';//# sourceMappingURL=parser.js.map
2
2
  //# sourceMappingURL=parser.js.map
@@ -1,4 +1,4 @@
1
- import { M as MatrixData, R as RangeData, C as ColourData, S as SplitData, f as ChartData, I as IpCidrData, g as SymbolicNode } from './Value-Ds3Gy07C.cjs';
1
+ import { M as MatrixData, R as RangeData, C as ColourData, S as SplitData, f as ChartData, I as IpCidrData, g as SymbolicNode } from './Value-BYHw-x7q.cjs';
2
2
 
3
3
  /** Base event, all events include a timestamp relative to pipeline start */
4
4
  interface BaseEvent {
@@ -1,4 +1,4 @@
1
- import { M as MatrixData, R as RangeData, C as ColourData, S as SplitData, f as ChartData, I as IpCidrData, g as SymbolicNode } from './Value-Ds3Gy07C.js';
1
+ import { M as MatrixData, R as RangeData, C as ColourData, S as SplitData, f as ChartData, I as IpCidrData, g as SymbolicNode } from './Value-BYHw-x7q.js';
2
2
 
3
3
  /** Base event, all events include a timestamp relative to pipeline start */
4
4
  interface BaseEvent {
@@ -1,7 +1,7 @@
1
1
  import { QueryClient } from '@tanstack/query-core';
2
- import { T as Token } from './Token-CbP_OutD.cjs';
2
+ import { T as Token } from './Token-D8f7yaz1.cjs';
3
3
  import { a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.cjs';
4
- import { V as Value } from './Value-Ds3Gy07C.cjs';
4
+ import { V as Value } from './Value-BYHw-x7q.cjs';
5
5
 
6
6
  /**
7
7
  * Result from a resolver's preflight() check.
@@ -1,7 +1,7 @@
1
1
  import { QueryClient } from '@tanstack/query-core';
2
- import { T as Token } from './Token-CbP_OutD.js';
2
+ import { T as Token } from './Token-D8f7yaz1.js';
3
3
  import { a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.js';
4
- import { V as Value } from './Value-Ds3Gy07C.js';
4
+ import { V as Value } from './Value-BYHw-x7q.js';
5
5
 
6
6
  /**
7
7
  * Result from a resolver's preflight() check.
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkZE5KKMBV_cjs=require('./chunk-ZE5KKMBV.cjs');require('./chunk-E4HAKNBQ.cjs'),require('./chunk-GXO7TSXQ.cjs');Object.defineProperty(exports,"TemporalCalendar",{enumerable:true,get:function(){return chunkZE5KKMBV_cjs.a}});Object.defineProperty(exports,"createTemporalCalendar",{enumerable:true,get:function(){return chunkZE5KKMBV_cjs.b}});//# sourceMappingURL=temporal.cjs.map
2
+ //# sourceMappingURL=temporal.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"temporal.cjs"}
@@ -0,0 +1,201 @@
1
+ import { C as CalendarBackend, a as CalendarFields, Z as ZonedFields } from './CalendarBackend-MdS3Bb4P.cjs';
2
+
3
+ /**
4
+ * The `Temporal` calendar backend: the engine's date questions answered
5
+ * through a `Temporal` implementation the host supplies, in a time zone the
6
+ * host chooses.
7
+ *
8
+ * `Temporal` is the JavaScript standard library's replacement for `Date`. It
9
+ * ships unflagged in Node 26 and in current Chrome, Firefox and Deno, but not
10
+ * in Safari nor in Node 22 and 24, and the smallest polyfill adds about twenty
11
+ * kilobytes gzipped to a bundle. The engine therefore imports no `Temporal`
12
+ * and no polyfill: this module is reached only through the
13
+ * `solve-engine/temporal` entry, and the host hands it the implementation to
14
+ * use, `globalThis.Temporal` on a runtime that has one or a polyfill's export.
15
+ * A host that never imports the entry pays nothing for it.
16
+ *
17
+ * The backend answers exactly what the `Date` backend answers. That is a
18
+ * design constraint rather than a hope: `Temporal` and `Date` differ in what
19
+ * they do with an out-of-range instant (`RangeError` against `NaN`), a
20
+ * fractional millisecond (a throw against truncation), a day past the end of
21
+ * a month (a clamp or a throw against a roll into the next month) and a year
22
+ * from 0 to 99 (read literally against read as the 1900s), and every one of
23
+ * those is reproduced here the way `Date` does it, because the engine's
24
+ * results are measured against `Date` and a host switching backends must see
25
+ * no result move. The differential suite under `__tests__/temporal/` is what
26
+ * holds that line.
27
+ *
28
+ * The one thing that does change is the zone. `Date` reads the process's own
29
+ * zone and nothing else; this backend reads the zone it was constructed with,
30
+ * so a document can be computed in Tokyo from a server in London, or in a
31
+ * zone the reader picks. That is the capability the backend adds, and the
32
+ * only observable difference.
33
+ *
34
+ * The named-zone display strings go through the same `Intl.DateTimeFormat`
35
+ * helpers the `Date` backend uses (`calendar/IntlZone.ts`), and the zone-free
36
+ * arithmetic through `calendar/Gregorian.ts`, so the two backends share one
37
+ * implementation wherever an answer does not depend on which backend is in
38
+ * use. The one piece of arithmetic `Date` keeps inside its own setters, the
39
+ * normalisation of overflowing fields, is written out in `CivilDays.ts`.
40
+ *
41
+ * @module TemporalCalendar
42
+ */
43
+
44
+ /**
45
+ * The part of a `Temporal.Instant` the backend reads: its epoch milliseconds,
46
+ * and the zoned date-time it shows in a named zone.
47
+ */
48
+ interface TemporalInstantLike {
49
+ readonly epochMilliseconds: number;
50
+ toZonedDateTimeISO(timeZone: string): TemporalZonedDateTimeLike;
51
+ }
52
+ /**
53
+ * The part of a `Temporal.ZonedDateTime` the backend reads: the calendar
54
+ * fields (a one-based month and an ISO weekday, Monday 1 to Sunday 7, both
55
+ * translated at the boundary), the offset, and the instant.
56
+ */
57
+ interface TemporalZonedDateTimeLike {
58
+ readonly year: number;
59
+ /** One-based month, 1 is January, as `Temporal` counts. */
60
+ readonly month: number;
61
+ readonly day: number;
62
+ /** ISO weekday: Monday is 1, Sunday is 7. */
63
+ readonly dayOfWeek: number;
64
+ readonly hour: number;
65
+ readonly minute: number;
66
+ readonly second: number;
67
+ readonly millisecond: number;
68
+ /** The zone's offset from UTC at this instant, in nanoseconds, positive when ahead. */
69
+ readonly offsetNanoseconds: number;
70
+ readonly epochMilliseconds: number;
71
+ /** The zone's canonical IANA identifier. */
72
+ readonly timeZoneId: string;
73
+ }
74
+ /** The part of a `Temporal.PlainDateTime` the backend uses: resolving a wall-clock time to an instant in a zone. */
75
+ interface TemporalPlainDateTimeLike {
76
+ toZonedDateTime(timeZone: string, options?: {
77
+ disambiguation?: "compatible" | "earlier" | "later" | "reject";
78
+ }): TemporalZonedDateTimeLike;
79
+ }
80
+ /** The wall-clock fields a `Temporal.PlainDateTime` is built from, with a one-based month. */
81
+ interface TemporalDateTimeFields {
82
+ year: number;
83
+ /** One-based month, 1 is January. */
84
+ month: number;
85
+ day: number;
86
+ hour: number;
87
+ minute: number;
88
+ second: number;
89
+ millisecond: number;
90
+ }
91
+ /**
92
+ * The subset of the `Temporal` namespace the backend uses, as a structural
93
+ * type, so the engine compiles and ships with no `Temporal` type installed
94
+ * and a host passes whichever implementation it has: `globalThis.Temporal`
95
+ * on Node 26 or a current browser, or the export of a polyfill such as
96
+ * `temporal-polyfill`. Both satisfy this shape as they are.
97
+ */
98
+ interface TemporalLike {
99
+ readonly Now: {
100
+ instant(): TemporalInstantLike;
101
+ timeZoneId(): string;
102
+ };
103
+ readonly Instant: {
104
+ fromEpochMilliseconds(epochMilliseconds: number): TemporalInstantLike;
105
+ };
106
+ readonly PlainDateTime: {
107
+ from(fields: TemporalDateTimeFields, options?: {
108
+ overflow?: "constrain" | "reject";
109
+ }): TemporalPlainDateTimeLike;
110
+ };
111
+ }
112
+ /** What {@link createTemporalCalendar} takes beside the implementation. */
113
+ interface TemporalCalendarOptions {
114
+ /**
115
+ * The IANA time zone the engine computes dates in (`"Asia/Tokyo"`,
116
+ * `"UTC"`). Defaults to the runtime's own zone, `Temporal.Now.timeZoneId()`,
117
+ * which is what the `Date` backend reads. A zone the implementation does
118
+ * not know is refused at construction with `TEMPORAL_TIME_ZONE_UNKNOWN`.
119
+ */
120
+ timeZone?: string;
121
+ /**
122
+ * The clock `now()` reads, in epoch milliseconds. Defaults to
123
+ * `Temporal.Now.instant()`. A test pins a date with this: a fake-timer
124
+ * library replaces `Date.now`, which the `Date` backend reads, but not
125
+ * `Temporal.Now`, so this backend needs telling separately.
126
+ */
127
+ now?: () => number;
128
+ }
129
+ /**
130
+ * A {@link CalendarBackend} over a `Temporal` implementation, computing in
131
+ * one named time zone. Build one with {@link createTemporalCalendar}.
132
+ *
133
+ * Every method answers what the `Date` backend answers for the same inputs
134
+ * when the zone is the process's own; see the module comment for the
135
+ * differences between `Temporal` and `Date` that are reproduced deliberately.
136
+ * The local methods answer `NaN` for an instant or a date the backend cannot
137
+ * represent and never throw; the four named-zone methods throw the runtime's
138
+ * `RangeError` for a zone it does not know or an instant it cannot represent,
139
+ * which is the contract the interface states.
140
+ */
141
+ declare class TemporalCalendar implements CalendarBackend {
142
+ /** The IANA zone every local answer is computed in, in its canonical spelling. */
143
+ readonly timeZone: string;
144
+ private readonly temporal;
145
+ private readonly clock;
146
+ constructor(temporal: TemporalLike, options?: TemporalCalendarOptions);
147
+ now(): number;
148
+ fields(epochMs: number): CalendarFields;
149
+ localMidnight(year: number, month0: number, day: number): number;
150
+ localWallClock(year: number, month0: number, day: number, minutesPastMidnight: number): number;
151
+ addDays(epochMs: number, days: number): number;
152
+ addMonths(epochMs: number, months: number): number;
153
+ utcOffsetMinutes(epochMs: number): number;
154
+ parseIso8601(text: string): number;
155
+ formatLongDate(epochMs: number, locale: string): string;
156
+ formatTimeOfDay(epochMs: number, locale: string): string;
157
+ zoneOffsetMinutes(zone: string, epochMs: number): number;
158
+ fieldsInZone(zone: string, epochMs: number): ZonedFields;
159
+ /** The IANA zone this backend computes in, which is what `CalendarBackend.zone` documents. */
160
+ zone(): string;
161
+ formatTimeInZone(zone: string, epochMs: number): string;
162
+ formatDateInZone(zone: string, epochMs: number): string;
163
+ /** The zoned date-time of an instant, or `null` where `Date` would answer `NaN`. */
164
+ private zoned;
165
+ /**
166
+ * The instant a set of local wall-clock fields names, with the fields
167
+ * normalised the way `Date`'s constructor and setters normalise them
168
+ * (month 12 is next January, day 0 the last of the month before, a year
169
+ * from 0 to 99 the 1900s) before the zone is consulted.
170
+ */
171
+ private wallClock;
172
+ /**
173
+ * Normalised wall-clock fields resolved to an instant in the backend's
174
+ * zone, clipped to the range `Date` represents only then, as `Date` clips
175
+ * last. `compatible` disambiguation is `Date`'s rule: a time in a
176
+ * spring-forward gap moves later by the gap, and a time that occurs twice
177
+ * on a fall-back day is its first occurrence.
178
+ */
179
+ private resolve;
180
+ }
181
+ /**
182
+ * A calendar backend over the host's `Temporal`, for the engine's `calendar`
183
+ * option.
184
+ *
185
+ * ```ts
186
+ * import { createEngine } from "solve-engine";
187
+ * import { createTemporalCalendar } from "solve-engine/temporal";
188
+ *
189
+ * const calendar = createTemporalCalendar(globalThis.Temporal, { timeZone: "Asia/Tokyo" });
190
+ * const engine = createEngine({ calendar });
191
+ * ```
192
+ *
193
+ * @param temporal - The `Temporal` implementation: `globalThis.Temporal` where the runtime ships one, or a polyfill's export.
194
+ * @param options - The zone to compute in and, for a test, the clock to read; see {@link TemporalCalendarOptions}.
195
+ * @returns A backend that computes every date in that zone and answers what the `Date` backend would in it.
196
+ * @throws `TEMPORAL_IMPLEMENTATION_INVALID` when `temporal` lacks the members the backend uses, and
197
+ * `TEMPORAL_TIME_ZONE_UNKNOWN` when the implementation does not know the zone asked for.
198
+ */
199
+ declare function createTemporalCalendar(temporal: TemporalLike, options?: TemporalCalendarOptions): TemporalCalendar;
200
+
201
+ export { CalendarBackend, CalendarFields, TemporalCalendar, type TemporalCalendarOptions, type TemporalDateTimeFields, type TemporalInstantLike, type TemporalLike, type TemporalPlainDateTimeLike, type TemporalZonedDateTimeLike, ZonedFields, createTemporalCalendar };