solve-engine 2.15.0 → 2.17.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 (174) hide show
  1. package/dist/{BytecodeBuilder-CRYfrFfq.d.cts → BytecodeBuilder-aqVa7Plx.d.cts} +10 -0
  2. package/dist/{BytecodeBuilder-CRYfrFfq.d.ts → BytecodeBuilder-aqVa7Plx.d.ts} +10 -0
  3. package/dist/{EngineError-Cv5q4Rbv.d.cts → EngineError-DTk7I7hZ.d.cts} +24 -0
  4. package/dist/{EngineError-Cv5q4Rbv.d.ts → EngineError-DTk7I7hZ.d.ts} +24 -0
  5. package/dist/{PackageCompatibility-Cl7GF_Iu.d.ts → PackageCompatibility-BGXSFuL9.d.ts} +1 -1
  6. package/dist/{PackageCompatibility-C2IQZ_w3.d.cts → PackageCompatibility-BZCqaTOO.d.cts} +1 -1
  7. package/dist/{PackageRegistry-CK_JoX50.d.ts → PackageRegistry-BRoVOYzg.d.ts} +107 -5
  8. package/dist/{PackageRegistry-CZO1IbS-.d.cts → PackageRegistry-rMGnTh7W.d.cts} +107 -5
  9. package/dist/{Parselet-CK0bNO1l.d.ts → Parselet-B-WyUtX4.d.ts} +5 -1
  10. package/dist/{Parselet-DOGmj6N6.d.cts → Parselet-Bkbp9CKD.d.cts} +5 -1
  11. package/dist/{ScopeManager-BtqiTVjG.d.cts → ScopeManager-bCYewWVt.d.cts} +2 -2
  12. package/dist/{ScopeManager-C6c1WmJD.d.ts → ScopeManager-gB9UengK.d.ts} +2 -2
  13. package/dist/{TokenNormalizer-BfTHg1qt.d.cts → TokenNormalizer-MXaKLJ_m.d.cts} +182 -0
  14. package/dist/{TokenNormalizer-d7F1KQFs.d.ts → TokenNormalizer-OTPS0Otq.d.ts} +182 -0
  15. package/dist/{VMCheckpoints-DJdvpliw.d.ts → VMCheckpoints-BDRY1Kx8.d.ts} +2 -2
  16. package/dist/{VMCheckpoints-BFDlaGse.d.cts → VMCheckpoints-DGar9Yg8.d.cts} +2 -2
  17. package/dist/{WorkerError-FH7KXX4_.d.cts → WorkerError-DGBNM3gA.d.cts} +1 -1
  18. package/dist/{WorkerError-J3v3ix_z.d.ts → WorkerError-DpZgKRks.d.ts} +1 -1
  19. package/dist/{chunk-UZSPBFZN.js → chunk-2DPKJ2SM.js} +2 -2
  20. package/dist/{chunk-UZSPBFZN.js.map → chunk-2DPKJ2SM.js.map} +1 -1
  21. package/dist/{chunk-O3ALJLYC.js → chunk-3GR46UOX.js} +2 -2
  22. package/dist/{chunk-O3ALJLYC.js.map → chunk-3GR46UOX.js.map} +1 -1
  23. package/dist/{chunk-PREIL3IB.cjs → chunk-3SSMOVWB.cjs} +2 -2
  24. package/dist/{chunk-PREIL3IB.cjs.map → chunk-3SSMOVWB.cjs.map} +1 -1
  25. package/dist/{chunk-XK23K3EJ.js → chunk-4ETS224G.js} +2 -2
  26. package/dist/{chunk-XK23K3EJ.js.map → chunk-4ETS224G.js.map} +1 -1
  27. package/dist/{chunk-Q7HPPLMG.js → chunk-5FMYW44V.js} +2 -2
  28. package/dist/{chunk-Q7HPPLMG.js.map → chunk-5FMYW44V.js.map} +1 -1
  29. package/dist/{chunk-GWCBPITD.cjs → chunk-6YM67DWH.cjs} +3 -3
  30. package/dist/{chunk-GWCBPITD.cjs.map → chunk-6YM67DWH.cjs.map} +1 -1
  31. package/dist/{chunk-6U66HQKQ.cjs → chunk-75JLWK4L.cjs} +2 -2
  32. package/dist/{chunk-6U66HQKQ.cjs.map → chunk-75JLWK4L.cjs.map} +1 -1
  33. package/dist/chunk-A2RQUV5H.cjs +5 -0
  34. package/dist/chunk-A2RQUV5H.cjs.map +1 -0
  35. package/dist/{chunk-VJP4GGCW.cjs → chunk-BNCBB4H5.cjs} +2 -2
  36. package/dist/{chunk-VJP4GGCW.cjs.map → chunk-BNCBB4H5.cjs.map} +1 -1
  37. package/dist/{chunk-EEUA3OJ6.cjs → chunk-CEURQXSN.cjs} +2 -2
  38. package/dist/{chunk-EEUA3OJ6.cjs.map → chunk-CEURQXSN.cjs.map} +1 -1
  39. package/dist/chunk-CO2BI6WL.cjs +3 -0
  40. package/dist/chunk-CO2BI6WL.cjs.map +1 -0
  41. package/dist/chunk-EN3CDYOS.cjs +2 -0
  42. package/dist/chunk-EN3CDYOS.cjs.map +1 -0
  43. package/dist/{chunk-GWJJRH32.js → chunk-EQDT42JG.js} +3 -3
  44. package/dist/{chunk-GWJJRH32.js.map → chunk-EQDT42JG.js.map} +1 -1
  45. package/dist/chunk-G2MFTERZ.cjs +2 -0
  46. package/dist/chunk-G2MFTERZ.cjs.map +1 -0
  47. package/dist/chunk-G63TMUL2.js +2 -0
  48. package/dist/chunk-G63TMUL2.js.map +1 -0
  49. package/dist/{chunk-UUAFDZK6.cjs → chunk-H3JXNH7X.cjs} +3 -3
  50. package/dist/{chunk-UUAFDZK6.cjs.map → chunk-H3JXNH7X.cjs.map} +1 -1
  51. package/dist/{chunk-3Y56PSQD.cjs → chunk-HQ2PE6HY.cjs} +3 -3
  52. package/dist/{chunk-3Y56PSQD.cjs.map → chunk-HQ2PE6HY.cjs.map} +1 -1
  53. package/dist/chunk-IES365YJ.cjs +3 -0
  54. package/dist/chunk-IES365YJ.cjs.map +1 -0
  55. package/dist/{chunk-2XZCLDHJ.cjs → chunk-J7ABVGZH.cjs} +2 -2
  56. package/dist/{chunk-2XZCLDHJ.cjs.map → chunk-J7ABVGZH.cjs.map} +1 -1
  57. package/dist/chunk-JVMINMAB.js +2 -0
  58. package/dist/chunk-JVMINMAB.js.map +1 -0
  59. package/dist/chunk-JYLNQOPU.cjs +2 -0
  60. package/dist/chunk-JYLNQOPU.cjs.map +1 -0
  61. package/dist/{chunk-JOIQFDZQ.js → chunk-KEA5HRL3.js} +2 -2
  62. package/dist/{chunk-JOIQFDZQ.js.map → chunk-KEA5HRL3.js.map} +1 -1
  63. package/dist/{chunk-TVE2DNPU.js → chunk-LJFS3XHW.js} +2 -2
  64. package/dist/{chunk-TVE2DNPU.js.map → chunk-LJFS3XHW.js.map} +1 -1
  65. package/dist/{chunk-C5MP74ER.js → chunk-MRRMIBHE.js} +2 -2
  66. package/dist/{chunk-C5MP74ER.js.map → chunk-MRRMIBHE.js.map} +1 -1
  67. package/dist/chunk-N64ZK6CL.cjs +2 -0
  68. package/dist/{chunk-EEVUKZ5B.cjs.map → chunk-N64ZK6CL.cjs.map} +1 -1
  69. package/dist/chunk-O3BDXOQJ.js +2 -0
  70. package/dist/chunk-O3BDXOQJ.js.map +1 -0
  71. package/dist/chunk-PIZQIQVM.js +3 -0
  72. package/dist/chunk-PIZQIQVM.js.map +1 -0
  73. package/dist/chunk-PS5OA7QU.js +5 -0
  74. package/dist/chunk-PS5OA7QU.js.map +1 -0
  75. package/dist/{chunk-IPOU3JTA.js → chunk-QTSDIDAS.js} +3 -3
  76. package/dist/{chunk-IPOU3JTA.js.map → chunk-QTSDIDAS.js.map} +1 -1
  77. package/dist/chunk-RHE3LC4Q.js +2 -0
  78. package/dist/chunk-RHE3LC4Q.js.map +1 -0
  79. package/dist/{chunk-P4ETODMP.js → chunk-RLTH2H3U.js} +2 -2
  80. package/dist/{chunk-P4ETODMP.js.map → chunk-RLTH2H3U.js.map} +1 -1
  81. package/dist/{chunk-WOIJPV7Z.js → chunk-SEOIKHYK.js} +2 -2
  82. package/dist/{chunk-WOIJPV7Z.js.map → chunk-SEOIKHYK.js.map} +1 -1
  83. package/dist/{chunk-W5ELYJ4Z.cjs → chunk-TL545PXW.cjs} +2 -2
  84. package/dist/{chunk-W5ELYJ4Z.cjs.map → chunk-TL545PXW.cjs.map} +1 -1
  85. package/dist/{chunk-FAGFPVYK.cjs → chunk-TRDOYAKJ.cjs} +2 -2
  86. package/dist/{chunk-FAGFPVYK.cjs.map → chunk-TRDOYAKJ.cjs.map} +1 -1
  87. package/dist/chunk-WMISTHB2.cjs +2 -0
  88. package/dist/chunk-WMISTHB2.cjs.map +1 -0
  89. package/dist/{chunk-3PDDKWTJ.js → chunk-XOEZ7UQI.js} +3 -3
  90. package/dist/{chunk-3PDDKWTJ.js.map → chunk-XOEZ7UQI.js.map} +1 -1
  91. package/dist/{chunk-EXCFCHAT.cjs → chunk-XPJGDGJF.cjs} +2 -2
  92. package/dist/{chunk-EXCFCHAT.cjs.map → chunk-XPJGDGJF.cjs.map} +1 -1
  93. package/dist/chunk-YQV4WGXH.js +3 -0
  94. package/dist/chunk-YQV4WGXH.js.map +1 -0
  95. package/dist/constants.cjs +1 -1
  96. package/dist/constants.js +1 -1
  97. package/dist/engine.cjs +1 -1
  98. package/dist/engine.d.cts +8 -8
  99. package/dist/engine.d.ts +8 -8
  100. package/dist/engine.js +1 -1
  101. package/dist/errors.cjs +1 -1
  102. package/dist/errors.d.cts +3 -3
  103. package/dist/errors.d.ts +3 -3
  104. package/dist/errors.js +1 -1
  105. package/dist/format.cjs +1 -1
  106. package/dist/format.js +1 -1
  107. package/dist/index.cjs +1 -1
  108. package/dist/index.d.cts +8 -8
  109. package/dist/index.d.ts +8 -8
  110. package/dist/index.js +1 -1
  111. package/dist/language.d.cts +7 -7
  112. package/dist/language.d.ts +7 -7
  113. package/dist/lexer.cjs +1 -1
  114. package/dist/lexer.js +1 -1
  115. package/dist/normalizer.cjs +1 -1
  116. package/dist/normalizer.d.cts +2 -2
  117. package/dist/normalizer.d.ts +2 -2
  118. package/dist/normalizer.js +1 -1
  119. package/dist/packages.cjs +1 -1
  120. package/dist/packages.d.cts +6 -6
  121. package/dist/packages.d.ts +6 -6
  122. package/dist/packages.js +1 -1
  123. package/dist/parser.cjs +1 -1
  124. package/dist/parser.d.cts +2 -2
  125. package/dist/parser.d.ts +2 -2
  126. package/dist/parser.js +1 -1
  127. package/dist/resolvers.d.cts +1 -1
  128. package/dist/resolvers.d.ts +1 -1
  129. package/dist/testing.cjs +2 -2
  130. package/dist/testing.d.cts +7 -7
  131. package/dist/testing.d.ts +7 -7
  132. package/dist/testing.js +1 -1
  133. package/dist/uom.cjs +1 -1
  134. package/dist/uom.d.cts +1 -1
  135. package/dist/uom.d.ts +1 -1
  136. package/dist/uom.js +1 -1
  137. package/dist/vm.cjs +1 -1
  138. package/dist/vm.d.cts +5 -5
  139. package/dist/vm.d.ts +5 -5
  140. package/dist/vm.js +1 -1
  141. package/dist/worker.cjs +2 -2
  142. package/dist/worker.d.cts +7 -7
  143. package/dist/worker.d.ts +7 -7
  144. package/dist/worker.js +1 -1
  145. package/package.json +1 -1
  146. package/dist/chunk-4IIFFJTJ.js +0 -5
  147. package/dist/chunk-4IIFFJTJ.js.map +0 -1
  148. package/dist/chunk-5SDSIRPL.js +0 -2
  149. package/dist/chunk-5SDSIRPL.js.map +0 -1
  150. package/dist/chunk-AYTEPHRO.js +0 -3
  151. package/dist/chunk-AYTEPHRO.js.map +0 -1
  152. package/dist/chunk-CUDPOWXA.js +0 -2
  153. package/dist/chunk-CUDPOWXA.js.map +0 -1
  154. package/dist/chunk-EEVUKZ5B.cjs +0 -2
  155. package/dist/chunk-FPGYRFJY.cjs +0 -5
  156. package/dist/chunk-FPGYRFJY.cjs.map +0 -1
  157. package/dist/chunk-FVQWN5HZ.cjs +0 -2
  158. package/dist/chunk-FVQWN5HZ.cjs.map +0 -1
  159. package/dist/chunk-HDGARCI2.cjs +0 -2
  160. package/dist/chunk-HDGARCI2.cjs.map +0 -1
  161. package/dist/chunk-IMXSVHQK.cjs +0 -2
  162. package/dist/chunk-IMXSVHQK.cjs.map +0 -1
  163. package/dist/chunk-KKMLFYVW.cjs +0 -3
  164. package/dist/chunk-KKMLFYVW.cjs.map +0 -1
  165. package/dist/chunk-NAZ6PGLS.cjs +0 -3
  166. package/dist/chunk-NAZ6PGLS.cjs.map +0 -1
  167. package/dist/chunk-Q3PSTNSY.js +0 -2
  168. package/dist/chunk-Q3PSTNSY.js.map +0 -1
  169. package/dist/chunk-RC4M6HBX.cjs +0 -2
  170. package/dist/chunk-RC4M6HBX.cjs.map +0 -1
  171. package/dist/chunk-YAZ4DUJJ.js +0 -3
  172. package/dist/chunk-YAZ4DUJJ.js.map +0 -1
  173. package/dist/chunk-YFX53MZF.js +0 -2
  174. package/dist/chunk-YFX53MZF.js.map +0 -1
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkGWCBPITD_cjs=require('./chunk-GWCBPITD.cjs'),chunk6U66HQKQ_cjs=require('./chunk-6U66HQKQ.cjs');var u=[10,11,12,13,14,16,60,61,62,63,150,159,95,96],E=[50,51,151,152,160],C=[157,158,161],L=(()=>{let r=new Array(256).fill(0);for(let e of u)r[e]=1;for(let e of E)r[e]=2;for(let e of C)r[e]=3;return r})();[...u,...E,...C];function m(r,e){return e+1+(L[r[e]]??0)}var R="currency",A=class{constructor(e){this.namespace=R;this.exchange=e??chunkGWCBPITD_cjs.b;}preflight(e,N,U,S,y){let{opcodes:c,strings:_}=N,f=c.length,o=0,i=-1,p=-1;for(;o<f;){let t=c[o];if(t===13&&(p=i,i=c[o+1]),(t===84||t===81||t===20||t===21||t===22||t===23)&&p>=0&&i>=0){let n=_[p],s=_[i];if(this.exchange.isCurrency(n)&&this.exchange.isCurrency(s)&&n.toUpperCase()!==s.toUpperCase()&&this.exchange.getRateSync(n,s)===null){let I=n.toUpperCase(),d=s.toUpperCase(),a=[R,I,d];if(y.getQueryData(a)!==void 0){o++;continue}let g=y.fetchQuery({queryKey:a,queryFn:({signal:h})=>this.exchange.getRate(n,s,h).then(T=>chunk6U66HQKQ_cjs.n(T)),staleTime:300*1e3});return {queryKey:a.join(":"),resolver:g,packageId:U,signal:S,metadata:{fromUnit:n,toUnit:s}}}}o=m(c,o);}return null}destroy(){}};exports.a=m;exports.b=A;//# sourceMappingURL=chunk-W5ELYJ4Z.cjs.map
2
- //# sourceMappingURL=chunk-W5ELYJ4Z.cjs.map
1
+ 'use strict';var chunk6YM67DWH_cjs=require('./chunk-6YM67DWH.cjs'),chunk75JLWK4L_cjs=require('./chunk-75JLWK4L.cjs');var u=[10,11,12,13,14,16,60,61,62,63,150,159,95,96],E=[50,51,151,152,160],C=[157,158,161],L=(()=>{let r=new Array(256).fill(0);for(let e of u)r[e]=1;for(let e of E)r[e]=2;for(let e of C)r[e]=3;return r})();[...u,...E,...C];function m(r,e){return e+1+(L[r[e]]??0)}var R="currency",A=class{constructor(e){this.namespace=R;this.exchange=e??chunk6YM67DWH_cjs.b;}preflight(e,N,U,S,y){let{opcodes:c,strings:_}=N,f=c.length,o=0,i=-1,p=-1;for(;o<f;){let t=c[o];if(t===13&&(p=i,i=c[o+1]),(t===84||t===81||t===20||t===21||t===22||t===23)&&p>=0&&i>=0){let n=_[p],s=_[i];if(this.exchange.isCurrency(n)&&this.exchange.isCurrency(s)&&n.toUpperCase()!==s.toUpperCase()&&this.exchange.getRateSync(n,s)===null){let I=n.toUpperCase(),d=s.toUpperCase(),a=[R,I,d];if(y.getQueryData(a)!==void 0){o++;continue}let g=y.fetchQuery({queryKey:a,queryFn:({signal:h})=>this.exchange.getRate(n,s,h).then(T=>chunk75JLWK4L_cjs.n(T)),staleTime:300*1e3});return {queryKey:a.join(":"),resolver:g,packageId:U,signal:S,metadata:{fromUnit:n,toUnit:s}}}}o=m(c,o);}return null}destroy(){}};exports.a=m;exports.b=A;//# sourceMappingURL=chunk-TL545PXW.cjs.map
2
+ //# sourceMappingURL=chunk-TL545PXW.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/parser/OperandWidth.ts","../src/uom/CurrencyResolver.ts"],"names":["ONE_OPERAND","TWO_OPERANDS","THREE_OPERANDS","OPERAND_BYTES","widths","op","nextInstruction","opcodes","index","CURRENCY_NS","CurrencyAsyncResolver","exchange","currencyExchangeService","_tokens","bytecode","packageId","signal","queryClient","strings","len","i","lastStrIdx","prevStrIdx","fromUnit","toUnit","fromUpper","toUpper","cacheKey","resolver","qSignal","rate","numberValue"],"mappings":"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","file":"chunk-W5ELYJ4Z.cjs","sourcesContent":["/**\n * How many operand bytes follow each opcode, and how to step over one.\n *\n * Anything walking a bytecode stream without executing it needs this: the\n * resolver preflight scanners look for specific opcodes and must skip past\n * everything else without mistaking an operand byte for an instruction.\n *\n * It used to be a hand-copied switch in each of those scanners. They had\n * already drifted: two counted `CALL_PLUGIN` as three bytes wide and the third\n * omitted it from that arm, so a stream containing one desynchronised there and\n * every opcode after it was read at the wrong offset. Adding an opcode meant\n * remembering every copy, and nothing checked that you had.\n *\n * `__tests__/parser/OperandWidth.spec.ts` asserts every opcode has a width, so\n * a new one fails a test rather than silently defaulting to zero operands.\n */\n\nimport { OpCode } from \"@solve-js/parser/OpCode\";\n\n/**\n * Opcodes taking one operand byte.\n *\n * A constant-pool index, or a variable-name index.\n */\nconst ONE_OPERAND: readonly OpCode[] = [\n\tOpCode.PUSH_NUMBER,\n\tOpCode.PUSH_BIGINT,\n\tOpCode.PUSH_HEX,\n\tOpCode.PUSH_STRING,\n\tOpCode.PUSH_BOOLEAN,\n\t// Its operand is a string-pool index holding the exact decimal text, so a\n\t// scanner must step over one byte exactly as it does for PUSH_STRING.\n\tOpCode.PUSH_DECIMAL,\n\tOpCode.LOAD_VAR,\n\tOpCode.STORE_VAR,\n\tOpCode.LOAD_GLOBAL_VAR,\n\tOpCode.STORE_GLOBAL_VAR,\n\tOpCode.DEFINE_USER_FUNCTION,\n\tOpCode.BIND_UNKNOWN,\n\t// Its operand is a constant-pool index, like PUSH_NUMBER's: the epoch-ms\n\t// was resolved at parse time and stored in `numbers`. Omitting it made\n\t// every scanner read that index byte as an opcode, so an ordinary date\n\t// literal desynchronised the whole preflight walk.\n\tOpCode.DATE_LITERAL,\n\t// One byte, the offset direction (0 forward, 1 backward) for \"N working\n\t// days after/before/from <date>\". See WorkdayOffsetParselet. DATE_WORKDAYS_BETWEEN\n\t// takes no operand and so is not listed here.\n\tOpCode.DATE_WORKDAY_OFFSET,\n];\n\n/**\n * Opcodes taking two operand bytes.\n *\n * A callable index plus an argument count, or a matrix's row and column counts.\n */\nconst TWO_OPERANDS: readonly OpCode[] = [\n\tOpCode.CALL_PLUGIN,\n\tOpCode.CALL_BUILTIN,\n\tOpCode.CALL_USER_FUNCTION,\n\tOpCode.MAT_NEW,\n\t// A body index plus the pooled source-expression string.\n\tOpCode.PLOT_INVOKE,\n];\n\n/**\n * Opcodes taking three operand bytes.\n *\n * The map and reduce invocations, which carry a body index alongside their\n * other operands.\n */\n// CALL_PLUGIN_WIDE: a two-byte plugin index plus the one-byte argument count.\nconst THREE_OPERANDS: readonly OpCode[] = [OpCode.MAP_INVOKE, OpCode.REDUCE_INVOKE, OpCode.CALL_PLUGIN_WIDE];\n\n/**\n * Operand byte count for every opcode, indexed by opcode value.\n *\n * A dense array rather than a map, because the preflight scanners run on every\n * keystroke and this is read once per instruction.\n */\nexport const OPERAND_BYTES: readonly number[] = (() => {\n\tconst widths = new Array<number>(256).fill(0);\n\tfor (const op of ONE_OPERAND) widths[op] = 1;\n\tfor (const op of TWO_OPERANDS) widths[op] = 2;\n\tfor (const op of THREE_OPERANDS) widths[op] = 3;\n\treturn widths;\n})();\n\n/**\n * Every opcode that takes at least one operand.\n *\n * Exported so a test can assert the table stays complete as opcodes are added.\n */\nexport const OPCODES_WITH_OPERANDS: readonly OpCode[] = [\n\t...ONE_OPERAND,\n\t...TWO_OPERANDS,\n\t...THREE_OPERANDS,\n];\n\n/**\n * Offset of the instruction after the one at `index`.\n *\n * @param opcodes - The bytecode stream.\n * @param index - Offset of an opcode, not of an operand byte. Passing an\n * operand offset yields nonsense, which is the failure mode this exists to\n * prevent: a caller stepping by hand and getting one width wrong reads the rest\n * of the stream misaligned.\n * @returns Offset of the next opcode. May be past the end when the instruction\n * at `index` is the last one, so callers loop while it is under `opcodes.length`.\n */\nexport function nextInstruction(opcodes: Uint8Array, index: number): number {\n\treturn index + 1 + (OPERAND_BYTES[opcodes[index]] ?? 0);\n}\n","/**\n * Currency async resolver, bridges CurrencyExchangeService to the\n * IAsyncResolver interface for the Suspense architecture.\n *\n * Uses TanStack Query (injected via queryClient) as the single cache layer.\n */\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport type { Token } from \"@solve-js/lexer\";\nimport type { BytecodeProgram } from \"@solve-js/parser/BytecodeBuilder\";\nimport { OpCode } from \"@solve-js/parser/OpCode\";\nimport { numberValue } from \"@solve-js/vm/Value\";\nimport {\n\tcurrencyExchangeService,\n\tCurrencyExchangeService,\n} from \"@solve-js/uom/CurrencyExchange\";\nimport type { IAsyncResolver, AsyncCheckResult } from \"@solve-js/resolvers/ResolverRegistry\";\nimport { nextInstruction } from \"@solve-js/parser/OperandWidth\";\n\nconst CURRENCY_NS = \"currency\";\n\n/**\n * Fetches exchange rates before the VM runs, so a conversion has real numbers.\n *\n * Until rates arrive the line evaluates to a pending value rather than a\n * guessed one, and re-evaluates when they land.\n */\nexport class CurrencyAsyncResolver implements IAsyncResolver {\n\treadonly namespace = CURRENCY_NS;\n\n\tprivate exchange: CurrencyExchangeService;\n\n\tconstructor(exchange?: CurrencyExchangeService) {\n\t\tthis.exchange = exchange ?? currencyExchangeService;\n\t}\n\n\tpreflight(_tokens: Token[], bytecode: BytecodeProgram, packageId: string, signal: AbortSignal, queryClient: QueryClient): AsyncCheckResult | null {\n\t\tconst { opcodes, strings } = bytecode;\n\t\tconst len = opcodes.length;\n\t\tlet i = 0;\n\n\t\tlet lastStrIdx = -1;\n\t\tlet prevStrIdx = -1;\n\n\t\twhile (i < len) {\n\t\t\tconst op = opcodes[i] as OpCode;\n\n\t\t\tif (op === OpCode.PUSH_STRING) {\n\t\t\t\tprevStrIdx = lastStrIdx;\n\t\t\t\tlastStrIdx = opcodes[i + 1];\n\t\t\t}\n\n\t\t\t// Explicit \"X to Y\"/\"X in Y\" conversions (UOM_CONVERT_IN/_TO) are\n\t\t\t// the obvious case, but arithmetic directly on two differently-\n\t\t\t// denominated currency literals, \"0.01 BTC + 1 ETH\", needs the\n\t\t\t// exact same preflight fetch and previously never got it: this\n\t\t\t// scanner only looked for the CONVERT opcodes, so ADD/SUB/MUL/DIV\n\t\t\t// between two currency UOMs skipped preflight entirely, ran with\n\t\t\t// no cached rate, and fell through to the VM's silent-wrong-math\n\t\t\t// fallback instead of ever reaching a network fetch.\n\t\t\tconst isCurrencyCombiningOp =\n\t\t\t\top === OpCode.UOM_CONVERT_IN || op === OpCode.UOM_CONVERT_TO ||\n\t\t\t\top === OpCode.ADD || op === OpCode.SUB || op === OpCode.MUL || op === OpCode.DIV;\n\t\t\tif (isCurrencyCombiningOp) {\n\t\t\t\tif (prevStrIdx >= 0 && lastStrIdx >= 0) {\n\t\t\t\t\tconst fromUnit = strings[prevStrIdx];\n\t\t\t\t\tconst toUnit = strings[lastStrIdx];\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.exchange.isCurrency(fromUnit) &&\n\t\t\t\t\t\tthis.exchange.isCurrency(toUnit) &&\n\t\t\t\t\t\tfromUnit.toUpperCase() !== toUnit.toUpperCase()\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst syncRate = this.exchange.getRateSync(fromUnit, toUnit);\n\t\t\t\t\t\tif (syncRate === null) {\n\t\t\t\t\t\t\tconst fromUpper = fromUnit.toUpperCase();\n\t\t\t\t\t\t\tconst toUpper = toUnit.toUpperCase();\n\n\t\t\t\t\t\t\t// Check TanStack Query cache\n\t\t\t\t\t\t\tconst cacheKey = [CURRENCY_NS, fromUpper, toUpper];\n\t\t\t\t\t\t\tif (queryClient.getQueryData(cacheKey) !== undefined) {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Fetch via TanStack Query (dedup + retry automatic)\n\t\t\t\t\t\t\tconst resolver = queryClient.fetchQuery({\n\t\t\t\t\t\t\t\tqueryKey: cacheKey,\n\t\t\t\t\t\t\t\tqueryFn: ({ signal: qSignal }) => {\n\t\t\t\t\t\t\t\t\treturn this.exchange.getRate(fromUnit, toUnit, qSignal).then((rate) => numberValue(rate));\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstaleTime: 5 * 60 * 1000,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn { queryKey: cacheKey.join(\":\"), resolver, packageId, signal, metadata: { fromUnit, toUnit } };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Step over this instruction and its operands. Shared table, because\n\t\t\t// three hand-copied versions of this had already drifted.\n\t\t\ti = nextInstruction(opcodes, i);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tdestroy(): void {\n\t\t// Cache cleared by ResolverRegistry.unregister() via removeQueries({ queryKey: [\"currency\"] })\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../src/parser/OperandWidth.ts","../src/uom/CurrencyResolver.ts"],"names":["ONE_OPERAND","TWO_OPERANDS","THREE_OPERANDS","OPERAND_BYTES","widths","op","nextInstruction","opcodes","index","CURRENCY_NS","CurrencyAsyncResolver","exchange","currencyExchangeService","_tokens","bytecode","packageId","signal","queryClient","strings","len","i","lastStrIdx","prevStrIdx","fromUnit","toUnit","fromUpper","toUpper","cacheKey","resolver","qSignal","rate","numberValue"],"mappings":"qHAwBA,IAAMA,CAAAA,CAAiC,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA,CAAA,EAwBvC,CAAA,CAOMC,CAAAA,CAAkC,CAAA,EAAA,CAAA,EAAA,CAAA,GAAA,CAAA,GAAA,CAAA,GAOxC,CAAA,CASMC,CAAAA,CAAoC,CAAA,GAAA,CAAA,GAAA,CAAA,GAAiE,CAAA,CAQ9FC,CAAAA,CAAAA,CAAoC,IAAM,CACtD,IAAMC,CAAAA,CAAS,IAAI,KAAA,CAAc,GAAG,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,CAC5C,IAAA,IAAWC,CAAAA,IAAML,CAAAA,CAAaI,CAAAA,CAAOC,CAAE,CAAA,CAAI,CAAA,CAC3C,IAAA,IAAWA,KAAMJ,CAAAA,CAAcG,CAAAA,CAAOC,CAAE,CAAA,CAAI,CAAA,CAC5C,IAAA,IAAWA,CAAAA,IAAMH,CAAAA,CAAgBE,CAAAA,CAAOC,CAAE,CAAA,CAAI,CAAA,CAC9C,OAAOD,CACR,CAAA,GAAG,CAOqD,CACvD,GAAGJ,CAAAA,CACH,GAAGC,CAAAA,CACH,GAAGC,CACJ,EAaO,SAASI,CAAAA,CAAgBC,CAAAA,CAAqBC,CAAAA,CAAuB,CAC3E,OAAOA,CAAAA,CAAQ,CAAA,EAAKL,EAAcI,CAAAA,CAAQC,CAAK,CAAC,CAAA,EAAK,CAAA,CACtD,CC7FA,IAAMC,CAAAA,CAAc,UAAA,CAQPC,CAAAA,CAAN,KAAsD,CAK5D,WAAA,CAAYC,CAAAA,CAAoC,CAJhD,IAAA,CAAS,UAAYF,CAAAA,CAKpB,IAAA,CAAK,QAAA,CAAWE,CAAAA,EAAYC,oBAC7B,CAEA,SAAA,CAAUC,CAAAA,CAAkBC,CAAAA,CAA2BC,CAAAA,CAAmBC,CAAAA,CAAqBC,CAAAA,CAAmD,CACjJ,GAAM,CAAE,OAAA,CAAAV,EAAS,OAAA,CAAAW,CAAQ,CAAA,CAAIJ,CAAAA,CACvBK,CAAAA,CAAMZ,CAAAA,CAAQ,MAAA,CAChBa,CAAAA,CAAI,CAAA,CAEJC,CAAAA,CAAa,EAAA,CACbC,CAAAA,CAAa,EAAA,CAEjB,KAAOF,CAAAA,CAAID,CAAAA,EAAK,CACf,IAAMd,CAAAA,CAAKE,CAAAA,CAAQa,CAAC,CAAA,CAkBpB,GAhBIf,CAAAA,GAAO,EAAA,GACViB,EAAaD,CAAAA,CACbA,CAAAA,CAAad,CAAAA,CAAQa,CAAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAY1Bf,CAAAA,GAAO,EAAA,EAAyBA,IAAO,EAAA,EACvCA,CAAAA,GAAO,EAAA,EAAcA,CAAAA,GAAO,EAAA,EAAcA,CAAAA,GAAO,EAAA,EAAcA,CAAAA,GAAO,EAAA,GAElEiB,CAAAA,EAAc,CAAA,EAAKD,CAAAA,EAAc,CAAA,CAAG,CACvC,IAAME,CAAAA,CAAWL,EAAQI,CAAU,CAAA,CAC7BE,CAAAA,CAASN,CAAAA,CAAQG,CAAU,CAAA,CAEjC,GACC,IAAA,CAAK,QAAA,CAAS,UAAA,CAAWE,CAAQ,CAAA,EACjC,IAAA,CAAK,QAAA,CAAS,UAAA,CAAWC,CAAM,GAC/BD,CAAAA,CAAS,WAAA,EAAY,GAAMC,CAAAA,CAAO,WAAA,EAAY,EAE7B,IAAA,CAAK,QAAA,CAAS,WAAA,CAAYD,CAAAA,CAAUC,CAAM,CAAA,GAC1C,IAAA,CAAM,CACtB,IAAMC,CAAAA,CAAYF,EAAS,WAAA,EAAY,CACjCG,CAAAA,CAAUF,CAAAA,CAAO,WAAA,EAAY,CAG7BG,CAAAA,CAAW,CAAClB,EAAagB,CAAAA,CAAWC,CAAO,CAAA,CACjD,GAAIT,CAAAA,CAAY,YAAA,CAAaU,CAAQ,CAAA,GAAM,OAAW,CACrDP,CAAAA,EAAAA,CACA,QACD,CAGA,IAAMQ,CAAAA,CAAWX,CAAAA,CAAY,UAAA,CAAW,CACvC,QAAA,CAAUU,CAAAA,CACV,OAAA,CAAS,CAAC,CAAE,MAAA,CAAQE,CAAQ,IACpB,IAAA,CAAK,QAAA,CAAS,OAAA,CAAQN,CAAAA,CAAUC,CAAAA,CAAQK,CAAO,CAAA,CAAE,IAAA,CAAMC,CAAAA,EAASC,mBAAAA,CAAYD,CAAI,CAAC,CAAA,CAEzF,SAAA,CAAW,GAAA,CAAS,GACrB,CAAC,CAAA,CAED,OAAO,CAAE,QAAA,CAAUH,CAAAA,CAAS,IAAA,CAAK,GAAG,CAAA,CAAG,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAb,CAAAA,CAAW,MAAA,CAAAC,CAAAA,CAAQ,QAAA,CAAU,CAAE,SAAAO,CAAAA,CAAU,MAAA,CAAAC,CAAO,CAAE,CACpG,CAEF,CAKDJ,CAAAA,CAAId,EAAgBC,CAAAA,CAASa,CAAC,EAC/B,CAEA,OAAO,IACR,CAEA,OAAA,EAAgB,CAEhB,CACD","file":"chunk-TL545PXW.cjs","sourcesContent":["/**\n * How many operand bytes follow each opcode, and how to step over one.\n *\n * Anything walking a bytecode stream without executing it needs this: the\n * resolver preflight scanners look for specific opcodes and must skip past\n * everything else without mistaking an operand byte for an instruction.\n *\n * It used to be a hand-copied switch in each of those scanners. They had\n * already drifted: two counted `CALL_PLUGIN` as three bytes wide and the third\n * omitted it from that arm, so a stream containing one desynchronised there and\n * every opcode after it was read at the wrong offset. Adding an opcode meant\n * remembering every copy, and nothing checked that you had.\n *\n * `__tests__/parser/OperandWidth.spec.ts` asserts every opcode has a width, so\n * a new one fails a test rather than silently defaulting to zero operands.\n */\n\nimport { OpCode } from \"@solve-js/parser/OpCode\";\n\n/**\n * Opcodes taking one operand byte.\n *\n * A constant-pool index, or a variable-name index.\n */\nconst ONE_OPERAND: readonly OpCode[] = [\n\tOpCode.PUSH_NUMBER,\n\tOpCode.PUSH_BIGINT,\n\tOpCode.PUSH_HEX,\n\tOpCode.PUSH_STRING,\n\tOpCode.PUSH_BOOLEAN,\n\t// Its operand is a string-pool index holding the exact decimal text, so a\n\t// scanner must step over one byte exactly as it does for PUSH_STRING.\n\tOpCode.PUSH_DECIMAL,\n\tOpCode.LOAD_VAR,\n\tOpCode.STORE_VAR,\n\tOpCode.LOAD_GLOBAL_VAR,\n\tOpCode.STORE_GLOBAL_VAR,\n\tOpCode.DEFINE_USER_FUNCTION,\n\tOpCode.BIND_UNKNOWN,\n\t// Its operand is a constant-pool index, like PUSH_NUMBER's: the epoch-ms\n\t// was resolved at parse time and stored in `numbers`. Omitting it made\n\t// every scanner read that index byte as an opcode, so an ordinary date\n\t// literal desynchronised the whole preflight walk.\n\tOpCode.DATE_LITERAL,\n\t// One byte, the offset direction (0 forward, 1 backward) for \"N working\n\t// days after/before/from <date>\". See WorkdayOffsetParselet. DATE_WORKDAYS_BETWEEN\n\t// takes no operand and so is not listed here.\n\tOpCode.DATE_WORKDAY_OFFSET,\n];\n\n/**\n * Opcodes taking two operand bytes.\n *\n * A callable index plus an argument count, or a matrix's row and column counts.\n */\nconst TWO_OPERANDS: readonly OpCode[] = [\n\tOpCode.CALL_PLUGIN,\n\tOpCode.CALL_BUILTIN,\n\tOpCode.CALL_USER_FUNCTION,\n\tOpCode.MAT_NEW,\n\t// A body index plus the pooled source-expression string.\n\tOpCode.PLOT_INVOKE,\n];\n\n/**\n * Opcodes taking three operand bytes.\n *\n * The map and reduce invocations, which carry a body index alongside their\n * other operands.\n */\n// CALL_PLUGIN_WIDE: a two-byte plugin index plus the one-byte argument count.\nconst THREE_OPERANDS: readonly OpCode[] = [OpCode.MAP_INVOKE, OpCode.REDUCE_INVOKE, OpCode.CALL_PLUGIN_WIDE];\n\n/**\n * Operand byte count for every opcode, indexed by opcode value.\n *\n * A dense array rather than a map, because the preflight scanners run on every\n * keystroke and this is read once per instruction.\n */\nexport const OPERAND_BYTES: readonly number[] = (() => {\n\tconst widths = new Array<number>(256).fill(0);\n\tfor (const op of ONE_OPERAND) widths[op] = 1;\n\tfor (const op of TWO_OPERANDS) widths[op] = 2;\n\tfor (const op of THREE_OPERANDS) widths[op] = 3;\n\treturn widths;\n})();\n\n/**\n * Every opcode that takes at least one operand.\n *\n * Exported so a test can assert the table stays complete as opcodes are added.\n */\nexport const OPCODES_WITH_OPERANDS: readonly OpCode[] = [\n\t...ONE_OPERAND,\n\t...TWO_OPERANDS,\n\t...THREE_OPERANDS,\n];\n\n/**\n * Offset of the instruction after the one at `index`.\n *\n * @param opcodes - The bytecode stream.\n * @param index - Offset of an opcode, not of an operand byte. Passing an\n * operand offset yields nonsense, which is the failure mode this exists to\n * prevent: a caller stepping by hand and getting one width wrong reads the rest\n * of the stream misaligned.\n * @returns Offset of the next opcode. May be past the end when the instruction\n * at `index` is the last one, so callers loop while it is under `opcodes.length`.\n */\nexport function nextInstruction(opcodes: Uint8Array, index: number): number {\n\treturn index + 1 + (OPERAND_BYTES[opcodes[index]] ?? 0);\n}\n","/**\n * Currency async resolver, bridges CurrencyExchangeService to the\n * IAsyncResolver interface for the Suspense architecture.\n *\n * Uses TanStack Query (injected via queryClient) as the single cache layer.\n */\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport type { Token } from \"@solve-js/lexer\";\nimport type { BytecodeProgram } from \"@solve-js/parser/BytecodeBuilder\";\nimport { OpCode } from \"@solve-js/parser/OpCode\";\nimport { numberValue } from \"@solve-js/vm/Value\";\nimport {\n\tcurrencyExchangeService,\n\tCurrencyExchangeService,\n} from \"@solve-js/uom/CurrencyExchange\";\nimport type { IAsyncResolver, AsyncCheckResult } from \"@solve-js/resolvers/ResolverRegistry\";\nimport { nextInstruction } from \"@solve-js/parser/OperandWidth\";\n\nconst CURRENCY_NS = \"currency\";\n\n/**\n * Fetches exchange rates before the VM runs, so a conversion has real numbers.\n *\n * Until rates arrive the line evaluates to a pending value rather than a\n * guessed one, and re-evaluates when they land.\n */\nexport class CurrencyAsyncResolver implements IAsyncResolver {\n\treadonly namespace = CURRENCY_NS;\n\n\tprivate exchange: CurrencyExchangeService;\n\n\tconstructor(exchange?: CurrencyExchangeService) {\n\t\tthis.exchange = exchange ?? currencyExchangeService;\n\t}\n\n\tpreflight(_tokens: Token[], bytecode: BytecodeProgram, packageId: string, signal: AbortSignal, queryClient: QueryClient): AsyncCheckResult | null {\n\t\tconst { opcodes, strings } = bytecode;\n\t\tconst len = opcodes.length;\n\t\tlet i = 0;\n\n\t\tlet lastStrIdx = -1;\n\t\tlet prevStrIdx = -1;\n\n\t\twhile (i < len) {\n\t\t\tconst op = opcodes[i] as OpCode;\n\n\t\t\tif (op === OpCode.PUSH_STRING) {\n\t\t\t\tprevStrIdx = lastStrIdx;\n\t\t\t\tlastStrIdx = opcodes[i + 1];\n\t\t\t}\n\n\t\t\t// Explicit \"X to Y\"/\"X in Y\" conversions (UOM_CONVERT_IN/_TO) are\n\t\t\t// the obvious case, but arithmetic directly on two differently-\n\t\t\t// denominated currency literals, \"0.01 BTC + 1 ETH\", needs the\n\t\t\t// exact same preflight fetch and previously never got it: this\n\t\t\t// scanner only looked for the CONVERT opcodes, so ADD/SUB/MUL/DIV\n\t\t\t// between two currency UOMs skipped preflight entirely, ran with\n\t\t\t// no cached rate, and fell through to the VM's silent-wrong-math\n\t\t\t// fallback instead of ever reaching a network fetch.\n\t\t\tconst isCurrencyCombiningOp =\n\t\t\t\top === OpCode.UOM_CONVERT_IN || op === OpCode.UOM_CONVERT_TO ||\n\t\t\t\top === OpCode.ADD || op === OpCode.SUB || op === OpCode.MUL || op === OpCode.DIV;\n\t\t\tif (isCurrencyCombiningOp) {\n\t\t\t\tif (prevStrIdx >= 0 && lastStrIdx >= 0) {\n\t\t\t\t\tconst fromUnit = strings[prevStrIdx];\n\t\t\t\t\tconst toUnit = strings[lastStrIdx];\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.exchange.isCurrency(fromUnit) &&\n\t\t\t\t\t\tthis.exchange.isCurrency(toUnit) &&\n\t\t\t\t\t\tfromUnit.toUpperCase() !== toUnit.toUpperCase()\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst syncRate = this.exchange.getRateSync(fromUnit, toUnit);\n\t\t\t\t\t\tif (syncRate === null) {\n\t\t\t\t\t\t\tconst fromUpper = fromUnit.toUpperCase();\n\t\t\t\t\t\t\tconst toUpper = toUnit.toUpperCase();\n\n\t\t\t\t\t\t\t// Check TanStack Query cache\n\t\t\t\t\t\t\tconst cacheKey = [CURRENCY_NS, fromUpper, toUpper];\n\t\t\t\t\t\t\tif (queryClient.getQueryData(cacheKey) !== undefined) {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Fetch via TanStack Query (dedup + retry automatic)\n\t\t\t\t\t\t\tconst resolver = queryClient.fetchQuery({\n\t\t\t\t\t\t\t\tqueryKey: cacheKey,\n\t\t\t\t\t\t\t\tqueryFn: ({ signal: qSignal }) => {\n\t\t\t\t\t\t\t\t\treturn this.exchange.getRate(fromUnit, toUnit, qSignal).then((rate) => numberValue(rate));\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstaleTime: 5 * 60 * 1000,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn { queryKey: cacheKey.join(\":\"), resolver, packageId, signal, metadata: { fromUnit, toUnit } };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Step over this instruction and its operands. Shared table, because\n\t\t\t// three hand-copied versions of this had already drifted.\n\t\t\ti = nextInstruction(opcodes, i);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tdestroy(): void {\n\t\t// Cache cleared by ResolverRegistry.unregister() via removeQueries({ queryKey: [\"currency\"] })\n\t}\n}\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk5IJD5L3O_cjs=require('./chunk-5IJD5L3O.cjs'),chunkS3DFU33X_cjs=require('./chunk-S3DFU33X.cjs'),chunkWEAKI5V5_cjs=require('./chunk-WEAKI5V5.cjs'),chunkNAZ6PGLS_cjs=require('./chunk-NAZ6PGLS.cjs');chunk5IJD5L3O_cjs.e();function g(){let c=new Uint8Array(128);for(let r=48;r<=57;r++)c[r]=2;for(let r=65;r<=90;r++)c[r]=3;for(let r=97;r<=122;r++)c[r]=3;return c[95]=3,c[46]=4,c[32]=1,c[9]=1,c[10]=1,c[13]=1,c[33]=5,c[37]=5,c[38]=5,c[40]=5,c[41]=5,c[42]=5,c[43]=5,c[44]=5,c[45]=5,c[47]=5,c[58]=5,c[59]=5,c[60]=5,c[61]=5,c[62]=5,c[63]=5,c[91]=5,c[93]=5,c[94]=5,c[123]=5,c[124]=5,c[125]=5,c[126]=5,c[64]=5,c[34]=6,c[35]=7,c[36]=8,c[96]=11,c}function w(c){return c===133||c===160||c===5760||c>=8192&&c<=8202||c===8203||c===8232||c===8233||c===8239||c===8287||c===12288||c===65279}var a=class{constructor(r,t,e,s,o,i,l,n,p){this.type=r;this.typeId=t;this.value=e;this.text=s;this.offset=o;this.lineBreaks=i;this.line=l;this.col=n;this.sourceEnd=p;}},y={61:{61:"EQUALITY",62:"THEREFORE"},33:{61:"NEQ"},62:{61:"GTE"},60:{61:"LTE"},38:{38:"LOGICAL_AND"},124:{124:"LOGICAL_OR"},43:{61:"PLUS_EQUALS"},45:{61:"MINUS_EQUALS"}},L={43:"PLUS",45:"MINUS",42:"STAR",47:"SLASH",94:"CARET",37:"PERCENT",40:"LPAREN",41:"RPAREN",91:"LBRACKET",93:"RBRACKET",123:"LBRACE",125:"RBRACE",44:"COMMA",58:"COLON",59:"SEMICOLON",61:"EQUALS",63:"QUESTION",33:"BANG",38:"BIT_AND",124:"BIT_OR",60:"LT",62:"GT",126:"BIT_NOT",64:"AT"},b=(()=>{let c=new Set;for(let t=48;t<=57;t++)c.add(t);let r=[43,45,42,47,94,37,40,41,91,93,123,125,61,60,62,33,38,124,126,59,63];for(let t of r)c.add(t);return c.add(36),c.add(163),c.add(8364),c.add(165),c.add(8381),c.add(8361),c.add(96),c.add(46),c.add(35),c})(),S=class S{constructor(r="en",t){this.configuredLookup=null;this.input="";this.pos=0;this.len=0;this.line=1;this.lineStartPos=0;this.groupingStack=[];this.pluginKeywordMap=new Map;this.pluginOperators=new Map;this.pluginUnits=new Set;this.hasPluginOps=false;this._inlineSolveSpans=[];this.pluginRawLinePatterns=[];this.pendingRawLineToken=null;this.localeCode=r,this.locale=chunkS3DFU33X_cjs.a(r),this.configuredLookup=t??null,this.keywordMap=new Map;for(let[e,s]of Object.entries(this.locale.keywordMap))this.keywordMap.set(e.toLowerCase(),s);this.mergedKeywords=new Map(this.keywordMap),this.mergedUnits=chunkWEAKI5V5_cjs.a;}matchRawLine(r){for(let t of this.pluginRawLinePatterns){let e=t.pattern.exec(r);if(e&&typeof e[1]=="string"){let s=e[1].trim();if(s.length>0)return new a(t.tokenType,chunk5IJD5L3O_cjs.c(t.tokenType),s,s,0,0,this.line,1)}}return null}rebuildMergedUnits(){this.mergedUnits=this.pluginUnits.size===0?chunkWEAKI5V5_cjs.a:new Set([...chunkWEAKI5V5_cjs.a,...this.pluginUnits]);}registerVocabulary(r){if(r.keywords)for(let[t,e]of Object.entries(r.keywords)){let s=t.toLowerCase();if(this.keywordMap.has(s))throw chunkNAZ6PGLS_cjs.c.config("PLUGIN_KEYWORD_COLLISION",`Plugin keyword "${t}" conflicts with built-in keyword (type: ${this.keywordMap.get(s)}). Built-in keywords cannot be overridden.`,{keyword:t,builtinType:this.keywordMap.get(s)});this.pluginKeywordMap.set(s,e),this.mergedKeywords.set(s,e);}if(r.operators){this.hasPluginOps=true;for(let[t,e]of Object.entries(r.operators))if(t.length===2){let s=t.charCodeAt(0),o=t.charCodeAt(1),i=y[s];if(i&&i[o]!==void 0)throw chunkNAZ6PGLS_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: ${i[o]}). Built-in operators cannot be overridden.`,{operator:t,builtinType:i[o]});if(s===60&&o===60)throw chunkNAZ6PGLS_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: LSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"LSHIFT"});if(s===62&&o===62)throw chunkNAZ6PGLS_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: RSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"RSHIFT"});if(s===47&&o===47)throw chunkNAZ6PGLS_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in comment sequence. Comment sequences cannot be overridden.`,{operator:t,builtinType:"COMMENT"});let l=this.pluginOperators.get(s);l||(l=new Map,this.pluginOperators.set(s,l)),l.set(o,e);}}if(r.units){for(let t of r.units){if(chunkWEAKI5V5_cjs.a.has(t))throw chunkNAZ6PGLS_cjs.c.config("PLUGIN_UNIT_COLLISION",`Plugin unit "${t}" conflicts with a built-in unit. Built-in units cannot be overridden.`,{unit:t});this.pluginUnits.add(t);}this.rebuildMergedUnits();}r.rawLinePatterns&&this.pluginRawLinePatterns.push(...r.rawLinePatterns);}unregisterVocabulary(r){if(r.keywords)for(let t of Object.keys(r.keywords)){let e=t.toLowerCase();this.pluginKeywordMap.delete(e),this.mergedKeywords.delete(e);}if(r.operators){for(let t of Object.keys(r.operators))if(t.length===2){let e=t.charCodeAt(0),s=t.charCodeAt(1),o=this.pluginOperators.get(e);o&&(o.delete(s),o.size===0&&this.pluginOperators.delete(e));}this.hasPluginOps=this.pluginOperators.size>0;}if(r.units){for(let t of r.units)this.pluginUnits.delete(t);this.rebuildMergedUnits();}if(r.rawLinePatterns){let t=new Set(r.rawLinePatterns);this.pluginRawLinePatterns=this.pluginRawLinePatterns.filter(e=>!t.has(e));}}reset(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0,this.pendingRawLineToken=this.pluginRawLinePatterns.length>0?this.matchRawLine(r):null;}scanDocument(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0;let t=[],e=this.input,s=this.len;for(;this.pos<s;){let o=this.pos,i=this.pos;for(;i<s;){let d=e.charCodeAt(i);if(d===10||d===13)break;i++;}let l=this.line,n=this.classifyFromPositions(o,i),p=e.slice(o,i),u=[];if(!n.skip){let d=this.pluginRawLinePatterns.length>0?this.matchRawLine(p):null;if(d)u=[d];else {let A=this.len;this.len=i,n.contentOffset!==void 0&&(this.pos=n.contentOffset),u=Array.from(this),this.len=A;}}let f=[];if(n.hasInlineSolve)if(!n.skip&&u.length>0){let d=this.findInlineSolves(p);f=this._inlineSolveSpans.map((A,C)=>({start:d[C]?.start??0,end:d[C]?.end??0,expression:d[C]?.expression??"",columnNumber:d[C]?.columnNumber??A.columnNumber,startTokenIndex:A.startTokenIndex,endTokenIndex:A.endTokenIndex}));}else f=this.findInlineSolves(p);if(t.push({text:p,lineNumber:l,startOffset:o,endOffset:i,classification:n,tokens:u,inlineSolves:f}),this.pos=i,this.pos<s){let d=e.charCodeAt(this.pos);d===13?(this.pos++,this.pos<s&&e.charCodeAt(this.pos)===10&&this.pos++):d===10&&this.pos++;}this.line++,this.lineStartPos=this.pos;}return t}tokenizeAll(){return this.pendingRawLineToken?(this._inlineSolveSpans=[],[this.pendingRawLineToken]):Array.from(this)}*[Symbol.iterator](){let r=this.len;if(r===0){this._inlineSolveSpans=[];return}let t=0,e=null,s=[];if(r===1){let i=this.input.charCodeAt(0);switch(S.CHAR_CLASS[i]??0){case 2:case 4:yield new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),this.input,this.input,0,0,1,1),t++;break;case 3:{let n=this.input,p=n.toLowerCase();if(this.mergedUnits.has(n))yield new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),n,n,0,0,1,1);else {let u=this.mergedKeywords.get(p);u?yield new a(u,chunk5IJD5L3O_cjs.c(u),n,n,0,0,1,1):yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),n,n,0,0,1,1);}t++;break}case 5:{let n=L[i];n&&(yield new a(n,chunk5IJD5L3O_cjs.c(n),this.input,this.input,0,0,1,1),t++);break}case 6:this.pos=0,yield this.tokenizeString(),t++;break;case 7:this.pos=0,yield this.tokenizeComment(),t++;break;case 8:yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",0,0,1,1),t++;break;case 11:yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",0,0,1,1),t++;break;default:{w(i)||(i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",0,0,1,1),t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",0,0,1,1),t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",0,0,1,1),t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",0,0,1,1),t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",0,0,1,1),t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",0,0,1,1),t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",0,0,1,1),t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",0,0,1,1),t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",0,0,1,1),t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",0,0,1,1),t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",0,0,1,1),t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",0,0,1,1),t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",0,0,1,1),t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",0,0,1,1),t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",0,0,1,1),t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",0,0,1,1),t++):i>=128&&(yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),this.input,this.input,0,0,1,1),t++));break}}this._inlineSolveSpans=s;return}let o=this.input;for(this.groupingStack.length=0;this.pos<r;){let i=o.charCodeAt(this.pos),l=S.CHAR_CLASS[i]??0;if(e&&i===92&&this.pos+1<r&&o.charCodeAt(this.pos+1)===96){this.pos+=2;continue}switch(l){case 1:this.pos++,i===10?(this.line++,this.lineStartPos=this.pos,this.groupingStack.length=0):i===13&&(this.line++,this.pos<r&&o.charCodeAt(this.pos)===10&&this.pos++,this.lineStartPos=this.pos,this.groupingStack.length=0);break;case 2:yield this.tokenizeNumber(),t++;break;case 3:{let n=this.tokenizeIdentifier();n.type==="INLINE_SOLVE_START"&&(e={startTokenIndex:t,startColumn:n.col}),yield n,t++;break}case 4:if(this.pos+1<r)if((S.CHAR_CLASS[o.charCodeAt(this.pos+1)]??0)===2)yield this.tokenizeNumber();else {let p=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,p),this.pos++;}else {let n=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,n),this.pos++;}t++;break;case 5:yield this.tokenizeOperator(),t++;break;case 6:yield this.tokenizeString(),t++;break;case 7:yield this.tokenizeComment(),t++;break;case 8:{let n=this.pos-this.lineStartPos+1;yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",this.pos,0,this.line,n),this.pos++,t++;break}case 11:{let n=this.pos-this.lineStartPos+1;if(yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",this.pos,0,this.line,n),this.pos++,e){let p=e;s.push({start:0,end:0,expression:"",columnNumber:p.startColumn,startTokenIndex:p.startTokenIndex,endTokenIndex:t}),e=null;}t++;break}default:{let n=this.pos-this.lineStartPos+1;w(i)?(this.pos++,(i===8232||i===8233||i===133)&&(this.line++,this.lineStartPos=this.pos)):i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",this.pos,0,this.line,n),this.pos++,t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",this.pos,0,this.line,n),this.pos++,t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",this.pos,0,this.line,n),this.pos++,t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",this.pos,0,this.line,n),this.pos++,t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",this.pos,0,this.line,n),this.pos++,t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",this.pos,0,this.line,n),this.pos++,t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",this.pos,0,this.line,n),this.pos++,t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",this.pos,0,this.line,n),this.pos++,t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",this.pos,0,this.line,n),this.pos++,t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",this.pos,0,this.line,n),this.pos++,t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",this.pos,0,this.line,n),this.pos++,t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",this.pos,0,this.line,n),this.pos++,t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",this.pos,0,this.line,n),this.pos++,t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",this.pos,0,this.line,n),this.pos++,t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",this.pos,0,this.line,n),this.pos++,t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",this.pos,0,this.line,n),this.pos++,t++):i>=128?(yield this.tokenizeIdentifier(),t++):this.pos++;break}}}this._inlineSolveSpans=s;}tokenizeNumber(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;if(r.charCodeAt(e)===48&&e+1<t){let f=r.charCodeAt(e+1);if(f===120||f===88){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}if(f===98||f===66){for(e+=2;e<t&&(i=r.charCodeAt(e),i===48||i===49);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}if(f===111||f===79){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=55);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}}let l=false;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)l=true,e++;for(;l&&e<t&&(r.charCodeAt(e)===44||r.charCodeAt(e)===46)&&!(r.charCodeAt(e)===44&&this.groupingStack.length>0&&this.groupingStack[this.groupingStack.length-1]);){if(e+4<=t){let f=r.charCodeAt(e+1),d=r.charCodeAt(e+2),A=r.charCodeAt(e+3),C=e+4<t?r.charCodeAt(e+4):-1,T=!(C>=48&&C<=57);if(f>=48&&f<=57&&d>=48&&d<=57&&A>=48&&A<=57&&T){e+=4,l=true;continue}}break}let n=false;if(e<t&&r.charCodeAt(e)===46&&e+1<t){let f=r.charCodeAt(e+1);if(f>=48&&f<=57)for(n=true,e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}let p=false;if(e<t){let f=r.charCodeAt(e);if((f===101||f===69)&&e+1<t){let d=r.charCodeAt(e+1);if(d>=48&&d<=57||d===43||d===45)for(p=true,e++,(d===43||d===45)&&e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}}if(e<t&&r.charCodeAt(e)===110&&l&&!n&&!p){e++;let f=r.slice(s,e);return this.pos=e,new a("BIGINT",chunk5IJD5L3O_cjs.c("BIGINT"),f,f,s,0,this.line,o)}let u=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),u,u,s,0,this.line,o)}tokenizeIdentifier(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95||i>=128&&!w(i));)e++;let l=r.slice(s,e),n=l.toLowerCase();if(n==="s"&&e<t&&r.charCodeAt(e)===96){e++,this.pos=e;let f=r.slice(s,e);return new a("INLINE_SOLVE_START",chunk5IJD5L3O_cjs.c("INLINE_SOLVE_START"),f,f,s,0,this.line,o)}if(this.mergedUnits.has(l)&&!this.isFollowedByLParen(e))return this.pos=e,new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),l,l,s,0,this.line,o);let u=this.mergedKeywords.get(n);return u?(this.pos=e,new a(u,chunk5IJD5L3O_cjs.c(u),l,l,s,0,this.line,o)):(this.pos=e,new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),l,l,s,0,this.line,o))}isFollowedByLParen(r){let t=this.len,e=r;for(;e<t;){let s=this.input.charCodeAt(e);if(s===40)return true;if(s!==32&&s!==9)break;e++;}return false}precededByCallTarget(r){let t=this.input,e=this.lineStartPos,s=r-1;for(;s>=e&&(t.charCodeAt(s)===32||t.charCodeAt(s)===9);)s--;if(s<e)return false;let o=t.charCodeAt(s),i=d=>d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||d===95,l=d=>d>=65&&d<=90||d>=97&&d<=122||d===95;if(!i(o))return false;let n=s+1,p=false;for(;s>=e;){let d=t.charCodeAt(s);if(!i(d))break;l(d)&&(p=true),s--;}if(!p)return false;let u=t.slice(s+1,n).toLowerCase(),f=this.mergedKeywords.get(u);return f===void 0||f==="FUNC"}tokenizeOperator(){let r=this.input,t=this.pos,e=t-this.lineStartPos+1,s=r.charCodeAt(t),o=this.len;if(t+1<o){let n=r.charCodeAt(t+1),p=y[s];if(p){let u=p[n];if(u){let f=r.slice(t,t+2);return this.pos=t+2,new a(u,chunk5IJD5L3O_cjs.c(u),f,f,t,0,this.line,e)}}if(s===47&&n===47){let u=t+2;for(;u<o;){let d=r.charCodeAt(u);if(d===10||d===13)break;u++;}let f=r.slice(t,u);return this.pos=u,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),f,f,t,0,this.line,e)}if(s===60&&n===60)return this.pos=t+2,new a("LSHIFT",chunk5IJD5L3O_cjs.c("LSHIFT"),"<<","<<",t,0,this.line,e);if(s===62&&n===62)return r.charCodeAt(t+2)===62?(this.pos=t+3,new a("URSHIFT",chunk5IJD5L3O_cjs.c("URSHIFT"),">>>",">>>",t,0,this.line,e)):(this.pos=t+2,new a("RSHIFT",chunk5IJD5L3O_cjs.c("RSHIFT"),">>",">>",t,0,this.line,e));if(this.hasPluginOps){let u=this.pluginOperators.get(s);if(u){let f=u.get(n);if(f){let d=r.slice(t,t+2);return this.pos=t+2,new a(f,chunk5IJD5L3O_cjs.c(f),d,d,t,0,this.line,e)}}}}this.pos=t+1,s===91?this.groupingStack.push(true):s===40?this.groupingStack.push(this.precededByCallTarget(t)):(s===41||s===93)&&this.groupingStack.length>0&&this.groupingStack.pop();let i=L[s],l=r.charAt(t);return new a(i||"ERROR",chunk5IJD5L3O_cjs.c(i||"ERROR"),l,l,t,0,this.line,e)}tokenizeString(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1,o=e+1,i=0;for(;o<t;){let l=r.charCodeAt(o);if(l===34){o++;let n=r.slice(e,o),p=r.slice(e+1,o-1);return this.pos=o,new a("STRING",chunk5IJD5L3O_cjs.c("STRING"),p,n,e,i,this.line,s)}if(l===92&&o+1<t){o+=2;continue}l===10&&(this.line++,this.lineStartPos=o+1,i++),o++;}throw this.pos=o,chunkNAZ6PGLS_cjs.c.parsing("UNTERMINATED_STRING",`Unterminated string literal: ${r.slice(e,o)}`,{literal:r.slice(e,o),offset:e})}static hasExpressionIndicators(r,t,e){let s=b;for(let o=t;o<e;o++){let i=r.charCodeAt(o);if(s.has(i)||i>=128&&(i===215||i===247||i===8800||i===163||i===8364||i===165||i===8381||i===8361))return true}return false}skipMarkerGap(r,t){let e=this.input,s=r;for(;s<t&&(e.charCodeAt(s)===32||e.charCodeAt(s)===9);)s++;if(s+2<t&&e.charCodeAt(s)===91&&e.charCodeAt(s+2)===93){let o=s+3;for(;o<t&&(e.charCodeAt(o)===32||e.charCodeAt(o)===9);)o++;if(o>s+3)return o}return s}matchHexColourEnd(r,t){let e=this.input,s=r+1,o=0;for(;s<t;){let i=e.charCodeAt(s);if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))break;o++,s++;}if(o!==3&&o!==4&&o!==6&&o!==8)return -1;if(s<t){let i=e.charCodeAt(s);if(i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95)return -1}return s}classifyFromPositions(r,t){let e=t;if(r>=e)return {type:"empty",skip:true,hasInlineSolve:false};let s=this.input,o=r;for(;o<e;){let n=s.charCodeAt(o);if(n!==32&&n!==9)break;o++;}if(o>=e)return {type:"empty",skip:true,hasInlineSolve:false};let i=s.charCodeAt(o),l;if(i===35){if(this.matchHexColourEnd(o,e)!==-1){if(l===void 0){let p=s.indexOf("s`",o);l=p!==-1&&p<e;}return {type:"expression",skip:false,hasInlineSolve:l}}let n=1;for(;o+n<e&&s.charCodeAt(o+n)===35;)n++;return n<=6&&o+n<e&&s.charCodeAt(o+n)===32?{type:"heading",skip:true,hasInlineSolve:false}:{type:"heading",skip:true,hasInlineSolve:false}}if(i===62&&o+1<e&&s.charCodeAt(o+1)===32)return {type:"blockquote",skip:true,hasInlineSolve:false};if(i===96&&o+2<e&&s.charCodeAt(o+1)===96&&s.charCodeAt(o+2)===96)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===126&&o+2<e&&s.charCodeAt(o+1)===126&&s.charCodeAt(o+2)===126)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===36&&o+1<e&&s.charCodeAt(o+1)===36)return {type:"math_fence",skip:true,hasInlineSolve:false};if(i===45||i===42||i===95){let n=1;for(;o+n<e&&s.charCodeAt(o+n)===i;)n++;if(n>=3){let p=o+n;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"hr",skip:true,hasInlineSolve:false}}}if((i===45||i===42||i===43)&&o+1<e&&s.charCodeAt(o+1)===32){if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(o+1,e)}}if(i>=48&&i<=57){let n=o;for(;n<e&&s.charCodeAt(n)>=48&&s.charCodeAt(n)<=57;)n++;if(n<e&&s.charCodeAt(n)===46&&n+1<e&&s.charCodeAt(n+1)===32){if(l===void 0){let p=s.indexOf("s`",o);l=p!==-1&&p<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(n+1,e)}}}if(i===124){let n=o+1;for(;n<e;){let p=s.charCodeAt(n);if(p!==45&&p!==58&&p!==124&&p!==32&&p!==9&&p!==13)break;n++;}if(n>=e)return {type:"table_separator",skip:true,hasInlineSolve:false}}if(i===91&&o+1<e&&s.charCodeAt(o+1)===91){let n=s.indexOf("]]",o+2);if(n!==-1&&n<e){let p=n+2;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===33&&o+2<e&&s.charCodeAt(o+1)===91&&s.charCodeAt(o+2)===91){let n=s.indexOf("]]",o+3);if(n!==-1&&n<e){let p=n+2;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===47&&o+1<e&&s.charCodeAt(o+1)===47)return {type:"comment",skip:true,hasInlineSolve:false};if(i===62){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"blockquote",skip:true,hasInlineSolve:false}}if(i===45||i===42||i===43){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"list",skip:false,hasInlineSolve:false}}if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}if(!l){let n=true;for(let p=o;p<e;p++){let u=s.charCodeAt(p);if(u>=128||S.CHAR_CLASS[u]>1){n=false;break}}if(n)return {type:"empty",skip:true,hasInlineSolve:false}}return {type:"expression",skip:false,hasInlineSolve:l}}classifyLine(r){let t=this.input,e=this.len,s=this.pos;this.input=r,this.len=r.length,this.pos=0;let o=this.classifyFromPositions(0,r.length);return this.input=t,this.len=e,this.pos=s,o}getKeywords(){return Object.fromEntries(this.mergedKeywords)}findInlineSolves(r){let t=[],e=r.length,s=0;for(;s<e;){let o=r.indexOf("s`",s);if(o===-1)break;let i=o+2,l=i;for(;l<e;){let u=r.charCodeAt(l);if(u===92&&l+1<e){l+=2;continue}if(u===96)break;l++;}l>=e&&(l=e);let n=r.slice(i,l),p=l<e?l+1:l;t.push({start:o,end:p,expression:n,columnNumber:o+1}),s=p;}return t}tokenizeComment(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1;if(r.charCodeAt(e)===35){let l=this.matchHexColourEnd(e,t);if(l!==-1){let d=r.slice(e,l);return this.pos=l,new a("HEX_COLOUR",chunk5IJD5L3O_cjs.c("HEX_COLOUR"),d,d,e,0,this.line,s)}let n=r.charCodeAt(e+1),p=n>=65&&n<=90||n>=97&&n<=122,u=e>this.lineStartPos?r.charCodeAt(e-1):-1,f=u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||u===95;if(p&&!f){let d=e+2;for(;d<t;){let C=r.charCodeAt(d);if(!(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||C===95||C===45))break;d++;}let A=r.slice(e+1,d);return this.pos=d,new a("TAG",chunk5IJD5L3O_cjs.c("TAG"),A,A,e,0,this.line,s)}}let o=this.pos;for(o+1<t&&r.charCodeAt(o+1)===47?o+=2:o++;o<t;){let l=r.charCodeAt(o);if(l===10||l===13)break;o++;}let i=r.slice(e,o);return this.pos=o,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),i,i,e,0,this.line,s)}};S.CHAR_CLASS=g();var I=S;exports.a=a;exports.b=I;//# sourceMappingURL=chunk-FAGFPVYK.cjs.map
2
- //# sourceMappingURL=chunk-FAGFPVYK.cjs.map
1
+ 'use strict';var chunk5IJD5L3O_cjs=require('./chunk-5IJD5L3O.cjs'),chunkS3DFU33X_cjs=require('./chunk-S3DFU33X.cjs'),chunkWEAKI5V5_cjs=require('./chunk-WEAKI5V5.cjs'),chunkCO2BI6WL_cjs=require('./chunk-CO2BI6WL.cjs');chunk5IJD5L3O_cjs.e();function g(){let c=new Uint8Array(128);for(let r=48;r<=57;r++)c[r]=2;for(let r=65;r<=90;r++)c[r]=3;for(let r=97;r<=122;r++)c[r]=3;return c[95]=3,c[46]=4,c[32]=1,c[9]=1,c[10]=1,c[13]=1,c[33]=5,c[37]=5,c[38]=5,c[40]=5,c[41]=5,c[42]=5,c[43]=5,c[44]=5,c[45]=5,c[47]=5,c[58]=5,c[59]=5,c[60]=5,c[61]=5,c[62]=5,c[63]=5,c[91]=5,c[93]=5,c[94]=5,c[123]=5,c[124]=5,c[125]=5,c[126]=5,c[64]=5,c[34]=6,c[35]=7,c[36]=8,c[96]=11,c}function w(c){return c===133||c===160||c===5760||c>=8192&&c<=8202||c===8203||c===8232||c===8233||c===8239||c===8287||c===12288||c===65279}var a=class{constructor(r,t,e,s,o,i,l,n,p){this.type=r;this.typeId=t;this.value=e;this.text=s;this.offset=o;this.lineBreaks=i;this.line=l;this.col=n;this.sourceEnd=p;}},y={61:{61:"EQUALITY",62:"THEREFORE"},33:{61:"NEQ"},62:{61:"GTE"},60:{61:"LTE"},38:{38:"LOGICAL_AND"},124:{124:"LOGICAL_OR"},43:{61:"PLUS_EQUALS"},45:{61:"MINUS_EQUALS"}},L={43:"PLUS",45:"MINUS",42:"STAR",47:"SLASH",94:"CARET",37:"PERCENT",40:"LPAREN",41:"RPAREN",91:"LBRACKET",93:"RBRACKET",123:"LBRACE",125:"RBRACE",44:"COMMA",58:"COLON",59:"SEMICOLON",61:"EQUALS",63:"QUESTION",33:"BANG",38:"BIT_AND",124:"BIT_OR",60:"LT",62:"GT",126:"BIT_NOT",64:"AT"},b=(()=>{let c=new Set;for(let t=48;t<=57;t++)c.add(t);let r=[43,45,42,47,94,37,40,41,91,93,123,125,61,60,62,33,38,124,126,59,63];for(let t of r)c.add(t);return c.add(36),c.add(163),c.add(8364),c.add(165),c.add(8381),c.add(8361),c.add(96),c.add(46),c.add(35),c})(),S=class S{constructor(r="en",t){this.configuredLookup=null;this.input="";this.pos=0;this.len=0;this.line=1;this.lineStartPos=0;this.groupingStack=[];this.pluginKeywordMap=new Map;this.pluginOperators=new Map;this.pluginUnits=new Set;this.hasPluginOps=false;this._inlineSolveSpans=[];this.pluginRawLinePatterns=[];this.pendingRawLineToken=null;this.localeCode=r,this.locale=chunkS3DFU33X_cjs.a(r),this.configuredLookup=t??null,this.keywordMap=new Map;for(let[e,s]of Object.entries(this.locale.keywordMap))this.keywordMap.set(e.toLowerCase(),s);this.mergedKeywords=new Map(this.keywordMap),this.mergedUnits=chunkWEAKI5V5_cjs.a;}matchRawLine(r){for(let t of this.pluginRawLinePatterns){let e=t.pattern.exec(r);if(e&&typeof e[1]=="string"){let s=e[1].trim();if(s.length>0)return new a(t.tokenType,chunk5IJD5L3O_cjs.c(t.tokenType),s,s,0,0,this.line,1)}}return null}rebuildMergedUnits(){this.mergedUnits=this.pluginUnits.size===0?chunkWEAKI5V5_cjs.a:new Set([...chunkWEAKI5V5_cjs.a,...this.pluginUnits]);}registerVocabulary(r){if(r.keywords)for(let[t,e]of Object.entries(r.keywords)){let s=t.toLowerCase();if(this.keywordMap.has(s))throw chunkCO2BI6WL_cjs.c.config("PLUGIN_KEYWORD_COLLISION",`Plugin keyword "${t}" conflicts with built-in keyword (type: ${this.keywordMap.get(s)}). Built-in keywords cannot be overridden.`,{keyword:t,builtinType:this.keywordMap.get(s)});this.pluginKeywordMap.set(s,e),this.mergedKeywords.set(s,e);}if(r.operators){this.hasPluginOps=true;for(let[t,e]of Object.entries(r.operators))if(t.length===2){let s=t.charCodeAt(0),o=t.charCodeAt(1),i=y[s];if(i&&i[o]!==void 0)throw chunkCO2BI6WL_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: ${i[o]}). Built-in operators cannot be overridden.`,{operator:t,builtinType:i[o]});if(s===60&&o===60)throw chunkCO2BI6WL_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: LSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"LSHIFT"});if(s===62&&o===62)throw chunkCO2BI6WL_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: RSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"RSHIFT"});if(s===47&&o===47)throw chunkCO2BI6WL_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in comment sequence. Comment sequences cannot be overridden.`,{operator:t,builtinType:"COMMENT"});let l=this.pluginOperators.get(s);l||(l=new Map,this.pluginOperators.set(s,l)),l.set(o,e);}}if(r.units){for(let t of r.units){if(chunkWEAKI5V5_cjs.a.has(t))throw chunkCO2BI6WL_cjs.c.config("PLUGIN_UNIT_COLLISION",`Plugin unit "${t}" conflicts with a built-in unit. Built-in units cannot be overridden.`,{unit:t});this.pluginUnits.add(t);}this.rebuildMergedUnits();}r.rawLinePatterns&&this.pluginRawLinePatterns.push(...r.rawLinePatterns);}unregisterVocabulary(r){if(r.keywords)for(let t of Object.keys(r.keywords)){let e=t.toLowerCase();this.pluginKeywordMap.delete(e),this.mergedKeywords.delete(e);}if(r.operators){for(let t of Object.keys(r.operators))if(t.length===2){let e=t.charCodeAt(0),s=t.charCodeAt(1),o=this.pluginOperators.get(e);o&&(o.delete(s),o.size===0&&this.pluginOperators.delete(e));}this.hasPluginOps=this.pluginOperators.size>0;}if(r.units){for(let t of r.units)this.pluginUnits.delete(t);this.rebuildMergedUnits();}if(r.rawLinePatterns){let t=new Set(r.rawLinePatterns);this.pluginRawLinePatterns=this.pluginRawLinePatterns.filter(e=>!t.has(e));}}reset(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0,this.pendingRawLineToken=this.pluginRawLinePatterns.length>0?this.matchRawLine(r):null;}scanDocument(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0;let t=[],e=this.input,s=this.len;for(;this.pos<s;){let o=this.pos,i=this.pos;for(;i<s;){let d=e.charCodeAt(i);if(d===10||d===13)break;i++;}let l=this.line,n=this.classifyFromPositions(o,i),p=e.slice(o,i),u=[];if(!n.skip){let d=this.pluginRawLinePatterns.length>0?this.matchRawLine(p):null;if(d)u=[d];else {let A=this.len;this.len=i,n.contentOffset!==void 0&&(this.pos=n.contentOffset),u=Array.from(this),this.len=A;}}let f=[];if(n.hasInlineSolve)if(!n.skip&&u.length>0){let d=this.findInlineSolves(p);f=this._inlineSolveSpans.map((A,C)=>({start:d[C]?.start??0,end:d[C]?.end??0,expression:d[C]?.expression??"",columnNumber:d[C]?.columnNumber??A.columnNumber,startTokenIndex:A.startTokenIndex,endTokenIndex:A.endTokenIndex}));}else f=this.findInlineSolves(p);if(t.push({text:p,lineNumber:l,startOffset:o,endOffset:i,classification:n,tokens:u,inlineSolves:f}),this.pos=i,this.pos<s){let d=e.charCodeAt(this.pos);d===13?(this.pos++,this.pos<s&&e.charCodeAt(this.pos)===10&&this.pos++):d===10&&this.pos++;}this.line++,this.lineStartPos=this.pos;}return t}tokenizeAll(){return this.pendingRawLineToken?(this._inlineSolveSpans=[],[this.pendingRawLineToken]):Array.from(this)}*[Symbol.iterator](){let r=this.len;if(r===0){this._inlineSolveSpans=[];return}let t=0,e=null,s=[];if(r===1){let i=this.input.charCodeAt(0);switch(S.CHAR_CLASS[i]??0){case 2:case 4:yield new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),this.input,this.input,0,0,1,1),t++;break;case 3:{let n=this.input,p=n.toLowerCase();if(this.mergedUnits.has(n))yield new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),n,n,0,0,1,1);else {let u=this.mergedKeywords.get(p);u?yield new a(u,chunk5IJD5L3O_cjs.c(u),n,n,0,0,1,1):yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),n,n,0,0,1,1);}t++;break}case 5:{let n=L[i];n&&(yield new a(n,chunk5IJD5L3O_cjs.c(n),this.input,this.input,0,0,1,1),t++);break}case 6:this.pos=0,yield this.tokenizeString(),t++;break;case 7:this.pos=0,yield this.tokenizeComment(),t++;break;case 8:yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",0,0,1,1),t++;break;case 11:yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",0,0,1,1),t++;break;default:{w(i)||(i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",0,0,1,1),t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",0,0,1,1),t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",0,0,1,1),t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",0,0,1,1),t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",0,0,1,1),t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",0,0,1,1),t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",0,0,1,1),t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",0,0,1,1),t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",0,0,1,1),t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",0,0,1,1),t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",0,0,1,1),t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",0,0,1,1),t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",0,0,1,1),t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",0,0,1,1),t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",0,0,1,1),t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",0,0,1,1),t++):i>=128&&(yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),this.input,this.input,0,0,1,1),t++));break}}this._inlineSolveSpans=s;return}let o=this.input;for(this.groupingStack.length=0;this.pos<r;){let i=o.charCodeAt(this.pos),l=S.CHAR_CLASS[i]??0;if(e&&i===92&&this.pos+1<r&&o.charCodeAt(this.pos+1)===96){this.pos+=2;continue}switch(l){case 1:this.pos++,i===10?(this.line++,this.lineStartPos=this.pos,this.groupingStack.length=0):i===13&&(this.line++,this.pos<r&&o.charCodeAt(this.pos)===10&&this.pos++,this.lineStartPos=this.pos,this.groupingStack.length=0);break;case 2:yield this.tokenizeNumber(),t++;break;case 3:{let n=this.tokenizeIdentifier();n.type==="INLINE_SOLVE_START"&&(e={startTokenIndex:t,startColumn:n.col}),yield n,t++;break}case 4:if(this.pos+1<r)if((S.CHAR_CLASS[o.charCodeAt(this.pos+1)]??0)===2)yield this.tokenizeNumber();else {let p=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,p),this.pos++;}else {let n=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,n),this.pos++;}t++;break;case 5:yield this.tokenizeOperator(),t++;break;case 6:yield this.tokenizeString(),t++;break;case 7:yield this.tokenizeComment(),t++;break;case 8:{let n=this.pos-this.lineStartPos+1;yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",this.pos,0,this.line,n),this.pos++,t++;break}case 11:{let n=this.pos-this.lineStartPos+1;if(yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",this.pos,0,this.line,n),this.pos++,e){let p=e;s.push({start:0,end:0,expression:"",columnNumber:p.startColumn,startTokenIndex:p.startTokenIndex,endTokenIndex:t}),e=null;}t++;break}default:{let n=this.pos-this.lineStartPos+1;w(i)?(this.pos++,(i===8232||i===8233||i===133)&&(this.line++,this.lineStartPos=this.pos)):i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",this.pos,0,this.line,n),this.pos++,t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",this.pos,0,this.line,n),this.pos++,t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",this.pos,0,this.line,n),this.pos++,t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",this.pos,0,this.line,n),this.pos++,t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",this.pos,0,this.line,n),this.pos++,t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",this.pos,0,this.line,n),this.pos++,t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",this.pos,0,this.line,n),this.pos++,t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",this.pos,0,this.line,n),this.pos++,t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",this.pos,0,this.line,n),this.pos++,t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",this.pos,0,this.line,n),this.pos++,t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",this.pos,0,this.line,n),this.pos++,t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",this.pos,0,this.line,n),this.pos++,t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",this.pos,0,this.line,n),this.pos++,t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",this.pos,0,this.line,n),this.pos++,t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",this.pos,0,this.line,n),this.pos++,t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",this.pos,0,this.line,n),this.pos++,t++):i>=128?(yield this.tokenizeIdentifier(),t++):this.pos++;break}}}this._inlineSolveSpans=s;}tokenizeNumber(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;if(r.charCodeAt(e)===48&&e+1<t){let f=r.charCodeAt(e+1);if(f===120||f===88){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}if(f===98||f===66){for(e+=2;e<t&&(i=r.charCodeAt(e),i===48||i===49);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}if(f===111||f===79){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=55);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}}let l=false;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)l=true,e++;for(;l&&e<t&&(r.charCodeAt(e)===44||r.charCodeAt(e)===46)&&!(r.charCodeAt(e)===44&&this.groupingStack.length>0&&this.groupingStack[this.groupingStack.length-1]);){if(e+4<=t){let f=r.charCodeAt(e+1),d=r.charCodeAt(e+2),A=r.charCodeAt(e+3),C=e+4<t?r.charCodeAt(e+4):-1,T=!(C>=48&&C<=57);if(f>=48&&f<=57&&d>=48&&d<=57&&A>=48&&A<=57&&T){e+=4,l=true;continue}}break}let n=false;if(e<t&&r.charCodeAt(e)===46&&e+1<t){let f=r.charCodeAt(e+1);if(f>=48&&f<=57)for(n=true,e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}let p=false;if(e<t){let f=r.charCodeAt(e);if((f===101||f===69)&&e+1<t){let d=r.charCodeAt(e+1);if(d>=48&&d<=57||d===43||d===45)for(p=true,e++,(d===43||d===45)&&e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}}if(e<t&&r.charCodeAt(e)===110&&l&&!n&&!p){e++;let f=r.slice(s,e);return this.pos=e,new a("BIGINT",chunk5IJD5L3O_cjs.c("BIGINT"),f,f,s,0,this.line,o)}let u=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),u,u,s,0,this.line,o)}tokenizeIdentifier(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95||i>=128&&!w(i));)e++;let l=r.slice(s,e),n=l.toLowerCase();if(n==="s"&&e<t&&r.charCodeAt(e)===96){e++,this.pos=e;let f=r.slice(s,e);return new a("INLINE_SOLVE_START",chunk5IJD5L3O_cjs.c("INLINE_SOLVE_START"),f,f,s,0,this.line,o)}if(this.mergedUnits.has(l)&&!this.isFollowedByLParen(e))return this.pos=e,new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),l,l,s,0,this.line,o);let u=this.mergedKeywords.get(n);return u?(this.pos=e,new a(u,chunk5IJD5L3O_cjs.c(u),l,l,s,0,this.line,o)):(this.pos=e,new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),l,l,s,0,this.line,o))}isFollowedByLParen(r){let t=this.len,e=r;for(;e<t;){let s=this.input.charCodeAt(e);if(s===40)return true;if(s!==32&&s!==9)break;e++;}return false}precededByCallTarget(r){let t=this.input,e=this.lineStartPos,s=r-1;for(;s>=e&&(t.charCodeAt(s)===32||t.charCodeAt(s)===9);)s--;if(s<e)return false;let o=t.charCodeAt(s),i=d=>d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||d===95,l=d=>d>=65&&d<=90||d>=97&&d<=122||d===95;if(!i(o))return false;let n=s+1,p=false;for(;s>=e;){let d=t.charCodeAt(s);if(!i(d))break;l(d)&&(p=true),s--;}if(!p)return false;let u=t.slice(s+1,n).toLowerCase(),f=this.mergedKeywords.get(u);return f===void 0||f==="FUNC"}tokenizeOperator(){let r=this.input,t=this.pos,e=t-this.lineStartPos+1,s=r.charCodeAt(t),o=this.len;if(t+1<o){let n=r.charCodeAt(t+1),p=y[s];if(p){let u=p[n];if(u){let f=r.slice(t,t+2);return this.pos=t+2,new a(u,chunk5IJD5L3O_cjs.c(u),f,f,t,0,this.line,e)}}if(s===47&&n===47){let u=t+2;for(;u<o;){let d=r.charCodeAt(u);if(d===10||d===13)break;u++;}let f=r.slice(t,u);return this.pos=u,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),f,f,t,0,this.line,e)}if(s===60&&n===60)return this.pos=t+2,new a("LSHIFT",chunk5IJD5L3O_cjs.c("LSHIFT"),"<<","<<",t,0,this.line,e);if(s===62&&n===62)return r.charCodeAt(t+2)===62?(this.pos=t+3,new a("URSHIFT",chunk5IJD5L3O_cjs.c("URSHIFT"),">>>",">>>",t,0,this.line,e)):(this.pos=t+2,new a("RSHIFT",chunk5IJD5L3O_cjs.c("RSHIFT"),">>",">>",t,0,this.line,e));if(this.hasPluginOps){let u=this.pluginOperators.get(s);if(u){let f=u.get(n);if(f){let d=r.slice(t,t+2);return this.pos=t+2,new a(f,chunk5IJD5L3O_cjs.c(f),d,d,t,0,this.line,e)}}}}this.pos=t+1,s===91?this.groupingStack.push(true):s===40?this.groupingStack.push(this.precededByCallTarget(t)):(s===41||s===93)&&this.groupingStack.length>0&&this.groupingStack.pop();let i=L[s],l=r.charAt(t);return new a(i||"ERROR",chunk5IJD5L3O_cjs.c(i||"ERROR"),l,l,t,0,this.line,e)}tokenizeString(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1,o=e+1,i=0;for(;o<t;){let l=r.charCodeAt(o);if(l===34){o++;let n=r.slice(e,o),p=r.slice(e+1,o-1);return this.pos=o,new a("STRING",chunk5IJD5L3O_cjs.c("STRING"),p,n,e,i,this.line,s)}if(l===92&&o+1<t){o+=2;continue}l===10&&(this.line++,this.lineStartPos=o+1,i++),o++;}throw this.pos=o,chunkCO2BI6WL_cjs.c.parsing("UNTERMINATED_STRING",`Unterminated string literal: ${r.slice(e,o)}`,{literal:r.slice(e,o),offset:e})}static hasExpressionIndicators(r,t,e){let s=b;for(let o=t;o<e;o++){let i=r.charCodeAt(o);if(s.has(i)||i>=128&&(i===215||i===247||i===8800||i===163||i===8364||i===165||i===8381||i===8361))return true}return false}skipMarkerGap(r,t){let e=this.input,s=r;for(;s<t&&(e.charCodeAt(s)===32||e.charCodeAt(s)===9);)s++;if(s+2<t&&e.charCodeAt(s)===91&&e.charCodeAt(s+2)===93){let o=s+3;for(;o<t&&(e.charCodeAt(o)===32||e.charCodeAt(o)===9);)o++;if(o>s+3)return o}return s}matchHexColourEnd(r,t){let e=this.input,s=r+1,o=0;for(;s<t;){let i=e.charCodeAt(s);if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))break;o++,s++;}if(o!==3&&o!==4&&o!==6&&o!==8)return -1;if(s<t){let i=e.charCodeAt(s);if(i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95)return -1}return s}classifyFromPositions(r,t){let e=t;if(r>=e)return {type:"empty",skip:true,hasInlineSolve:false};let s=this.input,o=r;for(;o<e;){let n=s.charCodeAt(o);if(n!==32&&n!==9)break;o++;}if(o>=e)return {type:"empty",skip:true,hasInlineSolve:false};let i=s.charCodeAt(o),l;if(i===35){if(this.matchHexColourEnd(o,e)!==-1){if(l===void 0){let p=s.indexOf("s`",o);l=p!==-1&&p<e;}return {type:"expression",skip:false,hasInlineSolve:l}}let n=1;for(;o+n<e&&s.charCodeAt(o+n)===35;)n++;return n<=6&&o+n<e&&s.charCodeAt(o+n)===32?{type:"heading",skip:true,hasInlineSolve:false}:{type:"heading",skip:true,hasInlineSolve:false}}if(i===62&&o+1<e&&s.charCodeAt(o+1)===32)return {type:"blockquote",skip:true,hasInlineSolve:false};if(i===96&&o+2<e&&s.charCodeAt(o+1)===96&&s.charCodeAt(o+2)===96)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===126&&o+2<e&&s.charCodeAt(o+1)===126&&s.charCodeAt(o+2)===126)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===36&&o+1<e&&s.charCodeAt(o+1)===36)return {type:"math_fence",skip:true,hasInlineSolve:false};if(i===45||i===42||i===95){let n=1;for(;o+n<e&&s.charCodeAt(o+n)===i;)n++;if(n>=3){let p=o+n;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"hr",skip:true,hasInlineSolve:false}}}if((i===45||i===42||i===43)&&o+1<e&&s.charCodeAt(o+1)===32){if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(o+1,e)}}if(i>=48&&i<=57){let n=o;for(;n<e&&s.charCodeAt(n)>=48&&s.charCodeAt(n)<=57;)n++;if(n<e&&s.charCodeAt(n)===46&&n+1<e&&s.charCodeAt(n+1)===32){if(l===void 0){let p=s.indexOf("s`",o);l=p!==-1&&p<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(n+1,e)}}}if(i===124){let n=o+1;for(;n<e;){let p=s.charCodeAt(n);if(p!==45&&p!==58&&p!==124&&p!==32&&p!==9&&p!==13)break;n++;}if(n>=e)return {type:"table_separator",skip:true,hasInlineSolve:false}}if(i===91&&o+1<e&&s.charCodeAt(o+1)===91){let n=s.indexOf("]]",o+2);if(n!==-1&&n<e){let p=n+2;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===33&&o+2<e&&s.charCodeAt(o+1)===91&&s.charCodeAt(o+2)===91){let n=s.indexOf("]]",o+3);if(n!==-1&&n<e){let p=n+2;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===47&&o+1<e&&s.charCodeAt(o+1)===47)return {type:"comment",skip:true,hasInlineSolve:false};if(i===62){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"blockquote",skip:true,hasInlineSolve:false}}if(i===45||i===42||i===43){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"list",skip:false,hasInlineSolve:false}}if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}if(!l){let n=true;for(let p=o;p<e;p++){let u=s.charCodeAt(p);if(u>=128||S.CHAR_CLASS[u]>1){n=false;break}}if(n)return {type:"empty",skip:true,hasInlineSolve:false}}return {type:"expression",skip:false,hasInlineSolve:l}}classifyLine(r){let t=this.input,e=this.len,s=this.pos;this.input=r,this.len=r.length,this.pos=0;let o=this.classifyFromPositions(0,r.length);return this.input=t,this.len=e,this.pos=s,o}getKeywords(){return Object.fromEntries(this.mergedKeywords)}findInlineSolves(r){let t=[],e=r.length,s=0;for(;s<e;){let o=r.indexOf("s`",s);if(o===-1)break;let i=o+2,l=i;for(;l<e;){let u=r.charCodeAt(l);if(u===92&&l+1<e){l+=2;continue}if(u===96)break;l++;}l>=e&&(l=e);let n=r.slice(i,l),p=l<e?l+1:l;t.push({start:o,end:p,expression:n,columnNumber:o+1}),s=p;}return t}tokenizeComment(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1;if(r.charCodeAt(e)===35){let l=this.matchHexColourEnd(e,t);if(l!==-1){let d=r.slice(e,l);return this.pos=l,new a("HEX_COLOUR",chunk5IJD5L3O_cjs.c("HEX_COLOUR"),d,d,e,0,this.line,s)}let n=r.charCodeAt(e+1),p=n>=65&&n<=90||n>=97&&n<=122,u=e>this.lineStartPos?r.charCodeAt(e-1):-1,f=u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||u===95;if(p&&!f){let d=e+2;for(;d<t;){let C=r.charCodeAt(d);if(!(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||C===95||C===45))break;d++;}let A=r.slice(e+1,d);return this.pos=d,new a("TAG",chunk5IJD5L3O_cjs.c("TAG"),A,A,e,0,this.line,s)}}let o=this.pos;for(o+1<t&&r.charCodeAt(o+1)===47?o+=2:o++;o<t;){let l=r.charCodeAt(o);if(l===10||l===13)break;o++;}let i=r.slice(e,o);return this.pos=o,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),i,i,e,0,this.line,s)}};S.CHAR_CLASS=g();var I=S;exports.a=a;exports.b=I;//# sourceMappingURL=chunk-TRDOYAKJ.cjs.map
2
+ //# sourceMappingURL=chunk-TRDOYAKJ.cjs.map