solve-engine 2.28.0 → 2.29.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 (152) hide show
  1. package/dist/{EngineError-CA2tiVaI.d.cts → EngineError-CqGtaT_v.d.cts} +4 -0
  2. package/dist/{EngineError-CA2tiVaI.d.ts → EngineError-CqGtaT_v.d.ts} +4 -0
  3. package/dist/{Lexer-B62Hn9I-.d.ts → Lexer-CqFjYoRA.d.ts} +1 -1
  4. package/dist/{Lexer-DOXatsjO.d.cts → Lexer-sCI05tqO.d.cts} +1 -1
  5. package/dist/{PackageCompatibility-DW18LqED.d.cts → PackageCompatibility-Bn-T_xKW.d.cts} +1 -1
  6. package/dist/{PackageCompatibility-DT1IPlQx.d.ts → PackageCompatibility-phvSFP4f.d.ts} +1 -1
  7. package/dist/{PackageRegistry-CevYUzRn.d.cts → PackageRegistry-B-C1duZw.d.cts} +3 -3
  8. package/dist/{PackageRegistry-Dl9kNP14.d.ts → PackageRegistry-C78jVkI9.d.ts} +3 -3
  9. package/dist/{VMBuiltins-AIivGl0a.d.cts → VMBuiltins-BkKzhj6C.d.cts} +1 -1
  10. package/dist/{VMBuiltins-CbuFfIgQ.d.ts → VMBuiltins-Du9y8sEo.d.ts} +1 -1
  11. package/dist/{VMCheckpoints-BVrJwfZY.d.cts → VMCheckpoints-WdUQrdc9.d.cts} +1 -1
  12. package/dist/{VMCheckpoints-DFCl63K5.d.ts → VMCheckpoints-gvy_yxYh.d.ts} +1 -1
  13. package/dist/{WorkerError-DDtwl4oH.d.cts → WorkerError-CRoM8Ju1.d.cts} +1 -1
  14. package/dist/{WorkerError-BuO9MrRr.d.ts → WorkerError-DTrl3Jag.d.ts} +1 -1
  15. package/dist/{chunk-IEBWLNI5.js → chunk-2PGGPFF3.js} +2 -2
  16. package/dist/{chunk-IEBWLNI5.js.map → chunk-2PGGPFF3.js.map} +1 -1
  17. package/dist/{chunk-I6WGOM3C.js → chunk-3ZGFAE3Q.js} +2 -2
  18. package/dist/{chunk-I6WGOM3C.js.map → chunk-3ZGFAE3Q.js.map} +1 -1
  19. package/dist/{chunk-UMW5PO42.cjs → chunk-4DR5RBHQ.cjs} +2 -2
  20. package/dist/{chunk-UMW5PO42.cjs.map → chunk-4DR5RBHQ.cjs.map} +1 -1
  21. package/dist/{chunk-FSNBYRNA.cjs → chunk-4PILWX4F.cjs} +3 -3
  22. package/dist/{chunk-FSNBYRNA.cjs.map → chunk-4PILWX4F.cjs.map} +1 -1
  23. package/dist/{chunk-WXOJ3DS3.cjs → chunk-5AKT36UK.cjs} +2 -2
  24. package/dist/{chunk-WXOJ3DS3.cjs.map → chunk-5AKT36UK.cjs.map} +1 -1
  25. package/dist/{chunk-APU5LON7.js → chunk-6K6ZW4B6.js} +3 -3
  26. package/dist/{chunk-APU5LON7.js.map → chunk-6K6ZW4B6.js.map} +1 -1
  27. package/dist/{chunk-MKBB7IVN.cjs → chunk-7DJYS5PO.cjs} +2 -2
  28. package/dist/{chunk-MKBB7IVN.cjs.map → chunk-7DJYS5PO.cjs.map} +1 -1
  29. package/dist/{chunk-KYE5BWPN.cjs → chunk-A755LVPT.cjs} +2 -2
  30. package/dist/{chunk-KYE5BWPN.cjs.map → chunk-A755LVPT.cjs.map} +1 -1
  31. package/dist/{chunk-5J2XDCSV.cjs → chunk-A764BY7L.cjs} +2 -2
  32. package/dist/{chunk-5J2XDCSV.cjs.map → chunk-A764BY7L.cjs.map} +1 -1
  33. package/dist/{chunk-TTHCH7V2.cjs → chunk-AGCNMEP2.cjs} +2 -2
  34. package/dist/{chunk-TTHCH7V2.cjs.map → chunk-AGCNMEP2.cjs.map} +1 -1
  35. package/dist/{chunk-MONPHAHO.js → chunk-B2NL65FI.js} +2 -2
  36. package/dist/{chunk-MONPHAHO.js.map → chunk-B2NL65FI.js.map} +1 -1
  37. package/dist/{chunk-RRJ77SF6.js → chunk-CB3EXUM2.js} +2 -2
  38. package/dist/{chunk-RRJ77SF6.js.map → chunk-CB3EXUM2.js.map} +1 -1
  39. package/dist/{chunk-OKSAUK5C.js → chunk-CDE2ZUGG.js} +2 -2
  40. package/dist/{chunk-OKSAUK5C.js.map → chunk-CDE2ZUGG.js.map} +1 -1
  41. package/dist/{chunk-YLTNXYA7.cjs → chunk-CM2WM5CM.cjs} +2 -2
  42. package/dist/{chunk-YLTNXYA7.cjs.map → chunk-CM2WM5CM.cjs.map} +1 -1
  43. package/dist/chunk-CT3PD7L3.cjs +3 -0
  44. package/dist/chunk-CT3PD7L3.cjs.map +1 -0
  45. package/dist/{chunk-2YNRIT2L.cjs → chunk-DUFEONVN.cjs} +3 -3
  46. package/dist/{chunk-2YNRIT2L.cjs.map → chunk-DUFEONVN.cjs.map} +1 -1
  47. package/dist/{chunk-7ASISMXA.js → chunk-FXB5GCBT.js} +2 -2
  48. package/dist/{chunk-7ASISMXA.js.map → chunk-FXB5GCBT.js.map} +1 -1
  49. package/dist/{chunk-2RLNVS6G.js → chunk-G3POUURF.js} +2 -2
  50. package/dist/{chunk-2RLNVS6G.js.map → chunk-G3POUURF.js.map} +1 -1
  51. package/dist/{chunk-2G3AW6OQ.cjs → chunk-GWV273KZ.cjs} +2 -2
  52. package/dist/{chunk-2G3AW6OQ.cjs.map → chunk-GWV273KZ.cjs.map} +1 -1
  53. package/dist/{chunk-N22D5ZD4.js → chunk-IQVSCL2R.js} +3 -3
  54. package/dist/{chunk-N22D5ZD4.js.map → chunk-IQVSCL2R.js.map} +1 -1
  55. package/dist/{chunk-IIBR4LVH.cjs → chunk-IY3GI2AM.cjs} +4 -4
  56. package/dist/{chunk-IIBR4LVH.cjs.map → chunk-IY3GI2AM.cjs.map} +1 -1
  57. package/dist/{chunk-6T5HPIZX.js → chunk-KH4QXKLT.js} +2 -2
  58. package/dist/{chunk-6T5HPIZX.js.map → chunk-KH4QXKLT.js.map} +1 -1
  59. package/dist/{chunk-OLATJABN.js → chunk-LP3JYC3A.js} +2 -2
  60. package/dist/{chunk-OLATJABN.js.map → chunk-LP3JYC3A.js.map} +1 -1
  61. package/dist/{chunk-A7RRWNLE.js → chunk-NQFCXLEF.js} +2 -2
  62. package/dist/{chunk-A7RRWNLE.js.map → chunk-NQFCXLEF.js.map} +1 -1
  63. package/dist/{chunk-O5ZLOZPH.cjs → chunk-OM7NOHJF.cjs} +2 -2
  64. package/dist/{chunk-O5ZLOZPH.cjs.map → chunk-OM7NOHJF.cjs.map} +1 -1
  65. package/dist/{chunk-QXGKONTZ.cjs → chunk-P43SV4NJ.cjs} +3 -3
  66. package/dist/{chunk-QXGKONTZ.cjs.map → chunk-P43SV4NJ.cjs.map} +1 -1
  67. package/dist/{chunk-DDVDRWCK.js → chunk-PTXUWGRR.js} +3 -3
  68. package/dist/{chunk-DDVDRWCK.js.map → chunk-PTXUWGRR.js.map} +1 -1
  69. package/dist/{chunk-GWEINEJG.cjs → chunk-Q7TBBV62.cjs} +2 -2
  70. package/dist/{chunk-GWEINEJG.cjs.map → chunk-Q7TBBV62.cjs.map} +1 -1
  71. package/dist/{chunk-POIHAKBX.js → chunk-QOEO7CKE.js} +2 -2
  72. package/dist/{chunk-POIHAKBX.js.map → chunk-QOEO7CKE.js.map} +1 -1
  73. package/dist/chunk-RAFOQ4T5.cjs +2 -0
  74. package/dist/{chunk-5NQE5JMU.cjs.map → chunk-RAFOQ4T5.cjs.map} +1 -1
  75. package/dist/{chunk-Z5DA5UXY.js → chunk-RELMEWY6.js} +2 -2
  76. package/dist/chunk-RELMEWY6.js.map +1 -0
  77. package/dist/{chunk-Z5VBXZ4A.js → chunk-SFM4XFGJ.js} +2 -2
  78. package/dist/{chunk-Z5VBXZ4A.js.map → chunk-SFM4XFGJ.js.map} +1 -1
  79. package/dist/{chunk-HTAT4MGN.cjs → chunk-SUAGBRQ7.cjs} +2 -2
  80. package/dist/chunk-SUAGBRQ7.cjs.map +1 -0
  81. package/dist/chunk-SYJAH6CD.js +3 -0
  82. package/dist/chunk-SYJAH6CD.js.map +1 -0
  83. package/dist/{chunk-JHHSQ2YR.js → chunk-TBAUKHEC.js} +3 -3
  84. package/dist/{chunk-JHHSQ2YR.js.map → chunk-TBAUKHEC.js.map} +1 -1
  85. package/dist/{chunk-7ZYYWSLT.js → chunk-VLX7ZVK4.js} +2 -2
  86. package/dist/{chunk-7ZYYWSLT.js.map → chunk-VLX7ZVK4.js.map} +1 -1
  87. package/dist/{chunk-W5BBKLNS.cjs → chunk-WQGHJAW2.cjs} +2 -2
  88. package/dist/{chunk-W5BBKLNS.cjs.map → chunk-WQGHJAW2.cjs.map} +1 -1
  89. package/dist/{chunk-U7CNADCJ.cjs → chunk-WU7SBKVU.cjs} +2 -2
  90. package/dist/{chunk-U7CNADCJ.cjs.map → chunk-WU7SBKVU.cjs.map} +1 -1
  91. package/dist/{chunk-LV7PJ2MU.js → chunk-X5K72MBV.js} +2 -2
  92. package/dist/{chunk-LV7PJ2MU.js.map → chunk-X5K72MBV.js.map} +1 -1
  93. package/dist/{chunk-IAL64FCP.js → chunk-YN5H54GM.js} +2 -2
  94. package/dist/{chunk-IAL64FCP.js.map → chunk-YN5H54GM.js.map} +1 -1
  95. package/dist/{chunk-UBKWHRFL.cjs → chunk-YWF6C2IO.cjs} +2 -2
  96. package/dist/{chunk-UBKWHRFL.cjs.map → chunk-YWF6C2IO.cjs.map} +1 -1
  97. package/dist/{chunk-RVNW627Y.cjs → chunk-ZBMWLTE6.cjs} +2 -2
  98. package/dist/{chunk-RVNW627Y.cjs.map → chunk-ZBMWLTE6.cjs.map} +1 -1
  99. package/dist/constants.cjs +1 -1
  100. package/dist/constants.js +1 -1
  101. package/dist/engine.cjs +1 -1
  102. package/dist/engine.d.cts +6 -6
  103. package/dist/engine.d.ts +6 -6
  104. package/dist/engine.js +1 -1
  105. package/dist/errors.cjs +1 -1
  106. package/dist/errors.d.cts +3 -3
  107. package/dist/errors.d.ts +3 -3
  108. package/dist/errors.js +1 -1
  109. package/dist/format.cjs +1 -1
  110. package/dist/format.js +1 -1
  111. package/dist/index.cjs +1 -1
  112. package/dist/index.d.cts +6 -6
  113. package/dist/index.d.ts +6 -6
  114. package/dist/index.js +1 -1
  115. package/dist/language.d.cts +5 -5
  116. package/dist/language.d.ts +5 -5
  117. package/dist/lexer.cjs +1 -1
  118. package/dist/lexer.d.cts +3 -3
  119. package/dist/lexer.d.ts +3 -3
  120. package/dist/lexer.js +1 -1
  121. package/dist/normalizer.cjs +1 -1
  122. package/dist/normalizer.js +1 -1
  123. package/dist/packages.cjs +1 -1
  124. package/dist/packages.d.cts +4 -4
  125. package/dist/packages.d.ts +4 -4
  126. package/dist/packages.js +1 -1
  127. package/dist/parser.cjs +1 -1
  128. package/dist/parser.js +1 -1
  129. package/dist/temporal.cjs +1 -1
  130. package/dist/temporal.js +1 -1
  131. package/dist/testing.cjs +2 -2
  132. package/dist/testing.d.cts +5 -5
  133. package/dist/testing.d.ts +5 -5
  134. package/dist/testing.js +1 -1
  135. package/dist/uom.cjs +1 -1
  136. package/dist/uom.js +1 -1
  137. package/dist/vm.cjs +1 -1
  138. package/dist/vm.d.cts +3 -3
  139. package/dist/vm.d.ts +3 -3
  140. package/dist/vm.js +1 -1
  141. package/dist/worker.cjs +2 -2
  142. package/dist/worker.d.cts +5 -5
  143. package/dist/worker.d.ts +5 -5
  144. package/dist/worker.js +1 -1
  145. package/package.json +1 -1
  146. package/dist/chunk-3LWK33TJ.js +0 -3
  147. package/dist/chunk-3LWK33TJ.js.map +0 -1
  148. package/dist/chunk-5NQE5JMU.cjs +0 -2
  149. package/dist/chunk-HTAT4MGN.cjs.map +0 -1
  150. package/dist/chunk-YIXCPLCN.cjs +0 -3
  151. package/dist/chunk-YIXCPLCN.cjs.map +0 -1
  152. package/dist/chunk-Z5DA5UXY.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { C as CompletionItem } from './PackageRegistry-Dl9kNP14.js';
2
- export { L as LanguageService, r as LanguageServiceOptions, s as SemanticToken } from './PackageRegistry-Dl9kNP14.js';
3
- import { e as TokenCategory } from './Lexer-B62Hn9I-.js';
1
+ import { C as CompletionItem } from './PackageRegistry-C78jVkI9.js';
2
+ export { L as LanguageService, r as LanguageServiceOptions, s as SemanticToken } from './PackageRegistry-C78jVkI9.js';
3
+ import { e as TokenCategory } from './Lexer-CqFjYoRA.js';
4
4
  import './Parselet-Dgymjxzd.js';
