@sheetxl/sdk 0.8.0-beta.1 → 0.8.0-beta.11

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 (775) hide show
  1. package/README.md +1 -1
  2. package/THIRD-PARTY-NOTICES.md +1 -1
  3. package/browser/esm/B7aUIvgUjncMMD_i.mjs +394 -0
  4. package/browser/esm/BFagR2JeWs74iAG3.mjs +171 -0
  5. package/browser/esm/BGOFfpxr2jPIdqmV.mjs +40 -0
  6. package/browser/esm/BLoUBId2xZpXAK_H.mjs +698 -0
  7. package/browser/esm/BMyDRQ716j79h_bH.mjs +86 -0
  8. package/browser/esm/BVDiOXGMc5_FMGfy.mjs +400 -0
  9. package/browser/esm/BjkCiv5Jz6WYKZeu.mjs +598 -0
  10. package/browser/esm/BkBhLS0l6z8sxI6D.mjs +441 -0
  11. package/browser/esm/BnG31I6Oj_HEtSPS.mjs +167 -0
  12. package/browser/esm/BoV6zPBnfqCBCqZ7.mjs +7729 -0
  13. package/browser/esm/BpgskG1Er_lGQ_yS.mjs +142 -0
  14. package/browser/esm/BtvLTTfSBdAKplVG.mjs +466 -0
  15. package/browser/esm/C16ycKja6zG0crV_.mjs +55580 -0
  16. package/browser/esm/C2VbEI_XVAoseAwa.mjs +1552 -0
  17. package/browser/esm/C4MqfLn9Dm-l3OIk.mjs +540 -0
  18. package/browser/esm/C5E6zSGAALWf61n4.mjs +199 -0
  19. package/browser/esm/CHU6iu_WGlm7fLET.mjs +1001 -0
  20. package/browser/esm/CQYjO777cmAznUzK.mjs +527 -0
  21. package/browser/esm/CU3DmJ-YnVVrC1_k.mjs +1123 -0
  22. package/browser/esm/CV5EGEjG5_-CPpP0.mjs +8212 -0
  23. package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → CaB7J-xgfKO2uAkG.mjs} +2 -2
  24. package/browser/esm/CkxWugaJFjDGZNZ-.mjs +12 -0
  25. package/browser/esm/ClPfI4lODvCece29.mjs +632 -0
  26. package/browser/esm/ClbvFbFzFzXLBKNN.mjs +193 -0
  27. package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → Ctjb0SsxV4K4MMqG.mjs} +179 -202
  28. package/browser/esm/D5np__Jb1euAyaLw.mjs +7 -0
  29. package/browser/esm/DEiPS3Dr-s4fPbVZ.mjs +607 -0
  30. package/browser/esm/DLLE0FZNsKxbBzRn.mjs +128 -0
  31. package/browser/esm/DWNzqw7DUKwoxjri.mjs +20 -0
  32. package/browser/esm/{B0HS42a7lga1k1U_.mjs → Dlmig06rIo7cInRk.mjs} +2 -2
  33. package/browser/esm/{f2G3QRgEbvFJcoa2.mjs → DvAaxH6z_tGvrRzl.mjs} +1704 -1008
  34. package/browser/esm/Dyq_ivuHvlXLwPCl.mjs +12831 -0
  35. package/browser/esm/PcHFjNzQsE54POri.mjs +1141 -0
  36. package/browser/esm/S2dNNx1a5ydRnARM.mjs +367 -0
  37. package/browser/esm/f1IoRb7tEb0QmCSt.mjs +110 -0
  38. package/browser/esm/gssVX_FH1XFN-twD.mjs +210 -0
  39. package/browser/esm/index.mjs +1759 -1161
  40. package/browser/esm/nvU0ClAbf0g94YBK.mjs +1695 -0
  41. package/browser/esm/zlLuW405RSguy4Kn.mjs +357 -0
  42. package/licenses/dependencies.txt +141 -141
  43. package/node/esm/2Kihw_-5lVTEnwMa.mjs +1132 -0
  44. package/node/esm/857CIBgQgGpnqrXk.mjs +199 -0
  45. package/node/esm/B084DssTcdBheTp_.mjs +7966 -0
  46. package/node/esm/B21JjOLghRoDOrkx.mjs +134 -0
  47. package/node/esm/BIRq1kT7lLRzns9t.mjs +610 -0
  48. package/node/esm/BIwObuhTJYf0jpUa.mjs +451 -0
  49. package/node/esm/Bbf1Pm9Gk7YpLTvg.mjs +12 -0
  50. package/node/esm/BqiexuA89caYnAPz.mjs +1135 -0
  51. package/node/esm/BrCKGFRsX_ezFJ4B.mjs +811 -0
  52. package/node/esm/CCN5vD410obwdz38.mjs +405 -0
  53. package/node/esm/{Cku7XiUvw1xrRasi.mjs → CDHdgJXH2vS71WMc.mjs} +1 -1
  54. package/node/esm/CGp6VZL-gZa9Uezx.mjs +1860 -0
  55. package/node/esm/CNCNJNg890KdgkWh.mjs +142 -0
  56. package/node/esm/CZICGK_ss0HoGHCP.mjs +7 -0
  57. package/node/esm/CZiqiay42tFTrLI4.mjs +171 -0
  58. package/node/esm/CdJHUJSBRHZoryPe.mjs +360 -0
  59. package/node/esm/Ct3h15sCus4Tgt6M.mjs +1762 -0
  60. package/node/esm/CwePQwTILHHjGDkZ.mjs +1033 -0
  61. package/node/esm/CzXT00vrQa1_gvW9.mjs +28 -0
  62. package/node/esm/D1TKBVmoKGAXf37B.mjs +402 -0
  63. package/node/esm/D2KBymQJd1XhpeQD.mjs +540 -0
  64. package/node/esm/D6e2z7eZpxOJXHc7.mjs +1783 -0
  65. package/node/esm/D8zEN-6ZdDqDvTxM.mjs +639 -0
  66. package/node/esm/DNRhGK-8Tr9xcRyc.mjs +8320 -0
  67. package/node/esm/DOU54VsOjG-m-NyQ.mjs +210 -0
  68. package/node/esm/DUTskXCXref-IJnI.mjs +133 -0
  69. package/node/esm/D_t5AUxSm7_icjzq.mjs +638 -0
  70. package/node/esm/Db0v7zXNnyjBIjjI.mjs +372 -0
  71. package/node/esm/De2IONBxQhz-Qbyh.mjs +596 -0
  72. package/node/esm/Df1bL6VFvrqIdSLB.mjs +40 -0
  73. package/node/esm/DkwIPzKc3UwdUIfM.mjs +86 -0
  74. package/node/esm/DrTZbfemSLq2mseG.mjs +111 -0
  75. package/node/esm/OVfaSb506tNSIvbv.mjs +57107 -0
  76. package/node/esm/cGwrLA1RCE-WhJ7w.mjs +255 -0
  77. package/node/esm/index.mjs +2873 -53929
  78. package/node/esm/mFiBSM7XgBHV9AY7.mjs +13010 -0
  79. package/node/esm/yavzZOiZW_EjG9lE.mjs +15 -0
  80. package/package.json +15 -17
  81. package/resources/contents.json +184 -0
  82. package/resources/fonts/arial-bold-italic.hinted.json +125 -0
  83. package/resources/fonts/arial-bold-italic.metrics.json +139 -0
  84. package/resources/fonts/arial-bold-italic.rows.json +9 -0
  85. package/resources/fonts/arial-bold.hinted.json +125 -0
  86. package/resources/fonts/arial-bold.metrics.json +139 -0
  87. package/resources/fonts/arial-bold.rows.json +9 -0
  88. package/resources/fonts/arial-italic.hinted.json +125 -0
  89. package/resources/fonts/arial-italic.metrics.json +139 -0
  90. package/resources/fonts/arial-italic.rows.json +9 -0
  91. package/resources/fonts/arial-regular.hinted.json +125 -0
  92. package/resources/fonts/arial-regular.metrics.json +139 -0
  93. package/resources/fonts/arial-regular.rows.json +9 -0
  94. package/resources/fonts/calibri-bold-italic.hinted.json +122 -0
  95. package/resources/fonts/calibri-bold-italic.metrics.json +137 -0
  96. package/resources/fonts/calibri-bold-italic.rows.json +9 -0
  97. package/resources/fonts/calibri-bold.hinted.json +122 -0
  98. package/resources/fonts/calibri-bold.metrics.json +137 -0
  99. package/resources/fonts/calibri-bold.rows.json +9 -0
  100. package/resources/fonts/calibri-italic.hinted.json +121 -0
  101. package/resources/fonts/calibri-italic.metrics.json +137 -0
  102. package/resources/fonts/calibri-italic.rows.json +9 -0
  103. package/resources/fonts/calibri-regular.hinted.json +121 -0
  104. package/resources/fonts/calibri-regular.metrics.json +137 -0
  105. package/resources/fonts/calibri-regular.rows.json +9 -0
  106. package/resources/fonts/cambria-bold-italic.hinted.json +105 -0
  107. package/resources/fonts/cambria-bold-italic.metrics.json +66 -0
  108. package/resources/fonts/cambria-bold-italic.rows.json +9 -0
  109. package/resources/fonts/cambria-bold.hinted.json +108 -0
  110. package/resources/fonts/cambria-bold.metrics.json +66 -0
  111. package/resources/fonts/cambria-bold.rows.json +9 -0
  112. package/resources/fonts/cambria-italic.hinted.json +102 -0
  113. package/resources/fonts/cambria-italic.metrics.json +66 -0
  114. package/resources/fonts/cambria-italic.rows.json +9 -0
  115. package/resources/fonts/cambria-regular.hinted.json +110 -0
  116. package/resources/fonts/cambria-regular.metrics.json +66 -0
  117. package/resources/fonts/cambria-regular.rows.json +9 -0
  118. package/resources/fonts/contents.json +406 -0
  119. package/resources/fonts/courier-new-bold-italic.hinted.json +11 -0
  120. package/resources/fonts/courier-new-bold-italic.metrics.json +143 -0
  121. package/resources/fonts/courier-new-bold-italic.rows.json +9 -0
  122. package/resources/fonts/courier-new-bold.hinted.json +11 -0
  123. package/resources/fonts/courier-new-bold.metrics.json +143 -0
  124. package/resources/fonts/courier-new-bold.rows.json +9 -0
  125. package/resources/fonts/courier-new-italic.hinted.json +11 -0
  126. package/resources/fonts/courier-new-italic.metrics.json +143 -0
  127. package/resources/fonts/courier-new-italic.rows.json +9 -0
  128. package/resources/fonts/courier-new-regular.hinted.json +11 -0
  129. package/resources/fonts/courier-new-regular.metrics.json +143 -0
  130. package/resources/fonts/courier-new-regular.rows.json +9 -0
  131. package/resources/fonts/times-new-roman-bold-italic.hinted.json +125 -0
  132. package/resources/fonts/times-new-roman-bold-italic.metrics.json +141 -0
  133. package/resources/fonts/times-new-roman-bold-italic.rows.json +9 -0
  134. package/resources/fonts/times-new-roman-bold.hinted.json +125 -0
  135. package/resources/fonts/times-new-roman-bold.metrics.json +141 -0
  136. package/resources/fonts/times-new-roman-bold.rows.json +9 -0
  137. package/resources/fonts/times-new-roman-italic.hinted.json +125 -0
  138. package/resources/fonts/times-new-roman-italic.metrics.json +143 -0
  139. package/resources/fonts/times-new-roman-italic.rows.json +9 -0
  140. package/resources/fonts/times-new-roman-regular.hinted.json +125 -0
  141. package/resources/fonts/times-new-roman-regular.metrics.json +141 -0
  142. package/resources/fonts/times-new-roman-regular.rows.json +9 -0
  143. package/resources/locales/de/model.msg.json +199 -21
  144. package/resources/locales/en/model.msg.json +207 -23
  145. package/types/scripting-api.json +10663 -0
  146. package/types/scripting-enums.json +435 -130
  147. package/types/scripting.d.ts +33010 -15730
  148. package/types/src/.generated/wasm/fonts.d.ts +161 -0
  149. package/types/src/.generated/wasm/fonts_bg.inline.d.ts +3 -0
  150. package/types/src/.generated/wasm/sdk.d.ts +122 -0
  151. package/types/src/.generated/wasm/sdk_bg.inline.d.ts +3 -0
  152. package/types/src/address/AddressUtils.d.ts +10 -1
  153. package/types/src/address/_StructuredAddress.d.ts +58 -0
  154. package/types/src/anchored/AbstractAnchored.d.ts +18 -8
  155. package/types/src/anchored/AnchoredMap.d.ts +2 -0
  156. package/types/src/anchored/IAnchoredMap.d.ts +52 -4
  157. package/types/src/autoFill/AutoFill.d.ts +316 -32
  158. package/types/src/autoFill/IAutoFill.d.ts +232 -15
  159. package/types/src/border/{IBorder.d.ts → IBorders.d.ts} +58 -41
  160. package/types/src/border/index.d.ts +1 -1
  161. package/types/src/calculation/Calculation.d.ts +584 -149
  162. package/types/src/calculation/ExternalBookBindings.d.ts +118 -0
  163. package/types/src/calculation/FormulaLiterals.d.ts +2 -1
  164. package/types/src/calculation/FormulaText.d.ts +98 -0
  165. package/types/src/calculation/ICalculation.d.ts +353 -88
  166. package/types/src/calculation/INamedFormulasCollection.d.ts +9 -8
  167. package/types/src/calculation/NamedFormulaCollection.d.ts +322 -115
  168. package/types/src/calculation/NamedLambdaFunction.d.ts +28 -0
  169. package/types/src/calculation/TokenType.d.ts +9 -0
  170. package/types/src/calculation/Types.d.ts +83 -2
  171. package/types/src/calculation/_CloneBoundary.d.ts +80 -0
  172. package/types/src/calculation/_FormulaToolkit.d.ts +9 -0
  173. package/types/src/calculation/_TableExtent.d.ts +60 -0
  174. package/types/src/calculation/_TableRename.d.ts +13 -0
  175. package/types/src/calculation/compiler/ASTTypes.d.ts +71 -0
  176. package/types/src/calculation/compiler/CompilerUtils.d.ts +152 -44
  177. package/types/src/calculation/compiler/FormulaCompiler.d.ts +29 -4
  178. package/types/src/calculation/compiler/FormulaParser.d.ts +1 -2
  179. package/types/src/calculation/compiler/LiteTransform.d.ts +17 -0
  180. package/types/src/calculation/compiler/ParserUtils.d.ts +42 -1
  181. package/types/src/calculation/compiler/SRParser.d.ts +2 -1
  182. package/types/src/calculation/compiler/Types.d.ts +79 -9
  183. package/types/src/calculation/engine/CalcBackend.d.ts +855 -0
  184. package/types/src/calculation/engine/index.d.ts +10 -0
  185. package/types/src/calculation/executor/CalcExecutor.d.ts +331 -33
  186. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +49 -2
  187. package/types/src/calculation/executor/CircularReference.d.ts +2 -0
  188. package/types/src/calculation/formula/Formula.d.ts +67 -21
  189. package/types/src/calculation/formula/FormulaBlock.d.ts +131 -23
  190. package/types/src/calculation/formula/FormulaRecordView.d.ts +79 -0
  191. package/types/src/calculation/formula/FunctionValues.d.ts +10 -0
  192. package/types/src/calculation/formula/IFormulaBlock.d.ts +277 -67
  193. package/types/src/calculation/formula/LambdaValue.d.ts +51 -26
  194. package/types/src/calculation/formula/LazyValue.d.ts +96 -0
  195. package/types/src/calculation/formula/TokenUtils.d.ts +25 -1
  196. package/types/src/calculation/formula/index.d.ts +1 -0
  197. package/types/src/calculation/functions/FunctionDeclarations.d.ts +35 -0
  198. package/types/src/calculation/functions/Operators.d.ts +8 -0
  199. package/types/src/calculation/functions/expandDeclaration.d.ts +15 -0
  200. package/types/src/calculation/functions/initializeFunctions.d.ts +3 -2
  201. package/types/src/calculation/grid/CalcGrid.d.ts +443 -158
  202. package/types/src/calculation/grid/CalcGridBackend.d.ts +523 -0
  203. package/types/src/calculation/grid/CalcGridProxy.d.ts +135 -0
  204. package/types/src/calculation/grid/CalcGridUtils.d.ts +69 -12
  205. package/types/src/calculation/grid/FormulaEntry.d.ts +129 -0
  206. package/types/src/calculation/grid/FormulaHost.d.ts +284 -0
  207. package/types/src/calculation/grid/ICalcGrid.d.ts +528 -141
  208. package/types/src/calculation/grid/_CalcRequest.d.ts +299 -0
  209. package/types/src/calculation/grid/_CellValueRun.d.ts +21 -0
  210. package/types/src/calculation/grid/index.d.ts +4 -0
  211. package/types/src/calculation/index.d.ts +2 -0
  212. package/types/src/calculation/spatial/ContentfulSpatialValue.d.ts +6 -2
  213. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +364 -11
  214. package/types/src/calculation/spatial/SpillEntry.d.ts +20 -5
  215. package/types/src/calculation/spatial/TouchedWindows.d.ts +86 -0
  216. package/types/src/calculation/spatial/index.d.ts +1 -0
  217. package/types/src/calculation/state/CalcInputs.d.ts +41 -0
  218. package/types/src/calculation/state/CalcNode.d.ts +141 -30
  219. package/types/src/calculation/state/CalcScope.d.ts +46 -0
  220. package/types/src/calculation/state/CalcState.d.ts +32 -1
  221. package/types/src/calculation/state/CalculationContext.d.ts +50 -3
  222. package/types/src/calculation/state/IContextContainer.d.ts +141 -27
  223. package/types/src/calculation/state/_PendingOverlayGrid.d.ts +163 -0
  224. package/types/src/calculation/state/_ReadObservedGrid.d.ts +74 -8
  225. package/types/src/calculation/state/index.d.ts +1 -0
  226. package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +80 -0
  227. package/types/src/calculation/symbol/ISymbolRegistry.d.ts +23 -0
  228. package/types/src/calculation/symbol/IndirectSymbolProvider.d.ts +16 -2
  229. package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +63 -3
  230. package/types/src/calculation/symbol/SymbolRegistry.d.ts +20 -0
  231. package/types/src/calculation/symbol/index.d.ts +3 -2
  232. package/types/src/calculation/toolkit/FormulaLiteralReader.d.ts +4 -0
  233. package/types/src/calculation/toolkit/FormulaTextParser.d.ts +10 -0
  234. package/types/src/calculation/toolkit/FunctionDeclarationTable.d.ts +4 -0
  235. package/types/src/calculation/toolkit/index.d.ts +12 -0
  236. package/types/src/cell/ICell.d.ts +357 -33
  237. package/types/src/cell/ICellHeader.d.ts +31 -8
  238. package/types/src/cell/ICellProtection.d.ts +50 -10
  239. package/types/src/cellRange/ICellHeaderRange.d.ts +6 -9
  240. package/types/src/cellRange/ICellHeaderRanges.d.ts +5 -0
  241. package/types/src/cellRange/ICellRange.d.ts +737 -130
  242. package/types/src/cellRange/ICellRanges.d.ts +31 -24
  243. package/types/src/chart/Chart.d.ts +246 -16
  244. package/types/src/chart/ChartCollection.d.ts +31 -0
  245. package/types/src/chart/IChart.d.ts +2058 -18
  246. package/types/src/chart/IChartCollection.d.ts +50 -0
  247. package/types/src/chart/_ChartParts.d.ts +1066 -0
  248. package/types/src/chart/_ChartSource.d.ts +47 -0
  249. package/types/src/chart/createChart.d.ts +26 -0
  250. package/types/src/chart/index.d.ts +5 -3
  251. package/types/src/chart/kinds/ChartKind.d.ts +252 -0
  252. package/types/src/chart/kinds/_Area.d.ts +3 -0
  253. package/types/src/chart/kinds/_Bar.d.ts +4 -0
  254. package/types/src/chart/kinds/_BoxWhisker.d.ts +4 -0
  255. package/types/src/chart/kinds/_Bubble.d.ts +3 -0
  256. package/types/src/chart/kinds/_Funnel.d.ts +4 -0
  257. package/types/src/chart/kinds/_Hierarchy.d.ts +31 -0
  258. package/types/src/chart/kinds/_Histogram.d.ts +4 -0
  259. package/types/src/chart/kinds/_HitKinds.d.ts +23 -0
  260. package/types/src/chart/kinds/_Line.d.ts +4 -0
  261. package/types/src/chart/kinds/_OfPie.d.ts +4 -0
  262. package/types/src/chart/kinds/_Pie.d.ts +4 -0
  263. package/types/src/chart/kinds/_Placeholder.d.ts +6 -0
  264. package/types/src/chart/kinds/_Radar.d.ts +4 -0
  265. package/types/src/chart/kinds/_Scatter.d.ts +8 -0
  266. package/types/src/chart/kinds/_Sunburst.d.ts +4 -0
  267. package/types/src/chart/kinds/_Surface.d.ts +4 -0
  268. package/types/src/chart/kinds/_Treemap.d.ts +4 -0
  269. package/types/src/chart/kinds/_Waterfall.d.ts +18 -0
  270. package/types/src/chart/kinds/_builtIns.d.ts +11 -0
  271. package/types/src/chart/layout/ChartLayout.d.ts +825 -0
  272. package/types/src/chart/layout/TextMeasurer.d.ts +38 -0
  273. package/types/src/chart/layout/_HitGeometry.d.ts +50 -0
  274. package/types/src/chart/layout/_HitTest.d.ts +36 -0
  275. package/types/src/chart/layout/_Layout.d.ts +25 -0
  276. package/types/src/chart/layout/_LayoutUtils.d.ts +97 -0
  277. package/types/src/chart/math/BoxStats.d.ts +35 -0
  278. package/types/src/chart/math/DateUnitCalcs.d.ts +80 -0
  279. package/types/src/chart/math/DisplayUnits.d.ts +53 -0
  280. package/types/src/chart/math/Histogram.d.ts +48 -0
  281. package/types/src/chart/math/OrdUnitCalcs.d.ts +166 -0
  282. package/types/src/chart/math/Treemap.d.ts +28 -0
  283. package/types/src/chart/math/Trendlines.d.ts +71 -0
  284. package/types/src/chart/math/UnitCalcs.d.ts +98 -0
  285. package/types/src/chart/model/ChartModel.d.ts +681 -0
  286. package/types/src/chart/model/_ChartType.d.ts +14 -0
  287. package/types/src/chart/model/_Edits.d.ts +489 -0
  288. package/types/src/chart/model/_Grouping.d.ts +83 -0
  289. package/types/src/chart/model/_Inference.d.ts +52 -0
  290. package/types/src/chart/model/_ModelFacts.d.ts +112 -0
  291. package/types/src/chart/model/_NewChart.d.ts +208 -0
  292. package/types/src/chart/model/_OfPie.d.ts +18 -0
  293. package/types/src/chart/resolve/_LegacyStyles.d.ts +48 -0
  294. package/types/src/chart/resolve/_Resolve.d.ts +51 -0
  295. package/types/src/chart/resolve/_ResolvedChart.d.ts +444 -0
  296. package/types/src/collections/ArraysGrid.d.ts +1 -1
  297. package/types/src/collections/IGrid.d.ts +1 -1
  298. package/types/src/collections/ISparseGrid.d.ts +9 -0
  299. package/types/src/collections/ISpatialMap.d.ts +59 -21
  300. package/types/src/collections/ImmutableList.d.ts +28 -0
  301. package/types/src/collections/MixedTypedArrayList.d.ts +168 -108
  302. package/types/src/collections/RTree.d.ts +116 -36
  303. package/types/src/collections/RepeatingList.d.ts +7 -0
  304. package/types/src/collections/ScalarGrid.d.ts +50 -0
  305. package/types/src/collections/SparseGrid.d.ts +7 -4
  306. package/types/src/collections/SpatialMap.d.ts +15 -29
  307. package/types/src/collections/SpatialMap3D.d.ts +2 -0
  308. package/types/src/collections/Tuple.d.ts +128 -16
  309. package/types/src/collections/_GridUtils.d.ts +19 -6
  310. package/types/src/collections/_SpatialUtils.d.ts +20 -2
  311. package/types/src/collections/index.d.ts +2 -1
  312. package/types/src/color/_BuiltInIndexDefs.d.ts +6 -0
  313. package/types/src/comment/Comment.d.ts +246 -0
  314. package/types/src/comment/CommentCollection.d.ts +40 -0
  315. package/types/src/comment/IComment.d.ts +377 -50
  316. package/types/src/comment/ICommentCollection.d.ts +90 -0
  317. package/types/src/comment/NoteMovable.d.ts +26 -0
  318. package/types/src/comment/_CommentUtils.d.ts +50 -0
  319. package/types/src/comment/_NoteBox.d.ts +67 -0
  320. package/types/src/comment/index.d.ts +1 -0
  321. package/types/src/condition/AnchoredConditional.d.ts +110 -19
  322. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +42 -12
  323. package/types/src/condition/BuiltInOperators/AfterEqualToOperator.d.ts +2 -0
  324. package/types/src/condition/BuiltInOperators/AfterOperator.d.ts +2 -0
  325. package/types/src/condition/BuiltInOperators/AndOperator.d.ts +3 -1
  326. package/types/src/condition/BuiltInOperators/AverageOperator.d.ts +2 -0
  327. package/types/src/condition/BuiltInOperators/BeforeEqualToOperator.d.ts +2 -0
  328. package/types/src/condition/BuiltInOperators/BeforeOperator.d.ts +2 -0
  329. package/types/src/condition/BuiltInOperators/BetweenOperator.d.ts +2 -0
  330. package/types/src/condition/BuiltInOperators/ColorOperator.d.ts +4 -0
  331. package/types/src/condition/BuiltInOperators/ContainsOperator.d.ts +2 -0
  332. package/types/src/condition/BuiltInOperators/EndsWithOperator.d.ts +2 -0
  333. package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +4 -1
  334. package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +5 -6
  335. package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +2 -0
  336. package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +2 -0
  337. package/types/src/condition/BuiltInOperators/IconOperator.d.ts +4 -0
  338. package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +22 -5
  339. package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +2 -0
  340. package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +2 -0
  341. package/types/src/condition/BuiltInOperators/NotOperator.d.ts +2 -0
  342. package/types/src/condition/BuiltInOperators/OrOperator.d.ts +3 -1
  343. package/types/src/condition/BuiltInOperators/StartsWithOperator.d.ts +2 -0
  344. package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
  345. package/types/src/condition/BuiltInOperators/TopNOperator.d.ts +6 -0
  346. package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +21 -6
  347. package/types/src/condition/BuiltinSelectors/DateSelector.d.ts +4 -5
  348. package/types/src/condition/BuiltinSelectors/DisplaySelector.d.ts +20 -0
  349. package/types/src/condition/BuiltinSelectors/TextLengthSelector.d.ts +7 -5
  350. package/types/src/condition/BuiltinSelectors/TimeSelector.d.ts +3 -5
  351. package/types/src/condition/BuiltinSelectors/WholeSelector.d.ts +3 -5
  352. package/types/src/condition/BuiltinSelectors/index.d.ts +12 -6
  353. package/types/src/condition/Condition.d.ts +19 -1
  354. package/types/src/condition/ICondition.d.ts +296 -75
  355. package/types/src/condition/_ConditionFormula.d.ts +152 -0
  356. package/types/src/condition/_ConditionUtils.d.ts +167 -13
  357. package/types/src/conditionalFormat/ConditionalEntry.d.ts +3 -3
  358. package/types/src/conditionalFormat/ConditionalFormat.d.ts +34 -17
  359. package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +19 -8
  360. package/types/src/conditionalFormat/IConditionalFormat.d.ts +16 -13
  361. package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +2 -0
  362. package/types/src/dataTable/DataTable.d.ts +67 -0
  363. package/types/src/dataTable/DataTableCollection.d.ts +19 -0
  364. package/types/src/dataTable/IDataTable.d.ts +99 -0
  365. package/types/src/dataTable/IDataTableCollection.d.ts +18 -0
  366. package/types/src/dataTable/index.d.ts +6 -0
  367. package/types/src/dataValidation/DataValidation.d.ts +70 -4
  368. package/types/src/dataValidation/DataValidationCollection.d.ts +23 -9
  369. package/types/src/dataValidation/IDataValidation.d.ts +150 -31
  370. package/types/src/dataValidation/IDataValidationCollection.d.ts +34 -2
  371. package/types/src/date/DateUtils.d.ts +20 -0
  372. package/types/src/date/_DateUtils.d.ts +91 -7
  373. package/types/src/documentProperties/DocumentProperties.d.ts +66 -0
  374. package/types/src/documentProperties/ICustomProperty.d.ts +69 -0
  375. package/types/src/documentProperties/IDocumentProperties.d.ts +110 -0
  376. package/types/src/documentProperties/index.d.ts +3 -0
  377. package/types/src/externalBook/ExternalBookCollection.d.ts +145 -12
  378. package/types/src/externalBook/ExternalBookName.d.ts +96 -0
  379. package/types/src/externalBook/IExternalBook.d.ts +171 -19
  380. package/types/src/externalBook/IExternalBookCollection.d.ts +79 -7
  381. package/types/src/externalBook/index.d.ts +1 -0
  382. package/types/src/{lib/file → file}/file.browser.d.ts +22 -8
  383. package/types/src/{lib/file → file}/file.node.d.ts +7 -2
  384. package/types/src/fill/IEffect.d.ts +5 -5
  385. package/types/src/fill/IFill.d.ts +129 -77
  386. package/types/src/fill/IFillable.d.ts +47 -0
  387. package/types/src/fill/IStroke.d.ts +204 -64
  388. package/types/src/fill/PaintUtils.d.ts +22 -0
  389. package/types/src/fill/RectAlignment.d.ts +20 -0
  390. package/types/src/fill/_Fills.d.ts +187 -0
  391. package/types/src/fill/_Stroke.d.ts +89 -0
  392. package/types/src/fill/index.d.ts +3 -0
  393. package/types/src/filter/IFilter.d.ts +188 -5
  394. package/types/src/font/AdvanceBuilder.d.ts +59 -0
  395. package/types/src/font/AdvanceTable.d.ts +228 -0
  396. package/types/src/font/CanvasAdvanceBuilder.d.ts +54 -0
  397. package/types/src/font/FontCapture.d.ts +4 -0
  398. package/types/src/font/FontCollection.d.ts +108 -0
  399. package/types/src/font/FontPlatform.d.ts +20 -0
  400. package/types/src/font/FontUtils.d.ts +5 -0
  401. package/types/src/font/IFont.d.ts +208 -61
  402. package/types/src/font/IFontCollection.d.ts +126 -22
  403. package/types/src/font/IFontStyle.d.ts +207 -0
  404. package/types/src/font/TableFileAdvanceBuilder.d.ts +36 -0
  405. package/types/src/font/_BuiltinFontTables.d.ts +10 -0
  406. package/types/src/font/_FontUtils.d.ts +11 -4
  407. package/types/src/font/_FontsVersion.d.ts +7 -0
  408. package/types/src/font/index.d.ts +2 -1
  409. package/types/src/font/platform.browser.d.ts +15 -0
  410. package/types/src/font/platform.node.d.ts +5 -0
  411. package/types/src/group/Group.d.ts +141 -0
  412. package/types/src/group/GroupMovableCollection.d.ts +41 -0
  413. package/types/src/group/IGroup.d.ts +129 -0
  414. package/types/src/group/index.d.ts +2 -0
  415. package/types/src/history/IHistory.d.ts +21 -3
  416. package/types/src/hyperlink/IHyperlink.d.ts +20 -1
  417. package/types/src/hyperlink/_Hyperlink.d.ts +5 -1
  418. package/types/src/i18n/LanguagePack.d.ts +12 -4
  419. package/types/src/index.d.ts +8 -0
  420. package/types/src/io/AbstractBackingStore.d.ts +24 -1
  421. package/types/src/io/ArrayBackingStore.d.ts +1 -1
  422. package/types/src/io/EmbeddedPart.d.ts +20 -0
  423. package/types/src/io/IEmbeddedPart.d.ts +63 -0
  424. package/types/src/io/IWorkbookIO.d.ts +185 -18
  425. package/types/src/io/WorkbookIO.d.ts +9 -0
  426. package/types/src/io/WorkbookOrigin.d.ts +20 -11
  427. package/types/src/io/WorkbookOriginProvider.d.ts +46 -0
  428. package/types/src/io/_XmlFragment.d.ts +49 -0
  429. package/types/src/io/index.d.ts +1 -0
  430. package/types/src/license/LicenseDetails.d.ts +1 -0
  431. package/types/src/license/LicenseManager.d.ts +25 -1
  432. package/types/src/license/Types.d.ts +38 -0
  433. package/types/src/license/_Utils.d.ts +39 -0
  434. package/types/src/license/details.d.ts +24 -0
  435. package/types/src/license/license-key.d.ts +49 -2
  436. package/types/src/license/runtime.browser.d.ts +46 -0
  437. package/types/src/{lib/utils/utils.node.d.ts → license/runtime.node.d.ts} +19 -12
  438. package/types/src/listener/IListener.d.ts +23 -6
  439. package/types/src/listener/ListenerEmitter.d.ts +55 -6
  440. package/types/src/model/AbstractModel.d.ts +14 -5
  441. package/types/src/movable/AbstractMovableContent.d.ts +182 -0
  442. package/types/src/movable/CustomElement.d.ts +4 -5
  443. package/types/src/movable/ErrorContent.d.ts +49 -0
  444. package/types/src/movable/FormControl.d.ts +285 -0
  445. package/types/src/movable/GroupMember.d.ts +87 -0
  446. package/types/src/movable/ICustomElement.d.ts +7 -2
  447. package/types/src/movable/IErrorContent.d.ts +23 -0
  448. package/types/src/movable/IFormControl.d.ts +455 -0
  449. package/types/src/movable/IMovable.d.ts +405 -60
  450. package/types/src/movable/IMovableCollection.d.ts +64 -4
  451. package/types/src/movable/Movable.d.ts +161 -50
  452. package/types/src/movable/MovableCollection.d.ts +21 -10
  453. package/types/src/movable/MovableContentRegistry.d.ts +113 -0
  454. package/types/src/movable/_BuiltInContents.d.ts +14 -0
  455. package/types/src/movable/_ContentFactory.d.ts +35 -0
  456. package/types/src/movable/_DrawnBounds.d.ts +37 -0
  457. package/types/src/movable/_InsertableCollection.d.ts +39 -0
  458. package/types/src/movable/_MovableUtils.d.ts +5 -0
  459. package/types/src/movable/_PendingContent.d.ts +25 -0
  460. package/types/src/movable/_PlacementUtils.d.ts +55 -0
  461. package/types/src/movable/_RotatedFrame.d.ts +20 -0
  462. package/types/src/movable/index.d.ts +7 -1
  463. package/types/src/named/AbstractNamed.d.ts +1 -1
  464. package/types/src/named/INamed.d.ts +34 -1
  465. package/types/src/named/INamedCollection.d.ts +28 -2
  466. package/types/src/named/NamedCollection.d.ts +32 -19
  467. package/types/src/numFmt/BuiltInFormats.d.ts +20 -7
  468. package/types/src/numFmt/IFormatEngine.d.ts +2 -0
  469. package/types/src/numFmt/NumberFormatParser.d.ts +5 -0
  470. package/types/src/numFmt/NumfmtFormatEngine.d.ts +2 -0
  471. package/types/src/numFmt/_FormatCell.d.ts +11 -2
  472. package/types/src/numFmt/_NumFmtUtils.d.ts +0 -1
  473. package/types/src/numFmt/vendor/numfmt/_sheetxl.d.ts +6 -0
  474. package/types/src/outline/IOutline.d.ts +186 -0
  475. package/types/src/outline/Outline.d.ts +157 -0
  476. package/types/src/outline/index.d.ts +2 -0
  477. package/types/src/person/IPerson.d.ts +99 -0
  478. package/types/src/person/IPersonCollection.d.ts +51 -0
  479. package/types/src/person/Person.d.ts +32 -0
  480. package/types/src/person/PersonCollection.d.ts +49 -0
  481. package/types/src/person/index.d.ts +4 -0
  482. package/types/src/picture/IPicture.d.ts +131 -4
  483. package/types/src/picture/Picture.d.ts +42 -14
  484. package/types/src/pivot/IPivotTable.d.ts +72 -0
  485. package/types/src/pivot/IPivotTableCollection.d.ts +25 -0
  486. package/types/src/pivot/PivotCache.d.ts +34 -0
  487. package/types/src/pivot/PivotTable.d.ts +61 -0
  488. package/types/src/pivot/PivotTableCollection.d.ts +25 -0
  489. package/types/src/pivot/_PivotXml.d.ts +24 -0
  490. package/types/src/pivot/index.d.ts +6 -0
  491. package/types/src/primitives/CompositeRangeStats.d.ts +2 -0
  492. package/types/src/primitives/Criteria.d.ts +1 -1
  493. package/types/src/primitives/Grouping.d.ts +65 -0
  494. package/types/src/primitives/LambdaBrand.d.ts +26 -0
  495. package/types/src/primitives/PrimitiveUtils.d.ts +56 -19
  496. package/types/src/primitives/Range.d.ts +133 -25
  497. package/types/src/primitives/RangeStats.d.ts +30 -2
  498. package/types/src/primitives/ReferenceRange.d.ts +44 -0
  499. package/types/src/primitives/Runtime.d.ts +15 -2
  500. package/types/src/primitives/environment.browser.d.ts +9 -0
  501. package/types/src/primitives/environment.node.d.ts +10 -0
  502. package/types/src/primitives/stats/AggregateStats.d.ts +49 -15
  503. package/types/src/primitives/stats/Cancellation.d.ts +13 -0
  504. package/types/src/primitives/stats/FrequencyStats.d.ts +10 -1
  505. package/types/src/primitives/stats/LookupIndex.d.ts +46 -0
  506. package/types/src/primitives/stats/Ranked.d.ts +1 -1
  507. package/types/src/primitives/stats/SortedNumbers.d.ts +4 -2
  508. package/types/src/primitives/stats/index.d.ts +1 -0
  509. package/types/src/print/IPageLayout.d.ts +635 -0
  510. package/types/src/print/PageLayout.d.ts +258 -0
  511. package/types/src/print/index.d.ts +1 -1
  512. package/types/src/protectedRange/IProtectedRange.d.ts +6 -2
  513. package/types/src/protectedRange/IProtectedRangeCollection.d.ts +2 -0
  514. package/types/src/protectedRange/ProtectedRange.d.ts +1 -4
  515. package/types/src/protectedRange/ProtectedRangeCollection.d.ts +19 -8
  516. package/types/src/protection/DefaultProtection.d.ts +12 -1
  517. package/types/src/protection/IProtection.d.ts +42 -2
  518. package/types/src/protection/PasswordHasher.d.ts +13 -0
  519. package/types/src/reference/ReferenceUtils.d.ts +80 -0
  520. package/types/src/reference/index.d.ts +2 -0
  521. package/types/src/resource/IResource.d.ts +21 -1
  522. package/types/src/resource/IResourceCollection.d.ts +9 -1
  523. package/types/src/resource/ResourceCollection.d.ts +6 -6
  524. package/types/src/richData/IRichDataKind.d.ts +22 -0
  525. package/types/src/richData/RichDataRegistry.d.ts +57 -0
  526. package/types/src/richData/RichText.d.ts +59 -0
  527. package/types/src/richData/index.d.ts +3 -0
  528. package/types/src/scripting/FunctionCollection.d.ts +49 -15
  529. package/types/src/scripting/IFunctionCollection.d.ts +62 -32
  530. package/types/src/scripting/IModule.d.ts +25 -0
  531. package/types/src/scripting/IModuleCollection.d.ts +17 -0
  532. package/types/src/scripting/IScript.d.ts +30 -28
  533. package/types/src/scripting/ITypedFunction.d.ts +1 -1
  534. package/types/src/scripting/Module.d.ts +34 -6
  535. package/types/src/scripting/ModuleCollection.d.ts +17 -12
  536. package/types/src/scripting/Runtime.d.ts +15 -0
  537. package/types/src/scripting/Scripts.d.ts +3 -7
  538. package/types/src/scripting/TypedFunction.d.ts +154 -18
  539. package/types/src/scripting/_FunctionIndex.d.ts +8 -3
  540. package/types/src/scripting/_ModuleUtils.d.ts +11 -1
  541. package/types/src/scripting/_ScriptUtils.d.ts +3 -0
  542. package/types/src/scripting/declarations.browser.d.ts +10 -0
  543. package/types/src/scripting/declarations.d.ts +52 -0
  544. package/types/src/scripting/declarations.node.d.ts +9 -0
  545. package/types/src/scripting/index.d.ts +3 -0
  546. package/types/src/selection/ChartElementSelection.d.ts +39 -0
  547. package/types/src/selection/IChartElementSelection.d.ts +103 -0
  548. package/types/src/selection/IItemSelection.d.ts +131 -0
  549. package/types/src/selection/IMovableSelection.d.ts +120 -0
  550. package/types/src/selection/IRangeSelection.d.ts +13 -8
  551. package/types/src/selection/ItemSelection.d.ts +49 -0
  552. package/types/src/selection/MovableSelection.d.ts +29 -0
  553. package/types/src/selection/RangeSelection.d.ts +19 -4
  554. package/types/src/selection/index.d.ts +4 -0
  555. package/types/src/shape/GeometryPreset.d.ts +197 -0
  556. package/types/src/shape/IGeometry.d.ts +380 -0
  557. package/types/src/shape/IShape.d.ts +342 -194
  558. package/types/src/shape/IShapeStyle.d.ts +109 -0
  559. package/types/src/shape/ITextBoxStyle.d.ts +85 -0
  560. package/types/src/shape/Shape.d.ts +107 -21
  561. package/types/src/shape/ShapeStyleUtils.d.ts +66 -0
  562. package/types/src/shape/_ConnectorFrame.d.ts +32 -0
  563. package/types/src/shape/_ConnectorRoute.d.ts +33 -0
  564. package/types/src/shape/_Connectors.d.ts +108 -0
  565. package/types/src/shape/_Geometry.d.ts +14 -0
  566. package/types/src/shape/_GeometryLoader.d.ts +21 -0
  567. package/types/src/shape/_ShapeStyle.d.ts +79 -0
  568. package/types/src/shape/_builtIn/_BuiltInChunks.d.ts +10 -0
  569. package/types/src/shape/_builtIn/_BuiltInDef.d.ts +9 -0
  570. package/types/src/shape/_builtIn/arrows.d.ts +6 -0
  571. package/types/src/shape/_builtIn/basic.d.ts +6 -0
  572. package/types/src/shape/_builtIn/callouts.d.ts +6 -0
  573. package/types/src/shape/_builtIn/flowchart.d.ts +6 -0
  574. package/types/src/shape/_builtIn/lines.d.ts +6 -0
  575. package/types/src/shape/_builtIn/math.d.ts +6 -0
  576. package/types/src/shape/_builtIn/other.d.ts +6 -0
  577. package/types/src/shape/_builtIn/rectangles.d.ts +6 -0
  578. package/types/src/shape/_builtIn/starsBanners.d.ts +6 -0
  579. package/types/src/shape/geometry/_strokeEnds.d.ts +7 -0
  580. package/types/src/shape/geometry/format.d.ts +3 -0
  581. package/types/src/shape/geometry/geometry.d.ts +85 -0
  582. package/types/src/shape/geometry/guides.d.ts +54 -0
  583. package/types/src/shape/geometry/handles.d.ts +14 -0
  584. package/types/src/shape/geometry/index.d.ts +7 -0
  585. package/types/src/shape/geometry/lineEnds.d.ts +54 -0
  586. package/types/src/shape/geometry/paths.d.ts +35 -0
  587. package/types/src/shape/geometry/segments.d.ts +114 -0
  588. package/types/src/shape/index.d.ts +4 -0
  589. package/types/src/sheet/CellRegion.d.ts +43 -3
  590. package/types/src/sheet/ICellContainerOptions.d.ts +50 -0
  591. package/types/src/sheet/IOpaqueSheet.d.ts +46 -0
  592. package/types/src/sheet/ISheet.d.ts +81 -931
  593. package/types/src/sheet/IWorksheet.d.ts +1514 -0
  594. package/types/src/sheet/{ISheetCollection.d.ts → IWorksheetCollection.d.ts} +38 -16
  595. package/types/src/sheet/NamedCellRange.d.ts +17 -8
  596. package/types/src/sheet/NamedRange.d.ts +10 -2
  597. package/types/src/sheet/OpaqueSheet.d.ts +114 -0
  598. package/types/src/sheet/SheetCell.d.ts +96 -39
  599. package/types/src/sheet/SheetRange.d.ts +130 -27
  600. package/types/src/sheet/SheetRanges.d.ts +33 -18
  601. package/types/src/sheet/Worksheet.d.ts +2250 -0
  602. package/types/src/sheet/WorksheetCollection.d.ts +39 -0
  603. package/types/src/sheet/_Anomalies.d.ts +109 -0
  604. package/types/src/sheet/_AnomalyFormulaChecks.d.ts +125 -0
  605. package/types/src/sheet/_AnomalyLabelChecks.d.ts +21 -0
  606. package/types/src/sheet/_CellBuffer.d.ts +224 -0
  607. package/types/src/sheet/_CopyUtils.d.ts +13 -6
  608. package/types/src/sheet/_HeldFormula.d.ts +69 -0
  609. package/types/src/sheet/_IgnoredErrors.d.ts +46 -0
  610. package/types/src/sheet/_InvalidSheetRange.d.ts +10 -9
  611. package/types/src/sheet/_Kinds.d.ts +34 -0
  612. package/types/src/sheet/_Labels.d.ts +38 -0
  613. package/types/src/sheet/_ListenerAnchor.d.ts +104 -0
  614. package/types/src/sheet/_RangeStateSweep.d.ts +15 -0
  615. package/types/src/sheet/_ScalarListFactory.d.ts +61 -0
  616. package/types/src/sheet/_SheetAutoFillUtils.d.ts +74 -0
  617. package/types/src/sheet/_SheetAutoFitUtils.d.ts +5 -5
  618. package/types/src/sheet/_SheetChangeEvent.d.ts +72 -0
  619. package/types/src/sheet/_SheetCoords.d.ts +3 -3
  620. package/types/src/sheet/_SheetEvents.d.ts +43 -0
  621. package/types/src/sheet/_SheetFilterUtils.d.ts +51 -3
  622. package/types/src/sheet/_SheetIntents.d.ts +314 -0
  623. package/types/src/sheet/_SheetMessages.d.ts +1 -1
  624. package/types/src/sheet/_SheetMutations.d.ts +185 -66
  625. package/types/src/sheet/_SheetSortUtils.d.ts +2 -2
  626. package/types/src/sheet/_SheetStateReader.d.ts +35 -11
  627. package/types/src/sheet/_SheetStateTypes.d.ts +143 -79
  628. package/types/src/sheet/_SheetUtils.d.ts +59 -41
  629. package/types/src/sheet/_WatchAnchor.d.ts +106 -0
  630. package/types/src/sheet/clipboard/RangeClipboardItems.d.ts +4 -4
  631. package/types/src/sheet/clipboard/SheetHTMLTableParser.d.ts +3 -3
  632. package/types/src/sheet/clipboard/SheetHTMLTableWriter.d.ts +3 -3
  633. package/types/src/sheet/index.d.ts +5 -2
  634. package/types/src/sheet/spatial/HeldFormulaEntry.d.ts +36 -0
  635. package/types/src/sheet/spatial/index.d.ts +1 -0
  636. package/types/src/sheet/style/SheetCellStyle.d.ts +223 -337
  637. package/types/src/sheet/style/SheetDirectStyle.d.ts +31 -20
  638. package/types/src/sheet/style/SheetNamedStyle.d.ts +19 -17
  639. package/types/src/sheet/style/SheetTableStyle.d.ts +5 -5
  640. package/types/src/sheet/style/_DigitWidth.d.ts +7 -0
  641. package/types/src/sheet/style/_Resolvers.d.ts +17 -10
  642. package/types/src/sheet/style/_StyleUtils.d.ts +34 -40
  643. package/types/src/sheetHeader/ISheetHeader.d.ts +96 -55
  644. package/types/src/sheetHeader/SheetCellHeader.d.ts +6 -0
  645. package/types/src/sheetHeader/SheetCellHeaderRange.d.ts +2 -0
  646. package/types/src/sheetHeader/SheetCellHeaderRanges.d.ts +2 -0
  647. package/types/src/sheetHeader/SheetHeader.d.ts +48 -27
  648. package/types/src/sheetHeader/_HeaderMetrics.d.ts +37 -0
  649. package/types/src/sheetHeader/_HeaderUtils.d.ts +5 -4
  650. package/types/src/sheetProtection/{ISheetProtection.d.ts → IWorksheetProtection.d.ts} +64 -30
  651. package/types/src/sheetProtection/WorksheetProtection.d.ts +51 -0
  652. package/types/src/sheetProtection/index.d.ts +1 -1
  653. package/types/src/sheetView/{ISheetView.d.ts → IWorksheetView.d.ts} +230 -69
  654. package/types/src/sheetView/WorksheetView.d.ts +139 -0
  655. package/types/src/sheetView/_SheetViewUtils.d.ts +5 -3
  656. package/types/src/sheetView/index.d.ts +1 -1
  657. package/types/src/slicer/ISlicer.d.ts +304 -17
  658. package/types/src/slicer/ISlicerStyle.d.ts +109 -0
  659. package/types/src/slicer/Slicer.d.ts +128 -13
  660. package/types/src/slicer/SlicerStyle.d.ts +25 -0
  661. package/types/src/slicer/_BuiltInSlicerStyles.d.ts +13 -0
  662. package/types/src/slicer/_SlicerUtils.d.ts +30 -0
  663. package/types/src/slicer/index.d.ts +1 -0
  664. package/types/src/sort/ISort.d.ts +39 -7
  665. package/types/src/string/IStringCollection.d.ts +5 -0
  666. package/types/src/string/StringCollection.d.ts +6 -6
  667. package/types/src/style/{IStyle.d.ts → ICellStyle.d.ts} +117 -85
  668. package/types/src/style/INamedStyleCollection.d.ts +72 -0
  669. package/types/src/style/ISlicerStyleCollection.d.ts +77 -0
  670. package/types/src/style/IStyleCollection.d.ts +91 -60
  671. package/types/src/style/ITableStyleCollection.d.ts +89 -0
  672. package/types/src/style/NamedStyleCollection.d.ts +39 -0
  673. package/types/src/style/SlicerStyleCollection.d.ts +46 -0
  674. package/types/src/style/StyleCollection.d.ts +81 -26
  675. package/types/src/style/TableStyleCollection.d.ts +49 -0
  676. package/types/src/style/_BuiltInStyleDefs.d.ts +9 -8
  677. package/types/src/style/_BuiltInStyleNames.d.ts +2 -2
  678. package/types/src/style/index.d.ts +7 -1
  679. package/types/src/table/AnchoredTable.d.ts +723 -78
  680. package/types/src/table/AutoTable.d.ts +8 -6
  681. package/types/src/table/ITable.d.ts +289 -49
  682. package/types/src/table/ITableCollection.d.ts +12 -0
  683. package/types/src/table/ITableStyle.d.ts +37 -37
  684. package/types/src/table/TableCollection.d.ts +19 -8
  685. package/types/src/table/_FilterField.d.ts +19 -6
  686. package/types/src/table/_NamedTable.d.ts +20 -4
  687. package/types/src/table/_NamedTableSource.d.ts +3 -2
  688. package/types/src/table/_SortField.d.ts +2 -0
  689. package/types/src/table/_TableColumn.d.ts +13 -2
  690. package/types/src/table/_TableMessages.d.ts +1 -0
  691. package/types/src/table/_TableUtils.d.ts +40 -0
  692. package/types/src/text/Bullet.d.ts +4 -0
  693. package/types/src/text/IText.d.ts +150 -15
  694. package/types/src/text/ITextFrame.d.ts +110 -1
  695. package/types/src/text/TextBoxAlignment.d.ts +25 -16
  696. package/types/src/text/TextEngine.d.ts +34 -0
  697. package/types/src/text/TextFrame.d.ts +8 -2
  698. package/types/src/text/TextLine.d.ts +4 -0
  699. package/types/src/text/TextParagraph.d.ts +4 -0
  700. package/types/src/text/TextRotation.d.ts +3 -3
  701. package/types/src/text/TextRun.d.ts +12 -2
  702. package/types/src/text/TextStacked.d.ts +83 -0
  703. package/types/src/text/TextWrapper.d.ts +32 -26
  704. package/types/src/text/_TextUtils.d.ts +5 -5
  705. package/types/src/text/_TextWrapperFallback.d.ts +49 -0
  706. package/types/src/text/impl/TabStrategy.d.ts +3 -1
  707. package/types/src/text/index.d.ts +1 -0
  708. package/types/src/text/richtext/IRichText.d.ts +50 -0
  709. package/types/src/text/richtext/index.d.ts +1 -1
  710. package/types/src/theme/ITheme.d.ts +153 -11
  711. package/types/src/theme/IThemeCollection.d.ts +2 -0
  712. package/types/src/theme/ThemeCollection.d.ts +16 -7
  713. package/types/src/theme/_OfficeFontScheme.d.ts +8 -0
  714. package/types/src/theme/_OfficeFormatScheme.d.ts +3 -0
  715. package/types/src/transaction/ITransaction.d.ts +277 -45
  716. package/types/src/transaction/Transaction.d.ts +108 -11
  717. package/types/src/transaction/TransactionUndoManager.d.ts +4 -1
  718. package/types/src/transaction/_BatchHandle.d.ts +118 -0
  719. package/types/src/type/AbstractCollection.d.ts +92 -0
  720. package/types/src/type/ICollection.d.ts +131 -1
  721. package/types/src/type/IProperties.d.ts +1 -1
  722. package/types/src/type/ITypes.d.ts +9 -7
  723. package/types/src/type/index.d.ts +1 -0
  724. package/types/src/utils/_CSSUtils.d.ts +4 -4
  725. package/types/src/wasm/_fontsWasm.d.ts +7 -0
  726. package/types/src/wasm/_sdkWasm.d.ts +7 -0
  727. package/types/src/wasm/fontsWasm.d.ts +32 -0
  728. package/types/src/wasm/index.d.ts +3 -0
  729. package/types/src/wasm/loader.browser.d.ts +9 -0
  730. package/types/src/wasm/loader.node.d.ts +9 -0
  731. package/types/src/wasm/sdkWasm.d.ts +32 -0
  732. package/types/src/workbook/IWorkbook.d.ts +404 -73
  733. package/types/src/workbook/Workbook.d.ts +196 -28
  734. package/types/src/workbook/WorkbookRange.d.ts +2 -2
  735. package/types/src/workbook/WorkbookRanges.d.ts +2 -2
  736. package/types/src/workbook/_WorkbookIntents.d.ts +36 -0
  737. package/types/src/workbook/_WorkbookMessages.d.ts +5 -0
  738. package/types/src/workbookProtection/IWorkbookProtection.d.ts +7 -0
  739. package/types/src/workbookProtection/WorkbookProtection.d.ts +3 -0
  740. package/types/src/workbookView/IWorkbookView.d.ts +94 -0
  741. package/types/src/workbookView/WorkbookView.d.ts +26 -0
  742. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  743. package/browser/cjs/BatsV2UUraVDCRXm.cjs +0 -57
  744. package/browser/cjs/CUz53T65cRGQRgvv.cjs +0 -33
  745. package/browser/cjs/DU0kYUtdFa3jK-im.cjs +0 -1
  746. package/browser/cjs/Dv3x6zut1ZRUt3IF.cjs +0 -10
  747. package/browser/cjs/Dv4yIPLV98M5zLHa.cjs +0 -1
  748. package/browser/cjs/a0Z-SXs_N71CtqYb.cjs +0 -1
  749. package/browser/cjs/index.cjs +0 -3
  750. package/browser/esm/6JKSOvc5czaQB2Bj.mjs +0 -109
  751. package/browser/esm/BtuJ9AGzeURtAsGo.mjs +0 -51241
  752. package/browser/esm/DGU6sM25u0EWCKl1.mjs +0 -824
  753. package/node/esm/-pxdn3M3tc6PLHs7.mjs +0 -114
  754. package/node/esm/0n5bslM9jhO1JnI2.mjs +0 -843
  755. package/types/src/cellRange/_GraphNode.d.ts +0 -38
  756. package/types/src/collections/OverlappingRangeIterator.d.ts +0 -91
  757. package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +0 -12
  758. package/types/src/dataValidation/_Utils.d.ts +0 -10
  759. package/types/src/font/CanvasFontMeasurer.d.ts +0 -25
  760. package/types/src/font/FontKitFontMeasurer.d.ts +0 -11
  761. package/types/src/font/SimpleFontMeasurer.d.ts +0 -4
  762. package/types/src/lib/utils/_Utils.d.ts +0 -27
  763. package/types/src/lib/utils/utils.browser.d.ts +0 -33
  764. package/types/src/movable/IGroup.d.ts +0 -30
  765. package/types/src/movable/IMovableSelection.d.ts +0 -49
  766. package/types/src/print/IPrint.d.ts +0 -234
  767. package/types/src/sheet/Sheet.d.ts +0 -1107
  768. package/types/src/sheet/SheetCollection.d.ts +0 -18
  769. package/types/src/sheet/listener/RangesListener.d.ts +0 -32
  770. package/types/src/sheet/listener/RangesListenerEntry.d.ts +0 -19
  771. package/types/src/sheet/listener/index.d.ts +0 -3
  772. package/types/src/sheetProtection/SheetProtection.d.ts +0 -39
  773. package/types/src/sheetView/SheetView.d.ts +0 -113
  774. package/types/src/text/richtext/IStyledFont.d.ts +0 -330
  775. /package/types/src/{lib/utils → license}/banner.d.ts +0 -0
