@forgeax/view 0.2.1-beta-20260924075842

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 (585) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +742 -0
  3. package/dist/modules/backend.mjs +54 -0
  4. package/dist/modules/backend.mjs.map +7 -0
  5. package/dist/modules/browser.mjs +180 -0
  6. package/dist/modules/browser.mjs.map +7 -0
  7. package/dist/modules/carrier-contract.mjs +38 -0
  8. package/dist/modules/carrier-contract.mjs.map +7 -0
  9. package/dist/modules/carrier.mjs +13 -0
  10. package/dist/modules/carrier.mjs.map +7 -0
  11. package/dist/modules/chunks/chunk-2ASWB6IX.mjs +225 -0
  12. package/dist/modules/chunks/chunk-2ASWB6IX.mjs.map +7 -0
  13. package/dist/modules/chunks/chunk-2IJKOG2F.mjs +801 -0
  14. package/dist/modules/chunks/chunk-2IJKOG2F.mjs.map +7 -0
  15. package/dist/modules/chunks/chunk-2K3BBJ5S.mjs +9 -0
  16. package/dist/modules/chunks/chunk-2K3BBJ5S.mjs.map +7 -0
  17. package/dist/modules/chunks/chunk-32GD5LL6.mjs +482 -0
  18. package/dist/modules/chunks/chunk-32GD5LL6.mjs.map +7 -0
  19. package/dist/modules/chunks/chunk-3B4KFAEC.mjs +10 -0
  20. package/dist/modules/chunks/chunk-3B4KFAEC.mjs.map +7 -0
  21. package/dist/modules/chunks/chunk-46O5WX43.mjs +25 -0
  22. package/dist/modules/chunks/chunk-46O5WX43.mjs.map +7 -0
  23. package/dist/modules/chunks/chunk-47J5JXAB.mjs +237 -0
  24. package/dist/modules/chunks/chunk-47J5JXAB.mjs.map +7 -0
  25. package/dist/modules/chunks/chunk-4BXQOUDQ.mjs +17 -0
  26. package/dist/modules/chunks/chunk-4BXQOUDQ.mjs.map +7 -0
  27. package/dist/modules/chunks/chunk-4GQWYU2V.mjs +126 -0
  28. package/dist/modules/chunks/chunk-4GQWYU2V.mjs.map +7 -0
  29. package/dist/modules/chunks/chunk-4N5X2PRQ.mjs +48 -0
  30. package/dist/modules/chunks/chunk-4N5X2PRQ.mjs.map +7 -0
  31. package/dist/modules/chunks/chunk-4WXD2KYX.mjs +56 -0
  32. package/dist/modules/chunks/chunk-4WXD2KYX.mjs.map +7 -0
  33. package/dist/modules/chunks/chunk-6ZWWVAZK.mjs +468 -0
  34. package/dist/modules/chunks/chunk-6ZWWVAZK.mjs.map +7 -0
  35. package/dist/modules/chunks/chunk-73UZNRHN.mjs +296 -0
  36. package/dist/modules/chunks/chunk-73UZNRHN.mjs.map +7 -0
  37. package/dist/modules/chunks/chunk-7ITLCRND.mjs +10 -0
  38. package/dist/modules/chunks/chunk-7ITLCRND.mjs.map +7 -0
  39. package/dist/modules/chunks/chunk-7TGVWKH7.mjs +59 -0
  40. package/dist/modules/chunks/chunk-7TGVWKH7.mjs.map +7 -0
  41. package/dist/modules/chunks/chunk-7URFF53W.mjs +42 -0
  42. package/dist/modules/chunks/chunk-7URFF53W.mjs.map +7 -0
  43. package/dist/modules/chunks/chunk-7YSDRIFN.mjs +14 -0
  44. package/dist/modules/chunks/chunk-7YSDRIFN.mjs.map +7 -0
  45. package/dist/modules/chunks/chunk-AAFVCQPK.mjs +52 -0
  46. package/dist/modules/chunks/chunk-AAFVCQPK.mjs.map +7 -0
  47. package/dist/modules/chunks/chunk-AEK7ZESQ.mjs +18 -0
  48. package/dist/modules/chunks/chunk-AEK7ZESQ.mjs.map +7 -0
  49. package/dist/modules/chunks/chunk-AL6ZWIEU.mjs +42 -0
  50. package/dist/modules/chunks/chunk-AL6ZWIEU.mjs.map +7 -0
  51. package/dist/modules/chunks/chunk-ALT7XVMQ.mjs +73 -0
  52. package/dist/modules/chunks/chunk-ALT7XVMQ.mjs.map +7 -0
  53. package/dist/modules/chunks/chunk-ASI2HBE6.mjs +116 -0
  54. package/dist/modules/chunks/chunk-ASI2HBE6.mjs.map +7 -0
  55. package/dist/modules/chunks/chunk-ATWGCH7I.mjs +174 -0
  56. package/dist/modules/chunks/chunk-ATWGCH7I.mjs.map +7 -0
  57. package/dist/modules/chunks/chunk-C45U6IIY.mjs +692 -0
  58. package/dist/modules/chunks/chunk-C45U6IIY.mjs.map +7 -0
  59. package/dist/modules/chunks/chunk-C7R3YRA7.mjs +98 -0
  60. package/dist/modules/chunks/chunk-C7R3YRA7.mjs.map +7 -0
  61. package/dist/modules/chunks/chunk-CRMICXKN.mjs +87 -0
  62. package/dist/modules/chunks/chunk-CRMICXKN.mjs.map +7 -0
  63. package/dist/modules/chunks/chunk-CUH2G6UF.mjs +81 -0
  64. package/dist/modules/chunks/chunk-CUH2G6UF.mjs.map +7 -0
  65. package/dist/modules/chunks/chunk-D7GWRZLL.mjs +77 -0
  66. package/dist/modules/chunks/chunk-D7GWRZLL.mjs.map +7 -0
  67. package/dist/modules/chunks/chunk-DBWUIBE3.mjs +10 -0
  68. package/dist/modules/chunks/chunk-DBWUIBE3.mjs.map +7 -0
  69. package/dist/modules/chunks/chunk-DQWVWWUU.mjs +77 -0
  70. package/dist/modules/chunks/chunk-DQWVWWUU.mjs.map +7 -0
  71. package/dist/modules/chunks/chunk-DZZ2WFEU.mjs +122 -0
  72. package/dist/modules/chunks/chunk-DZZ2WFEU.mjs.map +7 -0
  73. package/dist/modules/chunks/chunk-E4UIAN26.mjs +58 -0
  74. package/dist/modules/chunks/chunk-E4UIAN26.mjs.map +7 -0
  75. package/dist/modules/chunks/chunk-EJGBVKFE.mjs +77 -0
  76. package/dist/modules/chunks/chunk-EJGBVKFE.mjs.map +7 -0
  77. package/dist/modules/chunks/chunk-EPSTTHWV.mjs +173 -0
  78. package/dist/modules/chunks/chunk-EPSTTHWV.mjs.map +7 -0
  79. package/dist/modules/chunks/chunk-ER7T6QJ3.mjs +64 -0
  80. package/dist/modules/chunks/chunk-ER7T6QJ3.mjs.map +7 -0
  81. package/dist/modules/chunks/chunk-FD4BAJ6K.mjs +389 -0
  82. package/dist/modules/chunks/chunk-FD4BAJ6K.mjs.map +7 -0
  83. package/dist/modules/chunks/chunk-FJM6WWIY.mjs +80 -0
  84. package/dist/modules/chunks/chunk-FJM6WWIY.mjs.map +7 -0
  85. package/dist/modules/chunks/chunk-FKCQYDLX.mjs +162 -0
  86. package/dist/modules/chunks/chunk-FKCQYDLX.mjs.map +7 -0
  87. package/dist/modules/chunks/chunk-FLGC65SR.mjs +10 -0
  88. package/dist/modules/chunks/chunk-FLGC65SR.mjs.map +7 -0
  89. package/dist/modules/chunks/chunk-FMCACPX5.mjs +289 -0
  90. package/dist/modules/chunks/chunk-FMCACPX5.mjs.map +7 -0
  91. package/dist/modules/chunks/chunk-FOBRLUQV.mjs +51 -0
  92. package/dist/modules/chunks/chunk-FOBRLUQV.mjs.map +7 -0
  93. package/dist/modules/chunks/chunk-FV3DSKZB.mjs +33 -0
  94. package/dist/modules/chunks/chunk-FV3DSKZB.mjs.map +7 -0
  95. package/dist/modules/chunks/chunk-G7BAFAGO.mjs +98 -0
  96. package/dist/modules/chunks/chunk-G7BAFAGO.mjs.map +7 -0
  97. package/dist/modules/chunks/chunk-GQBZMCTK.mjs +145 -0
  98. package/dist/modules/chunks/chunk-GQBZMCTK.mjs.map +7 -0
  99. package/dist/modules/chunks/chunk-GYWIY7AL.mjs +131 -0
  100. package/dist/modules/chunks/chunk-GYWIY7AL.mjs.map +7 -0
  101. package/dist/modules/chunks/chunk-H3KNBALD.mjs +256 -0
  102. package/dist/modules/chunks/chunk-H3KNBALD.mjs.map +7 -0
  103. package/dist/modules/chunks/chunk-H3M22JDL.mjs +144 -0
  104. package/dist/modules/chunks/chunk-H3M22JDL.mjs.map +7 -0
  105. package/dist/modules/chunks/chunk-HES3DNTM.mjs +40 -0
  106. package/dist/modules/chunks/chunk-HES3DNTM.mjs.map +7 -0
  107. package/dist/modules/chunks/chunk-I5BFP7SS.mjs +2392 -0
  108. package/dist/modules/chunks/chunk-I5BFP7SS.mjs.map +7 -0
  109. package/dist/modules/chunks/chunk-IGRMZYRD.mjs +15 -0
  110. package/dist/modules/chunks/chunk-IGRMZYRD.mjs.map +7 -0
  111. package/dist/modules/chunks/chunk-IKNGC766.mjs +321 -0
  112. package/dist/modules/chunks/chunk-IKNGC766.mjs.map +7 -0
  113. package/dist/modules/chunks/chunk-IVHNYKZB.mjs +35 -0
  114. package/dist/modules/chunks/chunk-IVHNYKZB.mjs.map +7 -0
  115. package/dist/modules/chunks/chunk-JHOURMYW.mjs +101 -0
  116. package/dist/modules/chunks/chunk-JHOURMYW.mjs.map +7 -0
  117. package/dist/modules/chunks/chunk-JURXMRFA.mjs +282 -0
  118. package/dist/modules/chunks/chunk-JURXMRFA.mjs.map +7 -0
  119. package/dist/modules/chunks/chunk-JWZIREC3.mjs +18 -0
  120. package/dist/modules/chunks/chunk-JWZIREC3.mjs.map +7 -0
  121. package/dist/modules/chunks/chunk-KHRTIZ56.mjs +1400 -0
  122. package/dist/modules/chunks/chunk-KHRTIZ56.mjs.map +7 -0
  123. package/dist/modules/chunks/chunk-KLJZZ23J.mjs +102 -0
  124. package/dist/modules/chunks/chunk-KLJZZ23J.mjs.map +7 -0
  125. package/dist/modules/chunks/chunk-KNBAYU5I.mjs +49 -0
  126. package/dist/modules/chunks/chunk-KNBAYU5I.mjs.map +7 -0
  127. package/dist/modules/chunks/chunk-KSZNCFU4.mjs +125 -0
  128. package/dist/modules/chunks/chunk-KSZNCFU4.mjs.map +7 -0
  129. package/dist/modules/chunks/chunk-L45W6KM6.mjs +158 -0
  130. package/dist/modules/chunks/chunk-L45W6KM6.mjs.map +7 -0
  131. package/dist/modules/chunks/chunk-LERMYZRC.mjs +239 -0
  132. package/dist/modules/chunks/chunk-LERMYZRC.mjs.map +7 -0
  133. package/dist/modules/chunks/chunk-LKJCXYSJ.mjs +91 -0
  134. package/dist/modules/chunks/chunk-LKJCXYSJ.mjs.map +7 -0
  135. package/dist/modules/chunks/chunk-MBS3EICT.mjs +25 -0
  136. package/dist/modules/chunks/chunk-MBS3EICT.mjs.map +7 -0
  137. package/dist/modules/chunks/chunk-MUOQZPVH.mjs +609 -0
  138. package/dist/modules/chunks/chunk-MUOQZPVH.mjs.map +7 -0
  139. package/dist/modules/chunks/chunk-MVEPGFSB.mjs +1 -0
  140. package/dist/modules/chunks/chunk-MVEPGFSB.mjs.map +7 -0
  141. package/dist/modules/chunks/chunk-NBJKLWJ5.mjs +42 -0
  142. package/dist/modules/chunks/chunk-NBJKLWJ5.mjs.map +7 -0
  143. package/dist/modules/chunks/chunk-NBLGKTEM.mjs +86 -0
  144. package/dist/modules/chunks/chunk-NBLGKTEM.mjs.map +7 -0
  145. package/dist/modules/chunks/chunk-NI7CS3I2.mjs +110 -0
  146. package/dist/modules/chunks/chunk-NI7CS3I2.mjs.map +7 -0
  147. package/dist/modules/chunks/chunk-NJH2OJFC.mjs +2113 -0
  148. package/dist/modules/chunks/chunk-NJH2OJFC.mjs.map +7 -0
  149. package/dist/modules/chunks/chunk-OBK4LIJB.mjs +20 -0
  150. package/dist/modules/chunks/chunk-OBK4LIJB.mjs.map +7 -0
  151. package/dist/modules/chunks/chunk-PEUT3FW7.mjs +1 -0
  152. package/dist/modules/chunks/chunk-PEUT3FW7.mjs.map +7 -0
  153. package/dist/modules/chunks/chunk-PRZOWPDN.mjs +66 -0
  154. package/dist/modules/chunks/chunk-PRZOWPDN.mjs.map +7 -0
  155. package/dist/modules/chunks/chunk-Q4RXBGQS.mjs +55 -0
  156. package/dist/modules/chunks/chunk-Q4RXBGQS.mjs.map +7 -0
  157. package/dist/modules/chunks/chunk-QBHBKOIL.mjs +55 -0
  158. package/dist/modules/chunks/chunk-QBHBKOIL.mjs.map +7 -0
  159. package/dist/modules/chunks/chunk-QD6CCRMG.mjs +20 -0
  160. package/dist/modules/chunks/chunk-QD6CCRMG.mjs.map +7 -0
  161. package/dist/modules/chunks/chunk-QF4V23GW.mjs +39 -0
  162. package/dist/modules/chunks/chunk-QF4V23GW.mjs.map +7 -0
  163. package/dist/modules/chunks/chunk-QK6W7MJO.mjs +42 -0
  164. package/dist/modules/chunks/chunk-QK6W7MJO.mjs.map +7 -0
  165. package/dist/modules/chunks/chunk-QL7V6DK7.mjs +34 -0
  166. package/dist/modules/chunks/chunk-QL7V6DK7.mjs.map +7 -0
  167. package/dist/modules/chunks/chunk-QLBQQKRI.mjs +25 -0
  168. package/dist/modules/chunks/chunk-QLBQQKRI.mjs.map +7 -0
  169. package/dist/modules/chunks/chunk-QLZQGZDC.mjs +418 -0
  170. package/dist/modules/chunks/chunk-QLZQGZDC.mjs.map +7 -0
  171. package/dist/modules/chunks/chunk-QSKQZGK7.mjs +1625 -0
  172. package/dist/modules/chunks/chunk-QSKQZGK7.mjs.map +7 -0
  173. package/dist/modules/chunks/chunk-QURKBAG4.mjs +25 -0
  174. package/dist/modules/chunks/chunk-QURKBAG4.mjs.map +7 -0
  175. package/dist/modules/chunks/chunk-R274XBEH.mjs +53 -0
  176. package/dist/modules/chunks/chunk-R274XBEH.mjs.map +7 -0
  177. package/dist/modules/chunks/chunk-R4I4JEY5.mjs +77 -0
  178. package/dist/modules/chunks/chunk-R4I4JEY5.mjs.map +7 -0
  179. package/dist/modules/chunks/chunk-RR6L6VVR.mjs +9 -0
  180. package/dist/modules/chunks/chunk-RR6L6VVR.mjs.map +7 -0
  181. package/dist/modules/chunks/chunk-RXF7SBBZ.mjs +125 -0
  182. package/dist/modules/chunks/chunk-RXF7SBBZ.mjs.map +7 -0
  183. package/dist/modules/chunks/chunk-SR66S6EJ.mjs +138 -0
  184. package/dist/modules/chunks/chunk-SR66S6EJ.mjs.map +7 -0
  185. package/dist/modules/chunks/chunk-SSQMQJ52.mjs +27 -0
  186. package/dist/modules/chunks/chunk-SSQMQJ52.mjs.map +7 -0
  187. package/dist/modules/chunks/chunk-TP26TASL.mjs +20 -0
  188. package/dist/modules/chunks/chunk-TP26TASL.mjs.map +7 -0
  189. package/dist/modules/chunks/chunk-TSAEK5P3.mjs +50 -0
  190. package/dist/modules/chunks/chunk-TSAEK5P3.mjs.map +7 -0
  191. package/dist/modules/chunks/chunk-UAY27HT3.mjs +68 -0
  192. package/dist/modules/chunks/chunk-UAY27HT3.mjs.map +7 -0
  193. package/dist/modules/chunks/chunk-UDLIWGWS.mjs +103 -0
  194. package/dist/modules/chunks/chunk-UDLIWGWS.mjs.map +7 -0
  195. package/dist/modules/chunks/chunk-UDVQHPWV.mjs +89 -0
  196. package/dist/modules/chunks/chunk-UDVQHPWV.mjs.map +7 -0
  197. package/dist/modules/chunks/chunk-UM23W3G7.mjs +237 -0
  198. package/dist/modules/chunks/chunk-UM23W3G7.mjs.map +7 -0
  199. package/dist/modules/chunks/chunk-VDZJWEAA.mjs +214 -0
  200. package/dist/modules/chunks/chunk-VDZJWEAA.mjs.map +7 -0
  201. package/dist/modules/chunks/chunk-VIGOJWSO.mjs +42 -0
  202. package/dist/modules/chunks/chunk-VIGOJWSO.mjs.map +7 -0
  203. package/dist/modules/chunks/chunk-VY3S5BWI.mjs +284 -0
  204. package/dist/modules/chunks/chunk-VY3S5BWI.mjs.map +7 -0
  205. package/dist/modules/chunks/chunk-VZXGRZYU.mjs +47 -0
  206. package/dist/modules/chunks/chunk-VZXGRZYU.mjs.map +7 -0
  207. package/dist/modules/chunks/chunk-W5DMQZB5.mjs +42 -0
  208. package/dist/modules/chunks/chunk-W5DMQZB5.mjs.map +7 -0
  209. package/dist/modules/chunks/chunk-WOMHSTVZ.mjs +918 -0
  210. package/dist/modules/chunks/chunk-WOMHSTVZ.mjs.map +7 -0
  211. package/dist/modules/chunks/chunk-XFQT7XCG.mjs +42 -0
  212. package/dist/modules/chunks/chunk-XFQT7XCG.mjs.map +7 -0
  213. package/dist/modules/chunks/chunk-XJZEVRYX.mjs +98 -0
  214. package/dist/modules/chunks/chunk-XJZEVRYX.mjs.map +7 -0
  215. package/dist/modules/chunks/chunk-XUYFV23R.mjs +317 -0
  216. package/dist/modules/chunks/chunk-XUYFV23R.mjs.map +7 -0
  217. package/dist/modules/chunks/chunk-Y5HXCPPQ.mjs +58 -0
  218. package/dist/modules/chunks/chunk-Y5HXCPPQ.mjs.map +7 -0
  219. package/dist/modules/chunks/chunk-YTHGRKGI.mjs +147 -0
  220. package/dist/modules/chunks/chunk-YTHGRKGI.mjs.map +7 -0
  221. package/dist/modules/chunks/chunk-YVQSDKAO.mjs +341 -0
  222. package/dist/modules/chunks/chunk-YVQSDKAO.mjs.map +7 -0
  223. package/dist/modules/chunks/chunk-YYXQDUVT.mjs +123 -0
  224. package/dist/modules/chunks/chunk-YYXQDUVT.mjs.map +7 -0
  225. package/dist/modules/chunks/chunk-ZFXZ2NUI.mjs +142 -0
  226. package/dist/modules/chunks/chunk-ZFXZ2NUI.mjs.map +7 -0
  227. package/dist/modules/chunks/chunk-ZLNWF4ET.mjs +9 -0
  228. package/dist/modules/chunks/chunk-ZLNWF4ET.mjs.map +7 -0
  229. package/dist/modules/chunks/chunk-ZLU5QW2O.mjs +9 -0
  230. package/dist/modules/chunks/chunk-ZLU5QW2O.mjs.map +7 -0
  231. package/dist/modules/chunks/chunk-ZNZPYE2V.mjs +28 -0
  232. package/dist/modules/chunks/chunk-ZNZPYE2V.mjs.map +7 -0
  233. package/dist/modules/chunks/core-564N45MO.mjs +7480 -0
  234. package/dist/modules/chunks/core-564N45MO.mjs.map +7 -0
  235. package/dist/modules/chunks/css-BKH4SVJG.mjs +8 -0
  236. package/dist/modules/chunks/css-BKH4SVJG.mjs.map +7 -0
  237. package/dist/modules/chunks/engine-javascript-PDVIGNGR.mjs +3241 -0
  238. package/dist/modules/chunks/engine-javascript-PDVIGNGR.mjs.map +7 -0
  239. package/dist/modules/chunks/github-dark-default-6HVTHEWF.mjs +8 -0
  240. package/dist/modules/chunks/github-dark-default-6HVTHEWF.mjs.map +7 -0
  241. package/dist/modules/chunks/github-light-default-LAXRA6XL.mjs +8 -0
  242. package/dist/modules/chunks/github-light-default-LAXRA6XL.mjs.map +7 -0
  243. package/dist/modules/chunks/glsl-UC3YWUD2.mjs +18 -0
  244. package/dist/modules/chunks/glsl-UC3YWUD2.mjs.map +7 -0
  245. package/dist/modules/chunks/html-FRVIUV63.mjs +19 -0
  246. package/dist/modules/chunks/html-FRVIUV63.mjs.map +7 -0
  247. package/dist/modules/chunks/javascript-LN3OC7S2.mjs +8 -0
  248. package/dist/modules/chunks/javascript-LN3OC7S2.mjs.map +7 -0
  249. package/dist/modules/chunks/json-5CUGWTOP.mjs +11 -0
  250. package/dist/modules/chunks/json-5CUGWTOP.mjs.map +7 -0
  251. package/dist/modules/chunks/json5-YZQI5VNO.mjs +11 -0
  252. package/dist/modules/chunks/json5-YZQI5VNO.mjs.map +7 -0
  253. package/dist/modules/chunks/jsonc-SWID6VOZ.mjs +11 -0
  254. package/dist/modules/chunks/jsonc-SWID6VOZ.mjs.map +7 -0
  255. package/dist/modules/chunks/jsx-A7RDCLJO.mjs +11 -0
  256. package/dist/modules/chunks/jsx-A7RDCLJO.mjs.map +7 -0
  257. package/dist/modules/chunks/markdown-QTCU5KP5.mjs +11 -0
  258. package/dist/modules/chunks/markdown-QTCU5KP5.mjs.map +7 -0
  259. package/dist/modules/chunks/python-LAZONBIB.mjs +11 -0
  260. package/dist/modules/chunks/python-LAZONBIB.mjs.map +7 -0
  261. package/dist/modules/chunks/rust-XWTPJFJO.mjs +11 -0
  262. package/dist/modules/chunks/rust-XWTPJFJO.mjs.map +7 -0
  263. package/dist/modules/chunks/scss-CFXRHUUW.mjs +15 -0
  264. package/dist/modules/chunks/scss-CFXRHUUW.mjs.map +7 -0
  265. package/dist/modules/chunks/shellscript-OHO3LCVU.mjs +11 -0
  266. package/dist/modules/chunks/shellscript-OHO3LCVU.mjs.map +7 -0
  267. package/dist/modules/chunks/toml-IOHFZJ5B.mjs +11 -0
  268. package/dist/modules/chunks/toml-IOHFZJ5B.mjs.map +7 -0
  269. package/dist/modules/chunks/tsx-2E6WNX2E.mjs +11 -0
  270. package/dist/modules/chunks/tsx-2E6WNX2E.mjs.map +7 -0
  271. package/dist/modules/chunks/typescript-PBKAS54P.mjs +11 -0
  272. package/dist/modules/chunks/typescript-PBKAS54P.mjs.map +7 -0
  273. package/dist/modules/chunks/wgsl-PS6QPRLZ.mjs +11 -0
  274. package/dist/modules/chunks/wgsl-PS6QPRLZ.mjs.map +7 -0
  275. package/dist/modules/chunks/xml-JECR2ACB.mjs +18 -0
  276. package/dist/modules/chunks/xml-JECR2ACB.mjs.map +7 -0
  277. package/dist/modules/chunks/yaml-P2SV4LOE.mjs +11 -0
  278. package/dist/modules/chunks/yaml-P2SV4LOE.mjs.map +7 -0
  279. package/dist/modules/cli-contributions.mjs +32 -0
  280. package/dist/modules/cli-contributions.mjs.map +7 -0
  281. package/dist/modules/cli.mjs +14 -0
  282. package/dist/modules/cli.mjs.map +7 -0
  283. package/dist/modules/command-executor.mjs +65 -0
  284. package/dist/modules/command-executor.mjs.map +7 -0
  285. package/dist/modules/commands.mjs +10 -0
  286. package/dist/modules/commands.mjs.map +7 -0
  287. package/dist/modules/embedded.mjs +18608 -0
  288. package/dist/modules/embedded.mjs.map +7 -0
  289. package/dist/modules/extension-bridge.mjs +18 -0
  290. package/dist/modules/extension-bridge.mjs.map +7 -0
  291. package/dist/modules/frontend-root.mjs +61 -0
  292. package/dist/modules/frontend-root.mjs.map +7 -0
  293. package/dist/modules/index.mjs +784 -0
  294. package/dist/modules/index.mjs.map +7 -0
  295. package/dist/modules/page.mjs +45 -0
  296. package/dist/modules/page.mjs.map +7 -0
  297. package/dist/modules/pages/scene.mjs +18 -0
  298. package/dist/modules/pages/scene.mjs.map +7 -0
  299. package/dist/modules/plugin.mjs +56 -0
  300. package/dist/modules/plugin.mjs.map +7 -0
  301. package/dist/modules/plugins/asset/frontend.mjs +23 -0
  302. package/dist/modules/plugins/asset/frontend.mjs.map +7 -0
  303. package/dist/modules/plugins/asset/i18n.mjs +15 -0
  304. package/dist/modules/plugins/asset/i18n.mjs.map +7 -0
  305. package/dist/modules/plugins/asset/identity.mjs +42 -0
  306. package/dist/modules/plugins/asset/identity.mjs.map +7 -0
  307. package/dist/modules/plugins/asset/schema.mjs +10 -0
  308. package/dist/modules/plugins/asset/schema.mjs.map +7 -0
  309. package/dist/modules/plugins/asset/ui.mjs +16 -0
  310. package/dist/modules/plugins/asset/ui.mjs.map +7 -0
  311. package/dist/modules/plugins/content-browser/frontend.mjs +17 -0
  312. package/dist/modules/plugins/content-browser/frontend.mjs.map +7 -0
  313. package/dist/modules/plugins/content-browser/i18n.mjs +15 -0
  314. package/dist/modules/plugins/content-browser/i18n.mjs.map +7 -0
  315. package/dist/modules/plugins/content-browser/identity.mjs +22 -0
  316. package/dist/modules/plugins/content-browser/identity.mjs.map +7 -0
  317. package/dist/modules/plugins/content-browser/schema.mjs +12 -0
  318. package/dist/modules/plugins/content-browser/schema.mjs.map +7 -0
  319. package/dist/modules/plugins/content-browser/ui.mjs +15 -0
  320. package/dist/modules/plugins/content-browser/ui.mjs.map +7 -0
  321. package/dist/modules/plugins/display/api.mjs +10 -0
  322. package/dist/modules/plugins/display/api.mjs.map +7 -0
  323. package/dist/modules/plugins/display/backend.mjs +16 -0
  324. package/dist/modules/plugins/display/backend.mjs.map +7 -0
  325. package/dist/modules/plugins/display/carrier-contract.mjs +38 -0
  326. package/dist/modules/plugins/display/carrier-contract.mjs.map +7 -0
  327. package/dist/modules/plugins/display/carrier.mjs +13 -0
  328. package/dist/modules/plugins/display/carrier.mjs.map +7 -0
  329. package/dist/modules/plugins/display/effects.mjs +8 -0
  330. package/dist/modules/plugins/display/effects.mjs.map +7 -0
  331. package/dist/modules/plugins/display/frontend.mjs +14 -0
  332. package/dist/modules/plugins/display/frontend.mjs.map +7 -0
  333. package/dist/modules/plugins/display/i18n.mjs +58 -0
  334. package/dist/modules/plugins/display/i18n.mjs.map +7 -0
  335. package/dist/modules/plugins/display/identity.mjs +30 -0
  336. package/dist/modules/plugins/display/identity.mjs.map +7 -0
  337. package/dist/modules/plugins/display/page-broker.mjs +12 -0
  338. package/dist/modules/plugins/display/page-broker.mjs.map +7 -0
  339. package/dist/modules/plugins/display/schema.mjs +40 -0
  340. package/dist/modules/plugins/display/schema.mjs.map +7 -0
  341. package/dist/modules/plugins/display/ui.mjs +9 -0
  342. package/dist/modules/plugins/display/ui.mjs.map +7 -0
  343. package/dist/modules/plugins/inspector/frontend.mjs +17 -0
  344. package/dist/modules/plugins/inspector/frontend.mjs.map +7 -0
  345. package/dist/modules/plugins/inspector/i18n.mjs +15 -0
  346. package/dist/modules/plugins/inspector/i18n.mjs.map +7 -0
  347. package/dist/modules/plugins/inspector/identity.mjs +22 -0
  348. package/dist/modules/plugins/inspector/identity.mjs.map +7 -0
  349. package/dist/modules/plugins/inspector/schema.mjs +12 -0
  350. package/dist/modules/plugins/inspector/schema.mjs.map +7 -0
  351. package/dist/modules/plugins/inspector/ui.mjs +16 -0
  352. package/dist/modules/plugins/inspector/ui.mjs.map +7 -0
  353. package/dist/modules/plugins/material/frontend.mjs +25 -0
  354. package/dist/modules/plugins/material/frontend.mjs.map +7 -0
  355. package/dist/modules/plugins/material/i18n.mjs +15 -0
  356. package/dist/modules/plugins/material/i18n.mjs.map +7 -0
  357. package/dist/modules/plugins/material/identity.mjs +60 -0
  358. package/dist/modules/plugins/material/identity.mjs.map +7 -0
  359. package/dist/modules/plugins/material/schema.mjs +47 -0
  360. package/dist/modules/plugins/material/schema.mjs.map +7 -0
  361. package/dist/modules/plugins/material/ui.mjs +28 -0
  362. package/dist/modules/plugins/material/ui.mjs.map +7 -0
  363. package/dist/modules/plugins/mesh/frontend.mjs +23 -0
  364. package/dist/modules/plugins/mesh/frontend.mjs.map +7 -0
  365. package/dist/modules/plugins/mesh/i18n.mjs +15 -0
  366. package/dist/modules/plugins/mesh/i18n.mjs.map +7 -0
  367. package/dist/modules/plugins/mesh/identity.mjs +54 -0
  368. package/dist/modules/plugins/mesh/identity.mjs.map +7 -0
  369. package/dist/modules/plugins/mesh/schema.mjs +10 -0
  370. package/dist/modules/plugins/mesh/schema.mjs.map +7 -0
  371. package/dist/modules/plugins/mesh/ui.mjs +26 -0
  372. package/dist/modules/plugins/mesh/ui.mjs.map +7 -0
  373. package/dist/modules/plugins/plugins/api.mjs +11 -0
  374. package/dist/modules/plugins/plugins/api.mjs.map +7 -0
  375. package/dist/modules/plugins/plugins/backend.mjs +21 -0
  376. package/dist/modules/plugins/plugins/backend.mjs.map +7 -0
  377. package/dist/modules/plugins/plugins/cli.mjs +12 -0
  378. package/dist/modules/plugins/plugins/cli.mjs.map +7 -0
  379. package/dist/modules/plugins/plugins/frontend.mjs +17 -0
  380. package/dist/modules/plugins/plugins/frontend.mjs.map +7 -0
  381. package/dist/modules/plugins/plugins/i18n.mjs +15 -0
  382. package/dist/modules/plugins/plugins/i18n.mjs.map +7 -0
  383. package/dist/modules/plugins/plugins/identity.mjs +26 -0
  384. package/dist/modules/plugins/plugins/identity.mjs.map +7 -0
  385. package/dist/modules/plugins/plugins/runtime.mjs +50 -0
  386. package/dist/modules/plugins/plugins/runtime.mjs.map +7 -0
  387. package/dist/modules/plugins/plugins/schema.mjs +12 -0
  388. package/dist/modules/plugins/plugins/schema.mjs.map +7 -0
  389. package/dist/modules/plugins/plugins/ui/panel.mjs +14 -0
  390. package/dist/modules/plugins/plugins/ui/panel.mjs.map +7 -0
  391. package/dist/modules/plugins/plugins/ui.mjs +15 -0
  392. package/dist/modules/plugins/plugins/ui.mjs.map +7 -0
  393. package/dist/modules/plugins/scene/frontend.mjs +18 -0
  394. package/dist/modules/plugins/scene/frontend.mjs.map +7 -0
  395. package/dist/modules/plugins/scene/identity.mjs +14 -0
  396. package/dist/modules/plugins/scene/identity.mjs.map +7 -0
  397. package/dist/modules/plugins/scene-tree/frontend.mjs +17 -0
  398. package/dist/modules/plugins/scene-tree/frontend.mjs.map +7 -0
  399. package/dist/modules/plugins/scene-tree/i18n.mjs +15 -0
  400. package/dist/modules/plugins/scene-tree/i18n.mjs.map +7 -0
  401. package/dist/modules/plugins/scene-tree/identity.mjs +22 -0
  402. package/dist/modules/plugins/scene-tree/identity.mjs.map +7 -0
  403. package/dist/modules/plugins/scene-tree/schema.mjs +12 -0
  404. package/dist/modules/plugins/scene-tree/schema.mjs.map +7 -0
  405. package/dist/modules/plugins/scene-tree/ui.mjs +16 -0
  406. package/dist/modules/plugins/scene-tree/ui.mjs.map +7 -0
  407. package/dist/modules/plugins/texture/frontend.mjs +23 -0
  408. package/dist/modules/plugins/texture/frontend.mjs.map +7 -0
  409. package/dist/modules/plugins/texture/i18n.mjs +15 -0
  410. package/dist/modules/plugins/texture/i18n.mjs.map +7 -0
  411. package/dist/modules/plugins/texture/identity.mjs +54 -0
  412. package/dist/modules/plugins/texture/identity.mjs.map +7 -0
  413. package/dist/modules/plugins/texture/schema.mjs +10 -0
  414. package/dist/modules/plugins/texture/schema.mjs.map +7 -0
  415. package/dist/modules/plugins/texture/ui.mjs +26 -0
  416. package/dist/modules/plugins/texture/ui.mjs.map +7 -0
  417. package/dist/modules/plugins/viewport/frontend.mjs +27 -0
  418. package/dist/modules/plugins/viewport/frontend.mjs.map +7 -0
  419. package/dist/modules/plugins/viewport/identity.mjs +28 -0
  420. package/dist/modules/plugins/viewport/identity.mjs.map +7 -0
  421. package/dist/modules/plugins/viewport/presentation-identity.mjs +10 -0
  422. package/dist/modules/plugins/viewport/presentation-identity.mjs.map +7 -0
  423. package/dist/modules/plugins/viewport/presentation.mjs +18 -0
  424. package/dist/modules/plugins/viewport/presentation.mjs.map +7 -0
  425. package/dist/modules/plugins/viewport/schema.mjs +18 -0
  426. package/dist/modules/plugins/viewport/schema.mjs.map +7 -0
  427. package/dist/modules/plugins/viewport/workspace-shell.mjs +29 -0
  428. package/dist/modules/plugins/viewport/workspace-shell.mjs.map +7 -0
  429. package/dist/modules/shell/contract.mjs +10 -0
  430. package/dist/modules/shell/contract.mjs.map +7 -0
  431. package/dist/modules/shell/frontend.mjs +14 -0
  432. package/dist/modules/shell/frontend.mjs.map +7 -0
  433. package/dist/modules/shell/layout-zones.mjs +20 -0
  434. package/dist/modules/shell/layout-zones.mjs.map +7 -0
  435. package/dist/modules/start-cli.mjs +57 -0
  436. package/dist/modules/start-cli.mjs.map +7 -0
  437. package/dist/modules/start.mjs +18 -0
  438. package/dist/modules/start.mjs.map +7 -0
  439. package/dist/modules/viewer/catalog/backend.mjs +47 -0
  440. package/dist/modules/viewer/catalog/backend.mjs.map +7 -0
  441. package/dist/modules/viewer/catalog/frontend.mjs +55 -0
  442. package/dist/modules/viewer/catalog/frontend.mjs.map +7 -0
  443. package/dist/modules/viewer/catalog/shared.mjs +43 -0
  444. package/dist/modules/viewer/catalog/shared.mjs.map +7 -0
  445. package/dist/modules/viewer/catalog.mjs +85 -0
  446. package/dist/modules/viewer/catalog.mjs.map +7 -0
  447. package/dist/modules/viewer/cli.mjs +23 -0
  448. package/dist/modules/viewer/cli.mjs.map +7 -0
  449. package/dist/modules/viewer-host/frontend.mjs +65 -0
  450. package/dist/modules/viewer-host/frontend.mjs.map +7 -0
  451. package/dist/modules/viewer-host/page-registry.mjs +27 -0
  452. package/dist/modules/viewer-host/page-registry.mjs.map +7 -0
  453. package/dist/modules/viewer-host/slot-registry.mjs +8 -0
  454. package/dist/modules/viewer-host/slot-registry.mjs.map +7 -0
  455. package/dist/modules/viewer-host.mjs +43 -0
  456. package/dist/modules/viewer-host.mjs.map +7 -0
  457. package/dist/modules/viewer.mjs +85 -0
  458. package/dist/modules/viewer.mjs.map +7 -0
  459. package/dist/modules/workspace/adopt-surface.mjs +16 -0
  460. package/dist/modules/workspace/adopt-surface.mjs.map +7 -0
  461. package/dist/modules/workspace/api.mjs +8 -0
  462. package/dist/modules/workspace/api.mjs.map +7 -0
  463. package/dist/modules/workspace/backend.mjs +23 -0
  464. package/dist/modules/workspace/backend.mjs.map +7 -0
  465. package/dist/modules/workspace/broker.mjs +16 -0
  466. package/dist/modules/workspace/broker.mjs.map +7 -0
  467. package/dist/modules/workspace/cli.mjs +9 -0
  468. package/dist/modules/workspace/cli.mjs.map +7 -0
  469. package/dist/modules/workspace/client.mjs +15 -0
  470. package/dist/modules/workspace/client.mjs.map +7 -0
  471. package/dist/modules/workspace/command-error.mjs +16 -0
  472. package/dist/modules/workspace/command-error.mjs.map +7 -0
  473. package/dist/modules/workspace/contract.mjs +71 -0
  474. package/dist/modules/workspace/contract.mjs.map +7 -0
  475. package/dist/modules/workspace/demo-client.mjs +127 -0
  476. package/dist/modules/workspace/demo-client.mjs.map +7 -0
  477. package/dist/modules/workspace/engine-adapter.mjs +16 -0
  478. package/dist/modules/workspace/engine-adapter.mjs.map +7 -0
  479. package/dist/modules/workspace/engine-presentation.mjs +10 -0
  480. package/dist/modules/workspace/engine-presentation.mjs.map +7 -0
  481. package/dist/modules/workspace/extension-bridge.mjs +18 -0
  482. package/dist/modules/workspace/extension-bridge.mjs.map +7 -0
  483. package/dist/modules/workspace/frontend-plugin.mjs +18 -0
  484. package/dist/modules/workspace/frontend-plugin.mjs.map +7 -0
  485. package/dist/modules/workspace/frontend.mjs +29 -0
  486. package/dist/modules/workspace/frontend.mjs.map +7 -0
  487. package/dist/modules/workspace/id.mjs +8 -0
  488. package/dist/modules/workspace/id.mjs.map +7 -0
  489. package/dist/modules/workspace/inspection-presentation.mjs +12 -0
  490. package/dist/modules/workspace/inspection-presentation.mjs.map +7 -0
  491. package/dist/modules/workspace/locale-bridge.mjs +14 -0
  492. package/dist/modules/workspace/locale-bridge.mjs.map +7 -0
  493. package/dist/modules/workspace/page-title.mjs +13 -0
  494. package/dist/modules/workspace/page-title.mjs.map +7 -0
  495. package/dist/modules/workspace/presentation.mjs +18 -0
  496. package/dist/modules/workspace/presentation.mjs.map +7 -0
  497. package/dist/modules/workspace/preview-surface.mjs +17 -0
  498. package/dist/modules/workspace/preview-surface.mjs.map +7 -0
  499. package/dist/modules/workspace/project-session.mjs +18 -0
  500. package/dist/modules/workspace/project-session.mjs.map +7 -0
  501. package/dist/modules/workspace/render-resize-sync.mjs +12 -0
  502. package/dist/modules/workspace/render-resize-sync.mjs.map +7 -0
  503. package/dist/modules/workspace/resident.mjs +16 -0
  504. package/dist/modules/workspace/resident.mjs.map +7 -0
  505. package/dist/modules/workspace/resource-open.mjs +34 -0
  506. package/dist/modules/workspace/resource-open.mjs.map +7 -0
  507. package/dist/modules/workspace/resource-page.mjs +27 -0
  508. package/dist/modules/workspace/resource-page.mjs.map +7 -0
  509. package/dist/modules/workspace/tool-runtime.mjs +14 -0
  510. package/dist/modules/workspace/tool-runtime.mjs.map +7 -0
  511. package/dist/modules/workspace/view-trace.mjs +60 -0
  512. package/dist/modules/workspace/view-trace.mjs.map +7 -0
  513. package/dist/modules/workspace/workspace-client-connection.mjs +22 -0
  514. package/dist/modules/workspace/workspace-client-connection.mjs.map +7 -0
  515. package/dist/modules/workspace/workspace-recovery.mjs +35 -0
  516. package/dist/modules/workspace/workspace-recovery.mjs.map +7 -0
  517. package/dist/modules/workspace/workspace-state.mjs +12 -0
  518. package/dist/modules/workspace/workspace-state.mjs.map +7 -0
  519. package/dist/modules/workspace-frontend.mjs +17 -0
  520. package/dist/modules/workspace-frontend.mjs.map +7 -0
  521. package/dist/viewer/assets/chunk-CilyBKbf.js +1 -0
  522. package/dist/viewer/assets/core-DSQma37-.js +13 -0
  523. package/dist/viewer/assets/core-DSQma37-.js.map +1 -0
  524. package/dist/viewer/assets/css-Bq1BXecw.js +2 -0
  525. package/dist/viewer/assets/css-Bq1BXecw.js.map +1 -0
  526. package/dist/viewer/assets/css-CWQWazmX.js +1 -0
  527. package/dist/viewer/assets/embedded-D4ZDx--W.js +2 -0
  528. package/dist/viewer/assets/embedded-D4ZDx--W.js.map +1 -0
  529. package/dist/viewer/assets/engine-javascript-BvokIV9O.js +142 -0
  530. package/dist/viewer/assets/engine-javascript-BvokIV9O.js.map +1 -0
  531. package/dist/viewer/assets/github-dark-default-DaDlj-WZ.js +2 -0
  532. package/dist/viewer/assets/github-dark-default-DaDlj-WZ.js.map +1 -0
  533. package/dist/viewer/assets/github-light-default-BqhWxAZd.js +2 -0
  534. package/dist/viewer/assets/github-light-default-BqhWxAZd.js.map +1 -0
  535. package/dist/viewer/assets/glsl-BJgVnv11.js +2 -0
  536. package/dist/viewer/assets/glsl-BJgVnv11.js.map +1 -0
  537. package/dist/viewer/assets/html-AaaHGGyt.js +2 -0
  538. package/dist/viewer/assets/html-AaaHGGyt.js.map +1 -0
  539. package/dist/viewer/assets/javascript-BX9W64FE.js +1 -0
  540. package/dist/viewer/assets/javascript-DQODvD07.js +2 -0
  541. package/dist/viewer/assets/javascript-DQODvD07.js.map +1 -0
  542. package/dist/viewer/assets/json-CpcIDpT7.js +2 -0
  543. package/dist/viewer/assets/json-CpcIDpT7.js.map +1 -0
  544. package/dist/viewer/assets/json5-Czq4A7dk.js +2 -0
  545. package/dist/viewer/assets/json5-Czq4A7dk.js.map +1 -0
  546. package/dist/viewer/assets/jsonc-BXDfCMmu.js +2 -0
  547. package/dist/viewer/assets/jsonc-BXDfCMmu.js.map +1 -0
  548. package/dist/viewer/assets/jsx-DAWscEnf.js +2 -0
  549. package/dist/viewer/assets/jsx-DAWscEnf.js.map +1 -0
  550. package/dist/viewer/assets/main-C-2CHTN_.js +15 -0
  551. package/dist/viewer/assets/main-C-2CHTN_.js.map +1 -0
  552. package/dist/viewer/assets/markdown-Cx1FMNw-.js +2 -0
  553. package/dist/viewer/assets/markdown-Cx1FMNw-.js.map +1 -0
  554. package/dist/viewer/assets/panels-entry-Ddhfjgf0.js +46 -0
  555. package/dist/viewer/assets/panels-entry-Ddhfjgf0.js.map +1 -0
  556. package/dist/viewer/assets/python-CYPKjWV9.js +2 -0
  557. package/dist/viewer/assets/python-CYPKjWV9.js.map +1 -0
  558. package/dist/viewer/assets/rust-0e5cNx_V.js +2 -0
  559. package/dist/viewer/assets/rust-0e5cNx_V.js.map +1 -0
  560. package/dist/viewer/assets/scss-B-aKzLbT.js +2 -0
  561. package/dist/viewer/assets/scss-B-aKzLbT.js.map +1 -0
  562. package/dist/viewer/assets/shellscript-CpXD-pSm.js +2 -0
  563. package/dist/viewer/assets/shellscript-CpXD-pSm.js.map +1 -0
  564. package/dist/viewer/assets/style-ClttNKZk.css +2 -0
  565. package/dist/viewer/assets/styles-BXozhwiU.js +11 -0
  566. package/dist/viewer/assets/styles-BXozhwiU.js.map +1 -0
  567. package/dist/viewer/assets/toml-GmchYTXa.js +2 -0
  568. package/dist/viewer/assets/toml-GmchYTXa.js.map +1 -0
  569. package/dist/viewer/assets/tsx-Crj1Bi53.js +2 -0
  570. package/dist/viewer/assets/tsx-Crj1Bi53.js.map +1 -0
  571. package/dist/viewer/assets/typescript-xi0cSHCO.js +2 -0
  572. package/dist/viewer/assets/typescript-xi0cSHCO.js.map +1 -0
  573. package/dist/viewer/assets/wgsl-BoEPRo9U.js +2 -0
  574. package/dist/viewer/assets/wgsl-BoEPRo9U.js.map +1 -0
  575. package/dist/viewer/assets/xml-B8JqQrMD.js +2 -0
  576. package/dist/viewer/assets/xml-B8JqQrMD.js.map +1 -0
  577. package/dist/viewer/assets/yaml-DsIB85X9.js +2 -0
  578. package/dist/viewer/assets/yaml-DsIB85X9.js.map +1 -0
  579. package/dist/viewer/index.html +15 -0
  580. package/dist/viewer/panels.js +1 -0
  581. package/host.pack.json +13 -0
  582. package/package.json +174 -0
  583. package/skills/forgeax-view-cli/SKILL.md +74 -0
  584. package/skills/forgeax-view-start/SKILL.md +202 -0
  585. package/skills/forgeax-view-start/scripts/start-view.mjs +202 -0