5
5
  import './BytecodeBuilder-DSWKZi4f.js';
6
6
  import './Token-D8f7yaz1.js';
@@ -10,8 +10,8 @@ import './CalendarBackend-MdS3Bb4P.js';
10
10
  import './resolvers.js';
11
11
  import '@tanstack/query-core';
12
12
  import './TokenNormalizer-IF7nPRMp.js';
13
- import './VMBuiltins-CbuFfIgQ.js';
14
- import './EngineError-CA2tiVaI.js';
13
+ import './VMBuiltins-Du9y8sEo.js';
14
+ import './EngineError-CqGtaT_v.js';
15
15
  import './Configuration-BxriK9Kw.js';
16
16
 
17
17
  /**
package/dist/lexer.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkTTHCH7V2_cjs=require('./chunk-TTHCH7V2.cjs');require('./chunk-Y7O4D3BJ.cjs');var chunkU7CNADCJ_cjs=require('./chunk-U7CNADCJ.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-HTAT4MGN.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,chunkU7CNADCJ_cjs.c),r.setUnits(chunkJ4LSAHCY_cjs.a),r.build()}Object.defineProperty(exports,"Lexer",{enumerable:true,get:function(){return chunkTTHCH7V2_cjs.b}});Object.defineProperty(exports,"LexerState",{enumerable:true,get:function(){return chunkTTHCH7V2_cjs.a}});Object.defineProperty(exports,"sharedLexer",{enumerable:true,get:function(){return chunkTTHCH7V2_cjs.c}});Object.defineProperty(exports,"ExpressionLexer",{enumerable:true,get:function(){return chunkU7CNADCJ_cjs.b}});Object.defineProperty(exports,"LexerToken",{enumerable:true,get:function(){return chunkU7CNADCJ_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
1
+ 'use strict';var chunkAGCNMEP2_cjs=require('./chunk-AGCNMEP2.cjs');require('./chunk-Y7O4D3BJ.cjs');var chunkWU7SBKVU_cjs=require('./chunk-WU7SBKVU.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-SUAGBRQ7.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,chunkWU7SBKVU_cjs.c),r.setUnits(chunkJ4LSAHCY_cjs.a),r.build()}Object.defineProperty(exports,"Lexer",{enumerable:true,get:function(){return chunkAGCNMEP2_cjs.b}});Object.defineProperty(exports,"LexerState",{enumerable:true,get:function(){return chunkAGCNMEP2_cjs.a}});Object.defineProperty(exports,"sharedLexer",{enumerable:true,get:function(){return chunkAGCNMEP2_cjs.c}});Object.defineProperty(exports,"ExpressionLexer",{enumerable:true,get:function(){return chunkWU7SBKVU_cjs.b}});Object.defineProperty(exports,"LexerToken",{enumerable:true,get:function(){return chunkWU7SBKVU_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-DOXatsjO.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-DOXatsjO.cjs';
1
+ import { T as TokenLookup } from './Lexer-sCI05tqO.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-sCI05tqO.cjs';
3
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-CA2tiVaI.cjs';
4
+ import './EngineError-CqGtaT_v.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-B62Hn9I-.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-B62Hn9I-.js';
1
+ import { T as TokenLookup } from './Lexer-CqFjYoRA.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-CqFjYoRA.js';
3
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-CA2tiVaI.js';
4
+ import './EngineError-CqGtaT_v.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-OKSAUK5C.js';import'./chunk-JPFCXLJV.js';import {c}from'./chunk-OLATJABN.js';export{b as ExpressionLexer,a as LexerToken}from'./chunk-OLATJABN.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-Z5DA5UXY.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-CDE2ZUGG.js';import'./chunk-JPFCXLJV.js';import {c}from'./chunk-LP3JYC3A.js';export{b as ExpressionLexer,a as LexerToken}from'./chunk-LP3JYC3A.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-RELMEWY6.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 chunkUMW5PO42_cjs=require('./chunk-UMW5PO42.cjs'),chunkU7CNADCJ_cjs=require('./chunk-U7CNADCJ.cjs');require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-HTAT4MGN.cjs');Object.defineProperty(exports,"PhraseTrie",{enumerable:true,get:function(){return chunkUMW5PO42_cjs.a}});Object.defineProperty(exports,"TokenNormalizer",{enumerable:true,get:function(){return chunkUMW5PO42_cjs.c}});Object.defineProperty(exports,"createBuiltinNormalizerRules",{enumerable:true,get:function(){return chunkUMW5PO42_cjs.f}});Object.defineProperty(exports,"createFusedToken",{enumerable:true,get:function(){return chunkUMW5PO42_cjs.b}});Object.defineProperty(exports,"implicitMultiplyRule",{enumerable:true,get:function(){return chunkUMW5PO42_cjs.d}});Object.defineProperty(exports,"BUILTIN_PHRASES",{enumerable:true,get:function(){return chunkU7CNADCJ_cjs.c}});//# sourceMappingURL=normalizer.cjs.map
1
+ 'use strict';require('./chunk-NGBBNL4K.cjs');var chunk4DR5RBHQ_cjs=require('./chunk-4DR5RBHQ.cjs'),chunkWU7SBKVU_cjs=require('./chunk-WU7SBKVU.cjs');require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-SUAGBRQ7.cjs');Object.defineProperty(exports,"PhraseTrie",{enumerable:true,get:function(){return chunk4DR5RBHQ_cjs.a}});Object.defineProperty(exports,"TokenNormalizer",{enumerable:true,get:function(){return chunk4DR5RBHQ_cjs.c}});Object.defineProperty(exports,"createBuiltinNormalizerRules",{enumerable:true,get:function(){return chunk4DR5RBHQ_cjs.f}});Object.defineProperty(exports,"createFusedToken",{enumerable:true,get:function(){return chunk4DR5RBHQ_cjs.b}});Object.defineProperty(exports,"implicitMultiplyRule",{enumerable:true,get:function(){return chunk4DR5RBHQ_cjs.d}});Object.defineProperty(exports,"BUILTIN_PHRASES",{enumerable:true,get:function(){return chunkWU7SBKVU_cjs.c}});//# sourceMappingURL=normalizer.cjs.map
2
2
  //# sourceMappingURL=normalizer.cjs.map
@@ -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-MONPHAHO.js';export{c as BUILTIN_PHRASES}from'./chunk-OLATJABN.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-Z5DA5UXY.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-B2NL65FI.js';export{c as BUILTIN_PHRASES}from'./chunk-LP3JYC3A.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-RELMEWY6.js';//# sourceMappingURL=normalizer.js.map
2
2
  //# sourceMappingURL=normalizer.js.map
package/dist/packages.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkYIXCPLCN_cjs=require('./chunk-YIXCPLCN.cjs');require('./chunk-KYE5BWPN.cjs');var chunkW5BBKLNS_cjs=require('./chunk-W5BBKLNS.cjs');require('./chunk-WXOJ3DS3.cjs'),require('./chunk-UMW5PO42.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-5NQE5JMU.cjs'),require('./chunk-YLTNXYA7.cjs'),require('./chunk-2YNRIT2L.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-UBKWHRFL.cjs'),require('./chunk-5J2XDCSV.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-O5ZLOZPH.cjs'),require('./chunk-ZKFCKAIX.cjs'),require('./chunk-U7CNADCJ.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-HTAT4MGN.cjs');Object.defineProperty(exports,"ARITHMETIC_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.a}});Object.defineProperty(exports,"BIGINT_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.n}});Object.defineProperty(exports,"BUILTIN_PACKAGES",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.z}});Object.defineProperty(exports,"CONDITIONALS_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.o}});Object.defineProperty(exports,"CONVERTERS_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.p}});Object.defineProperty(exports,"CURRENCY_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.j}});Object.defineProperty(exports,"DATETIME_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.d}});Object.defineProperty(exports,"DICE_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.f}});Object.defineProperty(exports,"FINANCE_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.r}});Object.defineProperty(exports,"FUNCTION_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.c}});Object.defineProperty(exports,"LINES_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.w}});Object.defineProperty(exports,"MAPREDUCE_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.m}});Object.defineProperty(exports,"MATHPHRASES_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.q}});Object.defineProperty(exports,"MATRIX_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.l}});Object.defineProperty(exports,"PERCENTAGE_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.b}});Object.defineProperty(exports,"TABLES_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.x}});Object.defineProperty(exports,"TAGS_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.y}});Object.defineProperty(exports,"TIME_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.e}});Object.defineProperty(exports,"UOM_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.h}});Object.defineProperty(exports,"VARIABLES_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.g}});Object.defineProperty(exports,"VECTOR_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.k}});Object.defineProperty(exports,"WEATHER_PACKAGE",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.s}});Object.defineProperty(exports,"createCryptoPackage",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.u}});Object.defineProperty(exports,"createCurrencyPackage",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.i}});Object.defineProperty(exports,"createKnowledgePackage",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.v}});Object.defineProperty(exports,"createStocksPackage",{enumerable:true,get:function(){return chunkYIXCPLCN_cjs.t}});Object.defineProperty(exports,"SYMBOLIC_PACKAGE",{enumerable:true,get:function(){return chunkW5BBKLNS_cjs.a}});//# sourceMappingURL=packages.cjs.map
1
+ 'use strict';var chunkCT3PD7L3_cjs=require('./chunk-CT3PD7L3.cjs');require('./chunk-A755LVPT.cjs');var chunkWQGHJAW2_cjs=require('./chunk-WQGHJAW2.cjs');require('./chunk-5AKT36UK.cjs'),require('./chunk-4DR5RBHQ.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-RAFOQ4T5.cjs'),require('./chunk-CM2WM5CM.cjs'),require('./chunk-DUFEONVN.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-YWF6C2IO.cjs'),require('./chunk-A764BY7L.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-OM7NOHJF.cjs'),require('./chunk-ZKFCKAIX.cjs'),require('./chunk-WU7SBKVU.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-SUAGBRQ7.cjs');Object.defineProperty(exports,"ARITHMETIC_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.a}});Object.defineProperty(exports,"BIGINT_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.n}});Object.defineProperty(exports,"BUILTIN_PACKAGES",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.z}});Object.defineProperty(exports,"CONDITIONALS_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.o}});Object.defineProperty(exports,"CONVERTERS_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.p}});Object.defineProperty(exports,"CURRENCY_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.j}});Object.defineProperty(exports,"DATETIME_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.d}});Object.defineProperty(exports,"DICE_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.f}});Object.defineProperty(exports,"FINANCE_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.r}});Object.defineProperty(exports,"FUNCTION_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.c}});Object.defineProperty(exports,"LINES_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.w}});Object.defineProperty(exports,"MAPREDUCE_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.m}});Object.defineProperty(exports,"MATHPHRASES_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.q}});Object.defineProperty(exports,"MATRIX_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.l}});Object.defineProperty(exports,"PERCENTAGE_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.b}});Object.defineProperty(exports,"TABLES_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.x}});Object.defineProperty(exports,"TAGS_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.y}});Object.defineProperty(exports,"TIME_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.e}});Object.defineProperty(exports,"UOM_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.h}});Object.defineProperty(exports,"VARIABLES_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.g}});Object.defineProperty(exports,"VECTOR_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.k}});Object.defineProperty(exports,"WEATHER_PACKAGE",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.s}});Object.defineProperty(exports,"createCryptoPackage",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.u}});Object.defineProperty(exports,"createCurrencyPackage",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.i}});Object.defineProperty(exports,"createKnowledgePackage",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.v}});Object.defineProperty(exports,"createStocksPackage",{enumerable:true,get:function(){return chunkCT3PD7L3_cjs.t}});Object.defineProperty(exports,"SYMBOLIC_PACKAGE",{enumerable:true,get:function(){return chunkWQGHJAW2_cjs.a}});//# sourceMappingURL=packages.cjs.map
2
2
  //# sourceMappingURL=packages.cjs.map
@@ -1,16 +1,16 @@
1
- import { I as IEnginePackage } from './PackageRegistry-CevYUzRn.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-B-C1duZw.cjs';
2
2
  import './Parselet-DF3864la.cjs';
3
3
  import './BytecodeBuilder-DSWKZi4f.cjs';
4
4
  import './Token-D8f7yaz1.cjs';
5
5
  import './pipeline-BYkKNpql.cjs';
6
6
  import './Value-BYHw-x7q.cjs';
7
7
  import './CalendarBackend-MdS3Bb4P.cjs';
8
- import './Lexer-DOXatsjO.cjs';
9
- import './EngineError-CA2tiVaI.cjs';
8
+ import './Lexer-sCI05tqO.cjs';
9
+ import './EngineError-CqGtaT_v.cjs';
10
10
  import './resolvers.cjs';
11
11
  import '@tanstack/query-core';
12
12
  import './TokenNormalizer-Pe3_390t.cjs';
13
- import './VMBuiltins-AIivGl0a.cjs';
13
+ import './VMBuiltins-BkKzhj6C.cjs';
14
14
  import './Configuration-BxriK9Kw.cjs';
15
15
 
16
16
  /** Core arithmetic: numbers, `()` grouping, `pi`/`e` constants, `+ - * / % ^`, bitwise `<< >> & | ^`, and their `*_by` word forms. */
@@ -1,16 +1,16 @@
1
- import { I as IEnginePackage } from './PackageRegistry-Dl9kNP14.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-C78jVkI9.js';
2
2
  import './Parselet-Dgymjxzd.js';
3
3
  import './BytecodeBuilder-DSWKZi4f.js';
4
4
  import './Token-D8f7yaz1.js';
5
5
  import './pipeline-Cl7KW8CB.js';
6
6
  import './Value-BYHw-x7q.js';
7
7
  import './CalendarBackend-MdS3Bb4P.js';
8
- import './Lexer-B62Hn9I-.js';
9
- import './EngineError-CA2tiVaI.js';
8
+ import './Lexer-CqFjYoRA.js';
9
+ import './EngineError-CqGtaT_v.js';
10
10
  import './resolvers.js';
11
11
  import '@tanstack/query-core';
12
12
  import './TokenNormalizer-IF7nPRMp.js';
13
- import './VMBuiltins-CbuFfIgQ.js';
13
+ import './VMBuiltins-Du9y8sEo.js';
14
14
  import './Configuration-BxriK9Kw.js';
15
15
 
16
16
  /** Core arithmetic: numbers, `()` grouping, `pi`/`e` constants, `+ - * / % ^`, bitwise `<< >> & | ^`, and their `*_by` word forms. */
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-3LWK33TJ.js';import'./chunk-Z5VBXZ4A.js';export{a as SYMBOLIC_PACKAGE}from'./chunk-7ASISMXA.js';import'./chunk-7ZYYWSLT.js';import'./chunk-MONPHAHO.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-IAL64FCP.js';import'./chunk-I6WGOM3C.js';import'./chunk-DDVDRWCK.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-6T5HPIZX.js';import'./chunk-A7RRWNLE.js';import'./chunk-J4K72CQN.js';import'./chunk-LV7PJ2MU.js';import'./chunk-4CNYGIND.js';import'./chunk-OLATJABN.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-Z5DA5UXY.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-SYJAH6CD.js';import'./chunk-SFM4XFGJ.js';export{a as SYMBOLIC_PACKAGE}from'./chunk-FXB5GCBT.js';import'./chunk-VLX7ZVK4.js';import'./chunk-B2NL65FI.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-YN5H54GM.js';import'./chunk-3ZGFAE3Q.js';import'./chunk-PTXUWGRR.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-KH4QXKLT.js';import'./chunk-NQFCXLEF.js';import'./chunk-J4K72CQN.js';import'./chunk-X5K72MBV.js';import'./chunk-4CNYGIND.js';import'./chunk-LP3JYC3A.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import'./chunk-RELMEWY6.js';//# sourceMappingURL=packages.js.map
2
2
  //# sourceMappingURL=packages.js.map
