@sheetxl/studio-vanilla 0.8.0-beta.1 → 0.8.0-beta.2

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 (474) hide show
  1. package/browser/cjs/{C5rQELB0TUeXY6VM.cjs → 3a3qEmdJWFXfGW0q.cjs} +1 -1
  2. package/browser/cjs/9rXsWW4SnEpudhfh.cjs +1 -0
  3. package/browser/cjs/{DiZDRPIgbO3sQ8Vb.cjs → 9vk-L6rRvx20jeQj.cjs} +1 -1
  4. package/browser/cjs/{DxQkFYAFNZubVdn22.cjs → B0FCH1gFfg2bQiPi2.cjs} +1 -1
  5. package/browser/cjs/B3WkiDqFBfA_xxJL2.cjs +1 -0
  6. package/browser/cjs/B4ANcw0mAmhe2Aeb2.cjs +1 -0
  7. package/browser/cjs/B6IXpae7f0J8Ocq62.cjs +1 -0
  8. package/browser/cjs/B6vy56yEA1I3B74O2.cjs +1 -0
  9. package/browser/cjs/B7QDcu7uACQA1y3h.cjs +1 -0
  10. package/browser/cjs/BF8ZxFWyAAnbe4mz.cjs +5 -0
  11. package/browser/cjs/BLAG3kDSthU0SH-E.cjs +2 -0
  12. package/browser/cjs/BPWKnUtyoTrtW567.cjs +1 -0
  13. package/browser/cjs/BQWmn92gYmxC8eWt.cjs +1 -0
  14. package/browser/cjs/BcROQ4pvVajDQ1em.cjs +1 -0
  15. package/browser/cjs/BdJvn1vLXMZvE-8h.cjs +4 -0
  16. package/browser/cjs/BhcbKFKbSWEavYJm.cjs +7 -0
  17. package/browser/cjs/Bncc0oXhFMdj_HuR2.cjs +1 -0
  18. package/browser/cjs/Bo7EQ8niKmwtAwo_2.cjs +1 -0
  19. package/browser/cjs/Bqup1MCJFqTZbLDd2.cjs +1 -0
  20. package/browser/cjs/BsJHSGeWLskirGXg.cjs +14 -0
  21. package/browser/cjs/Bsl_clm06l5cwpML.cjs +32 -0
  22. package/browser/cjs/BvVzIzXLyLxpBcia2.cjs +3 -0
  23. package/browser/cjs/BylqpwnwQYDHIWjX.cjs +5 -0
  24. package/browser/cjs/C-xC6h1TOBr5ZDSe2.cjs +1 -0
  25. package/browser/cjs/{CRx1WvmgBjT8WVyB2.cjs → C0g87ndP2zMUbX6f.cjs} +1 -1
  26. package/browser/cjs/{BziOCn_XEGT4ynN5.cjs → C19UoK2TTtKU_faS.cjs} +1 -1
  27. package/browser/cjs/C1tOH7BEpO_ANMsa.cjs +1 -0
  28. package/browser/cjs/C4cZxb9nRtzTCA40.cjs +1 -0
  29. package/browser/cjs/C9q3zr8iCIoYDrdA.cjs +1 -0
  30. package/browser/cjs/CA_ZsYjkTHSpGK0j.cjs +41 -0
  31. package/browser/cjs/{lEQC21-Sk4lwHy2r2.cjs → CFxueP0tbpmvY1Ip2.cjs} +1 -1
  32. package/browser/cjs/CH7BUjrXIKDIE7XE.cjs +93 -0
  33. package/browser/cjs/CKEselBM-qmMpQBW2.cjs +2 -0
  34. package/browser/cjs/CRcv32tHTbGSGtkh2.cjs +1 -0
  35. package/browser/cjs/{_H5j4dU7HOBYTawU.cjs → CTDN-AYeejrfopDC.cjs} +1 -1
  36. package/browser/cjs/CVHc_cJddJk7J3Zt2.cjs +1 -0
  37. package/browser/cjs/CX7VUEYca9dtWS0N.cjs +1 -0
  38. package/browser/cjs/{BEJFcqVMDMKOvs11.cjs → C_T-ehCAzjaVRmTk.cjs} +1 -1
  39. package/browser/cjs/CaJGoNwTL6pAJ6a42.cjs +1 -0
  40. package/browser/cjs/CfXcRa4RlFmqU0Op2.cjs +1 -0
  41. package/browser/cjs/ClVLjLIRgWqX3Q-F.cjs +1 -0
  42. package/browser/cjs/Co31kjvOPAAYbeF-.cjs +1 -0
  43. package/browser/cjs/CoCKYtBIVeDXxSIq2.cjs +1 -0
  44. package/browser/cjs/CqPb6CbrHTRnbSKa2.cjs +8 -0
  45. package/browser/cjs/CtsduUtTrkcWM02v.cjs +3747 -0
  46. package/browser/cjs/D-N5oLosHPjoj-oG.cjs +1 -0
  47. package/browser/cjs/D2ZPx3v4EVejvhR2.cjs +54 -0
  48. package/browser/cjs/D5Gp16-G3pjMtypl2.cjs +1 -0
  49. package/browser/cjs/D8tkBbkGH5cZzIJP2.cjs +1 -0
  50. package/browser/cjs/DA0nGLC0bEkOhh7G2.cjs +1 -0
  51. package/browser/cjs/DCRe7NqRclU-Jr7p.cjs +1 -0
  52. package/browser/cjs/{EeOVMRq7TuptFKTc2.cjs → DF4l8xrxkcLkgExp2.cjs} +1 -1
  53. package/browser/cjs/{aYuNpndpwcZG5eik2.cjs → DHL7SVvz96-5zSWE2.cjs} +2 -2
  54. package/browser/cjs/DHMQnssVXWjGBSs-.cjs +3 -0
  55. package/browser/cjs/{DsIHLUKUrSrYhFHl.cjs → DIdPQwECld6gubdK2.cjs} +1 -1
  56. package/browser/cjs/DLtFM988NCD-jeBV.cjs +8 -0
  57. package/browser/cjs/DNnMGL1ff8hutxSd.cjs +1 -0
  58. package/browser/cjs/DP1pufP3NJFoDa-g.cjs +3 -0
  59. package/browser/cjs/{CnZfa45XxA-9Jhmp.cjs → DRmo6uoGoqtiVff82.cjs} +1 -1
  60. package/browser/cjs/DSXLVieENYN9qXYl2.cjs +1 -0
  61. package/browser/cjs/{bGMaev70Zd_NXqLM2.cjs → DTZiRVEB3kVK7eK-2.cjs} +1 -1
  62. package/browser/cjs/DU2HMmI1EeHBTvuG.cjs +1 -0
  63. package/browser/cjs/DWzkpizTIJkaqf4J2.cjs +1 -0
  64. package/browser/cjs/DZBKNR9xUMTHWS_D.cjs +1 -0
  65. package/browser/cjs/{B9EI7wviSkHS9ZkH.cjs → D_IilnLuy_hDaBmI.cjs} +1 -1
  66. package/browser/cjs/{a0Z-SXs_N71CtqYb2.cjs → Dg3GaW0QWwnlqetX2.cjs} +1 -1
  67. package/browser/cjs/Dg5fR9uTvYHyxOX62.cjs +22 -0
  68. package/browser/cjs/{Ci8Uu7_b4lwwRLAD2.cjs → Dk1WS0vM-LQJx_EO2.cjs} +1 -1
  69. package/browser/cjs/DpFg69dDCPoOK2BY2.cjs +1 -0
  70. package/browser/cjs/{Cm21F18ga8TluA9h.cjs → DsqHxG-lGZxL1XgQ.cjs} +1 -1
  71. package/browser/cjs/DtlC63s51_88j6AY2.cjs +1 -0
  72. package/browser/cjs/{Du4jBiFxRIF1OjD4.cjs → Dtxj9JR14A-uliu5.cjs} +1 -1
  73. package/browser/cjs/{CpJJh4UnFl1_qFui.cjs → Dx7GQ4ALtNG3kshu.cjs} +1 -1
  74. package/browser/cjs/{DG-AY_xO8RKHtEBE.cjs → Dy50BSaRMmRISD2Y.cjs} +1 -2
  75. package/browser/cjs/GPlG4lbMP89VDHYJ.cjs +126 -0
  76. package/browser/cjs/LD1P-jAXleebK12X.cjs +7 -0
  77. package/browser/cjs/PmwvZPFhqmL4DO582.cjs +1 -0
  78. package/browser/cjs/SATfdSwNygvlOSKC2.cjs +1 -0
  79. package/browser/cjs/TZQc-szdIVnHDH6F.cjs +11 -0
  80. package/browser/cjs/{hzUo76TXMOBqsI3U2.cjs → VgwyOcXDHhEp_NvH2.cjs} +1 -1
  81. package/browser/cjs/XRCcogT-Iqd3Wv6R2.cjs +1 -0
  82. package/browser/cjs/a4xpA8d_d22-GKos.cjs +1 -0
  83. package/browser/cjs/aBulzIf4cHnL7sbw.cjs +1 -0
  84. package/browser/cjs/cexWxRluo6g-NG_u.cjs +1 -0
  85. package/browser/cjs/iYn00uzmSLl2T0oN2.cjs +1 -0
  86. package/browser/cjs/ibvsavYh4kU-xxL8.cjs +1 -0
  87. package/browser/cjs/index.cjs +2 -2
  88. package/browser/cjs/{DIbdDzNf_3S2RYZN.cjs → p3PYFz7cN2z4XQoU.cjs} +1 -1
  89. package/browser/cjs/{D19RglhKiroWfpQn2.cjs → xTT7lHV4HUjeNdMs2.cjs} +1 -1
  90. package/browser/esm/{Cc5IufffX4N-8QpE.mjs → 04mVsW7CTmUlxnOa.mjs} +3 -3
  91. package/browser/esm/0YKBRd7eLIUmcKns.mjs +35 -0
  92. package/browser/esm/13CH9sjvoEqt6nbt2.mjs +37 -0
  93. package/browser/esm/7lIMFL11BRZrMXdc2.mjs +19 -0
  94. package/browser/esm/9CP_UyAqmAHE7-mv.mjs +267 -0
  95. package/{cdn/assets/Bv_96nwOEMHN9Sa0.js → browser/esm/AAHsV9V95k39t9SD.mjs} +27 -29
  96. package/browser/esm/{CsufM5aF6VTLKDWM.mjs → B-Zf8W3s_WXgYxhN.mjs} +12 -12
  97. package/browser/esm/{D3G3tI3DVCUF3Gdk.mjs → B0FNPu0uhX_WW-aJ.mjs} +1 -1
  98. package/{cdn/assets/Chq4BwbjH0sbIkJN2.js → browser/esm/B0aCnXuYD0ZopZdA.mjs} +28 -13
  99. package/browser/esm/B2nEJHcip8raAhdc.mjs +3342 -0
  100. package/browser/esm/B2vjec5TDs2ZJ1eI2.mjs +33 -0
  101. package/browser/esm/{D_t53-8k73CNpV-p.mjs → B50P0gSziuG68Umu.mjs} +88 -72
  102. package/browser/esm/BA6JMESdvw_1-mFg2.mjs +238 -0
  103. package/{cdn/assets/DQ4o4dG7gWbL1X8F.js → browser/esm/BBaNqp1ZjuO25FQg2.mjs} +2 -2
  104. package/browser/esm/BBzzLAeBBFbVvgph2.mjs +8 -0
  105. package/browser/esm/{7rixDGGrR72lXkMV.mjs → BCQgeu38866r56Dh.mjs} +97 -54
  106. package/{cdn/assets/DQ-0yyFAwoWtxmhV2.js → browser/esm/BDZAVKSYpcOp9Dve2.mjs} +1 -1
  107. package/browser/esm/BEWsOD2JQ8dwQCEm2.mjs +427 -0
  108. package/browser/esm/{CG5v2hAwGR5Ptufn.mjs → BEYY8z4FusH7S5K-.mjs} +1 -1
  109. package/browser/esm/{R5bs6kCQSZmsCXz-.mjs → BF842ZtkvebA1LgR.mjs} +1 -1
  110. package/browser/esm/{oYdWyqsKo9ejAdVm.mjs → BG_hG8jUkf0aMzGK.mjs} +2 -2
  111. package/browser/esm/{BLcn1kGRsjURZSzk.mjs → BG_hG8jUkf0aMzGK2.mjs} +2 -2
  112. package/{cdn/assets/8f9hCbpXTTYEgG31.js → browser/esm/BIab7njjwaSXjSEP2.mjs} +2 -2
  113. package/browser/esm/BJJBFdJaP2dMlug92.mjs +280 -0
  114. package/{cdn/assets/EwzqnZl1lTr56hH-.js → browser/esm/BM343UBJqjbDokO62.mjs} +1 -1
  115. package/browser/esm/{vcRSnmAqjwKglEkY.mjs → BOhfbmK18Xj1P7-i.mjs} +2 -2
  116. package/browser/esm/{Blc1T4zLkp8bRC_n2.mjs → BPt7dDNLBsKrZgzO2.mjs} +22 -22
  117. package/browser/esm/{CQM87ZBN7Yzn4Yxr.mjs → BTNqElWtYkKW47Vg.mjs} +3 -3
  118. package/{cdn/assets/CpnA5TZRkPDt4HnM2.js → browser/esm/BVOTzF7NFvB20R7D.mjs} +2 -2
  119. package/browser/esm/BVtQCzVeMOJZq64r2.mjs +394 -0
  120. package/browser/esm/BZZ2IOkVKppFWNLE.mjs +27 -0
  121. package/browser/esm/{BqTFwWLbXXJ0Fu-X2.mjs → B_49GiUSgx96vBvq2.mjs} +2 -2
  122. package/browser/esm/{CpjX81WsWJbXMUoT.mjs → BauR0SATr44ggHRU.mjs} +1712 -941
  123. package/browser/esm/Bc8-re9biUn57kdl.mjs +87777 -0
  124. package/browser/esm/{DFdU1DsC1lXOrejZ.mjs → BcHN_VMA7bLNKKMO.mjs} +1817 -1740
  125. package/browser/esm/{CJPemkFUzhcAD_qR.mjs → Bcjus_Q6f72kE1MK.mjs} +1 -1
  126. package/browser/esm/{Dc0BDcQUGy_WIVFa.mjs → Be2-C5U5LlfLTmyo2.mjs} +1 -1
  127. package/browser/esm/Be7--zCnU6JvLkK1.mjs +637 -0
  128. package/{cdn/assets/CAPgMrAKg07EREFD2.js → browser/esm/Bfq8Gdqf3I7y_Hju.mjs} +1 -1
  129. package/browser/esm/BhGgNWNVYntkJYgU.mjs +155 -0
  130. package/browser/esm/{DXWmgQSeh0_HDxZj.mjs → BiArrlzwKsOlSm00.mjs} +4 -4
  131. package/browser/esm/{Dnx3_xXfRlD6ECfZ2.mjs → Bl5xLu1ou-9zMIBZ2.mjs} +5 -5
  132. package/browser/esm/{DuPdSe-EXFTx9dsc2.mjs → BnFriW2cIcOJkXU42.mjs} +16 -16
  133. package/browser/esm/{8V-VceXEjpADM8qK2.mjs → Bokc-Wu4XBPWKmdt.mjs} +1 -1
  134. package/browser/esm/BuSBBEiK_3KnBr632.mjs +514 -0
  135. package/browser/esm/{DW72HwfnJtQxzoGa.mjs → Bvy9LWN5UHwJXV9i2.mjs} +2 -2
  136. package/{cdn/assets/BMRav2VAqEzDSp3r.js → browser/esm/C04uI3XsvTc6Cc7w2.mjs} +37 -3
  137. package/{cdn/assets/iXWgTu3qpYZHcx1J.js → browser/esm/C1EvC_qPiGiVMrkF.mjs} +963 -946
  138. package/{cdn/assets/Clfp7SznkOrJoQvL.js → browser/esm/C1doaJjkCzQlB_3u2.mjs} +3 -3
  139. package/browser/esm/{BjTf3XA9Swj0ngpH.mjs → C3M_lKSZ_Fq1SQOn.mjs} +2 -2
  140. package/browser/esm/C3qSUuVA-FII3rMU2.mjs +298 -0
  141. package/browser/esm/{1guzFZp1LHz_FwfL.mjs → C6X4CmElTpPxrad6.mjs} +1 -1
  142. package/{cdn/assets/DOsbSsKsexrBoeXa2.js → browser/esm/CA4eJpge9meoO0rj2.mjs} +17 -18
  143. package/browser/esm/CAVONPXgoytyiNK-.mjs +25 -0
  144. package/browser/esm/{CR3jgkduTLczbMjH2.mjs → CPgOplnn6NuHwsZ_.mjs} +1 -1
  145. package/{cdn/assets/B5ZqqASTcBEV5L9K.js → browser/esm/CQBSLdAdR53c7BVh2.mjs} +1 -1
  146. package/{cdn/assets/C1ZePT2B182vSnxW.js → browser/esm/CThP3jXwDzLlUOeI.mjs} +1 -1
  147. package/browser/esm/CTzKk6VuZTohsOIF2.mjs +58 -0
  148. package/{cdn/assets/DRc_Wi5c7WdKHTVN.js → browser/esm/CU1_-PzBC9cDsm5t2.mjs} +6 -6
  149. package/browser/esm/{DZbR5R1fNikjgqYb.mjs → CULlzRLL3s2Dikjg.mjs} +1 -1
  150. package/browser/esm/CUMu_1tXFa0LPKGV.mjs +3324 -0
  151. package/browser/esm/{CH0of3GZTzHviuQV.mjs → CUYBRp4sHMdGwkLT.mjs} +1 -1
  152. package/browser/esm/CYU_-DiQXjh1SEU1.mjs +3343 -0
  153. package/{cdn/assets/BKEzd89UphJ8q1pp2.js → browser/esm/CaTmLXIsIxaOrLcZ.mjs} +504 -405
  154. package/browser/esm/CcK4ACF7d5ogFpAS.mjs +91 -0
  155. package/{cdn/assets/CtXoSHbCUKMY-tSJ2.js → browser/esm/CjFOk9mcZqAngWD2.mjs} +48 -2
  156. package/browser/esm/{CdMv3f8Gyxh8q2RR2.mjs → CmSATmXaMlqwTjAe2.mjs} +1 -1
  157. package/{cdn/assets/COA_SZY2x8q6t4BD.js → browser/esm/CnvlkxK0pS02Z3gZ.mjs} +7 -6
  158. package/browser/esm/{9_bymSfTn_rR_v6W.mjs → Cvw3poNlUmn3qAh0.mjs} +6 -6
  159. package/browser/esm/{47Yv4X226-93If7L.mjs → CwDjNuGkKnVtfJo-.mjs} +1 -1
  160. package/{cdn/assets/BHBJtVTiQByD_y9j2.js → browser/esm/D-egzesxukW7Z_e3.mjs} +2 -2
  161. package/{cdn/assets/hFSDx-LnUOObv-6h.js → browser/esm/D13sLQRMMKrDHepu.mjs} +2 -2
  162. package/{cdn/assets/CGqvy5LwQ4z9J2oD.js → browser/esm/D1bACCJy4F8kANLy.mjs} +1 -1
  163. package/browser/esm/{CfvrjQGuf7vXiQCB.mjs → D5Pa9lfPfAcCGj_N.mjs} +1 -1
  164. package/browser/esm/{DzDwSOBdJh_lx_NM.mjs → DBTB0moKfwOu0F47.mjs} +241 -241
  165. package/browser/esm/{3y_bCend8tkaewDG2.mjs → DHzdEqMCGL_JPh9w2.mjs} +19 -27
  166. package/browser/esm/{fJ1McMt7xzRA_lUX.mjs → DMMtONCySdMHoaMU.mjs} +15 -15
  167. package/browser/esm/{BHmYoIIbNW3GdcqV2.mjs → DTfDzhFtORWkuoRv.mjs} +1 -1
  168. package/browser/esm/{BD7RxHQgrqy_4tb5.mjs → DYyxB53T5uaoyInL2.mjs} +2 -2
  169. package/browser/esm/DZLyXICwEHYRnCuO.mjs +758 -0
  170. package/browser/esm/{D6SKy2BtcWkhfiA02.mjs → DbVSG7Uf7YDQbmc32.mjs} +2 -5
  171. package/browser/esm/Dd80tsdITZsotoCX2.mjs +47 -0
  172. package/browser/esm/{CZWIS7FuqNjbheSw.mjs → DeSDYBzD8e5XXnvq.mjs} +40 -40
  173. package/browser/esm/DeeFxCkhXDF0p1nl.mjs +87 -0
  174. package/{cdn/assets/Cbw0JeJURvQyxIoa.js → browser/esm/DgH-AoqKDdIWg0J8.mjs} +1 -1
  175. package/browser/esm/{qG5zdZZAe6mQIJo32.mjs → DjNR_ZGCbg-xia152.mjs} +5 -5
  176. package/browser/esm/DkuK8fY8vrl7aZpf2.mjs +115 -0
  177. package/browser/esm/{DMX-ZlC_ljcf7oUN.mjs → DmPq6SwNcX1qXKct.mjs} +1 -1
  178. package/{cdn/assets/BDkVAo0CDCTE04ZJ.js → browser/esm/Dn8Z0WK2Hwi8MRnQ.mjs} +1 -1
  179. package/{cdn/assets/BCZjYGV8AqIZghBH.js → browser/esm/DoCYcvHzw3S0MDCW.mjs} +69 -4
  180. package/browser/esm/{BCkXtOM3yKocv7L-2.mjs → DtQu3vHaJfA5KM2H2.mjs} +1 -1
  181. package/browser/esm/{DtXC6uPF2LLktqFE.mjs → DtqMTXq5u5DmS5S1.mjs} +2 -2
  182. package/browser/esm/{CEN8dYSpN2oew8HH.mjs → DuijhgjRhgWB9sCY.mjs} +504 -331
  183. package/browser/esm/{B1NoGosH2YQh01g7.mjs → DyPe20tPiPVm1PLe.mjs} +6 -6
  184. package/{cdn/assets/CopfZ7Y1Zn_PDNXK.js → browser/esm/Dz713G5R9JayR5v1.mjs} +16 -11
  185. package/browser/esm/{NekeSGoazNCraGNC2.mjs → GDYIOITizuJ9xSUf2.mjs} +15 -15
  186. package/{cdn/assets/BykiUmcpDgSRNQI1.js → browser/esm/LfHB39-nf7mi9XC72.mjs} +1 -1
  187. package/browser/esm/{C6CK_4GD9IpxKglV2.mjs → LgoljOEffsYkpZZJ2.mjs} +2452 -2961
  188. package/browser/esm/QNvOHujamKYSXWWA2.mjs +32 -0
  189. package/browser/esm/{D4VqLbEWag8lTWzC2.mjs → R2c8rUTz1GjCQEp-2.mjs} +121 -94
  190. package/browser/esm/S2_pz0y2RTJFpXkS.mjs +15 -0
  191. package/browser/esm/{Gy0CHZTvn4hY-rkx2.mjs → V-oO_EfTyth0iptZ2.mjs} +1 -1
  192. package/browser/esm/XB269tVMhdRHj10G.mjs +674 -0
  193. package/browser/esm/{DVZ_UnchuMRveDG32.mjs → YC83lJ3yRZP57lBl2.mjs} +42 -4
  194. package/browser/esm/{DTaVECXVrgvC48BE.mjs → ZJ32DJlBpN_9fAph.mjs} +3 -3
  195. package/browser/esm/{DMLwXmjo28k_iNEU.mjs → apjOZ6N9KbmyErGz.mjs} +1867 -1402
  196. package/browser/esm/b49cTAZ6BWPQgfYu.mjs +159 -0
  197. package/{cdn/assets/DIQf1pX-j-dWQu_e.js → browser/esm/bvuPDJZmI2O5oihy2.mjs} +139 -138
  198. package/browser/esm/{DBL3Qp5jyPrFg7KI2.mjs → eTXmezPFvAwM_L-D2.mjs} +1 -1
  199. package/{cdn/assets/BVjXdv_wkL1x_8ZJ2.js → browser/esm/ep-IjWXOPg2b-REP2.mjs} +1 -1
  200. package/browser/esm/{Be4QC65cR8N84rTn.mjs → f9r0yTaD2YChFtEg2.mjs} +1 -1
  201. package/browser/esm/fJ0eqh3Ja3O0z1QL.mjs +149 -0
  202. package/browser/esm/{BceIETi6JJRW6Ss62.mjs → gAriGKwELet15RCY2.mjs} +13 -13
  203. package/browser/esm/gCeoOjDjiVaX8dtF2.mjs +119 -0
  204. package/browser/esm/iYNN3Px9AekrMEfu2.mjs +117 -0
  205. package/browser/esm/index.mjs +6 -6
  206. package/browser/esm/{-vgNEEXiEad4bltZ.mjs → j-9DpYsIlTN1mwql.mjs} +16021 -16672
  207. package/browser/esm/{BOl4FzJRD7MplCU72.mjs → jQ5c7MGwQOZq4s5w.mjs} +1 -1
  208. package/browser/esm/kcfC6hY47HklE6Om.mjs +225 -0
  209. package/{cdn/assets/DrUEYcXg6N2D2s1Z.js → browser/esm/lHpMVBxqkkCYD6d12.mjs} +51 -11
  210. package/{cdn/assets/D9-wpGVbTS9rRpxx.js → browser/esm/nBZATD4yR1W5D4Fi.mjs} +1 -1
  211. package/browser/esm/{B4vYIE3kSPTxCgpf2.mjs → rxlYDHBsenoxRx-K2.mjs} +6 -6
  212. package/browser/esm/sfOREE_huDAOcfYs.mjs +15495 -0
  213. package/browser/esm/{BPv6Pw1hW-sV5Fya.mjs → txVgXcuMeWVNWHnZ.mjs} +1 -1
  214. package/{cdn/assets/DvlpP6sUZ9Qzl9s22.js → browser/esm/xzoxSwyGoZdH-ysh.mjs} +193 -172
  215. package/browser/esm/{BVRzmIk5PujkT_Ap.mjs → yFldtlfN_ASKyMll.mjs} +563 -534
  216. package/browser/esm/yVLsr0rcaOFel2nS2.mjs +32 -0
  217. package/cdn/assets/13CH9sjvoEqt6nbt.js +37 -0
  218. package/cdn/assets/{CHttngK66Ido5dWW.js → 2QsTDWiE6SMelbNU2.js} +7 -7
  219. package/cdn/assets/588lLflWQypQVzce.js +27 -0
  220. package/cdn/assets/7lIMFL11BRZrMXdc.js +19 -0
  221. package/{browser/esm/Bv_96nwOEMHN9Sa02.mjs → cdn/assets/AAHsV9V95k39t9SD.js} +27 -29
  222. package/cdn/assets/{D3G3tI3DVCUF3Gdk2.js → B0FNPu0uhX_WW-aJ2.js} +1 -1
  223. package/cdn/assets/B2vjec5TDs2ZJ1eI.js +33 -0
  224. package/cdn/assets/{D_t53-8k73CNpV-p2.js → B50P0gSziuG68Umu2.js} +88 -72
  225. package/cdn/assets/{BhDLR-jtbOOG-tl12.js → B66--qmqjDI4V95v2.js} +25 -25
  226. package/cdn/assets/{C8mUyjJ26jsHGl_D.js → B9hBziUoXFzKPWF02.js} +7 -7
  227. package/cdn/assets/{BixsQGDDf3Iv_PtW2.js → B9oLwnLz9m-TWSPJ2.js} +1867 -1402
  228. package/cdn/assets/{DW7JlG-SQEdLYNar2.js → BB6k7f_6TCVysy8a.js} +41 -3
  229. package/{browser/esm/DQ4o4dG7gWbL1X8F2.mjs → cdn/assets/BBaNqp1ZjuO25FQg.js} +2 -2
  230. package/{browser/esm/DQ-0yyFAwoWtxmhV2.mjs → cdn/assets/BDZAVKSYpcOp9Dve.js} +1 -1
  231. package/cdn/assets/{CG5v2hAwGR5Ptufn2.js → BEYY8z4FusH7S5K-2.js} +1 -1
  232. package/cdn/assets/{R5bs6kCQSZmsCXz-2.js → BF842ZtkvebA1LgR2.js} +1 -1
  233. package/{browser/esm/8f9hCbpXTTYEgG312.mjs → cdn/assets/BIab7njjwaSXjSEP.js} +2 -2
  234. package/cdn/assets/BKouftCLbhExXXXU.js +264 -0
  235. package/{browser/esm/EwzqnZl1lTr56hH-2.mjs → cdn/assets/BM343UBJqjbDokO6.js} +1 -1
  236. package/cdn/assets/{DLEdaT0MmrOxMa2h2.js → BNm-ZCOBoBRceGXA2.js} +59 -59
  237. package/cdn/assets/{vcRSnmAqjwKglEkY2.js → BOhfbmK18Xj1P7-i2.js} +2 -2
  238. package/{browser/esm/BqwvP0318zI2izeL2.mjs → cdn/assets/BPOi08RtEmQdlbtS2.js} +27 -26
  239. package/cdn/assets/{gspQcUnmlRIwG609.js → BSixIKI7PxSqiUGB2.js} +5 -5
  240. package/{browser/esm/RW23HF8taEtW8q9D.mjs → cdn/assets/BT3KOuPzJsNUvy4B.js} +2 -2
  241. package/cdn/assets/BTB79KyzSZf-h-lm2.js +226 -0
  242. package/{browser/esm/CPUlpDM6aAzZzCat2.mjs → cdn/assets/BWtyERLPrUmI8Qbi2.js} +140 -137
  243. package/cdn/assets/{BqTFwWLbXXJ0Fu-X.js → B_49GiUSgx96vBvq.js} +2 -2
  244. package/cdn/assets/B_UEqzmXZIhHAEyS.js +280 -0
  245. package/cdn/assets/B_sKE05xgjFFafjm.js +15496 -0
  246. package/{browser/esm/B0HA_dHcr0kKfudQ.mjs → cdn/assets/BaEH7HZAJkFGHtNj2.js} +203 -180
  247. package/cdn/assets/{CJPemkFUzhcAD_qR.js → Bcjus_Q6f72kE1MK.js} +1 -1
  248. package/cdn/assets/{DbEGszSW_J_k96KJ.js → BdCn57ENgiC2kOsF.js} +2 -2
  249. package/cdn/assets/{Dc0BDcQUGy_WIVFa.js → Be2-C5U5LlfLTmyo.js} +1 -1
  250. package/cdn/assets/Be_TDLQucHiVwNvT.js +268 -0
  251. package/{browser/esm/CAPgMrAKg07EREFD.mjs → cdn/assets/Bfq8Gdqf3I7y_Hju2.js} +1 -1
  252. package/cdn/assets/Bi9IWSBo7DDXROTC.js +8 -0
  253. package/cdn/assets/{Dnx3_xXfRlD6ECfZ.js → Bl5xLu1ou-9zMIBZ.js} +5 -5
  254. package/cdn/assets/{8V-VceXEjpADM8qK.js → Bokc-Wu4XBPWKmdt.js} +1 -1
  255. package/cdn/assets/{DJwQ9abZkyFO9Doy.js → Bqe5WbSIlCRYLcqT.js} +4 -4
  256. package/cdn/assets/{j8nXVEYbO2kPuEYQ.js → BsGz_0JrhSfOZ24Q.js} +3 -3
  257. package/cdn/assets/BsHFBjNwTzc_CKLq2.js +87777 -0
  258. package/cdn/assets/{BJEpPEyFWtLzMIq-2.js → BuyRy9BcgPYo8l8W.js} +1801 -1030
  259. package/cdn/assets/{DVS_5oDniuAFH3vT2.js → ByHzW_x0qXsBJMwv2.js} +2429 -2938
  260. package/{browser/esm/BMRav2VAqEzDSp3r2.mjs → cdn/assets/C04uI3XsvTc6Cc7w.js} +37 -3
  261. package/{browser/esm/Clfp7SznkOrJoQvL.mjs → cdn/assets/C1doaJjkCzQlB_3u.js} +3 -3
  262. package/cdn/assets/C2JMpa_lWCs9k2ZI.js +3324 -0
  263. package/cdn/assets/{Ce5A_D4YBgi_s2KF.js → C2X9NooB33IkSomz.js} +13 -13
  264. package/cdn/assets/{CBuvbUg67ah_3BOZ.js → C3KIo0iwLXhIIMG8.js} +2 -2
  265. package/cdn/assets/{1guzFZp1LHz_FwfL2.js → C6X4CmElTpPxrad6.js} +1 -1
  266. package/cdn/assets/C6X4CmElTpPxrad62.js +24 -0
  267. package/{browser/esm/CU1d8OvDv5TU6fSd.mjs → cdn/assets/C7ZHXwoL2A_nxZjl.js} +484 -385
  268. package/cdn/assets/CA9oxppuFcYDyylE.js +149 -0
  269. package/cdn/assets/{B55nrhIK6gAAu4ZA.js → CAOPlenSF-pjVfqt2.js} +2 -2
  270. package/cdn/assets/CAVONPXgoytyiNK-.js +25 -0
  271. package/{browser/esm/B4iT_CduJeJunwBc.mjs → cdn/assets/CBQrIDBtf5Ibwi96.js} +28 -13
  272. package/cdn/assets/{DvItgGbf8IOWPyxd.js → CCTYceFrydwG3Vyt2.js} +10681 -11332
  273. package/cdn/assets/CDijenaMI_dBIGU-.js +3344 -0
  274. package/cdn/assets/{DCnA2-zB7W_QB-tD2.js → COk-0FZl3cv__3yY2.js} +565 -536
  275. package/cdn/assets/{c6VvwMHfXubjjtyj.js → CP0M0z_IaCwCMGNS.js} +16 -16
  276. package/cdn/assets/{CR3jgkduTLczbMjH.js → CPgOplnn6NuHwsZ_2.js} +1 -1
  277. package/cdn/assets/{-2S675KWulPRlVNb2.js → CPjsJ0CY-AurDJgm2.js} +14 -14
  278. package/{browser/esm/B5ZqqASTcBEV5L9K2.mjs → cdn/assets/CQBSLdAdR53c7BVh.js} +1 -1
  279. package/{browser/esm/C1ZePT2B182vSnxW2.mjs → cdn/assets/CThP3jXwDzLlUOeI2.js} +1 -1
  280. package/cdn/assets/CTzKk6VuZTohsOIF.js +58 -0
  281. package/{browser/esm/DRc_Wi5c7WdKHTVN2.mjs → cdn/assets/CU1_-PzBC9cDsm5t.js} +6 -6
  282. package/cdn/assets/{DZbR5R1fNikjgqYb.js → CULlzRLL3s2Dikjg.js} +1 -1
  283. package/cdn/assets/{CT3G9YRPVfKtHWwf2.js → CUTnOs5iWyc3J2cN2.js} +16 -16
  284. package/cdn/assets/CUYBRp4sHMdGwkLT2.js +24 -0
  285. package/cdn/assets/CUrzB9ponX7LAYXR.js +35 -0
  286. package/{browser/esm/Bl6bX86tSq8hfyb2.mjs → cdn/assets/CWOPhBfYI6R0kz-p.js} +965 -944
  287. package/cdn/assets/CZ3JFujrzd0iX0zL2.js +428 -0
  288. package/cdn/assets/{2CuCH0wi9XPgVzE42.js → CheDxDxt7x0CPz9P.js} +11 -9
  289. package/{browser/esm/CtXoSHbCUKMY-tSJ.mjs → cdn/assets/CjFOk9mcZqAngWD22.js} +48 -2
  290. package/cdn/assets/{CdMv3f8Gyxh8q2RR.js → CmSATmXaMlqwTjAe.js} +1 -1
  291. package/{browser/esm/COA_SZY2x8q6t4BD.mjs → cdn/assets/CnvlkxK0pS02Z3gZ.js} +7 -6
  292. package/cdn/assets/{DKeLjEJPO9nT3bpr.js → CqI09iUEId8rHfJ9.js} +242 -242
  293. package/cdn/assets/{47Yv4X226-93If7L2.js → CwDjNuGkKnVtfJo-2.js} +1 -1
  294. package/cdn/assets/CzEHYpK2SYTRpxDm2.js +239 -0
  295. package/{browser/esm/BHBJtVTiQByD_y9j.mjs → cdn/assets/D-egzesxukW7Z_e32.js} +2 -2
  296. package/{browser/esm/hFSDx-LnUOObv-6h2.mjs → cdn/assets/D13sLQRMMKrDHepu2.js} +2 -2
  297. package/{browser/esm/CGqvy5LwQ4z9J2oD2.mjs → cdn/assets/D1bACCJy4F8kANLy2.js} +1 -1
  298. package/cdn/assets/{CfvrjQGuf7vXiQCB2.js → D5Pa9lfPfAcCGj_N2.js} +1 -1
  299. package/{browser/esm/Dg5wjQp0fArKXlM3.mjs → cdn/assets/D6Uwvg4vo1g0pWZa.js} +16 -11
  300. package/cdn/assets/{D1MA2ed2cLMt7hV9.js → DI4QTfUQPCjSn0kl.js} +41 -41
  301. package/cdn/assets/DIlrvTRlRll76TiE2.js +496 -0
  302. package/cdn/assets/DJBTmv-rddT91Z-N2.js +156 -0
  303. package/cdn/assets/{D-fJXasEYyfRUcj2.js → DPN0a43QHMUmHgo5.js} +3 -3
  304. package/cdn/assets/{BHmYoIIbNW3GdcqV.js → DTfDzhFtORWkuoRv2.js} +1 -1
  305. package/cdn/assets/DYCh_5thAx4qo1ns2.js +3342 -0
  306. package/cdn/assets/{D6SKy2BtcWkhfiA0.js → DbVSG7Uf7YDQbmc3.js} +2 -5
  307. package/cdn/assets/Dd80tsdITZsotoCX.js +47 -0
  308. package/cdn/assets/Dg26zVdGlO10MX0h2.js +159 -0
  309. package/{browser/esm/Cbw0JeJURvQyxIoa.mjs → cdn/assets/DgH-AoqKDdIWg0J8.js} +1 -1
  310. package/cdn/assets/{qG5zdZZAe6mQIJo3.js → DjNR_ZGCbg-xia15.js} +5 -5
  311. package/cdn/assets/{tVOVNvOs6ro8FXqa2.js → Dlq2nAMNpWkqjt9Y.js} +16 -16
  312. package/cdn/assets/DmQ4uKOlhrcJfgk82.js +118 -0
  313. package/cdn/assets/{DaBczM5xU9ev5_or.js → DmRqcUu6qCPcOxgW.js} +2 -2
  314. package/{browser/esm/BDkVAo0CDCTE04ZJ2.mjs → cdn/assets/Dn8Z0WK2Hwi8MRnQ2.js} +1 -1
  315. package/cdn/assets/{DnzDlqizzNkbhJP7.js → DoBxkE57H5PfH7Or.js} +2 -2
  316. package/{browser/esm/BCZjYGV8AqIZghBH.mjs → cdn/assets/DoCYcvHzw3S0MDCW.js} +69 -4
  317. package/cdn/assets/{BCkXtOM3yKocv7L-.js → DtQu3vHaJfA5KM2H.js} +1 -1
  318. package/cdn/assets/{CEN8dYSpN2oew8HH2.js → DuijhgjRhgWB9sCY2.js} +504 -331
  319. package/cdn/assets/DvfekR32WVFv_WrS.js +394 -0
  320. package/cdn/assets/Dz0_oXqVesISvhbJ.js +87 -0
  321. package/cdn/assets/{EjOJX5m8OEL-IjPB.js → I2Cn0c2NkX845WIx.js} +7 -7
  322. package/cdn/assets/Ifw8W-tqHjQnCWZO2.js +299 -0
  323. package/{browser/esm/BykiUmcpDgSRNQI12.mjs → cdn/assets/LfHB39-nf7mi9XC7.js} +1 -1
  324. package/cdn/assets/{CF8m5SqeMaRkGIYM.js → N5PCgig3g9yqotn9.js} +2 -2
  325. package/cdn/assets/QNvOHujamKYSXWWA.js +32 -0
  326. package/cdn/assets/{BzUU8y1IFjREzgog2.js → QT-5i27zeGPhkyui2.js} +20 -28
  327. package/cdn/assets/S2_pz0y2RTJFpXkS2.js +15 -0
  328. package/cdn/assets/{BNybEGR813e3aNIv.js → UNtnFd2ssTtnrqRp.js} +1820 -1743
  329. package/cdn/assets/{Gy0CHZTvn4hY-rkx.js → V-oO_EfTyth0iptZ.js} +1 -1
  330. package/cdn/assets/VEJV_bhNDNNyZAIA2.js +116 -0
  331. package/cdn/assets/WFkg-W8MQ-V6F1Fu.js +758 -0
  332. package/cdn/assets/{DZDynaLqNeVaDoiH2.js → XFQGB8ADW__0ZBoF2.js} +9 -9
  333. package/cdn/assets/{C_Io1QC4CeLGRBrz.js → _gPnIgVx33slqynA.js} +2 -2
  334. package/cdn/assets/b-o8RUlQpF1RaDgI.js +675 -0
  335. package/cdn/assets/{DBL3Qp5jyPrFg7KI.js → eTXmezPFvAwM_L-D.js} +1 -1
  336. package/{browser/esm/BVjXdv_wkL1x_8ZJ2.mjs → cdn/assets/ep-IjWXOPg2b-REP2.js} +1 -1
  337. package/cdn/assets/{mtrwY1hjJeYlmzC-.js → erwt6xEgCY7lDQWp.js} +3 -3
  338. package/cdn/assets/f1iQWnLWVpKZ34XR2.js +91 -0
  339. package/cdn/assets/{Be4QC65cR8N84rTn2.js → f9r0yTaD2YChFtEg.js} +1 -1
  340. package/cdn/assets/gCeoOjDjiVaX8dtF.js +119 -0
  341. package/cdn/assets/{UYgwKnPX3US3Cj2k2.js → gJT4n5za0DqWXFK12.js} +75 -48
  342. package/cdn/assets/{BOl4FzJRD7MplCU7.js → jQ5c7MGwQOZq4s5w2.js} +1 -1
  343. package/{browser/esm/DrUEYcXg6N2D2s1Z2.mjs → cdn/assets/lHpMVBxqkkCYD6d1.js} +51 -11
  344. package/{browser/esm/D9-wpGVbTS9rRpxx.mjs → cdn/assets/nBZATD4yR1W5D4Fi.js} +1 -1
  345. package/cdn/assets/{BPv6Pw1hW-sV5Fya.js → txVgXcuMeWVNWHnZ.js} +1 -1
  346. package/cdn/assets/yVLsr0rcaOFel2nS.js +32 -0
  347. package/cdn/index.js +2 -2
  348. package/package.json +3 -3
  349. package/browser/cjs/2zXD3NPfuQT2KSZq.cjs +0 -7
  350. package/browser/cjs/49_x589Na12sizKK.cjs +0 -1
  351. package/browser/cjs/B19QM3SGmPKKwD_o.cjs +0 -1
  352. package/browser/cjs/B4JJfKSI4ppwU8552.cjs +0 -1
  353. package/browser/cjs/B5YBx0GqLor3i0O1.cjs +0 -1
  354. package/browser/cjs/BC2gCQkR1iykfAuC.cjs +0 -1
  355. package/browser/cjs/BEVqcFGFU6Ri9y8T.cjs +0 -5
  356. package/browser/cjs/BEzaum_kgG4yAOx0.cjs +0 -1
  357. package/browser/cjs/BF-38Z7Z0FZOPl192.cjs +0 -1
  358. package/browser/cjs/BIQZDBQfv3Qm5iC8.cjs +0 -4
  359. package/browser/cjs/BSCgCfORdZz1Ii5S.cjs +0 -2
  360. package/browser/cjs/BZr-IqNS1skh1hr6.cjs +0 -21
  361. package/browser/cjs/BfzzZ9IR27ZPzj-8.cjs +0 -3
  362. package/browser/cjs/Bgke3PtMSF2Iaen4.cjs +0 -1
  363. package/browser/cjs/BnccBYHCCq9TGFx4.cjs +0 -8
  364. package/browser/cjs/BwLx9ix5Sq7suAYP2.cjs +0 -1
  365. package/browser/cjs/C-HOJozu5NgCil1q.cjs +0 -1
  366. package/browser/cjs/C2oTW2DjZypuqq7x.cjs +0 -1
  367. package/browser/cjs/C6yxQPAEgcGWAhYR.cjs +0 -33
  368. package/browser/cjs/C9C-pr-T_ThweQX92.cjs +0 -1
  369. package/browser/cjs/CPgCih_KEqnUZ9Rv.cjs +0 -3
  370. package/browser/cjs/CSNCOmYEOR-iTJ7K.cjs +0 -5
  371. package/browser/cjs/C_7w8EJZpHw8ueuq.cjs +0 -1
  372. package/browser/cjs/C_IEgjM-hSJCv6Gm.cjs +0 -1
  373. package/browser/cjs/CcneNtiqtKppCa-p.cjs +0 -57
  374. package/browser/cjs/CeF0DZ-k4DB8M47I.cjs +0 -1
  375. package/browser/cjs/Clu7XiAsCB48GDXN2.cjs +0 -1
  376. package/browser/cjs/CojEXZgX08waZOoq.cjs +0 -1
  377. package/browser/cjs/CrDTTLE9EvaGDSD4.cjs +0 -88
  378. package/browser/cjs/Cty5pi0fwToP1GWe.cjs +0 -7
  379. package/browser/cjs/CvV18ZJgssoHMkdf2.cjs +0 -2
  380. package/browser/cjs/Cy-4IMt-AbR-ifP3.cjs +0 -126
  381. package/browser/cjs/CyGzzWYDy-IniKCq2.cjs +0 -7
  382. package/browser/cjs/CzgwTfy2072Dmt5u.cjs +0 -1
  383. package/browser/cjs/DCIlWcGDrp-5PDoA.cjs +0 -1
  384. package/browser/cjs/DFHxNnJ-lHtv0hIq.cjs +0 -1
  385. package/browser/cjs/DH3WXPfGHwWJW0nH.cjs +0 -1
  386. package/browser/cjs/DNCC-QNp2I7saV-I.cjs +0 -1
  387. package/browser/cjs/DNy-UU3NKNqQQngF.cjs +0 -1
  388. package/browser/cjs/DPjEO7dwhCFd8DHR2.cjs +0 -2
  389. package/browser/cjs/DfMJOaJ0GcUiSn4Q.cjs +0 -1
  390. package/browser/cjs/DsFZgtSQpC75d1M02.cjs +0 -1
  391. package/browser/cjs/DvSvfeo9V0Abfd3q2.cjs +0 -1
  392. package/browser/cjs/E-IqDztfMb_xdszH.cjs +0 -1
  393. package/browser/cjs/ElcoSB--cCpS6i7R2.cjs +0 -1
  394. package/browser/cjs/KNCocKN9uPR0tvUS.cjs +0 -1
  395. package/browser/cjs/Kr8f1inOTt-MICaP2.cjs +0 -1
  396. package/browser/cjs/Kvn916ebqGc4t6hv2.cjs +0 -1
  397. package/browser/cjs/PM3PrEWG3WHKxaDx.cjs +0 -1
  398. package/browser/cjs/YG320hBA20Dl3HoU2.cjs +0 -1
  399. package/browser/cjs/bIaGoYEDSBCrAaB6.cjs +0 -1
  400. package/browser/cjs/fqTQ_p3ehzUvc1tF2.cjs +0 -1
  401. package/browser/cjs/h3dw1jAp2J5Pu4p32.cjs +0 -1
  402. package/browser/cjs/i2VboqjlOcozI9MQ.cjs +0 -12
  403. package/browser/cjs/jev6VGWTdgEgm4Yk2.cjs +0 -1
  404. package/browser/cjs/ppSJKdLn646BZOzg.cjs +0 -1
  405. package/browser/cjs/xBcvszV6x7ys-m532.cjs +0 -1
  406. package/browser/esm/At60x9FEPePwPP_J.mjs +0 -51151
  407. package/browser/esm/B4h6iO7hQ9lCR7kj.mjs +0 -11273
  408. package/browser/esm/BBtOlJMVlsWorNJH.mjs +0 -824
  409. package/browser/esm/BQDXkeSabbxB5DUB2.mjs +0 -47
  410. package/browser/esm/BUCKq_2lHPd1ndvw.mjs +0 -149
  411. package/browser/esm/BX4f6i2WMBMKFVCq.mjs +0 -99
  412. package/browser/esm/BZsx0QHg1RZlM9ZN.mjs +0 -15
  413. package/browser/esm/BhxX7CZWSOlV2Dsz.mjs +0 -224
  414. package/browser/esm/BhzLZRz2N8RxjQ_U.mjs +0 -34
  415. package/browser/esm/BkSb_vyWe-AhyEDa.mjs +0 -4423
  416. package/browser/esm/Bp9qFBIcpIGXvMgo.mjs +0 -134
  417. package/browser/esm/C0rS1uBqfsj-gPR8.mjs +0 -152
  418. package/browser/esm/CGGJWgWSPZ0aP_C3.mjs +0 -87
  419. package/browser/esm/CGyydD3tRb0ik50l2.mjs +0 -20
  420. package/browser/esm/CY1zykikO58_ADk8.mjs +0 -3188
  421. package/browser/esm/Cb-FUOYcyRSkHG6u2.mjs +0 -238
  422. package/browser/esm/Cd8HXAJlflkkTXxc.mjs +0 -53
  423. package/browser/esm/CfuhUkrvOq11d9FR.mjs +0 -44
  424. package/browser/esm/Ckl3FLCOeqw7yhkP2.mjs +0 -82
  425. package/browser/esm/DDOO4tcrO4OfMUDe.mjs +0 -25
  426. package/browser/esm/DDUYQ8FPeh1TJU24.mjs +0 -538
  427. package/browser/esm/DVJd6McdAG5udItH.mjs +0 -27
  428. package/browser/esm/DVQNQmjI2PKkwiOw2.mjs +0 -514
  429. package/browser/esm/D_zNx76HGunFi7xJ.mjs +0 -509
  430. package/browser/esm/DfRGH6mEtIVDWEYN2.mjs +0 -304
  431. package/browser/esm/DnuaqN0xfgqzl8qG.mjs +0 -2687
  432. package/browser/esm/nguMxPB9LKexKBRX.mjs +0 -219
  433. package/browser/esm/qzhFT2j-mpQEQnKs.mjs +0 -16386
  434. package/cdn/assets/2UHIeioUPXrwtZy-2.js +0 -83
  435. package/cdn/assets/BAhvL7M7ZcgZ8eDc2.js +0 -48
  436. package/cdn/assets/BM7OqAUEUk-up7_82.js +0 -134
  437. package/cdn/assets/BNuoKAzs4zkxSocG2.js +0 -44
  438. package/cdn/assets/BU6uQhQhpaLElTT82.js +0 -225
  439. package/cdn/assets/BVgTMDEoPgsWFmku.js +0 -510
  440. package/cdn/assets/BWlMK76Aj2d4ygsH.js +0 -538
  441. package/cdn/assets/BZsx0QHg1RZlM9ZN2.js +0 -15
  442. package/cdn/assets/Bl6C6xWT8E6b7OwJ2.js +0 -239
  443. package/cdn/assets/CGyydD3tRb0ik50l.js +0 -20
  444. package/cdn/assets/CH0of3GZTzHviuQV.js +0 -24
  445. package/cdn/assets/CH0of3GZTzHviuQV2.js +0 -24
  446. package/cdn/assets/CpYlf4dXa_V2v-iS2.js +0 -3188
  447. package/cdn/assets/Crkvq5j5KIa6eTLI2.js +0 -51151
  448. package/cdn/assets/Cv-KXN9kl0UeMezQ.js +0 -824
  449. package/cdn/assets/CvtkpvGzCHhNuwTm.js +0 -16386
  450. package/cdn/assets/D9gETGi23d14kT7u2.js +0 -99
  451. package/cdn/assets/D9joTG0Z2zdWHAEa2.js +0 -4423
  452. package/cdn/assets/DC9obE_EVmxtvXCf.js +0 -11275
  453. package/cdn/assets/DDNivpFWzQ3AIJia.js +0 -2687
  454. package/cdn/assets/DDOO4tcrO4OfMUDe.js +0 -25
  455. package/cdn/assets/DEUY_zuVwmptMX4l.js +0 -150
  456. package/cdn/assets/DTCtbG90ip7Z7LaG.js +0 -220
  457. package/cdn/assets/D_HeH7AJqWoxehn52.js +0 -53
  458. package/cdn/assets/DfRGH6mEtIVDWEYN.js +0 -304
  459. package/cdn/assets/WLUhtyUNK5QJ7Pff.js +0 -34
  460. package/cdn/assets/c7aIqKLOO4pvUsV12.js +0 -220
  461. package/cdn/assets/mtI43hWjdp4E3Z_-.js +0 -152
  462. package/cdn/assets/nmR_PgTW7GrlbHHZ.js +0 -27
  463. package/cdn/assets/vTCuFafvRlSaT9wy.js +0 -87
  464. /package/browser/cjs/{507hQYooKKjnRzsZ2.cjs → 507hQYooKKjnRzsZ.cjs} +0 -0
  465. /package/browser/cjs/{BWDfauDHqB6U_2ka2.cjs → BWDfauDHqB6U_2ka.cjs} +0 -0
  466. /package/browser/cjs/{CV4KQsHluMqo1I2Q.cjs → CV4KQsHluMqo1I2Q2.cjs} +0 -0
  467. /package/browser/cjs/{CXlzsh_WHCOsErJ12.cjs → CXlzsh_WHCOsErJ1.cjs} +0 -0
  468. /package/browser/cjs/{DDnGLOLTqLFsdUDS2.cjs → DDnGLOLTqLFsdUDS.cjs} +0 -0
  469. /package/browser/cjs/{DG2kqsWRUtVugjay2.cjs → DG2kqsWRUtVugjay.cjs} +0 -0
  470. /package/browser/cjs/{DM7-R_ltoLbA9jde2.cjs → DM7-R_ltoLbA9jde.cjs} +0 -0
  471. /package/browser/cjs/{Dx79LP1-YCQg8B87.cjs → Dx79LP1-YCQg8B872.cjs} +0 -0
  472. /package/browser/cjs/{JfM6P_qoQQTWakZf.cjs → JfM6P_qoQQTWakZf2.cjs} +0 -0
  473. /package/browser/cjs/{CbLXP9WY38wTcGn5.cjs → NcNz8RfT5V889CMT2.cjs} +0 -0
  474. /package/browser/cjs/{z_rZE1OHFPpdGBh42.cjs → z_rZE1OHFPpdGBh4.cjs} +0 -0