@@ -1,25 +1,25 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.1
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.11
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { nt as e } from "./BtuJ9AGzeURtAsGo.mjs";
8
- import { FormulaError as t } from "@sheetxl/primitives";
9
- function n(e) {
7
+ import { An as e, Bn as t, Dn as n, Fn as r, Gn as i, Hn as a, In as o, Jn as s, Kn as c, Ln as l, Nn as u, Pn as d, Rn as f, Tn as p, Un as m, Vn as h, Wn as g, Xn as _, Yn as v, Zn as y, dr as b, ir as x, jn as S, kn as ee, nr as te, or as C, qn as w, rr as ne, sr as re, zn as ie } from "./C16ycKja6zG0crV_.mjs";
8
+ import { FormulaError as T } from "@sheetxl/primitives";
9
+ function E(e) {
10
10
  console && console.error && console.error(`Error: ${e}`);
11
11
  }
12
- function r(e) {
12
+ function D(e) {
13
13
  console && console.warn && console.warn(`Warning: ${e}`);
14
14
  }
15
- function i(e) {
15
+ function ae(e) {
16
16
  let t = (/* @__PURE__ */ new Date()).getTime(), n = e();
17
17
  return {
18
18
  time: (/* @__PURE__ */ new Date()).getTime() - t,
19
19
  value: n
20
20
  };
21
21
  }
22
- function a(e) {
22
+ function O(e) {
23
23
  function t() {}
24
24
  t.prototype = e;
25
25
  let n = new t();
@@ -28,7 +28,7 @@ function a(e) {
28
28
  }
29
29
  return r(), r(), e;
30
30
  }
31
- var o = class {
31
+ var k = class {
32
32
  get definition() {
33
33
  return this._definition;
34
34
  }
@@ -43,9 +43,9 @@ var o = class {
43
43
  t.accept(e);
44
44
  });
45
45
  }
46
- }, s = class extends o {
46
+ }, A = class extends k {
47
47
  constructor(e) {
48
- super([]), this.idx = 1, Object.assign(this, v(e));
48
+ super([]), this.idx = 1, Object.assign(this, B(e));
49
49
  }
50
50
  set definition(e) {}
51
51
  get definition() {
@@ -54,35 +54,35 @@ var o = class {
54
54
  accept(e) {
55
55
  e.visit(this);
56
56
  }
57
- }, c = class extends o {
57
+ }, j = class extends k {
58
58
  constructor(e) {
59
- super(e.definition), this.orgText = "", Object.assign(this, v(e));
59
+ super(e.definition), this.orgText = "", Object.assign(this, B(e));
60
60
  }
61
- }, l = class extends o {
61
+ }, M = class extends k {
62
62
  constructor(e) {
63
- super(e.definition), this.ignoreAmbiguities = !1, Object.assign(this, v(e));
63
+ super(e.definition), this.ignoreAmbiguities = !1, Object.assign(this, B(e));
64
64
  }
65
- }, u = class extends o {
65
+ }, N = class extends k {
66
66
  constructor(e) {
67
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
67
+ super(e.definition), this.idx = 1, Object.assign(this, B(e));
68
68
  }
69
- }, d = class extends o {
69
+ }, P = class extends k {
70
70
  constructor(e) {
71
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
71
+ super(e.definition), this.idx = 1, Object.assign(this, B(e));
72
72
  }
73
- }, f = class extends o {
73
+ }, F = class extends k {
74
74
  constructor(e) {
75
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
75
+ super(e.definition), this.idx = 1, Object.assign(this, B(e));
76
76
  }
77
- }, p = class extends o {
77
+ }, I = class extends k {
78
78
  constructor(e) {
79
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
79
+ super(e.definition), this.idx = 1, Object.assign(this, B(e));
80
80
  }
81
- }, m = class extends o {
81
+ }, L = class extends k {
82
82
  constructor(e) {
83
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
83
+ super(e.definition), this.idx = 1, Object.assign(this, B(e));
84
84
  }
85
- }, h = class extends o {
85
+ }, R = class extends k {
86
86
  get definition() {
87
87
  return this._definition;
88
88
  }
@@ -90,21 +90,21 @@ var o = class {
90
90
  this._definition = e;
91
91
  }
92
92
  constructor(e) {
93
- super(e.definition), this.idx = 1, this.ignoreAmbiguities = !1, this.hasPredicates = !1, Object.assign(this, v(e));
93
+ super(e.definition), this.idx = 1, this.ignoreAmbiguities = !1, this.hasPredicates = !1, Object.assign(this, B(e));
94
94
  }
95
- }, g = class {
95
+ }, z = class {
96
96
  constructor(e) {
97
- this.idx = 1, Object.assign(this, v(e));
97
+ this.idx = 1, Object.assign(this, B(e));
98
98
  }
99
99
  accept(e) {
100
100
  e.visit(this);
101
101
  }
102
102
  };
103
- function _(e) {
103
+ function oe(e) {
104
104
  function t(e) {
105
- return e.map(_);
105
+ return e.map(oe);
106
106
  }
107
- if (e instanceof s) {
107
+ if (e instanceof A) {
108
108
  let t = {
109
109
  type: "NonTerminal",
110
110
  name: e.nonTerminalName,
@@ -112,43 +112,43 @@ function _(e) {
112
112
  };
113
113
  return typeof e.label == "string" && (t.label = e.label), t;
114
114
  }
115
- if (e instanceof l) return {
115
+ if (e instanceof M) return {
116
116
  type: "Alternative",
117
117
  definition: t(e.definition)
118
118
  };
119
- if (e instanceof u) return {
119
+ if (e instanceof N) return {
120
120
  type: "Option",
121
121
  idx: e.idx,
122
122
  definition: t(e.definition)
123
123
  };
124
- if (e instanceof d) return {
124
+ if (e instanceof P) return {
125
125
  type: "RepetitionMandatory",
126
126
  idx: e.idx,
127
127
  definition: t(e.definition)
128
128
  };
129
- if (e instanceof f) return {
129
+ if (e instanceof F) return {
130
130
  type: "RepetitionMandatoryWithSeparator",
131
131
  idx: e.idx,
132
- separator: _(new g({ terminalType: e.separator })),
132
+ separator: oe(new z({ terminalType: e.separator })),
133
133
  definition: t(e.definition)
134
134
  };
135
- if (e instanceof m) return {
135
+ if (e instanceof L) return {
136
136
  type: "RepetitionWithSeparator",
137
137
  idx: e.idx,
138
- separator: _(new g({ terminalType: e.separator })),
138
+ separator: oe(new z({ terminalType: e.separator })),
139
139
  definition: t(e.definition)
140
140
  };
141
- if (e instanceof p) return {
141
+ if (e instanceof I) return {
142
142
  type: "Repetition",
143
143
  idx: e.idx,
144
144
  definition: t(e.definition)
145
145
  };
146
- if (e instanceof h) return {
146
+ if (e instanceof R) return {
147
147
  type: "Alternation",
148
148
  idx: e.idx,
149
149
  definition: t(e.definition)
150
150
  };
151
- if (e instanceof g) {
151
+ if (e instanceof z) {
152
152
  let t = {
153
153
  type: "Terminal",
154
154
  name: e.terminalType.name,
@@ -159,7 +159,7 @@ function _(e) {
159
159
  let i = e.terminalType.PATTERN;
160
160
  return e.terminalType.PATTERN && (t.pattern = i instanceof RegExp ? i.source : i), t;
161
161
  }
162
- if (e instanceof c) return {
162
+ if (e instanceof j) return {
163
163
  type: "Rule",
164
164
  name: e.name,
165
165
  orgText: e.orgText,
@@ -168,23 +168,23 @@ function _(e) {
168
168
  throw Error("non exhaustive match");
169
169
  var n, r;
170
170
  }
171
- function v(e) {
171
+ function B(e) {
172
172
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
173
173
  }
174
- var y = class {
174
+ var se = class {
175
175
  visit(e) {
176
176
  let t = e;
177
177
  switch (t.constructor) {
178
- case s: return this.visitNonTerminal(t);
179
- case l: return this.visitAlternative(t);
180
- case u: return this.visitOption(t);
181
- case d: return this.visitRepetitionMandatory(t);
182
- case f: return this.visitRepetitionMandatoryWithSeparator(t);
183
- case m: return this.visitRepetitionWithSeparator(t);
184
- case p: return this.visitRepetition(t);
185
- case h: return this.visitAlternation(t);
186
- case g: return this.visitTerminal(t);
187
- case c: return this.visitRule(t);
178
+ case A: return this.visitNonTerminal(t);
179
+ case M: return this.visitAlternative(t);
180
+ case N: return this.visitOption(t);
181
+ case P: return this.visitRepetitionMandatory(t);
182
+ case F: return this.visitRepetitionMandatoryWithSeparator(t);
183
+ case L: return this.visitRepetitionWithSeparator(t);
184
+ case I: return this.visitRepetition(t);
185
+ case R: return this.visitAlternation(t);
186
+ case z: return this.visitTerminal(t);
187
+ case j: return this.visitRule(t);
188
188
  default: throw Error("non exhaustive match");
189
189
  }
190
190
  }
@@ -199,34 +199,34 @@ var y = class {
199
199
  visitTerminal(e) {}
200
200
  visitRule(e) {}
201
201
  };
202
- function b(e, t = []) {
203
- return e instanceof u || e instanceof p || e instanceof m || (e instanceof h ? e.definition.some((e) => b(e, t)) : !(e instanceof s && t.includes(e)) && e instanceof o && (e instanceof s && t.push(e), e.definition.every((e) => b(e, t))));
202
+ function ce(e, t = []) {
203
+ return e instanceof N || e instanceof I || e instanceof L || (e instanceof R ? e.definition.some((e) => ce(e, t)) : !(e instanceof A && t.includes(e)) && e instanceof k && (e instanceof A && t.push(e), e.definition.every((e) => ce(e, t))));
204
204
  }
205
- function x(e) {
206
- if (e instanceof s) return "SUBRULE";
207
- if (e instanceof u) return "OPTION";
208
- if (e instanceof h) return "OR";
209
- if (e instanceof d) return "AT_LEAST_ONE";
210
- if (e instanceof f) return "AT_LEAST_ONE_SEP";
211
- if (e instanceof m) return "MANY_SEP";
212
- if (e instanceof p) return "MANY";
213
- if (e instanceof g) return "CONSUME";
205
+ function V(e) {
206
+ if (e instanceof A) return "SUBRULE";
207
+ if (e instanceof N) return "OPTION";
208
+ if (e instanceof R) return "OR";
209
+ if (e instanceof P) return "AT_LEAST_ONE";
210
+ if (e instanceof F) return "AT_LEAST_ONE_SEP";
211
+ if (e instanceof L) return "MANY_SEP";
212
+ if (e instanceof I) return "MANY";
213
+ if (e instanceof z) return "CONSUME";
214
214
  throw Error("non exhaustive match");
215
215
  }
216
- var S = class {
216
+ var le = class {
217
217
  walk(e, t = []) {
218
218
  e.definition.forEach((n, r) => {
219
219
  let i = e.definition.slice(r + 1);
220
- if (n instanceof s) this.walkProdRef(n, i, t);
221
- else if (n instanceof g) this.walkTerminal(n, i, t);
222
- else if (n instanceof l) this.walkFlat(n, i, t);
223
- else if (n instanceof u) this.walkOption(n, i, t);
224
- else if (n instanceof d) this.walkAtLeastOne(n, i, t);
225
- else if (n instanceof f) this.walkAtLeastOneSep(n, i, t);
226
- else if (n instanceof m) this.walkManySep(n, i, t);
227
- else if (n instanceof p) this.walkMany(n, i, t);
220
+ if (n instanceof A) this.walkProdRef(n, i, t);
221
+ else if (n instanceof z) this.walkTerminal(n, i, t);
222
+ else if (n instanceof M) this.walkFlat(n, i, t);
223
+ else if (n instanceof N) this.walkOption(n, i, t);
224
+ else if (n instanceof P) this.walkAtLeastOne(n, i, t);
225
+ else if (n instanceof F) this.walkAtLeastOneSep(n, i, t);
226
+ else if (n instanceof L) this.walkManySep(n, i, t);
227
+ else if (n instanceof I) this.walkMany(n, i, t);
228
228
  else {
229
- if (!(n instanceof h)) throw Error("non exhaustive match");
229
+ if (!(n instanceof R)) throw Error("non exhaustive match");
230
230
  this.walkOr(n, i, t);
231
231
  }
232
232
  });
@@ -242,51 +242,51 @@ var S = class {
242
242
  this.walk(e, r);
243
243
  }
244
244
  walkAtLeastOne(e, t, n) {
245
- let r = [new u({ definition: e.definition })].concat(t, n);
245
+ let r = [new N({ definition: e.definition })].concat(t, n);
246
246
  this.walk(e, r);
247
247
  }
248
248
  walkAtLeastOneSep(e, t, n) {
249
- let r = C(e, t, n);
249
+ let r = ue(e, t, n);
250
250
  this.walk(e, r);
251
251
  }
252
252
  walkMany(e, t, n) {
253
- let r = [new u({ definition: e.definition })].concat(t, n);
253
+ let r = [new N({ definition: e.definition })].concat(t, n);
254
254
  this.walk(e, r);
255
255
  }
256
256
  walkManySep(e, t, n) {
257
- let r = C(e, t, n);
257
+ let r = ue(e, t, n);
258
258
  this.walk(e, r);
259
259
  }
260
260
  walkOr(e, t, n) {
261
261
  let r = t.concat(n);
262
262
  e.definition.forEach((e) => {
263
- let t = new l({ definition: [e] });
263
+ let t = new M({ definition: [e] });
264
264
  this.walk(t, r);
265
265
  });
266
266
  }
267
267
  };
268
- function C(e, t, n) {
269
- return [new u({ definition: [new g({ terminalType: e.separator })].concat(e.definition) })].concat(t, n);
268
+ function ue(e, t, n) {
269
+ return [new N({ definition: [new z({ terminalType: e.separator })].concat(e.definition) })].concat(t, n);
270
270
  }
271
- function w(e) {
272
- if (e instanceof s) return w(e.referencedRule);
273
- if (e instanceof g) return [e.terminalType];
271
+ function de(e) {
272
+ if (e instanceof A) return de(e.referencedRule);
273
+ if (e instanceof z) return [e.terminalType];
274
274
  if (function(e) {
275
- return e instanceof l || e instanceof u || e instanceof p || e instanceof d || e instanceof f || e instanceof m || e instanceof g || e instanceof c;
275
+ return e instanceof M || e instanceof N || e instanceof I || e instanceof P || e instanceof F || e instanceof L || e instanceof z || e instanceof j;
276
276
  }(e)) return function(e) {
277
277
  let t = [], n = e.definition, r, i = 0, a = n.length > i, o = !0;
278
- for (; a && o;) r = n[i], o = b(r), t = t.concat(w(r)), i += 1, a = n.length > i;
278
+ for (; a && o;) r = n[i], o = ce(r), t = t.concat(de(r)), i += 1, a = n.length > i;
279
279
  return [...new Set(t)];
280
280
  }(e);
281
281
  if (function(e) {
282
- return e instanceof h;
282
+ return e instanceof R;
283
283
  }(e)) return function(e) {
284
- let t = e.definition.map((e) => w(e));
284
+ let t = e.definition.map((e) => de(e));
285
285
  return [...new Set(t.flat())];
286
286
  }(e);
287
287
  throw Error("non exhaustive match");
288
288
  }
289
- var T = "_~IN~_", E = class extends S {
289
+ var fe = "_~IN~_", pe = class extends le {
290
290
  constructor(e) {
291
291
  super(), this.topProd = e, this.follows = {};
292
292
  }
@@ -295,67 +295,67 @@ var T = "_~IN~_", E = class extends S {
295
295
  }
296
296
  walkTerminal(e, t, n) {}
297
297
  walkProdRef(e, t, n) {
298
- let r = (i = e.referencedRule, a = e.idx, i.name + a + T + this.topProd.name);
298
+ let r = (i = e.referencedRule, a = e.idx, i.name + a + fe + this.topProd.name);
299
299
  var i, a;
300
- let o = w(new l({ definition: t.concat(n) }));
300
+ let o = de(new M({ definition: t.concat(n) }));
301
301
  this.follows[r] = o;
302
302
  }
303
303
  };
304
- function D(e) {
304
+ function H(e) {
305
305
  return e.charCodeAt(0);
306
306
  }
307
- function O(e, t) {
307
+ function me(e, t) {
308
308
  Array.isArray(e) ? e.forEach(function(e) {
309
309
  t.push(e);
310
310
  }) : t.push(e);
311
311
  }
312
- function k(e, t) {
312
+ function U(e, t) {
313
313
  if (!0 === e[t]) throw "duplicate flag " + t;
314
314
  e[t], e[t] = !0;
315
315
  }
316
- function A(e) {
316
+ function W(e) {
317
317
  if (e === void 0) throw Error("Internal Error - Should never get here!");
318
318
  return !0;
319
319
  }
320
- function j() {
320
+ function he() {
321
321
  throw Error("Internal Error - Should never get here!");
322
322
  }
323
- function M(e) {
323
+ function ge(e) {
324
324
  return e.type === "Character";
325
325
  }
326
- var N = [];
327
- for (let e = D("0"); e <= D("9"); e++) N.push(e);
328
- var P = [D("_")].concat(N);
329
- for (let e = D("a"); e <= D("z"); e++) P.push(e);
330
- for (let e = D("A"); e <= D("Z"); e++) P.push(e);
331
- var ee = [
332
- D(" "),
333
- D("\f"),
334
- D("\n"),
335
- D("\r"),
336
- D(" "),
337
- D("\v"),
338
- D(" "),
339
- D("\xA0"),
340
- D(" "),
341
- D(" "),
342
- D(" "),
343
- D(" "),
344
- D(" "),
345
- D(" "),
346
- D(" "),
347
- D(" "),
348
- D(" "),
349
- D(" "),
350
- D(" "),
351
- D(" "),
352
- D("\u2028"),
353
- D("\u2029"),
354
- D(" "),
355
- D(" "),
356
- D(" "),
357
- D("")
358
- ], te = /[0-9a-fA-F]/, F = /[0-9]/, ne = /[1-9]/, I = class {
326
+ var _e = [];
327
+ for (let e = H("0"); e <= H("9"); e++) _e.push(e);
328
+ var ve = [H("_")].concat(_e);
329
+ for (let e = H("a"); e <= H("z"); e++) ve.push(e);
330
+ for (let e = H("A"); e <= H("Z"); e++) ve.push(e);
331
+ var ye = [
332
+ H(" "),
333
+ H("\f"),
334
+ H("\n"),
335
+ H("\r"),
336
+ H(" "),
337
+ H("\v"),
338
+ H(" "),
339
+ H("\xA0"),
340
+ H(" "),
341
+ H(" "),
342
+ H(" "),
343
+ H(" "),
344
+ H(" "),
345
+ H(" "),
346
+ H(" "),
347
+ H(" "),
348
+ H(" "),
349
+ H(" "),
350
+ H(" "),
351
+ H(" "),
352
+ H("\u2028"),
353
+ H("\u2029"),
354
+ H(" "),
355
+ H(" "),
356
+ H(" "),
357
+ H("")
358
+ ], be = /[0-9a-fA-F]/, xe = /[0-9]/, Se = /[1-9]/, Ce = class {
359
359
  visitChildren(e) {
360
360
  for (let t in e) {
361
361
  let n = e[t];
@@ -435,7 +435,7 @@ var ee = [
435
435
  visitGroup(e) {}
436
436
  visitGroupBackReference(e) {}
437
437
  visitQuantifier(e) {}
438
- }, L = {}, re = new class {
438
+ }, we = {}, Te = new class {
439
439
  constructor() {
440
440
  this.idx = 0, this.input = "", this.groupIdx = 0;
441
441
  }
@@ -467,18 +467,18 @@ var ee = [
467
467
  };
468
468
  for (; this.isRegExpFlag();) switch (this.popChar()) {
469
469
  case "g":
470
- k(n, "global");
470
+ U(n, "global");
471
471
  break;
472
472
  case "i":
473
- k(n, "ignoreCase");
473
+ U(n, "ignoreCase");
474
474
  break;
475
475
  case "m":
476
- k(n, "multiLine");
476
+ U(n, "multiLine");
477
477
  break;
478
478
  case "u":
479
- k(n, "unicode");
479
+ U(n, "unicode");
480
480
  break;
481
- case "y": k(n, "sticky");
481
+ case "y": U(n, "sticky");
482
482
  }
483
483
  if (this.idx !== this.input.length) throw Error("Redundant input: " + this.input.substring(this.idx));
484
484
  return {
@@ -548,7 +548,7 @@ var ee = [
548
548
  case "!": t = "NegativeLookbehind";
549
549
  }
550
550
  }
551
- A(t);
551
+ W(t);
552
552
  let n = this.disjunction();
553
553
  return this.consumeChar(")"), {
554
554
  type: t,
@@ -556,7 +556,7 @@ var ee = [
556
556
  loc: this.loc(e)
557
557
  };
558
558
  }
559
- return j();
559
+ return he();
560
560
  }
561
561
  quantifier(e = !1) {
562
562
  let t, n = this.idx;
@@ -564,13 +564,13 @@ var ee = [
564
564
  case "*":
565
565
  t = {
566
566
  atLeast: 0,
567
- atMost: Infinity
567
+ atMost: 1 / 0
568
568
  };
569
569
  break;
570
570
  case "+":
571
571
  t = {
572
572
  atLeast: 1,
573
- atMost: Infinity
573
+ atMost: 1 / 0
574
574
  };
575
575
  break;
576
576
  case "?":
@@ -595,13 +595,13 @@ var ee = [
595
595
  atMost: e
596
596
  }) : t = {
597
597
  atLeast: n,
598
- atMost: Infinity
598
+ atMost: 1 / 0
599
599
  }, this.consumeChar("}");
600
600
  }
601
601
  if (!0 === e && t === void 0) return;
602
- A(t);
602
+ W(t);
603
603
  }
604
- if (!0 !== e || t !== void 0) return A(t) ? (this.peekChar(0) === "?" ? (this.consumeChar("?"), t.greedy = !1) : t.greedy = !0, t.type = "Quantifier", t.loc = this.loc(n), t) : void 0;
604
+ if (!0 !== e || t !== void 0) return W(t) ? (this.peekChar(0) === "?" ? (this.consumeChar("?"), t.greedy = !1) : t.greedy = !0, t.type = "Quantifier", t.loc = this.loc(n), t) : void 0;
605
605
  }
606
606
  atom() {
607
607
  let e, t = this.idx;
@@ -617,17 +617,17 @@ var ee = [
617
617
  break;
618
618
  case "(": e = this.group();
619
619
  }
620
- return e === void 0 && this.isPatternCharacter() && (e = this.patternCharacter()), A(e) ? (e.loc = this.loc(t), this.isQuantifier() && (e.quantifier = this.quantifier()), e) : j();
620
+ return e === void 0 && this.isPatternCharacter() && (e = this.patternCharacter()), W(e) ? (e.loc = this.loc(t), this.isQuantifier() && (e.quantifier = this.quantifier()), e) : he();
621
621
  }
622
622
  dotAll() {
623
623
  return this.consumeChar("."), {
624
624
  type: "Set",
625
625
  complement: !0,
626
626
  value: [
627
- D("\n"),
628
- D("\r"),
629
- D("\u2028"),
630
- D("\u2029")
627
+ H("\n"),
628
+ H("\r"),
629
+ H("\u2028"),
630
+ H("\u2029")
631
631
  ]
632
632
  };
633
633
  }
@@ -670,49 +670,49 @@ var ee = [
670
670
  let e, t = !1;
671
671
  switch (this.popChar()) {
672
672
  case "d":
673
- e = N;
673
+ e = _e;
674
674
  break;
675
675
  case "D":
676
- e = N, t = !0;
676
+ e = _e, t = !0;
677
677
  break;
678
678
  case "s":
679
- e = ee;
679
+ e = ye;
680
680
  break;
681
681
  case "S":
682
- e = ee, t = !0;
682
+ e = ye, t = !0;
683
683
  break;
684
684
  case "w":
685
- e = P;
685
+ e = ve;
686
686
  break;
687
- case "W": e = P, t = !0;
687
+ case "W": e = ve, t = !0;
688
688
  }
689
- return A(e) ? {
689
+ return W(e) ? {
690
690
  type: "Set",
691
691
  value: e,
692
692
  complement: t
693
- } : j();
693
+ } : he();
694
694
  }
695
695
  controlEscapeAtom() {
696
696
  let e;
697
697
  switch (this.popChar()) {
698
698
  case "f":
699
- e = D("\f");
699
+ e = H("\f");
700
700
  break;
701
701
  case "n":
702
- e = D("\n");
702
+ e = H("\n");
703
703
  break;
704
704
  case "r":
705
- e = D("\r");
705
+ e = H("\r");
706
706
  break;
707
707
  case "t":
708
- e = D(" ");
708
+ e = H(" ");
709
709
  break;
710
- case "v": e = D("\v");
710
+ case "v": e = H("\v");
711
711
  }
712
- return A(e) ? {
712
+ return W(e) ? {
713
713
  type: "Character",
714
714
  value: e
715
- } : j();
715
+ } : he();
716
716
  }
717
717
  controlLetterEscapeAtom() {
718
718
  this.consumeChar("c");
@@ -726,7 +726,7 @@ var ee = [
726
726
  nulCharacterAtom() {
727
727
  return this.consumeChar("0"), {
728
728
  type: "Character",
729
- value: D("\0")
729
+ value: H("\0")
730
730
  };
731
731
  }
732
732
  hexEscapeSequenceAtom() {
@@ -738,7 +738,7 @@ var ee = [
738
738
  identityEscapeAtom() {
739
739
  return {
740
740
  type: "Character",
741
- value: D(this.popChar())
741
+ value: H(this.popChar())
742
742
  };
743
743
  }
744
744
  classPatternCharacterAtom() {
@@ -751,7 +751,7 @@ var ee = [
751
751
  case "]": throw Error("TBD");
752
752
  default: return {
753
753
  type: "Character",
754
- value: D(this.popChar())
754
+ value: H(this.popChar())
755
755
  };
756
756
  }
757
757
  }
@@ -759,17 +759,17 @@ var ee = [
759
759
  let e = [], t = !1;
760
760
  for (this.consumeChar("["), this.peekChar(0) === "^" && (this.consumeChar("^"), t = !0); this.isClassAtom();) {
761
761
  let t = this.classAtom();
762
- if (t.type, M(t) && this.isRangeDash()) {
762
+ if (t.type, ge(t) && this.isRangeDash()) {
763
763
  this.consumeChar("-");
764
764
  let n = this.classAtom();
765
- if (n.type, M(n)) {
765
+ if (n.type, ge(n)) {
766
766
  if (n.value < t.value) throw Error("Range out of order in character class");
767
767
  e.push({
768
768
  from: t.value,
769
769
  to: n.value
770
770
  });
771
- } else O(t.value, e), e.push(D("-")), O(n.value, e);
772
- } else O(t.value, e);
771
+ } else me(t.value, e), e.push(H("-")), me(n.value, e);
772
+ } else me(t.value, e);
773
773
  }
774
774
  return this.consumeChar("]"), {
775
775
  type: "Set",
@@ -792,7 +792,7 @@ var ee = [
792
792
  switch (this.consumeChar("\\"), this.peekChar()) {
793
793
  case "b": return this.consumeChar("b"), {
794
794
  type: "Character",
795
- value: D("\b")
795
+ value: H("\b")
796
796
  };
797
797
  case "d":
798
798
  case "D":
@@ -826,14 +826,14 @@ var ee = [
826
826
  }
827
827
  positiveInteger() {
828
828
  let e = this.popChar();
829
- if (!1 === ne.test(e)) throw Error("Expecting a positive integer");
830
- for (; F.test(this.peekChar(0));) e += this.popChar();
829
+ if (!1 === Se.test(e)) throw Error("Expecting a positive integer");
830
+ for (; xe.test(this.peekChar(0));) e += this.popChar();
831
831
  return parseInt(e, 10);
832
832
  }
833
833
  integerIncludingZero() {
834
834
  let e = this.popChar();
835
- if (!1 === F.test(e)) throw Error("Expecting an integer");
836
- for (; F.test(this.peekChar(0));) e += this.popChar();
835
+ if (!1 === xe.test(e)) throw Error("Expecting an integer");
836
+ for (; xe.test(this.peekChar(0));) e += this.popChar();
837
837
  return parseInt(e, 10);
838
838
  }
839
839
  patternCharacter() {
@@ -856,7 +856,7 @@ var ee = [
856
856
  case "|": throw Error("TBD");
857
857
  default: return {
858
858
  type: "Character",
859
- value: D(e)
859
+ value: H(e)
860
860
  };
861
861
  }
862
862
  }
@@ -874,7 +874,7 @@ var ee = [
874
874
  return this.peekChar() === "-" && this.isClassAtom(1);
875
875
  }
876
876
  isDigit() {
877
- return F.test(this.peekChar(0));
877
+ return xe.test(this.peekChar(0));
878
878
  }
879
879
  isClassAtom(e = 0) {
880
880
  switch (this.peekChar(e)) {
@@ -947,7 +947,7 @@ var ee = [
947
947
  let t = "";
948
948
  for (let n = 0; n < e; n++) {
949
949
  let e = this.popChar();
950
- if (!1 === te.test(e)) throw Error("Expecting a HexDecimal digits");
950
+ if (!1 === be.test(e)) throw Error("Expecting a HexDecimal digits");
951
951
  t += e;
952
952
  }
953
953
  return {
@@ -974,32 +974,32 @@ var ee = [
974
974
  };
975
975
  }
976
976
  }();
977
- function ie(e) {
977
+ function Ee(e) {
978
978
  let t = e.toString();
979
- if (L.hasOwnProperty(t)) return L[t];
979
+ if (we.hasOwnProperty(t)) return we[t];
980
980
  {
981
- let e = re.pattern(t);
982
- return L[t] = e, e;
981
+ let e = Te.pattern(t);
982
+ return we[t] = e, e;
983
983
  }
984
984
  }
985
- var ae = "Complement Sets are not supported for first char optimization", oe = "Unable to use \"first char\" lexer optimizations:\n";
986
- function se(e, t = !1) {
985
+ var De = "Complement Sets are not supported for first char optimization", Oe = "Unable to use \"first char\" lexer optimizations:\n";
986
+ function ke(e, t = !1) {
987
987
  try {
988
- let t = ie(e);
989
- return ce(t.value, {}, t.flags.ignoreCase);
990
- } catch (i) {
991
- if (i.message === ae) t && r(`${oe}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);
988
+ let t = Ee(e);
989
+ return Ae(t.value, {}, t.flags.ignoreCase);
990
+ } catch (n) {
991
+ if (n.message === De) t && D(`${Oe}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);
992
992
  else {
993
- let r = "";
994
- t && (r = "\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."), n(`${oe}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues` + r);
993
+ let n = "";
994
+ t && (n = "\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."), E(`${Oe}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues` + n);
995
995
  }
996
996
  }
997
997
  return [];
998
998
  }
999
- function ce(e, t, n) {
999
+ function Ae(e, t, n) {
1000
1000
  switch (e.type) {
1001
1001
  case "Disjunction":
1002
- for (let r = 0; r < e.value.length; r++) ce(e.value[r], t, n);
1002
+ for (let r = 0; r < e.value.length; r++) Ae(e.value[r], t, n);
1003
1003
  break;
1004
1004
  case "Alternative":
1005
1005
  let r = e.value;
@@ -1019,19 +1019,19 @@ function ce(e, t, n) {
1019
1019
  let a = i;
1020
1020
  switch (a.type) {
1021
1021
  case "Character":
1022
- le(a.value, t, n);
1022
+ je(a.value, t, n);
1023
1023
  break;
1024
1024
  case "Set":
1025
- if (!0 === a.complement) throw Error(ae);
1025
+ if (!0 === a.complement) throw Error(De);
1026
1026
  a.value.forEach((e) => {
1027
- if (typeof e == "number") le(e, t, n);
1027
+ if (typeof e == "number") je(e, t, n);
1028
1028
  else {
1029
1029
  let r = e;
1030
- if (!0 === n) for (let e = r.from; e <= r.to; e++) le(e, t, n);
1030
+ if (!0 === n) for (let e = r.from; e <= r.to; e++) je(e, t, n);
1031
1031
  else {
1032
- for (let e = r.from; e <= r.to && e < 256; e++) le(e, t, n);
1032
+ for (let e = r.from; e <= r.to && e < 256; e++) je(e, t, n);
1033
1033
  if (r.to >= 256) {
1034
- let e = r.from >= 256 ? r.from : 256, n = r.to, i = z(e), a = z(n);
1034
+ let e = r.from >= 256 ? r.from : 256, n = r.to, i = K(e), a = K(n);
1035
1035
  for (let e = i; e <= a; e++) t[e] = e;
1036
1036
  }
1037
1037
  }
@@ -1039,35 +1039,35 @@ function ce(e, t, n) {
1039
1039
  });
1040
1040
  break;
1041
1041
  case "Group":
1042
- ce(a.value, t, n);
1042
+ Ae(a.value, t, n);
1043
1043
  break;
1044
1044
  default: throw Error("Non Exhaustive Match");
1045
1045
  }
1046
1046
  let o = a.quantifier !== void 0 && a.quantifier.atLeast === 0;
1047
- if (a.type === "Group" && !1 === de(a) || a.type !== "Group" && !1 === o) break;
1047
+ if (a.type === "Group" && !1 === Ne(a) || a.type !== "Group" && !1 === o) break;
1048
1048
  }
1049
1049
  break;
1050
1050
  default: throw Error("non exhaustive match!");
1051
1051
  }
1052
1052
  return Object.values(t);
1053
1053
  }
1054
- function le(e, t, n) {
1055
- let r = z(e);
1054
+ function je(e, t, n) {
1055
+ let r = K(e);
1056
1056
  t[r] = r, !0 === n && function(e, t) {
1057
1057
  let n = String.fromCharCode(e), r = n.toUpperCase();
1058
1058
  if (r !== n) {
1059
- let e = z(r.charCodeAt(0));
1059
+ let e = K(r.charCodeAt(0));
1060
1060
  t[e] = e;
1061
1061
  } else {
1062
1062
  let e = n.toLowerCase();
1063
1063
  if (e !== n) {
1064
- let n = z(e.charCodeAt(0));
1064
+ let n = K(e.charCodeAt(0));
1065
1065
  t[n] = n;
1066
1066
  }
1067
1067
  }
1068
1068
  }(e, t);
1069
1069
  }
1070
- function ue(e, t) {
1070
+ function Me(e, t) {
1071
1071
  return e.value.find((e) => {
1072
1072
  if (typeof e == "number") return t.includes(e);
1073
1073
  {
@@ -1076,11 +1076,11 @@ function ue(e, t) {
1076
1076
  }
1077
1077
  });
1078
1078
  }
1079
- function de(e) {
1079
+ function Ne(e) {
1080
1080
  let t = e.quantifier;
1081
- return !(!t || t.atLeast !== 0) || !!e.value && (Array.isArray(e.value) ? e.value.every(de) : de(e.value));
1081
+ return !(!t || t.atLeast !== 0) || !!e.value && (Array.isArray(e.value) ? e.value.every(Ne) : Ne(e.value));
1082
1082
  }
1083
- var fe = class extends I {
1083
+ var Pe = class extends Ce {
1084
1084
  constructor(e) {
1085
1085
  super(), this.targetCharCodes = e, this.found = !1;
1086
1086
  }
@@ -1107,12 +1107,12 @@ var fe = class extends I {
1107
1107
  this.targetCharCodes.includes(e.value) && (this.found = !0);
1108
1108
  }
1109
1109
  visitSet(e) {
1110
- e.complement ? ue(e, this.targetCharCodes) === void 0 && (this.found = !0) : ue(e, this.targetCharCodes) !== void 0 && (this.found = !0);
1110
+ e.complement ? Me(e, this.targetCharCodes) === void 0 && (this.found = !0) : Me(e, this.targetCharCodes) !== void 0 && (this.found = !0);
1111
1111
  }
1112
1112
  };
1113
- function pe(e, t) {
1113
+ function Fe(e, t) {
1114
1114
  if (t instanceof RegExp) {
1115
- let n = ie(t), r = new fe(e);
1115
+ let n = Ee(t), r = new Pe(e);
1116
1116
  return r.visit(n), r.found;
1117
1117
  }
1118
1118
  for (let n of t) {
@@ -1121,28 +1121,28 @@ function pe(e, t) {
1121
1121
  }
1122
1122
  return !1;
1123
1123
  }
1124
- var R = "PATTERN", me = "defaultMode";
1125
- function he(e, t) {
1126
- let r = (t = Object.assign({
1124
+ var G = "PATTERN", Ie = "defaultMode";
1125
+ function Le(e, t) {
1126
+ let n = (t = Object.assign({
1127
1127
  safeMode: !1,
1128
1128
  positionTracking: "full",
1129
1129
  lineTerminatorCharacters: ["\r", "\n"],
1130
1130
  tracer: (e, t) => t()
1131
- }, t)).tracer, i;
1132
- r("initCharCodeToOptimizedIndexMap", () => {
1131
+ }, t)).tracer, r;
1132
+ n("initCharCodeToOptimizedIndexMap", () => {
1133
1133
  (function() {
1134
- if (De.length === 0) {
1135
- De = Array(65536);
1136
- for (let e = 0; e < 65536; e++) De[e] = e > 255 ? 255 + ~~(e / 255) : e;
1134
+ if (Ye.length === 0) {
1135
+ Ye = Array(65536);
1136
+ for (let e = 0; e < 65536; e++) Ye[e] = e > 255 ? 255 + ~~(e / 255) : e;
1137
1137
  }
1138
1138
  })();
1139
- }), r("Reject Lexer.NA", () => {
1140
- i = e.filter((e) => e[R] !== W.NA);
1139
+ }), n("Reject Lexer.NA", () => {
1140
+ r = e.filter((e) => e[G] !== J.NA);
1141
1141
  });
1142
- let a, o, s, c, l, u, d, f, p, m, h, g = !1;
1143
- r("Transform Patterns", () => {
1144
- g = !1, a = i.map((e) => {
1145
- let t = e[R];
1142
+ let i, a, o, s, c, l, u, d, f, p, m, h = !1;
1143
+ n("Transform Patterns", () => {
1144
+ h = !1, i = r.map((e) => {
1145
+ let t = e[G];
1146
1146
  if (t instanceof RegExp) {
1147
1147
  let e = t.source;
1148
1148
  return e.length !== 1 || e === "^" || e === "$" || e === "." || t.ignoreCase ? e.length !== 2 || e[0] !== "\\" || [
@@ -1162,86 +1162,113 @@ function he(e, t) {
1162
1162
  "v",
1163
1163
  "w",
1164
1164
  "W"
1165
- ].includes(e[1]) ? ye(t) : e[1] : e;
1165
+ ].includes(e[1]) ? Ve(t) : e[1] : e;
1166
1166
  }
1167
- if (typeof t == "function") return g = !0, { exec: t };
1168
- if (typeof t == "object") return g = !0, t;
1167
+ if (typeof t == "function") return h = !0, { exec: t };
1168
+ if (typeof t == "object") return h = !0, t;
1169
1169
  if (typeof t == "string") {
1170
1170
  if (t.length === 1) return t;
1171
1171
  {
1172
1172
  let e = t.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
1173
- return ye(new RegExp(e));
1173
+ return Ve(new RegExp(e));
1174
1174
  }
1175
1175
  }
1176
1176
  throw Error("non exhaustive match");
1177
1177
  });
1178
- }), r("misc mapping", () => {
1179
- o = i.map((e) => e.tokenTypeIdx), s = i.map((e) => {
1178
+ }), n("misc mapping", () => {
1179
+ a = r.map((e) => e.tokenTypeIdx), o = r.map((e) => {
1180
1180
  let t = e.GROUP;
1181
- if (t !== W.SKIPPED) {
1181
+ if (t !== J.SKIPPED) {
1182
1182
  if (typeof t == "string") return t;
1183
1183
  if (t === void 0) return !1;
1184
1184
  throw Error("non exhaustive match");
1185
1185
  }
1186
- }), c = i.map((e) => {
1186
+ }), s = r.map((e) => {
1187
1187
  let t = e.LONGER_ALT;
1188
- if (t) return Array.isArray(t) ? t.map((e) => i.indexOf(e)) : [i.indexOf(t)];
1189
- }), l = i.map((e) => e.PUSH_MODE), u = i.map((e) => Object.hasOwn(e, "POP_MODE"));
1190
- }), r("Line Terminator Handling", () => {
1191
- let e = Te(t.lineTerminatorCharacters);
1192
- d = i.map((e) => !1), t.positionTracking !== "onlyOffset" && (d = i.map((t) => Object.hasOwn(t, "LINE_BREAKS") ? !!t.LINE_BREAKS : !1 === Ce(t, e) && pe(e, t.PATTERN)));
1193
- }), r("Misc Mapping #2", () => {
1194
- f = i.map(be), p = a.map(xe), m = i.reduce((e, t) => {
1188
+ if (t) return Array.isArray(t) ? t.map((e) => r.indexOf(e)) : [r.indexOf(t)];
1189
+ }), c = r.map((e) => e.PUSH_MODE), l = r.map((e) => Object.hasOwn(e, "POP_MODE"));
1190
+ }), n("Line Terminator Handling", () => {
1191
+ let e = qe(t.lineTerminatorCharacters);
1192
+ u = r.map((e) => !1), t.positionTracking !== "onlyOffset" && (u = r.map((t) => Object.hasOwn(t, "LINE_BREAKS") ? !!t.LINE_BREAKS : !1 === Ge(t, e) && Fe(e, t.PATTERN)));
1193
+ }), n("Misc Mapping #2", () => {
1194
+ d = r.map(He), f = i.map(Ue), p = r.reduce((e, t) => {
1195
1195
  let n = t.GROUP;
1196
- return typeof n == "string" && n !== W.SKIPPED && (e[n] = []), e;
1197
- }, {}), h = a.map((e, t) => ({
1198
- pattern: a[t],
1199
- longerAlt: c[t],
1200
- canLineTerminator: d[t],
1201
- isCustom: f[t],
1202
- short: p[t],
1203
- group: s[t],
1204
- push: l[t],
1205
- pop: u[t],
1206
- tokenTypeIdx: o[t],
1207
- tokenType: i[t]
1208
- }));
1196
+ return typeof n == "string" && n !== J.SKIPPED && (e[n] = []), e;
1197
+ }, {}), m = i.map((e, t) => {
1198
+ let n = o[t] === void 0 && s[t] === void 0 ? function(e) {
1199
+ if (!(e instanceof RegExp) || e.flags !== "") return;
1200
+ let t;
1201
+ try {
1202
+ t = Ee(e);
1203
+ } catch {
1204
+ return;
1205
+ }
1206
+ if (t.value.value.length !== 1 || t.value.value[0].value.length !== 1) return;
1207
+ let n, r = t.value.value[0].value[0];
1208
+ for (; r.type === "Group";) {
1209
+ if (r.capturing || r.quantifier !== void 0 && n !== void 0 || r.value.value.length !== 1 || r.value.value[0].value.length !== 1) return;
1210
+ n = r.quantifier ?? n, r = r.value.value[0].value[0];
1211
+ }
1212
+ if (r.type !== "Set" || r.complement || r.quantifier !== void 0 && n !== void 0 || (n = r.quantifier ?? n, n?.atLeast !== 1 || n.atMost !== 1 / 0 || !n.greedy)) return;
1213
+ let i = /* @__PURE__ */ new Uint8Array(128);
1214
+ for (let e of r.value) {
1215
+ let t = typeof e == "number" ? e : e.from, n = typeof e == "number" ? e : e.to;
1216
+ if (t < 0 || n >= i.length) return;
1217
+ i.fill(1, t, n + 1);
1218
+ }
1219
+ return i;
1220
+ }(r[t].PATTERN) : void 0;
1221
+ return {
1222
+ pattern: i[t],
1223
+ asciiClass: n,
1224
+ longerAlt: s[t],
1225
+ canLineTerminator: u[t],
1226
+ matchType: n === void 0 ? !1 === f[t] ? d[t] ? 1 : 2 : 0 : 3,
1227
+ short: f[t],
1228
+ group: o[t],
1229
+ push: c[t],
1230
+ pop: l[t],
1231
+ tokenTypeIdx: a[t],
1232
+ tokenType: r[t]
1233
+ };
1234
+ });
1209
1235
  });
1210
- let _ = !0, v = [];
1211
- return t.safeMode || r("First Char Optimization", () => {
1212
- v = i.reduce((e, r, i) => {
1213
- if (typeof r.PATTERN == "string") Ee(e, z(r.PATTERN.charCodeAt(0)), h[i]);
1214
- else if (Array.isArray(r.START_CHARS_HINT)) {
1236
+ let g = !0, _ = [];
1237
+ return t.safeMode || n("First Char Optimization", () => {
1238
+ _ = r.reduce((e, n, r) => {
1239
+ if (typeof n.PATTERN == "string") Je(e, K(n.PATTERN.charCodeAt(0)), m[r]);
1240
+ else if (Array.isArray(n.START_CHARS_HINT)) {
1215
1241
  let t;
1216
- r.START_CHARS_HINT.forEach((n) => {
1217
- let r = z(typeof n == "string" ? n.charCodeAt(0) : n);
1218
- t !== r && (t = r, Ee(e, r, h[i]));
1219
- });
1220
- } else if (r.PATTERN instanceof RegExp) if (r.PATTERN.unicode) _ = !1, t.ensureOptimizations && n(`${oe}\tUnable to analyze < ${r.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);
1221
- else {
1222
- let n = se(r.PATTERN, t.ensureOptimizations);
1223
- n.length === 0 && (_ = !1), n.forEach((t) => {
1224
- Ee(e, t, h[i]);
1242
+ n.START_CHARS_HINT.forEach((n) => {
1243
+ let i = K(typeof n == "string" ? n.charCodeAt(0) : n);
1244
+ t !== i && (t = i, Je(e, i, m[r]));
1225
1245
  });
1226
- }
1227
- else t.ensureOptimizations && n(`${oe}\tTokenType: <${r.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`), _ = !1;
1246
+ } else if (n.PATTERN instanceof RegExp) {
1247
+ if (n.PATTERN.unicode) g = !1, t.ensureOptimizations && E(`${Oe}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);
1248
+ else {
1249
+ let i = ke(n.PATTERN, t.ensureOptimizations);
1250
+ i.length === 0 && (g = !1), i.forEach((t) => {
1251
+ Je(e, t, m[r]);
1252
+ });
1253
+ }
1254
+ } else t.ensureOptimizations && E(`${Oe}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`), g = !1;
1228
1255
  return e;
1229
1256
  }, []);
1230
1257
  }), {
1231
- emptyGroups: m,
1232
- patternIdxToConfig: h,
1233
- charCodeToPatternIdxToConfig: v,
1234
- hasCustom: g,
1235
- canBeOptimized: _
1258
+ emptyGroups: p,
1259
+ patternIdxToConfig: m,
1260
+ charCodeToPatternIdxToConfig: _,
1261
+ hasCustom: h,
1262
+ canBeOptimized: g
1236
1263
  };
1237
1264
  }
1238
- function ge(e, t) {
1265
+ function Re(e, t) {
1239
1266
  let n = [], r = function(e) {
1240
- let t = e.filter((e) => !Object.hasOwn(e, R));
1267
+ let t = e.filter((e) => !Object.hasOwn(e, G));
1241
1268
  return {
1242
1269
  errors: t.map((e) => ({
1243
1270
  message: "Token Type: ->" + e.name + "<- missing static 'PATTERN' property",
1244
- type: H.MISSING_PATTERN,
1271
+ type: q.MISSING_PATTERN,
1245
1272
  tokenTypes: [e]
1246
1273
  })),
1247
1274
  valid: e.filter((e) => !t.includes(e))
@@ -1250,22 +1277,22 @@ function ge(e, t) {
1250
1277
  n = n.concat(r.errors);
1251
1278
  let i = function(e) {
1252
1279
  let t = e.filter((e) => {
1253
- let t = e[R];
1280
+ let t = e[G];
1254
1281
  return !(t instanceof RegExp || typeof t == "function" || Object.hasOwn(t, "exec") || typeof t == "string");
1255
1282
  });
1256
1283
  return {
1257
1284
  errors: t.map((e) => ({
1258
1285
  message: "Token Type: ->" + e.name + "<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",
1259
- type: H.INVALID_PATTERN,
1286
+ type: q.INVALID_PATTERN,
1260
1287
  tokenTypes: [e]
1261
1288
  })),
1262
1289
  valid: e.filter((e) => !t.includes(e))
1263
1290
  };
1264
1291
  }(r.valid), a = i.valid;
1265
1292
  return n = n.concat(i.errors), n = n.concat(function(e) {
1266
- let t = [], n = e.filter((e) => e[R] instanceof RegExp);
1293
+ let t = [], n = e.filter((e) => e[G] instanceof RegExp);
1267
1294
  return t = t.concat(function(e) {
1268
- class t extends I {
1295
+ class t extends Ce {
1269
1296
  constructor() {
1270
1297
  super(...arguments), this.found = !1;
1271
1298
  }
@@ -1276,18 +1303,18 @@ function ge(e, t) {
1276
1303
  return e.filter((e) => {
1277
1304
  let n = e.PATTERN;
1278
1305
  try {
1279
- let e = ie(n), r = new t();
1306
+ let e = Ee(n), r = new t();
1280
1307
  return r.visit(e), r.found;
1281
1308
  } catch {
1282
- return _e.test(n.source);
1309
+ return ze.test(n.source);
1283
1310
  }
1284
1311
  }).map((e) => ({
1285
1312
  message: "Unexpected RegExp Anchor Error:\n Token Type: ->" + e.name + "<- static 'PATTERN' cannot contain end of input anchor '$'\n See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",
1286
- type: H.EOI_ANCHOR_FOUND,
1313
+ type: q.EOI_ANCHOR_FOUND,
1287
1314
  tokenTypes: [e]
1288
1315
  }));
1289
1316
  }(n)), t = t.concat(function(e) {
1290
- class t extends I {
1317
+ class t extends Ce {
1291
1318
  constructor() {
1292
1319
  super(...arguments), this.found = !1;
1293
1320
  }
@@ -1298,39 +1325,39 @@ function ge(e, t) {
1298
1325
  return e.filter((e) => {
1299
1326
  let n = e.PATTERN;
1300
1327
  try {
1301
- let e = ie(n), r = new t();
1328
+ let e = Ee(n), r = new t();
1302
1329
  return r.visit(e), r.found;
1303
1330
  } catch {
1304
- return ve.test(n.source);
1331
+ return Be.test(n.source);
1305
1332
  }
1306
1333
  }).map((e) => ({
1307
1334
  message: "Unexpected RegExp Anchor Error:\n Token Type: ->" + e.name + "<- static 'PATTERN' cannot contain start of input anchor '^'\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",
1308
- type: H.SOI_ANCHOR_FOUND,
1335
+ type: q.SOI_ANCHOR_FOUND,
1309
1336
  tokenTypes: [e]
1310
1337
  }));
1311
1338
  }(n)), t = t.concat(function(e) {
1312
1339
  return e.filter((e) => {
1313
- let t = e[R];
1340
+ let t = e[G];
1314
1341
  return t instanceof RegExp && (t.multiline || t.global);
1315
1342
  }).map((e) => ({
1316
1343
  message: "Token Type: ->" + e.name + "<- static 'PATTERN' may NOT contain global('g') or multiline('m')",
1317
- type: H.UNSUPPORTED_FLAGS_FOUND,
1344
+ type: q.UNSUPPORTED_FLAGS_FOUND,
1318
1345
  tokenTypes: [e]
1319
1346
  }));
1320
1347
  }(n)), t = t.concat(function(e) {
1321
- let t = [], n = e.map((n) => e.reduce((e, r) => (n.PATTERN.source !== r.PATTERN.source || t.includes(r) || r.PATTERN === W.NA || (t.push(r), e.push(r)), e), []));
1348
+ let t = [], n = e.map((n) => e.reduce((e, r) => (n.PATTERN.source !== r.PATTERN.source || t.includes(r) || r.PATTERN === J.NA || (t.push(r), e.push(r)), e), []));
1322
1349
  return n = n.filter(Boolean), n.filter((e) => e.length > 1).map((e) => {
1323
1350
  let t = e.map((e) => e.name);
1324
1351
  return {
1325
1352
  message: `The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,
1326
- type: H.DUPLICATE_PATTERNS_FOUND,
1353
+ type: q.DUPLICATE_PATTERNS_FOUND,
1327
1354
  tokenTypes: e
1328
1355
  };
1329
1356
  });
1330
1357
  }(n)), t = t.concat(function(e) {
1331
1358
  return e.filter((e) => e.PATTERN.test("")).map((e) => ({
1332
1359
  message: "Token Type: ->" + e.name + "<- static 'PATTERN' must not match an empty string",
1333
- type: H.EMPTY_MATCH_PATTERN,
1360
+ type: q.EMPTY_MATCH_PATTERN,
1334
1361
  tokenTypes: [e]
1335
1362
  }));
1336
1363
  }(n)), t;
@@ -1338,22 +1365,22 @@ function ge(e, t) {
1338
1365
  return e.filter((e) => {
1339
1366
  if (!Object.hasOwn(e, "GROUP")) return !1;
1340
1367
  let t = e.GROUP;
1341
- return t !== W.SKIPPED && t !== W.NA && typeof t != "string";
1368
+ return t !== J.SKIPPED && t !== J.NA && typeof t != "string";
1342
1369
  }).map((e) => ({
1343
1370
  message: "Token Type: ->" + e.name + "<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",
1344
- type: H.INVALID_GROUP_TYPE_FOUND,
1371
+ type: q.INVALID_GROUP_TYPE_FOUND,
1345
1372
  tokenTypes: [e]
1346
1373
  }));
1347
1374
  }(a)), n = n.concat(function(e, t) {
1348
1375
  return e.filter((e) => e.PUSH_MODE !== void 0 && !t.includes(e.PUSH_MODE)).map((e) => ({
1349
1376
  message: `Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,
1350
- type: H.PUSH_MODE_DOES_NOT_EXIST,
1377
+ type: q.PUSH_MODE_DOES_NOT_EXIST,
1351
1378
  tokenTypes: [e]
1352
1379
  }));
1353
1380
  }(a, t)), n = n.concat(function(e) {
1354
1381
  let t = [], n = e.reduce((e, t, n) => {
1355
1382
  let r = t.PATTERN;
1356
- return r === W.NA || (typeof r == "string" ? e.push({
1383
+ return r === J.NA || (typeof r == "string" ? e.push({
1357
1384
  str: r,
1358
1385
  idx: n,
1359
1386
  tokenType: t
@@ -1394,7 +1421,7 @@ function ge(e, t) {
1394
1421
  let n = `Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
1395
1422
  t.push({
1396
1423
  message: n,
1397
- type: H.UNREACHABLE_PATTERN,
1424
+ type: q.UNREACHABLE_PATTERN,
1398
1425
  tokenTypes: [e, a]
1399
1426
  });
1400
1427
  }
@@ -1402,74 +1429,74 @@ function ge(e, t) {
1402
1429
  }), t;
1403
1430
  }(a)), n;
1404
1431
  }
1405
- var _e = /[^\\][$]/, ve = /[^\\[][\^]|^\^/;
1406
- function ye(e) {
1432
+ var ze = /[^\\][$]/, Be = /[^\\[][\^]|^\^/;
1433
+ function Ve(e) {
1407
1434
  let t = e.ignoreCase ? "iy" : "y";
1408
1435
  return RegExp(`${e.source}`, t);
1409
1436
  }
1410
- function be(e) {
1437
+ function He(e) {
1411
1438
  let t = e.PATTERN;
1412
1439
  if (t instanceof RegExp) return !1;
1413
1440
  if (typeof t == "function" || Object.hasOwn(t, "exec")) return !0;
1414
1441
  if (typeof t == "string") return !1;
1415
1442
  throw Error("non exhaustive match");
1416
1443
  }
1417
- function xe(e) {
1444
+ function Ue(e) {
1418
1445
  return typeof e == "string" && e.length === 1 && e.charCodeAt(0);
1419
1446
  }
1420
- var Se = {
1447
+ var We = {
1421
1448
  test: function(e) {
1422
1449
  let t = e.length;
1423
1450
  for (let n = this.lastIndex; n < t; n++) {
1424
1451
  let t = e.charCodeAt(n);
1425
1452
  if (t === 10) return this.lastIndex = n + 1, !0;
1426
- if (t === 13) return e.charCodeAt(n + 1) === 10 ? this.lastIndex = n + 2 : this.lastIndex = n + 1, !0;
1453
+ if (t === 13) return this.lastIndex = e.charCodeAt(n + 1) === 10 ? n + 2 : n + 1, !0;
1427
1454
  }
1428
1455
  return !1;
1429
1456
  },
1430
1457
  lastIndex: 0
1431
1458
  };
1432
- function Ce(e, t) {
1459
+ function Ge(e, t) {
1433
1460
  if (Object.hasOwn(e, "LINE_BREAKS")) return !1;
1434
1461
  if (e.PATTERN instanceof RegExp) {
1435
1462
  try {
1436
- pe(t, e.PATTERN);
1463
+ Fe(t, e.PATTERN);
1437
1464
  } catch (e) {
1438
1465
  return {
1439
- issue: H.IDENTIFY_TERMINATOR,
1466
+ issue: q.IDENTIFY_TERMINATOR,
1440
1467
  errMsg: e.message
1441
1468
  };
1442
1469
  }
1443
1470
  return !1;
1444
1471
  }
1445
1472
  if (typeof e.PATTERN == "string") return !1;
1446
- if (be(e)) return { issue: H.CUSTOM_LINE_BREAK };
1473
+ if (He(e)) return { issue: q.CUSTOM_LINE_BREAK };
1447
1474
  throw Error("non exhaustive match");
1448
1475
  }
1449
- function we(e, t) {
1450
- if (t.issue === H.IDENTIFY_TERMINATOR) return `Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;
1451
- if (t.issue === H.CUSTOM_LINE_BREAK) return `Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;
1476
+ function Ke(e, t) {
1477
+ if (t.issue === q.IDENTIFY_TERMINATOR) return `Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;
1478
+ if (t.issue === q.CUSTOM_LINE_BREAK) return `Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;
1452
1479
  throw Error("non exhaustive match");
1453
1480
  }
1454
- function Te(e) {
1481
+ function qe(e) {
1455
1482
  return e.map((e) => typeof e == "string" ? e.charCodeAt(0) : e);
1456
1483
  }
1457
- function Ee(e, t, n) {
1484
+ function Je(e, t, n) {
1458
1485
  e[t] === void 0 ? e[t] = [n] : e[t].push(n);
1459
1486
  }
1460
- var De = [];
1461
- function z(e) {
1462
- return e < 256 ? e : De[e];
1487
+ var Ye = [];
1488
+ function K(e) {
1489
+ return e < 256 ? e : Ye[e];
1463
1490
  }
1464
- function B(e, t) {
1491
+ function Xe(e, t) {
1465
1492
  let n = e.tokenTypeIdx;
1466
1493
  return n === t.tokenTypeIdx || !0 === t.isParent && !0 === t.categoryMatchesMap[n];
1467
1494
  }
1468
- function Oe(e, t) {
1495
+ function Ze(e, t) {
1469
1496
  return e.tokenTypeIdx === t.tokenTypeIdx;
1470
1497
  }
1471
- var ke = 1, Ae = {};
1472
- function V(e) {
1498
+ var Qe = 1, $e = {};
1499
+ function et(e) {
1473
1500
  let t = function(e) {
1474
1501
  let t = [...e], n = e, r = !0;
1475
1502
  for (; r;) {
@@ -1482,107 +1509,107 @@ function V(e) {
1482
1509
  (function(e) {
1483
1510
  e.forEach((e) => {
1484
1511
  var t;
1485
- Me(e) || (Ae[ke] = e, e.tokenTypeIdx = ke++), Ne(e) && !Array.isArray(e.CATEGORIES) && (e.CATEGORIES = [e.CATEGORIES]), Ne(e) || (e.CATEGORIES = []), t = e, Object.hasOwn(t ?? {}, "categoryMatches") || (e.categoryMatches = []), function(e) {
1512
+ nt(e) || ($e[Qe] = e, e.tokenTypeIdx = Qe++), rt(e) && !Array.isArray(e.CATEGORIES) && (e.CATEGORIES = [e.CATEGORIES]), rt(e) || (e.CATEGORIES = []), t = e, Object.hasOwn(t ?? {}, "categoryMatches") || (e.categoryMatches = []), function(e) {
1486
1513
  return Object.hasOwn(e ?? {}, "categoryMatchesMap");
1487
1514
  }(e) || (e.categoryMatchesMap = {});
1488
1515
  });
1489
1516
  })(t), function(e) {
1490
1517
  e.forEach((e) => {
1491
- je([], e);
1518
+ tt([], e);
1492
1519
  });
1493
1520
  }(t), function(e) {
1494
1521
  e.forEach((e) => {
1495
1522
  e.categoryMatches = [], Object.keys(e.categoryMatchesMap).forEach((t) => {
1496
- e.categoryMatches.push(Ae[t].tokenTypeIdx);
1523
+ e.categoryMatches.push($e[t].tokenTypeIdx);
1497
1524
  });
1498
1525
  });
1499
1526
  }(t), t.forEach((e) => {
1500
1527
  e.isParent = e.categoryMatches.length > 0;
1501
1528
  });
1502
1529
  }
1503
- function je(e, t) {
1530
+ function tt(e, t) {
1504
1531
  e.forEach((e) => {
1505
1532
  t.categoryMatchesMap[e.tokenTypeIdx] = !0;
1506
1533
  }), t.CATEGORIES.forEach((n) => {
1507
1534
  let r = e.concat(t);
1508
- r.includes(n) || je(r, n);
1535
+ r.includes(n) || tt(r, n);
1509
1536
  });
1510
1537
  }
1511
- function Me(e) {
1538
+ function nt(e) {
1512
1539
  return Object.hasOwn(e ?? {}, "tokenTypeIdx");
1513
1540
  }
1514
- function Ne(e) {
1541
+ function rt(e) {
1515
1542
  return Object.hasOwn(e ?? {}, "CATEGORIES");
1516
1543
  }
1517
- function Pe(e) {
1544
+ function it(e) {
1518
1545
  return Object.hasOwn(e ?? {}, "tokenTypeIdx");
1519
1546
  }
1520
- var H, Fe = {
1547
+ var q, at = {
1521
1548
  buildUnableToPopLexerModeMessage: (e) => `Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,
1522
1549
  buildUnexpectedCharactersMessage: (e, t, n, r, i, a) => `unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`
1523
1550
  };
1524
1551
  (function(e) {
1525
1552
  e[e.MISSING_PATTERN = 0] = "MISSING_PATTERN", e[e.INVALID_PATTERN = 1] = "INVALID_PATTERN", e[e.EOI_ANCHOR_FOUND = 2] = "EOI_ANCHOR_FOUND", e[e.UNSUPPORTED_FLAGS_FOUND = 3] = "UNSUPPORTED_FLAGS_FOUND", e[e.DUPLICATE_PATTERNS_FOUND = 4] = "DUPLICATE_PATTERNS_FOUND", e[e.INVALID_GROUP_TYPE_FOUND = 5] = "INVALID_GROUP_TYPE_FOUND", e[e.PUSH_MODE_DOES_NOT_EXIST = 6] = "PUSH_MODE_DOES_NOT_EXIST", e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE = 7] = "MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE", e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY = 8] = "MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY", e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST = 9] = "MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST", e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED = 10] = "LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED", e[e.SOI_ANCHOR_FOUND = 11] = "SOI_ANCHOR_FOUND", e[e.EMPTY_MATCH_PATTERN = 12] = "EMPTY_MATCH_PATTERN", e[e.NO_LINE_BREAKS_FLAGS = 13] = "NO_LINE_BREAKS_FLAGS", e[e.UNREACHABLE_PATTERN = 14] = "UNREACHABLE_PATTERN", e[e.IDENTIFY_TERMINATOR = 15] = "IDENTIFY_TERMINATOR", e[e.CUSTOM_LINE_BREAK = 16] = "CUSTOM_LINE_BREAK", e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE = 17] = "MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";
1526
- })(H ||= {});
1527
- var U = {
1553
+ })(q ||= {});
1554
+ var ot = {
1528
1555
  deferDefinitionErrorsHandling: !1,
1529
1556
  positionTracking: "full",
1530
1557
  lineTerminatorsPattern: /\n|\r\n?/g,
1531
1558
  lineTerminatorCharacters: ["\n", "\r"],
1532
1559
  ensureOptimizations: !1,
1533
1560
  safeMode: !1,
1534
- errorMessageProvider: Fe,
1561
+ errorMessageProvider: at,
1535
1562
  traceInitPerf: !1,
1536
1563
  skipValidations: !1,
1537
1564
  recoveryEnabled: !0
1538
1565
  };
1539
- Object.freeze(U);
1540
- var W = class {
1541
- constructor(e, t = U) {
1566
+ Object.freeze(ot);
1567
+ var J = class {
1568
+ constructor(e, t = ot) {
1542
1569
  if (this.lexerDefinition = e, this.lexerDefinitionErrors = [], this.lexerDefinitionWarning = [], this.patternIdxToConfig = {}, this.charCodeToPatternIdxToConfig = {}, this.modes = [], this.emptyGroups = {}, this.cachedGroupKeys = [], this.trackStartLines = !0, this.trackEndLines = !0, this.hasCustom = !1, this.canModeBeOptimized = {}, this.TRACE_INIT = (e, t) => {
1543
1570
  if (!0 === this.traceInitPerf) {
1544
1571
  this.traceInitIndent++;
1545
1572
  let n = Array(this.traceInitIndent + 1).join(" ");
1546
1573
  this.traceInitIndent < this.traceInitMaxIdent && console.log(`${n}--\x3e <${e}>`);
1547
- let { time: r, value: a } = i(t), o = r > 10 ? console.warn : console.log;
1548
- return this.traceInitIndent < this.traceInitMaxIdent && o(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, a;
1574
+ let { time: r, value: i } = ae(t), a = r > 10 ? console.warn : console.log;
1575
+ return this.traceInitIndent < this.traceInitMaxIdent && a(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, i;
1549
1576
  }
1550
1577
  return t();
1551
1578
  }, typeof t == "boolean") throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");
1552
- this.config = Object.assign({}, U, t);
1579
+ this.config = Object.assign({}, ot, t);
1553
1580
  let n = this.config.traceInitPerf;
1554
- !0 === n ? (this.traceInitMaxIdent = Infinity, this.traceInitPerf = !0) : typeof n == "number" && (this.traceInitMaxIdent = n, this.traceInitPerf = !0), this.traceInitIndent = -1, this.TRACE_INIT("Lexer Constructor", () => {
1555
- let n, i = !0;
1581
+ !0 === n ? (this.traceInitMaxIdent = 1 / 0, this.traceInitPerf = !0) : typeof n == "number" && (this.traceInitMaxIdent = n, this.traceInitPerf = !0), this.traceInitIndent = -1, this.TRACE_INIT("Lexer Constructor", () => {
1582
+ let n, r = !0;
1556
1583
  this.TRACE_INIT("Lexer Config handling", () => {
1557
- if (this.config.lineTerminatorsPattern === U.lineTerminatorsPattern) this.config.lineTerminatorsPattern = Se;
1558
- else if (this.config.lineTerminatorCharacters === U.lineTerminatorCharacters) throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");
1584
+ if (this.config.lineTerminatorsPattern === ot.lineTerminatorsPattern) this.config.lineTerminatorsPattern = We;
1585
+ else if (this.config.lineTerminatorCharacters === ot.lineTerminatorCharacters) throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");
1559
1586
  if (t.safeMode && t.ensureOptimizations) throw Error("\"safeMode\" and \"ensureOptimizations\" flags are mutually exclusive.");
1560
1587
  this.trackStartLines = /full|onlyStart/i.test(this.config.positionTracking), this.trackEndLines = /full/i.test(this.config.positionTracking), Array.isArray(e) ? n = {
1561
1588
  modes: { defaultMode: [...e] },
1562
- defaultMode: me
1563
- } : (i = !1, n = Object.assign({}, e));
1589
+ defaultMode: Ie
1590
+ } : (r = !1, n = Object.assign({}, e));
1564
1591
  }), !1 === this.config.skipValidations && (this.TRACE_INIT("performRuntimeChecks", () => {
1565
1592
  this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(function(e) {
1566
1593
  let t = [];
1567
1594
  return Object.hasOwn(e, "defaultMode") || t.push({
1568
1595
  message: "A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition\n",
1569
- type: H.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE
1596
+ type: q.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE
1570
1597
  }), Object.hasOwn(e, "modes") || t.push({
1571
1598
  message: "A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",
1572
- type: H.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY
1599
+ type: q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY
1573
1600
  }), Object.hasOwn(e, "modes") && Object.hasOwn(e, "defaultMode") && !Object.hasOwn(e.modes, e.defaultMode) && t.push({
1574
- message: `A MultiMode Lexer cannot be initialized with a ${me}: <${e.defaultMode}>which does not exist\n`,
1575
- type: H.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST
1601
+ message: `A MultiMode Lexer cannot be initialized with a ${Ie}: <${e.defaultMode}>which does not exist\n`,
1602
+ type: q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST
1576
1603
  }), Object.hasOwn(e, "modes") && Object.keys(e.modes).forEach((n) => {
1577
1604
  let r = e.modes[n];
1578
1605
  r.forEach((e, i) => {
1579
1606
  e === void 0 ? t.push({
1580
1607
  message: `A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,
1581
- type: H.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED
1608
+ type: q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED
1582
1609
  }) : Object.hasOwn(e, "LONGER_ALT") && (Array.isArray(e.LONGER_ALT) ? e.LONGER_ALT : [e.LONGER_ALT]).forEach((i) => {
1583
1610
  i === void 0 || r.includes(i) || t.push({
1584
1611
  message: `A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,
1585
- type: H.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE
1612
+ type: q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE
1586
1613
  });
1587
1614
  });
1588
1615
  });
@@ -1590,34 +1617,34 @@ var W = class {
1590
1617
  }(n, this.trackStartLines, this.config.lineTerminatorCharacters));
1591
1618
  }), this.TRACE_INIT("performWarningRuntimeChecks", () => {
1592
1619
  this.lexerDefinitionWarning = this.lexerDefinitionWarning.concat(function(e, t, n) {
1593
- let r = [], i = !1, a = Object.values(e.modes || {}).flat().filter(Boolean).filter((e) => e[R] !== W.NA), o = Te(n);
1620
+ let r = [], i = !1, a = Object.values(e.modes || {}).flat().filter(Boolean).filter((e) => e[G] !== J.NA), o = qe(n);
1594
1621
  return t && a.forEach((e) => {
1595
- let t = Ce(e, o);
1622
+ let t = Ge(e, o);
1596
1623
  if (!1 !== t) {
1597
1624
  let n = {
1598
- message: we(e, t),
1625
+ message: Ke(e, t),
1599
1626
  type: t.issue,
1600
1627
  tokenType: e
1601
1628
  };
1602
1629
  r.push(n);
1603
- } else Object.hasOwn(e, "LINE_BREAKS") ? !0 === e.LINE_BREAKS && (i = !0) : pe(o, e.PATTERN) && (i = !0);
1630
+ } else Object.hasOwn(e, "LINE_BREAKS") ? !0 === e.LINE_BREAKS && (i = !0) : Fe(o, e.PATTERN) && (i = !0);
1604
1631
  }), t && !i && r.push({
1605
1632
  message: "Warning: No LINE_BREAKS Found.\n This Lexer has been defined to track line and column information,\n But none of the Token Types can be identified as matching a line terminator.\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n for details.",
1606
- type: H.NO_LINE_BREAKS_FLAGS
1633
+ type: q.NO_LINE_BREAKS_FLAGS
1607
1634
  }), r;
1608
1635
  }(n, this.trackStartLines, this.config.lineTerminatorCharacters));
1609
1636
  })), n.modes = n.modes ? n.modes : {}, Object.entries(n.modes).forEach(([e, t]) => {
1610
1637
  n.modes[e] = t.filter((e) => e !== void 0);
1611
1638
  });
1612
- let o = Object.keys(n.modes);
1639
+ let i = Object.keys(n.modes);
1613
1640
  if (Object.entries(n.modes).forEach(([e, n]) => {
1614
1641
  this.TRACE_INIT(`Mode: <${e}> processing`, () => {
1615
1642
  if (this.modes.push(e), !1 === this.config.skipValidations && this.TRACE_INIT("validatePatterns", () => {
1616
- this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(ge(n, o));
1643
+ this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(Re(n, i));
1617
1644
  }), this.lexerDefinitionErrors.length === 0) {
1618
1645
  let r;
1619
- V(n), this.TRACE_INIT("analyzeTokenTypes", () => {
1620
- r = he(n, {
1646
+ et(n), this.TRACE_INIT("analyzeTokenTypes", () => {
1647
+ r = Le(n, {
1621
1648
  lineTerminatorCharacters: this.config.lineTerminatorCharacters,
1622
1649
  positionTracking: t.positionTracking,
1623
1650
  ensureOptimizations: t.ensureOptimizations,
@@ -1632,9 +1659,9 @@ var W = class {
1632
1659
  throw Error("Errors detected in definition of Lexer:\n" + e);
1633
1660
  }
1634
1661
  this.lexerDefinitionWarning.forEach((e) => {
1635
- r(e.message);
1662
+ D(e.message);
1636
1663
  }), this.TRACE_INIT("Choosing sub-methods implementations", () => {
1637
- if (i && (this.handleModes = () => {}), !1 === this.trackStartLines && (this.computeNewColumn = (e) => e), !1 === this.trackEndLines && (this.updateTokenEndLineColumnLocation = () => {}), /full/i.test(this.config.positionTracking)) this.createTokenInstance = this.createFullToken;
1664
+ if (r && (this.handleModes = () => {}), !1 === this.trackStartLines && (this.computeNewColumn = (e) => e), !1 === this.trackEndLines && (this.updateTokenEndLineColumnLocation = () => {}), /full/i.test(this.config.positionTracking)) this.createTokenInstance = this.createFullToken;
1638
1665
  else if (/onlyStart/i.test(this.config.positionTracking)) this.createTokenInstance = this.createStartOnlyToken;
1639
1666
  else {
1640
1667
  if (!/onlyOffset/i.test(this.config.positionTracking)) throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);
@@ -1645,9 +1672,9 @@ var W = class {
1645
1672
  let e = Object.entries(this.canModeBeOptimized).reduce((e, [t, n]) => (!1 === n && e.push(t), e), []);
1646
1673
  if (t.ensureOptimizations && e.length > 0) throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`);
1647
1674
  }), this.TRACE_INIT("clearRegExpParserCache", () => {
1648
- L = {};
1675
+ we = {};
1649
1676
  }), this.TRACE_INIT("toFastProperties", () => {
1650
- a(this);
1677
+ O(this);
1651
1678
  });
1652
1679
  });
1653
1680
  }
@@ -1659,14 +1686,14 @@ var W = class {
1659
1686
  return this.tokenizeInternal(e, t);
1660
1687
  }
1661
1688
  tokenizeInternal(e, t) {
1662
- let n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _ = e, v = _.length, y = 0, b = 0, x = this.hasCustom ? 0 : Math.floor(e.length / 10), S = Array(x), C = [], w = this.trackStartLines ? 1 : void 0, T = this.trackStartLines ? 1 : void 0, E = {};
1663
- for (let e = 0; e < this.cachedGroupKeys.length; e++) E[this.cachedGroupKeys[e]] = [];
1664
- let D = this.trackStartLines, O = this.config.lineTerminatorsPattern, k = 0, A = [], j = [], M = [], N = [];
1665
- Object.freeze(N);
1666
- let P = !1, ee = (e) => {
1667
- if (M.length === 1 && e.tokenType.PUSH_MODE === void 0) {
1689
+ let n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _ = e, v = _.length, y = 0, b = 0, x = this.hasCustom ? 0 : Math.floor(e.length / 10), S = Array(x), ee = [], te = this.trackStartLines ? 1 : void 0, C = this.trackStartLines ? 1 : void 0, w = {};
1690
+ for (let e = 0; e < this.cachedGroupKeys.length; e++) w[this.cachedGroupKeys[e]] = [];
1691
+ let ne = this.trackStartLines, re = this.config.lineTerminatorsPattern, ie = 0, T = [], E = [], D = [], ae = [];
1692
+ Object.freeze(ae);
1693
+ let O = !1, k = (e) => {
1694
+ if (D.length === 1 && e.tokenType.PUSH_MODE === void 0) {
1668
1695
  let t = this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);
1669
- C.push({
1696
+ ee.push({
1670
1697
  offset: e.startOffset,
1671
1698
  line: e.startLine,
1672
1699
  column: e.startColumn,
@@ -1674,42 +1701,60 @@ var W = class {
1674
1701
  message: t
1675
1702
  });
1676
1703
  } else {
1677
- M.pop();
1678
- let e = M.at(-1);
1679
- A = this.patternIdxToConfig[e], j = this.charCodeToPatternIdxToConfig[e], k = A.length;
1704
+ D.pop();
1705
+ let e = D.at(-1);
1706
+ T = this.patternIdxToConfig[e], E = this.charCodeToPatternIdxToConfig[e], ie = T.length;
1680
1707
  let t = this.canModeBeOptimized[e] && !1 === this.config.safeMode;
1681
- P = !(!j || !t);
1708
+ O = !(!E || !t);
1682
1709
  }
1683
1710
  };
1684
- function te(e) {
1685
- M.push(e), j = this.charCodeToPatternIdxToConfig[e], A = this.patternIdxToConfig[e], k = A.length;
1711
+ function A(e) {
1712
+ D.push(e), E = this.charCodeToPatternIdxToConfig[e], T = this.patternIdxToConfig[e], ie = T.length;
1686
1713
  let t = this.canModeBeOptimized[e] && !1 === this.config.safeMode;
1687
- P = !(!j || !t);
1714
+ O = !(!E || !t);
1688
1715
  }
1689
- let F;
1690
- te.call(this, t);
1691
- let ne = this.config.recoveryEnabled;
1716
+ let j;
1717
+ A.call(this, t);
1718
+ let M = this.config.recoveryEnabled;
1692
1719
  for (; y < v;) {
1693
1720
  s = null, u = -1;
1694
1721
  let t = _.charCodeAt(y), x;
1695
- if (P) {
1696
- let e = z(t), n = j[e];
1697
- x = n === void 0 ? N : n;
1698
- } else x = A;
1699
- let I = x.length;
1700
- for (n = 0; n < I; n++) {
1701
- F = x[n];
1702
- let r = F.pattern;
1703
- c = null;
1704
- let d = F.short;
1705
- if (!1 === d ? !0 === F.isCustom ? (g = r.exec(_, y, S, E), g === null ? s = null : (s = g[0], u = s.length, g.payload !== void 0 && (c = g.payload))) : (r.lastIndex = y, u = this.matchLength(r, e, y)) : t === d && (u = 1, s = r), u !== -1) {
1706
- if (o = F.longerAlt, o !== void 0) {
1722
+ if (O) {
1723
+ let e = K(t), n = E[e];
1724
+ x = n === void 0 ? ae : n;
1725
+ } else x = T;
1726
+ let N = x.length;
1727
+ for (n = 0; n < N; n++) {
1728
+ j = x[n];
1729
+ let r = j.pattern;
1730
+ switch (c = null, j.matchType) {
1731
+ case 0:
1732
+ t === j.short && (u = 1, s = r);
1733
+ break;
1734
+ case 1:
1735
+ g = r.exec(_, y, S, w), g === null ? s = null : (s = g[0], u = s.length, g.payload !== void 0 && (c = g.payload));
1736
+ break;
1737
+ case 3: {
1738
+ let e = j.asciiClass;
1739
+ if (e[t] !== 1) {
1740
+ r.lastIndex = 0;
1741
+ break;
1742
+ }
1743
+ let n = y + 1;
1744
+ for (; e[_.charCodeAt(n)] === 1;) n++;
1745
+ u = n - y, r.lastIndex = n;
1746
+ break;
1747
+ }
1748
+ case 2: r.lastIndex = y, u = this.matchLength(r, e, y);
1749
+ }
1750
+ if (u !== -1) {
1751
+ if (o = j.longerAlt, o !== void 0) {
1707
1752
  s = e.substring(y, y + u);
1708
1753
  let t = o.length;
1709
1754
  for (i = 0; i < t; i++) {
1710
- let t = A[o[i]], n = t.pattern;
1711
- if (l = null, !0 === t.isCustom ? (g = n.exec(_, y, S, E), g === null ? a = null : (a = g[0], g.payload !== void 0 && (l = g.payload))) : (n.lastIndex = y, a = this.match(n, e, y)), a && a.length > s.length) {
1712
- s = a, u = a.length, c = l, F = t;
1755
+ let t = T[o[i]], n = t.pattern;
1756
+ if (l = null, t.matchType === 1 ? (g = n.exec(_, y, S, w), g === null ? a = null : (a = g[0], g.payload !== void 0 && (l = g.payload))) : (n.lastIndex = y, a = this.match(n, e, y)), a && a.length > s.length) {
1757
+ s = a, u = a.length, c = l, j = t;
1713
1758
  break;
1714
1759
  }
1715
1760
  }
@@ -1718,34 +1763,44 @@ var W = class {
1718
1763
  }
1719
1764
  }
1720
1765
  if (u !== -1) {
1721
- if (d = F.group, d !== void 0 && (s = s === null ? e.substring(y, y + u) : s, f = F.tokenTypeIdx, p = this.createTokenInstance(s, y, f, F.tokenType, w, T, u), this.handlePayload(p, c), !1 === d ? b = this.addToken(S, b, p) : E[d].push(p)), !0 === D && !0 === F.canLineTerminator) {
1766
+ if (d = j.group, d !== void 0 && (s = s === null ? e.substring(y, y + u) : s, f = j.tokenTypeIdx, p = this.createTokenInstance(s, y, f, j.tokenType, te, C, u), this.handlePayload(p, c), !1 === d ? b = this.addToken(S, b, p) : w[d].push(p)), !0 === ne && !0 === j.canLineTerminator) {
1722
1767
  let t, n, r = 0;
1723
- O.lastIndex = 0;
1768
+ re.lastIndex = 0;
1724
1769
  do
1725
- s = s === null ? e.substring(y, y + u) : s, t = O.test(s), !0 === t && (n = O.lastIndex - 1, r++);
1770
+ s = s === null ? e.substring(y, y + u) : s, t = re.test(s), !0 === t && (n = re.lastIndex - 1, r++);
1726
1771
  while (!0 === t);
1727
- r === 0 ? T = this.computeNewColumn(T, u) : (w += r, T = u - n, this.updateTokenEndLineColumnLocation(p, d, n, r, w, T, u));
1728
- } else T = this.computeNewColumn(T, u);
1729
- y += u, this.handleModes(F, ee, te, p);
1772
+ r === 0 ? C = this.computeNewColumn(C, u) : (te += r, C = u - n, this.updateTokenEndLineColumnLocation(p, d, n, r, te, C, u));
1773
+ } else C = this.computeNewColumn(C, u);
1774
+ y += u, this.handleModes(j, k, A, p);
1730
1775
  } else {
1731
- let t = y, n = w, i = T, a = !1 === ne;
1732
- for (; !1 === a && y < v;) for (y++, r = 0; r < k; r++) {
1733
- let t = A[r], n = t.pattern, i = t.short;
1734
- if (!1 === i ? !0 === t.isCustom ? a = n.exec(_, y, S, E) !== null : (n.lastIndex = y, a = n.exec(e) !== null) : _.charCodeAt(y) === i && (a = !0), !0 === a) break;
1776
+ let t = y, n = te, i = C, a = !1 === M;
1777
+ for (; !1 === a && y < v;) for (y++, r = 0; r < ie; r++) {
1778
+ let t = T[r], n = t.pattern;
1779
+ switch (t.matchType) {
1780
+ case 0:
1781
+ _.charCodeAt(y) === t.short && (a = !0);
1782
+ break;
1783
+ case 1:
1784
+ a = n.exec(_, y, S, w) !== null;
1785
+ break;
1786
+ case 3:
1787
+ case 2: n.lastIndex = y, a = n.exec(e) !== null;
1788
+ }
1789
+ if (!0 === a) break;
1735
1790
  }
1736
- if (m = y - t, T = this.computeNewColumn(T, m), h = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(_, t, m, n, i, M.at(-1)), C.push({
1791
+ if (m = y - t, C = this.computeNewColumn(C, m), h = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(_, t, m, n, i, D.at(-1)), ee.push({
1737
1792
  offset: t,
1738
1793
  line: n,
1739
1794
  column: i,
1740
1795
  length: m,
1741
1796
  message: h
1742
- }), !1 === ne) break;
1797
+ }), !1 === M) break;
1743
1798
  }
1744
1799
  }
1745
1800
  return this.hasCustom || (S.length = b), {
1746
1801
  tokens: S,
1747
- groups: E,
1748
- errors: C
1802
+ groups: w,
1803
+ errors: ee
1749
1804
  };
1750
1805
  }
1751
1806
  handleModes(e, t, n, r) {
@@ -1809,26 +1864,26 @@ var W = class {
1809
1864
  return !0 === e.test(t) ? e.lastIndex - n : -1;
1810
1865
  }
1811
1866
  };
1812
- function G(e) {
1813
- return Ie(e) ? e.LABEL : e.name;
1867
+ function st(e) {
1868
+ return ct(e) ? e.LABEL : e.name;
1814
1869
  }
1815
- function Ie(e) {
1870
+ function ct(e) {
1816
1871
  return typeof e.LABEL == "string" && e.LABEL !== "";
1817
1872
  }
1818
- W.SKIPPED = "This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.", W.NA = /NOT_APPLICABLE/;
1819
- var Le = "parent", Re = "categories", ze = "label", Be = "group", Ve = "push_mode", He = "pop_mode", Ue = "longer_alt", We = "line_breaks", Ge = "start_chars_hint";
1820
- function K(e) {
1873
+ J.SKIPPED = "This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.", J.NA = /NOT_APPLICABLE/;
1874
+ var lt = "parent", ut = "categories", dt = "label", ft = "group", pt = "push_mode", mt = "pop_mode", ht = "longer_alt", gt = "line_breaks", _t = "start_chars_hint";
1875
+ function Y(e) {
1821
1876
  return function(e) {
1822
1877
  let t = e.pattern, n = {};
1823
- if (n.name = e.name, t !== void 0 && (n.PATTERN = t), Object.hasOwn(e, Le)) throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
1824
- return Object.hasOwn(e, Re) && (n.CATEGORIES = e[Re]), V([n]), Object.hasOwn(e, ze) && (n.LABEL = e[ze]), Object.hasOwn(e, Be) && (n.GROUP = e[Be]), Object.hasOwn(e, He) && (n.POP_MODE = e[He]), Object.hasOwn(e, Ve) && (n.PUSH_MODE = e[Ve]), Object.hasOwn(e, Ue) && (n.LONGER_ALT = e[Ue]), Object.hasOwn(e, We) && (n.LINE_BREAKS = e[We]), Object.hasOwn(e, Ge) && (n.START_CHARS_HINT = e[Ge]), n;
1878
+ if (n.name = e.name, t !== void 0 && (n.PATTERN = t), Object.hasOwn(e, lt)) throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
1879
+ return Object.hasOwn(e, ut) && (n.CATEGORIES = e[ut]), et([n]), Object.hasOwn(e, dt) && (n.LABEL = e[dt]), Object.hasOwn(e, ft) && (n.GROUP = e[ft]), Object.hasOwn(e, mt) && (n.POP_MODE = e[mt]), Object.hasOwn(e, pt) && (n.PUSH_MODE = e[pt]), Object.hasOwn(e, ht) && (n.LONGER_ALT = e[ht]), Object.hasOwn(e, gt) && (n.LINE_BREAKS = e[gt]), Object.hasOwn(e, _t) && (n.START_CHARS_HINT = e[_t]), n;
1825
1880
  }(e);
1826
1881
  }
1827
- var q = K({
1882
+ var X = Y({
1828
1883
  name: "EOF",
1829
- pattern: W.NA
1884
+ pattern: J.NA
1830
1885
  });
1831
- function Ke(e, t, n, r, i, a, o, s) {
1886
+ function vt(e, t, n, r, i, a, o, s) {
1832
1887
  return {
1833
1888
  image: t,
1834
1889
  startOffset: n,
@@ -1841,38 +1896,38 @@ function Ke(e, t, n, r, i, a, o, s) {
1841
1896
  tokenType: e
1842
1897
  };
1843
1898
  }
1844
- V([q]);
1845
- var qe = {
1846
- buildMismatchTokenMessage: ({ expected: e, actual: t, previous: n, ruleName: r }) => `Expecting ${Ie(e) ? `--\x3e ${G(e)} <--` : `token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,
1899
+ et([X]);
1900
+ var yt = {
1901
+ buildMismatchTokenMessage: ({ expected: e, actual: t, previous: n, ruleName: r }) => `Expecting ${ct(e) ? `--\x3e ${st(e)} <--` : `token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,
1847
1902
  buildNotAllInputParsedMessage: ({ firstRedundant: e, ruleName: t }) => "Redundant input, expecting EOF but found: " + e.image,
1848
1903
  buildNoViableAltMessage({ expectedPathsPerAlt: e, actual: t, previous: n, customUserDescription: r, ruleName: i }) {
1849
1904
  let a = "\nbut found: '" + t[0].image + "'";
1850
- return r ? "Expecting: " + r + a : `Expecting: one of these possible Token sequences:\n${e.reduce((e, t) => e.concat(t), []).map((e) => `[${e.map((e) => G(e)).join(", ")}]`).map((e, t) => ` ${t + 1}. ${e}`).join("\n")}` + a;
1905
+ return r ? "Expecting: " + r + a : `Expecting: one of these possible Token sequences:\n${e.reduce((e, t) => e.concat(t), []).map((e) => `[${e.map((e) => st(e)).join(", ")}]`).map((e, t) => ` ${t + 1}. ${e}`).join("\n")}` + a;
1851
1906
  },
1852
1907
  buildEarlyExitMessage({ expectedIterationPaths: e, actual: t, customUserDescription: n, ruleName: r }) {
1853
1908
  let i = "\nbut found: '" + t[0].image + "'";
1854
- return n ? "Expecting: " + n + i : `Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map((e) => `[${e.map((e) => G(e)).join(",")}]`).join(" ,")}>` + i;
1909
+ return n ? "Expecting: " + n + i : `Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map((e) => `[${e.map((e) => st(e)).join(",")}]`).join(" ,")}>` + i;
1855
1910
  }
1856
1911
  };
1857
- Object.freeze(qe);
1858
- var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a rule which is not defined: ->" + t.nonTerminalName + "<-\ninside top level rule: ->" + e.name + "<-" }, J = {
1912
+ Object.freeze(yt);
1913
+ var bt = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a rule which is not defined: ->" + t.nonTerminalName + "<-\ninside top level rule: ->" + e.name + "<-" }, xt = {
1859
1914
  buildDuplicateFoundError(e, t) {
1860
- let n = e.name, r = t[0], i = r.idx, a = x(r), o = (c = r) instanceof g ? c.terminalType.name : c instanceof s ? c.nonTerminalName : "";
1861
- var c;
1862
- let l = `->${a}${i > 0 ? i : ""}<- ${o ? `with argument: ->${o}<-` : ""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;
1863
- return l = l.replace(/[ \t]+/g, " "), l = l.replace(/\s\s+/g, "\n"), l;
1915
+ let n = e.name, r = t[0], i = r.idx, a = V(r), o = (s = r) instanceof z ? s.terminalType.name : s instanceof A ? s.nonTerminalName : "";
1916
+ var s;
1917
+ let c = `->${a}${i > 0 ? i : ""}<- ${o ? `with argument: ->${o}<-` : ""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;
1918
+ return c = c.replace(/[ \t]+/g, " "), c = c.replace(/\s\s+/g, "\n"), c;
1864
1919
  },
1865
1920
  buildNamespaceConflictError: (e) => `Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,
1866
1921
  buildAlternationPrefixAmbiguityError(e) {
1867
- let t = e.prefixPath.map((e) => G(e)).join(", "), n = e.alternation.idx === 0 ? "" : e.alternation.idx;
1922
+ let t = e.prefixPath.map((e) => st(e)).join(", "), n = e.alternation.idx === 0 ? "" : e.alternation.idx;
1868
1923
  return `Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`;
1869
1924
  },
1870
1925
  buildAlternationAmbiguityError(e) {
1871
1926
  let t = e.alternation.idx === 0 ? "" : e.alternation.idx, n = e.prefixPath.length === 0, r = `Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,\n`;
1872
- return n ? r += "These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n" : r += `<${e.prefixPath.map((e) => G(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`, r += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", r;
1927
+ return r += n ? "These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n" : `<${e.prefixPath.map((e) => st(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`, r += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", r;
1873
1928
  },
1874
1929
  buildEmptyRepetitionError(e) {
1875
- let t = x(e.repetition);
1930
+ let t = V(e.repetition);
1876
1931
  return e.repetition.idx !== 0 && (t += e.repetition.idx), `The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`;
1877
1932
  },
1878
1933
  buildTokenNameError: (e) => "deprecated",
@@ -1885,9 +1940,9 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
1885
1940
  buildInvalidRuleNameError: (e) => "deprecated",
1886
1941
  buildDuplicateRuleNameError(e) {
1887
1942
  let t;
1888
- return t = e.topLevelRule instanceof c ? e.topLevelRule.name : e.topLevelRule, `Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`;
1943
+ return t = e.topLevelRule instanceof j ? e.topLevelRule.name : e.topLevelRule, `Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`;
1889
1944
  }
1890
- }, Y, Ye = class extends y {
1945
+ }, Z, St = class extends se {
1891
1946
  constructor(e, t) {
1892
1947
  super(), this.nameToTopRule = e, this.errMsgProvider = t, this.errors = [];
1893
1948
  }
@@ -1909,7 +1964,7 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
1909
1964
  });
1910
1965
  }
1911
1966
  }
1912
- }, Xe = class extends S {
1967
+ }, Ct = class extends le {
1913
1968
  constructor(e, t) {
1914
1969
  super(), this.topProd = e, this.path = t, this.possibleTokTypes = [], this.nextProductionName = "", this.nextProductionOccurrence = 0, this.found = !1, this.isAtEndOfPath = !1;
1915
1970
  }
@@ -1929,17 +1984,17 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
1929
1984
  updateExpectedNext() {
1930
1985
  this.ruleStack.length === 0 ? (this.nextProductionName = "", this.nextProductionOccurrence = 0, this.isAtEndOfPath = !0) : (this.nextProductionName = this.ruleStack.pop(), this.nextProductionOccurrence = this.occurrenceStack.pop());
1931
1986
  }
1932
- }, Ze = class extends Xe {
1987
+ }, wt = class extends Ct {
1933
1988
  constructor(e, t) {
1934
1989
  super(e, t), this.path = t, this.nextTerminalName = "", this.nextTerminalOccurrence = 0, this.nextTerminalName = this.path.lastTok.name, this.nextTerminalOccurrence = this.path.lastTokOccurrence;
1935
1990
  }
1936
1991
  walkTerminal(e, t, n) {
1937
1992
  if (this.isAtEndOfPath && e.terminalType.name === this.nextTerminalName && e.idx === this.nextTerminalOccurrence && !this.found) {
1938
- let e = new l({ definition: t.concat(n) });
1939
- this.possibleTokTypes = w(e), this.found = !0;
1993
+ let e = new M({ definition: t.concat(n) });
1994
+ this.possibleTokTypes = de(e), this.found = !0;
1940
1995
  }
1941
1996
  }
1942
- }, Qe = class extends S {
1997
+ }, Tt = class extends le {
1943
1998
  constructor(e, t) {
1944
1999
  super(), this.topRule = e, this.occurrence = t, this.result = {
1945
2000
  token: void 0,
@@ -1950,56 +2005,56 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
1950
2005
  startWalking() {
1951
2006
  return this.walk(this.topRule), this.result;
1952
2007
  }
1953
- }, $e = class extends Qe {
2008
+ }, Et = class extends Tt {
1954
2009
  walkMany(e, t, n) {
1955
2010
  if (e.idx === this.occurrence) {
1956
2011
  let e = t.concat(n)[0];
1957
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
2012
+ this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1958
2013
  } else super.walkMany(e, t, n);
1959
2014
  }
1960
- }, et = class extends Qe {
2015
+ }, Dt = class extends Tt {
1961
2016
  walkManySep(e, t, n) {
1962
2017
  if (e.idx === this.occurrence) {
1963
2018
  let e = t.concat(n)[0];
1964
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
2019
+ this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1965
2020
  } else super.walkManySep(e, t, n);
1966
2021
  }
1967
- }, tt = class extends Qe {
2022
+ }, Ot = class extends Tt {
1968
2023
  walkAtLeastOne(e, t, n) {
1969
2024
  if (e.idx === this.occurrence) {
1970
2025
  let e = t.concat(n)[0];
1971
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
2026
+ this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1972
2027
  } else super.walkAtLeastOne(e, t, n);
1973
2028
  }
1974
- }, nt = class extends Qe {
2029
+ }, kt = class extends Tt {
1975
2030
  walkAtLeastOneSep(e, t, n) {
1976
2031
  if (e.idx === this.occurrence) {
1977
2032
  let e = t.concat(n)[0];
1978
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
2033
+ this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1979
2034
  } else super.walkAtLeastOneSep(e, t, n);
1980
2035
  }
1981
2036
  };
1982
- function rt(e, t, n = []) {
2037
+ function At(e, t, n = []) {
1983
2038
  n = [...n];
1984
2039
  let r = [], i = 0;
1985
2040
  function a(a) {
1986
- let o = rt(a.concat(e.slice(i + 1)), t, n);
2041
+ let o = At(a.concat(e.slice(i + 1)), t, n);
1987
2042
  return r.concat(o);
1988
2043
  }
1989
2044
  for (; n.length < t && i < e.length;) {
1990
2045
  let t = e[i];
1991
- if (t instanceof l || t instanceof s) return a(t.definition);
1992
- if (t instanceof u) r = a(t.definition);
2046
+ if (t instanceof M || t instanceof A) return a(t.definition);
2047
+ if (t instanceof N) r = a(t.definition);
1993
2048
  else {
1994
- if (t instanceof d) return a(t.definition.concat([new p({ definition: t.definition })]));
1995
- if (t instanceof f) return a([new l({ definition: t.definition }), new p({ definition: [new g({ terminalType: t.separator })].concat(t.definition) })]);
1996
- if (t instanceof m) r = a(t.definition.concat([new p({ definition: [new g({ terminalType: t.separator })].concat(t.definition) })]));
1997
- else if (t instanceof p) r = a(t.definition.concat([new p({ definition: t.definition })]));
2049
+ if (t instanceof P) return a(t.definition.concat([new I({ definition: t.definition })]));
2050
+ if (t instanceof F) return a([new M({ definition: t.definition }), new I({ definition: [new z({ terminalType: t.separator })].concat(t.definition) })]);
2051
+ if (t instanceof L) r = a(t.definition.concat([new I({ definition: [new z({ terminalType: t.separator })].concat(t.definition) })]));
2052
+ else if (t instanceof I) r = a(t.definition.concat([new I({ definition: t.definition })]));
1998
2053
  else {
1999
- if (t instanceof h) return t.definition.forEach((e) => {
2054
+ if (t instanceof R) return t.definition.forEach((e) => {
2000
2055
  e.definition.length !== 0 && (r = a(e.definition));
2001
2056
  }), r;
2002
- if (!(t instanceof g)) throw Error("non exhaustive match");
2057
+ if (!(t instanceof z)) throw Error("non exhaustive match");
2003
2058
  n.push(t.terminalType);
2004
2059
  }
2005
2060
  }
@@ -2010,7 +2065,7 @@ function rt(e, t, n = []) {
2010
2065
  suffixDef: e.slice(i)
2011
2066
  }), r;
2012
2067
  }
2013
- function it(e, t, n, r) {
2068
+ function jt(e, t, n, r) {
2014
2069
  let i = [...n];
2015
2070
  i.push(e.name);
2016
2071
  let a = [...r];
@@ -2021,16 +2076,16 @@ function it(e, t, n, r) {
2021
2076
  occurrenceStack: a
2022
2077
  };
2023
2078
  }
2024
- function at(e) {
2025
- if (e instanceof u || e === "Option") return Y.OPTION;
2026
- if (e instanceof p || e === "Repetition") return Y.REPETITION;
2027
- if (e instanceof d || e === "RepetitionMandatory") return Y.REPETITION_MANDATORY;
2028
- if (e instanceof f || e === "RepetitionMandatoryWithSeparator") return Y.REPETITION_MANDATORY_WITH_SEPARATOR;
2029
- if (e instanceof m || e === "RepetitionWithSeparator") return Y.REPETITION_WITH_SEPARATOR;
2030
- if (e instanceof h || e === "Alternation") return Y.ALTERNATION;
2079
+ function Mt(e) {
2080
+ if (e instanceof N || e === "Option") return Z.OPTION;
2081
+ if (e instanceof I || e === "Repetition") return Z.REPETITION;
2082
+ if (e instanceof P || e === "RepetitionMandatory") return Z.REPETITION_MANDATORY;
2083
+ if (e instanceof F || e === "RepetitionMandatoryWithSeparator") return Z.REPETITION_MANDATORY_WITH_SEPARATOR;
2084
+ if (e instanceof L || e === "RepetitionWithSeparator") return Z.REPETITION_WITH_SEPARATOR;
2085
+ if (e instanceof R || e === "Alternation") return Z.ALTERNATION;
2031
2086
  throw Error("non exhaustive match");
2032
2087
  }
2033
- function ot(e, t, n, r) {
2088
+ function Nt(e, t, n, r) {
2034
2089
  let i = e.length, a = e.every((e) => e.every((e) => e.length === 1));
2035
2090
  if (t) return function(t) {
2036
2091
  let r = t.map((e) => e.GATE);
@@ -2065,7 +2120,7 @@ function ot(e, t, n, r) {
2065
2120
  }
2066
2121
  };
2067
2122
  }
2068
- function st(e, t, n) {
2123
+ function Pt(e, t, n) {
2069
2124
  let r = e.every((e) => e.length === 1), i = e.length;
2070
2125
  if (r && !n) {
2071
2126
  let t = e.flat();
@@ -2096,8 +2151,8 @@ function st(e, t, n) {
2096
2151
  }
2097
2152
  (function(e) {
2098
2153
  e[e.OPTION = 0] = "OPTION", e[e.REPETITION = 1] = "REPETITION", e[e.REPETITION_MANDATORY = 2] = "REPETITION_MANDATORY", e[e.REPETITION_MANDATORY_WITH_SEPARATOR = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR", e[e.REPETITION_WITH_SEPARATOR = 4] = "REPETITION_WITH_SEPARATOR", e[e.ALTERNATION = 5] = "ALTERNATION";
2099
- })(Y ||= {});
2100
- var ct = class extends S {
2154
+ })(Z ||= {});
2155
+ var Ft = class extends le {
2101
2156
  constructor(e, t, n) {
2102
2157
  super(), this.topProd = e, this.targetOccurrence = t, this.targetProdType = n;
2103
2158
  }
@@ -2108,21 +2163,21 @@ var ct = class extends S {
2108
2163
  return e.idx === this.targetOccurrence && this.targetProdType === t && (this.restDef = n.concat(r), !0);
2109
2164
  }
2110
2165
  walkOption(e, t, n) {
2111
- this.checkIsTarget(e, Y.OPTION, t, n) || super.walkOption(e, t, n);
2166
+ this.checkIsTarget(e, Z.OPTION, t, n) || super.walkOption(e, t, n);
2112
2167
  }
2113
2168
  walkAtLeastOne(e, t, n) {
2114
- this.checkIsTarget(e, Y.REPETITION_MANDATORY, t, n) || super.walkOption(e, t, n);
2169
+ this.checkIsTarget(e, Z.REPETITION_MANDATORY, t, n) || super.walkOption(e, t, n);
2115
2170
  }
2116
2171
  walkAtLeastOneSep(e, t, n) {
2117
- this.checkIsTarget(e, Y.REPETITION_MANDATORY_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
2172
+ this.checkIsTarget(e, Z.REPETITION_MANDATORY_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
2118
2173
  }
2119
2174
  walkMany(e, t, n) {
2120
- this.checkIsTarget(e, Y.REPETITION, t, n) || super.walkOption(e, t, n);
2175
+ this.checkIsTarget(e, Z.REPETITION, t, n) || super.walkOption(e, t, n);
2121
2176
  }
2122
2177
  walkManySep(e, t, n) {
2123
- this.checkIsTarget(e, Y.REPETITION_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
2178
+ this.checkIsTarget(e, Z.REPETITION_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
2124
2179
  }
2125
- }, lt = class extends y {
2180
+ }, It = class extends se {
2126
2181
  constructor(e, t, n) {
2127
2182
  super(), this.targetOccurrence = e, this.targetProdType = t, this.targetRef = n, this.result = [];
2128
2183
  }
@@ -2130,30 +2185,30 @@ var ct = class extends S {
2130
2185
  e.idx !== this.targetOccurrence || this.targetProdType !== t || this.targetRef !== void 0 && e !== this.targetRef || (this.result = e.definition);
2131
2186
  }
2132
2187
  visitOption(e) {
2133
- this.checkIsTarget(e, Y.OPTION);
2188
+ this.checkIsTarget(e, Z.OPTION);
2134
2189
  }
2135
2190
  visitRepetition(e) {
2136
- this.checkIsTarget(e, Y.REPETITION);
2191
+ this.checkIsTarget(e, Z.REPETITION);
2137
2192
  }
2138
2193
  visitRepetitionMandatory(e) {
2139
- this.checkIsTarget(e, Y.REPETITION_MANDATORY);
2194
+ this.checkIsTarget(e, Z.REPETITION_MANDATORY);
2140
2195
  }
2141
2196
  visitRepetitionMandatoryWithSeparator(e) {
2142
- this.checkIsTarget(e, Y.REPETITION_MANDATORY_WITH_SEPARATOR);
2197
+ this.checkIsTarget(e, Z.REPETITION_MANDATORY_WITH_SEPARATOR);
2143
2198
  }
2144
2199
  visitRepetitionWithSeparator(e) {
2145
- this.checkIsTarget(e, Y.REPETITION_WITH_SEPARATOR);
2200
+ this.checkIsTarget(e, Z.REPETITION_WITH_SEPARATOR);
2146
2201
  }
2147
2202
  visitAlternation(e) {
2148
- this.checkIsTarget(e, Y.ALTERNATION);
2203
+ this.checkIsTarget(e, Z.ALTERNATION);
2149
2204
  }
2150
2205
  };
2151
- function ut(e) {
2206
+ function Lt(e) {
2152
2207
  let t = Array(e);
2153
2208
  for (let n = 0; n < e; n++) t[n] = [];
2154
2209
  return t;
2155
2210
  }
2156
- function dt(e) {
2211
+ function Rt(e) {
2157
2212
  let t = [""];
2158
2213
  for (let n = 0; n < e.length; n++) {
2159
2214
  let r = e[n], i = [];
@@ -2169,7 +2224,7 @@ function dt(e) {
2169
2224
  }
2170
2225
  return t;
2171
2226
  }
2172
- function ft(e, t, n) {
2227
+ function zt(e, t, n) {
2173
2228
  for (let r = 0; r < e.length; r++) {
2174
2229
  if (r === n) continue;
2175
2230
  let i = e[r];
@@ -2177,25 +2232,25 @@ function ft(e, t, n) {
2177
2232
  }
2178
2233
  return !0;
2179
2234
  }
2180
- function pt(e, t) {
2181
- let n = e.map((e) => rt([e], 1)), r = ut(n.length), i = n.map((e) => {
2235
+ function Bt(e, t) {
2236
+ let n = e.map((e) => At([e], 1)), r = Lt(n.length), i = n.map((e) => {
2182
2237
  let t = {};
2183
2238
  return e.forEach((e) => {
2184
- dt(e.partialPath).forEach((e) => {
2239
+ Rt(e.partialPath).forEach((e) => {
2185
2240
  t[e] = !0;
2186
2241
  });
2187
2242
  }), t;
2188
2243
  }), a = n;
2189
2244
  for (let e = 1; e <= t; e++) {
2190
2245
  let n = a;
2191
- a = ut(n.length);
2246
+ a = Lt(n.length);
2192
2247
  for (let o = 0; o < n.length; o++) {
2193
2248
  let s = n[o];
2194
2249
  for (let n = 0; n < s.length; n++) {
2195
- let c = s[n].partialPath, l = s[n].suffixDef, u = dt(c);
2196
- if (ft(i, u, o) || l.length === 0 || c.length === t) {
2250
+ let c = s[n].partialPath, l = s[n].suffixDef, u = Rt(c);
2251
+ if (zt(i, u, o) || l.length === 0 || c.length === t) {
2197
2252
  let e = r[o];
2198
- if (!1 === gt(e, c)) {
2253
+ if (!1 === Ut(e, c)) {
2199
2254
  e.push(c);
2200
2255
  for (let e = 0; e < u.length; e++) {
2201
2256
  let t = u[e];
@@ -2203,9 +2258,9 @@ function pt(e, t) {
2203
2258
  }
2204
2259
  }
2205
2260
  } else {
2206
- let t = rt(l, e + 1, c);
2261
+ let t = At(l, e + 1, c);
2207
2262
  a[o] = a[o].concat(t), t.forEach((e) => {
2208
- dt(e.partialPath).forEach((e) => {
2263
+ Rt(e.partialPath).forEach((e) => {
2209
2264
  i[o][e] = !0;
2210
2265
  });
2211
2266
  });
@@ -2215,17 +2270,17 @@ function pt(e, t) {
2215
2270
  }
2216
2271
  return r;
2217
2272
  }
2218
- function mt(e, t, n, r) {
2219
- let i = new lt(e, Y.ALTERNATION, r);
2220
- return t.accept(i), pt(i.result, n);
2273
+ function Vt(e, t, n, r) {
2274
+ let i = new It(e, Z.ALTERNATION, r);
2275
+ return t.accept(i), Bt(i.result, n);
2221
2276
  }
2222
- function ht(e, t, n, r) {
2223
- let i = new lt(e, n);
2277
+ function Ht(e, t, n, r) {
2278
+ let i = new It(e, n);
2224
2279
  t.accept(i);
2225
- let a = i.result, o = new ct(t, e, n).startWalking();
2226
- return pt([new l({ definition: a }), new l({ definition: o })], r);
2280
+ let a = i.result, o = new Ft(t, e, n).startWalking();
2281
+ return Bt([new M({ definition: a }), new M({ definition: o })], r);
2227
2282
  }
2228
- function gt(e, t) {
2283
+ function Ut(e, t) {
2229
2284
  e: for (let n = 0; n < e.length; n++) {
2230
2285
  let r = e[n];
2231
2286
  if (r.length === t.length) {
@@ -2238,22 +2293,22 @@ function gt(e, t) {
2238
2293
  }
2239
2294
  return !1;
2240
2295
  }
2241
- function _t(e) {
2296
+ function Wt(e) {
2242
2297
  return e.every((e) => e.every((e) => e.every((e) => e.categoryMatches.length === 0)));
2243
2298
  }
2244
- function vt(e, t, n, r) {
2299
+ function Gt(e, t, n, r) {
2245
2300
  let i = e.flatMap((e) => function(e, t) {
2246
- let n = new xt();
2301
+ let n = new Jt();
2247
2302
  e.accept(n);
2248
- let r = n.allProductions, i = Object.groupBy(r, yt), a = Object.fromEntries(Object.entries(i).filter(([e, t]) => t.length > 1));
2303
+ let r = n.allProductions, i = Object.groupBy(r, Kt), a = Object.fromEntries(Object.entries(i).filter(([e, t]) => t.length > 1));
2249
2304
  return Object.values(a).map((n) => {
2250
- let r = n[0], i = t.buildDuplicateFoundError(e, n), a = x(r), o = {
2305
+ let r = n[0], i = t.buildDuplicateFoundError(e, n), a = V(r), o = {
2251
2306
  message: i,
2252
2307
  type: Q.DUPLICATE_PRODUCTIONS,
2253
2308
  ruleName: e.name,
2254
2309
  dslName: a,
2255
2310
  occurrence: r.idx
2256
- }, s = bt(r);
2311
+ }, s = qt(r);
2257
2312
  return s && (o.parameter = s), o;
2258
2313
  });
2259
2314
  }(e, n)), a = function(e, t, n) {
@@ -2270,7 +2325,7 @@ function vt(e, t, n, r) {
2270
2325
  }
2271
2326
  }), r;
2272
2327
  }(e, t, n), o = e.flatMap((e) => function(e, t) {
2273
- let n = new wt();
2328
+ let n = new Zt();
2274
2329
  return e.accept(n), n.alternations.flatMap((n) => n.definition.length > 255 ? [{
2275
2330
  message: t.buildTooManyAlternativesError({
2276
2331
  topLevelRule: e,
@@ -2297,13 +2352,13 @@ function vt(e, t, n, r) {
2297
2352
  }(t, e, r, n));
2298
2353
  return i.concat(a, o, s);
2299
2354
  }
2300
- function yt(e) {
2301
- return `${x(e)}_#_${e.idx}_#_${bt(e)}`;
2355
+ function Kt(e) {
2356
+ return `${V(e)}_#_${e.idx}_#_${qt(e)}`;
2302
2357
  }
2303
- function bt(e) {
2304
- return e instanceof g ? e.terminalType.name : e instanceof s ? e.nonTerminalName : "";
2358
+ function qt(e) {
2359
+ return e instanceof z ? e.terminalType.name : e instanceof A ? e.nonTerminalName : "";
2305
2360
  }
2306
- var xt = class extends y {
2361
+ var Jt = class extends se {
2307
2362
  constructor() {
2308
2363
  super(...arguments), this.allProductions = [];
2309
2364
  }
@@ -2332,8 +2387,8 @@ var xt = class extends y {
2332
2387
  this.allProductions.push(e);
2333
2388
  }
2334
2389
  };
2335
- function St(e, t, n, r = []) {
2336
- let i = [], a = Ct(t.definition);
2390
+ function Yt(e, t, n, r = []) {
2391
+ let i = [], a = Xt(t.definition);
2337
2392
  if (a.length === 0) return [];
2338
2393
  {
2339
2394
  let t = e.name;
@@ -2347,27 +2402,27 @@ function St(e, t, n, r = []) {
2347
2402
  });
2348
2403
  let o = r.concat([e]), s = a.filter((e) => !o.includes(e)).flatMap((t) => {
2349
2404
  let i = [...r];
2350
- return i.push(t), St(e, t, n, i);
2405
+ return i.push(t), Yt(e, t, n, i);
2351
2406
  });
2352
2407
  return i.concat(s);
2353
2408
  }
2354
2409
  }
2355
- function Ct(e) {
2410
+ function Xt(e) {
2356
2411
  let t = [];
2357
2412
  if (e.length === 0) return t;
2358
2413
  let n = e[0];
2359
- if (n instanceof s) t.push(n.referencedRule);
2360
- else if (n instanceof l || n instanceof u || n instanceof d || n instanceof f || n instanceof m || n instanceof p) t = t.concat(Ct(n.definition));
2361
- else if (n instanceof h) t = n.definition.map((e) => Ct(e.definition)).flat();
2362
- else if (!(n instanceof g)) throw Error("non exhaustive match");
2363
- let r = b(n), i = e.length > 1;
2414
+ if (n instanceof A) t.push(n.referencedRule);
2415
+ else if (n instanceof M || n instanceof N || n instanceof P || n instanceof F || n instanceof L || n instanceof I) t = t.concat(Xt(n.definition));
2416
+ else if (n instanceof R) t = n.definition.map((e) => Xt(e.definition)).flat();
2417
+ else if (!(n instanceof z)) throw Error("non exhaustive match");
2418
+ let r = ce(n), i = e.length > 1;
2364
2419
  if (r && i) {
2365
2420
  let n = e.slice(1);
2366
- return t.concat(Ct(n));
2421
+ return t.concat(Xt(n));
2367
2422
  }
2368
2423
  return t;
2369
2424
  }
2370
- var wt = class extends y {
2425
+ var Zt = class extends se {
2371
2426
  constructor() {
2372
2427
  super(...arguments), this.alternations = [];
2373
2428
  }
@@ -2375,159 +2430,160 @@ var wt = class extends y {
2375
2430
  this.alternations.push(e);
2376
2431
  }
2377
2432
  };
2378
- function Tt(e, t) {
2379
- let n = new wt();
2433
+ function Qt(e, t) {
2434
+ let n = new Zt();
2380
2435
  return e.accept(n), n.alternations.flatMap((n) => n.definition.slice(0, -1).flatMap((r, i) => function(e, t, n, r) {
2381
- let i = "EXIT_NONE_TERMINAL", a = [i], o = "EXIT_ALTERNATIVE", _ = !1, v = t.length, y = v - r - 1, b = [], x = [];
2382
- for (x.push({
2436
+ let i = "EXIT_NONE_TERMINAL", a = [i], o = "EXIT_ALTERNATIVE", s = !1, c = t.length, l = c - r - 1, u = [], d = [];
2437
+ for (d.push({
2383
2438
  idx: -1,
2384
2439
  def: e,
2385
2440
  ruleStack: [],
2386
2441
  occurrenceStack: []
2387
- }); x.length !== 0;) {
2388
- let e = x.pop();
2442
+ }); d.length !== 0;) {
2443
+ let e = d.pop();
2389
2444
  if (e === o) {
2390
- _ && x.at(-1).idx <= y && x.pop();
2445
+ s && d.at(-1).idx <= l && d.pop();
2391
2446
  continue;
2392
2447
  }
2393
- let r = e.def, S = e.idx, C = e.ruleStack, w = e.occurrenceStack;
2448
+ let r = e.def, f = e.idx, p = e.ruleStack, m = e.occurrenceStack;
2394
2449
  if (r.length === 0) continue;
2395
- let T = r[0];
2396
- if (T === i) {
2450
+ let h = r[0];
2451
+ if (h === i) {
2397
2452
  let e = {
2398
- idx: S,
2453
+ idx: f,
2399
2454
  def: r.slice(1),
2400
- ruleStack: C.slice(0, -1),
2401
- occurrenceStack: w.slice(0, -1)
2455
+ ruleStack: p.slice(0, -1),
2456
+ occurrenceStack: m.slice(0, -1)
2402
2457
  };
2403
- x.push(e);
2404
- } else if (T instanceof g) if (S < v - 1) {
2405
- let e = S + 1;
2406
- if (n(t[e], T.terminalType)) {
2407
- let t = {
2408
- idx: e,
2409
- def: r.slice(1),
2410
- ruleStack: C,
2411
- occurrenceStack: w
2412
- };
2413
- x.push(t);
2458
+ d.push(e);
2459
+ } else if (h instanceof z) {
2460
+ if (f < c - 1) {
2461
+ let e = f + 1;
2462
+ if (n(t[e], h.terminalType)) {
2463
+ let t = {
2464
+ idx: e,
2465
+ def: r.slice(1),
2466
+ ruleStack: p,
2467
+ occurrenceStack: m
2468
+ };
2469
+ d.push(t);
2470
+ }
2471
+ } else {
2472
+ if (f !== c - 1) throw Error("non exhaustive match");
2473
+ u.push({
2474
+ nextTokenType: h.terminalType,
2475
+ nextTokenOccurrence: h.idx,
2476
+ ruleStack: p,
2477
+ occurrenceStack: m
2478
+ }), s = !0;
2414
2479
  }
2415
- } else {
2416
- if (S !== v - 1) throw Error("non exhaustive match");
2417
- b.push({
2418
- nextTokenType: T.terminalType,
2419
- nextTokenOccurrence: T.idx,
2420
- ruleStack: C,
2421
- occurrenceStack: w
2422
- }), _ = !0;
2423
- }
2424
- else if (T instanceof s) {
2425
- let e = [...C];
2426
- e.push(T.nonTerminalName);
2427
- let t = [...w];
2428
- t.push(T.idx);
2480
+ } else if (h instanceof A) {
2481
+ let e = [...p];
2482
+ e.push(h.nonTerminalName);
2483
+ let t = [...m];
2484
+ t.push(h.idx);
2429
2485
  let n = {
2430
- idx: S,
2431
- def: T.definition.concat(a, r.slice(1)),
2486
+ idx: f,
2487
+ def: h.definition.concat(a, r.slice(1)),
2432
2488
  ruleStack: e,
2433
2489
  occurrenceStack: t
2434
2490
  };
2435
- x.push(n);
2436
- } else if (T instanceof u) {
2491
+ d.push(n);
2492
+ } else if (h instanceof N) {
2437
2493
  let e = {
2438
- idx: S,
2494
+ idx: f,
2439
2495
  def: r.slice(1),
2440
- ruleStack: C,
2441
- occurrenceStack: w
2496
+ ruleStack: p,
2497
+ occurrenceStack: m
2442
2498
  };
2443
- x.push(e), x.push(o);
2499
+ d.push(e), d.push(o);
2444
2500
  let t = {
2445
- idx: S,
2446
- def: T.definition.concat(r.slice(1)),
2447
- ruleStack: C,
2448
- occurrenceStack: w
2501
+ idx: f,
2502
+ def: h.definition.concat(r.slice(1)),
2503
+ ruleStack: p,
2504
+ occurrenceStack: m
2449
2505
  };
2450
- x.push(t);
2451
- } else if (T instanceof d) {
2452
- let e = new p({
2453
- definition: T.definition,
2454
- idx: T.idx
2506
+ d.push(t);
2507
+ } else if (h instanceof P) {
2508
+ let e = new I({
2509
+ definition: h.definition,
2510
+ idx: h.idx
2455
2511
  }), t = {
2456
- idx: S,
2457
- def: T.definition.concat([e], r.slice(1)),
2458
- ruleStack: C,
2459
- occurrenceStack: w
2512
+ idx: f,
2513
+ def: h.definition.concat([e], r.slice(1)),
2514
+ ruleStack: p,
2515
+ occurrenceStack: m
2460
2516
  };
2461
- x.push(t);
2462
- } else if (T instanceof f) {
2463
- let e = new p({
2464
- definition: [new g({ terminalType: T.separator })].concat(T.definition),
2465
- idx: T.idx
2517
+ d.push(t);
2518
+ } else if (h instanceof F) {
2519
+ let e = new I({
2520
+ definition: [new z({ terminalType: h.separator })].concat(h.definition),
2521
+ idx: h.idx
2466
2522
  }), t = {
2467
- idx: S,
2468
- def: T.definition.concat([e], r.slice(1)),
2469
- ruleStack: C,
2470
- occurrenceStack: w
2523
+ idx: f,
2524
+ def: h.definition.concat([e], r.slice(1)),
2525
+ ruleStack: p,
2526
+ occurrenceStack: m
2471
2527
  };
2472
- x.push(t);
2473
- } else if (T instanceof m) {
2528
+ d.push(t);
2529
+ } else if (h instanceof L) {
2474
2530
  let e = {
2475
- idx: S,
2531
+ idx: f,
2476
2532
  def: r.slice(1),
2477
- ruleStack: C,
2478
- occurrenceStack: w
2533
+ ruleStack: p,
2534
+ occurrenceStack: m
2479
2535
  };
2480
- x.push(e), x.push(o);
2481
- let t = new p({
2482
- definition: [new g({ terminalType: T.separator })].concat(T.definition),
2483
- idx: T.idx
2536
+ d.push(e), d.push(o);
2537
+ let t = new I({
2538
+ definition: [new z({ terminalType: h.separator })].concat(h.definition),
2539
+ idx: h.idx
2484
2540
  }), n = {
2485
- idx: S,
2486
- def: T.definition.concat([t], r.slice(1)),
2487
- ruleStack: C,
2488
- occurrenceStack: w
2541
+ idx: f,
2542
+ def: h.definition.concat([t], r.slice(1)),
2543
+ ruleStack: p,
2544
+ occurrenceStack: m
2489
2545
  };
2490
- x.push(n);
2491
- } else if (T instanceof p) {
2546
+ d.push(n);
2547
+ } else if (h instanceof I) {
2492
2548
  let e = {
2493
- idx: S,
2549
+ idx: f,
2494
2550
  def: r.slice(1),
2495
- ruleStack: C,
2496
- occurrenceStack: w
2551
+ ruleStack: p,
2552
+ occurrenceStack: m
2497
2553
  };
2498
- x.push(e), x.push(o);
2499
- let t = new p({
2500
- definition: T.definition,
2501
- idx: T.idx
2554
+ d.push(e), d.push(o);
2555
+ let t = new I({
2556
+ definition: h.definition,
2557
+ idx: h.idx
2502
2558
  }), n = {
2503
- idx: S,
2504
- def: T.definition.concat([t], r.slice(1)),
2505
- ruleStack: C,
2506
- occurrenceStack: w
2559
+ idx: f,
2560
+ def: h.definition.concat([t], r.slice(1)),
2561
+ ruleStack: p,
2562
+ occurrenceStack: m
2507
2563
  };
2508
- x.push(n);
2509
- } else if (T instanceof h) for (let e = T.definition.length - 1; e >= 0; e--) {
2564
+ d.push(n);
2565
+ } else if (h instanceof R) for (let e = h.definition.length - 1; e >= 0; e--) {
2510
2566
  let t = {
2511
- idx: S,
2512
- def: T.definition[e].definition.concat(r.slice(1)),
2513
- ruleStack: C,
2514
- occurrenceStack: w
2567
+ idx: f,
2568
+ def: h.definition[e].definition.concat(r.slice(1)),
2569
+ ruleStack: p,
2570
+ occurrenceStack: m
2515
2571
  };
2516
- x.push(t), x.push(o);
2572
+ d.push(t), d.push(o);
2517
2573
  }
2518
- else if (T instanceof l) x.push({
2519
- idx: S,
2520
- def: T.definition.concat(r.slice(1)),
2521
- ruleStack: C,
2522
- occurrenceStack: w
2574
+ else if (h instanceof M) d.push({
2575
+ idx: f,
2576
+ def: h.definition.concat(r.slice(1)),
2577
+ ruleStack: p,
2578
+ occurrenceStack: m
2523
2579
  });
2524
2580
  else {
2525
- if (!(T instanceof c)) throw Error("non exhaustive match");
2526
- x.push(it(T, S, C, w));
2581
+ if (!(h instanceof j)) throw Error("non exhaustive match");
2582
+ d.push(jt(h, f, p, m));
2527
2583
  }
2528
2584
  }
2529
- return b;
2530
- }([r], [], B, 1).length === 0 ? [{
2585
+ return u;
2586
+ }([r], [], Xe, 1).length === 0 ? [{
2531
2587
  message: t.buildEmptyAlternationError({
2532
2588
  topLevelRule: e,
2533
2589
  alternation: n,
@@ -2539,18 +2595,18 @@ function Tt(e, t) {
2539
2595
  alternative: i + 1
2540
2596
  }] : []));
2541
2597
  }
2542
- function Et(e, t, n) {
2543
- let r = new wt();
2598
+ function $t(e, t, n) {
2599
+ let r = new Zt();
2544
2600
  e.accept(r);
2545
2601
  let i = r.alternations;
2546
2602
  return i = i.filter((e) => !0 !== e.ignoreAmbiguities), i.flatMap((r) => {
2547
- let i = mt(r.idx, e, r.maxLookahead || t, r), a = function(e, t, n, r) {
2603
+ let i = r.idx, a = Vt(i, e, r.maxLookahead || t, r), o = function(e, t, n, r) {
2548
2604
  let i = [];
2549
2605
  return e.reduce((n, r, a) => (!0 === t.definition[a].ignoreAmbiguities || r.forEach((r) => {
2550
2606
  let o = [a];
2551
2607
  e.forEach((e, n) => {
2552
- a !== n && gt(e, r) && !0 !== t.definition[n].ignoreAmbiguities && o.push(n);
2553
- }), o.length > 1 && !gt(i, r) && (i.push(r), n.push({
2608
+ a !== n && Ut(e, r) && !0 !== t.definition[n].ignoreAmbiguities && o.push(n);
2609
+ }), o.length > 1 && !Ut(i, r) && (i.push(r), n.push({
2554
2610
  alts: o,
2555
2611
  path: r
2556
2612
  }));
@@ -2569,7 +2625,7 @@ function Et(e, t, n) {
2569
2625
  alternatives: e.alts
2570
2626
  };
2571
2627
  });
2572
- }(i, r, e, n), o = function(e, t, n, r) {
2628
+ }(a, r, e, n), s = function(e, t, n, r) {
2573
2629
  let i = e.reduce((e, t, n) => {
2574
2630
  let r = t.map((e) => ({
2575
2631
  idx: n,
@@ -2602,11 +2658,11 @@ function Et(e, t, n) {
2602
2658
  };
2603
2659
  });
2604
2660
  });
2605
- }(i, r, e, n);
2606
- return a.concat(o);
2661
+ }(a, r, e, n);
2662
+ return o.concat(s);
2607
2663
  });
2608
2664
  }
2609
- var Dt = class extends y {
2665
+ var en = class extends se {
2610
2666
  constructor() {
2611
2667
  super(...arguments), this.allProductions = [];
2612
2668
  }
@@ -2623,64 +2679,61 @@ var Dt = class extends y {
2623
2679
  this.allProductions.push(e);
2624
2680
  }
2625
2681
  };
2626
- function Ot(e) {
2627
- let t = Object.assign({ errMsgProvider: Je }, e), n = {};
2682
+ function tn(e) {
2683
+ let t = Object.assign({ errMsgProvider: bt }, e), n = {};
2628
2684
  return e.rules.forEach((e) => {
2629
2685
  n[e.name] = e;
2630
2686
  }), function(e, t) {
2631
- let n = new Ye(e, t);
2687
+ let n = new St(e, t);
2632
2688
  return n.resolveRefs(), n.errors;
2633
2689
  }(n, t.errMsgProvider);
2634
2690
  }
2635
- var kt = "MismatchedTokenException", At = "NoViableAltException", jt = "EarlyExitException", Mt = "NotAllInputParsedException", Nt = [
2636
- kt,
2637
- At,
2638
- jt,
2639
- Mt
2691
+ var nn = "MismatchedTokenException", rn = "NoViableAltException", an = "EarlyExitException", on = "NotAllInputParsedException", sn = [
2692
+ nn,
2693
+ rn,
2694
+ an,
2695
+ on
2640
2696
  ];
2641
- function Pt(e) {
2642
- return Nt.includes(e.name);
2697
+ function cn(e) {
2698
+ return sn.includes(e.name);
2643
2699
  }
2644
- Object.freeze(Nt);
2645
- var Ft = class extends Error {
2700
+ Object.freeze(sn);
2701
+ var ln = class extends Error {
2646
2702
  constructor(e, t) {
2647
2703
  super(e), this.token = t, this.resyncedTokens = [], Object.setPrototypeOf(this, new.target.prototype), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
2648
2704
  }
2649
- }, It = class extends Ft {
2705
+ }, un = class extends ln {
2650
2706
  constructor(e, t, n) {
2651
- super(e, t), this.previousToken = n, this.name = kt;
2707
+ super(e, t), this.previousToken = n, this.name = nn;
2652
2708
  }
2653
- }, Lt = class extends Ft {
2709
+ }, dn = class extends ln {
2654
2710
  constructor(e, t, n) {
2655
- super(e, t), this.previousToken = n, this.name = At;
2711
+ super(e, t), this.previousToken = n, this.name = rn;
2656
2712
  }
2657
- }, Rt = class extends Ft {
2713
+ }, fn = class extends ln {
2658
2714
  constructor(e, t) {
2659
- super(e, t), this.name = Mt;
2715
+ super(e, t), this.name = on;
2660
2716
  }
2661
- }, zt = class extends Ft {
2717
+ }, pn = class extends ln {
2662
2718
  constructor(e, t, n) {
2663
- super(e, t), this.previousToken = n, this.name = jt;
2719
+ super(e, t), this.previousToken = n, this.name = an;
2664
2720
  }
2665
- }, Bt = {}, Vt = class extends Error {
2721
+ }, mn = {}, hn = class extends Error {
2666
2722
  constructor(e) {
2667
2723
  super(e), this.name = "InRuleRecoveryException";
2668
2724
  }
2669
2725
  };
2670
- function Ht(e, t, n, r, i, a, o) {
2671
- let s = this.getKeyForAutomaticLookahead(r, i), c = this.firstAfterRepMap[s];
2672
- if (c === void 0) {
2726
+ function gn(e, t, n, r, i, a, o) {
2727
+ var s, c;
2728
+ let l = r | i, u = (s = this.firstAfterRepMap)[c = this.currRuleShortName] ?? (s[c] = []), d = u[l];
2729
+ if (d === void 0) {
2673
2730
  let e = this.getCurrRuleFullName();
2674
- c = new a(this.getGAstProductions()[e], i).startWalking(), this.firstAfterRepMap[s] = c;
2731
+ d = new a(this.getGAstProductions()[e], i).startWalking(), u[l] = d;
2675
2732
  }
2676
- let l = c.token, u = c.occurrence, d = c.isEndOfRule;
2677
- this.RULE_STACK_IDX === 0 && d && l === void 0 && (l = q, u = 1), l !== void 0 && u !== void 0 && this.shouldInRepetitionRecoveryBeTried(l, u, o) && this.tryInRepetitionRecovery(e, t, n, l);
2678
- }
2679
- var Ut = 1024, Wt = 1280, Gt = 1536;
2680
- function Kt(e, t, n) {
2681
- return n | t | e;
2733
+ let f = d.token, p = d.occurrence, m = d.isEndOfRule;
2734
+ this.RULE_STACK_IDX === 0 && m && f === void 0 && (f = X, p = 1), f !== void 0 && p !== void 0 && this.shouldInRepetitionRecoveryBeTried(f, p, o) && this.tryInRepetitionRecovery(e, t, n, f);
2682
2735
  }
2683
- var qt = class {
2736
+ var _n = 1024, vn = 1280, yn = 1536, bn = class {
2684
2737
  constructor(e) {
2685
2738
  this.maxLookahead = e?.maxLookahead ?? $.maxLookahead;
2686
2739
  }
@@ -2698,22 +2751,22 @@ var qt = class {
2698
2751
  return t;
2699
2752
  }
2700
2753
  validateNoLeftRecursion(e) {
2701
- return e.flatMap((e) => St(e, e, J));
2754
+ return e.flatMap((e) => Yt(e, e, xt));
2702
2755
  }
2703
2756
  validateEmptyOrAlternatives(e) {
2704
- return e.flatMap((e) => Tt(e, J));
2757
+ return e.flatMap((e) => Qt(e, xt));
2705
2758
  }
2706
2759
  validateAmbiguousAlternationAlternatives(e, t) {
2707
- return e.flatMap((e) => Et(e, t, J));
2760
+ return e.flatMap((e) => $t(e, t, xt));
2708
2761
  }
2709
2762
  validateSomeNonEmptyLookaheadPath(e, t) {
2710
2763
  return function(e, t, n) {
2711
2764
  let r = [];
2712
2765
  return e.forEach((e) => {
2713
- let i = new Dt();
2766
+ let i = new en();
2714
2767
  e.accept(i), i.allProductions.forEach((i) => {
2715
- let a = at(i), o = i.maxLookahead || t;
2716
- if (ht(i.idx, e, a, o)[0].flat().length === 0) {
2768
+ let a = Mt(i), o = i.maxLookahead || t;
2769
+ if (Ht(i.idx, e, a, o)[0].flat().length === 0) {
2717
2770
  let t = n.buildEmptyRepetitionError({
2718
2771
  topLevelRule: e,
2719
2772
  repetition: i
@@ -2726,21 +2779,21 @@ var qt = class {
2726
2779
  }
2727
2780
  });
2728
2781
  }), r;
2729
- }(e, t, J);
2782
+ }(e, t, xt);
2730
2783
  }
2731
2784
  buildLookaheadForAlternation(e) {
2732
2785
  return function(e, t, n, r, i, a) {
2733
- let o = mt(e, t, n);
2734
- return a(o, r, _t(o) ? Oe : B, i);
2735
- }(e.prodOccurrence, e.rule, e.maxLookahead, e.hasPredicates, e.dynamicTokensEnabled, ot);
2786
+ let o = Vt(e, t, n);
2787
+ return a(o, r, Wt(o) ? Ze : Xe, i);
2788
+ }(e.prodOccurrence, e.rule, e.maxLookahead, e.hasPredicates, e.dynamicTokensEnabled, Nt);
2736
2789
  }
2737
2790
  buildLookaheadForOptional(e) {
2738
2791
  return function(e, t, n, r, i, a) {
2739
- let o = ht(e, t, i, n), s = _t(o) ? Oe : B;
2792
+ let o = Ht(e, t, i, n), s = Wt(o) ? Ze : Xe;
2740
2793
  return a(o[0], s, r);
2741
- }(e.prodOccurrence, e.rule, e.maxLookahead, e.dynamicTokensEnabled, at(e.prodType), st);
2794
+ }(e.prodOccurrence, e.rule, e.maxLookahead, e.dynamicTokensEnabled, Mt(e.prodType), Pt);
2742
2795
  }
2743
- }, Jt = new class extends y {
2796
+ }, xn = new class extends se {
2744
2797
  constructor() {
2745
2798
  super(...arguments), this.dslMethods = {
2746
2799
  option: [],
@@ -2780,14 +2833,14 @@ var qt = class {
2780
2833
  this.dslMethods.alternation.push(e);
2781
2834
  }
2782
2835
  }();
2783
- function Yt(e, t) {
2836
+ function Sn(e, t) {
2784
2837
  e.startOffset === -1 ? (e.startOffset = t.startOffset, e.endOffset = t.endOffset) : e.endOffset < t.endOffset == 1 && (e.endOffset = t.endOffset);
2785
2838
  }
2786
- function Xt(e, t) {
2839
+ function Cn(e, t) {
2787
2840
  e.startOffset === -1 ? (e.startOffset = t.startOffset, e.startColumn = t.startColumn, e.startLine = t.startLine, e.endOffset = t.endOffset, e.endColumn = t.endColumn, e.endLine = t.endLine) : e.endOffset < t.endOffset == 1 && (e.endOffset = t.endOffset, e.endColumn = t.endColumn, e.endLine = t.endLine);
2788
2841
  }
2789
- var Zt;
2790
- function Qt(e, t) {
2842
+ var wn;
2843
+ function Tn(e, t) {
2791
2844
  Object.defineProperty(e, "name", {
2792
2845
  enumerable: !1,
2793
2846
  configurable: !0,
@@ -2795,7 +2848,7 @@ function Qt(e, t) {
2795
2848
  value: t
2796
2849
  });
2797
2850
  }
2798
- function $t(e, t) {
2851
+ function En(e, t) {
2799
2852
  let n = Object.keys(e), r = n.length;
2800
2853
  for (let i = 0; i < r; i++) {
2801
2854
  let r = e[n[i]], a = r.length;
@@ -2805,9 +2858,9 @@ function $t(e, t) {
2805
2858
  }
2806
2859
  }
2807
2860
  }
2808
- function en(e, t) {
2861
+ function Dn(e, t) {
2809
2862
  let n = function() {};
2810
- return Qt(n, e + "BaseSemantics"), n.prototype = {
2863
+ return Tn(n, e + "BaseSemantics"), n.prototype = {
2811
2864
  visit: function(e, t) {
2812
2865
  if (Array.isArray(e) && (e = e[0]), e !== void 0) return this[e.name](e.children, t);
2813
2866
  },
@@ -2816,7 +2869,7 @@ function en(e, t) {
2816
2869
  return function(e, t) {
2817
2870
  return t.filter((t) => typeof e[t] == "function" == 0).map((t) => ({
2818
2871
  msg: `Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,
2819
- type: Zt.MISSING_METHOD,
2872
+ type: wn.MISSING_METHOD,
2820
2873
  methodName: t
2821
2874
  })).filter(Boolean);
2822
2875
  }(e, t);
@@ -2830,68 +2883,68 @@ function en(e, t) {
2830
2883
  }
2831
2884
  (function(e) {
2832
2885
  e[e.REDUNDANT_METHOD = 0] = "REDUNDANT_METHOD", e[e.MISSING_METHOD = 1] = "MISSING_METHOD";
2833
- })(Zt ||= {});
2834
- var tn = { description: "This Object indicates the Parser is during Recording Phase" };
2835
- Object.freeze(tn);
2836
- var nn = !0, rn = 2 ** 8 - 1, an = K({
2886
+ })(wn ||= {});
2887
+ var On = { description: "This Object indicates the Parser is during Recording Phase" };
2888
+ Object.freeze(On);
2889
+ var kn = !0, An = Y({
2837
2890
  name: "RECORDING_PHASE_TOKEN",
2838
- pattern: W.NA
2891
+ pattern: J.NA
2839
2892
  });
2840
- V([an]);
2841
- var on = Ke(an, "This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details", -1, -1, -1, -1, -1, -1);
2842
- Object.freeze(on);
2843
- var sn = {
2893
+ et([An]);
2894
+ var jn = vt(An, "This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details", -1, -1, -1, -1, -1, -1);
2895
+ Object.freeze(jn);
2896
+ var Mn = {
2844
2897
  name: "This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",
2845
2898
  children: {}
2846
2899
  };
2847
- function X(e, t, n, r = !1) {
2848
- un(n);
2900
+ function Nn(e, t, n, r = !1) {
2901
+ In(n);
2849
2902
  let i = this.recordingProdStack.at(-1), a = typeof t == "function" ? t : t.DEF, o = new e({
2850
2903
  definition: [],
2851
2904
  idx: n
2852
2905
  });
2853
- return r && (o.separator = t.SEP), Object.hasOwn(t, "MAX_LOOKAHEAD") && (o.maxLookahead = t.MAX_LOOKAHEAD), this.recordingProdStack.push(o), a.call(this), i.definition.push(o), this.recordingProdStack.pop(), tn;
2906
+ return r && (o.separator = t.SEP), Object.hasOwn(t, "MAX_LOOKAHEAD") && (o.maxLookahead = t.MAX_LOOKAHEAD), this.recordingProdStack.push(o), a.call(this), i.definition.push(o), this.recordingProdStack.pop(), On;
2854
2907
  }
2855
- function cn(e, t) {
2856
- un(t);
2857
- let n = this.recordingProdStack.at(-1), r = !1 === Array.isArray(e), i = !1 === r ? e : e.DEF, a = new h({
2908
+ function Pn(e, t) {
2909
+ In(t);
2910
+ let n = this.recordingProdStack.at(-1), r = !1 === Array.isArray(e), i = !1 === r ? e : e.DEF, a = new R({
2858
2911
  definition: [],
2859
2912
  idx: t,
2860
2913
  ignoreAmbiguities: r && !0 === e.IGNORE_AMBIGUITIES
2861
2914
  });
2862
2915
  return Object.hasOwn(e, "MAX_LOOKAHEAD") && (a.maxLookahead = e.MAX_LOOKAHEAD), a.hasPredicates = i.some((e) => typeof e.GATE == "function"), n.definition.push(a), i.forEach((e) => {
2863
- let t = new l({ definition: [] });
2916
+ let t = new M({ definition: [] });
2864
2917
  a.definition.push(t), Object.hasOwn(e, "IGNORE_AMBIGUITIES") ? t.ignoreAmbiguities = e.IGNORE_AMBIGUITIES : Object.hasOwn(e, "GATE") && (t.ignoreAmbiguities = !0), this.recordingProdStack.push(t), e.ALT.call(this), this.recordingProdStack.pop();
2865
- }), tn;
2918
+ }), On;
2866
2919
  }
2867
- function ln(e) {
2920
+ function Fn(e) {
2868
2921
  return e === 0 ? "" : `${e}`;
2869
2922
  }
2870
- function un(e) {
2871
- if (e < 0 || e > rn) {
2872
- let t = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${rn + 1}`);
2923
+ function In(e) {
2924
+ if (e < 0 || e > 255) {
2925
+ let t = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than 256`);
2873
2926
  throw t.KNOWN_RECORDER_ERROR = !0, t;
2874
2927
  }
2875
2928
  }
2876
- var Z = Ke(q, "", -1, -1, -1, -1, -1, -1);
2877
- Object.freeze(Z);
2929
+ var Ln = vt(X, "", -1, -1, -1, -1, -1, -1);
2930
+ Object.freeze(Ln);
2878
2931
  var Q, $ = Object.freeze({
2879
2932
  recoveryEnabled: !1,
2880
2933
  maxLookahead: 3,
2881
2934
  dynamicTokensEnabled: !1,
2882
2935
  outputCst: !0,
2883
- errorMessageProvider: qe,
2936
+ errorMessageProvider: yt,
2884
2937
  nodeLocationTracking: "none",
2885
2938
  traceInitPerf: !1,
2886
2939
  skipValidations: !1
2887
- }), dn = Object.freeze({
2940
+ }), Rn = Object.freeze({
2888
2941
  recoveryValueFunc: () => {},
2889
2942
  resyncEnabled: !0
2890
2943
  });
2891
2944
  (function(e) {
2892
2945
  e[e.INVALID_RULE_NAME = 0] = "INVALID_RULE_NAME", e[e.DUPLICATE_RULE_NAME = 1] = "DUPLICATE_RULE_NAME", e[e.INVALID_RULE_OVERRIDE = 2] = "INVALID_RULE_OVERRIDE", e[e.DUPLICATE_PRODUCTIONS = 3] = "DUPLICATE_PRODUCTIONS", e[e.UNRESOLVED_SUBRULE_REF = 4] = "UNRESOLVED_SUBRULE_REF", e[e.LEFT_RECURSION = 5] = "LEFT_RECURSION", e[e.NONE_LAST_EMPTY_ALT = 6] = "NONE_LAST_EMPTY_ALT", e[e.AMBIGUOUS_ALTS = 7] = "AMBIGUOUS_ALTS", e[e.CONFLICT_TOKENS_RULES_NAMESPACE = 8] = "CONFLICT_TOKENS_RULES_NAMESPACE", e[e.INVALID_TOKEN_NAME = 9] = "INVALID_TOKEN_NAME", e[e.NO_NON_EMPTY_LOOKAHEAD = 10] = "NO_NON_EMPTY_LOOKAHEAD", e[e.AMBIGUOUS_PREFIX_ALTS = 11] = "AMBIGUOUS_PREFIX_ALTS", e[e.TOO_MANY_ALTS = 12] = "TOO_MANY_ALTS", e[e.CUSTOM_LOOKAHEAD_VALIDATION = 13] = "CUSTOM_LOOKAHEAD_VALIDATION";
2893
2946
  })(Q ||= {});
2894
- var fn, pn = class e {
2947
+ var zn, Bn = class e {
2895
2948
  static performSelfAnalysis(e) {
2896
2949
  throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.");
2897
2950
  }
@@ -2901,7 +2954,7 @@ var fn, pn = class e {
2901
2954
  this.selfAnalysisDone = !0;
2902
2955
  let n = this.className;
2903
2956
  this.TRACE_INIT("toFastProps", () => {
2904
- a(this);
2957
+ O(this);
2905
2958
  }), this.TRACE_INIT("Grammar Recording", () => {
2906
2959
  try {
2907
2960
  this.enableRecording(), this.definedRulesNames.forEach((e) => {
@@ -2916,16 +2969,16 @@ var fn, pn = class e {
2916
2969
  });
2917
2970
  let r = [];
2918
2971
  if (this.TRACE_INIT("Grammar Resolving", () => {
2919
- r = Ot({ rules: Object.values(this.gastProductionsCache) }), this.definitionErrors = this.definitionErrors.concat(r);
2972
+ r = tn({ rules: Object.values(this.gastProductionsCache) }), this.definitionErrors = this.definitionErrors.concat(r);
2920
2973
  }), this.TRACE_INIT("Grammar Validations", () => {
2921
2974
  if (r.length === 0 && !1 === this.skipValidations) {
2922
2975
  let t = function(e) {
2923
- let t = e.errMsgProvider ?? J;
2924
- return vt(e.rules, e.tokenTypes, t, e.grammarName);
2976
+ let t = e.errMsgProvider ?? xt;
2977
+ return Gt(e.rules, e.tokenTypes, t, e.grammarName);
2925
2978
  }({
2926
2979
  rules: Object.values(this.gastProductionsCache),
2927
2980
  tokenTypes: Object.values(this.tokensMap),
2928
- errMsgProvider: J,
2981
+ errMsgProvider: xt,
2929
2982
  grammarName: n
2930
2983
  }), r = (e = {
2931
2984
  lookaheadStrategy: this.lookaheadStrategy,
@@ -2944,7 +2997,7 @@ var fn, pn = class e {
2944
2997
  let e = function(e) {
2945
2998
  let t = {};
2946
2999
  return e.forEach((e) => {
2947
- let n = new E(e).startWalking();
3000
+ let n = new pe(e).startWalking();
2948
3001
  Object.assign(t, n);
2949
3002
  }), t;
2950
3003
  }(Object.values(this.gastProductionsCache));
@@ -2962,13 +3015,13 @@ var fn, pn = class e {
2962
3015
  this.skipValidations = Object.hasOwn(t, "skipValidations") ? t.skipValidations : $.skipValidations;
2963
3016
  }
2964
3017
  };
2965
- pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3018
+ Bn.DEFER_DEFINITION_ERRORS_HANDLING = !1, zn = Bn, [
2966
3019
  class {
2967
3020
  initRecoverable(e) {
2968
- this.firstAfterRepMap = {}, this.resyncFollows = {}, this.recoveryEnabled = Object.hasOwn(e, "recoveryEnabled") ? e.recoveryEnabled : $.recoveryEnabled, this.recoveryEnabled && (this.attemptInRepetitionRecovery = Ht);
3021
+ this.firstAfterRepMap = [], this.resyncFollows = {}, this.recoveryEnabled = Object.hasOwn(e, "recoveryEnabled") ? e.recoveryEnabled : $.recoveryEnabled, this.recoveryEnabled && (this.attemptInRepetitionRecovery = gn);
2969
3022
  }
2970
3023
  getTokenToInsert(e) {
2971
- let t = Ke(e, "", -1, -1, -1, -1, -1, -1);
3024
+ let t = vt(e, "", -1, -1, -1, -1, -1, -1);
2972
3025
  return t.isInsertedInRecovery = !0, t;
2973
3026
  }
2974
3027
  canTokenTypeBeInsertedInRecovery(e) {
@@ -2979,7 +3032,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
2979
3032
  }
2980
3033
  tryInRepetitionRecovery(e, t, n, r) {
2981
3034
  let i = this.findReSyncTokenType(), a = this.exportLexerState(), o = [], s = !1, c = this.LA_FAST(1), l = this.LA_FAST(1), u = () => {
2982
- let e = this.LA(0), t = new It(this.errorMessageProvider.buildMismatchTokenMessage({
3035
+ let e = this.LA(0), t = new un(this.errorMessageProvider.buildMismatchTokenMessage({
2983
3036
  expected: r,
2984
3037
  actual: c,
2985
3038
  previous: e,
@@ -2999,7 +3052,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
2999
3052
  }
3000
3053
  getNextPossibleTokenTypes(e) {
3001
3054
  let t = e.ruleStack[0], n = this.getGAstProductions()[t];
3002
- return new Ze(n, e).startWalking();
3055
+ return new wt(n, e).startWalking();
3003
3056
  }
3004
3057
  getFollowsForInRuleRecovery(e, t) {
3005
3058
  let n = this.getCurrentGrammarPath(e, t);
@@ -3011,7 +3064,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3011
3064
  let e = this.SKIP_TOKEN();
3012
3065
  return this.consumeToken(), e;
3013
3066
  }
3014
- throw new Vt("sad sad panda");
3067
+ throw new hn("sad sad panda");
3015
3068
  }
3016
3069
  canPerformInRuleRecovery(e, t) {
3017
3070
  return this.canRecoverWithSingleTokenInsertion(e, t) || this.canRecoverWithSingleTokenDeletion(e);
@@ -3031,13 +3084,13 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3031
3084
  findReSyncTokenType() {
3032
3085
  let e = this.flattenFollowSet(), t = this.LA_FAST(1), n = 2;
3033
3086
  for (;;) {
3034
- let r = e.find((e) => B(t, e));
3087
+ let r = e.find((e) => Xe(t, e));
3035
3088
  if (r !== void 0) return r;
3036
3089
  t = this.LA(n), n++;
3037
3090
  }
3038
3091
  }
3039
3092
  getCurrFollowKey() {
3040
- if (this.RULE_STACK_IDX === 0) return Bt;
3093
+ if (this.RULE_STACK_IDX === 0) return mn;
3041
3094
  let e = this.currRuleShortName, t = this.getLastExplicitRuleOccurrenceIndex(), n = this.getPreviousExplicitRuleShortName();
3042
3095
  return {
3043
3096
  ruleName: this.shortRuleNameToFullName(e),
@@ -3047,7 +3100,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3047
3100
  }
3048
3101
  buildFullFollowKeyStack() {
3049
3102
  let e = this.RULE_STACK, t = this.RULE_OCCURRENCE_STACK, n = this.RULE_STACK_IDX + 1, r = Array(n);
3050
- for (let i = 0; i < n; i++) r[i] = i === 0 ? Bt : {
3103
+ for (let i = 0; i < n; i++) r[i] = i === 0 ? mn : {
3051
3104
  ruleName: this.shortRuleNameToFullName(e[i]),
3052
3105
  idxInCallingRule: t[i],
3053
3106
  inRule: this.shortRuleNameToFullName(e[i - 1])
@@ -3058,12 +3111,12 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3058
3111
  return this.buildFullFollowKeyStack().map((e) => this.getFollowSetFromFollowKey(e)).flat();
3059
3112
  }
3060
3113
  getFollowSetFromFollowKey(e) {
3061
- if (e === Bt) return [q];
3062
- let t = e.ruleName + e.idxInCallingRule + T + e.inRule;
3114
+ if (e === mn) return [X];
3115
+ let t = e.ruleName + e.idxInCallingRule + fe + e.inRule;
3063
3116
  return this.resyncFollows[t];
3064
3117
  }
3065
3118
  addToResyncTokens(e, t) {
3066
- return this.tokenMatcher(e, q) || t.push(e), t;
3119
+ return this.tokenMatcher(e, X) || t.push(e), t;
3067
3120
  }
3068
3121
  reSyncTo(e) {
3069
3122
  let t = [], n = this.LA_FAST(1);
@@ -3087,38 +3140,38 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3087
3140
  },
3088
3141
  class {
3089
3142
  initLooksAhead(e) {
3090
- this.dynamicTokensEnabled = Object.hasOwn(e, "dynamicTokensEnabled") ? e.dynamicTokensEnabled : $.dynamicTokensEnabled, this.maxLookahead = Object.hasOwn(e, "maxLookahead") ? e.maxLookahead : $.maxLookahead, this.lookaheadStrategy = Object.hasOwn(e, "lookaheadStrategy") ? e.lookaheadStrategy : new qt({ maxLookahead: this.maxLookahead }), this.lookAheadFuncsCache = /* @__PURE__ */ new Map();
3143
+ this.dynamicTokensEnabled = Object.hasOwn(e, "dynamicTokensEnabled") ? e.dynamicTokensEnabled : $.dynamicTokensEnabled, this.maxLookahead = Object.hasOwn(e, "maxLookahead") ? e.maxLookahead : $.maxLookahead, this.lookaheadStrategy = Object.hasOwn(e, "lookaheadStrategy") ? e.lookaheadStrategy : new bn({ maxLookahead: this.maxLookahead }), this.lookAheadFuncsCache = [], this.currRuleLookaheadFuncs = [];
3091
3144
  }
3092
3145
  preComputeLookaheadFunctions(e) {
3093
3146
  e.forEach((e) => {
3094
3147
  this.TRACE_INIT(`${e.name} Rule Lookahead`, () => {
3095
3148
  let { alternation: t, repetition: n, option: r, repetitionMandatory: i, repetitionMandatoryWithSeparator: a, repetitionWithSeparator: o } = function(e) {
3096
- Jt.reset(), e.accept(Jt);
3097
- let t = Jt.dslMethods;
3098
- return Jt.reset(), t;
3149
+ xn.reset(), e.accept(xn);
3150
+ let t = xn.dslMethods;
3151
+ return xn.reset(), t;
3099
3152
  }(e);
3100
3153
  t.forEach((t) => {
3101
3154
  let n = t.idx === 0 ? "" : t.idx;
3102
- this.TRACE_INIT(`${x(t)}${n}`, () => {
3155
+ this.TRACE_INIT(`${V(t)}${n}`, () => {
3103
3156
  let n = this.lookaheadStrategy.buildLookaheadForAlternation({
3104
3157
  prodOccurrence: t.idx,
3105
3158
  rule: e,
3106
3159
  maxLookahead: t.maxLookahead || this.maxLookahead,
3107
3160
  hasPredicates: t.hasPredicates,
3108
3161
  dynamicTokensEnabled: this.dynamicTokensEnabled
3109
- }), r = Kt(this.fullRuleNameToShort[e.name], 256, t.idx);
3110
- this.setLaFuncCache(r, n);
3162
+ });
3163
+ this.setLaFuncCache(this.fullRuleNameToShort[e.name], 256 | t.idx, n);
3111
3164
  });
3112
3165
  }), n.forEach((t) => {
3113
- this.computeLookaheadFunc(e, t.idx, 768, "Repetition", t.maxLookahead, x(t));
3166
+ this.computeLookaheadFunc(e, t.idx, 768, "Repetition", t.maxLookahead, V(t));
3114
3167
  }), r.forEach((t) => {
3115
- this.computeLookaheadFunc(e, t.idx, 512, "Option", t.maxLookahead, x(t));
3168
+ this.computeLookaheadFunc(e, t.idx, 512, "Option", t.maxLookahead, V(t));
3116
3169
  }), i.forEach((t) => {
3117
- this.computeLookaheadFunc(e, t.idx, Ut, "RepetitionMandatory", t.maxLookahead, x(t));
3170
+ this.computeLookaheadFunc(e, t.idx, _n, "RepetitionMandatory", t.maxLookahead, V(t));
3118
3171
  }), a.forEach((t) => {
3119
- this.computeLookaheadFunc(e, t.idx, Gt, "RepetitionMandatoryWithSeparator", t.maxLookahead, x(t));
3172
+ this.computeLookaheadFunc(e, t.idx, yn, "RepetitionMandatoryWithSeparator", t.maxLookahead, V(t));
3120
3173
  }), o.forEach((t) => {
3121
- this.computeLookaheadFunc(e, t.idx, Wt, "RepetitionWithSeparator", t.maxLookahead, x(t));
3174
+ this.computeLookaheadFunc(e, t.idx, vn, "RepetitionWithSeparator", t.maxLookahead, V(t));
3122
3175
  });
3123
3176
  });
3124
3177
  });
@@ -3131,29 +3184,25 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3131
3184
  maxLookahead: i || this.maxLookahead,
3132
3185
  dynamicTokensEnabled: this.dynamicTokensEnabled,
3133
3186
  prodType: r
3134
- }), o = Kt(this.fullRuleNameToShort[e.name], n, t);
3135
- this.setLaFuncCache(o, a);
3187
+ });
3188
+ this.setLaFuncCache(this.fullRuleNameToShort[e.name], n | t, a);
3136
3189
  });
3137
3190
  }
3138
- getKeyForAutomaticLookahead(e, t) {
3139
- return Kt(this.currRuleShortName, e, t);
3140
- }
3141
- getLaFuncFromCache(e) {
3142
- return this.lookAheadFuncsCache.get(e);
3143
- }
3144
- setLaFuncCache(e, t) {
3145
- this.lookAheadFuncsCache.set(e, t);
3191
+ setLaFuncCache(e, t, n) {
3192
+ let r = this.lookAheadFuncsCache[e];
3193
+ r === void 0 && (r = [], this.lookAheadFuncsCache[e] = r), r[t] = n;
3146
3194
  }
3147
3195
  },
3148
3196
  class {
3149
3197
  initTreeBuilder(e) {
3150
- if (this.CST_STACK = [], this.outputCst = e.outputCst, this.nodeLocationTracking = Object.hasOwn(e, "nodeLocationTracking") ? e.nodeLocationTracking : $.nodeLocationTracking, this.outputCst) if (/full/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = Xt, this.setNodeLocationFromNode = Xt, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleFull, this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular);
3151
- else if (/onlyOffset/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = Yt, this.setNodeLocationFromNode = Yt, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleOnlyOffset, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular);
3152
- else {
3153
- if (!/none/i.test(this.nodeLocationTracking)) throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);
3154
- this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = () => {}, this.setInitialNodeLocation = () => {};
3155
- }
3156
- else this.cstInvocationStateUpdate = () => {}, this.cstFinallyStateUpdate = () => {}, this.cstPostTerminal = () => {}, this.cstPostNonTerminal = () => {}, this.cstPostRule = () => {};
3198
+ if (this.CST_STACK = [], this.outputCst = e.outputCst, this.nodeLocationTracking = Object.hasOwn(e, "nodeLocationTracking") ? e.nodeLocationTracking : $.nodeLocationTracking, this.outputCst) {
3199
+ if (/full/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = Cn, this.setNodeLocationFromNode = Cn, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleFull, this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular);
3200
+ else if (/onlyOffset/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = Sn, this.setNodeLocationFromNode = Sn, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleOnlyOffset, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular);
3201
+ else {
3202
+ if (!/none/i.test(this.nodeLocationTracking)) throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);
3203
+ this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = () => {}, this.setInitialNodeLocation = () => {};
3204
+ }
3205
+ } else this.cstInvocationStateUpdate = () => {}, this.cstFinallyStateUpdate = () => {}, this.cstPostTerminal = () => {}, this.cstPostNonTerminal = () => {}, this.cstPostRule = () => {};
3157
3206
  }
3158
3207
  setInitialNodeLocationOnlyOffsetRecovery(e) {
3159
3208
  e.location = {
@@ -3222,7 +3271,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3222
3271
  }
3223
3272
  getBaseCstVisitorConstructor() {
3224
3273
  if (this.baseCstVisitorConstructor === void 0) {
3225
- let e = en(this.className, Object.keys(this.gastProductionsCache));
3274
+ let e = Dn(this.className, Object.keys(this.gastProductionsCache));
3226
3275
  return this.baseCstVisitorConstructor = e, e;
3227
3276
  }
3228
3277
  return this.baseCstVisitorConstructor;
@@ -3231,10 +3280,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3231
3280
  if (this.baseCstVisitorWithDefaultsConstructor === void 0) {
3232
3281
  let e = function(e, t, n) {
3233
3282
  let r = function() {};
3234
- Qt(r, e + "BaseSemanticsWithDefaults");
3283
+ Tn(r, e + "BaseSemanticsWithDefaults");
3235
3284
  let i = Object.create(n.prototype);
3236
3285
  return t.forEach((e) => {
3237
- i[e] = $t;
3286
+ i[e] = En;
3238
3287
  }), (r.prototype = i).constructor = r, r;
3239
3288
  }(this.className, Object.keys(this.gastProductionsCache), this.getBaseCstVisitorConstructor());
3240
3289
  return this.baseCstVisitorWithDefaultsConstructor = e, e;
@@ -3260,7 +3309,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3260
3309
  return this.tokVector;
3261
3310
  }
3262
3311
  SKIP_TOKEN() {
3263
- return this.currIdx <= this.tokVectorLength - 2 ? (this.consumeToken(), this.LA_FAST(1)) : Z;
3312
+ return this.currIdx <= this.tokVectorLength - 2 ? (this.consumeToken(), this.LA_FAST(1)) : Ln;
3264
3313
  }
3265
3314
  LA_FAST(e) {
3266
3315
  let t = this.currIdx + e;
@@ -3268,7 +3317,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3268
3317
  }
3269
3318
  LA(e) {
3270
3319
  let t = this.currIdx + e;
3271
- return t < 0 || this.tokVectorLength <= t ? Z : this.tokVector[t];
3320
+ return t < 0 || this.tokVectorLength <= t ? Ln : this.tokVector[t];
3272
3321
  }
3273
3322
  consumeToken() {
3274
3323
  this.currIdx++;
@@ -3291,27 +3340,27 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3291
3340
  },
3292
3341
  class {
3293
3342
  initRecognizerEngine(e, t) {
3294
- if (this.className = this.constructor.name, this.shortRuleNameToFull = {}, this.fullRuleNameToShort = {}, this.ruleShortNameIdx = 256, this.tokenMatcher = Oe, this.subruleIdx = 0, this.currRuleShortName = 0, this.definedRulesNames = [], this.tokensMap = {}, this.isBackTrackingStack = [], this.RULE_STACK = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK = [], this.RULE_OCCURRENCE_STACK_IDX = -1, this.gastProductionsCache = {}, Object.hasOwn(t, "serializedGrammar")) throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");
3343
+ if (this.className = this.constructor.name, this.shortRuleNameToFull = [], this.fullRuleNameToShort = {}, this.ruleShortNameIdx = 0, this.tokenMatcher = Ze, this.subruleIdx = 0, this.currRuleShortName = -1, this.definedRulesNames = [], this.tokensMap = {}, this.isBackTrackingStack = [], this.RULE_STACK = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK = [], this.RULE_OCCURRENCE_STACK_IDX = -1, this.gastProductionsCache = {}, Object.hasOwn(t, "serializedGrammar")) throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");
3295
3344
  if (Array.isArray(e)) {
3296
3345
  if (e.length === 0) throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).");
3297
3346
  if (typeof e[0].startOffset == "number") throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.");
3298
3347
  }
3299
3348
  if (Array.isArray(e)) this.tokensMap = e.reduce((e, t) => (e[t.name] = t, e), {});
3300
- else if (Object.hasOwn(e, "modes") && Object.values(e.modes).flat().every(Pe)) {
3349
+ else if (Object.hasOwn(e, "modes") && Object.values(e.modes).flat().every(it)) {
3301
3350
  let t = Object.values(e.modes).flat(), n = [...new Set(t)];
3302
3351
  this.tokensMap = n.reduce((e, t) => (e[t.name] = t, e), {});
3303
3352
  } else {
3304
3353
  if (typeof e != "object" || !e) throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");
3305
3354
  this.tokensMap = Object.assign({}, e);
3306
3355
  }
3307
- this.tokensMap.EOF = q;
3356
+ this.tokensMap.EOF = X;
3308
3357
  let n = (Object.hasOwn(e, "modes") ? Object.values(e.modes).flat() : Object.values(e)).every((e) => e.categoryMatches?.length == 0);
3309
- this.tokenMatcher = n ? Oe : B, V(Object.values(this.tokensMap));
3358
+ this.tokenMatcher = n ? Ze : Xe, et(Object.values(this.tokensMap));
3310
3359
  }
3311
3360
  defineRule(e, t, n) {
3312
3361
  if (this.selfAnalysisDone) throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);
3313
- let r = Object.hasOwn(n, "resyncEnabled") ? n.resyncEnabled : dn.resyncEnabled, i = Object.hasOwn(n, "recoveryValueFunc") ? n.recoveryValueFunc : dn.recoveryValueFunc, a = this.ruleShortNameIdx << 12, o;
3314
- return this.ruleShortNameIdx++, this.shortRuleNameToFull[a] = e, this.fullRuleNameToShort[e] = a, o = !0 === this.outputCst ? function(...n) {
3362
+ let r = Object.hasOwn(n, "resyncEnabled") ? n.resyncEnabled : Rn.resyncEnabled, i = Object.hasOwn(n, "recoveryValueFunc") ? n.recoveryValueFunc : Rn.recoveryValueFunc, a = this.ruleShortNameIdx++, o;
3363
+ return this.shortRuleNameToFull[a] = e, this.fullRuleNameToShort[e] = a, o = !0 === this.outputCst ? function(...n) {
3315
3364
  try {
3316
3365
  this.ruleInvocationStateUpdate(a, e, this.subruleIdx), t.apply(this, n);
3317
3366
  let r = this.CST_STACK[this.CST_STACK.length - 1];
@@ -3344,7 +3393,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3344
3393
  }
3345
3394
  invokeRuleCatch(e, t, n) {
3346
3395
  let r = this.RULE_STACK_IDX === 0, i = t && !this.isBackTracking() && this.recoveryEnabled;
3347
- if (Pt(e)) {
3396
+ if (cn(e)) {
3348
3397
  let t = e;
3349
3398
  if (i) {
3350
3399
  let r = this.findReSyncTokenType();
@@ -3367,11 +3416,11 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3367
3416
  throw e;
3368
3417
  }
3369
3418
  optionInternal(e, t) {
3370
- let n = this.getKeyForAutomaticLookahead(512, t);
3419
+ let n = 512 | t;
3371
3420
  return this.optionInternalLogic(e, t, n);
3372
3421
  }
3373
3422
  optionInternalLogic(e, t, n) {
3374
- let r, i = this.getLaFuncFromCache(n);
3423
+ let r, i = this.currRuleLookaheadFuncs[n];
3375
3424
  if (typeof e != "function") {
3376
3425
  r = e.DEF;
3377
3426
  let t = e.GATE;
@@ -3383,11 +3432,11 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3383
3432
  if (!0 === i.call(this)) return r.call(this);
3384
3433
  }
3385
3434
  atLeastOneInternal(e, t) {
3386
- let n = this.getKeyForAutomaticLookahead(Ut, e);
3435
+ let n = _n | e;
3387
3436
  return this.atLeastOneInternalLogic(e, t, n);
3388
3437
  }
3389
3438
  atLeastOneInternalLogic(e, t, n) {
3390
- let r, i = this.getLaFuncFromCache(n);
3439
+ let r, i = this.currRuleLookaheadFuncs[n];
3391
3440
  if (typeof t != "function") {
3392
3441
  r = t.DEF;
3393
3442
  let e = t.GATE;
@@ -3396,20 +3445,20 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3396
3445
  i = () => e.call(this) && t.call(this);
3397
3446
  }
3398
3447
  } else r = t;
3399
- if (!0 !== i.call(this)) throw this.raiseEarlyExitException(e, Y.REPETITION_MANDATORY, t.ERR_MSG);
3448
+ if (!0 !== i.call(this)) throw this.raiseEarlyExitException(e, Z.REPETITION_MANDATORY, t.ERR_MSG);
3400
3449
  {
3401
3450
  let e = this.doSingleRepetition(r);
3402
3451
  for (; !0 === i.call(this) && !0 === e;) e = this.doSingleRepetition(r);
3403
3452
  }
3404
- this.attemptInRepetitionRecovery(this.atLeastOneInternal, [e, t], i, Ut, e, tt);
3453
+ this.attemptInRepetitionRecovery(this.atLeastOneInternal, [e, t], i, _n, e, Ot);
3405
3454
  }
3406
3455
  atLeastOneSepFirstInternal(e, t) {
3407
- let n = this.getKeyForAutomaticLookahead(Gt, e);
3456
+ let n = yn | e;
3408
3457
  this.atLeastOneSepFirstInternalLogic(e, t, n);
3409
3458
  }
3410
3459
  atLeastOneSepFirstInternalLogic(e, t, n) {
3411
3460
  let r = t.DEF, i = t.SEP;
3412
- if (!0 !== this.getLaFuncFromCache(n).call(this)) throw this.raiseEarlyExitException(e, Y.REPETITION_MANDATORY_WITH_SEPARATOR, t.ERR_MSG);
3461
+ if (!0 !== this.currRuleLookaheadFuncs[n].call(this)) throw this.raiseEarlyExitException(e, Z.REPETITION_MANDATORY_WITH_SEPARATOR, t.ERR_MSG);
3413
3462
  {
3414
3463
  r.call(this);
3415
3464
  let t = () => this.tokenMatcher(this.LA_FAST(1), i);
@@ -3419,16 +3468,16 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3419
3468
  i,
3420
3469
  t,
3421
3470
  r,
3422
- nt
3423
- ], t, Gt, e, nt);
3471
+ kt
3472
+ ], t, yn, e, kt);
3424
3473
  }
3425
3474
  }
3426
3475
  manyInternal(e, t) {
3427
- let n = this.getKeyForAutomaticLookahead(768, e);
3476
+ let n = 768 | e;
3428
3477
  return this.manyInternalLogic(e, t, n);
3429
3478
  }
3430
3479
  manyInternalLogic(e, t, n) {
3431
- let r, i = this.getLaFuncFromCache(n);
3480
+ let r, i = this.currRuleLookaheadFuncs[n];
3432
3481
  if (typeof t != "function") {
3433
3482
  r = t.DEF;
3434
3483
  let e = t.GATE;
@@ -3439,15 +3488,15 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3439
3488
  } else r = t;
3440
3489
  let a = !0;
3441
3490
  for (; !0 === i.call(this) && !0 === a;) a = this.doSingleRepetition(r);
3442
- this.attemptInRepetitionRecovery(this.manyInternal, [e, t], i, 768, e, $e, a);
3491
+ this.attemptInRepetitionRecovery(this.manyInternal, [e, t], i, 768, e, Et, a);
3443
3492
  }
3444
3493
  manySepFirstInternal(e, t) {
3445
- let n = this.getKeyForAutomaticLookahead(Wt, e);
3494
+ let n = vn | e;
3446
3495
  this.manySepFirstInternalLogic(e, t, n);
3447
3496
  }
3448
3497
  manySepFirstInternalLogic(e, t, n) {
3449
3498
  let r = t.DEF, i = t.SEP;
3450
- if (!0 === this.getLaFuncFromCache(n).call(this)) {
3499
+ if (!0 === this.currRuleLookaheadFuncs[n].call(this)) {
3451
3500
  r.call(this);
3452
3501
  let t = () => this.tokenMatcher(this.LA_FAST(1), i);
3453
3502
  for (; !0 === this.tokenMatcher(this.LA_FAST(1), i);) this.CONSUME(i), r.call(this);
@@ -3456,8 +3505,8 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3456
3505
  i,
3457
3506
  t,
3458
3507
  r,
3459
- et
3460
- ], t, Wt, e, et);
3508
+ Dt
3509
+ ], t, vn, e, Dt);
3461
3510
  }
3462
3511
  }
3463
3512
  repetitionSepSecondInternal(e, t, n, r, i) {
@@ -3468,19 +3517,19 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3468
3517
  n,
3469
3518
  r,
3470
3519
  i
3471
- ], n, Gt, e, i);
3520
+ ], n, yn, e, i);
3472
3521
  }
3473
3522
  doSingleRepetition(e) {
3474
3523
  let t = this.getLexerPosition();
3475
3524
  return e.call(this), this.getLexerPosition() > t;
3476
3525
  }
3477
3526
  orInternal(e, t) {
3478
- let n = this.getKeyForAutomaticLookahead(256, t), r = Array.isArray(e) ? e : e.DEF, i = this.getLaFuncFromCache(n).call(this, r);
3527
+ let n = 256 | t, r = Array.isArray(e) ? e : e.DEF, i = this.currRuleLookaheadFuncs[n].call(this, r);
3479
3528
  if (i !== void 0) return r[i].ALT.call(this);
3480
3529
  this.raiseNoAltException(t, e.ERR_MSG);
3481
3530
  }
3482
3531
  ruleFinallyStateUpdate() {
3483
- this.RULE_STACK_IDX--, this.RULE_OCCURRENCE_STACK_IDX--, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX]), this.cstFinallyStateUpdate();
3532
+ this.RULE_STACK_IDX--, this.RULE_OCCURRENCE_STACK_IDX--, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX], this.currRuleLookaheadFuncs = this.lookAheadFuncsCache[this.currRuleShortName]), this.cstFinallyStateUpdate();
3484
3533
  }
3485
3534
  subruleInternal(e, t, n) {
3486
3535
  let r;
@@ -3492,7 +3541,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3492
3541
  }
3493
3542
  }
3494
3543
  subruleInternalError(e, t, n) {
3495
- throw Pt(e) && e.partialCstResult !== void 0 && (this.cstPostNonTerminal(e.partialCstResult, t !== void 0 && t.LABEL !== void 0 ? t.LABEL : n), delete e.partialCstResult), e;
3544
+ throw cn(e) && e.partialCstResult !== void 0 && (this.cstPostNonTerminal(e.partialCstResult, t !== void 0 && t.LABEL !== void 0 ? t.LABEL : n), delete e.partialCstResult), e;
3496
3545
  }
3497
3546
  consumeInternal(e, t, n) {
3498
3547
  let r;
@@ -3511,7 +3560,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3511
3560
  actual: t,
3512
3561
  previous: i,
3513
3562
  ruleName: this.getCurrRuleFullName()
3514
- }), this.SAVE_ERROR(new It(r, t, i));
3563
+ }), this.SAVE_ERROR(new un(r, t, i));
3515
3564
  }
3516
3565
  consumeInternalRecovery(e, t, n) {
3517
3566
  if (!this.recoveryEnabled || n.name !== "MismatchedTokenException" || this.isBackTracking()) throw n;
@@ -3537,10 +3586,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3537
3586
  this.errors = e.errors, this.importLexerState(e.lexerState);
3538
3587
  let t = e.RULE_STACK;
3539
3588
  for (let e = 0; e < t.length; e++) this.RULE_STACK[e] = t[e];
3540
- this.RULE_STACK_IDX = t.length - 1, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX]);
3589
+ this.RULE_STACK_IDX = t.length - 1, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX], this.currRuleLookaheadFuncs = this.lookAheadFuncsCache[this.currRuleShortName]);
3541
3590
  }
3542
3591
  ruleInvocationStateUpdate(e, t, n) {
3543
- this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX] = n, this.RULE_STACK[++this.RULE_STACK_IDX] = e, this.currRuleShortName = e, this.cstInvocationStateUpdate(t);
3592
+ this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX] = n, this.RULE_STACK[++this.RULE_STACK_IDX] = e, this.currRuleShortName = e, this.currRuleLookaheadFuncs = this.lookAheadFuncsCache[e], this.cstInvocationStateUpdate(t);
3544
3593
  }
3545
3594
  isBackTracking() {
3546
3595
  return this.isBackTrackingStack.length !== 0;
@@ -3553,13 +3602,13 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3553
3602
  return this.shortRuleNameToFull[e];
3554
3603
  }
3555
3604
  isAtEndOfInput() {
3556
- return this.tokenMatcher(this.LA(1), q);
3605
+ return this.tokenMatcher(this.LA(1), X);
3557
3606
  }
3558
3607
  reset() {
3559
- this.resetLexerState(), this.subruleIdx = 0, this.currRuleShortName = 0, this.isBackTrackingStack = [], this.errors = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK_IDX = -1, this.CST_STACK = [];
3608
+ this.resetLexerState(), this.subruleIdx = 0, this.currRuleShortName = -1, this.currRuleLookaheadFuncs = [], this.isBackTrackingStack = [], this.errors = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK_IDX = -1, this.CST_STACK = [];
3560
3609
  }
3561
3610
  onBeforeParse(e) {
3562
- for (let e = 0; e < this.maxLookahead + 1; e++) this.tokVector.push(Z);
3611
+ for (let e = 0; e < this.maxLookahead + 1; e++) this.tokVector.push(Ln);
3563
3612
  }
3564
3613
  onAfterParse(e) {
3565
3614
  if (!1 === this.isAtEndOfInput()) {
@@ -3567,9 +3616,9 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3567
3616
  firstRedundant: e,
3568
3617
  ruleName: this.getCurrRuleFullName()
3569
3618
  });
3570
- this.SAVE_ERROR(new Rt(t, e));
3619
+ this.SAVE_ERROR(new fn(t, e));
3571
3620
  }
3572
- for (; this.tokVector.at(-1) === Z;) this.tokVector.pop();
3621
+ for (; this.tokVector.at(-1) === Ln;) this.tokVector.pop();
3573
3622
  }
3574
3623
  },
3575
3624
  class {
@@ -3834,10 +3883,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3834
3883
  AT_LEAST_ONE_SEP9(e) {
3835
3884
  this.atLeastOneSepFirstInternal(9, e);
3836
3885
  }
3837
- RULE(e, t, n = dn) {
3886
+ RULE(e, t, n = Rn) {
3838
3887
  if (this.definedRulesNames.includes(e)) {
3839
3888
  let t = {
3840
- message: J.buildDuplicateRuleNameError({
3889
+ message: xt.buildDuplicateRuleNameError({
3841
3890
  topLevelRule: e,
3842
3891
  grammarName: this.className
3843
3892
  }),
@@ -3850,7 +3899,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3850
3899
  let r = this.defineRule(e, t, n);
3851
3900
  return this[e] = r, r;
3852
3901
  }
3853
- OVERRIDE_RULE(e, t, n = dn) {
3902
+ OVERRIDE_RULE(e, t, n = Rn) {
3854
3903
  let r = function(e, t, n) {
3855
3904
  let r = [], i;
3856
3905
  return t.includes(e) || (i = `Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `, r.push({
@@ -3871,7 +3920,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3871
3920
  try {
3872
3921
  return n.apply(this, t), !0;
3873
3922
  } catch (e) {
3874
- if (Pt(e)) return !1;
3923
+ if (cn(e)) return !1;
3875
3924
  throw e;
3876
3925
  } finally {
3877
3926
  this.reloadRecogState(e), this.isBackTrackingStack.pop();
@@ -3882,7 +3931,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3882
3931
  return this.gastProductionsCache;
3883
3932
  }
3884
3933
  getSerializedGastProductions() {
3885
- return Object.values(this.gastProductionsCache).map(_);
3934
+ return Object.values(this.gastProductionsCache).map(oe);
3886
3935
  }
3887
3936
  },
3888
3937
  class {
@@ -3890,7 +3939,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3890
3939
  this._errors = [], this.errorMessageProvider = Object.hasOwn(e, "errorMessageProvider") ? e.errorMessageProvider : $.errorMessageProvider;
3891
3940
  }
3892
3941
  SAVE_ERROR(e) {
3893
- if (Pt(e)) return e.context = {
3942
+ if (cn(e)) return e.context = {
3894
3943
  ruleStack: this.getHumanReadableRuleStack(),
3895
3944
  ruleOccurrenceStack: this.RULE_OCCURRENCE_STACK.slice(0, this.RULE_OCCURRENCE_STACK_IDX + 1)
3896
3945
  }, this._errors.push(e), e;
@@ -3903,7 +3952,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3903
3952
  this._errors = e;
3904
3953
  }
3905
3954
  raiseEarlyExitException(e, t, n) {
3906
- let r = this.getCurrRuleFullName(), i = ht(e, this.getGAstProductions()[r], t, this.maxLookahead)[0], a = [];
3955
+ let r = this.getCurrRuleFullName(), i = Ht(e, this.getGAstProductions()[r], t, this.maxLookahead)[0], a = [];
3907
3956
  for (let e = 1; e <= this.maxLookahead; e++) a.push(this.LA(e));
3908
3957
  let o = this.errorMessageProvider.buildEarlyExitMessage({
3909
3958
  expectedIterationPaths: i,
@@ -3912,10 +3961,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3912
3961
  customUserDescription: n,
3913
3962
  ruleName: r
3914
3963
  });
3915
- throw this.SAVE_ERROR(new zt(o, this.LA(1), this.LA(0)));
3964
+ throw this.SAVE_ERROR(new pn(o, this.LA(1), this.LA(0)));
3916
3965
  }
3917
3966
  raiseNoAltException(e, t) {
3918
- let n = this.getCurrRuleFullName(), r = mt(e, this.getGAstProductions()[n], this.maxLookahead), i = [];
3967
+ let n = this.getCurrRuleFullName(), r = Vt(e, this.getGAstProductions()[n], this.maxLookahead), i = [];
3919
3968
  for (let e = 1; e <= this.maxLookahead; e++) i.push(this.LA(e));
3920
3969
  let a = this.LA(0), o = this.errorMessageProvider.buildNoViableAltMessage({
3921
3970
  expectedPathsPerAlt: r,
@@ -3924,7 +3973,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3924
3973
  customUserDescription: t,
3925
3974
  ruleName: this.getCurrRuleFullName()
3926
3975
  });
3927
- throw this.SAVE_ERROR(new Lt(o, this.LA(1), a));
3976
+ throw this.SAVE_ERROR(new dn(o, this.LA(1), a));
3928
3977
  }
3929
3978
  },
3930
3979
  class {
@@ -3983,11 +4032,11 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
3983
4032
  return () => !0;
3984
4033
  }
3985
4034
  LA_RECORD(e) {
3986
- return Z;
4035
+ return Ln;
3987
4036
  }
3988
4037
  topLevelRuleRecord(e, t) {
3989
4038
  try {
3990
- let n = new c({
4039
+ let n = new j({
3991
4040
  definition: [],
3992
4041
  name: e
3993
4042
  });
@@ -4002,54 +4051,54 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
4002
4051
  }
4003
4052
  }
4004
4053
  optionInternalRecord(e, t) {
4005
- return X.call(this, u, e, t);
4054
+ return Nn.call(this, N, e, t);
4006
4055
  }
4007
4056
  atLeastOneInternalRecord(e, t) {
4008
- X.call(this, d, t, e);
4057
+ Nn.call(this, P, t, e);
4009
4058
  }
4010
4059
  atLeastOneSepFirstInternalRecord(e, t) {
4011
- X.call(this, f, t, e, nn);
4060
+ Nn.call(this, F, t, e, kn);
4012
4061
  }
4013
4062
  manyInternalRecord(e, t) {
4014
- X.call(this, p, t, e);
4063
+ Nn.call(this, I, t, e);
4015
4064
  }
4016
4065
  manySepFirstInternalRecord(e, t) {
4017
- X.call(this, m, t, e, nn);
4066
+ Nn.call(this, L, t, e, kn);
4018
4067
  }
4019
4068
  orInternalRecord(e, t) {
4020
- return cn.call(this, e, t);
4069
+ return Pn.call(this, e, t);
4021
4070
  }
4022
4071
  subruleInternalRecord(e, t, n) {
4023
- if (un(t), !e || !Object.hasOwn(e, "ruleName")) {
4024
- let n = /* @__PURE__ */ Error(`<SUBRULE${ln(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
4072
+ if (In(t), !e || !Object.hasOwn(e, "ruleName")) {
4073
+ let n = /* @__PURE__ */ Error(`<SUBRULE${Fn(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
4025
4074
  throw n.KNOWN_RECORDER_ERROR = !0, n;
4026
4075
  }
4027
- let r = this.recordingProdStack.at(-1), i = e.ruleName, a = new s({
4076
+ let r = this.recordingProdStack.at(-1), i = e.ruleName, a = new A({
4028
4077
  idx: t,
4029
4078
  nonTerminalName: i,
4030
4079
  label: n?.LABEL,
4031
4080
  referencedRule: void 0
4032
4081
  });
4033
- return r.definition.push(a), this.outputCst ? sn : tn;
4082
+ return r.definition.push(a), this.outputCst ? Mn : On;
4034
4083
  }
4035
4084
  consumeInternalRecord(e, t, n) {
4036
- if (un(t), !Me(e)) {
4037
- let n = /* @__PURE__ */ Error(`<CONSUME${ln(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
4085
+ if (In(t), !nt(e)) {
4086
+ let n = /* @__PURE__ */ Error(`<CONSUME${Fn(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
4038
4087
  throw n.KNOWN_RECORDER_ERROR = !0, n;
4039
4088
  }
4040
- let r = this.recordingProdStack.at(-1), i = new g({
4089
+ let r = this.recordingProdStack.at(-1), i = new z({
4041
4090
  idx: t,
4042
4091
  terminalType: e,
4043
4092
  label: n?.LABEL
4044
4093
  });
4045
- return r.definition.push(i), on;
4094
+ return r.definition.push(i), jn;
4046
4095
  }
4047
4096
  },
4048
4097
  class {
4049
4098
  initPerformanceTracer(e) {
4050
4099
  if (Object.hasOwn(e, "traceInitPerf")) {
4051
4100
  let t = e.traceInitPerf, n = typeof t == "number";
4052
- this.traceInitMaxIdent = n ? t : Infinity, this.traceInitPerf = n ? t > 0 : t;
4101
+ this.traceInitMaxIdent = n ? t : 1 / 0, this.traceInitPerf = n ? t > 0 : t;
4053
4102
  } else this.traceInitMaxIdent = 0, this.traceInitPerf = $.traceInitPerf;
4054
4103
  this.traceInitIndent = -1;
4055
4104
  }
@@ -4058,8 +4107,8 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
4058
4107
  this.traceInitIndent++;
4059
4108
  let n = Array(this.traceInitIndent + 1).join(" ");
4060
4109
  this.traceInitIndent < this.traceInitMaxIdent && console.log(`${n}--\x3e <${e}>`);
4061
- let { time: r, value: a } = i(t), o = r > 10 ? console.warn : console.log;
4062
- return this.traceInitIndent < this.traceInitMaxIdent && o(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, a;
4110
+ let { time: r, value: i } = ae(t), a = r > 10 ? console.warn : console.log;
4111
+ return this.traceInitIndent < this.traceInitMaxIdent && a(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, i;
4063
4112
  }
4064
4113
  return t();
4065
4114
  }
@@ -4069,67 +4118,84 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
4069
4118
  Object.getOwnPropertyNames(t).forEach((n) => {
4070
4119
  if (n === "constructor") return;
4071
4120
  let r = Object.getOwnPropertyDescriptor(t, n);
4072
- r && (r.get || r.set) ? Object.defineProperty(fn.prototype, n, r) : fn.prototype[n] = e.prototype[n];
4121
+ r && (r.get || r.set) ? Object.defineProperty(zn.prototype, n, r) : zn.prototype[n] = e.prototype[n];
4073
4122
  });
4074
4123
  });
4075
- var mn = class extends pn {
4124
+ var Vn = class extends Bn {
4076
4125
  constructor(e, t = $) {
4077
4126
  let n = Object.assign({}, t);
4078
4127
  n.outputCst = !1, super(e, n);
4079
4128
  }
4080
- }, hn = class n {
4129
+ }, Hn = class e {
4081
4130
  static shared(t) {
4082
- let r = t?.locale ?? e, i = t?.maxColumn ?? yn, a = t?.maxRow ?? bn, o = vn.get(r);
4083
- o || (o = /* @__PURE__ */ new Map(), vn.set(r, o));
4084
- let s = `${i}:${a}`, c = o.get(s);
4085
- return c || (c = new n({
4086
- locale: r,
4087
- maxColumn: i,
4088
- maxRow: a
4089
- }), o.set(s, c)), c;
4090
- }
4091
- constructor(t) {
4092
- let n = t?.maxColumn ?? yn, r = t?.maxRow ?? bn, i = t?.locale ?? e;
4093
- this._locale = i, this._maxColumn = n, this._maxRow = r;
4094
- let { separatorFunction: a, separatorColumn: o, separatorRow: s, separatorDecimal: c } = i.separators;
4095
- if (o === s) throw Error(`FormulaLexer: separatorColumn and separatorRow must differ (both '${o}')`);
4096
- let l = K({
4131
+ let n = t?.locale ?? re, r = t?.maxColumn ?? Kn, i = t?.maxRow ?? qn, a = Gn.get(n);
4132
+ a || (a = /* @__PURE__ */ new Map(), Gn.set(n, a));
4133
+ let o = `${r}:${i}`, s = a.get(o);
4134
+ return s || (s = new e({
4135
+ locale: n,
4136
+ maxColumn: r,
4137
+ maxRow: i
4138
+ }), a.set(o, s)), s;
4139
+ }
4140
+ constructor(e) {
4141
+ let t = e?.maxColumn ?? Kn, n = e?.maxRow ?? qn, r = e?.locale ?? re;
4142
+ this._locale = r, this._maxColumn = t, this._maxRow = n;
4143
+ let { separatorFunction: i, separatorColumn: a, separatorRow: o, separatorDecimal: s } = r.separators;
4144
+ if (a === o) throw Error(`FormulaLexer: separatorColumn and separatorRow must differ (both '${a}')`);
4145
+ let c = Y({
4097
4146
  name: "WhiteSpace",
4098
- pattern: /\s+/,
4099
- group: W.SKIPPED
4100
- }), u = K({
4147
+ pattern: /[ \n\v\f\r\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,
4148
+ group: J.SKIPPED
4149
+ }), l = Y({
4101
4150
  name: "StringToken",
4102
4151
  pattern: /"(""|[^"])*"/
4103
- }), d = K({
4152
+ }), u = Y({
4104
4153
  name: "FunctionToken",
4105
4154
  pattern: /[a-zA-Z_\u007F-\uFFFF]+[a-zA-Z0-9_.\u007F-\uFFFF]*(?=\()/
4106
- }), f = K({
4155
+ }), d = Y({
4107
4156
  name: "TableReference",
4108
- pattern: { exec: wn },
4157
+ pattern: { exec: ne },
4109
4158
  line_breaks: !1,
4110
- start_chars_hint: _n
4111
- }), p = K({
4159
+ start_chars_hint: Wn
4160
+ }), f = Y({
4112
4161
  name: "BracketedString",
4113
- pattern: { exec: En },
4162
+ pattern: { exec: te },
4114
4163
  line_breaks: !1,
4115
4164
  start_chars_hint: [91],
4116
- longer_alt: [f, u]
4117
- }), m = (e) => (e ?? []).map((e) => e?.trim()).filter(Boolean).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).map((e) => e + "|").join(""), h = K({
4165
+ longer_alt: [d, l]
4166
+ }), p = (e) => (e ?? []).map((e) => e?.trim()).filter(Boolean).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).map((e) => e + "|").join(""), m = (e) => e.replace(/[A-Za-z]/g, (e) => `[${e.toUpperCase()}${e.toLowerCase()}]`), h = Y({
4118
4167
  name: "LiteralError",
4119
- pattern: RegExp(m(i.errorLiterals) + "#PARSE!|#NULL!|#DIV\\/0!|#VALUE!|#NUM!|#FIELD!|#N\\/A|#GETTING_DATA|#SPILL!|#CONNECT!|#BLOCKED!|#UNKNOWN!|#CALC!|#BUSY!|#PYTHON!|#TIMEOUT!")
4120
- }), g = K({
4168
+ pattern: new RegExp(p(r.errorLiterals) + [
4169
+ "#PARSE!",
4170
+ "#NULL!",
4171
+ "#DIV\\/0!",
4172
+ "#VALUE!",
4173
+ "#NUM!",
4174
+ "#FIELD!",
4175
+ "#N\\/A",
4176
+ "#GETTING_DATA",
4177
+ "#SPILL!",
4178
+ "#CONNECT!",
4179
+ "#BLOCKED!",
4180
+ "#UNKNOWN!",
4181
+ "#CALC!",
4182
+ "#BUSY!",
4183
+ "#PYTHON!",
4184
+ "#TIMEOUT!"
4185
+ ].map(m).join("|"))
4186
+ }), g = Y({
4121
4187
  name: "RefError",
4122
- pattern: RegExp(m(i.errorRefs) + "#REF!|#NAME\\?")
4123
- }), _ = K({
4188
+ pattern: new RegExp(p(r.errorRefs) + ["#REF!", "#NAME\\?"].map(m).join("|"))
4189
+ }), _ = Y({
4124
4190
  name: "SingleQuotedString",
4125
4191
  pattern: /'(''|[^'])*'/
4126
- }), v = K({
4192
+ }), v = Y({
4127
4193
  name: "SheetQuoted",
4128
4194
  pattern: /'(?:''|[^'])*?'!/
4129
- }), y = K({
4195
+ }), y = Y({
4130
4196
  name: "Sheet",
4131
4197
  pattern: /[A-Za-z_.\d\u007F-\uFFFF]*!/
4132
- }), b = /[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y, x = K({
4198
+ }), b = /[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y, x = Y({
4133
4199
  name: "NamedToken",
4134
4200
  pattern: { exec: (e, t) => {
4135
4201
  b.lastIndex = t;
@@ -4139,186 +4205,186 @@ var mn = class extends pn {
4139
4205
  return i === -1 ? r.endsWith(":") && (r = r.slice(0, -1)) : r = r.substring(0, i), [r];
4140
4206
  } },
4141
4207
  line_breaks: !1,
4142
- start_chars_hint: _n
4143
- }), S = K({
4208
+ start_chars_hint: Wn
4209
+ }), S = Y({
4144
4210
  name: "Cell",
4145
- pattern: { exec: Cn(n, r) },
4211
+ pattern: { exec: Xn(t, n) },
4146
4212
  line_breaks: !1,
4147
- start_chars_hint: [36, ...gn],
4213
+ start_chars_hint: [36, ...Un],
4148
4214
  longer_alt: x
4149
- }), C = K({
4215
+ }), ee = Y({
4150
4216
  name: "Column",
4151
- pattern: { exec: Sn(n) },
4217
+ pattern: { exec: Yn(t) },
4152
4218
  line_breaks: !1,
4153
- start_chars_hint: [36, ...gn],
4219
+ start_chars_hint: [36, ...Un],
4154
4220
  longer_alt: x
4155
- }), w = K({
4221
+ }), C = Y({
4156
4222
  name: "AbsRow",
4157
4223
  pattern: /[$][0-9]+/
4158
- }), T = c === "." ? "\\." : c, E = K({
4224
+ }), w = s === "." ? "\\." : s, ie = Y({
4159
4225
  name: "NumberToken",
4160
- pattern: RegExp(`[0-9]+${T}(?!:)[0-9]*([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|${T}[0-9]+([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+`)
4161
- }), D = K({
4226
+ pattern: RegExp(`[0-9]+${w}(?!:)[0-9]*([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|${w}[0-9]+([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+`)
4227
+ }), T = Y({
4162
4228
  name: "ScientificDigit",
4163
4229
  pattern: /[0-9]+\*\*[+-]?[0-9]+/
4164
- }), O = K({
4230
+ }), E = Y({
4165
4231
  name: "DigitToken",
4166
4232
  pattern: /[0-9]+/
4167
- }), k = ["TRUE", "FALSE"];
4168
- for (let e of [i.booleanTrue, i.booleanFalse]) {
4233
+ }), D = ["TRUE", "FALSE"];
4234
+ for (let e of [r.booleanTrue, r.booleanFalse]) {
4169
4235
  let t = e?.trim();
4170
- t && !k.some((e) => e.toLowerCase() === t.toLowerCase()) && k.push(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
4236
+ t && !D.some((e) => e.toLowerCase() === t.toLowerCase()) && D.push(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
4171
4237
  }
4172
- let A = K({
4238
+ let ae = Y({
4173
4239
  name: "BooleanToken",
4174
- pattern: new RegExp(k.join("|"), "i")
4175
- }), j = K({
4240
+ pattern: new RegExp(D.join("|"), "i")
4241
+ }), O = Y({
4176
4242
  name: "ArgSeparator",
4177
- pattern: Tn(a)
4178
- }), M = K({
4243
+ pattern: Zn(i)
4244
+ }), k = Y({
4179
4245
  name: "ColSeparator",
4180
- pattern: Tn(o)
4181
- }), N = K({
4246
+ pattern: Zn(a)
4247
+ }), A = Y({
4182
4248
  name: "RowSeparator",
4183
- pattern: Tn(s)
4184
- }), P = K({
4249
+ pattern: Zn(o)
4250
+ }), j = Y({
4185
4251
  name: "RangeOp",
4186
4252
  pattern: /:/
4187
- }), ee = K({
4253
+ }), M = Y({
4188
4254
  name: "RangeTrimFullOp",
4189
4255
  pattern: /\.:\./
4190
- }), te = K({
4256
+ }), N = Y({
4191
4257
  name: "RangeTrimLeadingOp",
4192
4258
  pattern: /\.:/
4193
- }), F = K({
4259
+ }), P = Y({
4194
4260
  name: "RangeTrimTrailingOp",
4195
4261
  pattern: /:\./
4196
- }), ne = K({
4262
+ }), F = Y({
4197
4263
  name: "OpenParen",
4198
4264
  pattern: /\(/
4199
- }), I = K({
4265
+ }), I = Y({
4200
4266
  name: "CloseParen",
4201
4267
  pattern: /\)/
4202
- }), L = K({
4268
+ }), L = Y({
4203
4269
  name: "OpenCurlyParen",
4204
4270
  pattern: /{/
4205
- }), re = K({
4271
+ }), R = Y({
4206
4272
  name: "CloseCurlyParen",
4207
4273
  pattern: /}/
4208
- }), ie = K({
4274
+ }), z = Y({
4209
4275
  name: "QuoteS",
4210
4276
  pattern: /'/
4211
- }), ae = K({
4277
+ }), oe = Y({
4212
4278
  name: "MulOp",
4213
4279
  pattern: /\*(?!\*)/
4214
- }), oe = K({
4280
+ }), B = Y({
4215
4281
  name: "PlusOp",
4216
4282
  pattern: /\+/
4217
- }), se = K({
4283
+ }), se = Y({
4218
4284
  name: "DivOp",
4219
4285
  pattern: /\//
4220
- }), ce = K({
4286
+ }), ce = Y({
4221
4287
  name: "MinOp",
4222
4288
  pattern: /-/
4223
- }), le = K({
4289
+ }), V = Y({
4224
4290
  name: "ImplicitIntersectOp",
4225
4291
  pattern: /@/
4226
- }), ue = K({
4292
+ }), le = Y({
4227
4293
  name: "ConcatOp",
4228
4294
  pattern: /&/
4229
- }), de = K({
4295
+ }), ue = Y({
4230
4296
  name: "ExOp",
4231
4297
  pattern: /\^/
4232
- }), fe = K({
4298
+ }), de = Y({
4233
4299
  name: "PercentOp",
4234
4300
  pattern: /%/
4235
- }), pe = K({
4301
+ }), fe = Y({
4236
4302
  name: "ArrayAnchorOp",
4237
4303
  pattern: /#/,
4238
4304
  longer_alt: [h, g]
4239
- }), R = K({
4305
+ }), pe = Y({
4240
4306
  name: "GtOp",
4241
4307
  pattern: />/
4242
- }), me = K({
4308
+ }), H = Y({
4243
4309
  name: "EqOp",
4244
4310
  pattern: /=/
4245
- }), he = K({
4311
+ }), me = Y({
4246
4312
  name: "LtOp",
4247
4313
  pattern: /</
4248
- }), ge = [
4314
+ }), U = [
4315
+ c,
4249
4316
  l,
4250
- u,
4251
4317
  v,
4252
4318
  _,
4253
4319
  y,
4320
+ u,
4254
4321
  d,
4255
4322
  f,
4256
- p,
4257
4323
  h,
4258
4324
  g,
4259
- j,
4260
- ...o === a ? [] : [M],
4325
+ O,
4326
+ ...a === i ? [] : [k],
4327
+ A,
4328
+ M,
4261
4329
  N,
4262
- ee,
4263
- te,
4264
- F,
4265
4330
  P,
4331
+ j,
4266
4332
  S,
4267
- A,
4333
+ ae,
4334
+ ee,
4268
4335
  C,
4269
- w,
4336
+ ie,
4337
+ T,
4270
4338
  E,
4271
- D,
4272
- O,
4273
- pe,
4274
- le,
4339
+ fe,
4340
+ V,
4275
4341
  x,
4276
- ne,
4342
+ F,
4277
4343
  I,
4278
4344
  L,
4279
- re,
4280
- ie,
4281
- ae,
4345
+ R,
4346
+ z,
4282
4347
  oe,
4348
+ B,
4283
4349
  se,
4284
4350
  ce,
4351
+ le,
4285
4352
  ue,
4286
4353
  de,
4287
- fe,
4288
- K({
4354
+ Y({
4289
4355
  name: "NeqOp",
4290
4356
  pattern: /<>/
4291
4357
  }),
4292
- K({
4358
+ Y({
4293
4359
  name: "GteOp",
4294
4360
  pattern: />=/
4295
4361
  }),
4296
- K({
4362
+ Y({
4297
4363
  name: "LteOp",
4298
4364
  pattern: /<=/
4299
4365
  }),
4300
- R,
4301
- me,
4302
- he
4366
+ pe,
4367
+ H,
4368
+ me
4303
4369
  ];
4304
- this._lexer = new W(ge, { ensureOptimizations: !0 });
4305
- let _e = {};
4306
- ge.forEach((e) => {
4307
- _e[e.name] = e;
4308
- }), o === a && (_e.ColSeparator = j), this._vocabulary = _e;
4309
- }
4310
- tokenize(e, n = !0) {
4311
- let r = this._lexer.tokenize(e);
4312
- if (n && r.errors.length > 0) {
4313
- let n = r.errors[0], i = n.line, a = n.column, o = e.substr(n.offset, n.length || 1), s = o ? `Unexpected character '${o}'` : n.message;
4314
- throw new t.Parse(s, {
4315
- line: i,
4316
- column: a,
4317
- offset: n.offset,
4318
- length: n.length
4370
+ this._lexer = new J(U, { ensureOptimizations: !0 });
4371
+ let W = {};
4372
+ U.forEach((e) => {
4373
+ W[e.name] = e;
4374
+ }), a === i && (W.ColSeparator = O), this._vocabulary = W;
4375
+ }
4376
+ tokenize(e, t = !0) {
4377
+ let n = this._lexer.tokenize(e);
4378
+ if (t && n.errors.length > 0) {
4379
+ let t = n.errors[0], r = t.line, i = t.column, a = e.substr(t.offset, t.length || 1), o = a ? `Unexpected character '${a}'` : t.message;
4380
+ throw new T.Parse(o, {
4381
+ line: r,
4382
+ column: i,
4383
+ offset: t.offset,
4384
+ length: t.length
4319
4385
  });
4320
4386
  }
4321
- return r;
4387
+ return n;
4322
4388
  }
4323
4389
  getVocabulary() {
4324
4390
  return this._vocabulary;
@@ -4335,22 +4401,22 @@ var mn = class extends pn {
4335
4401
  getSeparators() {
4336
4402
  return this._locale.separators;
4337
4403
  }
4338
- }, gn = (() => {
4404
+ }, Un = (() => {
4339
4405
  let e = [];
4340
4406
  for (let t = 65; t <= 90; t++) e.push(t);
4341
4407
  for (let t = 97; t <= 122; t++) e.push(t);
4342
4408
  for (let t = 48; t <= 57; t++) e.push(t);
4343
4409
  return e;
4344
- })().filter((e) => e < 48 || e > 57), _n = (() => {
4410
+ })().filter((e) => e < 48 || e > 57), Wn = (() => {
4345
4411
  let e = [
4346
- ...gn,
4412
+ ...Un,
4347
4413
  95,
4348
4414
  92
4349
4415
  ];
4350
4416
  for (let t = 127; t <= 65535; t++) e.push(t);
4351
4417
  return e;
4352
- })(), vn = /* @__PURE__ */ new WeakMap(), yn = 16384, bn = 1048576;
4353
- function xn(e, t, n) {
4418
+ })(), Gn = /* @__PURE__ */ new WeakMap(), Kn = 16384, qn = 1048576;
4419
+ function Jn(e, t, n) {
4354
4420
  let r = 0;
4355
4421
  for (let i = t; i < n; i++) {
4356
4422
  let t = e.charCodeAt(i);
@@ -4358,7 +4424,7 @@ function xn(e, t, n) {
4358
4424
  }
4359
4425
  return r;
4360
4426
  }
4361
- function Sn(e) {
4427
+ function Yn(e) {
4362
4428
  return (t, n) => {
4363
4429
  let r = n;
4364
4430
  t.charCodeAt(r) === 36 && r++;
@@ -4368,7 +4434,7 @@ function Sn(e) {
4368
4434
  if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122)) break;
4369
4435
  r++;
4370
4436
  }
4371
- if (r - i === 0 || xn(t, i, r) > e) return null;
4437
+ if (r - i === 0 || Jn(t, i, r) > e) return null;
4372
4438
  if (r < t.length) {
4373
4439
  let e = t.charCodeAt(r);
4374
4440
  if (e >= 48 && e <= 57) return null;
@@ -4376,7 +4442,7 @@ function Sn(e) {
4376
4442
  return [t.substring(n, r)];
4377
4443
  };
4378
4444
  }
4379
- function Cn(e, t) {
4445
+ function Xn(e, t) {
4380
4446
  return (n, r) => {
4381
4447
  let i = r;
4382
4448
  n.charCodeAt(i) === 36 && i++;
@@ -4386,51 +4452,681 @@ function Cn(e, t) {
4386
4452
  if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122)) break;
4387
4453
  i++;
4388
4454
  }
4389
- if (i - a === 0 || xn(n, a, i) > e) return null;
4455
+ if (i - a === 0 || Jn(n, a, i) > e) return null;
4390
4456
  i < n.length && n.charCodeAt(i) === 36 && i++;
4391
4457
  let o = i;
4392
- if (i >= n.length) return null;
4393
- let s = n.charCodeAt(i);
4394
- if (s < 49 || s > 57) return null;
4395
- for (i++; i < n.length;) {
4458
+ for (; i < n.length;) {
4396
4459
  let e = n.charCodeAt(i);
4397
4460
  if (!(e >= 48 && e <= 57)) break;
4398
4461
  i++;
4399
4462
  }
4400
- return parseInt(n.substring(o, i), 10) > t ? null : [n.substring(r, i)];
4463
+ if (i === o) return null;
4464
+ let s = parseInt(n.substring(o, i), 10);
4465
+ return s < 1 || s > t ? null : [n.substring(r, i)];
4401
4466
  };
4402
4467
  }
4403
- function wn(e, t) {
4404
- let n = e.charCodeAt(t);
4405
- if (!(n >= 65 && n <= 90 || n >= 97 && n <= 122 || n === 95 || n >= 127 && n <= 65535)) return null;
4406
- let r = t + 1;
4407
- for (; r < e.length;) {
4408
- let t = e.charCodeAt(r);
4409
- if (!(t >= 65 && t <= 90 || t >= 97 && t <= 122 || t >= 48 && t <= 57 || t === 95 || t === 46 || t >= 127 && t <= 65535)) break;
4410
- r++;
4411
- }
4412
- if (r >= e.length || e.charCodeAt(r) !== 91) return null;
4413
- let i = 0;
4414
- for (; r < e.length;) {
4415
- let n = e.charCodeAt(r);
4416
- if (n === 91) i++;
4417
- else if (n === 93 && (i--, i === 0)) return [e.substring(t, r + 1)];
4418
- r++;
4419
- }
4420
- return null;
4421
- }
4422
- function Tn(e) {
4468
+ function Zn(e) {
4423
4469
  return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
4424
4470
  }
4425
- function En(e, t) {
4426
- if (e.charCodeAt(t) !== 91) return null;
4427
- let n = 0, r = t;
4428
- for (; r < e.length;) {
4429
- let i = e.charCodeAt(r);
4430
- if (i === 91) n++;
4431
- else if (i === 93 && (n--, n === 0)) return [e.substring(t, r + 1)];
4432
- r++;
4433
- }
4434
- return null;
4471
+ var Qn = class {
4472
+ constructor(e = re) {
4473
+ let t = function(e) {
4474
+ let t = [...p];
4475
+ if (e) for (let n of Object.values(e)) {
4476
+ let e = n?.trim();
4477
+ e && !t.some((t) => t.toLowerCase() === e.toLowerCase()) && t.push(e);
4478
+ }
4479
+ return t.sort((e, t) => t.length - e.length), t.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
4480
+ }(e.specifiers), n = Y({
4481
+ name: "WhiteSpace",
4482
+ pattern: /\s+/,
4483
+ group: J.SKIPPED
4484
+ }), r = Y({
4485
+ name: "TableSpecifier",
4486
+ pattern: RegExp(`\\[#(?:${t})\\]`, "i")
4487
+ }), i = [
4488
+ n,
4489
+ r,
4490
+ Y({
4491
+ name: "BracketedColumn",
4492
+ pattern: /\[(?:'['#[\]]|'(?!['#[\]])|[^'[\]])*\]/,
4493
+ longer_alt: [r]
4494
+ }),
4495
+ Y({
4496
+ name: "BareSpecifier",
4497
+ pattern: RegExp(`#(?:${t})`, "i")
4498
+ }),
4499
+ Y({
4500
+ name: "ColumnSep",
4501
+ pattern: /:/
4502
+ }),
4503
+ Y({
4504
+ name: "ListSep",
4505
+ pattern: new RegExp(e.separators.separatorFunction.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))
4506
+ })
4507
+ ];
4508
+ this._lexer = new J(i, { ensureOptimizations: !0 });
4509
+ let a = {};
4510
+ i.forEach((e) => {
4511
+ a[e.name] = e;
4512
+ }), this._vocabulary = a;
4513
+ }
4514
+ getVocabulary() {
4515
+ return this._vocabulary;
4516
+ }
4517
+ tokenize(e) {
4518
+ return this._lexer.tokenize(e);
4519
+ }
4520
+ }, $n = class extends Vn {
4521
+ constructor(e = re) {
4522
+ let t = new Qn(e), n = t.getVocabulary();
4523
+ super(n, {
4524
+ nodeLocationTracking: "none",
4525
+ maxLookahead: 2,
4526
+ skipValidations: !0,
4527
+ recoveryEnabled: !1
4528
+ }), this._lexer = t;
4529
+ let { TableSpecifier: r, BracketedColumn: i, BareSpecifier: a, ColumnSep: o, ListSep: s } = n, c = this;
4530
+ c.RULE("ruleContent", () => {
4531
+ let e = [], t = c.SUBRULE(c.ruleItem);
4532
+ return c.ACTION(() => {
4533
+ t && e.push(t);
4534
+ }), c.MANY(() => {
4535
+ c.CONSUME(s), c.OPTION(() => {
4536
+ let t = c.SUBRULE2(c.ruleItem);
4537
+ c.ACTION(() => {
4538
+ t && e.push(t);
4539
+ });
4540
+ });
4541
+ }), e;
4542
+ }), c.RULE("ruleItem", () => c.OR([{ ALT: () => c.SUBRULE(c.ruleSpecifier) }, { ALT: () => c.SUBRULE(c.ruleColumnOrRange) }])), c.RULE("ruleSpecifier", () => c.OR([{ ALT: () => {
4543
+ let t = c.CONSUME(r);
4544
+ return c.ACTION(() => {
4545
+ let n = y(t.image, e);
4546
+ return n.image = t.image, n;
4547
+ });
4548
+ } }, { ALT: () => {
4549
+ let t = c.CONSUME(a);
4550
+ return c.ACTION(() => {
4551
+ let n = y(t.image, e);
4552
+ return n.image = t.image, n;
4553
+ });
4554
+ } }])), c.RULE("ruleColumnOrRange", () => {
4555
+ let e = c.CONSUME(i), t, n;
4556
+ return c.OPTION(() => {
4557
+ t = c.CONSUME(o), n = c.CONSUME2(i);
4558
+ }), c.ACTION(() => {
4559
+ let r = v(e.image);
4560
+ if (r.image = e.image, !n) return r;
4561
+ let i = v(n.image);
4562
+ i.image = n.image;
4563
+ let a = l(":", r, i, !0);
4564
+ return a.image = t?.image ?? ":", a;
4565
+ });
4566
+ }), c.performSelfAnalysis();
4567
+ }
4568
+ _parseInner(e) {
4569
+ let t = this._lexer.tokenize(e);
4570
+ return t.errors.length > 0 || t.tokens.length === 0 ? [] : (this.input = t.tokens, this.reset(), this.ruleContent() ?? []);
4571
+ }
4572
+ _parseContent(e) {
4573
+ if (!e) return [];
4574
+ let t = e.trim();
4575
+ if (!t) return [];
4576
+ let n = t[0];
4577
+ if (n === "@") {
4578
+ let e = t.slice(1).trim();
4579
+ if (!e) {
4580
+ let e = g("@", null, !0);
4581
+ return e.image = "@", [e];
4582
+ }
4583
+ if (e.charAt(0) === "[") {
4584
+ let t = this._parseInner(e);
4585
+ if (t.length === 1 && t[0].type === "infix") {
4586
+ let e = g("@", t[0], !0);
4587
+ return e.image = "@", [e];
4588
+ }
4589
+ }
4590
+ let n = v(e);
4591
+ n.image = e;
4592
+ let r = g("@", n, !0);
4593
+ return r.image = "@", [r];
4594
+ }
4595
+ if (n !== "[" && n !== "#") {
4596
+ let t = v(e);
4597
+ return t.image = e, [t];
4598
+ }
4599
+ return this._parseInner(t);
4600
+ }
4601
+ parse(e, t, n) {
4602
+ this.reset();
4603
+ let r = () => ({
4604
+ root: _("", []),
4605
+ errors: []
4606
+ });
4607
+ if (!n) return r();
4608
+ let i = 0;
4609
+ if (n.charAt(0) === "[") {
4610
+ let e = n.indexOf("]");
4611
+ e !== -1 && n.charAt(e + 1) === "!" && (i = e + 2);
4612
+ }
4613
+ let a = n.indexOf("[", i);
4614
+ if (a === -1) return r();
4615
+ let o = n.slice(0, a), s = n.slice(a + 1, -1), c = this._parseContent(s);
4616
+ return {
4617
+ root: _(o, c),
4618
+ errors: this.errors.length > 0 ? [...this.errors] : []
4619
+ };
4620
+ }
4621
+ }, er = /* @__PURE__ */ new Set([
4622
+ ":",
4623
+ ".:.",
4624
+ ".:",
4625
+ ":."
4626
+ ]), tr = /* @__PURE__ */ new Set([
4627
+ ".:.",
4628
+ ".:",
4629
+ ":."
4630
+ ]), nr = (e) => {
4631
+ if (!e) return null;
4632
+ if (e.type === b.Cell) {
4633
+ let t = e.value;
4634
+ return t.rowIndex === -(2 ** 53 - 1) ? "col" : t.colIndex === -(2 ** 53 - 1) ? "row" : null;
4635
+ }
4636
+ return Number.isInteger(e.value) ? "row" : null;
4637
+ }, rr = (e, t) => {
4638
+ let n = parseInt(e.charCodeAt(0) === 36 ? e.substring(1) : e, 10);
4639
+ return n >= 1 && n <= t;
4640
+ }, ir = "A formula must not be empty", ar = (e, t) => `A formula must not be longer than ${t} characters (this one is ${e})`;
4641
+ function or(e, t) {
4642
+ let n = e?.[0]?.image;
4643
+ if (!n) {
4644
+ let e = t?.image;
4645
+ return e ? `Expected a value after '${e}'` : "Expected a value";
4646
+ }
4647
+ return `Unexpected '${n}'`;
4435
4648
  }
4436
- export { K as a, q as i, mn as n, W as o, qe as r, hn as t };
4649
+ var sr = {
4650
+ ...yt,
4651
+ buildNoViableAltMessage: (e) => or(e.actual, e.previous),
4652
+ buildEarlyExitMessage: (e) => or(e.actual, e.previous),
4653
+ buildNotAllInputParsedMessage: (e) => {
4654
+ let t = e.firstRedundant?.image;
4655
+ return t ? `Unexpected '${t}'` : yt.buildNotAllInputParsedMessage(e);
4656
+ },
4657
+ buildMismatchTokenMessage: (e) => {
4658
+ let t = e.actual?.image;
4659
+ return e.expected === X && t ? `Unexpected '${t}'` : yt.buildMismatchTokenMessage(e);
4660
+ }
4661
+ }, cr = class extends Vn {
4662
+ constructor(p) {
4663
+ let _ = p?.lexer ?? Hn.shared(p?.lexerOptions), v = _.getVocabulary();
4664
+ super(v, {
4665
+ skipValidations: !0,
4666
+ recoveryEnabled: !0,
4667
+ ...p,
4668
+ nodeLocationTracking: "full",
4669
+ errorMessageProvider: sr,
4670
+ maxLookahead: 1
4671
+ }), this._ruleInfixOp = this.RULE("ruleInfixOp", () => {
4672
+ let { PlusOp: e, MinOp: t, MulOp: r, DivOp: i, ExOp: a, ConcatOp: o, GtOp: s, EqOp: c, LtOp: u, NeqOp: d, GteOp: f, LteOp: p } = this._vocab, m = [];
4673
+ return m.push({ node: this.SUBRULE(this._rulePostfixOp) }), this.MANY(() => {
4674
+ let n = this.OR(this._c1 ||= [
4675
+ { ALT: () => this.CONSUME(e).image },
4676
+ { ALT: () => this.CONSUME(t).image },
4677
+ { ALT: () => this.CONSUME(r).image },
4678
+ { ALT: () => this.CONSUME(i).image },
4679
+ { ALT: () => this.CONSUME(a).image },
4680
+ { ALT: () => this.CONSUME(o).image },
4681
+ { ALT: () => this.CONSUME(s).image },
4682
+ { ALT: () => this.CONSUME(c).image },
4683
+ { ALT: () => this.CONSUME(u).image },
4684
+ { ALT: () => this.CONSUME(d).image },
4685
+ { ALT: () => this.CONSUME(f).image },
4686
+ { ALT: () => this.CONSUME(p).image }
4687
+ ]), l = {
4688
+ value: n,
4689
+ index: this.getLexerPosition(),
4690
+ isRange: x.includes(n)
4691
+ }, h = this.SUBRULE2(this._rulePostfixOp);
4692
+ m.push({
4693
+ op: l,
4694
+ node: h
4695
+ });
4696
+ }), this.ACTION(() => {
4697
+ let e = m.length - 1, t = n.length;
4698
+ for (let r = 0; e > 0 && r < t; r++) {
4699
+ let t = n[r], i = 1;
4700
+ for (; i < m.length;) {
4701
+ let n = m[i].op;
4702
+ if (t.includes(n.value)) {
4703
+ let t = m[i - 1].node, r = m[i].node, a = l(n.value, t, r, n.isRange);
4704
+ a = this._tag(a, n.index), m[i - 1].node = a, m.splice(i, 1), e--;
4705
+ } else i++;
4706
+ }
4707
+ }
4708
+ }), m[0].node;
4709
+ }), this._rulePlusMinusOp = this.RULE("rulePlusMinusOp", () => {
4710
+ let { PlusOp: e, MinOp: t } = this._vocab;
4711
+ return this.OR([{ ALT: () => this.CONSUME(e) }, { ALT: () => this.CONSUME(t) }]);
4712
+ }), this._rulePostfixOp = this.RULE("rulePostfixOp", () => {
4713
+ let { PercentOp: e } = this._vocab, t = this.SUBRULE(this._rulePrefixOp), n = [];
4714
+ return this.MANY(() => {
4715
+ let t = this.CONSUME(e).image;
4716
+ this.ACTION(() => {
4717
+ n.push([t, this.getLexerPosition()]);
4718
+ });
4719
+ }), this.ACTION(() => {
4720
+ let e = n.length;
4721
+ if (e !== 0) for (let r = 0; r < e; r++) {
4722
+ let e = n[r], i = e[0], a = e[1], o = x.includes(i);
4723
+ t = m(i, t, o), t = this._tag(t, a);
4724
+ }
4725
+ }), t;
4726
+ }), this._rulePrefixOp = this.RULE("rulePrefixOp", () => {
4727
+ let { PlusOp: e, MinOp: t, ImplicitIntersectOp: n } = this._vocab, r = [];
4728
+ this.MANY(() => {
4729
+ let i = this.OR([
4730
+ { ALT: () => this.CONSUME(e).image },
4731
+ { ALT: () => this.CONSUME(t).image },
4732
+ { ALT: () => this.CONSUME(n).image }
4733
+ ]);
4734
+ this.ACTION(() => {
4735
+ r.push([i, this.getLexerPosition()]);
4736
+ });
4737
+ });
4738
+ let i = this.SUBRULE(this._ruleRangeOp);
4739
+ return this.ACTION(() => {
4740
+ let e = r.length;
4741
+ if (e !== 0) for (let t = e - 1; t >= 0; t--) {
4742
+ let e = r[t], n = e[0], a = e[1], o = x.includes(n);
4743
+ i = g(n, i, o), i = this._tag(i, a);
4744
+ }
4745
+ }), i;
4746
+ }), this._ruleRangeOp = this.RULE("ruleRangeOp", () => {
4747
+ let { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: n, RangeTrimTrailingOp: r, ArrayAnchorOp: i } = this._vocab, a = [];
4748
+ return a.push({ node: this.SUBRULE(this._ruleCallOp) }), this.MANY2(() => {
4749
+ this.CONSUME(i), a.push({ anchor: this.getLexerPosition() });
4750
+ }), this.MANY(() => {
4751
+ let o = {
4752
+ value: this.OR(this._c2 ||= [
4753
+ { ALT: () => this.CONSUME(e).image },
4754
+ { ALT: () => this.CONSUME(t).image },
4755
+ { ALT: () => this.CONSUME(n).image },
4756
+ { ALT: () => this.CONSUME(r).image }
4757
+ ]),
4758
+ index: this.getLexerPosition()
4759
+ }, s = this.SUBRULE2(this._ruleCallOp);
4760
+ a.push({
4761
+ op: o,
4762
+ node: s
4763
+ }), this.MANY3(() => {
4764
+ this.CONSUME2(i), a.push({ anchor: this.getLexerPosition() });
4765
+ });
4766
+ }), this.ACTION(() => {
4767
+ for (let e = 1; e < a.length; e++) {
4768
+ let t = a[e];
4769
+ if (t.anchor !== void 0) {
4770
+ a[0].node = this._tag(m("#", a[0].node, !0), t.anchor);
4771
+ continue;
4772
+ }
4773
+ let n = t.op, r = l(n.value, a[0].node, t.node, !0);
4774
+ r = this._tag(r, n.index), a[0].node = r;
4775
+ }
4776
+ }), a[0].node;
4777
+ }), this._ruleCallOp = this.RULE("ruleCallOp", () => {
4778
+ let { OpenParen: e, CloseParen: t } = this._vocab, n = this.SUBRULE(this._ruleFormula);
4779
+ return this.MANY({
4780
+ GATE: () => {
4781
+ let t = this.LA(0), n = this.LA(1);
4782
+ return !(!t || !n || n.tokenType !== e) && n.startOffset === t.endOffset + 1;
4783
+ },
4784
+ DEF: () => {
4785
+ this.CONSUME(e);
4786
+ let r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), a = n, o = this.ACTION(() => this._tag(S(a, i), r)), s = this.OPTION(() => this.CONSUME(t));
4787
+ this.ACTION(() => {
4788
+ s || this._reportError(o, "Missing closing parenthesis ')'", r), this._tagClose(o, this.getLexerPosition()), n = o;
4789
+ });
4790
+ }
4791
+ }), n;
4792
+ }), this._ruleIntersectOp = this.RULE("ruleIntersectOp", () => {
4793
+ let e = [this.SUBRULE(this._ruleInfixOp)];
4794
+ return this.MANY(() => {
4795
+ this.OPTION({
4796
+ GATE: () => {
4797
+ let e = this.LA(0);
4798
+ return this.LA(1).startOffset > e.endOffset + 1;
4799
+ },
4800
+ DEF: () => {
4801
+ e.push(this.SUBRULE3(this._ruleInfixOp));
4802
+ }
4803
+ });
4804
+ }), this.ACTION(() => {
4805
+ for (; e.length > 1;) {
4806
+ let t = e.length - 1;
4807
+ for (let n = 0; n < t; n++) {
4808
+ let r = e[n], i = e[n + 1], a = l(" ", r, i, !0), o = this._tokenMap.get(r);
4809
+ o && delete o.tokenIndexClose;
4810
+ let s = this._tokenMap.get(i), c = s?.tokenIndex;
4811
+ if (c !== void 0) {
4812
+ let e = this.input[c], t = this.input[c - 1]?.endOffset ?? -1, n = this._inputText.slice(t + 1, e.startOffset).slice(0, -1);
4813
+ n.length > 0 && (a.wsBefore = n);
4814
+ }
4815
+ s && delete s.tokenIndex, n + 1 < t && s && delete s.tokenIndexClose, e.splice(n, 2, a), n--, t--;
4816
+ }
4817
+ }
4818
+ }), e[0];
4819
+ }), this._ruleFormula = this.RULE("ruleFormula", () => this.OR9([
4820
+ { ALT: () => this.SUBRULE(this._ruleLiteral) },
4821
+ { ALT: () => this.SUBRULE(this._ruleReference) },
4822
+ { ALT: () => this.SUBRULE(this._ruleFunction) },
4823
+ { ALT: () => this.SUBRULE(this._ruleParen) },
4824
+ { ALT: () => this.SUBRULE(this._ruleTableReference) },
4825
+ { ALT: () => this.SUBRULE(this._ruleBracketedString) },
4826
+ { ALT: () => this.SUBRULE(this._ruleLiteralArray) }
4827
+ ])), this._ruleGroup = this.RULE("ruleGroup", () => {
4828
+ let { ArgSeparator: e } = this._vocab, t = [];
4829
+ return this.MANY(() => {
4830
+ this.CONSUME(e);
4831
+ let n = this.SUBRULE2(this._ruleIntersectOp);
4832
+ this.ACTION(() => {
4833
+ t.push(n);
4834
+ });
4835
+ }), t;
4836
+ }), this._ruleParen = this.RULE("ruleParen", () => {
4837
+ let { OpenParen: e, CloseParen: t } = this._vocab;
4838
+ return this._processParen(b.Paren, e, t);
4839
+ }), this._ruleLiteralArray = this.RULE("ruleLiteralArray", () => {
4840
+ let { OpenCurlyParen: e, CloseCurlyParen: n, ColSeparator: r, RowSeparator: i } = this._vocab, a = t();
4841
+ this.CONSUME(e);
4842
+ let o = this.getLexerPosition(), s = this.ACTION(() => this._tag(f(a), o)), c = this.SUBRULE(this._ruleLiteralForArray);
4843
+ this.ACTION(() => {
4844
+ a.value.push(c);
4845
+ }), this.MANY(() => {
4846
+ let e = !1;
4847
+ this.OR([{ ALT: () => {
4848
+ this.CONSUME(r), e = !0;
4849
+ } }, { ALT: () => this.CONSUME(i) }]);
4850
+ let n = this.SUBRULE2(this._ruleLiteralForArray);
4851
+ this.ACTION(() => {
4852
+ e || (a = t(), s.value.push(a)), a.value.push(n);
4853
+ });
4854
+ });
4855
+ let l = this.OPTION(() => this.CONSUME(n));
4856
+ return s = this.ACTION(() => (l || this._reportError(s, "Missing closing parenthesis '}'", o), this._tagClose(s, this.getLexerPosition()))), s;
4857
+ }), this._ruleLiteralForArray = this.RULE("ruleLiteralForArray", () => {
4858
+ let { StringToken: t, BooleanToken: n, LiteralError: r, RefError: o } = this._vocab;
4859
+ return this.OR([
4860
+ { ALT: () => {
4861
+ let e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), n = this.ACTION(() => this._tag(a(t.image, this._locale), this.getLexerPosition()));
4862
+ return this.ACTION(() => e ? i(e.image, n) : n);
4863
+ } },
4864
+ { ALT: () => {
4865
+ let e = this.CONSUME(t);
4866
+ return this.ACTION(() => this._tag(s(e.image), this.getLexerPosition()));
4867
+ } },
4868
+ { ALT: () => {
4869
+ let t = this.CONSUME(n);
4870
+ return this.ACTION(() => this._tag(e(t.image, this._locale), this.getLexerPosition()));
4871
+ } },
4872
+ { ALT: () => {
4873
+ let e = this.CONSUME(r);
4874
+ return this.ACTION(() => this._tag(ie(e.image, this._locale), this.getLexerPosition()));
4875
+ } },
4876
+ { ALT: () => {
4877
+ let e = this.CONSUME(o);
4878
+ return this.ACTION(() => this._tag(c(e.image, this._locale), this.getLexerPosition()));
4879
+ } }
4880
+ ]);
4881
+ }), this._ruleLiteral = this.RULE("ruleLiteral", () => {
4882
+ let { StringToken: t, BooleanToken: n, LiteralError: r, RefError: i } = this._vocab;
4883
+ return this.OR([
4884
+ { ALT: () => {
4885
+ let e = this.SUBRULE(this._ruleNumber);
4886
+ return this.ACTION(() => this._tag(a(e.image, this._locale), this.getLexerPosition()));
4887
+ } },
4888
+ { ALT: () => {
4889
+ let e = this.CONSUME(t);
4890
+ return this.ACTION(() => this._tag(s(e.image), this.getLexerPosition()));
4891
+ } },
4892
+ { ALT: () => {
4893
+ let t = this.CONSUME(n);
4894
+ return this.ACTION(() => this._tag(e(t.image, this._locale), this.getLexerPosition()));
4895
+ } },
4896
+ { ALT: () => {
4897
+ let e = this.CONSUME(r);
4898
+ return this.ACTION(() => this._tag(ie(e.image, this._locale), this.getLexerPosition()));
4899
+ } },
4900
+ { ALT: () => {
4901
+ let e = this.CONSUME(i);
4902
+ return this.ACTION(() => this._tag(c(e.image, this._locale), this.getLexerPosition()));
4903
+ } }
4904
+ ]);
4905
+ }), this._ruleFunction = this.RULE("ruleFunction", () => {
4906
+ let { FunctionToken: e, OpenParen: t, CloseParen: n } = this._vocab, r = this.CONSUME(e).image, i = this.getLexerPosition();
4907
+ this.CONSUME(t);
4908
+ let a = this.SUBRULE(this._ruleFunctionArguments), s = this.ACTION(() => this._tag(o(r, a), i)), c = this.OPTION(() => this.CONSUME(n));
4909
+ return s = this.ACTION(() => (c || this._reportError(s, "Missing closing parenthesis ')'", i), this._tagClose(s, this.getLexerPosition()))), s;
4910
+ }), this._ruleFunctionArguments = this.RULE("ruleFunctionArguments", () => {
4911
+ let { ArgSeparator: e, CloseParen: t } = this._vocab, n = [];
4912
+ return this.OPTION({
4913
+ GATE: () => this.LA(1).tokenType !== t,
4914
+ DEF: () => {
4915
+ let t;
4916
+ this.OPTION2(() => {
4917
+ t = this.SUBRULE(this._ruleIntersectOp);
4918
+ }), t = this.ACTION(() => t ?? this._tagClose(r(), this.getLexerPosition())), n.push(t), this.MANY(() => {
4919
+ let t;
4920
+ this.CONSUME(e), this.OPTION3(() => {
4921
+ t = this.SUBRULE2(this._ruleIntersectOp);
4922
+ }), t = this.ACTION(() => t ?? this._tagClose(r(), this.getLexerPosition())), n.push(t);
4923
+ });
4924
+ }
4925
+ }), n;
4926
+ }), this._ruleBracketedString = this.RULE("ruleBracketedString", () => {
4927
+ let { BracketedString: e } = this._vocab, t = this.CONSUME(e), n = this.getLexerPosition();
4928
+ return this.ACTION(() => {
4929
+ let e = this._srParser.parse(this.rowIndex, this.colIndex, t.image);
4930
+ for (let t of e.errors) this._astErrors.push(t);
4931
+ return this._tag(e.root, n);
4932
+ });
4933
+ }), this._ruleTableReference = this.RULE("ruleTableReference", () => {
4934
+ let { TableReference: e } = this._vocab, t = this.CONSUME(e), n = this.getLexerPosition();
4935
+ return this.ACTION(() => {
4936
+ let e = this._srParser.parse(this.rowIndex, this.colIndex, t.image);
4937
+ for (let t of e.errors) this._astErrors.push(t);
4938
+ return this._tag(e.root, n);
4939
+ });
4940
+ }), this._ruleReference = this.RULE("ruleReference", () => {
4941
+ let { Sheet: e, SheetQuoted: t, DivOp: n, MulOp: r, PlusOp: i, MinOp: a, ArgSeparator: o, Cell: s, NamedToken: l, SingleQuotedString: f, Column: p, AbsRow: m, DigitToken: g, RefError: _ } = this._vocab, v, y;
4942
+ this.OPTION2({
4943
+ GATE: () => {
4944
+ for (let s = 1; s < 6; s++) {
4945
+ let c = this.LA(s);
4946
+ if (c.tokenType === e || c.tokenType === t) return !0;
4947
+ if (c.image === "" || c.image === ")" || c.tokenType === n || c.tokenType === r || c.tokenType === i || c.tokenType === a || c.tokenType === o) break;
4948
+ }
4949
+ return !1;
4950
+ },
4951
+ DEF: () => {
4952
+ y = this.getLexerPosition() + 1, v = this.SUBRULE(this._rulePrefixSheetName);
4953
+ }
4954
+ });
4955
+ let x = this.OR([
4956
+ { ALT: () => {
4957
+ let e = this.CONSUME(s), t = this.getLexerPosition();
4958
+ return this.ACTION(() => this._tag(u(e.image, this.rowIndex, this.colIndex), t));
4959
+ } },
4960
+ { ALT: () => {
4961
+ let e = this.OR2([{ ALT: () => this.CONSUME(l) }, { ALT: () => this.CONSUME(f) }]);
4962
+ return this.ACTION(() => this._tag(h(e.image), this.getLexerPosition()));
4963
+ } },
4964
+ { ALT: () => this.SUBRULE(this._ruleBracketedString) },
4965
+ { ALT: () => this.SUBRULE(this._ruleFunction) },
4966
+ { ALT: () => {
4967
+ let e = this.CONSUME(p);
4968
+ return this.ACTION(() => this._tag(d(e.image, this.colIndex), this.getLexerPosition()));
4969
+ } },
4970
+ { ALT: () => {
4971
+ let e = this.CONSUME(m);
4972
+ return this.ACTION(() => this._tag(w(e.image, this.rowIndex), this.getLexerPosition()));
4973
+ } },
4974
+ { ALT: () => {
4975
+ let e = this.CONSUME(g);
4976
+ return this.ACTION(() => this._tag(w(e.image, this.rowIndex), this.getLexerPosition()));
4977
+ } },
4978
+ { ALT: () => {
4979
+ let e = this.CONSUME(_);
4980
+ return this.ACTION(() => this._tag(c(e.image, this._locale), this.getLexerPosition()));
4981
+ } }
4982
+ ]);
4983
+ return this.ACTION(() => {
4984
+ if (v && x) {
4985
+ if (v.name === "") return void this._reportError(x, `'${v.image}' is not a valid sheet reference — a '!' needs a sheet name before it`);
4986
+ let e = x;
4987
+ if (x.type === b.Postfix && x.inputs?.[0] && (e = x.inputs[0]), e.type === b.Cell || e.type === b.Named || e.type === b.Row || e.type === b.TableColumn || e.type === b.Error) {
4988
+ e.value.scope = v.name, e.value.scopeImage = v.image;
4989
+ let t = this._tokenMap.get(e);
4990
+ t && y !== void 0 && (t.tokenIndex = y);
4991
+ }
4992
+ }
4993
+ }), x;
4994
+ }), this._rulePrefixSheetName = this.RULE("rulePrefixSheetName", () => {
4995
+ let { SheetQuoted: e, BracketedString: t, NamedToken: n, RangeOp: r, Sheet: i } = this._vocab;
4996
+ return this.OR([{ ALT: () => {
4997
+ let t = this.CONSUME(e).image;
4998
+ return {
4999
+ name: t.slice(1, -2).replace(/''/g, "'"),
5000
+ image: t
5001
+ };
5002
+ } }, { ALT: () => {
5003
+ let e = "";
5004
+ this.OPTION(() => {
5005
+ e += this.CONSUME(t).image;
5006
+ }), this.OPTION2({
5007
+ GATE: () => this.LA(2).tokenType === r,
5008
+ DEF: () => {
5009
+ e += this.CONSUME(n).image, this.CONSUME(r), e += ":";
5010
+ }
5011
+ });
5012
+ let a = this.CONSUME(i).image;
5013
+ return {
5014
+ name: e + a.slice(0, -1),
5015
+ image: e + a
5016
+ };
5017
+ } }]);
5018
+ }), this._ruleNumber = this.RULE("ruleNumber", () => {
5019
+ let { NumberToken: e, ScientificDigit: t, DigitToken: n } = this._vocab;
5020
+ return this.OR([
5021
+ { ALT: () => this.CONSUME(e) },
5022
+ { ALT: () => this.CONSUME(t) },
5023
+ { ALT: () => this.CONSUME(n) }
5024
+ ]);
5025
+ }), this._ruleRoot = this.RULE("ruleRoot", () => {
5026
+ let { ArgSeparator: e } = this._vocab, t = this.SUBRULE(this._ruleIntersectOp), n = [];
5027
+ return this.MANY(() => {
5028
+ this.CONSUME(e), n.push(this.SUBRULE2(this._ruleIntersectOp));
5029
+ }), this.ACTION(() => n.length === 0 ? t : {
5030
+ type: b.List,
5031
+ value: ",",
5032
+ inputs: [t, ...n],
5033
+ isReference: !0
5034
+ });
5035
+ }), this._lexer = _, this._locale = _.getLocale(), this._vocab = v, this._srParser = p?.srParser ?? new $n(this._locale), this.performSelfAnalysis();
5036
+ }
5037
+ getLexer() {
5038
+ return this._lexer;
5039
+ }
5040
+ parse(e, t, n) {
5041
+ let r = this._lexer.tokenize(n), i;
5042
+ if (!r) return {
5043
+ root: {
5044
+ type: b.Unparsed,
5045
+ value: n
5046
+ },
5047
+ errors: []
5048
+ };
5049
+ let a = r.tokens;
5050
+ if (a.length === 0) throw new T.Parse(ir);
5051
+ return this.input = a, this._inputText = n, this._inputTextLength = n.length, this.rowIndex = e, this.colIndex = t, this._astErrors = [], this._tokenMap = /* @__PURE__ */ new Map(), this.reset(), i = this._ruleRoot(), i && this._bindAllWhitespace(i), i = C(i, (t, n) => {
5052
+ let r = t.type, i = n?.isReference ? n.value : void 0, a = typeof i == "string" && er.has(i), o = typeof i == "string" && tr.has(i), s = a ? n.inputs : void 0, c = s ? s[0] === t ? s[1] : s[0] : void 0, l = this._lexer.getMaxRow();
5053
+ if (a && r !== b.Cell && Number.isInteger(t.value)) {
5054
+ let n = w(t.image, e);
5055
+ return ee(n, t), nr(c) === "row" ? rr(t.image, l) || this._reportError(n, `'${t.image}' is not a valid row — rows run from 1 to ${l}`) : this._reportError(n, `'${t.image}' is not a valid reference — a whole row can only pair with another row (as in ${t.image}:${t.image})`), n;
5056
+ }
5057
+ if (o && r === b.Named) return this._reportError(t, `'${t.image ?? t.value?.nameId}' is a name — '${i}' needs a cell or range on both sides`), t;
5058
+ if (r === b.Cell) {
5059
+ let e = t.value, n = e.colIndex === -(2 ** 53 - 1), r = e.rowIndex === -(2 ** 53 - 1);
5060
+ if ((n || r) && nr(c) === (n ? "row" : "col")) return n && !rr(t.image, l) && this._reportError(t, `'${t.image}' is not a valid row — rows run from 1 to ${l}`), t;
5061
+ if (n || r || e.colIndex >= 16384) {
5062
+ let a = h(t.image);
5063
+ ee(a, t);
5064
+ let s = e.scope;
5065
+ return s && (a.value.scope = s, a.value.scopeImage = e.scopeImage), n ? this._reportError(a, `'${t.image}' is not a valid reference — a row needs a column (use ${t.image}:${t.image} for the whole row)`) : r && t.image.includes("$") ? this._reportError(a, `'${t.image}' is not a valid reference — a whole column can only pair with another column (as in ${t.image}:${t.image})`) : o && this._reportError(a, `'${t.image}' is a name — '${i}' needs a cell or range on both sides`), a;
5066
+ }
5067
+ }
5068
+ return t;
5069
+ }), {
5070
+ root: i,
5071
+ errors: [...this.errors, ...this._astErrors]
5072
+ };
5073
+ }
5074
+ _processParen(e, t, n) {
5075
+ let r;
5076
+ this.CONSUME(t);
5077
+ let i = this.getLexerPosition();
5078
+ r = this.ACTION(() => (r = {
5079
+ type: e,
5080
+ value: null,
5081
+ inputs: null
5082
+ }, this._tag(r, i)));
5083
+ let a = [], o = this.SUBRULE(this._ruleIntersectOp);
5084
+ o && a.push(o);
5085
+ let s = this.SUBRULE(this._ruleGroup), c = this.OPTION(() => this.CONSUME(n));
5086
+ return r = this.ACTION(() => {
5087
+ if (s) for (let e = 0; e < s.length; e++) a.push(s[e]);
5088
+ return r && (c || this._reportError(r, "Missing closing parenthesis", i), r.inputs = a), this._tagClose(r, this.getLexerPosition());
5089
+ }), r;
5090
+ }
5091
+ _reportError(e, t, n = void 0, r = "SyntaxError") {
5092
+ n === void 0 && (n = this.getLexerPosition()), e.error = !0, this._astErrors.push({
5093
+ name: r,
5094
+ message: t,
5095
+ previousToken: this.input[n],
5096
+ ast: e
5097
+ });
5098
+ }
5099
+ _tag(e, t) {
5100
+ return e ? (e.image ??= this.input[t].image, this._tokenMap.set(e, {
5101
+ tokenIndex: t,
5102
+ tokenIndexClose: t
5103
+ }), e) : (console.warn("node is null"), e);
5104
+ }
5105
+ _tagClose(e, t) {
5106
+ let n = this._tokenMap.get(e);
5107
+ return n ? n.tokenIndexClose = t : this._tokenMap.set(e, { tokenIndexClose: t }), e;
5108
+ }
5109
+ _bindNodeWhitespace(e) {
5110
+ let t = this._tokenMap.get(e);
5111
+ if (!t) return;
5112
+ let n = this.input, r = this._inputText, i = t.tokenIndex;
5113
+ if (i !== void 0) {
5114
+ let t = n[i], a = n[i - 1]?.endOffset ?? -1;
5115
+ a + 1 < t.startOffset && (e.wsBefore = r.slice(a + 1, t.startOffset));
5116
+ }
5117
+ let a = t.tokenIndexClose;
5118
+ if (a !== void 0) {
5119
+ let t = n[a], i = n[a + 1]?.startOffset ?? this._inputTextLength;
5120
+ t.endOffset + 1 < i && (e.wsAfter = r.slice(t.endOffset + 1, i));
5121
+ }
5122
+ }
5123
+ _bindAllWhitespace(e) {
5124
+ if (e) {
5125
+ if (this._bindNodeWhitespace(e), e.inputs) for (let t of e.inputs) t && this._bindAllWhitespace(t);
5126
+ if (e.type === b.Array && Array.isArray(e.value)) {
5127
+ for (let t of e.value) if (t && Array.isArray(t.value)) for (let e of t.value) e && this._bindAllWhitespace(e);
5128
+ }
5129
+ }
5130
+ }
5131
+ };
5132
+ export { Hn as i, ar as n, cr as r, ir as t };