package/dist/parser.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkGWEINEJG_cjs=require('./chunk-GWEINEJG.cjs');require('./chunk-HG4NPDN5.cjs');var chunkWXOJ3DS3_cjs=require('./chunk-WXOJ3DS3.cjs'),chunkABVDKMNF_cjs=require('./chunk-ABVDKMNF.cjs');require('./chunk-5J2XDCSV.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-HTAT4MGN.cjs');Object.defineProperty(exports,"ParseletRegistry",{enumerable:true,get:function(){return chunkGWEINEJG_cjs.b}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function(){return chunkGWEINEJG_cjs.a}});Object.defineProperty(exports,"PrecedenceParser",{enumerable:true,get:function(){return chunkGWEINEJG_cjs.a}});Object.defineProperty(exports,"sharedParseletRegistry",{enumerable:true,get:function(){return chunkGWEINEJG_cjs.c}});Object.defineProperty(exports,"BindingPower",{enumerable:true,get:function(){return chunkWXOJ3DS3_cjs.a}});Object.defineProperty(exports,"BytecodeBuilder",{enumerable:true,get:function(){return chunkWXOJ3DS3_cjs.d}});Object.defineProperty(exports,"buildBindingPowerTable",{enumerable:true,get:function(){return chunkWXOJ3DS3_cjs.b}});Object.defineProperty(exports,"invalidateBindingPowerTable",{enumerable:true,get:function(){return chunkWXOJ3DS3_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 chunkQ7TBBV62_cjs=require('./chunk-Q7TBBV62.cjs');require('./chunk-HG4NPDN5.cjs');var chunk5AKT36UK_cjs=require('./chunk-5AKT36UK.cjs'),chunkABVDKMNF_cjs=require('./chunk-ABVDKMNF.cjs');require('./chunk-A764BY7L.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-SUAGBRQ7.cjs');Object.defineProperty(exports,"ParseletRegistry",{enumerable:true,get:function(){return chunkQ7TBBV62_cjs.b}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function(){return chunkQ7TBBV62_cjs.a}});Object.defineProperty(exports,"PrecedenceParser",{enumerable:true,get:function(){return chunkQ7TBBV62_cjs.a}});Object.defineProperty(exports,"sharedParseletRegistry",{enumerable:true,get:function(){return chunkQ7TBBV62_cjs.c}});Object.defineProperty(exports,"BindingPower",{enumerable:true,get:function(){return chunk5AKT36UK_cjs.a}});Object.defineProperty(exports,"BytecodeBuilder",{enumerable:true,get:function(){return chunk5AKT36UK_cjs.d}});Object.defineProperty(exports,"buildBindingPowerTable",{enumerable:true,get:function(){return chunk5AKT36UK_cjs.b}});Object.defineProperty(exports,"invalidateBindingPowerTable",{enumerable:true,get:function(){return chunk5AKT36UK_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.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as ParseletRegistry,a as Parser,a as PrecedenceParser,c as sharedParseletRegistry}from'./chunk-RRJ77SF6.js';import'./chunk-JP4JMQOG.js';export{a as BindingPower,d as BytecodeBuilder,b as buildBindingPowerTable,c as invalidateBindingPowerTable}from'./chunk-7ZYYWSLT.js';export{a as OpCode,b as getOpCodeName}from'./chunk-TZYMXNIB.js';import'./chunk-A7RRWNLE.js';import'./chunk-J4K72CQN.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-Z5DA5UXY.js';//# sourceMappingURL=parser.js.map
1
+ export{b as ParseletRegistry,a as Parser,a as PrecedenceParser,c as sharedParseletRegistry}from'./chunk-CB3EXUM2.js';import'./chunk-JP4JMQOG.js';export{a as BindingPower,d as BytecodeBuilder,b as buildBindingPowerTable,c as invalidateBindingPowerTable}from'./chunk-VLX7ZVK4.js';export{a as OpCode,b as getOpCodeName}from'./chunk-TZYMXNIB.js';import'./chunk-NQFCXLEF.js';import'./chunk-J4K72CQN.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-RELMEWY6.js';//# sourceMappingURL=parser.js.map
2
2
  //# sourceMappingURL=parser.js.map
package/dist/temporal.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkYLTNXYA7_cjs=require('./chunk-YLTNXYA7.cjs');require('./chunk-E4HAKNBQ.cjs'),require('./chunk-HTAT4MGN.cjs');Object.defineProperty(exports,"TemporalCalendar",{enumerable:true,get:function(){return chunkYLTNXYA7_cjs.a}});Object.defineProperty(exports,"createTemporalCalendar",{enumerable:true,get:function(){return chunkYLTNXYA7_cjs.b}});//# sourceMappingURL=temporal.cjs.map
1
+ 'use strict';var chunkCM2WM5CM_cjs=require('./chunk-CM2WM5CM.cjs');require('./chunk-E4HAKNBQ.cjs'),require('./chunk-SUAGBRQ7.cjs');Object.defineProperty(exports,"TemporalCalendar",{enumerable:true,get:function(){return chunkCM2WM5CM_cjs.a}});Object.defineProperty(exports,"createTemporalCalendar",{enumerable:true,get:function(){return chunkCM2WM5CM_cjs.b}});//# sourceMappingURL=temporal.cjs.map
2
2
  //# sourceMappingURL=temporal.cjs.map
package/dist/temporal.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as TemporalCalendar,b as createTemporalCalendar}from'./chunk-I6WGOM3C.js';import'./chunk-J4K72CQN.js';import'./chunk-Z5DA5UXY.js';//# sourceMappingURL=temporal.js.map
1
+ export{a as TemporalCalendar,b as createTemporalCalendar}from'./chunk-3ZGFAE3Q.js';import'./chunk-J4K72CQN.js';import'./chunk-RELMEWY6.js';//# sourceMappingURL=temporal.js.map
2
2
  //# sourceMappingURL=temporal.js.map
package/dist/testing.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkIIBR4LVH_cjs=require('./chunk-IIBR4LVH.cjs');require('./chunk-GWEINEJG.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-ZVPZQ66D.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-2G3AW6OQ.cjs'),require('./chunk-HG4NPDN5.cjs'),require('./chunk-QXGKONTZ.cjs'),require('./chunk-R2SZFJTT.cjs');var chunkYIXCPLCN_cjs=require('./chunk-YIXCPLCN.cjs');require('./chunk-KYE5BWPN.cjs'),require('./chunk-W5BBKLNS.cjs'),require('./chunk-WXOJ3DS3.cjs'),require('./chunk-UMW5PO42.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-5NQE5JMU.cjs'),require('./chunk-YLTNXYA7.cjs'),require('./chunk-2YNRIT2L.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-UBKWHRFL.cjs'),require('./chunk-5J2XDCSV.cjs'),require('./chunk-E4HAKNBQ.cjs');var chunkO5ZLOZPH_cjs=require('./chunk-O5ZLOZPH.cjs');require('./chunk-ZKFCKAIX.cjs');var chunkRVNW627Y_cjs=require('./chunk-RVNW627Y.cjs');require('./chunk-TTHCH7V2.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-U7CNADCJ.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs');var chunkHTAT4MGN_cjs=require('./chunk-HTAT4MGN.cjs');var i=class o extends Error{constructor(t){super(t.message),this.name="ExpectationError",this.code=t.code,this.expected=t.expected,this.actual=t.actual,Object.setPrototypeOf(this,o.prototype);}};function V(o=[],t={}){let{locale:e="en",includeBuiltins:r=true}=t,s=new chunkIIBR4LVH_cjs.n({locale:e,packages:r?chunkYIXCPLCN_cjs.z:[]});for(let a of o)s.registerPackage(a);return s}function v(o,t){try{let e=o.evaluateExpression(t);return e.isError()?{status:"error",code:e.errorCode??"",message:e.errorMessage??"",source:e}:e.isPending()?{status:"pending",value:e}:{status:"value",value:e}}catch(e){if(e instanceof chunkHTAT4MGN_cjs.b)return {status:"error",code:e.code,message:e.message,source:e};let r=e instanceof Error?e.message:String(e);return {status:"error",code:"UNKNOWN_ERROR",message:r,source:new chunkO5ZLOZPH_cjs.m(13,"UNKNOWN_ERROR",r)}}}function x(o,t){if(Object.is(o,t))return true;if(!Number.isFinite(o)||!Number.isFinite(t))return false;let e=1e-9*Math.max(1,Math.abs(o),Math.abs(t));return Math.abs(o-t)<=e}function l(o){return o.type===3?JSON.stringify(o.value):o.type===6&&typeof o.unit=="string"?`${String(o.value)} ${o.unit}`:String(o.value)}function n(o){switch(o.status){case "value":return l(o.value);case "pending":return "a pending async value";case "error":return `an error (${o.code}: ${o.message})`}}var d=class{constructor(t,e){this.expression=t;this.outcome=e;}get value(){if(this.outcome.status==="error")throw new i({code:"EXPECTED_VALUE",message:`Expected "${this.expression}" to evaluate, but it failed with ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this.outcome.value}toEvaluate(){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EVALUATE",message:`Expected "${this.expression}" to evaluate to a value, but got ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this}toEqual(t,e){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but got ${n(this.outcome)}.`,expected:c(t,e),actual:n(this.outcome)});let r=this.outcome.value,s;if(typeof t=="number"?s=x(r.toNumber(),t):typeof t=="boolean"?s=r.type===10&&r.value===t:s=C(r)===t,!s)throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but it was ${l(r)}.`,expected:c(t,e),actual:l(r)});if(e!==void 0&&r.unit!==e)throw new i({code:"EXPECTED_UNIT",message:`Expected "${this.expression}" to carry the unit "${e}", but it was ${r.unit===void 0?"unitless":`"${r.unit}"`}.`,expected:`unit "${e}"`,actual:r.unit===void 0?"no unit":`unit "${r.unit}"`});return this}toBeError(){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_ERROR",message:`Expected "${this.expression}" to fail, but it produced ${n(this.outcome)}.`,expected:"an error",actual:n(this.outcome)});return this}toFailWith(t){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it produced ${n(this.outcome)}.`,expected:`error code "${t}"`,actual:n(this.outcome)});if(this.outcome.code!==t)throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,expected:`error code "${t}"`,actual:`error code "${this.outcome.code}"`});return this}toBePending(){if(this.outcome.status!=="pending")throw new i({code:"EXPECTED_PENDING",message:`Expected "${this.expression}" to be pending, but got ${n(this.outcome)}.`,expected:"a pending async value",actual:n(this.outcome)});return this}};function c(o,t){let e=typeof o=="string"?JSON.stringify(o):String(o);return t===void 0?e:`${e} ${t}`}function C(o){return String(o.value)}function D(o,t){return new d(t,v(o,t))}var O=["a","an","and","or","but","if","then","the","this","that","these","those","in","on","at","to","of","for","from","with","by","as","per","into","over","is","are","was","were","be","been","being","do","does","did","have","has","had","will","would","can","could","should","may","might","must","price","cost","value","total","sum","count","rate","amount","number","time","date","day","week","month","year","hour","minute","second","add","buy","sell","hold","make","take","give","get","set","run","up","down","out","off","all","some","any","no","not","more","less","one","two","three","first","last","next","each","every","here","there"],$=["error","warning","info"];function k(o){let t=[],e=o.lexerVocabulary;if(e?.keywords)for(let[r,s]of Object.entries(e.keywords))t.push({word:r,via:"keyword",tokenType:s});if(e?.units)for(let r of e.units)t.push({word:r,via:"unit"});if(e?.operators)for(let[r,s]of Object.entries(e.operators))t.push({word:r,via:"operator",tokenType:s});if(o.phrases)for(let[r,s]of Object.entries(o.phrases))r.includes(" ")||t.push({word:r,via:"phrase",tokenType:s});return t}var p=class{constructor(t){this.pkg=t;}notToShadow(t=O){let e=new Set(t.map(s=>s.toLowerCase())),r=k(this.pkg).filter(s=>e.has(s.word.toLowerCase()));if(r.length>0){let s=r.map(a=>`"${a.word}" (${a.via})`).join(", ");throw new i({code:"PACKAGE_SHADOWS_PROSE",message:`Package "${this.pkg.name}" claims prose word(s) as syntax: ${s}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,expected:"no prose words claimed as syntax",actual:s})}return r}notToCollideWith(t,e="error"){let r=chunkIIBR4LVH_cjs.a(this.pkg,t),s=$.indexOf(e),a=r.conflicts.filter(u=>$.indexOf(u.severity)<=s);if(a.length>0){let u=a.map(g=>`[${g.severity}] ${g.detail}`).join(`
1
+ 'use strict';var chunkIY3GI2AM_cjs=require('./chunk-IY3GI2AM.cjs');require('./chunk-Q7TBBV62.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-ZVPZQ66D.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-GWV273KZ.cjs'),require('./chunk-HG4NPDN5.cjs'),require('./chunk-P43SV4NJ.cjs'),require('./chunk-R2SZFJTT.cjs');var chunkCT3PD7L3_cjs=require('./chunk-CT3PD7L3.cjs');require('./chunk-A755LVPT.cjs'),require('./chunk-WQGHJAW2.cjs'),require('./chunk-5AKT36UK.cjs'),require('./chunk-4DR5RBHQ.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-RAFOQ4T5.cjs'),require('./chunk-CM2WM5CM.cjs'),require('./chunk-DUFEONVN.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-YWF6C2IO.cjs'),require('./chunk-A764BY7L.cjs'),require('./chunk-E4HAKNBQ.cjs');var chunkOM7NOHJF_cjs=require('./chunk-OM7NOHJF.cjs');require('./chunk-ZKFCKAIX.cjs');var chunkZBMWLTE6_cjs=require('./chunk-ZBMWLTE6.cjs');require('./chunk-AGCNMEP2.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-WU7SBKVU.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs');var chunkSUAGBRQ7_cjs=require('./chunk-SUAGBRQ7.cjs');var i=class o extends Error{constructor(t){super(t.message),this.name="ExpectationError",this.code=t.code,this.expected=t.expected,this.actual=t.actual,Object.setPrototypeOf(this,o.prototype);}};function V(o=[],t={}){let{locale:e="en",includeBuiltins:r=true}=t,s=new chunkIY3GI2AM_cjs.n({locale:e,packages:r?chunkCT3PD7L3_cjs.z:[]});for(let a of o)s.registerPackage(a);return s}function v(o,t){try{let e=o.evaluateExpression(t);return e.isError()?{status:"error",code:e.errorCode??"",message:e.errorMessage??"",source:e}:e.isPending()?{status:"pending",value:e}:{status:"value",value:e}}catch(e){if(e instanceof chunkSUAGBRQ7_cjs.b)return {status:"error",code:e.code,message:e.message,source:e};let r=e instanceof Error?e.message:String(e);return {status:"error",code:"UNKNOWN_ERROR",message:r,source:new chunkOM7NOHJF_cjs.m(13,"UNKNOWN_ERROR",r)}}}function x(o,t){if(Object.is(o,t))return true;if(!Number.isFinite(o)||!Number.isFinite(t))return false;let e=1e-9*Math.max(1,Math.abs(o),Math.abs(t));return Math.abs(o-t)<=e}function l(o){return o.type===3?JSON.stringify(o.value):o.type===6&&typeof o.unit=="string"?`${String(o.value)} ${o.unit}`:String(o.value)}function n(o){switch(o.status){case "value":return l(o.value);case "pending":return "a pending async value";case "error":return `an error (${o.code}: ${o.message})`}}var d=class{constructor(t,e){this.expression=t;this.outcome=e;}get value(){if(this.outcome.status==="error")throw new i({code:"EXPECTED_VALUE",message:`Expected "${this.expression}" to evaluate, but it failed with ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this.outcome.value}toEvaluate(){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EVALUATE",message:`Expected "${this.expression}" to evaluate to a value, but got ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this}toEqual(t,e){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but got ${n(this.outcome)}.`,expected:c(t,e),actual:n(this.outcome)});let r=this.outcome.value,s;if(typeof t=="number"?s=x(r.toNumber(),t):typeof t=="boolean"?s=r.type===10&&r.value===t:s=C(r)===t,!s)throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but it was ${l(r)}.`,expected:c(t,e),actual:l(r)});if(e!==void 0&&r.unit!==e)throw new i({code:"EXPECTED_UNIT",message:`Expected "${this.expression}" to carry the unit "${e}", but it was ${r.unit===void 0?"unitless":`"${r.unit}"`}.`,expected:`unit "${e}"`,actual:r.unit===void 0?"no unit":`unit "${r.unit}"`});return this}toBeError(){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_ERROR",message:`Expected "${this.expression}" to fail, but it produced ${n(this.outcome)}.`,expected:"an error",actual:n(this.outcome)});return this}toFailWith(t){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it produced ${n(this.outcome)}.`,expected:`error code "${t}"`,actual:n(this.outcome)});if(this.outcome.code!==t)throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,expected:`error code "${t}"`,actual:`error code "${this.outcome.code}"`});return this}toBePending(){if(this.outcome.status!=="pending")throw new i({code:"EXPECTED_PENDING",message:`Expected "${this.expression}" to be pending, but got ${n(this.outcome)}.`,expected:"a pending async value",actual:n(this.outcome)});return this}};function c(o,t){let e=typeof o=="string"?JSON.stringify(o):String(o);return t===void 0?e:`${e} ${t}`}function C(o){return String(o.value)}function D(o,t){return new d(t,v(o,t))}var O=["a","an","and","or","but","if","then","the","this","that","these","those","in","on","at","to","of","for","from","with","by","as","per","into","over","is","are","was","were","be","been","being","do","does","did","have","has","had","will","would","can","could","should","may","might","must","price","cost","value","total","sum","count","rate","amount","number","time","date","day","week","month","year","hour","minute","second","add","buy","sell","hold","make","take","give","get","set","run","up","down","out","off","all","some","any","no","not","more","less","one","two","three","first","last","next","each","every","here","there"],$=["error","warning","info"];function k(o){let t=[],e=o.lexerVocabulary;if(e?.keywords)for(let[r,s]of Object.entries(e.keywords))t.push({word:r,via:"keyword",tokenType:s});if(e?.units)for(let r of e.units)t.push({word:r,via:"unit"});if(e?.operators)for(let[r,s]of Object.entries(e.operators))t.push({word:r,via:"operator",tokenType:s});if(o.phrases)for(let[r,s]of Object.entries(o.phrases))r.includes(" ")||t.push({word:r,via:"phrase",tokenType:s});return t}var p=class{constructor(t){this.pkg=t;}notToShadow(t=O){let e=new Set(t.map(s=>s.toLowerCase())),r=k(this.pkg).filter(s=>e.has(s.word.toLowerCase()));if(r.length>0){let s=r.map(a=>`"${a.word}" (${a.via})`).join(", ");throw new i({code:"PACKAGE_SHADOWS_PROSE",message:`Package "${this.pkg.name}" claims prose word(s) as syntax: ${s}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,expected:"no prose words claimed as syntax",actual:s})}return r}notToCollideWith(t,e="error"){let r=chunkIY3GI2AM_cjs.a(this.pkg,t),s=$.indexOf(e),a=r.conflicts.filter(u=>$.indexOf(u.severity)<=s);if(a.length>0){let u=a.map(g=>`[${g.severity}] ${g.detail}`).join(`
2
2
  `);throw new i({code:"PACKAGE_VOCABULARY_COLLISION",message:`Package "${this.pkg.name}" collides with another package:
3
- ${u}`,expected:`no conflicts at or above "${e}" severity`,actual:`${a.length} conflict(s)`})}return r}toDeclareCompatibleEngineVersion(t=chunkRVNW627Y_cjs.a){let e=chunkIIBR4LVH_cjs.b(this.pkg,t);if(!e.compatible){let r=e.reason==="invalid-range"?`its range "${e.declaredRange}" is not valid semver`:`its range "${e.declaredRange}" is not satisfied by engine version "${e.engineVersion}"`;throw new i({code:"PACKAGE_ENGINE_VERSION_INCOMPATIBLE",message:`Package "${this.pkg.name}" declares an engineVersion that will be rejected at registration: ${r}.`,expected:`an engineVersion satisfied by "${t}"`,actual:`"${e.declaredRange}"`})}return this}};function L(o){return new p(o)}exports.COMMON_PROSE_WORDS=O;exports.ExpectationError=i;exports.ExpressionAssertion=d;exports.PackageAssertion=p;exports.createTestEngine=V;exports.expectExpression=D;exports.expectPackage=L;//# sourceMappingURL=testing.cjs.map
3
+ ${u}`,expected:`no conflicts at or above "${e}" severity`,actual:`${a.length} conflict(s)`})}return r}toDeclareCompatibleEngineVersion(t=chunkZBMWLTE6_cjs.a){let e=chunkIY3GI2AM_cjs.b(this.pkg,t);if(!e.compatible){let r=e.reason==="invalid-range"?`its range "${e.declaredRange}" is not valid semver`:`its range "${e.declaredRange}" is not satisfied by engine version "${e.engineVersion}"`;throw new i({code:"PACKAGE_ENGINE_VERSION_INCOMPATIBLE",message:`Package "${this.pkg.name}" declares an engineVersion that will be rejected at registration: ${r}.`,expected:`an engineVersion satisfied by "${t}"`,actual:`"${e.declaredRange}"`})}return this}};function L(o){return new p(o)}exports.COMMON_PROSE_WORDS=O;exports.ExpectationError=i;exports.ExpressionAssertion=d;exports.PackageAssertion=p;exports.createTestEngine=V;exports.expectExpression=D;exports.expectPackage=L;//# sourceMappingURL=testing.cjs.map
4
4
  //# sourceMappingURL=testing.cjs.map
@@ -1,17 +1,17 @@
1
- import { I as IEnginePackage, E as ExpressionEngine } from './PackageRegistry-CevYUzRn.cjs';
1
+ import { I as IEnginePackage, E as ExpressionEngine } from './PackageRegistry-B-C1duZw.cjs';
2
2
  import { V as Value } from './Value-BYHw-x7q.cjs';
3
- import { E as EngineError } from './EngineError-CA2tiVaI.cjs';
4
- import { C as CompatibilityReport } from './PackageCompatibility-DW18LqED.cjs';
3
+ import { E as EngineError } from './EngineError-CqGtaT_v.cjs';
4
+ import { C as CompatibilityReport } from './PackageCompatibility-Bn-T_xKW.cjs';
5
5
  import './Parselet-DF3864la.cjs';
6
6
  import './BytecodeBuilder-DSWKZi4f.cjs';
7
7
  import './Token-D8f7yaz1.cjs';
8
8
  import './pipeline-BYkKNpql.cjs';
9
9
  import './CalendarBackend-MdS3Bb4P.cjs';
10
- import './Lexer-DOXatsjO.cjs';
10
+ import './Lexer-sCI05tqO.cjs';
11
11
  import './resolvers.cjs';
12
12
  import '@tanstack/query-core';
13
13
  import './TokenNormalizer-Pe3_390t.cjs';
14
- import './VMBuiltins-AIivGl0a.cjs';
14
+ import './VMBuiltins-BkKzhj6C.cjs';
15
15
  import './Configuration-BxriK9Kw.cjs';
16
16
 
17
17
  /**
package/dist/testing.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { I as IEnginePackage, E as ExpressionEngine } from './PackageRegistry-Dl9kNP14.js';
1
+ import { I as IEnginePackage, E as ExpressionEngine } from './PackageRegistry-C78jVkI9.js';
2
2
  import { V as Value } from './Value-BYHw-x7q.js';
3
- import { E as EngineError } from './EngineError-CA2tiVaI.js';
4
- import { C as CompatibilityReport } from './PackageCompatibility-DT1IPlQx.js';
3
+ import { E as EngineError } from './EngineError-CqGtaT_v.js';
4
+ import { C as CompatibilityReport } from './PackageCompatibility-phvSFP4f.js';
5
5
  import './Parselet-Dgymjxzd.js';
6
6
  import './BytecodeBuilder-DSWKZi4f.js';
7
7
  import './Token-D8f7yaz1.js';
8
8
  import './pipeline-Cl7KW8CB.js';
9
9
  import './CalendarBackend-MdS3Bb4P.js';
10
- import './Lexer-B62Hn9I-.js';
10
+ import './Lexer-CqFjYoRA.js';
11
11
  import './resolvers.js';
12
12
  import '@tanstack/query-core';
13
13
  import './TokenNormalizer-IF7nPRMp.js';
14
- import './VMBuiltins-CbuFfIgQ.js';
14
+ import './VMBuiltins-Du9y8sEo.js';
15
15
  import './Configuration-BxriK9Kw.js';
16
16
 
17
17
  /**
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import {n as n$1,a,b}from'./chunk-APU5LON7.js';import'./chunk-RRJ77SF6.js';import'./chunk-2RWAXT6O.js';import'./chunk-IJHL3LMH.js';import'./chunk-MIQBJGGR.js';import'./chunk-IEBWLNI5.js';import'./chunk-JP4JMQOG.js';import'./chunk-N22D5ZD4.js';import'./chunk-XEIDV5JP.js';import {z}from'./chunk-3LWK33TJ.js';import'./chunk-Z5VBXZ4A.js';import'./chunk-7ASISMXA.js';import'./chunk-7ZYYWSLT.js';import'./chunk-MONPHAHO.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-IAL64FCP.js';import'./chunk-I6WGOM3C.js';import'./chunk-DDVDRWCK.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-6T5HPIZX.js';import'./chunk-A7RRWNLE.js';import'./chunk-J4K72CQN.js';import {m}from'./chunk-LV7PJ2MU.js';import'./chunk-4CNYGIND.js';import {a as a$1}from'./chunk-POIHAKBX.js';import'./chunk-OKSAUK5C.js';import'./chunk-JPFCXLJV.js';import'./chunk-OLATJABN.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import {b as b$1}from'./chunk-Z5DA5UXY.js';var i=class o extends Error{constructor(t){super(t.message),this.name="ExpectationError",this.code=t.code,this.expected=t.expected,this.actual=t.actual,Object.setPrototypeOf(this,o.prototype);}};function V(o=[],t={}){let{locale:e="en",includeBuiltins:r=true}=t,s=new n$1({locale:e,packages:r?z:[]});for(let a of o)s.registerPackage(a);return s}function v(o,t){try{let e=o.evaluateExpression(t);return e.isError()?{status:"error",code:e.errorCode??"",message:e.errorMessage??"",source:e}:e.isPending()?{status:"pending",value:e}:{status:"value",value:e}}catch(e){if(e instanceof b$1)return {status:"error",code:e.code,message:e.message,source:e};let r=e instanceof Error?e.message:String(e);return {status:"error",code:"UNKNOWN_ERROR",message:r,source:new m(13,"UNKNOWN_ERROR",r)}}}function x(o,t){if(Object.is(o,t))return true;if(!Number.isFinite(o)||!Number.isFinite(t))return false;let e=1e-9*Math.max(1,Math.abs(o),Math.abs(t));return Math.abs(o-t)<=e}function l(o){return o.type===3?JSON.stringify(o.value):o.type===6&&typeof o.unit=="string"?`${String(o.value)} ${o.unit}`:String(o.value)}function n(o){switch(o.status){case "value":return l(o.value);case "pending":return "a pending async value";case "error":return `an error (${o.code}: ${o.message})`}}var d=class{constructor(t,e){this.expression=t;this.outcome=e;}get value(){if(this.outcome.status==="error")throw new i({code:"EXPECTED_VALUE",message:`Expected "${this.expression}" to evaluate, but it failed with ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this.outcome.value}toEvaluate(){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EVALUATE",message:`Expected "${this.expression}" to evaluate to a value, but got ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this}toEqual(t,e){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but got ${n(this.outcome)}.`,expected:c(t,e),actual:n(this.outcome)});let r=this.outcome.value,s;if(typeof t=="number"?s=x(r.toNumber(),t):typeof t=="boolean"?s=r.type===10&&r.value===t:s=C(r)===t,!s)throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but it was ${l(r)}.`,expected:c(t,e),actual:l(r)});if(e!==void 0&&r.unit!==e)throw new i({code:"EXPECTED_UNIT",message:`Expected "${this.expression}" to carry the unit "${e}", but it was ${r.unit===void 0?"unitless":`"${r.unit}"`}.`,expected:`unit "${e}"`,actual:r.unit===void 0?"no unit":`unit "${r.unit}"`});return this}toBeError(){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_ERROR",message:`Expected "${this.expression}" to fail, but it produced ${n(this.outcome)}.`,expected:"an error",actual:n(this.outcome)});return this}toFailWith(t){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it produced ${n(this.outcome)}.`,expected:`error code "${t}"`,actual:n(this.outcome)});if(this.outcome.code!==t)throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,expected:`error code "${t}"`,actual:`error code "${this.outcome.code}"`});return this}toBePending(){if(this.outcome.status!=="pending")throw new i({code:"EXPECTED_PENDING",message:`Expected "${this.expression}" to be pending, but got ${n(this.outcome)}.`,expected:"a pending async value",actual:n(this.outcome)});return this}};function c(o,t){let e=typeof o=="string"?JSON.stringify(o):String(o);return t===void 0?e:`${e} ${t}`}function C(o){return String(o.value)}function D(o,t){return new d(t,v(o,t))}var O=["a","an","and","or","but","if","then","the","this","that","these","those","in","on","at","to","of","for","from","with","by","as","per","into","over","is","are","was","were","be","been","being","do","does","did","have","has","had","will","would","can","could","should","may","might","must","price","cost","value","total","sum","count","rate","amount","number","time","date","day","week","month","year","hour","minute","second","add","buy","sell","hold","make","take","give","get","set","run","up","down","out","off","all","some","any","no","not","more","less","one","two","three","first","last","next","each","every","here","there"],$=["error","warning","info"];function k(o){let t=[],e=o.lexerVocabulary;if(e?.keywords)for(let[r,s]of Object.entries(e.keywords))t.push({word:r,via:"keyword",tokenType:s});if(e?.units)for(let r of e.units)t.push({word:r,via:"unit"});if(e?.operators)for(let[r,s]of Object.entries(e.operators))t.push({word:r,via:"operator",tokenType:s});if(o.phrases)for(let[r,s]of Object.entries(o.phrases))r.includes(" ")||t.push({word:r,via:"phrase",tokenType:s});return t}var p=class{constructor(t){this.pkg=t;}notToShadow(t=O){let e=new Set(t.map(s=>s.toLowerCase())),r=k(this.pkg).filter(s=>e.has(s.word.toLowerCase()));if(r.length>0){let s=r.map(a=>`"${a.word}" (${a.via})`).join(", ");throw new i({code:"PACKAGE_SHADOWS_PROSE",message:`Package "${this.pkg.name}" claims prose word(s) as syntax: ${s}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,expected:"no prose words claimed as syntax",actual:s})}return r}notToCollideWith(t,e="error"){let r=a(this.pkg,t),s=$.indexOf(e),a$1=r.conflicts.filter(u=>$.indexOf(u.severity)<=s);if(a$1.length>0){let u=a$1.map(g=>`[${g.severity}] ${g.detail}`).join(`
1
+ import {n as n$1,a,b}from'./chunk-6K6ZW4B6.js';import'./chunk-CB3EXUM2.js';import'./chunk-2RWAXT6O.js';import'./chunk-IJHL3LMH.js';import'./chunk-MIQBJGGR.js';import'./chunk-2PGGPFF3.js';import'./chunk-JP4JMQOG.js';import'./chunk-IQVSCL2R.js';import'./chunk-XEIDV5JP.js';import {z}from'./chunk-SYJAH6CD.js';import'./chunk-SFM4XFGJ.js';import'./chunk-FXB5GCBT.js';import'./chunk-VLX7ZVK4.js';import'./chunk-B2NL65FI.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-YN5H54GM.js';import'./chunk-3ZGFAE3Q.js';import'./chunk-PTXUWGRR.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-KH4QXKLT.js';import'./chunk-NQFCXLEF.js';import'./chunk-J4K72CQN.js';import {m}from'./chunk-X5K72MBV.js';import'./chunk-4CNYGIND.js';import {a as a$1}from'./chunk-QOEO7CKE.js';import'./chunk-CDE2ZUGG.js';import'./chunk-JPFCXLJV.js';import'./chunk-LP3JYC3A.js';import'./chunk-FAO6DQ74.js';import'./chunk-LHLW7JLS.js';import'./chunk-CHVGFTO3.js';import'./chunk-PRSXXDTA.js';import {b as b$1}from'./chunk-RELMEWY6.js';var i=class o extends Error{constructor(t){super(t.message),this.name="ExpectationError",this.code=t.code,this.expected=t.expected,this.actual=t.actual,Object.setPrototypeOf(this,o.prototype);}};function V(o=[],t={}){let{locale:e="en",includeBuiltins:r=true}=t,s=new n$1({locale:e,packages:r?z:[]});for(let a of o)s.registerPackage(a);return s}function v(o,t){try{let e=o.evaluateExpression(t);return e.isError()?{status:"error",code:e.errorCode??"",message:e.errorMessage??"",source:e}:e.isPending()?{status:"pending",value:e}:{status:"value",value:e}}catch(e){if(e instanceof b$1)return {status:"error",code:e.code,message:e.message,source:e};let r=e instanceof Error?e.message:String(e);return {status:"error",code:"UNKNOWN_ERROR",message:r,source:new m(13,"UNKNOWN_ERROR",r)}}}function x(o,t){if(Object.is(o,t))return true;if(!Number.isFinite(o)||!Number.isFinite(t))return false;let e=1e-9*Math.max(1,Math.abs(o),Math.abs(t));return Math.abs(o-t)<=e}function l(o){return o.type===3?JSON.stringify(o.value):o.type===6&&typeof o.unit=="string"?`${String(o.value)} ${o.unit}`:String(o.value)}function n(o){switch(o.status){case "value":return l(o.value);case "pending":return "a pending async value";case "error":return `an error (${o.code}: ${o.message})`}}var d=class{constructor(t,e){this.expression=t;this.outcome=e;}get value(){if(this.outcome.status==="error")throw new i({code:"EXPECTED_VALUE",message:`Expected "${this.expression}" to evaluate, but it failed with ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this.outcome.value}toEvaluate(){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EVALUATE",message:`Expected "${this.expression}" to evaluate to a value, but got ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this}toEqual(t,e){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but got ${n(this.outcome)}.`,expected:c(t,e),actual:n(this.outcome)});let r=this.outcome.value,s;if(typeof t=="number"?s=x(r.toNumber(),t):typeof t=="boolean"?s=r.type===10&&r.value===t:s=C(r)===t,!s)throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but it was ${l(r)}.`,expected:c(t,e),actual:l(r)});if(e!==void 0&&r.unit!==e)throw new i({code:"EXPECTED_UNIT",message:`Expected "${this.expression}" to carry the unit "${e}", but it was ${r.unit===void 0?"unitless":`"${r.unit}"`}.`,expected:`unit "${e}"`,actual:r.unit===void 0?"no unit":`unit "${r.unit}"`});return this}toBeError(){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_ERROR",message:`Expected "${this.expression}" to fail, but it produced ${n(this.outcome)}.`,expected:"an error",actual:n(this.outcome)});return this}toFailWith(t){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it produced ${n(this.outcome)}.`,expected:`error code "${t}"`,actual:n(this.outcome)});if(this.outcome.code!==t)throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,expected:`error code "${t}"`,actual:`error code "${this.outcome.code}"`});return this}toBePending(){if(this.outcome.status!=="pending")throw new i({code:"EXPECTED_PENDING",message:`Expected "${this.expression}" to be pending, but got ${n(this.outcome)}.`,expected:"a pending async value",actual:n(this.outcome)});return this}};function c(o,t){let e=typeof o=="string"?JSON.stringify(o):String(o);return t===void 0?e:`${e} ${t}`}function C(o){return String(o.value)}function D(o,t){return new d(t,v(o,t))}var O=["a","an","and","or","but","if","then","the","this","that","these","those","in","on","at","to","of","for","from","with","by","as","per","into","over","is","are","was","were","be","been","being","do","does","did","have","has","had","will","would","can","could","should","may","might","must","price","cost","value","total","sum","count","rate","amount","number","time","date","day","week","month","year","hour","minute","second","add","buy","sell","hold","make","take","give","get","set","run","up","down","out","off","all","some","any","no","not","more","less","one","two","three","first","last","next","each","every","here","there"],$=["error","warning","info"];function k(o){let t=[],e=o.lexerVocabulary;if(e?.keywords)for(let[r,s]of Object.entries(e.keywords))t.push({word:r,via:"keyword",tokenType:s});if(e?.units)for(let r of e.units)t.push({word:r,via:"unit"});if(e?.operators)for(let[r,s]of Object.entries(e.operators))t.push({word:r,via:"operator",tokenType:s});if(o.phrases)for(let[r,s]of Object.entries(o.phrases))r.includes(" ")||t.push({word:r,via:"phrase",tokenType:s});return t}var p=class{constructor(t){this.pkg=t;}notToShadow(t=O){let e=new Set(t.map(s=>s.toLowerCase())),r=k(this.pkg).filter(s=>e.has(s.word.toLowerCase()));if(r.length>0){let s=r.map(a=>`"${a.word}" (${a.via})`).join(", ");throw new i({code:"PACKAGE_SHADOWS_PROSE",message:`Package "${this.pkg.name}" claims prose word(s) as syntax: ${s}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,expected:"no prose words claimed as syntax",actual:s})}return r}notToCollideWith(t,e="error"){let r=a(this.pkg,t),s=$.indexOf(e),a$1=r.conflicts.filter(u=>$.indexOf(u.severity)<=s);if(a$1.length>0){let u=a$1.map(g=>`[${g.severity}] ${g.detail}`).join(`
2
2
  `);throw new i({code:"PACKAGE_VOCABULARY_COLLISION",message:`Package "${this.pkg.name}" collides with another package:
3
3
  ${u}`,expected:`no conflicts at or above "${e}" severity`,actual:`${a$1.length} conflict(s)`})}return r}toDeclareCompatibleEngineVersion(t=a$1){let e=b(this.pkg,t);if(!e.compatible){let r=e.reason==="invalid-range"?`its range "${e.declaredRange}" is not valid semver`:`its range "${e.declaredRange}" is not satisfied by engine version "${e.engineVersion}"`;throw new i({code:"PACKAGE_ENGINE_VERSION_INCOMPATIBLE",message:`Package "${this.pkg.name}" declares an engineVersion that will be rejected at registration: ${r}.`,expected:`an engineVersion satisfied by "${t}"`,actual:`"${e.declaredRange}"`})}return this}};function L(o){return new p(o)}export{O as COMMON_PROSE_WORDS,i as ExpectationError,d as ExpressionAssertion,p as PackageAssertion,V as createTestEngine,D as expectExpression,L as expectPackage};//# sourceMappingURL=testing.js.map
4
4
  //# sourceMappingURL=testing.js.map
package/dist/uom.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKYE5BWPN_cjs=require('./chunk-KYE5BWPN.cjs'),chunk2YNRIT2L_cjs=require('./chunk-2YNRIT2L.cjs');require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-O5ZLOZPH.cjs');var chunkZKFCKAIX_cjs=require('./chunk-ZKFCKAIX.cjs');require('./chunk-EZKR44MA.cjs'),require('./chunk-HTAT4MGN.cjs');Object.defineProperty(exports,"CurrencyAsyncResolver",{enumerable:true,get:function(){return chunkKYE5BWPN_cjs.b}});Object.defineProperty(exports,"CurrencyExchangeService",{enumerable:true,get:function(){return chunk2YNRIT2L_cjs.a}});Object.defineProperty(exports,"currencyExchangeService",{enumerable:true,get:function(){return chunk2YNRIT2L_cjs.b}});Object.defineProperty(exports,"sharedCurrencyExchange",{enumerable:true,get:function(){return chunk2YNRIT2L_cjs.c}});Object.defineProperty(exports,"canConvert",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.d}});Object.defineProperty(exports,"convertUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.e}});Object.defineProperty(exports,"getBestUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.h}});Object.defineProperty(exports,"getMeasure",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.c}});Object.defineProperty(exports,"isConvertibleUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.g}});Object.defineProperty(exports,"resolveUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.b}});//# sourceMappingURL=uom.cjs.map
1
+ 'use strict';var chunkA755LVPT_cjs=require('./chunk-A755LVPT.cjs'),chunkDUFEONVN_cjs=require('./chunk-DUFEONVN.cjs');require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-OM7NOHJF.cjs');var chunkZKFCKAIX_cjs=require('./chunk-ZKFCKAIX.cjs');require('./chunk-EZKR44MA.cjs'),require('./chunk-SUAGBRQ7.cjs');Object.defineProperty(exports,"CurrencyAsyncResolver",{enumerable:true,get:function(){return chunkA755LVPT_cjs.b}});Object.defineProperty(exports,"CurrencyExchangeService",{enumerable:true,get:function(){return chunkDUFEONVN_cjs.a}});Object.defineProperty(exports,"currencyExchangeService",{enumerable:true,get:function(){return chunkDUFEONVN_cjs.b}});Object.defineProperty(exports,"sharedCurrencyExchange",{enumerable:true,get:function(){return chunkDUFEONVN_cjs.c}});Object.defineProperty(exports,"canConvert",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.d}});Object.defineProperty(exports,"convertUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.e}});Object.defineProperty(exports,"getBestUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.h}});Object.defineProperty(exports,"getMeasure",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.c}});Object.defineProperty(exports,"isConvertibleUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.g}});Object.defineProperty(exports,"resolveUnit",{enumerable:true,get:function(){return chunkZKFCKAIX_cjs.b}});//# sourceMappingURL=uom.cjs.map
2
2
  //# sourceMappingURL=uom.cjs.map
package/dist/uom.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as CurrencyAsyncResolver}from'./chunk-Z5VBXZ4A.js';export{a as CurrencyExchangeService,b as currencyExchangeService,c as sharedCurrencyExchange}from'./chunk-DDVDRWCK.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-LV7PJ2MU.js';export{d as canConvert,e as convertUnit,h as getBestUnit,c as getMeasure,g as isConvertibleUnit,b as resolveUnit}from'./chunk-4CNYGIND.js';import'./chunk-PRSXXDTA.js';import'./chunk-Z5DA5UXY.js';//# sourceMappingURL=uom.js.map
1
+ export{b as CurrencyAsyncResolver}from'./chunk-SFM4XFGJ.js';export{a as CurrencyExchangeService,b as currencyExchangeService,c as sharedCurrencyExchange}from'./chunk-PTXUWGRR.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-X5K72MBV.js';export{d as canConvert,e as convertUnit,h as getBestUnit,c as getMeasure,g as isConvertibleUnit,b as resolveUnit}from'./chunk-4CNYGIND.js';import'./chunk-PRSXXDTA.js';import'./chunk-RELMEWY6.js';//# sourceMappingURL=uom.js.map
2
2
  //# sourceMappingURL=uom.js.map
package/dist/vm.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk2G3AW6OQ_cjs=require('./chunk-2G3AW6OQ.cjs');require('./chunk-HG4NPDN5.cjs');var chunk5NQE5JMU_cjs=require('./chunk-5NQE5JMU.cjs');require('./chunk-YLTNXYA7.cjs'),require('./chunk-2YNRIT2L.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-UBKWHRFL.cjs'),require('./chunk-5J2XDCSV.cjs'),require('./chunk-E4HAKNBQ.cjs');var chunkO5ZLOZPH_cjs=require('./chunk-O5ZLOZPH.cjs');require('./chunk-ZKFCKAIX.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-HTAT4MGN.cjs');var l=class{constructor(t){this.checkpoints=[];this.vm=t;}snapshot(t,n,e){if(e.length===0)return null;let r=this.checkpoints.length>0?this.checkpoints[this.checkpoints.length-1]:null,o=Object.create(r?.variables??null),i=Object.create(r?.functions??null);for(let s of e){if(this.vm.hasUserFunction(s)){let p=this.vm.getUserFunction(s);p&&(i[s]=p);continue}let u=this.vm.getVar(s);u!==void 0&&(o[s]=u);}let c={lineNumber:t,lineId:n,variables:o,functions:i,parent:r};return this.checkpoints.push(c),c}restoreTo(t){let n=this.getNearestCheckpoint(t);if(!n){this.vm.reset();return}let e=[],r=n;for(;r;)e.unshift(r),r=r.parent;this.vm.reset();for(let o of e){for(let i of Object.keys(o.variables))this.vm.setVar(i,o.variables[i]);for(let i of Object.keys(o.functions)){let c=o.functions[i];this.vm.defineUserFunction(c.name,c.params,c.program);}}}getNearestCheckpoint(t){let n=null;for(let e of this.checkpoints)if(e.lineNumber<=t)n=e;else break;return n}getCheckpointAt(t){return this.checkpoints.find(n=>n.lineNumber===t)}getAllCheckpoints(){return this.checkpoints}lookupVariable(t){if(this.checkpoints.length===0)return;let e=this.checkpoints[this.checkpoints.length-1].variables;for(;e;){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];e=Object.getPrototypeOf(e);}}clear(){this.checkpoints=[];}get count(){return this.checkpoints.length}get isEmpty(){return this.checkpoints.length===0}get vmInstance(){return this.vm}};Object.defineProperty(exports,"DependencyGraph",{enumerable:true,get:function(){return chunk2G3AW6OQ_cjs.a}});Object.defineProperty(exports,"ScopeManager",{enumerable:true,get:function(){return chunk2G3AW6OQ_cjs.b}});Object.defineProperty(exports,"createVM",{enumerable:true,get:function(){return chunk2G3AW6OQ_cjs.c}});Object.defineProperty(exports,"executeBytecode",{enumerable:true,get:function(){return chunk2G3AW6OQ_cjs.d}});Object.defineProperty(exports,"OpRegistry",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.v}});Object.defineProperty(exports,"allocatePluginFunctionIndex",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.E}});Object.defineProperty(exports,"binaryOp",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.u}});Object.defineProperty(exports,"builtinFunctions",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.C}});Object.defineProperty(exports,"pluginFunctionIndexFor",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.F}});Object.defineProperty(exports,"pluginFunctionRegistry",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.D}});Object.defineProperty(exports,"sharedOpRegistry",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.w}});Object.defineProperty(exports,"unifyUom",{enumerable:true,get:function(){return chunk5NQE5JMU_cjs.j}});Object.defineProperty(exports,"Value",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.m}});Object.defineProperty(exports,"ValueType",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.g}});Object.defineProperty(exports,"bigIntValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.s}});Object.defineProperty(exports,"chargeAllocation",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.c}});Object.defineProperty(exports,"checkAllocation",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.d}});Object.defineProperty(exports,"checkedArray",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.e}});Object.defineProperty(exports,"colVectorValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.E}});Object.defineProperty(exports,"hexValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.r}});Object.defineProperty(exports,"matrixValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.C}});Object.defineProperty(exports,"numberValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.n}});Object.defineProperty(exports,"rangeValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.F}});Object.defineProperty(exports,"rowVectorValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.D}});Object.defineProperty(exports,"stringValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.t}});Object.defineProperty(exports,"uomValue",{enumerable:true,get:function(){return chunkO5ZLOZPH_cjs.u}});exports.VMCheckpointer=l;//# sourceMappingURL=vm.cjs.map
1
+ 'use strict';var chunkGWV273KZ_cjs=require('./chunk-GWV273KZ.cjs');require('./chunk-HG4NPDN5.cjs');var chunkRAFOQ4T5_cjs=require('./chunk-RAFOQ4T5.cjs');require('./chunk-CM2WM5CM.cjs'),require('./chunk-DUFEONVN.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-YWF6C2IO.cjs'),require('./chunk-A764BY7L.cjs'),require('./chunk-E4HAKNBQ.cjs');var chunkOM7NOHJF_cjs=require('./chunk-OM7NOHJF.cjs');require('./chunk-ZKFCKAIX.cjs'),require('./chunk-EZKR44MA.cjs'),require('./chunk-SUAGBRQ7.cjs');var l=class{constructor(t){this.checkpoints=[];this.vm=t;}snapshot(t,n,e){if(e.length===0)return null;let r=this.checkpoints.length>0?this.checkpoints[this.checkpoints.length-1]:null,o=Object.create(r?.variables??null),i=Object.create(r?.functions??null);for(let s of e){if(this.vm.hasUserFunction(s)){let p=this.vm.getUserFunction(s);p&&(i[s]=p);continue}let u=this.vm.getVar(s);u!==void 0&&(o[s]=u);}let c={lineNumber:t,lineId:n,variables:o,functions:i,parent:r};return this.checkpoints.push(c),c}restoreTo(t){let n=this.getNearestCheckpoint(t);if(!n){this.vm.reset();return}let e=[],r=n;for(;r;)e.unshift(r),r=r.parent;this.vm.reset();for(let o of e){for(let i of Object.keys(o.variables))this.vm.setVar(i,o.variables[i]);for(let i of Object.keys(o.functions)){let c=o.functions[i];this.vm.defineUserFunction(c.name,c.params,c.program);}}}getNearestCheckpoint(t){let n=null;for(let e of this.checkpoints)if(e.lineNumber<=t)n=e;else break;return n}getCheckpointAt(t){return this.checkpoints.find(n=>n.lineNumber===t)}getAllCheckpoints(){return this.checkpoints}lookupVariable(t){if(this.checkpoints.length===0)return;let e=this.checkpoints[this.checkpoints.length-1].variables;for(;e;){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];e=Object.getPrototypeOf(e);}}clear(){this.checkpoints=[];}get count(){return this.checkpoints.length}get isEmpty(){return this.checkpoints.length===0}get vmInstance(){return this.vm}};Object.defineProperty(exports,"DependencyGraph",{enumerable:true,get:function(){return chunkGWV273KZ_cjs.a}});Object.defineProperty(exports,"ScopeManager",{enumerable:true,get:function(){return chunkGWV273KZ_cjs.b}});Object.defineProperty(exports,"createVM",{enumerable:true,get:function(){return chunkGWV273KZ_cjs.c}});Object.defineProperty(exports,"executeBytecode",{enumerable:true,get:function(){return chunkGWV273KZ_cjs.d}});Object.defineProperty(exports,"OpRegistry",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.v}});Object.defineProperty(exports,"allocatePluginFunctionIndex",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.E}});Object.defineProperty(exports,"binaryOp",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.u}});Object.defineProperty(exports,"builtinFunctions",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.C}});Object.defineProperty(exports,"pluginFunctionIndexFor",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.F}});Object.defineProperty(exports,"pluginFunctionRegistry",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.D}});Object.defineProperty(exports,"sharedOpRegistry",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.w}});Object.defineProperty(exports,"unifyUom",{enumerable:true,get:function(){return chunkRAFOQ4T5_cjs.j}});Object.defineProperty(exports,"Value",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.m}});Object.defineProperty(exports,"ValueType",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.g}});Object.defineProperty(exports,"bigIntValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.s}});Object.defineProperty(exports,"chargeAllocation",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.c}});Object.defineProperty(exports,"checkAllocation",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.d}});Object.defineProperty(exports,"checkedArray",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.e}});Object.defineProperty(exports,"colVectorValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.E}});Object.defineProperty(exports,"hexValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.r}});Object.defineProperty(exports,"matrixValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.C}});Object.defineProperty(exports,"numberValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.n}});Object.defineProperty(exports,"rangeValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.F}});Object.defineProperty(exports,"rowVectorValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.D}});Object.defineProperty(exports,"stringValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.t}});Object.defineProperty(exports,"uomValue",{enumerable:true,get:function(){return chunkOM7NOHJF_cjs.u}});exports.VMCheckpointer=l;//# sourceMappingURL=vm.cjs.map
2
2
  //# sourceMappingURL=vm.cjs.map
package/dist/vm.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- export { B as Bytecode, D as DependencyGraph, E as ExpressionRecord, L as LineExecutionContext, O as OpRegistry, S as ScopeManager, V as VM, a as allocatePluginFunctionIndex, b as builtinFunctions, c as createVM, e as executeBytecode, p as pluginFunctionIndexFor, d as pluginFunctionRegistry, s as sharedOpRegistry } from './VMBuiltins-AIivGl0a.cjs';
1
+ export { B as Bytecode, D as DependencyGraph, E as ExpressionRecord, L as LineExecutionContext, O as OpRegistry, S as ScopeManager, V as VM, a as allocatePluginFunctionIndex, b as builtinFunctions, c as createVM, e as executeBytecode, p as pluginFunctionIndexFor, d as pluginFunctionRegistry, s as sharedOpRegistry } from './VMBuiltins-BkKzhj6C.cjs';
2
2
  import { V as Value } from './Value-BYHw-x7q.cjs';
3
3
  export { M as MatrixData, a as MatrixEntry, R as RangeData, b as ValueType, c as bigIntValue, d as colVectorValue, h as hexValue, m as matrixValue, n as numberValue, r as rangeValue, e as rowVectorValue, s as stringValue, u as uomValue } from './Value-BYHw-x7q.cjs';
4
- export { V as VMCheckpoint, a as VMCheckpointer } from './VMCheckpoints-BVrJwfZY.cjs';
4
+ export { V as VMCheckpoint, a as VMCheckpointer } from './VMCheckpoints-WdUQrdc9.cjs';
5
5
  import './BytecodeBuilder-DSWKZi4f.cjs';
6
6
  import './CalendarBackend-MdS3Bb4P.cjs';
7
- import './EngineError-CA2tiVaI.cjs';
7
+ import './EngineError-CqGtaT_v.cjs';
8
8
  import './pipeline-BYkKNpql.cjs';
9
9
 
10
10
  /**
package/dist/vm.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { B as Bytecode, D as DependencyGraph, E as ExpressionRecord, L as LineExecutionContext, O as OpRegistry, S as ScopeManager, V as VM, a as allocatePluginFunctionIndex, b as builtinFunctions, c as createVM, e as executeBytecode, p as pluginFunctionIndexFor, d as pluginFunctionRegistry, s as sharedOpRegistry } from './VMBuiltins-CbuFfIgQ.js';
1
+ export { B as Bytecode, D as DependencyGraph, E as ExpressionRecord, L as LineExecutionContext, O as OpRegistry, S as ScopeManager, V as VM, a as allocatePluginFunctionIndex, b as builtinFunctions, c as createVM, e as executeBytecode, p as pluginFunctionIndexFor, d as pluginFunctionRegistry, s as sharedOpRegistry } from './VMBuiltins-Du9y8sEo.js';
2
2
  import { V as Value } from './Value-BYHw-x7q.js';
3
3
  export { M as MatrixData, a as MatrixEntry, R as RangeData, b as ValueType, c as bigIntValue, d as colVectorValue, h as hexValue, m as matrixValue, n as numberValue, r as rangeValue, e as rowVectorValue, s as stringValue, u as uomValue } from './Value-BYHw-x7q.js';
4
- export { V as VMCheckpoint, a as VMCheckpointer } from './VMCheckpoints-DFCl63K5.js';
4
+ export { V as VMCheckpoint, a as VMCheckpointer } from './VMCheckpoints-gvy_yxYh.js';
5
5
  import './BytecodeBuilder-DSWKZi4f.js';
6
6
  import './CalendarBackend-MdS3Bb4P.js';
7
- import './EngineError-CA2tiVaI.js';
7
+ import './EngineError-CqGtaT_v.js';
8
8
  import './pipeline-Cl7KW8CB.js';
9
9
 
10
10
  /**
package/dist/vm.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as DependencyGraph,b as ScopeManager,c as createVM,d as executeBytecode}from'./chunk-IEBWLNI5.js';import'./chunk-JP4JMQOG.js';export{v as OpRegistry,E as allocatePluginFunctionIndex,u as binaryOp,C as builtinFunctions,F as pluginFunctionIndexFor,D as pluginFunctionRegistry,w as sharedOpRegistry,j as unifyUom}from'./chunk-IAL64FCP.js';import'./chunk-I6WGOM3C.js';import'./chunk-DDVDRWCK.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-6T5HPIZX.js';import'./chunk-A7RRWNLE.js';import'./chunk-J4K72CQN.js';export{m as Value,g as ValueType,s as bigIntValue,c as chargeAllocation,d as checkAllocation,e as checkedArray,E as colVectorValue,r as hexValue,C as matrixValue,n as numberValue,F as rangeValue,D as rowVectorValue,t as stringValue,u as uomValue}from'./chunk-LV7PJ2MU.js';import'./chunk-4CNYGIND.js';import'./chunk-PRSXXDTA.js';import'./chunk-Z5DA5UXY.js';var l=class{constructor(t){this.checkpoints=[];this.vm=t;}snapshot(t,n,e){if(e.length===0)return null;let r=this.checkpoints.length>0?this.checkpoints[this.checkpoints.length-1]:null,o=Object.create(r?.variables??null),i=Object.create(r?.functions??null);for(let s of e){if(this.vm.hasUserFunction(s)){let p=this.vm.getUserFunction(s);p&&(i[s]=p);continue}let u=this.vm.getVar(s);u!==void 0&&(o[s]=u);}let c={lineNumber:t,lineId:n,variables:o,functions:i,parent:r};return this.checkpoints.push(c),c}restoreTo(t){let n=this.getNearestCheckpoint(t);if(!n){this.vm.reset();return}let e=[],r=n;for(;r;)e.unshift(r),r=r.parent;this.vm.reset();for(let o of e){for(let i of Object.keys(o.variables))this.vm.setVar(i,o.variables[i]);for(let i of Object.keys(o.functions)){let c=o.functions[i];this.vm.defineUserFunction(c.name,c.params,c.program);}}}getNearestCheckpoint(t){let n=null;for(let e of this.checkpoints)if(e.lineNumber<=t)n=e;else break;return n}getCheckpointAt(t){return this.checkpoints.find(n=>n.lineNumber===t)}getAllCheckpoints(){return this.checkpoints}lookupVariable(t){if(this.checkpoints.length===0)return;let e=this.checkpoints[this.checkpoints.length-1].variables;for(;e;){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];e=Object.getPrototypeOf(e);}}clear(){this.checkpoints=[];}get count(){return this.checkpoints.length}get isEmpty(){return this.checkpoints.length===0}get vmInstance(){return this.vm}};export{l as VMCheckpointer};//# sourceMappingURL=vm.js.map
1
+ export{a as DependencyGraph,b as ScopeManager,c as createVM,d as executeBytecode}from'./chunk-2PGGPFF3.js';import'./chunk-JP4JMQOG.js';export{v as OpRegistry,E as allocatePluginFunctionIndex,u as binaryOp,C as builtinFunctions,F as pluginFunctionIndexFor,D as pluginFunctionRegistry,w as sharedOpRegistry,j as unifyUom}from'./chunk-YN5H54GM.js';import'./chunk-3ZGFAE3Q.js';import'./chunk-PTXUWGRR.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-KH4QXKLT.js';import'./chunk-NQFCXLEF.js';import'./chunk-J4K72CQN.js';export{m as Value,g as ValueType,s as bigIntValue,c as chargeAllocation,d as checkAllocation,e as checkedArray,E as colVectorValue,r as hexValue,C as matrixValue,n as numberValue,F as rangeValue,D as rowVectorValue,t as stringValue,u as uomValue}from'./chunk-X5K72MBV.js';import'./chunk-4CNYGIND.js';import'./chunk-PRSXXDTA.js';import'./chunk-RELMEWY6.js';var l=class{constructor(t){this.checkpoints=[];this.vm=t;}snapshot(t,n,e){if(e.length===0)return null;let r=this.checkpoints.length>0?this.checkpoints[this.checkpoints.length-1]:null,o=Object.create(r?.variables??null),i=Object.create(r?.functions??null);for(let s of e){if(this.vm.hasUserFunction(s)){let p=this.vm.getUserFunction(s);p&&(i[s]=p);continue}let u=this.vm.getVar(s);u!==void 0&&(o[s]=u);}let c={lineNumber:t,lineId:n,variables:o,functions:i,parent:r};return this.checkpoints.push(c),c}restoreTo(t){let n=this.getNearestCheckpoint(t);if(!n){this.vm.reset();return}let e=[],r=n;for(;r;)e.unshift(r),r=r.parent;this.vm.reset();for(let o of e){for(let i of Object.keys(o.variables))this.vm.setVar(i,o.variables[i]);for(let i of Object.keys(o.functions)){let c=o.functions[i];this.vm.defineUserFunction(c.name,c.params,c.program);}}}getNearestCheckpoint(t){let n=null;for(let e of this.checkpoints)if(e.lineNumber<=t)n=e;else break;return n}getCheckpointAt(t){return this.checkpoints.find(n=>n.lineNumber===t)}getAllCheckpoints(){return this.checkpoints}lookupVariable(t){if(this.checkpoints.length===0)return;let e=this.checkpoints[this.checkpoints.length-1].variables;for(;e;){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];e=Object.getPrototypeOf(e);}}clear(){this.checkpoints=[];}get count(){return this.checkpoints.length}get isEmpty(){return this.checkpoints.length===0}get vmInstance(){return this.vm}};export{l as VMCheckpointer};//# sourceMappingURL=vm.js.map
2
2
  //# sourceMappingURL=vm.js.map
package/dist/worker.cjs CHANGED
@@ -1,3 +1,3 @@
1
- 'use strict';var chunkMKBB7IVN_cjs=require('./chunk-MKBB7IVN.cjs'),chunkIIBR4LVH_cjs=require('./chunk-IIBR4LVH.cjs');require('./chunk-GWEINEJG.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-ZVPZQ66D.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-2G3AW6OQ.cjs'),require('./chunk-HG4NPDN5.cjs');var chunkQXGKONTZ_cjs=require('./chunk-QXGKONTZ.cjs');require('./chunk-R2SZFJTT.cjs');var chunkYIXCPLCN_cjs=require('./chunk-YIXCPLCN.cjs');require('./chunk-KYE5BWPN.cjs');var chunkW5BBKLNS_cjs=require('./chunk-W5BBKLNS.cjs');require('./chunk-WXOJ3DS3.cjs'),require('./chunk-UMW5PO42.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-5NQE5JMU.cjs'),require('./chunk-YLTNXYA7.cjs'),require('./chunk-2YNRIT2L.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs');var chunk5TVI2UPZ_cjs=require('./chunk-5TVI2UPZ.cjs'),chunkUBKWHRFL_cjs=require('./chunk-UBKWHRFL.cjs');require('./chunk-5J2XDCSV.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-O5ZLOZPH.cjs'),require('./chunk-ZKFCKAIX.cjs');var chunkRVNW627Y_cjs=require('./chunk-RVNW627Y.cjs');require('./chunk-TTHCH7V2.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-U7CNADCJ.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs');var chunkHTAT4MGN_cjs=require('./chunk-HTAT4MGN.cjs');function B(e){if(e?.date?.inputOrder!=="locale")return e;let r={...e.date,inputOrder:chunkW5BBKLNS_cjs.h({...chunkRVNW627Y_cjs.b.date,...e.date}).order};return delete r.inputLocale,{...e,date:r}}var x=class{constructor(r){this.nextId=1;this.pending=new Map;this.resolvedListeners=new Set;this.asyncErrorListeners=new Set;this.terminated=false;this.transport=r,this.transport.onMessage(n=>this.onMessage(n));}init(r){let n=this.nextId++;return new Promise((t,s)=>{this.pending.set(n,{resolve:()=>t(),reject:s}),this.transport.postMessage({kind:"init",id:n,localeCode:r.localeCode,diagnostics:r.diagnostics,config:B(r.config),packages:r.packages,formatting:r.formatting});})}parseDocument(r,n){let{signal:t,...s}=n??{},i=Object.keys(s).length>0?s:void 0;return this.call("parseDocument",[r,i],t)}evaluateLines(r,n){return this.call("evaluateLines",[r],n?.signal)}evaluateExpression(r,n){return this.call("evaluateExpression",[r],n?.signal)}onResolved(r){return this.resolvedListeners.add(r),()=>this.resolvedListeners.delete(r)}onAsyncError(r){return this.asyncErrorListeners.add(r),()=>this.asyncErrorListeners.delete(r)}terminate(){if(this.terminated)return;this.terminated=true;let r=chunkMKBB7IVN_cjs.e();for(let n of this.pending.values())this.unhook(n),n.reject(r);this.pending.clear(),this.resolvedListeners.clear(),this.asyncErrorListeners.clear(),this.transport.terminate();}call(r,n,t){if(this.terminated)return Promise.reject(chunkMKBB7IVN_cjs.e());if(t?.aborted)return Promise.reject(chunkMKBB7IVN_cjs.d(r));let s=this.nextId++;return new Promise((i,l)=>{let c={resolve:i,reject:l};if(t){let p=()=>{this.pending.has(s)&&(this.pending.delete(s),this.transport.postMessage({kind:"cancel",id:s}),l(chunkMKBB7IVN_cjs.d(r)));};c.signal=t,c.onAbort=p,t.addEventListener("abort",p,{once:true});}this.pending.set(s,c),this.transport.postMessage({kind:"request",id:s,method:r,args:n});})}onMessage(r){let n=r;switch(n.kind){case "ready":case "result":{let t=n.kind==="result"?n.value:void 0;this.settle(n.id,s=>s.resolve(t));break}case "error":this.settle(n.id,t=>t.reject(chunkMKBB7IVN_cjs.c(n.error)));break;case "async-update":for(let t of [...this.resolvedListeners])t(n.lines);break;case "async-error":for(let t of [...this.asyncErrorListeners])t({queryKey:n.queryKey,packageId:n.packageId,error:chunkMKBB7IVN_cjs.c(n.error)});break}}settle(r,n){let t=this.pending.get(r);t&&(this.pending.delete(r),this.unhook(t),n(t));}unhook(r){r.signal&&r.onAbort&&r.signal.removeEventListener("abort",r.onAbort);}};async function G(e){let r=new x(e.transport);return await r.init(e),r}function F(e){return e>0?"Infinity":e<0?"-Infinity":"NaN"}function H(e){let r=e.data.map(n=>typeof n=="object"&&n!==null?chunkUBKWHRFL_cjs.R(n):typeof n=="number"&&!Number.isFinite(n)?F(n):n);return {rows:e.rows,cols:e.cols,cells:r,hasSymbolic:e.hasSymbolic}}function m(e,r){let n=e.toNumber(),t={type:e.type,text:chunkQXGKONTZ_cjs.c(e,r),number:Number.isFinite(n)?n:0};Number.isFinite(n)||(t.nonFinite=F(n)),e.unit!==void 0&&(t.unit=e.unit),e.timedOut!==void 0&&(t.timedOut=e.timedOut),e.grain!==void 0&&(t.grain=e.grain),e.zone!==void 0&&(t.zone=e.zone);let s=e.value;if(typeof s=="bigint")t.bigint=s.toString();else if(e.type===7)t.matrix=H(s);else if(e.type===8){let i=s;t.range={min:i.min,max:i.max};}else if(e.type===14){let i=s;t.colour={hex:chunk5TVI2UPZ_cjs.f(i),r:i.r,g:i.g,b:i.b,a:i.a,format:i.format,css:chunk5TVI2UPZ_cjs.g(i)};}else if(e.type===16){let i=s;t.chart={kind:i.kind,points:i.points.map(l=>[l[0],l[1]]),label:i.label,domain:[i.domain[0],i.domain[1]],range:[i.range[0],i.range[1]],...i.expr!==void 0?{expr:i.expr}:{}};}else if(e.type===17){let i=s;t.ipCidr={...i.addr!==void 0?{addr:i.addr}:{},...i.prefix!==void 0?{prefix:i.prefix}:{},text:chunkQXGKONTZ_cjs.c(e).replace(/^=\s*/,"")};}return t}function q(e,r){return e?m(e,r):null}function J(e,r){return {start:e.start,end:e.end,expression:e.expression,lineNumber:e.lineNumber,columnNumber:e.columnNumber,result:q(e.result,r),error:e.error??null}}function y(e,r){return {lineNumber:e.lineNumber,text:e.text,startPosition:e.startPosition,endPosition:e.endPosition,isEmpty:e.isEmpty,hasInlineSolves:e.hasInlineSolves,inlineSolves:e.inlineSolves.map(n=>J(n,r)),expression:e.expression,result:q(e.result,r),error:e.error}}function R(e,r){let n={lines:e.lines.map(t=>y(t,r)),totalLines:e.totalLines,errors:[...e.errors]};return e.diagnostics!==void 0&&(n.diagnostics=e.diagnostics),n}function $(e,r){if(r===void 0)return e;let n=new Map(e.map(s=>[s.name,s])),t=[];for(let s of r){let i=n.get(s);if(!i)throw chunkHTAT4MGN_cjs.c.config(chunkMKBB7IVN_cjs.a.WORKER_UNKNOWN_PACKAGE,`No package named "${s}" is available in this worker runtime`,{name:s,available:[...n.keys()]});t.push(i);}return t}function Q(e,r={}){let n=r.packages??chunkYIXCPLCN_cjs.z,t=null,s,i=new Map,l=new Map,c=null,p=null,g=o=>e.postMessage(o),E=(o,a)=>{g({kind:"error",id:o,error:chunkMKBB7IVN_cjs.b(chunkHTAT4MGN_cjs.d(a))});},D=o=>{let a=new Map;return o.method==="parseDocument"?o.args[0].split(`
2
- `).forEach((u,d)=>a.set(d+1,u)):o.method==="evaluateLines"?o.args[0].forEach((u,d)=>a.set(d+1,u)):a.set(-1,o.args[0]),a},V=(o,a)=>{if(a.type==="error"){g({kind:"async-error",queryKey:a.queryKey,packageId:a.packageId,error:chunkMKBB7IVN_cjs.b(chunkHTAT4MGN_cjs.d(a.error))});return}let u=[];for(let d of a.lineNumbers){let f=l.get(d);if(f!==void 0)try{let T=o.evaluateLine(d,f);T&&u.push({lineNumber:d,value:m(T,s)});}catch{}}u.length>0&&g({kind:"async-update",lines:u});},U=o=>{p?.();let a=o.getEventStream().getReader();p=()=>{a.cancel();},(async()=>{try{for(;;){let{done:u,value:d}=await a.read();if(u)return;V(o,d);}}catch{}})();},j=o=>{try{let a=$(n,o.packages);t=new chunkIIBR4LVH_cjs.n({locale:o.localeCode??"en",diagnostics:o.diagnostics??!1,config:o.config,packages:a,calendar:r.calendar}),s=r.calendar?{...o.formatting??chunkQXGKONTZ_cjs.a,calendar:r.calendar}:o.formatting,U(t),g({kind:"ready",id:o.id});}catch(a){E(o.id,a);}},K=(o,a)=>{let{method:u,args:d}=a;switch(u){case "parseDocument":return R(o.parseDocument(d[0],d[1]),s);case "evaluateLines":return o.evaluateLines(d[0]).map(f=>y(f,s));case "evaluateExpression":return m(o.evaluateExpression(d[0]),s);default:throw chunkHTAT4MGN_cjs.c.execution(chunkMKBB7IVN_cjs.a.WORKER_UNKNOWN_METHOD,`The worker runtime has no method named "${String(u)}"`,{method:u})}},_=o=>{let a=t;if(!a){E(o.id,chunkHTAT4MGN_cjs.c.execution(chunkMKBB7IVN_cjs.a.WORKER_NOT_INITIALISED,"The worker received a request before its engine finished initialising"));return}c?.abort();let u=new AbortController;c=u,l=D(o),i.set(o.id,u),a.setKeystrokeSignal(u.signal);try{let d=K(a,o);g({kind:"result",id:o.id,value:d});}catch(d){E(o.id,d);}finally{i.delete(o.id),a.setKeystrokeSignal(null);}};return e.onMessage(o=>{let a=o;switch(a.kind){case "init":j(a);break;case "request":_(a);break;case "cancel":i.get(a.id)?.abort();break}}),()=>{p?.(),p=null,c?.abort(),c=null,l=new Map;for(let o of i.values())o.abort();i.clear(),t?.clear(),t=null,e.terminate();}}function X(e){return typeof globalThis.structuredClone=="function"?globalThis.structuredClone(e):JSON.parse(JSON.stringify(e))}function Y(){let e=null,r=null,n=true,t=(l,c)=>{let p=X(c);queueMicrotask(()=>{n&&l()?.(p);});};return {client:{postMessage:l=>t(()=>r,l),onMessage:l=>{e=l;},terminate:()=>{n=false;}},host:{postMessage:l=>t(()=>e,l),onMessage:l=>{r=l;},terminate:()=>{n=false;}}}}function Z(e){return {postMessage:r=>e.postMessage(r),onMessage:r=>{let n=t=>r(t.data);typeof e.addEventListener=="function"?e.addEventListener("message",n):e.onmessage=n,e.start?.();},terminate:()=>{e.terminate?.(),e.close?.();}}}function ee(e){return {postMessage:r=>e.postMessage(r),onMessage:r=>{e.on("message",n=>r(n));},terminate:()=>{e.terminate?.(),e.close?.();}}}exports.createLinkedTransports=Y;exports.createWorkerEngine=G;exports.eventTargetTransport=Z;exports.messagePortTransport=ee;exports.serializeParsedLine=y;exports.serializeParsingResult=R;exports.serializeValue=m;exports.startWorkerRuntime=Q;//# sourceMappingURL=worker.cjs.map
1
+ 'use strict';var chunk7DJYS5PO_cjs=require('./chunk-7DJYS5PO.cjs'),chunkIY3GI2AM_cjs=require('./chunk-IY3GI2AM.cjs');require('./chunk-Q7TBBV62.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-ZVPZQ66D.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-GWV273KZ.cjs'),require('./chunk-HG4NPDN5.cjs');var chunkP43SV4NJ_cjs=require('./chunk-P43SV4NJ.cjs');require('./chunk-R2SZFJTT.cjs');var chunkCT3PD7L3_cjs=require('./chunk-CT3PD7L3.cjs');require('./chunk-A755LVPT.cjs');var chunkWQGHJAW2_cjs=require('./chunk-WQGHJAW2.cjs');require('./chunk-5AKT36UK.cjs'),require('./chunk-4DR5RBHQ.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-RAFOQ4T5.cjs'),require('./chunk-CM2WM5CM.cjs'),require('./chunk-DUFEONVN.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs');var chunk5TVI2UPZ_cjs=require('./chunk-5TVI2UPZ.cjs'),chunkYWF6C2IO_cjs=require('./chunk-YWF6C2IO.cjs');require('./chunk-A764BY7L.cjs'),require('./chunk-E4HAKNBQ.cjs'),require('./chunk-OM7NOHJF.cjs'),require('./chunk-ZKFCKAIX.cjs');var chunkZBMWLTE6_cjs=require('./chunk-ZBMWLTE6.cjs');require('./chunk-AGCNMEP2.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-WU7SBKVU.cjs'),require('./chunk-YBQOQTVL.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-J4LSAHCY.cjs'),require('./chunk-EZKR44MA.cjs');var chunkSUAGBRQ7_cjs=require('./chunk-SUAGBRQ7.cjs');function B(e){if(e?.date?.inputOrder!=="locale")return e;let r={...e.date,inputOrder:chunkWQGHJAW2_cjs.h({...chunkZBMWLTE6_cjs.b.date,...e.date}).order};return delete r.inputLocale,{...e,date:r}}var x=class{constructor(r){this.nextId=1;this.pending=new Map;this.resolvedListeners=new Set;this.asyncErrorListeners=new Set;this.terminated=false;this.transport=r,this.transport.onMessage(n=>this.onMessage(n));}init(r){let n=this.nextId++;return new Promise((t,s)=>{this.pending.set(n,{resolve:()=>t(),reject:s}),this.transport.postMessage({kind:"init",id:n,localeCode:r.localeCode,diagnostics:r.diagnostics,config:B(r.config),packages:r.packages,formatting:r.formatting});})}parseDocument(r,n){let{signal:t,...s}=n??{},i=Object.keys(s).length>0?s:void 0;return this.call("parseDocument",[r,i],t)}evaluateLines(r,n){return this.call("evaluateLines",[r],n?.signal)}evaluateExpression(r,n){return this.call("evaluateExpression",[r],n?.signal)}onResolved(r){return this.resolvedListeners.add(r),()=>this.resolvedListeners.delete(r)}onAsyncError(r){return this.asyncErrorListeners.add(r),()=>this.asyncErrorListeners.delete(r)}terminate(){if(this.terminated)return;this.terminated=true;let r=chunk7DJYS5PO_cjs.e();for(let n of this.pending.values())this.unhook(n),n.reject(r);this.pending.clear(),this.resolvedListeners.clear(),this.asyncErrorListeners.clear(),this.transport.terminate();}call(r,n,t){if(this.terminated)return Promise.reject(chunk7DJYS5PO_cjs.e());if(t?.aborted)return Promise.reject(chunk7DJYS5PO_cjs.d(r));let s=this.nextId++;return new Promise((i,l)=>{let c={resolve:i,reject:l};if(t){let p=()=>{this.pending.has(s)&&(this.pending.delete(s),this.transport.postMessage({kind:"cancel",id:s}),l(chunk7DJYS5PO_cjs.d(r)));};c.signal=t,c.onAbort=p,t.addEventListener("abort",p,{once:true});}this.pending.set(s,c),this.transport.postMessage({kind:"request",id:s,method:r,args:n});})}onMessage(r){let n=r;switch(n.kind){case "ready":case "result":{let t=n.kind==="result"?n.value:void 0;this.settle(n.id,s=>s.resolve(t));break}case "error":this.settle(n.id,t=>t.reject(chunk7DJYS5PO_cjs.c(n.error)));break;case "async-update":for(let t of [...this.resolvedListeners])t(n.lines);break;case "async-error":for(let t of [...this.asyncErrorListeners])t({queryKey:n.queryKey,packageId:n.packageId,error:chunk7DJYS5PO_cjs.c(n.error)});break}}settle(r,n){let t=this.pending.get(r);t&&(this.pending.delete(r),this.unhook(t),n(t));}unhook(r){r.signal&&r.onAbort&&r.signal.removeEventListener("abort",r.onAbort);}};async function G(e){let r=new x(e.transport);return await r.init(e),r}function F(e){return e>0?"Infinity":e<0?"-Infinity":"NaN"}function H(e){let r=e.data.map(n=>typeof n=="object"&&n!==null?chunkYWF6C2IO_cjs.R(n):typeof n=="number"&&!Number.isFinite(n)?F(n):n);return {rows:e.rows,cols:e.cols,cells:r,hasSymbolic:e.hasSymbolic}}function m(e,r){let n=e.toNumber(),t={type:e.type,text:chunkP43SV4NJ_cjs.c(e,r),number:Number.isFinite(n)?n:0};Number.isFinite(n)||(t.nonFinite=F(n)),e.unit!==void 0&&(t.unit=e.unit),e.timedOut!==void 0&&(t.timedOut=e.timedOut),e.grain!==void 0&&(t.grain=e.grain),e.zone!==void 0&&(t.zone=e.zone);let s=e.value;if(typeof s=="bigint")t.bigint=s.toString();else if(e.type===7)t.matrix=H(s);else if(e.type===8){let i=s;t.range={min:i.min,max:i.max};}else if(e.type===14){let i=s;t.colour={hex:chunk5TVI2UPZ_cjs.f(i),r:i.r,g:i.g,b:i.b,a:i.a,format:i.format,css:chunk5TVI2UPZ_cjs.g(i)};}else if(e.type===16){let i=s;t.chart={kind:i.kind,points:i.points.map(l=>[l[0],l[1]]),label:i.label,domain:[i.domain[0],i.domain[1]],range:[i.range[0],i.range[1]],...i.expr!==void 0?{expr:i.expr}:{}};}else if(e.type===17){let i=s;t.ipCidr={...i.addr!==void 0?{addr:i.addr}:{},...i.prefix!==void 0?{prefix:i.prefix}:{},text:chunkP43SV4NJ_cjs.c(e).replace(/^=\s*/,"")};}return t}function q(e,r){return e?m(e,r):null}function J(e,r){return {start:e.start,end:e.end,expression:e.expression,lineNumber:e.lineNumber,columnNumber:e.columnNumber,result:q(e.result,r),error:e.error??null}}function y(e,r){return {lineNumber:e.lineNumber,text:e.text,startPosition:e.startPosition,endPosition:e.endPosition,isEmpty:e.isEmpty,hasInlineSolves:e.hasInlineSolves,inlineSolves:e.inlineSolves.map(n=>J(n,r)),expression:e.expression,result:q(e.result,r),error:e.error}}function R(e,r){let n={lines:e.lines.map(t=>y(t,r)),totalLines:e.totalLines,errors:[...e.errors]};return e.diagnostics!==void 0&&(n.diagnostics=e.diagnostics),n}function $(e,r){if(r===void 0)return e;let n=new Map(e.map(s=>[s.name,s])),t=[];for(let s of r){let i=n.get(s);if(!i)throw chunkSUAGBRQ7_cjs.c.config(chunk7DJYS5PO_cjs.a.WORKER_UNKNOWN_PACKAGE,`No package named "${s}" is available in this worker runtime`,{name:s,available:[...n.keys()]});t.push(i);}return t}function Q(e,r={}){let n=r.packages??chunkCT3PD7L3_cjs.z,t=null,s,i=new Map,l=new Map,c=null,p=null,g=o=>e.postMessage(o),E=(o,a)=>{g({kind:"error",id:o,error:chunk7DJYS5PO_cjs.b(chunkSUAGBRQ7_cjs.d(a))});},D=o=>{let a=new Map;return o.method==="parseDocument"?o.args[0].split(`
2
+ `).forEach((u,d)=>a.set(d+1,u)):o.method==="evaluateLines"?o.args[0].forEach((u,d)=>a.set(d+1,u)):a.set(-1,o.args[0]),a},V=(o,a)=>{if(a.type==="error"){g({kind:"async-error",queryKey:a.queryKey,packageId:a.packageId,error:chunk7DJYS5PO_cjs.b(chunkSUAGBRQ7_cjs.d(a.error))});return}let u=[];for(let d of a.lineNumbers){let f=l.get(d);if(f!==void 0)try{let T=o.evaluateLine(d,f);T&&u.push({lineNumber:d,value:m(T,s)});}catch{}}u.length>0&&g({kind:"async-update",lines:u});},U=o=>{p?.();let a=o.getEventStream().getReader();p=()=>{a.cancel();},(async()=>{try{for(;;){let{done:u,value:d}=await a.read();if(u)return;V(o,d);}}catch{}})();},j=o=>{try{let a=$(n,o.packages);t=new chunkIY3GI2AM_cjs.n({locale:o.localeCode??"en",diagnostics:o.diagnostics??!1,config:o.config,packages:a,calendar:r.calendar}),s=r.calendar?{...o.formatting??chunkP43SV4NJ_cjs.a,calendar:r.calendar}:o.formatting,U(t),g({kind:"ready",id:o.id});}catch(a){E(o.id,a);}},K=(o,a)=>{let{method:u,args:d}=a;switch(u){case "parseDocument":return R(o.parseDocument(d[0],d[1]),s);case "evaluateLines":return o.evaluateLines(d[0]).map(f=>y(f,s));case "evaluateExpression":return m(o.evaluateExpression(d[0]),s);default:throw chunkSUAGBRQ7_cjs.c.execution(chunk7DJYS5PO_cjs.a.WORKER_UNKNOWN_METHOD,`The worker runtime has no method named "${String(u)}"`,{method:u})}},_=o=>{let a=t;if(!a){E(o.id,chunkSUAGBRQ7_cjs.c.execution(chunk7DJYS5PO_cjs.a.WORKER_NOT_INITIALISED,"The worker received a request before its engine finished initialising"));return}c?.abort();let u=new AbortController;c=u,l=D(o),i.set(o.id,u),a.setKeystrokeSignal(u.signal);try{let d=K(a,o);g({kind:"result",id:o.id,value:d});}catch(d){E(o.id,d);}finally{i.delete(o.id),a.setKeystrokeSignal(null);}};return e.onMessage(o=>{let a=o;switch(a.kind){case "init":j(a);break;case "request":_(a);break;case "cancel":i.get(a.id)?.abort();break}}),()=>{p?.(),p=null,c?.abort(),c=null,l=new Map;for(let o of i.values())o.abort();i.clear(),t?.clear(),t=null,e.terminate();}}function X(e){return typeof globalThis.structuredClone=="function"?globalThis.structuredClone(e):JSON.parse(JSON.stringify(e))}function Y(){let e=null,r=null,n=true,t=(l,c)=>{let p=X(c);queueMicrotask(()=>{n&&l()?.(p);});};return {client:{postMessage:l=>t(()=>r,l),onMessage:l=>{e=l;},terminate:()=>{n=false;}},host:{postMessage:l=>t(()=>e,l),onMessage:l=>{r=l;},terminate:()=>{n=false;}}}}function Z(e){return {postMessage:r=>e.postMessage(r),onMessage:r=>{let n=t=>r(t.data);typeof e.addEventListener=="function"?e.addEventListener("message",n):e.onmessage=n,e.start?.();},terminate:()=>{e.terminate?.(),e.close?.();}}}function ee(e){return {postMessage:r=>e.postMessage(r),onMessage:r=>{e.on("message",n=>r(n));},terminate:()=>{e.terminate?.(),e.close?.();}}}exports.createLinkedTransports=Y;exports.createWorkerEngine=G;exports.eventTargetTransport=Z;exports.messagePortTransport=ee;exports.serializeParsedLine=y;exports.serializeParsingResult=R;exports.serializeValue=m;exports.startWorkerRuntime=Q;//# sourceMappingURL=worker.cjs.map
3
3
  //# sourceMappingURL=worker.cjs.map