@@ -1,4423 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.8.0-beta.1
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { o as e } from "./D_t53-8k73CNpV-p.mjs";
8
- import { Vt as t } from "./At60x9FEPePwPP_J.mjs";
9
- function n(e) {
10
- console && console.error && console.error(`Error: ${e}`);
11
- }
12
- function r(e) {
13
- console && console.warn && console.warn(`Warning: ${e}`);
14
- }
15
- function i(e) {
16
- let t = (/* @__PURE__ */ new Date()).getTime(), n = e();
17
- return {
18
- time: (/* @__PURE__ */ new Date()).getTime() - t,
19
- value: n
20
- };
21
- }
22
- function a(e) {
23
- function t() {}
24
- t.prototype = e;
25
- let n = new t();
26
- function r() {
27
- return typeof n.bar;
28
- }
29
- return r(), r(), e;
30
- }
31
- var o = class {
32
- get definition() {
33
- return this._definition;
34
- }
35
- set definition(e) {
36
- this._definition = e;
37
- }
38
- constructor(e) {
39
- this._definition = e;
40
- }
41
- accept(e) {
42
- e.visit(this), this.definition.forEach((t) => {
43
- t.accept(e);
44
- });
45
- }
46
- }, s = class extends o {
47
- constructor(e) {
48
- super([]), this.idx = 1, Object.assign(this, v(e));
49
- }
50
- set definition(e) {}
51
- get definition() {
52
- return this.referencedRule === void 0 ? [] : this.referencedRule.definition;
53
- }
54
- accept(e) {
55
- e.visit(this);
56
- }
57
- }, c = class extends o {
58
- constructor(e) {
59
- super(e.definition), this.orgText = "", Object.assign(this, v(e));
60
- }
61
- }, l = class extends o {
62
- constructor(e) {
63
- super(e.definition), this.ignoreAmbiguities = !1, Object.assign(this, v(e));
64
- }
65
- }, u = class extends o {
66
- constructor(e) {
67
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
68
- }
69
- }, d = class extends o {
70
- constructor(e) {
71
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
72
- }
73
- }, f = class extends o {
74
- constructor(e) {
75
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
76
- }
77
- }, p = class extends o {
78
- constructor(e) {
79
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
80
- }
81
- }, m = class extends o {
82
- constructor(e) {
83
- super(e.definition), this.idx = 1, Object.assign(this, v(e));
84
- }
85
- }, h = class extends o {
86
- get definition() {
87
- return this._definition;
88
- }
89
- set definition(e) {
90
- this._definition = e;
91
- }
92
- constructor(e) {
93
- super(e.definition), this.idx = 1, this.ignoreAmbiguities = !1, this.hasPredicates = !1, Object.assign(this, v(e));
94
- }
95
- }, g = class {
96
- constructor(e) {
97
- this.idx = 1, Object.assign(this, v(e));
98
- }
99
- accept(e) {
100
- e.visit(this);
101
- }
102
- };
103
- function _(e) {
104
- function t(e) {
105
- return e.map(_);
106
- }
107
- if (e instanceof s) {
108
- let t = {
109
- type: "NonTerminal",
110
- name: e.nonTerminalName,
111
- idx: e.idx
112
- };
113
- return typeof e.label == "string" && (t.label = e.label), t;
114
- }
115
- if (e instanceof l) return {
116
- type: "Alternative",
117
- definition: t(e.definition)
118
- };
119
- if (e instanceof u) return {
120
- type: "Option",
121
- idx: e.idx,
122
- definition: t(e.definition)
123
- };
124
- if (e instanceof d) return {
125
- type: "RepetitionMandatory",
126
- idx: e.idx,
127
- definition: t(e.definition)
128
- };
129
- if (e instanceof f) return {
130
- type: "RepetitionMandatoryWithSeparator",
131
- idx: e.idx,
132
- separator: _(new g({ terminalType: e.separator })),
133
- definition: t(e.definition)
134
- };
135
- if (e instanceof m) return {
136
- type: "RepetitionWithSeparator",
137
- idx: e.idx,
138
- separator: _(new g({ terminalType: e.separator })),
139
- definition: t(e.definition)
140
- };
141
- if (e instanceof p) return {
142
- type: "Repetition",
143
- idx: e.idx,
144
- definition: t(e.definition)
145
- };
146
- if (e instanceof h) return {
147
- type: "Alternation",
148
- idx: e.idx,
149
- definition: t(e.definition)
150
- };
151
- if (e instanceof g) {
152
- let t = {
153
- type: "Terminal",
154
- name: e.terminalType.name,
155
- label: (n = e.terminalType, typeof (r = n).LABEL == "string" && r.LABEL !== "" ? n.LABEL : n.name),
156
- idx: e.idx
157
- };
158
- typeof e.label == "string" && (t.terminalLabel = e.label);
159
- let i = e.terminalType.PATTERN;
160
- return e.terminalType.PATTERN && (t.pattern = i instanceof RegExp ? i.source : i), t;
161
- }
162
- if (e instanceof c) return {
163
- type: "Rule",
164
- name: e.name,
165
- orgText: e.orgText,
166
- definition: t(e.definition)
167
- };
168
- throw Error("non exhaustive match");
169
- var n, r;
170
- }
171
- function v(e) {
172
- return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
173
- }
174
- var y = class {
175
- visit(e) {
176
- let t = e;
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);
188
- default: throw Error("non exhaustive match");
189
- }
190
- }
191
- visitNonTerminal(e) {}
192
- visitAlternative(e) {}
193
- visitOption(e) {}
194
- visitRepetition(e) {}
195
- visitRepetitionMandatory(e) {}
196
- visitRepetitionMandatoryWithSeparator(e) {}
197
- visitRepetitionWithSeparator(e) {}
198
- visitAlternation(e) {}
199
- visitTerminal(e) {}
200
- visitRule(e) {}
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))));
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";
214
- throw Error("non exhaustive match");
215
- }
216
- var S = class {
217
- walk(e, t = []) {
218
- e.definition.forEach((n, r) => {
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);
228
- else {
229
- if (!(n instanceof h)) throw Error("non exhaustive match");
230
- this.walkOr(n, i, t);
231
- }
232
- });
233
- }
234
- walkTerminal(e, t, n) {}
235
- walkProdRef(e, t, n) {}
236
- walkFlat(e, t, n) {
237
- let r = t.concat(n);
238
- this.walk(e, r);
239
- }
240
- walkOption(e, t, n) {
241
- let r = t.concat(n);
242
- this.walk(e, r);
243
- }
244
- walkAtLeastOne(e, t, n) {
245
- let r = [new u({ definition: e.definition })].concat(t, n);
246
- this.walk(e, r);
247
- }
248
- walkAtLeastOneSep(e, t, n) {
249
- let r = C(e, t, n);
250
- this.walk(e, r);
251
- }
252
- walkMany(e, t, n) {
253
- let r = [new u({ definition: e.definition })].concat(t, n);
254
- this.walk(e, r);
255
- }
256
- walkManySep(e, t, n) {
257
- let r = C(e, t, n);
258
- this.walk(e, r);
259
- }
260
- walkOr(e, t, n) {
261
- let r = t.concat(n);
262
- e.definition.forEach((e) => {
263
- let t = new l({ definition: [e] });
264
- this.walk(t, r);
265
- });
266
- }
267
- };
268
- function C(e, t, n) {
269
- return [new u({ definition: [new g({ terminalType: e.separator })].concat(e.definition) })].concat(t, n);
270
- }
271
- function w(e) {
272
- if (e instanceof s) return w(e.referencedRule);
273
- if (e instanceof g) return [e.terminalType];
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;
276
- }(e)) return function(e) {
277
- let t, n = [], r = e.definition, i = 0, a = r.length > i, o = !0;
278
- for (; a && o;) t = r[i], o = b(t), n = n.concat(w(t)), i += 1, a = r.length > i;
279
- return [...new Set(n)];
280
- }(e);
281
- if (function(e) {
282
- return e instanceof h;
283
- }(e)) return function(e) {
284
- let t = e.definition.map((e) => w(e));
285
- return [...new Set(t.flat())];
286
- }(e);
287
- throw Error("non exhaustive match");
288
- }
289
- var T = "_~IN~_", E = class extends S {
290
- constructor(e) {
291
- super(), this.topProd = e, this.follows = {};
292
- }
293
- startWalking() {
294
- return this.walk(this.topProd), this.follows;
295
- }
296
- walkTerminal(e, t, n) {}
297
- walkProdRef(e, t, n) {
298
- let r = (i = e.referencedRule, a = e.idx, i.name + a + T + this.topProd.name);
299
- var i, a;
300
- let o = w(new l({ definition: t.concat(n) }));
301
- this.follows[r] = o;
302
- }
303
- };
304
- function D(e) {
305
- return e.charCodeAt(0);
306
- }
307
- function O(e, t) {
308
- Array.isArray(e) ? e.forEach(function(e) {
309
- t.push(e);
310
- }) : t.push(e);
311
- }
312
- function k(e, t) {
313
- if (!0 === e[t]) throw "duplicate flag " + t;
314
- e[t], e[t] = !0;
315
- }
316
- function A(e) {
317
- if (e === void 0) throw Error("Internal Error - Should never get here!");
318
- return !0;
319
- }
320
- function j() {
321
- throw Error("Internal Error - Should never get here!");
322
- }
323
- function M(e) {
324
- return e.type === "Character";
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 F = [
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
- ], ee = /[0-9a-fA-F]/, I = /[0-9]/, te = /[1-9]/, L = class {
359
- visitChildren(e) {
360
- for (let t in e) {
361
- let n = e[t];
362
- e.hasOwnProperty(t) && (n.type === void 0 ? Array.isArray(n) && n.forEach((e) => {
363
- this.visit(e);
364
- }, this) : this.visit(n));
365
- }
366
- }
367
- visit(e) {
368
- switch (e.type) {
369
- case "Pattern":
370
- this.visitPattern(e);
371
- break;
372
- case "Flags":
373
- this.visitFlags(e);
374
- break;
375
- case "Disjunction":
376
- this.visitDisjunction(e);
377
- break;
378
- case "Alternative":
379
- this.visitAlternative(e);
380
- break;
381
- case "StartAnchor":
382
- this.visitStartAnchor(e);
383
- break;
384
- case "EndAnchor":
385
- this.visitEndAnchor(e);
386
- break;
387
- case "WordBoundary":
388
- this.visitWordBoundary(e);
389
- break;
390
- case "NonWordBoundary":
391
- this.visitNonWordBoundary(e);
392
- break;
393
- case "Lookahead":
394
- this.visitLookahead(e);
395
- break;
396
- case "NegativeLookahead":
397
- this.visitNegativeLookahead(e);
398
- break;
399
- case "Lookbehind":
400
- this.visitLookbehind(e);
401
- break;
402
- case "NegativeLookbehind":
403
- this.visitNegativeLookbehind(e);
404
- break;
405
- case "Character":
406
- this.visitCharacter(e);
407
- break;
408
- case "Set":
409
- this.visitSet(e);
410
- break;
411
- case "Group":
412
- this.visitGroup(e);
413
- break;
414
- case "GroupBackReference":
415
- this.visitGroupBackReference(e);
416
- break;
417
- case "Quantifier": this.visitQuantifier(e);
418
- }
419
- this.visitChildren(e);
420
- }
421
- visitPattern(e) {}
422
- visitFlags(e) {}
423
- visitDisjunction(e) {}
424
- visitAlternative(e) {}
425
- visitStartAnchor(e) {}
426
- visitEndAnchor(e) {}
427
- visitWordBoundary(e) {}
428
- visitNonWordBoundary(e) {}
429
- visitLookahead(e) {}
430
- visitNegativeLookahead(e) {}
431
- visitLookbehind(e) {}
432
- visitNegativeLookbehind(e) {}
433
- visitCharacter(e) {}
434
- visitSet(e) {}
435
- visitGroup(e) {}
436
- visitGroupBackReference(e) {}
437
- visitQuantifier(e) {}
438
- }, R = {}, ne = new class {
439
- constructor() {
440
- this.idx = 0, this.input = "", this.groupIdx = 0;
441
- }
442
- saveState() {
443
- return {
444
- idx: this.idx,
445
- input: this.input,
446
- groupIdx: this.groupIdx
447
- };
448
- }
449
- restoreState(e) {
450
- this.idx = e.idx, this.input = e.input, this.groupIdx = e.groupIdx;
451
- }
452
- pattern(e) {
453
- this.idx = 0, this.input = e, this.groupIdx = 0, this.consumeChar("/");
454
- let t = this.disjunction();
455
- this.consumeChar("/");
456
- let n = {
457
- type: "Flags",
458
- loc: {
459
- begin: this.idx,
460
- end: e.length
461
- },
462
- global: !1,
463
- ignoreCase: !1,
464
- multiLine: !1,
465
- unicode: !1,
466
- sticky: !1
467
- };
468
- for (; this.isRegExpFlag();) switch (this.popChar()) {
469
- case "g":
470
- k(n, "global");
471
- break;
472
- case "i":
473
- k(n, "ignoreCase");
474
- break;
475
- case "m":
476
- k(n, "multiLine");
477
- break;
478
- case "u":
479
- k(n, "unicode");
480
- break;
481
- case "y": k(n, "sticky");
482
- }
483
- if (this.idx !== this.input.length) throw Error("Redundant input: " + this.input.substring(this.idx));
484
- return {
485
- type: "Pattern",
486
- flags: n,
487
- value: t,
488
- loc: this.loc(0)
489
- };
490
- }
491
- disjunction() {
492
- let e = [], t = this.idx;
493
- for (e.push(this.alternative()); this.peekChar() === "|";) this.consumeChar("|"), e.push(this.alternative());
494
- return {
495
- type: "Disjunction",
496
- value: e,
497
- loc: this.loc(t)
498
- };
499
- }
500
- alternative() {
501
- let e = [], t = this.idx;
502
- for (; this.isTerm();) e.push(this.term());
503
- return {
504
- type: "Alternative",
505
- value: e,
506
- loc: this.loc(t)
507
- };
508
- }
509
- term() {
510
- return this.isAssertion() ? this.assertion() : this.atom();
511
- }
512
- assertion() {
513
- let e = this.idx;
514
- switch (this.popChar()) {
515
- case "^": return {
516
- type: "StartAnchor",
517
- loc: this.loc(e)
518
- };
519
- case "$": return {
520
- type: "EndAnchor",
521
- loc: this.loc(e)
522
- };
523
- case "\\":
524
- switch (this.popChar()) {
525
- case "b": return {
526
- type: "WordBoundary",
527
- loc: this.loc(e)
528
- };
529
- case "B": return {
530
- type: "NonWordBoundary",
531
- loc: this.loc(e)
532
- };
533
- }
534
- throw Error("Invalid Assertion Escape");
535
- case "(":
536
- let t;
537
- switch (this.consumeChar("?"), this.popChar()) {
538
- case "=":
539
- t = "Lookahead";
540
- break;
541
- case "!":
542
- t = "NegativeLookahead";
543
- break;
544
- case "<": switch (this.popChar()) {
545
- case "=":
546
- t = "Lookbehind";
547
- break;
548
- case "!": t = "NegativeLookbehind";
549
- }
550
- }
551
- A(t);
552
- let n = this.disjunction();
553
- return this.consumeChar(")"), {
554
- type: t,
555
- value: n,
556
- loc: this.loc(e)
557
- };
558
- }
559
- return j();
560
- }
561
- quantifier(e = !1) {
562
- let t, n = this.idx;
563
- switch (this.popChar()) {
564
- case "*":
565
- t = {
566
- atLeast: 0,
567
- atMost: Infinity
568
- };
569
- break;
570
- case "+":
571
- t = {
572
- atLeast: 1,
573
- atMost: Infinity
574
- };
575
- break;
576
- case "?":
577
- t = {
578
- atLeast: 0,
579
- atMost: 1
580
- };
581
- break;
582
- case "{":
583
- let n = this.integerIncludingZero();
584
- switch (this.popChar()) {
585
- case "}":
586
- t = {
587
- atLeast: n,
588
- atMost: n
589
- };
590
- break;
591
- case ",":
592
- let e;
593
- this.isDigit() ? (e = this.integerIncludingZero(), t = {
594
- atLeast: n,
595
- atMost: e
596
- }) : t = {
597
- atLeast: n,
598
- atMost: Infinity
599
- }, this.consumeChar("}");
600
- }
601
- if (!0 === e && t === void 0) return;
602
- A(t);
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;
605
- }
606
- atom() {
607
- let e, t = this.idx;
608
- switch (this.peekChar()) {
609
- case ".":
610
- e = this.dotAll();
611
- break;
612
- case "\\":
613
- e = this.atomEscape();
614
- break;
615
- case "[":
616
- e = this.characterClass();
617
- break;
618
- case "(": e = this.group();
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();
621
- }
622
- dotAll() {
623
- return this.consumeChar("."), {
624
- type: "Set",
625
- complement: !0,
626
- value: [
627
- D("\n"),
628
- D("\r"),
629
- D("\u2028"),
630
- D("\u2029")
631
- ]
632
- };
633
- }
634
- atomEscape() {
635
- switch (this.consumeChar("\\"), this.peekChar()) {
636
- case "1":
637
- case "2":
638
- case "3":
639
- case "4":
640
- case "5":
641
- case "6":
642
- case "7":
643
- case "8":
644
- case "9": return this.decimalEscapeAtom();
645
- case "d":
646
- case "D":
647
- case "s":
648
- case "S":
649
- case "w":
650
- case "W": return this.characterClassEscape();
651
- case "f":
652
- case "n":
653
- case "r":
654
- case "t":
655
- case "v": return this.controlEscapeAtom();
656
- case "c": return this.controlLetterEscapeAtom();
657
- case "0": return this.nulCharacterAtom();
658
- case "x": return this.hexEscapeSequenceAtom();
659
- case "u": return this.regExpUnicodeEscapeSequenceAtom();
660
- default: return this.identityEscapeAtom();
661
- }
662
- }
663
- decimalEscapeAtom() {
664
- return {
665
- type: "GroupBackReference",
666
- value: this.positiveInteger()
667
- };
668
- }
669
- characterClassEscape() {
670
- let e, t = !1;
671
- switch (this.popChar()) {
672
- case "d":
673
- e = N;
674
- break;
675
- case "D":
676
- e = N, t = !0;
677
- break;
678
- case "s":
679
- e = F;
680
- break;
681
- case "S":
682
- e = F, t = !0;
683
- break;
684
- case "w":
685
- e = P;
686
- break;
687
- case "W": e = P, t = !0;
688
- }
689
- return A(e) ? {
690
- type: "Set",
691
- value: e,
692
- complement: t
693
- } : j();
694
- }
695
- controlEscapeAtom() {
696
- let e;
697
- switch (this.popChar()) {
698
- case "f":
699
- e = D("\f");
700
- break;
701
- case "n":
702
- e = D("\n");
703
- break;
704
- case "r":
705
- e = D("\r");
706
- break;
707
- case "t":
708
- e = D(" ");
709
- break;
710
- case "v": e = D("\v");
711
- }
712
- return A(e) ? {
713
- type: "Character",
714
- value: e
715
- } : j();
716
- }
717
- controlLetterEscapeAtom() {
718
- this.consumeChar("c");
719
- let e = this.popChar();
720
- if (!1 === /[a-zA-Z]/.test(e)) throw Error("Invalid ");
721
- return {
722
- type: "Character",
723
- value: e.toUpperCase().charCodeAt(0) - 64
724
- };
725
- }
726
- nulCharacterAtom() {
727
- return this.consumeChar("0"), {
728
- type: "Character",
729
- value: D("\0")
730
- };
731
- }
732
- hexEscapeSequenceAtom() {
733
- return this.consumeChar("x"), this.parseHexDigits(2);
734
- }
735
- regExpUnicodeEscapeSequenceAtom() {
736
- return this.consumeChar("u"), this.parseHexDigits(4);
737
- }
738
- identityEscapeAtom() {
739
- return {
740
- type: "Character",
741
- value: D(this.popChar())
742
- };
743
- }
744
- classPatternCharacterAtom() {
745
- switch (this.peekChar()) {
746
- case "\n":
747
- case "\r":
748
- case "\u2028":
749
- case "\u2029":
750
- case "\\":
751
- case "]": throw Error("TBD");
752
- default: return {
753
- type: "Character",
754
- value: D(this.popChar())
755
- };
756
- }
757
- }
758
- characterClass() {
759
- let e = [], t = !1;
760
- for (this.consumeChar("["), this.peekChar(0) === "^" && (this.consumeChar("^"), t = !0); this.isClassAtom();) {
761
- let t = this.classAtom();
762
- if (t.type, M(t) && this.isRangeDash()) {
763
- this.consumeChar("-");
764
- let n = this.classAtom();
765
- if (n.type, M(n)) {
766
- if (n.value < t.value) throw Error("Range out of order in character class");
767
- e.push({
768
- from: t.value,
769
- to: n.value
770
- });
771
- } else O(t.value, e), e.push(D("-")), O(n.value, e);
772
- } else O(t.value, e);
773
- }
774
- return this.consumeChar("]"), {
775
- type: "Set",
776
- complement: t,
777
- value: e
778
- };
779
- }
780
- classAtom() {
781
- switch (this.peekChar()) {
782
- case "]":
783
- case "\n":
784
- case "\r":
785
- case "\u2028":
786
- case "\u2029": throw Error("TBD");
787
- case "\\": return this.classEscape();
788
- default: return this.classPatternCharacterAtom();
789
- }
790
- }
791
- classEscape() {
792
- switch (this.consumeChar("\\"), this.peekChar()) {
793
- case "b": return this.consumeChar("b"), {
794
- type: "Character",
795
- value: D("\b")
796
- };
797
- case "d":
798
- case "D":
799
- case "s":
800
- case "S":
801
- case "w":
802
- case "W": return this.characterClassEscape();
803
- case "f":
804
- case "n":
805
- case "r":
806
- case "t":
807
- case "v": return this.controlEscapeAtom();
808
- case "c": return this.controlLetterEscapeAtom();
809
- case "0": return this.nulCharacterAtom();
810
- case "x": return this.hexEscapeSequenceAtom();
811
- case "u": return this.regExpUnicodeEscapeSequenceAtom();
812
- default: return this.identityEscapeAtom();
813
- }
814
- }
815
- group() {
816
- let e = !0;
817
- this.consumeChar("("), this.peekChar(0) === "?" ? (this.consumeChar("?"), this.consumeChar(":"), e = !1) : this.groupIdx++;
818
- let t = this.disjunction();
819
- this.consumeChar(")");
820
- let n = {
821
- type: "Group",
822
- capturing: e,
823
- value: t
824
- };
825
- return e && (n.idx = this.groupIdx), n;
826
- }
827
- positiveInteger() {
828
- let e = this.popChar();
829
- if (!1 === te.test(e)) throw Error("Expecting a positive integer");
830
- for (; I.test(this.peekChar(0));) e += this.popChar();
831
- return parseInt(e, 10);
832
- }
833
- integerIncludingZero() {
834
- let e = this.popChar();
835
- if (!1 === I.test(e)) throw Error("Expecting an integer");
836
- for (; I.test(this.peekChar(0));) e += this.popChar();
837
- return parseInt(e, 10);
838
- }
839
- patternCharacter() {
840
- let e = this.popChar();
841
- switch (e) {
842
- case "\n":
843
- case "\r":
844
- case "\u2028":
845
- case "\u2029":
846
- case "^":
847
- case "$":
848
- case "\\":
849
- case ".":
850
- case "*":
851
- case "+":
852
- case "?":
853
- case "(":
854
- case ")":
855
- case "[":
856
- case "|": throw Error("TBD");
857
- default: return {
858
- type: "Character",
859
- value: D(e)
860
- };
861
- }
862
- }
863
- isRegExpFlag() {
864
- switch (this.peekChar(0)) {
865
- case "g":
866
- case "i":
867
- case "m":
868
- case "u":
869
- case "y": return !0;
870
- default: return !1;
871
- }
872
- }
873
- isRangeDash() {
874
- return this.peekChar() === "-" && this.isClassAtom(1);
875
- }
876
- isDigit() {
877
- return I.test(this.peekChar(0));
878
- }
879
- isClassAtom(e = 0) {
880
- switch (this.peekChar(e)) {
881
- case "]":
882
- case "\n":
883
- case "\r":
884
- case "\u2028":
885
- case "\u2029": return !1;
886
- default: return !0;
887
- }
888
- }
889
- isTerm() {
890
- return this.isAtom() || this.isAssertion();
891
- }
892
- isAtom() {
893
- if (this.isPatternCharacter()) return !0;
894
- switch (this.peekChar(0)) {
895
- case ".":
896
- case "\\":
897
- case "[":
898
- case "(": return !0;
899
- default: return !1;
900
- }
901
- }
902
- isAssertion() {
903
- switch (this.peekChar(0)) {
904
- case "^":
905
- case "$": return !0;
906
- case "\\": switch (this.peekChar(1)) {
907
- case "b":
908
- case "B": return !0;
909
- default: return !1;
910
- }
911
- case "(": return this.peekChar(1) === "?" && (this.peekChar(2) === "=" || this.peekChar(2) === "!" || this.peekChar(2) === "<" && (this.peekChar(3) === "=" || this.peekChar(3) === "!"));
912
- default: return !1;
913
- }
914
- }
915
- isQuantifier() {
916
- let e = this.saveState();
917
- try {
918
- return this.quantifier(!0) !== void 0;
919
- } catch {
920
- return !1;
921
- } finally {
922
- this.restoreState(e);
923
- }
924
- }
925
- isPatternCharacter() {
926
- switch (this.peekChar()) {
927
- case "^":
928
- case "$":
929
- case "\\":
930
- case ".":
931
- case "*":
932
- case "+":
933
- case "?":
934
- case "(":
935
- case ")":
936
- case "[":
937
- case "|":
938
- case "/":
939
- case "\n":
940
- case "\r":
941
- case "\u2028":
942
- case "\u2029": return !1;
943
- default: return !0;
944
- }
945
- }
946
- parseHexDigits(e) {
947
- let t = "";
948
- for (let n = 0; n < e; n++) {
949
- let e = this.popChar();
950
- if (!1 === ee.test(e)) throw Error("Expecting a HexDecimal digits");
951
- t += e;
952
- }
953
- return {
954
- type: "Character",
955
- value: parseInt(t, 16)
956
- };
957
- }
958
- peekChar(e = 0) {
959
- return this.input[this.idx + e];
960
- }
961
- popChar() {
962
- let e = this.peekChar(0);
963
- return this.consumeChar(void 0), e;
964
- }
965
- consumeChar(e) {
966
- if (e !== void 0 && this.input[this.idx] !== e) throw Error("Expected: '" + e + "' but found: '" + this.input[this.idx] + "' at offset: " + this.idx);
967
- if (this.idx >= this.input.length) throw Error("Unexpected end of input");
968
- this.idx++;
969
- }
970
- loc(e) {
971
- return {
972
- begin: e,
973
- end: this.idx
974
- };
975
- }
976
- }();
977
- function z(e) {
978
- let t = e.toString();
979
- if (R.hasOwnProperty(t)) return R[t];
980
- {
981
- let e = ne.pattern(t);
982
- return R[t] = e, e;
983
- }
984
- }
985
- var re = "Complement Sets are not supported for first char optimization", ie = "Unable to use \"first char\" lexer optimizations:\n";
986
- function ae(e, t = !1) {
987
- try {
988
- let t = z(e);
989
- return oe(t.value, {}, t.flags.ignoreCase);
990
- } catch (i) {
991
- if (i.message === re) t && r(`${ie}\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
- 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(`${ie}\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);
995
- }
996
- }
997
- return [];
998
- }
999
- function oe(e, t, n) {
1000
- switch (e.type) {
1001
- case "Disjunction":
1002
- for (let r = 0; r < e.value.length; r++) oe(e.value[r], t, n);
1003
- break;
1004
- case "Alternative":
1005
- let r = e.value;
1006
- for (let e = 0; e < r.length; e++) {
1007
- let i = r[e];
1008
- switch (i.type) {
1009
- case "EndAnchor":
1010
- case "GroupBackReference":
1011
- case "Lookahead":
1012
- case "NegativeLookahead":
1013
- case "Lookbehind":
1014
- case "NegativeLookbehind":
1015
- case "StartAnchor":
1016
- case "WordBoundary":
1017
- case "NonWordBoundary": continue;
1018
- }
1019
- let a = i;
1020
- switch (a.type) {
1021
- case "Character":
1022
- se(a.value, t, n);
1023
- break;
1024
- case "Set":
1025
- if (!0 === a.complement) throw Error(re);
1026
- a.value.forEach((e) => {
1027
- if (typeof e == "number") se(e, t, n);
1028
- else {
1029
- let r = e;
1030
- if (!0 === n) for (let e = r.from; e <= r.to; e++) se(e, t, n);
1031
- else {
1032
- for (let e = r.from; e <= r.to && e < 256; e++) se(e, t, n);
1033
- if (r.to >= 256) {
1034
- let e = r.from >= 256 ? r.from : 256, n = r.to, i = V(e), a = V(n);
1035
- for (let e = i; e <= a; e++) t[e] = e;
1036
- }
1037
- }
1038
- }
1039
- });
1040
- break;
1041
- case "Group":
1042
- oe(a.value, t, n);
1043
- break;
1044
- default: throw Error("Non Exhaustive Match");
1045
- }
1046
- let o = a.quantifier !== void 0 && a.quantifier.atLeast === 0;
1047
- if (a.type === "Group" && !1 === le(a) || a.type !== "Group" && !1 === o) break;
1048
- }
1049
- break;
1050
- default: throw Error("non exhaustive match!");
1051
- }
1052
- return Object.values(t);
1053
- }
1054
- function se(e, t, n) {
1055
- let r = V(e);
1056
- t[r] = r, !0 === n && function(e, t) {
1057
- let n = String.fromCharCode(e), r = n.toUpperCase();
1058
- if (r !== n) {
1059
- let e = V(r.charCodeAt(0));
1060
- t[e] = e;
1061
- } else {
1062
- let e = n.toLowerCase();
1063
- if (e !== n) {
1064
- let n = V(e.charCodeAt(0));
1065
- t[n] = n;
1066
- }
1067
- }
1068
- }(e, t);
1069
- }
1070
- function ce(e, t) {
1071
- return e.value.find((e) => {
1072
- if (typeof e == "number") return t.includes(e);
1073
- {
1074
- let n = e;
1075
- return t.find((e) => n.from <= e && e <= n.to) !== void 0;
1076
- }
1077
- });
1078
- }
1079
- function le(e) {
1080
- let t = e.quantifier;
1081
- return !(!t || t.atLeast !== 0) || !!e.value && (Array.isArray(e.value) ? e.value.every(le) : le(e.value));
1082
- }
1083
- var ue = class extends L {
1084
- constructor(e) {
1085
- super(), this.targetCharCodes = e, this.found = !1;
1086
- }
1087
- visitChildren(e) {
1088
- if (!0 !== this.found) {
1089
- switch (e.type) {
1090
- case "Lookahead":
1091
- this.visitLookahead(e);
1092
- return;
1093
- case "NegativeLookahead":
1094
- this.visitNegativeLookahead(e);
1095
- return;
1096
- case "Lookbehind":
1097
- this.visitLookbehind(e);
1098
- return;
1099
- case "NegativeLookbehind":
1100
- this.visitNegativeLookbehind(e);
1101
- return;
1102
- }
1103
- super.visitChildren(e);
1104
- }
1105
- }
1106
- visitCharacter(e) {
1107
- this.targetCharCodes.includes(e.value) && (this.found = !0);
1108
- }
1109
- visitSet(e) {
1110
- e.complement ? ce(e, this.targetCharCodes) === void 0 && (this.found = !0) : ce(e, this.targetCharCodes) !== void 0 && (this.found = !0);
1111
- }
1112
- };
1113
- function de(e, t) {
1114
- if (t instanceof RegExp) {
1115
- let n = z(t), r = new ue(e);
1116
- return r.visit(n), r.found;
1117
- }
1118
- for (let n of t) {
1119
- let t = n.charCodeAt(0);
1120
- if (e.includes(t)) return !0;
1121
- }
1122
- return !1;
1123
- }
1124
- var B = "PATTERN", fe = "defaultMode";
1125
- function pe(e, t) {
1126
- let r, i = (t = Object.assign({
1127
- safeMode: !1,
1128
- positionTracking: "full",
1129
- lineTerminatorCharacters: ["\r", "\n"],
1130
- tracer: (e, t) => t()
1131
- }, t)).tracer;
1132
- i("initCharCodeToOptimizedIndexMap", () => {
1133
- (function() {
1134
- if (we.length === 0) {
1135
- we = Array(65536);
1136
- for (let e = 0; e < 65536; e++) we[e] = e > 255 ? 255 + ~~(e / 255) : e;
1137
- }
1138
- })();
1139
- }), i("Reject Lexer.NA", () => {
1140
- r = e.filter((e) => e[B] !== K.NA);
1141
- });
1142
- let a, o, s, c, l, u, d, f, p, m, h, g = !1;
1143
- i("Transform Patterns", () => {
1144
- g = !1, a = r.map((e) => {
1145
- let t = e[B];
1146
- if (t instanceof RegExp) {
1147
- let e = t.source;
1148
- return e.length !== 1 || e === "^" || e === "$" || e === "." || t.ignoreCase ? e.length !== 2 || e[0] !== "\\" || [
1149
- "d",
1150
- "D",
1151
- "s",
1152
- "S",
1153
- "t",
1154
- "r",
1155
- "n",
1156
- "t",
1157
- "0",
1158
- "c",
1159
- "b",
1160
- "B",
1161
- "f",
1162
- "v",
1163
- "w",
1164
- "W"
1165
- ].includes(e[1]) ? ge(t) : e[1] : e;
1166
- }
1167
- if (typeof t == "function") return g = !0, { exec: t };
1168
- if (typeof t == "object") return g = !0, t;
1169
- if (typeof t == "string") {
1170
- if (t.length === 1) return t;
1171
- {
1172
- let e = t.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
1173
- return ge(new RegExp(e));
1174
- }
1175
- }
1176
- throw Error("non exhaustive match");
1177
- });
1178
- }), i("misc mapping", () => {
1179
- o = r.map((e) => e.tokenTypeIdx), s = r.map((e) => {
1180
- let t = e.GROUP;
1181
- if (t !== K.SKIPPED) {
1182
- if (typeof t == "string") return t;
1183
- if (t === void 0) return !1;
1184
- throw Error("non exhaustive match");
1185
- }
1186
- }), c = r.map((e) => {
1187
- let t = e.LONGER_ALT;
1188
- if (t) return Array.isArray(t) ? t.map((e) => r.indexOf(e)) : [r.indexOf(t)];
1189
- }), l = r.map((e) => e.PUSH_MODE), u = r.map((e) => Object.hasOwn(e, "POP_MODE"));
1190
- }), i("Line Terminator Handling", () => {
1191
- let e = Se(t.lineTerminatorCharacters);
1192
- d = r.map((e) => !1), t.positionTracking !== "onlyOffset" && (d = r.map((t) => Object.hasOwn(t, "LINE_BREAKS") ? !!t.LINE_BREAKS : !1 === be(t, e) && de(e, t.PATTERN)));
1193
- }), i("Misc Mapping #2", () => {
1194
- f = r.map(_e), p = a.map(ve), m = r.reduce((e, t) => {
1195
- let n = t.GROUP;
1196
- return typeof n == "string" && n !== K.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: r[t]
1208
- }));
1209
- });
1210
- let _ = !0, v = [];
1211
- return t.safeMode || i("First Char Optimization", () => {
1212
- v = r.reduce((e, r, i) => {
1213
- if (typeof r.PATTERN == "string") Ce(e, V(r.PATTERN.charCodeAt(0)), h[i]);
1214
- else if (Array.isArray(r.START_CHARS_HINT)) {
1215
- let t;
1216
- r.START_CHARS_HINT.forEach((n) => {
1217
- let r = V(typeof n == "string" ? n.charCodeAt(0) : n);
1218
- t !== r && (t = r, Ce(e, r, h[i]));
1219
- });
1220
- } else if (r.PATTERN instanceof RegExp) if (r.PATTERN.unicode) _ = !1, t.ensureOptimizations && n(`${ie}\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 = ae(r.PATTERN, t.ensureOptimizations);
1223
- n.length === 0 && (_ = !1), n.forEach((t) => {
1224
- Ce(e, t, h[i]);
1225
- });
1226
- }
1227
- else t.ensureOptimizations && n(`${ie}\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;
1228
- return e;
1229
- }, []);
1230
- }), {
1231
- emptyGroups: m,
1232
- patternIdxToConfig: h,
1233
- charCodeToPatternIdxToConfig: v,
1234
- hasCustom: g,
1235
- canBeOptimized: _
1236
- };
1237
- }
1238
- var me = /[^\\][$]/, he = /[^\\[][\^]|^\^/;
1239
- function ge(e) {
1240
- let t = e.ignoreCase ? "iy" : "y";
1241
- return RegExp(`${e.source}`, t);
1242
- }
1243
- function _e(e) {
1244
- let t = e.PATTERN;
1245
- if (t instanceof RegExp) return !1;
1246
- if (typeof t == "function" || Object.hasOwn(t, "exec")) return !0;
1247
- if (typeof t == "string") return !1;
1248
- throw Error("non exhaustive match");
1249
- }
1250
- function ve(e) {
1251
- return typeof e == "string" && e.length === 1 && e.charCodeAt(0);
1252
- }
1253
- var ye = {
1254
- test: function(e) {
1255
- let t = e.length;
1256
- for (let n = this.lastIndex; n < t; n++) {
1257
- let t = e.charCodeAt(n);
1258
- if (t === 10) return this.lastIndex = n + 1, !0;
1259
- if (t === 13) return e.charCodeAt(n + 1) === 10 ? this.lastIndex = n + 2 : this.lastIndex = n + 1, !0;
1260
- }
1261
- return !1;
1262
- },
1263
- lastIndex: 0
1264
- };
1265
- function be(e, t) {
1266
- if (Object.hasOwn(e, "LINE_BREAKS")) return !1;
1267
- if (e.PATTERN instanceof RegExp) {
1268
- try {
1269
- de(t, e.PATTERN);
1270
- } catch (e) {
1271
- return {
1272
- issue: U.IDENTIFY_TERMINATOR,
1273
- errMsg: e.message
1274
- };
1275
- }
1276
- return !1;
1277
- }
1278
- if (typeof e.PATTERN == "string") return !1;
1279
- if (_e(e)) return { issue: U.CUSTOM_LINE_BREAK };
1280
- throw Error("non exhaustive match");
1281
- }
1282
- function xe(e, t) {
1283
- if (t.issue === U.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`;
1284
- if (t.issue === U.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`;
1285
- throw Error("non exhaustive match");
1286
- }
1287
- function Se(e) {
1288
- return e.map((e) => typeof e == "string" ? e.charCodeAt(0) : e);
1289
- }
1290
- function Ce(e, t, n) {
1291
- e[t] === void 0 ? e[t] = [n] : e[t].push(n);
1292
- }
1293
- var we = [];
1294
- function V(e) {
1295
- return e < 256 ? e : we[e];
1296
- }
1297
- function H(e, t) {
1298
- let n = e.tokenTypeIdx;
1299
- return n === t.tokenTypeIdx || !0 === t.isParent && !0 === t.categoryMatchesMap[n];
1300
- }
1301
- function Te(e, t) {
1302
- return e.tokenTypeIdx === t.tokenTypeIdx;
1303
- }
1304
- var U, Ee = 1, De = {};
1305
- function W(e) {
1306
- let t = function(e) {
1307
- let t = [...e], n = e, r = !0;
1308
- for (; r;) {
1309
- n = n.map((e) => e.CATEGORIES).flat().filter(Boolean);
1310
- let e = n.filter((e) => !t.includes(e));
1311
- t = t.concat(e), e.length === 0 ? r = !1 : n = e;
1312
- }
1313
- return t;
1314
- }(e);
1315
- (function(e) {
1316
- e.forEach((e) => {
1317
- var t;
1318
- ke(e) || (De[Ee] = e, e.tokenTypeIdx = Ee++), Ae(e) && !Array.isArray(e.CATEGORIES) && (e.CATEGORIES = [e.CATEGORIES]), Ae(e) || (e.CATEGORIES = []), t = e, Object.hasOwn(t ?? {}, "categoryMatches") || (e.categoryMatches = []), function(e) {
1319
- return Object.hasOwn(e ?? {}, "categoryMatchesMap");
1320
- }(e) || (e.categoryMatchesMap = {});
1321
- });
1322
- })(t), function(e) {
1323
- e.forEach((e) => {
1324
- Oe([], e);
1325
- });
1326
- }(t), function(e) {
1327
- e.forEach((e) => {
1328
- e.categoryMatches = [], Object.keys(e.categoryMatchesMap).forEach((t) => {
1329
- e.categoryMatches.push(De[t].tokenTypeIdx);
1330
- });
1331
- });
1332
- }(t), t.forEach((e) => {
1333
- e.isParent = e.categoryMatches.length > 0;
1334
- });
1335
- }
1336
- function Oe(e, t) {
1337
- e.forEach((e) => {
1338
- t.categoryMatchesMap[e.tokenTypeIdx] = !0;
1339
- }), t.CATEGORIES.forEach((n) => {
1340
- let r = e.concat(t);
1341
- r.includes(n) || Oe(r, n);
1342
- });
1343
- }
1344
- function ke(e) {
1345
- return Object.hasOwn(e ?? {}, "tokenTypeIdx");
1346
- }
1347
- function Ae(e) {
1348
- return Object.hasOwn(e ?? {}, "CATEGORIES");
1349
- }
1350
- function je(e) {
1351
- return Object.hasOwn(e ?? {}, "tokenTypeIdx");
1352
- }
1353
- var G;
1354
- (G = U ||= {})[G.MISSING_PATTERN = 0] = "MISSING_PATTERN", G[G.INVALID_PATTERN = 1] = "INVALID_PATTERN", G[G.EOI_ANCHOR_FOUND = 2] = "EOI_ANCHOR_FOUND", G[G.UNSUPPORTED_FLAGS_FOUND = 3] = "UNSUPPORTED_FLAGS_FOUND", G[G.DUPLICATE_PATTERNS_FOUND = 4] = "DUPLICATE_PATTERNS_FOUND", G[G.INVALID_GROUP_TYPE_FOUND = 5] = "INVALID_GROUP_TYPE_FOUND", G[G.PUSH_MODE_DOES_NOT_EXIST = 6] = "PUSH_MODE_DOES_NOT_EXIST", G[G.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE = 7] = "MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE", G[G.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY = 8] = "MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY", G[G.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST = 9] = "MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST", G[G.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED = 10] = "LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED", G[G.SOI_ANCHOR_FOUND = 11] = "SOI_ANCHOR_FOUND", G[G.EMPTY_MATCH_PATTERN = 12] = "EMPTY_MATCH_PATTERN", G[G.NO_LINE_BREAKS_FLAGS = 13] = "NO_LINE_BREAKS_FLAGS", G[G.UNREACHABLE_PATTERN = 14] = "UNREACHABLE_PATTERN", G[G.IDENTIFY_TERMINATOR = 15] = "IDENTIFY_TERMINATOR", G[G.CUSTOM_LINE_BREAK = 16] = "CUSTOM_LINE_BREAK", G[G.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE = 17] = "MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";
1355
- var Me = {
1356
- deferDefinitionErrorsHandling: !1,
1357
- positionTracking: "full",
1358
- lineTerminatorsPattern: /\n|\r\n?/g,
1359
- lineTerminatorCharacters: ["\n", "\r"],
1360
- ensureOptimizations: !1,
1361
- safeMode: !1,
1362
- errorMessageProvider: {
1363
- buildUnableToPopLexerModeMessage: (e) => `Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,
1364
- buildUnexpectedCharactersMessage: (e, t, n, r, i, a) => `unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`
1365
- },
1366
- traceInitPerf: !1,
1367
- skipValidations: !1,
1368
- recoveryEnabled: !0
1369
- };
1370
- Object.freeze(Me);
1371
- var K = class {
1372
- constructor(e, t = Me) {
1373
- 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) => {
1374
- if (!0 === this.traceInitPerf) {
1375
- this.traceInitIndent++;
1376
- let n = Array(this.traceInitIndent + 1).join(" ");
1377
- this.traceInitIndent < this.traceInitMaxIdent && console.log(`${n}--\x3e <${e}>`);
1378
- let { time: r, value: a } = i(t), o = r > 10 ? console.warn : console.log;
1379
- return this.traceInitIndent < this.traceInitMaxIdent && o(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, a;
1380
- }
1381
- return t();
1382
- }, 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");
1383
- this.config = Object.assign({}, Me, t);
1384
- let n = this.config.traceInitPerf;
1385
- !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", () => {
1386
- let n, i = !0;
1387
- this.TRACE_INIT("Lexer Config handling", () => {
1388
- if (this.config.lineTerminatorsPattern === Me.lineTerminatorsPattern) this.config.lineTerminatorsPattern = ye;
1389
- else if (this.config.lineTerminatorCharacters === Me.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");
1390
- if (t.safeMode && t.ensureOptimizations) throw Error("\"safeMode\" and \"ensureOptimizations\" flags are mutually exclusive.");
1391
- this.trackStartLines = /full|onlyStart/i.test(this.config.positionTracking), this.trackEndLines = /full/i.test(this.config.positionTracking), Array.isArray(e) ? n = {
1392
- modes: { defaultMode: [...e] },
1393
- defaultMode: fe
1394
- } : (i = !1, n = Object.assign({}, e));
1395
- }), !1 === this.config.skipValidations && (this.TRACE_INIT("performRuntimeChecks", () => {
1396
- this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(function(e) {
1397
- let t = [];
1398
- return Object.hasOwn(e, "defaultMode") || t.push({
1399
- message: "A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition\n",
1400
- type: U.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE
1401
- }), Object.hasOwn(e, "modes") || t.push({
1402
- message: "A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",
1403
- type: U.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY
1404
- }), Object.hasOwn(e, "modes") && Object.hasOwn(e, "defaultMode") && !Object.hasOwn(e.modes, e.defaultMode) && t.push({
1405
- message: `A MultiMode Lexer cannot be initialized with a ${fe}: <${e.defaultMode}>which does not exist\n`,
1406
- type: U.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST
1407
- }), Object.hasOwn(e, "modes") && Object.keys(e.modes).forEach((n) => {
1408
- let r = e.modes[n];
1409
- r.forEach((e, i) => {
1410
- e === void 0 ? t.push({
1411
- message: `A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,
1412
- type: U.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED
1413
- }) : Object.hasOwn(e, "LONGER_ALT") && (Array.isArray(e.LONGER_ALT) ? e.LONGER_ALT : [e.LONGER_ALT]).forEach((i) => {
1414
- i === void 0 || r.includes(i) || t.push({
1415
- message: `A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,
1416
- type: U.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE
1417
- });
1418
- });
1419
- });
1420
- }), t;
1421
- }(n, this.trackStartLines, this.config.lineTerminatorCharacters));
1422
- }), this.TRACE_INIT("performWarningRuntimeChecks", () => {
1423
- this.lexerDefinitionWarning = this.lexerDefinitionWarning.concat(function(e, t, n) {
1424
- let r = [], i = !1, a = Object.values(e.modes || {}).flat().filter(Boolean).filter((e) => e[B] !== K.NA), o = Se(n);
1425
- return t && a.forEach((e) => {
1426
- let t = be(e, o);
1427
- if (!1 !== t) {
1428
- let n = {
1429
- message: xe(e, t),
1430
- type: t.issue,
1431
- tokenType: e
1432
- };
1433
- r.push(n);
1434
- } else Object.hasOwn(e, "LINE_BREAKS") ? !0 === e.LINE_BREAKS && (i = !0) : de(o, e.PATTERN) && (i = !0);
1435
- }), t && !i && r.push({
1436
- 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.",
1437
- type: U.NO_LINE_BREAKS_FLAGS
1438
- }), r;
1439
- }(n, this.trackStartLines, this.config.lineTerminatorCharacters));
1440
- })), n.modes = n.modes ? n.modes : {}, Object.entries(n.modes).forEach(([e, t]) => {
1441
- n.modes[e] = t.filter((e) => e !== void 0);
1442
- });
1443
- let o = Object.keys(n.modes);
1444
- if (Object.entries(n.modes).forEach(([e, n]) => {
1445
- this.TRACE_INIT(`Mode: <${e}> processing`, () => {
1446
- if (this.modes.push(e), !1 === this.config.skipValidations && this.TRACE_INIT("validatePatterns", () => {
1447
- this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(function(e, t) {
1448
- let n = [], r = function(e) {
1449
- let t = e.filter((e) => !Object.hasOwn(e, B));
1450
- return {
1451
- errors: t.map((e) => ({
1452
- message: "Token Type: ->" + e.name + "<- missing static 'PATTERN' property",
1453
- type: U.MISSING_PATTERN,
1454
- tokenTypes: [e]
1455
- })),
1456
- valid: e.filter((e) => !t.includes(e))
1457
- };
1458
- }(e);
1459
- n = n.concat(r.errors);
1460
- let i = function(e) {
1461
- let t = e.filter((e) => {
1462
- let t = e[B];
1463
- return !(t instanceof RegExp || typeof t == "function" || Object.hasOwn(t, "exec") || typeof t == "string");
1464
- });
1465
- return {
1466
- errors: t.map((e) => ({
1467
- 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.",
1468
- type: U.INVALID_PATTERN,
1469
- tokenTypes: [e]
1470
- })),
1471
- valid: e.filter((e) => !t.includes(e))
1472
- };
1473
- }(r.valid), a = i.valid;
1474
- return n = n.concat(i.errors), n = n.concat(function(e) {
1475
- let t = [], n = e.filter((e) => e[B] instanceof RegExp);
1476
- return t = t.concat(function(e) {
1477
- class t extends L {
1478
- constructor() {
1479
- super(...arguments), this.found = !1;
1480
- }
1481
- visitEndAnchor(e) {
1482
- this.found = !0;
1483
- }
1484
- }
1485
- return e.filter((e) => {
1486
- let n = e.PATTERN;
1487
- try {
1488
- let e = z(n), r = new t();
1489
- return r.visit(e), r.found;
1490
- } catch {
1491
- return me.test(n.source);
1492
- }
1493
- }).map((e) => ({
1494
- 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.",
1495
- type: U.EOI_ANCHOR_FOUND,
1496
- tokenTypes: [e]
1497
- }));
1498
- }(n)), t = t.concat(function(e) {
1499
- class t extends L {
1500
- constructor() {
1501
- super(...arguments), this.found = !1;
1502
- }
1503
- visitStartAnchor(e) {
1504
- this.found = !0;
1505
- }
1506
- }
1507
- return e.filter((e) => {
1508
- let n = e.PATTERN;
1509
- try {
1510
- let e = z(n), r = new t();
1511
- return r.visit(e), r.found;
1512
- } catch {
1513
- return he.test(n.source);
1514
- }
1515
- }).map((e) => ({
1516
- 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.",
1517
- type: U.SOI_ANCHOR_FOUND,
1518
- tokenTypes: [e]
1519
- }));
1520
- }(n)), t = t.concat(function(e) {
1521
- return e.filter((e) => {
1522
- let t = e[B];
1523
- return t instanceof RegExp && (t.multiline || t.global);
1524
- }).map((e) => ({
1525
- message: "Token Type: ->" + e.name + "<- static 'PATTERN' may NOT contain global('g') or multiline('m')",
1526
- type: U.UNSUPPORTED_FLAGS_FOUND,
1527
- tokenTypes: [e]
1528
- }));
1529
- }(n)), t = t.concat(function(e) {
1530
- let t = [], n = e.map((n) => e.reduce((e, r) => (n.PATTERN.source !== r.PATTERN.source || t.includes(r) || r.PATTERN === K.NA || (t.push(r), e.push(r)), e), []));
1531
- return n = n.filter(Boolean), n.filter((e) => e.length > 1).map((e) => {
1532
- let t = e.map((e) => e.name);
1533
- return {
1534
- message: `The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,
1535
- type: U.DUPLICATE_PATTERNS_FOUND,
1536
- tokenTypes: e
1537
- };
1538
- });
1539
- }(n)), t = t.concat(function(e) {
1540
- return e.filter((e) => e.PATTERN.test("")).map((e) => ({
1541
- message: "Token Type: ->" + e.name + "<- static 'PATTERN' must not match an empty string",
1542
- type: U.EMPTY_MATCH_PATTERN,
1543
- tokenTypes: [e]
1544
- }));
1545
- }(n)), t;
1546
- }(a)), n = n.concat(function(e) {
1547
- return e.filter((e) => {
1548
- if (!Object.hasOwn(e, "GROUP")) return !1;
1549
- let t = e.GROUP;
1550
- return t !== K.SKIPPED && t !== K.NA && typeof t != "string";
1551
- }).map((e) => ({
1552
- message: "Token Type: ->" + e.name + "<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",
1553
- type: U.INVALID_GROUP_TYPE_FOUND,
1554
- tokenTypes: [e]
1555
- }));
1556
- }(a)), n = n.concat(function(e, t) {
1557
- return e.filter((e) => e.PUSH_MODE !== void 0 && !t.includes(e.PUSH_MODE)).map((e) => ({
1558
- message: `Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,
1559
- type: U.PUSH_MODE_DOES_NOT_EXIST,
1560
- tokenTypes: [e]
1561
- }));
1562
- }(a, t)), n = n.concat(function(e) {
1563
- let t = [], n = e.reduce((e, t, n) => {
1564
- let r = t.PATTERN;
1565
- return r === K.NA || (typeof r == "string" ? e.push({
1566
- str: r,
1567
- idx: n,
1568
- tokenType: t
1569
- }) : r instanceof RegExp && (i = r, [
1570
- ".",
1571
- "\\",
1572
- "[",
1573
- "]",
1574
- "|",
1575
- "^",
1576
- "$",
1577
- "(",
1578
- ")",
1579
- "?",
1580
- "*",
1581
- "+",
1582
- "{"
1583
- ].find((e) => i.source.indexOf(e) !== -1) === void 0) && e.push({
1584
- str: r.source,
1585
- idx: n,
1586
- tokenType: t
1587
- })), e;
1588
- var i;
1589
- }, []);
1590
- return e.forEach((e, r) => {
1591
- n.forEach(({ str: n, idx: i, tokenType: a }) => {
1592
- if (r < i && function(e, t) {
1593
- if (t instanceof RegExp) {
1594
- if (/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)) return !1;
1595
- let n = t.exec(e);
1596
- return n !== null && n.index === 0;
1597
- }
1598
- if (typeof t == "function") return t(e, 0, [], {});
1599
- if (Object.hasOwn(t, "exec")) return t.exec(e, 0, [], {});
1600
- if (typeof t == "string") return t === e;
1601
- throw Error("non exhaustive match");
1602
- }(n, e.PATTERN)) {
1603
- 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`;
1604
- t.push({
1605
- message: n,
1606
- type: U.UNREACHABLE_PATTERN,
1607
- tokenTypes: [e, a]
1608
- });
1609
- }
1610
- });
1611
- }), t;
1612
- }(a)), n;
1613
- }(n, o));
1614
- }), this.lexerDefinitionErrors.length === 0) {
1615
- let r;
1616
- W(n), this.TRACE_INIT("analyzeTokenTypes", () => {
1617
- r = pe(n, {
1618
- lineTerminatorCharacters: this.config.lineTerminatorCharacters,
1619
- positionTracking: t.positionTracking,
1620
- ensureOptimizations: t.ensureOptimizations,
1621
- safeMode: t.safeMode,
1622
- tracer: this.TRACE_INIT
1623
- });
1624
- }), this.patternIdxToConfig[e] = r.patternIdxToConfig, this.charCodeToPatternIdxToConfig[e] = r.charCodeToPatternIdxToConfig, this.emptyGroups = Object.assign({}, this.emptyGroups, r.emptyGroups), this.hasCustom = r.hasCustom || this.hasCustom, this.canModeBeOptimized[e] = r.canBeOptimized;
1625
- }
1626
- });
1627
- }), this.defaultMode = n.defaultMode, this.cachedGroupKeys = Object.keys(this.emptyGroups), this.lexerDefinitionErrors.length > 0 && !this.config.deferDefinitionErrorsHandling) {
1628
- let e = this.lexerDefinitionErrors.map((e) => e.message).join("-----------------------\n");
1629
- throw Error("Errors detected in definition of Lexer:\n" + e);
1630
- }
1631
- this.lexerDefinitionWarning.forEach((e) => {
1632
- r(e.message);
1633
- }), this.TRACE_INIT("Choosing sub-methods implementations", () => {
1634
- 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;
1635
- else if (/onlyStart/i.test(this.config.positionTracking)) this.createTokenInstance = this.createStartOnlyToken;
1636
- else {
1637
- if (!/onlyOffset/i.test(this.config.positionTracking)) throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);
1638
- this.createTokenInstance = this.createOffsetOnlyToken;
1639
- }
1640
- this.hasCustom ? (this.addToken = this.addTokenUsingPush, this.handlePayload = this.handlePayloadWithCustom) : (this.addToken = this.addTokenUsingMemberAccess, this.handlePayload = this.handlePayloadNoCustom);
1641
- }), this.TRACE_INIT("Failed Optimization Warnings", () => {
1642
- let e = Object.entries(this.canModeBeOptimized).reduce((e, [t, n]) => (!1 === n && e.push(t), e), []);
1643
- 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.`);
1644
- }), this.TRACE_INIT("clearRegExpParserCache", () => {
1645
- R = {};
1646
- }), this.TRACE_INIT("toFastProperties", () => {
1647
- a(this);
1648
- });
1649
- });
1650
- }
1651
- tokenize(e, t = this.defaultMode) {
1652
- if (this.lexerDefinitionErrors.length > 0) {
1653
- let e = this.lexerDefinitionErrors.map((e) => e.message).join("-----------------------\n");
1654
- throw Error("Unable to Tokenize because Errors detected in definition of Lexer:\n" + e);
1655
- }
1656
- return this.tokenizeInternal(e, t);
1657
- }
1658
- tokenizeInternal(e, t) {
1659
- 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 = {};
1660
- for (let e = 0; e < this.cachedGroupKeys.length; e++) E[this.cachedGroupKeys[e]] = [];
1661
- let D = this.trackStartLines, O = this.config.lineTerminatorsPattern, k = 0, A = [], j = [], M = [], N = [];
1662
- Object.freeze(N);
1663
- let P, F = !1, ee = (e) => {
1664
- if (M.length === 1 && e.tokenType.PUSH_MODE === void 0) {
1665
- let t = this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);
1666
- C.push({
1667
- offset: e.startOffset,
1668
- line: e.startLine,
1669
- column: e.startColumn,
1670
- length: e.image.length,
1671
- message: t
1672
- });
1673
- } else {
1674
- M.pop();
1675
- let e = M.at(-1);
1676
- A = this.patternIdxToConfig[e], j = this.charCodeToPatternIdxToConfig[e], k = A.length;
1677
- let t = this.canModeBeOptimized[e] && !1 === this.config.safeMode;
1678
- F = !(!j || !t);
1679
- }
1680
- };
1681
- function I(e) {
1682
- M.push(e), j = this.charCodeToPatternIdxToConfig[e], A = this.patternIdxToConfig[e], k = A.length;
1683
- let t = this.canModeBeOptimized[e] && !1 === this.config.safeMode;
1684
- F = !(!j || !t);
1685
- }
1686
- I.call(this, t);
1687
- let te = this.config.recoveryEnabled;
1688
- for (; y < v;) {
1689
- s = null, u = -1;
1690
- let t, x = _.charCodeAt(y);
1691
- if (F) {
1692
- let e = V(x), n = j[e];
1693
- t = n === void 0 ? N : n;
1694
- } else t = A;
1695
- let L = t.length;
1696
- for (n = 0; n < L; n++) {
1697
- P = t[n];
1698
- let r = P.pattern;
1699
- c = null;
1700
- let d = P.short;
1701
- if (!1 === d ? !0 === P.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)) : x === d && (u = 1, s = r), u !== -1) {
1702
- if (o = P.longerAlt, o !== void 0) {
1703
- s = e.substring(y, y + u);
1704
- let t = o.length;
1705
- for (i = 0; i < t; i++) {
1706
- let t = A[o[i]], n = t.pattern;
1707
- 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) {
1708
- s = a, u = a.length, c = l, P = t;
1709
- break;
1710
- }
1711
- }
1712
- }
1713
- break;
1714
- }
1715
- }
1716
- if (u !== -1) {
1717
- if (d = P.group, d !== void 0 && (s = s === null ? e.substring(y, y + u) : s, f = P.tokenTypeIdx, p = this.createTokenInstance(s, y, f, P.tokenType, w, T, u), this.handlePayload(p, c), !1 === d ? b = this.addToken(S, b, p) : E[d].push(p)), !0 === D && !0 === P.canLineTerminator) {
1718
- let t, n, r = 0;
1719
- O.lastIndex = 0;
1720
- do
1721
- s = s === null ? e.substring(y, y + u) : s, t = O.test(s), !0 === t && (n = O.lastIndex - 1, r++);
1722
- while (!0 === t);
1723
- r === 0 ? T = this.computeNewColumn(T, u) : (w += r, T = u - n, this.updateTokenEndLineColumnLocation(p, d, n, r, w, T, u));
1724
- } else T = this.computeNewColumn(T, u);
1725
- y += u, this.handleModes(P, ee, I, p);
1726
- } else {
1727
- let t = y, n = w, i = T, a = !1 === te;
1728
- for (; !1 === a && y < v;) for (y++, r = 0; r < k; r++) {
1729
- let t = A[r], n = t.pattern, i = t.short;
1730
- 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;
1731
- }
1732
- if (m = y - t, T = this.computeNewColumn(T, m), h = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(_, t, m, n, i, M.at(-1)), C.push({
1733
- offset: t,
1734
- line: n,
1735
- column: i,
1736
- length: m,
1737
- message: h
1738
- }), !1 === te) break;
1739
- }
1740
- }
1741
- return this.hasCustom || (S.length = b), {
1742
- tokens: S,
1743
- groups: E,
1744
- errors: C
1745
- };
1746
- }
1747
- handleModes(e, t, n, r) {
1748
- if (!0 === e.pop) {
1749
- let i = e.push;
1750
- t(r), i !== void 0 && n.call(this, i);
1751
- } else e.push !== void 0 && n.call(this, e.push);
1752
- }
1753
- updateTokenEndLineColumnLocation(e, t, n, r, i, a, o) {
1754
- let s, c;
1755
- t !== void 0 && (s = n === o - 1, c = s ? -1 : 0, r === 1 && !0 === s || (e.endLine = i + c, e.endColumn = a - 1 - c));
1756
- }
1757
- computeNewColumn(e, t) {
1758
- return e + t;
1759
- }
1760
- createOffsetOnlyToken(e, t, n, r) {
1761
- return {
1762
- image: e,
1763
- startOffset: t,
1764
- tokenTypeIdx: n,
1765
- tokenType: r
1766
- };
1767
- }
1768
- createStartOnlyToken(e, t, n, r, i, a) {
1769
- return {
1770
- image: e,
1771
- startOffset: t,
1772
- startLine: i,
1773
- startColumn: a,
1774
- tokenTypeIdx: n,
1775
- tokenType: r
1776
- };
1777
- }
1778
- createFullToken(e, t, n, r, i, a, o) {
1779
- return {
1780
- image: e,
1781
- startOffset: t,
1782
- endOffset: t + o - 1,
1783
- startLine: i,
1784
- endLine: i,
1785
- startColumn: a,
1786
- endColumn: a + o - 1,
1787
- tokenTypeIdx: n,
1788
- tokenType: r
1789
- };
1790
- }
1791
- addTokenUsingPush(e, t, n) {
1792
- return e.push(n), t;
1793
- }
1794
- addTokenUsingMemberAccess(e, t, n) {
1795
- return e[t] = n, ++t;
1796
- }
1797
- handlePayloadNoCustom(e, t) {}
1798
- handlePayloadWithCustom(e, t) {
1799
- t !== null && (e.payload = t);
1800
- }
1801
- match(e, t, n) {
1802
- return !0 === e.test(t) ? t.substring(n, e.lastIndex) : null;
1803
- }
1804
- matchLength(e, t, n) {
1805
- return !0 === e.test(t) ? e.lastIndex - n : -1;
1806
- }
1807
- };
1808
- function Ne(e) {
1809
- return Pe(e) ? e.LABEL : e.name;
1810
- }
1811
- function Pe(e) {
1812
- return typeof e.LABEL == "string" && e.LABEL !== "";
1813
- }
1814
- K.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.", K.NA = /NOT_APPLICABLE/;
1815
- var Fe = "categories", Ie = "label", Le = "group", Re = "push_mode", ze = "pop_mode", Be = "longer_alt", Ve = "line_breaks", He = "start_chars_hint";
1816
- function q(e) {
1817
- return function(e) {
1818
- let t = e.pattern, n = {};
1819
- if (n.name = e.name, t !== void 0 && (n.PATTERN = t), Object.hasOwn(e, "parent")) throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
1820
- return Object.hasOwn(e, Fe) && (n.CATEGORIES = e[Fe]), W([n]), Object.hasOwn(e, Ie) && (n.LABEL = e[Ie]), Object.hasOwn(e, Le) && (n.GROUP = e[Le]), Object.hasOwn(e, ze) && (n.POP_MODE = e[ze]), Object.hasOwn(e, Re) && (n.PUSH_MODE = e[Re]), Object.hasOwn(e, Be) && (n.LONGER_ALT = e[Be]), Object.hasOwn(e, Ve) && (n.LINE_BREAKS = e[Ve]), Object.hasOwn(e, He) && (n.START_CHARS_HINT = e[He]), n;
1821
- }(e);
1822
- }
1823
- var J = q({
1824
- name: "EOF",
1825
- pattern: K.NA
1826
- });
1827
- function Ue(e, t, n, r, i, a, o, s) {
1828
- return {
1829
- image: t,
1830
- startOffset: n,
1831
- endOffset: r,
1832
- startLine: i,
1833
- endLine: a,
1834
- startColumn: o,
1835
- endColumn: s,
1836
- tokenTypeIdx: e.tokenTypeIdx,
1837
- tokenType: e
1838
- };
1839
- }
1840
- W([J]);
1841
- var We = {
1842
- buildMismatchTokenMessage: ({ expected: e, actual: t, previous: n, ruleName: r }) => `Expecting ${Pe(e) ? `--\x3e ${Ne(e)} <--` : `token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,
1843
- buildNotAllInputParsedMessage: ({ firstRedundant: e, ruleName: t }) => "Redundant input, expecting EOF but found: " + e.image,
1844
- buildNoViableAltMessage({ expectedPathsPerAlt: e, actual: t, previous: n, customUserDescription: r, ruleName: i }) {
1845
- let a = "\nbut found: '" + t[0].image + "'";
1846
- 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) => Ne(e)).join(", ")}]`).map((e, t) => ` ${t + 1}. ${e}`).join("\n")}` + a;
1847
- },
1848
- buildEarlyExitMessage({ expectedIterationPaths: e, actual: t, customUserDescription: n, ruleName: r }) {
1849
- let i = "\nbut found: '" + t[0].image + "'";
1850
- 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) => Ne(e)).join(",")}]`).join(" ,")}>` + i;
1851
- }
1852
- };
1853
- Object.freeze(We);
1854
- var Y, Ge = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a rule which is not defined: ->" + t.nonTerminalName + "<-\ninside top level rule: ->" + e.name + "<-" }, X = {
1855
- buildDuplicateFoundError(e, t) {
1856
- 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 : "";
1857
- var c;
1858
- 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 `;
1859
- return l = l.replace(/[ \t]+/g, " "), l = l.replace(/\s\s+/g, "\n"), l;
1860
- },
1861
- 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.`,
1862
- buildAlternationPrefixAmbiguityError(e) {
1863
- let t = e.prefixPath.map((e) => Ne(e)).join(", "), n = e.alternation.idx === 0 ? "" : e.alternation.idx;
1864
- 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.`;
1865
- },
1866
- buildAlternationAmbiguityError(e) {
1867
- 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`;
1868
- 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) => Ne(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;
1869
- },
1870
- buildEmptyRepetitionError(e) {
1871
- let t = x(e.repetition);
1872
- 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.`;
1873
- },
1874
- buildTokenNameError: (e) => "deprecated",
1875
- buildEmptyAlternationError: (e) => `Ambiguous empty alternative: <${e.emptyChoiceIdx + 1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,
1876
- buildTooManyAlternativesError: (e) => `An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length + 1} alternatives.`,
1877
- buildLeftRecursionError(e) {
1878
- let t = e.topLevelRule.name;
1879
- return `Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map((e) => e.name).concat([t]).join(" --> ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
1880
- },
1881
- buildInvalidRuleNameError: (e) => "deprecated",
1882
- buildDuplicateRuleNameError(e) {
1883
- let t;
1884
- return t = e.topLevelRule instanceof c ? e.topLevelRule.name : e.topLevelRule, `Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`;
1885
- }
1886
- }, Ke = class extends y {
1887
- constructor(e, t) {
1888
- super(), this.nameToTopRule = e, this.errMsgProvider = t, this.errors = [];
1889
- }
1890
- resolveRefs() {
1891
- Object.values(this.nameToTopRule).forEach((e) => {
1892
- this.currTopLevel = e, e.accept(this);
1893
- });
1894
- }
1895
- visitNonTerminal(e) {
1896
- let t = this.nameToTopRule[e.nonTerminalName];
1897
- if (t) e.referencedRule = t;
1898
- else {
1899
- let t = this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel, e);
1900
- this.errors.push({
1901
- message: t,
1902
- type: Z.UNRESOLVED_SUBRULE_REF,
1903
- ruleName: this.currTopLevel.name,
1904
- unresolvedRefName: e.nonTerminalName
1905
- });
1906
- }
1907
- }
1908
- }, qe = class extends S {
1909
- constructor(e, t) {
1910
- super(), this.topProd = e, this.path = t, this.possibleTokTypes = [], this.nextProductionName = "", this.nextProductionOccurrence = 0, this.found = !1, this.isAtEndOfPath = !1;
1911
- }
1912
- startWalking() {
1913
- if (this.found = !1, this.path.ruleStack[0] !== this.topProd.name) throw Error("The path does not start with the walker's top Rule!");
1914
- return this.ruleStack = [...this.path.ruleStack].reverse(), this.occurrenceStack = [...this.path.occurrenceStack].reverse(), this.ruleStack.pop(), this.occurrenceStack.pop(), this.updateExpectedNext(), this.walk(this.topProd), this.possibleTokTypes;
1915
- }
1916
- walk(e, t = []) {
1917
- this.found || super.walk(e, t);
1918
- }
1919
- walkProdRef(e, t, n) {
1920
- if (e.referencedRule.name === this.nextProductionName && e.idx === this.nextProductionOccurrence) {
1921
- let r = t.concat(n);
1922
- this.updateExpectedNext(), this.walk(e.referencedRule, r);
1923
- }
1924
- }
1925
- updateExpectedNext() {
1926
- this.ruleStack.length === 0 ? (this.nextProductionName = "", this.nextProductionOccurrence = 0, this.isAtEndOfPath = !0) : (this.nextProductionName = this.ruleStack.pop(), this.nextProductionOccurrence = this.occurrenceStack.pop());
1927
- }
1928
- }, Je = class extends qe {
1929
- constructor(e, t) {
1930
- super(e, t), this.path = t, this.nextTerminalName = "", this.nextTerminalOccurrence = 0, this.nextTerminalName = this.path.lastTok.name, this.nextTerminalOccurrence = this.path.lastTokOccurrence;
1931
- }
1932
- walkTerminal(e, t, n) {
1933
- if (this.isAtEndOfPath && e.terminalType.name === this.nextTerminalName && e.idx === this.nextTerminalOccurrence && !this.found) {
1934
- let e = new l({ definition: t.concat(n) });
1935
- this.possibleTokTypes = w(e), this.found = !0;
1936
- }
1937
- }
1938
- }, Ye = class extends S {
1939
- constructor(e, t) {
1940
- super(), this.topRule = e, this.occurrence = t, this.result = {
1941
- token: void 0,
1942
- occurrence: void 0,
1943
- isEndOfRule: void 0
1944
- };
1945
- }
1946
- startWalking() {
1947
- return this.walk(this.topRule), this.result;
1948
- }
1949
- }, Xe = class extends Ye {
1950
- walkMany(e, t, n) {
1951
- if (e.idx === this.occurrence) {
1952
- let e = t.concat(n)[0];
1953
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1954
- } else super.walkMany(e, t, n);
1955
- }
1956
- }, Ze = class extends Ye {
1957
- walkManySep(e, t, n) {
1958
- if (e.idx === this.occurrence) {
1959
- let e = t.concat(n)[0];
1960
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1961
- } else super.walkManySep(e, t, n);
1962
- }
1963
- }, Qe = class extends Ye {
1964
- walkAtLeastOne(e, t, n) {
1965
- if (e.idx === this.occurrence) {
1966
- let e = t.concat(n)[0];
1967
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1968
- } else super.walkAtLeastOne(e, t, n);
1969
- }
1970
- }, $e = class extends Ye {
1971
- walkAtLeastOneSep(e, t, n) {
1972
- if (e.idx === this.occurrence) {
1973
- let e = t.concat(n)[0];
1974
- this.result.isEndOfRule = e === void 0, e instanceof g && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
1975
- } else super.walkAtLeastOneSep(e, t, n);
1976
- }
1977
- };
1978
- function et(e, t, n = []) {
1979
- n = [...n];
1980
- let r = [], i = 0;
1981
- function a(a) {
1982
- let o = et(a.concat(e.slice(i + 1)), t, n);
1983
- return r.concat(o);
1984
- }
1985
- for (; n.length < t && i < e.length;) {
1986
- let t = e[i];
1987
- if (t instanceof l || t instanceof s) return a(t.definition);
1988
- if (t instanceof u) r = a(t.definition);
1989
- else {
1990
- if (t instanceof d) return a(t.definition.concat([new p({ definition: t.definition })]));
1991
- if (t instanceof f) return a([new l({ definition: t.definition }), new p({ definition: [new g({ terminalType: t.separator })].concat(t.definition) })]);
1992
- if (t instanceof m) r = a(t.definition.concat([new p({ definition: [new g({ terminalType: t.separator })].concat(t.definition) })]));
1993
- else if (t instanceof p) r = a(t.definition.concat([new p({ definition: t.definition })]));
1994
- else {
1995
- if (t instanceof h) return t.definition.forEach((e) => {
1996
- e.definition.length !== 0 && (r = a(e.definition));
1997
- }), r;
1998
- if (!(t instanceof g)) throw Error("non exhaustive match");
1999
- n.push(t.terminalType);
2000
- }
2001
- }
2002
- i++;
2003
- }
2004
- return r.push({
2005
- partialPath: n,
2006
- suffixDef: e.slice(i)
2007
- }), r;
2008
- }
2009
- function tt(e, t, n, r) {
2010
- let i = [...n];
2011
- i.push(e.name);
2012
- let a = [...r];
2013
- return a.push(1), {
2014
- idx: t,
2015
- def: e.definition,
2016
- ruleStack: i,
2017
- occurrenceStack: a
2018
- };
2019
- }
2020
- function nt(e) {
2021
- if (e instanceof u || e === "Option") return Y.OPTION;
2022
- if (e instanceof p || e === "Repetition") return Y.REPETITION;
2023
- if (e instanceof d || e === "RepetitionMandatory") return Y.REPETITION_MANDATORY;
2024
- if (e instanceof f || e === "RepetitionMandatoryWithSeparator") return Y.REPETITION_MANDATORY_WITH_SEPARATOR;
2025
- if (e instanceof m || e === "RepetitionWithSeparator") return Y.REPETITION_WITH_SEPARATOR;
2026
- if (e instanceof h || e === "Alternation") return Y.ALTERNATION;
2027
- throw Error("non exhaustive match");
2028
- }
2029
- function rt(e, t, n, r) {
2030
- let i = e.length, a = e.every((e) => e.every((e) => e.length === 1));
2031
- if (t) return function(t) {
2032
- let r = t.map((e) => e.GATE);
2033
- for (let t = 0; t < i; t++) {
2034
- let i = e[t], a = i.length, o = r[t];
2035
- if (o === void 0 || !1 !== o.call(this)) e: for (let e = 0; e < a; e++) {
2036
- let r = i[e], a = r.length;
2037
- for (let e = 0; e < a; e++) if (!1 === n(this.LA_FAST(e + 1), r[e])) continue e;
2038
- return t;
2039
- }
2040
- }
2041
- };
2042
- if (a && !r) {
2043
- let t = e.map((e) => e.flat()).reduce((e, t, n) => (t.forEach((t) => {
2044
- t.tokenTypeIdx in e || (e[t.tokenTypeIdx] = n), t.categoryMatches.forEach((t) => {
2045
- Object.hasOwn(e, t) || (e[t] = n);
2046
- });
2047
- }), e), {});
2048
- return function() {
2049
- let e = this.LA_FAST(1);
2050
- return t[e.tokenTypeIdx];
2051
- };
2052
- }
2053
- return function() {
2054
- for (let t = 0; t < i; t++) {
2055
- let r = e[t], i = r.length;
2056
- e: for (let e = 0; e < i; e++) {
2057
- let i = r[e], a = i.length;
2058
- for (let e = 0; e < a; e++) if (!1 === n(this.LA_FAST(e + 1), i[e])) continue e;
2059
- return t;
2060
- }
2061
- }
2062
- };
2063
- }
2064
- function it(e, t, n) {
2065
- let r = e.every((e) => e.length === 1), i = e.length;
2066
- if (r && !n) {
2067
- let t = e.flat();
2068
- if (t.length === 1 && t[0].categoryMatches.length === 0) {
2069
- let e = t[0].tokenTypeIdx;
2070
- return function() {
2071
- return this.LA_FAST(1).tokenTypeIdx === e;
2072
- };
2073
- }
2074
- {
2075
- let e = t.reduce((e, t, n) => (e[t.tokenTypeIdx] = !0, t.categoryMatches.forEach((t) => {
2076
- e[t] = !0;
2077
- }), e), []);
2078
- return function() {
2079
- let t = this.LA_FAST(1);
2080
- return !0 === e[t.tokenTypeIdx];
2081
- };
2082
- }
2083
- }
2084
- return function() {
2085
- e: for (let n = 0; n < i; n++) {
2086
- let r = e[n], i = r.length;
2087
- for (let e = 0; e < i; e++) if (!1 === t(this.LA_FAST(e + 1), r[e])) continue e;
2088
- return !0;
2089
- }
2090
- return !1;
2091
- };
2092
- }
2093
- (function(e) {
2094
- 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";
2095
- })(Y ||= {});
2096
- var at = class extends S {
2097
- constructor(e, t, n) {
2098
- super(), this.topProd = e, this.targetOccurrence = t, this.targetProdType = n;
2099
- }
2100
- startWalking() {
2101
- return this.walk(this.topProd), this.restDef;
2102
- }
2103
- checkIsTarget(e, t, n, r) {
2104
- return e.idx === this.targetOccurrence && this.targetProdType === t && (this.restDef = n.concat(r), !0);
2105
- }
2106
- walkOption(e, t, n) {
2107
- this.checkIsTarget(e, Y.OPTION, t, n) || super.walkOption(e, t, n);
2108
- }
2109
- walkAtLeastOne(e, t, n) {
2110
- this.checkIsTarget(e, Y.REPETITION_MANDATORY, t, n) || super.walkOption(e, t, n);
2111
- }
2112
- walkAtLeastOneSep(e, t, n) {
2113
- this.checkIsTarget(e, Y.REPETITION_MANDATORY_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
2114
- }
2115
- walkMany(e, t, n) {
2116
- this.checkIsTarget(e, Y.REPETITION, t, n) || super.walkOption(e, t, n);
2117
- }
2118
- walkManySep(e, t, n) {
2119
- this.checkIsTarget(e, Y.REPETITION_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
2120
- }
2121
- }, ot = class extends y {
2122
- constructor(e, t, n) {
2123
- super(), this.targetOccurrence = e, this.targetProdType = t, this.targetRef = n, this.result = [];
2124
- }
2125
- checkIsTarget(e, t) {
2126
- e.idx !== this.targetOccurrence || this.targetProdType !== t || this.targetRef !== void 0 && e !== this.targetRef || (this.result = e.definition);
2127
- }
2128
- visitOption(e) {
2129
- this.checkIsTarget(e, Y.OPTION);
2130
- }
2131
- visitRepetition(e) {
2132
- this.checkIsTarget(e, Y.REPETITION);
2133
- }
2134
- visitRepetitionMandatory(e) {
2135
- this.checkIsTarget(e, Y.REPETITION_MANDATORY);
2136
- }
2137
- visitRepetitionMandatoryWithSeparator(e) {
2138
- this.checkIsTarget(e, Y.REPETITION_MANDATORY_WITH_SEPARATOR);
2139
- }
2140
- visitRepetitionWithSeparator(e) {
2141
- this.checkIsTarget(e, Y.REPETITION_WITH_SEPARATOR);
2142
- }
2143
- visitAlternation(e) {
2144
- this.checkIsTarget(e, Y.ALTERNATION);
2145
- }
2146
- };
2147
- function st(e) {
2148
- let t = Array(e);
2149
- for (let n = 0; n < e; n++) t[n] = [];
2150
- return t;
2151
- }
2152
- function ct(e) {
2153
- let t = [""];
2154
- for (let n = 0; n < e.length; n++) {
2155
- let r = e[n], i = [];
2156
- for (let e = 0; e < t.length; e++) {
2157
- let n = t[e];
2158
- i.push(n + "_" + r.tokenTypeIdx);
2159
- for (let e = 0; e < r.categoryMatches.length; e++) {
2160
- let t = "_" + r.categoryMatches[e];
2161
- i.push(n + t);
2162
- }
2163
- }
2164
- t = i;
2165
- }
2166
- return t;
2167
- }
2168
- function lt(e, t, n) {
2169
- for (let r = 0; r < e.length; r++) {
2170
- if (r === n) continue;
2171
- let i = e[r];
2172
- for (let e = 0; e < t.length; e++) if (!0 === i[t[e]]) return !1;
2173
- }
2174
- return !0;
2175
- }
2176
- function ut(e, t) {
2177
- let n = e.map((e) => et([e], 1)), r = st(n.length), i = n.map((e) => {
2178
- let t = {};
2179
- return e.forEach((e) => {
2180
- ct(e.partialPath).forEach((e) => {
2181
- t[e] = !0;
2182
- });
2183
- }), t;
2184
- }), a = n;
2185
- for (let e = 1; e <= t; e++) {
2186
- let n = a;
2187
- a = st(n.length);
2188
- for (let o = 0; o < n.length; o++) {
2189
- let s = n[o];
2190
- for (let n = 0; n < s.length; n++) {
2191
- let c = s[n].partialPath, l = s[n].suffixDef, u = ct(c);
2192
- if (lt(i, u, o) || l.length === 0 || c.length === t) {
2193
- let e = r[o];
2194
- if (!1 === pt(e, c)) {
2195
- e.push(c);
2196
- for (let e = 0; e < u.length; e++) {
2197
- let t = u[e];
2198
- i[o][t] = !0;
2199
- }
2200
- }
2201
- } else {
2202
- let t = et(l, e + 1, c);
2203
- a[o] = a[o].concat(t), t.forEach((e) => {
2204
- ct(e.partialPath).forEach((e) => {
2205
- i[o][e] = !0;
2206
- });
2207
- });
2208
- }
2209
- }
2210
- }
2211
- }
2212
- return r;
2213
- }
2214
- function dt(e, t, n, r) {
2215
- let i = new ot(e, Y.ALTERNATION, r);
2216
- return t.accept(i), ut(i.result, n);
2217
- }
2218
- function ft(e, t, n, r) {
2219
- let i = new ot(e, n);
2220
- t.accept(i);
2221
- let a = i.result, o = new at(t, e, n).startWalking();
2222
- return ut([new l({ definition: a }), new l({ definition: o })], r);
2223
- }
2224
- function pt(e, t) {
2225
- e: for (let n = 0; n < e.length; n++) {
2226
- let r = e[n];
2227
- if (r.length === t.length) {
2228
- for (let e = 0; e < r.length; e++) {
2229
- let n = t[e], i = r[e];
2230
- if ((n === i || i.categoryMatchesMap[n.tokenTypeIdx] !== void 0) == 0) continue e;
2231
- }
2232
- return !0;
2233
- }
2234
- }
2235
- return !1;
2236
- }
2237
- function mt(e) {
2238
- return e.every((e) => e.every((e) => e.every((e) => e.categoryMatches.length === 0)));
2239
- }
2240
- function ht(e) {
2241
- return `${x(e)}_#_${e.idx}_#_${gt(e)}`;
2242
- }
2243
- function gt(e) {
2244
- return e instanceof g ? e.terminalType.name : e instanceof s ? e.nonTerminalName : "";
2245
- }
2246
- var _t = class extends y {
2247
- constructor() {
2248
- super(...arguments), this.allProductions = [];
2249
- }
2250
- visitNonTerminal(e) {
2251
- this.allProductions.push(e);
2252
- }
2253
- visitOption(e) {
2254
- this.allProductions.push(e);
2255
- }
2256
- visitRepetitionWithSeparator(e) {
2257
- this.allProductions.push(e);
2258
- }
2259
- visitRepetitionMandatory(e) {
2260
- this.allProductions.push(e);
2261
- }
2262
- visitRepetitionMandatoryWithSeparator(e) {
2263
- this.allProductions.push(e);
2264
- }
2265
- visitRepetition(e) {
2266
- this.allProductions.push(e);
2267
- }
2268
- visitAlternation(e) {
2269
- this.allProductions.push(e);
2270
- }
2271
- visitTerminal(e) {
2272
- this.allProductions.push(e);
2273
- }
2274
- };
2275
- function vt(e, t, n, r = []) {
2276
- let i = [], a = yt(t.definition);
2277
- if (a.length === 0) return [];
2278
- {
2279
- let t = e.name;
2280
- a.includes(e) && i.push({
2281
- message: n.buildLeftRecursionError({
2282
- topLevelRule: e,
2283
- leftRecursionPath: r
2284
- }),
2285
- type: Z.LEFT_RECURSION,
2286
- ruleName: t
2287
- });
2288
- let o = r.concat([e]), s = a.filter((e) => !o.includes(e)).flatMap((t) => {
2289
- let i = [...r];
2290
- return i.push(t), vt(e, t, n, i);
2291
- });
2292
- return i.concat(s);
2293
- }
2294
- }
2295
- function yt(e) {
2296
- let t = [];
2297
- if (e.length === 0) return t;
2298
- let n = e[0];
2299
- if (n instanceof s) t.push(n.referencedRule);
2300
- else if (n instanceof l || n instanceof u || n instanceof d || n instanceof f || n instanceof m || n instanceof p) t = t.concat(yt(n.definition));
2301
- else if (n instanceof h) t = n.definition.map((e) => yt(e.definition)).flat();
2302
- else if (!(n instanceof g)) throw Error("non exhaustive match");
2303
- let r = b(n), i = e.length > 1;
2304
- if (r && i) {
2305
- let n = e.slice(1);
2306
- return t.concat(yt(n));
2307
- }
2308
- return t;
2309
- }
2310
- var bt = class extends y {
2311
- constructor() {
2312
- super(...arguments), this.alternations = [];
2313
- }
2314
- visitAlternation(e) {
2315
- this.alternations.push(e);
2316
- }
2317
- }, xt = class extends y {
2318
- constructor() {
2319
- super(...arguments), this.allProductions = [];
2320
- }
2321
- visitRepetitionWithSeparator(e) {
2322
- this.allProductions.push(e);
2323
- }
2324
- visitRepetitionMandatory(e) {
2325
- this.allProductions.push(e);
2326
- }
2327
- visitRepetitionMandatoryWithSeparator(e) {
2328
- this.allProductions.push(e);
2329
- }
2330
- visitRepetition(e) {
2331
- this.allProductions.push(e);
2332
- }
2333
- }, St = "MismatchedTokenException", Ct = "NoViableAltException", wt = "EarlyExitException", Tt = "NotAllInputParsedException", Et = [
2334
- St,
2335
- Ct,
2336
- wt,
2337
- Tt
2338
- ];
2339
- function Dt(e) {
2340
- return Et.includes(e.name);
2341
- }
2342
- Object.freeze(Et);
2343
- var Ot = class extends Error {
2344
- constructor(e, t) {
2345
- super(e), this.token = t, this.resyncedTokens = [], Object.setPrototypeOf(this, new.target.prototype), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
2346
- }
2347
- }, kt = class extends Ot {
2348
- constructor(e, t, n) {
2349
- super(e, t), this.previousToken = n, this.name = St;
2350
- }
2351
- }, At = class extends Ot {
2352
- constructor(e, t, n) {
2353
- super(e, t), this.previousToken = n, this.name = Ct;
2354
- }
2355
- }, jt = class extends Ot {
2356
- constructor(e, t) {
2357
- super(e, t), this.name = Tt;
2358
- }
2359
- }, Mt = class extends Ot {
2360
- constructor(e, t, n) {
2361
- super(e, t), this.previousToken = n, this.name = wt;
2362
- }
2363
- }, Nt = {}, Pt = class extends Error {
2364
- constructor(e) {
2365
- super(e), this.name = "InRuleRecoveryException";
2366
- }
2367
- };
2368
- function Ft(e, t, n, r, i, a, o) {
2369
- let s = this.getKeyForAutomaticLookahead(r, i), c = this.firstAfterRepMap[s];
2370
- if (c === void 0) {
2371
- let e = this.getCurrRuleFullName();
2372
- c = new a(this.getGAstProductions()[e], i).startWalking(), this.firstAfterRepMap[s] = c;
2373
- }
2374
- let l = c.token, u = c.occurrence, d = c.isEndOfRule;
2375
- this.RULE_STACK_IDX === 0 && d && l === void 0 && (l = J, u = 1), l !== void 0 && u !== void 0 && this.shouldInRepetitionRecoveryBeTried(l, u, o) && this.tryInRepetitionRecovery(e, t, n, l);
2376
- }
2377
- var It = 1024, Lt = 1280, Rt = 1536;
2378
- function zt(e, t, n) {
2379
- return n | t | e;
2380
- }
2381
- var Bt, Vt = class {
2382
- constructor(e) {
2383
- this.maxLookahead = e?.maxLookahead ?? $.maxLookahead;
2384
- }
2385
- validate(e) {
2386
- let t = this.validateNoLeftRecursion(e.rules);
2387
- if (t.length === 0) {
2388
- let n = this.validateEmptyOrAlternatives(e.rules), r = this.validateAmbiguousAlternationAlternatives(e.rules, this.maxLookahead), i = this.validateSomeNonEmptyLookaheadPath(e.rules, this.maxLookahead);
2389
- return [
2390
- ...t,
2391
- ...n,
2392
- ...r,
2393
- ...i
2394
- ];
2395
- }
2396
- return t;
2397
- }
2398
- validateNoLeftRecursion(e) {
2399
- return e.flatMap((e) => vt(e, e, X));
2400
- }
2401
- validateEmptyOrAlternatives(e) {
2402
- return e.flatMap((e) => function(e, t) {
2403
- let n = new bt();
2404
- return e.accept(n), n.alternations.flatMap((n) => n.definition.slice(0, -1).flatMap((r, i) => function(e, t, n) {
2405
- let r = "EXIT_NONE_TERMINAL", i = [r], a = "EXIT_ALTERNATIVE", o = !1, _ = t.length, v = _ - 1 - 1, y = [], b = [];
2406
- for (b.push({
2407
- idx: -1,
2408
- def: e,
2409
- ruleStack: [],
2410
- occurrenceStack: []
2411
- }); b.length !== 0;) {
2412
- let e = b.pop();
2413
- if (e === a) {
2414
- o && b.at(-1).idx <= v && b.pop();
2415
- continue;
2416
- }
2417
- let x = e.def, S = e.idx, C = e.ruleStack, w = e.occurrenceStack;
2418
- if (x.length === 0) continue;
2419
- let T = x[0];
2420
- if (T === r) {
2421
- let e = {
2422
- idx: S,
2423
- def: x.slice(1),
2424
- ruleStack: C.slice(0, -1),
2425
- occurrenceStack: w.slice(0, -1)
2426
- };
2427
- b.push(e);
2428
- } else if (T instanceof g) if (S < _ - 1) {
2429
- let e = S + 1;
2430
- if (n(t[e], T.terminalType)) {
2431
- let t = {
2432
- idx: e,
2433
- def: x.slice(1),
2434
- ruleStack: C,
2435
- occurrenceStack: w
2436
- };
2437
- b.push(t);
2438
- }
2439
- } else {
2440
- if (S !== _ - 1) throw Error("non exhaustive match");
2441
- y.push({
2442
- nextTokenType: T.terminalType,
2443
- nextTokenOccurrence: T.idx,
2444
- ruleStack: C,
2445
- occurrenceStack: w
2446
- }), o = !0;
2447
- }
2448
- else if (T instanceof s) {
2449
- let e = [...C];
2450
- e.push(T.nonTerminalName);
2451
- let t = [...w];
2452
- t.push(T.idx);
2453
- let n = {
2454
- idx: S,
2455
- def: T.definition.concat(i, x.slice(1)),
2456
- ruleStack: e,
2457
- occurrenceStack: t
2458
- };
2459
- b.push(n);
2460
- } else if (T instanceof u) {
2461
- let e = {
2462
- idx: S,
2463
- def: x.slice(1),
2464
- ruleStack: C,
2465
- occurrenceStack: w
2466
- };
2467
- b.push(e), b.push(a);
2468
- let t = {
2469
- idx: S,
2470
- def: T.definition.concat(x.slice(1)),
2471
- ruleStack: C,
2472
- occurrenceStack: w
2473
- };
2474
- b.push(t);
2475
- } else if (T instanceof d) {
2476
- let e = new p({
2477
- definition: T.definition,
2478
- idx: T.idx
2479
- }), t = {
2480
- idx: S,
2481
- def: T.definition.concat([e], x.slice(1)),
2482
- ruleStack: C,
2483
- occurrenceStack: w
2484
- };
2485
- b.push(t);
2486
- } else if (T instanceof f) {
2487
- let e = new p({
2488
- definition: [new g({ terminalType: T.separator })].concat(T.definition),
2489
- idx: T.idx
2490
- }), t = {
2491
- idx: S,
2492
- def: T.definition.concat([e], x.slice(1)),
2493
- ruleStack: C,
2494
- occurrenceStack: w
2495
- };
2496
- b.push(t);
2497
- } else if (T instanceof m) {
2498
- let e = {
2499
- idx: S,
2500
- def: x.slice(1),
2501
- ruleStack: C,
2502
- occurrenceStack: w
2503
- };
2504
- b.push(e), b.push(a);
2505
- let t = new p({
2506
- definition: [new g({ terminalType: T.separator })].concat(T.definition),
2507
- idx: T.idx
2508
- }), n = {
2509
- idx: S,
2510
- def: T.definition.concat([t], x.slice(1)),
2511
- ruleStack: C,
2512
- occurrenceStack: w
2513
- };
2514
- b.push(n);
2515
- } else if (T instanceof p) {
2516
- let e = {
2517
- idx: S,
2518
- def: x.slice(1),
2519
- ruleStack: C,
2520
- occurrenceStack: w
2521
- };
2522
- b.push(e), b.push(a);
2523
- let t = new p({
2524
- definition: T.definition,
2525
- idx: T.idx
2526
- }), n = {
2527
- idx: S,
2528
- def: T.definition.concat([t], x.slice(1)),
2529
- ruleStack: C,
2530
- occurrenceStack: w
2531
- };
2532
- b.push(n);
2533
- } else if (T instanceof h) for (let e = T.definition.length - 1; e >= 0; e--) {
2534
- let t = {
2535
- idx: S,
2536
- def: T.definition[e].definition.concat(x.slice(1)),
2537
- ruleStack: C,
2538
- occurrenceStack: w
2539
- };
2540
- b.push(t), b.push(a);
2541
- }
2542
- else if (T instanceof l) b.push({
2543
- idx: S,
2544
- def: T.definition.concat(x.slice(1)),
2545
- ruleStack: C,
2546
- occurrenceStack: w
2547
- });
2548
- else {
2549
- if (!(T instanceof c)) throw Error("non exhaustive match");
2550
- b.push(tt(T, S, C, w));
2551
- }
2552
- }
2553
- return y;
2554
- }([r], [], H).length === 0 ? [{
2555
- message: t.buildEmptyAlternationError({
2556
- topLevelRule: e,
2557
- alternation: n,
2558
- emptyChoiceIdx: i
2559
- }),
2560
- type: Z.NONE_LAST_EMPTY_ALT,
2561
- ruleName: e.name,
2562
- occurrence: n.idx,
2563
- alternative: i + 1
2564
- }] : []));
2565
- }(e, X));
2566
- }
2567
- validateAmbiguousAlternationAlternatives(e, t) {
2568
- return e.flatMap((e) => function(e, t, n) {
2569
- let r = new bt();
2570
- e.accept(r);
2571
- let i = r.alternations;
2572
- return i = i.filter((e) => !0 !== e.ignoreAmbiguities), i.flatMap((r) => {
2573
- let i = dt(r.idx, e, r.maxLookahead || t, r), a = function(e, t, n, r) {
2574
- let i = [];
2575
- return e.reduce((n, r, a) => (!0 === t.definition[a].ignoreAmbiguities || r.forEach((r) => {
2576
- let o = [a];
2577
- e.forEach((e, n) => {
2578
- a !== n && pt(e, r) && !0 !== t.definition[n].ignoreAmbiguities && o.push(n);
2579
- }), o.length > 1 && !pt(i, r) && (i.push(r), n.push({
2580
- alts: o,
2581
- path: r
2582
- }));
2583
- }), n), []).map((e) => {
2584
- let i = e.alts.map((e) => e + 1);
2585
- return {
2586
- message: r.buildAlternationAmbiguityError({
2587
- topLevelRule: n,
2588
- alternation: t,
2589
- ambiguityIndices: i,
2590
- prefixPath: e.path
2591
- }),
2592
- type: Z.AMBIGUOUS_ALTS,
2593
- ruleName: n.name,
2594
- occurrence: t.idx,
2595
- alternatives: e.alts
2596
- };
2597
- });
2598
- }(i, r, e, n), o = function(e, t, n, r) {
2599
- let i = e.reduce((e, t, n) => {
2600
- let r = t.map((e) => ({
2601
- idx: n,
2602
- path: e
2603
- }));
2604
- return e.concat(r);
2605
- }, []);
2606
- return i.flatMap((e) => {
2607
- if (!0 === t.definition[e.idx].ignoreAmbiguities) return [];
2608
- let a = e.idx, o = e.path;
2609
- return i.filter((e) => {
2610
- return !0 !== t.definition[e.idx].ignoreAmbiguities && e.idx < a && (n = e.path, r = o, n.length < r.length && n.every((e, t) => {
2611
- let n = r[t];
2612
- return e === n || n.categoryMatchesMap[e.tokenTypeIdx];
2613
- }));
2614
- var n, r;
2615
- }).map((e) => {
2616
- let i = [e.idx + 1, a + 1], o = t.idx === 0 ? "" : t.idx;
2617
- return {
2618
- message: r.buildAlternationPrefixAmbiguityError({
2619
- topLevelRule: n,
2620
- alternation: t,
2621
- ambiguityIndices: i,
2622
- prefixPath: e.path
2623
- }),
2624
- type: Z.AMBIGUOUS_PREFIX_ALTS,
2625
- ruleName: n.name,
2626
- occurrence: o,
2627
- alternatives: i
2628
- };
2629
- });
2630
- });
2631
- }(i, r, e, n);
2632
- return a.concat(o);
2633
- });
2634
- }(e, t, X));
2635
- }
2636
- validateSomeNonEmptyLookaheadPath(e, t) {
2637
- return function(e, t, n) {
2638
- let r = [];
2639
- return e.forEach((e) => {
2640
- let i = new xt();
2641
- e.accept(i), i.allProductions.forEach((i) => {
2642
- let a = nt(i), o = i.maxLookahead || t;
2643
- if (ft(i.idx, e, a, o)[0].flat().length === 0) {
2644
- let t = n.buildEmptyRepetitionError({
2645
- topLevelRule: e,
2646
- repetition: i
2647
- });
2648
- r.push({
2649
- message: t,
2650
- type: Z.NO_NON_EMPTY_LOOKAHEAD,
2651
- ruleName: e.name
2652
- });
2653
- }
2654
- });
2655
- }), r;
2656
- }(e, t, X);
2657
- }
2658
- buildLookaheadForAlternation(e) {
2659
- return function(e, t, n, r, i, a) {
2660
- let o = dt(e, t, n);
2661
- return a(o, r, mt(o) ? Te : H, i);
2662
- }(e.prodOccurrence, e.rule, e.maxLookahead, e.hasPredicates, e.dynamicTokensEnabled, rt);
2663
- }
2664
- buildLookaheadForOptional(e) {
2665
- return function(e, t, n, r, i, a) {
2666
- let o = ft(e, t, i, n), s = mt(o) ? Te : H;
2667
- return a(o[0], s, r);
2668
- }(e.prodOccurrence, e.rule, e.maxLookahead, e.dynamicTokensEnabled, nt(e.prodType), it);
2669
- }
2670
- }, Ht = new class extends y {
2671
- constructor() {
2672
- super(...arguments), this.dslMethods = {
2673
- option: [],
2674
- alternation: [],
2675
- repetition: [],
2676
- repetitionWithSeparator: [],
2677
- repetitionMandatory: [],
2678
- repetitionMandatoryWithSeparator: []
2679
- };
2680
- }
2681
- reset() {
2682
- this.dslMethods = {
2683
- option: [],
2684
- alternation: [],
2685
- repetition: [],
2686
- repetitionWithSeparator: [],
2687
- repetitionMandatory: [],
2688
- repetitionMandatoryWithSeparator: []
2689
- };
2690
- }
2691
- visitOption(e) {
2692
- this.dslMethods.option.push(e);
2693
- }
2694
- visitRepetitionWithSeparator(e) {
2695
- this.dslMethods.repetitionWithSeparator.push(e);
2696
- }
2697
- visitRepetitionMandatory(e) {
2698
- this.dslMethods.repetitionMandatory.push(e);
2699
- }
2700
- visitRepetitionMandatoryWithSeparator(e) {
2701
- this.dslMethods.repetitionMandatoryWithSeparator.push(e);
2702
- }
2703
- visitRepetition(e) {
2704
- this.dslMethods.repetition.push(e);
2705
- }
2706
- visitAlternation(e) {
2707
- this.dslMethods.alternation.push(e);
2708
- }
2709
- }();
2710
- function Ut(e, t) {
2711
- e.startOffset === -1 ? (e.startOffset = t.startOffset, e.endOffset = t.endOffset) : e.endOffset < t.endOffset == 1 && (e.endOffset = t.endOffset);
2712
- }
2713
- function Wt(e, t) {
2714
- 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);
2715
- }
2716
- function Gt(e, t) {
2717
- Object.defineProperty(e, "name", {
2718
- enumerable: !1,
2719
- configurable: !0,
2720
- writable: !1,
2721
- value: t
2722
- });
2723
- }
2724
- function Kt(e, t) {
2725
- let n = Object.keys(e), r = n.length;
2726
- for (let i = 0; i < r; i++) {
2727
- let r = e[n[i]], a = r.length;
2728
- for (let e = 0; e < a; e++) {
2729
- let n = r[e];
2730
- n.tokenTypeIdx === void 0 && this[n.name](n.children, t);
2731
- }
2732
- }
2733
- }
2734
- (function(e) {
2735
- e[e.REDUNDANT_METHOD = 0] = "REDUNDANT_METHOD", e[e.MISSING_METHOD = 1] = "MISSING_METHOD";
2736
- })(Bt ||= {});
2737
- var qt = { description: "This Object indicates the Parser is during Recording Phase" };
2738
- Object.freeze(qt);
2739
- var Jt = !0, Yt = q({
2740
- name: "RECORDING_PHASE_TOKEN",
2741
- pattern: K.NA
2742
- });
2743
- W([Yt]);
2744
- var Xt = Ue(Yt, "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);
2745
- Object.freeze(Xt);
2746
- var Zt = {
2747
- name: "This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",
2748
- children: {}
2749
- };
2750
- function Qt(e, t, n, r = !1) {
2751
- tn(n);
2752
- let i = this.recordingProdStack.at(-1), a = typeof t == "function" ? t : t.DEF, o = new e({
2753
- definition: [],
2754
- idx: n
2755
- });
2756
- 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(), qt;
2757
- }
2758
- function $t(e, t) {
2759
- tn(t);
2760
- let n = this.recordingProdStack.at(-1), r = !1 === Array.isArray(e), i = !1 === r ? e : e.DEF, a = new h({
2761
- definition: [],
2762
- idx: t,
2763
- ignoreAmbiguities: r && !0 === e.IGNORE_AMBIGUITIES
2764
- });
2765
- 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) => {
2766
- let t = new l({ definition: [] });
2767
- 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();
2768
- }), qt;
2769
- }
2770
- function en(e) {
2771
- return e === 0 ? "" : `${e}`;
2772
- }
2773
- function tn(e) {
2774
- if (e < 0 || e > 255) {
2775
- let t = Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than 256`);
2776
- throw t.KNOWN_RECORDER_ERROR = !0, t;
2777
- }
2778
- }
2779
- var Z, Q = Ue(J, "", -1, -1, -1, -1, -1, -1);
2780
- Object.freeze(Q);
2781
- var nn, $ = Object.freeze({
2782
- recoveryEnabled: !1,
2783
- maxLookahead: 3,
2784
- dynamicTokensEnabled: !1,
2785
- outputCst: !0,
2786
- errorMessageProvider: We,
2787
- nodeLocationTracking: "none",
2788
- traceInitPerf: !1,
2789
- skipValidations: !1
2790
- }), rn = Object.freeze({
2791
- recoveryValueFunc: () => {},
2792
- resyncEnabled: !0
2793
- });
2794
- (function(e) {
2795
- 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";
2796
- })(Z ||= {});
2797
- var an = class e {
2798
- static performSelfAnalysis(e) {
2799
- throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.");
2800
- }
2801
- performSelfAnalysis() {
2802
- this.TRACE_INIT("performSelfAnalysis", () => {
2803
- let t;
2804
- this.selfAnalysisDone = !0;
2805
- let n = this.className;
2806
- this.TRACE_INIT("toFastProps", () => {
2807
- a(this);
2808
- }), this.TRACE_INIT("Grammar Recording", () => {
2809
- try {
2810
- this.enableRecording(), this.definedRulesNames.forEach((e) => {
2811
- let t, n = this[e].originalGrammarAction;
2812
- this.TRACE_INIT(`${e} Rule`, () => {
2813
- t = this.topLevelRuleRecord(e, n);
2814
- }), this.gastProductionsCache[e] = t;
2815
- });
2816
- } finally {
2817
- this.disableRecording();
2818
- }
2819
- });
2820
- let r = [];
2821
- if (this.TRACE_INIT("Grammar Resolving", () => {
2822
- r = function(e) {
2823
- let t = Object.assign({ errMsgProvider: Ge }, e), n = {};
2824
- return e.rules.forEach((e) => {
2825
- n[e.name] = e;
2826
- }), function(e, t) {
2827
- let n = new Ke(e, t);
2828
- return n.resolveRefs(), n.errors;
2829
- }(n, t.errMsgProvider);
2830
- }({ rules: Object.values(this.gastProductionsCache) }), this.definitionErrors = this.definitionErrors.concat(r);
2831
- }), this.TRACE_INIT("Grammar Validations", () => {
2832
- if (r.length === 0 && !1 === this.skipValidations) {
2833
- let t = function(e) {
2834
- return function(e, t, n, r) {
2835
- let i = e.flatMap((e) => function(e, t) {
2836
- let n = new _t();
2837
- e.accept(n);
2838
- let r = n.allProductions, i = Object.groupBy(r, ht), a = Object.fromEntries(Object.entries(i).filter(([e, t]) => t.length > 1));
2839
- return Object.values(a).map((n) => {
2840
- let r = n[0], i = t.buildDuplicateFoundError(e, n), a = x(r), o = {
2841
- message: i,
2842
- type: Z.DUPLICATE_PRODUCTIONS,
2843
- ruleName: e.name,
2844
- dslName: a,
2845
- occurrence: r.idx
2846
- }, s = gt(r);
2847
- return s && (o.parameter = s), o;
2848
- });
2849
- }(e, n)), a = function(e, t, n) {
2850
- let r = [], i = t.map((e) => e.name);
2851
- return e.forEach((e) => {
2852
- let t = e.name;
2853
- if (i.includes(t)) {
2854
- let i = n.buildNamespaceConflictError(e);
2855
- r.push({
2856
- message: i,
2857
- type: Z.CONFLICT_TOKENS_RULES_NAMESPACE,
2858
- ruleName: t
2859
- });
2860
- }
2861
- }), r;
2862
- }(e, t, n), o = e.flatMap((e) => function(e, t) {
2863
- let n = new bt();
2864
- return e.accept(n), n.alternations.flatMap((n) => n.definition.length > 255 ? [{
2865
- message: t.buildTooManyAlternativesError({
2866
- topLevelRule: e,
2867
- alternation: n
2868
- }),
2869
- type: Z.TOO_MANY_ALTS,
2870
- ruleName: e.name,
2871
- occurrence: n.idx
2872
- }] : []);
2873
- }(e, n)), s = e.flatMap((t) => function(e, t, n, r) {
2874
- let i = [];
2875
- if (t.reduce((t, n) => n.name === e.name ? t + 1 : t, 0) > 1) {
2876
- let t = r.buildDuplicateRuleNameError({
2877
- topLevelRule: e,
2878
- grammarName: n
2879
- });
2880
- i.push({
2881
- message: t,
2882
- type: Z.DUPLICATE_RULE_NAME,
2883
- ruleName: e.name
2884
- });
2885
- }
2886
- return i;
2887
- }(t, e, r, n));
2888
- return i.concat(a, o, s);
2889
- }(e.rules, e.tokenTypes, e.errMsgProvider ?? X, e.grammarName);
2890
- }({
2891
- rules: Object.values(this.gastProductionsCache),
2892
- tokenTypes: Object.values(this.tokensMap),
2893
- errMsgProvider: X,
2894
- grammarName: n
2895
- }), r = (e = {
2896
- lookaheadStrategy: this.lookaheadStrategy,
2897
- rules: Object.values(this.gastProductionsCache),
2898
- tokenTypes: Object.values(this.tokensMap),
2899
- grammarName: n
2900
- }).lookaheadStrategy.validate({
2901
- rules: e.rules,
2902
- tokenTypes: e.tokenTypes,
2903
- grammarName: e.grammarName
2904
- }).map((e) => Object.assign({ type: Z.CUSTOM_LOOKAHEAD_VALIDATION }, e));
2905
- this.definitionErrors = this.definitionErrors.concat(t, r);
2906
- }
2907
- var e;
2908
- }), this.definitionErrors.length === 0 && (this.recoveryEnabled && this.TRACE_INIT("computeAllProdsFollows", () => {
2909
- let e = function(e) {
2910
- let t = {};
2911
- return e.forEach((e) => {
2912
- let n = new E(e).startWalking();
2913
- Object.assign(t, n);
2914
- }), t;
2915
- }(Object.values(this.gastProductionsCache));
2916
- this.resyncFollows = e;
2917
- }), this.TRACE_INIT("ComputeLookaheadFunctions", () => {
2918
- var e, t;
2919
- (t = (e = this.lookaheadStrategy).initialize) == null || t.call(e, { rules: Object.values(this.gastProductionsCache) }), this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache));
2920
- })), !e.DEFER_DEFINITION_ERRORS_HANDLING && this.definitionErrors.length !== 0) throw t = this.definitionErrors.map((e) => e.message), Error(`Parser Definition Errors detected:\n ${t.join("\n-------------------------------\n")}`);
2921
- });
2922
- }
2923
- constructor(e, t) {
2924
- this.definitionErrors = [], this.selfAnalysisDone = !1;
2925
- let n = this;
2926
- if (n.initErrorHandler(t), n.initLexerAdapter(), n.initLooksAhead(t), n.initRecognizerEngine(e, t), n.initRecoverable(t), n.initTreeBuilder(t), n.initGastRecorder(t), n.initPerformanceTracer(t), Object.hasOwn(t, "ignoredIssues")) throw Error("The <ignoredIssues> IParserConfig property has been deprecated.\n Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");
2927
- this.skipValidations = Object.hasOwn(t, "skipValidations") ? t.skipValidations : $.skipValidations;
2928
- }
2929
- };
2930
- an.DEFER_DEFINITION_ERRORS_HANDLING = !1, nn = an, [
2931
- class {
2932
- initRecoverable(e) {
2933
- this.firstAfterRepMap = {}, this.resyncFollows = {}, this.recoveryEnabled = Object.hasOwn(e, "recoveryEnabled") ? e.recoveryEnabled : $.recoveryEnabled, this.recoveryEnabled && (this.attemptInRepetitionRecovery = Ft);
2934
- }
2935
- getTokenToInsert(e) {
2936
- let t = Ue(e, "", -1, -1, -1, -1, -1, -1);
2937
- return t.isInsertedInRecovery = !0, t;
2938
- }
2939
- canTokenTypeBeInsertedInRecovery(e) {
2940
- return !0;
2941
- }
2942
- canTokenTypeBeDeletedInRecovery(e) {
2943
- return !0;
2944
- }
2945
- tryInRepetitionRecovery(e, t, n, r) {
2946
- let i = this.findReSyncTokenType(), a = this.exportLexerState(), o = [], s = !1, c = this.LA_FAST(1), l = this.LA_FAST(1), u = () => {
2947
- let e = this.LA(0), t = new kt(this.errorMessageProvider.buildMismatchTokenMessage({
2948
- expected: r,
2949
- actual: c,
2950
- previous: e,
2951
- ruleName: this.getCurrRuleFullName()
2952
- }), c, this.LA(0));
2953
- t.resyncedTokens = o.slice(0, -1), this.SAVE_ERROR(t);
2954
- };
2955
- for (; !s;) {
2956
- if (this.tokenMatcher(l, r)) return void u();
2957
- if (n.call(this)) return u(), void e.apply(this, t);
2958
- this.tokenMatcher(l, i) ? s = !0 : (l = this.SKIP_TOKEN(), this.addToResyncTokens(l, o));
2959
- }
2960
- this.importLexerState(a);
2961
- }
2962
- shouldInRepetitionRecoveryBeTried(e, t, n) {
2963
- return !1 !== n && !this.tokenMatcher(this.LA_FAST(1), e) && !this.isBackTracking() && !this.canPerformInRuleRecovery(e, this.getFollowsForInRuleRecovery(e, t));
2964
- }
2965
- getNextPossibleTokenTypes(e) {
2966
- let t = e.ruleStack[0], n = this.getGAstProductions()[t];
2967
- return new Je(n, e).startWalking();
2968
- }
2969
- getFollowsForInRuleRecovery(e, t) {
2970
- let n = this.getCurrentGrammarPath(e, t);
2971
- return this.getNextPossibleTokenTypes(n);
2972
- }
2973
- tryInRuleRecovery(e, t) {
2974
- if (this.canRecoverWithSingleTokenInsertion(e, t)) return this.getTokenToInsert(e);
2975
- if (this.canRecoverWithSingleTokenDeletion(e)) {
2976
- let e = this.SKIP_TOKEN();
2977
- return this.consumeToken(), e;
2978
- }
2979
- throw new Pt("sad sad panda");
2980
- }
2981
- canPerformInRuleRecovery(e, t) {
2982
- return this.canRecoverWithSingleTokenInsertion(e, t) || this.canRecoverWithSingleTokenDeletion(e);
2983
- }
2984
- canRecoverWithSingleTokenInsertion(e, t) {
2985
- if (!this.canTokenTypeBeInsertedInRecovery(e) || t.length === 0) return !1;
2986
- let n = this.LA_FAST(1);
2987
- return t.find((e) => this.tokenMatcher(n, e)) !== void 0;
2988
- }
2989
- canRecoverWithSingleTokenDeletion(e) {
2990
- return !!this.canTokenTypeBeDeletedInRecovery(e) && this.tokenMatcher(this.LA(2), e);
2991
- }
2992
- isInCurrentRuleReSyncSet(e) {
2993
- let t = this.getCurrFollowKey();
2994
- return this.getFollowSetFromFollowKey(t).includes(e);
2995
- }
2996
- findReSyncTokenType() {
2997
- let e = this.flattenFollowSet(), t = this.LA_FAST(1), n = 2;
2998
- for (;;) {
2999
- let r = e.find((e) => H(t, e));
3000
- if (r !== void 0) return r;
3001
- t = this.LA(n), n++;
3002
- }
3003
- }
3004
- getCurrFollowKey() {
3005
- if (this.RULE_STACK_IDX === 0) return Nt;
3006
- let e = this.currRuleShortName, t = this.getLastExplicitRuleOccurrenceIndex(), n = this.getPreviousExplicitRuleShortName();
3007
- return {
3008
- ruleName: this.shortRuleNameToFullName(e),
3009
- idxInCallingRule: t,
3010
- inRule: this.shortRuleNameToFullName(n)
3011
- };
3012
- }
3013
- buildFullFollowKeyStack() {
3014
- let e = this.RULE_STACK, t = this.RULE_OCCURRENCE_STACK, n = this.RULE_STACK_IDX + 1, r = Array(n);
3015
- for (let i = 0; i < n; i++) r[i] = i === 0 ? Nt : {
3016
- ruleName: this.shortRuleNameToFullName(e[i]),
3017
- idxInCallingRule: t[i],
3018
- inRule: this.shortRuleNameToFullName(e[i - 1])
3019
- };
3020
- return r;
3021
- }
3022
- flattenFollowSet() {
3023
- return this.buildFullFollowKeyStack().map((e) => this.getFollowSetFromFollowKey(e)).flat();
3024
- }
3025
- getFollowSetFromFollowKey(e) {
3026
- if (e === Nt) return [J];
3027
- let t = e.ruleName + e.idxInCallingRule + T + e.inRule;
3028
- return this.resyncFollows[t];
3029
- }
3030
- addToResyncTokens(e, t) {
3031
- return this.tokenMatcher(e, J) || t.push(e), t;
3032
- }
3033
- reSyncTo(e) {
3034
- let t = [], n = this.LA_FAST(1);
3035
- for (; !1 === this.tokenMatcher(n, e);) n = this.SKIP_TOKEN(), this.addToResyncTokens(n, t);
3036
- return t.slice(0, -1);
3037
- }
3038
- attemptInRepetitionRecovery(e, t, n, r, i, a, o) {}
3039
- getCurrentGrammarPath(e, t) {
3040
- return {
3041
- ruleStack: this.getHumanReadableRuleStack(),
3042
- occurrenceStack: this.RULE_OCCURRENCE_STACK.slice(0, this.RULE_OCCURRENCE_STACK_IDX + 1),
3043
- lastTok: e,
3044
- lastTokOccurrence: t
3045
- };
3046
- }
3047
- getHumanReadableRuleStack() {
3048
- let e = this.RULE_STACK_IDX + 1, t = Array(e);
3049
- for (let n = 0; n < e; n++) t[n] = this.shortRuleNameToFullName(this.RULE_STACK[n]);
3050
- return t;
3051
- }
3052
- },
3053
- class {
3054
- initLooksAhead(e) {
3055
- 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 Vt({ maxLookahead: this.maxLookahead }), this.lookAheadFuncsCache = /* @__PURE__ */ new Map();
3056
- }
3057
- preComputeLookaheadFunctions(e) {
3058
- e.forEach((e) => {
3059
- this.TRACE_INIT(`${e.name} Rule Lookahead`, () => {
3060
- let { alternation: t, repetition: n, option: r, repetitionMandatory: i, repetitionMandatoryWithSeparator: a, repetitionWithSeparator: o } = function(e) {
3061
- Ht.reset(), e.accept(Ht);
3062
- let t = Ht.dslMethods;
3063
- return Ht.reset(), t;
3064
- }(e);
3065
- t.forEach((t) => {
3066
- let n = t.idx === 0 ? "" : t.idx;
3067
- this.TRACE_INIT(`${x(t)}${n}`, () => {
3068
- let n = this.lookaheadStrategy.buildLookaheadForAlternation({
3069
- prodOccurrence: t.idx,
3070
- rule: e,
3071
- maxLookahead: t.maxLookahead || this.maxLookahead,
3072
- hasPredicates: t.hasPredicates,
3073
- dynamicTokensEnabled: this.dynamicTokensEnabled
3074
- }), r = zt(this.fullRuleNameToShort[e.name], 256, t.idx);
3075
- this.setLaFuncCache(r, n);
3076
- });
3077
- }), n.forEach((t) => {
3078
- this.computeLookaheadFunc(e, t.idx, 768, "Repetition", t.maxLookahead, x(t));
3079
- }), r.forEach((t) => {
3080
- this.computeLookaheadFunc(e, t.idx, 512, "Option", t.maxLookahead, x(t));
3081
- }), i.forEach((t) => {
3082
- this.computeLookaheadFunc(e, t.idx, It, "RepetitionMandatory", t.maxLookahead, x(t));
3083
- }), a.forEach((t) => {
3084
- this.computeLookaheadFunc(e, t.idx, Rt, "RepetitionMandatoryWithSeparator", t.maxLookahead, x(t));
3085
- }), o.forEach((t) => {
3086
- this.computeLookaheadFunc(e, t.idx, Lt, "RepetitionWithSeparator", t.maxLookahead, x(t));
3087
- });
3088
- });
3089
- });
3090
- }
3091
- computeLookaheadFunc(e, t, n, r, i, a) {
3092
- this.TRACE_INIT(`${a}${t === 0 ? "" : t}`, () => {
3093
- let a = this.lookaheadStrategy.buildLookaheadForOptional({
3094
- prodOccurrence: t,
3095
- rule: e,
3096
- maxLookahead: i || this.maxLookahead,
3097
- dynamicTokensEnabled: this.dynamicTokensEnabled,
3098
- prodType: r
3099
- }), o = zt(this.fullRuleNameToShort[e.name], n, t);
3100
- this.setLaFuncCache(o, a);
3101
- });
3102
- }
3103
- getKeyForAutomaticLookahead(e, t) {
3104
- return zt(this.currRuleShortName, e, t);
3105
- }
3106
- getLaFuncFromCache(e) {
3107
- return this.lookAheadFuncsCache.get(e);
3108
- }
3109
- setLaFuncCache(e, t) {
3110
- this.lookAheadFuncsCache.set(e, t);
3111
- }
3112
- },
3113
- class {
3114
- initTreeBuilder(e) {
3115
- 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 = Wt, this.setNodeLocationFromNode = Wt, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleFull, this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular);
3116
- else if (/onlyOffset/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = Ut, this.setNodeLocationFromNode = Ut, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleOnlyOffset, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular);
3117
- else {
3118
- if (!/none/i.test(this.nodeLocationTracking)) throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);
3119
- this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = () => {}, this.setInitialNodeLocation = () => {};
3120
- }
3121
- else this.cstInvocationStateUpdate = () => {}, this.cstFinallyStateUpdate = () => {}, this.cstPostTerminal = () => {}, this.cstPostNonTerminal = () => {}, this.cstPostRule = () => {};
3122
- }
3123
- setInitialNodeLocationOnlyOffsetRecovery(e) {
3124
- e.location = {
3125
- startOffset: -1,
3126
- endOffset: -1
3127
- };
3128
- }
3129
- setInitialNodeLocationOnlyOffsetRegular(e) {
3130
- e.location = {
3131
- startOffset: this.LA_FAST(1).startOffset,
3132
- endOffset: -1
3133
- };
3134
- }
3135
- setInitialNodeLocationFullRecovery(e) {
3136
- e.location = {
3137
- startOffset: -1,
3138
- startLine: -1,
3139
- startColumn: -1,
3140
- endOffset: -1,
3141
- endLine: -1,
3142
- endColumn: -1
3143
- };
3144
- }
3145
- setInitialNodeLocationFullRegular(e) {
3146
- let t = this.LA_FAST(1);
3147
- e.location = {
3148
- startOffset: t.startOffset,
3149
- startLine: t.startLine,
3150
- startColumn: t.startColumn,
3151
- endOffset: -1,
3152
- endLine: -1,
3153
- endColumn: -1
3154
- };
3155
- }
3156
- cstInvocationStateUpdate(e) {
3157
- let t = {
3158
- name: e,
3159
- children: Object.create(null)
3160
- };
3161
- this.setInitialNodeLocation(t), this.CST_STACK.push(t);
3162
- }
3163
- cstFinallyStateUpdate() {
3164
- this.CST_STACK.pop();
3165
- }
3166
- cstPostRuleFull(e) {
3167
- let t = this.LA(0), n = e.location;
3168
- n.startOffset !== -1 && n.startOffset <= t.startOffset == 1 ? (n.endOffset = t.endOffset, n.endLine = t.endLine, n.endColumn = t.endColumn) : (n.startOffset = -1, n.startLine = -1, n.startColumn = -1);
3169
- }
3170
- cstPostRuleOnlyOffset(e) {
3171
- let t = this.LA(0), n = e.location;
3172
- n.startOffset !== -1 && n.startOffset <= t.startOffset == 1 ? n.endOffset = t.endOffset : n.startOffset = -1;
3173
- }
3174
- cstPostTerminal(e, t) {
3175
- let n = this.CST_STACK[this.CST_STACK.length - 1];
3176
- var r, i = t, a = e;
3177
- (r = n).children[a] === void 0 ? r.children[a] = [i] : r.children[a].push(i), this.setNodeLocationFromToken(n.location, t);
3178
- }
3179
- cstPostNonTerminal(e, t) {
3180
- let n = this.CST_STACK[this.CST_STACK.length - 1];
3181
- (function(e, t, n) {
3182
- e.children[t] === void 0 ? e.children[t] = [n] : e.children[t].push(n);
3183
- })(n, t, e), this.setNodeLocationFromNode(n.location, e.location);
3184
- }
3185
- get currCSTNode() {
3186
- return this.CST_STACK[this.CST_STACK.length - 1];
3187
- }
3188
- getBaseCstVisitorConstructor() {
3189
- if (this.baseCstVisitorConstructor === void 0) {
3190
- let e = function(e, t) {
3191
- let n = function() {};
3192
- return Gt(n, e + "BaseSemantics"), n.prototype = {
3193
- visit: function(e, t) {
3194
- if (Array.isArray(e) && (e = e[0]), e !== void 0) return this[e.name](e.children, t);
3195
- },
3196
- validateVisitor: function() {
3197
- let e = function(e, t) {
3198
- return function(e, t) {
3199
- return t.filter((t) => typeof e[t] == "function" == 0).map((t) => ({
3200
- msg: `Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,
3201
- type: Bt.MISSING_METHOD,
3202
- methodName: t
3203
- })).filter(Boolean);
3204
- }(e, t);
3205
- }(this, t);
3206
- if (e.length !== 0) {
3207
- let t = e.map((e) => e.msg);
3208
- throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g, "\n ")}`);
3209
- }
3210
- }
3211
- }, n.prototype.constructor = n, n._RULE_NAMES = t, n;
3212
- }(this.className, Object.keys(this.gastProductionsCache));
3213
- return this.baseCstVisitorConstructor = e, e;
3214
- }
3215
- return this.baseCstVisitorConstructor;
3216
- }
3217
- getBaseCstVisitorConstructorWithDefaults() {
3218
- if (this.baseCstVisitorWithDefaultsConstructor === void 0) {
3219
- let e = function(e, t, n) {
3220
- let r = function() {};
3221
- Gt(r, e + "BaseSemanticsWithDefaults");
3222
- let i = Object.create(n.prototype);
3223
- return t.forEach((e) => {
3224
- i[e] = Kt;
3225
- }), (r.prototype = i).constructor = r, r;
3226
- }(this.className, Object.keys(this.gastProductionsCache), this.getBaseCstVisitorConstructor());
3227
- return this.baseCstVisitorWithDefaultsConstructor = e, e;
3228
- }
3229
- return this.baseCstVisitorWithDefaultsConstructor;
3230
- }
3231
- getPreviousExplicitRuleShortName() {
3232
- return this.RULE_STACK[this.RULE_STACK_IDX - 1];
3233
- }
3234
- getLastExplicitRuleOccurrenceIndex() {
3235
- return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX];
3236
- }
3237
- },
3238
- class {
3239
- initLexerAdapter() {
3240
- this.tokVector = [], this.tokVectorLength = 0, this.currIdx = -1;
3241
- }
3242
- set input(e) {
3243
- if (!0 !== this.selfAnalysisDone) throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");
3244
- this.reset(), this.tokVector = e, this.tokVectorLength = e.length;
3245
- }
3246
- get input() {
3247
- return this.tokVector;
3248
- }
3249
- SKIP_TOKEN() {
3250
- return this.currIdx <= this.tokVectorLength - 2 ? (this.consumeToken(), this.LA_FAST(1)) : Q;
3251
- }
3252
- LA_FAST(e) {
3253
- let t = this.currIdx + e;
3254
- return this.tokVector[t];
3255
- }
3256
- LA(e) {
3257
- let t = this.currIdx + e;
3258
- return t < 0 || this.tokVectorLength <= t ? Q : this.tokVector[t];
3259
- }
3260
- consumeToken() {
3261
- this.currIdx++;
3262
- }
3263
- exportLexerState() {
3264
- return this.currIdx;
3265
- }
3266
- importLexerState(e) {
3267
- this.currIdx = e;
3268
- }
3269
- resetLexerState() {
3270
- this.currIdx = -1;
3271
- }
3272
- moveToTerminatedState() {
3273
- this.currIdx = this.tokVectorLength - 1;
3274
- }
3275
- getLexerPosition() {
3276
- return this.exportLexerState();
3277
- }
3278
- },
3279
- class {
3280
- initRecognizerEngine(e, t) {
3281
- if (this.className = this.constructor.name, this.shortRuleNameToFull = {}, this.fullRuleNameToShort = {}, this.ruleShortNameIdx = 256, this.tokenMatcher = Te, 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.");
3282
- if (Array.isArray(e)) {
3283
- 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).");
3284
- 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.");
3285
- }
3286
- if (Array.isArray(e)) this.tokensMap = e.reduce((e, t) => (e[t.name] = t, e), {});
3287
- else if (Object.hasOwn(e, "modes") && Object.values(e.modes).flat().every(je)) {
3288
- let t = Object.values(e.modes).flat(), n = [...new Set(t)];
3289
- this.tokensMap = n.reduce((e, t) => (e[t.name] = t, e), {});
3290
- } else {
3291
- if (typeof e != "object" || !e) throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");
3292
- this.tokensMap = Object.assign({}, e);
3293
- }
3294
- this.tokensMap.EOF = J;
3295
- let n = (Object.hasOwn(e, "modes") ? Object.values(e.modes).flat() : Object.values(e)).every((e) => e.categoryMatches?.length == 0);
3296
- this.tokenMatcher = n ? Te : H, W(Object.values(this.tokensMap));
3297
- }
3298
- defineRule(e, t, n) {
3299
- 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.`);
3300
- let r, i = Object.hasOwn(n, "resyncEnabled") ? n.resyncEnabled : rn.resyncEnabled, a = Object.hasOwn(n, "recoveryValueFunc") ? n.recoveryValueFunc : rn.recoveryValueFunc, o = this.ruleShortNameIdx << 12;
3301
- return this.ruleShortNameIdx++, this.shortRuleNameToFull[o] = e, this.fullRuleNameToShort[e] = o, r = !0 === this.outputCst ? function(...n) {
3302
- try {
3303
- this.ruleInvocationStateUpdate(o, e, this.subruleIdx), t.apply(this, n);
3304
- let r = this.CST_STACK[this.CST_STACK.length - 1];
3305
- return this.cstPostRule(r), r;
3306
- } catch (e) {
3307
- return this.invokeRuleCatch(e, i, a);
3308
- } finally {
3309
- this.ruleFinallyStateUpdate();
3310
- }
3311
- } : function(...n) {
3312
- try {
3313
- return this.ruleInvocationStateUpdate(o, e, this.subruleIdx), t.apply(this, n);
3314
- } catch (e) {
3315
- return this.invokeRuleCatch(e, i, a);
3316
- } finally {
3317
- this.ruleFinallyStateUpdate();
3318
- }
3319
- }, Object.assign(function(...t) {
3320
- this.onBeforeParse(e);
3321
- try {
3322
- return r.apply(this, t);
3323
- } finally {
3324
- this.onAfterParse(e);
3325
- }
3326
- }, {
3327
- ruleName: e,
3328
- originalGrammarAction: t,
3329
- coreRule: r
3330
- });
3331
- }
3332
- invokeRuleCatch(e, t, n) {
3333
- let r = this.RULE_STACK_IDX === 0, i = t && !this.isBackTracking() && this.recoveryEnabled;
3334
- if (Dt(e)) {
3335
- let t = e;
3336
- if (i) {
3337
- let r = this.findReSyncTokenType();
3338
- if (this.isInCurrentRuleReSyncSet(r)) {
3339
- if (t.resyncedTokens = this.reSyncTo(r), this.outputCst) {
3340
- let e = this.CST_STACK[this.CST_STACK.length - 1];
3341
- return e.recoveredNode = !0, e;
3342
- }
3343
- return n(e);
3344
- }
3345
- if (this.outputCst) {
3346
- let e = this.CST_STACK[this.CST_STACK.length - 1];
3347
- e.recoveredNode = !0, t.partialCstResult = e;
3348
- }
3349
- throw t;
3350
- }
3351
- if (r) return this.moveToTerminatedState(), n(e);
3352
- throw t;
3353
- }
3354
- throw e;
3355
- }
3356
- optionInternal(e, t) {
3357
- let n = this.getKeyForAutomaticLookahead(512, t);
3358
- return this.optionInternalLogic(e, t, n);
3359
- }
3360
- optionInternalLogic(e, t, n) {
3361
- let r, i = this.getLaFuncFromCache(n);
3362
- if (typeof e != "function") {
3363
- r = e.DEF;
3364
- let t = e.GATE;
3365
- if (t !== void 0) {
3366
- let e = i;
3367
- i = () => t.call(this) && e.call(this);
3368
- }
3369
- } else r = e;
3370
- if (!0 === i.call(this)) return r.call(this);
3371
- }
3372
- atLeastOneInternal(e, t) {
3373
- let n = this.getKeyForAutomaticLookahead(It, e);
3374
- return this.atLeastOneInternalLogic(e, t, n);
3375
- }
3376
- atLeastOneInternalLogic(e, t, n) {
3377
- let r, i = this.getLaFuncFromCache(n);
3378
- if (typeof t != "function") {
3379
- r = t.DEF;
3380
- let e = t.GATE;
3381
- if (e !== void 0) {
3382
- let t = i;
3383
- i = () => e.call(this) && t.call(this);
3384
- }
3385
- } else r = t;
3386
- if (!0 !== i.call(this)) throw this.raiseEarlyExitException(e, Y.REPETITION_MANDATORY, t.ERR_MSG);
3387
- {
3388
- let e = this.doSingleRepetition(r);
3389
- for (; !0 === i.call(this) && !0 === e;) e = this.doSingleRepetition(r);
3390
- }
3391
- this.attemptInRepetitionRecovery(this.atLeastOneInternal, [e, t], i, It, e, Qe);
3392
- }
3393
- atLeastOneSepFirstInternal(e, t) {
3394
- let n = this.getKeyForAutomaticLookahead(Rt, e);
3395
- this.atLeastOneSepFirstInternalLogic(e, t, n);
3396
- }
3397
- atLeastOneSepFirstInternalLogic(e, t, n) {
3398
- let r = t.DEF, i = t.SEP;
3399
- if (!0 !== this.getLaFuncFromCache(n).call(this)) throw this.raiseEarlyExitException(e, Y.REPETITION_MANDATORY_WITH_SEPARATOR, t.ERR_MSG);
3400
- {
3401
- r.call(this);
3402
- let t = () => this.tokenMatcher(this.LA_FAST(1), i);
3403
- for (; !0 === this.tokenMatcher(this.LA_FAST(1), i);) this.CONSUME(i), r.call(this);
3404
- this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
3405
- e,
3406
- i,
3407
- t,
3408
- r,
3409
- $e
3410
- ], t, Rt, e, $e);
3411
- }
3412
- }
3413
- manyInternal(e, t) {
3414
- let n = this.getKeyForAutomaticLookahead(768, e);
3415
- return this.manyInternalLogic(e, t, n);
3416
- }
3417
- manyInternalLogic(e, t, n) {
3418
- let r, i = this.getLaFuncFromCache(n);
3419
- if (typeof t != "function") {
3420
- r = t.DEF;
3421
- let e = t.GATE;
3422
- if (e !== void 0) {
3423
- let t = i;
3424
- i = () => e.call(this) && t.call(this);
3425
- }
3426
- } else r = t;
3427
- let a = !0;
3428
- for (; !0 === i.call(this) && !0 === a;) a = this.doSingleRepetition(r);
3429
- this.attemptInRepetitionRecovery(this.manyInternal, [e, t], i, 768, e, Xe, a);
3430
- }
3431
- manySepFirstInternal(e, t) {
3432
- let n = this.getKeyForAutomaticLookahead(Lt, e);
3433
- this.manySepFirstInternalLogic(e, t, n);
3434
- }
3435
- manySepFirstInternalLogic(e, t, n) {
3436
- let r = t.DEF, i = t.SEP;
3437
- if (!0 === this.getLaFuncFromCache(n).call(this)) {
3438
- r.call(this);
3439
- let t = () => this.tokenMatcher(this.LA_FAST(1), i);
3440
- for (; !0 === this.tokenMatcher(this.LA_FAST(1), i);) this.CONSUME(i), r.call(this);
3441
- this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
3442
- e,
3443
- i,
3444
- t,
3445
- r,
3446
- Ze
3447
- ], t, Lt, e, Ze);
3448
- }
3449
- }
3450
- repetitionSepSecondInternal(e, t, n, r, i) {
3451
- for (; n();) this.CONSUME(t), r.call(this);
3452
- this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
3453
- e,
3454
- t,
3455
- n,
3456
- r,
3457
- i
3458
- ], n, Rt, e, i);
3459
- }
3460
- doSingleRepetition(e) {
3461
- let t = this.getLexerPosition();
3462
- return e.call(this), this.getLexerPosition() > t;
3463
- }
3464
- orInternal(e, t) {
3465
- let n = this.getKeyForAutomaticLookahead(256, t), r = Array.isArray(e) ? e : e.DEF, i = this.getLaFuncFromCache(n).call(this, r);
3466
- if (i !== void 0) return r[i].ALT.call(this);
3467
- this.raiseNoAltException(t, e.ERR_MSG);
3468
- }
3469
- ruleFinallyStateUpdate() {
3470
- 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();
3471
- }
3472
- subruleInternal(e, t, n) {
3473
- let r;
3474
- try {
3475
- let i = n === void 0 ? void 0 : n.ARGS;
3476
- return this.subruleIdx = t, r = e.coreRule.apply(this, i), this.cstPostNonTerminal(r, n !== void 0 && n.LABEL !== void 0 ? n.LABEL : e.ruleName), r;
3477
- } catch (t) {
3478
- throw this.subruleInternalError(t, n, e.ruleName);
3479
- }
3480
- }
3481
- subruleInternalError(e, t, n) {
3482
- throw Dt(e) && e.partialCstResult !== void 0 && (this.cstPostNonTerminal(e.partialCstResult, t !== void 0 && t.LABEL !== void 0 ? t.LABEL : n), delete e.partialCstResult), e;
3483
- }
3484
- consumeInternal(e, t, n) {
3485
- let r;
3486
- try {
3487
- let t = this.LA_FAST(1);
3488
- !0 === this.tokenMatcher(t, e) ? (this.consumeToken(), r = t) : this.consumeInternalError(e, t, n);
3489
- } catch (n) {
3490
- r = this.consumeInternalRecovery(e, t, n);
3491
- }
3492
- return this.cstPostTerminal(n !== void 0 && n.LABEL !== void 0 ? n.LABEL : e.name, r), r;
3493
- }
3494
- consumeInternalError(e, t, n) {
3495
- let r, i = this.LA(0);
3496
- throw r = n !== void 0 && n.ERR_MSG ? n.ERR_MSG : this.errorMessageProvider.buildMismatchTokenMessage({
3497
- expected: e,
3498
- actual: t,
3499
- previous: i,
3500
- ruleName: this.getCurrRuleFullName()
3501
- }), this.SAVE_ERROR(new kt(r, t, i));
3502
- }
3503
- consumeInternalRecovery(e, t, n) {
3504
- if (!this.recoveryEnabled || n.name !== "MismatchedTokenException" || this.isBackTracking()) throw n;
3505
- {
3506
- let r = this.getFollowsForInRuleRecovery(e, t);
3507
- try {
3508
- return this.tryInRuleRecovery(e, r);
3509
- } catch (e) {
3510
- throw e.name === "InRuleRecoveryException" ? n : e;
3511
- }
3512
- }
3513
- }
3514
- saveRecogState() {
3515
- let e = this.errors, t = this.RULE_STACK.slice(0, this.RULE_STACK_IDX + 1);
3516
- return {
3517
- errors: e,
3518
- lexerState: this.exportLexerState(),
3519
- RULE_STACK: t,
3520
- CST_STACK: this.CST_STACK
3521
- };
3522
- }
3523
- reloadRecogState(e) {
3524
- this.errors = e.errors, this.importLexerState(e.lexerState);
3525
- let t = e.RULE_STACK;
3526
- for (let e = 0; e < t.length; e++) this.RULE_STACK[e] = t[e];
3527
- this.RULE_STACK_IDX = t.length - 1, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX]);
3528
- }
3529
- ruleInvocationStateUpdate(e, t, n) {
3530
- this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX] = n, this.RULE_STACK[++this.RULE_STACK_IDX] = e, this.currRuleShortName = e, this.cstInvocationStateUpdate(t);
3531
- }
3532
- isBackTracking() {
3533
- return this.isBackTrackingStack.length !== 0;
3534
- }
3535
- getCurrRuleFullName() {
3536
- let e = this.currRuleShortName;
3537
- return this.shortRuleNameToFull[e];
3538
- }
3539
- shortRuleNameToFullName(e) {
3540
- return this.shortRuleNameToFull[e];
3541
- }
3542
- isAtEndOfInput() {
3543
- return this.tokenMatcher(this.LA(1), J);
3544
- }
3545
- reset() {
3546
- 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 = [];
3547
- }
3548
- onBeforeParse(e) {
3549
- for (let e = 0; e < this.maxLookahead + 1; e++) this.tokVector.push(Q);
3550
- }
3551
- onAfterParse(e) {
3552
- if (!1 === this.isAtEndOfInput()) {
3553
- let e = this.LA(1), t = this.errorMessageProvider.buildNotAllInputParsedMessage({
3554
- firstRedundant: e,
3555
- ruleName: this.getCurrRuleFullName()
3556
- });
3557
- this.SAVE_ERROR(new jt(t, e));
3558
- }
3559
- for (; this.tokVector.at(-1) === Q;) this.tokVector.pop();
3560
- }
3561
- },
3562
- class {
3563
- ACTION(e) {
3564
- return e.call(this);
3565
- }
3566
- consume(e, t, n) {
3567
- return this.consumeInternal(t, e, n);
3568
- }
3569
- subrule(e, t, n) {
3570
- return this.subruleInternal(t, e, n);
3571
- }
3572
- option(e, t) {
3573
- return this.optionInternal(t, e);
3574
- }
3575
- or(e, t) {
3576
- return this.orInternal(t, e);
3577
- }
3578
- many(e, t) {
3579
- return this.manyInternal(e, t);
3580
- }
3581
- atLeastOne(e, t) {
3582
- return this.atLeastOneInternal(e, t);
3583
- }
3584
- CONSUME(e, t) {
3585
- return this.consumeInternal(e, 0, t);
3586
- }
3587
- CONSUME1(e, t) {
3588
- return this.consumeInternal(e, 1, t);
3589
- }
3590
- CONSUME2(e, t) {
3591
- return this.consumeInternal(e, 2, t);
3592
- }
3593
- CONSUME3(e, t) {
3594
- return this.consumeInternal(e, 3, t);
3595
- }
3596
- CONSUME4(e, t) {
3597
- return this.consumeInternal(e, 4, t);
3598
- }
3599
- CONSUME5(e, t) {
3600
- return this.consumeInternal(e, 5, t);
3601
- }
3602
- CONSUME6(e, t) {
3603
- return this.consumeInternal(e, 6, t);
3604
- }
3605
- CONSUME7(e, t) {
3606
- return this.consumeInternal(e, 7, t);
3607
- }
3608
- CONSUME8(e, t) {
3609
- return this.consumeInternal(e, 8, t);
3610
- }
3611
- CONSUME9(e, t) {
3612
- return this.consumeInternal(e, 9, t);
3613
- }
3614
- SUBRULE(e, t) {
3615
- return this.subruleInternal(e, 0, t);
3616
- }
3617
- SUBRULE1(e, t) {
3618
- return this.subruleInternal(e, 1, t);
3619
- }
3620
- SUBRULE2(e, t) {
3621
- return this.subruleInternal(e, 2, t);
3622
- }
3623
- SUBRULE3(e, t) {
3624
- return this.subruleInternal(e, 3, t);
3625
- }
3626
- SUBRULE4(e, t) {
3627
- return this.subruleInternal(e, 4, t);
3628
- }
3629
- SUBRULE5(e, t) {
3630
- return this.subruleInternal(e, 5, t);
3631
- }
3632
- SUBRULE6(e, t) {
3633
- return this.subruleInternal(e, 6, t);
3634
- }
3635
- SUBRULE7(e, t) {
3636
- return this.subruleInternal(e, 7, t);
3637
- }
3638
- SUBRULE8(e, t) {
3639
- return this.subruleInternal(e, 8, t);
3640
- }
3641
- SUBRULE9(e, t) {
3642
- return this.subruleInternal(e, 9, t);
3643
- }
3644
- OPTION(e) {
3645
- return this.optionInternal(e, 0);
3646
- }
3647
- OPTION1(e) {
3648
- return this.optionInternal(e, 1);
3649
- }
3650
- OPTION2(e) {
3651
- return this.optionInternal(e, 2);
3652
- }
3653
- OPTION3(e) {
3654
- return this.optionInternal(e, 3);
3655
- }
3656
- OPTION4(e) {
3657
- return this.optionInternal(e, 4);
3658
- }
3659
- OPTION5(e) {
3660
- return this.optionInternal(e, 5);
3661
- }
3662
- OPTION6(e) {
3663
- return this.optionInternal(e, 6);
3664
- }
3665
- OPTION7(e) {
3666
- return this.optionInternal(e, 7);
3667
- }
3668
- OPTION8(e) {
3669
- return this.optionInternal(e, 8);
3670
- }
3671
- OPTION9(e) {
3672
- return this.optionInternal(e, 9);
3673
- }
3674
- OR(e) {
3675
- return this.orInternal(e, 0);
3676
- }
3677
- OR1(e) {
3678
- return this.orInternal(e, 1);
3679
- }
3680
- OR2(e) {
3681
- return this.orInternal(e, 2);
3682
- }
3683
- OR3(e) {
3684
- return this.orInternal(e, 3);
3685
- }
3686
- OR4(e) {
3687
- return this.orInternal(e, 4);
3688
- }
3689
- OR5(e) {
3690
- return this.orInternal(e, 5);
3691
- }
3692
- OR6(e) {
3693
- return this.orInternal(e, 6);
3694
- }
3695
- OR7(e) {
3696
- return this.orInternal(e, 7);
3697
- }
3698
- OR8(e) {
3699
- return this.orInternal(e, 8);
3700
- }
3701
- OR9(e) {
3702
- return this.orInternal(e, 9);
3703
- }
3704
- MANY(e) {
3705
- this.manyInternal(0, e);
3706
- }
3707
- MANY1(e) {
3708
- this.manyInternal(1, e);
3709
- }
3710
- MANY2(e) {
3711
- this.manyInternal(2, e);
3712
- }
3713
- MANY3(e) {
3714
- this.manyInternal(3, e);
3715
- }
3716
- MANY4(e) {
3717
- this.manyInternal(4, e);
3718
- }
3719
- MANY5(e) {
3720
- this.manyInternal(5, e);
3721
- }
3722
- MANY6(e) {
3723
- this.manyInternal(6, e);
3724
- }
3725
- MANY7(e) {
3726
- this.manyInternal(7, e);
3727
- }
3728
- MANY8(e) {
3729
- this.manyInternal(8, e);
3730
- }
3731
- MANY9(e) {
3732
- this.manyInternal(9, e);
3733
- }
3734
- MANY_SEP(e) {
3735
- this.manySepFirstInternal(0, e);
3736
- }
3737
- MANY_SEP1(e) {
3738
- this.manySepFirstInternal(1, e);
3739
- }
3740
- MANY_SEP2(e) {
3741
- this.manySepFirstInternal(2, e);
3742
- }
3743
- MANY_SEP3(e) {
3744
- this.manySepFirstInternal(3, e);
3745
- }
3746
- MANY_SEP4(e) {
3747
- this.manySepFirstInternal(4, e);
3748
- }
3749
- MANY_SEP5(e) {
3750
- this.manySepFirstInternal(5, e);
3751
- }
3752
- MANY_SEP6(e) {
3753
- this.manySepFirstInternal(6, e);
3754
- }
3755
- MANY_SEP7(e) {
3756
- this.manySepFirstInternal(7, e);
3757
- }
3758
- MANY_SEP8(e) {
3759
- this.manySepFirstInternal(8, e);
3760
- }
3761
- MANY_SEP9(e) {
3762
- this.manySepFirstInternal(9, e);
3763
- }
3764
- AT_LEAST_ONE(e) {
3765
- this.atLeastOneInternal(0, e);
3766
- }
3767
- AT_LEAST_ONE1(e) {
3768
- return this.atLeastOneInternal(1, e);
3769
- }
3770
- AT_LEAST_ONE2(e) {
3771
- this.atLeastOneInternal(2, e);
3772
- }
3773
- AT_LEAST_ONE3(e) {
3774
- this.atLeastOneInternal(3, e);
3775
- }
3776
- AT_LEAST_ONE4(e) {
3777
- this.atLeastOneInternal(4, e);
3778
- }
3779
- AT_LEAST_ONE5(e) {
3780
- this.atLeastOneInternal(5, e);
3781
- }
3782
- AT_LEAST_ONE6(e) {
3783
- this.atLeastOneInternal(6, e);
3784
- }
3785
- AT_LEAST_ONE7(e) {
3786
- this.atLeastOneInternal(7, e);
3787
- }
3788
- AT_LEAST_ONE8(e) {
3789
- this.atLeastOneInternal(8, e);
3790
- }
3791
- AT_LEAST_ONE9(e) {
3792
- this.atLeastOneInternal(9, e);
3793
- }
3794
- AT_LEAST_ONE_SEP(e) {
3795
- this.atLeastOneSepFirstInternal(0, e);
3796
- }
3797
- AT_LEAST_ONE_SEP1(e) {
3798
- this.atLeastOneSepFirstInternal(1, e);
3799
- }
3800
- AT_LEAST_ONE_SEP2(e) {
3801
- this.atLeastOneSepFirstInternal(2, e);
3802
- }
3803
- AT_LEAST_ONE_SEP3(e) {
3804
- this.atLeastOneSepFirstInternal(3, e);
3805
- }
3806
- AT_LEAST_ONE_SEP4(e) {
3807
- this.atLeastOneSepFirstInternal(4, e);
3808
- }
3809
- AT_LEAST_ONE_SEP5(e) {
3810
- this.atLeastOneSepFirstInternal(5, e);
3811
- }
3812
- AT_LEAST_ONE_SEP6(e) {
3813
- this.atLeastOneSepFirstInternal(6, e);
3814
- }
3815
- AT_LEAST_ONE_SEP7(e) {
3816
- this.atLeastOneSepFirstInternal(7, e);
3817
- }
3818
- AT_LEAST_ONE_SEP8(e) {
3819
- this.atLeastOneSepFirstInternal(8, e);
3820
- }
3821
- AT_LEAST_ONE_SEP9(e) {
3822
- this.atLeastOneSepFirstInternal(9, e);
3823
- }
3824
- RULE(e, t, n = rn) {
3825
- if (this.definedRulesNames.includes(e)) {
3826
- let t = {
3827
- message: X.buildDuplicateRuleNameError({
3828
- topLevelRule: e,
3829
- grammarName: this.className
3830
- }),
3831
- type: Z.DUPLICATE_RULE_NAME,
3832
- ruleName: e
3833
- };
3834
- this.definitionErrors.push(t);
3835
- }
3836
- this.definedRulesNames.push(e);
3837
- let r = this.defineRule(e, t, n);
3838
- return this[e] = r, r;
3839
- }
3840
- OVERRIDE_RULE(e, t, n = rn) {
3841
- let r = function(e, t, n) {
3842
- let r, i = [];
3843
- return t.includes(e) || (r = `Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `, i.push({
3844
- message: r,
3845
- type: Z.INVALID_RULE_OVERRIDE,
3846
- ruleName: e
3847
- })), i;
3848
- }(e, this.definedRulesNames, this.className);
3849
- this.definitionErrors = this.definitionErrors.concat(r);
3850
- let i = this.defineRule(e, t, n);
3851
- return this[e] = i, i;
3852
- }
3853
- BACKTRACK(e, t) {
3854
- let n = e.coreRule ?? e;
3855
- return function() {
3856
- this.isBackTrackingStack.push(1);
3857
- let e = this.saveRecogState();
3858
- try {
3859
- return n.apply(this, t), !0;
3860
- } catch (e) {
3861
- if (Dt(e)) return !1;
3862
- throw e;
3863
- } finally {
3864
- this.reloadRecogState(e), this.isBackTrackingStack.pop();
3865
- }
3866
- };
3867
- }
3868
- getGAstProductions() {
3869
- return this.gastProductionsCache;
3870
- }
3871
- getSerializedGastProductions() {
3872
- return Object.values(this.gastProductionsCache).map(_);
3873
- }
3874
- },
3875
- class {
3876
- initErrorHandler(e) {
3877
- this._errors = [], this.errorMessageProvider = Object.hasOwn(e, "errorMessageProvider") ? e.errorMessageProvider : $.errorMessageProvider;
3878
- }
3879
- SAVE_ERROR(e) {
3880
- if (Dt(e)) return e.context = {
3881
- ruleStack: this.getHumanReadableRuleStack(),
3882
- ruleOccurrenceStack: this.RULE_OCCURRENCE_STACK.slice(0, this.RULE_OCCURRENCE_STACK_IDX + 1)
3883
- }, this._errors.push(e), e;
3884
- throw Error("Trying to save an Error which is not a RecognitionException");
3885
- }
3886
- get errors() {
3887
- return [...this._errors];
3888
- }
3889
- set errors(e) {
3890
- this._errors = e;
3891
- }
3892
- raiseEarlyExitException(e, t, n) {
3893
- let r = this.getCurrRuleFullName(), i = ft(e, this.getGAstProductions()[r], t, this.maxLookahead)[0], a = [];
3894
- for (let e = 1; e <= this.maxLookahead; e++) a.push(this.LA(e));
3895
- let o = this.errorMessageProvider.buildEarlyExitMessage({
3896
- expectedIterationPaths: i,
3897
- actual: a,
3898
- previous: this.LA(0),
3899
- customUserDescription: n,
3900
- ruleName: r
3901
- });
3902
- throw this.SAVE_ERROR(new Mt(o, this.LA(1), this.LA(0)));
3903
- }
3904
- raiseNoAltException(e, t) {
3905
- let n = this.getCurrRuleFullName(), r = dt(e, this.getGAstProductions()[n], this.maxLookahead), i = [];
3906
- for (let e = 1; e <= this.maxLookahead; e++) i.push(this.LA(e));
3907
- let a = this.LA(0), o = this.errorMessageProvider.buildNoViableAltMessage({
3908
- expectedPathsPerAlt: r,
3909
- actual: i,
3910
- previous: a,
3911
- customUserDescription: t,
3912
- ruleName: this.getCurrRuleFullName()
3913
- });
3914
- throw this.SAVE_ERROR(new At(o, this.LA(1), a));
3915
- }
3916
- },
3917
- class {
3918
- initGastRecorder(e) {
3919
- this.recordingProdStack = [], this.RECORDING_PHASE = !1;
3920
- }
3921
- enableRecording() {
3922
- this.RECORDING_PHASE = !0, this.TRACE_INIT("Enable Recording", () => {
3923
- for (let e = 0; e < 10; e++) {
3924
- let t = e > 0 ? e : "";
3925
- this[`CONSUME${t}`] = function(t, n) {
3926
- return this.consumeInternalRecord(t, e, n);
3927
- }, this[`SUBRULE${t}`] = function(t, n) {
3928
- return this.subruleInternalRecord(t, e, n);
3929
- }, this[`OPTION${t}`] = function(t) {
3930
- return this.optionInternalRecord(t, e);
3931
- }, this[`OR${t}`] = function(t) {
3932
- return this.orInternalRecord(t, e);
3933
- }, this[`MANY${t}`] = function(t) {
3934
- this.manyInternalRecord(e, t);
3935
- }, this[`MANY_SEP${t}`] = function(t) {
3936
- this.manySepFirstInternalRecord(e, t);
3937
- }, this[`AT_LEAST_ONE${t}`] = function(t) {
3938
- this.atLeastOneInternalRecord(e, t);
3939
- }, this[`AT_LEAST_ONE_SEP${t}`] = function(t) {
3940
- this.atLeastOneSepFirstInternalRecord(e, t);
3941
- };
3942
- }
3943
- this.consume = function(e, t, n) {
3944
- return this.consumeInternalRecord(t, e, n);
3945
- }, this.subrule = function(e, t, n) {
3946
- return this.subruleInternalRecord(t, e, n);
3947
- }, this.option = function(e, t) {
3948
- return this.optionInternalRecord(t, e);
3949
- }, this.or = function(e, t) {
3950
- return this.orInternalRecord(t, e);
3951
- }, this.many = function(e, t) {
3952
- this.manyInternalRecord(e, t);
3953
- }, this.atLeastOne = function(e, t) {
3954
- this.atLeastOneInternalRecord(e, t);
3955
- }, this.ACTION = this.ACTION_RECORD, this.BACKTRACK = this.BACKTRACK_RECORD, this.LA = this.LA_RECORD;
3956
- });
3957
- }
3958
- disableRecording() {
3959
- this.RECORDING_PHASE = !1, this.TRACE_INIT("Deleting Recording methods", () => {
3960
- let e = this;
3961
- for (let t = 0; t < 10; t++) {
3962
- let n = t > 0 ? t : "";
3963
- delete e[`CONSUME${n}`], delete e[`SUBRULE${n}`], delete e[`OPTION${n}`], delete e[`OR${n}`], delete e[`MANY${n}`], delete e[`MANY_SEP${n}`], delete e[`AT_LEAST_ONE${n}`], delete e[`AT_LEAST_ONE_SEP${n}`];
3964
- }
3965
- delete e.consume, delete e.subrule, delete e.option, delete e.or, delete e.many, delete e.atLeastOne, delete e.ACTION, delete e.BACKTRACK, delete e.LA;
3966
- });
3967
- }
3968
- ACTION_RECORD(e) {}
3969
- BACKTRACK_RECORD(e, t) {
3970
- return () => !0;
3971
- }
3972
- LA_RECORD(e) {
3973
- return Q;
3974
- }
3975
- topLevelRuleRecord(e, t) {
3976
- try {
3977
- let n = new c({
3978
- definition: [],
3979
- name: e
3980
- });
3981
- return n.name = e, this.recordingProdStack.push(n), t.call(this), this.recordingProdStack.pop(), n;
3982
- } catch (e) {
3983
- if (!0 !== e.KNOWN_RECORDER_ERROR) try {
3984
- e.message += "\n This error was thrown during the \"grammar recording phase\" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording";
3985
- } catch {
3986
- throw e;
3987
- }
3988
- throw e;
3989
- }
3990
- }
3991
- optionInternalRecord(e, t) {
3992
- return Qt.call(this, u, e, t);
3993
- }
3994
- atLeastOneInternalRecord(e, t) {
3995
- Qt.call(this, d, t, e);
3996
- }
3997
- atLeastOneSepFirstInternalRecord(e, t) {
3998
- Qt.call(this, f, t, e, Jt);
3999
- }
4000
- manyInternalRecord(e, t) {
4001
- Qt.call(this, p, t, e);
4002
- }
4003
- manySepFirstInternalRecord(e, t) {
4004
- Qt.call(this, m, t, e, Jt);
4005
- }
4006
- orInternalRecord(e, t) {
4007
- return $t.call(this, e, t);
4008
- }
4009
- subruleInternalRecord(e, t, n) {
4010
- if (tn(t), !e || !Object.hasOwn(e, "ruleName")) {
4011
- let n = Error(`<SUBRULE${en(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
4012
- throw n.KNOWN_RECORDER_ERROR = !0, n;
4013
- }
4014
- let r = this.recordingProdStack.at(-1), i = e.ruleName, a = new s({
4015
- idx: t,
4016
- nonTerminalName: i,
4017
- label: n?.LABEL,
4018
- referencedRule: void 0
4019
- });
4020
- return r.definition.push(a), this.outputCst ? Zt : qt;
4021
- }
4022
- consumeInternalRecord(e, t, n) {
4023
- if (tn(t), !ke(e)) {
4024
- let n = Error(`<CONSUME${en(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
4025
- throw n.KNOWN_RECORDER_ERROR = !0, n;
4026
- }
4027
- let r = this.recordingProdStack.at(-1), i = new g({
4028
- idx: t,
4029
- terminalType: e,
4030
- label: n?.LABEL
4031
- });
4032
- return r.definition.push(i), Xt;
4033
- }
4034
- },
4035
- class {
4036
- initPerformanceTracer(e) {
4037
- if (Object.hasOwn(e, "traceInitPerf")) {
4038
- let t = e.traceInitPerf, n = typeof t == "number";
4039
- this.traceInitMaxIdent = n ? t : Infinity, this.traceInitPerf = n ? t > 0 : t;
4040
- } else this.traceInitMaxIdent = 0, this.traceInitPerf = $.traceInitPerf;
4041
- this.traceInitIndent = -1;
4042
- }
4043
- TRACE_INIT(e, t) {
4044
- if (!0 === this.traceInitPerf) {
4045
- this.traceInitIndent++;
4046
- let n = Array(this.traceInitIndent + 1).join(" ");
4047
- this.traceInitIndent < this.traceInitMaxIdent && console.log(`${n}--\x3e <${e}>`);
4048
- let { time: r, value: a } = i(t), o = r > 10 ? console.warn : console.log;
4049
- return this.traceInitIndent < this.traceInitMaxIdent && o(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, a;
4050
- }
4051
- return t();
4052
- }
4053
- }
4054
- ].forEach((e) => {
4055
- let t = e.prototype;
4056
- Object.getOwnPropertyNames(t).forEach((n) => {
4057
- if (n === "constructor") return;
4058
- let r = Object.getOwnPropertyDescriptor(t, n);
4059
- r && (r.get || r.set) ? Object.defineProperty(nn.prototype, n, r) : nn.prototype[n] = e.prototype[n];
4060
- });
4061
- });
4062
- var on = class extends an {
4063
- constructor(e, t = $) {
4064
- let n = Object.assign({}, t);
4065
- n.outputCst = !1, super(e, n);
4066
- }
4067
- }, sn = class n {
4068
- static shared(e) {
4069
- let r = e?.locale ?? t, i = e?.maxColumn ?? dn, a = e?.maxRow ?? fn, o = un.get(r);
4070
- o || (o = /* @__PURE__ */ new Map(), un.set(r, o));
4071
- let s = `${i}:${a}`, c = o.get(s);
4072
- return c || (c = new n({
4073
- locale: r,
4074
- maxColumn: i,
4075
- maxRow: a
4076
- }), o.set(s, c)), c;
4077
- }
4078
- constructor(e) {
4079
- let n = e?.maxColumn ?? dn, r = e?.maxRow ?? fn, i = e?.locale ?? t;
4080
- this._locale = i, this._maxColumn = n, this._maxRow = r;
4081
- let { separatorFunction: a, separatorColumn: o, separatorRow: s, separatorDecimal: c } = i.separators;
4082
- if (o === s) throw Error(`FormulaLexer: separatorColumn and separatorRow must differ (both '${o}')`);
4083
- let l = q({
4084
- name: "WhiteSpace",
4085
- pattern: /\s+/,
4086
- group: K.SKIPPED
4087
- }), u = q({
4088
- name: "StringToken",
4089
- pattern: /"(""|[^"])*"/
4090
- }), d = q({
4091
- name: "FunctionToken",
4092
- pattern: /[a-zA-Z_\u007F-\uFFFF]+[a-zA-Z0-9_.\u007F-\uFFFF]*(?=\()/
4093
- }), f = q({
4094
- name: "TableReference",
4095
- pattern: { exec: gn },
4096
- line_breaks: !1,
4097
- start_chars_hint: ln
4098
- }), p = q({
4099
- name: "BracketedString",
4100
- pattern: { exec: vn },
4101
- line_breaks: !1,
4102
- start_chars_hint: [91],
4103
- longer_alt: [f, u]
4104
- }), m = (e) => (e ?? []).map((e) => e?.trim()).filter(Boolean).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).map((e) => e + "|").join(""), h = q({
4105
- name: "LiteralError",
4106
- pattern: RegExp(m(i.errorLiterals) + "#PARSE!|#NULL!|#DIV\\/0!|#VALUE!|#NUM!|#FIELD!|#N\\/A|#GETTING_DATA|#SPILL!|#CONNECT!|#BLOCKED!|#UNKNOWN!|#CALC!|#BUSY!|#PYTHON!|#TIMEOUT!")
4107
- }), g = q({
4108
- name: "RefError",
4109
- pattern: RegExp(m(i.errorRefs) + "#REF!|#NAME\\?")
4110
- }), _ = q({
4111
- name: "SingleQuotedString",
4112
- pattern: /'(''|[^'])*'/
4113
- }), v = q({
4114
- name: "SheetQuoted",
4115
- pattern: /'(?:''|[^'])*?'!/
4116
- }), y = q({
4117
- name: "Sheet",
4118
- pattern: /[A-Za-z_.\d\u007F-\uFFFF]*!/
4119
- }), b = /[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y, x = q({
4120
- name: "NamedToken",
4121
- pattern: { exec: (e, t) => {
4122
- b.lastIndex = t;
4123
- let n = b.exec(e);
4124
- if (!n) return null;
4125
- let r = n[0], i = r.indexOf(".:");
4126
- return i === -1 ? r.endsWith(":") && (r = r.slice(0, -1)) : r = r.substring(0, i), [r];
4127
- } },
4128
- line_breaks: !1,
4129
- start_chars_hint: ln
4130
- }), S = q({
4131
- name: "Cell",
4132
- pattern: { exec: hn(n, r) },
4133
- line_breaks: !1,
4134
- start_chars_hint: [36, ...cn],
4135
- longer_alt: x
4136
- }), C = q({
4137
- name: "Column",
4138
- pattern: { exec: mn(n) },
4139
- line_breaks: !1,
4140
- start_chars_hint: [36, ...cn],
4141
- longer_alt: x
4142
- }), w = q({
4143
- name: "AbsRow",
4144
- pattern: /[$][0-9]+/
4145
- }), T = c === "." ? "\\." : c, E = q({
4146
- name: "NumberToken",
4147
- 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]+`)
4148
- }), D = q({
4149
- name: "ScientificDigit",
4150
- pattern: /[0-9]+\*\*[+-]?[0-9]+/
4151
- }), O = q({
4152
- name: "DigitToken",
4153
- pattern: /[0-9]+/
4154
- }), k = ["TRUE", "FALSE"];
4155
- for (let e of [i.booleanTrue, i.booleanFalse]) {
4156
- let t = e?.trim();
4157
- t && !k.some((e) => e.toLowerCase() === t.toLowerCase()) && k.push(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
4158
- }
4159
- let A = q({
4160
- name: "BooleanToken",
4161
- pattern: new RegExp(k.join("|"), "i")
4162
- }), j = q({
4163
- name: "ArgSeparator",
4164
- pattern: _n(a)
4165
- }), M = q({
4166
- name: "ColSeparator",
4167
- pattern: _n(o)
4168
- }), N = q({
4169
- name: "RowSeparator",
4170
- pattern: _n(s)
4171
- }), P = q({
4172
- name: "RangeOp",
4173
- pattern: /:/
4174
- }), F = q({
4175
- name: "RangeTrimFullOp",
4176
- pattern: /\.:\./
4177
- }), ee = q({
4178
- name: "RangeTrimLeadingOp",
4179
- pattern: /\.:/
4180
- }), I = q({
4181
- name: "RangeTrimTrailingOp",
4182
- pattern: /:\./
4183
- }), te = q({
4184
- name: "OpenParen",
4185
- pattern: /\(/
4186
- }), L = q({
4187
- name: "CloseParen",
4188
- pattern: /\)/
4189
- }), R = q({
4190
- name: "OpenCurlyParen",
4191
- pattern: /{/
4192
- }), ne = q({
4193
- name: "CloseCurlyParen",
4194
- pattern: /}/
4195
- }), z = q({
4196
- name: "QuoteS",
4197
- pattern: /'/
4198
- }), re = q({
4199
- name: "MulOp",
4200
- pattern: /\*(?!\*)/
4201
- }), ie = q({
4202
- name: "PlusOp",
4203
- pattern: /\+/
4204
- }), ae = q({
4205
- name: "DivOp",
4206
- pattern: /\//
4207
- }), oe = q({
4208
- name: "MinOp",
4209
- pattern: /-/
4210
- }), se = q({
4211
- name: "ImplicitIntersectOp",
4212
- pattern: /@/
4213
- }), ce = q({
4214
- name: "ConcatOp",
4215
- pattern: /&/
4216
- }), le = q({
4217
- name: "ExOp",
4218
- pattern: /\^/
4219
- }), ue = q({
4220
- name: "PercentOp",
4221
- pattern: /%/
4222
- }), de = q({
4223
- name: "ArrayAnchorOp",
4224
- pattern: /#/,
4225
- longer_alt: [h, g]
4226
- }), B = q({
4227
- name: "GtOp",
4228
- pattern: />/
4229
- }), fe = q({
4230
- name: "EqOp",
4231
- pattern: /=/
4232
- }), pe = q({
4233
- name: "LtOp",
4234
- pattern: /</
4235
- }), me = [
4236
- l,
4237
- u,
4238
- v,
4239
- _,
4240
- y,
4241
- d,
4242
- f,
4243
- p,
4244
- h,
4245
- g,
4246
- j,
4247
- ...o === a ? [] : [M],
4248
- N,
4249
- F,
4250
- ee,
4251
- I,
4252
- P,
4253
- S,
4254
- A,
4255
- C,
4256
- w,
4257
- E,
4258
- D,
4259
- O,
4260
- de,
4261
- se,
4262
- x,
4263
- te,
4264
- L,
4265
- R,
4266
- ne,
4267
- z,
4268
- re,
4269
- ie,
4270
- ae,
4271
- oe,
4272
- ce,
4273
- le,
4274
- ue,
4275
- q({
4276
- name: "NeqOp",
4277
- pattern: /<>/
4278
- }),
4279
- q({
4280
- name: "GteOp",
4281
- pattern: />=/
4282
- }),
4283
- q({
4284
- name: "LteOp",
4285
- pattern: /<=/
4286
- }),
4287
- B,
4288
- fe,
4289
- pe
4290
- ];
4291
- this._lexer = new K(me, { ensureOptimizations: !0 });
4292
- let he = {};
4293
- me.forEach((e) => {
4294
- he[e.name] = e;
4295
- }), o === a && (he.ColSeparator = j), this._vocabulary = he;
4296
- }
4297
- tokenize(t, n = !0) {
4298
- let r = this._lexer.tokenize(t);
4299
- if (n && r.errors.length > 0) {
4300
- let n = r.errors[0], i = n.line, a = n.column, o = t.substr(n.offset, n.length || 1), s = o ? `Unexpected character '${o}'` : n.message;
4301
- throw new e.Parse(s, {
4302
- line: i,
4303
- column: a,
4304
- offset: n.offset,
4305
- length: n.length
4306
- });
4307
- }
4308
- return r;
4309
- }
4310
- getVocabulary() {
4311
- return this._vocabulary;
4312
- }
4313
- getLocale() {
4314
- return this._locale;
4315
- }
4316
- getMaxColumn() {
4317
- return this._maxColumn;
4318
- }
4319
- getMaxRow() {
4320
- return this._maxRow;
4321
- }
4322
- getSeparators() {
4323
- return this._locale.separators;
4324
- }
4325
- }, cn = (() => {
4326
- let e = [];
4327
- for (let t = 65; t <= 90; t++) e.push(t);
4328
- for (let t = 97; t <= 122; t++) e.push(t);
4329
- for (let t = 48; t <= 57; t++) e.push(t);
4330
- return e;
4331
- })().filter((e) => e < 48 || e > 57), ln = (() => {
4332
- let e = [
4333
- ...cn,
4334
- 95,
4335
- 92
4336
- ];
4337
- for (let t = 127; t <= 65535; t++) e.push(t);
4338
- return e;
4339
- })(), un = /* @__PURE__ */ new WeakMap(), dn = 16384, fn = 1048576;
4340
- function pn(e, t, n) {
4341
- let r = 0;
4342
- for (let i = t; i < n; i++) {
4343
- let t = e.charCodeAt(i);
4344
- r = 26 * r + (t >= 97 ? t - 96 : t - 64);
4345
- }
4346
- return r;
4347
- }
4348
- function mn(e) {
4349
- return (t, n) => {
4350
- let r = n;
4351
- t.charCodeAt(r) === 36 && r++;
4352
- let i = r;
4353
- for (; r < t.length && r - i < 3;) {
4354
- let e = t.charCodeAt(r);
4355
- if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122)) break;
4356
- r++;
4357
- }
4358
- if (r - i === 0 || pn(t, i, r) > e) return null;
4359
- if (r < t.length) {
4360
- let e = t.charCodeAt(r);
4361
- if (e >= 48 && e <= 57) return null;
4362
- }
4363
- return [t.substring(n, r)];
4364
- };
4365
- }
4366
- function hn(e, t) {
4367
- return (n, r) => {
4368
- let i = r;
4369
- n.charCodeAt(i) === 36 && i++;
4370
- let a = i;
4371
- for (; i < n.length && i - a < 3;) {
4372
- let e = n.charCodeAt(i);
4373
- if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122)) break;
4374
- i++;
4375
- }
4376
- if (i - a === 0 || pn(n, a, i) > e) return null;
4377
- i < n.length && n.charCodeAt(i) === 36 && i++;
4378
- let o = i;
4379
- if (i >= n.length) return null;
4380
- let s = n.charCodeAt(i);
4381
- if (s < 49 || s > 57) return null;
4382
- for (i++; i < n.length;) {
4383
- let e = n.charCodeAt(i);
4384
- if (!(e >= 48 && e <= 57)) break;
4385
- i++;
4386
- }
4387
- return parseInt(n.substring(o, i), 10) > t ? null : [n.substring(r, i)];
4388
- };
4389
- }
4390
- function gn(e, t) {
4391
- let n = e.charCodeAt(t);
4392
- if (!(n >= 65 && n <= 90 || n >= 97 && n <= 122 || n === 95 || n >= 127 && n <= 65535)) return null;
4393
- let r = t + 1;
4394
- for (; r < e.length;) {
4395
- let t = e.charCodeAt(r);
4396
- if (!(t >= 65 && t <= 90 || t >= 97 && t <= 122 || t >= 48 && t <= 57 || t === 95 || t === 46 || t >= 127 && t <= 65535)) break;
4397
- r++;
4398
- }
4399
- if (r >= e.length || e.charCodeAt(r) !== 91) return null;
4400
- let i = 0;
4401
- for (; r < e.length;) {
4402
- let n = e.charCodeAt(r);
4403
- if (n === 91) i++;
4404
- else if (n === 93 && (i--, i === 0)) return [e.substring(t, r + 1)];
4405
- r++;
4406
- }
4407
- return null;
4408
- }
4409
- function _n(e) {
4410
- return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
4411
- }
4412
- function vn(e, t) {
4413
- if (e.charCodeAt(t) !== 91) return null;
4414
- let n = 0, r = t;
4415
- for (; r < e.length;) {
4416
- let i = e.charCodeAt(r);
4417
- if (i === 91) n++;
4418
- else if (i === 93 && (n--, n === 0)) return [e.substring(t, r + 1)];
4419
- r++;
4420
- }
4421
- return null;
4422
- }
4423
- export { J as a, on as i, K as n, We as o, sn as r, q as t };