@@ -0,0 +1,3241 @@
1
+ import "./chunk-FLGC65SR.mjs";
2
+
3
+ // node_modules/.pnpm/@shikijs+engine-javascript@4.4.3/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs
4
+ var MAX = 4294967295;
5
+ var JavaScriptScanner = class {
6
+ patterns;
7
+ options;
8
+ regexps;
9
+ constructor(patterns, options = {}) {
10
+ this.patterns = patterns;
11
+ this.options = options;
12
+ const { forgiving = false, cache, regexConstructor } = options;
13
+ if (!regexConstructor) throw new Error("Option `regexConstructor` is not provided");
14
+ this.regexps = patterns.map((p) => {
15
+ if (typeof p !== "string") return p;
16
+ const cached = cache?.get(p);
17
+ if (cached) {
18
+ if (cached instanceof RegExp) return cached;
19
+ if (forgiving) return null;
20
+ throw cached;
21
+ }
22
+ try {
23
+ const regex = regexConstructor(p);
24
+ cache?.set(p, regex);
25
+ return regex;
26
+ } catch (e) {
27
+ cache?.set(p, e);
28
+ if (forgiving) return null;
29
+ throw e;
30
+ }
31
+ });
32
+ }
33
+ findNextMatchSync(string, startPosition, _options) {
34
+ const str = typeof string === "string" ? string : string.content;
35
+ const pending = [];
36
+ function toResult(index, match, offset = 0) {
37
+ return {
38
+ index,
39
+ captureIndices: match.indices.map((indice) => {
40
+ if (indice == null) return {
41
+ start: MAX,
42
+ end: MAX,
43
+ length: 0
44
+ };
45
+ return {
46
+ start: indice[0] + offset,
47
+ end: indice[1] + offset,
48
+ length: indice[1] - indice[0]
49
+ };
50
+ })
51
+ };
52
+ }
53
+ for (let i2 = 0; i2 < this.regexps.length; i2++) {
54
+ const regexp = this.regexps[i2];
55
+ if (!regexp) continue;
56
+ try {
57
+ regexp.lastIndex = startPosition;
58
+ const match = regexp.exec(str);
59
+ if (!match) continue;
60
+ if (match.index === startPosition) return toResult(i2, match, 0);
61
+ pending.push([
62
+ i2,
63
+ match,
64
+ 0
65
+ ]);
66
+ } catch (e) {
67
+ if (this.options.forgiving) continue;
68
+ throw e;
69
+ }
70
+ }
71
+ if (pending.length) {
72
+ const minIndex = Math.min(...pending.map((m3) => m3[1].index));
73
+ for (const [i2, match, offset] of pending) if (match.index === minIndex) return toResult(i2, match, offset);
74
+ }
75
+ return null;
76
+ }
77
+ };
78
+
79
+ // node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js
80
+ function r(e) {
81
+ if ([...e].length !== 1) throw new Error(`Expected "${e}" to be a single code point`);
82
+ return e.codePointAt(0);
83
+ }
84
+ function l(e, t, n) {
85
+ return e.has(t) || e.set(t, n), e.get(t);
86
+ }
87
+ var i = /* @__PURE__ */ new Set(["alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "word", "xdigit"]);
88
+ var o = String.raw;
89
+ function u(e, t) {
90
+ if (e == null) throw new Error(t ?? "Value expected");
91
+ return e;
92
+ }
93
+
94
+ // node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js
95
+ var m = o`\[\^?`;
96
+ var b = `c.? | C(?:-.?)?|${o`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${o`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${o`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${o`o\{[^\}]*\}?`}|${o`\d{1,3}`}`;
97
+ var y = /[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/;
98
+ var C = new RegExp(o`
99
+ \\ (?:
100
+ ${b}
101
+ | [gk]<[^>]*>?
102
+ | [gk]'[^']*'?
103
+ | .
104
+ )
105
+ | \( (?:
106
+ \? (?:
107
+ [:=!>({]
108
+ | <[=!]
109
+ | <[^>]*>
110
+ | '[^']*'
111
+ | ~\|?
112
+ | #(?:[^)\\]|\\.?)*
113
+ | [^:)]*[:)]
114
+ )?
115
+ | \*[^\)]*\)?
116
+ )?
117
+ | (?:${y.source})+
118
+ | ${m}
119
+ | .
120
+ `.replace(/\s+/g, ""), "gsu");
121
+ var T = new RegExp(o`
122
+ \\ (?:
123
+ ${b}
124
+ | .
125
+ )
126
+ | \[:(?:\^?\p{Alpha}+|\^):\]
127
+ | ${m}
128
+ | &&
129
+ | .
130
+ `.replace(/\s+/g, ""), "gsu");
131
+ function M(e, n = {}) {
132
+ const t = { flags: "", ...n, rules: { captureGroup: false, singleline: false, ...n.rules } };
133
+ if (typeof e != "string") throw new Error("String expected as pattern");
134
+ const o3 = Y(t.flags), s2 = [o3.extended], a2 = { captureGroup: t.rules.captureGroup, getCurrentModX() {
135
+ return s2.at(-1);
136
+ }, numOpenGroups: 0, popModX() {
137
+ s2.pop();
138
+ }, pushModX(u2) {
139
+ s2.push(u2);
140
+ }, replaceCurrentModX(u2) {
141
+ s2[s2.length - 1] = u2;
142
+ }, singleline: t.rules.singleline };
143
+ let r4 = [], i2;
144
+ for (C.lastIndex = 0; i2 = C.exec(e); ) {
145
+ const u2 = F(a2, e, i2[0], C.lastIndex);
146
+ u2.tokens ? r4.push(...u2.tokens) : u2.token && r4.push(u2.token), u2.lastIndex !== void 0 && (C.lastIndex = u2.lastIndex);
147
+ }
148
+ const l3 = [];
149
+ let c = 0;
150
+ r4.filter((u2) => u2.type === "GroupOpen").forEach((u2) => {
151
+ u2.kind === "capturing" ? u2.number = ++c : u2.raw === "(" && l3.push(u2);
152
+ }), c || l3.forEach((u2, S2) => {
153
+ u2.kind = "capturing", u2.number = S2 + 1;
154
+ });
155
+ const g = c || l3.length;
156
+ return { tokens: r4.map((u2) => u2.type === "EscapedNumber" ? ee(u2, g) : u2).flat(), flags: o3 };
157
+ }
158
+ function F(e, n, t, o3) {
159
+ const [s2, a2] = t;
160
+ if (t === "[" || t === "[^") {
161
+ const r4 = K(n, t, o3);
162
+ return { tokens: r4.tokens, lastIndex: r4.lastIndex };
163
+ }
164
+ if (s2 === "\\") {
165
+ if ("AbBGyYzZ".includes(a2)) return { token: w(t, t) };
166
+ if (/^\\g[<']/.test(t)) {
167
+ if (!/^\\g(?:<[^>]+>|'[^']+')$/.test(t)) throw new Error(`Invalid group name "${t}"`);
168
+ return { token: R(t) };
169
+ }
170
+ if (/^\\k[<']/.test(t)) {
171
+ if (!/^\\k(?:<[^>]+>|'[^']+')$/.test(t)) throw new Error(`Invalid group name "${t}"`);
172
+ return { token: A(t) };
173
+ }
174
+ if (a2 === "K") return { token: I("keep", t) };
175
+ if (a2 === "N" || a2 === "R") return { token: k("newline", t, { negate: a2 === "N" }) };
176
+ if (a2 === "O") return { token: k("any", t) };
177
+ if (a2 === "X") return { token: k("text_segment", t) };
178
+ const r4 = x(t, { inCharClass: false });
179
+ return Array.isArray(r4) ? { tokens: r4 } : { token: r4 };
180
+ }
181
+ if (s2 === "(") {
182
+ if (a2 === "*") return { token: j(t) };
183
+ if (t === "(?{") throw new Error(`Unsupported callout "${t}"`);
184
+ if (t.startsWith("(?#")) {
185
+ if (n[o3] !== ")") throw new Error('Unclosed comment group "(?#"');
186
+ return { lastIndex: o3 + 1 };
187
+ }
188
+ if (/^\(\?[-imx]+[:)]$/.test(t)) return { token: L(t, e) };
189
+ if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, t === "(" && !e.captureGroup || t === "(?:") return { token: f("group", t) };
190
+ if (t === "(?>") return { token: f("atomic", t) };
191
+ if (t === "(?=" || t === "(?!" || t === "(?<=" || t === "(?<!") return { token: f(t[2] === "<" ? "lookbehind" : "lookahead", t, { negate: t.endsWith("!") }) };
192
+ if (t === "(" && e.captureGroup || t.startsWith("(?<") && t.endsWith(">") || t.startsWith("(?'") && t.endsWith("'")) return { token: f("capturing", t, { ...t !== "(" && { name: t.slice(3, -1) } }) };
193
+ if (t.startsWith("(?~")) {
194
+ if (t === "(?~|") throw new Error(`Unsupported absence function kind "${t}"`);
195
+ return { token: f("absence_repeater", t) };
196
+ }
197
+ throw t === "(?(" ? new Error(`Unsupported conditional "${t}"`) : new Error(`Invalid or unsupported group option "${t}"`);
198
+ }
199
+ if (t === ")") {
200
+ if (e.popModX(), e.numOpenGroups--, e.numOpenGroups < 0) throw new Error('Unmatched ")"');
201
+ return { token: Q(t) };
202
+ }
203
+ if (e.getCurrentModX()) {
204
+ if (t === "#") {
205
+ const r4 = n.indexOf(`
206
+ `, o3);
207
+ return { lastIndex: r4 === -1 ? n.length : r4 };
208
+ }
209
+ if (/^\s$/.test(t)) {
210
+ const r4 = /\s+/y;
211
+ return r4.lastIndex = o3, { lastIndex: r4.exec(n) ? r4.lastIndex : o3 };
212
+ }
213
+ }
214
+ if (t === ".") return { token: k("dot", t) };
215
+ if (t === "^" || t === "$") {
216
+ const r4 = e.singleline ? { "^": o`\A`, $: o`\Z` }[t] : t;
217
+ return { token: w(r4, t) };
218
+ }
219
+ return t === "|" ? { token: P(t) } : y.test(t) ? { tokens: te(t) } : { token: d(r(t), t) };
220
+ }
221
+ function K(e, n, t) {
222
+ const o3 = [E(n[1] === "^", n)];
223
+ let s2 = 1, a2;
224
+ for (T.lastIndex = t; a2 = T.exec(e); ) {
225
+ const r4 = a2[0];
226
+ if (r4[0] === "[" && r4[1] !== ":") s2++, o3.push(E(r4[1] === "^", r4));
227
+ else if (r4 === "]") {
228
+ if (o3.at(-1).type === "CharacterClassOpen") o3.push(d(93, r4));
229
+ else if (s2--, o3.push(z(r4)), !s2) break;
230
+ } else {
231
+ const i2 = X(r4);
232
+ Array.isArray(i2) ? o3.push(...i2) : o3.push(i2);
233
+ }
234
+ }
235
+ return { tokens: o3, lastIndex: T.lastIndex || e.length };
236
+ }
237
+ function X(e) {
238
+ if (e[0] === "\\") return x(e, { inCharClass: true });
239
+ if (e[0] === "[") {
240
+ const n = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);
241
+ if (!n || !i.has(n.groups.name)) throw new Error(`Invalid POSIX class "${e}"`);
242
+ return k("posix", e, { value: n.groups.name, negate: !!n.groups.negate });
243
+ }
244
+ return e === "-" ? U(e) : e === "&&" ? H(e) : d(r(e), e);
245
+ }
246
+ function x(e, { inCharClass: n }) {
247
+ const t = e[1];
248
+ if (t === "c" || t === "C") return Z(e);
249
+ if ("dDhHsSwW".includes(t)) return q(e);
250
+ if (e.startsWith(o`\o{`)) throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);
251
+ if (/^\\[pP]\{/.test(e)) {
252
+ if (e.length === 3) throw new Error(`Incomplete or invalid Unicode property "${e}"`);
253
+ return V(e);
254
+ }
255
+ if (/^\\x[89A-Fa-f]\p{AHex}/u.test(e)) try {
256
+ const o3 = e.split(/\\x/).slice(1).map((i2) => parseInt(i2, 16)), s2 = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }).decode(new Uint8Array(o3)), a2 = new TextEncoder();
257
+ return [...s2].map((i2) => {
258
+ const l3 = [...a2.encode(i2)].map((c) => `\\x${c.toString(16)}`).join("");
259
+ return d(r(i2), l3);
260
+ });
261
+ } catch {
262
+ throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`);
263
+ }
264
+ if (t === "u" || t === "x") return d(J(e), e);
265
+ if ($.has(t)) return d($.get(t), e);
266
+ if (/\d/.test(t)) return W(n, e);
267
+ if (e === "\\") throw new Error(o`Incomplete escape "\"`);
268
+ if (t === "M") throw new Error(`Unsupported meta "${e}"`);
269
+ if ([...e].length === 2) return d(e.codePointAt(1), e);
270
+ throw new Error(`Unexpected escape "${e}"`);
271
+ }
272
+ function P(e) {
273
+ return { type: "Alternator", raw: e };
274
+ }
275
+ function w(e, n) {
276
+ return { type: "Assertion", kind: e, raw: n };
277
+ }
278
+ function A(e) {
279
+ return { type: "Backreference", raw: e };
280
+ }
281
+ function d(e, n) {
282
+ return { type: "Character", value: e, raw: n };
283
+ }
284
+ function z(e) {
285
+ return { type: "CharacterClassClose", raw: e };
286
+ }
287
+ function U(e) {
288
+ return { type: "CharacterClassHyphen", raw: e };
289
+ }
290
+ function H(e) {
291
+ return { type: "CharacterClassIntersector", raw: e };
292
+ }
293
+ function E(e, n) {
294
+ return { type: "CharacterClassOpen", negate: e, raw: n };
295
+ }
296
+ function k(e, n, t = {}) {
297
+ return { type: "CharacterSet", kind: e, ...t, raw: n };
298
+ }
299
+ function I(e, n, t = {}) {
300
+ return e === "keep" ? { type: "Directive", kind: e, raw: n } : { type: "Directive", kind: e, flags: u(t.flags), raw: n };
301
+ }
302
+ function W(e, n) {
303
+ return { type: "EscapedNumber", inCharClass: e, raw: n };
304
+ }
305
+ function Q(e) {
306
+ return { type: "GroupClose", raw: e };
307
+ }
308
+ function f(e, n, t = {}) {
309
+ return { type: "GroupOpen", kind: e, ...t, raw: n };
310
+ }
311
+ function D(e, n, t, o3) {
312
+ return { type: "NamedCallout", kind: e, tag: n, arguments: t, raw: o3 };
313
+ }
314
+ function _(e, n, t, o3) {
315
+ return { type: "Quantifier", kind: e, min: n, max: t, raw: o3 };
316
+ }
317
+ function R(e) {
318
+ return { type: "Subroutine", raw: e };
319
+ }
320
+ var B = /* @__PURE__ */ new Set(["COUNT", "CMP", "ERROR", "FAIL", "MAX", "MISMATCH", "SKIP", "TOTAL_COUNT"]);
321
+ var $ = /* @__PURE__ */ new Map([["a", 7], ["b", 8], ["e", 27], ["f", 12], ["n", 10], ["r", 13], ["t", 9], ["v", 11]]);
322
+ function Z(e) {
323
+ const n = e[1] === "c" ? e[2] : e[3];
324
+ if (!n || !/[A-Za-z]/.test(n)) throw new Error(`Unsupported control character "${e}"`);
325
+ return d(r(n.toUpperCase()) - 64, e);
326
+ }
327
+ function L(e, n) {
328
+ let { on: t, off: o3 } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;
329
+ o3 ??= "";
330
+ const s2 = (n.getCurrentModX() || t.includes("x")) && !o3.includes("x"), a2 = v(t), r4 = v(o3), i2 = {};
331
+ if (a2 && (i2.enable = a2), r4 && (i2.disable = r4), e.endsWith(")")) return n.replaceCurrentModX(s2), I("flags", e, { flags: i2 });
332
+ if (e.endsWith(":")) return n.pushModX(s2), n.numOpenGroups++, f("group", e, { ...(a2 || r4) && { flags: i2 } });
333
+ throw new Error(`Unexpected flag modifier "${e}"`);
334
+ }
335
+ function j(e) {
336
+ const n = /\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);
337
+ if (!n) throw new Error(`Incomplete or invalid named callout "${e}"`);
338
+ const { name: t, tag: o3, args: s2 } = n.groups;
339
+ if (!t) throw new Error(`Invalid named callout "${e}"`);
340
+ if (o3 === "") throw new Error(`Named callout tag with empty value not allowed "${e}"`);
341
+ const a2 = s2 ? s2.split(",").filter((g) => g !== "").map((g) => /^[+-]?\d+$/.test(g) ? +g : g) : [], [r4, i2, l3] = a2, c = B.has(t) ? t.toLowerCase() : "custom";
342
+ switch (c) {
343
+ case "fail":
344
+ case "mismatch":
345
+ case "skip":
346
+ if (a2.length > 0) throw new Error(`Named callout arguments not allowed "${a2}"`);
347
+ break;
348
+ case "error":
349
+ if (a2.length > 1) throw new Error(`Named callout allows only one argument "${a2}"`);
350
+ if (typeof r4 == "string") throw new Error(`Named callout argument must be a number "${r4}"`);
351
+ break;
352
+ case "max":
353
+ if (!a2.length || a2.length > 2) throw new Error(`Named callout must have one or two arguments "${a2}"`);
354
+ if (typeof r4 == "string" && !/^[A-Za-z_]\w*$/.test(r4)) throw new Error(`Named callout argument one must be a tag or number "${r4}"`);
355
+ if (a2.length === 2 && (typeof i2 == "number" || !/^[<>X]$/.test(i2))) throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i2}"`);
356
+ break;
357
+ case "count":
358
+ case "total_count":
359
+ if (a2.length > 1) throw new Error(`Named callout allows only one argument "${a2}"`);
360
+ if (a2.length === 1 && (typeof r4 == "number" || !/^[<>X]$/.test(r4))) throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${r4}"`);
361
+ break;
362
+ case "cmp":
363
+ if (a2.length !== 3) throw new Error(`Named callout must have three arguments "${a2}"`);
364
+ if (typeof r4 == "string" && !/^[A-Za-z_]\w*$/.test(r4)) throw new Error(`Named callout argument one must be a tag or number "${r4}"`);
365
+ if (typeof i2 == "number" || !/^(?:[<>!=]=|[<>])$/.test(i2)) throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i2}"`);
366
+ if (typeof l3 == "string" && !/^[A-Za-z_]\w*$/.test(l3)) throw new Error(`Named callout argument three must be a tag or number "${l3}"`);
367
+ break;
368
+ case "custom":
369
+ throw new Error(`Undefined callout name "${t}"`);
370
+ default:
371
+ throw new Error(`Unexpected named callout kind "${c}"`);
372
+ }
373
+ return D(c, o3 ?? null, s2?.split(",") ?? null, e);
374
+ }
375
+ function O(e) {
376
+ let n = null, t, o3;
377
+ if (e[0] === "{") {
378
+ const { minStr: s2, maxStr: a2 } = /^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups, r4 = 1e5;
379
+ if (+s2 > r4 || a2 && +a2 > r4) throw new Error("Quantifier value unsupported in Oniguruma");
380
+ if (t = +s2, o3 = a2 === void 0 ? +s2 : a2 === "" ? 1 / 0 : +a2, t > o3 && (n = "possessive", [t, o3] = [o3, t]), e.endsWith("?")) {
381
+ if (n === "possessive") throw new Error('Unsupported possessive interval quantifier chain with "?"');
382
+ n = "lazy";
383
+ } else n || (n = "greedy");
384
+ } else t = e[0] === "+" ? 1 : 0, o3 = e[0] === "?" ? 1 : 1 / 0, n = e[1] === "+" ? "possessive" : e[1] === "?" ? "lazy" : "greedy";
385
+ return _(n, t, o3, e);
386
+ }
387
+ function q(e) {
388
+ const n = e[1].toLowerCase();
389
+ return k({ d: "digit", h: "hex", s: "space", w: "word" }[n], e, { negate: e[1] !== n });
390
+ }
391
+ function V(e) {
392
+ const { p: n, neg: t, value: o3 } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;
393
+ return k("property", e, { value: o3, negate: n === "P" && !t || n === "p" && !!t });
394
+ }
395
+ function v(e) {
396
+ const n = {};
397
+ return e.includes("i") && (n.ignoreCase = true), e.includes("m") && (n.dotAll = true), e.includes("x") && (n.extended = true), Object.keys(n).length ? n : null;
398
+ }
399
+ function Y(e) {
400
+ const n = { ignoreCase: false, dotAll: false, extended: false, digitIsAscii: false, posixIsAscii: false, spaceIsAscii: false, wordIsAscii: false, textSegmentMode: null };
401
+ for (let t = 0; t < e.length; t++) {
402
+ const o3 = e[t];
403
+ if (!"imxDPSWy".includes(o3)) throw new Error(`Invalid flag "${o3}"`);
404
+ if (o3 === "y") {
405
+ if (!/^y{[gw]}/.test(e.slice(t))) throw new Error('Invalid or unspecified flag "y" mode');
406
+ n.textSegmentMode = e[t + 2] === "g" ? "grapheme" : "word", t += 3;
407
+ continue;
408
+ }
409
+ n[{ i: "ignoreCase", m: "dotAll", x: "extended", D: "digitIsAscii", P: "posixIsAscii", S: "spaceIsAscii", W: "wordIsAscii" }[o3]] = true;
410
+ }
411
+ return n;
412
+ }
413
+ function J(e) {
414
+ if (/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e)) throw new Error(`Incomplete or invalid escape "${e}"`);
415
+ const n = e[2] === "{" ? /^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex : e.slice(2);
416
+ return parseInt(n, 16);
417
+ }
418
+ function ee(e, n) {
419
+ const { raw: t, inCharClass: o3 } = e, s2 = t.slice(1);
420
+ if (!o3 && (s2 !== "0" && s2.length === 1 || s2[0] !== "0" && +s2 <= n)) return [A(t)];
421
+ const a2 = [], r4 = s2.match(/^[0-7]+|\d/g);
422
+ for (let i2 = 0; i2 < r4.length; i2++) {
423
+ const l3 = r4[i2];
424
+ let c;
425
+ if (i2 === 0 && l3 !== "8" && l3 !== "9") {
426
+ if (c = parseInt(l3, 8), c > 127) throw new Error(o`Octal encoded byte above 177 unsupported "${t}"`);
427
+ } else c = r(l3);
428
+ a2.push(d(c, (i2 === 0 ? "\\" : "") + l3));
429
+ }
430
+ return a2;
431
+ }
432
+ function te(e) {
433
+ const n = [], t = new RegExp(y, "gy");
434
+ let o3;
435
+ for (; o3 = t.exec(e); ) {
436
+ const s2 = o3[0];
437
+ if (s2[0] === "{") {
438
+ const a2 = /^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s2);
439
+ if (a2) {
440
+ const { min: r4, max: i2 } = a2.groups;
441
+ if (+r4 > +i2 && s2.endsWith("?")) {
442
+ t.lastIndex--, n.push(O(s2.slice(0, -1)));
443
+ continue;
444
+ }
445
+ }
446
+ }
447
+ n.push(O(s2));
448
+ }
449
+ return n;
450
+ }
451
+
452
+ // node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js
453
+ function o2(e, t) {
454
+ if (!Array.isArray(e.body)) throw new Error("Expected node with body array");
455
+ if (e.body.length !== 1) return false;
456
+ const r4 = e.body[0];
457
+ return !t || Object.keys(t).every((n) => t[n] === r4[n]);
458
+ }
459
+ function s(e) {
460
+ return y2.has(e.type);
461
+ }
462
+ var y2 = /* @__PURE__ */ new Set(["AbsenceFunction", "Backreference", "CapturingGroup", "Character", "CharacterClass", "CharacterSet", "Group", "Quantifier", "Subroutine"]);
463
+
464
+ // node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js
465
+ function J2(e, r4 = {}) {
466
+ const n = { flags: "", normalizeUnknownPropertyNames: false, skipBackrefValidation: false, skipLookbehindValidation: false, skipPropertyNameValidation: false, unicodePropertyMap: null, ...r4, rules: { captureGroup: false, singleline: false, ...r4.rules } }, o3 = M(e, { flags: n.flags, rules: { captureGroup: n.rules.captureGroup, singleline: n.rules.singleline } }), i2 = (p, N) => {
467
+ const u2 = o3.tokens[t.nextIndex];
468
+ switch (t.parent = p, t.nextIndex++, u2.type) {
469
+ case "Alternator":
470
+ return b2();
471
+ case "Assertion":
472
+ return W2(u2);
473
+ case "Backreference":
474
+ return X2(u2, t);
475
+ case "Character":
476
+ return m2(u2.value, { useLastValid: !!N.isCheckingRangeEnd });
477
+ case "CharacterClassHyphen":
478
+ return ee2(u2, t, N);
479
+ case "CharacterClassOpen":
480
+ return re(u2, t, N);
481
+ case "CharacterSet":
482
+ return ne(u2, t);
483
+ case "Directive":
484
+ return I2(u2.kind, { flags: u2.flags });
485
+ case "GroupOpen":
486
+ return te2(u2, t, N);
487
+ case "NamedCallout":
488
+ return U2(u2.kind, u2.tag, u2.arguments);
489
+ case "Quantifier":
490
+ return oe(u2, t);
491
+ case "Subroutine":
492
+ return ae(u2, t);
493
+ default:
494
+ throw new Error(`Unexpected token type "${u2.type}"`);
495
+ }
496
+ }, t = { capturingGroups: [], hasNumberedRef: false, namedGroupsByName: /* @__PURE__ */ new Map(), nextIndex: 0, normalizeUnknownPropertyNames: n.normalizeUnknownPropertyNames, parent: null, skipBackrefValidation: n.skipBackrefValidation, skipLookbehindValidation: n.skipLookbehindValidation, skipPropertyNameValidation: n.skipPropertyNameValidation, subroutines: [], tokens: o3.tokens, unicodePropertyMap: n.unicodePropertyMap, walk: i2 }, d2 = B2(T2(o3.flags));
497
+ let s2 = d2.body[0];
498
+ for (; t.nextIndex < o3.tokens.length; ) {
499
+ const p = i2(s2, {});
500
+ p.type === "Alternative" ? (d2.body.push(p), s2 = p) : s2.body.push(p);
501
+ }
502
+ const { capturingGroups: a2, hasNumberedRef: l3, namedGroupsByName: c, subroutines: f2 } = t;
503
+ if (l3 && c.size && !n.rules.captureGroup) throw new Error("Numbered backref/subroutine not allowed when using named capture");
504
+ for (const { ref: p } of f2) if (typeof p == "number") {
505
+ if (p > a2.length) throw new Error("Subroutine uses a group number that's not defined");
506
+ p && (a2[p - 1].isSubroutined = true);
507
+ } else if (c.has(p)) {
508
+ if (c.get(p).length > 1) throw new Error(o`Subroutine uses a duplicate group name "\g<${p}>"`);
509
+ c.get(p)[0].isSubroutined = true;
510
+ } else throw new Error(o`Subroutine uses a group name that's not defined "\g<${p}>"`);
511
+ return d2;
512
+ }
513
+ function W2({ kind: e }) {
514
+ return F2(u({ "^": "line_start", $: "line_end", "\\A": "string_start", "\\b": "word_boundary", "\\B": "word_boundary", "\\G": "search_start", "\\y": "text_segment_boundary", "\\Y": "text_segment_boundary", "\\z": "string_end", "\\Z": "string_end_newline" }[e], `Unexpected assertion kind "${e}"`), { negate: e === o`\B` || e === o`\Y` });
515
+ }
516
+ function X2({ raw: e }, r4) {
517
+ const n = /^\\k[<']/.test(e), o3 = n ? e.slice(3, -1) : e.slice(1), i2 = (t, d2 = false) => {
518
+ const s2 = r4.capturingGroups.length;
519
+ let a2 = false;
520
+ if (t > s2) if (r4.skipBackrefValidation) a2 = true;
521
+ else throw new Error(`Not enough capturing groups defined to the left "${e}"`);
522
+ return r4.hasNumberedRef = true, k2(d2 ? s2 + 1 - t : t, { orphan: a2 });
523
+ };
524
+ if (n) {
525
+ const t = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(o3);
526
+ if (t) return i2(+t.groups.num, !!t.groups.sign);
527
+ if (/[-+]/.test(o3)) throw new Error(`Invalid backref name "${e}"`);
528
+ if (!r4.namedGroupsByName.has(o3)) throw new Error(`Group name not defined to the left "${e}"`);
529
+ return k2(o3);
530
+ }
531
+ return i2(+o3);
532
+ }
533
+ function ee2(e, r4, n) {
534
+ const { tokens: o3, walk: i2 } = r4, t = r4.parent, d2 = t.body.at(-1), s2 = o3[r4.nextIndex];
535
+ if (!n.isCheckingRangeEnd && d2 && d2.type !== "CharacterClass" && d2.type !== "CharacterClassRange" && s2 && s2.type !== "CharacterClassOpen" && s2.type !== "CharacterClassClose" && s2.type !== "CharacterClassIntersector") {
536
+ const a2 = i2(t, { ...n, isCheckingRangeEnd: true });
537
+ if (d2.type === "Character" && a2.type === "Character") return t.body.pop(), L2(d2, a2);
538
+ throw new Error("Invalid character class range");
539
+ }
540
+ return m2(r("-"));
541
+ }
542
+ function re({ negate: e }, r4, n) {
543
+ const { tokens: o3, walk: i2 } = r4, t = [C2()], d2 = o3[r4.nextIndex];
544
+ let s2 = z2(d2);
545
+ for (; s2.type !== "CharacterClassClose"; ) {
546
+ if (s2.type === "CharacterClassIntersector") t.push(C2()), r4.nextIndex++;
547
+ else {
548
+ const l3 = t.at(-1);
549
+ l3.body.push(i2(l3, n));
550
+ }
551
+ s2 = z2(o3[r4.nextIndex], d2);
552
+ }
553
+ const a2 = C2({ negate: e });
554
+ return t.length === 1 ? a2.body = t[0].body : (a2.kind = "intersection", a2.body = t.map((l3) => l3.body.length === 1 ? l3.body[0] : l3)), r4.nextIndex++, a2;
555
+ }
556
+ function ne({ kind: e, negate: r4, value: n }, o3) {
557
+ const { normalizeUnknownPropertyNames: i2, skipPropertyNameValidation: t, unicodePropertyMap: d2 } = o3;
558
+ if (e === "property") {
559
+ const s2 = w2(n);
560
+ if (i.has(s2) && !d2?.has(s2)) e = "posix", n = s2;
561
+ else return Q2(n, { negate: r4, normalizeUnknownPropertyNames: i2, skipPropertyNameValidation: t, unicodePropertyMap: d2 });
562
+ }
563
+ return e === "posix" ? R2(n, { negate: r4 }) : E2(e, { negate: r4 });
564
+ }
565
+ function te2(e, r4, n) {
566
+ const { tokens: o3, capturingGroups: i2, namedGroupsByName: t, skipLookbehindValidation: d2, walk: s2 } = r4, a2 = ie(e), l3 = a2.type === "AbsenceFunction", c = $2(a2), f2 = c && a2.negate;
567
+ if (a2.type === "CapturingGroup" && (i2.push(a2), a2.name && l(t, a2.name, []).push(a2)), l3 && n.isInAbsenceFunction) throw new Error("Nested absence function not supported by Oniguruma");
568
+ let p = D2(o3[r4.nextIndex]);
569
+ for (; p.type !== "GroupClose"; ) {
570
+ if (p.type === "Alternator") a2.body.push(b2()), r4.nextIndex++;
571
+ else {
572
+ const N = a2.body.at(-1), u2 = s2(N, { ...n, isInAbsenceFunction: n.isInAbsenceFunction || l3, isInLookbehind: n.isInLookbehind || c, isInNegLookbehind: n.isInNegLookbehind || f2 });
573
+ if (N.body.push(u2), (c || n.isInLookbehind) && !d2) {
574
+ const v2 = "Lookbehind includes a pattern not allowed by Oniguruma";
575
+ if (f2 || n.isInNegLookbehind) {
576
+ if (M2(u2) || u2.type === "CapturingGroup") throw new Error(v2);
577
+ } else if (M2(u2) || $2(u2) && u2.negate) throw new Error(v2);
578
+ }
579
+ }
580
+ p = D2(o3[r4.nextIndex]);
581
+ }
582
+ return r4.nextIndex++, a2;
583
+ }
584
+ function oe({ kind: e, min: r4, max: n }, o3) {
585
+ const i2 = o3.parent, t = i2.body.at(-1);
586
+ if (!t || !s(t)) throw new Error("Quantifier requires a repeatable token");
587
+ const d2 = _2(e, r4, n, t);
588
+ return i2.body.pop(), d2;
589
+ }
590
+ function ae({ raw: e }, r4) {
591
+ const { capturingGroups: n, subroutines: o3 } = r4;
592
+ let i2 = e.slice(3, -1);
593
+ const t = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i2);
594
+ if (t) {
595
+ const s2 = +t.groups.num, a2 = n.length;
596
+ if (r4.hasNumberedRef = true, i2 = { "": s2, "+": a2 + s2, "-": a2 + 1 - s2 }[t.groups.sign], i2 < 1) throw new Error("Invalid subroutine number");
597
+ } else i2 === "0" && (i2 = 0);
598
+ const d2 = O2(i2);
599
+ return o3.push(d2), d2;
600
+ }
601
+ function G(e, r4) {
602
+ if (e !== "repeater") throw new Error(`Unexpected absence function kind "${e}"`);
603
+ return { type: "AbsenceFunction", kind: e, body: h(r4?.body) };
604
+ }
605
+ function b2(e) {
606
+ return { type: "Alternative", body: V2(e?.body) };
607
+ }
608
+ function F2(e, r4) {
609
+ const n = { type: "Assertion", kind: e };
610
+ return (e === "word_boundary" || e === "text_segment_boundary") && (n.negate = !!r4?.negate), n;
611
+ }
612
+ function k2(e, r4) {
613
+ const n = !!r4?.orphan;
614
+ return { type: "Backreference", ref: e, ...n && { orphan: n } };
615
+ }
616
+ function P2(e, r4) {
617
+ const n = { name: void 0, isSubroutined: false, ...r4 };
618
+ if (n.name !== void 0 && !se(n.name)) throw new Error(`Group name "${n.name}" invalid in Oniguruma`);
619
+ return { type: "CapturingGroup", number: e, ...n.name && { name: n.name }, ...n.isSubroutined && { isSubroutined: n.isSubroutined }, body: h(r4?.body) };
620
+ }
621
+ function m2(e, r4) {
622
+ const n = { useLastValid: false, ...r4 };
623
+ if (e > 1114111) {
624
+ const o3 = e.toString(16);
625
+ if (n.useLastValid) e = 1114111;
626
+ else throw e > 1310719 ? new Error(`Invalid code point out of range "\\x{${o3}}"`) : new Error(`Invalid code point out of range in JS "\\x{${o3}}"`);
627
+ }
628
+ return { type: "Character", value: e };
629
+ }
630
+ function C2(e) {
631
+ const r4 = { kind: "union", negate: false, ...e };
632
+ return { type: "CharacterClass", kind: r4.kind, negate: r4.negate, body: V2(e?.body) };
633
+ }
634
+ function L2(e, r4) {
635
+ if (r4.value < e.value) throw new Error("Character class range out of order");
636
+ return { type: "CharacterClassRange", min: e, max: r4 };
637
+ }
638
+ function E2(e, r4) {
639
+ const n = !!r4?.negate, o3 = { type: "CharacterSet", kind: e };
640
+ return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (o3.negate = n), (e === "text_segment" || e === "newline" && !n) && (o3.variableLength = true), o3;
641
+ }
642
+ function I2(e, r4 = {}) {
643
+ if (e === "keep") return { type: "Directive", kind: e };
644
+ if (e === "flags") return { type: "Directive", kind: e, flags: u(r4.flags) };
645
+ throw new Error(`Unexpected directive kind "${e}"`);
646
+ }
647
+ function T2(e) {
648
+ return { type: "Flags", ...e };
649
+ }
650
+ function A2(e) {
651
+ const r4 = e?.atomic, n = e?.flags;
652
+ if (r4 && n) throw new Error("Atomic group cannot have flags");
653
+ return { type: "Group", ...r4 && { atomic: r4 }, ...n && { flags: n }, body: h(e?.body) };
654
+ }
655
+ function K2(e) {
656
+ const r4 = { behind: false, negate: false, ...e };
657
+ return { type: "LookaroundAssertion", kind: r4.behind ? "lookbehind" : "lookahead", negate: r4.negate, body: h(e?.body) };
658
+ }
659
+ function U2(e, r4, n) {
660
+ return { type: "NamedCallout", kind: e, tag: r4, arguments: n };
661
+ }
662
+ function R2(e, r4) {
663
+ const n = !!r4?.negate;
664
+ if (!i.has(e)) throw new Error(`Invalid POSIX class "${e}"`);
665
+ return { type: "CharacterSet", kind: "posix", value: e, negate: n };
666
+ }
667
+ function _2(e, r4, n, o3) {
668
+ if (r4 > n) throw new Error("Invalid reversed quantifier range");
669
+ return { type: "Quantifier", kind: e, min: r4, max: n, body: o3 };
670
+ }
671
+ function B2(e, r4) {
672
+ return { type: "Regex", body: h(r4?.body), flags: e };
673
+ }
674
+ function O2(e) {
675
+ return { type: "Subroutine", ref: e };
676
+ }
677
+ function Q2(e, r4) {
678
+ const n = { negate: false, normalizeUnknownPropertyNames: false, skipPropertyNameValidation: false, unicodePropertyMap: null, ...r4 };
679
+ let o3 = n.unicodePropertyMap?.get(w2(e));
680
+ if (!o3) {
681
+ if (n.normalizeUnknownPropertyNames) o3 = de(e);
682
+ else if (n.unicodePropertyMap && !n.skipPropertyNameValidation) throw new Error(o`Invalid Unicode property "\p{${e}}"`);
683
+ }
684
+ return { type: "CharacterSet", kind: "property", value: o3 ?? e, negate: n.negate };
685
+ }
686
+ function ie({ flags: e, kind: r4, name: n, negate: o3, number: i2 }) {
687
+ switch (r4) {
688
+ case "absence_repeater":
689
+ return G("repeater");
690
+ case "atomic":
691
+ return A2({ atomic: true });
692
+ case "capturing":
693
+ return P2(i2, { name: n });
694
+ case "group":
695
+ return A2({ flags: e });
696
+ case "lookahead":
697
+ case "lookbehind":
698
+ return K2({ behind: r4 === "lookbehind", negate: o3 });
699
+ default:
700
+ throw new Error(`Unexpected group kind "${r4}"`);
701
+ }
702
+ }
703
+ function h(e) {
704
+ if (e === void 0) e = [b2()];
705
+ else if (!Array.isArray(e) || !e.length || !e.every((r4) => r4.type === "Alternative")) throw new Error("Invalid body; expected array of one or more Alternative nodes");
706
+ return e;
707
+ }
708
+ function V2(e) {
709
+ if (e === void 0) e = [];
710
+ else if (!Array.isArray(e) || !e.every((r4) => !!r4.type)) throw new Error("Invalid body; expected array of nodes");
711
+ return e;
712
+ }
713
+ function M2(e) {
714
+ return e.type === "LookaroundAssertion" && e.kind === "lookahead";
715
+ }
716
+ function $2(e) {
717
+ return e.type === "LookaroundAssertion" && e.kind === "lookbehind";
718
+ }
719
+ function se(e) {
720
+ return /^[\p{Alpha}\p{Pc}][^)]*$/u.test(e);
721
+ }
722
+ function de(e) {
723
+ return e.trim().replace(/[- _]+/g, "_").replace(/[A-Z][a-z]+(?=[A-Z])/g, "$&_").replace(/[A-Za-z]+/g, (r4) => r4[0].toUpperCase() + r4.slice(1).toLowerCase());
724
+ }
725
+ function w2(e) {
726
+ return e.replace(/[- _]+/g, "").toLowerCase();
727
+ }
728
+ function z2(e, r4) {
729
+ const n = r4;
730
+ return u(e, `Unclosed character class${n?.type === "Character" && n.value === 93 && n.raw === "]" ? ' (started with "]")' : ""}`);
731
+ }
732
+ function D2(e) {
733
+ return u(e, "Unclosed group");
734
+ }
735
+
736
+ // node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js
737
+ function S(a2, v2, N = null) {
738
+ function b3(e, s2) {
739
+ for (let t = 0; t < e.length; t++) {
740
+ const r4 = n(e[t], s2, t, e);
741
+ t = Math.max(-1, t + r4);
742
+ }
743
+ }
744
+ function n(e, s2 = null, t = null, r4 = null) {
745
+ let i2 = 0, c = false;
746
+ const d2 = { node: e, parent: s2, key: t, container: r4, root: a2, remove() {
747
+ x2(r4).splice(Math.max(0, l2(t) + i2), 1), i2--, c = true;
748
+ }, removeAllNextSiblings() {
749
+ return x2(r4).splice(l2(t) + 1);
750
+ }, removeAllPrevSiblings() {
751
+ const o3 = l2(t) + i2;
752
+ return i2 -= o3, x2(r4).splice(0, Math.max(0, o3));
753
+ }, replaceWith(o3, m3 = {}) {
754
+ const y3 = !!m3.traverse;
755
+ r4 ? r4[Math.max(0, l2(t) + i2)] = o3 : u(s2, "Can't replace root node")[t] = o3, y3 && n(o3, s2, t, r4), c = true;
756
+ }, replaceWithMultiple(o3, m3 = {}) {
757
+ const y3 = !!m3.traverse;
758
+ if (x2(r4).splice(Math.max(0, l2(t) + i2), 1, ...o3), i2 += o3.length - 1, y3) {
759
+ let g = 0;
760
+ for (let p = 0; p < o3.length; p++) g += n(o3[p], s2, l2(t) + p + g, r4);
761
+ }
762
+ c = true;
763
+ }, skip() {
764
+ c = true;
765
+ } }, { type: f2 } = e, u2 = v2["*"], h2 = v2[f2], R3 = typeof u2 == "function" ? u2 : u2?.enter, P3 = typeof h2 == "function" ? h2 : h2?.enter;
766
+ if (R3?.(d2, N), P3?.(d2, N), !c) switch (f2) {
767
+ case "AbsenceFunction":
768
+ case "Alternative":
769
+ case "CapturingGroup":
770
+ case "CharacterClass":
771
+ case "Group":
772
+ case "LookaroundAssertion":
773
+ b3(e.body, e);
774
+ break;
775
+ case "Assertion":
776
+ case "Backreference":
777
+ case "Character":
778
+ case "CharacterSet":
779
+ case "Directive":
780
+ case "Flags":
781
+ case "NamedCallout":
782
+ case "Subroutine":
783
+ break;
784
+ case "CharacterClassRange":
785
+ n(e.min, e, "min"), n(e.max, e, "max");
786
+ break;
787
+ case "Quantifier":
788
+ n(e.body, e, "body");
789
+ break;
790
+ case "Regex":
791
+ b3(e.body, e), n(e.flags, e, "flags");
792
+ break;
793
+ default:
794
+ throw new Error(`Unexpected node type "${f2}"`);
795
+ }
796
+ return h2?.exit?.(d2, N), u2?.exit?.(d2, N), i2;
797
+ }
798
+ return n(a2), a2;
799
+ }
800
+ function x2(a2) {
801
+ if (!Array.isArray(a2)) throw new Error("Container expected");
802
+ return a2;
803
+ }
804
+ function l2(a2) {
805
+ if (typeof a2 != "number") throw new Error("Numeric key expected");
806
+ return a2;
807
+ }
808
+
809
+ // node_modules/.pnpm/regex@6.1.0/node_modules/regex/src/utils-internals.js
810
+ var noncapturingDelim = String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;
811
+ function incrementIfAtLeast(arr, threshold) {
812
+ for (let i2 = 0; i2 < arr.length; i2++) {
813
+ if (arr[i2] >= threshold) {
814
+ arr[i2]++;
815
+ }
816
+ }
817
+ }
818
+ function spliceStr(str, pos, oldValue, newValue) {
819
+ return str.slice(0, pos) + newValue + str.slice(pos + oldValue.length);
820
+ }
821
+
822
+ // node_modules/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js
823
+ var Context = Object.freeze({
824
+ DEFAULT: "DEFAULT",
825
+ CHAR_CLASS: "CHAR_CLASS"
826
+ });
827
+ function replaceUnescaped(expression, needle, replacement, context) {
828
+ const re2 = new RegExp(String.raw`${needle}|(?<$skip>\[\^?|\\?.)`, "gsu");
829
+ const negated = [false];
830
+ let numCharClassesOpen = 0;
831
+ let result = "";
832
+ for (const match of expression.matchAll(re2)) {
833
+ const { 0: m3, groups: { $skip } } = match;
834
+ if (!$skip && (!context || context === Context.DEFAULT === !numCharClassesOpen)) {
835
+ if (replacement instanceof Function) {
836
+ result += replacement(match, {
837
+ context: numCharClassesOpen ? Context.CHAR_CLASS : Context.DEFAULT,
838
+ negated: negated[negated.length - 1]
839
+ });
840
+ } else {
841
+ result += replacement;
842
+ }
843
+ continue;
844
+ }
845
+ if (m3[0] === "[") {
846
+ numCharClassesOpen++;
847
+ negated.push(m3[1] === "^");
848
+ } else if (m3 === "]" && numCharClassesOpen) {
849
+ numCharClassesOpen--;
850
+ negated.pop();
851
+ }
852
+ result += m3;
853
+ }
854
+ return result;
855
+ }
856
+ function forEachUnescaped(expression, needle, callback, context) {
857
+ replaceUnescaped(expression, needle, callback, context);
858
+ }
859
+ function execUnescaped(expression, needle, pos = 0, context) {
860
+ if (!new RegExp(needle, "su").test(expression)) {
861
+ return null;
862
+ }
863
+ const re2 = new RegExp(`${needle}|(?<$skip>\\\\?.)`, "gsu");
864
+ re2.lastIndex = pos;
865
+ let numCharClassesOpen = 0;
866
+ let match;
867
+ while (match = re2.exec(expression)) {
868
+ const { 0: m3, groups: { $skip } } = match;
869
+ if (!$skip && (!context || context === Context.DEFAULT === !numCharClassesOpen)) {
870
+ return match;
871
+ }
872
+ if (m3 === "[") {
873
+ numCharClassesOpen++;
874
+ } else if (m3 === "]" && numCharClassesOpen) {
875
+ numCharClassesOpen--;
876
+ }
877
+ if (re2.lastIndex == match.index) {
878
+ re2.lastIndex++;
879
+ }
880
+ }
881
+ return null;
882
+ }
883
+ function hasUnescaped(expression, needle, context) {
884
+ return !!execUnescaped(expression, needle, 0, context);
885
+ }
886
+ function getGroupContents(expression, contentsStartPos) {
887
+ const token2 = /\\?./gsu;
888
+ token2.lastIndex = contentsStartPos;
889
+ let contentsEndPos = expression.length;
890
+ let numCharClassesOpen = 0;
891
+ let numGroupsOpen = 1;
892
+ let match;
893
+ while (match = token2.exec(expression)) {
894
+ const [m3] = match;
895
+ if (m3 === "[") {
896
+ numCharClassesOpen++;
897
+ } else if (!numCharClassesOpen) {
898
+ if (m3 === "(") {
899
+ numGroupsOpen++;
900
+ } else if (m3 === ")") {
901
+ numGroupsOpen--;
902
+ if (!numGroupsOpen) {
903
+ contentsEndPos = match.index;
904
+ break;
905
+ }
906
+ }
907
+ } else if (m3 === "]") {
908
+ numCharClassesOpen--;
909
+ }
910
+ }
911
+ return expression.slice(contentsStartPos, contentsEndPos);
912
+ }
913
+
914
+ // node_modules/.pnpm/regex@6.1.0/node_modules/regex/src/atomic.js
915
+ var atomicPluginToken = new RegExp(String.raw`(?<noncapturingStart>${noncapturingDelim})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`, "gsu");
916
+ function atomic(expression, data) {
917
+ const hiddenCaptures = data?.hiddenCaptures ?? [];
918
+ let captureTransfers = data?.captureTransfers ?? /* @__PURE__ */ new Map();
919
+ if (!/\(\?>/.test(expression)) {
920
+ return {
921
+ pattern: expression,
922
+ captureTransfers,
923
+ hiddenCaptures
924
+ };
925
+ }
926
+ const aGDelim = "(?>";
927
+ const emulatedAGDelim = "(?:(?=(";
928
+ const captureNumMap = [0];
929
+ const addedHiddenCaptures = [];
930
+ let numCapturesBeforeAG = 0;
931
+ let numAGs = 0;
932
+ let aGPos = NaN;
933
+ let hasProcessedAG;
934
+ do {
935
+ hasProcessedAG = false;
936
+ let numCharClassesOpen = 0;
937
+ let numGroupsOpenInAG = 0;
938
+ let inAG = false;
939
+ let match;
940
+ atomicPluginToken.lastIndex = Number.isNaN(aGPos) ? 0 : aGPos + emulatedAGDelim.length;
941
+ while (match = atomicPluginToken.exec(expression)) {
942
+ const { 0: m3, index, groups: { capturingStart, noncapturingStart } } = match;
943
+ if (m3 === "[") {
944
+ numCharClassesOpen++;
945
+ } else if (!numCharClassesOpen) {
946
+ if (m3 === aGDelim && !inAG) {
947
+ aGPos = index;
948
+ inAG = true;
949
+ } else if (inAG && noncapturingStart) {
950
+ numGroupsOpenInAG++;
951
+ } else if (capturingStart) {
952
+ if (inAG) {
953
+ numGroupsOpenInAG++;
954
+ } else {
955
+ numCapturesBeforeAG++;
956
+ captureNumMap.push(numCapturesBeforeAG + numAGs);
957
+ }
958
+ } else if (m3 === ")" && inAG) {
959
+ if (!numGroupsOpenInAG) {
960
+ numAGs++;
961
+ const addedCaptureNum = numCapturesBeforeAG + numAGs;
962
+ expression = `${expression.slice(0, aGPos)}${emulatedAGDelim}${expression.slice(aGPos + aGDelim.length, index)}))<$$${addedCaptureNum}>)${expression.slice(index + 1)}`;
963
+ hasProcessedAG = true;
964
+ addedHiddenCaptures.push(addedCaptureNum);
965
+ incrementIfAtLeast(hiddenCaptures, addedCaptureNum);
966
+ if (captureTransfers.size) {
967
+ const newCaptureTransfers = /* @__PURE__ */ new Map();
968
+ captureTransfers.forEach((from, to) => {
969
+ newCaptureTransfers.set(
970
+ to >= addedCaptureNum ? to + 1 : to,
971
+ from.map((f2) => f2 >= addedCaptureNum ? f2 + 1 : f2)
972
+ );
973
+ });
974
+ captureTransfers = newCaptureTransfers;
975
+ }
976
+ break;
977
+ }
978
+ numGroupsOpenInAG--;
979
+ }
980
+ } else if (m3 === "]") {
981
+ numCharClassesOpen--;
982
+ }
983
+ }
984
+ } while (hasProcessedAG);
985
+ hiddenCaptures.push(...addedHiddenCaptures);
986
+ expression = replaceUnescaped(
987
+ expression,
988
+ String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,
989
+ ({ 0: m3, groups: { backrefNum, wrappedBackrefNum } }) => {
990
+ if (backrefNum) {
991
+ const bNum = +backrefNum;
992
+ if (bNum > captureNumMap.length - 1) {
993
+ throw new Error(`Backref "${m3}" greater than number of captures`);
994
+ }
995
+ return `\\${captureNumMap[bNum]}`;
996
+ }
997
+ return `\\${wrappedBackrefNum}`;
998
+ },
999
+ Context.DEFAULT
1000
+ );
1001
+ return {
1002
+ pattern: expression,
1003
+ captureTransfers,
1004
+ hiddenCaptures
1005
+ };
1006
+ }
1007
+ var baseQuantifier = String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`;
1008
+ var possessivePluginToken = new RegExp(String.raw`
1009
+ \\(?: \d+
1010
+ | c[A-Za-z]
1011
+ | [gk]<[^>]+>
1012
+ | [pPu]\{[^\}]+\}
1013
+ | u[A-Fa-f\d]{4}
1014
+ | x[A-Fa-f\d]{2}
1015
+ )
1016
+ | \((?: \? (?: [:=!>]
1017
+ | <(?:[=!]|[^>]+>)
1018
+ | [A-Za-z\-]+:
1019
+ | \(DEFINE\)
1020
+ ))?
1021
+ | (?<qBase>${baseQuantifier})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
1022
+ | \\?.
1023
+ `.replace(/\s+/g, ""), "gsu");
1024
+ function possessive(expression) {
1025
+ if (!new RegExp(`${baseQuantifier}\\+`).test(expression)) {
1026
+ return {
1027
+ pattern: expression
1028
+ };
1029
+ }
1030
+ const openGroupIndices = [];
1031
+ let lastGroupIndex = null;
1032
+ let lastCharClassIndex = null;
1033
+ let lastToken = "";
1034
+ let numCharClassesOpen = 0;
1035
+ let match;
1036
+ possessivePluginToken.lastIndex = 0;
1037
+ while (match = possessivePluginToken.exec(expression)) {
1038
+ const { 0: m3, index, groups: { qBase, qMod, invalidQ } } = match;
1039
+ if (m3 === "[") {
1040
+ if (!numCharClassesOpen) {
1041
+ lastCharClassIndex = index;
1042
+ }
1043
+ numCharClassesOpen++;
1044
+ } else if (m3 === "]") {
1045
+ if (numCharClassesOpen) {
1046
+ numCharClassesOpen--;
1047
+ } else {
1048
+ lastCharClassIndex = null;
1049
+ }
1050
+ } else if (!numCharClassesOpen) {
1051
+ if (qMod === "+" && lastToken && !lastToken.startsWith("(")) {
1052
+ if (invalidQ) {
1053
+ throw new Error(`Invalid quantifier "${m3}"`);
1054
+ }
1055
+ let charsAdded = -1;
1056
+ if (/^\{\d+\}$/.test(qBase)) {
1057
+ expression = spliceStr(expression, index + qBase.length, qMod, "");
1058
+ } else {
1059
+ if (lastToken === ")" || lastToken === "]") {
1060
+ const nodeIndex = lastToken === ")" ? lastGroupIndex : lastCharClassIndex;
1061
+ if (nodeIndex === null) {
1062
+ throw new Error(`Invalid unmatched "${lastToken}"`);
1063
+ }
1064
+ expression = `${expression.slice(0, nodeIndex)}(?>${expression.slice(nodeIndex, index)}${qBase})${expression.slice(index + m3.length)}`;
1065
+ } else {
1066
+ expression = `${expression.slice(0, index - lastToken.length)}(?>${lastToken}${qBase})${expression.slice(index + m3.length)}`;
1067
+ }
1068
+ charsAdded += 4;
1069
+ }
1070
+ possessivePluginToken.lastIndex += charsAdded;
1071
+ } else if (m3[0] === "(") {
1072
+ openGroupIndices.push(index);
1073
+ } else if (m3 === ")") {
1074
+ lastGroupIndex = openGroupIndices.length ? openGroupIndices.pop() : null;
1075
+ }
1076
+ }
1077
+ lastToken = m3;
1078
+ }
1079
+ return {
1080
+ pattern: expression
1081
+ };
1082
+ }
1083
+
1084
+ // node_modules/.pnpm/regex-recursion@6.0.2/node_modules/regex-recursion/src/index.js
1085
+ var r2 = String.raw;
1086
+ var gRToken = r2`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`;
1087
+ var recursiveToken = r2`\(\?R=(?<rDepth>[^\)]+)\)|${gRToken}`;
1088
+ var namedCaptureDelim = r2`\(\?<(?![=!])(?<captureName>[^>]+)>`;
1089
+ var captureDelim = r2`${namedCaptureDelim}|(?<unnamed>\()(?!\?)`;
1090
+ var token = new RegExp(r2`${namedCaptureDelim}|${recursiveToken}|\(\?|\\?.`, "gsu");
1091
+ var overlappingRecursionMsg = "Cannot use multiple overlapping recursions";
1092
+ function recursion(pattern, data) {
1093
+ const { hiddenCaptures, mode } = {
1094
+ hiddenCaptures: [],
1095
+ mode: "plugin",
1096
+ ...data
1097
+ };
1098
+ let captureTransfers = data?.captureTransfers ?? /* @__PURE__ */ new Map();
1099
+ if (!new RegExp(recursiveToken, "su").test(pattern)) {
1100
+ return {
1101
+ pattern,
1102
+ captureTransfers,
1103
+ hiddenCaptures
1104
+ };
1105
+ }
1106
+ if (mode === "plugin" && hasUnescaped(pattern, r2`\(\?\(DEFINE\)`, Context.DEFAULT)) {
1107
+ throw new Error("DEFINE groups cannot be used with recursion");
1108
+ }
1109
+ const addedHiddenCaptures = [];
1110
+ const hasNumberedBackref = hasUnescaped(pattern, r2`\\[1-9]`, Context.DEFAULT);
1111
+ const groupContentsStartPos = /* @__PURE__ */ new Map();
1112
+ const openGroups = [];
1113
+ let hasRecursed = false;
1114
+ let numCharClassesOpen = 0;
1115
+ let numCapturesPassed = 0;
1116
+ let match;
1117
+ token.lastIndex = 0;
1118
+ while (match = token.exec(pattern)) {
1119
+ const { 0: m3, groups: { captureName, rDepth, gRNameOrNum, gRDepth } } = match;
1120
+ if (m3 === "[") {
1121
+ numCharClassesOpen++;
1122
+ } else if (!numCharClassesOpen) {
1123
+ if (rDepth) {
1124
+ assertMaxInBounds(rDepth);
1125
+ if (hasRecursed) {
1126
+ throw new Error(overlappingRecursionMsg);
1127
+ }
1128
+ if (hasNumberedBackref) {
1129
+ throw new Error(
1130
+ // When used in `external` mode by transpilers other than Regex+, backrefs might have
1131
+ // gone through conversion from named to numbered, so avoid a misleading error
1132
+ `${mode === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with global recursion`
1133
+ );
1134
+ }
1135
+ const left = pattern.slice(0, match.index);
1136
+ const right = pattern.slice(token.lastIndex);
1137
+ if (hasUnescaped(right, recursiveToken, Context.DEFAULT)) {
1138
+ throw new Error(overlappingRecursionMsg);
1139
+ }
1140
+ const reps = +rDepth - 1;
1141
+ pattern = makeRecursive(
1142
+ left,
1143
+ right,
1144
+ reps,
1145
+ false,
1146
+ hiddenCaptures,
1147
+ addedHiddenCaptures,
1148
+ numCapturesPassed
1149
+ );
1150
+ captureTransfers = mapCaptureTransfers(
1151
+ captureTransfers,
1152
+ left,
1153
+ reps,
1154
+ addedHiddenCaptures.length,
1155
+ 0,
1156
+ numCapturesPassed
1157
+ );
1158
+ break;
1159
+ } else if (gRNameOrNum) {
1160
+ assertMaxInBounds(gRDepth);
1161
+ let isWithinReffedGroup = false;
1162
+ for (const g of openGroups) {
1163
+ if (g.name === gRNameOrNum || g.num === +gRNameOrNum) {
1164
+ isWithinReffedGroup = true;
1165
+ if (g.hasRecursedWithin) {
1166
+ throw new Error(overlappingRecursionMsg);
1167
+ }
1168
+ break;
1169
+ }
1170
+ }
1171
+ if (!isWithinReffedGroup) {
1172
+ throw new Error(r2`Recursive \g cannot be used outside the referenced group "${mode === "external" ? gRNameOrNum : r2`\g<${gRNameOrNum}&R=${gRDepth}>`}"`);
1173
+ }
1174
+ const startPos = groupContentsStartPos.get(gRNameOrNum);
1175
+ const groupContents = getGroupContents(pattern, startPos);
1176
+ if (hasNumberedBackref && hasUnescaped(groupContents, r2`${namedCaptureDelim}|\((?!\?)`, Context.DEFAULT)) {
1177
+ throw new Error(
1178
+ // When used in `external` mode by transpilers other than Regex+, backrefs might have
1179
+ // gone through conversion from named to numbered, so avoid a misleading error
1180
+ `${mode === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with recursion of capturing groups`
1181
+ );
1182
+ }
1183
+ const groupContentsLeft = pattern.slice(startPos, match.index);
1184
+ const groupContentsRight = groupContents.slice(groupContentsLeft.length + m3.length);
1185
+ const numAddedHiddenCapturesPreExpansion = addedHiddenCaptures.length;
1186
+ const reps = +gRDepth - 1;
1187
+ const expansion = makeRecursive(
1188
+ groupContentsLeft,
1189
+ groupContentsRight,
1190
+ reps,
1191
+ true,
1192
+ hiddenCaptures,
1193
+ addedHiddenCaptures,
1194
+ numCapturesPassed
1195
+ );
1196
+ captureTransfers = mapCaptureTransfers(
1197
+ captureTransfers,
1198
+ groupContentsLeft,
1199
+ reps,
1200
+ addedHiddenCaptures.length - numAddedHiddenCapturesPreExpansion,
1201
+ numAddedHiddenCapturesPreExpansion,
1202
+ numCapturesPassed
1203
+ );
1204
+ const pre = pattern.slice(0, startPos);
1205
+ const post = pattern.slice(startPos + groupContents.length);
1206
+ pattern = `${pre}${expansion}${post}`;
1207
+ token.lastIndex += expansion.length - m3.length - groupContentsLeft.length - groupContentsRight.length;
1208
+ openGroups.forEach((g) => g.hasRecursedWithin = true);
1209
+ hasRecursed = true;
1210
+ } else if (captureName) {
1211
+ numCapturesPassed++;
1212
+ groupContentsStartPos.set(String(numCapturesPassed), token.lastIndex);
1213
+ groupContentsStartPos.set(captureName, token.lastIndex);
1214
+ openGroups.push({
1215
+ num: numCapturesPassed,
1216
+ name: captureName
1217
+ });
1218
+ } else if (m3[0] === "(") {
1219
+ const isUnnamedCapture = m3 === "(";
1220
+ if (isUnnamedCapture) {
1221
+ numCapturesPassed++;
1222
+ groupContentsStartPos.set(String(numCapturesPassed), token.lastIndex);
1223
+ }
1224
+ openGroups.push(isUnnamedCapture ? { num: numCapturesPassed } : {});
1225
+ } else if (m3 === ")") {
1226
+ openGroups.pop();
1227
+ }
1228
+ } else if (m3 === "]") {
1229
+ numCharClassesOpen--;
1230
+ }
1231
+ }
1232
+ hiddenCaptures.push(...addedHiddenCaptures);
1233
+ return {
1234
+ pattern,
1235
+ captureTransfers,
1236
+ hiddenCaptures
1237
+ };
1238
+ }
1239
+ function assertMaxInBounds(max) {
1240
+ const errMsg = `Max depth must be integer between 2 and 100; used ${max}`;
1241
+ if (!/^[1-9]\d*$/.test(max)) {
1242
+ throw new Error(errMsg);
1243
+ }
1244
+ max = +max;
1245
+ if (max < 2 || max > 100) {
1246
+ throw new Error(errMsg);
1247
+ }
1248
+ }
1249
+ function makeRecursive(left, right, reps, isSubpattern, hiddenCaptures, addedHiddenCaptures, numCapturesPassed) {
1250
+ const namesInRecursed = /* @__PURE__ */ new Set();
1251
+ if (isSubpattern) {
1252
+ forEachUnescaped(left + right, namedCaptureDelim, ({ groups: { captureName } }) => {
1253
+ namesInRecursed.add(captureName);
1254
+ }, Context.DEFAULT);
1255
+ }
1256
+ const rest = [
1257
+ reps,
1258
+ isSubpattern ? namesInRecursed : null,
1259
+ hiddenCaptures,
1260
+ addedHiddenCaptures,
1261
+ numCapturesPassed
1262
+ ];
1263
+ return `${left}${repeatWithDepth(`(?:${left}`, "forward", ...rest)}(?:)${repeatWithDepth(`${right})`, "backward", ...rest)}${right}`;
1264
+ }
1265
+ function repeatWithDepth(pattern, direction, reps, namesInRecursed, hiddenCaptures, addedHiddenCaptures, numCapturesPassed) {
1266
+ const startNum = 2;
1267
+ const getDepthNum = (i2) => direction === "forward" ? i2 + startNum : reps - i2 + startNum - 1;
1268
+ let result = "";
1269
+ for (let i2 = 0; i2 < reps; i2++) {
1270
+ const depthNum = getDepthNum(i2);
1271
+ result += replaceUnescaped(
1272
+ pattern,
1273
+ r2`${captureDelim}|\\k<(?<backref>[^>]+)>`,
1274
+ ({ 0: m3, groups: { captureName, unnamed, backref } }) => {
1275
+ if (backref && namesInRecursed && !namesInRecursed.has(backref)) {
1276
+ return m3;
1277
+ }
1278
+ const suffix = `_$${depthNum}`;
1279
+ if (unnamed || captureName) {
1280
+ const addedCaptureNum = numCapturesPassed + addedHiddenCaptures.length + 1;
1281
+ addedHiddenCaptures.push(addedCaptureNum);
1282
+ incrementIfAtLeast2(hiddenCaptures, addedCaptureNum);
1283
+ return unnamed ? m3 : `(?<${captureName}${suffix}>`;
1284
+ }
1285
+ return r2`\k<${backref}${suffix}>`;
1286
+ },
1287
+ Context.DEFAULT
1288
+ );
1289
+ }
1290
+ return result;
1291
+ }
1292
+ function incrementIfAtLeast2(arr, threshold) {
1293
+ for (let i2 = 0; i2 < arr.length; i2++) {
1294
+ if (arr[i2] >= threshold) {
1295
+ arr[i2]++;
1296
+ }
1297
+ }
1298
+ }
1299
+ function mapCaptureTransfers(captureTransfers, left, reps, numCapturesAddedInExpansion, numAddedHiddenCapturesPreExpansion, numCapturesPassed) {
1300
+ if (captureTransfers.size && numCapturesAddedInExpansion) {
1301
+ let numCapturesInLeft = 0;
1302
+ forEachUnescaped(left, captureDelim, () => numCapturesInLeft++, Context.DEFAULT);
1303
+ const recursionDelimCaptureNum = numCapturesPassed - numCapturesInLeft + numAddedHiddenCapturesPreExpansion;
1304
+ const newCaptureTransfers = /* @__PURE__ */ new Map();
1305
+ captureTransfers.forEach((from, to) => {
1306
+ const numCapturesInRight = (numCapturesAddedInExpansion - numCapturesInLeft * reps) / reps;
1307
+ const numCapturesAddedInLeft = numCapturesInLeft * reps;
1308
+ const newTo = to > recursionDelimCaptureNum + numCapturesInLeft ? to + numCapturesAddedInExpansion : to;
1309
+ const newFrom = [];
1310
+ for (const f2 of from) {
1311
+ if (f2 <= recursionDelimCaptureNum) {
1312
+ newFrom.push(f2);
1313
+ } else if (f2 > recursionDelimCaptureNum + numCapturesInLeft + numCapturesInRight) {
1314
+ newFrom.push(f2 + numCapturesAddedInExpansion);
1315
+ } else if (f2 <= recursionDelimCaptureNum + numCapturesInLeft) {
1316
+ for (let i2 = 0; i2 <= reps; i2++) {
1317
+ newFrom.push(f2 + numCapturesInLeft * i2);
1318
+ }
1319
+ } else {
1320
+ for (let i2 = 0; i2 <= reps; i2++) {
1321
+ newFrom.push(f2 + numCapturesAddedInLeft + numCapturesInRight * i2);
1322
+ }
1323
+ }
1324
+ }
1325
+ newCaptureTransfers.set(newTo, newFrom);
1326
+ });
1327
+ return newCaptureTransfers;
1328
+ }
1329
+ return captureTransfers;
1330
+ }
1331
+
1332
+ // node_modules/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js
1333
+ var cp = String.fromCodePoint;
1334
+ var r3 = String.raw;
1335
+ var envFlags = {};
1336
+ var globalRegExp = globalThis.RegExp;
1337
+ envFlags.flagGroups = (() => {
1338
+ try {
1339
+ new globalRegExp("(?i:)");
1340
+ } catch {
1341
+ return false;
1342
+ }
1343
+ return true;
1344
+ })();
1345
+ envFlags.unicodeSets = (() => {
1346
+ try {
1347
+ new globalRegExp("[[]]", "v");
1348
+ } catch {
1349
+ return false;
1350
+ }
1351
+ return true;
1352
+ })();
1353
+ envFlags.bugFlagVLiteralHyphenIsRange = envFlags.unicodeSets ? (() => {
1354
+ try {
1355
+ new globalRegExp(r3`[\d\-a]`, "v");
1356
+ } catch {
1357
+ return true;
1358
+ }
1359
+ return false;
1360
+ })() : false;
1361
+ envFlags.bugNestedClassIgnoresNegation = envFlags.unicodeSets && new globalRegExp("[[^a]]", "v").test("a");
1362
+ function getNewCurrentFlags(current, { enable, disable }) {
1363
+ return {
1364
+ dotAll: !disable?.dotAll && !!(enable?.dotAll || current.dotAll),
1365
+ ignoreCase: !disable?.ignoreCase && !!(enable?.ignoreCase || current.ignoreCase)
1366
+ };
1367
+ }
1368
+ function getOrInsert(map, key, defaultValue) {
1369
+ if (!map.has(key)) {
1370
+ map.set(key, defaultValue);
1371
+ }
1372
+ return map.get(key);
1373
+ }
1374
+ function isMinTarget(target, min) {
1375
+ return EsVersion[target] >= EsVersion[min];
1376
+ }
1377
+ function throwIfNullish(value, msg) {
1378
+ if (value == null) {
1379
+ throw new Error(msg ?? "Value expected");
1380
+ }
1381
+ return value;
1382
+ }
1383
+ var EsVersion = {
1384
+ ES2025: 2025,
1385
+ ES2024: 2024,
1386
+ ES2018: 2018
1387
+ };
1388
+ var Target = (
1389
+ /** @type {const} */
1390
+ {
1391
+ auto: "auto",
1392
+ ES2025: "ES2025",
1393
+ ES2024: "ES2024",
1394
+ ES2018: "ES2018"
1395
+ }
1396
+ );
1397
+ function getOptions(options = {}) {
1398
+ if ({}.toString.call(options) !== "[object Object]") {
1399
+ throw new Error("Unexpected options");
1400
+ }
1401
+ if (options.target !== void 0 && !Target[options.target]) {
1402
+ throw new Error(`Unexpected target "${options.target}"`);
1403
+ }
1404
+ const opts = {
1405
+ // Sets the level of emulation rigor/strictness.
1406
+ accuracy: "default",
1407
+ // Disables advanced emulation that relies on returning a `RegExp` subclass, resulting in
1408
+ // certain patterns not being emulatable.
1409
+ avoidSubclass: false,
1410
+ // Oniguruma flags; a string with `i`, `m`, `x`, `D`, `S`, `W`, `y{g}` in any order (all
1411
+ // optional). Oniguruma's `m` is equivalent to JavaScript's `s` (`dotAll`).
1412
+ flags: "",
1413
+ // Include JavaScript flag `g` (`global`) in the result.
1414
+ global: false,
1415
+ // Include JavaScript flag `d` (`hasIndices`) in the result.
1416
+ hasIndices: false,
1417
+ // Delay regex construction until first use if the transpiled pattern is at least this length.
1418
+ lazyCompileLength: Infinity,
1419
+ // JavaScript version used for generated regexes. Using `auto` detects the best value based on
1420
+ // your environment. Later targets allow faster processing, simpler generated source, and
1421
+ // support for additional features.
1422
+ target: "auto",
1423
+ // Disables minifications that simplify the pattern without changing the meaning.
1424
+ verbose: false,
1425
+ ...options,
1426
+ // Advanced options that override standard behavior, error checking, and flags when enabled.
1427
+ rules: {
1428
+ // Useful with TextMate grammars that merge backreferences across patterns.
1429
+ allowOrphanBackrefs: false,
1430
+ // Use ASCII `\b` and `\B`, which increases search performance of generated regexes.
1431
+ asciiWordBoundaries: false,
1432
+ // Allow unnamed captures and numbered calls (backreferences and subroutines) when using
1433
+ // named capture. This is Oniguruma option `ONIG_OPTION_CAPTURE_GROUP`; on by default in
1434
+ // `vscode-oniguruma`.
1435
+ captureGroup: false,
1436
+ // Change the recursion depth limit from Oniguruma's `20` to an integer `2`–`20`.
1437
+ recursionLimit: 20,
1438
+ // `^` as `\A`; `$` as`\Z`. Improves search performance of generated regexes without changing
1439
+ // the meaning if searching line by line. This is Oniguruma option `ONIG_OPTION_SINGLELINE`.
1440
+ singleline: false,
1441
+ ...options.rules
1442
+ }
1443
+ };
1444
+ if (opts.target === "auto") {
1445
+ opts.target = envFlags.flagGroups ? "ES2025" : envFlags.unicodeSets ? "ES2024" : "ES2018";
1446
+ }
1447
+ return opts;
1448
+ }
1449
+ var asciiSpaceChar = "[ -\r ]";
1450
+ var CharsWithoutIgnoreCaseExpansion = /* @__PURE__ */ new Set([
1451
+ cp(304),
1452
+ // İ
1453
+ cp(305)
1454
+ // ı
1455
+ ]);
1456
+ var defaultWordChar = r3`[\p{L}\p{M}\p{N}\p{Pc}]`;
1457
+ function getIgnoreCaseMatchChars(char) {
1458
+ if (CharsWithoutIgnoreCaseExpansion.has(char)) {
1459
+ return [char];
1460
+ }
1461
+ const set = /* @__PURE__ */ new Set();
1462
+ const lower = char.toLowerCase();
1463
+ const upper = lower.toUpperCase();
1464
+ const title = LowerToTitleCaseMap.get(lower);
1465
+ const altLower = LowerToAlternativeLowerCaseMap.get(lower);
1466
+ const altUpper = LowerToAlternativeUpperCaseMap.get(lower);
1467
+ if ([...upper].length === 1) {
1468
+ set.add(upper);
1469
+ }
1470
+ altUpper && set.add(altUpper);
1471
+ title && set.add(title);
1472
+ set.add(lower);
1473
+ altLower && set.add(altLower);
1474
+ return [...set];
1475
+ }
1476
+ var JsUnicodePropertyMap = /* @__PURE__ */ new Map(
1477
+ `C Other
1478
+ Cc Control cntrl
1479
+ Cf Format
1480
+ Cn Unassigned
1481
+ Co Private_Use
1482
+ Cs Surrogate
1483
+ L Letter
1484
+ LC Cased_Letter
1485
+ Ll Lowercase_Letter
1486
+ Lm Modifier_Letter
1487
+ Lo Other_Letter
1488
+ Lt Titlecase_Letter
1489
+ Lu Uppercase_Letter
1490
+ M Mark Combining_Mark
1491
+ Mc Spacing_Mark
1492
+ Me Enclosing_Mark
1493
+ Mn Nonspacing_Mark
1494
+ N Number
1495
+ Nd Decimal_Number digit
1496
+ Nl Letter_Number
1497
+ No Other_Number
1498
+ P Punctuation punct
1499
+ Pc Connector_Punctuation
1500
+ Pd Dash_Punctuation
1501
+ Pe Close_Punctuation
1502
+ Pf Final_Punctuation
1503
+ Pi Initial_Punctuation
1504
+ Po Other_Punctuation
1505
+ Ps Open_Punctuation
1506
+ S Symbol
1507
+ Sc Currency_Symbol
1508
+ Sk Modifier_Symbol
1509
+ Sm Math_Symbol
1510
+ So Other_Symbol
1511
+ Z Separator
1512
+ Zl Line_Separator
1513
+ Zp Paragraph_Separator
1514
+ Zs Space_Separator
1515
+ ASCII
1516
+ ASCII_Hex_Digit AHex
1517
+ Alphabetic Alpha
1518
+ Any
1519
+ Assigned
1520
+ Bidi_Control Bidi_C
1521
+ Bidi_Mirrored Bidi_M
1522
+ Case_Ignorable CI
1523
+ Cased
1524
+ Changes_When_Casefolded CWCF
1525
+ Changes_When_Casemapped CWCM
1526
+ Changes_When_Lowercased CWL
1527
+ Changes_When_NFKC_Casefolded CWKCF
1528
+ Changes_When_Titlecased CWT
1529
+ Changes_When_Uppercased CWU
1530
+ Dash
1531
+ Default_Ignorable_Code_Point DI
1532
+ Deprecated Dep
1533
+ Diacritic Dia
1534
+ Emoji
1535
+ Emoji_Component EComp
1536
+ Emoji_Modifier EMod
1537
+ Emoji_Modifier_Base EBase
1538
+ Emoji_Presentation EPres
1539
+ Extended_Pictographic ExtPict
1540
+ Extender Ext
1541
+ Grapheme_Base Gr_Base
1542
+ Grapheme_Extend Gr_Ext
1543
+ Hex_Digit Hex
1544
+ IDS_Binary_Operator IDSB
1545
+ IDS_Trinary_Operator IDST
1546
+ ID_Continue IDC
1547
+ ID_Start IDS
1548
+ Ideographic Ideo
1549
+ Join_Control Join_C
1550
+ Logical_Order_Exception LOE
1551
+ Lowercase Lower
1552
+ Math
1553
+ Noncharacter_Code_Point NChar
1554
+ Pattern_Syntax Pat_Syn
1555
+ Pattern_White_Space Pat_WS
1556
+ Quotation_Mark QMark
1557
+ Radical
1558
+ Regional_Indicator RI
1559
+ Sentence_Terminal STerm
1560
+ Soft_Dotted SD
1561
+ Terminal_Punctuation Term
1562
+ Unified_Ideograph UIdeo
1563
+ Uppercase Upper
1564
+ Variation_Selector VS
1565
+ White_Space space
1566
+ XID_Continue XIDC
1567
+ XID_Start XIDS`.split(/\s/).map((p) => [w2(p), p])
1568
+ );
1569
+ var LowerToAlternativeLowerCaseMap = /* @__PURE__ */ new Map([
1570
+ ["s", cp(383)],
1571
+ // s, ſ
1572
+ [cp(383), "s"]
1573
+ // ſ, s
1574
+ ]);
1575
+ var LowerToAlternativeUpperCaseMap = /* @__PURE__ */ new Map([
1576
+ [cp(223), cp(7838)],
1577
+ // ß, ẞ
1578
+ [cp(107), cp(8490)],
1579
+ // k, K (Kelvin)
1580
+ [cp(229), cp(8491)],
1581
+ // å, Å (Angstrom)
1582
+ [cp(969), cp(8486)]
1583
+ // ω, Ω (Ohm)
1584
+ ]);
1585
+ var LowerToTitleCaseMap = new Map([
1586
+ titleEntry(453),
1587
+ titleEntry(456),
1588
+ titleEntry(459),
1589
+ titleEntry(498),
1590
+ ...titleRange(8072, 8079),
1591
+ ...titleRange(8088, 8095),
1592
+ ...titleRange(8104, 8111),
1593
+ titleEntry(8124),
1594
+ titleEntry(8140),
1595
+ titleEntry(8188)
1596
+ ]);
1597
+ var PosixClassMap = /* @__PURE__ */ new Map([
1598
+ ["alnum", r3`[\p{Alpha}\p{Nd}]`],
1599
+ ["alpha", r3`\p{Alpha}`],
1600
+ ["ascii", r3`\p{ASCII}`],
1601
+ ["blank", r3`[\p{Zs}\t]`],
1602
+ ["cntrl", r3`\p{Cc}`],
1603
+ ["digit", r3`\p{Nd}`],
1604
+ ["graph", r3`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],
1605
+ ["lower", r3`\p{Lower}`],
1606
+ ["print", r3`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],
1607
+ ["punct", r3`[\p{P}\p{S}]`],
1608
+ // Updated value from Onig 6.9.9; changed from Unicode `\p{punct}`
1609
+ ["space", r3`\p{space}`],
1610
+ ["upper", r3`\p{Upper}`],
1611
+ ["word", r3`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
1612
+ ["xdigit", r3`\p{AHex}`]
1613
+ ]);
1614
+ function range(start, end) {
1615
+ const range2 = [];
1616
+ for (let i2 = start; i2 <= end; i2++) {
1617
+ range2.push(i2);
1618
+ }
1619
+ return range2;
1620
+ }
1621
+ function titleEntry(codePoint) {
1622
+ const char = cp(codePoint);
1623
+ return [char.toLowerCase(), char];
1624
+ }
1625
+ function titleRange(start, end) {
1626
+ return range(start, end).map((codePoint) => titleEntry(codePoint));
1627
+ }
1628
+ var UnicodePropertiesWithSpecificCase = /* @__PURE__ */ new Set([
1629
+ "Lower",
1630
+ "Lowercase",
1631
+ "Upper",
1632
+ "Uppercase",
1633
+ "Ll",
1634
+ "Lowercase_Letter",
1635
+ "Lt",
1636
+ "Titlecase_Letter",
1637
+ "Lu",
1638
+ "Uppercase_Letter"
1639
+ // The `Changes_When_*` properties (and their aliases) could be included, but they're very rare.
1640
+ // Some other properties include a handful of chars with specific cases only, but these chars are
1641
+ // generally extreme edge cases and using such properties case insensitively generally produces
1642
+ // undesired behavior anyway
1643
+ ]);
1644
+ function transform(ast, options) {
1645
+ const opts = {
1646
+ // A couple edge cases exist where options `accuracy` and `bestEffortTarget` are used:
1647
+ // - `CharacterSet` kind `text_segment` (`\X`): An exact representation would require heavy
1648
+ // Unicode data; a best-effort approximation requires knowing the target.
1649
+ // - `CharacterSet` kind `posix` with values `graph` and `print`: Their complex Unicode
1650
+ // representations would be hard to change to ASCII versions after the fact in the generator
1651
+ // based on `target`/`accuracy`, so produce the appropriate structure here.
1652
+ accuracy: "default",
1653
+ asciiWordBoundaries: false,
1654
+ avoidSubclass: false,
1655
+ bestEffortTarget: "ES2025",
1656
+ ...options
1657
+ };
1658
+ addParentProperties(ast);
1659
+ const firstPassState = {
1660
+ accuracy: opts.accuracy,
1661
+ asciiWordBoundaries: opts.asciiWordBoundaries,
1662
+ avoidSubclass: opts.avoidSubclass,
1663
+ flagDirectivesByAlt: /* @__PURE__ */ new Map(),
1664
+ jsGroupNameMap: /* @__PURE__ */ new Map(),
1665
+ minTargetEs2024: isMinTarget(opts.bestEffortTarget, "ES2024"),
1666
+ passedLookbehind: false,
1667
+ strategy: null,
1668
+ // Subroutines can appear before the groups they ref, so collect reffed nodes for a second pass
1669
+ subroutineRefMap: /* @__PURE__ */ new Map(),
1670
+ supportedGNodes: /* @__PURE__ */ new Set(),
1671
+ digitIsAscii: ast.flags.digitIsAscii,
1672
+ spaceIsAscii: ast.flags.spaceIsAscii,
1673
+ wordIsAscii: ast.flags.wordIsAscii
1674
+ };
1675
+ S(ast, FirstPassVisitor, firstPassState);
1676
+ const globalFlags = {
1677
+ dotAll: ast.flags.dotAll,
1678
+ ignoreCase: ast.flags.ignoreCase
1679
+ };
1680
+ const secondPassState = {
1681
+ currentFlags: globalFlags,
1682
+ prevFlags: null,
1683
+ globalFlags,
1684
+ groupOriginByCopy: /* @__PURE__ */ new Map(),
1685
+ groupsByName: /* @__PURE__ */ new Map(),
1686
+ multiplexCapturesToLeftByRef: /* @__PURE__ */ new Map(),
1687
+ openRefs: /* @__PURE__ */ new Map(),
1688
+ reffedNodesByReferencer: /* @__PURE__ */ new Map(),
1689
+ subroutineRefMap: firstPassState.subroutineRefMap
1690
+ };
1691
+ S(ast, SecondPassVisitor, secondPassState);
1692
+ const thirdPassState = {
1693
+ groupsByName: secondPassState.groupsByName,
1694
+ highestOrphanBackref: 0,
1695
+ numCapturesToLeft: 0,
1696
+ reffedNodesByReferencer: secondPassState.reffedNodesByReferencer
1697
+ };
1698
+ S(ast, ThirdPassVisitor, thirdPassState);
1699
+ ast._originMap = secondPassState.groupOriginByCopy;
1700
+ ast._strategy = firstPassState.strategy;
1701
+ return ast;
1702
+ }
1703
+ var FirstPassVisitor = {
1704
+ AbsenceFunction({ node, parent, replaceWith }) {
1705
+ const { body, kind } = node;
1706
+ if (kind === "repeater") {
1707
+ const innerGroup = A2();
1708
+ innerGroup.body[0].body.push(
1709
+ // Insert own alts as `body`
1710
+ K2({ negate: true, body }),
1711
+ Q2("Any")
1712
+ );
1713
+ const outerGroup = A2();
1714
+ outerGroup.body[0].body.push(
1715
+ _2("greedy", 0, Infinity, innerGroup)
1716
+ );
1717
+ replaceWith(setParentDeep(outerGroup, parent), { traverse: true });
1718
+ } else {
1719
+ throw new Error(`Unsupported absence function "(?~|"`);
1720
+ }
1721
+ },
1722
+ Alternative: {
1723
+ enter({ node, parent, key }, { flagDirectivesByAlt }) {
1724
+ const flagDirectives = node.body.filter((el) => el.kind === "flags");
1725
+ for (let i2 = key + 1; i2 < parent.body.length; i2++) {
1726
+ const forwardSiblingAlt = parent.body[i2];
1727
+ getOrInsert(flagDirectivesByAlt, forwardSiblingAlt, []).push(...flagDirectives);
1728
+ }
1729
+ },
1730
+ exit({ node }, { flagDirectivesByAlt }) {
1731
+ if (flagDirectivesByAlt.get(node)?.length) {
1732
+ const flags = getCombinedFlagModsFromFlagNodes(flagDirectivesByAlt.get(node));
1733
+ if (flags) {
1734
+ const flagGroup = A2({ flags });
1735
+ flagGroup.body[0].body = node.body;
1736
+ node.body = [setParentDeep(flagGroup, node)];
1737
+ }
1738
+ }
1739
+ }
1740
+ },
1741
+ Assertion({ node, parent, key, container, root, remove, replaceWith }, state) {
1742
+ const { kind, negate } = node;
1743
+ const { asciiWordBoundaries, avoidSubclass, supportedGNodes, wordIsAscii } = state;
1744
+ if (kind === "text_segment_boundary") {
1745
+ throw new Error(`Unsupported text segment boundary "\\${negate ? "Y" : "y"}"`);
1746
+ } else if (kind === "line_end") {
1747
+ replaceWith(setParentDeep(K2({ body: [
1748
+ b2({ body: [F2("string_end")] }),
1749
+ b2({ body: [m2(10)] })
1750
+ // `\n`
1751
+ ] }), parent));
1752
+ } else if (kind === "line_start") {
1753
+ replaceWith(setParentDeep(parseFragment(r3`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: true }), parent));
1754
+ } else if (kind === "search_start") {
1755
+ if (supportedGNodes.has(node)) {
1756
+ root.flags.sticky = true;
1757
+ remove();
1758
+ } else {
1759
+ const prev = container[key - 1];
1760
+ if (prev && isAlwaysNonZeroLength(prev)) {
1761
+ replaceWith(setParentDeep(K2({ negate: true }), parent));
1762
+ } else if (avoidSubclass) {
1763
+ throw new Error(r3`Uses "\G" in a way that requires a subclass`);
1764
+ } else {
1765
+ replaceWith(setParent(F2("string_start"), parent));
1766
+ state.strategy = "clip_search";
1767
+ }
1768
+ }
1769
+ } else if (kind === "string_end" || kind === "string_start") {
1770
+ } else if (kind === "string_end_newline") {
1771
+ replaceWith(setParentDeep(parseFragment(r3`(?=\n?\z)`), parent));
1772
+ } else if (kind === "word_boundary") {
1773
+ if (!wordIsAscii && !asciiWordBoundaries) {
1774
+ const b3 = `(?:(?<=${defaultWordChar})(?!${defaultWordChar})|(?<!${defaultWordChar})(?=${defaultWordChar}))`;
1775
+ const B3 = `(?:(?<=${defaultWordChar})(?=${defaultWordChar})|(?<!${defaultWordChar})(?!${defaultWordChar}))`;
1776
+ replaceWith(setParentDeep(parseFragment(negate ? B3 : b3), parent));
1777
+ }
1778
+ } else {
1779
+ throw new Error(`Unexpected assertion kind "${kind}"`);
1780
+ }
1781
+ },
1782
+ Backreference({ node }, { jsGroupNameMap }) {
1783
+ let { ref } = node;
1784
+ if (typeof ref === "string" && !isValidJsGroupName(ref)) {
1785
+ ref = getAndStoreJsGroupName(ref, jsGroupNameMap);
1786
+ node.ref = ref;
1787
+ }
1788
+ },
1789
+ CapturingGroup({ node }, { jsGroupNameMap, subroutineRefMap }) {
1790
+ let { name } = node;
1791
+ if (name && !isValidJsGroupName(name)) {
1792
+ name = getAndStoreJsGroupName(name, jsGroupNameMap);
1793
+ node.name = name;
1794
+ }
1795
+ subroutineRefMap.set(node.number, node);
1796
+ if (name) {
1797
+ subroutineRefMap.set(name, node);
1798
+ }
1799
+ },
1800
+ CharacterClassRange({ node, parent, replaceWith }) {
1801
+ if (parent.kind === "intersection") {
1802
+ const cc = C2({ body: [node] });
1803
+ replaceWith(setParentDeep(cc, parent), { traverse: true });
1804
+ }
1805
+ },
1806
+ CharacterSet({ node, parent, replaceWith }, { accuracy, minTargetEs2024, digitIsAscii, spaceIsAscii, wordIsAscii }) {
1807
+ const { kind, negate, value } = node;
1808
+ if (digitIsAscii && (kind === "digit" || value === "digit")) {
1809
+ replaceWith(setParent(E2("digit", { negate }), parent));
1810
+ return;
1811
+ }
1812
+ if (spaceIsAscii && (kind === "space" || value === "space")) {
1813
+ replaceWith(setParentDeep(setNegate(parseFragment(asciiSpaceChar), negate), parent));
1814
+ return;
1815
+ }
1816
+ if (wordIsAscii && (kind === "word" || value === "word")) {
1817
+ replaceWith(setParent(E2("word", { negate }), parent));
1818
+ return;
1819
+ }
1820
+ if (kind === "any") {
1821
+ replaceWith(setParent(Q2("Any"), parent));
1822
+ } else if (kind === "digit") {
1823
+ replaceWith(setParent(Q2("Nd", { negate }), parent));
1824
+ } else if (kind === "dot") {
1825
+ } else if (kind === "text_segment") {
1826
+ if (accuracy === "strict") {
1827
+ throw new Error(r3`Use of "\X" requires non-strict accuracy`);
1828
+ }
1829
+ const eBase = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?";
1830
+ const emoji = r3`\p{RI}{2}|${eBase}(?:\u200D${eBase})*`;
1831
+ replaceWith(setParentDeep(parseFragment(
1832
+ // Close approximation of an extended grapheme cluster; see <unicode.org/reports/tr29/>
1833
+ r3`(?>\r\n|${minTargetEs2024 ? r3`\p{RGI_Emoji}` : emoji}|\P{M}\p{M}*)`,
1834
+ // Allow JS property `RGI_Emoji` through
1835
+ { skipPropertyNameValidation: true }
1836
+ ), parent));
1837
+ } else if (kind === "hex") {
1838
+ replaceWith(setParent(Q2("AHex", { negate }), parent));
1839
+ } else if (kind === "newline") {
1840
+ replaceWith(setParentDeep(parseFragment(negate ? "[^\n]" : "(?>\r\n?|[\n\v\f\x85\u2028\u2029])"), parent));
1841
+ } else if (kind === "posix") {
1842
+ if (!minTargetEs2024 && (value === "graph" || value === "print")) {
1843
+ if (accuracy === "strict") {
1844
+ throw new Error(`POSIX class "${value}" requires min target ES2024 or non-strict accuracy`);
1845
+ }
1846
+ let ascii = {
1847
+ graph: "!-~",
1848
+ print: " -~"
1849
+ }[value];
1850
+ if (negate) {
1851
+ ascii = `\0-${cp(ascii.codePointAt(0) - 1)}${cp(ascii.codePointAt(2) + 1)}-\u{10FFFF}`;
1852
+ }
1853
+ replaceWith(setParentDeep(parseFragment(`[${ascii}]`), parent));
1854
+ } else {
1855
+ replaceWith(setParentDeep(setNegate(parseFragment(PosixClassMap.get(value)), negate), parent));
1856
+ }
1857
+ } else if (kind === "property") {
1858
+ if (!JsUnicodePropertyMap.has(w2(value))) {
1859
+ node.key = "sc";
1860
+ }
1861
+ } else if (kind === "space") {
1862
+ replaceWith(setParent(Q2("space", { negate }), parent));
1863
+ } else if (kind === "word") {
1864
+ replaceWith(setParentDeep(setNegate(parseFragment(defaultWordChar), negate), parent));
1865
+ } else {
1866
+ throw new Error(`Unexpected character set kind "${kind}"`);
1867
+ }
1868
+ },
1869
+ Directive({ node, parent, root, remove, replaceWith, removeAllPrevSiblings, removeAllNextSiblings }) {
1870
+ const { kind, flags } = node;
1871
+ if (kind === "flags") {
1872
+ if (!flags.enable && !flags.disable) {
1873
+ remove();
1874
+ } else {
1875
+ const flagGroup = A2({ flags });
1876
+ flagGroup.body[0].body = removeAllNextSiblings();
1877
+ replaceWith(setParentDeep(flagGroup, parent), { traverse: true });
1878
+ }
1879
+ } else if (kind === "keep") {
1880
+ const firstAlt = root.body[0];
1881
+ const hasWrapperGroup = root.body.length === 1 && // Not emulatable if within a `CapturingGroup`
1882
+ o2(firstAlt, { type: "Group" }) && firstAlt.body[0].body.length === 1;
1883
+ const topLevel = hasWrapperGroup ? firstAlt.body[0] : root;
1884
+ if (parent.parent !== topLevel || topLevel.body.length > 1) {
1885
+ throw new Error(r3`Uses "\K" in a way that's unsupported`);
1886
+ }
1887
+ const lookbehind = K2({ behind: true });
1888
+ lookbehind.body[0].body = removeAllPrevSiblings();
1889
+ replaceWith(setParentDeep(lookbehind, parent));
1890
+ } else {
1891
+ throw new Error(`Unexpected directive kind "${kind}"`);
1892
+ }
1893
+ },
1894
+ Flags({ node, parent }) {
1895
+ if (node.posixIsAscii) {
1896
+ throw new Error('Unsupported flag "P"');
1897
+ }
1898
+ if (node.textSegmentMode === "word") {
1899
+ throw new Error('Unsupported flag "y{w}"');
1900
+ }
1901
+ [
1902
+ "digitIsAscii",
1903
+ // Flag D
1904
+ "extended",
1905
+ // Flag x
1906
+ "posixIsAscii",
1907
+ // Flag P
1908
+ "spaceIsAscii",
1909
+ // Flag S
1910
+ "wordIsAscii",
1911
+ // Flag W
1912
+ "textSegmentMode"
1913
+ // Flag y{g} or y{w}
1914
+ ].forEach((f2) => delete node[f2]);
1915
+ Object.assign(node, {
1916
+ // JS flag g; no Onig equiv
1917
+ global: false,
1918
+ // JS flag d; no Onig equiv
1919
+ hasIndices: false,
1920
+ // JS flag m; no Onig equiv but its behavior is always on in Onig. Onig's only line break
1921
+ // char is line feed, unlike JS, so this flag isn't used since it would produce inaccurate
1922
+ // results (also allows `^` and `$` to be used in the generator for string start and end)
1923
+ multiline: false,
1924
+ // JS flag y; no Onig equiv, but used for `\G` emulation
1925
+ sticky: node.sticky ?? false
1926
+ // Note: Regex+ doesn't allow explicitly adding flags it handles implicitly, so leave out
1927
+ // properties `unicode` (JS flag u) and `unicodeSets` (JS flag v). Keep the existing values
1928
+ // for `ignoreCase` (flag i) and `dotAll` (JS flag s, but Onig flag m)
1929
+ });
1930
+ parent.options = {
1931
+ disable: {
1932
+ // Onig uses different rules for flag x than Regex+, so disable the implicit flag
1933
+ x: true,
1934
+ // Onig has no flag to control "named capture only" mode but contextually applies its
1935
+ // behavior when named capturing is used, so disable Regex+'s implicit flag for it
1936
+ n: true
1937
+ },
1938
+ force: {
1939
+ // Always add flag v because we're generating an AST that relies on it (it enables JS
1940
+ // support for Onig features nested classes, intersection, Unicode properties, etc.).
1941
+ // However, the generator might disable flag v based on its `target` option
1942
+ v: true
1943
+ }
1944
+ };
1945
+ },
1946
+ Group({ node }) {
1947
+ if (!node.flags) {
1948
+ return;
1949
+ }
1950
+ const { enable, disable } = node.flags;
1951
+ enable?.extended && delete enable.extended;
1952
+ disable?.extended && delete disable.extended;
1953
+ enable?.dotAll && disable?.dotAll && delete enable.dotAll;
1954
+ enable?.ignoreCase && disable?.ignoreCase && delete enable.ignoreCase;
1955
+ enable && !Object.keys(enable).length && delete node.flags.enable;
1956
+ disable && !Object.keys(disable).length && delete node.flags.disable;
1957
+ !node.flags.enable && !node.flags.disable && delete node.flags;
1958
+ },
1959
+ LookaroundAssertion({ node }, state) {
1960
+ const { kind } = node;
1961
+ if (kind === "lookbehind") {
1962
+ state.passedLookbehind = true;
1963
+ }
1964
+ },
1965
+ NamedCallout({ node, parent, replaceWith }) {
1966
+ const { kind } = node;
1967
+ if (kind === "fail") {
1968
+ replaceWith(setParentDeep(K2({ negate: true }), parent));
1969
+ } else {
1970
+ throw new Error(`Unsupported named callout "(*${kind.toUpperCase()}"`);
1971
+ }
1972
+ },
1973
+ Quantifier({ node }) {
1974
+ if (node.body.type === "Quantifier") {
1975
+ const group = A2();
1976
+ group.body[0].body.push(node.body);
1977
+ node.body = setParentDeep(group, node);
1978
+ }
1979
+ },
1980
+ Regex: {
1981
+ enter({ node }, { supportedGNodes }) {
1982
+ const leadingGs = [];
1983
+ let hasAltWithLeadG = false;
1984
+ let hasAltWithoutLeadG = false;
1985
+ for (const alt of node.body) {
1986
+ if (alt.body.length === 1 && alt.body[0].kind === "search_start") {
1987
+ alt.body.pop();
1988
+ } else {
1989
+ const leadingG = getLeadingG(alt.body);
1990
+ if (leadingG) {
1991
+ hasAltWithLeadG = true;
1992
+ Array.isArray(leadingG) ? leadingGs.push(...leadingG) : leadingGs.push(leadingG);
1993
+ } else {
1994
+ hasAltWithoutLeadG = true;
1995
+ }
1996
+ }
1997
+ }
1998
+ if (hasAltWithLeadG && !hasAltWithoutLeadG) {
1999
+ leadingGs.forEach((g) => supportedGNodes.add(g));
2000
+ }
2001
+ },
2002
+ exit(_3, { accuracy, passedLookbehind, strategy }) {
2003
+ if (accuracy === "strict" && passedLookbehind && strategy) {
2004
+ throw new Error(r3`Uses "\G" in a way that requires non-strict accuracy`);
2005
+ }
2006
+ }
2007
+ },
2008
+ Subroutine({ node }, { jsGroupNameMap }) {
2009
+ let { ref } = node;
2010
+ if (typeof ref === "string" && !isValidJsGroupName(ref)) {
2011
+ ref = getAndStoreJsGroupName(ref, jsGroupNameMap);
2012
+ node.ref = ref;
2013
+ }
2014
+ }
2015
+ };
2016
+ var SecondPassVisitor = {
2017
+ Backreference({ node }, { multiplexCapturesToLeftByRef, reffedNodesByReferencer }) {
2018
+ const { orphan, ref } = node;
2019
+ if (!orphan) {
2020
+ reffedNodesByReferencer.set(node, [...multiplexCapturesToLeftByRef.get(ref).map(({ node: node2 }) => node2)]);
2021
+ }
2022
+ },
2023
+ CapturingGroup: {
2024
+ enter({
2025
+ node,
2026
+ parent,
2027
+ replaceWith,
2028
+ skip
2029
+ }, {
2030
+ groupOriginByCopy,
2031
+ groupsByName,
2032
+ multiplexCapturesToLeftByRef,
2033
+ openRefs,
2034
+ reffedNodesByReferencer
2035
+ }) {
2036
+ const origin = groupOriginByCopy.get(node);
2037
+ if (origin && openRefs.has(node.number)) {
2038
+ const recursion2 = setParent(createRecursion(node.number), parent);
2039
+ reffedNodesByReferencer.set(recursion2, openRefs.get(node.number));
2040
+ replaceWith(recursion2);
2041
+ return;
2042
+ }
2043
+ openRefs.set(node.number, node);
2044
+ multiplexCapturesToLeftByRef.set(node.number, []);
2045
+ if (node.name) {
2046
+ getOrInsert(multiplexCapturesToLeftByRef, node.name, []);
2047
+ }
2048
+ const multiplexNodes = multiplexCapturesToLeftByRef.get(node.name ?? node.number);
2049
+ for (let i2 = 0; i2 < multiplexNodes.length; i2++) {
2050
+ const multiplex = multiplexNodes[i2];
2051
+ if (
2052
+ // This group is from subroutine expansion, and there's a multiplex value from either the
2053
+ // origin node or a prior subroutine expansion group with the same origin
2054
+ origin === multiplex.node || origin && origin === multiplex.origin || // This group is not from subroutine expansion, and it comes after a subroutine expansion
2055
+ // group that refers to this group
2056
+ node === multiplex.origin
2057
+ ) {
2058
+ multiplexNodes.splice(i2, 1);
2059
+ break;
2060
+ }
2061
+ }
2062
+ multiplexCapturesToLeftByRef.get(node.number).push({ node, origin });
2063
+ if (node.name) {
2064
+ multiplexCapturesToLeftByRef.get(node.name).push({ node, origin });
2065
+ }
2066
+ if (node.name) {
2067
+ const groupsWithSameName = getOrInsert(groupsByName, node.name, /* @__PURE__ */ new Map());
2068
+ let hasDuplicateNameToRemove = false;
2069
+ if (origin) {
2070
+ hasDuplicateNameToRemove = true;
2071
+ } else {
2072
+ for (const groupInfo of groupsWithSameName.values()) {
2073
+ if (!groupInfo.hasDuplicateNameToRemove) {
2074
+ hasDuplicateNameToRemove = true;
2075
+ break;
2076
+ }
2077
+ }
2078
+ }
2079
+ groupsByName.get(node.name).set(node, { node, hasDuplicateNameToRemove });
2080
+ }
2081
+ },
2082
+ exit({ node }, { openRefs }) {
2083
+ if (openRefs.get(node.number) === node) {
2084
+ openRefs.delete(node.number);
2085
+ }
2086
+ }
2087
+ },
2088
+ Group: {
2089
+ enter({ node }, state) {
2090
+ state.prevFlags = state.currentFlags;
2091
+ if (node.flags) {
2092
+ state.currentFlags = getNewCurrentFlags(state.currentFlags, node.flags);
2093
+ }
2094
+ },
2095
+ exit(_3, state) {
2096
+ state.currentFlags = state.prevFlags;
2097
+ }
2098
+ },
2099
+ Subroutine({ node, parent, replaceWith }, state) {
2100
+ const { isRecursive, ref } = node;
2101
+ if (isRecursive) {
2102
+ let reffed = parent;
2103
+ while (reffed = reffed.parent) {
2104
+ if (reffed.type === "CapturingGroup" && (reffed.name === ref || reffed.number === ref)) {
2105
+ break;
2106
+ }
2107
+ }
2108
+ state.reffedNodesByReferencer.set(node, reffed);
2109
+ return;
2110
+ }
2111
+ const reffedGroupNode = state.subroutineRefMap.get(ref);
2112
+ const isGlobalRecursion = ref === 0;
2113
+ const expandedSubroutine = isGlobalRecursion ? createRecursion(0) : (
2114
+ // The reffed group might itself contain subroutines, which are expanded during sub-traversal
2115
+ cloneCapturingGroup(reffedGroupNode, state.groupOriginByCopy, null)
2116
+ );
2117
+ let replacement = expandedSubroutine;
2118
+ if (!isGlobalRecursion) {
2119
+ const reffedGroupFlagMods = getCombinedFlagModsFromFlagNodes(getAllParents(
2120
+ reffedGroupNode,
2121
+ (p) => p.type === "Group" && !!p.flags
2122
+ ));
2123
+ const reffedGroupFlags = reffedGroupFlagMods ? getNewCurrentFlags(state.globalFlags, reffedGroupFlagMods) : state.globalFlags;
2124
+ if (!areFlagsEqual(reffedGroupFlags, state.currentFlags)) {
2125
+ replacement = A2({
2126
+ flags: getFlagModsFromFlags(reffedGroupFlags)
2127
+ });
2128
+ replacement.body[0].body.push(expandedSubroutine);
2129
+ }
2130
+ }
2131
+ replaceWith(setParentDeep(replacement, parent), { traverse: !isGlobalRecursion });
2132
+ }
2133
+ };
2134
+ var ThirdPassVisitor = {
2135
+ Backreference({ node, parent, replaceWith }, state) {
2136
+ if (node.orphan) {
2137
+ state.highestOrphanBackref = Math.max(state.highestOrphanBackref, node.ref);
2138
+ return;
2139
+ }
2140
+ const reffedNodes = state.reffedNodesByReferencer.get(node);
2141
+ const participants = reffedNodes.filter((reffed) => canParticipateWithNode(reffed, node));
2142
+ if (!participants.length) {
2143
+ replaceWith(setParentDeep(K2({ negate: true }), parent));
2144
+ } else if (participants.length > 1) {
2145
+ const group = A2({
2146
+ atomic: true,
2147
+ body: participants.reverse().map((reffed) => b2({
2148
+ body: [k2(reffed.number)]
2149
+ }))
2150
+ });
2151
+ replaceWith(setParentDeep(group, parent));
2152
+ } else {
2153
+ node.ref = participants[0].number;
2154
+ }
2155
+ },
2156
+ CapturingGroup({ node }, state) {
2157
+ node.number = ++state.numCapturesToLeft;
2158
+ if (node.name) {
2159
+ if (state.groupsByName.get(node.name).get(node).hasDuplicateNameToRemove) {
2160
+ delete node.name;
2161
+ }
2162
+ }
2163
+ },
2164
+ Regex: {
2165
+ exit({ node }, state) {
2166
+ const numCapsNeeded = Math.max(state.highestOrphanBackref - state.numCapturesToLeft, 0);
2167
+ for (let i2 = 0; i2 < numCapsNeeded; i2++) {
2168
+ const emptyCapture = P2();
2169
+ node.body.at(-1).body.push(emptyCapture);
2170
+ }
2171
+ }
2172
+ },
2173
+ Subroutine({ node }, state) {
2174
+ if (!node.isRecursive || node.ref === 0) {
2175
+ return;
2176
+ }
2177
+ node.ref = state.reffedNodesByReferencer.get(node).number;
2178
+ }
2179
+ };
2180
+ function addParentProperties(root) {
2181
+ S(root, {
2182
+ "*"({ node, parent }) {
2183
+ node.parent = parent;
2184
+ }
2185
+ });
2186
+ }
2187
+ function areFlagsEqual(a2, b3) {
2188
+ return a2.dotAll === b3.dotAll && a2.ignoreCase === b3.ignoreCase;
2189
+ }
2190
+ function canParticipateWithNode(capture, node) {
2191
+ let rightmostPoint = node;
2192
+ do {
2193
+ if (rightmostPoint.type === "Regex") {
2194
+ return false;
2195
+ }
2196
+ if (rightmostPoint.type === "Alternative") {
2197
+ continue;
2198
+ }
2199
+ if (rightmostPoint === capture) {
2200
+ return false;
2201
+ }
2202
+ const kidsOfParent = getKids(rightmostPoint.parent);
2203
+ for (const kid of kidsOfParent) {
2204
+ if (kid === rightmostPoint) {
2205
+ break;
2206
+ }
2207
+ if (kid === capture || isAncestorOf(kid, capture)) {
2208
+ return true;
2209
+ }
2210
+ }
2211
+ } while (rightmostPoint = rightmostPoint.parent);
2212
+ throw new Error("Unexpected path");
2213
+ }
2214
+ function cloneCapturingGroup(obj, originMap, up, up2) {
2215
+ const store = Array.isArray(obj) ? [] : {};
2216
+ for (const [key, value] of Object.entries(obj)) {
2217
+ if (key === "parent") {
2218
+ store.parent = Array.isArray(up) ? up2 : up;
2219
+ } else if (value && typeof value === "object") {
2220
+ store[key] = cloneCapturingGroup(value, originMap, store, up);
2221
+ } else {
2222
+ if (key === "type" && value === "CapturingGroup") {
2223
+ originMap.set(store, originMap.get(obj) ?? obj);
2224
+ }
2225
+ store[key] = value;
2226
+ }
2227
+ }
2228
+ return store;
2229
+ }
2230
+ function createRecursion(ref) {
2231
+ const node = O2(ref);
2232
+ node.isRecursive = true;
2233
+ return node;
2234
+ }
2235
+ function getAllParents(node, filterFn) {
2236
+ const results = [];
2237
+ while (node = node.parent) {
2238
+ if (!filterFn || filterFn(node)) {
2239
+ results.push(node);
2240
+ }
2241
+ }
2242
+ return results;
2243
+ }
2244
+ function getAndStoreJsGroupName(name, map) {
2245
+ if (map.has(name)) {
2246
+ return map.get(name);
2247
+ }
2248
+ const jsName = `$${map.size}_${name.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug, "_")}`;
2249
+ map.set(name, jsName);
2250
+ return jsName;
2251
+ }
2252
+ function getCombinedFlagModsFromFlagNodes(flagNodes) {
2253
+ const flagProps = ["dotAll", "ignoreCase"];
2254
+ const combinedFlags = { enable: {}, disable: {} };
2255
+ flagNodes.forEach(({ flags }) => {
2256
+ flagProps.forEach((prop) => {
2257
+ if (flags.enable?.[prop]) {
2258
+ delete combinedFlags.disable[prop];
2259
+ combinedFlags.enable[prop] = true;
2260
+ }
2261
+ if (flags.disable?.[prop]) {
2262
+ combinedFlags.disable[prop] = true;
2263
+ }
2264
+ });
2265
+ });
2266
+ if (!Object.keys(combinedFlags.enable).length) {
2267
+ delete combinedFlags.enable;
2268
+ }
2269
+ if (!Object.keys(combinedFlags.disable).length) {
2270
+ delete combinedFlags.disable;
2271
+ }
2272
+ if (combinedFlags.enable || combinedFlags.disable) {
2273
+ return combinedFlags;
2274
+ }
2275
+ return null;
2276
+ }
2277
+ function getFlagModsFromFlags({ dotAll, ignoreCase }) {
2278
+ const mods = {};
2279
+ if (dotAll || ignoreCase) {
2280
+ mods.enable = {};
2281
+ dotAll && (mods.enable.dotAll = true);
2282
+ ignoreCase && (mods.enable.ignoreCase = true);
2283
+ }
2284
+ if (!dotAll || !ignoreCase) {
2285
+ mods.disable = {};
2286
+ !dotAll && (mods.disable.dotAll = true);
2287
+ !ignoreCase && (mods.disable.ignoreCase = true);
2288
+ }
2289
+ return mods;
2290
+ }
2291
+ function getKids(node) {
2292
+ if (!node) {
2293
+ throw new Error("Node expected");
2294
+ }
2295
+ const { body } = node;
2296
+ return Array.isArray(body) ? body : body ? [body] : null;
2297
+ }
2298
+ function getLeadingG(els) {
2299
+ const firstToConsider = els.find((el) => el.kind === "search_start" || isLoneGLookaround(el, { negate: false }) || !isAlwaysZeroLength(el));
2300
+ if (!firstToConsider) {
2301
+ return null;
2302
+ }
2303
+ if (firstToConsider.kind === "search_start") {
2304
+ return firstToConsider;
2305
+ }
2306
+ if (firstToConsider.type === "LookaroundAssertion") {
2307
+ return firstToConsider.body[0].body[0];
2308
+ }
2309
+ if (firstToConsider.type === "CapturingGroup" || firstToConsider.type === "Group") {
2310
+ const gNodesForGroup = [];
2311
+ for (const alt of firstToConsider.body) {
2312
+ const leadingG = getLeadingG(alt.body);
2313
+ if (!leadingG) {
2314
+ return null;
2315
+ }
2316
+ Array.isArray(leadingG) ? gNodesForGroup.push(...leadingG) : gNodesForGroup.push(leadingG);
2317
+ }
2318
+ return gNodesForGroup;
2319
+ }
2320
+ return null;
2321
+ }
2322
+ function isAncestorOf(node, descendant) {
2323
+ const kids = getKids(node) ?? [];
2324
+ for (const kid of kids) {
2325
+ if (kid === descendant || isAncestorOf(kid, descendant)) {
2326
+ return true;
2327
+ }
2328
+ }
2329
+ return false;
2330
+ }
2331
+ function isAlwaysZeroLength({ type }) {
2332
+ return type === "Assertion" || type === "Directive" || type === "LookaroundAssertion";
2333
+ }
2334
+ function isAlwaysNonZeroLength(node) {
2335
+ const types = [
2336
+ "Character",
2337
+ "CharacterClass",
2338
+ "CharacterSet"
2339
+ ];
2340
+ return types.includes(node.type) || node.type === "Quantifier" && node.min && types.includes(node.body.type);
2341
+ }
2342
+ function isLoneGLookaround(node, options) {
2343
+ const opts = {
2344
+ negate: null,
2345
+ ...options
2346
+ };
2347
+ return node.type === "LookaroundAssertion" && (opts.negate === null || node.negate === opts.negate) && node.body.length === 1 && o2(node.body[0], {
2348
+ type: "Assertion",
2349
+ kind: "search_start"
2350
+ });
2351
+ }
2352
+ function isValidJsGroupName(name) {
2353
+ return /^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(name);
2354
+ }
2355
+ function parseFragment(pattern, options) {
2356
+ const ast = J2(pattern, {
2357
+ ...options,
2358
+ // Providing a custom set of Unicode property names avoids converting some JS Unicode
2359
+ // properties (ex: `\p{Alpha}`) to Onig POSIX classes
2360
+ unicodePropertyMap: JsUnicodePropertyMap
2361
+ });
2362
+ const alts = ast.body;
2363
+ if (alts.length > 1 || alts[0].body.length > 1) {
2364
+ return A2({ body: alts });
2365
+ }
2366
+ return alts[0].body[0];
2367
+ }
2368
+ function setNegate(node, negate) {
2369
+ node.negate = negate;
2370
+ return node;
2371
+ }
2372
+ function setParent(node, parent) {
2373
+ node.parent = parent;
2374
+ return node;
2375
+ }
2376
+ function setParentDeep(node, parent) {
2377
+ addParentProperties(node);
2378
+ node.parent = parent;
2379
+ return node;
2380
+ }
2381
+ function generate(ast, options) {
2382
+ const opts = getOptions(options);
2383
+ const minTargetEs2024 = isMinTarget(opts.target, "ES2024");
2384
+ const minTargetEs2025 = isMinTarget(opts.target, "ES2025");
2385
+ const recursionLimit = opts.rules.recursionLimit;
2386
+ if (!Number.isInteger(recursionLimit) || recursionLimit < 2 || recursionLimit > 20) {
2387
+ throw new Error("Invalid recursionLimit; use 2-20");
2388
+ }
2389
+ let hasCaseInsensitiveNode = null;
2390
+ let hasCaseSensitiveNode = null;
2391
+ if (!minTargetEs2025) {
2392
+ const iStack = [ast.flags.ignoreCase];
2393
+ S(ast, FlagModifierVisitor, {
2394
+ getCurrentModI: () => iStack.at(-1),
2395
+ popModI() {
2396
+ iStack.pop();
2397
+ },
2398
+ pushModI(isIOn) {
2399
+ iStack.push(isIOn);
2400
+ },
2401
+ setHasCasedChar() {
2402
+ if (iStack.at(-1)) {
2403
+ hasCaseInsensitiveNode = true;
2404
+ } else {
2405
+ hasCaseSensitiveNode = true;
2406
+ }
2407
+ }
2408
+ });
2409
+ }
2410
+ const appliedGlobalFlags = {
2411
+ dotAll: ast.flags.dotAll,
2412
+ // - Turn global flag i on if a case insensitive node was used and no case sensitive nodes were
2413
+ // used (to avoid unnecessary node expansion).
2414
+ // - Turn global flag i off if a case sensitive node was used (since case sensitivity can't be
2415
+ // forced without the use of ES2025 flag groups)
2416
+ ignoreCase: !!((ast.flags.ignoreCase || hasCaseInsensitiveNode) && !hasCaseSensitiveNode)
2417
+ };
2418
+ let lastNode = ast;
2419
+ const state = {
2420
+ accuracy: opts.accuracy,
2421
+ appliedGlobalFlags,
2422
+ captureMap: /* @__PURE__ */ new Map(),
2423
+ currentFlags: {
2424
+ dotAll: ast.flags.dotAll,
2425
+ ignoreCase: ast.flags.ignoreCase
2426
+ },
2427
+ inCharClass: false,
2428
+ lastNode,
2429
+ originMap: ast._originMap,
2430
+ recursionLimit,
2431
+ useAppliedIgnoreCase: !!(!minTargetEs2025 && hasCaseInsensitiveNode && hasCaseSensitiveNode),
2432
+ useFlagMods: minTargetEs2025,
2433
+ useFlagV: minTargetEs2024,
2434
+ verbose: opts.verbose
2435
+ };
2436
+ function gen(node) {
2437
+ state.lastNode = lastNode;
2438
+ lastNode = node;
2439
+ const fn = throwIfNullish(generator[node.type], `Unexpected node type "${node.type}"`);
2440
+ return fn(node, state, gen);
2441
+ }
2442
+ const result = {
2443
+ pattern: ast.body.map(gen).join("|"),
2444
+ // Could reset `lastNode` at this point via `lastNode = ast`, but it isn't needed by flags
2445
+ flags: gen(ast.flags),
2446
+ options: { ...ast.options }
2447
+ };
2448
+ if (!minTargetEs2024) {
2449
+ delete result.options.force.v;
2450
+ result.options.disable.v = true;
2451
+ result.options.unicodeSetsPlugin = null;
2452
+ }
2453
+ result._captureTransfers = /* @__PURE__ */ new Map();
2454
+ result._hiddenCaptures = [];
2455
+ state.captureMap.forEach((value, key) => {
2456
+ if (value.hidden) {
2457
+ result._hiddenCaptures.push(key);
2458
+ }
2459
+ if (value.transferTo) {
2460
+ getOrInsert(result._captureTransfers, value.transferTo, []).push(key);
2461
+ }
2462
+ });
2463
+ return result;
2464
+ }
2465
+ var FlagModifierVisitor = {
2466
+ "*": {
2467
+ enter({ node }, state) {
2468
+ if (isAnyGroup(node)) {
2469
+ const currentModI = state.getCurrentModI();
2470
+ state.pushModI(
2471
+ node.flags ? getNewCurrentFlags({ ignoreCase: currentModI }, node.flags).ignoreCase : currentModI
2472
+ );
2473
+ }
2474
+ },
2475
+ exit({ node }, state) {
2476
+ if (isAnyGroup(node)) {
2477
+ state.popModI();
2478
+ }
2479
+ }
2480
+ },
2481
+ Backreference(_3, state) {
2482
+ state.setHasCasedChar();
2483
+ },
2484
+ Character({ node }, state) {
2485
+ if (charHasCase(cp(node.value))) {
2486
+ state.setHasCasedChar();
2487
+ }
2488
+ },
2489
+ CharacterClassRange({ node, skip }, state) {
2490
+ skip();
2491
+ if (getCasesOutsideCharClassRange(node, { firstOnly: true }).length) {
2492
+ state.setHasCasedChar();
2493
+ }
2494
+ },
2495
+ CharacterSet({ node }, state) {
2496
+ if (node.kind === "property" && UnicodePropertiesWithSpecificCase.has(node.value)) {
2497
+ state.setHasCasedChar();
2498
+ }
2499
+ }
2500
+ };
2501
+ var generator = {
2502
+ /**
2503
+ @param {AlternativeNode} node
2504
+ */
2505
+ Alternative({ body }, _3, gen) {
2506
+ return body.map(gen).join("");
2507
+ },
2508
+ /**
2509
+ @param {AssertionNode} node
2510
+ */
2511
+ Assertion({ kind, negate }) {
2512
+ if (kind === "string_end") {
2513
+ return "$";
2514
+ }
2515
+ if (kind === "string_start") {
2516
+ return "^";
2517
+ }
2518
+ if (kind === "word_boundary") {
2519
+ return negate ? r3`\B` : r3`\b`;
2520
+ }
2521
+ throw new Error(`Unexpected assertion kind "${kind}"`);
2522
+ },
2523
+ /**
2524
+ @param {BackreferenceNode} node
2525
+ */
2526
+ Backreference({ ref }, state) {
2527
+ if (typeof ref !== "number") {
2528
+ throw new Error("Unexpected named backref in transformed AST");
2529
+ }
2530
+ if (!state.useFlagMods && state.accuracy === "strict" && state.currentFlags.ignoreCase && !state.captureMap.get(ref).ignoreCase) {
2531
+ throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");
2532
+ }
2533
+ return "\\" + ref;
2534
+ },
2535
+ /**
2536
+ @param {CapturingGroupNode} node
2537
+ */
2538
+ CapturingGroup(node, state, gen) {
2539
+ const { body, name, number } = node;
2540
+ const data = { ignoreCase: state.currentFlags.ignoreCase };
2541
+ const origin = state.originMap.get(node);
2542
+ if (origin) {
2543
+ data.hidden = true;
2544
+ if (number > origin.number) {
2545
+ data.transferTo = origin.number;
2546
+ }
2547
+ }
2548
+ state.captureMap.set(number, data);
2549
+ return `(${name ? `?<${name}>` : ""}${body.map(gen).join("|")})`;
2550
+ },
2551
+ /**
2552
+ @param {CharacterNode} node
2553
+ */
2554
+ Character({ value }, state) {
2555
+ const char = cp(value);
2556
+ const escaped = getCharEscape(value, {
2557
+ escDigit: state.lastNode.type === "Backreference",
2558
+ inCharClass: state.inCharClass,
2559
+ useFlagV: state.useFlagV
2560
+ });
2561
+ if (escaped !== char) {
2562
+ return escaped;
2563
+ }
2564
+ if (state.useAppliedIgnoreCase && state.currentFlags.ignoreCase && charHasCase(char)) {
2565
+ const cases = getIgnoreCaseMatchChars(char);
2566
+ return state.inCharClass ? cases.join("") : cases.length > 1 ? `[${cases.join("")}]` : cases[0];
2567
+ }
2568
+ return char;
2569
+ },
2570
+ /**
2571
+ @param {CharacterClassNode} node
2572
+ */
2573
+ CharacterClass(node, state, gen) {
2574
+ const { kind, negate, parent } = node;
2575
+ let { body } = node;
2576
+ if (kind === "intersection" && !state.useFlagV) {
2577
+ throw new Error("Use of character class intersection requires min target ES2024");
2578
+ }
2579
+ if (envFlags.bugFlagVLiteralHyphenIsRange && state.useFlagV && body.some(isLiteralHyphen)) {
2580
+ body = [m2(45), ...body.filter((kid) => !isLiteralHyphen(kid))];
2581
+ }
2582
+ const genClass = () => `[${negate ? "^" : ""}${body.map(gen).join(kind === "intersection" ? "&&" : "")}]`;
2583
+ if (!state.inCharClass) {
2584
+ if (
2585
+ // Already established `kind !== 'intersection'` if `!state.useFlagV`; don't check again
2586
+ (!state.useFlagV || envFlags.bugNestedClassIgnoresNegation) && !negate
2587
+ ) {
2588
+ const negatedChildClasses = body.filter(
2589
+ (kid) => kid.type === "CharacterClass" && kid.kind === "union" && kid.negate
2590
+ );
2591
+ if (negatedChildClasses.length) {
2592
+ const group = A2();
2593
+ const groupFirstAlt = group.body[0];
2594
+ group.parent = parent;
2595
+ groupFirstAlt.parent = group;
2596
+ body = body.filter((kid) => !negatedChildClasses.includes(kid));
2597
+ node.body = body;
2598
+ if (body.length) {
2599
+ node.parent = groupFirstAlt;
2600
+ groupFirstAlt.body.push(node);
2601
+ } else {
2602
+ group.body.pop();
2603
+ }
2604
+ negatedChildClasses.forEach((cc) => {
2605
+ const newAlt = b2({ body: [cc] });
2606
+ cc.parent = newAlt;
2607
+ newAlt.parent = group;
2608
+ group.body.push(newAlt);
2609
+ });
2610
+ return gen(group);
2611
+ }
2612
+ }
2613
+ state.inCharClass = true;
2614
+ const result = genClass();
2615
+ state.inCharClass = false;
2616
+ return result;
2617
+ }
2618
+ const firstEl = body[0];
2619
+ if (
2620
+ // Already established that the parent is a char class via `inCharClass`; don't check again
2621
+ kind === "union" && !negate && firstEl && // Allows many nested classes to work with `target` ES2018 which doesn't support nesting
2622
+ ((!state.useFlagV || !state.verbose) && parent.kind === "union" && !(envFlags.bugFlagVLiteralHyphenIsRange && state.useFlagV) || !state.verbose && parent.kind === "intersection" && // JS doesn't allow intersection with union or ranges
2623
+ body.length === 1 && firstEl.type !== "CharacterClassRange")
2624
+ ) {
2625
+ return body.map(gen).join("");
2626
+ }
2627
+ if (!state.useFlagV && parent.type === "CharacterClass") {
2628
+ throw new Error("Uses nested character class in a way that requires min target ES2024");
2629
+ }
2630
+ return genClass();
2631
+ },
2632
+ /**
2633
+ @param {CharacterClassRangeNode} node
2634
+ */
2635
+ CharacterClassRange(node, state) {
2636
+ const min = node.min.value;
2637
+ const max = node.max.value;
2638
+ const escOpts = {
2639
+ escDigit: false,
2640
+ inCharClass: true,
2641
+ useFlagV: state.useFlagV
2642
+ };
2643
+ const minStr = getCharEscape(min, escOpts);
2644
+ const maxStr = getCharEscape(max, escOpts);
2645
+ const extraChars = /* @__PURE__ */ new Set();
2646
+ if (state.useAppliedIgnoreCase && state.currentFlags.ignoreCase) {
2647
+ const charsOutsideRange = getCasesOutsideCharClassRange(node);
2648
+ const ranges = getCodePointRangesFromChars(charsOutsideRange);
2649
+ ranges.forEach((value) => {
2650
+ extraChars.add(
2651
+ Array.isArray(value) ? `${getCharEscape(value[0], escOpts)}-${getCharEscape(value[1], escOpts)}` : getCharEscape(value, escOpts)
2652
+ );
2653
+ });
2654
+ }
2655
+ return `${minStr}-${maxStr}${[...extraChars].join("")}`;
2656
+ },
2657
+ /**
2658
+ @param {CharacterSetNode} node
2659
+ */
2660
+ CharacterSet({ kind, negate, value, key }, state) {
2661
+ if (kind === "dot") {
2662
+ return state.currentFlags.dotAll ? state.appliedGlobalFlags.dotAll || state.useFlagMods ? "." : "[^]" : (
2663
+ // Onig's only line break char is line feed, unlike JS
2664
+ r3`[^\n]`
2665
+ );
2666
+ }
2667
+ if (kind === "digit") {
2668
+ return negate ? r3`\D` : r3`\d`;
2669
+ }
2670
+ if (kind === "property") {
2671
+ if (state.useAppliedIgnoreCase && state.currentFlags.ignoreCase && UnicodePropertiesWithSpecificCase.has(value)) {
2672
+ throw new Error(`Unicode property "${value}" can't be case-insensitive when other chars have specific case`);
2673
+ }
2674
+ return `${negate ? r3`\P` : r3`\p`}{${key ? `${key}=` : ""}${value}}`;
2675
+ }
2676
+ if (kind === "word") {
2677
+ return negate ? r3`\W` : r3`\w`;
2678
+ }
2679
+ throw new Error(`Unexpected character set kind "${kind}"`);
2680
+ },
2681
+ /**
2682
+ @param {FlagsNode} node
2683
+ */
2684
+ Flags(node, state) {
2685
+ return (
2686
+ // The transformer should never turn on the properties for flags d, g, m since Onig doesn't
2687
+ // have equivs. Flag m is never used since Onig uses different line break chars than JS
2688
+ // (node.hasIndices ? 'd' : '') +
2689
+ // (node.global ? 'g' : '') +
2690
+ // (node.multiline ? 'm' : '') +
2691
+ (state.appliedGlobalFlags.ignoreCase ? "i" : "") + (node.dotAll ? "s" : "") + (node.sticky ? "y" : "")
2692
+ );
2693
+ },
2694
+ /**
2695
+ @param {GroupNode} node
2696
+ */
2697
+ Group({ atomic: atomic2, body, flags, parent }, state, gen) {
2698
+ const currentFlags = state.currentFlags;
2699
+ if (flags) {
2700
+ state.currentFlags = getNewCurrentFlags(currentFlags, flags);
2701
+ }
2702
+ const contents = body.map(gen).join("|");
2703
+ const result = !state.verbose && body.length === 1 && // Single alt
2704
+ parent.type !== "Quantifier" && !atomic2 && (!state.useFlagMods || !flags) ? contents : `(?${getGroupPrefix(atomic2, flags, state.useFlagMods)}${contents})`;
2705
+ state.currentFlags = currentFlags;
2706
+ return result;
2707
+ },
2708
+ /**
2709
+ @param {LookaroundAssertionNode} node
2710
+ */
2711
+ LookaroundAssertion({ body, kind, negate }, _3, gen) {
2712
+ const prefix = `${kind === "lookahead" ? "" : "<"}${negate ? "!" : "="}`;
2713
+ return `(?${prefix}${body.map(gen).join("|")})`;
2714
+ },
2715
+ /**
2716
+ @param {QuantifierNode} node
2717
+ */
2718
+ Quantifier(node, _3, gen) {
2719
+ return gen(node.body) + getQuantifierStr(node);
2720
+ },
2721
+ /**
2722
+ @param {SubroutineNode & {isRecursive: true}} node
2723
+ */
2724
+ Subroutine({ isRecursive, ref }, state) {
2725
+ if (!isRecursive) {
2726
+ throw new Error("Unexpected non-recursive subroutine in transformed AST");
2727
+ }
2728
+ const limit = state.recursionLimit;
2729
+ return ref === 0 ? `(?R=${limit})` : r3`\g<${ref}&R=${limit}>`;
2730
+ }
2731
+ };
2732
+ var BaseEscapeChars = /* @__PURE__ */ new Set([
2733
+ "$",
2734
+ "(",
2735
+ ")",
2736
+ "*",
2737
+ "+",
2738
+ ".",
2739
+ "?",
2740
+ "[",
2741
+ "\\",
2742
+ "]",
2743
+ "^",
2744
+ "{",
2745
+ "|",
2746
+ "}"
2747
+ ]);
2748
+ var CharClassEscapeChars = /* @__PURE__ */ new Set([
2749
+ "-",
2750
+ "\\",
2751
+ "]",
2752
+ "^",
2753
+ // Literal `[` doesn't require escaping with flag u, but this can help work around regex source
2754
+ // linters and regex syntax processors that expect unescaped `[` to create a nested class
2755
+ "["
2756
+ ]);
2757
+ var CharClassEscapeCharsFlagV = /* @__PURE__ */ new Set([
2758
+ "(",
2759
+ ")",
2760
+ "-",
2761
+ "/",
2762
+ "[",
2763
+ "\\",
2764
+ "]",
2765
+ "^",
2766
+ "{",
2767
+ "|",
2768
+ "}",
2769
+ // Double punctuators; also includes already-listed `-` and `^`
2770
+ "!",
2771
+ "#",
2772
+ "$",
2773
+ "%",
2774
+ "&",
2775
+ "*",
2776
+ "+",
2777
+ ",",
2778
+ ".",
2779
+ ":",
2780
+ ";",
2781
+ "<",
2782
+ "=",
2783
+ ">",
2784
+ "?",
2785
+ "@",
2786
+ "`",
2787
+ "~"
2788
+ ]);
2789
+ var CharCodeEscapeMap = /* @__PURE__ */ new Map([
2790
+ [9, r3`\t`],
2791
+ // horizontal tab
2792
+ [10, r3`\n`],
2793
+ // line feed
2794
+ [11, r3`\v`],
2795
+ // vertical tab
2796
+ [12, r3`\f`],
2797
+ // form feed
2798
+ [13, r3`\r`],
2799
+ // carriage return
2800
+ [8232, r3`\u2028`],
2801
+ // line separator
2802
+ [8233, r3`\u2029`],
2803
+ // paragraph separator
2804
+ [65279, r3`\uFEFF`]
2805
+ // ZWNBSP/BOM
2806
+ ]);
2807
+ var casedRe = /^\p{Cased}$/u;
2808
+ function charHasCase(char) {
2809
+ return casedRe.test(char);
2810
+ }
2811
+ function getCasesOutsideCharClassRange(node, options) {
2812
+ const firstOnly = !!options?.firstOnly;
2813
+ const min = node.min.value;
2814
+ const max = node.max.value;
2815
+ const found = [];
2816
+ if (min < 65 && (max === 65535 || max >= 131071) || min === 65536 && max >= 131071) {
2817
+ return found;
2818
+ }
2819
+ for (let i2 = min; i2 <= max; i2++) {
2820
+ const char = cp(i2);
2821
+ if (!charHasCase(char)) {
2822
+ continue;
2823
+ }
2824
+ const charsOutsideRange = getIgnoreCaseMatchChars(char).filter((caseOfChar) => {
2825
+ const num = caseOfChar.codePointAt(0);
2826
+ return num < min || num > max;
2827
+ });
2828
+ if (charsOutsideRange.length) {
2829
+ found.push(...charsOutsideRange);
2830
+ if (firstOnly) {
2831
+ break;
2832
+ }
2833
+ }
2834
+ }
2835
+ return found;
2836
+ }
2837
+ function getCharEscape(codePoint, { escDigit, inCharClass, useFlagV }) {
2838
+ if (CharCodeEscapeMap.has(codePoint)) {
2839
+ return CharCodeEscapeMap.get(codePoint);
2840
+ }
2841
+ if (
2842
+ // Control chars, etc.; condition modeled on the Chrome developer console's display for strings
2843
+ codePoint < 32 || codePoint > 126 && codePoint < 160 || // Unicode planes 4-16; unassigned, special purpose, and private use area
2844
+ codePoint > 262143 || // Avoid corrupting a preceding backref by immediately following it with a literal digit
2845
+ escDigit && isDigitCharCode(codePoint)
2846
+ ) {
2847
+ return codePoint > 255 ? `\\u{${codePoint.toString(16).toUpperCase()}}` : `\\x${codePoint.toString(16).toUpperCase().padStart(2, "0")}`;
2848
+ }
2849
+ const escapeChars = inCharClass ? useFlagV ? CharClassEscapeCharsFlagV : CharClassEscapeChars : BaseEscapeChars;
2850
+ const char = cp(codePoint);
2851
+ return (escapeChars.has(char) ? "\\" : "") + char;
2852
+ }
2853
+ function getCodePointRangesFromChars(chars) {
2854
+ const codePoints = chars.map((char) => char.codePointAt(0)).sort((a2, b3) => a2 - b3);
2855
+ const values = [];
2856
+ let start = null;
2857
+ for (let i2 = 0; i2 < codePoints.length; i2++) {
2858
+ if (codePoints[i2 + 1] === codePoints[i2] + 1) {
2859
+ start ??= codePoints[i2];
2860
+ } else if (start === null) {
2861
+ values.push(codePoints[i2]);
2862
+ } else {
2863
+ values.push([start, codePoints[i2]]);
2864
+ start = null;
2865
+ }
2866
+ }
2867
+ return values;
2868
+ }
2869
+ function getGroupPrefix(atomic2, flagMods, useFlagMods) {
2870
+ if (atomic2) {
2871
+ return ">";
2872
+ }
2873
+ let mods = "";
2874
+ if (flagMods && useFlagMods) {
2875
+ const { enable, disable } = flagMods;
2876
+ mods = (enable?.ignoreCase ? "i" : "") + (enable?.dotAll ? "s" : "") + (disable ? "-" : "") + (disable?.ignoreCase ? "i" : "") + (disable?.dotAll ? "s" : "");
2877
+ }
2878
+ return `${mods}:`;
2879
+ }
2880
+ function getQuantifierStr({ kind, max, min }) {
2881
+ let base;
2882
+ if (!min && max === 1) {
2883
+ base = "?";
2884
+ } else if (!min && max === Infinity) {
2885
+ base = "*";
2886
+ } else if (min === 1 && max === Infinity) {
2887
+ base = "+";
2888
+ } else if (min === max) {
2889
+ base = `{${min}}`;
2890
+ } else {
2891
+ base = `{${min},${max === Infinity ? "" : max}}`;
2892
+ }
2893
+ return base + {
2894
+ greedy: "",
2895
+ lazy: "?",
2896
+ possessive: "+"
2897
+ }[kind];
2898
+ }
2899
+ function isAnyGroup({ type }) {
2900
+ return type === "CapturingGroup" || type === "Group" || type === "LookaroundAssertion";
2901
+ }
2902
+ function isDigitCharCode(value) {
2903
+ return value > 47 && value < 58;
2904
+ }
2905
+ function isLiteralHyphen({ type, value }) {
2906
+ return type === "Character" && value === 45;
2907
+ }
2908
+ var EmulatedRegExp = class _EmulatedRegExp extends RegExp {
2909
+ /**
2910
+ @type {Map<number, {
2911
+ hidden?: true;
2912
+ transferTo?: number;
2913
+ }>}
2914
+ */
2915
+ #captureMap = /* @__PURE__ */ new Map();
2916
+ /**
2917
+ @type {RegExp | EmulatedRegExp | null}
2918
+ */
2919
+ #compiled = null;
2920
+ /**
2921
+ @type {string}
2922
+ */
2923
+ #pattern;
2924
+ /**
2925
+ @type {Map<number, string>?}
2926
+ */
2927
+ #nameMap = null;
2928
+ /**
2929
+ @type {string?}
2930
+ */
2931
+ #strategy = null;
2932
+ /**
2933
+ Can be used to serialize the instance.
2934
+ @type {EmulatedRegExpOptions}
2935
+ */
2936
+ rawOptions = {};
2937
+ // Override the getter with one that works with lazy-compiled regexes
2938
+ get source() {
2939
+ return this.#pattern || "(?:)";
2940
+ }
2941
+ /**
2942
+ @overload
2943
+ @param {string} pattern
2944
+ @param {string} [flags]
2945
+ @param {EmulatedRegExpOptions} [options]
2946
+ */
2947
+ /**
2948
+ @overload
2949
+ @param {EmulatedRegExp} pattern
2950
+ @param {string} [flags]
2951
+ */
2952
+ constructor(pattern, flags, options) {
2953
+ const lazyCompile = !!options?.lazyCompile;
2954
+ if (pattern instanceof RegExp) {
2955
+ if (options) {
2956
+ throw new Error("Cannot provide options when copying a regexp");
2957
+ }
2958
+ const re2 = pattern;
2959
+ super(re2, flags);
2960
+ this.#pattern = re2.source;
2961
+ if (re2 instanceof _EmulatedRegExp) {
2962
+ this.#captureMap = re2.#captureMap;
2963
+ this.#nameMap = re2.#nameMap;
2964
+ this.#strategy = re2.#strategy;
2965
+ this.rawOptions = re2.rawOptions;
2966
+ }
2967
+ } else {
2968
+ const opts = {
2969
+ hiddenCaptures: [],
2970
+ strategy: null,
2971
+ transfers: [],
2972
+ ...options
2973
+ };
2974
+ super(lazyCompile ? "" : pattern, flags);
2975
+ this.#pattern = pattern;
2976
+ this.#captureMap = createCaptureMap(opts.hiddenCaptures, opts.transfers);
2977
+ this.#strategy = opts.strategy;
2978
+ this.rawOptions = options ?? {};
2979
+ }
2980
+ if (!lazyCompile) {
2981
+ this.#compiled = this;
2982
+ }
2983
+ }
2984
+ /**
2985
+ Called internally by all String/RegExp methods that use regexes.
2986
+ @override
2987
+ @param {string} str
2988
+ @returns {RegExpExecArray?}
2989
+ */
2990
+ exec(str) {
2991
+ if (!this.#compiled) {
2992
+ const { lazyCompile, ...rest } = this.rawOptions;
2993
+ this.#compiled = new _EmulatedRegExp(this.#pattern, this.flags, rest);
2994
+ }
2995
+ const useLastIndex = this.global || this.sticky;
2996
+ const pos = this.lastIndex;
2997
+ if (this.#strategy === "clip_search" && useLastIndex && pos) {
2998
+ this.lastIndex = 0;
2999
+ const match = this.#execCore(str.slice(pos));
3000
+ if (match) {
3001
+ adjustMatchDetailsForOffset(match, pos, str, this.hasIndices);
3002
+ this.lastIndex += pos;
3003
+ }
3004
+ return match;
3005
+ }
3006
+ return this.#execCore(str);
3007
+ }
3008
+ /**
3009
+ Adds support for hidden and transfer captures.
3010
+ @param {string} str
3011
+ @returns
3012
+ */
3013
+ #execCore(str) {
3014
+ this.#compiled.lastIndex = this.lastIndex;
3015
+ const match = super.exec.call(this.#compiled, str);
3016
+ this.lastIndex = this.#compiled.lastIndex;
3017
+ if (!match || !this.#captureMap.size) {
3018
+ return match;
3019
+ }
3020
+ const matchCopy = [...match];
3021
+ match.length = 1;
3022
+ let indicesCopy;
3023
+ if (this.hasIndices) {
3024
+ indicesCopy = [...match.indices];
3025
+ match.indices.length = 1;
3026
+ }
3027
+ const mappedNums = [0];
3028
+ for (let i2 = 1; i2 < matchCopy.length; i2++) {
3029
+ const { hidden, transferTo } = this.#captureMap.get(i2) ?? {};
3030
+ if (hidden) {
3031
+ mappedNums.push(null);
3032
+ } else {
3033
+ mappedNums.push(match.length);
3034
+ match.push(matchCopy[i2]);
3035
+ if (this.hasIndices) {
3036
+ match.indices.push(indicesCopy[i2]);
3037
+ }
3038
+ }
3039
+ if (transferTo && matchCopy[i2] !== void 0) {
3040
+ const to = mappedNums[transferTo];
3041
+ if (!to) {
3042
+ throw new Error(`Invalid capture transfer to "${to}"`);
3043
+ }
3044
+ match[to] = matchCopy[i2];
3045
+ if (this.hasIndices) {
3046
+ match.indices[to] = indicesCopy[i2];
3047
+ }
3048
+ if (match.groups) {
3049
+ if (!this.#nameMap) {
3050
+ this.#nameMap = createNameMap(this.source);
3051
+ }
3052
+ const name = this.#nameMap.get(transferTo);
3053
+ if (name) {
3054
+ match.groups[name] = matchCopy[i2];
3055
+ if (this.hasIndices) {
3056
+ match.indices.groups[name] = indicesCopy[i2];
3057
+ }
3058
+ }
3059
+ }
3060
+ }
3061
+ }
3062
+ return match;
3063
+ }
3064
+ };
3065
+ function adjustMatchDetailsForOffset(match, offset, input, hasIndices) {
3066
+ match.index += offset;
3067
+ match.input = input;
3068
+ if (hasIndices) {
3069
+ const indices = match.indices;
3070
+ for (let i2 = 0; i2 < indices.length; i2++) {
3071
+ const arr = indices[i2];
3072
+ if (arr) {
3073
+ indices[i2] = [arr[0] + offset, arr[1] + offset];
3074
+ }
3075
+ }
3076
+ const groupIndices = indices.groups;
3077
+ if (groupIndices) {
3078
+ Object.keys(groupIndices).forEach((key) => {
3079
+ const arr = groupIndices[key];
3080
+ if (arr) {
3081
+ groupIndices[key] = [arr[0] + offset, arr[1] + offset];
3082
+ }
3083
+ });
3084
+ }
3085
+ }
3086
+ }
3087
+ function createCaptureMap(hiddenCaptures, transfers) {
3088
+ const captureMap = /* @__PURE__ */ new Map();
3089
+ for (const num of hiddenCaptures) {
3090
+ captureMap.set(num, {
3091
+ hidden: true
3092
+ });
3093
+ }
3094
+ for (const [to, from] of transfers) {
3095
+ for (const num of from) {
3096
+ getOrInsert(captureMap, num, {}).transferTo = to;
3097
+ }
3098
+ }
3099
+ return captureMap;
3100
+ }
3101
+ function createNameMap(pattern) {
3102
+ const re2 = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu;
3103
+ const map = /* @__PURE__ */ new Map();
3104
+ let numCharClassesOpen = 0;
3105
+ let numCaptures = 0;
3106
+ let match;
3107
+ while (match = re2.exec(pattern)) {
3108
+ const { 0: m3, groups: { capture, name } } = match;
3109
+ if (m3 === "[") {
3110
+ numCharClassesOpen++;
3111
+ } else if (!numCharClassesOpen) {
3112
+ if (capture) {
3113
+ numCaptures++;
3114
+ if (name) {
3115
+ map.set(numCaptures, name);
3116
+ }
3117
+ }
3118
+ } else if (m3 === "]") {
3119
+ numCharClassesOpen--;
3120
+ }
3121
+ }
3122
+ return map;
3123
+ }
3124
+ function toRegExp(pattern, options) {
3125
+ const d2 = toRegExpDetails(pattern, options);
3126
+ if (d2.options) {
3127
+ return new EmulatedRegExp(d2.pattern, d2.flags, d2.options);
3128
+ }
3129
+ return new RegExp(d2.pattern, d2.flags);
3130
+ }
3131
+ function toRegExpDetails(pattern, options) {
3132
+ const opts = getOptions(options);
3133
+ const onigurumaAst = J2(pattern, {
3134
+ flags: opts.flags,
3135
+ normalizeUnknownPropertyNames: true,
3136
+ rules: {
3137
+ captureGroup: opts.rules.captureGroup,
3138
+ singleline: opts.rules.singleline
3139
+ },
3140
+ skipBackrefValidation: opts.rules.allowOrphanBackrefs,
3141
+ unicodePropertyMap: JsUnicodePropertyMap
3142
+ });
3143
+ const regexPlusAst = transform(onigurumaAst, {
3144
+ accuracy: opts.accuracy,
3145
+ asciiWordBoundaries: opts.rules.asciiWordBoundaries,
3146
+ avoidSubclass: opts.avoidSubclass,
3147
+ bestEffortTarget: opts.target
3148
+ });
3149
+ const generated = generate(regexPlusAst, opts);
3150
+ const recursionResult = recursion(generated.pattern, {
3151
+ captureTransfers: generated._captureTransfers,
3152
+ hiddenCaptures: generated._hiddenCaptures,
3153
+ mode: "external"
3154
+ });
3155
+ const possessiveResult = possessive(recursionResult.pattern);
3156
+ const atomicResult = atomic(possessiveResult.pattern, {
3157
+ captureTransfers: recursionResult.captureTransfers,
3158
+ hiddenCaptures: recursionResult.hiddenCaptures
3159
+ });
3160
+ const details = {
3161
+ pattern: atomicResult.pattern,
3162
+ flags: `${opts.hasIndices ? "d" : ""}${opts.global ? "g" : ""}${generated.flags}${generated.options.disable.v ? "u" : "v"}`
3163
+ };
3164
+ if (opts.avoidSubclass) {
3165
+ if (opts.lazyCompileLength !== Infinity) {
3166
+ throw new Error("Lazy compilation requires subclass");
3167
+ }
3168
+ } else {
3169
+ const hiddenCaptures = atomicResult.hiddenCaptures.sort((a2, b3) => a2 - b3);
3170
+ const transfers = Array.from(atomicResult.captureTransfers);
3171
+ const strategy = regexPlusAst._strategy;
3172
+ const lazyCompile = details.pattern.length >= opts.lazyCompileLength;
3173
+ if (hiddenCaptures.length || transfers.length || strategy || lazyCompile) {
3174
+ details.options = {
3175
+ ...hiddenCaptures.length && { hiddenCaptures },
3176
+ ...transfers.length && { transfers },
3177
+ ...strategy && { strategy },
3178
+ ...lazyCompile && { lazyCompile }
3179
+ };
3180
+ }
3181
+ }
3182
+ return details;
3183
+ }
3184
+
3185
+ // node_modules/.pnpm/@shikijs+engine-javascript@4.4.3/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
3186
+ function defaultJavaScriptRegexConstructor(pattern, options) {
3187
+ return toRegExp(pattern, {
3188
+ global: true,
3189
+ hasIndices: true,
3190
+ lazyCompileLength: 3e3,
3191
+ rules: {
3192
+ allowOrphanBackrefs: true,
3193
+ asciiWordBoundaries: true,
3194
+ captureGroup: true,
3195
+ recursionLimit: 5,
3196
+ singleline: true
3197
+ },
3198
+ ...options
3199
+ });
3200
+ }
3201
+ function createJavaScriptRegexEngine(options = {}) {
3202
+ const _options = {
3203
+ target: "auto",
3204
+ cache: /* @__PURE__ */ new Map(),
3205
+ ...options
3206
+ };
3207
+ _options.regexConstructor ||= (pattern) => defaultJavaScriptRegexConstructor(pattern, { target: _options.target });
3208
+ return {
3209
+ createScanner(patterns) {
3210
+ return new JavaScriptScanner(patterns, _options);
3211
+ },
3212
+ createString(s2) {
3213
+ return { content: s2 };
3214
+ }
3215
+ };
3216
+ }
3217
+
3218
+ // node_modules/.pnpm/@shikijs+engine-javascript@4.4.3/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs
3219
+ function createJavaScriptRawEngine() {
3220
+ const options = {
3221
+ cache: /* @__PURE__ */ new Map(),
3222
+ regexConstructor: () => {
3223
+ throw new Error("JavaScriptRawEngine: only support precompiled grammar");
3224
+ }
3225
+ };
3226
+ return {
3227
+ createScanner(patterns) {
3228
+ return new JavaScriptScanner(patterns, options);
3229
+ },
3230
+ createString(s2) {
3231
+ return { content: s2 };
3232
+ }
3233
+ };
3234
+ }
3235
+ export {
3236
+ JavaScriptScanner,
3237
+ createJavaScriptRawEngine,
3238
+ createJavaScriptRegexEngine,
3239
+ defaultJavaScriptRegexConstructor
3240
+ };
3241
+ //# sourceMappingURL=engine-javascript-PDVIGNGR.mjs.map