package/dist/worker.d.cts CHANGED
@@ -1,19 +1,19 @@
1
1
  import { E as EngineConfigOverride } from './Configuration-BxriK9Kw.cjs';
2
- import { U as UnifiedParsingOptions, I as IEnginePackage, N as ParsedLine, P as ParsingResult } from './PackageRegistry-CevYUzRn.cjs';
2
+ import { U as UnifiedParsingOptions, I as IEnginePackage, N as ParsedLine, P as ParsingResult } from './PackageRegistry-B-C1duZw.cjs';
3
3
  import { F as FormattingSettings } from './FormattingSettings-ByO-4wiM.cjs';
4
- import { E as EngineError } from './EngineError-CA2tiVaI.cjs';
4
+ import { E as EngineError } from './EngineError-CqGtaT_v.cjs';
5
5
  import { b as ValueType, i as ColourFormat, D as DatetimeGrain, V as Value } from './Value-BYHw-x7q.cjs';
6
6
  import { a as DiagnosticReportJSON } from './pipeline-BYkKNpql.cjs';
7
7
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.cjs';
8
- import { S as SerializedEngineError } from './WorkerError-DDtwl4oH.cjs';
8
+ import { S as SerializedEngineError } from './WorkerError-CRoM8Ju1.cjs';
9
9
  import './Parselet-DF3864la.cjs';
