@sheetxl/studio-vanilla 0.4.13 → 0.4.15

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 (313) hide show
  1. package/README.md +2 -2
  2. package/browser/cjs/0wJgZUT7DgId9Xtu.cjs +11 -0
  3. package/browser/cjs/3oobHi8j_DGW35rC.cjs +124 -0
  4. package/browser/cjs/6DwFSFOve5d5Kh4O.cjs +6 -0
  5. package/browser/cjs/ArJueN3Q9EFBG6tK.cjs +6 -0
  6. package/browser/cjs/BFZbsyTO3uhLJbLO.cjs +6 -0
  7. package/browser/cjs/BG0zKZBHarIk0gKB.cjs +145 -0
  8. package/browser/cjs/BH_qrKPpuqL9YxGP.cjs +15 -0
  9. package/browser/cjs/BJu8UGaYuFmjvmwl.cjs +6 -0
  10. package/browser/cjs/BKIvZi8Z5lHc2S32.cjs +7 -0
  11. package/browser/cjs/BSJTx60VBwf450vd.cjs +6 -0
  12. package/browser/cjs/BUWv6Ysw6pYG7w7W.cjs +7 -0
  13. package/browser/cjs/BVHaNjM0-FXL7gyh.cjs +6 -0
  14. package/browser/cjs/BcHEeTMPgurSZ2Kh.cjs +6 -0
  15. package/browser/cjs/BdnGDChdub9m1gbK.cjs +6 -0
  16. package/browser/cjs/Bf0HoYuEDFO9Gwdv.cjs +12 -0
  17. package/browser/cjs/BgHBftj6ugXjpyaF.cjs +6 -0
  18. package/browser/cjs/BgsgGbpzcl7wg2IO.cjs +6 -0
  19. package/browser/cjs/BsCdHkza2KUgNs3F.cjs +6 -0
  20. package/browser/cjs/BzRfETjQwEEJfpgZ.cjs +6 -0
  21. package/browser/cjs/BzhfyRZdk-oiyEa3.cjs +6 -0
  22. package/browser/cjs/C8BQmea-gRcTEaYH.cjs +6 -0
  23. package/browser/cjs/CA0OjW0AOuGEjxZ2.cjs +6 -0
  24. package/browser/cjs/CRe-vd2WZQabNDDS.cjs +6 -0
  25. package/browser/cjs/CRe8klqBNVDkSDEr.cjs +13 -0
  26. package/browser/cjs/CXn4J7ISlTV_SfvZ.cjs +6 -0
  27. package/browser/cjs/Ck8K0c7E5RT8WMbO.cjs +15 -0
  28. package/browser/cjs/ClXfvzbTzK5w-Tv9.cjs +6 -0
  29. package/browser/cjs/CnDLmICwEpdeYECg.cjs +32 -0
  30. package/browser/cjs/CqILFqDohV7CdFQ1.cjs +6 -0
  31. package/browser/cjs/CqugZolY4J8viegd.cjs +6 -0
  32. package/browser/cjs/CrnvoFSZfgmBlK86.cjs +42 -0
  33. package/browser/cjs/Ct0fgg-1dB-T7u7T.cjs +161 -0
  34. package/browser/cjs/CtLA5mrQxGamDt92.cjs +6 -0
  35. package/browser/cjs/D4582BA0aCqJ_PrJ.cjs +6 -0
  36. package/browser/cjs/D74hXHJrfnGhbNBg.cjs +6 -0
  37. package/browser/cjs/DAGEOiTL4sCagK3p.cjs +6 -0
  38. package/browser/cjs/DAxpZHSeQ9vUP1m6.cjs +14 -0
  39. package/browser/cjs/DDbNLc2mUv7Q6msK.cjs +11 -0
  40. package/browser/cjs/DWh6QtlFsPfZ3Asz.cjs +1501 -0
  41. package/browser/cjs/DY1iEDz8BWZpqFOo.cjs +16 -0
  42. package/browser/cjs/D_RVszeEK0DfF-EN.cjs +6 -0
  43. package/browser/cjs/Dg9yKaBrYK9w4cQO.cjs +19 -0
  44. package/browser/cjs/DgFtbCf8dkncAq_r.cjs +6 -0
  45. package/browser/cjs/DotFGD_QKvqoQlAL.cjs +6 -0
  46. package/browser/cjs/DrRRwzZUlGvA6cQT.cjs +6 -0
  47. package/browser/cjs/DtQ-sP4vg1IpzFkc.cjs +6 -0
  48. package/browser/cjs/EIY0bt22HqBjrvRt.cjs +6 -0
  49. package/browser/cjs/TAIJH4y6CbXhFnhx.cjs +364 -0
  50. package/browser/cjs/YTXgMiobveLIPF9T.cjs +6 -0
  51. package/browser/cjs/_OSzgfBNK1m22Jek.cjs +6 -0
  52. package/browser/cjs/fjQ9vPUSGRU1VSoH.cjs +6 -0
  53. package/browser/cjs/gI7uI_k_jVDAtJup.cjs +6 -0
  54. package/browser/cjs/index.cjs +3 -4
  55. package/browser/cjs/mW3Ya0GEjpmsa_YK.cjs +6 -0
  56. package/browser/cjs/qB-lxZgY2Iz9Bc6T.cjs +7 -0
  57. package/browser/cjs/sXSha5rBK3lo_tOD.cjs +6 -0
  58. package/browser/cjs/uryrVY1PPsKlOzso.cjs +6 -0
  59. package/browser/cjs/vce4VfmWFd9ClUSo.cjs +6 -0
  60. package/{cdn/assets/KDGtuIzSpkf1vsmH.js → browser/esm/5RdhqzgwkuR2ox0E.mjs} +1 -1
  61. package/{cdn/assets/B1Iys8a964LGNZKf.js → browser/esm/B9vAqNVLp_vCTrP_.mjs} +1 -1
  62. package/{cdn/assets/CsorxCiOoe7qX9j1.js → browser/esm/BFYBuTXa6xa5ZjBo.mjs} +1 -1
  63. package/{cdn/assets/B2RAJJJFkcaWUfUW.js → browser/esm/BNuTKa0cEC3F4rTF.mjs} +1 -1
  64. package/{cdn/assets/C4vStn7wNlvrxdsp.js → browser/esm/BPDWQKVFxO_3IqZX.mjs} +1 -1
  65. package/{cdn/assets/BMiA9p1uOrwnooVT.js → browser/esm/BUAQRxezxaeHUbwe.mjs} +1 -1
  66. package/{cdn/assets/CT0d1P-Aav62lUvV.js → browser/esm/BXhoPHXmFqGJhEOT.mjs} +1 -1
  67. package/browser/esm/B_JJ8lAbaPdlt8l4.mjs +29 -0
  68. package/{cdn/assets/F6zW9Vj410C4yRVG.js → browser/esm/B_YrH7VnXiUkYu8u.mjs} +167 -166
  69. package/browser/esm/Beqd_eZheAqcy9eR.mjs +49911 -0
  70. package/{cdn/assets/BL6TUDSeou6wPejW.js → browser/esm/Bh6dC8KTHWpKMi09.mjs} +1 -1
  71. package/browser/esm/BmkIbFYjQZnaZGzF.mjs +13208 -0
  72. package/{cdn/assets/CrLrvmlJhYpNpXqR.js → browser/esm/Bp2dkgUm5zsuNnPH.mjs} +1 -1
  73. package/{cdn/assets/DD3csu4pddGtMp3n.js → browser/esm/Bpujg7eS-yYzfXnQ.mjs} +537 -539
  74. package/{cdn/assets/D-5VYBO5_VEh6fEW.js → browser/esm/BqmualWSYd-czqNW.mjs} +1 -1
  75. package/{cdn/assets/5XdpCWQ6AcxZ6oY1.js → browser/esm/Bt1LjWrzTz3VQP5i.mjs} +1 -1
  76. package/{cdn/assets/CKA4s2hlzSnrdWSD.js → browser/esm/BwEUAuMX1MAp6TLB.mjs} +1 -1
  77. package/browser/esm/BxForeOFuQExxhBo.mjs +3755 -0
  78. package/{cdn/assets/BDE7FUo2oiivrvBL.js → browser/esm/C0KLnjyGhfqKP-3J.mjs} +16 -18
  79. package/{cdn/assets/C-Z8wvIy20kJ7R-k.js → browser/esm/C2DVh9PCXymQ6Bku.mjs} +1 -1
  80. package/{cdn/assets/DHydjLSnijEgtpyU.js → browser/esm/C5Vhk6RekNjP_kzl.mjs} +1 -1
  81. package/{cdn/assets/DXHirQMr483hJBil.js → browser/esm/CMgjnCC7huqsMZ7l.mjs} +12 -14
  82. package/{cdn/assets/BwpBFv8Ks2ka07ch.js → browser/esm/CQMGhCDKbq2op_BI.mjs} +1 -1
  83. package/browser/esm/CQoo-4sVCrOfP9iU.mjs +1365 -0
  84. package/browser/esm/CSSayGD6fTeehKt_.mjs +1575 -0
  85. package/browser/esm/CTEiaS8NJUMozWzX.mjs +6800 -0
  86. package/{cdn/assets/DXtbonLk2ESfF4Dh.js → browser/esm/CWSZwGuenxmHgLXd.mjs} +1 -1
  87. package/{cdn/assets/DvFNLgeMJ9LdQROu.js → browser/esm/Cb1Q2phpEESgs7mi.mjs} +26 -28
  88. package/browser/esm/CeDuz_yZT4XG-Pv8.mjs +47 -0
  89. package/browser/esm/CfMo1fAExeFOibAQ.mjs +39 -0
  90. package/{cdn/assets/f3_QXO8z0p-q4nJo.js → browser/esm/ClLJBQr4mG8VGyC3.mjs} +12 -12
  91. package/{cdn/assets/BUwNyHytF9St68tJ.js → browser/esm/CnwSRSKNfq2GyXas.mjs} +1 -1
  92. package/browser/esm/CqRDFmwJualsG-hJ.mjs +1346 -0
  93. package/{cdn/assets/BxblmHGC7YxZcuak.js → browser/esm/CslDdQ92RlF9XCcF.mjs} +1 -1
  94. package/{cdn/assets/BBJxLS-wB_nXRnI2.js → browser/esm/CvTxaj5stKRFGegY.mjs} +1 -1
  95. package/browser/esm/D14VyfRK6-WOMJJO.mjs +1665 -0
  96. package/browser/esm/D9ftd36uosOvK1Bz.mjs +44 -0
  97. package/browser/esm/DAM-CuXQIzcQS8y2.mjs +820 -0
  98. package/browser/esm/DQiTAq0r1q5Z_7H6.mjs +84 -0
  99. package/browser/esm/DRoKqCpNKKdYKqZ3.mjs +3937 -0
  100. package/browser/esm/DSBeC26EhsTkKu9_.mjs +1702 -0
  101. package/{cdn/assets/N3pWBoccPrTedAw-.js → browser/esm/DT0kcrmyi0GrASFM.mjs} +1 -1
  102. package/{cdn/assets/CuNqTH3P8mCglRiz.js → browser/esm/DVAgkqy1aZdEMIzM.mjs} +1 -1
  103. package/browser/esm/DVqoG8OFm93ndK8u.mjs +21 -0
  104. package/browser/esm/DdcqO--nszyX8nqj.mjs +20 -0
  105. package/{cdn/assets/9-cIcj6CRJx5HTn9.js → browser/esm/DmSh4h3LBSgZNzzF.mjs} +1 -1
  106. package/{cdn/assets/C3EFzvmp0DcC_HAx.js → browser/esm/Do7w66ZbyFAW-Kvo.mjs} +1 -1
  107. package/{cdn/assets/BciokME96sykArSM.js → browser/esm/DrVjmz0t2Y2eHDvu.mjs} +1 -1
  108. package/{cdn/assets/2mxiQm6dELsqQoX7.js → browser/esm/Dre4qd4kiDqAnEpH.mjs} +1370 -1412
  109. package/browser/esm/DxOr3qEZVibn2HK7.mjs +421 -0
  110. package/{cdn/assets/C5q0qaKi2eeDgoO8.js → browser/esm/IWZ_bebXCJeQz19V.mjs} +1 -1
  111. package/{cdn/assets/XysyS9rk9tFdbzZh.js → browser/esm/YEeWnRTVhFsSnEoO.mjs} +501 -510
  112. package/browser/esm/ZciEgxXQYsHyV2gO.mjs +633 -0
  113. package/{cdn/assets/DFHruAftzuzBZ71r.js → browser/esm/azuJCFiVoU4Ebb9P.mjs} +65 -68
  114. package/browser/esm/iXnpVI-bOFX7L6z-.mjs +2344 -0
  115. package/browser/esm/index.mjs +6 -2
  116. package/browser/esm/n6RMMH6ZZaYET-uv.mjs +48 -0
  117. package/browser/esm/u8MA5qQcSH-VSLrB.mjs +472 -0
  118. package/cdn/assets/5RdhqzgwkuR2ox0E.js +10 -0
  119. package/cdn/assets/B9vAqNVLp_vCTrP_.js +10 -0
  120. package/cdn/assets/BAARsakyOFrwNKVu.js +1466 -0
  121. package/cdn/assets/BCMTnGKJGZCOn8RP.js +84 -0
  122. package/cdn/assets/BFYBuTXa6xa5ZjBo.js +10 -0
  123. package/cdn/assets/BNuTKa0cEC3F4rTF.js +21 -0
  124. package/cdn/assets/BPDWQKVFxO_3IqZX.js +10 -0
  125. package/cdn/assets/BUAQRxezxaeHUbwe.js +10 -0
  126. package/cdn/assets/BXhoPHXmFqGJhEOT.js +10 -0
  127. package/cdn/assets/Bh6dC8KTHWpKMi09.js +10 -0
  128. package/cdn/assets/BmkIbFYjQZnaZGzF.js +13208 -0
  129. package/cdn/assets/Bp2dkgUm5zsuNnPH.js +10 -0
  130. package/cdn/assets/BqmualWSYd-czqNW.js +24 -0
  131. package/cdn/assets/BsNGXIjB2gB75oDq.js +46 -0
  132. package/cdn/assets/Bt1LjWrzTz3VQP5i.js +10 -0
  133. package/cdn/assets/BwEUAuMX1MAp6TLB.js +10 -0
  134. package/cdn/assets/{0j_nQmV1Bb0lJ6sB.js → ByGApkjEdqWJCmIL.js} +4 -4
  135. package/cdn/assets/C2DVh9PCXymQ6Bku.js +10 -0
  136. package/cdn/assets/C4PvQzHOWYFQIrTT.js +22 -0
  137. package/cdn/assets/{quOP5QFyTT9soNIl.js → C5Vhk6RekNjP_kzl.js} +3 -5
  138. package/cdn/assets/{Xwyp21e7L5fTeb_y.js → C82_3AL3p2OPqUES.js} +186 -184
  139. package/cdn/assets/C8ZVHIXuFCsMz4su.js +3756 -0
  140. package/cdn/assets/CP0YRrUyk_DwRGye.js +46 -0
  141. package/cdn/assets/CQMGhCDKbq2op_BI.js +10 -0
  142. package/cdn/assets/CQ_eXYB8jRiWFzL8.js +149 -0
  143. package/cdn/assets/CQoo-4sVCrOfP9iU.js +1365 -0
  144. package/cdn/assets/CVtFEjbMohoQQwVa.js +2346 -0
  145. package/cdn/assets/CWSZwGuenxmHgLXd.js +10 -0
  146. package/cdn/assets/{BgnlshX157Ob6RLs.js → ChzKnwtP8tCXlyQC.js} +5 -5
  147. package/cdn/assets/ClwsvKMIARY6eKe8.js +43 -0
  148. package/cdn/assets/CnwSRSKNfq2GyXas.js +10 -0
  149. package/cdn/assets/CqRDFmwJualsG-hJ.js +1346 -0
  150. package/cdn/assets/CsV6TK9KYwaT40Nd.js +2177 -0
  151. package/cdn/assets/CslDdQ92RlF9XCcF.js +10 -0
  152. package/cdn/assets/CvTxaj5stKRFGegY.js +10 -0
  153. package/cdn/assets/{C9eQW5GKgPRmKKgJ.js → CxPN10OK3cql47vK.js} +2 -2
  154. package/cdn/assets/D14VyfRK6-WOMJJO.js +1665 -0
  155. package/cdn/assets/D3wy0hvPKjYlTqDZ.js +390 -0
  156. package/cdn/assets/D4UoNdvz3kZD9Fg7.js +3937 -0
  157. package/cdn/assets/{Gz4u4ewyWfB-Pf-a.js → D8Eij5qtEH8tI7eL.js} +4 -5
  158. package/cdn/assets/DPpga_z_sz7WeoGk.js +49739 -0
  159. package/{browser/esm/CVeyOpbAhaBhDRye.mjs → cdn/assets/DT0kcrmyi0GrASFM.js} +7 -2
  160. package/cdn/assets/{DPQqTIMsRLhMxPIy.js → DTlKjG3w2RgTejVm.js} +2 -2
  161. package/cdn/assets/DVAgkqy1aZdEMIzM.js +10 -0
  162. package/cdn/assets/DmSh4h3LBSgZNzzF.js +10 -0
  163. package/cdn/assets/DmTmS8Vw_AvNiuzU.js +50 -0
  164. package/cdn/assets/Do7w66ZbyFAW-Kvo.js +10 -0
  165. package/cdn/assets/DoiUKE9bzdCohsIn.js +58 -0
  166. package/cdn/assets/{6JtXguBKwGj6dqfy.js → DrKm9mDEvFK0tW1J.js} +385 -387
  167. package/cdn/assets/DrVjmz0t2Y2eHDvu.js +10 -0
  168. package/cdn/assets/DxOr3qEZVibn2HK7.js +421 -0
  169. package/cdn/assets/IWZ_bebXCJeQz19V.js +10 -0
  170. package/cdn/assets/NPHYIK_SYI8TgWVt.js +23 -0
  171. package/cdn/assets/ZciEgxXQYsHyV2gO.js +633 -0
  172. package/cdn/assets/bGhAFgohHm88dsqJ.js +41 -0
  173. package/cdn/assets/clveP5QdWgiuzHNH.js +5582 -0
  174. package/cdn/assets/sMpbLhp97YEbNwUD.js +49 -0
  175. package/cdn/index.js +73 -73
  176. package/cdn/loader.js +1 -1
  177. package/package.json +3 -3
  178. package/types/index.d.ts +1 -0
  179. package/browser/cjs/-DkdmW3XP1ICRY25.cjs +0 -7
  180. package/browser/cjs/B-KQs1Bf48nEucW7.cjs +0 -7
  181. package/browser/cjs/B1xnY7pDnbnNzknG.cjs +0 -7
  182. package/browser/cjs/B6A5w_aWHkigBc6j.cjs +0 -7
  183. package/browser/cjs/B9jxuOg1CXcmbi9J.cjs +0 -110
  184. package/browser/cjs/BAYjkr4LmsWRLoPr.cjs +0 -7
  185. package/browser/cjs/BG2uV2RpxrfZyCuV.cjs +0 -7
  186. package/browser/cjs/BGCPG4Ip5ZijUQwi.cjs +0 -7
  187. package/browser/cjs/BHTlBOQH-tPGoKgo.cjs +0 -7
  188. package/browser/cjs/BLBNzBvRVl9VLynf.cjs +0 -7
  189. package/browser/cjs/BLh6E7ER8mrM6vc_.cjs +0 -7
  190. package/browser/cjs/BMaq_2S3IFrE5XeJ.cjs +0 -7
  191. package/browser/cjs/BO7Pbclmywy-QCSV.cjs +0 -13
  192. package/browser/cjs/BPlthbyKkqCDjgxO.cjs +0 -7
  193. package/browser/cjs/BUGo0mXtBfFOmQXV.cjs +0 -7
  194. package/browser/cjs/BdHdXCz_K1djQgI4.cjs +0 -7
  195. package/browser/cjs/BfNkb1jDZkJf3wRA.cjs +0 -7
  196. package/browser/cjs/BfdQd2UEOlOc5iF3.cjs +0 -7
  197. package/browser/cjs/Bi9KvObgq_kJ_pjC.cjs +0 -7
  198. package/browser/cjs/BjPpJjnABDd3_WOZ.cjs +0 -7
  199. package/browser/cjs/BsSNzyN8kOGCKzso.cjs +0 -7
  200. package/browser/cjs/BtCcoaKKb8ZDnliG.cjs +0 -7
  201. package/browser/cjs/BwHquG4sSd7OJjxz.cjs +0 -7
  202. package/browser/cjs/BywNBbTVRYbgRbNI.cjs +0 -7
  203. package/browser/cjs/C04Qr5P8uyQ6Vcml.cjs +0 -7
  204. package/browser/cjs/C42ZEPRmW9Wcd7tI.cjs +0 -7
  205. package/browser/cjs/CBpt1PBR1VfBegko.cjs +0 -7
  206. package/browser/cjs/CED8Az5C8GWF7pUT.cjs +0 -7
  207. package/browser/cjs/CbD4Wa5QLTdRCYcz.cjs +0 -7
  208. package/browser/cjs/CbILz9Skl6lWf6yR.cjs +0 -7
  209. package/browser/cjs/CoFQQqIzuvS9PM77.cjs +0 -7
  210. package/browser/cjs/CpDNo2Lhwr5ZHECs.cjs +0 -7
  211. package/browser/cjs/CsamfGfFsItvSgo_.cjs +0 -7
  212. package/browser/cjs/Cx3kn5gBsQ-1bORi.cjs +0 -7
  213. package/browser/cjs/CxLvGnG44-qNI36G.cjs +0 -7
  214. package/browser/cjs/D-xyWit7jxctQCpR.cjs +0 -7
  215. package/browser/cjs/D4XQsK7d7DRctaOO.cjs +0 -7
  216. package/browser/cjs/D9rVEA1BdB0JZwhE.cjs +0 -7
  217. package/browser/cjs/DES2NmIRVZg-HXgs.cjs +0 -7
  218. package/browser/cjs/DFxeLNhACFIHb0nv.cjs +0 -7
  219. package/browser/cjs/DIv1SrLYeyVwcaxE.cjs +0 -7
  220. package/browser/cjs/DJ6L43osbaMzEV5K.cjs +0 -7
  221. package/browser/cjs/DMjLN_HDktNzzUB8.cjs +0 -7
  222. package/browser/cjs/DVPfPZCFjmYu3xyn.cjs +0 -7
  223. package/browser/cjs/DhSlaiQXxEOVtZkA.cjs +0 -7
  224. package/browser/cjs/Dh_dFnagz7dMZlGh.cjs +0 -7
  225. package/browser/cjs/DpF6vgGka2d-RKkb.cjs +0 -10
  226. package/browser/cjs/DtY0Jzlwnr_YKnV4.cjs +0 -7
  227. package/browser/cjs/DwyyFI1Ix0uc0Qoz.cjs +0 -7
  228. package/browser/cjs/Dy5_viRzFls9rOzN.cjs +0 -7
  229. package/browser/cjs/GkINjQ8Te3GKi2mx.cjs +0 -7
  230. package/browser/cjs/aN3KCqswA1SdJIMq.cjs +0 -7
  231. package/browser/cjs/hLJbgylpETByV4wc.cjs +0 -7
  232. package/browser/cjs/qumqKlVHFx89iLeu.cjs +0 -7
  233. package/browser/cjs/rKZjTYQ0WpTriIv6.cjs +0 -7
  234. package/browser/cjs/xjKotAOVt3JH36U7.cjs +0 -7
  235. package/browser/cjs/ymbPxio09Fw7I2BW.cjs +0 -7
  236. package/browser/esm/2P5dQT7wZToOh-n9.mjs +0 -7
  237. package/browser/esm/4GgcUVhUmQmiv9Ha.mjs +0 -110
  238. package/browser/esm/7_x68v6PpvRDox_Z.mjs +0 -7
  239. package/browser/esm/9icgSuuzXq6mlgM8.mjs +0 -7
  240. package/browser/esm/B354iAatN9y9AIIP.mjs +0 -7
  241. package/browser/esm/B5EVyoxm3aSlAnxN.mjs +0 -7
  242. package/browser/esm/BD8rE7MUxuHXsdcf.mjs +0 -7
  243. package/browser/esm/BGFWI1a1PmU8_hCE.mjs +0 -7
  244. package/browser/esm/BI6JAQCQx1V0F2aC.mjs +0 -7
  245. package/browser/esm/BIYg30d_9HaluFFz.mjs +0 -7
  246. package/browser/esm/BKL-uyBp_OE47lXd.mjs +0 -7
  247. package/browser/esm/BMwJCtLAYUW8wExX.mjs +0 -13
  248. package/browser/esm/BNOfK-lGWF2S8vQE.mjs +0 -7
  249. package/browser/esm/Ba433v6lQUMtECiY.mjs +0 -7
  250. package/browser/esm/BbZWfDW2LUyjqUDy.mjs +0 -7
  251. package/browser/esm/C238uBmZN1XXqMUb.mjs +0 -7
  252. package/browser/esm/C34whwRkHO0lhq4-.mjs +0 -7
  253. package/browser/esm/C6FEpAqSZoW5Hgte.mjs +0 -7
  254. package/browser/esm/COlW5ULL29SUKN1Z.mjs +0 -7
  255. package/browser/esm/CRyxOj2xPj9qe9LK.mjs +0 -7
  256. package/browser/esm/CVyVvtlJuCTn4MDh.mjs +0 -7
  257. package/browser/esm/CapeIfjWq-_BHMlE.mjs +0 -7
  258. package/browser/esm/CcQqGNgK2CsgNtuD.mjs +0 -7
  259. package/browser/esm/CdZSxrk3k1Lx6G8W.mjs +0 -7
  260. package/browser/esm/CdchvB_wAbv_6Whw.mjs +0 -7
  261. package/browser/esm/Cf8eDl3Tu5NAWWwG.mjs +0 -7
  262. package/browser/esm/Cfq9tttQlsKvfaCr.mjs +0 -7
  263. package/browser/esm/ClR6uLJoM-xKVYEc.mjs +0 -7
  264. package/browser/esm/Cnl_e-EYkZ3CLbi2.mjs +0 -7
  265. package/browser/esm/CtRS2ZCPF7IH_mXe.mjs +0 -7
  266. package/browser/esm/CuV-bwi1vcXAqFUY.mjs +0 -7
  267. package/browser/esm/CwVE0qelO_xgf-l1.mjs +0 -7
  268. package/browser/esm/D1Dzlta8ZVy08ng6.mjs +0 -7
  269. package/browser/esm/D1TjRQiHLWhpl-dl.mjs +0 -7
  270. package/browser/esm/D8BJ-y3ulgO_ezrj.mjs +0 -10
  271. package/browser/esm/DTDXNEbHVnnZONNL.mjs +0 -7
  272. package/browser/esm/DTWfi8Dl-c2s5moT.mjs +0 -7
  273. package/browser/esm/DYVBXcu1r5KRLB-1.mjs +0 -7
  274. package/browser/esm/DZjWyWMvr2XHQrBg.mjs +0 -7
  275. package/browser/esm/DhHK4QmASvgAq9Xy.mjs +0 -7
  276. package/browser/esm/DoFV2S6Su86IN5Ul.mjs +0 -7
  277. package/browser/esm/Dq3ybkgattcCsF_4.mjs +0 -7
  278. package/browser/esm/DqWoZ4TjweoJWX3o.mjs +0 -7
  279. package/browser/esm/DtXxHirBm16ldE1l.mjs +0 -7
  280. package/browser/esm/DtuWZG6c_8vKRSdr.mjs +0 -7
  281. package/browser/esm/FBG8XXdIMd9PfUIo.mjs +0 -7
  282. package/browser/esm/Nh7JiwvF01PblHQ0.mjs +0 -7
  283. package/browser/esm/PVYiH9vBQM6rqXI4.mjs +0 -7
  284. package/browser/esm/U5-LDZQ0qkJ2Y-p8.mjs +0 -7
  285. package/browser/esm/XhQDWZu47oe6bwHh.mjs +0 -7
  286. package/browser/esm/_BjU6TtI-mQfFpfy.mjs +0 -7
  287. package/browser/esm/gOUfyCw957TzcbNB.mjs +0 -7
  288. package/browser/esm/lmkbfs9sNc7f0oe5.mjs +0 -7
  289. package/browser/esm/naa0kcRwxHEYGaQB.mjs +0 -7
  290. package/browser/esm/qxOkQutRxmAi1vRh.mjs +0 -7
  291. package/browser/esm/tMSro0g2GM5BBTIH.mjs +0 -7
  292. package/cdn/assets/0e9wDKSn4SFxSmP5.js +0 -27
  293. package/cdn/assets/8U2WVdbZHYCBnd9L.js +0 -23
  294. package/cdn/assets/B-kFRtzNNkf4_SiP.js +0 -1701
  295. package/cdn/assets/BAzGoI9gE2G3F3on.js +0 -637
  296. package/cdn/assets/BLqaorJ5Wl-1YOoy.js +0 -3875
  297. package/cdn/assets/BNh9nSR83reiVMKt.js +0 -90
  298. package/cdn/assets/BQON-ToGsIBPrPkM.js +0 -1371
  299. package/cdn/assets/BVYDmdUGWvMG5gNK.js +0 -241
  300. package/cdn/assets/B_2bXmyji3Dr7LRM.js +0 -50224
  301. package/cdn/assets/BlYoycYtR-sUp0iC.js +0 -27
  302. package/cdn/assets/Bsa9-Itkf_SdDBM9.js +0 -6481
  303. package/cdn/assets/CHTspRZD2v_dU_eV.js +0 -22
  304. package/cdn/assets/CMBDD1Mjde6UL5ep.js +0 -84
  305. package/cdn/assets/CR01MBraUPYPpwy4.js +0 -36
  306. package/cdn/assets/CV8UjJPDVplXjK1E.js +0 -49
  307. package/cdn/assets/CwdMjMPFdIs8SAV0.js +0 -1358
  308. package/cdn/assets/DUtu7r6CzW4dtW3E.js +0 -50
  309. package/cdn/assets/Dr5X-ng9wbwUWVr4.js +0 -41
  310. package/cdn/assets/Dvj7UEckqOBrgs9i.js +0 -3947
  311. package/cdn/assets/KtKlo5mM4kTTfFgi.js +0 -46
  312. package/cdn/assets/NTINjW8JjyZudT8s.js +0 -13449
  313. package/cdn/assets/R9RwlorPWfftoboH.js +0 -2373
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B9jxuOg1CXcmbi9J.cjs");var t="object"==typeof global&&global&&global.Object===Object&&global,n="object"==typeof self&&self&&self.Object===Object&&self,r=t||n||Function("return this")(),i=r.Symbol,o=Object.prototype,s=o.hasOwnProperty,a=o.toString,c=i?i.toStringTag:void 0,u=Object.prototype.toString,l=i?i.toStringTag:void 0;function h(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?function(e){var t=s.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[c]=n:delete e[c]),i}(e):function(e){return u.call(e)}(e)}function f(e){return null!=e&&"object"==typeof e}function d(e){return"symbol"==typeof e||f(e)&&"[object Symbol]"==h(e)}function p(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var m=Array.isArray,E=i?i.prototype:void 0,g=E?E.toString:void 0;function T(e){if("string"==typeof e)return e;if(m(e))return p(e,T)+"";if(d(e))return g?g.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var A=/\s/,I=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var y=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,v=/^0o[0-7]+$/i,O=parseInt,S=1/0;function _(e){return e?(e=function(e){if("number"==typeof e)return e;if(d(e))return NaN;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&A.test(e.charAt(t)););return t}(e)+1).replace(I,""):e}(e);var n=R.test(e);return n||v.test(e)?O(e.slice(2),n?2:8):y.test(e)?NaN:+e}(e))===S||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function L(e){var t=_(e),n=t%1;return t==t?n?t-n:t:0}function x(e){return e}function C(e){if(!N(e))return!1;var t=h(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var k,b=r["__core-js_shared__"],P=(k=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",w=Function.prototype.toString;function M(e){if(null!=e){try{return w.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var U=/^\[object .+?Constructor\]$/,F=Function.prototype,D=Object.prototype,j=F.toString,B=D.hasOwnProperty,$=RegExp("^"+j.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function W(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!N(e)||(t=e,P&&P in t))&&(C(e)?$:U).test(M(e));var t}(n)?n:void 0}var G=W(r,"WeakMap"),K=Object.create,z=function(){function e(){}return function(t){if(!N(t))return{};if(K)return K(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function V(){}var H,Y,X,q=Date.now,Z=function(){try{var e=W(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Q=Z?function(e,t){return Z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:x,J=(H=Q,Y=0,X=0,function(){var e=q(),t=16-(e-X);if(X=e,t>0){if(++Y>=800)return arguments[0]}else Y=0;return H.apply(void 0,arguments)});function ee(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function te(e,t,n,r){for(var i=e.length,o=n+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function ne(e){return e!=e}function re(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):te(e,ne,n)}function ie(e,t){return!(null==e||!e.length)&&re(e,t,0)>-1}var oe=/^(?:0|[1-9]\d*)$/;function se(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function ae(e,t,n){"__proto__"==t&&Z?Z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ce(e,t){return e===t||e!=e&&t!=t}var ue=Object.prototype.hasOwnProperty;function le(e,t,n){var r=e[t];ue.call(e,t)&&ce(r,n)&&(void 0!==n||t in e)||ae(e,t,n)}function he(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],c=void 0;void 0===c&&(c=e[a]),i?ae(n,a,c):le(n,a,c)}return n}var fe=Math.max;function de(e,t){return J(function(e,t,n){return t=fe(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=fe(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,x),e+"")}function pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function me(e){return null!=e&&pe(e.length)&&!C(e)}function Ee(e,t,n){if(!N(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&se(t,n.length):"string"==r&&t in n)&&ce(n[t],e)}var ge=Object.prototype;function Te(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function Ae(e){return f(e)&&"[object Arguments]"==h(e)}var Ie=Object.prototype,Ne=Ie.hasOwnProperty,ye=Ie.propertyIsEnumerable,Re=Ae(function(){return arguments}())?Ae:function(e){return f(e)&&Ne.call(e,"callee")&&!ye.call(e,"callee")},ve="object"==typeof exports&&exports&&!exports.nodeType&&exports,Oe=ve&&"object"==typeof module&&module&&!module.nodeType&&module,Se=Oe&&Oe.exports===ve?r.Buffer:void 0,_e=(Se?Se.isBuffer:void 0)||function(){return!1},Le={};function xe(e){return function(t){return e(t)}}Le["[object Float32Array]"]=Le["[object Float64Array]"]=Le["[object Int8Array]"]=Le["[object Int16Array]"]=Le["[object Int32Array]"]=Le["[object Uint8Array]"]=Le["[object Uint8ClampedArray]"]=Le["[object Uint16Array]"]=Le["[object Uint32Array]"]=!0,Le["[object Arguments]"]=Le["[object Array]"]=Le["[object ArrayBuffer]"]=Le["[object Boolean]"]=Le["[object DataView]"]=Le["[object Date]"]=Le["[object Error]"]=Le["[object Function]"]=Le["[object Map]"]=Le["[object Number]"]=Le["[object Object]"]=Le["[object RegExp]"]=Le["[object Set]"]=Le["[object String]"]=Le["[object WeakMap]"]=!1;var Ce="object"==typeof exports&&exports&&!exports.nodeType&&exports,ke=Ce&&"object"==typeof module&&module&&!module.nodeType&&module,be=ke&&ke.exports===Ce&&t.process,Pe=function(){try{return ke&&ke.require&&ke.require("util").types||be&&be.binding&&be.binding("util")}catch(e){}}(),we=Pe&&Pe.isTypedArray,Me=we?xe(we):function(e){return f(e)&&pe(e.length)&&!!Le[h(e)]},Ue=Object.prototype.hasOwnProperty;function Fe(e,t){var n=m(e),r=!n&&Re(e),i=!n&&!r&&_e(e),o=!n&&!r&&!i&&Me(e),s=n||r||i||o,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!t&&!Ue.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||se(u,c))||a.push(u);return a}function De(e,t){return function(n){return e(t(n))}}var je=De(Object.keys,Object),Be=Object.prototype.hasOwnProperty;function $e(e){if(!Te(e))return je(e);var t=[];for(var n in Object(e))Be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function We(e){return me(e)?Fe(e):$e(e)}var Ge,Ke=Object.prototype.hasOwnProperty,ze=(Ge=function(e,t){if(Te(t)||me(t))he(t,We(t),e);else for(var n in t)Ke.call(t,n)&&le(e,n,t[n])},de(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=Ge.length>3&&"function"==typeof i?(r--,i):void 0,o&&Ee(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var s=t[n];s&&Ge(e,s)}return e})),Ve=Object.prototype.hasOwnProperty;function He(e){return me(e)?Fe(e,!0):function(e){if(!N(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Te(e),n=[];for(var r in e)("constructor"!=r||!t&&Ve.call(e,r))&&n.push(r);return n}(e)}var Ye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xe=/^\w*$/;function qe(e,t){if(m(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!d(e))||Xe.test(e)||!Ye.test(e)||null!=t&&e in Object(t)}var Ze=W(Object,"create"),Qe=Object.prototype.hasOwnProperty,Je=Object.prototype.hasOwnProperty;function et(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function tt(e,t){for(var n=e.length;n--;)if(ce(e[n][0],t))return n;return-1}et.prototype.clear=function(){this.__data__=Ze?Ze(null):{},this.size=0},et.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},et.prototype.get=function(e){var t=this.__data__;if(Ze){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Qe.call(t,e)?t[e]:void 0},et.prototype.has=function(e){var t=this.__data__;return Ze?void 0!==t[e]:Je.call(t,e)},et.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ze&&void 0===t?"__lodash_hash_undefined__":t,this};var nt=Array.prototype.splice;function rt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rt.prototype.clear=function(){this.__data__=[],this.size=0},rt.prototype.delete=function(e){var t=this.__data__,n=tt(t,e);return!(n<0||(n==t.length-1?t.pop():nt.call(t,n,1),--this.size,0))},rt.prototype.get=function(e){var t=this.__data__,n=tt(t,e);return n<0?void 0:t[n][1]},rt.prototype.has=function(e){return tt(this.__data__,e)>-1},rt.prototype.set=function(e,t){var n=this.__data__,r=tt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var it=W(r,"Map");function ot(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function st(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function at(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(at.Cache||st),n}st.prototype.clear=function(){this.size=0,this.__data__={hash:new et,map:new(it||rt),string:new et}},st.prototype.delete=function(e){var t=ot(this,e).delete(e);return this.size-=t?1:0,t},st.prototype.get=function(e){return ot(this,e).get(e)},st.prototype.has=function(e){return ot(this,e).has(e)},st.prototype.set=function(e,t){var n=ot(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},at.Cache=st;var ct,ut,lt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ht=/\\(\\)?/g,ft=(ct=at(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(lt,function(e,n,r,i){t.push(r?i.replace(ht,"$1"):n||e)}),t},function(e){return 500===ut.size&&ut.clear(),e}),ut=ct.cache,ct);function dt(e,t){return m(e)?e:qe(e,t)?[e]:ft(function(e){return null==e?"":T(e)}(e))}function pt(e){if("string"==typeof e||d(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function mt(e,t){for(var n=0,r=(t=dt(t,e)).length;null!=e&&n<r;)e=e[pt(t[n++])];return n&&n==r?e:void 0}function Et(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var gt=i?i.isConcatSpreadable:void 0;function Tt(e){return m(e)||Re(e)||!!(gt&&e&&e[gt])}function At(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=Tt),i||(i=[]);++o<s;){var a=e[o];n(a)?Et(i,a):r||(i[i.length]=a)}return i}function It(e){return null!=e&&e.length?At(e):[]}var Nt=De(Object.getPrototypeOf,Object);function yt(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function Rt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e){var t=this.__data__=new rt(e);this.size=t.size}vt.prototype.clear=function(){this.__data__=new rt,this.size=0},vt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},vt.prototype.get=function(e){return this.__data__.get(e)},vt.prototype.has=function(e){return this.__data__.has(e)},vt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof rt){var r=n.__data__;if(!it||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new st(r)}return n.set(e,t),this.size=n.size,this};var Ot="object"==typeof exports&&exports&&!exports.nodeType&&exports,St=Ot&&"object"==typeof module&&module&&!module.nodeType&&module,_t=St&&St.exports===Ot?r.Buffer:void 0,Lt=_t?_t.allocUnsafe:void 0;function xt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Ct(){return[]}var kt=Object.prototype.propertyIsEnumerable,bt=Object.getOwnPropertySymbols,Pt=bt?function(e){return null==e?[]:(e=Object(e),xt(bt(e),function(t){return kt.call(e,t)}))}:Ct,wt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Et(t,Pt(e)),e=Nt(e);return t}:Ct;function Mt(e,t,n){var r=t(e);return m(e)?r:Et(r,n(e))}function Ut(e){return Mt(e,We,Pt)}var Ft=W(r,"DataView"),Dt=W(r,"Promise"),jt=W(r,"Set"),Bt="[object Map]",$t="[object Promise]",Wt="[object Set]",Gt="[object WeakMap]",Kt="[object DataView]",zt=M(Ft),Vt=M(it),Ht=M(Dt),Yt=M(jt),Xt=M(G),qt=h;(Ft&&qt(new Ft(new ArrayBuffer(1)))!=Kt||it&&qt(new it)!=Bt||Dt&&qt(Dt.resolve())!=$t||jt&&qt(new jt)!=Wt||G&&qt(new G)!=Gt)&&(qt=function(e){var t=h(e),n="[object Object]"==t?e.constructor:void 0,r=n?M(n):"";if(r)switch(r){case zt:return Kt;case Vt:return Bt;case Ht:return $t;case Yt:return Wt;case Xt:return Gt}return t});var Zt=Object.prototype.hasOwnProperty,Qt=r.Uint8Array,Jt=/\w*$/,en=i?i.prototype:void 0,tn=en?en.valueOf:void 0;var nn=Pe&&Pe.isMap,rn=nn?xe(nn):function(e){return f(e)&&"[object Map]"==qt(e)},on=Pe&&Pe.isSet,sn=on?xe(on):function(e){return f(e)&&"[object Set]"==qt(e)},an="[object Arguments]",cn="[object Function]",un="[object Object]",ln={};function hn(e,t,n,r,i,o){var s;if(void 0!==s)return s;if(!N(e))return e;var a=m(e);if(a)return s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Zt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,s);var c=qt(e),u=c==cn||"[object GeneratorFunction]"==c;if(_e(e))return function(e){var t=e.length,n=Lt?Lt(t):new e.constructor(t);return e.copy(n),n}(e);if(c==un||c==an||u&&!i)return s=u?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:z(Nt(e))}(e),function(e,t){return he(e,Pt(e),t)}(e,function(e,t){return e&&he(t,We(t),e)}(s,e));if(!ln[c])return i?e:{};s=function(e,t){var n,r,i,o,s,a=e.constructor;switch(t){case"[object ArrayBuffer]":return s=new(o=e).constructor(o.byteLength),new Qt(s).set(new Qt(o)),s;case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return i=(r=e).buffer,new r.constructor(i,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=e.buffer;return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Jt.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return n=e,tn?Object(tn.call(n)):{}}}(e,c),o||(o=new vt);var l=o.get(e);if(l)return l;o.set(e,s),sn(e)?e.forEach(function(r){s.add(hn(r,t,n,r,e,o))}):rn(e)&&e.forEach(function(r,i){s.set(i,hn(r,t,n,i,e,o))});var h=a?void 0:Ut(e);return ee(h||e,function(r,i){h&&(r=e[i=r]),le(s,i,hn(r,t,n,i,e,o))}),s}function fn(e){return hn(e,4)}function dn(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}function pn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new st;++t<n;)this.add(e[t])}function mn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function En(e,t){return e.has(t)}function gn(e,t,n,r,i,o){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var h=-1,f=!0,d=2&n?new pn:void 0;for(o.set(e,t),o.set(t,e);++h<a;){var p=e[h],m=t[h];if(r)var E=s?r(m,p,h,t,e,o):r(p,m,h,e,t,o);if(void 0!==E){if(E)continue;f=!1;break}if(d){if(!mn(t,function(e,t){if(!En(d,t)&&(p===e||i(p,e,n,r,o)))return d.push(t)})){f=!1;break}}else if(p!==m&&!i(p,m,n,r,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function Tn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function An(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}ln[an]=ln["[object Array]"]=ln["[object ArrayBuffer]"]=ln["[object DataView]"]=ln["[object Boolean]"]=ln["[object Date]"]=ln["[object Float32Array]"]=ln["[object Float64Array]"]=ln["[object Int8Array]"]=ln["[object Int16Array]"]=ln["[object Int32Array]"]=ln["[object Map]"]=ln["[object Number]"]=ln[un]=ln["[object RegExp]"]=ln["[object Set]"]=ln["[object String]"]=ln["[object Symbol]"]=ln["[object Uint8Array]"]=ln["[object Uint8ClampedArray]"]=ln["[object Uint16Array]"]=ln["[object Uint32Array]"]=!0,ln["[object Error]"]=ln[cn]=ln["[object WeakMap]"]=!1,pn.prototype.add=pn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},pn.prototype.has=function(e){return this.__data__.has(e)};var In=i?i.prototype:void 0,Nn=In?In.valueOf:void 0,yn=Object.prototype.hasOwnProperty,Rn="[object Arguments]",vn="[object Array]",On="[object Object]",Sn=Object.prototype.hasOwnProperty;function _n(e,t,n,r,i){return e===t||(null==e||null==t||!f(e)&&!f(t)?e!=e&&t!=t:function(e,t,n,r,i,o){var s=m(e),a=m(t),c=s?vn:qt(e),u=a?vn:qt(t),l=(c=c==Rn?On:c)==On,h=(u=u==Rn?On:u)==On,f=c==u;if(f&&_e(e)){if(!_e(t))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new vt),s||Me(e)?gn(e,t,n,r,i,o):function(e,t,n,r,i,o,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Qt(e),new Qt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ce(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Tn;case"[object Set]":var c=1&r;if(a||(a=An),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var l=gn(a(e),a(t),r,i,o,s);return s.delete(e),l;case"[object Symbol]":if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,c,n,r,i,o);if(!(1&n)){var d=l&&Sn.call(e,"__wrapped__"),p=h&&Sn.call(t,"__wrapped__");if(d||p){var E=d?e.value():e,g=p?t.value():t;return o||(o=new vt),i(E,g,n,r,o)}}return!!f&&(o||(o=new vt),function(e,t,n,r,i,o){var s=1&n,a=Ut(e),c=a.length;if(c!=Ut(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:yn.call(t,l)))return!1}var h=o.get(e),f=o.get(t);if(h&&f)return h==t&&f==e;var d=!0;o.set(e,t),o.set(t,e);for(var p=s;++u<c;){var m=e[l=a[u]],E=t[l];if(r)var g=s?r(E,m,l,t,e,o):r(m,E,l,e,t,o);if(!(void 0===g?m===E||i(m,E,n,r,o):g)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var T=e.constructor,A=t.constructor;T==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof T&&T instanceof T&&"function"==typeof A&&A instanceof A||(d=!1)}return o.delete(e),o.delete(t),d}(e,t,n,r,i,o))}(e,t,n,r,_n,i))}function Ln(e){return e==e&&!N(e)}function xn(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}function Cn(e,t){return null!=e&&t in Object(e)}function kn(e,t,n){for(var r=-1,i=(t=dt(t,e)).length,o=!1;++r<i;){var s=pt(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&pe(i)&&se(s,i)&&(m(e)||Re(e))}function bn(e){return"function"==typeof e?e:null==e?x:"object"==typeof e?m(e)?function(e,t){return qe(e)&&Ln(t)?xn(pt(e),t):function(n){var r=function(e,t){var n=null==e?void 0:mt(e,t);return void 0===n?void 0:n}(n,e);return void 0===r&&r===t?function(e,t){return null!=e&&kn(e,t,Cn)}(n,e):_n(t,r,3)}}(e[0],e[1]):function(e){var t=function(e){for(var t=We(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ln(i)]}return t}(e);return 1==t.length&&t[0][2]?xn(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n){var r=n.length,i=r;if(null==e)return!i;for(e=Object(e);r--;){var o=n[r];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<i;){var s=(o=n[r])[0],a=e[s],c=o[1];if(o[2]){if(void 0===a&&!(s in e))return!1}else if(!_n(c,a,3,void 0,new vt))return!1}return!0}(n,0,t)}}(e):function(e){return qe(e)?(t=pt(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return mt(t,e)}}(e);var t}(e)}function Pn(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}var wn,Mn=(wn=function(e,t){return e&&function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var a=o[++r];if(!1===t(i[a],a,i))break}return e}(e,t,We)},function(e,t){if(null==e)return e;if(!me(e))return wn(e,t);for(var n=e.length,r=-1,i=Object(e);++r<n&&!1!==t(i[r],r,i););return e});function Un(e,t,n,r){return Mn(e,function(e,i,o){t(r,e,n(e),o)}),r}var Fn=Object.prototype,Dn=Fn.hasOwnProperty,jn=de(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&Ee(t[0],t[1],i)&&(r=1);++n<r;)for(var o=t[n],s=He(o),a=-1,c=s.length;++a<c;){var u=s[a],l=e[u];(void 0===l||ce(l,Fn[u])&&!Dn.call(e,u))&&(e[u]=o[u])}return e});function Bn(e){return f(e)&&me(e)}var $n=de(function(e,t){return Bn(e)?function(e,t){var n=-1,r=ie,i=!0,o=e.length,s=[],a=t.length;if(!o)return s;t.length>=200&&(r=En,i=!1,t=new pn(t));e:for(;++n<o;){var c=e[n],u=c;if(c=0!==c?c:0,i&&u==u){for(var l=a;l--;)if(t[l]===u)continue e;s.push(c)}else r(t,u,undefined)||s.push(c)}return s}(e,At(t,0,Bn,!0)):[]});function Wn(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function Gn(e,t,n){var r=null==e?0:e.length;return r?yt(e,(t=void 0===t?1:L(t))<0?0:t,r):[]}function Kn(e,t,n){var r=null==e?0:e.length;return r?yt(e,0,(t=r-(t=void 0===t?1:L(t)))<0?0:t):[]}function zn(e,t){var n;return(m(e)?ee:Mn)(e,"function"==typeof(n=t)?n:x)}function Vn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Hn(e,t){var n=!0;return Mn(e,function(e,r,i){return n=!!t(e,r,i)}),n}function Yn(e,t,n){return(m(e)?Vn:Hn)(e,bn(t))}function Xn(e,t){var n=[];return Mn(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function qn(e,t){return(m(e)?xt:Xn)(e,bn(t))}var Zn,Qn=Math.max,Jn=(Zn=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:L(n);return i<0&&(i=Qn(r+i,0)),te(e,bn(t),i)},function(e,t,n){var r=Object(e);if(!me(e)){var i=bn(t);e=We(e),t=function(e){return i(r[e],e,r)}}var o=Zn(e,t,n);return o>-1?r[i?e[o]:o]:void 0});function er(e){return e&&e.length?e[0]:void 0}function tr(e,t){var n=-1,r=me(e)?Array(e.length):[];return Mn(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function nr(e,t){return(m(e)?p:tr)(e,bn(t))}function rr(e,t){return At(nr(e,t))}var ir,or=Object.prototype.hasOwnProperty,sr=(ir=function(e,t,n){or.call(e,n)?e[n].push(t):ae(e,n,[t])},function(e,t){return(m(e)?Pn:Un)(e,ir,bn(t),{})}),ar=Object.prototype.hasOwnProperty;function cr(e,t){return null!=e&&ar.call(e,t)}function ur(e,t){return null!=e&&kn(e,t,cr)}function lr(e){return"string"==typeof e||!m(e)&&f(e)&&"[object String]"==h(e)}function hr(e){return null==e?[]:function(e,t){return p(t,function(t){return e[t]})}(e,We(e))}var fr=Math.max;function dr(e,t,n,r){e=me(e)?e:hr(e),n=n?L(n):0;var i=e.length;return n<0&&(n=fr(i+n,0)),lr(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&re(e,t,n)>-1}function pr(e,t,n){return null!=e&&e.length?re(e,t,0):-1}var mr=Object.prototype.hasOwnProperty;function Er(e){if(null==e)return!0;if(me(e)&&(m(e)||"string"==typeof e||"function"==typeof e.splice||_e(e)||Me(e)||Re(e)))return!e.length;var t=qt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Te(e))return!$e(e).length;for(var n in e)if(mr.call(e,n))return!1;return!0}var gr=Pe&&Pe.isRegExp,Tr=gr?xe(gr):function(e){return f(e)&&"[object RegExp]"==h(e)};function Ar(e){return void 0===e}function Ir(e,t,n,r){if(!N(e))return e;for(var i=-1,o=(t=dt(t,e)).length,s=o-1,a=e;null!=a&&++i<o;){var c=pt(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=s){var l=a[c];void 0===(u=void 0)&&(u=N(l)?l:se(t[i+1])?[]:{})}le(a,c,u),a=a[c]}return e}function Nr(e,t){if(null==e)return{};var n=p(function(e){return Mt(e,He,wt)}(e),function(e){return[e]});return t=bn(t),function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=mt(e,s);n(a,s)&&Ir(o,dt(s,e),a)}return o}(e,n,function(e,n){return t(e,n[0])})}function yr(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Rr(e,t,n){var r=m(e)?Rt:yr,i=arguments.length<3;return r(e,bn(t),n,i,Mn)}function vr(e,t){return(m(e)?xt:Xn)(e,function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(bn(t)))}function Or(e,t){var n;return Mn(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function Sr(e,t,n){return(m(e)?mn:Or)(e,bn(t))}var _r=jt&&1/An(new jt([,-0]))[1]==1/0?function(e){return new jt(e)}:V;function Lr(e){return e&&e.length?function(e){var t=-1,n=ie,r=e.length,i=!0,o=[],s=o;if(r>=200){var a=_r(e);if(a)return An(a);i=!1,n=En,s=new pn}else s=o;e:for(;++t<r;){var c=e[t],u=c;if(c=0!==c?c:0,i&&u==u){for(var l=s.length;l--;)if(s[l]===u)continue e;o.push(c)}else n(s,u,undefined)||(s!==o&&s.push(u),o.push(c))}return o}(e):[]}function xr(e){console&&console.error&&console.error(`Error: ${e}`)}function Cr(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function kr(e){const t=(new Date).getTime(),n=e();return{time:(new Date).getTime()-t,value:n}}function br(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}function Pr(e){return lr((t=e).LABEL)&&""!==t.LABEL?e.LABEL:e.name;var t}class wr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),zn(this.definition,t=>{t.accept(e)})}}class Mr extends wr{constructor(e){super([]),this.idx=1,ze(this,Nr(e,e=>void 0!==e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Ur extends wr{constructor(e){super(e.definition),this.orgText="",ze(this,Nr(e,e=>void 0!==e))}}class Fr extends wr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ze(this,Nr(e,e=>void 0!==e))}}class Dr extends wr{constructor(e){super(e.definition),this.idx=1,ze(this,Nr(e,e=>void 0!==e))}}class jr extends wr{constructor(e){super(e.definition),this.idx=1,ze(this,Nr(e,e=>void 0!==e))}}class Br extends wr{constructor(e){super(e.definition),this.idx=1,ze(this,Nr(e,e=>void 0!==e))}}class $r extends wr{constructor(e){super(e.definition),this.idx=1,ze(this,Nr(e,e=>void 0!==e))}}class Wr extends wr{constructor(e){super(e.definition),this.idx=1,ze(this,Nr(e,e=>void 0!==e))}}class Gr extends wr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,ze(this,Nr(e,e=>void 0!==e))}}class Kr{constructor(e){this.idx=1,ze(this,Nr(e,e=>void 0!==e))}accept(e){e.visit(this)}}function zr(e){function t(e){return nr(e,zr)}if(e instanceof Mr){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return lr(e.label)&&(t.label=e.label),t}if(e instanceof Fr)return{type:"Alternative",definition:t(e.definition)};if(e instanceof Dr)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof jr)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Br)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:zr(new Kr({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Wr)return{type:"RepetitionWithSeparator",idx:e.idx,separator:zr(new Kr({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof $r)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Gr)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof Kr){const t={type:"Terminal",name:e.terminalType.name,label:Pr(e.terminalType),idx:e.idx};lr(e.label)&&(t.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=Tr(n)?n.source:n),t}if(e instanceof Ur)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}class Vr{visit(e){const t=e;switch(t.constructor){case Mr:return this.visitNonTerminal(t);case Fr:return this.visitAlternative(t);case Dr:return this.visitOption(t);case jr:return this.visitRepetitionMandatory(t);case Br:return this.visitRepetitionMandatoryWithSeparator(t);case Wr:return this.visitRepetitionWithSeparator(t);case $r:return this.visitRepetition(t);case Gr:return this.visitAlternation(t);case Kr:return this.visitTerminal(t);case Ur:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hr(e,t=[]){return!!(e instanceof Dr||e instanceof $r||e instanceof Wr)||(e instanceof Gr?Sr(e.definition,e=>Hr(e,t)):!(e instanceof Mr&&dr(t,e))&&e instanceof wr&&(e instanceof Mr&&t.push(e),Yn(e.definition,e=>Hr(e,t))))}function Yr(e){if(e instanceof Mr)return"SUBRULE";if(e instanceof Dr)return"OPTION";if(e instanceof Gr)return"OR";if(e instanceof jr)return"AT_LEAST_ONE";if(e instanceof Br)return"AT_LEAST_ONE_SEP";if(e instanceof Wr)return"MANY_SEP";if(e instanceof $r)return"MANY";if(e instanceof Kr)return"CONSUME";throw Error("non exhaustive match")}class Xr{walk(e,t=[]){zn(e.definition,(n,r)=>{const i=Gn(e.definition,r+1);if(n instanceof Mr)this.walkProdRef(n,i,t);else if(n instanceof Kr)this.walkTerminal(n,i,t);else if(n instanceof Fr)this.walkFlat(n,i,t);else if(n instanceof Dr)this.walkOption(n,i,t);else if(n instanceof jr)this.walkAtLeastOne(n,i,t);else if(n instanceof Br)this.walkAtLeastOneSep(n,i,t);else if(n instanceof Wr)this.walkManySep(n,i,t);else if(n instanceof $r)this.walkMany(n,i,t);else{if(!(n instanceof Gr))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new Dr({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=qr(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new Dr({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=qr(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);zn(e.definition,e=>{const t=new Fr({definition:[e]});this.walk(t,r)})}}function qr(e,t,n){return[new Dr({definition:[new Kr({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Zr(e){if(e instanceof Mr)return Zr(e.referencedRule);if(e instanceof Kr)return[e.terminalType];if(function(e){return e instanceof Fr||e instanceof Dr||e instanceof $r||e instanceof jr||e instanceof Br||e instanceof Wr||e instanceof Kr||e instanceof Ur}(e))return function(e){let t=[];const n=e.definition;let r,i=0,o=n.length>i,s=!0;for(;o&&s;)r=n[i],s=Hr(r),t=t.concat(Zr(r)),i+=1,o=n.length>i;return Lr(t)}(e);if(function(e){return e instanceof Gr}(e))return function(e){const t=nr(e.definition,e=>Zr(e));return Lr(It(t))}(e);throw Error("non exhaustive match")}const Qr="_~IN~_";class Jr extends Xr{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,o=e.idx,i.name+o+Qr+this.topProd.name);var i,o;const s=t.concat(n),a=Zr(new Fr({definition:s}));this.follows[r]=a}}function ei(e){return e.charCodeAt(0)}function ti(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function ni(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function ri(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function ii(e){return"Character"===e.type}const oi=[];for(let e=ei("0");e<=ei("9");e++)oi.push(e);const si=[ei("_")].concat(oi);for(let e=ei("a");e<=ei("z");e++)si.push(e);for(let e=ei("A");e<=ei("Z");e++)si.push(e);const ai=[ei(" "),ei("\f"),ei("\n"),ei("\r"),ei("\t"),ei("\v"),ei("\t"),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei(" "),ei("\u2028"),ei("\u2029"),ei(" "),ei(" "),ei(" "),ei("\ufeff")],ci=/[0-9a-fA-F]/,ui=/[0-9]/,li=/[1-9]/;class hi{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}let fi={};const di=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":ni(n,"global");break;case"i":ni(n,"ignoreCase");break;case"m":ni(n,"multiLine");break;case"u":ni(n,"unicode");break;case"y":ni(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}ri(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return function(){throw Error("Internal Error - Should never get here!")}()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;ri(t)}if(!0!==e||void 0!==t)return ri(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}if(void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),ri(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ei("\n"),ei("\r"),ei("\u2028"),ei("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=oi;break;case"D":e=oi,t=!0;break;case"s":e=ai;break;case"S":e=ai,t=!0;break;case"w":e=si;break;case"W":e=si,t=!0}if(ri(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ei("\f");break;case"n":e=ei("\n");break;case"r":e=ei("\r");break;case"t":e=ei("\t");break;case"v":e=ei("\v")}if(ri(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ei("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ei(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ei(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,ii(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,ii(n)){if(n.value<t.value)throw Error("Range out of order in character class");e.push({from:t.value,to:n.value})}else ti(t.value,e),e.push(ei("-")),ti(n.value,e)}else ti(t.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}}classAtom(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:ei("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;this.consumeChar("("),"?"===this.peekChar(0)?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;const t=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(!1===li.test(e))throw Error("Expecting a positive integer");for(;ui.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(!1===ui.test(e))throw Error("Expecting an integer");for(;ui.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:ei(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return"-"===this.peekChar()&&this.isClassAtom(1)}isDigit(){return ui.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}}isQuantifier(){const e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(e){return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let t="";for(let n=0;n<e;n++){const e=this.popChar();if(!1===ci.test(e))throw Error("Expecting a HexDecimal digits");t+=e}return{type:"Character",value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function pi(e){const t=e.toString();if(fi.hasOwnProperty(t))return fi[t];{const e=di.pattern(t);return fi[t]=e,e}}const mi="Complement Sets are not supported for first char optimization",Ei='Unable to use "first char" lexer optimizations:\n';function gi(e,t=!1){try{const t=pi(e);return Ti(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===mi)t&&Cr(`${Ei}\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.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),xr(`${Ei}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Ti(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r<e.value.length;r++)Ti(e.value[r],t,n);break;case"Alternative":const r=e.value;for(let e=0;e<r.length;e++){const i=r[e];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=i;switch(o.type){case"Character":Ai(o.value,t,n);break;case"Set":if(!0===o.complement)throw Error(mi);zn(o.value,e=>{if("number"==typeof e)Ai(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)Ai(e,t,n);else{for(let e=r.from;e<=r.to&&e<Di;e++)Ai(e,t,n);if(r.to>=Di){const e=r.from>=Di?r.from:Di,n=r.to,i=Bi(e),o=Bi(n);for(let e=i;e<=o;e++)t[e]=e}}}});break;case"Group":Ti(o.value,t,n);break;default:throw Error("Non Exhaustive Match")}const s=void 0!==o.quantifier&&0===o.quantifier.atLeast;if("Group"===o.type&&!1===Ni(o)||"Group"!==o.type&&!1===s)break}break;default:throw Error("non exhaustive match!")}return hr(t)}function Ai(e,t,n){const r=Bi(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=Bi(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=Bi(e.charCodeAt(0));t[n]=n}}}(e,t)}function Ii(e,t){return Jn(e.value,e=>{if("number"==typeof e)return dr(t,e);{const n=e;return void 0!==Jn(t,e=>n.from<=e&&e<=n.to)}})}function Ni(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(m(e.value)?Yn(e.value,Ni):Ni(e.value))}class yi extends hi{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){dr(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Ii(e,this.targetCharCodes)&&(this.found=!0):void 0!==Ii(e,this.targetCharCodes)&&(this.found=!0)}}function Ri(e,t){if(t instanceof RegExp){const n=pi(t),r=new yi(e);return r.visit(n),r.found}return void 0!==Jn(t,t=>dr(e,t.charCodeAt(0)))}const vi="PATTERN",Oi="defaultMode",Si="modes";let _i="boolean"==typeof new RegExp("(?:)").sticky;const Li=/[^\\][$]/,xi=/[^\\[][\^]|^\^/;function Ci(e){const t=e.ignoreCase?"i":"";return new RegExp(`^(?:${e.source})`,t)}function ki(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function bi(e){const t=e.PATTERN;if(Tr(t))return!1;if(C(t))return!0;if(ur(t,"exec"))return!0;if(lr(t))return!1;throw Error("non exhaustive match")}function Pi(e){return!(!lr(e)||1!==e.length)&&e.charCodeAt(0)}const wi={test:function(e){const t=e.length;for(let n=this.lastIndex;n<t;n++){const t=e.charCodeAt(n);if(10===t)return this.lastIndex=n+1,!0;if(13===t)return 10===e.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function Mi(e,t){if(ur(e,"LINE_BREAKS"))return!1;if(Tr(e.PATTERN)){try{Ri(t,e.PATTERN)}catch(e){return{issue:qi.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if(lr(e.PATTERN))return!1;if(bi(e))return{issue:qi.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function Ui(e){return nr(e,e=>lr(e)?e.charCodeAt(0):e)}function Fi(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const Di=256;let ji=[];function Bi(e){return e<Di?e:ji[e]}function $i(e,t){const n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function Wi(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}let Gi=1;const Ki={};function zi(e){const t=function(e){let t=fn(e),n=e,r=!0;for(;r;){n=dn(It(nr(n,e=>e.CATEGORIES)));const e=$n(n,t);t=t.concat(e),Er(e)?r=!1:n=e}return t}(e);!function(e){zn(e,e=>{Hi(e)||(Ki[Gi]=e,e.tokenTypeIdx=Gi++),Yi(e)&&!m(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Yi(e)||(e.CATEGORIES=[]),ur(e,"categoryMatches")||(e.categoryMatches=[]),function(e){return ur(e,"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){zn(e,e=>{Vi([],e)})}(t),function(e){zn(e,e=>{e.categoryMatches=[],zn(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(Ki[n].tokenTypeIdx)})})}(t),zn(t,e=>{e.isParent=e.categoryMatches.length>0})}function Vi(e,t){zn(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),zn(t.CATEGORIES,n=>{const r=e.concat(t);dr(r,n)||Vi(r,n)})}function Hi(e){return ur(e,"tokenTypeIdx")}function Yi(e){return ur(e,"CATEGORIES")}function Xi(e){return ur(e,"tokenTypeIdx")}var qi,Zi;(Zi=qi||(qi={}))[Zi.MISSING_PATTERN=0]="MISSING_PATTERN",Zi[Zi.INVALID_PATTERN=1]="INVALID_PATTERN",Zi[Zi.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",Zi[Zi.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",Zi[Zi.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",Zi[Zi.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",Zi[Zi.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",Zi[Zi.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",Zi[Zi.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",Zi[Zi.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",Zi[Zi.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",Zi[Zi.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",Zi[Zi.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",Zi[Zi.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",Zi[Zi.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",Zi[Zi.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",Zi[Zi.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",Zi[Zi.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";const Qi={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Qi);class Ji{constructor(e,t=Qi){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);const{time:r,value:i}=kr(t),o=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=ze({},Qi,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Qi.lineTerminatorsPattern)this.config.lineTerminatorsPattern=wi;else if(this.config.lineTerminatorCharacters===Qi.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),m(e)?n={modes:{defaultMode:fn(e)},defaultMode:Oi}:(r=!1,n=fn(e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return ur(e,Oi)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Oi+"> property in its definition\n",type:qi.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),ur(e,Si)||t.push({message:"A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",type:qi.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),ur(e,Si)&&ur(e,Oi)&&!ur(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Oi}: <${e.defaultMode}>which does not exist\n`,type:qi.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),ur(e,Si)&&zn(e.modes,(e,n)=>{zn(e,(r,i)=>{Ar(r)?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:qi.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):ur(r,"LONGER_ALT")&&zn(m(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT],i=>{Ar(i)||dr(e,i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${n}>\n`,type:qi.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const o=vr(dn(It(hr(e.modes))),e=>e[vi]===Ji.NA),s=Ui(n);return t&&zn(o,e=>{const t=Mi(e,s);if(!1!==t){const n=function(e,t){if(t.issue===qi.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`;if(t.issue===qi.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`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else ur(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):Ri(s,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:qi.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},zn(n.modes,(e,t)=>{n.modes[t]=vr(e,e=>Ar(e))});const i=We(n.modes);if(zn(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=qn(e,e=>!ur(e,vi)),n=nr(t,e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:qi.MISSING_PATTERN,tokenTypes:[e]}));return{errors:n,valid:$n(e,t)}}(e);n=n.concat(r.errors);const i=function(e){const t=qn(e,e=>{const t=e[vi];return!(Tr(t)||C(t)||ur(t,"exec")||lr(t))}),n=nr(t,e=>({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.",type:qi.INVALID_PATTERN,tokenTypes:[e]}));return{errors:n,valid:$n(e,t)}}(r.valid),o=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=qn(e,e=>Tr(e[vi]));return t=t.concat(function(e){class t extends hi{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}const n=qn(e,e=>{const n=e.PATTERN;try{const e=pi(n),r=new t;return r.visit(e),r.found}catch(e){return Li.test(n.source)}}),r=nr(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:qi.EOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){class t extends hi{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}const n=qn(e,e=>{const n=e.PATTERN;try{const e=pi(n),r=new t;return r.visit(e),r.found}catch(e){return xi.test(n.source)}}),r=nr(n,e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:qi.SOI_ANCHOR_FOUND,tokenTypes:[e]}));return r}(n)),t=t.concat(function(e){const t=qn(e,e=>{const t=e[vi];return t instanceof RegExp&&(t.multiline||t.global)}),n=nr(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:qi.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}));return n}(n)),t=t.concat(function(e){const t=[];let n=nr(e,n=>Rr(e,(e,r)=>(n.PATTERN.source!==r.PATTERN.source||dr(t,r)||r.PATTERN===Ji.NA||(t.push(r),e.push(r)),e),[]));n=dn(n);const r=nr(qn(n,e=>e.length>1),e=>{const t=nr(e,e=>e.name);return{message:`The same RegExp pattern ->${er(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:qi.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}});return r}(n)),t=t.concat(function(e){const t=qn(e,e=>e.PATTERN.test("")),n=nr(t,e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:qi.EMPTY_MATCH_PATTERN,tokenTypes:[e]}));return n}(n)),t}(o)),n=n.concat(function(e){const t=qn(e,e=>{if(!ur(e,"GROUP"))return!1;const t=e.GROUP;return t!==Ji.SKIPPED&&t!==Ji.NA&&!lr(t)}),n=nr(t,e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:qi.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}));return n}(o)),n=n.concat(function(e,t){const n=qn(e,e=>void 0!==e.PUSH_MODE&&!dr(t,e.PUSH_MODE)),r=nr(n,e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:qi.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}));return r}(o,t)),n=n.concat(function(e){const t=[],n=Rr(e,(e,t,n)=>{const r=t.PATTERN;return r===Ji.NA||(lr(r)?e.push({str:r,idx:n,tokenType:t}):Tr(r)&&(i=r,void 0===Jn([".","\\","[","]","|","^","$","(",")","?","*","+","{"],e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return zn(e,(e,r)=>{zn(n,({str:n,idx:i,tokenType:o})=>{if(r<i&&function(e,t){if(Tr(t)){const n=t.exec(e);return null!==n&&0===n.index}if(C(t))return t(e,0,[],{});if(ur(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(n,e.PATTERN)){const n=`Token: ->${o.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`;t.push({message:n,type:qi.UNREACHABLE_PATTERN,tokenTypes:[e,o]})}})}),t}(o)),n}(e,i))}),Er(this.lexerDefinitionErrors)){let r;zi(e),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=jn(t,{useSticky:_i,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()})).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(Er(ji)){ji=new Array(65536);for(let e=0;e<65536;e++)ji[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=vr(e,e=>e[vi]===Ji.NA)});let i,o,s,a,c,u,l,h,f,d,p,E=!1;n("Transform Patterns",()=>{E=!1,i=nr(r,e=>{const n=e[vi];if(Tr(n)){const e=n.source;return 1!==e.length||"^"===e||"$"===e||"."===e||n.ignoreCase?2!==e.length||"\\"!==e[0]||dr(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],e[1])?t.useSticky?ki(n):Ci(n):e[1]:e}if(C(n))return E=!0,{exec:n};if("object"==typeof n)return E=!0,n;if("string"==typeof n){if(1===n.length)return n;{const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=new RegExp(e);return t.useSticky?ki(r):Ci(r)}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{o=nr(r,e=>e.tokenTypeIdx),s=nr(r,e=>{const t=e.GROUP;if(t!==Ji.SKIPPED){if(lr(t))return t;if(Ar(t))return!1;throw Error("non exhaustive match")}}),a=nr(r,e=>{const t=e.LONGER_ALT;if(t)return m(t)?nr(t,e=>pr(r,e)):[pr(r,t)]}),c=nr(r,e=>e.PUSH_MODE),u=nr(r,e=>ur(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=Ui(t.lineTerminatorCharacters);l=nr(r,e=>!1),"onlyOffset"!==t.positionTracking&&(l=nr(r,t=>ur(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===Mi(t,e)&&Ri(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=nr(r,bi),f=nr(i,Pi),d=Rr(r,(e,t)=>{const n=t.GROUP;return lr(n)&&n!==Ji.SKIPPED&&(e[n]=[]),e},{}),p=nr(i,(e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:l[t],isCustom:h[t],short:f[t],group:s[t],push:c[t],pop:u[t],tokenTypeIdx:o[t],tokenType:r[t]}))});let g=!0,T=[];return t.safeMode||n("First Char Optimization",()=>{T=Rr(r,(e,n,r)=>{if("string"==typeof n.PATTERN){const t=Bi(n.PATTERN.charCodeAt(0));Fi(e,t,p[r])}else if(m(n.START_CHARS_HINT)){let t;zn(n.START_CHARS_HINT,n=>{const i=Bi("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,Fi(e,i,p[r]))})}else if(Tr(n.PATTERN))if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&xr(`${Ei}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=gi(n.PATTERN,t.ensureOptimizations);Er(i)&&(g=!1),zn(i,t=>{Fi(e,t,p[r])})}else t.ensureOptimizations&&xr(`${Ei}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:d,patternIdxToConfig:p,charCodeToPatternIdxToConfig:T,hasCustom:E,canBeOptimized:g}}(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=ze({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!Er(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const e=nr(this.lexerDefinitionErrors,e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}zn(this.lexerDefinitionWarning,e=>{Cr(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(_i?(this.chopInput=x,this.match=this.matchWithTest):(this.updateLastIndex=V,this.match=this.matchWithExec),r&&(this.handleModes=V),!1===this.trackStartLines&&(this.computeNewColumn=x),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=V),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Rr(this.canModeBeOptimized,(e,t,n)=>(!1===t&&e.push(n),e),[]);if(t.ensureOptimizations&&!Er(e))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.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{fi={}}),this.TRACE_INIT("toFastProperties",()=>{br(this)})})}tokenize(e,t=this.defaultMode){if(!Er(this.lexerDefinitionErrors)){const e=nr(this.lexerDefinitionErrors,e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,o,s,a,c,u,l,h,f,d,p,E,g;const T=e,A=T.length;let I=0,N=0;const y=this.hasCustom?0:Math.floor(e.length/10),R=new Array(y),v=[];let O=this.trackStartLines?1:void 0,S=this.trackStartLines?1:void 0;const _=function(e){const t={};return zn(We(e),n=>{const r=e[n];if(!m(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),L=this.trackStartLines,x=this.config.lineTerminatorsPattern;let C=0,k=[],b=[];const P=[],w=[];let M;function U(){return k}function F(e){const t=Bi(e),n=b[t];return void 0===n?w:n}Object.freeze(w);const D=e=>{if(1===P.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);v.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{P.pop();const e=Wn(P);k=this.patternIdxToConfig[e],b=this.charCodeToPatternIdxToConfig[e],C=k.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;M=b&&t?F:U}};function j(e){P.push(e),b=this.charCodeToPatternIdxToConfig[e],k=this.patternIdxToConfig[e],C=k.length,C=k.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;M=b&&t?F:U}let B;j.call(this,t);const $=this.config.recoveryEnabled;for(;I<A;){a=null;const t=T.charCodeAt(I),m=M(t),y=m.length;for(n=0;n<y;n++){B=m[n];const r=B.pattern;c=null;const l=B.short;if(!1!==l?t===l&&(a=r):!0===B.isCustom?(g=r.exec(T,I,R,_),null!==g?(a=g[0],void 0!==g.payload&&(c=g.payload)):a=null):(this.updateLastIndex(r,I),a=this.match(r,e,I)),null!==a){if(s=B.longerAlt,void 0!==s){const t=s.length;for(i=0;i<t;i++){const t=k[s[i]],n=t.pattern;if(u=null,!0===t.isCustom?(g=n.exec(T,I,R,_),null!==g?(o=g[0],void 0!==g.payload&&(u=g.payload)):o=null):(this.updateLastIndex(n,I),o=this.match(n,e,I)),o&&o.length>a.length){a=o,c=u,B=t;break}}}break}}if(null!==a){if(l=a.length,h=B.group,void 0!==h&&(f=B.tokenTypeIdx,d=this.createTokenInstance(a,I,f,B.tokenType,O,S,l),this.handlePayload(d,c),!1===h?N=this.addToken(R,N,d):_[h].push(d)),e=this.chopInput(e,l),I+=l,S=this.computeNewColumn(S,l),!0===L&&!0===B.canLineTerminator){let e,t,n=0;x.lastIndex=0;do{e=x.test(a),!0===e&&(t=x.lastIndex-1,n++)}while(!0===e);0!==n&&(O+=n,S=l-t,this.updateTokenEndLineColumnLocation(d,h,t,n,O,S,l))}this.handleModes(B,D,j,d)}else{const t=I,n=O,i=S;let o=!1===$;for(;!1===o&&I<A;)for(e=this.chopInput(e,1),I++,r=0;r<C;r++){const t=k[r],n=t.pattern,i=t.short;if(!1!==i?T.charCodeAt(I)===i&&(o=!0):!0===t.isCustom?o=null!==n.exec(T,I,R,_):(this.updateLastIndex(n,I),o=null!==n.exec(e)),!0===o)break}if(p=I-t,S=this.computeNewColumn(S,p),E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(T,t,p,n,i),v.push({offset:t,line:n,column:i,length:p,message:E}),!1===$)break}}return this.hasCustom||(R.length=N),{tokens:R,groups:_,errors:v}}handleModes(e,t,n,r){if(!0===e.pop){const i=e.push;t(r),void 0!==i&&n.call(this,i)}else void 0!==e.push&&n.call(this,e.push)}chopInput(e,t){return e.substring(t)}updateLastIndex(e,t){e.lastIndex=t}updateTokenEndLineColumnLocation(e,t,n,r,i,o,s){let a,c;void 0!==t&&(a=n===s-1,c=a?-1:0,1===r&&!0===a||(e.endLine=i+c,e.endColumn=o-1-c))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,o){return{image:e,startOffset:t,startLine:i,startColumn:o,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,o,s){return{image:e,startOffset:t,endOffset:t+s-1,startLine:i,endLine:i,startColumn:o,endColumn:o+s-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,++t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){null!==t&&(e.payload=t)}matchWithTest(e,t,n){return!0===e.test(t)?t.substring(n,e.lastIndex):null}matchWithExec(e,t){const n=e.exec(t);return null!==n?n[0]:null}}function eo(e){return to(e)?e.LABEL:e.name}function to(e){return lr(e.LABEL)&&""!==e.LABEL}Ji.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",Ji.NA=/NOT_APPLICABLE/;const no="categories",ro="label",io="group",oo="push_mode",so="pop_mode",ao="longer_alt",co="line_breaks",uo="start_chars_hint";function lo(e){return function(e){const t=e.pattern,n={};if(n.name=e.name,Ar(t)||(n.PATTERN=t),ur(e,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return ur(e,no)&&(n.CATEGORIES=e[no]),zi([n]),ur(e,ro)&&(n.LABEL=e[ro]),ur(e,io)&&(n.GROUP=e[io]),ur(e,so)&&(n.POP_MODE=e[so]),ur(e,oo)&&(n.PUSH_MODE=e[oo]),ur(e,ao)&&(n.LONGER_ALT=e[ao]),ur(e,co)&&(n.LINE_BREAKS=e[co]),ur(e,uo)&&(n.START_CHARS_HINT=e[uo]),n}(e)}const ho=lo({name:"EOF",pattern:Ji.NA});function fo(e,t,n,r,i,o,s,a){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}zi([ho]);const po={buildMismatchTokenMessage:({expected:e,actual:t,previous:n,ruleName:r})=>`Expecting ${to(e)?`--\x3e ${eo(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const o="Expecting: ",s="\nbut found: '"+er(t).image+"'";if(r)return o+r+s;{const t=nr(Rr(e,(e,t)=>e.concat(t),[]),e=>`[${nr(e,e=>eo(e)).join(", ")}]`);return o+`one of these possible Token sequences:\n${nr(t,(e,t)=>` ${t+1}. ${e}`).join("\n")}`+s}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",o="\nbut found: '"+er(t).image+"'";return n?i+n+o:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${nr(e,e=>`[${nr(e,e=>eo(e)).join(",")}]`).join(" ,")}>`+o}};Object.freeze(po);const mo={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},Eo={buildDuplicateFoundError(e,t){const n=e.name,r=er(t),i=r.idx,o=Yr(r),s=(a=r)instanceof Kr?a.terminalType.name:a instanceof Mr?a.nonTerminalName:"";var a;let c=`->${o}${i>0?i:""}<- ${s?`with argument: ->${s}<-`:""}\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 `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,"\n"),c},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.`,buildAlternationPrefixAmbiguityError(e){const t=nr(e.prefixPath,e=>eo(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;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.`},buildAlternationAmbiguityError(e){const t=nr(e.prefixPath,e=>eo(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=Yr(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",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.`,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.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;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 ${nr(e.leftRecursionPath,e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof Ur?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class go extends Vr{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){zn(hr(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:ws.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class To extends Xr{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=fn(this.path.ruleStack).reverse(),this.occurrenceStack=fn(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){Er(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Ao extends To{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new Fr({definition:e});this.possibleTokTypes=Zr(r),this.found=!0}}}class Io extends Xr{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class No extends Io{walkMany(e,t,n){if(e.idx===this.occurrence){const e=er(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Kr&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class yo extends Io{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=er(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Kr&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Ro extends Io{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=er(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Kr&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class vo extends Io{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=er(t.concat(n));this.result.isEndOfRule=void 0===e,e instanceof Kr&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Oo(e,t,n=[]){n=fn(n);let r=[],i=0;function o(o){const s=Oo(o.concat(Gn(e,i+1)),t,n);return r.concat(s)}for(;n.length<t&&i<e.length;){const t=e[i];if(t instanceof Fr)return o(t.definition);if(t instanceof Mr)return o(t.definition);if(t instanceof Dr)r=o(t.definition);else{if(t instanceof jr)return o(t.definition.concat([new $r({definition:t.definition})]));if(t instanceof Br)return o([new Fr({definition:t.definition}),new $r({definition:[new Kr({terminalType:t.separator})].concat(t.definition)})]);if(t instanceof Wr){const e=t.definition.concat([new $r({definition:[new Kr({terminalType:t.separator})].concat(t.definition)})]);r=o(e)}else if(t instanceof $r){const e=t.definition.concat([new $r({definition:t.definition})]);r=o(e)}else{if(t instanceof Gr)return zn(t.definition,e=>{!1===Er(e.definition)&&(r=o(e.definition))}),r;if(!(t instanceof Kr))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:Gn(e,i)}),r}function So(e,t,n,r){const i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE";let a=!1;const c=t.length,u=c-r-1,l=[],h=[];for(h.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!Er(h);){const e=h.pop();if(e===s){a&&Wn(h).idx<=u&&h.pop();continue}const r=e.def,f=e.idx,d=e.ruleStack,p=e.occurrenceStack;if(Er(r))continue;const m=r[0];if(m===i){const e={idx:f,def:Gn(r),ruleStack:Kn(d),occurrenceStack:Kn(p)};h.push(e)}else if(m instanceof Kr)if(f<c-1){const e=f+1;if(n(t[e],m.terminalType)){const t={idx:e,def:Gn(r),ruleStack:d,occurrenceStack:p};h.push(t)}}else{if(f!==c-1)throw Error("non exhaustive match");l.push({nextTokenType:m.terminalType,nextTokenOccurrence:m.idx,ruleStack:d,occurrenceStack:p}),a=!0}else if(m instanceof Mr){const e=fn(d);e.push(m.nonTerminalName);const t=fn(p);t.push(m.idx);const n={idx:f,def:m.definition.concat(o,Gn(r)),ruleStack:e,occurrenceStack:t};h.push(n)}else if(m instanceof Dr){const e={idx:f,def:Gn(r),ruleStack:d,occurrenceStack:p};h.push(e),h.push(s);const t={idx:f,def:m.definition.concat(Gn(r)),ruleStack:d,occurrenceStack:p};h.push(t)}else if(m instanceof jr){const e=new $r({definition:m.definition,idx:m.idx}),t={idx:f,def:m.definition.concat([e],Gn(r)),ruleStack:d,occurrenceStack:p};h.push(t)}else if(m instanceof Br){const e=new Kr({terminalType:m.separator}),t=new $r({definition:[e].concat(m.definition),idx:m.idx}),n={idx:f,def:m.definition.concat([t],Gn(r)),ruleStack:d,occurrenceStack:p};h.push(n)}else if(m instanceof Wr){const e={idx:f,def:Gn(r),ruleStack:d,occurrenceStack:p};h.push(e),h.push(s);const t=new Kr({terminalType:m.separator}),n=new $r({definition:[t].concat(m.definition),idx:m.idx}),i={idx:f,def:m.definition.concat([n],Gn(r)),ruleStack:d,occurrenceStack:p};h.push(i)}else if(m instanceof $r){const e={idx:f,def:Gn(r),ruleStack:d,occurrenceStack:p};h.push(e),h.push(s);const t=new $r({definition:m.definition,idx:m.idx}),n={idx:f,def:m.definition.concat([t],Gn(r)),ruleStack:d,occurrenceStack:p};h.push(n)}else if(m instanceof Gr)for(let e=m.definition.length-1;e>=0;e--){const t={idx:f,def:m.definition[e].definition.concat(Gn(r)),ruleStack:d,occurrenceStack:p};h.push(t),h.push(s)}else if(m instanceof Fr)h.push({idx:f,def:m.definition.concat(Gn(r)),ruleStack:d,occurrenceStack:p});else{if(!(m instanceof Ur))throw Error("non exhaustive match");h.push(_o(m,f,d,p))}}return l}function _o(e,t,n,r){const i=fn(n);i.push(e.name);const o=fn(r);return o.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:o}}var Lo;function xo(e){if(e instanceof Dr||"Option"===e)return Lo.OPTION;if(e instanceof $r||"Repetition"===e)return Lo.REPETITION;if(e instanceof jr||"RepetitionMandatory"===e)return Lo.REPETITION_MANDATORY;if(e instanceof Br||"RepetitionMandatoryWithSeparator"===e)return Lo.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof Wr||"RepetitionWithSeparator"===e)return Lo.REPETITION_WITH_SEPARATOR;if(e instanceof Gr||"Alternation"===e)return Lo.ALTERNATION;throw Error("non exhaustive match")}function Co(e,t,n,r){const i=e.length,o=Yn(e,e=>Yn(e,e=>1===e.length));if(t)return function(t){const r=nr(t,e=>e.GATE);for(let t=0;t<i;t++){const i=e[t],o=i.length,s=r[t];if(void 0===s||!1!==s.call(this))e:for(let e=0;e<o;e++){const r=i[e],o=r.length;for(let e=0;e<o;e++){const t=this.LA(e+1);if(!1===n(t,r[e]))continue e}return t}}};if(o&&!r){const t=Rr(nr(e,e=>It(e)),(e,t,n)=>(zn(t,t=>{ur(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),zn(t.categoryMatches,t=>{ur(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t<i;t++){const r=e[t],i=r.length;e:for(let e=0;e<i;e++){const i=r[e],o=i.length;for(let e=0;e<o;e++){const t=this.LA(e+1);if(!1===n(t,i[e]))continue e}return t}}}}function ko(e,t,n){const r=Yn(e,e=>1===e.length),i=e.length;if(r&&!n){const t=It(e);if(1===t.length&&Er(t[0].categoryMatches)){const e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{const e=Rr(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,zn(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){const t=this.LA(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;n<i;n++){const r=e[n],i=r.length;for(let e=0;e<i;e++){const n=this.LA(e+1);if(!1===t(n,r[e]))continue e}return!0}return!1}}!function(e){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"}(Lo||(Lo={}));class bo extends Xr{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)}walkOption(e,t,n){this.checkIsTarget(e,Lo.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,Lo.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,Lo.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,Lo.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,Lo.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}}class Po extends Vr{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Lo.OPTION)}visitRepetition(e){this.checkIsTarget(e,Lo.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Lo.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Lo.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Lo.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Lo.ALTERNATION)}}function wo(e){const t=new Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function Mo(e){let t=[""];for(let n=0;n<e.length;n++){const r=e[n],i=[];for(let e=0;e<t.length;e++){const n=t[e];i.push(n+"_"+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){const t="_"+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function Uo(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;const i=e[r];for(let e=0;e<t.length;e++)if(!0===i[t[e]])return!1}return!0}function Fo(e,t){const n=nr(e,e=>Oo([e],1)),r=wo(n.length),i=nr(n,e=>{const t={};return zn(e,e=>{zn(Mo(e.partialPath),e=>{t[e]=!0})}),t});let o=n;for(let e=1;e<=t;e++){const n=o;o=wo(n.length);for(let s=0;s<n.length;s++){const a=n[s];for(let n=0;n<a.length;n++){const c=a[n].partialPath,u=a[n].suffixDef,l=Mo(c);if(Uo(i,l,s)||Er(u)||c.length===t){const e=r[s];if(!1===Bo(e,c)){e.push(c);for(let e=0;e<l.length;e++){const t=l[e];i[s][t]=!0}}}else{const t=Oo(u,e+1,c);o[s]=o[s].concat(t),zn(t,e=>{zn(Mo(e.partialPath),e=>{i[s][e]=!0})})}}}}return r}function Do(e,t,n,r){const i=new Po(e,Lo.ALTERNATION,r);return t.accept(i),Fo(i.result,n)}function jo(e,t,n,r){const i=new Po(e,n);t.accept(i);const o=i.result,s=new bo(t,e,n).startWalking();return Fo([new Fr({definition:o}),new Fr({definition:s})],r)}function Bo(e,t){e:for(let n=0;n<e.length;n++){const r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){const n=t[e],i=r[e];if(!1==(n===i||void 0!==i.categoryMatchesMap[n.tokenTypeIdx]))continue e}return!0}}return!1}function $o(e){return Yn(e,e=>Yn(e,e=>Yn(e,e=>Er(e.categoryMatches))))}function Wo(e){return`${Yr(e)}_#_${e.idx}_#_${Go(e)}`}function Go(e){return e instanceof Kr?e.terminalType.name:e instanceof Mr?e.nonTerminalName:""}class Ko extends Vr{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function zo(e,t,n,r=[]){const i=[],o=Vo(t.definition);if(Er(o))return[];{const t=e.name;dr(o,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:ws.LEFT_RECURSION,ruleName:t});const s=rr($n(o,r.concat([e])),t=>{const i=fn(r);return i.push(t),zo(e,t,n,i)});return i.concat(s)}}function Vo(e){let t=[];if(Er(e))return t;const n=er(e);if(n instanceof Mr)t.push(n.referencedRule);else if(n instanceof Fr||n instanceof Dr||n instanceof jr||n instanceof Br||n instanceof Wr||n instanceof $r)t=t.concat(Vo(n.definition));else if(n instanceof Gr)t=It(nr(n.definition,e=>Vo(e.definition)));else if(!(n instanceof Kr))throw Error("non exhaustive match");const r=Hr(n),i=e.length>1;if(r&&i){const n=Gn(e);return t.concat(Vo(n))}return t}class Ho extends Vr{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Yo extends Vr{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const Xo="MismatchedTokenException",qo="NoViableAltException",Zo="EarlyExitException",Qo="NotAllInputParsedException",Jo=[Xo,qo,Zo,Qo];function es(e){return dr(Jo,e.name)}Object.freeze(Jo);class ts extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ns extends ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Xo}}class rs extends ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=qo}}class is extends ts{constructor(e,t){super(e,t),this.name=Qo}}class os extends ts{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Zo}}const ss={},as="InRuleRecoveryException";class cs extends Error{constructor(e){super(e),this.name=as}}function us(e,t,n,r,i,o,s){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(void 0===c){const e=this.getCurrRuleFullName();c=new o(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,l=c.occurrence;const h=c.isEndOfRule;1===this.RULE_STACK.length&&h&&void 0===u&&(u=ho,l=1),void 0!==u&&void 0!==l&&this.shouldInRepetitionRecoveryBeTried(u,l,s)&&this.tryInRepetitionRecovery(e,t,n,u)}const ls=1024,hs=1280,fs=1536;function ds(e,t,n){return n|t|e}class ps{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:bs.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(Er(t)){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return rr(e,e=>zo(e,e,Eo))}validateEmptyOrAlternatives(e){return rr(e,e=>function(e,t){const n=new Ho;return e.accept(n),rr(n.alternations,n=>rr(Kn(n.definition),(r,i)=>Er(So([r],[],$i,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:ws.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,Eo))}validateAmbiguousAlternationAlternatives(e,t){return rr(e,e=>function(e,t,n){const r=new Ho;e.accept(r);let i=r.alternations;i=vr(i,e=>!0===e.ignoreAmbiguities);const o=rr(i,r=>{const i=r.idx,o=r.maxLookahead||t,s=Do(i,e,o,r),a=function(e,t,n,r){const i=[],o=Rr(e,(n,r,o)=>(!0===t.definition[o].ignoreAmbiguities||zn(r,r=>{const s=[o];zn(e,(e,n)=>{o!==n&&Bo(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&s.push(n)}),s.length>1&&!Bo(i,r)&&(i.push(r),n.push({alts:s,path:r}))}),n),[]),s=nr(o,e=>{const i=nr(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:ws.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}});return s}(s,r,e,n),c=function(e,t,n,r){const i=Rr(e,(e,t,n)=>{const r=nr(t,e=>({idx:n,path:e}));return e.concat(r)},[]),o=dn(rr(i,e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const o=e.idx,s=e.path;return nr(qn(i,e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<o&&(n=e.path,r=s,n.length<r.length&&Yn(n,(e,t)=>{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}),e=>{const i=[e.idx+1,o+1],s=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:ws.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:s,alternatives:i}})}));return o}(s,r,e,n);return a.concat(c)});return o}(e,t,Eo))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return zn(e,e=>{const i=new Yo;e.accept(i),zn(i.allProductions,i=>{const o=xo(i),s=i.maxLookahead||t;if(Er(It(jo(i.idx,e,o,s)[0]))){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:ws.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,Eo)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,o){const s=Do(e,t,n);return o(s,r,$o(s)?Wi:$i,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Co)}buildLookaheadForOptional(e){return function(e,t,n,r,i,o){const s=jo(e,t,i,n),a=$o(s)?Wi:$i;return o(s[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,xo(e.prodType),ko)}}const ms=new class extends Vr{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Es(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==1&&(e.endOffset=t.endOffset)}function gs(e,t){!0===isNaN(e.startOffset)?(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)}function Ts(e,t){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}function As(e,t){const n=We(e),r=n.length;for(let i=0;i<r;i++){const r=e[n[i]],o=r.length;for(let e=0;e<o;e++){const n=r[e];void 0===n.tokenTypeIdx&&this[n.name](n.children,t)}}}var Is;!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(Is||(Is={}));const Ns={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ns);const ys=!0,Rs=Math.pow(2,8)-1,vs=lo({name:"RECORDING_PHASE_TOKEN",pattern:Ji.NA});zi([vs]);const Os=fo(vs,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(Os);const Ss={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};function _s(e,t,n,r=!1){Cs(n);const i=Wn(this.recordingProdStack),o=C(t)?t:t.DEF,s=new e({definition:[],idx:n});return r&&(s.separator=t.SEP),ur(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),Ns}function Ls(e,t){Cs(t);const n=Wn(this.recordingProdStack),r=!1===m(e),i=!1===r?e:e.DEF,o=new Gr({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});ur(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD);const s=Sr(i,e=>C(e.GATE));return o.hasPredicates=s,n.definition.push(o),zn(i,e=>{const t=new Fr({definition:[]});o.definition.push(t),ur(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:ur(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Ns}function xs(e){return 0===e?"":`${e}`}function Cs(e){if(e<0||e>Rs){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${Rs+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ks=fo(ho,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ks);const bs=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:po,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ps=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var ws,Ms,Us;!function(e){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"}(ws||(ws={}));class Fs{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{br(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),zn(this.definedRulesNames,e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=jn(e,{errMsgProvider:mo}),n={};return zn(e.rules,e=>{n[e.name]=e}),function(e,t){const n=new go(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:hr(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Er(n)&&!1===this.skipValidations){const n=(e={rules:hr(this.gastProductionsCache),tokenTypes:hr(this.tokensMap),errMsgProvider:Eo,grammarName:t},function(e,t,n,r){const i=rr(e,e=>function(e,t){const n=new Ko;e.accept(n);const r=n.allProductions,i=nr(hr(Nr(sr(r,Wo),e=>e.length>1)),n=>{const r=er(n),i=t.buildDuplicateFoundError(e,n),o=Yr(r),s={message:i,type:ws.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:o,occurrence:r.idx},a=Go(r);return a&&(s.parameter=a),s});return i}(e,n)),o=function(e,t,n){const r=[],i=nr(t,e=>e.name);return zn(e,e=>{const t=e.name;if(dr(i,t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:ws.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),s=rr(e,e=>function(e,t){const n=new Ho;e.accept(n);const r=rr(n.alternations,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:ws.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]);return r}(e,n)),a=rr(e,t=>function(e,t,n,r){const i=[],o=Rr(t,(t,n)=>n.name===e.name?t+1:t,0);if(o>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:ws.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(o,s,a)}((e=jn(e,{errMsgProvider:Eo})).rules,e.tokenTypes,e.errMsgProvider,e.grammarName)),r=function(e){return nr(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:ws.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:hr(this.gastProductionsCache),tokenTypes:hr(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(n,r)}var e}),Er(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return zn(e,e=>{const n=new Jr(e).startWalking();ze(t,n)}),t}(hr(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:hr(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(hr(this.gastProductionsCache))})),!Fs.DEFER_DEFINITION_ERRORS_HANDLING&&!Er(this.definitionErrors))throw e=nr(this.definitionErrors,e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),ur(t,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=ur(t,"skipValidations")?t.skipValidations:bs.skipValidations}}Fs.DEFER_DEFINITION_ERRORS_HANDLING=!1,Ms=Fs,Us=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=ur(e,"recoveryEnabled")?e.recoveryEnabled:bs.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=us)}getTokenToInsert(e){const t=fo(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),o=this.exportLexerState(),s=[];let a=!1;const c=this.LA(1);let u=this.LA(1);const l=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),n=new ns(t,c,this.LA(0));n.resyncedTokens=Kn(s),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void l();if(n.call(this))return l(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,s))}this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new cs("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(Er(t))return!1;const n=this.LA(1);return void 0!==Jn(t,e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return dr(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),n=2;for(;;){const r=Jn(e,e=>$i(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return ss;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return nr(e,(n,r)=>0===r?ss:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return It(nr(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===ss)return[ho];const t=e.ruleName+e.idxInCallingRule+Qr+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,ho)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Kn(t)}attemptInRepetitionRecovery(e,t,n,r,i,o,s){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:fn(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return nr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},class{initLooksAhead(e){this.dynamicTokensEnabled=ur(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:bs.dynamicTokensEnabled,this.maxLookahead=ur(e,"maxLookahead")?e.maxLookahead:bs.maxLookahead,this.lookaheadStrategy=ur(e,"lookaheadStrategy")?e.lookaheadStrategy:new ps({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){zn(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:s}=function(e){ms.reset(),e.accept(ms);const t=ms.dslMethods;return ms.reset(),t}(e);zn(t,t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${Yr(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=ds(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),zn(n,t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,Yr(t))}),zn(r,t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,Yr(t))}),zn(i,t=>{this.computeLookaheadFunc(e,t.idx,ls,"RepetitionMandatory",t.maxLookahead,Yr(t))}),zn(o,t=>{this.computeLookaheadFunc(e,t.idx,fs,"RepetitionMandatoryWithSeparator",t.maxLookahead,Yr(t))}),zn(s,t=>{this.computeLookaheadFunc(e,t.idx,hs,"RepetitionWithSeparator",t.maxLookahead,Yr(t))})})})}computeLookaheadFunc(e,t,n,r,i,o){this.TRACE_INIT(`${o}${0===t?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),s=ds(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(s,o)})}getKeyForAutomaticLookahead(e,t){return ds(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=ur(e,"nodeLocationTracking")?e.nodeLocationTracking:bs.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=gs,this.setNodeLocationFromNode=gs,this.cstPostRule=V,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=V,this.setNodeLocationFromNode=V,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Es,this.setNodeLocationFromNode=Es,this.cstPostRule=V,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=V,this.setNodeLocationFromNode=V,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=V,this.setNodeLocationFromNode=V,this.cstPostRule=V,this.setInitialNodeLocation=V}else this.cstInvocationStateUpdate=V,this.cstFinallyStateUpdate=V,this.cstPostTerminal=V,this.cstPostNonTerminal=V,this.cstPostRule=V}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,o;i=t,o=e,void 0===(r=n).children[o]?r.children[o]=[i]:r.children[o].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Ar(this.baseCstVisitorConstructor)){const e=function(e,t){const n=function(){};Ts(n,e+"BaseSemantics");const r={visit:function(e,t){if(m(e)&&(e=e[0]),!Ar(e))return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){const n=qn(t,t=>!1===C(e[t])),r=nr(n,t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Is.MISSING_METHOD,methodName:t}));return dn(r)}(e,t);return n}(this,t);if(!Er(e)){const t=nr(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,We(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Ar(this.baseCstVisitorWithDefaultsConstructor)){const e=function(e,t,n){const r=function(){};Ts(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return zn(t,e=>{i[e]=As}),(r.prototype=i).constructor=r,r}(this.className,We(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):ks}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ks:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Wi,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},ur(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(m(e)){if(Er(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(m(e))this.tokensMap=Rr(e,(e,t)=>(e[t.name]=t,e),{});else if(ur(e,"modes")&&Yn(It(hr(e.modes)),Xi)){const t=Lr(It(hr(e.modes)));this.tokensMap=Rr(t,(e,t)=>(e[t.name]=t,e),{})}else{if(!N(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=fn(e)}this.tokensMap.EOF=ho;const n=Yn(ur(e,"modes")?It(hr(e.modes)):hr(e),e=>Er(e.categoryMatches));this.tokenMatcher=n?Wi:$i,zi(hr(this.tokensMap))}defineRule(e,t,n){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.`);const r=ur(n,"resyncEnabled")?n.resyncEnabled:Ps.resyncEnabled,i=ur(n,"recoveryValueFunc")?n.recoveryValueFunc:Ps.recoveryValueFunc,o=this.ruleShortNameIdx<<12;let s;return this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o,s=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(s,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){const r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(es(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(ls,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Lo.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,ls,e,Ro)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(fs,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Lo.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,vo],t,fs,e,vo)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let o=!0;for(;!0===i.call(this)&&!0===o;)o=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,No,o)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(hs,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA(1),i);for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,yo],t,hs,e,yo)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,fs,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=m(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new is(t,e))}}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw es(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ns(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===as?n:e}}}saveRecogState(){const e=this.errors,t=fn(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),ho)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Ps){if(dr(this.definedRulesNames,e)){const t={message:Eo.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ws.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Ps){const r=function(e,t,n){const r=[];let i;return dr(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:ws.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(es(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return nr(hr(this.gastProductionsCache),zr)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=ur(e,"errorMessageProvider")?e.errorMessageProvider:bs.errorMessageProvider}SAVE_ERROR(e){if(es(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:fn(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return fn(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=jo(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],o=[];for(let e=1;e<=this.maxLookahead;e++)o.push(this.LA(e));const s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new os(s,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=Do(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new rs(s,this.LA(1),o))}},class{initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if(Ar(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return So([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=er(e.ruleStack),n=this.getGAstProductions()[t];return new Ao(n,e).startWalking()}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";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}`]}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})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ks}topLevelRuleRecord(e,t){try{const n=new Ur({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return _s.call(this,Dr,e,t)}atLeastOneInternalRecord(e,t){_s.call(this,jr,t,e)}atLeastOneSepFirstInternalRecord(e,t){_s.call(this,Br,t,e,ys)}manyInternalRecord(e,t){_s.call(this,$r,t,e)}manySepFirstInternalRecord(e,t){_s.call(this,Wr,t,e,ys)}orInternalRecord(e,t){return Ls.call(this,e,t)}subruleInternalRecord(e,t,n){if(Cs(t),!e||!1===ur(e,"ruleName")){const n=new Error(`<SUBRULE${xs(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Wn(this.recordingProdStack),i=e.ruleName,o=new Mr({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(o),this.outputCst?Ss:Ns}consumeInternalRecord(e,t,n){if(Cs(t),!Hi(e)){const n=new Error(`<CONSUME${xs(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=Wn(this.recordingProdStack),i=new Kr({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Os}},class{initPerformanceTracer(e){if(ur(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=bs.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);const{time:r,value:i}=kr(t),o=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()}}],Us.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(Ms.prototype,n,r):Ms.prototype[n]=e.prototype[n]})});class Ds extends Fs{constructor(e,t=bs){const n=fn(t);n.outputCst=!1,super(e,n)}}const js=lo({name:"WhiteSpace",pattern:/\s+/,group:Ji.SKIPPED}),Bs=lo({name:"String",pattern:/"(""|[^"])*"/}),$s=lo({name:"SingleQuotedString",pattern:/'(''|[^'])*'/}),Ws=lo({name:"SheetQuoted",pattern:/'((?![\\/[\]*?:]).)+?'!/}),Gs=lo({name:"FunctionToken",pattern:/[A-Za-z_]+[A-Za-z_0-9.]*\(/}),Ks=lo({name:"NamedTableReference",pattern:/[A-Za-z_]+[A-Za-z_0-9.]*\[/}),zs=lo({name:"BracketedString",pattern:/\[([^[\]]*)\]/,longer_alt:[Ks,Bs]}),Vs=lo({name:"LiteralError",pattern:/#PARSE!|#NULL!|#DIV\/0!|#VALUE!|#NUM!|#FIELD!|#N\/A|#GETTING_DATA|#SPILL!|#CONNECT!|#BLOCKED!|#UNKNOWN!|#FIELD!|#CALC!|#BUSY!|#PYTHON!|#TIMEOUT!/}),Hs=lo({name:"RefError",pattern:/#REF!|#NAME\?/}),Ys=lo({name:"Sheet",pattern:/[A-Za-z_.\d\u007F-\uFFFF]+!/}),Xs=/^[a-zA-Z_][a-zA-Z0-9_.?]*:?/,qs=lo({name:"Name",pattern:{exec:(e,t)=>{try{const n=Xs.exec(e.substring(t));if(n){const e=n[0];if(e.endsWith(":")){const t=e.length;return"."===e[t-2]?[e.substring(0,t-2)]:[e.substring(0,t-1)]}return[e]}}catch(e){console.warn("Error parsing name",e)}return null}},line_breaks:!1,start_chars_hint:(()=>{const e=[];for(let t=65;t<=90;t++)e.push(t);for(let t=97;t<=122;t++)e.push(t);for(let t=48;t<=57;t++)e.push(t);return e})()}),Zs=lo({name:"Cell",pattern:/[$]?[A-Za-z]{1,3}[$]?[1-9][0-9]*/,longer_alt:qs}),Qs=lo({name:"Column",pattern:/[$]?[A-Za-z]{1,3}/,longer_alt:qs}),Js=lo({name:"AbsRow",pattern:/[$][0-9]+/,longer_alt:qs}),ea=lo({name:"NumberToken",pattern:/[0-9]+[.]?[0-9]*([eE][+-][0-9]+)?/}),ta=lo({name:"Boolean",pattern:/TRUE|FALSE/i}),na=lo({name:"Comma",pattern:/,/}),ra=lo({name:"RangeUnion",pattern:/:/}),ia=lo({name:"RangeTrimFull",pattern:/\.:\./}),oa=lo({name:"RangeTrimLeading",pattern:/\.:/}),sa=lo({name:"RangeTrimTrailing",pattern:/:\./}),aa=lo({name:"Semicolon",pattern:/;/}),ca=lo({name:"OpenParen",pattern:/\(/}),ua=lo({name:"CloseParen",pattern:/\)/}),la=lo({name:"OpenSquareParen",pattern:/\[/}),ha=lo({name:"CloseSquareParen",pattern:/]/});lo({name:"exclamationMark",pattern:/!/});const fa=lo({name:"OpenCurlyParen",pattern:/{/}),da=lo({name:"CloseCurlyParen",pattern:/}/}),pa=lo({name:"QuoteS",pattern:/'/}),ma=lo({name:"MulOp",pattern:/\*/}),Ea=lo({name:"PlusOp",pattern:/\+/}),ga=lo({name:"DivOp",pattern:/\//}),Ta=lo({name:"MinOp",pattern:/-/}),Aa=lo({name:"ImplicitIntersectOp",pattern:/@/}),Ia=lo({name:"ConcatOp",pattern:/&/}),Na=lo({name:"ExOp",pattern:/\^/}),ya=lo({name:"PercentOp",pattern:/%/}),Ra=lo({name:"TableSpecifier",pattern:/#(All|Data|Headers|Totals|This Row)/i}),va=lo({name:"ArrayAnchorOp",pattern:/#/,longer_alt:[Ra,Vs,Hs]}),Oa=lo({name:"GtOp",pattern:/>/}),Sa=lo({name:"EqOp",pattern:/=/}),_a=lo({name:"LtOp",pattern:/</}),La=[js,Bs,Ws,$s,Gs,Ks,zs,Vs,Hs,Ys,Zs,ta,Qs,Js,Ra,va,Aa,qs,ea,na,ia,oa,sa,ra,aa,ca,ua,la,ha,fa,da,pa,ma,Ea,ga,Ta,Ia,Na,ma,ya,lo({name:"NeqOp",pattern:/<>/}),lo({name:"GteOp",pattern:/>=/}),lo({name:"LteOp",pattern:/<=/}),Oa,Sa,_a],xa=new Ji(La,{ensureOptimizations:!0}),Ca={};La.forEach(e=>{Ca[e.name]=e});const ka={boolean:3,string:2,number:1},ba=(e,t)=>{let n=e+t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},Pa=(e,t)=>{let n=e-t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},wa=(e,t)=>{let n=e*t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},Ma=(e,t)=>{if(0===t)return 1/0;let n=e/t;return n=Math.abs(n)<99e-14?0:n,isFinite(n)?n:Number.NaN},Ua=(e,t)=>{const n=e**t;return isFinite(n)?n:Number.NaN},Fa=(e="",t="")=>(null===e&&(e=""),null===t&&(t=""),"boolean"==typeof e&&(e=e?"TRUE":"FALSE"),"boolean"==typeof t&&(t=t?"TRUE":"FALSE"),""+e+t),Da=(e=null,t=null)=>typeof e==typeof t&&e===t,ja=(e=null,t=null)=>typeof e!=typeof t||e!==t,Ba=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e>t:ka[n]>ka[r]},$a=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e>=t:ka[n]>=ka[r]},Wa=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e<t:ka[n]<ka[r]},Ga=(e=null,t=null)=>{const n=typeof e,r=typeof t;return n===r?e<=t:ka[n]<=ka[r]},Ka={type:e.t.Number,coerce:!0,includeBoolean:!0,includeMistyped:!0,mismatchFill:e.r.BuiltIn.NA},za={type:e.t.String,coerce:!0,includeMistyped:!0,mismatchFill:e.r.BuiltIn.NA},Va={type:null,coerce:!0,includeMistyped:!0,mismatchFill:e.r.BuiltIn.NA},Ha=(t,n,r,i)=>{if(null!==n&&void 0!==n.colStart&&(n=t.getValueAt(n.rowStart,n.colStart)),null!==r&&void 0!==r.colStart&&(r=t.getValueAt(r.rowStart,r.colStart)),"number"==typeof n&&"number"==typeof r)return i(n,r);let o,s;if(n?.isIRange?o=n:r?.isIRange&&(s=r),!o&&!s){const t=!1;return n=e.tu(n,e.Kh(n,!0),e.t.Number,!0,t),r=e.tu(r,e.Kh(r,!0),e.t.Number,!0,t),n instanceof e.r.Value?n:r instanceof e.r.Value?r:i(n,r)}return o||(o=t.getRange(n)),o.broadcast(r,i,Ka).fillEmpty(0)},Ya=(e,t,n,r)=>{let i,o;return null!==t&&void 0!==t.colStart&&(t=e.getValueAt(t.rowStart,t.colStart)),null!==n&&void 0!==n.colStart&&(n=e.getValueAt(n.rowStart,n.colStart)),t?.isIRange?(i=t,o=n):n?.isIRange&&(i=n,o=t),i?i.broadcast(o,r,Va):r(t,n)},Xa=(t,n)=>{null==n&&(n=0);let r,i=1;if("+"===t)return n;if("-"!==t)throw new e.r.Value(`Unrecognized prefix: ${t}`);return i=-i,n?.isIRange&&(r=n),r?r.broadcast(i,wa,Va):"number"!=typeof(n=e.tu(n,e.Kh(n,!0),e.t.Number))||isNaN(n)?e.r.BuiltIn.Value:n*i},qa=(t,n,r,i)=>{if(!n)return e.r.BuiltIn.Ref;if(n.isIReferenceRange&&(n=n.getCoords()),void 0===n.colStart)return e.r.BuiltIn.Ref;if(r.isIReferenceRange&&(r=r.getCoords()),void 0===r.colStart)return e.r.BuiltIn.Ref;const o=i(n,r);return o?t.getReference(o):e.r.BuiltIn.Null},Za={"+":(e,t,n)=>Ha(e,t,n,ba),"-":(e,t,n)=>Ha(e,t,n,Pa),"*":(e,t,n)=>Ha(e,t,n,wa),"/":(e,t,n)=>Ha(e,t,n,Ma),"^":(e,t,n)=>Ha(e,t,n,Ua)," ":(t,n,r,i)=>qa(t,n,r,e.W.intersectRanges),":":(t,n,r,i)=>qa(t,n,r,e.W.unionRanges),".:.":(t,n,r,i)=>{const o=qa(t,n,r,e.W.unionRanges);return t.getFunction("TRIMRANGE").execute(o,3,3)},".:":(t,n,r,i)=>{const o=qa(t,n,r,e.W.unionRanges);return t.getFunction("TRIMRANGE").execute(o,1,1)},":.":(t,n,r,i)=>{const o=qa(t,n,r,e.W.unionRanges);return t.getFunction("TRIMRANGE").execute(o,2,2)},"&":(t,n,r)=>((t,n,r,i)=>{if(null!==n&&void 0!==n.colStart&&(n=t.getValueAt(n.rowStart,n.colStart)),null!==r&&void 0!==r.colStart&&(r=t.getValueAt(r.rowStart,r.colStart)),"string"==typeof n&&"string"==typeof r)return i(n,r);let o,s;return n?.isIRange?o=n:r?.isIRange&&(s=r),o||s?(o||(o=t.getRange(n)),o.broadcast(r,i,za)):i(n=e.tu(n,e.Kh(n,!0),e.t.String),r=e.tu(r,e.Kh(r,!0),e.t.String))})(t,n,r,Fa),"=":(e,t,n)=>Ya(e,t,n,Da),"<>":(e,t,n)=>Ya(e,t,n,ja),">":(e,t,n)=>Ya(e,t,n,Ba),"<":(e,t,n)=>Ya(e,t,n,Wa),">=":(e,t,n)=>Ya(e,t,n,$a),"<=":(e,t,n)=>Ya(e,t,n,Ga)},Qa={"-":(e,t)=>Xa("-",t),"+":(e,t)=>Xa("+",t),"@":(t,n)=>{if(!n||!n.isIReferenceRange)return n;const r=n.getCoords(),i=n,o=t.getPosition(),s=i.getHeight(),a=i.getWidth();if(a>1&&s>1)return e.r.BuiltIn.Value;if(s>1){const e=o.rowIndex-r.rowStart;if(e>=0&&e<s)return i.getValueAt(e,0)}else{if(!(a>1))return i.getValueAt(0,0);{const e=o.colIndex-r.colStart;if(e>=0&&e<a)return i.getValueAt(0,e)}}return e.r.BuiltIn.Value}},Ja={"%":(e,t)=>Ha(e,t,100,Ma),"#":(t,n)=>t.getSpillAt(n.rowStart,n.colStart)||e.r.BuiltIn.Ref};function ec(e){const t=(e=e.toUpperCase()).length;let n=0;for(let r=0;r<t;r++){const i=e.charCodeAt(r);isNaN(i)||(n+=(i-64)*26**(t-r-1))}return n}function tc(e){return{type:"cell",value:Object.freeze({colIndex:e.colIndex,rowIndex:e.rowIndex,$colIndex:e.$colIndex||!1,$rowIndex:e.$rowIndex||!1}),inputs:null,isReference:!0}}function nc(e,t){const n=e.startsWith("$");n&&(e=e.substring(1));let r=parseInt(e)-1;return n||r===Number.MIN_SAFE_INTEGER||(r-=t.colIndex),{type:"cell",value:Object.freeze({colIndex:Number.MIN_SAFE_INTEGER,$colIndex:!1,rowIndex:r,$rowIndex:n}),inputs:null,isReference:!0}}function rc(e,t){return{type:"function",value:e=e.toUpperCase(),inputs:t}}function ic(e,t){return{type:"tableReference",value:e,inputs:t}}function oc(e){return{type:"tableSpecifier",value:e,inputs:null,isReference:!0}}function sc(e,t,n,r=!1){const i={type:"infix",value:e,inputs:[t,n]};return r&&(i.isReference=!0),i}function ac(e,t,n=!1){const r={type:"postfix",value:e,inputs:[t]};return n&&(r.isReference=!0),r}function cc(e,t,n=!1){const r={type:"prefix",value:e,inputs:[t]};return n&&(r.isReference=!0),r}function uc(e){return{type:"named",value:e,inputs:null,isReference:!0}}function lc(e){return{type:"number",value:Number(e),isLiteral:!0}}function hc(e){let t=e;const n=e&&e.length>1&&'"'===e[0]&&'"'===e[e.length-1];return n&&(t=e.substring(1,e.length-1)),{type:n?"quotedString":"string",value:t,isLiteral:!0}}function fc(e){return{type:"boolean",value:"TRUE"===e||"TRUE"===e.toUpperCase(),isLiteral:!0}}function dc(t){return{type:"error",value:e.r.getBuiltInByLabel(t.toUpperCase()),isLiteral:!0}}function pc(t){return{type:"error",value:t?e.r.getBuiltInByLabel(t.toUpperCase()):e.r.BuiltIn.Ref,inputs:null,isReference:!0}}function mc(e,t){const n=function e(n,r){const i=n.inputs;let o;if(i){const t=i.length;for(let r=0;r<t;r++){const t=i[r],s=e(t,n);s!==t&&(o||(o=[...i]),o[r]=s)}}const s=o?{...n,inputs:o}:n,a=t(s,r);return void 0===a?s:a}(e,void 0);return n||this}function Ec(t,n){let r=0,i=mc(t,e=>{const t={...e};return t.evalIndex=r++,t});const o=new Array(r),s=new Set,a=new Map;let c;const u=new Map,l=[],h=[];i=mc(i,(t,n)=>{const r=t.type,i=t.evalIndex;if(o[i]=null,t.isReference){const e=t,n={node:t,index:u.size,op:null,value:null,inputs:null};if(u.set(e,n),"cell"===r){const r=e.value;return r.$colIndex&&(n.hasHorizontalAbs=!0),r.$rowIndex&&(n.hasVerticalAbs=!0),n.value=a.size,a.set(e,a.size),s.add(n),t.refIndex=h.length,void h.push(n.index)}if("infix"===r||"prefix"===r||"postfix"===r||"spill"===r){const r=e.inputs,i=r.length,o=t.value;n.op=o;const a=new Array(i);n.inputs=a;for(let e=0;e<i;e++){const t=r[e],i=u.get(t);i&&(i.hasHorizontalAbs&&(n.hasHorizontalAbs=!0),i.hasVerticalAbs&&(n.hasVerticalAbs=!0)),a[e]=i?i.index:-1,s.delete(i)}if(s.add(n),Ic.includes(o)){const e=r[0],i=!!e&&"cell"===e.type,o=r[1],s=!!o&&"cell"===o.type;i&&s&&(h.splice(o.refIndex,1),o.refIndex=e.refIndex,t.refIndex=e.refIndex,h[e.refIndex]=n.index)}else"#"===o&&(t.refIndex=r[0].refIndex);return void l.push(t)}if("error"===r||"named"===r){c||(c=new Map);const i=e.value;let o=c.get(i);return n.op=r,void 0===o&&(o=c.size,c.set(i,o)),n.value=o,s.add(n),t.refIndex=h.length,void h.push(n.index)}"tableReference"===r&&(n.op=r),"tableSpecifier"===r&&(n.op=r),"structuredArg"===r&&(n.op=r)}else if(n&&n.isReference){const e=t,n={node:t,index:u.size,op:"function",value:t.value,inputs:null};u.set(e,n)}if(t.isLiteral)if("array"!==r)o[i]=t.value;else{const n=t.value,r=n.length,s=new Array(r);for(let e=0;e<r;e++){const t=n[e].value,r=t.length,i=new Array(r);for(let e=0;e<r;e++){const n=t[e];let r=n.value;if("prefix"===n.type){const e=n.value;r=n.inputs[0].value,"-"===e&&(r=-r)}i[e]=r}s[e]=i}o[i]=e.su(s)}else{if("empty"!==r)return l.push(t),t;o[i]=void 0}});const f=new Array(a.size);a.forEach((e,t)=>{const n=t.value,r=n.colIndex,i=n.rowIndex,o=n.$colIndex,s=n.$rowIndex,a={colStart:r,rowStart:i,colEnd:r,rowEnd:i,$colStart:o,$rowStart:s,$colEnd:o,$rowEnd:s};r===Number.MIN_SAFE_INTEGER&&(a.colEnd=Number.MAX_SAFE_INTEGER),i===Number.MIN_SAFE_INTEGER&&(a.rowEnd=Number.MAX_SAFE_INTEGER),n.sheetName&&(a.sheetName=n.sheetName),f[e]=a});const d=f.length,p=new Array(d);for(let e=0;e<d;e++)p[e]={colStart:0,rowStart:0,colEnd:0,rowEnd:0,sheetName:null};const m=new Array(u.size);let E;u.forEach(e=>{m[e.index]=e}),c&&(E=[],c.forEach((e,t)=>{E.push(t)}));const g=[];s.forEach(e=>{g.push(e.index)});const T=l.length;for(let e=0;e<T;e++){const t=l[e],n=t.type;if("infix"===n){const e=t.value;t.fn=Za[e]}else if("prefix"===n){const e=t.value;t.fn=Qa[e]}else if("postfix"===n){const e=t.value;t.fn=Ja[e]}}const A=function(e){const t=[],n=(e,n)=>{const r={type:e.type,value:e.value};void 0!==e.evalIndex&&(r.evalIndex=e.evalIndex),void 0!==e.refIndex&&(r.refIndex=e.refIndex),n&&(r.ctx=n),t.push(r)},r=(e,n,r,i)=>{if(null==n)return;if(t.length>1&&"whitespace"===e&&"whitespace"===t[t.length-1].type)return;const o={type:e,value:n};r&&(o.ctx=r),void 0!==i&&(o.evalIndex=i),t.push(o)};!function e(t,i,o){const s=t.evalIndex??o??0,a=t.type,c=(t,n,i)=>{if(!t)return;const o=t.length;for(let s=0;s<o;s++)e(t[s],n,i),s<o-1&&r("comma",",",n)};if(t.isLiteral){if(r("whitespace",t.wsBefore,i),"array"===a){r("type","{",i);const n=t.value,o=n.length;for(let t=0;t<o;t++){const a=n[t],c=a.value,u=c.length;for(let t=0;t<u;t++){const n=c[t];r("whitespace",n.wsBefore,i),e(n,i,s),r("whitespace",n.wsAfter,i),t<u-1&&r("comma",",",i)}t<o-1&&(r("whitespace",a.wsBefore,i),r("comma",";",i),r("whitespace",a.wsAfter,i))}t.error||r("type","}",i)}else"quotedString"===a?(t={type:a,value:'"'+t.value+'"'},n(t,i)):n(t,i);r("whitespace",t.wsAfter,i)}else if("infix"===a)e(t.inputs[0],i,s),r("whitespace",t.wsBefore,i),n(t,i),r("whitespace",t.wsAfter,i),e(t.inputs[1],i,s);else if("prefix"===a)r("whitespace",t.wsBefore,i),n(t,i),r("whitespace",t.wsAfter,i),e(t.inputs[0],i,s);else if("postfix"===a)e(t.inputs[0],i,s),r("whitespace",t.wsBefore,i),n(t,i),r("whitespace",t.wsAfter,i);else{r("whitespace",t.wsBefore,i);const o=t.inputs;switch(a){case"function":n(t,i);const u={name:String(t.value),argIndex:-1};if(r("paren","(",u,t.evalIndex),o){const t=o.length;for(let n=0;n<t;n++){const i={...u,argIndex:n};e(o[n],i,s),n<t-1&&r("comma",",",i)}}t.error||r("paren",")",u,t.evalIndex);break;case"cell":n(t,i);break;case"paren":r(a,"(",i,s),c(o,i,s),t.error||r(a,")",i,s);break;case"squareParen":r(a,"[",i,s),c(o,i,s),t.error||r(a,"]",i,s);break;case"tableReference":n(t,i);const l={name:String(t.value),argIndex:-1};if(r("paren","[",l),o){const t=o.length;for(let n=0;n<t;n++){const i={...l,argIndex:n};e(o[n],i,s),n<t-1&&r("comma",",",i)}}t.error||r("paren","]",l);break;default:void 0!==t.value&&n(t,i),o&&o.forEach(t=>e(t,i,s))}r("whitespace",t.wsAfter,i)}}(e);const i=t.length;for(let e=0;e<i;e++){const n=t[e];if("whitespace"===n.type&&void 0===n.evalIndex){const r=t[e+1];r&&void 0!==r.evalIndex&&(n.evalIndex=r.evalIndex)}}return t}(i);return{ast:i,evaluations:o,executions:l,precedentsAbsolute:p,precedentsExecute:m,precedentsNamed:E,precedentsRelative:f,precedentsRoot:g,references:h,tokens:A,error:n}}function gc(t,n){let r,i=-1,o="";Number.isSafeInteger(t.previousToken?.startLine)?(i=t.previousToken.startLine,r=t.previousToken.endColumn+1):Number.isSafeInteger(t.token?.startLine)&&(i=t.token.startLine,r=t.token.startColumn),-1!==i?(o+="\n"+n.split("\n")[i-1]+"\n",o+=Array(r-1).fill(" ").join("")+"^\n",o+=`Error at position ${i}:${r}\n`+t.message,t.errorLocation={line:i,column:r}):o=n+"\n"+t.message;const s=new e.r.Parse(o);return s.details=t,s}const Tc=function(e,t){return t.wsBefore&&(e.wsBefore=t.wsBefore),t.wsAfter&&(e.wsAfter=t.wsAfter),t.image&&(e.image=t.image),e},Ac=Object.freeze([[":",".:.",".:",,":."],["^"],["*","/"],["+","-"],["&"],["<",">","=","<>","<=",">="]]),Ic=Object.freeze([":",".:.",".:",,":."]),Nc=Object.freeze([":"," ",".:.",".:",,":."]),yc=Object.freeze(["@"]),Rc=Object.freeze(["#"]),vc=Object.freeze(Nc.concat(yc).concat(Rc)),{String:Oc,SheetQuoted:Sc,SingleQuotedString:_c,FunctionToken:Lc,NamedTableReference:xc,LiteralError:Cc,RefError:kc,Cell:bc,Sheet:Pc,Name:wc,NumberToken:Mc,Boolean:Uc,Column:Fc,AbsRow:Dc,ImplicitIntersectOp:jc,Comma:Bc,RangeUnion:$c,RangeTrimFull:Wc,RangeTrimLeading:Gc,RangeTrimTrailing:Kc,Semicolon:zc,OpenParen:Vc,CloseParen:Hc,OpenSquareParen:Yc,CloseSquareParen:Xc,OpenCurlyParen:qc,CloseCurlyParen:Zc,MulOp:Qc,PlusOp:Jc,DivOp:eu,MinOp:tu,ConcatOp:nu,ExOp:ru,PercentOp:iu,ArrayAnchorOp:ou,TableSpecifier:su,BracketedString:au,NeqOp:cu,GteOp:uu,LteOp:lu,GtOp:hu,EqOp:fu,LtOp:du}=Ca;class pu extends Ds{constructor(){super(Ca,{nodeLocationTracking:"full",maxLookahead:1,skipValidations:!0,recoveryEnabled:!0}),this.position={colIndex:0,rowIndex:0},this.astErrors=[];const e=this,t=(t,n,r)=>{let i;e.CONSUME(n);const o=e.getLexerPosition();i=e.ACTION(()=>(i={type:t,value:null,inputs:null},this._ensureWhitespace(i,o,!0)));const s=[],a=e.SUBRULE(e.intersectOp);a&&s.push(a);const c=e.SUBRULE(e.group),u=e.OPTION(()=>this.CONSUME(r));return i=e.ACTION(()=>{if(c)for(let e=0;e<c.length;e++)s.push(c[e]);return i&&(u||this._reportError(i,"Missing closing parenthesis",o),i.inputs=s),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0)}),i};e.RULE("infixOp",()=>{const t=[],n=[e.SUBRULE(e.postfixOp)];return e.MANY(()=>{const r=e.OR(e.c1||(e.c1=[{ALT:()=>e.CONSUME($c).image},{ALT:()=>e.CONSUME(Jc).image},{ALT:()=>e.CONSUME(tu).image},{ALT:()=>e.CONSUME(Qc).image},{ALT:()=>e.CONSUME(eu).image},{ALT:()=>e.CONSUME(ru).image},{ALT:()=>e.CONSUME(nu).image},{ALT:()=>e.CONSUME(hu).image},{ALT:()=>e.CONSUME(fu).image},{ALT:()=>e.CONSUME(du).image},{ALT:()=>e.CONSUME(cu).image},{ALT:()=>e.CONSUME(uu).image},{ALT:()=>e.CONSUME(lu).image},{ALT:()=>e.CONSUME(Wc).image},{ALT:()=>e.CONSUME(Gc).image},{ALT:()=>e.CONSUME(Kc).image}]));t.push([r,e.getLexerPosition(),vc.includes(r)]),n.push(e.SUBRULE2(e.postfixOp))}),e.ACTION(()=>{let e=t.length;const r=Ac.length;for(let i=0;e>0&&i<r;i++){const r=Ac[i];let o=t.length;for(let i=0;i<o;i++){const s=t[i],a=s[0];if(!r.includes(a))continue;let c=sc(a,n[i],n[i+1],s[2]);c=this._ensureWhitespace(c,s[1]),t.splice(i,1),n.splice(i,2,c),i--,o--,e--}}}),n[0]}),e.RULE("plusMinusOp",()=>e.OR([{ALT:()=>e.CONSUME(Jc).image},{ALT:()=>e.CONSUME(tu).image}])),e.RULE("postfixOp",()=>{let t=e.SUBRULE(e.prefixOp);const n=[];return e.MANY(()=>{const t=e.OR([{ALT:()=>e.CONSUME(iu).image},{ALT:()=>e.CONSUME(ou).image}]);e.ACTION(()=>{n.push([t,e.getLexerPosition()])})}),e.ACTION(()=>{const e=n.length;if(0!==e)for(let r=0;r<e;r++){const e=n[r],i=e[0],o=e[1],s=vc.includes(i);t=ac(i,t,s),t=this._ensureWhitespace(t,o)}}),t}),e.RULE("prefixOp",()=>{const t=[];e.MANY(()=>{const n=e.OR([{ALT:()=>e.CONSUME(Jc).image},{ALT:()=>e.CONSUME(tu).image},{ALT:()=>e.CONSUME(jc).image}]);e.ACTION(()=>{t.push([n,e.getLexerPosition()])})});let n=e.SUBRULE(e.formula);return e.ACTION(()=>{const e=t.length;if(0!==e)for(let r=e-1;r>=0;r--){const e=t[r],i=e[0],o=e[1],s=vc.includes(i);n=cc(i,n,s),n=this._ensureWhitespace(n,o)}}),n}),e.RULE("intersectOp",()=>{const t=[e.SUBRULE(e.infixOp)];return e.MANY(()=>{e.OPTION({GATE:()=>{const t=e.LA(0);return e.LA(1).startOffset>t.endOffset+1},DEF:()=>{t.push(e.SUBRULE3(e.infixOp))}})}),e.ACTION(()=>{for(;t.length>1;){let e=t.length-1;for(let n=0;n<e;n++){const r=t[n],i=t[n+1],o=sc(" ",r,i,!0);if(delete r.wsAfter,i.wsBefore){const e=i.wsBefore.slice(0,-1),t=e.length;delete i.wsBefore,t>0&&(o.wsBefore=e)}n+1<e&&delete i.wsAfter,t.splice(n,2,o),n--,e--}}}),t[0]}),e.RULE("formula",()=>e.OR9([{ALT:()=>e.SUBRULE(e.referenceWithoutInfix)},{ALT:()=>e.SUBRULE(e.function)},{ALT:()=>e.SUBRULE(e.paren)},{ALT:()=>e.SUBRULE(e.namedTableReference)},{ALT:()=>e.SUBRULE(e.bracketedString)},{ALT:()=>e.SUBRULE(e.squareParen)},{ALT:()=>e.SUBRULE(e.literal)},{ALT:()=>e.SUBRULE(e.literalArray)}])),e.RULE("group",()=>{const t=[];return e.MANY(()=>{e.CONSUME(Bc);const n=e.SUBRULE2(e.intersectOp);e.ACTION(()=>{t.push(n)})}),t}),e.RULE("paren",()=>t("paren",Vc,Hc)),e.RULE("literalArray",()=>{let t={type:"row",value:[],isLiteral:!0};e.CONSUME(qc);const n=e.getLexerPosition();let r=e.ACTION(()=>this._ensureWhitespace({type:"array",value:[t],isLiteral:!0},n,!0));const i=e.SUBRULE(e.literalForArray);e.ACTION(()=>{t.value.push(i)}),e.MANY(()=>{const n=e.OR([{ALT:()=>e.CONSUME(Bc).image},{ALT:()=>e.CONSUME(zc).image}]),i=e.SUBRULE2(e.literalForArray);e.ACTION(()=>{","===n||(t={type:"row",value:[],isLiteral:!0},r.value.push(t)),t.value.push(i)})});const o=e.OPTION(()=>this.CONSUME(Zc));return r=e.ACTION(()=>(o||this._reportError(r,"Missing closing parenthesis '}'",n),this._ensureWhitespace(r,e.getLexerPosition(),!1,!0))),r}),e.RULE("literalForArray",()=>e.OR([{ALT:()=>{const t=e.OPTION(()=>e.SUBRULE(e.plusMinusOp)),n=e.CONSUME(Mc),r=e.ACTION(()=>this._ensureWhitespace(lc(n.image),e.getLexerPosition()));return t?e.ACTION(()=>function(e,t){return{type:"prefix",value:e,inputs:[t]}}(t,r)):r}},{ALT:()=>{const t=e.CONSUME(Oc);return e.ACTION(()=>this._ensureWhitespace(hc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Uc);return e.ACTION(()=>this._ensureWhitespace(fc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Cc);return e.ACTION(()=>this._ensureWhitespace(dc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(kc);return e.ACTION(()=>this._ensureWhitespace(pc(t.image),e.getLexerPosition()))}}])),e.RULE("literal",()=>e.OR([{ALT:()=>{const t=e.CONSUME(Mc);return e.ACTION(()=>this._ensureWhitespace(lc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Oc);return e.ACTION(()=>this._ensureWhitespace(hc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Uc);return e.ACTION(()=>this._ensureWhitespace(fc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Cc);return e.ACTION(()=>this._ensureWhitespace(dc(t.image),e.getLexerPosition()))}}])),e.RULE("function",()=>{const t=e.CONSUME(Lc).image.slice(0,-1),n=e.getLexerPosition(),r=e.SUBRULE(e.functionArguments);let i=e.ACTION(()=>this._ensureWhitespace(rc(t,r),n,!0));const o=e.OPTION(()=>this.CONSUME(Hc));return i=e.ACTION(()=>(o||this._reportError(i,"Missing closing parenthesis ')'",n),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0))),i}),e.RULE("functionArguments",()=>{const t=[];return e.MANY2(()=>{let n;e.CONSUME2(Bc),n=e.ACTION(()=>this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0)),t.push(n)}),e.OPTION(()=>{t.push(e.SUBRULE(e.intersectOp)),e.MANY(()=>{let n;e.CONSUME1(Bc),n=e.ACTION(()=>this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0)),t.push(n),e.OPTION3(()=>{t.pop(),t.push(e.SUBRULE2(e.intersectOp))})})}),t}),e.RULE("bracketedString",()=>{const t=e.CONSUME(au),n=e.getLexerPosition();return e.ACTION(()=>{const r=t.image;let i=ic("",[oc(r.substring(1,r.length-1))]);return i=this._ensureWhitespace(i,n,!0,!1),i=this._ensureWhitespace(i,e.getLexerPosition(),!1,!0),i})}),e.RULE("squareParen",()=>{e.CONSUME(Yc);const t=e.getLexerPosition();let n=ic("",[e.SUBRULE(e.structuredArgument)]);const r=e.OPTION(()=>this.CONSUME(Xc));return e.ACTION(()=>{r||this._reportError(n,"Missing closing parenthesis ']'",t),n=this._ensureWhitespace(n,t,!0,!1),n=this._ensureWhitespace(n,e.getLexerPosition(),!1,!0)}),n}),e.RULE("namedTableReference",()=>{const t=e.CONSUME(xc).image.slice(0,-1),n=e.getLexerPosition(),r=e.SUBRULE(e.structuredArguments);let i=e.ACTION(()=>this._ensureWhitespace(ic(t,r),n,!0));const o=e.OPTION(()=>this.CONSUME(Xc));return i=e.ACTION(()=>(o||this._reportError(i,"Missing closing parenthesis ']'",n),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0))),i}),e.RULE("structuredArguments",()=>{const t=[];return e.MANY2(()=>{e.CONSUME2(Bc),e.ACTION(()=>{t.push(this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0))})}),e.OPTION(()=>{const n=e.SUBRULE(e.structuredArgument);e.ACTION(()=>{n&&t.push(n)}),e.MANY(()=>{e.CONSUME1(Bc),e.OPTION3(()=>{let n=e.SUBRULE2(e.structuredArgument);e.ACTION(()=>{n||(n=this._ensureWhitespace({type:"empty",value:""},e.getLexerPosition(),!1,!0)),t.push(n)})})})}),t}),e.RULE("structuredArgument",()=>{const t=e.OPTION(()=>e.CONSUME(jc)),n=e.getLexerPosition(),r=e.OPTION2(()=>this.CONSUME(Yc));let i=e.OR([{ALT:()=>{const t=e.CONSUME(su);return e.ACTION(()=>this._ensureWhitespace(oc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(au);return e.ACTION(()=>this._ensureWhitespace(oc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(wc);return e.ACTION(()=>this._ensureWhitespace(uc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(_c);return e.ACTION(()=>this._ensureWhitespace(hc(t.image),e.getLexerPosition()))}}]);if(r){const t=e.OPTION3(()=>this.CONSUME(Hc));e.ACTION(()=>(t||this._reportError(i,"Missing closing parenthesis ']'",n),this._ensureWhitespace(i,e.getLexerPosition(),!1,!0))),i={type:"structuredArg",value:null,inputs:[i]}}return e.ACTION(()=>{t&&(i=cc(t.image,i,!0),i=this._ensureWhitespace(i,e.getLexerPosition()))}),i}),e.RULE("referenceWithoutInfix",()=>e.OR([{ALT:()=>e.SUBRULE(e.reference)},{ALT:()=>{const t=e.SUBRULE(e.prefixSheetName),n=e.SUBRULE2(e.formula);return e.ACTION(()=>{if((e=n)&&e.isFormulaError)return n;var e;n.ref&&(n.ref.sheet=t)}),n}}])),e.RULE("reference",()=>{const t=e.OPTION4(()=>e.CONSUME(jc));let n=e.OR([{ALT:()=>{const t=e.CONSUME(bc),n=e.getLexerPosition(),r=e.OPTION(()=>e.CONSUME(ou));return e.ACTION(()=>{const i=this._ensureWhitespace(function(e,t){const n=e.match(/([$]?)([A-Za-z]{1,3})([$]?)([1-9][0-9]*)/);let r=ec(n[2])-1;const i=1===n[1].length;let o=+n[4]-1;const s=1===n[3].length;return i||r===Number.MIN_SAFE_INTEGER||(r-=t.colIndex),s||o===Number.MIN_SAFE_INTEGER||(o-=t.rowIndex),{type:"cell",value:Object.freeze({colIndex:r,rowIndex:o,$colIndex:i,$rowIndex:s}),inputs:null,isReference:!0}}(t.image,e.position),n);return r?this._ensureWhitespace(ac("#",i,!0),n):i})}},{ALT:()=>{const t=e.CONSUME(wc);return e.ACTION(()=>this._ensureWhitespace(uc(t.image),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Fc);return e.ACTION(()=>this._ensureWhitespace(function(e,t){const n=e.startsWith("$");n&&(e=e.substring(1));let r=ec(e)-1;return n||r===Number.MIN_SAFE_INTEGER||(r-=t.colIndex),{type:"cell",value:Object.freeze({colIndex:r,rowIndex:Number.MIN_SAFE_INTEGER,$colIndex:n,$rowIndex:!1}),inputs:null,isReference:!0}}(t.image,e.position),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(Dc);return e.ACTION(()=>this._ensureWhitespace(nc(t.image,e.position),e.getLexerPosition()))}},{ALT:()=>{const t=e.CONSUME(kc);return e.ACTION(()=>this._ensureWhitespace(pc(t.image),e.getLexerPosition()))}}]);return e.ACTION(()=>{t&&(n=cc(t,n,!0),n=this._ensureWhitespace(n,e.getLexerPosition()))}),n}),e.RULE("prefixSheetName",()=>e.OR([{ALT:()=>e.CONSUME(Pc).image.slice(0,-1)},{ALT:()=>e.CONSUME(Sc).image.slice(1,-2).replace(/''/g,"'")}])),e.performSelfAnalysis()}_reportError(e,t,n=void 0,r="SyntaxError"){void 0===n&&(n=this.getLexerPosition()),e.error=!0,this.astErrors.push({name:r,message:t,previousToken:this.input[n],ast:e})}_ensureWhitespace(e,t,n=!1,r=!1){if(!e)return console.warn("node is null"),e;const i=this.input,o=i[t];if(e.image||(e.image=o.image),!r){const n=o.startOffset,r=i[t-1],s=r?.endOffset??-1;s+1<n&&(e.wsBefore=" ".repeat(n-s-1))}if(!n){const n=o.endOffset,r=i[t+1],s=r?.startOffset??this.inputTextLength;n+1<s&&(e.wsAfter=" ".repeat(s-n-1))}return e}_createAST(t,n){const r=function(t){const n=xa.tokenize(t);if(n.errors.length>0){const r=n.errors[0],i=r.line,o=r.column;let s="\n"+t.split("\n")[i-1]+"\n";throw s+=Array(o-1).fill(" ").join("")+"^\n",r.message=s+`Error at position ${i}:${o}\n`+r.message,r.errorLocation={line:i,column:o},new e.r.Parse(r.message,{line:i,column:o,offset:r.offset,length:r.length})}return n}(n);let i;if(!r)return i={type:"text",value:n},i;const o=r.tokens;this.input=o,this.inputTextLength=n.length;const s=t.getPosition();return this.position=s,this.astErrors=[],this.reset(),i=this.intersectOp(),i=mc(i,(e,t)=>{let n=e.type;if("function"===n&&e.value&&e.value.toUpperCase().startsWith("_XLFN.")){const t=e.value.substring(6);let r=e.image.substring(6),i=e;"ANCHORARRAY"===t?(i=ac("#",e.inputs[0],!0),r="#"):"SINGLE"===t?(i=cc("@",e.inputs[0],!0),r="@"):i=rc(t,e.inputs),Tc(i,e),i.image=r,n=(e=i).type}const r=t?.isReference;if(r){const n=t.value;if((":"===n||".:."===n||".:"===n||":."===n)&&Number.isInteger(e.value)){const n=t.inputs[0]===e?t.inputs[1]:t.inputs[0];if(n&&Number.isInteger(n.value)){const t=nc(e.image,s);return Tc(t,e),t}}}else if("cell"===n){const t=e.value;if(t.rowIndex===Number.MIN_SAFE_INTEGER||t.colIndex>=16384){const t=uc(e.image);return Tc(t,e),t}}return e}),i}build(t,n){if(0===n.length)throw Error("Input must not be empty.");let r,i,o;try{r=this._createAST(t,n)}catch(t){o=t instanceof e.r.Parse?t:new e.r.Parse(t.message,t)}const s=this.errors;s.length>0&&(o=gc(s[0],n));const a=this.astErrors;return a.length>0&&(o=gc(a[0],n)),i=r?Ec(r,o):{ast:null,evaluations:e._t.EmptyArray,executions:e._t.EmptyArray,precedentsAbsolute:e._t.EmptyArray,precedentsExecute:e._t.EmptyArray,precedentsNamed:null,precedentsRelative:e._t.EmptyArray,precedentsRoot:e._t.EmptyArray,references:e._t.EmptyArray,tokens:e._t.EmptyArray,error:o},i}}class mu{constructor(e,t){this._options=e,this._compiled=t}getTextAt(t,n,r=!1){return r?e.cw(this._compiled.tokens):e.hw(this._compiled.tokens,t,n)}getTokens(){return this._compiled.tokens}getError(){return this._compiled.error??null}isEquals(t){if(!(t&&t instanceof mu))return!1;if(this===t)return!0;const n=this._compiled.tokens,r=t._compiled.tokens;return n.length===r.length&&e.cw(n)===e.cw(r)}getReferences(){const t=this._compiled,n=t.references,r=n.length;if(0===r)return e._t.EmptyArray;const i=t.precedentsExecute,o=t.precedentsRelative,s=new Array(r);for(let e=0;e<r;e++){const r=i[n[e]],a=r.inputs;if(a&&2===a.length){const t=o[i[a[0]].value],n=o[i[a[1]].value];s[e]={colStart:t.colStart,rowStart:t.rowStart,colEnd:n.colEnd,rowEnd:n.rowEnd,$colStart:t.$colStart,$rowStart:t.$rowStart,$colEnd:n.$colEnd,$rowEnd:n.$rowEnd,sheetName:t.sheetName}}else if("cell"===r.node.type){const t=o[r.value];s[e]={...t}}else if("named"===r.op){const n=t.precedentsNamed;s[e]=n[r.value]}else"error"===r.op&&(s[e]=r.node.value)}return s}setReferenceAt(t,n){const r=this._compiled,i=r.references;if(0===i.length)return e._t.EmptyArray;const o=r.precedentsExecute,s=i[t];if(void 0===s)throw new Error(`Invalid reference index: ${t}`);const a=o[s],c=a.node,u=c.inputs??e._t.EmptyArray;let l,h,f=!1;n&&(l={colIndex:n.colStart,rowIndex:n.rowStart,$colIndex:n.$colStart??!1,$rowIndex:n.$rowStart??!1},n.sheetName&&(l.sheetName=n.sheetName),f=!e.W.isSingleCell(n),f&&(h={colIndex:n.colEnd,rowIndex:n.rowEnd,$colIndex:n.$colEnd??!1,$rowIndex:n.$rowEnd??!1},n.colEnd===Number.MAX_SAFE_INTEGER&&(h.colIndex=Number.MIN_SAFE_INTEGER),n.rowEnd===Number.MAX_SAFE_INTEGER&&(h.rowIndex=Number.MIN_SAFE_INTEGER)));const d=2===u.length;let p=-1,m=-1;if(d)p=u[0].evalIndex,m=u[1].evalIndex;else{if("cell"!==c.type)throw"named"===a.op?new Error("Cannot setReference for a named reference"):new Error(`Invalidate reference index: ${t}`);p=c.evalIndex}const E=this._compiled.ast,g=mc(E,e=>{if(!e||!e.isReference)return;const t=e.type;if(!n&&Ic.includes(e.value)){const e=u[0],t=u[1];let n=e.evalIndex===p,r=t.evalIndex===m;if(n||r){const e=pc();return e.image="#REF!",e}}if("cell"!==t&&"error"!==t)return;const r=e.evalIndex;let i,o=r===p;if(o||r===m){if(n)if(d===f){let t=o?l:h;i={...e},i.value=t,i.image=null}else i=f?sc(":",tc(l),tc(h),!0):tc(l);else i=pc(),i.image="#REF!";return i}});if(g===E)return this;const T=Ec(g,this._compiled.error),A=this._options;return new mu(A,T)}_resolveNamed(t,n,r,i){const o=this._options?.getNamed;if(!o)return e.r.BuiltIn.Name;let s=o?.(t,this._options.getSheetName?.())?.[0];return s?(s.isFormulaError||(s=e.Zu(s,n,r,i)),s):e.r.BuiltIn.Name}getDirectPrecedentsAt(t,n,r=!1,i,o){const s=this._compiled,a=s.precedentsRoot,c=a.length;if(0===c)return e._t.EmptyArray;const u=s.precedentsRelative,l=s.precedentsAbsolute,h=u.length;for(let r=0;r<h;r++){const i=u[r];let o=l[r],s=e.Zu(i,t,n,o);l[r]=s}let f=!1;const d=s.precedentsExecute,p=d.length,m=Eu;for(let r=0;r<p;r++){const i=d[r],o=i.op;if(!o){const e=l[i.value];m[i.index]=e;continue}if("named"===o){f=!0,m[i.index]=this._resolveNamed(i.node.value,t,n);continue}if("error"===o){m[i.index]=i.node.value;continue}if("@"===o||"#"===o){m[i.index]=m[i.inputs[0]];continue}const s=i.inputs;if(!s)continue;let a=m[s[0]];if(void 0===a){m[i.index]=e.r.BuiltIn.Value;continue}if(a.isFormulaError){m[i.index]=a;continue}let c,u=m[s[1]];void 0!==u?u.isFormulaError?m[i.index]=u:(" "===o?c=e.W.intersectRanges(a,u):":"!==o&&".:."!==o&&":."!==o&&".:"!==o||(c=m[i.index]=e.W.unionRanges(a,u)),m[i.index]=c??e.r.BuiltIn.Null):m[i.index]=e.r.BuiltIn.Value}const E=new Array(c);for(let e=0;e<c;e++){const t=a[e],n=m[t];if(E[e]=void 0!==n?.rowStart?{...n}:n,i||o){const r=d[t];f&&"named"===r.op?(i&&(i[e]=n.$colStart||n.$colEnd),o&&(o[e]=n.$rowStart||n.$rowEnd)):(i&&(i[e]=r.hasVerticalAbs),o&&(o[e]=r.hasHorizontalAbs))}}return E}evaluate(t,n,r){const i=t.getPosition(),o=i?.rowIndex??0,s=i?.colIndex??0;let a=this._compiled;if(void 0!==n){let e;if(mc(a.ast,t=>{t.evalIndex===n&&(e=t)}),!e)throw new Error(`Invalid evalIndex: ${n}`);a=Ec(e,a.error)}if(a.error)return a.error;const c=a.evaluations,u=a.executions;let l,h;r||(r=this._resolvePrecedents(t));const f=a.precedentsExecute,d=a.precedentsRelative,p=a.precedentsAbsolute,m=f.length;for(let n=0;n<m;n++){const r=f[n],i=r.op;if(i){if("named"===i){const e=r.node;let n=this._resolveNamed(r.node.value,o,s);void 0!==n?.colStart&&(n=t.getReference(n)),c[e.evalIndex]=n}else if("error"===i){const e=r.node;c[e.evalIndex]=r.node.value}}else{const t=d[r.value];let i=p[n];const a=e.Zu(t,o,s,i),u=r.node;c[u.evalIndex]=a}}const E=a.precedentsRoot,g=E.length;if(g!==r.length)return e.r.BuiltIn.Parse;for(let e=0;e<g;e++){const t=f[E[e]].node;let n=r[e];n.isIRange&&"cell"===t.type&&n.size>1&&(n=n.getValueAt(0,0)??null),c[t.evalIndex]=n}let T;const A=n=>{const r=n.inputs,i=r?r.length:0;let o;switch(n.type){case"infix":const s=n.value;let a=c[r[0].evalIndex],u=c[r[1].evalIndex];if("+"===s&&"number"==typeof a&&"number"==typeof u){const e=a+u;return Math.abs(e)<99e-14?0:e}if("-"===s&&"number"==typeof a&&"number"==typeof u){const e=a-u;return Math.abs(e)<99e-14?0:e}if(a&&a.isFormulaError)return a;if(u&&u.isFormulaError)return u;const l=n.fn;return o=l?l(t,a,u):e.r.BuiltIn.Value,o=e.ou(o,null),o;case"function":T||(T=new Array(i)),T.length!==i&&(T.length=i);for(let e=0;e<i;e++)T[e]=c[r[e].evalIndex];return o=this._callFunction(t,n,T),o&&"function"==typeof o.then?o.then(r=>{r=e.ou(r,t),o instanceof e.r.Known&&(h=o),c[n.evalIndex]=r}).catch(t=>{const r=t instanceof e.r.Known?t:new e.r.Value("Uncaught error",{cause:t});c[n.evalIndex]=r}):o instanceof e.r.Known&&(h=o),o;case"prefix":case"postfix":let f=c[r[0].evalIndex];if(f&&f.isFormulaError)return f;const d=n.fn;return o=d?d(t,f):e.r.BuiltIn.Value,o;case"paren":if(1===i)return c[r[0].evalIndex];{const e=new Array(i);for(let t=0;t<i;t++)e[t]=c[r[t].evalIndex];return e}case"named":return null;case"empty":return}};let I=u.length;for(let e=0;e<I;e++){const t=u[e];if(h)return h;if(l)l=l.then(()=>{const e=A(t);return c[t.evalIndex]=e,e});else{const e=A(t);c[t.evalIndex]=e,e&&"function"==typeof e.then&&(l=e)}}if(l)return l.then(()=>{const e=c[c.length-1];return this._finalizeReturnValue(t,e)});const N=c[c.length-1];return this._finalizeReturnValue(t,N)}_resolvePrecedents(t){const n=t.getPosition(),r=n?.rowIndex??0,i=n?.colIndex??0,o=this.getDirectPrecedentsAt(r,i),s=o.length;let a;if(s>0){a=new Array(s);for(let n=0;n<s;n++){const r=o[n];if(r instanceof e.r.Known)a[n]=r;else if(Array.isArray(r)){const e=new Array(r.length);for(let n=0;n<r.length;n++)e[n]=t.getReference(r[n]);a[n]=e}else a[n]=t.getReference(r)}}else a=e._t.EmptyArray;return a}wrapImplicit(t,n,r){const i=this._compiled.ast;if(!i||!i.isReference)return this;if("cell"===i.type)return this;if("@"===i.value)return this;if(!r)return this;const o=e.Eu(n)+e.Su(t);if(r.has(o))return this;const s=Ec(cc("@",i,!0),this._compiled.error);return new mu(this._options,s)}_callFunction(t,n,r){const i=n?.cacheFn??t.getFunction(n.value);if(!i)return new e.r.Parse;const o=i.isBuiltIn();let s;o?n.cacheFn=i:this._context=t;try{s=i.execute(...r)}catch(t){s=t instanceof e.r.Known?t:new e.r.Value(t.message,{cause:t})}return o||(this._context=null),void 0===s?new e.r.Parse:s}_finalizeReturnValue(t,n){if(n&&void 0!==n.colStart&&(n=t.getValueAt(n.rowStart,n.colStart)),Array.isArray(n))if(1===n.length&&Array.isArray(n[0])&&1===n[0].length)n=n[0][0],Array.isArray(n)&&(n=e.r.BuiltIn.Value);else try{n=t.getRange(n)}catch(t){n=e.r.BuiltIn.Value}return n?.isIRange?1===n.size?(n=n.getValueAt(0,0,gu),null===(n=e.ou(n,t))&&(n=0)):n=n.fillEmpty(0):null===(n=e.ou(n,t))&&(n=0),n}get[Symbol.toStringTag](){return"[FormulaBlock]"}toString(){const t=this._compiled;if(t.error)return t.error.toString();const n=this._context;if(n){const e=n.getPosition();return this.getTextAt(e.rowIndex,e.colIndex)}return e.cw(t.tokens)}}const Eu=new Array(20);for(let e=0;e<Eu.length;e++)Eu[e]={colStart:0,rowStart:0,colEnd:0,rowEnd:0,sheetName:null};const gu={type:null};exports.FormulaParser=class{constructor(t){this._options={getEntireCoords:e.Xh,...t},this._astBuilder=new pu}parse(e,t){e.getPosition().sheetName;const n=this._astBuilder.build(e,t);return new mu(this._options,n)}eval(e,t){return this.parse(e,t).evaluate(e)}};
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.default={ACOS:{s:"Returns the arccosine of a number, in radians in the range 0 to Pi. The arccosine is the angle whose cosine is Number",p:{number:{d:"is the cosine of the angle you want and must be from -1 to 1"}}},ACOSH:{s:"Returns the inverse hyperbolic cosine of a number",p:{number:{d:"is any real number equal to or greater than 1"}}},ACOT:{s:"Returns the arccotangent of a number, in radians in the range 0 to Pi.",p:{number:{d:"is the cotangent of the angle you want"}}},ACOTH:{s:"Returns the inverse hyperbolic cotangent of a number",p:{number:{d:"is the hyperbolic cotangent of the angle that you want"}}},ASIN:{s:"Returns the arcsine of a number in radians, in the range -Pi/2 to Pi/2",p:{number:{d:"is the sine of the angle you want and must be from -1 to 1"}}},ASINH:{s:"Returns the inverse hyperbolic sine of a number",p:{number:{d:"is any real number equal to or greater than 1"}}},ATAN:{s:"Returns the arctangent of a number in radians, in the range -Pi/2 to Pi/2",p:{number:{d:"is the tangent of the angle you want"}}},ATAN2:{s:"Returns the arctangent of the specified x- and y- coordinates, in radians between -Pi and Pi, excluding -Pi",p:{x:{d:"is the x-coordinate of the point"},y:{d:"is the y-coordinate of the point"}}},ATANH:{s:"Returns the inverse hyperbolic tangent of a number",p:{number:{d:"is any real number between -1 and 1 excluding -1 and 1"}}},COS:{s:"Returns the cosine of an angle",p:{number:{d:"is the angle in radians for which you want the cosine"}}},COSH:{s:"Returns the hyperbolic cosine of a number",p:{number:{d:"is any real number"}}},COT:{s:"Returns the cotangent of an angle",p:{number:{d:"is the angle in radians for which you want the cotangent"}}},COTH:{s:"Returns the hyperbolic cotangent of a number",p:{number:{d:"is the angle in radians for which you want the hyperbolic cotangent"}}},CSC:{s:"Returns the cosecant of an angle",p:{number:{d:"is the angle in radians for which you want the cosecant"}}},CSCH:{s:"Returns the hyperbolic cosecant of an angle",p:{number:{d:"is the angle in radians for which you want the hyperbolic cosecant"}}},SEC:{s:"Returns the secant of an angle",p:{number:{d:"is the angle in radians for which you want the secant"}}},SECH:{s:"Returns the hyperbolic secant of an angle",p:{number:{d:"is the angle in radians for which you want the hyperbolic secant"}}},SIN:{s:"Returns the sine of an angle",p:{number:{d:"is the angle in radians for which you want the sine. Degrees * PI()/180 = radians"}}},SINH:{s:"Returns the hyperbolic sine of a number",p:{number:{d:"is any real number"}}},TAN:{s:"Returns the tangent of an angle",p:{number:{d:"is the angle in radians for which you want the tangent. Degrees * PI()/180 = radians"}}},TANH:{s:"Returns the hyperbolic tangent of a number",p:{number:{d:"is any real number"}}}};