10
10
  import './BytecodeBuilder-DSWKZi4f.cjs';
11
11
  import './Token-D8f7yaz1.cjs';
12
- import './Lexer-DOXatsjO.cjs';
12
+ import './Lexer-sCI05tqO.cjs';
13
13
  import './resolvers.cjs';
14
14
  import '@tanstack/query-core';
15
15
  import './TokenNormalizer-Pe3_390t.cjs';
16
- import './VMBuiltins-AIivGl0a.cjs';
16
+ import './VMBuiltins-BkKzhj6C.cjs';
17
17
 
18
18
  /**
19
19
  * The seam between the harness and whatever actually carries messages.
package/dist/worker.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  import { E as EngineConfigOverride } from './Configuration-BxriK9Kw.js';
2
- import { U as UnifiedParsingOptions, I as IEnginePackage, N as ParsedLine, P as ParsingResult } from './PackageRegistry-Dl9kNP14.js';
2
+ import { U as UnifiedParsingOptions, I as IEnginePackage, N as ParsedLine, P as ParsingResult } from './PackageRegistry-C78jVkI9.js';
3
3
  import { F as FormattingSettings } from './FormattingSettings-CvCzAfsz.js';
4
- import { E as EngineError } from './EngineError-CA2tiVaI.js';
4
+ import { E as EngineError } from './EngineError-CqGtaT_v.js';
5
5
  import { b as ValueType, i as ColourFormat, D as DatetimeGrain, V as Value } from './Value-BYHw-x7q.js';
6
6
  import { a as DiagnosticReportJSON } from './pipeline-Cl7KW8CB.js';
7
7
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.js';
8
- import { S as SerializedEngineError } from './WorkerError-BuO9MrRr.js';
8
+ import { S as SerializedEngineError } from './WorkerError-DTrl3Jag.js';
9
9
  import './Parselet-Dgymjxzd.js';
10
10
  import './BytecodeBuilder-DSWKZi4f.js';
11
11
  import './Token-D8f7yaz1.js';
12
- import './Lexer-B62Hn9I-.js';
12
+ import './Lexer-CqFjYoRA.js';
13
13
  import './resolvers.js';
14
14
  import '@tanstack/query-core';
15
15
  import './TokenNormalizer-IF7nPRMp.js';
16
- import './VMBuiltins-CbuFfIgQ.js';
16
+ import './VMBuiltins-Du9y8sEo.js';
17
17
 
18
18
  /**
19
19
  * The seam between the harness and whatever actually carries messages.