just-binary 2.9.8

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 (841) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +458 -0
  3. package/dist/AGENTS.md +323 -0
  4. package/dist/Bash.d.ts +179 -0
  5. package/dist/ast/types.d.ts +615 -0
  6. package/dist/banned-patterns-test.d.ts +8 -0
  7. package/dist/bin/chunks/alias-23G4Q2RS.js +2 -0
  8. package/dist/bin/chunks/awk2-Z6VRXKAK.js +2 -0
  9. package/dist/bin/chunks/base64-DNX4WCIO.js +2 -0
  10. package/dist/bin/chunks/basename-MPQ7M4RF.js +2 -0
  11. package/dist/bin/chunks/bash-OQ32Y5I6.js +2 -0
  12. package/dist/bin/chunks/bytes-6YUZMX3P.js +2 -0
  13. package/dist/bin/chunks/cat-CL5ISR5P.js +2 -0
  14. package/dist/bin/chunks/chmod-R6IWRSKZ.js +2 -0
  15. package/dist/bin/chunks/chunk-227L3ACM.js +23 -0
  16. package/dist/bin/chunks/chunk-2QA4P6HI.js +12 -0
  17. package/dist/bin/chunks/chunk-3MFM4GSH.js +36 -0
  18. package/dist/bin/chunks/chunk-3UP5LXDO.js +3 -0
  19. package/dist/bin/chunks/chunk-47P7JSQI.js +2 -0
  20. package/dist/bin/chunks/chunk-4KBTPDQB.js +3 -0
  21. package/dist/bin/chunks/chunk-4UK2MV3F.js +13 -0
  22. package/dist/bin/chunks/chunk-4VDEBYW7.js +2 -0
  23. package/dist/bin/chunks/chunk-563AO4OL.js +7 -0
  24. package/dist/bin/chunks/chunk-5HDWUXRX.js +7 -0
  25. package/dist/bin/chunks/chunk-5MCFI6LE.js +5 -0
  26. package/dist/bin/chunks/chunk-6CZOPIZD.js +6 -0
  27. package/dist/bin/chunks/chunk-6FNFX5GG.js +5 -0
  28. package/dist/bin/chunks/chunk-6NYIHYDY.js +7 -0
  29. package/dist/bin/chunks/chunk-6Y4TKR73.js +16 -0
  30. package/dist/bin/chunks/chunk-7C7WEK46.js +23 -0
  31. package/dist/bin/chunks/chunk-7TNGQWY6.js +6 -0
  32. package/dist/bin/chunks/chunk-7UAWRBQS.js +9 -0
  33. package/dist/bin/chunks/chunk-ARGU3OIG.js +17 -0
  34. package/dist/bin/chunks/chunk-BA3A5BYZ.js +3 -0
  35. package/dist/bin/chunks/chunk-BB7T22CF.js +140 -0
  36. package/dist/bin/chunks/chunk-BY24LKGP.js +8 -0
  37. package/dist/bin/chunks/chunk-CRHN4WNQ.js +63 -0
  38. package/dist/bin/chunks/chunk-ELZHJGI7.js +10 -0
  39. package/dist/bin/chunks/chunk-F46CSMUF.js +2 -0
  40. package/dist/bin/chunks/chunk-FQX4G5RH.js +7 -0
  41. package/dist/bin/chunks/chunk-G43H2WGH.js +17 -0
  42. package/dist/bin/chunks/chunk-GIFF636B.js +2 -0
  43. package/dist/bin/chunks/chunk-GMJWC3MC.js +12 -0
  44. package/dist/bin/chunks/chunk-HVDU57EV.js +16 -0
  45. package/dist/bin/chunks/chunk-HWGK3XW7.js +6 -0
  46. package/dist/bin/chunks/chunk-HYR7G7KS.js +3 -0
  47. package/dist/bin/chunks/chunk-I2225JSU.js +14 -0
  48. package/dist/bin/chunks/chunk-I2FUQZXU.js +11 -0
  49. package/dist/bin/chunks/chunk-IBHPKKIT.js +10 -0
  50. package/dist/bin/chunks/chunk-IKNNFJNZ.js +14 -0
  51. package/dist/bin/chunks/chunk-INPUJM7Y.js +8 -0
  52. package/dist/bin/chunks/chunk-IOBKPMWJ.js +9 -0
  53. package/dist/bin/chunks/chunk-IYSA2L6A.js +13 -0
  54. package/dist/bin/chunks/chunk-JMLNX7GE.js +287 -0
  55. package/dist/bin/chunks/chunk-K2K4KPOQ.js +3 -0
  56. package/dist/bin/chunks/chunk-K6DD7NH3.js +9 -0
  57. package/dist/bin/chunks/chunk-KFLJ4EMB.js +4 -0
  58. package/dist/bin/chunks/chunk-KOMDAXHM.js +7 -0
  59. package/dist/bin/chunks/chunk-KV7ZTM2R.js +11 -0
  60. package/dist/bin/chunks/chunk-LCCVVEJA.js +10 -0
  61. package/dist/bin/chunks/chunk-LUPJK5US.js +84 -0
  62. package/dist/bin/chunks/chunk-LWF3XDOC.js +32 -0
  63. package/dist/bin/chunks/chunk-LXNARM2C.js +9 -0
  64. package/dist/bin/chunks/chunk-LXZS3X5T.js +9 -0
  65. package/dist/bin/chunks/chunk-M4ICSCXT.js +100 -0
  66. package/dist/bin/chunks/chunk-MEBZXRGE.js +5 -0
  67. package/dist/bin/chunks/chunk-MSPSS36S.js +16 -0
  68. package/dist/bin/chunks/chunk-N335RIGZ.js +20 -0
  69. package/dist/bin/chunks/chunk-N5KGQWJH.js +5 -0
  70. package/dist/bin/chunks/chunk-NDHTQE5T.js +8 -0
  71. package/dist/bin/chunks/chunk-NF5G7X3O.js +7 -0
  72. package/dist/bin/chunks/chunk-NGKNJ6V2.js +11 -0
  73. package/dist/bin/chunks/chunk-OBH7XN5N.js +1 -0
  74. package/dist/bin/chunks/chunk-OKQ6RACF.js +73 -0
  75. package/dist/bin/chunks/chunk-PBY7XGZ6.js +8 -0
  76. package/dist/bin/chunks/chunk-PHHNNFRS.js +6 -0
  77. package/dist/bin/chunks/chunk-PO6Y7TWQ.js +6 -0
  78. package/dist/bin/chunks/chunk-Q4TLKLIZ.js +12 -0
  79. package/dist/bin/chunks/chunk-QS6LP3E3.js +6 -0
  80. package/dist/bin/chunks/chunk-QT2GMJRJ.js +8 -0
  81. package/dist/bin/chunks/chunk-QUVW3R4I.js +5 -0
  82. package/dist/bin/chunks/chunk-QUYWT2TY.js +21 -0
  83. package/dist/bin/chunks/chunk-QWUII542.js +2 -0
  84. package/dist/bin/chunks/chunk-R5EQDD5Y.js +13 -0
  85. package/dist/bin/chunks/chunk-RQSPCXDR.js +2 -0
  86. package/dist/bin/chunks/chunk-RTC6C5QW.js +2 -0
  87. package/dist/bin/chunks/chunk-S5W2KVHC.js +2 -0
  88. package/dist/bin/chunks/chunk-SDXDICI4.js +2 -0
  89. package/dist/bin/chunks/chunk-SE4C7FJY.js +33 -0
  90. package/dist/bin/chunks/chunk-SX7TI7Q2.js +3 -0
  91. package/dist/bin/chunks/chunk-TDJ55L4A.js +16 -0
  92. package/dist/bin/chunks/chunk-TNPUAMV3.js +8 -0
  93. package/dist/bin/chunks/chunk-TSGSFBQI.js +14 -0
  94. package/dist/bin/chunks/chunk-U5ZE562V.js +2 -0
  95. package/dist/bin/chunks/chunk-UIMH6I3G.js +33 -0
  96. package/dist/bin/chunks/chunk-UXPY5T2P.js +9 -0
  97. package/dist/bin/chunks/chunk-UYBH3FNE.js +2 -0
  98. package/dist/bin/chunks/chunk-V5I6PHN2.js +14 -0
  99. package/dist/bin/chunks/chunk-VOTJNR36.js +5 -0
  100. package/dist/bin/chunks/chunk-W5XFREQC.js +3 -0
  101. package/dist/bin/chunks/chunk-X2MOXVGO.js +26 -0
  102. package/dist/bin/chunks/chunk-XOGQUO62.js +2 -0
  103. package/dist/bin/chunks/chunk-Y57BDPQ5.js +6 -0
  104. package/dist/bin/chunks/chunk-YE6KXFFU.js +2 -0
  105. package/dist/bin/chunks/chunk-YEPWKN4F.js +3 -0
  106. package/dist/bin/chunks/chunk-ZEDWVSUZ.js +19 -0
  107. package/dist/bin/chunks/chunk-ZI4TTZL5.js +21 -0
  108. package/dist/bin/chunks/chunk-ZZVIGHYS.js +7 -0
  109. package/dist/bin/chunks/clear-27OP2FQZ.js +2 -0
  110. package/dist/bin/chunks/column-FJNKONCJ.js +2 -0
  111. package/dist/bin/chunks/comm-5FNEJE7X.js +2 -0
  112. package/dist/bin/chunks/cp-LVKHKFHQ.js +2 -0
  113. package/dist/bin/chunks/curl-S4FJSZA5.js +26 -0
  114. package/dist/bin/chunks/cut-UXU6PNTT.js +2 -0
  115. package/dist/bin/chunks/date-GGPTXVUT.js +2 -0
  116. package/dist/bin/chunks/diff-3V3FOITV.js +2 -0
  117. package/dist/bin/chunks/dirname-455JDV2M.js +2 -0
  118. package/dist/bin/chunks/du-WUEAQO2W.js +2 -0
  119. package/dist/bin/chunks/echo-HBXOI5TQ.js +2 -0
  120. package/dist/bin/chunks/env-MXFHTVHS.js +2 -0
  121. package/dist/bin/chunks/expand-F4FM4ML2.js +2 -0
  122. package/dist/bin/chunks/expansion-7AYBVOIQ.js +2 -0
  123. package/dist/bin/chunks/expr-5ZKR5ER5.js +2 -0
  124. package/dist/bin/chunks/file-BFN7BKUR.js +2 -0
  125. package/dist/bin/chunks/find-W4BCEJEC.js +2 -0
  126. package/dist/bin/chunks/flag-coverage-DBKGNLJO.js +2 -0
  127. package/dist/bin/chunks/fold-AE57YLOS.js +2 -0
  128. package/dist/bin/chunks/grep-I63BWUKL.js +2 -0
  129. package/dist/bin/chunks/gzip-X5IDXWZE.js +2 -0
  130. package/dist/bin/chunks/head-TBQETLQX.js +2 -0
  131. package/dist/bin/chunks/help-HGMKZ2GW.js +2 -0
  132. package/dist/bin/chunks/history-2DYRIL3U.js +2 -0
  133. package/dist/bin/chunks/hostname-RWEPTCXH.js +2 -0
  134. package/dist/bin/chunks/html-to-markdown-2VQWCEKU.js +2 -0
  135. package/dist/bin/chunks/join-TRRWQBEU.js +2 -0
  136. package/dist/bin/chunks/jq-NFKKH27D.js +2 -0
  137. package/dist/bin/chunks/ln-BSEVUP2J.js +2 -0
  138. package/dist/bin/chunks/ls-IJLTWVOI.js +2 -0
  139. package/dist/bin/chunks/md5sum-ZIQHOC4K.js +2 -0
  140. package/dist/bin/chunks/mkdir-KYFAO2SF.js +2 -0
  141. package/dist/bin/chunks/mv-TWM2PA7Q.js +2 -0
  142. package/dist/bin/chunks/nl-XLF2HFST.js +2 -0
  143. package/dist/bin/chunks/od-BOM6JPTH.js +2 -0
  144. package/dist/bin/chunks/paste-FUGXVGJX.js +2 -0
  145. package/dist/bin/chunks/printf-XUGNJ3QM.js +2 -0
  146. package/dist/bin/chunks/pwd-RZG6GZEU.js +2 -0
  147. package/dist/bin/chunks/python3-PIXJS3YM.js +14 -0
  148. package/dist/bin/chunks/readlink-4SOSIDHE.js +2 -0
  149. package/dist/bin/chunks/rev-5E5UGSUZ.js +2 -0
  150. package/dist/bin/chunks/rg-4YJSQZN7.js +2 -0
  151. package/dist/bin/chunks/rm-3PFOF4E3.js +2 -0
  152. package/dist/bin/chunks/rmdir-CSK7CGH5.js +2 -0
  153. package/dist/bin/chunks/sed-XBCUZMEP.js +2 -0
  154. package/dist/bin/chunks/seq-H7ID4VMK.js +2 -0
  155. package/dist/bin/chunks/sha1sum-EDQNYXXH.js +2 -0
  156. package/dist/bin/chunks/sha256sum-APTG6DO2.js +2 -0
  157. package/dist/bin/chunks/sleep-PNT7KILS.js +2 -0
  158. package/dist/bin/chunks/sort-ELAGZUES.js +2 -0
  159. package/dist/bin/chunks/split-QGXYUWBC.js +2 -0
  160. package/dist/bin/chunks/sqlite3-ELLMKNNJ.js +2 -0
  161. package/dist/bin/chunks/stat-Q2TZRKO3.js +2 -0
  162. package/dist/bin/chunks/strings-IGEGP5QX.js +2 -0
  163. package/dist/bin/chunks/tac-VOEDJLLG.js +2 -0
  164. package/dist/bin/chunks/tail-JOQASWMV.js +2 -0
  165. package/dist/bin/chunks/tar-2UVSVD3P.js +2 -0
  166. package/dist/bin/chunks/tee-IQLEDZOQ.js +2 -0
  167. package/dist/bin/chunks/time-VRCJK2LI.js +2 -0
  168. package/dist/bin/chunks/timeout-A36YWZWR.js +2 -0
  169. package/dist/bin/chunks/touch-5ECNQNBP.js +2 -0
  170. package/dist/bin/chunks/tr-AVALLN54.js +2 -0
  171. package/dist/bin/chunks/tree-UFM5EDXS.js +2 -0
  172. package/dist/bin/chunks/true-BU5JSAAW.js +2 -0
  173. package/dist/bin/chunks/unexpand-TDRWZW5F.js +2 -0
  174. package/dist/bin/chunks/uniq-IKBUNAMN.js +2 -0
  175. package/dist/bin/chunks/wc-2R4RS2SX.js +2 -0
  176. package/dist/bin/chunks/which-6UVGMXDF.js +2 -0
  177. package/dist/bin/chunks/whoami-N6TLTETT.js +2 -0
  178. package/dist/bin/chunks/worker.js +2260 -0
  179. package/dist/bin/chunks/xan-JX5QUK32.js +2 -0
  180. package/dist/bin/chunks/xan-view-NFMUMJ7Z.js +2 -0
  181. package/dist/bin/chunks/xargs-4MYN4U3C.js +2 -0
  182. package/dist/bin/chunks/yq-EHDQVD7S.js +2 -0
  183. package/dist/bin/just-bash.js +732 -0
  184. package/dist/bin/shell/chunks/alias-23G4Q2RS.js +2 -0
  185. package/dist/bin/shell/chunks/awk2-Z6VRXKAK.js +2 -0
  186. package/dist/bin/shell/chunks/base64-DNX4WCIO.js +2 -0
  187. package/dist/bin/shell/chunks/basename-MPQ7M4RF.js +2 -0
  188. package/dist/bin/shell/chunks/bash-OQ32Y5I6.js +2 -0
  189. package/dist/bin/shell/chunks/bytes-6YUZMX3P.js +2 -0
  190. package/dist/bin/shell/chunks/cat-CL5ISR5P.js +2 -0
  191. package/dist/bin/shell/chunks/chmod-R6IWRSKZ.js +2 -0
  192. package/dist/bin/shell/chunks/chunk-227L3ACM.js +23 -0
  193. package/dist/bin/shell/chunks/chunk-2QA4P6HI.js +12 -0
  194. package/dist/bin/shell/chunks/chunk-3MFM4GSH.js +36 -0
  195. package/dist/bin/shell/chunks/chunk-3UP5LXDO.js +3 -0
  196. package/dist/bin/shell/chunks/chunk-47P7JSQI.js +2 -0
  197. package/dist/bin/shell/chunks/chunk-4KBTPDQB.js +3 -0
  198. package/dist/bin/shell/chunks/chunk-4UK2MV3F.js +13 -0
  199. package/dist/bin/shell/chunks/chunk-4VDEBYW7.js +2 -0
  200. package/dist/bin/shell/chunks/chunk-563AO4OL.js +7 -0
  201. package/dist/bin/shell/chunks/chunk-5HDWUXRX.js +7 -0
  202. package/dist/bin/shell/chunks/chunk-5MCFI6LE.js +5 -0
  203. package/dist/bin/shell/chunks/chunk-6CZOPIZD.js +6 -0
  204. package/dist/bin/shell/chunks/chunk-6FNFX5GG.js +5 -0
  205. package/dist/bin/shell/chunks/chunk-6NYIHYDY.js +7 -0
  206. package/dist/bin/shell/chunks/chunk-6Y4TKR73.js +16 -0
  207. package/dist/bin/shell/chunks/chunk-7C7WEK46.js +23 -0
  208. package/dist/bin/shell/chunks/chunk-7TNGQWY6.js +6 -0
  209. package/dist/bin/shell/chunks/chunk-7UAWRBQS.js +9 -0
  210. package/dist/bin/shell/chunks/chunk-ARGU3OIG.js +17 -0
  211. package/dist/bin/shell/chunks/chunk-BA3A5BYZ.js +3 -0
  212. package/dist/bin/shell/chunks/chunk-BB7T22CF.js +140 -0
  213. package/dist/bin/shell/chunks/chunk-BY24LKGP.js +8 -0
  214. package/dist/bin/shell/chunks/chunk-CRHN4WNQ.js +63 -0
  215. package/dist/bin/shell/chunks/chunk-ELZHJGI7.js +10 -0
  216. package/dist/bin/shell/chunks/chunk-F46CSMUF.js +2 -0
  217. package/dist/bin/shell/chunks/chunk-FQX4G5RH.js +7 -0
  218. package/dist/bin/shell/chunks/chunk-G43H2WGH.js +17 -0
  219. package/dist/bin/shell/chunks/chunk-GIFF636B.js +2 -0
  220. package/dist/bin/shell/chunks/chunk-GMJWC3MC.js +12 -0
  221. package/dist/bin/shell/chunks/chunk-HVDU57EV.js +16 -0
  222. package/dist/bin/shell/chunks/chunk-HWGK3XW7.js +6 -0
  223. package/dist/bin/shell/chunks/chunk-HYR7G7KS.js +3 -0
  224. package/dist/bin/shell/chunks/chunk-I2225JSU.js +14 -0
  225. package/dist/bin/shell/chunks/chunk-I2FUQZXU.js +11 -0
  226. package/dist/bin/shell/chunks/chunk-IBHPKKIT.js +10 -0
  227. package/dist/bin/shell/chunks/chunk-IKNNFJNZ.js +14 -0
  228. package/dist/bin/shell/chunks/chunk-INPUJM7Y.js +8 -0
  229. package/dist/bin/shell/chunks/chunk-IOBKPMWJ.js +9 -0
  230. package/dist/bin/shell/chunks/chunk-IYSA2L6A.js +13 -0
  231. package/dist/bin/shell/chunks/chunk-JMLNX7GE.js +287 -0
  232. package/dist/bin/shell/chunks/chunk-K2K4KPOQ.js +3 -0
  233. package/dist/bin/shell/chunks/chunk-K6DD7NH3.js +9 -0
  234. package/dist/bin/shell/chunks/chunk-KFLJ4EMB.js +4 -0
  235. package/dist/bin/shell/chunks/chunk-KOMDAXHM.js +7 -0
  236. package/dist/bin/shell/chunks/chunk-KV7ZTM2R.js +11 -0
  237. package/dist/bin/shell/chunks/chunk-LCCVVEJA.js +10 -0
  238. package/dist/bin/shell/chunks/chunk-LUPJK5US.js +84 -0
  239. package/dist/bin/shell/chunks/chunk-LWF3XDOC.js +32 -0
  240. package/dist/bin/shell/chunks/chunk-LXNARM2C.js +9 -0
  241. package/dist/bin/shell/chunks/chunk-LXZS3X5T.js +9 -0
  242. package/dist/bin/shell/chunks/chunk-M4ICSCXT.js +100 -0
  243. package/dist/bin/shell/chunks/chunk-MEBZXRGE.js +5 -0
  244. package/dist/bin/shell/chunks/chunk-MSPSS36S.js +16 -0
  245. package/dist/bin/shell/chunks/chunk-N335RIGZ.js +20 -0
  246. package/dist/bin/shell/chunks/chunk-N5KGQWJH.js +5 -0
  247. package/dist/bin/shell/chunks/chunk-NDHTQE5T.js +8 -0
  248. package/dist/bin/shell/chunks/chunk-NF5G7X3O.js +7 -0
  249. package/dist/bin/shell/chunks/chunk-NGKNJ6V2.js +11 -0
  250. package/dist/bin/shell/chunks/chunk-OBH7XN5N.js +1 -0
  251. package/dist/bin/shell/chunks/chunk-OKQ6RACF.js +73 -0
  252. package/dist/bin/shell/chunks/chunk-PBY7XGZ6.js +8 -0
  253. package/dist/bin/shell/chunks/chunk-PHHNNFRS.js +6 -0
  254. package/dist/bin/shell/chunks/chunk-PO6Y7TWQ.js +6 -0
  255. package/dist/bin/shell/chunks/chunk-Q4TLKLIZ.js +12 -0
  256. package/dist/bin/shell/chunks/chunk-QS6LP3E3.js +6 -0
  257. package/dist/bin/shell/chunks/chunk-QT2GMJRJ.js +8 -0
  258. package/dist/bin/shell/chunks/chunk-QUVW3R4I.js +5 -0
  259. package/dist/bin/shell/chunks/chunk-QUYWT2TY.js +21 -0
  260. package/dist/bin/shell/chunks/chunk-QWUII542.js +2 -0
  261. package/dist/bin/shell/chunks/chunk-R5EQDD5Y.js +13 -0
  262. package/dist/bin/shell/chunks/chunk-RQSPCXDR.js +2 -0
  263. package/dist/bin/shell/chunks/chunk-RTC6C5QW.js +2 -0
  264. package/dist/bin/shell/chunks/chunk-S5W2KVHC.js +2 -0
  265. package/dist/bin/shell/chunks/chunk-SDXDICI4.js +2 -0
  266. package/dist/bin/shell/chunks/chunk-SE4C7FJY.js +33 -0
  267. package/dist/bin/shell/chunks/chunk-SX7TI7Q2.js +3 -0
  268. package/dist/bin/shell/chunks/chunk-TDJ55L4A.js +16 -0
  269. package/dist/bin/shell/chunks/chunk-TNPUAMV3.js +8 -0
  270. package/dist/bin/shell/chunks/chunk-TSGSFBQI.js +14 -0
  271. package/dist/bin/shell/chunks/chunk-U5ZE562V.js +2 -0
  272. package/dist/bin/shell/chunks/chunk-UIMH6I3G.js +33 -0
  273. package/dist/bin/shell/chunks/chunk-UXPY5T2P.js +9 -0
  274. package/dist/bin/shell/chunks/chunk-UYBH3FNE.js +2 -0
  275. package/dist/bin/shell/chunks/chunk-V5I6PHN2.js +14 -0
  276. package/dist/bin/shell/chunks/chunk-VOTJNR36.js +5 -0
  277. package/dist/bin/shell/chunks/chunk-W5XFREQC.js +3 -0
  278. package/dist/bin/shell/chunks/chunk-X2MOXVGO.js +26 -0
  279. package/dist/bin/shell/chunks/chunk-XOGQUO62.js +2 -0
  280. package/dist/bin/shell/chunks/chunk-Y57BDPQ5.js +6 -0
  281. package/dist/bin/shell/chunks/chunk-YE6KXFFU.js +2 -0
  282. package/dist/bin/shell/chunks/chunk-YEPWKN4F.js +3 -0
  283. package/dist/bin/shell/chunks/chunk-ZEDWVSUZ.js +19 -0
  284. package/dist/bin/shell/chunks/chunk-ZI4TTZL5.js +21 -0
  285. package/dist/bin/shell/chunks/chunk-ZZVIGHYS.js +7 -0
  286. package/dist/bin/shell/chunks/clear-27OP2FQZ.js +2 -0
  287. package/dist/bin/shell/chunks/column-FJNKONCJ.js +2 -0
  288. package/dist/bin/shell/chunks/comm-5FNEJE7X.js +2 -0
  289. package/dist/bin/shell/chunks/cp-LVKHKFHQ.js +2 -0
  290. package/dist/bin/shell/chunks/curl-S4FJSZA5.js +26 -0
  291. package/dist/bin/shell/chunks/cut-UXU6PNTT.js +2 -0
  292. package/dist/bin/shell/chunks/date-GGPTXVUT.js +2 -0
  293. package/dist/bin/shell/chunks/diff-3V3FOITV.js +2 -0
  294. package/dist/bin/shell/chunks/dirname-455JDV2M.js +2 -0
  295. package/dist/bin/shell/chunks/du-WUEAQO2W.js +2 -0
  296. package/dist/bin/shell/chunks/echo-HBXOI5TQ.js +2 -0
  297. package/dist/bin/shell/chunks/env-MXFHTVHS.js +2 -0
  298. package/dist/bin/shell/chunks/expand-F4FM4ML2.js +2 -0
  299. package/dist/bin/shell/chunks/expansion-7AYBVOIQ.js +2 -0
  300. package/dist/bin/shell/chunks/expr-5ZKR5ER5.js +2 -0
  301. package/dist/bin/shell/chunks/file-BFN7BKUR.js +2 -0
  302. package/dist/bin/shell/chunks/find-W4BCEJEC.js +2 -0
  303. package/dist/bin/shell/chunks/flag-coverage-DBKGNLJO.js +2 -0
  304. package/dist/bin/shell/chunks/fold-AE57YLOS.js +2 -0
  305. package/dist/bin/shell/chunks/grep-I63BWUKL.js +2 -0
  306. package/dist/bin/shell/chunks/gzip-X5IDXWZE.js +2 -0
  307. package/dist/bin/shell/chunks/head-TBQETLQX.js +2 -0
  308. package/dist/bin/shell/chunks/help-HGMKZ2GW.js +2 -0
  309. package/dist/bin/shell/chunks/history-2DYRIL3U.js +2 -0
  310. package/dist/bin/shell/chunks/hostname-RWEPTCXH.js +2 -0
  311. package/dist/bin/shell/chunks/html-to-markdown-2VQWCEKU.js +2 -0
  312. package/dist/bin/shell/chunks/join-TRRWQBEU.js +2 -0
  313. package/dist/bin/shell/chunks/jq-NFKKH27D.js +2 -0
  314. package/dist/bin/shell/chunks/ln-BSEVUP2J.js +2 -0
  315. package/dist/bin/shell/chunks/ls-IJLTWVOI.js +2 -0
  316. package/dist/bin/shell/chunks/md5sum-ZIQHOC4K.js +2 -0
  317. package/dist/bin/shell/chunks/mkdir-KYFAO2SF.js +2 -0
  318. package/dist/bin/shell/chunks/mv-TWM2PA7Q.js +2 -0
  319. package/dist/bin/shell/chunks/nl-XLF2HFST.js +2 -0
  320. package/dist/bin/shell/chunks/od-BOM6JPTH.js +2 -0
  321. package/dist/bin/shell/chunks/paste-FUGXVGJX.js +2 -0
  322. package/dist/bin/shell/chunks/printf-XUGNJ3QM.js +2 -0
  323. package/dist/bin/shell/chunks/pwd-RZG6GZEU.js +2 -0
  324. package/dist/bin/shell/chunks/python3-PIXJS3YM.js +14 -0
  325. package/dist/bin/shell/chunks/readlink-4SOSIDHE.js +2 -0
  326. package/dist/bin/shell/chunks/rev-5E5UGSUZ.js +2 -0
  327. package/dist/bin/shell/chunks/rg-4YJSQZN7.js +2 -0
  328. package/dist/bin/shell/chunks/rm-3PFOF4E3.js +2 -0
  329. package/dist/bin/shell/chunks/rmdir-CSK7CGH5.js +2 -0
  330. package/dist/bin/shell/chunks/sed-XBCUZMEP.js +2 -0
  331. package/dist/bin/shell/chunks/seq-H7ID4VMK.js +2 -0
  332. package/dist/bin/shell/chunks/sha1sum-EDQNYXXH.js +2 -0
  333. package/dist/bin/shell/chunks/sha256sum-APTG6DO2.js +2 -0
  334. package/dist/bin/shell/chunks/sleep-PNT7KILS.js +2 -0
  335. package/dist/bin/shell/chunks/sort-ELAGZUES.js +2 -0
  336. package/dist/bin/shell/chunks/split-QGXYUWBC.js +2 -0
  337. package/dist/bin/shell/chunks/sqlite3-ELLMKNNJ.js +2 -0
  338. package/dist/bin/shell/chunks/stat-Q2TZRKO3.js +2 -0
  339. package/dist/bin/shell/chunks/strings-IGEGP5QX.js +2 -0
  340. package/dist/bin/shell/chunks/tac-VOEDJLLG.js +2 -0
  341. package/dist/bin/shell/chunks/tail-JOQASWMV.js +2 -0
  342. package/dist/bin/shell/chunks/tar-2UVSVD3P.js +2 -0
  343. package/dist/bin/shell/chunks/tee-IQLEDZOQ.js +2 -0
  344. package/dist/bin/shell/chunks/time-VRCJK2LI.js +2 -0
  345. package/dist/bin/shell/chunks/timeout-A36YWZWR.js +2 -0
  346. package/dist/bin/shell/chunks/touch-5ECNQNBP.js +2 -0
  347. package/dist/bin/shell/chunks/tr-AVALLN54.js +2 -0
  348. package/dist/bin/shell/chunks/tree-UFM5EDXS.js +2 -0
  349. package/dist/bin/shell/chunks/true-BU5JSAAW.js +2 -0
  350. package/dist/bin/shell/chunks/unexpand-TDRWZW5F.js +2 -0
  351. package/dist/bin/shell/chunks/uniq-IKBUNAMN.js +2 -0
  352. package/dist/bin/shell/chunks/wc-2R4RS2SX.js +2 -0
  353. package/dist/bin/shell/chunks/which-6UVGMXDF.js +2 -0
  354. package/dist/bin/shell/chunks/whoami-N6TLTETT.js +2 -0
  355. package/dist/bin/shell/chunks/xan-JX5QUK32.js +2 -0
  356. package/dist/bin/shell/chunks/xan-view-NFMUMJ7Z.js +2 -0
  357. package/dist/bin/shell/chunks/xargs-4MYN4U3C.js +2 -0
  358. package/dist/bin/shell/chunks/yq-EHDQVD7S.js +2 -0
  359. package/dist/bin/shell/shell.js +711 -0
  360. package/dist/browser.d.ts +22 -0
  361. package/dist/bundle/browser.js +1481 -0
  362. package/dist/bundle/chunks/alias-T2KDAHDL.js +1 -0
  363. package/dist/bundle/chunks/awk2-UIH6CPHX.js +1 -0
  364. package/dist/bundle/chunks/base64-RY5JPAQL.js +1 -0
  365. package/dist/bundle/chunks/basename-QT55QR7O.js +1 -0
  366. package/dist/bundle/chunks/bash-BZZ6TUGW.js +1 -0
  367. package/dist/bundle/chunks/bytes-W6ESHQ7F.js +1 -0
  368. package/dist/bundle/chunks/cat-WUR2OJUG.js +1 -0
  369. package/dist/bundle/chunks/chmod-LTQYKUUW.js +1 -0
  370. package/dist/bundle/chunks/chunk-24BT6QUB.js +11 -0
  371. package/dist/bundle/chunks/chunk-274QVGRQ.js +2 -0
  372. package/dist/bundle/chunks/chunk-2IKXAFP4.js +11 -0
  373. package/dist/bundle/chunks/chunk-2IO54DPD.js +1 -0
  374. package/dist/bundle/chunks/chunk-2VAJD54D.js +13 -0
  375. package/dist/bundle/chunks/chunk-34P4G5H7.js +5 -0
  376. package/dist/bundle/chunks/chunk-3OY3UJDR.js +62 -0
  377. package/dist/bundle/chunks/chunk-3R6EWKMD.js +13 -0
  378. package/dist/bundle/chunks/chunk-3SPSXVPQ.js +2 -0
  379. package/dist/bundle/chunks/chunk-43RXAZRC.js +7 -0
  380. package/dist/bundle/chunks/chunk-44UOCSGV.js +1 -0
  381. package/dist/bundle/chunks/chunk-47LWQIG6.js +15 -0
  382. package/dist/bundle/chunks/chunk-4L3Y4LKT.js +5 -0
  383. package/dist/bundle/chunks/chunk-4LYDOEQ6.js +4 -0
  384. package/dist/bundle/chunks/chunk-4Q5DFBVQ.js +6 -0
  385. package/dist/bundle/chunks/chunk-4R5AUIZ4.js +6 -0
  386. package/dist/bundle/chunks/chunk-4UTZCT3W.js +2 -0
  387. package/dist/bundle/chunks/chunk-5FDLF2FN.js +5 -0
  388. package/dist/bundle/chunks/chunk-5HJSZMTG.js +1 -0
  389. package/dist/bundle/chunks/chunk-5NR6JZM4.js +12 -0
  390. package/dist/bundle/chunks/chunk-5PL72KVW.js +7 -0
  391. package/dist/bundle/chunks/chunk-6BM2WKUH.js +23 -0
  392. package/dist/bundle/chunks/chunk-6HLDZZOT.js +4 -0
  393. package/dist/bundle/chunks/chunk-7MKBHGLS.js +1 -0
  394. package/dist/bundle/chunks/chunk-7VHVF5PX.js +20 -0
  395. package/dist/bundle/chunks/chunk-A3YV3X3J.js +6 -0
  396. package/dist/bundle/chunks/chunk-AJNR4FJT.js +8 -0
  397. package/dist/bundle/chunks/chunk-AMQM5ZPF.js +1 -0
  398. package/dist/bundle/chunks/chunk-BCDE2QUY.js +1 -0
  399. package/dist/bundle/chunks/chunk-BMKJMOWP.js +2 -0
  400. package/dist/bundle/chunks/chunk-BVFIC7R6.js +4 -0
  401. package/dist/bundle/chunks/chunk-CC4HUWHZ.js +4 -0
  402. package/dist/bundle/chunks/chunk-CNCKROJZ.js +10 -0
  403. package/dist/bundle/chunks/chunk-CSFZQCAK.js +139 -0
  404. package/dist/bundle/chunks/chunk-CU7G2LMR.js +1 -0
  405. package/dist/bundle/chunks/chunk-CZP7PMAG.js +4 -0
  406. package/dist/bundle/chunks/chunk-D2OUCFAU.js +8 -0
  407. package/dist/bundle/chunks/chunk-DQXLKPVQ.js +7 -0
  408. package/dist/bundle/chunks/chunk-E6IR6BWV.js +286 -0
  409. package/dist/bundle/chunks/chunk-ELZ2RVIZ.js +11 -0
  410. package/dist/bundle/chunks/chunk-EVNUXIEZ.js +2 -0
  411. package/dist/bundle/chunks/chunk-F6FQRFZU.js +6 -0
  412. package/dist/bundle/chunks/chunk-FAECBHMR.js +2 -0
  413. package/dist/bundle/chunks/chunk-FBOLGXN4.js +16 -0
  414. package/dist/bundle/chunks/chunk-FNIOXBJW.js +9 -0
  415. package/dist/bundle/chunks/chunk-GD5SDRL7.js +5 -0
  416. package/dist/bundle/chunks/chunk-GEAGCSIY.js +31 -0
  417. package/dist/bundle/chunks/chunk-GI2KN5IL.js +22 -0
  418. package/dist/bundle/chunks/chunk-GOG2LNAH.js +9 -0
  419. package/dist/bundle/chunks/chunk-H2ENJVUI.js +10 -0
  420. package/dist/bundle/chunks/chunk-HDNR2KMO.js +13 -0
  421. package/dist/bundle/chunks/chunk-HJ37IXKX.js +12 -0
  422. package/dist/bundle/chunks/chunk-I36BZMR3.js +1 -0
  423. package/dist/bundle/chunks/chunk-I6YSZMB6.js +15 -0
  424. package/dist/bundle/chunks/chunk-IJXFPKNC.js +1 -0
  425. package/dist/bundle/chunks/chunk-IXD4Z54Z.js +8 -0
  426. package/dist/bundle/chunks/chunk-J44PYBAW.js +2 -0
  427. package/dist/bundle/chunks/chunk-JDREUEBG.js +9 -0
  428. package/dist/bundle/chunks/chunk-KA244HSE.js +5 -0
  429. package/dist/bundle/chunks/chunk-KKZJ6K7R.js +8 -0
  430. package/dist/bundle/chunks/chunk-KZ3P3SVS.js +22 -0
  431. package/dist/bundle/chunks/chunk-LIVSDOY2.js +1 -0
  432. package/dist/bundle/chunks/chunk-LX7SQKLW.js +15 -0
  433. package/dist/bundle/chunks/chunk-M5O5DYR7.js +1 -0
  434. package/dist/bundle/chunks/chunk-MML7K3J2.js +6 -0
  435. package/dist/bundle/chunks/chunk-N4GRDEVJ.js +5 -0
  436. package/dist/bundle/chunks/chunk-NPZMNEW5.js +6 -0
  437. package/dist/bundle/chunks/chunk-NUFRM6SI.js +0 -0
  438. package/dist/bundle/chunks/chunk-O7N2RCS7.js +1 -0
  439. package/dist/bundle/chunks/chunk-OSYLT4VG.js +4 -0
  440. package/dist/bundle/chunks/chunk-OXRHP7HO.js +3 -0
  441. package/dist/bundle/chunks/chunk-OZOS3R6K.js +99 -0
  442. package/dist/bundle/chunks/chunk-OZQ4AW5X.js +8 -0
  443. package/dist/bundle/chunks/chunk-PNGAWBIZ.js +10 -0
  444. package/dist/bundle/chunks/chunk-PPUKM2B7.js +13 -0
  445. package/dist/bundle/chunks/chunk-PTELGM2J.js +7 -0
  446. package/dist/bundle/chunks/chunk-Q3TLRYBC.js +72 -0
  447. package/dist/bundle/chunks/chunk-Q5AOYNOX.js +6 -0
  448. package/dist/bundle/chunks/chunk-QEKGAAIL.js +1 -0
  449. package/dist/bundle/chunks/chunk-QIL3FXIC.js +6 -0
  450. package/dist/bundle/chunks/chunk-QNZEO23C.js +8 -0
  451. package/dist/bundle/chunks/chunk-R4IVADTA.js +7 -0
  452. package/dist/bundle/chunks/chunk-RK57WTFF.js +12 -0
  453. package/dist/bundle/chunks/chunk-RU5M6ZRS.js +4 -0
  454. package/dist/bundle/chunks/chunk-SBVBPPEQ.js +5 -0
  455. package/dist/bundle/chunks/chunk-SP22LBKJ.js +20 -0
  456. package/dist/bundle/chunks/chunk-UKS3AEEA.js +32 -0
  457. package/dist/bundle/chunks/chunk-UYR5HJI6.js +7 -0
  458. package/dist/bundle/chunks/chunk-V6ANTLBA.js +15 -0
  459. package/dist/bundle/chunks/chunk-VLGZJRPG.js +16 -0
  460. package/dist/bundle/chunks/chunk-VZUQMDOT.js +2 -0
  461. package/dist/bundle/chunks/chunk-XDQU6V6S.js +19 -0
  462. package/dist/bundle/chunks/chunk-XRVUJRYI.js +35 -0
  463. package/dist/bundle/chunks/chunk-YNYSPYQ5.js +32 -0
  464. package/dist/bundle/chunks/clear-NLKZY76S.js +1 -0
  465. package/dist/bundle/chunks/column-S7P64XRJ.js +1 -0
  466. package/dist/bundle/chunks/comm-FPLN4BYY.js +1 -0
  467. package/dist/bundle/chunks/cp-W5HXJH5J.js +1 -0
  468. package/dist/bundle/chunks/curl-UFR6W4B6.js +25 -0
  469. package/dist/bundle/chunks/cut-VNFQFCA7.js +1 -0
  470. package/dist/bundle/chunks/date-EDSSFONA.js +1 -0
  471. package/dist/bundle/chunks/diff-RR5VJXIT.js +1 -0
  472. package/dist/bundle/chunks/dirname-V7Z24BGZ.js +1 -0
  473. package/dist/bundle/chunks/du-QKRPQIMY.js +1 -0
  474. package/dist/bundle/chunks/echo-TR3BM2AJ.js +1 -0
  475. package/dist/bundle/chunks/env-SVQBHVZF.js +1 -0
  476. package/dist/bundle/chunks/expand-ZVCJ72RF.js +1 -0
  477. package/dist/bundle/chunks/expansion-OBOJBZTH.js +1 -0
  478. package/dist/bundle/chunks/expr-QRA5KFYV.js +1 -0
  479. package/dist/bundle/chunks/file-TORG4IVZ.js +1 -0
  480. package/dist/bundle/chunks/find-NAGPRRQ7.js +1 -0
  481. package/dist/bundle/chunks/flag-coverage-FMTW4YWD.js +1 -0
  482. package/dist/bundle/chunks/fold-L4U6GS2N.js +1 -0
  483. package/dist/bundle/chunks/grep-D6AI423Z.js +1 -0
  484. package/dist/bundle/chunks/gzip-4EFUBHN7.js +1 -0
  485. package/dist/bundle/chunks/head-KBQT2JAC.js +1 -0
  486. package/dist/bundle/chunks/help-F3TJS3LS.js +1 -0
  487. package/dist/bundle/chunks/history-OKEAINJD.js +1 -0
  488. package/dist/bundle/chunks/hostname-AGIPNJOC.js +1 -0
  489. package/dist/bundle/chunks/html-to-markdown-P2LSCPVF.js +1 -0
  490. package/dist/bundle/chunks/join-FTSZAZYU.js +1 -0
  491. package/dist/bundle/chunks/jq-TNIKCGGT.js +1 -0
  492. package/dist/bundle/chunks/ln-BWYUCELO.js +1 -0
  493. package/dist/bundle/chunks/ls-6BM6G675.js +1 -0
  494. package/dist/bundle/chunks/md5sum-ALFVDB3W.js +1 -0
  495. package/dist/bundle/chunks/mkdir-I3BZBLTZ.js +1 -0
  496. package/dist/bundle/chunks/mv-76WRD5SE.js +1 -0
  497. package/dist/bundle/chunks/nl-77Q7V2GV.js +1 -0
  498. package/dist/bundle/chunks/od-AA6TIC6A.js +1 -0
  499. package/dist/bundle/chunks/paste-C6JKQOHO.js +1 -0
  500. package/dist/bundle/chunks/printf-WOYMDX2I.js +1 -0
  501. package/dist/bundle/chunks/pwd-BE3B3ZPG.js +1 -0
  502. package/dist/bundle/chunks/python3-QFUFNW7I.js +13 -0
  503. package/dist/bundle/chunks/readlink-QI6K7ZZX.js +1 -0
  504. package/dist/bundle/chunks/rev-2FZQEIQG.js +1 -0
  505. package/dist/bundle/chunks/rg-CNS6SD3V.js +1 -0
  506. package/dist/bundle/chunks/rm-JMWEKCU4.js +1 -0
  507. package/dist/bundle/chunks/rmdir-5HDB4IQ7.js +1 -0
  508. package/dist/bundle/chunks/sed-CSUGXVBJ.js +1 -0
  509. package/dist/bundle/chunks/seq-UP62NDEL.js +1 -0
  510. package/dist/bundle/chunks/sha1sum-XXYTWQIW.js +1 -0
  511. package/dist/bundle/chunks/sha256sum-GD6AFWG3.js +1 -0
  512. package/dist/bundle/chunks/sleep-225KIGXI.js +1 -0
  513. package/dist/bundle/chunks/sort-BIWEEIVX.js +1 -0
  514. package/dist/bundle/chunks/split-QUFGLTTX.js +1 -0
  515. package/dist/bundle/chunks/sqlite3-3ZFEGTQ7.js +1 -0
  516. package/dist/bundle/chunks/stat-DIMPSC6S.js +1 -0
  517. package/dist/bundle/chunks/strings-LECMRXOT.js +1 -0
  518. package/dist/bundle/chunks/tac-A6JKZKWL.js +1 -0
  519. package/dist/bundle/chunks/tail-YGDXZZGG.js +1 -0
  520. package/dist/bundle/chunks/tar-7KN7KZ6S.js +1 -0
  521. package/dist/bundle/chunks/tee-J4MBDQJZ.js +1 -0
  522. package/dist/bundle/chunks/time-CVS7ESWV.js +1 -0
  523. package/dist/bundle/chunks/timeout-UX2PSLYJ.js +1 -0
  524. package/dist/bundle/chunks/touch-ATQADRUQ.js +1 -0
  525. package/dist/bundle/chunks/tr-QVFN4YWH.js +1 -0
  526. package/dist/bundle/chunks/tree-IY7WNFVF.js +1 -0
  527. package/dist/bundle/chunks/true-AKKYE7WM.js +1 -0
  528. package/dist/bundle/chunks/unexpand-2WTX7UPB.js +1 -0
  529. package/dist/bundle/chunks/uniq-XS6VGRO2.js +1 -0
  530. package/dist/bundle/chunks/wc-22EISCPD.js +1 -0
  531. package/dist/bundle/chunks/which-IWHCX6SW.js +1 -0
  532. package/dist/bundle/chunks/whoami-HCON4D7C.js +1 -0
  533. package/dist/bundle/chunks/worker.js +2260 -0
  534. package/dist/bundle/chunks/xan-XDECJHII.js +1 -0
  535. package/dist/bundle/chunks/xan-view-IJ4EABH7.js +1 -0
  536. package/dist/bundle/chunks/xargs-5MMN7C6P.js +1 -0
  537. package/dist/bundle/chunks/yq-LQX5YIGM.js +1 -0
  538. package/dist/bundle/index.js +688 -0
  539. package/dist/commands/alias/alias.d.ts +6 -0
  540. package/dist/commands/awk/ast.d.ts +202 -0
  541. package/dist/commands/awk/awk2.d.ts +9 -0
  542. package/dist/commands/awk/builtins.d.ts +17 -0
  543. package/dist/commands/awk/interpreter/context.d.ts +73 -0
  544. package/dist/commands/awk/interpreter/expressions.d.ts +17 -0
  545. package/dist/commands/awk/interpreter/fields.d.ts +25 -0
  546. package/dist/commands/awk/interpreter/index.d.ts +8 -0
  547. package/dist/commands/awk/interpreter/interpreter.d.ts +52 -0
  548. package/dist/commands/awk/interpreter/statements.d.ts +11 -0
  549. package/dist/commands/awk/interpreter/type-coercion.d.ts +32 -0
  550. package/dist/commands/awk/interpreter/types.d.ts +13 -0
  551. package/dist/commands/awk/interpreter/variables.d.ts +35 -0
  552. package/dist/commands/awk/lexer.d.ts +100 -0
  553. package/dist/commands/awk/parser2-print.d.ts +35 -0
  554. package/dist/commands/awk/parser2.d.ts +81 -0
  555. package/dist/commands/base64/base64.d.ts +7 -0
  556. package/dist/commands/basename/basename.d.ts +4 -0
  557. package/dist/commands/bash/bash.d.ts +6 -0
  558. package/dist/commands/browser-excluded.d.ts +16 -0
  559. package/dist/commands/cat/cat.d.ts +4 -0
  560. package/dist/commands/chmod/chmod.d.ts +4 -0
  561. package/dist/commands/clear/clear.d.ts +4 -0
  562. package/dist/commands/column/column.d.ts +11 -0
  563. package/dist/commands/comm/comm.d.ts +12 -0
  564. package/dist/commands/cp/cp.d.ts +4 -0
  565. package/dist/commands/curl/curl.d.ts +8 -0
  566. package/dist/commands/curl/form.d.ts +21 -0
  567. package/dist/commands/curl/help.d.ts +9 -0
  568. package/dist/commands/curl/parse.d.ts +9 -0
  569. package/dist/commands/curl/response-formatting.d.ts +20 -0
  570. package/dist/commands/curl/types.d.ts +31 -0
  571. package/dist/commands/cut/cut.d.ts +4 -0
  572. package/dist/commands/date/date.d.ts +7 -0
  573. package/dist/commands/diff/diff.d.ts +7 -0
  574. package/dist/commands/dirname/dirname.d.ts +4 -0
  575. package/dist/commands/du/du.d.ts +4 -0
  576. package/dist/commands/echo/echo.d.ts +4 -0
  577. package/dist/commands/env/env.d.ts +6 -0
  578. package/dist/commands/expand/expand.d.ts +12 -0
  579. package/dist/commands/expand/unexpand.d.ts +12 -0
  580. package/dist/commands/expr/expr.d.ts +9 -0
  581. package/dist/commands/file/file.d.ts +9 -0
  582. package/dist/commands/find/find.d.ts +4 -0
  583. package/dist/commands/find/matcher.d.ts +69 -0
  584. package/dist/commands/find/parser.d.ts +2 -0
  585. package/dist/commands/find/types.d.ts +88 -0
  586. package/dist/commands/flag-coverage.d.ts +2 -0
  587. package/dist/commands/fold/fold.d.ts +12 -0
  588. package/dist/commands/fuzz-flags-types.d.ts +17 -0
  589. package/dist/commands/fuzz-flags.d.ts +8 -0
  590. package/dist/commands/grep/grep.d.ts +8 -0
  591. package/dist/commands/gzip/gzip.d.ts +13 -0
  592. package/dist/commands/head/head-tail-shared.d.ts +38 -0
  593. package/dist/commands/head/head.d.ts +4 -0
  594. package/dist/commands/help/help.d.ts +4 -0
  595. package/dist/commands/help.d.ts +16 -0
  596. package/dist/commands/history/history.d.ts +4 -0
  597. package/dist/commands/hostname/hostname.d.ts +11 -0
  598. package/dist/commands/html-to-markdown/html-to-markdown.d.ts +9 -0
  599. package/dist/commands/join/join.d.ts +12 -0
  600. package/dist/commands/jq/jq.d.ts +9 -0
  601. package/dist/commands/ln/ln.d.ts +4 -0
  602. package/dist/commands/ls/ls.d.ts +4 -0
  603. package/dist/commands/md5sum/checksum.d.ts +7 -0
  604. package/dist/commands/md5sum/md5sum.d.ts +4 -0
  605. package/dist/commands/md5sum/sha1sum.d.ts +4 -0
  606. package/dist/commands/md5sum/sha256sum.d.ts +4 -0
  607. package/dist/commands/mkdir/mkdir.d.ts +4 -0
  608. package/dist/commands/mv/mv.d.ts +4 -0
  609. package/dist/commands/nl/nl.d.ts +12 -0
  610. package/dist/commands/od/od.d.ts +12 -0
  611. package/dist/commands/paste/paste.d.ts +4 -0
  612. package/dist/commands/printf/escapes.d.ts +31 -0
  613. package/dist/commands/printf/printf.d.ts +4 -0
  614. package/dist/commands/printf/strftime.d.ts +9 -0
  615. package/dist/commands/pwd/pwd.d.ts +4 -0
  616. package/dist/commands/python3/fs-bridge-handler.d.ts +50 -0
  617. package/dist/commands/python3/protocol.d.ts +138 -0
  618. package/dist/commands/python3/python3.d.ts +11 -0
  619. package/dist/commands/python3/sync-fs-backend.d.ts +59 -0
  620. package/dist/commands/python3/worker.d.ts +22 -0
  621. package/dist/commands/query-engine/builtins/array-builtins.d.ts +20 -0
  622. package/dist/commands/query-engine/builtins/control-builtins.d.ts +18 -0
  623. package/dist/commands/query-engine/builtins/date-builtins.d.ts +15 -0
  624. package/dist/commands/query-engine/builtins/format-builtins.d.ts +11 -0
  625. package/dist/commands/query-engine/builtins/index-builtins.d.ts +16 -0
  626. package/dist/commands/query-engine/builtins/index.d.ts +17 -0
  627. package/dist/commands/query-engine/builtins/math-builtins.d.ts +15 -0
  628. package/dist/commands/query-engine/builtins/navigation-builtins.d.ts +18 -0
  629. package/dist/commands/query-engine/builtins/object-builtins.d.ts +15 -0
  630. package/dist/commands/query-engine/builtins/path-builtins.d.ts +20 -0
  631. package/dist/commands/query-engine/builtins/sql-builtins.d.ts +16 -0
  632. package/dist/commands/query-engine/builtins/string-builtins.d.ts +15 -0
  633. package/dist/commands/query-engine/builtins/type-builtins.d.ts +11 -0
  634. package/dist/commands/query-engine/evaluator.d.ts +37 -0
  635. package/dist/commands/query-engine/index.d.ts +8 -0
  636. package/dist/commands/query-engine/parser-types.d.ts +171 -0
  637. package/dist/commands/query-engine/parser.d.ts +9 -0
  638. package/dist/commands/query-engine/path-operations.d.ts +15 -0
  639. package/dist/commands/query-engine/safe-object.d.ts +59 -0
  640. package/dist/commands/query-engine/value-operations.d.ts +41 -0
  641. package/dist/commands/readlink/readlink.d.ts +4 -0
  642. package/dist/commands/registry.d.ts +45 -0
  643. package/dist/commands/rev/rev.d.ts +13 -0
  644. package/dist/commands/rg/file-types.d.ts +49 -0
  645. package/dist/commands/rg/gitignore.d.ts +98 -0
  646. package/dist/commands/rg/rg-options.d.ts +61 -0
  647. package/dist/commands/rg/rg-parser.d.ts +20 -0
  648. package/dist/commands/rg/rg-search.d.ts +15 -0
  649. package/dist/commands/rg/rg.d.ts +14 -0
  650. package/dist/commands/rm/rm.d.ts +4 -0
  651. package/dist/commands/rmdir/rmdir.d.ts +4 -0
  652. package/dist/commands/search-engine/index.d.ts +10 -0
  653. package/dist/commands/search-engine/matcher.d.ts +60 -0
  654. package/dist/commands/search-engine/regex.d.ts +33 -0
  655. package/dist/commands/sed/executor.d.ts +7 -0
  656. package/dist/commands/sed/lexer.d.ts +86 -0
  657. package/dist/commands/sed/parser.d.ts +18 -0
  658. package/dist/commands/sed/sed-regex.d.ts +23 -0
  659. package/dist/commands/sed/sed.d.ts +4 -0
  660. package/dist/commands/sed/types.d.ts +219 -0
  661. package/dist/commands/seq/seq.d.ts +16 -0
  662. package/dist/commands/sleep/sleep.d.ts +4 -0
  663. package/dist/commands/sort/comparator.d.ts +9 -0
  664. package/dist/commands/sort/parser.d.ts +11 -0
  665. package/dist/commands/sort/sort.d.ts +4 -0
  666. package/dist/commands/sort/types.d.ts +30 -0
  667. package/dist/commands/split/split.d.ts +12 -0
  668. package/dist/commands/sqlite3/formatters.d.ts +15 -0
  669. package/dist/commands/sqlite3/sqlite3.d.ts +16 -0
  670. package/dist/commands/sqlite3/worker.d.ts +44 -0
  671. package/dist/commands/stat/stat.d.ts +4 -0
  672. package/dist/commands/strings/strings.d.ts +12 -0
  673. package/dist/commands/tac/tac.d.ts +11 -0
  674. package/dist/commands/tail/tail.d.ts +4 -0
  675. package/dist/commands/tar/archive.d.ts +107 -0
  676. package/dist/commands/tar/tar-options.d.ts +36 -0
  677. package/dist/commands/tar/tar.d.ts +10 -0
  678. package/dist/commands/tee/tee.d.ts +4 -0
  679. package/dist/commands/time/time.d.ts +27 -0
  680. package/dist/commands/timeout/timeout.d.ts +4 -0
  681. package/dist/commands/touch/touch.d.ts +4 -0
  682. package/dist/commands/tr/tr.d.ts +4 -0
  683. package/dist/commands/tree/tree.d.ts +4 -0
  684. package/dist/commands/true/true.d.ts +6 -0
  685. package/dist/commands/uniq/uniq.d.ts +4 -0
  686. package/dist/commands/wc/wc.d.ts +4 -0
  687. package/dist/commands/which/which.d.ts +4 -0
  688. package/dist/commands/whoami/whoami.d.ts +11 -0
  689. package/dist/commands/xan/aggregation.d.ts +20 -0
  690. package/dist/commands/xan/column-selection.d.ts +19 -0
  691. package/dist/commands/xan/csv.d.ts +37 -0
  692. package/dist/commands/xan/moonblade-parser.d.ts +80 -0
  693. package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
  694. package/dist/commands/xan/moonblade-tokenizer.d.ts +25 -0
  695. package/dist/commands/xan/subcommands.d.ts +15 -0
  696. package/dist/commands/xan/xan-agg.d.ts +8 -0
  697. package/dist/commands/xan/xan-columns.d.ts +8 -0
  698. package/dist/commands/xan/xan-core.d.ts +10 -0
  699. package/dist/commands/xan/xan-data.d.ts +52 -0
  700. package/dist/commands/xan/xan-filter.d.ts +8 -0
  701. package/dist/commands/xan/xan-map.d.ts +11 -0
  702. package/dist/commands/xan/xan-reshape.d.ts +40 -0
  703. package/dist/commands/xan/xan-simple.d.ts +40 -0
  704. package/dist/commands/xan/xan-view.d.ts +12 -0
  705. package/dist/commands/xan/xan.d.ts +10 -0
  706. package/dist/commands/xargs/xargs.d.ts +4 -0
  707. package/dist/commands/yq/formats.d.ts +64 -0
  708. package/dist/commands/yq/yq.d.ts +13 -0
  709. package/dist/custom-commands.d.ts +61 -0
  710. package/dist/fs/encoding.d.ts +17 -0
  711. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +63 -0
  712. package/dist/fs/in-memory-fs/index.d.ts +1 -0
  713. package/dist/fs/init.d.ts +12 -0
  714. package/dist/fs/interface.d.ts +219 -0
  715. package/dist/fs/mountable-fs/index.d.ts +1 -0
  716. package/dist/fs/mountable-fs/mountable-fs.d.ts +120 -0
  717. package/dist/fs/overlay-fs/index.d.ts +1 -0
  718. package/dist/fs/overlay-fs/overlay-fs.d.ts +126 -0
  719. package/dist/fs/read-write-fs/index.d.ts +1 -0
  720. package/dist/fs/read-write-fs/read-write-fs.d.ts +69 -0
  721. package/dist/index.d.ts +19 -0
  722. package/dist/interpreter/alias-expansion.d.ts +23 -0
  723. package/dist/interpreter/arithmetic.d.ts +24 -0
  724. package/dist/interpreter/assignment-expansion.d.ts +24 -0
  725. package/dist/interpreter/builtin-dispatch.d.ts +39 -0
  726. package/dist/interpreter/builtins/break.d.ts +6 -0
  727. package/dist/interpreter/builtins/cd.d.ts +6 -0
  728. package/dist/interpreter/builtins/compgen.d.ts +26 -0
  729. package/dist/interpreter/builtins/complete.d.ts +17 -0
  730. package/dist/interpreter/builtins/compopt.d.ts +28 -0
  731. package/dist/interpreter/builtins/continue.d.ts +6 -0
  732. package/dist/interpreter/builtins/declare-array-parsing.d.ts +14 -0
  733. package/dist/interpreter/builtins/declare-print.d.ts +39 -0
  734. package/dist/interpreter/builtins/declare.d.ts +35 -0
  735. package/dist/interpreter/builtins/dirs.d.ts +29 -0
  736. package/dist/interpreter/builtins/eval.d.ts +9 -0
  737. package/dist/interpreter/builtins/exit.d.ts +5 -0
  738. package/dist/interpreter/builtins/export.d.ts +14 -0
  739. package/dist/interpreter/builtins/getopts.d.ts +18 -0
  740. package/dist/interpreter/builtins/hash.d.ts +19 -0
  741. package/dist/interpreter/builtins/help.d.ts +12 -0
  742. package/dist/interpreter/builtins/index.d.ts +45 -0
  743. package/dist/interpreter/builtins/let.d.ts +18 -0
  744. package/dist/interpreter/builtins/local.d.ts +6 -0
  745. package/dist/interpreter/builtins/mapfile.d.ts +17 -0
  746. package/dist/interpreter/builtins/read.d.ts +6 -0
  747. package/dist/interpreter/builtins/return.d.ts +6 -0
  748. package/dist/interpreter/builtins/set.d.ts +9 -0
  749. package/dist/interpreter/builtins/shift.d.ts +15 -0
  750. package/dist/interpreter/builtins/shopt.d.ts +7 -0
  751. package/dist/interpreter/builtins/source.d.ts +6 -0
  752. package/dist/interpreter/builtins/unset.d.ts +16 -0
  753. package/dist/interpreter/builtins/variable-assignment.d.ts +66 -0
  754. package/dist/interpreter/command-resolution.d.ts +43 -0
  755. package/dist/interpreter/conditionals.d.ts +17 -0
  756. package/dist/interpreter/control-flow.d.ts +21 -0
  757. package/dist/interpreter/errors.d.ts +150 -0
  758. package/dist/interpreter/expansion/analysis.d.ts +37 -0
  759. package/dist/interpreter/expansion/arith-text-expansion.d.ts +20 -0
  760. package/dist/interpreter/expansion/array-pattern-ops.d.ts +21 -0
  761. package/dist/interpreter/expansion/array-prefix-suffix.d.ts +46 -0
  762. package/dist/interpreter/expansion/array-slice-transform.d.ts +36 -0
  763. package/dist/interpreter/expansion/array-word-expansion.d.ts +39 -0
  764. package/dist/interpreter/expansion/brace-range.d.ts +20 -0
  765. package/dist/interpreter/expansion/command-substitution.d.ts +23 -0
  766. package/dist/interpreter/expansion/glob-escape.d.ts +32 -0
  767. package/dist/interpreter/expansion/indirect-expansion.d.ts +42 -0
  768. package/dist/interpreter/expansion/parameter-ops.d.ts +113 -0
  769. package/dist/interpreter/expansion/pattern-expansion.d.ts +23 -0
  770. package/dist/interpreter/expansion/pattern-removal.d.ts +18 -0
  771. package/dist/interpreter/expansion/pattern.d.ts +23 -0
  772. package/dist/interpreter/expansion/positional-params.d.ts +59 -0
  773. package/dist/interpreter/expansion/prompt.d.ts +39 -0
  774. package/dist/interpreter/expansion/quoting.d.ts +13 -0
  775. package/dist/interpreter/expansion/tilde.d.ts +12 -0
  776. package/dist/interpreter/expansion/unquoted-expansion.d.ts +76 -0
  777. package/dist/interpreter/expansion/variable-attrs.d.ts +19 -0
  778. package/dist/interpreter/expansion/variable.d.ts +43 -0
  779. package/dist/interpreter/expansion/word-glob-expansion.d.ts +33 -0
  780. package/dist/interpreter/expansion/word-split.d.ts +29 -0
  781. package/dist/interpreter/expansion.d.ts +57 -0
  782. package/dist/interpreter/functions.d.ts +12 -0
  783. package/dist/interpreter/helpers/array.d.ts +43 -0
  784. package/dist/interpreter/helpers/condition.d.ts +18 -0
  785. package/dist/interpreter/helpers/errors.d.ts +8 -0
  786. package/dist/interpreter/helpers/file-tests.d.ts +33 -0
  787. package/dist/interpreter/helpers/ifs.d.ts +104 -0
  788. package/dist/interpreter/helpers/loop.d.ts +24 -0
  789. package/dist/interpreter/helpers/nameref.d.ts +65 -0
  790. package/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
  791. package/dist/interpreter/helpers/quoting.d.ts +24 -0
  792. package/dist/interpreter/helpers/readonly.d.ts +45 -0
  793. package/dist/interpreter/helpers/regex.d.ts +8 -0
  794. package/dist/interpreter/helpers/result.d.ts +62 -0
  795. package/dist/interpreter/helpers/shell-constants.d.ts +25 -0
  796. package/dist/interpreter/helpers/shellopts.d.ts +28 -0
  797. package/dist/interpreter/helpers/statements.d.ts +20 -0
  798. package/dist/interpreter/helpers/string-compare.d.ts +24 -0
  799. package/dist/interpreter/helpers/string-tests.d.ts +13 -0
  800. package/dist/interpreter/helpers/tilde.d.ts +13 -0
  801. package/dist/interpreter/helpers/variable-tests.d.ts +9 -0
  802. package/dist/interpreter/helpers/word-matching.d.ts +26 -0
  803. package/dist/interpreter/helpers/word-parts.d.ts +29 -0
  804. package/dist/interpreter/helpers/xtrace.d.ts +18 -0
  805. package/dist/interpreter/index.d.ts +3 -0
  806. package/dist/interpreter/interpreter.d.ts +65 -0
  807. package/dist/interpreter/pipeline-execution.d.ts +16 -0
  808. package/dist/interpreter/redirections.d.ts +51 -0
  809. package/dist/interpreter/simple-command-assignments.d.ts +29 -0
  810. package/dist/interpreter/subshell-group.d.ts +32 -0
  811. package/dist/interpreter/type-command.d.ts +37 -0
  812. package/dist/interpreter/types.d.ts +317 -0
  813. package/dist/limits.d.ts +42 -0
  814. package/dist/network/allow-list/shared.d.ts +45 -0
  815. package/dist/network/allow-list.d.ts +51 -0
  816. package/dist/network/fetch.d.ts +25 -0
  817. package/dist/network/index.d.ts +7 -0
  818. package/dist/network/types.d.ts +96 -0
  819. package/dist/parser/arithmetic-parser.d.ts +23 -0
  820. package/dist/parser/arithmetic-primaries.d.ts +45 -0
  821. package/dist/parser/command-parser.d.ts +10 -0
  822. package/dist/parser/compound-parser.d.ts +28 -0
  823. package/dist/parser/conditional-parser.d.ts +8 -0
  824. package/dist/parser/expansion-parser.d.ts +16 -0
  825. package/dist/parser/lexer.d.ts +192 -0
  826. package/dist/parser/parser-substitution.d.ts +62 -0
  827. package/dist/parser/parser.d.ts +135 -0
  828. package/dist/parser/types.d.ts +25 -0
  829. package/dist/parser/word-parser.d.ts +33 -0
  830. package/dist/sandbox/Command.d.ts +28 -0
  831. package/dist/sandbox/Sandbox.d.ts +60 -0
  832. package/dist/sandbox/index.d.ts +2 -0
  833. package/dist/shell-metadata.d.ts +28 -0
  834. package/dist/test-utils.d.ts +15 -0
  835. package/dist/types.d.ts +148 -0
  836. package/dist/utils/args.d.ts +55 -0
  837. package/dist/utils/bytes.d.ts +39 -0
  838. package/dist/utils/constants.d.ts +15 -0
  839. package/dist/utils/file-reader.d.ts +67 -0
  840. package/dist/utils/glob.d.ts +25 -0
  841. package/package.json +115 -0
@@ -0,0 +1,1481 @@
1
+ var l7=Object.create;var ea=Object.defineProperty;var c7=Object.getOwnPropertyDescriptor;var u7=Object.getOwnPropertyNames;var f7=Object.getPrototypeOf,p7=Object.prototype.hasOwnProperty;var ni=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var I=(t,e)=>()=>(t&&(e=t(t=0)),e);var ri=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),se=(t,e)=>{for(var n in e)ea(t,n,{get:e[n],enumerable:!0})},h7=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of u7(e))!p7.call(t,s)&&s!==n&&ea(t,s,{get:()=>e[s],enumerable:!(r=c7(e,s))||r.enumerable});return t};var Du=(t,e,n)=>(n=t!=null?l7(f7(t)):{},h7(e||!t||!t.__esModule?ea(n,"default",{value:t,enumerable:!0}):n,t));function x(t){return ta.encode(t)}function R(t){return er.decode(t)}function j(t,e){if(t.length===0)return e;if(e.length===0)return t;let n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function Mt(t){return t.length===0}function W(t){return t.map(e=>er.decode(e))}function $(t,e,n=""){let r=t.get(e);return r!==void 0?er.decode(r):n}function T(t,e,n){t.set(e,ta.encode(n))}function si(t){return{get(e){let n=t.get(e);return n!==void 0?er.decode(n):void 0},set(e,n){return t.set(e,ta.encode(n)),this},has(e){return t.has(e)},delete(e){return t.delete(e)},get size(){return t.size},clear(){t.clear()},keys(){return t.keys()},*values(){for(let e of t.values())yield er.decode(e)},*entries(){for(let[e,n]of t.entries())yield[e,er.decode(n)]},forEach(e){for(let[n,r]of t)e(er.decode(r),n,this)},[Symbol.iterator](){return this.entries()},[Symbol.toStringTag]:"StringEnvAdapter"}}function vr(t){let e=t.length;for(;e>0&&t[e-1]===10;)e--;return e===t.length?t:e===0?y:t.subarray(0,e)}var ta,er,y,F=I(()=>{"use strict";ta=new TextEncoder,er=new TextDecoder,y=new Uint8Array(0)});var _u={};se(_u,{echoCommand:()=>m7,flagsForFuzzing:()=>g7});function nr(t,e){for(let n=0;n<e.length;n++)t.push(e[n])}function d7(t){let e=[],n=0;for(;n<t.length;)if(t[n]==="\\"){if(n+1>=t.length){e.push(92);break}let r=t[n+1];switch(r){case"\\":e.push(92),n+=2;break;case"n":e.push(10),n+=2;break;case"t":e.push(9),n+=2;break;case"r":e.push(13),n+=2;break;case"a":e.push(7),n+=2;break;case"b":e.push(8),n+=2;break;case"f":e.push(12),n+=2;break;case"v":e.push(11),n+=2;break;case"e":case"E":e.push(27),n+=2;break;case"c":return{output:new Uint8Array(e),stop:!0};case"0":{let s="",i=n+2;for(;i<t.length&&i<n+5&&/[0-7]/.test(t[i]);)s+=t[i],i++;s.length===0?e.push(0):e.push(parseInt(s,8)%256),n=i;break}case"x":{let s="",i=n+2;for(;i<t.length&&i<n+4&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;s.length===0?(e.push(92,120),n+=2):(e.push(parseInt(s,16)),n=i);break}case"u":{let s="",i=n+2;for(;i<t.length&&i<n+6&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;if(s.length===0)nr(e,tr.encode("\\u")),n+=2;else{let o=parseInt(s,16);nr(e,tr.encode(String.fromCodePoint(o))),n=i}break}case"U":{let s="",i=n+2;for(;i<t.length&&i<n+10&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;if(s.length===0)nr(e,tr.encode("\\U")),n+=2;else{let o=parseInt(s,16);try{nr(e,tr.encode(String.fromCodePoint(o)))}catch{nr(e,tr.encode(`\\U${s}`))}n=i}break}default:nr(e,tr.encode(`\\${r}`)),n+=2}}else{let r=t.charCodeAt(n);if(r<128)e.push(r),n++;else{let s=r>=55296&&r<=56319&&n+1<t.length?t.slice(n,n+2):t[n];nr(e,tr.encode(s)),n+=s.length}}return{output:new Uint8Array(e),stop:!1}}var tr,m7,g7,Mu=I(()=>{"use strict";F();tr=new TextEncoder;m7={name:"echo",async execute(t,e){let n=W(t),r=!1,s=e.xpgEcho??!1,i=0;for(;i<n.length;){let u=n[i];if(u==="-n")r=!0,i++;else if(u==="-e")s=!0,i++;else if(u==="-E")s=!1,i++;else if(u==="-ne"||u==="-en")r=!0,s=!0,i++;else break}if(s){let u=n.slice(i).join(" "),f=d7(u);return f.stop?{stdout:f.output,stderr:y,exitCode:0}:{stdout:r?f.output:j(f.output,new Uint8Array([10])),stderr:y,exitCode:0}}let o=new Uint8Array([32]),a=new Uint8Array([10]),l=t.slice(i),c=y;for(let u=0;u<l.length;u++)u>0&&(c=j(c,o)),c=j(c,l[u]);return r||(c=j(c,a)),{stdout:c,stderr:y,exitCode:0}}},g7={name:"echo",flags:[{flag:"-n",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-E",type:"boolean"}],stdinType:"none",needsArgs:!0}});function q(t){let e=`${t.name} - ${t.summary}
2
+
3
+ `;if(e+=`Usage: ${t.usage}
4
+ `,t.description){if(e+=`
5
+ Description:
6
+ `,typeof t.description=="string")for(let n of t.description.split(`
7
+ `))e+=n?` ${n}
8
+ `:`
9
+ `;else if(t.description.length>0)for(let n of t.description)e+=n?` ${n}
10
+ `:`
11
+ `}if(t.options&&t.options.length>0){e+=`
12
+ Options:
13
+ `;for(let n of t.options)e+=` ${n}
14
+ `}if(t.examples&&t.examples.length>0){e+=`
15
+ Examples:
16
+ `;for(let n of t.examples)e+=` ${n}
17
+ `}if(t.notes&&t.notes.length>0){e+=`
18
+ Notes:
19
+ `;for(let n of t.notes)e+=` ${n}
20
+ `}return{stdout:x(e),stderr:y,exitCode:0}}function Z(t){return t.includes("--help")}function oe(t,e){let n=e.startsWith("--")?`${t}: unrecognized option '${e}'
21
+ `:`${t}: invalid option -- '${e.replace(/^-/,"")}'
22
+ `;return{stdout:y,stderr:x(n),exitCode:1}}var he=I(()=>{"use strict";F()});function ke(t,e,n){let r=new Map,s=new Map;for(let[l,c]of Object.entries(n)){let u={name:l,type:c.type};c.short&&r.set(c.short,u),c.long&&s.set(c.long,u)}let i=Object.create(null);for(let[l,c]of Object.entries(n))c.default!==void 0?i[l]=c.default:c.type==="boolean"&&(i[l]=!1);let o=[],a=!1;for(let l=0;l<e.length;l++){let c=e[l];if(a||!c.startsWith("-")||c==="-"){o.push(c);continue}if(c==="--"){a=!0;continue}if(c.startsWith("--")){let u=c.indexOf("="),f,p;u!==-1?(f=c.slice(2,u),p=c.slice(u+1)):f=c.slice(2);let h=s.get(f);if(!h)return{ok:!1,error:oe(t,c)};let{name:m,type:d}=h;if(d==="boolean")i[m]=!0;else{if(p===void 0){if(l+1>=e.length)return{ok:!1,error:{stdout:y,stderr:x(`${t}: option '--${f}' requires an argument
23
+ `),exitCode:1}};p=e[++l]}i[m]=d==="number"?parseInt(p,10):p}}else{let u=c.slice(1);for(let f=0;f<u.length;f++){let p=u[f],h=r.get(p);if(!h)return{ok:!1,error:oe(t,`-${p}`)};let{name:m,type:d}=h;if(d==="boolean")i[m]=!0;else{let g;if(f+1<u.length)g=u.slice(f+1);else if(l+1<e.length)g=e[++l];else return{ok:!1,error:{stdout:y,stderr:x(`${t}: option requires an argument -- '${p}'
24
+ `),exitCode:1}};i[m]=d==="number"?parseInt(g,10):g;break}}}}return{ok:!0,result:{flags:i,positional:o}}}var nt=I(()=>{"use strict";he();F()});var kr=I(()=>{"use strict"});async function rr(t,e,n){let{cmdName:r,allowStdinMarker:s=!0,stopOnError:i=!1,batchSize:o=100}=n;if(e.length===0)return{files:[{filename:"",content:t.stdin}],stderr:"",exitCode:0};let a=[],l="",c=0;for(let u=0;u<e.length;u+=o){let f=e.slice(u,u+o),p=await Promise.all(f.map(async h=>{if(s&&h==="-")return{filename:"-",content:t.stdin,error:null};try{let m=t.fs.resolvePath(t.cwd,h),d=await t.fs.readFileBuffer(m);return{filename:h,content:d,error:null}}catch{return{filename:h,content:y,error:`${r}: ${h}: No such file or directory
25
+ `}}}));for(let h of p)if(h.error){if(l+=h.error,c=1,i)return{files:a,stderr:l,exitCode:c}}else a.push({filename:h.filename,content:h.content})}return{files:a,stderr:l,exitCode:c}}async function Ir(t,e,n){let r=await rr(t,e,{...n,stopOnError:!0});return r.exitCode!==0?{ok:!1,error:{stdout:y,stderr:x(r.stderr),exitCode:r.exitCode}}:{ok:!0,content:r.files.reduce((i,o)=>j(i,o.content),y)}}var sr=I(()=>{"use strict";F();kr()});var Lu={};se(Lu,{catCommand:()=>b7,flagsForFuzzing:()=>E7});function x7(t,e){let n=t.split(`
26
+ `),r=t.endsWith(`
27
+ `),s=r?n.slice(0,-1):n;return{content:s.map((o,a)=>`${String(e+a).padStart(6," ")} ${o}`).join(`
28
+ `)+(r?`
29
+ `:""),nextLineNumber:e+s.length}}var y7,w7,b7,E7,Fu=I(()=>{"use strict";nt();F();sr();he();y7={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-n, --number number all output lines"," --help display this help and exit"]},w7={number:{short:"n",long:"number",type:"boolean"}},b7={name:"cat",async execute(t,e){let n=W(t);if(Z(n))return q(y7);let r=ke("cat",n,w7);if(!r.ok)return r.error;let s=r.result.flags.number,i=r.result.positional,o=await rr(e,i,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1});if(s){let l="",c=1;for(let{content:u}of o.files){let f=R(u),p=x7(f,c);l+=p.content,c=p.nextLineNumber}return{stdout:x(l),stderr:x(o.stderr),exitCode:o.exitCode}}return{stdout:o.files.reduce((l,c)=>j(l,c.content),new Uint8Array(0)),stderr:x(o.stderr),exitCode:o.exitCode}}};E7={name:"cat",flags:[{flag:"-n",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-t",type:"boolean"}],stdinType:"text",needsFiles:!0}});function ii(t){return t instanceof xt||t instanceof Et||t instanceof mt}var kt,xt,Et,mt,Lt,It,Ee,Be,Tt,yn,Tr,ae,wn,Yt,Ne=I(()=>{"use strict";F();kt=class extends Error{stdout;stderr;constructor(e,n=y,r=y){super(e),this.stdout=n,this.stderr=r}prependOutput(e,n){this.stdout=j(e,this.stdout),this.stderr=j(n,this.stderr)}},xt=class extends kt{levels;name="BreakError";constructor(e=1,n=y,r=y){super("break",n,r),this.levels=e}},Et=class extends kt{levels;name="ContinueError";constructor(e=1,n=y,r=y){super("continue",n,r),this.levels=e}},mt=class extends kt{exitCode;name="ReturnError";constructor(e=0,n=y,r=y){super("return",n,r),this.exitCode=e}},Lt=class extends kt{exitCode;name="ErrexitError";constructor(e,n=y,r=y){super(`errexit: command exited with status ${e}`,n,r),this.exitCode=e}},It=class extends kt{varName;name="NounsetError";constructor(e,n=y){super(`${e}: unbound variable`,n,x(`bash: ${e}: unbound variable
30
+ `)),this.varName=e}},Ee=class extends kt{exitCode;name="ExitError";constructor(e,n=y,r=y){super("exit",n,r),this.exitCode=e}},Be=class extends kt{name="ArithmeticError";fatal;constructor(e,n=y,r=y,s=!1){super(e,n,r),this.stderr=r.length>0?r:x(`bash: ${e}
31
+ `),this.fatal=s}},Tt=class extends kt{name="BadSubstitutionError";constructor(e,n=y,r=y){super(e,n,r),this.stderr=r.length>0?r:x(`bash: ${e}: bad substitution
32
+ `)}},yn=class extends kt{name="GlobError";constructor(e,n=y,r=y){super(`no match: ${e}`,n,r),this.stderr=r.length>0?r:x(`bash: no match: ${e}
33
+ `)}},Tr=class extends kt{name="BraceExpansionError";constructor(e,n=y,r=y){super(e,n,r),this.stderr=r.length>0?r:x(`bash: ${e}
34
+ `)}},ae=class extends kt{limitType;name="ExecutionLimitError";static EXIT_CODE=126;constructor(e,n,r=y,s=y){super(e,r,s),this.limitType=n,this.stderr=s.length>0?s:x(`bash: ${e}
35
+ `)}},wn=class extends kt{name="SubshellExitError";constructor(e=y,n=y){super("subshell exit",e,n)}};Yt=class extends kt{exitCode;name="PosixFatalError";constructor(e,n=y,r=y){super("posix fatal error",n,r),this.exitCode=e}}});function qe(t){return t instanceof Error?t.message:String(t)}var Qt=I(()=>{"use strict"});function or(t,e){for(let n=0;n<e.length;n++)t.push(e[n])}function oi(t,e,n){let r=t;n>=0&&r.length>n&&(r=r.slice(0,n));let s=Math.abs(e);return s>r.length&&(e<0?r=r.padEnd(s," "):r=r.padStart(s," ")),r}function Uu(t,e){let n=e,r=0,s=-1,i=!1;for(n<t.length&&t[n]==="-"&&(i=!0,n++);n<t.length&&/\d/.test(t[n]);)r=r*10+parseInt(t[n],10),n++;if(n<t.length&&t[n]===".")for(n++,s=0;n<t.length&&/\d/.test(t[n]);)s=s*10+parseInt(t[n],10),n++;return i&&r>0&&(r=-r),[r,s,n-e]}function Bu(t){let e=[],n=0;for(;n<t.length;)if(t[n]==="\\"&&n+1<t.length)switch(t[n+1]){case"n":e.push(10),n+=2;break;case"t":e.push(9),n+=2;break;case"r":e.push(13),n+=2;break;case"\\":e.push(92),n+=2;break;case"a":e.push(7),n+=2;break;case"b":e.push(8),n+=2;break;case"f":e.push(12),n+=2;break;case"v":e.push(11),n+=2;break;case"e":case"E":e.push(27),n+=2;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let s="",i=n+1;for(;i<t.length&&i<n+4&&/[0-7]/.test(t[i]);)s+=t[i],i++;e.push(parseInt(s,8)&255),n=i;break}case"x":{let s=n,i=!1;for(;s+3<t.length&&t[s]==="\\"&&t[s+1]==="x"&&/[0-9a-fA-F]{2}/.test(t.slice(s+2,s+4));)e.push(parseInt(t.slice(s+2,s+4),16)),s+=4,i=!0;i?n=s:(or(e,ir.encode(t[n])),n++);break}case"u":{let s="",i=n+2;for(;i<t.length&&i<n+6&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;s?(or(e,ir.encode(String.fromCodePoint(parseInt(s,16)))),n=i):(or(e,ir.encode("\\u")),n+=2);break}case"U":{let s="",i=n+2;for(;i<t.length&&i<n+10&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;s?(or(e,ir.encode(String.fromCodePoint(parseInt(s,16)))),n=i):(or(e,ir.encode("\\U")),n+=2);break}default:or(e,ir.encode(t[n])),n++}else{let r=t.charCodeAt(n);if(r<128)e.push(r),n++;else{let s=r>=55296&&r<=56319&&n+1<t.length?t.slice(n,n+2):t[n];or(e,ir.encode(s)),n+=s.length}}return new Uint8Array(e)}function Wu(t){let e="",n=0;for(;n<t.length;)if(t[n]==="\\"&&n+1<t.length)switch(t[n+1]){case"n":e+=`
36
+ `,n+=2;break;case"t":e+=" ",n+=2;break;case"r":e+="\r",n+=2;break;case"\\":e+="\\",n+=2;break;case"a":e+="\x07",n+=2;break;case"b":e+="\b",n+=2;break;case"f":e+="\f",n+=2;break;case"v":e+="\v",n+=2;break;case"e":case"E":e+="\x1B",n+=2;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let s="",i=n+1;for(;i<t.length&&i<n+4&&/[0-7]/.test(t[i]);)s+=t[i],i++;e+=String.fromCharCode(parseInt(s,8)),n=i;break}case"x":{let s=[],i=n;for(;i+3<t.length&&t[i]==="\\"&&t[i+1]==="x"&&/[0-9a-fA-F]{2}/.test(t.slice(i+2,i+4));)s.push(parseInt(t.slice(i+2,i+4),16)),i+=4;if(s.length>0){try{let o=new TextDecoder("utf-8",{fatal:!0});e+=o.decode(new Uint8Array(s))}catch{for(let o of s)e+=String.fromCharCode(o)}n=i}else e+=t[n],n++;break}case"u":{let s="",i=n+2;for(;i<t.length&&i<n+6&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;s?(e+=String.fromCodePoint(parseInt(s,16)),n=i):(e+="\\u",n+=2);break}case"U":{let s="",i=n+2;for(;i<t.length&&i<n+10&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;s?(e+=String.fromCodePoint(parseInt(s,16)),n=i):(e+="\\U",n+=2);break}default:e+=t[n],n++}else e+=t[n],n++;return e}var ir,na=I(()=>{"use strict";ir=new TextEncoder});function ju(t,e,n){let r=new Date(e*1e3),s="",i=0;for(;i<t.length;)if(t[i]==="%"&&i+1<t.length){let o=t[i+1],a=S7(r,o,n);a!==null?(s+=a,i+=2):(s+=t[i],i++)}else s+=t[i],i++;return s}function A7(t,e){let n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",hour12:!1,timeZone:e};try{let s=new Intl.DateTimeFormat("en-US",n).formatToParts(t),i=l=>s.find(c=>c.type===l)?.value??"",o=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),a=i("weekday");return{year:Number.parseInt(i("year"),10)||t.getFullYear(),month:Number.parseInt(i("month"),10)||t.getMonth()+1,day:Number.parseInt(i("day"),10)||t.getDate(),hour:Number.parseInt(i("hour"),10)||t.getHours(),minute:Number.parseInt(i("minute"),10)||t.getMinutes(),second:Number.parseInt(i("second"),10)||t.getSeconds(),weekday:o.get(a)??t.getDay()}}catch{return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),weekday:t.getDay()}}}function S7(t,e,n){let r=A7(t,n),s=(l,c=2)=>String(l).padStart(c,"0"),i=Gu(r.year,r.month,r.day),o=zu(r.year,r.month,r.day,r.weekday,0),a=zu(r.year,r.month,r.day,r.weekday,1);switch(e){case"a":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][r.weekday];case"A":return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][r.weekday];case"b":case"h":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.month-1];case"B":return["January","February","March","April","May","June","July","August","September","October","November","December"][r.month-1];case"c":return`${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][r.weekday]} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.month-1]} ${String(r.day).padStart(2," ")} ${s(r.hour)}:${s(r.minute)}:${s(r.second)} ${r.year}`;case"C":return s(Math.floor(r.year/100));case"d":return s(r.day);case"D":return`${s(r.month)}/${s(r.day)}/${s(r.year%100)}`;case"e":return String(r.day).padStart(2," ");case"F":return`${r.year}-${s(r.month)}-${s(r.day)}`;case"g":return s(Hu(r.year,r.month,r.day)%100);case"G":return String(Hu(r.year,r.month,r.day));case"H":return s(r.hour);case"I":return s(r.hour%12||12);case"j":return String(i).padStart(3,"0");case"k":return String(r.hour).padStart(2," ");case"l":return String(r.hour%12||12).padStart(2," ");case"m":return s(r.month);case"M":return s(r.minute);case"n":return`
37
+ `;case"N":return"000000000";case"p":return r.hour<12?"AM":"PM";case"P":return r.hour<12?"am":"pm";case"r":return`${s(r.hour%12||12)}:${s(r.minute)}:${s(r.second)} ${r.hour<12?"AM":"PM"}`;case"R":return`${s(r.hour)}:${s(r.minute)}`;case"s":return String(Math.floor(t.getTime()/1e3));case"S":return s(r.second);case"t":return" ";case"T":return`${s(r.hour)}:${s(r.minute)}:${s(r.second)}`;case"u":return String(r.weekday===0?7:r.weekday);case"U":return s(o);case"V":return s(v7(r.year,r.month,r.day));case"w":return String(r.weekday);case"W":return s(a);case"x":return`${s(r.month)}/${s(r.day)}/${s(r.year%100)}`;case"X":return`${s(r.hour)}:${s(r.minute)}:${s(r.second)}`;case"y":return s(r.year%100);case"Y":return String(r.year);case"z":return C7(t,n);case"Z":return N7(t,n);case"%":return"%";default:return null}}function C7(t,e){if(!e){let o=-t.getTimezoneOffset(),a=o>=0?"+":"-",l=Math.floor(Math.abs(o)/60),c=Math.abs(o)%60;return`${a}${String(l).padStart(2,"0")}${String(c).padStart(2,"0")}`}try{let l=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).formatToParts(t).find(c=>c.type==="timeZoneName");if(l){let c=l.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(c)return`${c[1]}${c[2]}${c[3]}`;if(l.value==="GMT"||l.value==="UTC")return"+0000"}}catch{}let n=-t.getTimezoneOffset(),r=n>=0?"+":"-",s=Math.floor(Math.abs(n)/60),i=Math.abs(n)%60;return`${r}${String(s).padStart(2,"0")}${String(i).padStart(2,"0")}`}function N7(t,e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short"}).formatToParts(t).find(i=>i.type==="timeZoneName")?.value??"UTC"}catch{return"UTC"}}function Gu(t,e,n){let r=[31,28,31,30,31,30,31,31,30,31,30,31];(t%4===0&&t%100!==0||t%400===0)&&(r[1]=29);let i=n;for(let o=0;o<e-1;o++)i+=r[o];return i}function zu(t,e,n,r,s){let i=Gu(t,e,n),l=(new Date(t,0,1).getDay()-s+7)%7,c=(r-s+7)%7,u=i-1+l;return Math.floor((u-c+7)/7)}function v7(t,e,n){let r=new Date(t,e-1,n,12,0,0);r.setDate(r.getDate()+3-(r.getDay()+6)%7);let s=new Date(r.getFullYear(),0,4);s.setDate(s.getDate()+3-(s.getDay()+6)%7);let i=r.getTime()-s.getTime();return 1+Math.round(i/(10080*60*1e3))}function Hu(t,e,n){let r=new Date(t,e-1,n,12,0,0);return r.setDate(r.getDate()+3-(r.getDay()+6)%7),r.getFullYear()}var Vu=I(()=>{"use strict"});var Yu={};se(Yu,{flagsForFuzzing:()=>U7,printfCommand:()=>I7});import{sprintf as Or}from"sprintf-js";function li(t,e){for(let n=0;n<e.length;n++)t.push(e[n])}function ds(t,e){li(t,ms.encode(e))}function T7(t){return String.fromCharCode(t)}function qu(t){return t>=48&&t<=57}function O7(t,e,n,r,s){let i=[],o=0,a=0,l=!1,c="";for(;o<t.length;)if(t[o]===37&&o+1<t.length){let u=o;if(o++,t[o]===37){i.push(37),o++;continue}let p=new TextDecoder().decode(t.subarray(u)).match(/^%(-?\d*)(?:\.(\d+))?\(([^)]*)\)T/);if(p){let L=p[1]?parseInt(p[1],10):0,D=p[2]?parseInt(p[2],10):-1,v=p[3],_=ms.encode(p[0]),H=e[n+a]||"";a++;let pe;H===""||H==="-1"||H==="-2"?pe=Math.floor(Date.now()/1e3):pe=parseInt(H,10)||0;let J=ju(v,pe,r);if(D>=0&&J.length>D&&(J=J.slice(0,D)),L!==0){let ce=Math.abs(L);J.length<ce&&(L<0?J=J.padEnd(ce," "):J=J.padStart(ce," "))}ds(i,J),o=u+_.length;continue}for(;o<t.length&&(t[o]===43||t[o]===45||t[o]===48||t[o]===32||t[o]===35||t[o]===39);)o++;let h=!1;if(t[o]===42)h=!0,o++;else for(;o<t.length&&qu(t[o]);)o++;let m=!1;if(t[o]===46)if(o++,t[o]===42)m=!0,o++;else for(;o<t.length&&qu(t[o]);)o++;o<t.length&&(t[o]===104||t[o]===108||t[o]===76)&&o++;let d=o<t.length?t[o]:0,g=d?T7(d):"";o++;let w=t.subarray(u,o),b=new TextDecoder().decode(w);if(h){let L=parseInt(e[n+a]||"0",10);a++,b=b.replace("*",String(L))}if(m){let L=parseInt(e[n+a]||"0",10);a++,b=b.replace(".*",`.${L}`)}let A=n+a,N=e[A]||"",P=s?.[A]??x(N);a++;let{value:O,rawBytes:G,parseError:M,parseErrMsg:Y,stopped:B}=R7(b,g,N,P);if(G?li(i,G):ds(i,O),M&&(l=!0,Y&&(c=Y)),B)return{result:new Uint8Array(i),argsConsumed:a,error:l,errMsg:c,stopped:!0}}else i.push(t[o]),o++;return{result:new Uint8Array(i),argsConsumed:a,error:l,errMsg:c,stopped:!1}}function R7(t,e,n,r){let s=!1,i="";switch(e){case"d":case"i":{let o=ai(n);return s=cn,s&&(i=`printf: ${n}: invalid number
38
+ `),{value:Zu(t,o),parseError:s,parseErrMsg:i}}case"o":{let o=ai(n);return s=cn,s&&(i=`printf: ${n}: invalid number
39
+ `),{value:P7(t,o),parseError:s,parseErrMsg:i}}case"u":{let o=ai(n);s=cn,s&&(i=`printf: ${n}: invalid number
40
+ `);let a=o<0?o>>>0:o;return{value:Zu(t.replace("u","d"),a),parseError:s,parseErrMsg:i}}case"x":case"X":{let o=ai(n);return s=cn,s&&(i=`printf: ${n}: invalid number
41
+ `),{value:$7(t,o),parseError:s,parseErrMsg:i}}case"e":case"E":case"f":case"F":case"g":case"G":{let o=parseFloat(n)||0;return{value:L7(t,e,o),parseError:!1,parseErrMsg:""}}case"c":{if(n==="")return{value:"",parseError:!1,parseErrMsg:""};let o=ms.encode(n);return{value:"",rawBytes:new Uint8Array([o[0]]),parseError:!1,parseErrMsg:""}}case"s":return{value:_7(t,n),parseError:!1,parseErrMsg:""};case"q":return{value:M7(t,r??x(n)),parseError:!1,parseErrMsg:""};case"b":{let o=F7(n);return{value:"",rawBytes:o.value,parseError:!1,parseErrMsg:"",stopped:o.stopped}}default:try{return{value:Or(t,n),parseError:!1,parseErrMsg:""}}catch{return{value:"",parseError:!0,parseErrMsg:`printf: [sprintf] unexpected placeholder
42
+ `}}}}function ai(t){cn=!1;let e=t.trimStart(),n=e!==e.trimEnd();if(t=e.trimEnd(),t.startsWith("'")&&t.length>=2||t.startsWith('"')&&t.length>=2)return t.charCodeAt(1);if(t.startsWith("\\'")&&t.length>=3||t.startsWith('\\"')&&t.length>=3)return t.charCodeAt(2);if(t.startsWith("+")&&(t=t.slice(1)),t.startsWith("0x")||t.startsWith("0X")){let r=parseInt(t,16);return Number.isNaN(r)?(cn=!0,0):(n&&(cn=!0),r)}if(t.startsWith("0")&&t.length>1&&/^-?0[0-7]+$/.test(t))return n&&(cn=!0),parseInt(t,8)||0;if(/^\d+#/.test(t)){cn=!0;let r=t.match(/^(\d+)#/);return r?parseInt(r[1],10):0}if(t!==""&&!/^-?\d+$/.test(t)){cn=!0;let r=parseInt(t,10);return Number.isNaN(r)?0:r}return n&&(cn=!0),parseInt(t,10)||0}function Zu(t,e){let n=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!n)return Or(t.replace(/\.\d*/,""),e);let r=n[1]||"",s=n[2]?parseInt(n[2],10):0,i=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,o=e<0,a=Math.abs(e),l=String(a);i>=0&&(l=l.padStart(i,"0"));let c="";o?c="-":r.includes("+")?c="+":r.includes(" ")&&(c=" ");let u=c+l;return s>u.length&&(r.includes("-")?u=u.padEnd(s," "):r.includes("0")&&i<0?u=c+l.padStart(s-c.length,"0"):u=u.padStart(s," ")),u}function P7(t,e){let n=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!n)return Or(t,e);let r=n[1]||"",s=n[2]?parseInt(n[2],10):0,i=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,o=Math.abs(e).toString(8);i>=0&&(o=o.padStart(i,"0")),r.includes("#")&&!o.startsWith("0")&&(o=`0${o}`);let a=o;return s>a.length&&(r.includes("-")?a=a.padEnd(s," "):r.includes("0")&&i<0?a=a.padStart(s,"0"):a=a.padStart(s," ")),a}function $7(t,e){let n=t.includes("X"),r=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!r)return Or(t,e);let s=r[1]||"",i=r[2]?parseInt(r[2],10):0,o=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,a=Math.abs(e).toString(16);n&&(a=a.toUpperCase()),o>=0&&(a=a.padStart(o,"0"));let l="";s.includes("#")&&e!==0&&(l=n?"0X":"0x");let c=l+a;return i>c.length&&(s.includes("-")?c=c.padEnd(i," "):s.includes("0")&&o<0?c=l+a.padStart(i-l.length,"0"):c=c.padStart(i," ")),c}function ra(t){return t<128?1:(t&224)===192?2:(t&240)===224?3:(t&248)===240?4:0}function D7(t){if(t.length===0)return"''";let e=!0;for(let i=0;i<t.length;i++){let o=t[i];if(!(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===46||o===95||o===47||o===45)){e=!1;break}}if(e)return new TextDecoder().decode(t);let n=!1;for(let i=0;i<t.length;i++){let o=t[i];if(o<32||o===127){n=!0;break}if(o>=128){let a=ra(o);if(a===0||i+a>t.length){n=!0;break}let l=!0;for(let c=1;c<a;c++)if((t[i+c]&192)!==128){l=!1;break}if(!l){n=!0;break}i+=a-1}}if(n){let i="$'";for(let o=0;o<t.length;o++){let a=t[o];if(a===39)i+="\\'";else if(a===92)i+="\\\\";else if(a===10)i+="\\n";else if(a===9)i+="\\t";else if(a===13)i+="\\r";else if(a===7)i+="\\a";else if(a===8)i+="\\b";else if(a===12)i+="\\f";else if(a===11)i+="\\v";else if(a===27)i+="\\E";else if(a<32||a===127)i+=`\\${a.toString(8).padStart(3,"0")}`;else if(a>=128){let l=ra(a),c=l>0&&o+l<=t.length;if(c){for(let u=1;u<l;u++)if((t[o+u]&192)!==128){c=!1;break}}if(c){let u=new TextDecoder().decode(t.subarray(o,o+l));i+=u,o+=l-1}else i+=`\\${a.toString(8).padStart(3,"0")}`}else a===34?i+='\\"':i+=String.fromCharCode(a)}return i+="'",i}let r=new Set(" |&;<>()$`\\\"'*?[#~=%!{}".split("").map(i=>i.charCodeAt(0))),s="";for(let i=0;i<t.length;i++){let o=t[i];if(o>=128){let a=ra(o),l=new TextDecoder().decode(t.subarray(i,i+a));s+=l,i+=a-1}else r.has(o)?s+=`\\${String.fromCharCode(o)}`:s+=String.fromCharCode(o)}return s}function _7(t,e){let n=t.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!n)return Or(t.replace(/0+(?=\d)/,""),e);let r=n[1]==="-",s=n[2]?parseInt(n[2],10):0,i=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,o=r?-s:s;return oi(e,o,i)}function M7(t,e){let n=D7(e),r=t.match(/^%(-?)(\d*)q$/);if(!r)return n;let s=r[1]==="-",i=r[2]?parseInt(r[2],10):0,o=n;return i>o.length&&(s?o=o.padEnd(i," "):o=o.padStart(i," ")),o}function L7(t,e,n){let r=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!r)return Or(t,n);let s=r[1]||"",i=r[2]?parseInt(r[2],10):0,o=r[3]!==void 0?r[4]?parseInt(r[4],10):0:6,a,l=e.toLowerCase();if(l==="e"?(a=n.toExponential(o),a=a.replace(/e([+-])(\d)$/,"e$10$2"),e==="E"&&(a=a.toUpperCase())):l==="f"?(a=n.toFixed(o),s.includes("#")&&o===0&&!a.includes(".")&&(a+=".")):l==="g"?(a=n.toPrecision(o||1),s.includes("#")||(a=a.replace(/\.?0+$/,""),a=a.replace(/\.?0+e/,"e")),a=a.replace(/e([+-])(\d)$/,"e$10$2"),e==="G"&&(a=a.toUpperCase())):a=n.toString(),n>=0&&(s.includes("+")?a=`+${a}`:s.includes(" ")&&(a=` ${a}`)),i>a.length)if(s.includes("-"))a=a.padEnd(i," ");else if(s.includes("0")){let c=a.match(/^[+ -]/)?.[0]||"",u=c?a.slice(1):a;a=c+u.padStart(i-c.length,"0")}else a=a.padStart(i," ");return a}function F7(t){let e=[],n=0;for(;n<t.length;)if(t[n]==="\\"&&n+1<t.length)switch(t[n+1]){case"n":e.push(10),n+=2;break;case"t":e.push(9),n+=2;break;case"r":e.push(13),n+=2;break;case"\\":e.push(92),n+=2;break;case"a":e.push(7),n+=2;break;case"b":e.push(8),n+=2;break;case"f":e.push(12),n+=2;break;case"v":e.push(11),n+=2;break;case"c":return{value:new Uint8Array(e),stopped:!0};case"x":{let s=n,i=!1;for(;s+1<t.length&&t[s]==="\\"&&t[s+1]==="x";){let o="",a=s+2;for(;a<t.length&&a<s+4&&/[0-9a-fA-F]/.test(t[a]);)o+=t[a],a++;if(o)e.push(parseInt(o,16)),s=a,i=!0;else break}i?n=s:(ds(e,"\\x"),n+=2);break}case"u":{let s="",i=n+2;for(;i<t.length&&i<n+6&&/[0-9a-fA-F]/.test(t[i]);)s+=t[i],i++;s?(li(e,ms.encode(String.fromCodePoint(parseInt(s,16)))),n=i):(ds(e,"\\u"),n+=2);break}case"0":{let s="",i=n+2;for(;i<t.length&&i<n+5&&/[0-7]/.test(t[i]);)s+=t[i],i++;s?e.push(parseInt(s,8)&255):e.push(0),n=i;break}case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let s="",i=n+1;for(;i<t.length&&i<n+4&&/[0-7]/.test(t[i]);)s+=t[i],i++;e.push(parseInt(s,8)&255),n=i;break}default:ds(e,t[n]),n++}else{let r=t.charCodeAt(n);if(r<128)e.push(r),n++;else{let s=r>=55296&&r<=56319&&n+1<t.length?t.slice(n,n+2):t[n];li(e,ms.encode(s)),n+=s.length}}return{value:new Uint8Array(e),stopped:!1}}var ms,k7,I7,cn,U7,Qu=I(()=>{"use strict";Ne();Qt();F();he();na();Vu();ms=new TextEncoder;k7={name:"printf",summary:"format and print data",usage:"printf [-v var] FORMAT [ARGUMENT...]",options:[" -v var assign the output to shell variable VAR rather than display it"," --help display this help and exit"],notes:["FORMAT controls the output like in C printf.","Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)","Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)","Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)","Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)"]},I7={name:"printf",async execute(t,e){let n=W(t);if(Z(n))return q(k7);if(n.length===0)return{stdout:y,stderr:x(`printf: usage: printf format [arguments]
43
+ `),exitCode:2};let r=null,s=0;for(;s<n.length;){let l=n[s];if(l==="--"){s++;break}if(l==="-v"){if(s+1>=n.length)return{stdout:y,stderr:x(`printf: -v: option requires an argument
44
+ `),exitCode:1};if(r=n[s+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?$/.test(r))return{stdout:y,stderr:x(`printf: \`${r}': not a valid identifier
45
+ `),exitCode:2};s+=2}else{if(l.startsWith("-")&&l!=="-")break;break}}if(s>=n.length)return{stdout:y,stderr:x(`printf: usage: printf format [arguments]
46
+ `),exitCode:1};let i=n[s],o=n.slice(s+1),a=t.slice(s+1);try{let l=Bu(i),c=y,u=0,f=!1,p="",h=$(e.env,"TZ")||void 0,m=e.limits?.maxStringLength;do{let{result:d,argsConsumed:g,error:w,errMsg:E,stopped:b}=O7(l,o,u,h,a);if(c=j(c,d),m!==void 0&&m>0&&c.length>m)throw new ae(`printf: output size limit exceeded (${m} bytes)`,"string_length");if(u+=g,w&&(f=!0,E&&(p=E)),b)break}while(u<o.length&&u>0);if(u===0&&o.length>0,r){let d=new TextDecoder().decode(c),g=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(['"]?)(.+?)\2\]$/);if(g){let w=g[1],E=g[3];E=E.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(b,A)=>$(e.env,A)),T(e.env,`${w}_${E}`,d)}else T(e.env,r,d);return{stdout:y,stderr:x(p),exitCode:f?1:0}}return{stdout:c,stderr:x(p),exitCode:f?1:0}}catch(l){if(l instanceof ae)throw l;return{stdout:y,stderr:x(`printf: ${qe(l)}
47
+ `),exitCode:1}}}};cn=!1;U7={name:"printf",flags:[{flag:"-v",type:"value",valueHint:"string"}],stdinType:"none",needsArgs:!0}});var Ju={};se(Ju,{flagsForFuzzing:()=>j7,lsCommand:()=>z7});import{minimatch as Ku}from"minimatch";function ci(t){if(t<1024)return String(t);if(t<1024*1024){let n=t/1024;return n<10?`${n.toFixed(1)}K`:`${Math.round(n)}K`}if(t<1024*1024*1024){let n=t/1048576;return n<10?`${n.toFixed(1)}M`:`${Math.round(n)}M`}let e=t/(1024*1024*1024);return e<10?`${e.toFixed(1)}G`:`${Math.round(e)}G`}function ui(t){let n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],r=String(t.getDate()).padStart(2," "),s=new Date,i=new Date(s.getTime()-4320*60*60*1e3);if(t>i){let a=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return`${n} ${r} ${a}:${l}`}let o=t.getFullYear();return`${n} ${r} ${o}`}async function H7(t,e,n,r,s,i=!1,o=!1,a=!1){let l=n||r,c=e.fs.getAllPaths(),u=e.fs.resolvePath(e.cwd,"."),f=[];for(let p of c){let h=p.startsWith(u)&&p.slice(u.length+1)||p;if(Ku(h,t)||Ku(p,t)){let m=h.split("/").pop()||h;if(!l&&m.startsWith("."))continue;f.push(h||p)}}if(f.length===0)return{stdout:y,stderr:x(`ls: ${t}: No such file or directory
48
+ `),exitCode:2};if(a){let p=[];for(let h of f){let m=e.fs.resolvePath(e.cwd,h);try{let d=await e.fs.stat(m);p.push({path:h,size:d.size??0})}catch{p.push({path:h,size:0})}}p.sort((h,m)=>m.size-h.size),f.length=0,f.push(...p.map(h=>h.path))}else f.sort();if(i&&f.reverse(),s){let p=[];for(let h of f){let m=e.fs.resolvePath(e.cwd,h);try{let d=await e.fs.stat(m),g=d.isDirectory?"drwxr-xr-x":"-rw-r--r--",w=d.isDirectory?"/":"",E=d.size??0,b=o?ci(E).padStart(5):String(E).padStart(5),A=d.mtime??new Date(0),N=ui(A);p.push(`${g} 1 user user ${b} ${N} ${h}${w}`)}catch{p.push(`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${h}`)}}return{stdout:x(`${p.join(`
49
+ `)}
50
+ `),stderr:y,exitCode:0}}return{stdout:x(`${f.join(`
51
+ `)}
52
+ `),stderr:y,exitCode:0}}async function Xu(t,e,n,r,s,i,o,a=!1,l=!1,c=!1,u=!1){let f=n||r,p=e.fs.resolvePath(e.cwd,t);try{let h=await e.fs.stat(p);if(!h.isDirectory){if(s){let g=h.size??0,w=l?ci(g).padStart(5):String(g).padStart(5),E=h.mtime??new Date(0),b=ui(E);return{stdout:x(`-rw-r--r-- 1 user user ${w} ${b} ${t}
53
+ `),stderr:y,exitCode:0}}return{stdout:x(`${t}
54
+ `),stderr:y,exitCode:0}}let m=await e.fs.readdir(p);if(f||(m=m.filter(g=>!g.startsWith("."))),c){let g=[];for(let w of m){let E=p==="/"?`/${w}`:`${p}/${w}`;try{let b=await e.fs.stat(E);g.push({name:w,size:b.size??0})}catch{g.push({name:w,size:0})}}g.sort((w,E)=>E.size-w.size),m=g.map(w=>w.name)}else m.sort();n&&(m=[".","..",...m]),a&&m.reverse();let d="";if((i||o)&&(d+=`${t}:
55
+ `),s){d+=`total ${m.length}
56
+ `;let g=m.filter(A=>A==="."||A===".."),w=m.filter(A=>A!=="."&&A!=="..");for(let A of g)d+=`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${A}
57
+ `;let E=[];for(let A=0;A<w.length;A+=100){let N=w.slice(A,A+100),P=await Promise.all(N.map(async O=>{let G=p==="/"?`/${O}`:`${p}/${O}`;try{let M=await e.fs.stat(G),Y=M.isDirectory?"drwxr-xr-x":"-rw-r--r--",B=M.isDirectory?"/":"",L=M.size??0,D=l?ci(L).padStart(5):String(L).padStart(5),v=M.mtime??new Date(0),_=ui(v);return{name:O,line:`${Y} 1 user user ${D} ${_} ${O}${B}
58
+ `}}catch{return{name:O,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${O}
59
+ `}}}));E.push(...P)}let b=new Map(w.map((A,N)=>[A,N]));E.sort((A,N)=>(b.get(A.name)??0)-(b.get(N.name)??0));for(let{line:A}of E)d+=A}else d+=m.join(`
60
+ `)+(m.length?`
61
+ `:"");if(i){let g=m.filter(b=>b!=="."&&b!==".."),w=[];if(e.fs.readdirWithFileTypes)w=(await e.fs.readdirWithFileTypes(p)).filter(A=>A.isDirectory&&g.includes(A.name)).map(A=>({name:A.name,isDirectory:!0}));else for(let b=0;b<g.length;b+=100){let A=g.slice(b,b+100),N=await Promise.all(A.map(async P=>{let O=p==="/"?`/${P}`:`${p}/${P}`;try{let G=await e.fs.stat(O);return{name:P,isDirectory:G.isDirectory}}catch{return{name:P,isDirectory:!1}}}));w.push(...N.filter(P=>P.isDirectory))}w.sort((b,A)=>b.name.localeCompare(A.name)),a&&w.reverse();let E=[];for(let b=0;b<w.length;b+=100){let A=w.slice(b,b+100),N=await Promise.all(A.map(async P=>{let O=t==="."?`./${P.name}`:`${t}/${P.name}`,G=await Xu(O,e,n,r,s,i,!1,a,l,c,!0);return{name:P.name,result:G}}));E.push(...N)}E.sort((b,A)=>b.name.localeCompare(A.name)),a&&E.reverse();for(let{result:b}of E)d+=`
62
+ `,d+=R(b.stdout)}return{stdout:x(d),stderr:y,exitCode:0}}catch{return{stdout:y,stderr:x(`ls: ${t}: No such file or directory
63
+ `),exitCode:2}}}var B7,W7,z7,j7,ef=I(()=>{"use strict";nt();F();kr();he();B7={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},W7={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},z7={name:"ls",async execute(t,e){let n=W(t);if(Z(n))return q(B7);let r=ke("ls",n,W7);if(!r.ok)return r.error;let s=r.result.flags.showAll,i=r.result.flags.showAlmostAll,o=r.result.flags.longFormat,a=r.result.flags.humanReadable,l=r.result.flags.recursive,c=r.result.flags.reverse,u=r.result.flags.sortBySize,f=r.result.flags.directoryOnly,p=r.result.flags.sortByTime;r.result.flags.onePerLine;let h=r.result.positional;h.length===0&&h.push(".");let m="",d="",g=0;for(let w=0;w<h.length;w++){let E=h[w];if(w>0&&m&&!m.endsWith(`
64
+
65
+ `)&&(m+=`
66
+ `),f){let b=e.fs.resolvePath(e.cwd,E);try{let A=await e.fs.stat(b);if(o){let N=A.isDirectory?"drwxr-xr-x":"-rw-r--r--",P=A.isDirectory?"/":"",O=A.size??0,G=a?ci(O).padStart(5):String(O).padStart(5),M=A.mtime??new Date(0),Y=ui(M);m+=`${N} 1 user user ${G} ${Y} ${E}${P}
67
+ `}else m+=`${E}
68
+ `}catch{d+=`ls: cannot access '${E}': No such file or directory
69
+ `,g=2}continue}if(E.includes("*")||E.includes("?")||E.includes("[")){let b=await H7(E,e,s,i,o,c,a,u);m+=R(b.stdout),d+=R(b.stderr),b.exitCode!==0&&(g=b.exitCode)}else{let b=await Xu(E,e,s,i,o,l,h.length>1,c,a,u);m+=R(b.stdout),d+=R(b.stderr),b.exitCode!==0&&(g=b.exitCode)}}return{stdout:x(m),stderr:x(d),exitCode:g}}};j7={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0}});var tf={};se(tf,{flagsForFuzzing:()=>q7,mkdirCommand:()=>V7});var G7,V7,q7,nf=I(()=>{"use strict";Qt();nt();F();G7={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},V7={name:"mkdir",async execute(t,e){let n=W(t),r=ke("mkdir",n,G7);if(!r.ok)return r.error;let s=r.result.flags.recursive,i=r.result.flags.verbose,o=r.result.positional;if(o.length===0)return{stdout:y,stderr:x(`mkdir: missing operand
70
+ `),exitCode:1};let a="",l="",c=0;for(let u of o)try{let f=e.fs.resolvePath(e.cwd,u);await e.fs.mkdir(f,{recursive:s}),i&&(a+=`mkdir: created directory '${u}'
71
+ `)}catch(f){let p=qe(f);p.includes("ENOENT")||p.includes("no such file")?l+=`mkdir: cannot create directory '${u}': No such file or directory
72
+ `:p.includes("EEXIST")||p.includes("already exists")?l+=`mkdir: cannot create directory '${u}': File exists
73
+ `:l+=`mkdir: cannot create directory '${u}': ${p}
74
+ `,c=1}return{stdout:x(a),stderr:x(l),exitCode:c}}},q7={name:"mkdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}});var of={};se(of,{flagsForFuzzing:()=>X7,rmdirCommand:()=>Q7});async function K7(t,e,n,r){let s="",i="",a=t.fs.resolvePath(t.cwd,e),l=await rf(t,a,e,r);if(s+=R(l.stdout),i+=R(l.stderr),l.exitCode!==0)return{stdout:x(s),stderr:x(i),exitCode:l.exitCode};if(n){let c=a,u=e;for(;;){let f=sf(c),p=sf(u);if(f===c||f==="/"||f==="."||p==="."||p==="")break;let h=await rf(t,f,p,r);if(s+=R(h.stdout),h.exitCode!==0)break;c=f,u=p}}return{stdout:x(s),stderr:x(i),exitCode:0}}async function rf(t,e,n,r){try{if(!await t.fs.exists(e))return{stdout:y,stderr:x(`rmdir: failed to remove '${n}': No such file or directory
75
+ `),exitCode:1};if(!(await t.fs.stat(e)).isDirectory)return{stdout:y,stderr:x(`rmdir: failed to remove '${n}': Not a directory
76
+ `),exitCode:1};if((await t.fs.readdir(e)).length>0)return{stdout:y,stderr:x(`rmdir: failed to remove '${n}': Directory not empty
77
+ `),exitCode:1};await t.fs.rm(e,{recursive:!1,force:!1});let a="";return r&&(a=`rmdir: removing directory, '${n}'
78
+ `),{stdout:x(a),stderr:y,exitCode:0}}catch(s){let i=qe(s);return{stdout:y,stderr:x(`rmdir: failed to remove '${n}': ${i}
79
+ `),exitCode:1}}}function sf(t){let e=t.replace(/\/+$/,""),n=e.lastIndexOf("/");return n===-1?".":n===0?"/":e.substring(0,n)}var Z7,Y7,Q7,X7,af=I(()=>{"use strict";Qt();nt();F();Z7=`Usage: rmdir [-pv] DIRECTORY...
80
+ Remove empty directories.
81
+
82
+ Options:
83
+ -p, --parents Remove DIRECTORY and its ancestors
84
+ -v, --verbose Output a diagnostic for every directory processed`,Y7={parents:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},help:{long:"help",type:"boolean"}},Q7={name:"rmdir",async execute(t,e){let n=W(t),r=ke("rmdir",n,Y7);if(!r.ok)return r.error;if(r.result.flags.help)return{stdout:x(`${Z7}
85
+ `),stderr:y,exitCode:0};let s=r.result.flags.parents,i=r.result.flags.verbose,o=r.result.positional;if(o.length===0)return{stdout:y,stderr:x(`rmdir: missing operand
86
+ `),exitCode:1};let a="",l="",c=0;for(let u of o){let f=await K7(e,u,s,i);a+=R(f.stdout),l+=R(f.stderr),f.exitCode!==0&&(c=f.exitCode)}return{stdout:x(a),stderr:x(l),exitCode:c}}};X7={name:"rmdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}});var lf={};se(lf,{flagsForFuzzing:()=>ty,touchCommand:()=>ey});function J7(t){let e=t.replace(/\//g,"-"),n=new Date(e);if(!Number.isNaN(n.getTime()))return n;let r=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(r){let[,i,o,a]=r;if(n=new Date(Number.parseInt(i,10),Number.parseInt(o,10)-1,Number.parseInt(a,10)),!Number.isNaN(n.getTime()))return n}let s=e.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(s){let[,i,o,a,l,c,u]=s;if(n=new Date(Number.parseInt(i,10),Number.parseInt(o,10)-1,Number.parseInt(a,10),Number.parseInt(l,10),Number.parseInt(c,10),Number.parseInt(u,10)),!Number.isNaN(n.getTime()))return n}return null}var ey,ty,cf=I(()=>{"use strict";Qt();F();he();ey={name:"touch",async execute(t,e){let n=W(t),r=[],s=null,i=!1;for(let c=0;c<n.length;c++){let u=n[c];if(u==="--"){r.push(...n.slice(c+1));break}else if(u==="-d"||u==="--date"){if(c+1>=n.length)return{stdout:y,stderr:x(`touch: option requires an argument -- 'd'
87
+ `),exitCode:1};s=n[++c]}else if(u.startsWith("--date="))s=u.slice(7);else if(u==="-c"||u==="--no-create")i=!0;else if(u==="-a"||u==="-m"||u==="-r"||u==="-t")(u==="-r"||u==="-t")&&c++;else{if(u.startsWith("--"))return oe("touch",u);if(u.startsWith("-")&&u.length>1){let f=!1;for(let p of u.slice(1))if(p==="c")i=!0;else if(!(p==="a"||p==="m"))if(p==="d"){if(c+1>=n.length)return{stdout:y,stderr:x(`touch: option requires an argument -- 'd'
88
+ `),exitCode:1};s=n[++c],f=!0;break}else if(p==="r"||p==="t"){c++,f=!0;break}else return oe("touch",`-${p}`);if(f)continue}else r.push(u)}}if(r.length===0)return{stdout:y,stderr:x(`touch: missing file operand
89
+ `),exitCode:1};let o=null;if(s!==null&&(o=J7(s),o===null))return{stdout:y,stderr:x(`touch: invalid date format '${s}'
90
+ `),exitCode:1};let a="",l=0;for(let c of r)try{let u=e.fs.resolvePath(e.cwd,c);if(!await e.fs.exists(u)){if(i)continue;await e.fs.writeFile(u,"")}let p=o??new Date;await e.fs.utimes(u,p,p)}catch(u){a+=`touch: cannot touch '${c}': ${qe(u)}
91
+ `,l=1}return{stdout:y,stderr:x(a),exitCode:l}}},ty={name:"touch",flags:[{flag:"-c",type:"boolean"},{flag:"-a",type:"boolean"},{flag:"-m",type:"boolean"},{flag:"-d",type:"value",valueHint:"string"}],needsArgs:!0}});var uf={};se(uf,{flagsForFuzzing:()=>sy,rmCommand:()=>ry});var ny,ry,sy,ff=I(()=>{"use strict";Qt();nt();F();ny={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},ry={name:"rm",async execute(t,e){let n=W(t),r=ke("rm",n,ny);if(!r.ok)return r.error;let s=r.result.flags.recursive||r.result.flags.recursiveUpper,i=r.result.flags.force,o=r.result.flags.verbose,a=r.result.positional;if(a.length===0)return i?{stdout:y,stderr:y,exitCode:0}:{stdout:y,stderr:x(`rm: missing operand
92
+ `),exitCode:1};let l="",c="",u=0;for(let f of a)try{let p=e.fs.resolvePath(e.cwd,f);if((await e.fs.stat(p)).isDirectory&&!s){c+=`rm: cannot remove '${f}': Is a directory
93
+ `,u=1;continue}await e.fs.rm(p,{recursive:s,force:i}),o&&(l+=`removed '${f}'
94
+ `)}catch(p){if(!i){let h=qe(p);h.includes("ENOENT")||h.includes("no such file")?c+=`rm: cannot remove '${f}': No such file or directory
95
+ `:h.includes("ENOTEMPTY")||h.includes("not empty")?c+=`rm: cannot remove '${f}': Directory not empty
96
+ `:c+=`rm: cannot remove '${f}': ${h}
97
+ `,u=1}}return{stdout:x(l),stderr:x(c),exitCode:u}}},sy={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}});var pf={};se(pf,{cpCommand:()=>ay,flagsForFuzzing:()=>ly});var iy,oy,ay,ly,hf=I(()=>{"use strict";Qt();nt();F();he();iy={name:"cp",summary:"copy files and directories",usage:"cp [OPTION]... SOURCE... DEST",options:["-r, -R, --recursive copy directories recursively","-n, --no-clobber do not overwrite an existing file","-p, --preserve preserve file attributes","-v, --verbose explain what is being done"," --help display this help and exit"]},oy={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},preserve:{short:"p",long:"preserve",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},ay={name:"cp",async execute(t,e){let n=W(t);if(Z(n))return q(iy);let r=ke("cp",n,oy);if(!r.ok)return r.error;let s=r.result.flags.recursive||r.result.flags.recursiveUpper,i=r.result.flags.noClobber,o=r.result.flags.preserve,a=r.result.flags.verbose,l=r.result.positional;if(l.length<2)return{stdout:y,stderr:x(`cp: missing destination file operand
98
+ `),exitCode:1};let c=l.pop()??"",u=l,f=e.fs.resolvePath(e.cwd,c),p="",h="",m=0,d=!1;try{d=(await e.fs.stat(f)).isDirectory}catch{}if(u.length>1&&!d)return{stdout:y,stderr:x(`cp: target '${c}' is not a directory
99
+ `),exitCode:1};for(let g of u)try{let w=e.fs.resolvePath(e.cwd,g),E=await e.fs.stat(w),b=f;if(d){let A=g.split("/").pop()||g;b=f==="/"?`/${A}`:`${f}/${A}`}if(E.isDirectory&&!s){h+=`cp: -r not specified; omitting directory '${g}'
100
+ `,m=1;continue}if(i)try{await e.fs.stat(b);continue}catch{}await e.fs.cp(w,b,{recursive:s}),a&&(p+=`'${g}' -> '${b}'
101
+ `)}catch(w){let E=qe(w);E.includes("ENOENT")||E.includes("no such file")?h+=`cp: cannot stat '${g}': No such file or directory
102
+ `:h+=`cp: cannot copy '${g}': ${E}
103
+ `,m=1}return{stdout:x(p),stderr:x(h),exitCode:m}}},ly={name:"cp",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var df={};se(df,{flagsForFuzzing:()=>py,mvCommand:()=>fy});var cy,uy,fy,py,mf=I(()=>{"use strict";Qt();nt();F();he();cy={name:"mv",summary:"move (rename) files",usage:"mv [OPTION]... SOURCE... DEST",options:["-f, --force do not prompt before overwriting","-n, --no-clobber do not overwrite an existing file","-v, --verbose explain what is being done"," --help display this help and exit"]},uy={force:{short:"f",long:"force",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},fy={name:"mv",async execute(t,e){let n=W(t);if(Z(n))return q(cy);let r=ke("mv",n,uy);if(!r.ok)return r.error;let s=r.result.flags.force,i=r.result.flags.noClobber,o=r.result.flags.verbose,a=r.result.positional;if(i&&(s=!1),a.length<2)return{stdout:y,stderr:x(`mv: missing destination file operand
104
+ `),exitCode:1};let l=a.pop()??"",c=a,u=e.fs.resolvePath(e.cwd,l),f="",p="",h=0,m=!1;try{m=(await e.fs.stat(u)).isDirectory}catch{}if(c.length>1&&!m)return{stdout:y,stderr:x(`mv: target '${l}' is not a directory
105
+ `),exitCode:1};for(let d of c)try{let g=e.fs.resolvePath(e.cwd,d),w=u;if(m){let E=d.split("/").pop()||d;w=u==="/"?`/${E}`:`${u}/${E}`}if(i)try{await e.fs.stat(w);continue}catch{}if(await e.fs.mv(g,w),o){let E=m?`${l}/${d.split("/").pop()||d}`:l;f+=`renamed '${d}' -> '${E}'
106
+ `}}catch(g){let w=qe(g);w.includes("ENOENT")||w.includes("no such file")?p+=`mv: cannot stat '${d}': No such file or directory
107
+ `:p+=`mv: cannot move '${d}': ${w}
108
+ `,h=1}return{stdout:x(f),stderr:x(p),exitCode:h}}},py={name:"mv",flags:[{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var gf={};se(gf,{flagsForFuzzing:()=>my,lnCommand:()=>dy});var hy,dy,my,yf=I(()=>{"use strict";F();he();hy={name:"ln",summary:"make links between files",usage:"ln [OPTIONS] TARGET LINK_NAME",options:["-s create a symbolic link instead of a hard link","-f remove existing destination files","-n treat LINK_NAME as a normal file if it is a symbolic link to a directory","-v print name of each linked file"," --help display this help and exit"]},dy={name:"ln",async execute(t,e){let n=W(t);if(Z(n))return q(hy);let r=!1,s=!1,i=!1,o=0;for(;o<n.length&&n[o].startsWith("-");){let p=n[o];if(p==="-s"||p==="--symbolic")r=!0,o++;else if(p==="-f"||p==="--force")s=!0,o++;else if(p==="-v"||p==="--verbose")i=!0,o++;else if(p==="-n"||p==="--no-dereference")o++;else if(/^-[sfvn]+$/.test(p))p.includes("s")&&(r=!0),p.includes("f")&&(s=!0),p.includes("v")&&(i=!0),o++;else if(p==="--"){o++;break}else return{stdout:y,stderr:x(`ln: invalid option -- '${p.slice(1)}'
109
+ `),exitCode:1}}let a=n.slice(o);if(a.length<2)return{stdout:y,stderr:x(`ln: missing file operand
110
+ `),exitCode:1};let l=a[0],c=a[1],u=e.fs.resolvePath(e.cwd,c);if(await e.fs.exists(u))if(s)try{await e.fs.rm(u,{force:!0})}catch{return{stdout:y,stderr:x(`ln: cannot remove '${c}': Permission denied
111
+ `),exitCode:1}}else return{stdout:y,stderr:x(`ln: failed to create ${r?"symbolic ":""}link '${c}': File exists
112
+ `),exitCode:1};try{if(r)await e.fs.symlink(l,u);else{let p=e.fs.resolvePath(e.cwd,l);if(!await e.fs.exists(p))return{stdout:y,stderr:x(`ln: failed to access '${l}': No such file or directory
113
+ `),exitCode:1};await e.fs.link(p,u)}}catch(p){let h=p;return h.message.includes("EPERM")?{stdout:y,stderr:x(`ln: '${l}': hard link not allowed for directory
114
+ `),exitCode:1}:{stdout:y,stderr:x(`ln: ${h.message}
115
+ `),exitCode:1}}let f="";return i&&(f=`'${c}' -> '${l}'
116
+ `),{stdout:x(f),stderr:y,exitCode:0}}},my={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var bf={};se(bf,{chmodCommand:()=>yy,flagsForFuzzing:()=>wy});async function wf(t,e,n,r,s){let i="",o=await t.fs.readdir(e);for(let a of o){let l=e==="/"?`/${a}`:`${e}/${a}`,c;if(n!==void 0)c=n;else if(r!==void 0){let f=await t.fs.stat(l);c=sa(r,f.mode)}else c=420;await t.fs.chmod(l,c),s&&(i+=`mode of '${l}' changed to ${c.toString(8).padStart(4,"0")}
117
+ `),(await t.fs.stat(l)).isDirectory&&(i+=await wf(t,l,n,r,s))}return i}function sa(t,e=420){if(/^[0-7]+$/.test(t))return parseInt(t,8);let n=e&4095,r=t.split(",");for(let s of r){let i=s.match(/^([ugoa]*)([+\-=])([rwxXst]*)$/);if(!i)throw new Error(`Invalid mode: ${t}`);let o=i[1]||"a",a=i[2],l=i[3];(o==="a"||o==="")&&(o="ugo");let c=0;l.includes("r")&&(c|=4),l.includes("w")&&(c|=2),(l.includes("x")||l.includes("X"))&&(c|=1);let u=0;l.includes("s")&&(o.includes("u")&&(u|=2048),o.includes("g")&&(u|=1024)),l.includes("t")&&(u|=512);for(let f of o){let p=0;f==="u"?p=6:f==="g"?p=3:f==="o"&&(p=0);let h=c<<p;a==="+"?n|=h:a==="-"?n&=~h:a==="="&&(n&=~(7<<p),n|=h)}a==="+"?n|=u:a==="-"?n&=~u:a==="="&&(l.includes("s")&&(o.includes("u")&&(n&=-2049,n|=u&2048),o.includes("g")&&(n&=-1025,n|=u&1024)),l.includes("t")&&(n&=-513,n|=u&512))}return n}var gy,yy,wy,xf=I(()=>{"use strict";F();he();gy={name:"chmod",summary:"change file mode bits",usage:"chmod [OPTIONS] MODE FILE...",options:["-R change files recursively","-v output a diagnostic for every file processed"," --help display this help and exit"]},yy={name:"chmod",async execute(t,e){let n=W(t);if(Z(n))return q(gy);if(n.length<2)return{stdout:y,stderr:x(`chmod: missing operand
118
+ `),exitCode:1};let r=!1,s=!1,i=0;for(;i<n.length&&n[i].startsWith("-");){let h=n[i];if(h==="-R"||h==="--recursive")r=!0,i++;else if(h==="-v"||h==="--verbose")s=!0,i++;else if(h==="--"){i++;break}else{if(/^[+-]?[rwxugo]+/.test(h)||/^\d+$/.test(h))break;if(/^-[Rv]+$/.test(h)){h.includes("R")&&(r=!0),h.includes("v")&&(s=!0),i++;continue}return{stdout:y,stderr:x(`chmod: invalid option -- '${h.slice(1)}'
119
+ `),exitCode:1}}}if(n.length-i<2)return{stdout:y,stderr:x(`chmod: missing operand
120
+ `),exitCode:1};let o=n[i],a=n.slice(i+1),l=/^[0-7]+$/.test(o),c;if(l)c=parseInt(o,8);else try{sa(o,420)}catch{return{stdout:y,stderr:x(`chmod: invalid mode: '${o}'
121
+ `),exitCode:1}}let u="",f="",p=!1;for(let h of a){let m=e.fs.resolvePath(e.cwd,h);try{let d;if(l&&c!==void 0)d=c;else{let g=await e.fs.stat(m);d=sa(o,g.mode)}if(await e.fs.chmod(m,d),s&&(u+=`mode of '${h}' changed to ${d.toString(8).padStart(4,"0")}
122
+ `),r&&(await e.fs.stat(m)).isDirectory){let w=await wf(e,m,l?c:void 0,l?void 0:o,s);u+=w}}catch{f+=`chmod: cannot access '${h}': No such file or directory
123
+ `,p=!0}}return{stdout:x(u),stderr:x(f),exitCode:p?1:0}}};wy={name:"chmod",flags:[{flag:"-R",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}});var Ef={};se(Ef,{flagsForFuzzing:()=>xy,pwdCommand:()=>by});var by,xy,Af=I(()=>{"use strict";F();by={name:"pwd",async execute(t,e){let n=W(t),r=!1;for(let i of n)if(i==="-P")r=!0;else if(i==="-L")r=!1;else{if(i==="--")break;i.startsWith("-")}let s=e.cwd;if(r)try{s=await e.fs.realpath(e.cwd)}catch{}return{stdout:x(`${s}
124
+ `),stderr:y,exitCode:0}}},xy={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]}});var Sf={};se(Sf,{flagsForFuzzing:()=>Sy,readlinkCommand:()=>Ay});var Ey,Ay,Sy,Cf=I(()=>{"use strict";F();he();Ey={name:"readlink",summary:"print resolved symbolic links or canonical file names",usage:"readlink [OPTIONS] FILE...",options:["-f canonicalize by following every symlink in every component of the given name recursively"," --help display this help and exit"]},Ay={name:"readlink",async execute(t,e){let n=W(t);if(Z(n))return q(Ey);let r=!1,s=0;for(;s<n.length&&n[s].startsWith("-");){let l=n[s];if(l==="-f"||l==="--canonicalize")r=!0,s++;else if(l==="--"){s++;break}else return{stdout:y,stderr:x(`readlink: invalid option -- '${l.slice(1)}'
125
+ `),exitCode:1}}let i=n.slice(s);if(i.length===0)return{stdout:y,stderr:x(`readlink: missing operand
126
+ `),exitCode:1};let o="",a=!1;for(let l of i){let c=e.fs.resolvePath(e.cwd,l);try{if(r){let u=c,f=new Set;for(;!f.has(u);){f.add(u);try{let p=await e.fs.readlink(u);if(p.startsWith("/"))u=p;else{let h=u.substring(0,u.lastIndexOf("/"))||"/";u=e.fs.resolvePath(h,p)}}catch{break}}o+=`${u}
127
+ `}else{let u=await e.fs.readlink(c);o+=`${u}
128
+ `}}catch{r?o+=`${c}
129
+ `:a=!0}}return{stdout:x(o),stderr:y,exitCode:a?1:0}}},Sy={name:"readlink",flags:[{flag:"-f",type:"boolean"},{flag:"-e",type:"boolean"}],needsArgs:!0}});function fi(t,e){let n=10,r=null,s=!1,i=!1,o=!1,a=[];for(let l=0;l<t.length;l++){let c=t[l];if(c==="-n"&&l+1<t.length){let u=t[++l];e==="tail"&&u.startsWith("+")?(o=!0,n=parseInt(u.slice(1),10)):n=parseInt(u,10)}else if(e==="tail"&&c.startsWith("-n+"))o=!0,n=parseInt(c.slice(3),10);else if(c.startsWith("-n"))n=parseInt(c.slice(2),10);else if(c==="-c"&&l+1<t.length)r=parseInt(t[++l],10);else if(c.startsWith("-c"))r=parseInt(c.slice(2),10);else if(c.startsWith("--bytes="))r=parseInt(c.slice(8),10);else if(c.startsWith("--lines="))n=parseInt(c.slice(8),10);else if(c==="-q"||c==="--quiet"||c==="--silent")s=!0;else if(c==="-v"||c==="--verbose")i=!0;else if(c.match(/^-\d+$/))n=parseInt(c.slice(1),10);else{if(c.startsWith("--"))return{ok:!1,error:oe(e,c)};if(c.startsWith("-")&&c!=="-")return{ok:!1,error:oe(e,c)};a.push(c)}}return r!==null&&(Number.isNaN(r)||r<0)?{ok:!1,error:{stdout:y,stderr:x(`${e}: invalid number of bytes
130
+ `),exitCode:1}}:Number.isNaN(n)||n<0?{ok:!1,error:{stdout:y,stderr:x(`${e}: invalid number of lines
131
+ `),exitCode:1}}:{ok:!0,options:{lines:n,bytes:r,quiet:s,verbose:i,files:a,fromLine:o}}}async function pi(t,e,n,r){let{quiet:s,verbose:i,files:o}=e;if(o.length===0)return{stdout:x(r(R(t.stdin))),stderr:y,exitCode:0};let a="",l="",c=0,u=i||!s&&o.length>1,f=0;for(let p=0;p<o.length;p++){let h=o[p];try{let m=t.fs.resolvePath(t.cwd,h),d=await t.fs.readFile(m);u&&(f>0&&(a+=`
132
+ `),a+=`==> ${h} <==
133
+ `),a+=r(d),f++}catch{l+=`${n}: ${h}: No such file or directory
134
+ `,c=1}}return{stdout:x(a),stderr:x(l),exitCode:c}}function Nf(t,e,n){if(n!==null)return t.slice(0,n);if(e===0)return"";let r=0,s=0,i=t.length;for(;r<i&&s<e;){let o=t.indexOf(`
135
+ `,r);if(o===-1)return`${t}
136
+ `;s++,r=o+1}return r>0?t.slice(0,r):""}function vf(t,e,n,r){if(n!==null)return t.slice(-n);let s=t.length;if(s===0)return"";if(r){let l=0,c=1;for(;l<s&&c<e;){let f=t.indexOf(`
137
+ `,l);if(f===-1)break;c++,l=f+1}let u=t.slice(l);return u.endsWith(`
138
+ `)?u:`${u}
139
+ `}if(e===0)return"";let i=s-1;t[i]===`
140
+ `&&i--;let o=0;for(;i>=0&&o<e;){if(t[i]===`
141
+ `&&(o++,o===e)){i++;break}i--}i<0&&(i=0);let a=t.slice(i);return t[s-1]===`
142
+ `?a:`${a}
143
+ `}var ia=I(()=>{"use strict";F();he()});var kf={};se(kf,{flagsForFuzzing:()=>vy,headCommand:()=>Ny});var Cy,Ny,vy,If=I(()=>{"use strict";F();he();ia();Cy={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},Ny={name:"head",async execute(t,e){let n=W(t);if(Z(n))return q(Cy);let r=fi(n,"head");if(!r.ok)return r.error;let{lines:s,bytes:i}=r.options;return pi(e,r.options,"head",o=>Nf(o,s,i))}},vy={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Tf={};se(Tf,{flagsForFuzzing:()=>Ty,tailCommand:()=>Iy});var ky,Iy,Ty,Of=I(()=>{"use strict";F();ia();he();ky={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},Iy={name:"tail",async execute(t,e){let n=W(t);if(Z(n))return q(ky);let r=fi(n,"tail");if(!r.ok)return r.error;let{lines:s,bytes:i,fromLine:o}=r.options;return pi(e,r.options,"tail",a=>vf(a,s,i,o??!1))}},Ty={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Pf={};se(Pf,{flagsForFuzzing:()=>$y,wcCommand:()=>Py});function Rf(t){let e=t.length,n=0,r=0,s=!1;for(let i=0;i<e;i++){let o=t[i];o===`
144
+ `?(n++,s&&(r++,s=!1)):o===" "||o===" "||o==="\r"?s&&(r++,s=!1):s=!0}return s&&r++,{lines:n,words:r,chars:e}}function oa(t,e,n,r,s,i){let o=[];e&&o.push(String(t.lines).padStart(i)),n&&o.push(String(t.words).padStart(i)),r&&o.push(String(t.chars).padStart(i));let a=o.join(" ");return s&&(a+=` ${s}`),a}var Oy,Ry,Py,$y,$f=I(()=>{"use strict";nt();F();sr();he();Oy={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},Ry={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},Py={name:"wc",async execute(t,e){let n=W(t);if(Z(n))return q(Oy);let r=ke("wc",n,Ry);if(!r.ok)return r.error;let{lines:s,words:i}=r.result.flags,o=r.result.flags.bytes||r.result.flags.chars,a=r.result.positional;!s&&!i&&!o&&(s=i=o=!0);let l=await rr(e,a,{cmdName:"wc",stopOnError:!1});if(a.length===0){let E=Rf(R(l.files[0].content));return{stdout:x(`${oa(E,s,i,o,"",0)}
145
+ `),stderr:y,exitCode:0}}let c=[],u=0,f=0,p=0;for(let{filename:E,content:b}of l.files){let A=Rf(R(b));u+=A.lines,f+=A.words,p+=A.chars,c.push({filename:E,stats:A})}let h=a.length>1?u:Math.max(...c.map(E=>E.stats.lines)),m=a.length>1?f:Math.max(...c.map(E=>E.stats.words)),d=a.length>1?p:Math.max(...c.map(E=>E.stats.chars)),g=a.length>1?3:0;s&&(g=Math.max(g,String(h).length)),i&&(g=Math.max(g,String(m).length)),o&&(g=Math.max(g,String(d).length));let w="";for(let{filename:E,stats:b}of c)w+=`${oa(b,s,i,o,E,g)}
146
+ `;return a.length>1&&(w+=`${oa({lines:u,words:f,chars:p},s,i,o,"total",g)}
147
+ `),{stdout:x(w),stderr:x(l.stderr),exitCode:l.exitCode}}};$y={name:"wc",flags:[{flag:"-l",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-m",type:"boolean"}],stdinType:"text",needsFiles:!0}});var _f={};se(_f,{flagsForFuzzing:()=>Ly,statCommand:()=>My});function Df(t,e){let n=e?"d":"-",r=[t&256?"r":"-",t&128?"w":"-",t&64?"x":"-",t&32?"r":"-",t&16?"w":"-",t&8?"x":"-",t&4?"r":"-",t&2?"w":"-",t&1?"x":"-"];return n+r.join("")}var Dy,_y,My,Ly,Mf=I(()=>{"use strict";nt();F();he();Dy={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},_y={format:{short:"c",type:"string"}},My={name:"stat",async execute(t,e){let n=W(t);if(Z(n))return q(Dy);let r=ke("stat",n,_y);if(!r.ok)return r.error;let s=r.result.flags.format??null,i=r.result.positional;if(i.length===0)return{stdout:y,stderr:x(`stat: missing operand
148
+ `),exitCode:1};let o="",a="",l=!1;for(let c of i){let u=e.fs.resolvePath(e.cwd,c);try{let f=await e.fs.stat(u);if(s){let p=s,h=f.mode.toString(8),m=Df(f.mode,f.isDirectory);p=p.replace(/%n/g,c),p=p.replace(/%N/g,`'${c}'`),p=p.replace(/%s/g,String(f.size)),p=p.replace(/%F/g,f.isDirectory?"directory":"regular file"),p=p.replace(/%a/g,h),p=p.replace(/%A/g,m),p=p.replace(/%u/g,"1000"),p=p.replace(/%U/g,"user"),p=p.replace(/%g/g,"1000"),p=p.replace(/%G/g,"group"),o+=`${p}
149
+ `}else{let p=f.mode.toString(8).padStart(4,"0"),h=Df(f.mode,f.isDirectory);o+=` File: ${c}
150
+ `,o+=` Size: ${f.size} Blocks: ${Math.ceil(f.size/512)}
151
+ `,o+=`Access: (${p}/${h})
152
+ `,o+=`Modify: ${f.mtime.toISOString()}
153
+ `}}catch{a+=`stat: cannot stat '${c}': No such file or directory
154
+ `,l=!0}}return{stdout:x(o),stderr:x(a),exitCode:l?1:0}}};Ly={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0}});var ie,U,k,tn,Ae,$e,n1,Un,hi,aa,Pr,$r,ze,la,un,ca,ua,xn,fa,pa,Je,ve,ha,di,gs,z,da,Rr,ma,ga,Pe,Lf,Ff,Uf,Bf,Wf,zf,Hf,jf,Gf,Vf,qf,Zf,Yf,Qf,Kf,Xf,Jf,e1,t1,bn,ys,ya,wa,ba,xa,Ea,Bn,r1=I(()=>{ie=class t{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static MATCH_NL=t.CLASS_NL|t.DOT_NL;static PERL=t.CLASS_NL|t.ONE_LINE|t.PERL_X|t.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2},U=class{static CODES=new Map([["\x07",7],["\b",8],[" ",9],[`
155
+ `,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(e){let n=String.fromCodePoint(e).toUpperCase();if(n.length>1)return e;let r=String.fromCodePoint(n.codePointAt(0)).toLowerCase();return r.length>1||r.codePointAt(0)!==e?e:n.codePointAt(0)}static toLowerCase(e){let n=String.fromCodePoint(e).toLowerCase();if(n.length>1)return e;let r=String.fromCodePoint(n.codePointAt(0)).toUpperCase();return r.length>1||r.codePointAt(0)!==e?e:n.codePointAt(0)}},k=class{SIZE=3;constructor(e){this.data=e}getLo(e){return this.data[e*this.SIZE]}getHi(e){return this.data[e*this.SIZE+1]}getStride(e){return this.data[e*this.SIZE+2]}get(e){let n=e*this.SIZE;return[this.data[n],this.data[n+1],this.data[n+2]]}get length(){return this.data.length/this.SIZE}},tn=class t{static CASE_ORBIT=new Map([[75,107],[107,8490],[8490,75],[83,115],[115,383],[383,83],[181,924],[924,956],[956,181],[197,229],[229,8491],[8491,197],[452,453],[453,454],[454,452],[455,456],[456,457],[457,455],[458,459],[459,460],[460,458],[497,498],[498,499],[499,497],[837,921],[921,953],[953,8126],[8126,837],[914,946],[946,976],[976,914],[917,949],[949,1013],[1013,917],[920,952],[952,977],[977,1012],[1012,920],[922,954],[954,1008],[1008,922],[928,960],[960,982],[982,928],[929,961],[961,1009],[1009,929],[931,962],[962,963],[963,931],[934,966],[966,981],[981,934],[937,969],[969,8486],[8486,937],[1042,1074],[1074,7296],[7296,1042],[1044,1076],[1076,7297],[7297,1044],[1054,1086],[1086,7298],[7298,1054],[1057,1089],[1089,7299],[7299,1057],[1058,1090],[1090,7300],[7300,7301],[7301,1058],[1066,1098],[1098,7302],[7302,1066],[1122,1123],[1123,7303],[7303,1122],[7304,42570],[42570,42571],[42571,7304],[7776,7777],[7777,7835],[7835,7776],[223,7838],[7838,223],[8064,8072],[8072,8064],[8065,8073],[8073,8065],[8066,8074],[8074,8066],[8067,8075],[8075,8067],[8068,8076],[8076,8068],[8069,8077],[8077,8069],[8070,8078],[8078,8070],[8071,8079],[8079,8071],[8080,8088],[8088,8080],[8081,8089],[8089,8081],[8082,8090],[8090,8082],[8083,8091],[8091,8083],[8084,8092],[8092,8084],[8085,8093],[8093,8085],[8086,8094],[8094,8086],[8087,8095],[8095,8087],[8096,8104],[8104,8096],[8097,8105],[8105,8097],[8098,8106],[8106,8098],[8099,8107],[8107,8099],[8100,8108],[8108,8100],[8101,8109],[8109,8101],[8102,8110],[8110,8102],[8103,8111],[8111,8103],[8115,8124],[8124,8115],[8131,8140],[8140,8131],[912,8147],[8147,912],[944,8163],[8163,944],[8179,8188],[8188,8179],[64261,64262],[64262,64261],[66560,66600],[66600,66560],[66561,66601],[66601,66561],[66562,66602],[66602,66562],[66563,66603],[66603,66563],[66564,66604],[66604,66564],[66565,66605],[66605,66565],[66566,66606],[66606,66566],[66567,66607],[66607,66567],[66568,66608],[66608,66568],[66569,66609],[66609,66569],[66570,66610],[66610,66570],[66571,66611],[66611,66571],[66572,66612],[66612,66572],[66573,66613],[66613,66573],[66574,66614],[66614,66574],[66575,66615],[66615,66575],[66576,66616],[66616,66576],[66577,66617],[66617,66577],[66578,66618],[66618,66578],[66579,66619],[66619,66579],[66580,66620],[66620,66580],[66581,66621],[66621,66581],[66582,66622],[66622,66582],[66583,66623],[66623,66583],[66584,66624],[66624,66584],[66585,66625],[66625,66585],[66586,66626],[66626,66586],[66587,66627],[66627,66587],[66588,66628],[66628,66588],[66589,66629],[66629,66589],[66590,66630],[66630,66590],[66591,66631],[66631,66591],[66592,66632],[66632,66592],[66593,66633],[66633,66593],[66594,66634],[66634,66594],[66595,66635],[66635,66595],[66596,66636],[66636,66596],[66597,66637],[66637,66597],[66598,66638],[66638,66598],[66599,66639],[66639,66599],[66736,66776],[66776,66736],[66737,66777],[66777,66737],[66738,66778],[66778,66738],[66739,66779],[66779,66739],[66740,66780],[66780,66740],[66741,66781],[66781,66741],[66742,66782],[66782,66742],[66743,66783],[66783,66743],[66744,66784],[66784,66744],[66745,66785],[66785,66745],[66746,66786],[66786,66746],[66747,66787],[66787,66747],[66748,66788],[66788,66748],[66749,66789],[66789,66749],[66750,66790],[66790,66750],[66751,66791],[66791,66751],[66752,66792],[66792,66752],[66753,66793],[66793,66753],[66754,66794],[66794,66754],[66755,66795],[66795,66755],[66756,66796],[66796,66756],[66757,66797],[66797,66757],[66758,66798],[66798,66758],[66759,66799],[66799,66759],[66760,66800],[66800,66760],[66761,66801],[66801,66761],[66762,66802],[66802,66762],[66763,66803],[66803,66763],[66764,66804],[66804,66764],[66765,66805],[66805,66765],[66766,66806],[66806,66766],[66767,66807],[66807,66767],[66768,66808],[66808,66768],[66769,66809],[66809,66769],[66770,66810],[66810,66770],[66771,66811],[66811,66771],[66928,66967],[66967,66928],[66929,66968],[66968,66929],[66930,66969],[66969,66930],[66931,66970],[66970,66931],[66932,66971],[66971,66932],[66933,66972],[66972,66933],[66934,66973],[66973,66934],[66935,66974],[66974,66935],[66936,66975],[66975,66936],[66937,66976],[66976,66937],[66938,66977],[66977,66938],[66940,66979],[66979,66940],[66941,66980],[66980,66941],[66942,66981],[66981,66942],[66943,66982],[66982,66943],[66944,66983],[66983,66944],[66945,66984],[66984,66945],[66946,66985],[66985,66946],[66947,66986],[66986,66947],[66948,66987],[66987,66948],[66949,66988],[66988,66949],[66950,66989],[66989,66950],[66951,66990],[66990,66951],[66952,66991],[66991,66952],[66953,66992],[66992,66953],[66954,66993],[66993,66954],[66956,66995],[66995,66956],[66957,66996],[66996,66957],[66958,66997],[66997,66958],[66959,66998],[66998,66959],[66960,66999],[66999,66960],[66961,67e3],[67e3,66961],[66962,67001],[67001,66962],[66964,67003],[67003,66964],[66965,67004],[67004,66965],[68736,68800],[68800,68736],[68737,68801],[68801,68737],[68738,68802],[68802,68738],[68739,68803],[68803,68739],[68740,68804],[68804,68740],[68741,68805],[68805,68741],[68742,68806],[68806,68742],[68743,68807],[68807,68743],[68744,68808],[68808,68744],[68745,68809],[68809,68745],[68746,68810],[68810,68746],[68747,68811],[68811,68747],[68748,68812],[68812,68748],[68749,68813],[68813,68749],[68750,68814],[68814,68750],[68751,68815],[68815,68751],[68752,68816],[68816,68752],[68753,68817],[68817,68753],[68754,68818],[68818,68754],[68755,68819],[68819,68755],[68756,68820],[68820,68756],[68757,68821],[68821,68757],[68758,68822],[68822,68758],[68759,68823],[68823,68759],[68760,68824],[68824,68760],[68761,68825],[68825,68761],[68762,68826],[68826,68762],[68763,68827],[68827,68763],[68764,68828],[68828,68764],[68765,68829],[68829,68765],[68766,68830],[68830,68766],[68767,68831],[68831,68767],[68768,68832],[68832,68768],[68769,68833],[68833,68769],[68770,68834],[68834,68770],[68771,68835],[68835,68771],[68772,68836],[68836,68772],[68773,68837],[68837,68773],[68774,68838],[68838,68774],[68775,68839],[68839,68775],[68776,68840],[68840,68776],[68777,68841],[68841,68777],[68778,68842],[68842,68778],[68779,68843],[68843,68779],[68780,68844],[68844,68780],[68781,68845],[68845,68781],[68782,68846],[68846,68782],[68783,68847],[68847,68783],[68784,68848],[68848,68784],[68785,68849],[68849,68785],[68786,68850],[68850,68786],[68944,68976],[68976,68944],[68945,68977],[68977,68945],[68946,68978],[68978,68946],[68947,68979],[68979,68947],[68948,68980],[68980,68948],[68949,68981],[68981,68949],[68950,68982],[68982,68950],[68951,68983],[68983,68951],[68952,68984],[68984,68952],[68953,68985],[68985,68953],[68954,68986],[68986,68954],[68955,68987],[68987,68955],[68956,68988],[68988,68956],[68957,68989],[68989,68957],[68958,68990],[68990,68958],[68959,68991],[68991,68959],[68960,68992],[68992,68960],[68961,68993],[68993,68961],[68962,68994],[68994,68962],[68963,68995],[68995,68963],[68964,68996],[68996,68964],[68965,68997],[68997,68965],[71840,71872],[71872,71840],[71841,71873],[71873,71841],[71842,71874],[71874,71842],[71843,71875],[71875,71843],[71844,71876],[71876,71844],[71845,71877],[71877,71845],[71846,71878],[71878,71846],[71847,71879],[71879,71847],[71848,71880],[71880,71848],[71849,71881],[71881,71849],[71850,71882],[71882,71850],[71851,71883],[71883,71851],[71852,71884],[71884,71852],[71853,71885],[71885,71853],[71854,71886],[71886,71854],[71855,71887],[71887,71855],[71856,71888],[71888,71856],[71857,71889],[71889,71857],[71858,71890],[71890,71858],[71859,71891],[71891,71859],[71860,71892],[71892,71860],[71861,71893],[71893,71861],[71862,71894],[71894,71862],[71863,71895],[71895,71863],[71864,71896],[71896,71864],[71865,71897],[71897,71865],[71866,71898],[71898,71866],[71867,71899],[71899,71867],[71868,71900],[71900,71868],[71869,71901],[71901,71869],[71870,71902],[71902,71870],[71871,71903],[71903,71871],[93760,93792],[93792,93760],[93761,93793],[93793,93761],[93762,93794],[93794,93762],[93763,93795],[93795,93763],[93764,93796],[93796,93764],[93765,93797],[93797,93765],[93766,93798],[93798,93766],[93767,93799],[93799,93767],[93768,93800],[93800,93768],[93769,93801],[93801,93769],[93770,93802],[93802,93770],[93771,93803],[93803,93771],[93772,93804],[93804,93772],[93773,93805],[93805,93773],[93774,93806],[93806,93774],[93775,93807],[93807,93775],[93776,93808],[93808,93776],[93777,93809],[93809,93777],[93778,93810],[93810,93778],[93779,93811],[93811,93779],[93780,93812],[93812,93780],[93781,93813],[93813,93781],[93782,93814],[93814,93782],[93783,93815],[93815,93783],[93784,93816],[93816,93784],[93785,93817],[93817,93785],[93786,93818],[93818,93786],[93787,93819],[93819,93787],[93788,93820],[93820,93788],[93789,93821],[93821,93789],[93790,93822],[93822,93790],[93791,93823],[93823,93791],[125184,125218],[125218,125184],[125185,125219],[125219,125185],[125186,125220],[125220,125186],[125187,125221],[125221,125187],[125188,125222],[125222,125188],[125189,125223],[125223,125189],[125190,125224],[125224,125190],[125191,125225],[125225,125191],[125192,125226],[125226,125192],[125193,125227],[125227,125193],[125194,125228],[125228,125194],[125195,125229],[125229,125195],[125196,125230],[125230,125196],[125197,125231],[125231,125197],[125198,125232],[125232,125198],[125199,125233],[125233,125199],[125200,125234],[125234,125200],[125201,125235],[125235,125201],[125202,125236],[125236,125202],[125203,125237],[125237,125203],[125204,125238],[125238,125204],[125205,125239],[125239,125205],[125206,125240],[125240,125206],[125207,125241],[125241,125207],[125208,125242],[125242,125208],[125209,125243],[125243,125209],[125210,125244],[125244,125210],[125211,125245],[125245,125211],[125212,125246],[125246,125212],[125213,125247],[125247,125213],[125214,125248],[125248,125214],[125215,125249],[125249,125215],[125216,125250],[125250,125216],[125217,125251],[125251,125217]]);static C=new k(new Uint32Array([0,31,1,127,159,1,173,888,715,889,896,7,897,899,1,907,909,2,930,1328,398,1367,1368,1,1419,1420,1,1424,1480,56,1481,1487,1,1515,1518,1,1525,1541,1,1564,1757,193,1806,1807,1,1867,1868,1,1970,1983,1,2043,2044,1,2094,2095,1,2111,2140,29,2141,2143,2,2155,2159,1,2191,2198,1,2274,2436,162,2445,2446,1,2449,2450,1,2473,2481,8,2483,2485,1,2490,2491,1,2501,2502,1,2505,2506,1,2511,2518,1,2520,2523,1,2526,2532,6,2533,2559,26,2560,2564,4,2571,2574,1,2577,2578,1,2601,2609,8,2612,2618,3,2619,2621,2,2627,2630,1,2633,2634,1,2638,2640,1,2642,2648,1,2653,2655,2,2656,2661,1,2679,2688,1,2692,2702,10,2706,2729,23,2737,2740,3,2746,2747,1,2758,2766,4,2767,2769,2,2770,2783,1,2788,2789,1,2802,2808,1,2816,2820,4,2829,2830,1,2833,2834,1,2857,2865,8,2868,2874,6,2875,2885,10,2886,2889,3,2890,2894,4,2895,2900,1,2904,2907,1,2910,2916,6,2917,2936,19,2937,2945,1,2948,2955,7,2956,2957,1,2961,2966,5,2967,2968,1,2971,2973,2,2976,2978,1,2981,2983,1,2987,2989,1,3002,3005,1,3011,3013,1,3017,3022,5,3023,3025,2,3026,3030,1,3032,3045,1,3067,3071,1,3085,3089,4,3113,3130,17,3131,3141,10,3145,3150,5,3151,3156,1,3159,3163,4,3164,3166,2,3167,3172,5,3173,3184,11,3185,3190,1,3213,3217,4,3241,3252,11,3258,3259,1,3269,3273,4,3278,3284,1,3287,3292,1,3295,3300,5,3301,3312,11,3316,3327,1,3341,3345,4,3397,3401,4,3408,3411,1,3428,3429,1,3456,3460,4,3479,3481,1,3506,3516,10,3518,3519,1,3527,3529,1,3531,3534,1,3541,3543,2,3552,3557,1,3568,3569,1,3573,3584,1,3643,3646,1,3676,3712,1,3715,3717,2,3723,3748,25,3750,3774,24,3775,3781,6,3783,3791,8,3802,3803,1,3808,3839,1,3912,3949,37,3950,3952,1,3992,4029,37,4045,4059,14,4060,4095,1,4294,4296,2,4297,4300,1,4302,4303,1,4681,4686,5,4687,4695,8,4697,4702,5,4703,4745,42,4750,4751,1,4785,4790,5,4791,4799,8,4801,4806,5,4807,4823,16,4881,4886,5,4887,4955,68,4956,4989,33,4990,4991,1,5018,5023,1,5110,5111,1,5118,5119,1,5789,5791,1,5881,5887,1,5910,5918,1,5943,5951,1,5972,5983,1,5997,6001,4,6004,6015,1,6110,6111,1,6122,6127,1,6138,6143,1,6158,6170,12,6171,6175,1,6265,6271,1,6315,6319,1,6390,6399,1,6431,6444,13,6445,6447,1,6460,6463,1,6465,6467,1,6510,6511,1,6517,6527,1,6572,6575,1,6602,6607,1,6619,6621,1,6684,6685,1,6751,6781,30,6782,6794,12,6795,6799,1,6810,6815,1,6830,6831,1,6863,6911,1,6989,7156,167,7157,7163,1,7224,7226,1,7242,7244,1,7307,7311,1,7355,7356,1,7368,7375,1,7419,7423,1,7958,7959,1,7966,7967,1,8006,8007,1,8014,8015,1,8024,8030,2,8062,8063,1,8117,8133,16,8148,8149,1,8156,8176,20,8177,8181,4,8191,8203,12,8204,8207,1,8234,8238,1,8288,8303,1,8306,8307,1,8335,8349,14,8350,8351,1,8385,8399,1,8433,8447,1,8588,8591,1,9258,9279,1,9291,9311,1,11124,11125,1,11158,11508,350,11509,11512,1,11558,11560,2,11561,11564,1,11566,11567,1,11624,11630,1,11633,11646,1,11671,11679,1,11687,11743,8,11870,11903,1,11930,12020,90,12021,12031,1,12246,12271,1,12352,12439,87,12440,12544,104,12545,12548,1,12592,12687,95,12774,12782,1,12831,42125,29294,42126,42127,1,42183,42191,1,42540,42559,1,42744,42751,1,42958,42959,1,42962,42964,2,42973,42993,1,43053,43055,1,43066,43071,1,43128,43135,1,43206,43213,1,43226,43231,1,43348,43358,1,43389,43391,1,43470,43482,12,43483,43485,1,43519,43575,56,43576,43583,1,43598,43599,1,43610,43611,1,43715,43738,1,43767,43776,1,43783,43784,1,43791,43792,1,43799,43807,1,43815,43823,8,43884,43887,1,44014,44015,1,44026,44031,1,55204,55215,1,55239,55242,1,55292,63743,1,64110,64111,1,64218,64255,1,64263,64274,1,64280,64284,1,64311,64317,6,64319,64325,3,64451,64466,1,64912,64913,1,64968,64974,1,64976,65007,1,65050,65055,1,65107,65127,20,65132,65135,1,65141,65277,136,65278,65280,1,65471,65473,1,65480,65481,1,65488,65489,1,65496,65497,1,65501,65503,1,65511,65519,8,65520,65531,1,65534,65535,1,65548,65575,27,65595,65598,3,65614,65615,1,65630,65663,1,65787,65791,1,65795,65798,1,65844,65846,1,65935,65949,14,65950,65951,1,65953,65999,1,66046,66175,1,66205,66207,1,66257,66271,1,66300,66303,1,66340,66348,1,66379,66383,1,66427,66431,1,66462,66500,38,66501,66503,1,66518,66559,1,66718,66719,1,66730,66735,1,66772,66775,1,66812,66815,1,66856,66863,1,66916,66926,1,66939,66955,16,66963,66966,3,66978,66994,16,67002,67005,3,67006,67007,1,67060,67071,1,67383,67391,1,67414,67423,1,67432,67455,1,67462,67505,43,67515,67583,1,67590,67591,1,67593,67638,45,67641,67643,1,67645,67646,1,67670,67743,73,67744,67750,1,67760,67807,1,67827,67830,3,67831,67834,1,67868,67870,1,67898,67902,1,67904,67967,1,68024,68027,1,68048,68049,1,68100,68103,3,68104,68107,1,68116,68120,4,68150,68151,1,68155,68158,1,68169,68175,1,68185,68191,1,68256,68287,1,68327,68330,1,68343,68351,1,68406,68408,1,68438,68439,1,68467,68471,1,68498,68504,1,68509,68520,1,68528,68607,1,68681,68735,1,68787,68799,1,68851,68857,1,68904,68911,1,68922,68927,1,68966,68968,1,68998,69005,1,69008,69215,1,69247,69290,43,69294,69295,1,69298,69313,1,69317,69371,1,69416,69423,1,69466,69487,1,69514,69551,1,69580,69599,1,69623,69631,1,69710,69713,1,69750,69758,1,69821,69827,6,69828,69839,1,69865,69871,1,69882,69887,1,69941,69960,19,69961,69967,1,70007,70015,1,70112,70133,21,70134,70143,1,70162,70210,48,70211,70271,1,70279,70281,2,70286,70302,16,70314,70319,1,70379,70383,1,70394,70399,1,70404,70413,9,70414,70417,3,70418,70441,23,70449,70452,3,70458,70469,11,70470,70473,3,70474,70478,4,70479,70481,2,70482,70486,1,70488,70492,1,70500,70501,1,70509,70511,1,70517,70527,1,70538,70540,2,70541,70543,2,70582,70593,11,70595,70596,1,70598,70603,5,70614,70617,3,70618,70624,1,70627,70655,1,70748,70754,6,70755,70783,1,70856,70863,1,70874,71039,1,71094,71095,1,71134,71167,1,71237,71247,1,71258,71263,1,71277,71295,1,71354,71359,1,71370,71375,1,71396,71423,1,71451,71452,1,71468,71471,1,71495,71679,1,71740,71839,1,71923,71934,1,71943,71944,1,71946,71947,1,71956,71959,3,71990,71993,3,71994,72007,13,72008,72015,1,72026,72095,1,72104,72105,1,72152,72153,1,72165,72191,1,72264,72271,1,72355,72367,1,72441,72447,1,72458,72639,1,72674,72687,1,72698,72703,1,72713,72759,46,72774,72783,1,72813,72815,1,72848,72849,1,72872,72887,15,72888,72959,1,72967,72970,3,73015,73017,1,73019,73022,3,73032,73039,1,73050,73055,1,73062,73065,3,73103,73106,3,73113,73119,1,73130,73439,1,73465,73471,1,73489,73531,42,73532,73533,1,73563,73647,1,73649,73663,1,73714,73726,1,74650,74751,1,74863,74869,6,74870,74879,1,75076,77711,1,77811,77823,1,78896,78911,1,78934,78943,1,82939,82943,1,83527,90367,1,90426,92159,1,92729,92735,1,92767,92778,11,92779,92781,1,92863,92874,11,92875,92879,1,92910,92911,1,92918,92927,1,92998,93007,1,93018,93026,8,93048,93052,1,93072,93503,1,93562,93759,1,93851,93951,1,94027,94030,1,94088,94094,1,94112,94175,1,94181,94191,1,94194,94207,1,100344,100351,1,101590,101630,1,101641,110575,1,110580,110588,8,110591,110883,292,110884,110897,1,110899,110927,1,110931,110932,1,110934,110947,1,110952,110959,1,111356,113663,1,113771,113775,1,113789,113791,1,113801,113807,1,113818,113819,1,113824,117759,1,118010,118015,1,118452,118527,1,118574,118575,1,118599,118607,1,118724,118783,1,119030,119039,1,119079,119080,1,119155,119162,1,119275,119295,1,119366,119487,1,119508,119519,1,119540,119551,1,119639,119647,1,119673,119807,1,119893,119965,72,119968,119969,1,119971,119972,1,119975,119976,1,119981,119994,13,119996,120004,8,120070,120075,5,120076,120085,9,120093,120122,29,120127,120133,6,120135,120137,1,120145,120486,341,120487,120780,293,120781,121484,703,121485,121498,1,121504,121520,16,121521,122623,1,122655,122660,1,122667,122879,1,122887,122905,18,122906,122914,8,122917,122923,6,122924,122927,1,122990,123022,1,123024,123135,1,123181,123183,1,123198,123199,1,123210,123213,1,123216,123535,1,123567,123583,1,123642,123646,1,123648,124111,1,124154,124367,1,124411,124414,1,124416,124895,1,124903,124908,5,124911,124927,16,125125,125126,1,125143,125183,1,125260,125263,1,125274,125277,1,125280,126064,1,126133,126208,1,126270,126463,1,126468,126496,28,126499,126501,2,126502,126504,2,126515,126520,5,126522,126524,2,126525,126529,1,126531,126534,1,126536,126540,2,126544,126547,3,126549,126550,1,126552,126560,2,126563,126565,2,126566,126571,5,126579,126589,5,126591,126602,11,126620,126624,1,126628,126634,6,126652,126703,1,126706,126975,1,127020,127023,1,127124,127135,1,127151,127152,1,127168,127184,16,127222,127231,1,127406,127461,1,127491,127503,1,127548,127551,1,127561,127567,1,127570,127583,1,127590,127743,1,128728,128731,1,128749,128751,1,128765,128767,1,128887,128890,1,128986,128991,1,129004,129007,1,129009,129023,1,129036,129039,1,129096,129103,1,129114,129119,1,129160,129167,1,129198,129199,1,129212,129215,1,129218,129279,1,129620,129631,1,129646,129647,1,129661,129663,1,129674,129678,1,129735,129741,1,129757,129758,1,129770,129775,1,129785,129791,1,129939,130042,103,130043,131071,1,173792,173823,1,177978,177983,1,178206,178207,1,183970,183983,1,191457,191471,1,192094,194559,1,195102,196607,1,201547,201551,1,205744,917759,1,918e3,1114111,1]));static Cc=new k(new Uint32Array([0,31,1,127,159,1]));static Cf=new k(new Uint32Array([173,1536,1363,1537,1541,1,1564,1757,193,1807,2192,385,2193,2274,81,6158,8203,2045,8204,8207,1,8234,8238,1,8288,8292,1,8294,8303,1,65279,65529,250,65530,65531,1,69821,69837,16,78896,78911,1,113824,113827,1,119155,119162,1,917505,917536,31,917537,917631,1]));static Co=new k(new Uint32Array([57344,63743,1,983040,1048573,1,1048576,1114109,1]));static Cs=new k(new Uint32Array([55296,57343,1]));static L=new k(new Uint32Array([65,90,1,97,122,1,170,181,11,186,192,6,193,214,1,216,246,1,248,705,1,710,721,1,736,740,1,748,750,2,880,884,1,886,887,1,890,893,1,895,902,7,904,906,1,908,910,2,911,929,1,931,1013,1,1015,1153,1,1162,1327,1,1329,1366,1,1369,1376,7,1377,1416,1,1488,1514,1,1519,1522,1,1568,1610,1,1646,1647,1,1649,1747,1,1749,1765,16,1766,1774,8,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2036,2037,1,2042,2048,6,2049,2069,1,2074,2084,10,2088,2112,24,2113,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2249,1,2308,2361,1,2365,2384,19,2392,2401,1,2417,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3654,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3782,3804,22,3805,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4256,18,4257,4293,1,4295,4301,6,4304,4346,1,4348,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5024,5109,1,5112,5117,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6103,6108,5,6176,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6823,6917,94,6918,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7293,1,7296,7306,1,7312,7354,1,7357,7359,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,7424,6,7425,7615,1,7680,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8124,1,8126,8130,4,8131,8132,1,8134,8140,1,8144,8147,1,8150,8155,1,8160,8172,1,8178,8180,1,8182,8188,1,8305,8319,14,8336,8348,1,8450,8455,5,8458,8467,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8495,8505,1,8508,8511,1,8517,8521,1,8526,8579,53,8580,11264,2684,11265,11492,1,11499,11502,1,11506,11507,1,11520,11557,1,11559,11565,6,11568,11623,1,11631,11648,17,11649,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11823,12293,470,12294,12337,43,12338,12341,1,12347,12348,1,12353,12438,1,12445,12447,1,12449,12538,1,12540,12543,1,12549,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,42124,1,42192,42237,1,42240,42508,1,42512,42527,1,42538,42539,1,42560,42606,1,42623,42653,1,42656,42725,1,42775,42783,1,42786,42888,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43471,43488,17,43489,43492,1,43494,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43741,1,43744,43754,1,43762,43764,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43866,1,43868,43881,1,43888,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65313,65338,1,65345,65370,1,65382,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66560,66717,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68736,68786,1,68800,68850,1,68864,68899,1,68938,68965,1,68975,68997,1,69248,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71840,71903,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,92992,92995,1,93027,93047,1,93053,93071,1,93504,93548,1,93760,93823,1,93952,94026,1,94032,94099,67,94100,94111,1,94176,94177,1,94179,94208,29,94209,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120512,1,120514,120538,1,120540,120570,1,120572,120596,1,120598,120628,1,120630,120654,1,120656,120686,1,120688,120712,1,120714,120744,1,120746,120770,1,120772,120779,1,122624,122654,1,122661,122666,1,122928,122989,1,123136,123180,1,123191,123197,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124139,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125184,125251,1,125259,126464,1205,126465,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static foldL=new k(new Uint32Array([837,837,1]));static Ll=new k(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,311,2,312,328,2,329,375,2,378,382,2,383,384,1,387,389,2,392,396,4,397,402,5,405,409,4,410,411,1,414,417,3,419,421,2,424,426,2,427,429,2,432,436,4,438,441,3,442,445,3,446,447,1,454,460,3,462,476,2,477,495,2,496,499,3,501,505,4,507,563,2,564,569,1,572,575,3,576,578,2,583,591,2,592,659,1,661,687,1,881,883,2,887,891,4,892,893,1,912,940,28,941,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1020,1072,52,1073,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1376,1416,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7424,118,7425,7467,1,7531,7543,1,7545,7578,1,7681,7829,2,7830,7837,1,7839,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8016,8023,1,8032,8039,1,8048,8061,1,8064,8071,1,8080,8087,1,8096,8103,1,8112,8116,1,8118,8119,1,8126,8130,4,8131,8132,1,8134,8135,1,8144,8147,1,8150,8151,1,8160,8167,1,8178,8180,1,8182,8183,1,8458,8462,4,8463,8467,4,8495,8505,5,8508,8509,1,8518,8521,1,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11377,11379,2,11380,11382,2,11383,11387,1,11393,11491,2,11492,11500,8,11502,11507,5,11520,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42800,42801,1,42803,42865,2,42866,42872,1,42874,42876,2,42879,42887,2,42892,42894,2,42897,42899,2,42900,42901,1,42903,42921,2,42927,42933,6,42935,42947,2,42952,42954,2,42957,42961,4,42963,42971,2,42998,43002,4,43824,43866,1,43872,43880,1,43888,43967,1,64256,64262,1,64275,64279,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,119834,119859,1,119886,119892,1,119894,119911,1,119938,119963,1,119990,119993,1,119995,119997,2,119998,120003,1,120005,120015,1,120042,120067,1,120094,120119,1,120146,120171,1,120198,120223,1,120250,120275,1,120302,120327,1,120354,120379,1,120406,120431,1,120458,120485,1,120514,120538,1,120540,120545,1,120572,120596,1,120598,120603,1,120630,120654,1,120656,120661,1,120688,120712,1,120714,120719,1,120746,120770,1,120772,120777,1,120779,122624,1845,122625,122633,1,122635,122654,1,122661,122666,1,125218,125251,1]));static foldLl=new k(new Uint32Array([65,90,1,192,214,1,216,222,1,256,302,2,306,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,453,1,455,456,1,458,459,1,461,475,2,478,494,2,497,498,1,500,502,2,503,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,837,880,43,882,886,4,895,902,7,904,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,984,9,986,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8072,8079,1,8088,8095,1,8104,8111,1,8120,8124,1,8136,8140,1,8152,8155,1,8168,8172,1,8184,8188,1,8486,8490,4,8491,8498,7,8579,11264,2685,11265,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,125184,125217,1]));static Lm=new k(new Uint32Array([688,705,1,710,721,1,736,740,1,748,750,2,884,890,6,1369,1600,231,1765,1766,1,2036,2037,1,2042,2074,32,2084,2088,4,2249,2417,168,3654,3782,128,4348,6103,1755,6211,6823,612,7288,7293,1,7468,7530,1,7544,7579,35,7580,7615,1,8305,8319,14,8336,8348,1,11388,11389,1,11631,11823,192,12293,12337,44,12338,12341,1,12347,12445,98,12446,12540,94,12541,12542,1,40981,42232,1251,42233,42237,1,42508,42623,115,42652,42653,1,42775,42783,1,42864,42888,24,42994,42996,1,43e3,43001,1,43471,43494,23,43632,43741,109,43763,43764,1,43868,43871,1,43881,65392,21511,65438,65439,1,67456,67461,1,67463,67504,1,67506,67514,1,68942,68975,33,92992,92995,1,93504,93506,1,93547,93548,1,94099,94111,1,94176,94177,1,94179,110576,16397,110577,110579,1,110581,110587,1,110589,110590,1,122928,122989,1,123191,123197,1,124139,125259,1120]));static Lo=new k(new Uint32Array([170,186,16,443,448,5,449,451,1,660,1488,828,1489,1514,1,1519,1522,1,1568,1599,1,1601,1610,1,1646,1647,1,1649,1747,1,1749,1774,25,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2048,2069,1,2112,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2248,1,2308,2361,1,2365,2384,19,2392,2401,1,2418,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3653,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3804,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4352,114,4353,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6108,6176,68,6177,6210,1,6212,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6917,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7287,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,8501,1083,8502,8504,1,11568,11623,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,12294,12348,54,12353,12438,1,12447,12449,2,12450,12538,1,12543,12549,6,12550,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,40980,1,40982,42124,1,42192,42231,1,42240,42507,1,42512,42527,1,42538,42539,1,42606,42656,50,42657,42725,1,42895,42999,104,43003,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43488,43492,1,43495,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43631,1,43633,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43740,1,43744,43754,1,43762,43777,15,43778,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43968,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65382,65391,1,65393,65437,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66640,66717,1,66816,66855,1,66864,66915,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68864,68899,1,68938,68941,1,68943,69248,305,69249,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,93027,93047,1,93053,93071,1,93507,93546,1,93952,94026,1,94032,94208,176,94209,100343,1,100352,101589,1,101631,101640,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,122634,123136,502,123137,123180,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124138,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static Lt=new k(new Uint32Array([453,459,3,498,8072,7574,8073,8079,1,8088,8095,1,8104,8111,1,8124,8140,16,8188,8188,1]));static foldLt=new k(new Uint32Array([452,454,2,455,457,2,458,460,2,497,499,2,8064,8071,1,8080,8087,1,8096,8103,1,8115,8131,16,8179,8179,1]));static Lu=new k(new Uint32Array([65,90,1,192,214,1,216,222,1,256,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,461,3,463,475,2,478,494,2,497,500,3,502,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,880,882,2,886,895,9,902,904,2,905,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,978,3,979,980,1,984,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8120,8123,1,8136,8139,1,8152,8155,1,8168,8172,1,8184,8187,1,8450,8455,5,8459,8461,1,8464,8466,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8496,8499,1,8510,8511,1,8517,8579,62,11264,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,119808,119833,1,119860,119885,1,119912,119937,1,119964,119966,2,119967,119973,3,119974,119977,3,119978,119980,1,119982,119989,1,120016,120041,1,120068,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120120,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120172,120197,1,120224,120249,1,120276,120301,1,120328,120353,1,120380,120405,1,120432,120457,1,120488,120512,1,120546,120570,1,120604,120628,1,120662,120686,1,120720,120744,1,120778,125184,4406,125185,125217,1]));static Upper=this.Lu;static foldLu=new k(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,303,2,307,311,2,314,328,2,331,375,2,378,382,2,383,384,1,387,389,2,392,396,4,402,405,3,409,411,1,414,417,3,419,421,2,424,429,5,432,436,4,438,441,3,445,447,2,453,454,1,456,457,1,459,460,1,462,476,2,477,495,2,498,499,1,501,505,4,507,543,2,547,563,2,572,575,3,576,578,2,583,591,2,592,596,1,598,599,1,601,603,2,604,608,4,609,611,2,612,614,1,616,620,1,623,625,2,626,629,3,637,640,3,642,643,1,647,652,1,658,669,11,670,837,167,881,883,2,887,891,4,892,893,1,940,943,1,945,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1072,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1377,1414,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7545,239,7549,7566,17,7681,7829,2,7835,7841,6,7843,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8017,8023,2,8032,8039,1,8048,8061,1,8112,8113,1,8126,8144,18,8145,8160,15,8161,8165,4,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11379,11382,3,11393,11491,2,11500,11502,2,11507,11520,13,11521,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42803,42863,2,42874,42876,2,42879,42887,2,42892,42897,5,42899,42900,1,42903,42921,2,42933,42947,2,42952,42954,2,42957,42961,4,42967,42971,2,42998,43859,861,43888,43967,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,125218,125251,1]));static M=new k(new Uint32Array([768,879,1,1155,1161,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2307,1,2362,2364,1,2366,2383,1,2385,2391,1,2402,2403,1,2433,2435,1,2492,2494,2,2495,2500,1,2503,2504,1,2507,2509,1,2519,2530,11,2531,2558,27,2561,2563,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2672,31,2673,2677,4,2689,2691,1,2748,2750,2,2751,2757,1,2759,2761,1,2763,2765,1,2786,2787,1,2810,2815,1,2817,2819,1,2876,2878,2,2879,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2914,2915,1,2946,3006,60,3007,3010,1,3014,3016,1,3018,3021,1,3031,3072,41,3073,3076,1,3132,3134,2,3135,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3203,1,3260,3262,2,3263,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3298,3299,1,3315,3328,13,3329,3331,1,3387,3388,1,3390,3396,1,3398,3400,1,3402,3405,1,3415,3426,11,3427,3457,30,3458,3459,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3570,3571,1,3633,3636,3,3637,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3902,3903,1,3953,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4139,101,4140,4158,1,4182,4185,1,4190,4192,1,4194,4196,1,4199,4205,1,4209,4212,1,4226,4237,1,4239,4250,11,4251,4253,1,4957,4959,1,5906,5909,1,5938,5940,1,5970,5971,1,6002,6003,1,6068,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6443,1,6448,6459,1,6679,6683,1,6741,6750,1,6752,6780,1,6783,6832,49,6833,6862,1,6912,6916,1,6964,6980,1,7019,7027,1,7040,7042,1,7073,7085,1,7142,7155,1,7204,7223,1,7376,7378,1,7380,7400,1,7405,7412,7,7415,7417,1,7616,7679,1,8400,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12335,1,12441,12442,1,42607,42610,1,42612,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43043,24,43044,43047,1,43052,43136,84,43137,43188,51,43189,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43347,1,43392,43395,1,43443,43456,1,43493,43561,68,43562,43574,1,43587,43596,9,43597,43643,46,43644,43645,1,43696,43698,2,43699,43700,1,43703,43704,1,43710,43711,1,43713,43755,42,43756,43759,1,43765,43766,1,44003,44010,1,44012,44013,1,64286,65024,738,65025,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69632,69634,1,69688,69702,1,69744,69747,3,69748,69759,11,69760,69762,1,69808,69818,1,69826,69888,62,69889,69890,1,69927,69940,1,69957,69958,1,70003,70016,13,70017,70018,1,70067,70080,1,70089,70092,1,70094,70095,1,70188,70199,1,70206,70209,3,70367,70378,1,70400,70403,1,70459,70460,1,70462,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70502,3,70503,70508,1,70512,70516,1,70584,70592,1,70594,70597,3,70599,70602,1,70604,70608,1,70610,70625,15,70626,70709,83,70710,70726,1,70750,70832,82,70833,70851,1,71087,71093,1,71096,71104,1,71132,71133,1,71216,71232,1,71339,71351,1,71453,71467,1,71724,71738,1,71984,71989,1,71991,71992,1,71995,71998,1,72e3,72002,2,72003,72145,142,72146,72151,1,72154,72160,1,72164,72193,29,72194,72202,1,72243,72249,1,72251,72254,1,72263,72273,10,72274,72283,1,72330,72345,1,72751,72758,1,72760,72767,1,72850,72871,1,72873,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73098,67,73099,73102,1,73104,73105,1,73107,73111,1,73459,73462,1,73472,73473,1,73475,73524,49,73525,73530,1,73534,73538,1,73562,78912,5350,78919,78933,1,90398,90415,1,92912,92916,1,92976,92982,1,94031,94033,2,94034,94087,1,94095,94098,1,94180,94192,12,94193,113821,19628,113822,118528,4706,118529,118573,1,118576,118598,1,119141,119145,1,119149,119154,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]));static foldM=new k(new Uint32Array([921,953,32,8126,8126,1]));static Mc=new k(new Uint32Array([2307,2363,56,2366,2368,1,2377,2380,1,2382,2383,1,2434,2435,1,2494,2496,1,2503,2504,1,2507,2508,1,2519,2563,44,2622,2624,1,2691,2750,59,2751,2752,1,2761,2763,2,2764,2818,54,2819,2878,59,2880,2887,7,2888,2891,3,2892,2903,11,3006,3007,1,3009,3010,1,3014,3016,1,3018,3020,1,3031,3073,42,3074,3075,1,3137,3140,1,3202,3203,1,3262,3264,2,3265,3268,1,3271,3272,1,3274,3275,1,3285,3286,1,3315,3330,15,3331,3390,59,3391,3392,1,3398,3400,1,3402,3404,1,3415,3458,43,3459,3535,76,3536,3537,1,3544,3551,1,3570,3571,1,3902,3903,1,3967,4139,172,4140,4145,5,4152,4155,3,4156,4182,26,4183,4194,11,4195,4196,1,4199,4205,1,4227,4228,1,4231,4236,1,4239,4250,11,4251,4252,1,5909,5940,31,6070,6078,8,6079,6085,1,6087,6088,1,6435,6438,1,6441,6443,1,6448,6449,1,6451,6456,1,6681,6682,1,6741,6743,2,6753,6755,2,6756,6765,9,6766,6770,1,6916,6965,49,6971,6973,2,6974,6977,1,6979,6980,1,7042,7073,31,7078,7079,1,7082,7143,61,7146,7148,1,7150,7154,4,7155,7204,49,7205,7211,1,7220,7221,1,7393,7415,22,12334,12335,1,43043,43044,1,43047,43136,89,43137,43188,51,43189,43203,1,43346,43347,1,43395,43444,49,43445,43450,5,43451,43454,3,43455,43456,1,43567,43568,1,43571,43572,1,43597,43643,46,43645,43755,110,43758,43759,1,43765,44003,238,44004,44006,2,44007,44009,2,44010,44012,2,69632,69634,2,69762,69808,46,69809,69810,1,69815,69816,1,69932,69957,25,69958,70018,60,70067,70069,1,70079,70080,1,70094,70188,94,70189,70190,1,70194,70195,1,70197,70368,171,70369,70370,1,70402,70403,1,70462,70463,1,70465,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70584,85,70585,70586,1,70594,70597,3,70599,70602,1,70604,70605,1,70607,70709,102,70710,70711,1,70720,70721,1,70725,70832,107,70833,70834,1,70841,70843,2,70844,70846,1,70849,71087,238,71088,71089,1,71096,71099,1,71102,71216,114,71217,71218,1,71227,71228,1,71230,71340,110,71342,71343,1,71350,71454,104,71456,71457,1,71462,71724,262,71725,71726,1,71736,71984,248,71985,71989,1,71991,71992,1,71997,72e3,3,72002,72145,143,72146,72147,1,72156,72159,1,72164,72249,85,72279,72280,1,72343,72751,408,72766,72873,107,72881,72884,3,73098,73102,1,73107,73108,1,73110,73461,351,73462,73475,13,73524,73525,1,73534,73535,1,73537,90410,16873,90411,90412,1,94033,94087,1,94192,94193,1,119141,119142,1,119149,119154,1]));static Me=new k(new Uint32Array([1160,1161,1,6846,8413,1567,8414,8416,1,8418,8420,1,42608,42610,1]));static Mn=new k(new Uint32Array([768,879,1,1155,1159,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2306,1,2362,2364,2,2369,2376,1,2381,2385,4,2386,2391,1,2402,2403,1,2433,2492,59,2497,2500,1,2509,2530,21,2531,2558,27,2561,2562,1,2620,2625,5,2626,2631,5,2632,2635,3,2636,2637,1,2641,2672,31,2673,2677,4,2689,2690,1,2748,2753,5,2754,2757,1,2759,2760,1,2765,2786,21,2787,2810,23,2811,2815,1,2817,2876,59,2879,2881,2,2882,2884,1,2893,2901,8,2902,2914,12,2915,2946,31,3008,3021,13,3072,3076,4,3132,3134,2,3135,3136,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3260,59,3263,3270,7,3276,3277,1,3298,3299,1,3328,3329,1,3387,3388,1,3393,3396,1,3405,3426,21,3427,3457,30,3530,3538,8,3539,3540,1,3542,3633,91,3636,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3953,3966,1,3968,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4141,103,4142,4144,1,4146,4151,1,4153,4154,1,4157,4158,1,4184,4185,1,4190,4192,1,4209,4212,1,4226,4229,3,4230,4237,7,4253,4957,704,4958,4959,1,5906,5908,1,5938,5939,1,5970,5971,1,6002,6003,1,6068,6069,1,6071,6077,1,6086,6089,3,6090,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6434,1,6439,6440,1,6450,6457,7,6458,6459,1,6679,6680,1,6683,6742,59,6744,6750,1,6752,6754,2,6757,6764,1,6771,6780,1,6783,6832,49,6833,6845,1,6847,6862,1,6912,6915,1,6964,6966,2,6967,6970,1,6972,6978,6,7019,7027,1,7040,7041,1,7074,7077,1,7080,7081,1,7083,7085,1,7142,7144,2,7145,7149,4,7151,7153,1,7212,7219,1,7222,7223,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8400,8412,1,8417,8421,4,8422,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12333,1,12441,12442,1,42607,42612,5,42613,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43045,26,43046,43052,6,43204,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43345,1,43392,43394,1,43443,43446,3,43447,43449,1,43452,43453,1,43493,43561,68,43562,43566,1,43569,43570,1,43573,43574,1,43587,43596,9,43644,43696,52,43698,43700,1,43703,43704,1,43710,43711,1,43713,43756,43,43757,43766,9,44005,44008,3,44013,64286,20273,65024,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69633,69688,55,69689,69702,1,69744,69747,3,69748,69759,11,69760,69761,1,69811,69814,1,69817,69818,1,69826,69888,62,69889,69890,1,69927,69931,1,69933,69940,1,70003,70016,13,70017,70070,53,70071,70078,1,70089,70092,1,70095,70191,96,70192,70193,1,70196,70198,2,70199,70206,7,70209,70367,158,70371,70378,1,70400,70401,1,70459,70460,1,70464,70502,38,70503,70508,1,70512,70516,1,70587,70592,1,70606,70610,2,70625,70626,1,70712,70719,1,70722,70724,1,70726,70750,24,70835,70840,1,70842,70847,5,70848,70850,2,70851,71090,239,71091,71093,1,71100,71101,1,71103,71104,1,71132,71133,1,71219,71226,1,71229,71231,2,71232,71339,107,71341,71344,3,71345,71349,1,71351,71453,102,71455,71458,3,71459,71461,1,71463,71467,1,71727,71735,1,71737,71738,1,71995,71996,1,71998,72003,5,72148,72151,1,72154,72155,1,72160,72193,33,72194,72202,1,72243,72248,1,72251,72254,1,72263,72273,10,72274,72278,1,72281,72283,1,72330,72342,1,72344,72345,1,72752,72758,1,72760,72765,1,72767,72850,83,72851,72871,1,72874,72880,1,72882,72883,1,72885,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73104,73,73105,73109,4,73111,73459,348,73460,73472,12,73473,73526,53,73527,73530,1,73536,73538,2,73562,78912,5350,78919,78933,1,90398,90409,1,90413,90415,1,92912,92916,1,92976,92982,1,94031,94095,64,94096,94098,1,94180,113821,19641,113822,118528,4706,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]));static foldMn=new k(new Uint32Array([921,953,32,8126,8126,1]));static N=new k(new Uint32Array([48,57,1,178,179,1,185,188,3,189,190,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2548,2553,1,2662,2671,1,2790,2799,1,2918,2927,1,2930,2935,1,3046,3058,1,3174,3183,1,3192,3198,1,3302,3311,1,3416,3422,1,3430,3448,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3891,1,4160,4169,1,4240,4249,1,4969,4988,1,5870,5872,1,6112,6121,1,6128,6137,1,6160,6169,1,6470,6479,1,6608,6618,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,8304,8308,4,8309,8313,1,8320,8329,1,8528,8578,1,8581,8585,1,9312,9371,1,9450,9471,1,10102,10131,1,11517,12295,778,12321,12329,1,12344,12346,1,12690,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,42528,42537,1,42726,42735,1,43056,43061,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,65799,65843,1,65856,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,66369,66378,9,66513,66517,1,66720,66729,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,68912,68921,1,68928,68937,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70113,70132,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71483,1,71904,71922,1,72016,72025,1,72688,72697,1,72784,72812,1,73040,73049,1,73120,73129,1,73552,73561,1,73664,73684,1,74752,74862,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93019,93025,1,93552,93561,1,93824,93846,1,118e3,118009,1,119488,119507,1,119520,119539,1,119648,119672,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125127,125135,1,125264,125273,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1,130032,130041,1]));static Nd=new k(new Uint32Array([48,57,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2662,2671,1,2790,2799,1,2918,2927,1,3046,3055,1,3174,3183,1,3302,3311,1,3430,3439,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3881,1,4160,4169,1,4240,4249,1,6112,6121,1,6160,6169,1,6470,6479,1,6608,6617,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,42528,42537,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,66720,66729,1,68912,68921,1,68928,68937,1,69734,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71481,1,71904,71913,1,72016,72025,1,72688,72697,1,72784,72793,1,73040,73049,1,73120,73129,1,73552,73561,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93552,93561,1,118e3,118009,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125264,125273,1,130032,130041,1]));static Nl=new k(new Uint32Array([5870,5872,1,8544,8578,1,8581,8584,1,12295,12321,26,12322,12329,1,12344,12346,1,42726,42735,1,65856,65908,1,66369,66378,9,66513,66517,1,74752,74862,1]));static No=new k(new Uint32Array([178,179,1,185,188,3,189,190,1,2548,2553,1,2930,2935,1,3056,3058,1,3192,3198,1,3416,3422,1,3440,3448,1,3882,3891,1,4969,4988,1,6128,6137,1,6618,8304,1686,8308,8313,1,8320,8329,1,8528,8543,1,8585,9312,727,9313,9371,1,9450,9471,1,10102,10131,1,11517,12690,1173,12691,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,43056,43061,1,65799,65843,1,65909,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69733,1,70113,70132,1,71482,71483,1,71914,71922,1,72794,72812,1,73664,73684,1,93019,93025,1,93824,93846,1,119488,119507,1,119520,119539,1,119648,119672,1,125127,125135,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1]));static P=new k(new Uint32Array([33,35,1,37,42,1,44,47,1,58,59,1,63,64,1,91,93,1,95,123,28,125,161,36,167,171,4,182,183,1,187,191,4,894,903,9,1370,1375,1,1417,1418,1,1470,1472,2,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3898,38,3899,3901,1,3973,4048,75,4049,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5120,5742,622,5787,5788,1,5867,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8208,829,8209,8231,1,8240,8259,1,8261,8273,1,8275,8286,1,8317,8318,1,8333,8334,1,8968,8971,1,9001,9002,1,10088,10101,1,10181,10182,1,10214,10223,1,10627,10648,1,10712,10715,1,10748,10749,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11822,1,11824,11855,1,11858,11869,1,12289,12291,1,12296,12305,1,12308,12319,1,12336,12349,13,12448,12539,91,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,64830,20819,64831,65040,209,65041,65049,1,65072,65106,1,65108,65121,1,65123,65128,5,65130,65131,1,65281,65283,1,65285,65290,1,65292,65295,1,65306,65307,1,65311,65312,1,65339,65341,1,65343,65371,28,65373,65375,2,65376,65381,1,65792,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,68974,69293,319,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]));static Pc=new k(new Uint32Array([95,8255,8160,8256,8276,20,65075,65076,1,65101,65103,1,65343,65343,1]));static Pd=new k(new Uint32Array([45,1418,1373,1470,5120,3650,6150,8208,2058,8209,8213,1,11799,11802,3,11834,11835,1,11840,11869,29,12316,12336,20,12448,65073,52625,65074,65112,38,65123,65293,170,68974,69293,319]));static Pe=new k(new Uint32Array([41,93,52,125,3899,3774,3901,5788,1887,8262,8318,56,8334,8969,635,8971,9002,31,10089,10101,2,10182,10215,33,10217,10223,2,10628,10648,2,10713,10715,2,10749,11811,1062,11813,11817,2,11862,11868,2,12297,12305,2,12309,12315,2,12318,12319,1,64830,65048,218,65078,65092,2,65096,65114,18,65116,65118,2,65289,65341,52,65373,65379,3]));static Pf=new k(new Uint32Array([187,8217,8030,8221,8250,29,11779,11781,2,11786,11789,3,11805,11809,4]));static Pi=new k(new Uint32Array([171,8216,8045,8219,8220,1,8223,8249,26,11778,11780,2,11785,11788,3,11804,11808,4]));static Po=new k(new Uint32Array([33,35,1,37,39,1,42,46,2,47,58,11,59,63,4,64,92,28,161,167,6,182,183,1,191,894,703,903,1370,467,1371,1375,1,1417,1472,55,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3973,113,4048,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5742,5867,125,5868,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6149,1,6151,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8214,835,8215,8224,9,8225,8231,1,8240,8248,1,8251,8254,1,8257,8259,1,8263,8273,1,8275,8277,2,8278,8286,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11782,5,11783,11784,1,11787,11790,3,11791,11798,1,11800,11801,1,11803,11806,3,11807,11818,11,11819,11822,1,11824,11833,1,11836,11839,1,11841,11843,2,11844,11855,1,11858,11860,1,12289,12291,1,12349,12539,190,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,65040,21029,65041,65046,1,65049,65072,23,65093,65094,1,65097,65100,1,65104,65106,1,65108,65111,1,65119,65121,1,65128,65130,2,65131,65281,150,65282,65283,1,65285,65287,1,65290,65294,2,65295,65306,11,65307,65311,4,65312,65340,28,65377,65380,3,65381,65792,411,65793,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]));static Ps=new k(new Uint32Array([40,91,51,123,3898,3775,3900,5787,1887,8218,8222,4,8261,8317,56,8333,8968,635,8970,9001,31,10088,10100,2,10181,10214,33,10216,10222,2,10627,10647,2,10712,10714,2,10748,11810,1062,11812,11816,2,11842,11861,19,11863,11867,2,12296,12304,2,12308,12314,2,12317,64831,52514,65047,65077,30,65079,65091,2,65095,65113,18,65115,65117,2,65288,65339,51,65371,65375,4,65378,65378,1]));static S=new k(new Uint32Array([36,43,7,60,62,1,94,96,2,124,126,2,162,166,1,168,169,1,172,174,2,175,177,1,180,184,4,215,247,32,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,1014,113,1154,1421,267,1422,1423,1,1542,1544,1,1547,1550,3,1551,1758,207,1769,1789,20,1790,2038,248,2046,2047,1,2184,2546,362,2547,2554,7,2555,2801,246,2928,3059,131,3060,3066,1,3199,3407,208,3449,3647,198,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6107,366,6464,6622,158,6623,6655,1,7009,7018,1,7028,7036,1,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,8260,8274,14,8314,8316,1,8330,8332,1,8352,8384,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8472,1,8478,8483,1,8485,8489,2,8494,8506,12,8507,8512,5,8513,8516,1,8522,8525,1,8527,8586,59,8587,8592,5,8593,8967,1,8972,9e3,1,9003,9257,1,9280,9290,1,9372,9449,1,9472,10087,1,10132,10180,1,10183,10213,1,10224,10626,1,10649,10711,1,10716,10747,1,10750,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12443,12444,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,42752,42774,1,42784,42785,1,42889,42890,1,43048,43051,1,43062,43065,1,43639,43641,1,43867,43882,15,43883,64297,20414,64434,64450,1,64832,64847,1,64975,65020,45,65021,65023,1,65122,65124,2,65125,65126,1,65129,65284,155,65291,65308,17,65309,65310,1,65342,65344,2,65372,65374,2,65504,65510,1,65512,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,69006,710,69007,71487,2480,73685,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,123647,432,126124,126128,4,126254,126704,450,126705,126976,271,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]));static Sc=new k(new Uint32Array([36,162,126,163,165,1,1423,1547,124,2046,2047,1,2546,2547,1,2555,2801,246,3065,3647,582,6107,8352,2245,8353,8384,1,43064,65020,21956,65129,65284,155,65504,65505,1,65509,65510,1,73693,73696,1,123647,126128,2481]));static Sk=new k(new Uint32Array([94,96,2,168,175,7,180,184,4,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,2184,1283,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,12443,12444,1,42752,42774,1,42784,42785,1,42889,42890,1,43867,43882,15,43883,64434,20551,64435,64450,1,65342,65344,2,65507,127995,62488,127996,127999,1]));static Sm=new k(new Uint32Array([43,60,17,61,62,1,124,126,2,172,177,5,215,247,32,1014,1542,528,1543,1544,1,8260,8274,14,8314,8316,1,8330,8332,1,8472,8512,40,8513,8516,1,8523,8592,69,8593,8596,1,8602,8603,1,8608,8614,3,8622,8654,32,8655,8658,3,8660,8692,32,8693,8959,1,8992,8993,1,9084,9115,31,9116,9139,1,9180,9185,1,9655,9665,10,9720,9727,1,9839,10176,337,10177,10180,1,10183,10213,1,10224,10239,1,10496,10626,1,10649,10711,1,10716,10747,1,10750,11007,1,11056,11076,1,11079,11084,1,64297,65122,825,65124,65126,1,65291,65308,17,65309,65310,1,65372,65374,2,65506,65513,7,65514,65516,1,69006,69007,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,126704,126705,1]));static So=new k(new Uint32Array([166,169,3,174,176,2,1154,1421,267,1422,1550,128,1551,1758,207,1769,1789,20,1790,2038,248,2554,2928,374,3059,3064,1,3066,3199,133,3407,3449,42,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6464,723,6622,6655,1,7009,7018,1,7028,7036,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8478,7,8479,8483,1,8485,8489,2,8494,8506,12,8507,8522,15,8524,8525,1,8527,8586,59,8587,8597,10,8598,8601,1,8604,8607,1,8609,8610,1,8612,8613,1,8615,8621,1,8623,8653,1,8656,8657,1,8659,8661,2,8662,8691,1,8960,8967,1,8972,8991,1,8994,9e3,1,9003,9083,1,9085,9114,1,9140,9179,1,9186,9257,1,9280,9290,1,9372,9449,1,9472,9654,1,9656,9664,1,9666,9719,1,9728,9838,1,9840,10087,1,10132,10175,1,10240,10495,1,11008,11055,1,11077,11078,1,11085,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,43048,43051,1,43062,43063,1,43065,43639,574,43640,43641,1,64832,64847,1,64975,65021,46,65022,65023,1,65508,65512,4,65517,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,71487,3191,73685,73692,1,73697,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,126124,2909,126254,126976,722,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,127994,1,128e3,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]));static Z=new k(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8232,8233,1,8239,8287,48,12288,12288,1]));static Zl=new k(new Uint32Array([8232,8232,1]));static Zp=new k(new Uint32Array([8233,8233,1]));static Zs=new k(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8239,8287,48,12288,12288,1]));static Adlam=new k(new Uint32Array([125184,125259,1,125264,125273,1,125278,125279,1]));static Ahom=new k(new Uint32Array([71424,71450,1,71453,71467,1,71472,71494,1]));static Anatolian_Hieroglyphs=new k(new Uint32Array([82944,83526,1]));static Arabic=new k(new Uint32Array([1536,1540,1,1542,1547,1,1549,1562,1,1564,1566,1,1568,1599,1,1601,1610,1,1622,1647,1,1649,1756,1,1758,1791,1,1872,1919,1,2160,2190,1,2192,2193,1,2199,2273,1,2275,2303,1,64336,64450,1,64467,64829,1,64832,64911,1,64914,64967,1,64975,65008,33,65009,65023,1,65136,65140,1,65142,65276,1,69216,69246,1,69314,69316,1,69372,69375,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1]));static Armenian=new k(new Uint32Array([1329,1366,1,1369,1418,1,1421,1423,1,64275,64279,1]));static Avestan=new k(new Uint32Array([68352,68405,1,68409,68415,1]));static Balinese=new k(new Uint32Array([6912,6988,1,6990,7039,1]));static Bamum=new k(new Uint32Array([42656,42743,1,92160,92728,1]));static Bassa_Vah=new k(new Uint32Array([92880,92909,1,92912,92917,1]));static Batak=new k(new Uint32Array([7104,7155,1,7164,7167,1]));static Bengali=new k(new Uint32Array([2432,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1]));static Bhaiksuki=new k(new Uint32Array([72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1]));static Bopomofo=new k(new Uint32Array([746,747,1,12549,12591,1,12704,12735,1]));static Brahmi=new k(new Uint32Array([69632,69709,1,69714,69749,1,69759,69759,1]));static Braille=new k(new Uint32Array([10240,10495,1]));static Buginese=new k(new Uint32Array([6656,6683,1,6686,6687,1]));static Buhid=new k(new Uint32Array([5952,5971,1]));static Canadian_Aboriginal=new k(new Uint32Array([5120,5759,1,6320,6389,1,72368,72383,1]));static Carian=new k(new Uint32Array([66208,66256,1]));static Caucasian_Albanian=new k(new Uint32Array([66864,66915,1,66927,66927,1]));static Chakma=new k(new Uint32Array([69888,69940,1,69942,69959,1]));static Cham=new k(new Uint32Array([43520,43574,1,43584,43597,1,43600,43609,1,43612,43615,1]));static Cherokee=new k(new Uint32Array([5024,5109,1,5112,5117,1,43888,43967,1]));static Chorasmian=new k(new Uint32Array([69552,69579,1]));static Common=new k(new Uint32Array([0,64,1,91,96,1,123,169,1,171,185,1,187,191,1,215,247,32,697,735,1,741,745,1,748,767,1,884,894,10,901,903,2,1541,1548,7,1563,1567,4,1600,1757,157,2274,2404,130,2405,3647,1242,4053,4056,1,4347,5867,1520,5868,5869,1,5941,5942,1,6146,6147,1,6149,7379,1230,7393,7401,8,7402,7404,1,7406,7411,1,7413,7415,1,7418,8192,774,8193,8203,1,8206,8292,1,8294,8304,1,8308,8318,1,8320,8334,1,8352,8384,1,8448,8485,1,8487,8489,1,8492,8497,1,8499,8525,1,8527,8543,1,8585,8587,1,8592,9257,1,9280,9290,1,9312,10239,1,10496,11123,1,11126,11157,1,11159,11263,1,11776,11869,1,12272,12292,1,12294,12296,2,12297,12320,1,12336,12343,1,12348,12351,1,12443,12444,1,12448,12539,91,12540,12688,148,12689,12703,1,12736,12773,1,12783,12832,49,12833,12895,1,12927,13007,1,13055,13144,89,13145,13311,1,19904,19967,1,42752,42785,1,42888,42890,1,43056,43065,1,43310,43471,161,43867,43882,15,43883,64830,20947,64831,65040,209,65041,65049,1,65072,65106,1,65108,65126,1,65128,65131,1,65279,65281,2,65282,65312,1,65339,65344,1,65371,65381,1,65392,65438,46,65439,65504,65,65505,65510,1,65512,65518,1,65529,65533,1,65792,65794,1,65799,65843,1,65847,65855,1,65936,65948,1,66e3,66044,1,66273,66299,1,113824,113827,1,117760,118009,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119142,1,119146,119162,1,119171,119172,1,119180,119209,1,119214,119274,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,120831,1,126065,126132,1,126209,126269,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127487,1,127489,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,917505,917536,31,917537,917631,1]));static foldCommon=new k(new Uint32Array([924,956,32]));static Coptic=new k(new Uint32Array([994,1007,1,11392,11507,1,11513,11519,1]));static Cuneiform=new k(new Uint32Array([73728,74649,1,74752,74862,1,74864,74868,1,74880,75075,1]));static Cypriot=new k(new Uint32Array([67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3]));static Cypro_Minoan=new k(new Uint32Array([77712,77810,1]));static Cyrillic=new k(new Uint32Array([1024,1156,1,1159,1327,1,7296,7306,1,7467,7544,77,11744,11775,1,42560,42655,1,65070,65071,1,122928,122989,1,123023,123023,1]));static Deseret=new k(new Uint32Array([66560,66639,1]));static Devanagari=new k(new Uint32Array([2304,2384,1,2389,2403,1,2406,2431,1,43232,43263,1,72448,72457,1]));static Dives_Akuru=new k(new Uint32Array([71936,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1]));static Dogra=new k(new Uint32Array([71680,71739,1]));static Duployan=new k(new Uint32Array([113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1]));static Egyptian_Hieroglyphs=new k(new Uint32Array([77824,78933,1,78944,82938,1]));static Elbasan=new k(new Uint32Array([66816,66855,1]));static Elymaic=new k(new Uint32Array([69600,69622,1]));static Ethiopic=new k(new Uint32Array([4608,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,124896,124902,1,124904,124907,1,124909,124910,1,124912,124926,1]));static Garay=new k(new Uint32Array([68928,68965,1,68969,68997,1,69006,69007,1]));static Georgian=new k(new Uint32Array([4256,4293,1,4295,4301,6,4304,4346,1,4348,4351,1,7312,7354,1,7357,7359,1,11520,11557,1,11559,11565,6]));static Glagolitic=new k(new Uint32Array([11264,11359,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1]));static Gothic=new k(new Uint32Array([66352,66378,1]));static Grantha=new k(new Uint32Array([70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70460,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1]));static Greek=new k(new Uint32Array([880,883,1,885,887,1,890,893,1,895,900,5,902,904,2,905,906,1,908,910,2,911,929,1,931,993,1,1008,1023,1,7462,7466,1,7517,7521,1,7526,7530,1,7615,7936,321,7937,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8486,43877,35391,65856,65934,1,65952,119296,53344,119297,119365,1]));static foldGreek=new k(new Uint32Array([181,837,656]));static Gujarati=new k(new Uint32Array([2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1]));static Gunjala_Gondi=new k(new Uint32Array([73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1]));static Gurmukhi=new k(new Uint32Array([2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1]));static Gurung_Khema=new k(new Uint32Array([90368,90425,1]));static Han=new k(new Uint32Array([11904,11929,1,11931,12019,1,12032,12245,1,12293,12295,2,12321,12329,1,12344,12347,1,13312,19903,1,19968,40959,1,63744,64109,1,64112,64217,1,94178,94179,1,94192,94193,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static Hangul=new k(new Uint32Array([4352,4607,1,12334,12335,1,12593,12686,1,12800,12830,1,12896,12926,1,43360,43388,1,44032,55203,1,55216,55238,1,55243,55291,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1]));static Hanifi_Rohingya=new k(new Uint32Array([68864,68903,1,68912,68921,1]));static Hanunoo=new k(new Uint32Array([5920,5940,1]));static Hatran=new k(new Uint32Array([67808,67826,1,67828,67829,1,67835,67839,1]));static Hebrew=new k(new Uint32Array([1425,1479,1,1488,1514,1,1519,1524,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64335,1]));static Hiragana=new k(new Uint32Array([12353,12438,1,12445,12447,1,110593,110879,1,110898,110928,30,110929,110930,1,127488,127488,1]));static Imperial_Aramaic=new k(new Uint32Array([67648,67669,1,67671,67679,1]));static Inherited=new k(new Uint32Array([768,879,1,1157,1158,1,1611,1621,1,1648,2385,737,2386,2388,1,6832,6862,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8204,8205,1,8400,8432,1,12330,12333,1,12441,12442,1,65024,65039,1,65056,65069,1,66045,66272,227,70459,118528,48069,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,917760,917999,1]));static foldInherited=new k(new Uint32Array([921,953,32,8126,8126,1]));static Inscriptional_Pahlavi=new k(new Uint32Array([68448,68466,1,68472,68479,1]));static Inscriptional_Parthian=new k(new Uint32Array([68416,68437,1,68440,68447,1]));static Javanese=new k(new Uint32Array([43392,43469,1,43472,43481,1,43486,43487,1]));static Kaithi=new k(new Uint32Array([69760,69826,1,69837,69837,1]));static Kannada=new k(new Uint32Array([3200,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1]));static Katakana=new k(new Uint32Array([12449,12538,1,12541,12543,1,12784,12799,1,13008,13054,1,13056,13143,1,65382,65391,1,65393,65437,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110880,288,110881,110882,1,110933,110948,15,110949,110951,1]));static Kawi=new k(new Uint32Array([73472,73488,1,73490,73530,1,73534,73562,1]));static Kayah_Li=new k(new Uint32Array([43264,43309,1,43311,43311,1]));static Kharoshthi=new k(new Uint32Array([68096,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1]));static Khitan_Small_Script=new k(new Uint32Array([94180,101120,6940,101121,101589,1,101631,101631,1]));static Khmer=new k(new Uint32Array([6016,6109,1,6112,6121,1,6128,6137,1,6624,6655,1]));static Khojki=new k(new Uint32Array([70144,70161,1,70163,70209,1]));static Khudawadi=new k(new Uint32Array([70320,70378,1,70384,70393,1]));static Kirat_Rai=new k(new Uint32Array([93504,93561,1]));static Lao=new k(new Uint32Array([3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1]));static Latin=new k(new Uint32Array([65,90,1,97,122,1,170,186,16,192,214,1,216,246,1,248,696,1,736,740,1,7424,7461,1,7468,7516,1,7522,7525,1,7531,7543,1,7545,7614,1,7680,7935,1,8305,8319,14,8336,8348,1,8490,8491,1,8498,8526,28,8544,8584,1,11360,11391,1,42786,42887,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43007,1,43824,43866,1,43868,43876,1,43878,43881,1,64256,64262,1,65313,65338,1,65345,65370,1,67456,67461,1,67463,67504,1,67506,67514,1,122624,122654,1,122661,122666,1]));static Lepcha=new k(new Uint32Array([7168,7223,1,7227,7241,1,7245,7247,1]));static Limbu=new k(new Uint32Array([6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6479,1]));static Linear_A=new k(new Uint32Array([67072,67382,1,67392,67413,1,67424,67431,1]));static Linear_B=new k(new Uint32Array([65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1]));static Lisu=new k(new Uint32Array([42192,42239,1,73648,73648,1]));static Lycian=new k(new Uint32Array([66176,66204,1]));static Lydian=new k(new Uint32Array([67872,67897,1,67903,67903,1]));static Mahajani=new k(new Uint32Array([69968,70006,1]));static Makasar=new k(new Uint32Array([73440,73464,1]));static Malayalam=new k(new Uint32Array([3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1]));static Mandaic=new k(new Uint32Array([2112,2139,1,2142,2142,1]));static Manichaean=new k(new Uint32Array([68288,68326,1,68331,68342,1]));static Marchen=new k(new Uint32Array([72816,72847,1,72850,72871,1,72873,72886,1]));static Masaram_Gondi=new k(new Uint32Array([72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1]));static Medefaidrin=new k(new Uint32Array([93760,93850,1]));static Meetei_Mayek=new k(new Uint32Array([43744,43766,1,43968,44013,1,44016,44025,1]));static Mende_Kikakui=new k(new Uint32Array([124928,125124,1,125127,125142,1]));static Meroitic_Cursive=new k(new Uint32Array([68e3,68023,1,68028,68047,1,68050,68095,1]));static Meroitic_Hieroglyphs=new k(new Uint32Array([67968,67999,1]));static Miao=new k(new Uint32Array([93952,94026,1,94031,94087,1,94095,94111,1]));static Modi=new k(new Uint32Array([71168,71236,1,71248,71257,1]));static Mongolian=new k(new Uint32Array([6144,6145,1,6148,6150,2,6151,6169,1,6176,6264,1,6272,6314,1,71264,71276,1]));static Mro=new k(new Uint32Array([92736,92766,1,92768,92777,1,92782,92783,1]));static Multani=new k(new Uint32Array([70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1]));static Myanmar=new k(new Uint32Array([4096,4255,1,43488,43518,1,43616,43647,1,71376,71395,1]));static Nabataean=new k(new Uint32Array([67712,67742,1,67751,67759,1]));static Nag_Mundari=new k(new Uint32Array([124112,124153,1]));static Nandinagari=new k(new Uint32Array([72096,72103,1,72106,72151,1,72154,72164,1]));static New_Tai_Lue=new k(new Uint32Array([6528,6571,1,6576,6601,1,6608,6618,1,6622,6623,1]));static Newa=new k(new Uint32Array([70656,70747,1,70749,70753,1]));static Nko=new k(new Uint32Array([1984,2042,1,2045,2047,1]));static Nushu=new k(new Uint32Array([94177,110960,16783,110961,111355,1]));static Nyiakeng_Puachue_Hmong=new k(new Uint32Array([123136,123180,1,123184,123197,1,123200,123209,1,123214,123215,1]));static Ogham=new k(new Uint32Array([5760,5788,1]));static Ol_Chiki=new k(new Uint32Array([7248,7295,1]));static Ol_Onal=new k(new Uint32Array([124368,124410,1,124415,124415,1]));static Old_Hungarian=new k(new Uint32Array([68736,68786,1,68800,68850,1,68858,68863,1]));static Old_Italic=new k(new Uint32Array([66304,66339,1,66349,66351,1]));static Old_North_Arabian=new k(new Uint32Array([68224,68255,1]));static Old_Permic=new k(new Uint32Array([66384,66426,1]));static Old_Persian=new k(new Uint32Array([66464,66499,1,66504,66517,1]));static Old_Sogdian=new k(new Uint32Array([69376,69415,1]));static Old_South_Arabian=new k(new Uint32Array([68192,68223,1]));static Old_Turkic=new k(new Uint32Array([68608,68680,1]));static Old_Uyghur=new k(new Uint32Array([69488,69513,1]));static Oriya=new k(new Uint32Array([2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1]));static Osage=new k(new Uint32Array([66736,66771,1,66776,66811,1]));static Osmanya=new k(new Uint32Array([66688,66717,1,66720,66729,1]));static Pahawh_Hmong=new k(new Uint32Array([92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1]));static Palmyrene=new k(new Uint32Array([67680,67711,1]));static Pau_Cin_Hau=new k(new Uint32Array([72384,72440,1]));static Phags_Pa=new k(new Uint32Array([43072,43127,1]));static Phoenician=new k(new Uint32Array([67840,67867,1,67871,67871,1]));static Psalter_Pahlavi=new k(new Uint32Array([68480,68497,1,68505,68508,1,68521,68527,1]));static Rejang=new k(new Uint32Array([43312,43347,1,43359,43359,1]));static Runic=new k(new Uint32Array([5792,5866,1,5870,5880,1]));static Samaritan=new k(new Uint32Array([2048,2093,1,2096,2110,1]));static Saurashtra=new k(new Uint32Array([43136,43205,1,43214,43225,1]));static Sharada=new k(new Uint32Array([70016,70111,1]));static Shavian=new k(new Uint32Array([66640,66687,1]));static Siddham=new k(new Uint32Array([71040,71093,1,71096,71133,1]));static SignWriting=new k(new Uint32Array([120832,121483,1,121499,121503,1,121505,121519,1]));static Sinhala=new k(new Uint32Array([3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,70113,70132,1]));static Sogdian=new k(new Uint32Array([69424,69465,1]));static Sora_Sompeng=new k(new Uint32Array([69840,69864,1,69872,69881,1]));static Soyombo=new k(new Uint32Array([72272,72354,1]));static Sundanese=new k(new Uint32Array([7040,7103,1,7360,7367,1]));static Sunuwar=new k(new Uint32Array([72640,72673,1,72688,72697,1]));static Syloti_Nagri=new k(new Uint32Array([43008,43052,1]));static Syriac=new k(new Uint32Array([1792,1805,1,1807,1866,1,1869,1871,1,2144,2154,1]));static Tagalog=new k(new Uint32Array([5888,5909,1,5919,5919,1]));static Tagbanwa=new k(new Uint32Array([5984,5996,1,5998,6e3,1,6002,6003,1]));static Tai_Le=new k(new Uint32Array([6480,6509,1,6512,6516,1]));static Tai_Tham=new k(new Uint32Array([6688,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1]));static Tai_Viet=new k(new Uint32Array([43648,43714,1,43739,43743,1]));static Takri=new k(new Uint32Array([71296,71353,1,71360,71369,1]));static Tamil=new k(new Uint32Array([2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,73664,73713,1,73727,73727,1]));static Tangsa=new k(new Uint32Array([92784,92862,1,92864,92873,1]));static Tangut=new k(new Uint32Array([94176,94208,32,94209,100343,1,100352,101119,1,101632,101640,1]));static Telugu=new k(new Uint32Array([3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3199,1]));static Thaana=new k(new Uint32Array([1920,1969,1]));static Thai=new k(new Uint32Array([3585,3642,1,3648,3675,1]));static Tibetan=new k(new Uint32Array([3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4052,1,4057,4058,1]));static Tifinagh=new k(new Uint32Array([11568,11623,1,11631,11632,1,11647,11647,1]));static Tirhuta=new k(new Uint32Array([70784,70855,1,70864,70873,1]));static Todhri=new k(new Uint32Array([67008,67059,1]));static Toto=new k(new Uint32Array([123536,123566,1]));static Tulu_Tigalari=new k(new Uint32Array([70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1]));static Ugaritic=new k(new Uint32Array([66432,66461,1,66463,66463,1]));static Vai=new k(new Uint32Array([42240,42539,1]));static Vithkuqi=new k(new Uint32Array([66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1]));static Wancho=new k(new Uint32Array([123584,123641,1,123647,123647,1]));static Warang_Citi=new k(new Uint32Array([71840,71922,1,71935,71935,1]));static Yezidi=new k(new Uint32Array([69248,69289,1,69291,69293,1,69296,69297,1]));static Yi=new k(new Uint32Array([40960,42124,1,42128,42182,1]));static Zanabazar_Square=new k(new Uint32Array([72192,72263,1]));static CATEGORIES=new Map([["C",t.C],["Cc",t.Cc],["Cf",t.Cf],["Co",t.Co],["Cs",t.Cs],["L",t.L],["Ll",t.Ll],["Lm",t.Lm],["Lo",t.Lo],["Lt",t.Lt],["Lu",t.Lu],["M",t.M],["Mc",t.Mc],["Me",t.Me],["Mn",t.Mn],["N",t.N],["Nd",t.Nd],["Nl",t.Nl],["No",t.No],["P",t.P],["Pc",t.Pc],["Pd",t.Pd],["Pe",t.Pe],["Pf",t.Pf],["Pi",t.Pi],["Po",t.Po],["Ps",t.Ps],["S",t.S],["Sc",t.Sc],["Sk",t.Sk],["Sm",t.Sm],["So",t.So],["Z",t.Z],["Zl",t.Zl],["Zp",t.Zp],["Zs",t.Zs]]);static SCRIPTS=new Map([["Adlam",t.Adlam],["Ahom",t.Ahom],["Anatolian_Hieroglyphs",t.Anatolian_Hieroglyphs],["Arabic",t.Arabic],["Armenian",t.Armenian],["Avestan",t.Avestan],["Balinese",t.Balinese],["Bamum",t.Bamum],["Bassa_Vah",t.Bassa_Vah],["Batak",t.Batak],["Bengali",t.Bengali],["Bhaiksuki",t.Bhaiksuki],["Bopomofo",t.Bopomofo],["Brahmi",t.Brahmi],["Braille",t.Braille],["Buginese",t.Buginese],["Buhid",t.Buhid],["Canadian_Aboriginal",t.Canadian_Aboriginal],["Carian",t.Carian],["Caucasian_Albanian",t.Caucasian_Albanian],["Chakma",t.Chakma],["Cham",t.Cham],["Cherokee",t.Cherokee],["Chorasmian",t.Chorasmian],["Common",t.Common],["Coptic",t.Coptic],["Cuneiform",t.Cuneiform],["Cypriot",t.Cypriot],["Cypro_Minoan",t.Cypro_Minoan],["Cyrillic",t.Cyrillic],["Deseret",t.Deseret],["Devanagari",t.Devanagari],["Dives_Akuru",t.Dives_Akuru],["Dogra",t.Dogra],["Duployan",t.Duployan],["Egyptian_Hieroglyphs",t.Egyptian_Hieroglyphs],["Elbasan",t.Elbasan],["Elymaic",t.Elymaic],["Ethiopic",t.Ethiopic],["Garay",t.Garay],["Georgian",t.Georgian],["Glagolitic",t.Glagolitic],["Gothic",t.Gothic],["Grantha",t.Grantha],["Greek",t.Greek],["Gujarati",t.Gujarati],["Gunjala_Gondi",t.Gunjala_Gondi],["Gurmukhi",t.Gurmukhi],["Gurung_Khema",t.Gurung_Khema],["Han",t.Han],["Hangul",t.Hangul],["Hanifi_Rohingya",t.Hanifi_Rohingya],["Hanunoo",t.Hanunoo],["Hatran",t.Hatran],["Hebrew",t.Hebrew],["Hiragana",t.Hiragana],["Imperial_Aramaic",t.Imperial_Aramaic],["Inherited",t.Inherited],["Inscriptional_Pahlavi",t.Inscriptional_Pahlavi],["Inscriptional_Parthian",t.Inscriptional_Parthian],["Javanese",t.Javanese],["Kaithi",t.Kaithi],["Kannada",t.Kannada],["Katakana",t.Katakana],["Kawi",t.Kawi],["Kayah_Li",t.Kayah_Li],["Kharoshthi",t.Kharoshthi],["Khitan_Small_Script",t.Khitan_Small_Script],["Khmer",t.Khmer],["Khojki",t.Khojki],["Khudawadi",t.Khudawadi],["Kirat_Rai",t.Kirat_Rai],["Lao",t.Lao],["Latin",t.Latin],["Lepcha",t.Lepcha],["Limbu",t.Limbu],["Linear_A",t.Linear_A],["Linear_B",t.Linear_B],["Lisu",t.Lisu],["Lycian",t.Lycian],["Lydian",t.Lydian],["Mahajani",t.Mahajani],["Makasar",t.Makasar],["Malayalam",t.Malayalam],["Mandaic",t.Mandaic],["Manichaean",t.Manichaean],["Marchen",t.Marchen],["Masaram_Gondi",t.Masaram_Gondi],["Medefaidrin",t.Medefaidrin],["Meetei_Mayek",t.Meetei_Mayek],["Mende_Kikakui",t.Mende_Kikakui],["Meroitic_Cursive",t.Meroitic_Cursive],["Meroitic_Hieroglyphs",t.Meroitic_Hieroglyphs],["Miao",t.Miao],["Modi",t.Modi],["Mongolian",t.Mongolian],["Mro",t.Mro],["Multani",t.Multani],["Myanmar",t.Myanmar],["Nabataean",t.Nabataean],["Nag_Mundari",t.Nag_Mundari],["Nandinagari",t.Nandinagari],["New_Tai_Lue",t.New_Tai_Lue],["Newa",t.Newa],["Nko",t.Nko],["Nushu",t.Nushu],["Nyiakeng_Puachue_Hmong",t.Nyiakeng_Puachue_Hmong],["Ogham",t.Ogham],["Ol_Chiki",t.Ol_Chiki],["Ol_Onal",t.Ol_Onal],["Old_Hungarian",t.Old_Hungarian],["Old_Italic",t.Old_Italic],["Old_North_Arabian",t.Old_North_Arabian],["Old_Permic",t.Old_Permic],["Old_Persian",t.Old_Persian],["Old_Sogdian",t.Old_Sogdian],["Old_South_Arabian",t.Old_South_Arabian],["Old_Turkic",t.Old_Turkic],["Old_Uyghur",t.Old_Uyghur],["Oriya",t.Oriya],["Osage",t.Osage],["Osmanya",t.Osmanya],["Pahawh_Hmong",t.Pahawh_Hmong],["Palmyrene",t.Palmyrene],["Pau_Cin_Hau",t.Pau_Cin_Hau],["Phags_Pa",t.Phags_Pa],["Phoenician",t.Phoenician],["Psalter_Pahlavi",t.Psalter_Pahlavi],["Rejang",t.Rejang],["Runic",t.Runic],["Samaritan",t.Samaritan],["Saurashtra",t.Saurashtra],["Sharada",t.Sharada],["Shavian",t.Shavian],["Siddham",t.Siddham],["SignWriting",t.SignWriting],["Sinhala",t.Sinhala],["Sogdian",t.Sogdian],["Sora_Sompeng",t.Sora_Sompeng],["Soyombo",t.Soyombo],["Sundanese",t.Sundanese],["Sunuwar",t.Sunuwar],["Syloti_Nagri",t.Syloti_Nagri],["Syriac",t.Syriac],["Tagalog",t.Tagalog],["Tagbanwa",t.Tagbanwa],["Tai_Le",t.Tai_Le],["Tai_Tham",t.Tai_Tham],["Tai_Viet",t.Tai_Viet],["Takri",t.Takri],["Tamil",t.Tamil],["Tangsa",t.Tangsa],["Tangut",t.Tangut],["Telugu",t.Telugu],["Thaana",t.Thaana],["Thai",t.Thai],["Tibetan",t.Tibetan],["Tifinagh",t.Tifinagh],["Tirhuta",t.Tirhuta],["Todhri",t.Todhri],["Toto",t.Toto],["Tulu_Tigalari",t.Tulu_Tigalari],["Ugaritic",t.Ugaritic],["Vai",t.Vai],["Vithkuqi",t.Vithkuqi],["Wancho",t.Wancho],["Warang_Citi",t.Warang_Citi],["Yezidi",t.Yezidi],["Yi",t.Yi],["Zanabazar_Square",t.Zanabazar_Square]]);static FOLD_CATEGORIES=new Map([["L",t.foldL],["Ll",t.foldLl],["Lt",t.foldLt],["Lu",t.foldLu],["M",t.foldM],["Mn",t.foldMn]]);static FOLD_SCRIPT=new Map([["Common",t.foldCommon],["Greek",t.foldGreek],["Inherited",t.foldInherited]]);static Print=new k(new Uint32Array([33,126,1,161,172,1,174,887,1,890,895,1,900,906,1,908,910,2,911,929,1,931,1327,1,1329,1366,1,1369,1418,1,1421,1423,1,1425,1479,1,1488,1514,1,1519,1524,1,1542,1563,1,1565,1756,1,1758,1805,1,1808,1866,1,1869,1969,1,1984,2042,1,2045,2093,1,2096,2110,1,2112,2139,1,2142,2144,2,2145,2154,1,2160,2190,1,2199,2273,1,2275,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1,2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1,2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1,2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1,2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1,3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1,3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,3585,3642,1,3647,3675,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1,3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4058,1,4096,4293,1,4295,4301,6,4304,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,5024,5109,1,5112,5117,1,5120,5759,1,5761,5788,1,5792,5880,1,5888,5909,1,5919,5942,1,5952,5971,1,5984,5996,1,5998,6e3,1,6002,6003,1,6016,6109,1,6112,6121,1,6128,6137,1,6144,6157,1,6159,6169,1,6176,6264,1,6272,6314,1,6320,6389,1,6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6608,6618,1,6622,6683,1,6686,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1,6832,6862,1,6912,6988,1,6990,7155,1,7164,7223,1,7227,7241,1,7245,7306,1,7312,7354,1,7357,7367,1,7376,7418,1,7424,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8208,8231,1,8240,8286,1,8304,8305,1,8308,8334,1,8336,8348,1,8352,8384,1,8400,8432,1,8448,8587,1,8592,9257,1,9280,9290,1,9312,11123,1,11126,11157,1,11159,11507,1,11513,11557,1,11559,11565,6,11568,11623,1,11631,11632,1,11647,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11744,11869,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12289,12351,1,12353,12438,1,12441,12543,1,12549,12591,1,12593,12686,1,12688,12773,1,12783,12830,1,12832,42124,1,42128,42182,1,42192,42539,1,42560,42743,1,42752,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43052,1,43056,43065,1,43072,43127,1,43136,43205,1,43214,43225,1,43232,43347,1,43359,43388,1,43392,43469,1,43471,43481,1,43486,43518,1,43520,43574,1,43584,43597,1,43600,43609,1,43612,43714,1,43739,43766,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43883,1,43888,44013,1,44016,44025,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64450,1,64467,64911,1,64914,64967,1,64975,65008,33,65009,65049,1,65056,65106,1,65108,65126,1,65128,65131,1,65136,65140,1,65142,65276,1,65281,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65504,65510,1,65512,65518,1,65532,65533,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,65792,65794,1,65799,65843,1,65847,65934,1,65936,65948,1,65952,66e3,48,66001,66045,1,66176,66204,1,66208,66256,1,66272,66299,1,66304,66339,1,66349,66378,1,66384,66426,1,66432,66461,1,66463,66499,1,66504,66517,1,66560,66717,1,66720,66729,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66927,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67671,67742,1,67751,67759,1,67808,67826,1,67828,67829,1,67835,67867,1,67871,67897,1,67903,67968,65,67969,68023,1,68028,68047,1,68050,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1,68192,68255,1,68288,68326,1,68331,68342,1,68352,68405,1,68409,68437,1,68440,68466,1,68472,68497,1,68505,68508,1,68521,68527,1,68608,68680,1,68736,68786,1,68800,68850,1,68858,68903,1,68912,68921,1,68928,68965,1,68969,68997,1,69006,69007,1,69216,69246,1,69248,69289,1,69291,69293,1,69296,69297,1,69314,69316,1,69372,69415,1,69424,69465,1,69488,69513,1,69552,69579,1,69600,69622,1,69632,69709,1,69714,69749,1,69759,69820,1,69822,69826,1,69840,69864,1,69872,69881,1,69888,69940,1,69942,69959,1,69968,70006,1,70016,70111,1,70113,70132,1,70144,70161,1,70163,70209,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1,70320,70378,1,70384,70393,1,70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70459,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1,70656,70747,1,70749,70753,1,70784,70855,1,70864,70873,1,71040,71093,1,71096,71133,1,71168,71236,1,71248,71257,1,71264,71276,1,71296,71353,1,71360,71369,1,71376,71395,1,71424,71450,1,71453,71467,1,71472,71494,1,71680,71739,1,71840,71922,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1,72096,72103,1,72106,72151,1,72154,72164,1,72192,72263,1,72272,72354,1,72368,72440,1,72448,72457,1,72640,72673,1,72688,72697,1,72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1,72816,72847,1,72850,72871,1,72873,72886,1,72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1,73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1,73440,73464,1,73472,73488,1,73490,73530,1,73534,73562,1,73648,73664,16,73665,73713,1,73727,74649,1,74752,74862,1,74864,74868,1,74880,75075,1,77712,77810,1,77824,78895,1,78912,78933,1,78944,82938,1,82944,83526,1,90368,90425,1,92160,92728,1,92736,92766,1,92768,92777,1,92782,92862,1,92864,92873,1,92880,92909,1,92912,92917,1,92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1,93504,93561,1,93760,93850,1,93952,94026,1,94031,94087,1,94095,94111,1,94176,94180,1,94192,94193,1,94208,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1,117760,118009,1,118016,118451,1,118528,118573,1,118576,118598,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119154,1,119163,119274,1,119296,119365,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,121483,1,121499,121503,1,121505,121519,1,122624,122654,1,122661,122666,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,122928,122989,1,123023,123136,113,123137,123180,1,123184,123197,1,123200,123209,1,123214,123215,1,123536,123566,1,123584,123641,1,123647,124112,465,124113,124153,1,124368,124410,1,124415,124896,481,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125127,125142,1,125184,125259,1,125264,125273,1,125278,125279,1,126065,126132,1,126209,126269,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1,917760,917999,1]))},Ae=class{static MAX_RUNE=1114111;static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static is32(e,n){let r=0,s=e.length;for(;r<s;){let i=r+Math.floor((s-r)/2),o=e.getLo(i),a=e.getHi(i);if(o<=n&&n<=a){let l=e.getStride(i);return(n-o)%l===0}n<o?s=i:r=i+1}return!1}static is(e,n){if(n<=this.MAX_LATIN1){for(let r=0;r<e.length;r++){let s=e.getHi(r);if(n>s)continue;let i=e.getLo(r);if(n<i)return!1;let o=e.getStride(r);return(n-i)%o===0}return!1}return e.length>0&&n>=e.getLo(0)&&this.is32(e,n)}static isUpper(e){if(e<=this.MAX_LATIN1){let n=String.fromCodePoint(e);return n.toUpperCase()===n&&n.toLowerCase()!==n}return this.is(tn.Upper,e)}static isPrint(e){return e<=this.MAX_LATIN1?e>=32&&e<this.MAX_ASCII||e>=161&&e!==173:this.is(tn.Print,e)}static simpleFold(e){if(tn.CASE_ORBIT.has(e))return tn.CASE_ORBIT.get(e);let n=U.toLowerCase(e);return n!==e?n:U.toUpperCase(e)}static equalsIgnoreCase(e,n){if(e<0||n<0||e===n)return!0;if(e<=this.MAX_ASCII&&n<=this.MAX_ASCII)return U.CODES.get("A")<=e&&e<=U.CODES.get("Z")&&(e|=32),U.CODES.get("A")<=n&&n<=U.CODES.get("Z")&&(n|=32),e===n;for(let r=this.simpleFold(e);r!==e;r=this.simpleFold(r))if(r===n)return!0;return!1}},$e=class{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isalnum(e){return U.CODES.get("0")<=e&&e<=U.CODES.get("9")||U.CODES.get("a")<=e&&e<=U.CODES.get("z")||U.CODES.get("A")<=e&&e<=U.CODES.get("Z")}static unhex(e){return U.CODES.get("0")<=e&&e<=U.CODES.get("9")?e-U.CODES.get("0"):U.CODES.get("a")<=e&&e<=U.CODES.get("f")?e-U.CODES.get("a")+10:U.CODES.get("A")<=e&&e<=U.CODES.get("F")?e-U.CODES.get("A")+10:-1}static escapeRune(e){let n="";if(Ae.isPrint(e))this.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(n+="\\"),n+=String.fromCodePoint(e);else switch(e){case U.CODES.get('"'):n+='\\"';break;case U.CODES.get("\\"):n+="\\\\";break;case U.CODES.get(" "):n+="\\t";break;case U.CODES.get(`
156
+ `):n+="\\n";break;case U.CODES.get("\r"):n+="\\r";break;case U.CODES.get("\b"):n+="\\b";break;case U.CODES.get("\f"):n+="\\f";break;default:{let r=e.toString(16);e<256?(n+="\\x",r.length===1&&(n+="0"),n+=r):n+=`\\x{${r}}`;break}}return n}static stringToRunes(e){return String(e).split("").map(n=>n.codePointAt(0))}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return U.CODES.get("a")<=e&&e<=U.CODES.get("z")||U.CODES.get("A")<=e&&e<=U.CODES.get("Z")||U.CODES.get("0")<=e&&e<=U.CODES.get("9")||e===U.CODES.get("_")}static emptyOpContext(e,n){let r=0;return e<0&&(r|=this.EMPTY_BEGIN_TEXT|this.EMPTY_BEGIN_LINE),e===U.CODES.get(`
157
+ `)&&(r|=this.EMPTY_BEGIN_LINE),n<0&&(r|=this.EMPTY_END_TEXT|this.EMPTY_END_LINE),n===U.CODES.get(`
158
+ `)&&(r|=this.EMPTY_END_LINE),this.isWordRune(e)!==this.isWordRune(n)?r|=this.EMPTY_WORD_BOUNDARY:r|=this.EMPTY_NO_WORD_BOUNDARY,r}static quoteMeta(e){return e.split("").map(n=>this.METACHARACTERS.indexOf(n)>=0?`\\${n}`:n).join("")}static charCount(e){return e>Ae.MAX_BMP?2:1}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return Array.from(new TextEncoder().encode(e));{let n=[],r=0;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);i<128?n[r++]=i:i<2048?(n[r++]=i>>6|192,n[r++]=i&63|128):(i&64512)===55296&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++s)&1023),n[r++]=i>>18|240,n[r++]=i>>12&63|128,n[r++]=i>>6&63|128,n[r++]=i&63|128):(n[r++]=i>>12|224,n[r++]=i>>6&63|128,n[r++]=i&63|128)}return n}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder)return new TextDecoder("utf-8").decode(new Uint8Array(e));{let n=[],r=0,s=0;for(;r<e.length;){let i=e[r++];if(i<128)n[s++]=String.fromCharCode(i);else if(i>191&&i<224){let o=e[r++];n[s++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=e[r++],a=e[r++],l=e[r++],c=((i&7)<<18|(o&63)<<12|(a&63)<<6|l&63)-65536;n[s++]=String.fromCharCode(55296+(c>>10)),n[s++]=String.fromCharCode(56320+(c&1023))}else{let o=e[r++],a=e[r++];n[s++]=String.fromCharCode((i&15)<<12|(o&63)<<6|a&63)}}return n.join("")}}},n1=(t=[],e=0)=>{let n={};for(let r=0;r<t.length;r++){let s=t[r],i=e+r;n[s]=i,n[i]=s}return Object.freeze(n)},Un=class t{static Encoding=n1(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===t.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===t.Encoding.UTF_16}},hi=class extends Un{constructor(e=null){super(),this.bytes=e}getEncoding(){return Un.Encoding.UTF_8}asCharSequence(){return $e.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},aa=class extends Un{constructor(e=null){super(),this.charSequence=e}getEncoding(){return Un.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return this.charSequence.toString().split("").map(e=>e.codePointAt(0))}length(){return this.charSequence.length}},Pr=class{static utf16(e){return new aa(e)}static utf8(e){return Array.isArray(e)?new hi(e):new hi($e.stringToUtf8ByteArray(e))}},$r=class extends Error{constructor(e){super(e),this.name="RE2JSException"}},ze=class extends $r{constructor(e,n=null){let r=`error parsing regexp: ${e}`;n&&(r+=`: \`${n}\``),super(r),this.name="RE2JSSyntaxException",this.message=r,this.error=e,this.input=n}getDescription(){return this.error}getPattern(){return this.input}},la=class extends $r{constructor(e){super(e),this.name="RE2JSCompileException"}},un=class extends $r{constructor(e){super(e),this.name="RE2JSGroupException"}},ca=class extends $r{constructor(e){super(e),this.name="RE2JSFlagsException"}},ua=class{static quoteReplacement(e){return e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(n=>{let r=n.codePointAt(0);return r===U.CODES["\\"]||r===U.CODES.$?`\\${n}`:n}).join("")}constructor(e,n){if(e===null)throw new Error("pattern is null");this.patternInput=e;let r=this.patternInput.re2();this.patternGroupCount=r.numberOfCapturingGroups(),this.groups=[],this.namedGroups=r.namedGroups,this.numberOfInstructions=r.numberOfInstructions(),n instanceof Un?this.resetMatcherInput(n):Array.isArray(n)?this.resetMatcherInput(Pr.utf8(n)):this.resetMatcherInput(Pr.utf16(n))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return this.matcherInput=e,this.reset(),this}start(e=0){if(typeof e=="string"){let n=this.namedGroups[e];if(!Number.isFinite(n))throw new un(`group '${e}' not found`);e=n}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){let n=this.namedGroups[e];if(!Number.isFinite(n))throw new un(`group '${e}' not found`);e=n}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){let s=this.namedGroups[e];if(!Number.isFinite(s))throw new un(`group '${e}' not found`);e=s}let n=this.start(e),r=this.end(e);return n<0&&r<0?null:this.substring(n,r)}groupCount(){return this.patternGroupCount}loadGroup(e){if(e<0||e>this.patternGroupCount)throw new un(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new un("perhaps no match attempted");if(e===0||this.hasGroups)return;let n=this.groups[1]+1;n>this.matcherInputLength&&(n=this.matcherInputLength);let r=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],n,this.anchorFlag,1+this.patternGroupCount);if(!r[0])throw new un("inconsistency in matching group data");this.groups=r[1],this.hasGroups=!0}matches(){return this.genMatch(0,ie.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,ie.ANCHOR_START)}find(e=null){if(e!==null){if(e<0||e>this.matcherInputLength)throw new un(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}return e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1]&&e++),this.genMatch(e,ie.UNANCHORED)}genMatch(e,n){let r=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,n,1);return r[0]?(this.groups=r[1],this.hasMatch=!0,this.hasGroups=!1,this.anchorFlag=n,!0):!1}substring(e,n){return this.matcherInput.isUTF8Encoding()?$e.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,n)):this.matcherInput.asCharSequence().substring(e,n).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,n=!1){let r="",s=this.start(),i=this.end();return this.appendPos<s&&(r+=this.substring(this.appendPos,s)),this.appendPos=i,r+=n?this.appendReplacementInternalPerl(e):this.appendReplacementInternal(e),r}appendReplacementInternal(e){let n="",r=0,s=e.length;for(let i=0;i<s-1;i++){if(e.codePointAt(i)===U.CODES.get("\\")){r<i&&(n+=e.substring(r,i)),i++,r=i;continue}if(e.codePointAt(i)===U.CODES.get("$")){let o=e.codePointAt(i+1);if(U.CODES.get("0")<=o&&o<=U.CODES.get("9")){let a=o-U.CODES.get("0");for(r<i&&(n+=e.substring(r,i)),i+=2;i<s&&(o=e.codePointAt(i),!(o<U.CODES.get("0")||o>U.CODES.get("9")||a*10+o-U.CODES.get("0")>this.patternGroupCount));i++)a=a*10+o-U.CODES.get("0");if(a>this.patternGroupCount)throw new un(`n > number of groups: ${a}`);let l=this.group(a);l!==null&&(n+=l),r=i,i--;continue}else if(o===U.CODES.get("{")){r<i&&(n+=e.substring(r,i)),i++;let a=i+1;for(;a<e.length&&e.codePointAt(a)!==U.CODES.get("}")&&e.codePointAt(a)!==U.CODES.get(" ");)a++;if(a===e.length||e.codePointAt(a)!==U.CODES.get("}"))throw new un("named capture group is missing trailing '}'");let l=e.substring(i+1,a);n+=this.group(l),r=a+1}}}return r<s&&(n+=e.substring(r,s)),n}appendReplacementInternalPerl(e){let n="",r=0,s=e.length;for(let i=0;i<s-1;i++)if(e.codePointAt(i)===U.CODES.get("$")){let o=e.codePointAt(i+1);if(U.CODES.get("$")===o){r<i&&(n+=e.substring(r,i)),n+="$",i++,r=i+1;continue}else if(U.CODES.get("&")===o){r<i&&(n+=e.substring(r,i));let a=this.group(0);a!==null?n+=a:n+="$&",i++,r=i+1;continue}else if(U.CODES.get("1")<=o&&o<=U.CODES.get("9")){let a=o-U.CODES.get("0");for(r<i&&(n+=e.substring(r,i)),i+=2;i<s&&(o=e.codePointAt(i),!(o<U.CODES.get("0")||o>U.CODES.get("9")||a*10+o-U.CODES.get("0")>this.patternGroupCount));i++)a=a*10+o-U.CODES.get("0");if(a>this.patternGroupCount){n+=`$${a}`,r=i,i--;continue}let l=this.group(a);l!==null&&(n+=l),r=i,i--;continue}else if(o===U.CODES.get("<")){r<i&&(n+=e.substring(r,i)),i++;let a=i+1;for(;a<e.length&&e.codePointAt(a)!==U.CODES.get(">")&&e.codePointAt(a)!==U.CODES.get(" ");)a++;if(a===e.length||e.codePointAt(a)!==U.CODES.get(">")){n+=e.substring(i-1,a+1),r=a+1;continue}let l=e.substring(i+1,a);Object.prototype.hasOwnProperty.call(this.namedGroups,l)?n+=this.group(l):n+=`$<${l}>`,r=a+1}}return r<s&&(n+=e.substring(r,s)),n}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,n=!1){return this.replace(e,!0,n)}replaceFirst(e,n=!1){return this.replace(e,!1,n)}replace(e,n=!0,r=!1){let s="";for(this.reset();this.find()&&(s+=this.appendReplacement(e,r),!!n););return s+=this.appendTail(),s}},xn=class{static EOF(){return-8}canCheckPrefix(){return!0}endPos(){return this.end}},fa=class extends xn{constructor(e,n=0,r=e.length){super(),this.bytes=e,this.start=n,this.end=r}step(e){if(e+=this.start,e>=this.end)return xn.EOF();let n=this.bytes[e++]&255;return(n&128)===0?n<<3|1:(n&224)===192?(n=n&31,e>=this.end?xn.EOF():(n=n<<6|this.bytes[e++]&63,n<<3|2)):(n&240)===224?(n=n&15,e+1>=this.end?xn.EOF():(n=n<<6|this.bytes[e++]&63,n=n<<6|this.bytes[e++]&63,n<<3|3)):(n=n&7,e+2>=this.end?xn.EOF():(n=n<<6|this.bytes[e++]&63,n=n<<6|this.bytes[e++]&63,n=n<<6|this.bytes[e++]&63,n<<3|4))}index(e,n){n+=this.start;let r=this.indexOf(this.bytes,e.prefixUTF8,n);return r<0?r:r-n}context(e){e+=this.start;let n=-1;if(e>this.start&&e<=this.end){let s=e-1;if(n=this.bytes[s--],n>=128){let i=e-4;for(i<this.start&&(i=this.start);s>=i&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start),n=this.step(s)>>3}}let r=e<this.end?this.step(e)>>3:-1;return $e.emptyOpContext(n,r)}indexOf(e,n,r=0){let s=n.length;if(s===0)return-1;let i=e.length;for(let o=r;o<=i-s;o++)for(let a=0;a<s&&e[o+a]===n[a];a++)if(a===s-1)return o;return-1}},pa=class extends xn{constructor(e,n=0,r=e.length){super(),this.charSequence=e,this.start=n,this.end=r}step(e){if(e+=this.start,e<this.end){let n=this.charSequence.codePointAt(e);return n<<3|$e.charCount(n)}else return xn.EOF()}index(e,n){n+=this.start;let r=this.charSequence.indexOf(e.prefix,n);return r<0?r:r-n}context(e){e+=this.start;let n=e>0&&e<=this.charSequence.length?this.charSequence.codePointAt(e-1):-1,r=e<this.charSequence.length?this.charSequence.codePointAt(e):-1;return $e.emptyOpContext(n,r)}},Je=class{static fromUTF8(e,n=0,r=e.length){return new fa(e,n,r)}static fromUTF16(e,n=0,r=e.length){return new pa(e,n,r)}},ve=class t{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static isRuneOp(e){return t.RUNE<=e&&e<=t.RUNE_ANY_NOT_NL}static escapeRunes(e){let n='"';for(let r of e)n+=$e.escapeRune(r);return n+='"',n}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=[]}matchRune(e){if(this.runes.length===1){let s=this.runes[0];return(this.arg&ie.FOLD_CASE)!==0?Ae.equalsIgnoreCase(s,e):e===s}for(let s=0;s<this.runes.length&&s<=8;s+=2){if(e<this.runes[s])return!1;if(e<=this.runes[s+1])return!0}let n=0,r=this.runes.length/2|0;for(;n<r;){let s=n+((r-n)/2|0);if(this.runes[2*s]<=e){if(e<=this.runes[2*s+1])return!0;n=s+1}else r=s}return!1}toString(){switch(this.op){case t.ALT:return`alt -> ${this.out}, ${this.arg}`;case t.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case t.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case t.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case t.MATCH:return"match";case t.FAIL:return"fail";case t.NOP:return`nop -> ${this.out}`;case t.RUNE:return this.runes===null?"rune <null>":["rune ",t.escapeRunes(this.runes),(this.arg&ie.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case t.RUNE1:return`rune1 ${t.escapeRunes(this.runes)} -> ${this.out}`;case t.RUNE_ANY:return`any -> ${this.out}`;case t.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},ha=class{constructor(){this.inst=null,this.cap=[]}},di=class{constructor(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}contains(e){let n=this.sparse[e];return n<this.size&&this.densePcs[n]===e}isEmpty(){return this.size===0}add(e){let n=this.size++;return this.sparse[e]=n,this.denseThreads[n]=null,this.densePcs[n]=e,n}clear(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}toString(){let e="{";for(let n=0;n<this.size;n++)n!==0&&(e+=", "),e+=this.densePcs[n];return e+="}",e}},gs=class t{static fromRE2(e){let n=new t;return n.prog=e.prog,n.re2=e,n.q0=new di(n.prog.numInst()),n.q1=new di(n.prog.numInst()),n.pool=[],n.poolSize=0,n.matched=!1,n.matchcap=Array(n.prog.numCap<2?2:n.prog.numCap).fill(0),n.ncap=0,n}static fromMachine(e){let n=new t;return n.re2=e.re2,n.prog=e.prog,n.q0=e.q0,n.q1=e.q1,n.pool=e.pool,n.poolSize=e.poolSize,n.matched=e.matched,n.matchcap=e.matchcap,n.ncap=e.ncap,n}init(e){this.ncap=e,e>this.matchcap.length?this.initNewCap(e):this.resetCap(e)}resetCap(e){for(let n=0;n<this.poolSize;n++){let r=this.pool[n];r.cap=Array(e).fill(0)}}initNewCap(e){for(let n=0;n<this.poolSize;n++){let r=this.pool[n];r.cap=Array(e).fill(0)}this.matchcap=Array(e).fill(0)}submatches(){return this.ncap===0?$e.emptyInts():this.matchcap.slice(0,this.ncap)}alloc(e){let n;return this.poolSize>0?(this.poolSize--,n=this.pool[this.poolSize]):n=new ha,n.inst=e,n}freeQueue(e,n=0){let r=e.size-n,s=this.poolSize+r;this.pool.length<s&&(this.pool=this.pool.slice(0,Math.max(this.pool.length*2,s)));for(let i=n;i<e.size;i++){let o=e.denseThreads[i];o!==null&&(this.pool[this.poolSize]=o,this.poolSize++)}e.clear()}freeThread(e){this.pool.length<=this.poolSize&&(this.pool=this.pool.slice(0,this.pool.length*2)),this.pool[this.poolSize]=e,this.poolSize++}match(e,n,r){let s=this.re2.cond;if(s===$e.EMPTY_ALL||(r===ie.ANCHOR_START||r===ie.ANCHOR_BOTH)&&n!==0)return!1;this.matched=!1,this.matchcap=Array(this.prog.numCap).fill(-1);let i=this.q0,o=this.q1,a=e.step(n),l=a>>3,c=a&7,u=-1,f=0;a!==xn.EOF()&&(a=e.step(n+c),u=a>>3,f=a&7);let p;for(n===0?p=$e.emptyOpContext(-1,l):p=e.context(n);;){if(i.isEmpty()){if((s&$e.EMPTY_BEGIN_TEXT)!==0&&n!==0||this.matched)break;if(this.re2.prefix.length!==0&&u!==this.re2.prefixRune&&e.canCheckPrefix()){let d=e.index(this.re2,n);if(d<0)break;n+=d,a=e.step(n),l=a>>3,c=a&7,a=e.step(n+c),u=a>>3,f=a&7}}!this.matched&&(n===0||r===ie.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=n),this.add(i,this.prog.start,n,this.matchcap,p,null));let h=n+c;if(p=e.context(h),this.step(i,o,n,h,l,p,r,n===e.endPos()),c===0||this.ncap===0&&this.matched)break;n+=c,l=u,c=f,l!==-1&&(a=e.step(n+c),u=a>>3,f=a&7);let m=i;i=o,o=m}return this.freeQueue(o),this.matched}step(e,n,r,s,i,o,a,l){let c=this.re2.longest;for(let u=0;u<e.size;u++){let f=e.denseThreads[u];if(f===null)continue;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<f.cap[0]){this.freeThread(f);continue}let p=f.inst,h=!1;switch(p.op){case ve.MATCH:if(a===ie.ANCHOR_BOTH&&!l)break;this.ncap>0&&(!c||!this.matched||this.matchcap[1]<r)&&(f.cap[1]=r,this.matchcap=f.cap.slice(0,this.ncap)),c||this.freeQueue(e,u+1),this.matched=!0;break;case ve.RUNE:h=p.matchRune(i);break;case ve.RUNE1:h=i===p.runes[0];break;case ve.RUNE_ANY:h=!0;break;case ve.RUNE_ANY_NOT_NL:h=i!==U.CODES.get(`
159
+ `);break;default:throw new Error("bad inst")}h&&(f=this.add(n,p.out,s,f.cap,o,f)),f!==null&&(this.freeThread(f),e.denseThreads[u]=null)}e.clear()}add(e,n,r,s,i,o){if(n===0||e.contains(n))return o;let a=e.add(n),l=this.prog.inst[n];switch(l.op){case ve.FAIL:break;case ve.ALT:case ve.ALT_MATCH:o=this.add(e,l.out,r,s,i,o),o=this.add(e,l.arg,r,s,i,o);break;case ve.EMPTY_WIDTH:(l.arg&~i)===0&&(o=this.add(e,l.out,r,s,i,o));break;case ve.NOP:o=this.add(e,l.out,r,s,i,o);break;case ve.CAPTURE:if(l.arg<this.ncap){let c=s[l.arg];s[l.arg]=r,this.add(e,l.out,r,s,i,null),s[l.arg]=c}else o=this.add(e,l.out,r,s,i,o);break;case ve.MATCH:case ve.RUNE:case ve.RUNE1:case ve.RUNE_ANY:case ve.RUNE_ANY_NOT_NL:o===null?o=this.alloc(l):o.inst=l,this.ncap>0&&o.cap!==s&&(o.cap=s.slice(0,this.ncap)),e.denseThreads[a]=o,o=null;break;default:throw new Error("unhandled")}return o}},z=class t{static Op=n1(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=t.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===U.CODES.get("-")?"\\":""}static fromRegexp(e){let n=new t(e.op);return n.flags=e.flags,n.subs=e.subs,n.runes=e.runes,n.cap=e.cap,n.min=e.min,n.max=e.max,n.name=e.name,n.namedGroups=e.namedGroups,n}constructor(e){this.op=e,this.flags=0,this.subs=t.emptySubs(),this.runes=[],this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups={}}reinit(){this.flags=0,this.subs=t.emptySubs(),this.runes=[],this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups={}}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case t.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case t.Op.EMPTY_MATCH:e+="(?:)";break;case t.Op.STAR:case t.Op.PLUS:case t.Op.QUEST:case t.Op.REPEAT:{let n=this.subs[0];switch(n.op>t.Op.CAPTURE||n.op===t.Op.LITERAL&&n.runes.length>1?e+=`(?:${n.appendTo()})`:e+=n.appendTo(),this.op){case t.Op.STAR:e+="*";break;case t.Op.PLUS:e+="+";break;case t.Op.QUEST:e+="?";break;case t.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}";break}(this.flags&ie.NON_GREEDY)!==0&&(e+="?");break}case t.Op.CONCAT:{for(let n of this.subs)n.op===t.Op.ALTERNATE?e+=`(?:${n.appendTo()})`:e+=n.appendTo();break}case t.Op.ALTERNATE:{let n="";for(let r of this.subs)e+=n,n="|",e+=r.appendTo();break}case t.Op.LITERAL:(this.flags&ie.FOLD_CASE)!==0&&(e+="(?i:");for(let n of this.runes)e+=$e.escapeRune(n);(this.flags&ie.FOLD_CASE)!==0&&(e+=")");break;case t.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case t.Op.ANY_CHAR:e+="(?s:.)";break;case t.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==t.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case t.Op.BEGIN_TEXT:e+="\\A";break;case t.Op.END_TEXT:(this.flags&ie.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case t.Op.BEGIN_LINE:e+="^";break;case t.Op.END_LINE:e+="$";break;case t.Op.WORD_BOUNDARY:e+="\\b";break;case t.Op.NO_WORD_BOUNDARY:e+="\\B";break;case t.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===Ae.MAX_RUNE){e+="^";for(let n=1;n<this.runes.length-1;n+=2){let r=this.runes[n]+1,s=this.runes[n+1]-1;e+=t.quoteIfHyphen(r),e+=$e.escapeRune(r),r!==s&&(e+="-",e+=t.quoteIfHyphen(s),e+=$e.escapeRune(s))}}else for(let n=0;n<this.runes.length;n+=2){let r=this.runes[n],s=this.runes[n+1];e+=t.quoteIfHyphen(r),e+=$e.escapeRune(r),r!==s&&(e+="-",e+=t.quoteIfHyphen(s),e+=$e.escapeRune(s))}e+="]";break;default:e+=this.op;break}return e}maxCap(){let e=0;if(this.op===t.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let n of this.subs){let r=n.maxCap();e<r&&(e=r)}return e}equals(e){if(!(e!==null&&e instanceof t)||this.op!==e.op)return!1;switch(this.op){case t.Op.END_TEXT:{if((this.flags&ie.WAS_DOLLAR)!==(e.flags&ie.WAS_DOLLAR))return!1;break}case t.Op.LITERAL:case t.Op.CHAR_CLASS:{if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let n=0;n<this.runes.length;n++)if(this.runes[n]!==e.runes[n])return!1;break}case t.Op.ALTERNATE:case t.Op.CONCAT:{if(this.subs.length!==e.subs.length)return!1;for(let n=0;n<this.subs.length;++n)if(!this.subs[n].equals(e.subs[n]))return!1;break}case t.Op.STAR:case t.Op.PLUS:case t.Op.QUEST:{if((this.flags&ie.NON_GREEDY)!==(e.flags&ie.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break}case t.Op.REPEAT:{if((this.flags&ie.NON_GREEDY)!==(e.flags&ie.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break}case t.Op.CAPTURE:{if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break}}return!0}},da=class{constructor(){this.inst=[],this.start=0,this.numCap=2}getInst(e){return this.inst[e]}numInst(){return this.inst.length}addInst(e){this.inst.push(new ve(e))}skipNop(e){let n=this.inst[e];for(;n.op===ve.NOP||n.op===ve.CAPTURE;)n=this.inst[e],e=n.out;return n}prefix(){let e="",n=this.skipNop(this.start);if(!ve.isRuneOp(n.op)||n.runes.length!==1)return[n.op===ve.MATCH,e];for(;ve.isRuneOp(n.op)&&n.runes.length===1&&(n.arg&ie.FOLD_CASE)===0;)e+=String.fromCodePoint(n.runes[0]),n=this.skipNop(n.out);return[n.op===ve.MATCH,e]}startCond(){let e=0,n=this.start;e:for(;;){let r=this.inst[n];switch(r.op){case ve.EMPTY_WIDTH:e|=r.arg;break;case ve.FAIL:return-1;case ve.CAPTURE:case ve.NOP:break;default:break e}n=r.out}return e}next(e){let n=this.inst[e>>1];return(e&1)===0?n.out:n.arg}patch(e,n){for(;e!==0;){let r=this.inst[e>>1];(e&1)===0?(e=r.out,r.out=n):(e=r.arg,r.arg=n)}}append(e,n){if(e===0)return n;if(n===0)return e;let r=e;for(;;){let i=this.next(r);if(i===0)break;r=i}let s=this.inst[r>>1];return(r&1)===0?s.out=n:s.arg=n,e}toString(){let e="";for(let n=0;n<this.inst.length;n++){let r=e.length;e+=n,n===this.start&&(e+="*"),e+=" ".substring(e.length-r),e+=this.inst[n],e+=`
160
+ `}return e}},Rr=class{constructor(e=0,n=0,r=!1){this.i=e,this.out=n,this.nullable=r}},ma=class t{static ANY_RUNE_NOT_NL(){return[0,U.CODES.get(`
161
+ `)-1,U.CODES.get(`
162
+ `)+1,Ae.MAX_RUNE]}static ANY_RUNE(){return[0,Ae.MAX_RUNE]}static compileRegexp(e){let n=new t,r=n.compile(e);return n.prog.patch(r.out,n.newInst(ve.MATCH).i),n.prog.start=r.i,n.prog}constructor(){this.prog=new da,this.newInst(ve.FAIL)}newInst(e){return this.prog.addInst(e),new Rr(this.prog.numInst()-1,0,!0)}nop(){let e=this.newInst(ve.NOP);return e.out=e.i<<1,e}fail(){return new Rr}cap(e){let n=this.newInst(ve.CAPTURE);return n.out=n.i<<1,this.prog.getInst(n.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),n}cat(e,n){return e.i===0||n.i===0?this.fail():(this.prog.patch(e.out,n.i),new Rr(e.i,n.out,e.nullable&&n.nullable))}alt(e,n){if(e.i===0)return n;if(n.i===0)return e;let r=this.newInst(ve.ALT),s=this.prog.getInst(r.i);return s.out=e.i,s.arg=n.i,r.out=this.prog.append(e.out,n.out),r.nullable=e.nullable||n.nullable,r}loop(e,n){let r=this.newInst(ve.ALT),s=this.prog.getInst(r.i);return n?(s.arg=e.i,r.out=r.i<<1):(s.out=e.i,r.out=r.i<<1|1),this.prog.patch(e.out,r.i),r}quest(e,n){let r=this.newInst(ve.ALT),s=this.prog.getInst(r.i);return n?(s.arg=e.i,r.out=r.i<<1):(s.out=e.i,r.out=r.i<<1|1),r.out=this.prog.append(r.out,e.out),r}star(e,n){return e.nullable?this.quest(this.plus(e,n),n):this.loop(e,n)}plus(e,n){return new Rr(e.i,this.loop(e,n).out,e.nullable)}empty(e){let n=this.newInst(ve.EMPTY_WIDTH);return this.prog.getInst(n.i).arg=e,n.out=n.i<<1,n}rune(e,n){let r=this.newInst(ve.RUNE);r.nullable=!1;let s=this.prog.getInst(r.i);return s.runes=e,n&=ie.FOLD_CASE,(e.length!==1||Ae.simpleFold(e[0])===e[0])&&(n&=-2),s.arg=n,r.out=r.i<<1,(n&ie.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?s.op=ve.RUNE1:e.length===2&&e[0]===0&&e[1]===Ae.MAX_RUNE?s.op=ve.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===U.CODES.get(`
163
+ `)-1&&e[2]===U.CODES.get(`
164
+ `)+1&&e[3]===Ae.MAX_RUNE&&(s.op=ve.RUNE_ANY_NOT_NL),r}compile(e){switch(e.op){case z.Op.NO_MATCH:return this.fail();case z.Op.EMPTY_MATCH:return this.nop();case z.Op.LITERAL:if(e.runes.length===0)return this.nop();{let n=null;for(let r of e.runes){let s=this.rune([r],e.flags);n=n===null?s:this.cat(n,s)}return n}case z.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case z.Op.ANY_CHAR_NOT_NL:return this.rune(t.ANY_RUNE_NOT_NL(),0);case z.Op.ANY_CHAR:return this.rune(t.ANY_RUNE(),0);case z.Op.BEGIN_LINE:return this.empty($e.EMPTY_BEGIN_LINE);case z.Op.END_LINE:return this.empty($e.EMPTY_END_LINE);case z.Op.BEGIN_TEXT:return this.empty($e.EMPTY_BEGIN_TEXT);case z.Op.END_TEXT:return this.empty($e.EMPTY_END_TEXT);case z.Op.WORD_BOUNDARY:return this.empty($e.EMPTY_WORD_BOUNDARY);case z.Op.NO_WORD_BOUNDARY:return this.empty($e.EMPTY_NO_WORD_BOUNDARY);case z.Op.CAPTURE:{let n=this.cap(e.cap<<1),r=this.compile(e.subs[0]),s=this.cap(e.cap<<1|1);return this.cat(this.cat(n,r),s)}case z.Op.STAR:return this.star(this.compile(e.subs[0]),(e.flags&ie.NON_GREEDY)!==0);case z.Op.PLUS:return this.plus(this.compile(e.subs[0]),(e.flags&ie.NON_GREEDY)!==0);case z.Op.QUEST:return this.quest(this.compile(e.subs[0]),(e.flags&ie.NON_GREEDY)!==0);case z.Op.CONCAT:{if(e.subs.length===0)return this.nop();{let n=null;for(let r of e.subs){let s=this.compile(r);n=n===null?s:this.cat(n,s)}return n}}case z.Op.ALTERNATE:{if(e.subs.length===0)return this.nop();{let n=null;for(let r of e.subs){let s=this.compile(r);n=n===null?s:this.alt(n,s)}return n}}default:throw new la("regexp: unhandled case in compile")}}},ga=class t{static simplify(e){if(e===null)return null;switch(e.op){case z.Op.CAPTURE:case z.Op.CONCAT:case z.Op.ALTERNATE:{let n=e;for(let r=0;r<e.subs.length;r++){let s=e.subs[r],i=t.simplify(s);n===e&&i!==s&&(n=z.fromRegexp(e),n.runes=[],n.subs=e.subs.slice(0,e.subs.length)),n!==e&&(n.subs[r]=i)}return n}case z.Op.STAR:case z.Op.PLUS:case z.Op.QUEST:{let n=t.simplify(e.subs[0]);return t.simplify1(e.op,e.flags,n,e)}case z.Op.REPEAT:{if(e.min===0&&e.max===0)return new z(z.Op.EMPTY_MATCH);let n=t.simplify(e.subs[0]);if(e.max===-1){if(e.min===0)return t.simplify1(z.Op.STAR,e.flags,n,null);if(e.min===1)return t.simplify1(z.Op.PLUS,e.flags,n,null);let s=new z(z.Op.CONCAT),i=[];for(let o=0;o<e.min-1;o++)i.push(n);return i.push(t.simplify1(z.Op.PLUS,e.flags,n,null)),s.subs=i.slice(0),s}if(e.min===1&&e.max===1)return n;let r=null;if(e.min>0){r=[];for(let s=0;s<e.min;s++)r.push(n)}if(e.max>e.min){let s=t.simplify1(z.Op.QUEST,e.flags,n,null);for(let i=e.min+1;i<e.max;i++){let o=new z(z.Op.CONCAT);o.subs=[n,s],s=t.simplify1(z.Op.QUEST,e.flags,o,null)}if(r===null)return s;r.push(s)}if(r!==null){let s=new z(z.Op.CONCAT);return s.subs=r.slice(0),s}return new z(z.Op.NO_MATCH)}}return e}static simplify1(e,n,r,s){return r.op===z.Op.EMPTY_MATCH||e===r.op&&(n&ie.NON_GREEDY)===(r.flags&ie.NON_GREEDY)?r:(s!==null&&s.op===e&&(s.flags&ie.NON_GREEDY)===(n&ie.NON_GREEDY)&&r===s.subs[0]||(s=new z(e),s.flags=n,s.subs=[r]),s)}},Pe=class{constructor(e,n){this.sign=e,this.cls=n}},Lf=[48,57],Ff=[9,10,12,13,32,32],Uf=[48,57,65,90,95,95,97,122],Bf=new Map([["\\d",new Pe(1,Lf)],["\\D",new Pe(-1,Lf)],["\\s",new Pe(1,Ff)],["\\S",new Pe(-1,Ff)],["\\w",new Pe(1,Uf)],["\\W",new Pe(-1,Uf)]]),Wf=[48,57,65,90,97,122],zf=[65,90,97,122],Hf=[0,127],jf=[9,9,32,32],Gf=[0,31,127,127],Vf=[48,57],qf=[33,126],Zf=[97,122],Yf=[32,126],Qf=[33,47,58,64,91,96,123,126],Kf=[9,13,32,32],Xf=[65,90],Jf=[48,57,65,90,95,95,97,122],e1=[48,57,65,70,97,102],t1=new Map([["[:alnum:]",new Pe(1,Wf)],["[:^alnum:]",new Pe(-1,Wf)],["[:alpha:]",new Pe(1,zf)],["[:^alpha:]",new Pe(-1,zf)],["[:ascii:]",new Pe(1,Hf)],["[:^ascii:]",new Pe(-1,Hf)],["[:blank:]",new Pe(1,jf)],["[:^blank:]",new Pe(-1,jf)],["[:cntrl:]",new Pe(1,Gf)],["[:^cntrl:]",new Pe(-1,Gf)],["[:digit:]",new Pe(1,Vf)],["[:^digit:]",new Pe(-1,Vf)],["[:graph:]",new Pe(1,qf)],["[:^graph:]",new Pe(-1,qf)],["[:lower:]",new Pe(1,Zf)],["[:^lower:]",new Pe(-1,Zf)],["[:print:]",new Pe(1,Yf)],["[:^print:]",new Pe(-1,Yf)],["[:punct:]",new Pe(1,Qf)],["[:^punct:]",new Pe(-1,Qf)],["[:space:]",new Pe(1,Kf)],["[:^space:]",new Pe(-1,Kf)],["[:upper:]",new Pe(1,Xf)],["[:^upper:]",new Pe(-1,Xf)],["[:word:]",new Pe(1,Jf)],["[:^word:]",new Pe(-1,Jf)],["[:xdigit:]",new Pe(1,e1)],["[:^xdigit:]",new Pe(-1,e1)]]),bn=class t{static charClassToString(e,n){let r="[";for(let s=0;s<n;s+=2){s>0&&(r+=" ");let i=e[s],o=e[s+1];i===o?r+=`0x${i.toString(16)}`:r+=`0x${i.toString(16)}-0x${o.toString(16)}`}return r+="]",r}static cmp(e,n,r,s){let i=e[n]-r;return i!==0?i:s-e[n+1]}static qsortIntPair(e,n,r){let s=((n+r)/2|0)&-2,i=e[s],o=e[s+1],a=n,l=r;for(;a<=l;){for(;a<r&&t.cmp(e,a,i,o)<0;)a+=2;for(;l>n&&t.cmp(e,l,i,o)>0;)l-=2;if(a<=l){if(a!==l){let c=e[a];e[a]=e[l],e[l]=c,c=e[a+1],e[a+1]=e[l+1],e[l+1]=c}a+=2,l-=2}}n<l&&t.qsortIntPair(e,n,l),a<r&&t.qsortIntPair(e,a,r)}constructor(e=$e.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.len===this.r.length?this.r:this.r.slice(0,this.len)}cleanClass(){if(this.len<4)return this;t.qsortIntPair(this.r,0,this.len-2);let e=2;for(let n=2;n<this.len;n+=2){let r=this.r[n],s=this.r[n+1];if(r<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=r,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,n){return(n&ie.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,n){if(this.len>0){for(let r=2;r<=4;r+=2)if(this.len>=r){let s=this.r[this.len-r],i=this.r[this.len-r+1];if(e<=i+1&&s<=n+1)return e<s&&(this.r[this.len-r]=e),n>i&&(this.r[this.len-r+1]=n),this}}return this.r[this.len++]=e,this.r[this.len++]=n,this}appendFoldedRange(e,n){if(e<=Ae.MIN_FOLD&&n>=Ae.MAX_FOLD)return this.appendRange(e,n);if(n<Ae.MIN_FOLD||e>Ae.MAX_FOLD)return this.appendRange(e,n);e<Ae.MIN_FOLD&&(this.appendRange(e,Ae.MIN_FOLD-1),e=Ae.MIN_FOLD),n>Ae.MAX_FOLD&&(this.appendRange(Ae.MAX_FOLD+1,n),n=Ae.MAX_FOLD);for(let r=e;r<=n;r++){this.appendRange(r,r);for(let s=Ae.simpleFold(r);s!==r;s=Ae.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let n=0;n<e.length;n+=2)this.appendRange(e[n],e[n+1]);return this}appendFoldedClass(e){for(let n=0;n<e.length;n+=2)this.appendFoldedRange(e[n],e[n+1]);return this}appendNegatedClass(e){let n=0;for(let r=0;r<e.length;r+=2){let s=e[r],i=e[r+1];n<=s-1&&this.appendRange(n,s-1),n=i+1}return n<=Ae.MAX_RUNE&&this.appendRange(n,Ae.MAX_RUNE),this}appendTable(e){for(let n=0;n<e.length;++n){let r=e.getLo(n),s=e.getHi(n),i=e.getStride(n);if(i===1){this.appendRange(r,s);continue}for(let o=r;o<=s;o+=i)this.appendRange(o,o)}return this}appendNegatedTable(e){let n=0;for(let r=0;r<e.length;++r){let s=e.getLo(r),i=e.getHi(r),o=e.getStride(r);if(o===1){n<=s-1&&this.appendRange(n,s-1),n=i+1;continue}for(let a=s;a<=i;a+=o)n<=a-1&&this.appendRange(n,a-1),n=a+1}return n<=Ae.MAX_RUNE&&this.appendRange(n,Ae.MAX_RUNE),this}appendTableWithSign(e,n){return n<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,n=0;for(let r=0;r<this.len;r+=2){let s=this.r[r],i=this.r[r+1];e<=s-1&&(this.r[n]=e,this.r[n+1]=s-1,n+=2),e=i+1}return this.len=n,e<=Ae.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=Ae.MAX_RUNE),this}appendClassWithSign(e,n){return n<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,n){let r=e.cls;return n&&(r=new t().appendFoldedClass(r).cleanClass().toArray()),this.appendClassWithSign(r,e.sign)}toString(){return t.charClassToString(this.r,this.len)}},ys=class t{static of(e,n){return new t(e,n)}constructor(e,n){this.first=e,this.second=n}},ya=class{constructor(e){this.str=e,this.position=0}pos(){return this.position}rewindTo(e){this.position=e}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(e){this.position+=e}skipString(e){this.position+=e.length}pop(){let e=this.str.codePointAt(this.position);return this.position+=$e.charCount(e),e}lookingAt(e){return this.rest().startsWith(e)}rest(){return this.str.substring(this.position)}from(e){return this.str.substring(e,this.position)}toString(){return this.rest()}},wa=class t{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static MAX_HEIGHT=1e3;static MAX_SIZE=3355443;static MAX_RUNES=33554432;static ANY_TABLE=new k(new Uint32Array([0,Ae.MAX_RUNE,1]));static unicodeTable(e){return e==="Any"?ys.of(t.ANY_TABLE,t.ANY_TABLE):tn.CATEGORIES.has(e)?ys.of(tn.CATEGORIES.get(e),tn.FOLD_CATEGORIES.get(e)):tn.SCRIPTS.has(e)?ys.of(tn.SCRIPTS.get(e),tn.FOLD_SCRIPT.get(e)):null}static minFoldRune(e){if(e<Ae.MIN_FOLD||e>Ae.MAX_FOLD)return e;let n=e,r=e;for(e=Ae.simpleFold(e);e!==r;e=Ae.simpleFold(e))n>e&&(n=e);return n}static leadingRegexp(e){if(e.op===z.Op.EMPTY_MATCH)return null;if(e.op===z.Op.CONCAT&&e.subs.length>0){let n=e.subs[0];return n.op===z.Op.EMPTY_MATCH?null:n}return e}static literalRegexp(e,n){let r=new z(z.Op.LITERAL);return r.flags=n,r.runes=$e.stringToRunes(e),r}static parse(e,n){return new t(e,n).parseInternal()}static parseRepeat(e){let n=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let r=t.parseInt(e);if(r===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=r;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=t.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),r<0||r>1e3||s===-2||s>1e3||s>=0&&r>s)throw new ze(t.ERR_INVALID_REPEAT_SIZE,e.from(n));return r<<16|s&Ae.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let n=0;n<e.length;n++){let r=e.codePointAt(n);if(r!==U.CODES.get("_")&&!$e.isalnum(r))return!1}return!0}static parseInt(e){let n=e.pos();for(;e.more()&&e.peek()>=U.CODES.get("0")&&e.peek()<=U.CODES.get("9");)e.skip(1);let r=e.from(n);return r.length===0||r.length>1&&r.codePointAt(0)===U.CODES.get("0")?-1:r.length>8?-2:parseFloat(r,10)}static isCharClass(e){return e.op===z.Op.LITERAL&&e.runes.length===1||e.op===z.Op.CHAR_CLASS||e.op===z.Op.ANY_CHAR_NOT_NL||e.op===z.Op.ANY_CHAR}static matchRune(e,n){switch(e.op){case z.Op.LITERAL:return e.runes.length===1&&e.runes[0]===n;case z.Op.CHAR_CLASS:for(let r=0;r<e.runes.length;r+=2)if(e.runes[r]<=n&&n<=e.runes[r+1])return!0;return!1;case z.Op.ANY_CHAR_NOT_NL:return n!==U.CODES.get(`
165
+ `);case z.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,n){switch(e.op){case z.Op.ANY_CHAR:break;case z.Op.ANY_CHAR_NOT_NL:t.matchRune(n,U.CODES.get(`
166
+ `))&&(e.op=z.Op.ANY_CHAR);break;case z.Op.CHAR_CLASS:n.op===z.Op.LITERAL?e.runes=new bn(e.runes).appendLiteral(n.runes[0],n.flags).toArray():e.runes=new bn(e.runes).appendClass(n.runes).toArray();break;case z.Op.LITERAL:if(n.runes[0]===e.runes[0]&&n.flags===e.flags)break;e.op=z.Op.CHAR_CLASS,e.runes=new bn().appendLiteral(e.runes[0],e.flags).appendLiteral(n.runes[0],n.flags).toArray();break}}static parseEscape(e){let n=e.pos();if(e.skip(1),!e.more())throw new ze(t.ERR_TRAILING_BACKSLASH);let r=e.pop();e:switch(r){case U.CODES.get("1"):case U.CODES.get("2"):case U.CODES.get("3"):case U.CODES.get("4"):case U.CODES.get("5"):case U.CODES.get("6"):case U.CODES.get("7"):if(!e.more()||e.peek()<U.CODES.get("0")||e.peek()>U.CODES.get("7"))break;case U.CODES.get("0"):{let s=r-U.CODES.get("0");for(let i=1;i<3&&!(!e.more()||e.peek()<U.CODES.get("0")||e.peek()>U.CODES.get("7"));i++)s=s*8+e.peek()-U.CODES.get("0"),e.skip(1);return s}case U.CODES.get("x"):{if(!e.more())break;if(r=e.pop(),r===U.CODES.get("{")){let o=0,a=0;for(;;){if(!e.more())break e;if(r=e.pop(),r===U.CODES.get("}"))break;let l=$e.unhex(r);if(l<0||(a=a*16+l,a>Ae.MAX_RUNE))break e;o++}if(o===0)break e;return a}let s=$e.unhex(r);if(!e.more())break;r=e.pop();let i=$e.unhex(r);if(s<0||i<0)break;return s*16+i}case U.CODES.get("a"):return U.CODES.get("\x07");case U.CODES.get("f"):return U.CODES.get("\f");case U.CODES.get("n"):return U.CODES.get(`
167
+ `);case U.CODES.get("r"):return U.CODES.get("\r");case U.CODES.get("t"):return U.CODES.get(" ");case U.CODES.get("v"):return U.CODES.get("\v");default:if(r<=Ae.MAX_ASCII&&!$e.isalnum(r))return r;break}throw new ze(t.ERR_INVALID_ESCAPE,e.from(n))}static parseClassChar(e,n){if(!e.more())throw new ze(t.ERR_MISSING_BRACKET,e.from(n));return e.lookingAt("\\")?t.parseEscape(e):e.pop()}static concatRunes(e,n){return[...e,...n]}constructor(e,n=0){this.wholeRegexp=e,this.flags=n,this.numCap=0,this.namedGroups={},this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null}newRegexp(e){let n=this.free;return n!==null&&n.subs!==null&&n.subs.length>0?(this.free=n.subs[0],n.reinit(),n.op=e):(n=new z(e),this.numRegexp+=1),n}reuse(e){this.height!==null&&Object.prototype.hasOwnProperty.call(this.height,e)&&delete this.height[e],e.subs!==null&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(e){if(this.numRunes>t.MAX_RUNES)throw new ze(t.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===z.Op.REPEAT){let n=e.max;n===-1&&(n=e.min),n<=0&&(n=1),n>t.MAX_SIZE/this.repeats?this.repeats=t.MAX_SIZE:this.repeats*=n}if(this.numRegexp<t.MAX_SIZE/this.repeats)return;this.size={};for(let n of this.stack)this.checkSize(n)}if(this.calcSize(e,!0)>t.MAX_SIZE)throw new ze(t.ERR_LARGE)}calcSize(e,n=!1){if(!n&&Object.prototype.hasOwnProperty.call(this.size,e))return this.size[e];let r=0;switch(e.op){case z.Op.LITERAL:{r=e.runes.length;break}case z.Op.CAPTURE:case z.Op.STAR:{r=2+this.calcSize(e.subs[0]);break}case z.Op.PLUS:case z.Op.QUEST:{r=1+this.calcSize(e.subs[0]);break}case z.Op.CONCAT:{for(let s of e.subs)r=r+this.calcSize(s);break}case z.Op.ALTERNATE:{for(let s of e.subs)r=r+this.calcSize(s);e.subs.length>1&&(r=r+e.subs.length-1);break}case z.Op.REPEAT:{let s=this.calcSize(e.subs[0]);if(e.max===-1){e.min===0?r=2+s:r=1+e.min*s;break}r=e.max*s+(e.max-e.min);break}}return r=Math.max(1,r),this.size[e]=r,r}checkHeight(e){if(!(this.numRegexp<t.MAX_HEIGHT)){if(this.height===null){this.height={};for(let n of this.stack)this.checkHeight(n)}if(this.calcHeight(e,!0)>t.MAX_HEIGHT)throw new ze(t.ERR_NESTING_DEPTH)}}calcHeight(e,n=!1){if(!n&&Object.prototype.hasOwnProperty.call(this.height,e))return this.height[e];let r=1;for(let s of e.subs){let i=this.calcHeight(s);r<1+i&&(r=1+i)}return this.height[e]=r,r}pop(){return this.stack.pop()}popToPseudo(){let e=this.stack.length,n=e;for(;n>0&&!z.isPseudoOp(this.stack[n-1].op);)n--;let r=this.stack.slice(n,e);return this.stack=this.stack.slice(0,n),r}push(e){if(this.numRunes+=e.runes.length,e.op===z.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&-2))return null;e.op=z.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&-2}else if(e.op===z.Op.CHAR_CLASS&&e.runes.length===4&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&Ae.simpleFold(e.runes[0])===e.runes[2]&&Ae.simpleFold(e.runes[2])===e.runes[0]||e.op===z.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]+1===e.runes[1]&&Ae.simpleFold(e.runes[0])===e.runes[1]&&Ae.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|ie.FOLD_CASE))return null;e.op=z.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|ie.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,n){let r=this.stack.length;if(r<2)return!1;let s=this.stack[r-1],i=this.stack[r-2];return s.op!==z.Op.LITERAL||i.op!==z.Op.LITERAL||(s.flags&ie.FOLD_CASE)!==(i.flags&ie.FOLD_CASE)?!1:(i.runes=t.concatRunes(i.runes,s.runes),e>=0?(s.runes=[e],s.flags=n,!0):(this.pop(),this.reuse(s),!1))}newLiteral(e,n){let r=this.newRegexp(z.Op.LITERAL);return r.flags=n,(n&ie.FOLD_CASE)!==0&&(e=t.minFoldRune(e)),r.runes=[e],r}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){let n=this.newRegexp(e);return n.flags=this.flags,this.push(n)}repeat(e,n,r,s,i,o){let a=this.flags;if((a&ie.PERL_X)!==0&&(i.more()&&i.lookingAt("?")&&(i.skip(1),a^=ie.NON_GREEDY),o!==-1))throw new ze(t.ERR_INVALID_REPEAT_OP,i.from(o));let l=this.stack.length;if(l===0)throw new ze(t.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let c=this.stack[l-1];if(z.isPseudoOp(c.op))throw new ze(t.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let u=this.newRegexp(e);if(u.min=n,u.max=r,u.flags=a,u.subs=[c],this.stack[l-1]=u,this.checkLimits(u),e===z.Op.REPEAT&&(n>=2||r>=2)&&!this.repeatIsValid(u,1e3))throw new ze(t.ERR_INVALID_REPEAT_SIZE,i.from(s))}repeatIsValid(e,n){if(e.op===z.Op.REPEAT){let r=e.max;if(r===0)return!0;if(r<0&&(r=e.min),r>n)return!1;r>0&&(n=Math.trunc(n/r))}for(let r of e.subs)if(!this.repeatIsValid(r,n))return!1;return!0}concat(){this.maybeConcat(-1,0);let e=this.popToPseudo();return e.length===0?this.push(this.newRegexp(z.Op.EMPTY_MATCH)):this.push(this.collapse(e,z.Op.CONCAT))}alternate(){let e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(z.Op.NO_MATCH)):this.push(this.collapse(e,z.Op.ALTERNATE))}cleanAlt(e){e.op===z.Op.CHAR_CLASS&&(e.runes=new bn(e.runes).cleanClass().toArray(),e.runes.length===2&&e.runes[0]===0&&e.runes[1]===Ae.MAX_RUNE?(e.runes=[],e.op=z.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===U.CODES.get(`
168
+ `)-1&&e.runes[2]===U.CODES.get(`
169
+ `)+1&&e.runes[3]===Ae.MAX_RUNE&&(e.runes=[],e.op=z.Op.ANY_CHAR_NOT_NL))}collapse(e,n){if(e.length===1)return e[0];let r=0;for(let a of e)r+=a.op===n?a.subs.length:1;let s=new Array(r).fill(null),i=0;for(let a of e)a.op===n?(s.splice(i,a.subs.length,...a.subs),i+=a.subs.length,this.reuse(a)):s[i++]=a;let o=this.newRegexp(n);if(o.subs=s,n===z.Op.ALTERNATE&&(o.subs=this.factor(o.subs),o.subs.length===1)){let a=o;o=o.subs[0],this.reuse(a)}return o}factor(e){if(e.length<2)return e;let n=0,r=e.length,s=0,i=null,o=0,a=0,l=0;for(let u=0;u<=r;u++){let f=null,p=0,h=0;if(u<r){let m=e[n+u];if(m.op===z.Op.CONCAT&&m.subs.length>0&&(m=m.subs[0]),m.op===z.Op.LITERAL&&(f=m.runes,p=m.runes.length,h=m.flags&ie.FOLD_CASE),h===a){let d=0;for(;d<o&&d<p&&i[d]===f[d];)d++;if(d>0){o=d;continue}}}if(u!==l)if(u===l+1)e[s++]=e[n+l];else{let m=this.newRegexp(z.Op.LITERAL);m.flags=a,m.runes=i.slice(0,o);for(let w=l;w<u;w++)e[n+w]=this.removeLeadingString(e[n+w],o),this.checkLimits(e[n+w]);let d=this.collapse(e.slice(n+l,n+u),z.Op.ALTERNATE),g=this.newRegexp(z.Op.CONCAT);g.subs=[m,d],e[s++]=g}l=u,i=f,o=p,a=h}r=s,n=0,l=0,s=0;let c=null;for(let u=0;u<=r;u++){let f=null;if(!(u<r&&(f=t.leadingRegexp(e[n+u]),c!==null&&c.equals(f)&&(t.isCharClass(c)||c.op===z.Op.REPEAT&&c.min===c.max&&t.isCharClass(c.subs[0]))))){if(u!==l)if(u===l+1)e[s++]=e[n+l];else{let p=c;for(let d=l;d<u;d++){let g=d!==l;e[n+d]=this.removeLeadingRegexp(e[n+d],g),this.checkLimits(e[n+d])}let h=this.collapse(e.slice(n+l,n+u),z.Op.ALTERNATE),m=this.newRegexp(z.Op.CONCAT);m.subs=[p,h],e[s++]=m}l=u,c=f}}r=s,n=0,l=0,s=0;for(let u=0;u<=r;u++)if(!(u<r&&t.isCharClass(e[n+u]))){if(u!==l)if(u===l+1)e[s++]=e[n+l];else{let f=l;for(let h=l+1;h<u;h++){let m=e[n+f],d=e[n+h];(m.op<d.op||m.op===d.op&&(m.runes!==null?m.runes.length:0)<(d.runes!==null?d.runes.length:0))&&(f=h)}let p=e[n+l];e[n+l]=e[n+f],e[n+f]=p;for(let h=l+1;h<u;h++)t.mergeCharClass(e[n+l],e[n+h]),this.reuse(e[n+h]);this.cleanAlt(e[n+l]),e[s++]=e[n+l]}u<r&&(e[s++]=e[n+u]),l=u+1}r=s,n=0,l=0,s=0;for(let u=0;u<r;++u)u+1<r&&e[n+u].op===z.Op.EMPTY_MATCH&&e[n+u+1].op===z.Op.EMPTY_MATCH||(e[s++]=e[n+u]);return r=s,n=0,e.slice(n,r)}removeLeadingString(e,n){if(e.op===z.Op.CONCAT&&e.subs.length>0){let r=this.removeLeadingString(e.subs[0],n);if(e.subs[0]=r,r.op===z.Op.EMPTY_MATCH)switch(this.reuse(r),e.subs.length){case 0:case 1:e.op=z.Op.EMPTY_MATCH,e.subs=null;break;case 2:{let s=e;e=e.subs[1],this.reuse(s);break}default:e.subs=e.subs.slice(1,e.subs.length);break}return e}return e.op===z.Op.LITERAL&&(e.runes=e.runes.slice(n,e.runes.length),e.runes.length===0&&(e.op=z.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,n){if(e.op===z.Op.CONCAT&&e.subs.length>0){switch(n&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:{e.op=z.Op.EMPTY_MATCH,e.subs=z.emptySubs();break}case 1:{let r=e;e=e.subs[0],this.reuse(r);break}}return e}return n&&this.reuse(e),this.newRegexp(z.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&ie.LITERAL)!==0)return t.literalRegexp(this.wholeRegexp,this.flags);let e=-1,n=-1,r=-1,s=new ya(this.wholeRegexp);for(;s.more();){let o=-1;e:switch(s.peek()){case U.CODES.get("("):if((this.flags&ie.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(z.Op.LEFT_PAREN).cap=++this.numCap,s.skip(1);break;case U.CODES.get("|"):this.parseVerticalBar(),s.skip(1);break;case U.CODES.get(")"):this.parseRightParen(),s.skip(1);break;case U.CODES.get("^"):(this.flags&ie.ONE_LINE)!==0?this.op(z.Op.BEGIN_TEXT):this.op(z.Op.BEGIN_LINE),s.skip(1);break;case U.CODES.get("$"):(this.flags&ie.ONE_LINE)!==0?this.op(z.Op.END_TEXT).flags|=ie.WAS_DOLLAR:this.op(z.Op.END_LINE),s.skip(1);break;case U.CODES.get("."):(this.flags&ie.DOT_NL)!==0?this.op(z.Op.ANY_CHAR):this.op(z.Op.ANY_CHAR_NOT_NL),s.skip(1);break;case U.CODES.get("["):this.parseClass(s);break;case U.CODES.get("*"):case U.CODES.get("+"):case U.CODES.get("?"):{o=s.pos();let a=null;switch(s.pop()){case U.CODES.get("*"):a=z.Op.STAR;break;case U.CODES.get("+"):a=z.Op.PLUS;break;case U.CODES.get("?"):a=z.Op.QUEST;break}this.repeat(a,n,r,o,s,e);break}case U.CODES.get("{"):{o=s.pos();let a=t.parseRepeat(s);if(a<0){s.rewindTo(o),this.literal(s.pop());break}n=a>>16,r=(a&Ae.MAX_BMP)<<16>>16,this.repeat(z.Op.REPEAT,n,r,o,s,e);break}case U.CODES.get("\\"):{let a=s.pos();if(s.skip(1),(this.flags&ie.PERL_X)!==0&&s.more())switch(s.pop()){case U.CODES.get("A"):this.op(z.Op.BEGIN_TEXT);break e;case U.CODES.get("b"):this.op(z.Op.WORD_BOUNDARY);break e;case U.CODES.get("B"):this.op(z.Op.NO_WORD_BOUNDARY);break e;case U.CODES.get("C"):throw new ze(t.ERR_INVALID_ESCAPE,"\\C");case U.CODES.get("Q"):{let f=s.rest(),p=f.indexOf("\\E");p>=0&&(f=f.substring(0,p)),s.skipString(f),s.skipString("\\E");let h=0;for(;h<f.length;){let m=f.codePointAt(h);this.literal(m),h+=$e.charCount(m)}break e}case U.CODES.get("z"):this.op(z.Op.END_TEXT);break e;default:s.rewindTo(a);break}let l=this.newRegexp(z.Op.CHAR_CLASS);if(l.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){let u=new bn;if(this.parseUnicodeClass(s,u)){l.runes=u.toArray(),this.push(l);break e}}let c=new bn;if(this.parsePerlClassEscape(s,c)){l.runes=c.toArray(),this.push(l);break e}s.rewindTo(a),this.reuse(l),this.literal(t.parseEscape(s));break}default:this.literal(s.pop());break}e=o}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new ze(t.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){let n=e.pos(),r=e.rest();if(r.startsWith("(?P<")||r.startsWith("(?<")){let a=r.charAt(2)==="P"?4:3,l=r.indexOf(">");if(l<0)throw new ze(t.ERR_INVALID_NAMED_CAPTURE,r);let c=r.substring(a,l);if(e.skipString(c),e.skip(a+1),!t.isValidCaptureName(c))throw new ze(t.ERR_INVALID_NAMED_CAPTURE,r.substring(0,l+1));let u=this.op(z.Op.LEFT_PAREN);if(u.cap=++this.numCap,this.namedGroups[c])throw new ze(t.ERR_DUPLICATE_NAMED_CAPTURE,c);this.namedGroups[c]=this.numCap,u.name=c;return}e.skip(2);let s=this.flags,i=1,o=!1;e:for(;e.more();){let a=e.pop();switch(a){case U.CODES.get("i"):s|=ie.FOLD_CASE,o=!0;break;case U.CODES.get("m"):s&=-17,o=!0;break;case U.CODES.get("s"):s|=ie.DOT_NL,o=!0;break;case U.CODES.get("U"):s|=ie.NON_GREEDY,o=!0;break;case U.CODES.get("-"):if(i<0)break e;i=-1,s=~s,o=!1;break;case U.CODES.get(":"):case U.CODES.get(")"):if(i<0){if(!o)break e;s=~s}a===U.CODES.get(":")&&this.op(z.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new ze(t.ERR_INVALID_PERL_OP,e.from(n))}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(z.Op.VERTICAL_BAR)}swapVerticalBar(){let e=this.stack.length;if(e>=3&&this.stack[e-2].op===z.Op.VERTICAL_BAR&&t.isCharClass(this.stack[e-1])&&t.isCharClass(this.stack[e-3])){let n=this.stack[e-1],r=this.stack[e-3];if(n.op>r.op){let s=r;r=n,n=s,this.stack[e-3]=r}return t.mergeCharClass(r,n),this.reuse(n),this.pop(),!0}if(e>=2){let n=this.stack[e-1],r=this.stack[e-2];if(r.op===z.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=n,this.stack[e-1]=r,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new ze(t.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let n=this.pop(),r=this.pop();if(r.op!==z.Op.LEFT_PAREN)throw new ze(t.ERR_UNEXPECTED_PAREN,this.wholeRegexp);this.flags=r.flags,r.cap===0?this.push(n):(r.op=z.Op.CAPTURE,r.subs=[n],this.push(r))}parsePerlClassEscape(e,n){let r=e.pos();if((this.flags&ie.PERL_X)===0||!e.more()||e.pop()!==U.CODES.get("\\")||!e.more())return!1;e.pop();let s=e.from(r),i=Bf.has(s)?Bf.get(s):null;return i===null?!1:(n.appendGroup(i,(this.flags&ie.FOLD_CASE)!==0),!0)}parseNamedClass(e,n){let r=e.rest(),s=r.indexOf(":]");if(s<0)return!1;let i=r.substring(0,s+2);e.skipString(i);let o=t1.has(i)?t1.get(i):null;if(o===null)throw new ze(t.ERR_INVALID_CHAR_RANGE,i);return n.appendGroup(o,(this.flags&ie.FOLD_CASE)!==0),!0}parseUnicodeClass(e,n){let r=e.pos();if((this.flags&ie.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let s=1,i=e.pop();if(i===U.CODES.get("P")&&(s=-1),!e.more())throw e.rewindTo(r),new ze(t.ERR_INVALID_CHAR_RANGE,e.rest());i=e.pop();let o;if(i!==U.CODES.get("{"))o=$e.runeToString(i);else{let u=e.rest(),f=u.indexOf("}");if(f<0)throw e.rewindTo(r),new ze(t.ERR_INVALID_CHAR_RANGE,e.rest());o=u.substring(0,f),e.skipString(o),e.skip(1)}o.length!==0&&o.codePointAt(0)===U.CODES.get("^")&&(s=0-s,o=o.substring(1));let a=t.unicodeTable(o);if(a===null)throw new ze(t.ERR_INVALID_CHAR_RANGE,e.from(r));let l=a.first,c=a.second;if((this.flags&ie.FOLD_CASE)===0||c===null)n.appendTableWithSign(l,s);else{let u=new bn().appendTable(l).appendTable(c).cleanClass().toArray();n.appendClassWithSign(u,s)}return!0}parseClass(e){let n=e.pos();e.skip(1);let r=this.newRegexp(z.Op.CHAR_CLASS);r.flags=this.flags;let s=new bn,i=1;e.more()&&e.lookingAt("^")&&(i=-1,e.skip(1),(this.flags&ie.CLASS_NL)===0&&s.appendRange(U.CODES.get(`
170
+ `),U.CODES.get(`
171
+ `)));let o=!0;for(;!e.more()||e.peek()!==U.CODES.get("]")||o;){if(e.more()&&e.lookingAt("-")&&(this.flags&ie.PERL_X)===0&&!o){let u=e.rest();if(u==="-"||!u.startsWith("-]"))throw e.rewindTo(n),new ze(t.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;let a=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(a)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(a);let l=t.parseClassChar(e,n),c=l;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(c=t.parseClassChar(e,n),c<l)throw new ze(t.ERR_INVALID_CHAR_RANGE,e.from(a))}(this.flags&ie.FOLD_CASE)===0?s.appendRange(l,c):s.appendFoldedRange(l,c)}e.skip(1),s.cleanClass(),i<0&&s.negateClass(),r.runes=s.toArray(),this.push(r)}},ba=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}compareAndSet(e,n){return this.value===e?(this.value=n,!0):!1}},xa=class t{static initTest(e){let n=t.compile(e),r=new t(n.expr,n.prog,n.numSubexp,n.longest);return r.cond=n.cond,r.prefix=n.prefix,r.prefixUTF8=n.prefixUTF8,r.prefixComplete=n.prefixComplete,r.prefixRune=n.prefixRune,r}static compile(e){return t.compileImpl(e,ie.PERL,!1)}static compilePOSIX(e){return t.compileImpl(e,ie.POSIX,!0)}static compileImpl(e,n,r){let s=wa.parse(e,n),i=s.maxCap();s=ga.simplify(s);let o=ma.compileRegexp(s),a=new t(e,o,i,r),[l,c]=o.prefix();return a.prefixComplete=l,a.prefix=c,a.prefixUTF8=$e.stringToUtf8ByteArray(a.prefix),a.prefix.length>0&&(a.prefixRune=a.prefix.codePointAt(0)),a.namedGroups=s.namedGroups,a}static match(e,n){return t.compile(e).match(n)}constructor(e,n,r=0,s=0){this.expr=e,this.prog=n,this.numSubexp=r,this.longest=s,this.cond=n.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new ba}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){let e;do e=this.pooled.get();while(e&&!this.pooled.compareAndSet(e,e.next));return e}reset(){this.pooled.set(null)}put(e,n){let r=this.pooled.get();do r=this.pooled.get(),!n&&r&&(e=gs.fromMachine(e),n=!0),e.next!==r&&(e.next=r);while(!this.pooled.compareAndSet(r,e))}toString(){return this.expr}doExecute(e,n,r,s){let i=this.get(),o=!1;i?i.next!==null&&(i=gs.fromMachine(i),o=!0):(i=gs.fromRE2(this),o=!0),i.init(s);let a=i.match(e,n,r)?i.submatches():null;return this.put(i,o),a}match(e){return this.doExecute(Je.fromUTF16(e),0,ie.UNANCHORED,0)!==null}matchWithGroup(e,n,r,s,i){return e instanceof Un||(e=Pr.utf16(e)),this.matchMachineInput(e,n,r,s,i)}matchMachineInput(e,n,r,s,i){if(n>r)return[!1,null];let o=e.isUTF16Encoding()?Je.fromUTF16(e.asCharSequence(),0,r):Je.fromUTF8(e.asBytes(),0,r),a=this.doExecute(o,n,s,2*i);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.doExecute(Je.fromUTF8(e),0,ie.UNANCHORED,0)!==null}replaceAll(e,n){return this.replaceAllFunc(e,()=>n,2*e.length+1)}replaceFirst(e,n){return this.replaceAllFunc(e,()=>n,1)}replaceAllFunc(e,n,r){let s=0,i=0,o="",a=Je.fromUTF16(e),l=0;for(;i<=e.length;){let c=this.doExecute(a,i,ie.UNANCHORED,2);if(c===null||c.length===0)break;o+=e.substring(s,c[0]),(c[1]>s||c[0]===0)&&(o+=n(e.substring(c[0],c[1])),l++),s=c[1];let u=a.step(i)&7;if(i+u>c[1]?i+=u:i+1>c[1]?i++:i=c[1],l>=r)break}return o+=e.substring(s),o}pad(e){if(e===null)return null;let n=(1+this.numSubexp)*2;if(e.length<n){let r=new Array(n).fill(-1);for(let s=0;s<e.length;s++)r[s]=e[s];e=r}return e}allMatches(e,n,r=s=>s){let s=[],i=e.endPos();n<0&&(n=i+1);let o=0,a=0,l=-1;for(;a<n&&o<=i;){let c=this.doExecute(e,o,ie.UNANCHORED,this.prog.numCap);if(c===null||c.length===0)break;let u=!0;if(c[1]===o){c[0]===l&&(u=!1);let f=e.step(o);f<0?o=i+1:o+=f&7}else o=c[1];l=c[1],u&&(s.push(r(this.pad(c))),a++)}return s}findUTF8(e){let n=this.doExecute(Je.fromUTF8(e),0,ie.UNANCHORED,2);return n===null?null:e.slice(n[0],n[1])}findUTF8Index(e){let n=this.doExecute(Je.fromUTF8(e),0,ie.UNANCHORED,2);return n===null?null:n.slice(0,2)}find(e){let n=this.doExecute(Je.fromUTF16(e),0,ie.UNANCHORED,2);return n===null?"":e.substring(n[0],n[1])}findIndex(e){return this.doExecute(Je.fromUTF16(e),0,ie.UNANCHORED,2)}findUTF8Submatch(e){let n=this.doExecute(Je.fromUTF8(e),0,ie.UNANCHORED,this.prog.numCap);if(n===null)return null;let r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<n.length&&n[2*s]>=0&&(r[s]=e.slice(n[2*s],n[2*s+1]));return r}findUTF8SubmatchIndex(e){return this.pad(this.doExecute(Je.fromUTF8(e),0,ie.UNANCHORED,this.prog.numCap))}findSubmatch(e){let n=this.doExecute(Je.fromUTF16(e),0,ie.UNANCHORED,this.prog.numCap);if(n===null)return null;let r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<n.length&&n[2*s]>=0&&(r[s]=e.substring(n[2*s],n[2*s+1]));return r}findSubmatchIndex(e){return this.pad(this.doExecute(Je.fromUTF16(e),0,ie.UNANCHORED,this.prog.numCap))}findAllUTF8(e,n){let r=this.allMatches(Je.fromUTF8(e),n,s=>e.slice(s[0],s[1]));return r.length===0?null:r}findAllUTF8Index(e,n){let r=this.allMatches(Je.fromUTF8(e),n,s=>s.slice(0,2));return r.length===0?null:r}findAll(e,n){let r=this.allMatches(Je.fromUTF16(e),n,s=>e.substring(s[0],s[1]));return r.length===0?null:r}findAllIndex(e,n){let r=this.allMatches(Je.fromUTF16(e),n,s=>s.slice(0,2));return r.length===0?null:r}findAllUTF8Submatch(e,n){let r=this.allMatches(Je.fromUTF8(e),n,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.slice(s[2*o],s[2*o+1]));return i});return r.length===0?null:r}findAllUTF8SubmatchIndex(e,n){let r=this.allMatches(Je.fromUTF8(e),n);return r.length===0?null:r}findAllSubmatch(e,n){let r=this.allMatches(Je.fromUTF16(e),n,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.substring(s[2*o],s[2*o+1]));return i});return r.length===0?null:r}findAllSubmatchIndex(e,n){let r=this.allMatches(Je.fromUTF16(e),n);return r.length===0?null:r}},Ea=class t{static isUpperCaseAlpha(e){return"A"<=e&&e<="Z"}static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static getUtf8CharSize(e){let n=e.charCodeAt(0);return n<128?1:n<2048?2:n<65536?3:4}static translate(e){if(typeof e!="string")return e;let n="",r=!1,s=e.length;s===0&&(n="(?:)",r=!0);let i=0;for(;i<s;){let o=e[i];if(o==="\\"){if(i+1<s)switch(o=e[i+1],o){case"\\":{n+="\\\\",i+=2;continue}case"c":{if(i+2<s){let l=e[i+2];if(t.isUpperCaseAlpha(l)){n+="\\x",n+=(l.charCodeAt(0)-64>>4).toString(16).toUpperCase(),n+=(l.charCodeAt(0)-64&15).toString(16).toUpperCase(),i+=3,r=!0;continue}}n+="\\c",i+=2;continue}case"u":{if(i+2<s){let l=e[i+2];if(t.isHexadecimal(l)){n+="\\x{"+l,i+=3;for(let c=0;c<3&&i<s&&(l=e[i],!!t.isHexadecimal(l));++i,++c)n+=l;n+="}",r=!0;continue}else if(l==="{"){n+="\\x",i+=2,r=!0;continue}}n+="\\u",i+=2;continue}default:{n+="\\";let l=t.getUtf8CharSize(o);n+=e.substring(i+1,i+1+l),i+=l+1;continue}}}else if(o==="/"){n+="\\/",i+=1,r=!0;continue}else if(o==="("&&i+2<s&&e[i+1]==="?"&&e[i+2]==="<"&&(i+3>=s||e[i+3]!=="="&&e[i+3]!=="!")){n+="(?P<",i+=3,r=!0;continue}let a=t.getUtf8CharSize(o);n+=e.substring(i,i+a),i+=a}return r?n:e}},Bn=class t{static CASE_INSENSITIVE=1;static DOTALL=2;static MULTILINE=4;static DISABLE_UNICODE_GROUPS=8;static LONGEST_MATCH=16;static quote(e){return $e.quoteMeta(e)}static translateRegExp(e){return Ea.translate(e)}static compile(e,n=0){let r=e;if((n&t.CASE_INSENSITIVE)!==0&&(r=`(?i)${r}`),(n&t.DOTALL)!==0&&(r=`(?s)${r}`),(n&t.MULTILINE)!==0&&(r=`(?m)${r}`),(n&~(t.MULTILINE|t.DOTALL|t.CASE_INSENSITIVE|t.DISABLE_UNICODE_GROUPS|t.LONGEST_MATCH))!==0)throw new ca("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");let s=ie.PERL;(n&t.DISABLE_UNICODE_GROUPS)!==0&&(s&=-129);let i=new t(e,n);return i.re2Input=xa.compileImpl(r,s,(n&t.LONGEST_MATCH)!==0),i}static matches(e,n){return t.compile(e).matcher(n).matches()}static initTest(e,n,r){if(e==null)throw new Error("pattern is null");if(r==null)throw new Error("re2 is null");let s=new t(e,n);return s.re2Input=r,s}constructor(e,n){this.patternInput=e,this.flagsInput=n}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.matcher(e).matches()}matcher(e){return Array.isArray(e)&&(e=Pr.utf8(e)),new ua(this,e)}split(e,n=0){let r=this.matcher(e),s=[],i=0,o=0;for(;r.find();){if(o===0&&r.end()===0){o=r.end();continue}if(n>0&&s.length===n-1)break;if(o===r.start()){if(n===0){i+=1,o=r.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(r.substring(o,r.start())),o=r.end()}if(n===0&&o!==r.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(r.substring(o,r.inputLength()))}return(n!==0||s.length===0)&&s.push(r.substring(o,r.inputLength())),s}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}}});function Fy(t){let e=0;return t.includes("i")&&(e|=Bn.CASE_INSENSITIVE),t.includes("m")&&(e|=Bn.MULTILINE),t.includes("s")&&(e|=Bn.DOTALL),e}function Uy(t){return Bn.translateRegExp(t)}function ee(t,e=""){return new mi(t,e)}var mi,Rn,s1=I(()=>{"use strict";r1();mi=class{_re2;_pattern;_flags;_global;_ignoreCase;_multiline;_lastIndex=0;_nativeRegex=null;constructor(e,n=""){this._pattern=e,this._flags=n,this._global=n.includes("g"),this._ignoreCase=n.includes("i"),this._multiline=n.includes("m");try{let r=Uy(e),s=Fy(n);this._re2=Bn.compile(r,s)}catch(r){if(r instanceof ze){let s=r.message||"",i="";throw s.includes("(?=")||s.includes("(?!")||s.includes("(?<")||s.includes("(?<!")||e.includes("(?=")||e.includes("(?!")||e.includes("(?<=")||e.includes("(?<!")?i=" Lookahead (?=, ?!) and lookbehind (?<=, ?<!) assertions are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support these features.":(s.includes("backreference")||/\\[1-9]/.test(e))&&(i=" Backreferences (\\1, \\2, etc.) are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support backreferences."),new SyntaxError(`Invalid regular expression: /${e}/: ${s}${i}`)}throw r}}test(e){return this._global&&(this._lastIndex=0),this._re2.matcher(e).find()}exec(e){let n=this._re2.matcher(e),r=this._global?this._lastIndex:0;if(!n.find(r))return this._global&&(this._lastIndex=0),null;let s=this._re2.groupCount(),i=[];i.push(n.group(0)??"");for(let l=1;l<=s;l++){let c=n.group(l);i.push(c)}let o=i;o.index=n.start(0),o.input=e;let a=this._re2.namedGroups();if(a&&Object.keys(a).length>0){let l=Object.create(null);for(let[c,u]of Object.entries(a)){let f=n.group(u);f!==null&&(l[c]=f)}o.groups=l}return this._global&&(this._lastIndex=n.end(0),n.start(0)===n.end(0)&&this._lastIndex++),o}match(e){if(this._global&&(this._lastIndex=0),!this._global)return this.exec(e);let n=[],r=this._re2.matcher(e),s=0;for(;r.find(s);){let i=r.group(0)??"";if(n.push(i),s=r.end(0),r.start(0)===r.end(0)&&s++,s>e.length)break}return n.length>0?n:null}replace(e,n){if(this._global&&(this._lastIndex=0),typeof n=="string"){let c=this._re2.matcher(e);return this._global?c.replaceAll(n,!0):c.replaceFirst(n,!0)}let r=[],s=this._re2.matcher(e),i=0,o=0,a=this._re2.groupCount(),l=this._re2.namedGroups();for(;s.find(o);){r.push(e.slice(i,s.start(0)));let c=[],u=s.group(0)??"";for(let f=1;f<=a;f++)c.push(s.group(f));if(c.push(s.start(0)),c.push(e),l&&Object.keys(l).length>0){let f=Object.create(null);for(let[p,h]of Object.entries(l))f[p]=s.group(h)??"";c.push(f)}if(r.push(n(u,...c)),i=s.end(0),o=i,s.start(0)===s.end(0)&&o++,!this._global||o>e.length)break}return r.push(e.slice(i)),r.join("")}split(e,n){return n===void 0||n<0?this._re2.split(e,-1):n===0?[]:this._re2.split(e,-1).slice(0,n)}search(e){let n=this._re2.matcher(e);return n.find()?n.start(0):-1}*matchAll(e){if(!this._global)throw new Error("matchAll requires global flag");this._lastIndex=0;let n=this._re2.matcher(e),r=this._re2.groupCount(),s=this._re2.namedGroups(),i=0;for(;n.find(i);){let o=[];o.push(n.group(0)??"");for(let l=1;l<=r;l++)o.push(n.group(l));let a=o;if(a.index=n.start(0),a.input=e,s&&Object.keys(s).length>0){let l=Object.create(null);for(let[c,u]of Object.entries(s)){let f=n.group(u);f!==null&&(l[c]=f)}a.groups=l}if(yield a,i=n.end(0),n.start(0)===n.end(0)&&i++,i>e.length)break}}get native(){if(!this._nativeRegex)try{this._nativeRegex=new RegExp(this._pattern,this._flags)}catch{this._nativeRegex=new RegExp("",this._flags),Object.defineProperty(this._nativeRegex,"source",{value:this._pattern,writable:!1})}return this._nativeRegex}get source(){return this._pattern}get flags(){return this._flags}get global(){return this._global}get ignoreCase(){return this._ignoreCase}get multiline(){return this._multiline}get lastIndex(){return this._lastIndex}set lastIndex(e){this._lastIndex=e}};Rn=class{_regex;constructor(e){this._regex=e}test(e){return this._regex.global&&(this._regex.lastIndex=0),this._regex.test(e)}exec(e){return this._regex.exec(e)}match(e){return this._regex.global&&(this._regex.lastIndex=0),e.match(this._regex)}replace(e,n){return this._regex.global&&(this._regex.lastIndex=0),e.replace(this._regex,n)}split(e,n){return e.split(this._regex,n)}search(e){return e.search(this._regex)}*matchAll(e){if(!this._regex.global)throw new Error("matchAll requires global flag");this._regex.lastIndex=0;let n=this._regex.exec(e);for(;n!==null;)yield n,n[0].length===0&&this._regex.lastIndex++,n=this._regex.exec(e)}get native(){return this._regex}get source(){return this._regex.source}get flags(){return this._regex.flags}get global(){return this._regex.global}get ignoreCase(){return this._regex.ignoreCase}get multiline(){return this._regex.multiline}get lastIndex(){return this._regex.lastIndex}set lastIndex(e){this._regex.lastIndex=e}}});var Ve=I(()=>{"use strict";s1()});function Ot(t,e,n){let r=typeof n=="boolean"?{ignoreCase:n}:n??{},s=e;r.stripQuotes&&(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))&&(s=s.slice(1,-1));let i=r.ignoreCase?`i:${s}`:s,o=i1.get(i);return o||(o=By(s,r.ignoreCase),i1.set(i,o)),o.test(t)}function By(t,e){let n="^";for(let r=0;r<t.length;r++){let s=t[r];if(s==="*")n+=".*";else if(s==="?")n+=".";else if(s==="["){let i=r+1;for(;i<t.length&&t[i]!=="]";)i++;n+=t.slice(r,i+1),r=i}else s==="."||s==="+"||s==="^"||s==="$"||s==="{"||s==="}"||s==="("||s===")"||s==="|"||s==="\\"?n+=`\\${s}`:n+=s}return n+="$",ee(n,e?"i":"")}var i1,Aa=I(()=>{"use strict";Ve();i1=new Map});function o1(t,e){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(n,r,s)=>{if(r==="&")return e[0];if(s!==void 0)return e.groups?.[s]??"";let i=parseInt(r,10);return e[i]??""})}function Dr(t,e,n={}){let{invertMatch:r=!1,showLineNumbers:s=!1,countOnly:i=!1,countMatches:o=!1,filename:a="",onlyMatching:l=!1,beforeContext:c=0,afterContext:u=0,maxCount:f=0,contextSeparator:p="--",showColumn:h=!1,vimgrep:m=!1,showByteOffset:d=!1,replace:g=null,passthru:w=!1,multiline:E=!1,kResetGroup:b}=n;if(E)return Wy(t,e,{invertMatch:r,showLineNumbers:s,countOnly:i,countMatches:o,filename:a,onlyMatching:l,beforeContext:c,afterContext:u,maxCount:f,contextSeparator:p,showColumn:h,showByteOffset:d,replace:g,kResetGroup:b});let A=t.split(`
172
+ `),N=A.length,P=N>0&&A[N-1]===""?N-1:N;if(i||o){let L=0,D=(o||l)&&!r;for(let _=0;_<P;_++)if(e.lastIndex=0,D)for(let H=e.exec(A[_]);H!==null;H=e.exec(A[_]))L++,H[0].length===0&&e.lastIndex++;else e.test(A[_])!==r&&L++;return{output:`${a?`${a}:${L}`:String(L)}
173
+ `,matched:L>0,matchCount:L}}if(c===0&&u===0&&!w){let L=[],D=!1,v=0,_=0;for(let H=0;H<P&&!(f>0&&v>=f);H++){let pe=A[H];if(e.lastIndex=0,e.test(pe)!==r)if(D=!0,v++,l){e.lastIndex=0;for(let ce=e.exec(pe);ce!==null;ce=e.exec(pe)){let we=b!==void 0?ce[b]??"":ce[0],Q=g!==null?o1(g,ce):we,fe=a?`${a}:`:"";d&&(fe+=`${_+ce.index}:`),s&&(fe+=`${H+1}:`),h&&(fe+=`${ce.index+1}:`),L.push(fe+Q),ce[0].length===0&&e.lastIndex++}}else if(m){e.lastIndex=0;for(let ce=e.exec(pe);ce!==null;ce=e.exec(pe)){let we=a?`${a}:`:"";d&&(we+=`${_+ce.index}:`),s&&(we+=`${H+1}:`),h&&(we+=`${ce.index+1}:`),L.push(we+pe),ce[0].length===0&&e.lastIndex++}}else{e.lastIndex=0;let ce=e.exec(pe),we=ce?ce.index+1:1,Q=pe;g!==null&&(e.lastIndex=0,Q=e.replace(pe,(...De)=>{if(De[0].length===0)return"";let Re=De,ne=De[De.length-1];return typeof ne=="object"&&ne!==null?(Re.groups=ne,Re.input=De[De.length-2],Re.index=De[De.length-3]):(Re.input=De[De.length-1],Re.index=De[De.length-2]),o1(g,Re)}));let fe=a?`${a}:`:"";d&&(fe+=`${_+(ce?ce.index:0)}:`),s&&(fe+=`${H+1}:`),h&&(fe+=`${we}:`),L.push(fe+Q)}_+=pe.length+1}return{output:L.length>0?`${L.join(`
174
+ `)}
175
+ `:"",matched:D,matchCount:v}}if(w){let L=[],D=!1,v=0;for(let _=0;_<P;_++){let H=A[_];e.lastIndex=0;let J=e.test(H)!==r;J&&(D=!0,v++);let ce=J?":":"-",we=a?`${a}${ce}`:"";s&&(we+=`${_+1}${ce}`),L.push(we+H)}return{output:L.length>0?`${L.join(`
176
+ `)}
177
+ `:"",matched:D,matchCount:v}}let O=[],G=0,M=new Set,Y=-1,B=[];for(let L=0;L<P&&!(f>0&&G>=f);L++)e.lastIndex=0,e.test(A[L])!==r&&(B.push(L),G++);for(let L of B){let D=Math.max(0,L-c);Y>=0&&D>Y+1&&O.push(p);for(let _=D;_<L;_++)if(!M.has(_)){M.add(_),Y=_;let H=A[_];s&&(H=`${_+1}-${H}`),a&&(H=`${a}-${H}`),O.push(H)}if(!M.has(L)){M.add(L),Y=L;let _=A[L];if(l){e.lastIndex=0;for(let H=e.exec(_);H!==null;H=e.exec(_)){let pe=b!==void 0?H[b]??"":H[0],J=g!==null?g:pe,ce=a?`${a}:`:"";s&&(ce+=`${L+1}:`),h&&(ce+=`${H.index+1}:`),O.push(ce+J),H[0].length===0&&e.lastIndex++}}else{let H=_;s&&(H=`${L+1}:${H}`),a&&(H=`${a}:${H}`),O.push(H)}}let v=Math.min(P-1,L+u);for(let _=L+1;_<=v;_++)if(!M.has(_)){M.add(_),Y=_;let H=A[_];s&&(H=`${_+1}-${H}`),a&&(H=`${a}-${H}`),O.push(H)}}return{output:O.length>0?`${O.join(`
178
+ `)}
179
+ `:"",matched:G>0,matchCount:G}}function Wy(t,e,n){let{invertMatch:r,showLineNumbers:s,countOnly:i,countMatches:o,filename:a,onlyMatching:l,beforeContext:c,afterContext:u,maxCount:f,contextSeparator:p,showColumn:h,showByteOffset:m,replace:d,kResetGroup:g}=n,w=t.split(`
180
+ `),E=w.length,b=E>0&&w[E-1]===""?E-1:E,A=[0];for(let B=0;B<t.length;B++)t[B]===`
181
+ `&&A.push(B+1);let N=B=>{let L=0;for(let D=0;D<A.length&&!(A[D]>B);D++)L=D;return L},P=B=>{let L=N(B);return B-A[L]+1},O=[];e.lastIndex=0;for(let B=e.exec(t);B!==null&&!(f>0&&O.length>=f);B=e.exec(t)){let L=N(B.index),D=N(B.index+Math.max(0,B[0].length-1)),v=g!==void 0?B[g]??"":B[0];O.push({startLine:L,endLine:D,byteOffset:B.index,column:P(B.index),matchText:v}),B[0].length===0&&e.lastIndex++}if(i||o){let B;if(o)B=r?0:O.length;else{let D=new Set;for(let v of O)for(let _=v.startLine;_<=v.endLine;_++)D.add(_);B=r?b-D.size:D.size}return{output:`${a?`${a}:${B}`:String(B)}
182
+ `,matched:B>0,matchCount:B}}if(r){let B=new Set;for(let D of O)for(let v=D.startLine;v<=D.endLine;v++)B.add(v);let L=[];for(let D=0;D<b;D++)if(!B.has(D)){let v=w[D];s&&(v=`${D+1}:${v}`),a&&(v=`${a}:${v}`),L.push(v)}return{output:L.length>0?`${L.join(`
183
+ `)}
184
+ `:"",matched:L.length>0,matchCount:L.length}}if(O.length===0)return{output:"",matched:!1,matchCount:0};let G=new Set,M=-1,Y=[];for(let B of O){let L=Math.max(0,B.startLine-c),D=Math.min(b-1,B.endLine+u);M>=0&&L>M+1&&Y.push(p);for(let v=L;v<B.startLine;v++)if(!G.has(v)){G.add(v),M=v;let _=w[v];s&&(_=`${v+1}-${_}`),a&&(_=`${a}-${_}`),Y.push(_)}if(l){let v=d!==null?d:B.matchText,_=a?`${a}:`:"";m&&(_+=`${B.byteOffset}:`),s&&(_+=`${B.startLine+1}:`),h&&(_+=`${B.column}:`),Y.push(_+v);for(let H=B.startLine;H<=B.endLine;H++)G.add(H),M=H}else for(let v=B.startLine;v<=B.endLine&&v<b;v++)if(!G.has(v)){G.add(v),M=v;let _=w[v];d!==null&&v===B.startLine&&(e.lastIndex=0,_=e.replace(_,d));let H=a?`${a}:`:"";m&&v===B.startLine&&(H+=`${B.byteOffset}:`),s&&(H+=`${v+1}:`),h&&v===B.startLine&&(H+=`${B.column}:`),Y.push(H+_)}for(let v=B.endLine+1;v<=D;v++)if(!G.has(v)){G.add(v),M=v;let _=w[v];s&&(_=`${v+1}-${_}`),a&&(_=`${a}-${_}`),Y.push(_)}}return{output:Y.length>0?`${Y.join(`
185
+ `)}
186
+ `:"",matched:!0,matchCount:O.length}}var a1=I(()=>{"use strict"});function l1(t){let e="",n=0;for(;n<t.length;){if(t.slice(n,n+7)==="[[:<:]]"){e+="\\b",n+=7;continue}if(t.slice(n,n+7)==="[[:>:]]"){e+="\\b",n+=7;continue}if(t[n]==="["){let r="[";for(n++,n<t.length&&(t[n]==="^"||t[n]==="!")&&(r+="^",n++),n<t.length&&t[n]==="]"&&(r+="\\]",n++);n<t.length&&t[n]!=="]";){if(t[n]==="["&&n+1<t.length&&t[n+1]===":"){let s=t.indexOf(":]",n+2);if(s!==-1){let i=t.slice(n+2,s),o=zy.get(i);if(o){r+=o,n=s+2;continue}}}if(t[n]==="\\"&&n+1<t.length){r+=t[n]+t[n+1],n+=2;continue}r+=t[n],n++}n<t.length&&t[n]==="]"&&(r+="]",n++),e+=r;continue}if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}e+=t[n],n++}return e}function ws(t,e){let n,r;switch(e.mode){case"fixed":n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(n=l1(t),n=n.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),e.mode==="perl"){n=Hy(n),n=jy(n),n=Gy(n);let o=Yy(n);n=o.pattern,r=o.kResetGroup}break}default:n=l1(t),n=Xy(n);break}e.wholeWord&&(n=`\\b(?:${n})\\b`),e.lineRegexp&&(n=`^${n}$`);let s=/\\u\{[0-9A-Fa-f]+\}/.test(n),i="g"+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.multilineDotall?"s":"")+(s?"u":"");return{regex:ee(n,i),kResetGroup:r}}function Hy(t){let e="",n=0;for(;n<t.length;)if(t[n]==="\\"&&n+1<t.length&&t[n+1]==="Q"){n+=2;let r="";for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length&&t[n+1]==="E"){n+=2;break}r+=t[n],n++}e+=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else e+=t[n],n++;return e}function jy(t){return t.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function Gy(t){let e="",n=0;for(;n<t.length;){if(t[n]==="("&&n+1<t.length&&t[n+1]==="?"){let r=t.slice(n).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(r){let s=r[1]||"",i=r[2]||"",o=r[3];if(o===":"){let a=n+r[0].length-1,l=Vy(t,n);if(l!==-1){let c=t.slice(a+1,l),u=qy(c,s,i);e+=`(?:${u})`,n=l+1;continue}}else if(o===")"||o===""){n+=r[0].length;continue}}}e+=t[n],n++}return e}function Vy(t,e){let n=0,r=e;for(;r<t.length;){if(t[r]==="\\"){r+=2;continue}if(t[r]==="["){for(r++;r<t.length&&t[r]!=="]";)t[r]==="\\"&&r++,r++;r++;continue}if(t[r]==="(")n++;else if(t[r]===")"&&(n--,n===0))return r;r++}return-1}function qy(t,e,n){let r=t;return e.includes("i")&&(r=Zy(r)),r}function Zy(t){let e="",n=0;for(;n<t.length;){let r=t[n];if(r==="\\"){n+1<t.length?(e+=r+t[n+1],n+=2):(e+=r,n++);continue}if(r==="["){e+=r,n++,n<t.length&&t[n]==="^"&&(e+=t[n],n++);let s=[];for(;n<t.length&&t[n]!=="]";)if(t[n]==="\\")s.push(t[n]),n++,n<t.length&&(s.push(t[n]),n++);else if(t[n]==="-"&&s.length>0&&n+1<t.length&&t[n+1]!=="]"){let i=s[s.length-1],o=t[n+1];s.push("-"),s.push(o),/[a-z]/.test(i)&&/[a-z]/.test(o)?(s.push(i.toUpperCase()),s.push("-"),s.push(o.toUpperCase())):/[A-Z]/.test(i)&&/[A-Z]/.test(o)&&(s.push(i.toLowerCase()),s.push("-"),s.push(o.toLowerCase())),n+=2}else{let i=t[n];if(s.push(i),/[a-zA-Z]/.test(i)){let o=i===i.toLowerCase()?i.toUpperCase():i.toLowerCase();s.includes(o)||s.push(o)}n++}e+=s.join(""),n<t.length&&(e+=t[n],n++);continue}if(/[a-zA-Z]/.test(r)){let s=r.toLowerCase(),i=r.toUpperCase();e+=`[${i}${s}]`}else e+=r;n++}return e}function Yy(t){let e=Qy(t);if(e===-1)return{pattern:t};let n=t.slice(0,e),r=t.slice(e+2),s=Ky(n);return{pattern:`(?:${n})(${r})`,kResetGroup:s+1}}function Qy(t){let e=0;for(;e<t.length-1;)if(t[e]==="\\"){if(t[e+1]==="K"){let n=0,r=e-1;for(;r>=0&&t[r]==="\\";)n++,r--;if(n%2===0)return e}e+=2}else e++;return-1}function Ky(t){let e=0,n=0;for(;n<t.length;){if(t[n]==="\\"){n+=2;continue}if(t[n]==="["){for(n++;n<t.length&&t[n]!=="]";)t[n]==="\\"&&n++,n++;n++;continue}if(t[n]==="(")if(n+1<t.length&&t[n+1]==="?"){if(n+2<t.length){let r=t[n+2];if(r===":"||r==="="||r==="!"){n++;continue}if(r==="<"&&n+3<t.length){let s=t[n+3];if(s==="="||s==="!"){n++;continue}e++,n++;continue}}}else e++;n++}return e}function Sa(t){let e=t.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return e=e.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),e=e.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),e}function Xy(t){let e="",n=0,r=!0,s=0;for(;n<t.length;){let i=t[n];if(i==="["){for(e+=i,n++,n<t.length&&(t[n]==="^"||t[n]==="!")&&(e+=t[n],n++),n<t.length&&t[n]==="]"&&(e+=t[n],n++);n<t.length&&t[n]!=="]";)t[n]==="\\"&&n+1<t.length?(e+=t[n]+t[n+1],n+=2):(e+=t[n],n++);n<t.length&&t[n]==="]"&&(e+=t[n],n++),r=!1;continue}if(i==="\\"&&n+1<t.length){let o=t[n+1];if(o==="|"){e+="|",n+=2,r=!0;continue}if(o==="("){e+="(",n+=2,s++,r=!0;continue}if(o===")"){e+=")",n+=2,s=Math.max(0,s-1),r=!1;continue}if(o==="{"){let l=t.slice(n).match(/^\\{(\d+)(,(\d*)?)?\\}/);if(l){let c=l[1],u=l[2]!==void 0,f=l[3]||"";u?e+=`{${c},${f}}`:e+=`{${c}}`,n+=l[0].length,r=!1;continue}e+="\\{",n+=2,r=!1;continue}if(o==="}"){e+="\\}",n+=2,r=!1;continue}e+=i+o,n+=2,r=!1;continue}if(i==="*"&&r){e+="\\*",n++;continue}if(i==="^"){if(r){e+="^",n++;continue}e+="\\^",n++;continue}if(i==="$"){let o=n===t.length-1,a=n+2<t.length&&t[n+1]==="\\"&&t[n+2]===")";o||a?e+="$":e+="\\$",n++,r=!1;continue}i==="+"||i==="?"||i==="|"||i==="("||i===")"||i==="{"||i==="}"?e+=`\\${i}`:e+=i,n++,r=!1}return e}var zy,c1=I(()=>{"use strict";Ve();zy=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]])});var Ca=I(()=>{"use strict";a1();c1()});var yi={};se(yi,{egrepCommand:()=>n4,egrepFlagsForFuzzing:()=>i4,fgrepCommand:()=>t4,fgrepFlagsForFuzzing:()=>s4,flagsForFuzzing:()=>r4,grepCommand:()=>Na});async function u1(t,e,n,r){let s=n.fs.resolvePath(n.cwd,t);try{if(!(await n.fs.stat(s)).isDirectory){let a=t.split("/").pop()||"";if(e){let l=e.replace(/^\//,"");Ot(a,l,{stripQuotes:!0})&&r.push(t)}return}let o=await n.fs.readdir(s);for(let a of o){let l=t==="."?a:`${t}/${a}`,c=n.fs.resolvePath(n.cwd,l);if((await n.fs.stat(c)).isDirectory)await u1(l,e,n,r);else if(e){let f=e.replace(/^\//,"");Ot(a,f,{stripQuotes:!0})&&r.push(l)}}}catch{}}async function e4(t,e){let n=[],r=t.lastIndexOf("/"),s,i;if(r===-1?(s=e.cwd,i=t):(s=t.slice(0,r)||"/",i=t.slice(r+1)),t.includes("**")){let a=[],l=t.split("**"),c=l[0].replace(/\/$/,"")||".",u=l[1]||"";return await u1(c,u,e,a),a.map(f=>({path:f}))}let o=e.fs.resolvePath(e.cwd,s);try{if(e.fs.readdirWithFileTypes){let a=await e.fs.readdirWithFileTypes(o);for(let l of a)if(Ot(l.name,i,{stripQuotes:!0})){let c=r===-1?l.name:`${s}/${l.name}`;n.push({path:c,isFile:l.isFile})}}else{let a=await e.fs.readdir(o);for(let l of a)if(Ot(l,i,{stripQuotes:!0})){let c=r===-1?l:`${s}/${l}`;n.push({path:c})}}}catch{}return n.sort((a,l)=>a.path.localeCompare(l.path))}async function gi(t,e,n=[],r=[],s=[],i){let o=e.fs.resolvePath(e.cwd,t),a=[];try{let l,c;if(i!==void 0)l=i,c=!i;else{let f=await e.fs.stat(o);l=f.isFile,c=f.isDirectory}if(l){let f=t.split("/").pop()||t;return r.length>0&&r.some(p=>Ot(f,p,{stripQuotes:!0}))?[]:n.length>0&&!n.some(p=>Ot(f,p,{stripQuotes:!0}))?[]:[{path:t,isFile:!0}]}if(!c)return[];let u=t.split("/").pop()||t;if(s.length>0&&s.some(f=>Ot(u,f,{stripQuotes:!0})))return[];if(e.fs.readdirWithFileTypes){let f=await e.fs.readdirWithFileTypes(o);for(let p of f){if(p.name.startsWith("."))continue;let h=t==="."?p.name:`${t}/${p.name}`,m=await gi(h,e,n,r,s,p.isFile);a.push(...m)}}else{let f=await e.fs.readdir(o);for(let p of f){if(p.startsWith("."))continue;let h=t==="."?p:`${t}/${p}`,m=await gi(h,e,n,r,s);a.push(...m)}}}catch{}return a}var Jy,Na,t4,n4,r4,s4,i4,wi=I(()=>{"use strict";F();Aa();he();Ca();Jy={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},Na={name:"grep",async execute(t,e){let n=W(t);if(Z(n))return q(Jy);let r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1,u=!1,f=!1,p=!1,h=!1,m=!1,d=!1,g=!1,w=!1,E=0,b=0,A=0,N=[],P=[],O=[],G=null,M=[];for(let Q=0;Q<n.length;Q++){let fe=n[Q];if(fe.startsWith("-")&&fe!=="-"){if(fe==="-e"&&Q+1<n.length){G=n[++Q];continue}if(fe.startsWith("--include=")){N.push(fe.slice(10));continue}if(fe.startsWith("--exclude=")){P.push(fe.slice(10));continue}if(fe.startsWith("--exclude-dir=")){O.push(fe.slice(14));continue}if(fe.startsWith("--max-count=")){E=parseInt(fe.slice(12),10);continue}let De=fe.match(/^-m(\d+)$/);if(De){E=parseInt(De[1],10);continue}if(fe==="-m"&&Q+1<n.length){E=parseInt(n[++Q],10);continue}let xe=fe.match(/^-([ABC])(\d+)$/);if(xe){let ne=parseInt(xe[2],10);xe[1]==="A"?A=ne:xe[1]==="B"?b=ne:xe[1]==="C"&&(b=ne,A=ne);continue}if((fe==="-A"||fe==="-B"||fe==="-C")&&Q+1<n.length){let ne=parseInt(n[++Q],10);fe==="-A"?A=ne:fe==="-B"?b=ne:(b=ne,A=ne);continue}let Re=fe.startsWith("--")?[fe]:fe.slice(1).split("");for(let ne of Re)if(ne==="i"||ne==="--ignore-case")r=!0;else if(ne==="n"||ne==="--line-number")s=!0;else if(ne==="v"||ne==="--invert-match")i=!0;else if(ne==="c"||ne==="--count")o=!0;else if(ne==="l"||ne==="--files-with-matches")a=!0;else if(ne==="L"||ne==="--files-without-match")l=!0;else if(ne==="r"||ne==="R"||ne==="--recursive")c=!0;else if(ne==="w"||ne==="--word-regexp")u=!0;else if(ne==="x"||ne==="--line-regexp")f=!0;else if(ne==="E"||ne==="--extended-regexp")p=!0;else if(ne==="P"||ne==="--perl-regexp")h=!0;else if(ne==="F"||ne==="--fixed-strings")m=!0;else if(ne==="o"||ne==="--only-matching")d=!0;else if(ne==="h"||ne==="--no-filename")g=!0;else if(ne==="q"||ne==="--quiet"||ne==="--silent")w=!0;else{if(ne.startsWith("--"))return oe("grep",ne);if(ne.length===1)return oe("grep",`-${ne}`)}}else G===null?G=fe:M.push(fe)}if(G===null)return{stdout:y,stderr:x(`grep: missing pattern
187
+ `),exitCode:2};let Y=m?"fixed":p?"extended":h?"perl":"basic",B,L;try{let Q=ws(G,{mode:Y,ignoreCase:r,wholeWord:u,lineRegexp:f});B=Q.regex,L=Q.kResetGroup}catch{return{stdout:y,stderr:x(`grep: invalid regular expression: ${G}
188
+ `),exitCode:2}}if(M.length===0&&e.stdin!==void 0){let Q=Dr(R(e.stdin),B,{invertMatch:i,showLineNumbers:s,countOnly:o,filename:"",onlyMatching:d,beforeContext:b,afterContext:A,maxCount:E,kResetGroup:L});return w?{stdout:y,stderr:y,exitCode:Q.matched?0:1}:{stdout:x(Q.output),stderr:y,exitCode:Q.matched?0:1}}if(M.length===0)return{stdout:y,stderr:x(`grep: no input files
189
+ `),exitCode:2};let D="",v="",_=!1,H=!1,pe=[];for(let Q of M)if(Q.includes("*")||Q.includes("?")||Q.includes("[")){let fe=await e4(Q,e);if(c)for(let De of fe){let xe=await gi(De.path,e,N,P,O,De.isFile);pe.push(...xe)}else pe.push(...fe)}else if(c){let fe=await gi(Q,e,N,P,O);pe.push(...fe)}else pe.push({path:Q});let J=(pe.length>1||c)&&!g,ce=50;for(let Q=0;Q<pe.length;Q+=ce){let fe=pe.slice(Q,Q+ce),De=await Promise.all(fe.map(async xe=>{let Re=xe.path,ne=Re.split("/").pop()||Re;if(P.length>0&&!c&&P.some(je=>Ot(ne,je,{stripQuotes:!0}))||N.length>0&&!c&&!N.some(je=>Ot(ne,je,{stripQuotes:!0})))return null;try{let je=e.fs.resolvePath(e.cwd,Re),Ge=!1;if(xe.isFile===void 0?Ge=(await e.fs.stat(je)).isDirectory:Ge=!xe.isFile,Ge)return c?null:{error:`grep: ${Re}: Is a directory
190
+ `};let Xe=await e.fs.readFile(je),lt=Dr(Xe,B,{invertMatch:i,showLineNumbers:s,countOnly:o,filename:J?Re:"",onlyMatching:d,beforeContext:b,afterContext:A,maxCount:E,kResetGroup:L});return{file:Re,result:lt}}catch{return{error:`grep: ${Re}: No such file or directory
191
+ `}}}));for(let xe of De){if(xe===null)continue;if("error"in xe&&xe.error){v+=xe.error,xe.error.includes("Is a directory")||(H=!0);continue}if(!("file"in xe)||!xe.result)continue;let{file:Re,result:ne}=xe;if(ne.matched){if(_=!0,w)return{stdout:y,stderr:y,exitCode:0};a?D+=`${Re}
192
+ `:l||(D+=ne.output)}else l?D+=`${Re}
193
+ `:o&&!a&&(D+=ne.output)}}let we;return H?we=2:l?we=D.length>0?0:1:we=_?0:1,w?{stdout:y,stderr:y,exitCode:we}:{stdout:x(D),stderr:x(v),exitCode:we}}};t4={name:"fgrep",async execute(t,e){return Na.execute([x("-F"),...t],e)}},n4={name:"egrep",async execute(t,e){return Na.execute([x("-E"),...t],e)}},r4={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},s4={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},i4={name:"egrep",flags:[],stdinType:"text",needsArgs:!0}});function p1(){let t=[];for(let[e,n]of Object.entries(f1).sort()){let r=[];for(let s of n.extensions)r.push(`*${s}`);for(let s of n.globs)r.push(s);t.push(`${e}: ${r.join(", ")}`)}return`${t.join(`
194
+ `)}
195
+ `}var f1,bs,va=I(()=>{"use strict";Ve();f1={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},bs=class{types;constructor(){this.types=new Map(Object.entries(f1).map(([e,n])=>[e,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(e){let n=e.indexOf(":");if(n===-1)return;let r=e.slice(0,n),s=e.slice(n+1);if(s.startsWith("include:")){let i=s.slice(8),o=this.types.get(i);if(o){let a=this.types.get(r)||{extensions:[],globs:[]};a.extensions.push(...o.extensions),a.globs.push(...o.globs),this.types.set(r,a)}}else{let i=this.types.get(r)||{extensions:[],globs:[]};if(s.startsWith("*.")&&!s.slice(2).includes("*")){let o=s.slice(1);i.extensions.includes(o)||i.extensions.push(o)}else i.globs.includes(s)||i.globs.push(s);this.types.set(r,i)}}clearType(e){let n=this.types.get(e);n&&(n.extensions=[],n.globs=[])}getType(e){return this.types.get(e)}getAllTypes(){return this.types}matchesType(e,n){let r=e.toLowerCase();for(let s of n){if(s==="all"){if(this.matchesAnyType(e))return!0;continue}let i=this.types.get(s);if(i){for(let o of i.extensions)if(r.endsWith(o))return!0;for(let o of i.globs)if(o.includes("*")){let a=o.replace(/\./g,"\\.").replace(/\*/g,".*");if(ee(`^${a}$`,"i").test(e))return!0}else if(r===o.toLowerCase())return!0}}return!1}matchesAnyType(e){let n=e.toLowerCase();for(let r of this.types.values()){for(let s of r.extensions)if(n.endsWith(s))return!0;for(let s of r.globs)if(s.includes("*")){let i=s.replace(/\./g,"\\.").replace(/\*/g,".*");if(ee(`^${i}$`,"i").test(e))return!0}else if(n===s.toLowerCase())return!0}return!1}}});function h1(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:1/0,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}var d1=I(()=>{"use strict"});function o4(t){let e=t.match(/^(\d+)([KMG])?$/i);if(!e)return 0;let n=parseInt(e[1],10);switch((e[2]||"").toUpperCase()){case"K":return n*1024;case"M":return n*1024*1024;case"G":return n*1024*1024*1024;default:return n}}function a4(t){return/^\d+[KMG]?$/i.test(t)?null:{stdout:y,stderr:x(`rg: invalid --max-filesize value: ${t}
196
+ `),exitCode:1}}function m1(t){return null}function u4(t){t.hidden?t.searchBinary=!0:t.noIgnore?t.hidden=!0:t.noIgnore=!0}function f4(t,e,n){let r=t[e];for(let s of g1){if(r.startsWith(`--${s.long}=`)){let i=r.slice(`--${s.long}=`.length),o=bi(n,s,i);return o?{newIndex:e,error:o}:{newIndex:e}}if(s.short&&r.startsWith(`-${s.short}`)&&r.length>2){let i=r.slice(2),o=bi(n,s,i);return o?{newIndex:e,error:o}:{newIndex:e}}if(s.short&&r===`-${s.short}`||r===`--${s.long}`){if(e+1>=t.length)return null;let i=t[e+1],o=bi(n,s,i);return o?{newIndex:e+1,error:o}:{newIndex:e+1}}}return null}function p4(t){return g1.find(e=>e.short===t)}function bi(t,e,n){if(e.validate){let s=e.validate(n);if(s)return s}let r=e.parse?e.parse(n):n;e.multi?t[e.target].push(r):t[e.target]=r}function h4(t,e){let n=t[e];if(n==="--sort"&&e+1<t.length){let r=t[e+1];if(r==="path"||r==="none")return{value:r,newIndex:e+1}}if(n.startsWith("--sort=")){let r=n.slice(7);if(r==="path"||r==="none")return{value:r,newIndex:e}}return null}function d4(t,e){let n=t[e],r=n.match(/^-([ABC])(\d+)$/);return r?{flag:r[1],value:parseInt(r[2],10),newIndex:e}:(n==="-A"||n==="-B"||n==="-C")&&e+1<t.length?{flag:n[1],value:parseInt(t[e+1],10),newIndex:e+1}:null}function m4(t){let e=t.match(/^-m(\d+)$/);return e?parseInt(e[1],10):null}function y1(t){let e=h1(),n=null,r=[],s=-1,i=-1,o=-1,a=!1;for(let l=0;l<t.length;l++){let c=t[l];if(c.startsWith("-")&&c!=="-"){let u=d4(t,l);if(u){let{flag:g,value:w,newIndex:E}=u;g==="A"?s=Math.max(s,w):g==="B"?i=Math.max(i,w):o=w,l=E;continue}let f=m4(c);if(f!==null){e.maxCount=f;continue}let p=f4(t,l,e);if(p){if(p.error)return{success:!1,error:p.error};l=p.newIndex;continue}let h=h4(t,l);if(h){e.sort=h.value,l=h.newIndex;continue}let m=c.startsWith("--")?[c]:c.slice(1).split(""),d=!1;for(let g of m){if(c4.has(g)){e.lineNumber=!0,a=!0;continue}if(g==="u"||g==="--unrestricted"){u4(e);continue}if(g==="P"||g==="--pcre2")return{success:!1,error:{stdout:y,stderr:x(`rg: PCRE2 is not supported. Use standard regex syntax instead.
197
+ `),exitCode:1}};if(g.length===1){let E=p4(g);if(E){if(l+1>=t.length)return{success:!1,error:oe("rg",`-${g}`)};let b=bi(e,E,t[l+1]);if(b)return{success:!1,error:b};l++,d=!0;continue}}let w=l4.get(g);if(w){w(e);continue}if(g.startsWith("--"))return{success:!1,error:oe("rg",g)};if(g.length===1)return{success:!1,error:oe("rg",`-${g}`)}}}else n===null&&e.patterns.length===0&&e.patternFiles.length===0?n=c:r.push(c)}return(s>=0||o>=0)&&(e.afterContext=Math.max(s>=0?s:0,o>=0?o:0)),(i>=0||o>=0)&&(e.beforeContext=Math.max(i>=0?i:0,o>=0?o:0)),n!==null&&e.patterns.push(n),(e.column||e.vimgrep)&&(a=!0),{success:!0,options:e,paths:r,explicitLineNumbers:a}}var g1,l4,c4,w1=I(()=>{"use strict";F();he();d1();g1=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:m1},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:m1},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:o4,validate:a4},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",target:"maxDepth",parse:()=>1/0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],l4=new Map([["i",t=>{t.ignoreCase=!0,t.caseSensitive=!1,t.smartCase=!1}],["--ignore-case",t=>{t.ignoreCase=!0,t.caseSensitive=!1,t.smartCase=!1}],["s",t=>{t.caseSensitive=!0,t.ignoreCase=!1,t.smartCase=!1}],["--case-sensitive",t=>{t.caseSensitive=!0,t.ignoreCase=!1,t.smartCase=!1}],["S",t=>{t.smartCase=!0,t.ignoreCase=!1,t.caseSensitive=!1}],["--smart-case",t=>{t.smartCase=!0,t.ignoreCase=!1,t.caseSensitive=!1}],["F",t=>{t.fixedStrings=!0}],["--fixed-strings",t=>{t.fixedStrings=!0}],["w",t=>{t.wordRegexp=!0}],["--word-regexp",t=>{t.wordRegexp=!0}],["x",t=>{t.lineRegexp=!0}],["--line-regexp",t=>{t.lineRegexp=!0}],["v",t=>{t.invertMatch=!0}],["--invert-match",t=>{t.invertMatch=!0}],["U",t=>{t.multiline=!0}],["--multiline",t=>{t.multiline=!0}],["--multiline-dotall",t=>{t.multilineDotall=!0,t.multiline=!0}],["c",t=>{t.count=!0}],["--count",t=>{t.count=!0}],["--count-matches",t=>{t.countMatches=!0}],["l",t=>{t.filesWithMatches=!0}],["--files",t=>{t.files=!0}],["--files-with-matches",t=>{t.filesWithMatches=!0}],["--files-without-match",t=>{t.filesWithoutMatch=!0}],["--stats",t=>{t.stats=!0}],["o",t=>{t.onlyMatching=!0}],["--only-matching",t=>{t.onlyMatching=!0}],["q",t=>{t.quiet=!0}],["--quiet",t=>{t.quiet=!0}],["N",t=>{t.lineNumber=!1}],["--no-line-number",t=>{t.lineNumber=!1}],["H",t=>{t.withFilename=!0}],["--with-filename",t=>{t.withFilename=!0}],["I",t=>{t.noFilename=!0}],["--no-filename",t=>{t.noFilename=!0}],["0",t=>{t.nullSeparator=!0}],["--null",t=>{t.nullSeparator=!0}],["b",t=>{t.byteOffset=!0}],["--byte-offset",t=>{t.byteOffset=!0}],["--column",t=>{t.column=!0,t.lineNumber=!0}],["--no-column",t=>{t.column=!1}],["--vimgrep",t=>{t.vimgrep=!0,t.column=!0,t.lineNumber=!0}],["--json",t=>{t.json=!0}],["--hidden",t=>{t.hidden=!0}],["--no-ignore",t=>{t.noIgnore=!0}],["--no-ignore-dot",t=>{t.noIgnoreDot=!0}],["--no-ignore-vcs",t=>{t.noIgnoreVcs=!0}],["L",t=>{t.followSymlinks=!0}],["--follow",t=>{t.followSymlinks=!0}],["z",t=>{t.searchZip=!0}],["--search-zip",t=>{t.searchZip=!0}],["a",t=>{t.searchBinary=!0}],["--text",t=>{t.searchBinary=!0}],["--heading",t=>{t.heading=!0}],["--passthru",t=>{t.passthru=!0}],["--include-zero",t=>{t.includeZero=!0}],["--glob-case-insensitive",t=>{t.globCaseInsensitive=!0}]]),c4=new Set(["n","--line-number"])});async function ka(t,e,n=!1,r=!1,s=[]){let i=new Es(t,e,n,r);await i.load(e);for(let o of s)try{let a=t.resolvePath(e,o),l=await t.readFile(a);i.addPatternsFromContent(l,e)}catch{}return i}var xs,Es,b1=I(()=>{"use strict";Ve();xs=class{patterns=[];basePath;constructor(e="/"){this.basePath=e}parse(e){let n=e.split(`
198
+ `);for(let r of n){let s=r.replace(/\s+$/,"");if(!s||s.startsWith("#"))continue;let i=!1;s.startsWith("!")&&(i=!0,s=s.slice(1));let o=!1;s.endsWith("/")&&(o=!0,s=s.slice(0,-1));let a=!1;s.startsWith("/")?(a=!0,s=s.slice(1)):s.includes("/")&&!s.startsWith("**/")&&(a=!0);let l=this.patternToRegex(s,a);this.patterns.push({pattern:r,regex:l,negated:i,directoryOnly:o,rooted:a})}}patternToRegex(e,n){let r="";n?r="^":r="(?:^|/)";let s=0;for(;s<e.length;){let i=e[s];if(i==="*")e[s+1]==="*"?e[s+2]==="/"?(r+="(?:.*/)?",s+=3):(s+2>=e.length,r+=".*",s+=2):(r+="[^/]*",s++);else if(i==="?")r+="[^/]",s++;else if(i==="["){let o=s+1;for(o<e.length&&e[o]==="!"&&o++,o<e.length&&e[o]==="]"&&o++;o<e.length&&e[o]!=="]";)o++;if(o<e.length){let a=e.slice(s,o+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),r+=a,s=o+1}else r+="\\[",s++}else i==="/"?(r+="/",s++):(r+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s++)}return r+="(?:/.*)?$",ee(r)}matches(e,n){let r=e.replace(/^\.\//,"");r=r.replace(/^\//,"");let s=!1;for(let i of this.patterns)i.directoryOnly&&!n||i.regex.test(r)&&(s=!i.negated);return s}isWhitelisted(e,n){let r=e.replace(/^\.\//,"");r=r.replace(/^\//,"");for(let s of this.patterns)if(!(s.directoryOnly&&!n)&&s.negated&&s.regex.test(r))return!0;return!1}getBasePath(){return this.basePath}},Es=class{parsers=[];fs;skipDotIgnore;skipVcsIgnore;loadedDirs=new Set;constructor(e,n,r=!1,s=!1){this.fs=e,this.skipDotIgnore=r,this.skipVcsIgnore=s}async load(e){let n=[],r=e;for(;;){n.unshift(r);let i=this.fs.resolvePath(r,"..");if(i===r)break;r=i}let s=[];this.skipVcsIgnore||s.push(".gitignore"),this.skipDotIgnore||s.push(".rgignore",".ignore");for(let i of n){this.loadedDirs.add(i);for(let o of s){let a=this.fs.resolvePath(i,o);try{let l=await this.fs.readFile(a),c=new xs(i);c.parse(l),this.parsers.push(c)}catch{}}}}async loadForDirectory(e){if(this.loadedDirs.has(e))return;this.loadedDirs.add(e);let n=[];this.skipVcsIgnore||n.push(".gitignore"),this.skipDotIgnore||n.push(".rgignore",".ignore");for(let r of n){let s=this.fs.resolvePath(e,r);try{let i=await this.fs.readFile(s),o=new xs(e);o.parse(i),this.parsers.push(o)}catch{}}}addPatternsFromContent(e,n){let r=new xs(n);r.parse(e),this.parsers.push(r)}matches(e,n){for(let r of this.parsers){let s=r.getBasePath();if(!e.startsWith(s))continue;let i=e.slice(s.length).replace(/^\//,"");if(r.matches(i,n))return!0}return!1}isWhitelisted(e,n){for(let r of this.parsers){let s=r.getBasePath();if(!e.startsWith(s))continue;let i=e.slice(s.length).replace(/^\//,"");if(r.isWhitelisted(i,n))return!0}return!1}static isCommonIgnored(e){return new Set(["node_modules",".git",".svn",".hg","__pycache__",".pytest_cache",".mypy_cache","venv",".venv",".next",".nuxt",".cargo"]).has(e)}}});import{gunzipSync as g4}from"node:zlib";function y4(t){return t.length>=2&&t[0]===31&&t[1]===139}function w4(t){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];r==="["&&!e?e=!0:r==="]"&&e&&(e=!1)}return e?`rg: glob '${t}' has an unclosed character class`:null}async function x1(t){let{ctx:e,options:n,paths:r,explicitLineNumbers:s}=t;for(let g of n.globs){let w=g.startsWith("!")?g.slice(1):g,E=w4(w);if(E)return{stdout:y,stderr:x(`${E}
199
+ `),exitCode:1}}if(n.files){let g=[...n.patterns,...r];return E4(e,g,n)}let i=[...n.patterns];for(let g of n.patternFiles)try{let w;if(g==="-")w=R(e.stdin);else{let b=e.fs.resolvePath(e.cwd,g);w=await e.fs.readFile(b)}let E=w.split(`
200
+ `).filter(b=>b.length>0);i.push(...E)}catch{return{stdout:y,stderr:x(`rg: ${g}: No such file or directory
201
+ `),exitCode:2}}if(i.length===0)return n.patternFiles.length>0?{stdout:y,stderr:y,exitCode:1}:{stdout:y,stderr:x(`rg: no pattern given
202
+ `),exitCode:2};let o=r.length===0?["."]:r,a=b4(n,i),l,c;try{let g=x4(i,n,a);l=g.regex,c=g.kResetGroup}catch{return{stdout:y,stderr:x(`rg: invalid regex: ${i.join(", ")}
203
+ `),exitCode:2}}let u=null;n.noIgnore||(u=await ka(e.fs,e.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let f=new bs;for(let g of n.typeClear)f.clearType(g);for(let g of n.typeAdd)f.addType(g);let{files:p,singleExplicitFile:h}=await E1(e,o,n,u,f);if(p.length===0)return{stdout:y,stderr:y,exitCode:1};let m=!n.noFilename&&(n.withFilename||!h||p.length>1),d=n.lineNumber;return s||(h&&p.length===1&&(d=!1),n.onlyMatching&&(d=!1)),C4(e,p,l,n,m,d,c)}function b4(t,e){return t.caseSensitive?!1:t.ignoreCase?!0:t.smartCase?!e.some(n=>/[A-Z]/.test(n)):!1}function x4(t,e,n){let r;return t.length===1?r=t[0]:r=t.map(s=>e.fixedStrings?s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):`(?:${s})`).join("|"),ws(r,{mode:e.fixedStrings&&t.length===1?"fixed":"perl",ignoreCase:n,wholeWord:e.wordRegexp,lineRegexp:e.lineRegexp,multiline:e.multiline,multilineDotall:e.multilineDotall})}async function E1(t,e,n,r,s){let i=[],o=0,a=0;for(let c of e){let u=t.fs.resolvePath(t.cwd,c);try{let f=await t.fs.stat(u);if(f.isFile){if(o++,n.maxFilesize>0&&f.size>n.maxFilesize)continue;S1(c,n,r,u,s)&&i.push(c)}else f.isDirectory&&(a++,await A1(t,c,u,0,n,r,s,i))}catch{}}return{files:n.sort==="path"?i.sort():i,singleExplicitFile:o===1&&a===0}}async function A1(t,e,n,r,s,i,o,a){if(!(r>=s.maxDepth)){i&&await i.loadForDirectory(n);try{let l=t.fs.readdirWithFileTypes?await t.fs.readdirWithFileTypes(n):(await t.fs.readdir(n)).map(c=>({name:c,isFile:void 0}));for(let c of l){let u=c.name;if(!s.noIgnore&&Es.isCommonIgnored(u))continue;let f=u.startsWith("."),p=e==="."?u:e==="./"?`./${u}`:e.endsWith("/")?`${e}${u}`:`${e}/${u}`,h=t.fs.resolvePath(n,u),m,d,g=!1;if(c.isFile!==void 0&&"isDirectory"in c){let b=c;if(g=b.isSymbolicLink===!0,g&&!s.followSymlinks)continue;if(g&&s.followSymlinks)try{let A=await t.fs.stat(h);m=A.isFile,d=A.isDirectory}catch{continue}else m=b.isFile,d=b.isDirectory}else try{let b=t.fs.lstat?await t.fs.lstat(h):await t.fs.stat(h);if(g=b.isSymbolicLink===!0,g&&!s.followSymlinks)continue;let A=g&&s.followSymlinks?await t.fs.stat(h):b;m=A.isFile,d=A.isDirectory}catch{continue}if(!i?.matches(h,d)&&!(f&&!s.hidden&&!i?.isWhitelisted(h,d))){if(d)await A1(t,p,h,r+1,s,i,o,a);else if(m){if(s.maxFilesize>0)try{if((await t.fs.stat(h)).size>s.maxFilesize)continue}catch{continue}S1(p,s,i,h,o)&&a.push(p)}}}}catch{}}}function S1(t,e,n,r,s){let i=t.split("/").pop()||t;if(n?.matches(r,!1)||e.types.length>0&&!s.matchesType(i,e.types)||e.typesNot.length>0&&s.matchesType(i,e.typesNot))return!1;if(e.globs.length>0){let o=e.globCaseInsensitive,a=e.globs.filter(c=>!c.startsWith("!")),l=e.globs.filter(c=>c.startsWith("!")).map(c=>c.slice(1));if(a.length>0){let c=!1;for(let u of a)if(fn(i,u,o)||fn(t,u,o)){c=!0;break}if(!c)return!1}for(let c of l)if(c.startsWith("/")){let u=c.slice(1);if(fn(t,u,o))return!1}else if(fn(i,c,o)||fn(t,c,o))return!1}if(e.iglobs.length>0){let o=e.iglobs.filter(l=>!l.startsWith("!")),a=e.iglobs.filter(l=>l.startsWith("!")).map(l=>l.slice(1));if(o.length>0){let l=!1;for(let c of o)if(fn(i,c,!0)||fn(t,c,!0)){l=!0;break}if(!l)return!1}for(let l of a)if(l.startsWith("/")){let c=l.slice(1);if(fn(t,c,!0))return!1}else if(fn(i,l,!0)||fn(t,l,!0))return!1}return!0}function fn(t,e,n=!1){let r="^";for(let s=0;s<e.length;s++){let i=e[s];if(i==="*")e[s+1]==="*"?(r+=".*",s++):r+="[^/]*";else if(i==="?")r+="[^/]";else if(i==="["){let o=s+1;for(o<e.length&&e[o]==="!"&&o++,o<e.length&&e[o]==="]"&&o++;o<e.length&&e[o]!=="]";)o++;if(o<e.length){let a=e.slice(s,o+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),r+=a,s=o}else r+="\\["}else r+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return r+="$",ee(r,n?"i":"").test(t)}async function E4(t,e,n){let r=null;n.noIgnore||(r=await ka(t.fs,t.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let s=new bs;for(let c of n.typeClear)s.clearType(c);for(let c of n.typeAdd)s.addType(c);let i=e.length===0?["."]:e,{files:o}=await E1(t,i,n,r,s);if(o.length===0)return{stdout:y,stderr:y,exitCode:1};if(n.quiet)return{stdout:y,stderr:y,exitCode:0};let a=n.nullSeparator?"\0":`
204
+ `,l=o.map(c=>c+a).join("");return{stdout:x(l),stderr:y,exitCode:0}}function A4(t,e){if(e.length===0)return!0;for(let n of e)if(fn(t,n,!1))return!0;return!1}async function S4(t,e,n,r){try{if(r.preprocessor&&t.exec){let o=n.split("/").pop()||n;if(A4(o,r.preprocessorGlobs)){let a=await t.exec(`${r.preprocessor} "${e}"`,{cwd:t.cwd});if(a.exitCode===0&&a.stdout.length>0){let l=R(a.stdout),c=l.slice(0,8192);return{content:l,isBinary:c.includes("\0")}}}}if(r.searchZip&&n.endsWith(".gz")){let o=await t.fs.readFileBuffer(e);if(y4(o))try{let a=g4(o),l=new TextDecoder().decode(a),c=l.slice(0,8192);return{content:l,isBinary:c.includes("\0")}}catch{return null}}let s=await t.fs.readFile(e),i=s.slice(0,8192);return{content:s,isBinary:i.includes("\0")}}catch{return null}}async function C4(t,e,n,r,s,i,o){let a="",l=!1,c=[],u=0,f=0,p=0,h=50;e:for(let g=0;g<e.length;g+=h){let w=e.slice(g,g+h),E=await Promise.all(w.map(async b=>{let A=t.fs.resolvePath(t.cwd,b),N=await S4(t,A,b,r);if(!N)return null;let{content:P,isBinary:O}=N;if(p+=P.length,O&&!r.searchBinary)return null;let G=s&&!r.heading?b:"",M=Dr(P,n,{invertMatch:r.invertMatch,showLineNumbers:i,countOnly:r.count,countMatches:r.countMatches,filename:G,onlyMatching:r.onlyMatching,beforeContext:r.beforeContext,afterContext:r.afterContext,maxCount:r.maxCount,contextSeparator:r.contextSeparator,showColumn:r.column,vimgrep:r.vimgrep,showByteOffset:r.byteOffset,replace:r.replace!==null?Sa(r.replace):null,passthru:r.passthru,multiline:r.multiline,kResetGroup:o});return r.json&&M.matched?{file:b,result:M,content:P,isBinary:!1}:{file:b,result:M}}));for(let b of E){if(!b)continue;let{file:A,result:N}=b;if(N.matched){if(l=!0,f++,u+=N.matchCount,r.quiet&&!r.json)break e;if(r.json&&!r.quiet){let P=b.content||"";c.push(JSON.stringify({type:"begin",data:{path:{text:A}}}));let O=P.split(`
205
+ `);n.lastIndex=0;let G=0;for(let M=0;M<O.length;M++){let Y=O[M];n.lastIndex=0;let B=[];for(let L=n.exec(Y);L!==null;L=n.exec(Y)){let D={match:{text:L[0]},start:L.index,end:L.index+L[0].length};r.replace!==null&&(D.replacement={text:r.replace}),B.push(D),L[0].length===0&&n.lastIndex++}if(B.length>0){let L={type:"match",data:{path:{text:A},lines:{text:`${Y}
206
+ `},line_number:M+1,absolute_offset:G,submatches:B}};c.push(JSON.stringify(L))}G+=Y.length+1}c.push(JSON.stringify({type:"end",data:{path:{text:A},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:1,searches_with_match:1,bytes_searched:P.length,bytes_printed:0,matched_lines:N.matchCount,matches:N.matchCount}}}))}else if(r.filesWithMatches){let P=r.nullSeparator?"\0":`
207
+ `;a+=`${A}${P}`}else r.filesWithoutMatch||(r.heading&&!r.noFilename&&(a+=`${A}
208
+ `),a+=N.output)}else if(r.filesWithoutMatch){let P=r.nullSeparator?"\0":`
209
+ `;a+=`${A}${P}`}else r.includeZero&&(r.count||r.countMatches)&&(a+=N.output)}}r.json&&(c.push(JSON.stringify({type:"summary",data:{elapsed_total:{secs:0,nanos:0,human:"0s"},stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:e.length,searches_with_match:f,bytes_searched:p,bytes_printed:0,matched_lines:u,matches:u}}})),a=`${c.join(`
210
+ `)}
211
+ `);let m=r.quiet&&!r.json?"":a;if(r.stats&&!r.json){let g=["",`${u} matches`,`${u} matched lines`,`${f} files contained matches`,`${e.length} files searched`,`${p} bytes searched`].join(`
212
+ `);m+=`${g}
213
+ `}let d;return r.filesWithoutMatch?d=a.length>0?0:1:d=l?0:1,{stdout:x(m),stderr:y,exitCode:d}}var C1=I(()=>{"use strict";Ve();F();Ca();va();b1()});var N1={};se(N1,{flagsForFuzzing:()=>k4,rgCommand:()=>v4});var N4,v4,k4,v1=I(()=>{"use strict";F();he();va();w1();C1();N4={name:"rg",summary:"recursively search for a pattern",usage:"rg [OPTIONS] PATTERN [PATH ...]",description:`rg (ripgrep) recursively searches directories for a regex pattern.
214
+ Unlike grep, rg is recursive by default and respects .gitignore files.
215
+
216
+ EXAMPLES:
217
+ rg foo Search for 'foo' in current directory
218
+ rg foo src/ Search in src/ directory
219
+ rg -i foo Case-insensitive search
220
+ rg -w foo Match whole words only
221
+ rg -t js foo Search only JavaScript files
222
+ rg -g '*.ts' foo Search files matching glob
223
+ rg --hidden foo Include hidden files
224
+ rg -l foo List files with matches only`,options:["-e, --regexp PATTERN search for PATTERN (can be used multiple times)","-f, --file FILE read patterns from FILE, one per line","-i, --ignore-case case-insensitive search","-s, --case-sensitive case-sensitive search (overrides smart-case)","-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)","-F, --fixed-strings treat pattern as literal string","-w, --word-regexp match whole words only","-x, --line-regexp match whole lines only","-v, --invert-match select non-matching lines","-r, --replace TEXT replace matches with TEXT","-c, --count print count of matching lines per file"," --count-matches print count of individual matches per file","-l, --files-with-matches print only file names with matches"," --files-without-match print file names without matches"," --files list files that would be searched","-o, --only-matching print only matching parts","-m, --max-count NUM stop after NUM matches per file","-q, --quiet suppress output, exit 0 on match"," --stats print search statistics","-n, --line-number print line numbers (default: on)","-N, --no-line-number do not print line numbers","-I, --no-filename suppress the prefixing of file names","-0, --null use NUL as filename separator","-b, --byte-offset show byte offset of each match"," --column show column number of first match"," --vimgrep show results in vimgrep format"," --json show results in JSON Lines format","-A NUM print NUM lines after each match","-B NUM print NUM lines before each match","-C NUM print NUM lines before and after each match"," --context-separator SEP separator for context groups (default: --)","-U, --multiline match patterns across lines","-z, --search-zip search in compressed files (gzip only)","-g, --glob GLOB include files matching GLOB","-t, --type TYPE only search files of TYPE (e.g., js, py, ts)","-T, --type-not TYPE exclude files of TYPE","-L, --follow follow symbolic links","-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)","-a, --text search binary files as text"," --hidden search hidden files and directories"," --no-ignore don't respect .gitignore/.ignore files","-d, --max-depth NUM maximum search depth"," --sort TYPE sort files (path, none)"," --heading show file path above matches"," --passthru print all lines (non-matches use - separator)"," --include-zero include files with 0 matches in count output"," --type-list list all available file types"," --help display this help and exit"]},v4={name:"rg",async execute(t,e){let n=W(t);if(Z(n))return q(N4);if(n.includes("--type-list"))return{stdout:x(p1()),stderr:y,exitCode:0};let r=y1(n);return r.success?x1({ctx:e,options:r.options,paths:r.paths,explicitLineNumbers:r.explicitLineNumbers}):r.error}},k4={name:"rg",flags:[{flag:"-i",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-N",type:"boolean"},{flag:"--hidden",type:"boolean"},{flag:"--no-ignore",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-g",type:"value",valueHint:"pattern"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-T",type:"value",valueHint:"string"}],needsArgs:!0}});function Ta(t){let e="",n=0,r=!1;for(;n<t.length;){if(t[n]==="["&&!r){if(t[n+1]==="["&&t[n+2]===":"){let s=t.indexOf(":]]",n+3);if(s!==-1){let i=t.slice(n+3,s),o=Ia.get(i);if(o){e+=`[${o}]`,n=s+3;continue}}}if(t[n+1]==="^"&&t[n+2]==="["&&t[n+3]===":"){let s=t.indexOf(":]]",n+4);if(s!==-1){let i=t.slice(n+4,s),o=Ia.get(i);if(o){e+=`[^${o}]`,n=s+3;continue}}}e+="[",n++,r=!0,n<t.length&&t[n]==="^"&&(e+="^",n++),n<t.length&&t[n]==="]"&&(e+="\\]",n++);continue}if(r){if(t[n]==="]"){e+="]",n++,r=!1;continue}if(t[n]==="["&&t[n+1]===":"){let s=t.indexOf(":]",n+2);if(s!==-1){let i=t.slice(n+2,s),o=Ia.get(i);if(o){e+=o,n=s+2;continue}}}if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}e+=t[n],n++;continue}if(t[n]==="\\"&&n+1<t.length){let s=t[n+1];if(s==="+"||s==="?"||s==="|"){e+=s,n+=2;continue}if(s==="("||s===")"){e+=s,n+=2;continue}if(s==="{"||s==="}"){e+=s,n+=2;continue}if(s==="t"){e+=" ",n+=2;continue}if(s==="n"){e+=`
225
+ `,n+=2;continue}if(s==="r"){e+="\r",n+=2;continue}e+=t[n]+s,n+=2;continue}if(t[n]==="+"||t[n]==="?"||t[n]==="|"||t[n]==="("||t[n]===")"){e+=`\\${t[n]}`,n++;continue}if(t[n]==="^"&&!(e===""||e.endsWith("("))){e+="\\^",n++;continue}if(t[n]==="$"){let s=n===t.length-1,i=n+2<t.length&&t[n+1]==="\\"&&t[n+2]===")";if(!s&&!i){e+="\\$",n++;continue}}e+=t[n],n++}return e}function Oa(t){let e="",n=!1;for(let r=0;r<t.length;r++)t[r]==="["&&!n?(n=!0,e+="[",r++,r<t.length&&t[r]==="^"&&(e+="^",r++),r<t.length&&t[r]==="]"&&(e+="]",r++),r--):t[r]==="]"&&n?(n=!1,e+="]"):!n&&t[r]==="{"&&t[r+1]===","?(e+="{0,",r++):e+=t[r];return e}function k1(t){let e="";for(let n=0;n<t.length;n++){let r=t[n],s=r.charCodeAt(0);r==="\\"?e+="\\\\":r===" "?e+="\\t":r===`
226
+ `?e+=`$
227
+ `:r==="\r"?e+="\\r":r==="\x07"?e+="\\a":r==="\b"?e+="\\b":r==="\f"?e+="\\f":r==="\v"?e+="\\v":s<32||s>=127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=r}return`${e}$`}var Ia,I1=I(()=>{"use strict";Ia=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]])});function T1(t,e,n){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:t,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],pendingExecute:void 0,rangeStates:n||new Map,linesConsumedInCycle:0}}function T4(t){return typeof t=="object"&&"first"in t&&"step"in t}function O4(t){return typeof t=="object"&&"offset"in t}function _r(t,e,n,r,s){if(t==="$")return e===n;if(typeof t=="number")return e===t;if(T4(t)){let{first:i,step:o}=t;return o===0?e===i:(e-i)%o===0&&e>=i}if(typeof t=="object"&&"pattern"in t)try{let i=t.pattern;i===""&&s?.lastPattern?i=s.lastPattern:i!==""&&s&&(s.lastPattern=i);let o=Oa(Ta(i));return ee(o).test(r)}catch{return!1}return!1}function Ra(t){let e=n=>n===void 0?"undefined":n==="$"?"$":typeof n=="number"?String(n):"pattern"in n?`/${n.pattern}/`:"first"in n?`${n.first}~${n.step}`:"unknown";return`${e(t.start)},${e(t.end)}`}function R4(t,e,n,r,s,i){if(!t||!t.start&&!t.end)return!0;let o=t.start,a=t.end;if(o!==void 0&&a===void 0)return _r(o,e,n,r,i);if(o!==void 0&&a!==void 0){let l=typeof o=="object"&&"pattern"in o,c=typeof a=="object"&&"pattern"in a,u=O4(a);if(u&&s){let p=Ra(t),h=s.get(p);if(h||(h={active:!1},s.set(p,h)),h.active){let m=h.startLine||e;return e>=m+a.offset&&(h.active=!1,s.set(p,h)),!0}else return _r(o,e,n,r,i)?(h.active=!0,h.startLine=e,s.set(p,h),a.offset===0&&(h.active=!1,s.set(p,h)),!0):!1}if(!l&&!c&&!u){let p=typeof o=="number"?o:o==="$"?n:1,h=typeof a=="number"?a:n;if(p<=h)return e>=p&&e<=h;if(s){let m=Ra(t),d=s.get(m);return d||(d={active:!1},s.set(m,d)),!d.completed&&e>=p?(d.completed=!0,s.set(m,d),!0):!1}return!1}if(s){let p=Ra(t),h=s.get(p);if(h||(h={active:!1},s.set(p,h)),h.active)return _r(a,e,n,r,i)&&(h.active=!1,typeof o=="number"&&(h.completed=!0),s.set(p,h)),!0;{if(h.completed)return!1;let m=!1;return typeof o=="number"?m=e>=o:m=_r(o,e,n,r,i),m?(h.active=!0,h.startLine=e,s.set(p,h),_r(a,e,n,r,i)&&(h.active=!1,typeof o=="number"&&(h.completed=!0),s.set(p,h)),!0):!1}}return _r(o,e,n,r,i)}return!0}function ar(t,e,n,r,s,i){let o=R4(t,e,n,r,s,i);return t?.negated?!o:o}function P4(t,e,n,r){let s="",i=0,o=!1;for(;i<=t.length;){e.lastIndex=i;let a=e.exec(t);if(!a){s+=t.slice(i);break}if(a.index!==i){s+=t.slice(i,a.index),i=a.index,o=!1;continue}let l=a[0],c=a.slice(1);if(o&&l.length===0){if(i<t.length)s+=t[i],i++;else break;o=!1;continue}if(s+=r(l,c),o=!1,l.length===0)if(i<t.length)s+=t[i],i++;else break;else i+=l.length,o=!0}return s}function Pa(t,e,n){let r="",s=0;for(;s<t.length;){if(t[s]==="\\"&&s+1<t.length){let i=t[s+1];if(i==="&"){r+="&",s+=2;continue}if(i==="n"){r+=`
228
+ `,s+=2;continue}if(i==="t"){r+=" ",s+=2;continue}if(i==="r"){r+="\r",s+=2;continue}let o=parseInt(i,10);if(o===0){r+=e,s+=2;continue}if(o>=1&&o<=9){r+=n[o-1]||"",s+=2;continue}r+=i,s+=2;continue}if(t[s]==="&"){r+=e,s++;continue}r+=t[s],s++}return r}function $4(t,e){let{lineNumber:n,totalLines:r,patternSpace:s}=e;if(t.type==="label"){e.coverage?.hit(`sed:cmd:${t.type}`);return}if(ar(t.address,n,r,s,e.rangeStates,e))switch(e.coverage?.hit(`sed:cmd:${t.type}`),t.type){case"substitute":{let i=t,o="";i.global&&(o+="g"),i.ignoreCase&&(o+="i");let a=i.pattern;a===""&&e.lastPattern?a=e.lastPattern:a!==""&&(e.lastPattern=a);let l=Oa(i.extendedRegex?a:Ta(a));try{let c=ee(l,o),u=c.test(e.patternSpace);if(c.lastIndex=0,u){if(e.substitutionMade=!0,i.nthOccurrence&&i.nthOccurrence>0&&!i.global){let f=0,p=i.nthOccurrence,h=ee(l,`g${i.ignoreCase?"i":""}`);e.patternSpace=h.replace(e.patternSpace,(m,...d)=>{if(f++,f===p){let g=d.slice(0,-2);return Pa(i.replacement,m,g)}return m})}else if(i.global){let f=ee(l,`g${i.ignoreCase?"i":""}`);e.patternSpace=P4(e.patternSpace,f,i.replacement,(p,h)=>Pa(i.replacement,p,h))}else e.patternSpace=c.replace(e.patternSpace,(f,...p)=>{let h=p.slice(0,-2);return Pa(i.replacement,f,h)});i.printOnMatch&&e.lineNumberOutput.push(e.patternSpace)}}catch{}break}case"print":e.lineNumberOutput.push(e.patternSpace);break;case"printFirstLine":{let i=e.patternSpace.indexOf(`
229
+ `);i!==-1?e.lineNumberOutput.push(e.patternSpace.slice(0,i)):e.lineNumberOutput.push(e.patternSpace);break}case"delete":e.deleted=!0;break;case"deleteFirstLine":{let i=e.patternSpace.indexOf(`
230
+ `);i!==-1?(e.patternSpace=e.patternSpace.slice(i+1),e.restartCycle=!0,e.inDRestartedCycle=!0):e.deleted=!0;break}case"zap":e.patternSpace="";break;case"append":e.appendBuffer.push(t.text);break;case"insert":e.appendBuffer.unshift(`__INSERT__${t.text}`);break;case"change":e.deleted=!0,e.changedText=t.text;break;case"hold":e.holdSpace=e.patternSpace;break;case"holdAppend":e.holdSpace?e.holdSpace+=`
231
+ ${e.patternSpace}`:e.holdSpace=e.patternSpace;break;case"get":e.patternSpace=e.holdSpace;break;case"getAppend":e.patternSpace+=`
232
+ ${e.holdSpace}`;break;case"exchange":{let i=e.patternSpace;e.patternSpace=e.holdSpace,e.holdSpace=i;break}case"next":e.printed=!0;break;case"quit":e.quit=!0,t.exitCode!==void 0&&(e.exitCode=t.exitCode);break;case"quitSilent":e.quit=!0,e.quitSilent=!0,t.exitCode!==void 0&&(e.exitCode=t.exitCode);break;case"list":{let i=k1(e.patternSpace);e.lineNumberOutput.push(i);break}case"printFilename":e.currentFilename&&e.lineNumberOutput.push(e.currentFilename);break;case"version":{let i=[4,8,0];if(t.minVersion){let o=t.minVersion.split("."),a=[],l=!1;for(let c of o){let u=parseInt(c,10);if(Number.isNaN(u)||u<0){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: invalid version string: ${t.minVersion}`,l=!0;break}a.push(u)}if(!l){for(;a.length<3;)a.push(0);for(let c=0;c<3;c++){if(a[c]>i[c]){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: this is not GNU sed version ${t.minVersion}`;break}if(a[c]<i[c])break}}}break}case"readFile":e.pendingFileReads.push({filename:t.filename,wholeFile:!0});break;case"readFileLine":e.pendingFileReads.push({filename:t.filename,wholeFile:!1});break;case"writeFile":e.pendingFileWrites.push({filename:t.filename,content:`${e.patternSpace}
233
+ `});break;case"writeFirstLine":{let i=e.patternSpace.indexOf(`
234
+ `),o=i!==-1?e.patternSpace.slice(0,i):e.patternSpace;e.pendingFileWrites.push({filename:t.filename,content:`${o}
235
+ `});break}case"execute":t.command?e.pendingExecute={command:t.command,replacePattern:!1}:e.pendingExecute={command:e.patternSpace,replacePattern:!0};break;case"transliterate":e.patternSpace=D4(e.patternSpace,t);break;case"lineNumber":e.lineNumberOutput.push(String(e.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function D4(t,e){let n="";for(let r of t){let s=e.source.indexOf(r);s!==-1?n+=e.dest[s]:n+=r}return n}function $a(t,e,n,r){let s=new Map;for(let l=0;l<t.length;l++){let c=t[l];c.type==="label"&&s.set(c.name,l)}let i=r?.maxIterations??I4,o=0,a=0;for(;a<t.length;){if(o++,o>i)throw new ae(`sed: command execution exceeded maximum iterations (${i})`,"iterations");if(e.deleted||e.quit||e.quitSilent||e.restartCycle)break;let l=t[a];if(l.type==="next"){if(ar(l.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:next"),e.nCommandOutput.push(e.patternSpace),n&&n.currentLineIndex+e.linesConsumedInCycle+1<n.lines.length){e.linesConsumedInCycle++;let c=n.lines[n.currentLineIndex+e.linesConsumedInCycle];e.patternSpace=c,e.lineNumber=n.currentLineIndex+e.linesConsumedInCycle+1,e.substitutionMade=!1}else{e.quit=!0,e.deleted=!0;break}a++;continue}if(l.type==="nextAppend"){if(ar(l.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:nextAppend"),n&&n.currentLineIndex+e.linesConsumedInCycle+1<n.lines.length){e.linesConsumedInCycle++;let c=n.lines[n.currentLineIndex+e.linesConsumedInCycle];e.patternSpace+=`
236
+ ${c}`,e.lineNumber=n.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;break}a++;continue}if(l.type==="branch"){let c=l;if(ar(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)){if(e.coverage?.hit("sed:cmd:branch"),c.label){let u=s.get(c.label);if(u!==void 0){a=u;continue}e.branchRequest=c.label;break}break}a++;continue}if(l.type==="branchOnSubst"){let c=l;if(ar(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnSubst"),e.substitutionMade)){if(e.substitutionMade=!1,c.label){let u=s.get(c.label);if(u!==void 0){a=u;continue}e.branchRequest=c.label;break}break}a++;continue}if(l.type==="branchOnNoSubst"){let c=l;if(ar(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnNoSubst"),!e.substitutionMade)){if(c.label){let u=s.get(c.label);if(u!==void 0){a=u;continue}e.branchRequest=c.label;break}break}a++;continue}if(l.type==="group"){let c=l;if(ar(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:group"),$a(c.commands,e,n,r),e.branchRequest)){let u=s.get(e.branchRequest);if(u!==void 0){e.branchRequest=void 0,a=u;continue}break}a++;continue}$4(l,e),a++}return e.linesConsumedInCycle}var I4,O1=I(()=>{"use strict";Ne();Ve();I1();I4=1e4});var le,xi,R1=I(()=>{"use strict";(function(t){t.NUMBER="NUMBER",t.DOLLAR="DOLLAR",t.PATTERN="PATTERN",t.STEP="STEP",t.RELATIVE_OFFSET="RELATIVE_OFFSET",t.LBRACE="LBRACE",t.RBRACE="RBRACE",t.SEMICOLON="SEMICOLON",t.NEWLINE="NEWLINE",t.COMMA="COMMA",t.NEGATION="NEGATION",t.COMMAND="COMMAND",t.SUBSTITUTE="SUBSTITUTE",t.TRANSLITERATE="TRANSLITERATE",t.LABEL_DEF="LABEL_DEF",t.BRANCH="BRANCH",t.BRANCH_ON_SUBST="BRANCH_ON_SUBST",t.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",t.TEXT_CMD="TEXT_CMD",t.FILE_READ="FILE_READ",t.FILE_READ_LINE="FILE_READ_LINE",t.FILE_WRITE="FILE_WRITE",t.FILE_WRITE_LINE="FILE_WRITE_LINE",t.EXECUTE="EXECUTE",t.VERSION="VERSION",t.EOF="EOF",t.ERROR="ERROR"})(le||(le={}));xi=class{input;pos=0;line=1;column=1;constructor(e){this.input=e}tokenize(){let e=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&e.push(n)}return e.push(this.makeToken(le.EOF,"")),e}makeToken(e,n,r){return{type:e,value:n,line:this.line,column:this.column,...r}}peek(e=0){return this.input[this.pos+e]||""}advance(){let e=this.input[this.pos++]||"";return e===`
237
+ `?(this.line++,this.column=1):this.column++,e}readEscapedString(e){let n="";for(;this.pos<this.input.length&&this.peek()!==e;)if(this.peek()==="\\"){this.advance();let r=this.advance();r==="n"?n+=`
238
+ `:r==="t"?n+=" ":n+=r}else{if(this.peek()===`
239
+ `)return null;n+=this.advance()}return n}skipWhitespace(){for(;this.pos<this.input.length;){let e=this.peek();if(e===" "||e===" "||e==="\r")this.advance();else if(e==="#")for(;this.pos<this.input.length&&this.peek()!==`
240
+ `;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let e=this.line,n=this.column,r=this.peek();return r===`
241
+ `?(this.advance(),{type:le.NEWLINE,value:`
242
+ `,line:e,column:n}):r===";"?(this.advance(),{type:le.SEMICOLON,value:";",line:e,column:n}):r==="{"?(this.advance(),{type:le.LBRACE,value:"{",line:e,column:n}):r==="}"?(this.advance(),{type:le.RBRACE,value:"}",line:e,column:n}):r===","?(this.advance(),{type:le.COMMA,value:",",line:e,column:n}):r==="!"?(this.advance(),{type:le.NEGATION,value:"!",line:e,column:n}):r==="$"?(this.advance(),{type:le.DOLLAR,value:"$",line:e,column:n}):this.isDigit(r)?this.readNumber():r==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():r==="/"?this.readPattern():r===":"?this.readLabelDef():this.readCommand()}readNumber(){let e=this.line,n=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="~"){this.advance();let s="";for(;this.isDigit(this.peek());)s+=this.advance();let i=parseInt(r,10),o=parseInt(s,10)||0;return{type:le.STEP,value:`${i}~${o}`,first:i,step:o,line:e,column:n}}return{type:le.NUMBER,value:parseInt(r,10),line:e,column:n}}readRelativeOffset(){let e=this.line,n=this.column;this.advance();let r="";for(;this.isDigit(this.peek());)r+=this.advance();let s=parseInt(r,10)||0;return{type:le.RELATIVE_OFFSET,value:`+${s}`,offset:s,line:e,column:n}}readPattern(){let e=this.line,n=this.column;this.advance();let r="",s=!1;for(;this.pos<this.input.length;){let i=this.peek();if(i==="/"&&!s)break;if(i==="\\")r+=this.advance(),this.pos<this.input.length&&this.peek()!==`
243
+ `&&(r+=this.advance());else{if(i===`
244
+ `)break;i==="["&&!s?(s=!0,r+=this.advance(),this.peek()==="^"&&(r+=this.advance()),this.peek()==="]"&&(r+=this.advance())):i==="]"&&s?(s=!1,r+=this.advance()):r+=this.advance()}}return this.peek()==="/"&&this.advance(),{type:le.PATTERN,value:r,pattern:r,line:e,column:n}}readLabelDef(){let e=this.line,n=this.column;for(this.advance();this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
245
+ `||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:le.LABEL_DEF,value:r,label:r,line:e,column:n}}readCommand(){let e=this.line,n=this.column,r=this.advance();switch(r){case"s":return this.readSubstitute(e,n);case"y":return this.readTransliterate(e,n);case"a":case"i":case"c":return this.readTextCommand(r,e,n);case"b":return this.readBranch(le.BRANCH,"b",e,n);case"t":return this.readBranch(le.BRANCH_ON_SUBST,"t",e,n);case"T":return this.readBranch(le.BRANCH_ON_NO_SUBST,"T",e,n);case"r":return this.readFileCommand(le.FILE_READ,"r",e,n);case"R":return this.readFileCommand(le.FILE_READ_LINE,"R",e,n);case"w":return this.readFileCommand(le.FILE_WRITE,"w",e,n);case"W":return this.readFileCommand(le.FILE_WRITE_LINE,"W",e,n);case"e":return this.readExecute(e,n);case"p":case"P":case"d":case"D":case"h":case"H":case"g":case"G":case"x":case"n":case"N":case"q":case"Q":case"z":case"=":case"l":case"F":return{type:le.COMMAND,value:r,line:e,column:n};case"v":return this.readVersion(e,n);default:return{type:le.ERROR,value:r,line:e,column:n}}}readSubstitute(e,n){let r=this.advance();if(!r||r===`
246
+ `)return{type:le.ERROR,value:"s",line:e,column:n};let s="",i=!1;for(;this.pos<this.input.length;){let l=this.peek();if(l===r&&!i)break;if(l==="\\")this.advance(),this.pos<this.input.length&&this.peek()!==`
247
+ `?this.peek()===r&&!i?s+=this.advance():(s+="\\",s+=this.advance()):s+="\\";else{if(l===`
248
+ `)break;l==="["&&!i?(i=!0,s+=this.advance(),this.peek()==="^"&&(s+=this.advance()),this.peek()==="]"&&(s+=this.advance())):l==="]"&&i?(i=!1,s+=this.advance()):s+=this.advance()}}if(this.peek()!==r)return{type:le.ERROR,value:"unterminated substitution pattern",line:e,column:n};this.advance();let o="";for(;this.pos<this.input.length&&this.peek()!==r;)if(this.peek()==="\\")if(this.advance(),this.pos<this.input.length){let l=this.peek();l==="\\"?(this.advance(),this.pos<this.input.length&&this.peek()===`
249
+ `?(o+=`
250
+ `,this.advance()):o+="\\"):l===`
251
+ `?(o+=`
252
+ `,this.advance()):o+=`\\${this.advance()}`}else o+="\\";else{if(this.peek()===`
253
+ `)break;o+=this.advance()}this.peek()===r&&this.advance();let a="";for(;this.pos<this.input.length;){let l=this.peek();if(l==="g"||l==="i"||l==="p"||l==="I"||this.isDigit(l))a+=this.advance();else break}return{type:le.SUBSTITUTE,value:`s${r}${s}${r}${o}${r}${a}`,pattern:s,replacement:o,flags:a,line:e,column:n}}readTransliterate(e,n){let r=this.advance();if(!r||r===`
254
+ `)return{type:le.ERROR,value:"y",line:e,column:n};let s=this.readEscapedString(r);if(s===null||this.peek()!==r)return{type:le.ERROR,value:"unterminated transliteration source",line:e,column:n};this.advance();let i=this.readEscapedString(r);if(i===null||this.peek()!==r)return{type:le.ERROR,value:"unterminated transliteration dest",line:e,column:n};this.advance();let o=this.peek();for(;o===" "||o===" ";)this.advance(),o=this.peek();return o!==""&&o!==";"&&o!==`
255
+ `&&o!=="}"?{type:le.ERROR,value:"extra text at the end of a transform command",line:e,column:n}:{type:le.TRANSLITERATE,value:`y${r}${s}${r}${i}${r}`,source:s,dest:i,line:e,column:n}}readTextCommand(e,n,r){let s=!1;this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===`
256
+ `||this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&(s=!0,this.advance()),(this.peek()===" "||this.peek()===" ")&&this.advance(),this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&this.advance(),s&&this.peek()===`
257
+ `&&this.advance();let i="";for(;this.pos<this.input.length;){let o=this.peek();if(o===`
258
+ `){if(i.endsWith("\\")){i=`${i.slice(0,-1)}
259
+ `,this.advance();continue}break}if(o==="\\"&&this.pos+1<this.input.length){let a=this.input[this.pos+1];if(a==="n"){i+=`
260
+ `,this.advance(),this.advance();continue}if(a==="t"){i+=" ",this.advance(),this.advance();continue}if(a==="r"){i+="\r",this.advance(),this.advance();continue}}i+=this.advance()}return{type:le.TEXT_CMD,value:e,text:i,line:n,column:r}}readBranch(e,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let o=this.peek();if(o===" "||o===" "||o===`
261
+ `||o===";"||o==="}"||o==="{")break;i+=this.advance()}return{type:e,value:n,label:i||void 0,line:r,column:s}}readVersion(e,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
262
+ `||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:le.VERSION,value:"v",label:r||void 0,line:e,column:n}}readFileCommand(e,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let o=this.peek();if(o===`
263
+ `||o===";")break;i+=this.advance()}return{type:e,value:n,filename:i.trim(),line:r,column:s}}readExecute(e,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
264
+ `||s===";")break;r+=this.advance()}return{type:le.EXECUTE,value:"e",command:r.trim()||void 0,line:e,column:n}}isDigit(e){return e>="0"&&e<="9"}}});function P1(t,e=!1){let n=!1,r=!1,s=[];for(let l=0;l<t.length;l++){let c=t[l];if(s.length===0&&l===0){let u=c.match(/^#([nr]+)\s*(?:\n|$)/i);if(u){let f=u[1].toLowerCase();f.includes("n")&&(n=!0),f.includes("r")&&(r=!0),c=c.slice(u[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let u=s[s.length-1];s[s.length-1]=`${u}
265
+ ${c}`}else s.push(c)}let i=s.join(`
266
+ `),a=new Da([i],e||r).parse();if(!a.error&&a.commands.length>0){let l=_4(a.commands);if(l)return{commands:[],error:l,silentMode:n,extendedRegexMode:r}}return{...a,silentMode:n,extendedRegexMode:r}}function _4(t){let e=new Set;$1(t,e);let n=D1(t,e);if(n)return`undefined label '${n}'`}function $1(t,e){for(let n of t)n.type==="label"?e.add(n.name):n.type==="group"&&$1(n.commands,e)}function D1(t,e){for(let n of t){if((n.type==="branch"||n.type==="branchOnSubst"||n.type==="branchOnNoSubst")&&n.label&&!e.has(n.label))return n.label;if(n.type==="group"){let r=D1(n.commands,e);if(r)return r}}}var Da,_1=I(()=>{"use strict";R1();Da=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,n=!1){this.scripts=e,this.extendedRegex=n}parse(){let e=[];for(let n of this.scripts){let r=new xi(n);for(this.tokens=r.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(le.NEWLINE)||this.check(le.SEMICOLON)){this.advance();continue}let s=this.parseCommand();if(s.error)return{commands:[],error:s.error};s.command&&e.push(s.command)}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let n=e?.address;for(this.check(le.NEGATION)&&(this.advance(),n&&(n.negated=!0));this.check(le.NEWLINE)||this.check(le.SEMICOLON);)this.advance();if(this.isAtEnd())return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null};let r=this.peek();switch(r.type){case le.COMMAND:return this.parseSimpleCommand(r,n);case le.SUBSTITUTE:return this.parseSubstituteFromToken(r,n);case le.TRANSLITERATE:return this.parseTransliterateFromToken(r,n);case le.LABEL_DEF:return this.advance(),{command:{type:"label",name:r.label||""}};case le.BRANCH:return this.advance(),{command:{type:"branch",address:n,label:r.label}};case le.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:n,label:r.label}};case le.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:n,label:r.label}};case le.TEXT_CMD:return this.advance(),this.parseTextCommand(r,n);case le.FILE_READ:return this.advance(),{command:{type:"readFile",address:n,filename:r.filename||""}};case le.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:n,filename:r.filename||""}};case le.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:n,filename:r.filename||""}};case le.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:n,filename:r.filename||""}};case le.EXECUTE:return this.advance(),{command:{type:"execute",address:n,command:r.command}};case le.VERSION:return this.advance(),{command:{type:"version",address:n,minVersion:r.label}};case le.LBRACE:return this.parseGroup(n);case le.RBRACE:return{command:null};case le.ERROR:return{command:null,error:`invalid command: ${r.value}`};default:return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,n){this.advance();let r=e.value;switch(r){case"p":return{command:{type:"print",address:n}};case"P":return{command:{type:"printFirstLine",address:n}};case"d":return{command:{type:"delete",address:n}};case"D":return{command:{type:"deleteFirstLine",address:n}};case"h":return{command:{type:"hold",address:n}};case"H":return{command:{type:"holdAppend",address:n}};case"g":return{command:{type:"get",address:n}};case"G":return{command:{type:"getAppend",address:n}};case"x":return{command:{type:"exchange",address:n}};case"n":return{command:{type:"next",address:n}};case"N":return{command:{type:"nextAppend",address:n}};case"q":return{command:{type:"quit",address:n}};case"Q":return{command:{type:"quitSilent",address:n}};case"z":return{command:{type:"zap",address:n}};case"=":return{command:{type:"lineNumber",address:n}};case"l":return{command:{type:"list",address:n}};case"F":return{command:{type:"printFilename",address:n}};default:return{command:null,error:`unknown command: ${r}`}}}parseSubstituteFromToken(e,n){this.advance();let r=e.flags||"",s,i=r.match(/(\d+)/);return i&&(s=parseInt(i[1],10)),{command:{type:"substitute",address:n,pattern:e.pattern||"",replacement:e.replacement||"",global:r.includes("g"),ignoreCase:r.includes("i")||r.includes("I"),printOnMatch:r.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,n){this.advance();let r=e.source||"",s=e.dest||"";return r.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:n,source:r,dest:s}}}parseTextCommand(e,n){let r=e.value,s=e.text||"";switch(r){case"a":return{command:{type:"append",address:n,text:s}};case"i":return{command:{type:"insert",address:n,text:s}};case"c":return{command:{type:"change",address:n,text:s}};default:return{command:null,error:`unknown text command: ${r}`}}}parseGroup(e){this.advance();let n=[];for(;!this.isAtEnd()&&!this.check(le.RBRACE);){if(this.check(le.NEWLINE)||this.check(le.SEMICOLON)){this.advance();continue}let r=this.parseCommand();if(r.error)return{command:null,error:r.error};r.command&&n.push(r.command)}return this.check(le.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:n}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){let e=this.parseAddress();if(e===void 0)return;let n;if(this.check(le.RELATIVE_OFFSET))n={offset:this.advance().offset||0};else if(this.check(le.COMMA)&&(this.advance(),n=this.parseAddress(),n===void 0))return{error:"expected context address"};return{address:{start:e,end:n}}}parseAddress(){let e=this.peek();switch(e.type){case le.NUMBER:return this.advance(),e.value;case le.DOLLAR:return this.advance(),"$";case le.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case le.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case le.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:le.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===le.EOF}}});var M1={};se(M1,{flagsForFuzzing:()=>F4,sedCommand:()=>L4});async function _a(t,e,n,r={}){let{limits:s,filename:i,fs:o,cwd:a,coverage:l}=r,c=t.endsWith(`
267
+ `),u=t.split(`
268
+ `);u.length>0&&u[u.length-1]===""&&u.pop();let f=u.length,p="",h,m=!1,d=s?.maxStringLength??0,g=G=>{if(p+=G,d>0&&p.length>d)throw new ae(`sed: output size limit exceeded (${d} bytes)`,"string_length")},w="",E,b=new Map,A=new Map,N=new Map,P=new Map,O=s?{maxIterations:s.maxSedIterations}:void 0;for(let G=0;G<u.length;G++){let M={...T1(f,i,b),patternSpace:u[G],holdSpace:w,lastPattern:E,lineNumber:G+1,totalLines:f,substitutionMade:!1,coverage:l},Y={lines:u,currentLineIndex:G},B=0,L=1e4;M.linesConsumedInCycle=0;do{if(B++,B>L)break;if(M.restartCycle=!1,M.pendingFileReads=[],M.pendingFileWrites=[],$a(e,M,Y,O),o&&a){for(let J of M.pendingFileReads){let ce=o.resolvePath(a,J.filename);try{if(J.wholeFile){let we=await o.readFile(ce);M.appendBuffer.push(we.replace(/\n$/,""))}else{if(!A.has(ce)){let fe=await o.readFile(ce);A.set(ce,fe.split(`
269
+ `)),N.set(ce,0)}let we=A.get(ce),Q=N.get(ce);we&&Q!==void 0&&Q<we.length&&(M.appendBuffer.push(we[Q]),N.set(ce,Q+1))}}catch{}}for(let J of M.pendingFileWrites){let ce=o.resolvePath(a,J.filename),we=P.get(ce)||"";P.set(ce,we+J.content)}}}while(M.restartCycle&&!M.deleted&&!M.quit&&!M.quitSilent);if(G+=M.linesConsumedInCycle,w=M.holdSpace,E=M.lastPattern,!n)for(let J of M.nCommandOutput)g(`${J}
270
+ `);let D=M.lineNumberOutput.length>0;for(let J of M.lineNumberOutput)g(`${J}
271
+ `);let v=[],_=[];for(let J of M.appendBuffer)J.startsWith("__INSERT__")?v.push(J.slice(10)):_.push(J);for(let J of v)g(`${J}
272
+ `);let H=!1;!M.deleted&&!M.quitSilent?n?M.printed&&(g(`${M.patternSpace}
273
+ `),H=!0):(g(`${M.patternSpace}
274
+ `),H=!0):M.changedText!==void 0&&(g(`${M.changedText}
275
+ `),H=!0);for(let J of _)g(`${J}
276
+ `);if(m=(D||H)&&_.length===0,M.quit||M.quitSilent){if(M.exitCode!==void 0&&(h=M.exitCode),M.errorMessage)return{output:"",exitCode:h||1,errorMessage:M.errorMessage};break}}if(o&&a)for(let[G,M]of P)try{await o.writeFile(G,M)}catch{}return!c&&m&&p.endsWith(`
277
+ `)&&(p=p.slice(0,-1)),{output:p,exitCode:h}}var M4,L4,F4,L1=I(()=>{"use strict";Ne();F();he();O1();_1();M4={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
278
+ s/regexp/replacement/[flags] substitute
279
+ d delete pattern space
280
+ p print pattern space
281
+ a\\ text append text after line
282
+ i\\ text insert text before line
283
+ c\\ text change (replace) line with text
284
+ h copy pattern space to hold space
285
+ H append pattern space to hold space
286
+ g copy hold space to pattern space
287
+ G append hold space to pattern space
288
+ x exchange pattern and hold spaces
289
+ n read next line into pattern space
290
+ N append next line to pattern space
291
+ y/source/dest/ transliterate characters
292
+ = print line number
293
+ l list pattern space (escape special chars)
294
+ b [label] branch to label
295
+ t [label] branch on substitution
296
+ T [label] branch if no substitution
297
+ :label define label
298
+ q quit
299
+ Q quit without printing
300
+
301
+ Addresses:
302
+ N line number
303
+ $ last line
304
+ /regexp/ lines matching regexp
305
+ N,M range from line N to M
306
+ first~step every step-th line starting at first`};L4={name:"sed",async execute(t,e){let n=W(t);if(Z(n))return q(M4);let r=[],s=[],i=!1,o=!1,a=!1,l=[];for(let d=0;d<n.length;d++){let g=n[d];if(g==="-n"||g==="--quiet"||g==="--silent")i=!0;else if(g==="-i"||g==="--in-place")o=!0;else if(g.startsWith("-i"))o=!0;else if(g==="-E"||g==="-r"||g==="--regexp-extended")a=!0;else if(g==="-e")d+1<n.length&&r.push(n[++d]);else if(g==="-f")d+1<n.length&&s.push(n[++d]);else{if(g.startsWith("--"))return oe("sed",g);if(g==="-")l.push(g);else if(g.startsWith("-")&&g.length>1){for(let w of g.slice(1))if(w!=="n"&&w!=="e"&&w!=="f"&&w!=="i"&&w!=="E"&&w!=="r")return oe("sed",`-${w}`);g.includes("n")&&(i=!0),g.includes("i")&&(o=!0),(g.includes("E")||g.includes("r"))&&(a=!0),g.includes("e")&&!g.includes("n")&&!g.includes("i")&&d+1<n.length&&r.push(n[++d]),g.includes("f")&&!g.includes("e")&&d+1<n.length&&s.push(n[++d])}else!g.startsWith("-")&&r.length===0&&s.length===0?r.push(g):g.startsWith("-")||l.push(g)}}for(let d of s){let g=e.fs.resolvePath(e.cwd,d);try{let w=await e.fs.readFile(g);for(let E of w.split(`
307
+ `)){let b=E.trim();b&&!b.startsWith("#")&&r.push(b)}}catch{return{stdout:y,stderr:x(`sed: couldn't open file ${d}: No such file or directory
308
+ `),exitCode:1}}}if(r.length===0)return{stdout:y,stderr:x(`sed: no script specified
309
+ `),exitCode:1};let{commands:c,error:u,silentMode:f}=P1(r,a);if(u)return{stdout:y,stderr:x(`sed: ${u}
310
+ `),exitCode:1};let p=!!(i||f);if(o){if(l.length===0)return{stdout:y,stderr:x(`sed: -i requires at least one file argument
311
+ `),exitCode:1};for(let d of l){if(d==="-")continue;let g=e.fs.resolvePath(e.cwd,d);try{let w=await e.fs.readFile(g),E=await _a(w,c,p,{limits:e.limits,filename:d,fs:e.fs,cwd:e.cwd,coverage:e.coverage});if(E.errorMessage)return{stdout:y,stderr:x(`${E.errorMessage}
312
+ `),exitCode:E.exitCode??1};await e.fs.writeFile(g,E.output)}catch(w){return w instanceof ae?{stdout:y,stderr:x(`sed: ${w.message}
313
+ `),exitCode:ae.EXIT_CODE}:{stdout:y,stderr:x(`sed: ${d}: No such file or directory
314
+ `),exitCode:1}}}return{stdout:y,stderr:y,exitCode:0}}let h="";if(l.length===0){h=R(e.stdin);try{let d=await _a(h,c,p,{limits:e.limits,fs:e.fs,cwd:e.cwd,coverage:e.coverage});return{stdout:x(d.output),stderr:x(d.errorMessage?`${d.errorMessage}
315
+ `:""),exitCode:d.exitCode??0}}catch(d){if(d instanceof ae)return{stdout:y,stderr:x(`sed: ${d.message}
316
+ `),exitCode:ae.EXIT_CODE};throw d}}let m=!1;for(let d of l){let g;if(d==="-")m?g="":(g=R(e.stdin),m=!0);else{let w=e.fs.resolvePath(e.cwd,d);try{g=await e.fs.readFile(w)}catch(E){return E instanceof ae?{stdout:y,stderr:x(`sed: ${E.message}
317
+ `),exitCode:ae.EXIT_CODE}:{stdout:y,stderr:x(`sed: ${d}: No such file or directory
318
+ `),exitCode:1}}}h.length>0&&g.length>0&&!h.endsWith(`
319
+ `)&&(h+=`
320
+ `),h+=g}try{let d=await _a(h,c,p,{limits:e.limits,filename:l.length===1?l[0]:void 0,fs:e.fs,cwd:e.cwd,coverage:e.coverage});return{stdout:x(d.output),stderr:x(d.errorMessage?`${d.errorMessage}
321
+ `:""),exitCode:d.exitCode??0}}catch(d){if(d instanceof ae)return{stdout:y,stderr:x(`sed: ${d.message}
322
+ `),exitCode:ae.EXIT_CODE};throw d}}},F4={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0}});function Rt(t){let e=Object.create(null);for(let[n,r]of t)e[n]=typeof r=="string"?r:R(r);return e}function pn(t,e){let n=Object.create(null);for(let[r,s]of t)n[r]=typeof s=="string"?s:R(s);return e&&Object.assign(n,e),n}function Ei(...t){return Object.assign(Object.create(null),...t)}var Wn=I(()=>{"use strict";F()});function Ma(t={}){let{fieldSep:e=W4,maxIterations:n=U4,maxRecursionDepth:r=B4,maxOutputSize:s=0,fs:i,cwd:o,exec:a,coverage:l}=t;return{FS:" ",OFS:" ",ORS:`
323
+ `,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,fieldSep:e,maxIterations:n,maxRecursionDepth:r,maxOutputSize:s,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:i,cwd:o,exec:a,coverage:l}}var U4,B4,W4,F1=I(()=>{"use strict";Ve();U4=1e4,B4=100,W4=new Rn(/\s+/)});function U1(t,e,n){switch(n){case"+":return t+e;case"-":return t-e;case"*":return t*e;case"/":return e!==0?t/e:0;case"%":return e!==0?t%e:0;case"^":case"**":return t**e;default:return 0}}var B1=I(()=>{"use strict"});function nn(t){if(typeof t=="number")return t;let e=parseFloat(t);return Number.isNaN(e)?0:e}function gt(t){return typeof t=="string"?t:(Number.isInteger(t),String(t))}async function Ai(t,e){if(t.type==="regex")return t.pattern;let n=gt(await e.evalExpr(t));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function z1(t,e){return t?t.type==="variable"?t.name:t.type==="field"?`$${Math.floor(nn(await e.evalExpr(t.index)))}`:"$0":"$0"}function H1(t,e){if(t==="$0")return e.line;if(t.startsWith("$")){let n=parseInt(t.slice(1),10)-1;return e.fields[n]||""}return gt(e.vars[t]??"")}function j1(t,e,n){if(t==="$0")n.line=e,n.fields=n.FS===" "?e.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(e),n.NF=n.fields.length;else if(t.startsWith("$")){let r=parseInt(t.slice(1),10)-1;for(;n.fields.length<=r;)n.fields.push("");n.fields[r]=e,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[t]=e}async function z4(t,e,n){return t.length===0?e.line.length:gt(await n.evalExpr(t[0])).length}async function H4(t,e,n){if(t.length<2)return"";let r=gt(await n.evalExpr(t[0])),s=Math.floor(nn(await n.evalExpr(t[1])))-1;if(t.length>=3){let i=Math.floor(nn(await n.evalExpr(t[2])));return r.substr(Math.max(0,s),i)}return r.substr(Math.max(0,s))}async function j4(t,e,n){if(t.length<2)return 0;let r=gt(await n.evalExpr(t[0])),s=gt(await n.evalExpr(t[1])),i=r.indexOf(s);return i===-1?0:i+1}async function G4(t,e,n){if(t.length<2)return 0;let r=gt(await n.evalExpr(t[0])),s=t[1];if(s.type!=="variable")return 0;let i=s.name,o=e.FS;if(t.length>=3){let l=t[2];if(l.type==="regex")o=ee(l.pattern);else{let c=gt(await n.evalExpr(l));o=c===" "?ee("\\s+"):c}}else e.FS===" "&&(o=ee("\\s+"));let a=typeof o=="string"?r.split(o):o.split(r);e.arrays[i]=Object.create(null);for(let l=0;l<a.length;l++)e.arrays[i][String(l+1)]=a[l];return a.length}async function V4(t,e,n){if(t.length<2)return 0;let r=await Ai(t[0],n),s=gt(await n.evalExpr(t[1])),i=await z1(t[2],n),o=H1(i,e);try{let l=ee(r).replace(o,G1(s)),c=l!==o?1:0;return j1(i,l,e),c}catch{return 0}}async function q4(t,e,n){if(t.length<2)return 0;let r=await Ai(t[0],n),s=gt(await n.evalExpr(t[1])),i=await z1(t[2],n),o=H1(i,e);try{let a=ee(r,"g"),l=a.match(o),c=l?l.length:0,u=a.replace(o,G1(s));return j1(i,u,e),c}catch{return 0}}function G1(t){return e=>{let n="",r=0;for(;r<t.length;)if(t[r]==="\\"&&r+1<t.length){let s=t[r+1];s==="&"?(n+="&",r+=2):s==="\\"?(n+="\\",r+=2):(n+=t[r+1],r+=2)}else t[r]==="&"?(n+=e,r++):(n+=t[r],r++);return n}}async function Z4(t,e,n){if(t.length<2)return e.RSTART=0,e.RLENGTH=-1,0;let r=gt(await n.evalExpr(t[0])),s=await Ai(t[1],n);try{let o=ee(s).exec(r);if(o)return e.RSTART=o.index+1,e.RLENGTH=o[0].length,e.RSTART}catch{}return e.RSTART=0,e.RLENGTH=-1,0}async function Y4(t,e,n){if(t.length<3)return"";let r=await Ai(t[0],n),s=gt(await n.evalExpr(t[1])),i=gt(await n.evalExpr(t[2])),o=t.length>=4?gt(await n.evalExpr(t[3])):e.line;try{let a=i.toLowerCase()==="g",l=a?0:parseInt(i,10)||1;if(a)return ee(r,"g").replace(o,(u,...f)=>W1(s,u,f.slice(0,-2)));{let c=0;return ee(r,"g").replace(o,(f,...p)=>(c++,c===l?W1(s,f,p.slice(0,-2)):f))}}catch{return o}}function W1(t,e,n){let r="",s=0;for(;s<t.length;)if(t[s]==="\\"&&s+1<t.length){let i=t[s+1];if(i==="&")r+="&",s+=2;else if(i==="0")r+=e,s+=2;else if(i>="1"&&i<="9"){let o=parseInt(i,10)-1;r+=n[o]||"",s+=2}else i==="n"?(r+=`
324
+ `,s+=2):i==="t"?(r+=" ",s+=2):(r+=i,s+=2)}else t[s]==="&"?(r+=e,s++):(r+=t[s],s++);return r}async function Q4(t,e,n){return t.length===0?"":gt(await n.evalExpr(t[0])).toLowerCase()}async function K4(t,e,n){return t.length===0?"":gt(await n.evalExpr(t[0])).toUpperCase()}async function X4(t,e,n){if(t.length===0)return"";let r=gt(await n.evalExpr(t[0])),s=[];for(let i=1;i<t.length;i++)s.push(await n.evalExpr(t[i]));return Si(r,s)}async function J4(t,e,n){return t.length===0?0:Math.floor(nn(await n.evalExpr(t[0])))}async function e3(t,e,n){return t.length===0?0:Math.sqrt(nn(await n.evalExpr(t[0])))}async function t3(t,e,n){return t.length===0?0:Math.sin(nn(await n.evalExpr(t[0])))}async function n3(t,e,n){return t.length===0?0:Math.cos(nn(await n.evalExpr(t[0])))}async function r3(t,e,n){let r=t.length>0?nn(await n.evalExpr(t[0])):0,s=t.length>1?nn(await n.evalExpr(t[1])):0;return Math.atan2(r,s)}async function s3(t,e,n){return t.length===0?0:Math.log(nn(await n.evalExpr(t[0])))}async function i3(t,e,n){return t.length===0?1:Math.exp(nn(await n.evalExpr(t[0])))}function o3(t,e,n){return e.random?e.random():Math.random()}async function a3(t,e,n){let r=t.length>0?nn(await n.evalExpr(t[0])):Date.now();return e.vars._srand_seed=r,r}function l3(t,e){return()=>{throw new Error(`${t}() is not supported - ${e}`)}}function La(t){return()=>{throw new Error(`function '${t}()' is not implemented`)}}function Si(t,e){let n=0,r="",s=0;for(;s<t.length;)if(t[s]==="%"&&s+1<t.length){let i=s+1,o="",a="",l="",c,u=i;for(;i<t.length&&/\d/.test(t[i]);)i++;i>u&&t[i]==="$"?(c=parseInt(t.substring(u,i),10)-1,i++):i=u;let f=()=>{if(i<t.length){if(i+1<t.length&&(t[i]==="h"&&t[i+1]==="h"||t[i]==="l"&&t[i+1]==="l")){i+=2;return}/[lzjh]/.test(t[i])&&i++}};for(;i<t.length&&/[-+ #0]/.test(t[i]);)o+=t[i++];if(t[i]==="*"){let d=e[n++],g=d!==void 0?Math.floor(Number(d)):0;g<0?(o+="-",a=String(Math.min(-g,lr))):a=String(Math.min(g,lr)),i++}else for(;i<t.length&&/\d/.test(t[i]);)a+=t[i++];if(a&&parseInt(a,10)>lr&&(a=String(lr)),t[i]==="."){if(i++,t[i]==="*"){let d=e[n++];l=String(Math.min(d!==void 0?Math.floor(Number(d)):0,lr)),i++}else for(;i<t.length&&/\d/.test(t[i]);)l+=t[i++];l&&parseInt(l,10)>lr&&(l=String(lr))}f();let p=t[i],m=e[c!==void 0?c:n];switch(p){case"s":{let d=m!==void 0?String(m):"";if(l&&(d=d.substring(0,parseInt(l,10))),a){let g=parseInt(a,10);o.includes("-")?d=d.padEnd(g):d=d.padStart(g)}r+=d,c===void 0&&n++;break}case"d":case"i":{let d=m!==void 0?Math.floor(Number(m)):0;Number.isNaN(d)&&(d=0);let g=d<0,w=Math.abs(d).toString();if(l){let A=parseInt(l,10);w=w.padStart(A,"0")}let E="";g?E="-":o.includes("+")?E="+":o.includes(" ")&&(E=" ");let b=E+w;if(a){let A=parseInt(a,10);o.includes("-")?b=b.padEnd(A):o.includes("0")&&!l?b=E+w.padStart(A-E.length,"0"):b=b.padStart(A)}r+=b,c===void 0&&n++;break}case"f":{let d=m!==void 0?Number(m):0;Number.isNaN(d)&&(d=0);let g=l?parseInt(l,10):6,w=d.toFixed(g);if(a){let E=parseInt(a,10);o.includes("-")?w=w.padEnd(E):w=w.padStart(E)}r+=w,c===void 0&&n++;break}case"e":case"E":{let d=m!==void 0?Number(m):0;Number.isNaN(d)&&(d=0);let g=l?parseInt(l,10):6,w=d.toExponential(g);if(p==="E"&&(w=w.toUpperCase()),a){let E=parseInt(a,10);o.includes("-")?w=w.padEnd(E):w=w.padStart(E)}r+=w,c===void 0&&n++;break}case"g":case"G":{let d=m!==void 0?Number(m):0;Number.isNaN(d)&&(d=0);let g=l?parseInt(l,10):6,w=d!==0?Math.floor(Math.log10(Math.abs(d))):0,E;if(d===0?E="0":w<-4||w>=g?(E=d.toExponential(g-1),p==="G"&&(E=E.toUpperCase())):E=d.toPrecision(g),E.includes(".")&&(E=E.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),E.includes("e")&&(E=E.replace(/\.?0+e/,"e")),a){let b=parseInt(a,10);o.includes("-")?E=E.padEnd(b):E=E.padStart(b)}r+=E,c===void 0&&n++;break}case"x":case"X":{let d=m!==void 0?Math.floor(Number(m)):0;Number.isNaN(d)&&(d=0);let g=Math.abs(d).toString(16);if(p==="X"&&(g=g.toUpperCase()),l){let b=parseInt(l,10);g=g.padStart(b,"0")}let w=d<0?"-":"",E=w+g;if(a){let b=parseInt(a,10);o.includes("-")?E=E.padEnd(b):o.includes("0")&&!l?E=w+g.padStart(b-w.length,"0"):E=E.padStart(b)}r+=E,c===void 0&&n++;break}case"o":{let d=m!==void 0?Math.floor(Number(m)):0;Number.isNaN(d)&&(d=0);let g=Math.abs(d).toString(8);if(l){let b=parseInt(l,10);g=g.padStart(b,"0")}let w=d<0?"-":"",E=w+g;if(a){let b=parseInt(a,10);o.includes("-")?E=E.padEnd(b):o.includes("0")&&!l?E=w+g.padStart(b-w.length,"0"):E=E.padStart(b)}r+=E,c===void 0&&n++;break}case"c":{typeof m=="number"?r+=String.fromCharCode(m):r+=String(m??"").charAt(0)||"",c===void 0&&n++;break}case"%":r+="%";break;default:r+=t.substring(s,i+1)}s=i+1}else if(t[s]==="\\"&&s+1<t.length){let i=t[s+1];switch(i){case"n":r+=`
325
+ `;break;case"t":r+=" ";break;case"r":r+="\r";break;case"\\":r+="\\";break;default:r+=i}s+=2}else r+=t[s++];return r}var lr,V1,Fa=I(()=>{"use strict";Ve();lr=1e4;V1=new Map([["length",z4],["substr",H4],["index",j4],["split",G4],["sub",V4],["gsub",q4],["match",Z4],["gensub",Y4],["tolower",Q4],["toupper",K4],["sprintf",X4],["int",J4],["sqrt",e3],["sin",t3],["cos",n3],["atan2",r3],["log",s3],["exp",i3],["rand",o3],["srand",a3],["system",l3("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",La("systime")],["mktime",La("mktime")],["strftime",La("strftime")]])});function Pt(t){return typeof t=="number"?t!==0:!(t===""||t==="0")}function Ke(t){if(typeof t=="number")return t;let e=parseFloat(t);return Number.isNaN(e)?0:e}function Le(t){return typeof t=="string"?t:(Number.isInteger(t),String(t))}function Ua(t){if(typeof t=="number")return!0;let e=String(t).trim();return e===""?!1:!Number.isNaN(Number(e))}function As(t,e){try{return ee(t).test(e)}catch{return!1}}var Mr=I(()=>{"use strict";Ve()});function q1(t,e){return e===""?[]:t.FS===" "?e.trim().split(/\s+/).filter(Boolean):t.fieldSep.split(e)}function Ci(t,e){return e===0?t.line:e<0||e>t.fields.length?"":t.fields[e-1]??""}function Ba(t,e,n){if(e===0)t.line=Le(n),t.fields=q1(t,t.line),t.NF=t.fields.length;else if(e>0){for(;t.fields.length<e;)t.fields.push("");t.fields[e-1]=Le(n),t.NF=t.fields.length,t.line=t.fields.join(t.OFS)}}function Lr(t,e){t.line=e,t.fields=q1(t,e),t.NF=t.fields.length}function Z1(t,e){if(t.FS=e,e===" ")t.fieldSep=new Rn(/\s+/);else try{t.fieldSep=ee(e)}catch{t.fieldSep=ee(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}var Ni=I(()=>{"use strict";Ve();Mr()});function vi(t,e){switch(e){case"FS":return t.FS;case"OFS":return t.OFS;case"ORS":return t.ORS;case"OFMT":return t.OFMT;case"NR":return t.NR;case"NF":return t.NF;case"FNR":return t.FNR;case"FILENAME":return t.FILENAME;case"RSTART":return t.RSTART;case"RLENGTH":return t.RLENGTH;case"SUBSEP":return t.SUBSEP;case"ARGC":return t.ARGC}return t.vars[e]??""}function Fr(t,e,n){switch(e){case"FS":Z1(t,Le(n));return;case"OFS":t.OFS=Le(n);return;case"ORS":t.ORS=Le(n);return;case"OFMT":t.OFMT=Le(n);return;case"NR":t.NR=Math.floor(Ke(n));return;case"NF":{let r=Math.floor(Ke(n));if(r<t.NF)t.fields=t.fields.slice(0,r),t.line=t.fields.join(t.OFS);else if(r>t.NF){for(;t.fields.length<r;)t.fields.push("");t.line=t.fields.join(t.OFS)}t.NF=r;return}case"FNR":t.FNR=Math.floor(Ke(n));return;case"FILENAME":t.FILENAME=Le(n);return;case"RSTART":t.RSTART=Math.floor(Ke(n));return;case"RLENGTH":t.RLENGTH=Math.floor(Ke(n));return;case"SUBSEP":t.SUBSEP=Le(n);return}t.vars[e]=n}function Ss(t,e){let n=e,r=new Set,s=t.arrayAliases.get(n);for(;s!==void 0&&!r.has(n);)r.add(n),n=s,s=t.arrayAliases.get(n);return n}function ki(t,e,n){if(e==="ARGV")return t.ARGV[n]??"";if(e==="ENVIRON")return t.ENVIRON[n]??"";let r=Ss(t,e);return t.arrays[r]?.[n]??""}function Wa(t,e,n,r){let s=Ss(t,e);t.arrays[s]||(t.arrays[s]=Object.create(null)),t.arrays[s][n]=r}function Y1(t,e,n){if(e==="ARGV")return t.ARGV[n]!==void 0;if(e==="ENVIRON")return t.ENVIRON[n]!==void 0;let r=Ss(t,e);return t.arrays[r]?.[n]!==void 0}function Q1(t,e,n){let r=Ss(t,e);t.arrays[r]&&delete t.arrays[r][n]}function K1(t,e){let n=Ss(t,e);delete t.arrays[n]}var za=I(()=>{"use strict";Ni();Mr()});function X1(t){Ha=t}async function ge(t,e){switch(t.coverage?.hit(`awk:expr:${e.type}`),e.type){case"number":return e.value;case"string":return e.value;case"regex":return As(e.pattern,t.line)?1:0;case"field":return c3(t,e);case"variable":return vi(t,e.name);case"array_access":return u3(t,e);case"binary":return f3(t,e);case"unary":return d3(t,e);case"ternary":return Pt(await ge(t,e.condition))?await ge(t,e.consequent):await ge(t,e.alternate);case"call":return m3(t,e.name,e.args);case"assignment":return y3(t,e);case"pre_increment":return w3(t,e.operand);case"pre_decrement":return b3(t,e.operand);case"post_increment":return x3(t,e.operand);case"post_decrement":return E3(t,e.operand);case"in":return A3(t,e.key,e.array);case"getline":return S3(t,e.variable,e.file,e.command);case"tuple":return v3(t,e.elements);default:return""}}async function c3(t,e){let n=Math.floor(Ke(await ge(t,e.index)));return Ci(t,n)}async function u3(t,e){let n=Le(await ge(t,e.key));return ki(t,e.array,n)}async function f3(t,e){let n=e.operator;if(n==="||")return Pt(await ge(t,e.left))||Pt(await ge(t,e.right))?1:0;if(n==="&&")return Pt(await ge(t,e.left))&&Pt(await ge(t,e.right))?1:0;if(n==="~"){let a=await ge(t,e.left);e.right.type==="regex"&&t.coverage?.hit("awk:expr:regex");let l=e.right.type==="regex"?e.right.pattern:Le(await ge(t,e.right));try{return ee(l).test(Le(a))?1:0}catch{return 0}}if(n==="!~"){let a=await ge(t,e.left);e.right.type==="regex"&&t.coverage?.hit("awk:expr:regex");let l=e.right.type==="regex"?e.right.pattern:Le(await ge(t,e.right));try{return ee(l).test(Le(a))?0:1}catch{return 1}}let r=await ge(t,e.left),s=await ge(t,e.right);if(n===" "){let a=Le(r)+Le(s);if(t.maxOutputSize>0&&a.length>t.maxOutputSize)throw new ae(`awk: string concatenation size limit exceeded (${t.maxOutputSize} bytes)`,"string_length",x(t.output));return a}if(p3(n))return h3(r,s,n);let i=Ke(r),o=Ke(s);return U1(i,o,n)}function p3(t){return["<","<=",">",">=","==","!="].includes(t)}function h3(t,e,n){let r=Ua(t),s=Ua(e);if(r&&s){let a=Ke(t),l=Ke(e);switch(n){case"<":return a<l?1:0;case"<=":return a<=l?1:0;case">":return a>l?1:0;case">=":return a>=l?1:0;case"==":return a===l?1:0;case"!=":return a!==l?1:0}}let i=Le(t),o=Le(e);switch(n){case"<":return i<o?1:0;case"<=":return i<=o?1:0;case">":return i>o?1:0;case">=":return i>=o?1:0;case"==":return i===o?1:0;case"!=":return i!==o?1:0}return 0}async function d3(t,e){let n=await ge(t,e.operand);switch(e.operator){case"!":return Pt(n)?0:1;case"-":return-Ke(n);case"+":return+Ke(n);default:return n}}async function m3(t,e,n){let r=V1.get(e);if(r)return r(n,t,{evalExpr:i=>ge(t,i)});let s=t.functions.get(e);return s?g3(t,s,n):""}async function g3(t,e,n){if(t.currentRecursionDepth++,t.currentRecursionDepth>t.maxRecursionDepth)throw t.currentRecursionDepth--,new ae(`awk: recursion depth exceeded maximum (${t.maxRecursionDepth})`,"recursion",x(t.output));let r=Object.create(null);for(let o of e.params)r[o]=t.vars[o];let s=[];for(let o=0;o<e.params.length;o++){let a=e.params[o];if(o<n.length){let l=n[o];l.type==="variable"&&(t.arrayAliases.set(a,l.name),s.push(a));let c=await ge(t,l);t.vars[a]=c}else t.vars[a]=""}t.hasReturn=!1,t.returnValue=void 0,Ha&&await Ha(t,e.body.statements);let i=t.returnValue??"";for(let o of e.params)r[o]!==void 0?t.vars[o]=r[o]:delete t.vars[o];for(let o of s)t.arrayAliases.delete(o);return t.hasReturn=!1,t.returnValue=void 0,t.currentRecursionDepth--,i}async function y3(t,e){let n=await ge(t,e.value),r=e.target,s=e.operator,i;if(s==="=")i=n;else{let o;if(r.type==="field"){let c=Math.floor(Ke(await ge(t,r.index)));o=Ci(t,c)}else if(r.type==="variable")o=vi(t,r.name);else{let c=Le(await ge(t,r.key));o=ki(t,r.array,c)}let a=Ke(o),l=Ke(n);switch(s){case"+=":i=a+l;break;case"-=":i=a-l;break;case"*=":i=a*l;break;case"/=":i=l!==0?a/l:0;break;case"%=":i=l!==0?a%l:0;break;case"^=":i=a**l;break;default:i=n}}if(r.type==="field"){let o=Math.floor(Ke(await ge(t,r.index)));Ba(t,o,i)}else if(r.type==="variable")Fr(t,r.name,i);else{let o=Le(await ge(t,r.key));Wa(t,r.array,o,i)}return i}async function Ii(t,e,n,r){let s;if(e.type==="field"){let i=Math.floor(Ke(await ge(t,e.index)));s=Ke(Ci(t,i)),Ba(t,i,s+n)}else if(e.type==="variable")s=Ke(vi(t,e.name)),Fr(t,e.name,s+n);else{let i=Le(await ge(t,e.key));s=Ke(ki(t,e.array,i)),Wa(t,e.array,i,s+n)}return r?s+n:s}async function w3(t,e){return Ii(t,e,1,!0)}async function b3(t,e){return Ii(t,e,-1,!0)}async function x3(t,e){return Ii(t,e,1,!1)}async function E3(t,e){return Ii(t,e,-1,!1)}async function A3(t,e,n){let r;if(e.type==="tuple"){t.coverage?.hit("awk:expr:tuple");let s=[];for(let i of e.elements)s.push(Le(await ge(t,i)));r=s.join(t.SUBSEP)}else r=Le(await ge(t,e));return Y1(t,n,r)?1:0}async function S3(t,e,n,r){if(r)return C3(t,e,r);if(n)return N3(t,e,n);if(!t.lines||t.lineIndex===void 0)return-1;let s=t.lineIndex+1;if(s>=t.lines.length)return 0;let i=t.lines[s];return e?Fr(t,e,i):Lr(t,i),t.NR++,t.lineIndex=s,1}async function C3(t,e,n){if(!t.exec)return-1;let r=Le(await ge(t,n)),s=`__cmd_${r}`,i=`__cmdi_${r}`,o,a;if(t.vars[s]===void 0)try{o=(await t.exec(r)).stdout.split(`
326
+ `),o.length>0&&o[o.length-1]===""&&o.pop(),t.vars[s]=JSON.stringify(o),t.vars[i]=-1,a=-1}catch{return-1}else o=JSON.parse(t.vars[s]),a=t.vars[i];let l=a+1;if(l>=o.length)return 0;let c=o[l];return t.vars[i]=l,e?Fr(t,e,c):Lr(t,c),1}async function N3(t,e,n){if(!t.fs||!t.cwd)return-1;let r=Le(await ge(t,n));if(r==="/dev/null")return 0;let s=t.fs.resolvePath(t.cwd,r),i=`__fc_${s}`,o=`__fi_${s}`,a,l;if(t.vars[i]===void 0)try{a=(await t.fs.readFile(s)).split(`
327
+ `),a.length>0&&a[a.length-1]===""&&a.pop(),t.vars[i]=JSON.stringify(a),t.vars[o]=-1,l=-1}catch{return-1}else a=JSON.parse(t.vars[i]),l=t.vars[o];let c=l+1;if(c>=a.length)return 0;let u=a[c];return t.vars[o]=c,e?Fr(t,e,u):Lr(t,u),1}async function v3(t,e){if(e.length===0)return"";for(let n=0;n<e.length-1;n++)await ge(t,e[n]);return ge(t,e[e.length-1])}var Ha,ja=I(()=>{"use strict";Ne();Ve();B1();F();Fa();Ni();Mr();za();Ha=null});function Ga(t){if(t.maxOutputSize>0&&t.output.length>t.maxOutputSize)throw new ae(`awk: output size limit exceeded (${t.maxOutputSize} bytes)`,"string_length",x(t.output))}async function Ur(t,e){for(let n of e)if(await cr(t,n),k3(t))break}function k3(t){return t.shouldExit||t.shouldNext||t.shouldNextFile||t.loopBreak||t.loopContinue||t.hasReturn}async function cr(t,e){switch(t.coverage?.hit(`awk:stmt:${e.type}`),e.type){case"block":await Ur(t,e.statements);break;case"expr_stmt":await ge(t,e.expression);break;case"print":await I3(t,e.args,e.output);break;case"printf":await T3(t,e.format,e.args,e.output);break;case"if":await O3(t,e);break;case"while":await R3(t,e);break;case"do_while":await P3(t,e);break;case"for":await $3(t,e);break;case"for_in":await D3(t,e);break;case"break":t.loopBreak=!0;break;case"continue":t.loopContinue=!0;break;case"next":t.shouldNext=!0;break;case"nextfile":t.shouldNextFile=!0;break;case"exit":t.shouldExit=!0,t.exitCode=e.code?Math.floor(Ke(await ge(t,e.code))):0;break;case"return":t.hasReturn=!0,t.returnValue=e.value?await ge(t,e.value):"";break;case"delete":await _3(t,e.target);break}}async function I3(t,e,n){let r=[];for(let i of e){let o=await ge(t,i);typeof o=="number"?Number.isInteger(o)&&Math.abs(o)<Number.MAX_SAFE_INTEGER?r.push(String(o)):r.push(Si(t.OFMT,[o])):r.push(Le(o))}let s=r.join(t.OFS)+t.ORS;n?await J1(t,n.redirect,n.file,s):(t.output+=s,Ga(t))}async function T3(t,e,n,r){let s=Le(await ge(t,e)),i=[];for(let a of n)i.push(await ge(t,a));let o=Si(s,i);r?await J1(t,r.redirect,r.file,o):(t.output+=o,Ga(t))}async function J1(t,e,n,r){if(!t.fs||!t.cwd){t.output+=r,Ga(t);return}let s=Le(await ge(t,n)),i=t.fs.resolvePath(t.cwd,s);e===">"?t.openedFiles.has(i)?await t.fs.appendFile(i,r):(await t.fs.writeFile(i,r),t.openedFiles.add(i)):(t.openedFiles.has(i)||t.openedFiles.add(i),await t.fs.appendFile(i,r))}async function O3(t,e){Pt(await ge(t,e.condition))?await cr(t,e.consequent):e.alternate&&await cr(t,e.alternate)}async function R3(t,e){let n=0;for(;Pt(await ge(t,e.condition));){if(n++,n>t.maxIterations)throw new ae(`awk: while loop exceeded maximum iterations (${t.maxIterations})`,"iterations",x(t.output));if(t.loopContinue=!1,await cr(t,e.body),t.loopBreak){t.loopBreak=!1;break}if(t.shouldExit||t.shouldNext||t.hasReturn)break}}async function P3(t,e){let n=0;do{if(n++,n>t.maxIterations)throw new ae(`awk: do-while loop exceeded maximum iterations (${t.maxIterations})`,"iterations",x(t.output));if(t.loopContinue=!1,await cr(t,e.body),t.loopBreak){t.loopBreak=!1;break}if(t.shouldExit||t.shouldNext||t.hasReturn)break}while(Pt(await ge(t,e.condition)))}async function $3(t,e){e.init&&await ge(t,e.init);let n=0;for(;!e.condition||Pt(await ge(t,e.condition));){if(n++,n>t.maxIterations)throw new ae(`awk: for loop exceeded maximum iterations (${t.maxIterations})`,"iterations",x(t.output));if(t.loopContinue=!1,await cr(t,e.body),t.loopBreak){t.loopBreak=!1;break}if(t.shouldExit||t.shouldNext||t.hasReturn)break;e.update&&await ge(t,e.update)}}async function D3(t,e){let n=t.arrays[e.array];if(n)for(let r of Object.keys(n)){if(t.vars[e.variable]=r,t.loopContinue=!1,await cr(t,e.body),t.loopBreak){t.loopBreak=!1;break}if(t.shouldExit||t.shouldNext||t.hasReturn)break}}async function _3(t,e){if(e.type==="array_access"){let n=Le(await ge(t,e.key));Q1(t,e.array,n)}else e.type==="variable"&&K1(t,e.name)}var ep=I(()=>{"use strict";Ne();F();Fa();ja();Mr();za();X1(Ur)});var Cs,tp=I(()=>{"use strict";ja();Ni();ep();Mr();Cs=class{ctx;program=null;rangeStates=[];constructor(e){this.ctx=e}execute(e){this.program=e,this.ctx.output="";for(let n of e.functions)this.ctx.functions.set(n.name,n);this.rangeStates=e.rules.map(()=>!1)}async executeBegin(){if(this.program){for(let e of this.program.rules)if(e.pattern?.type==="begin"&&(await Ur(this.ctx,e.action.statements),this.ctx.shouldExit))break}}async executeLine(e){if(!(!this.program||this.ctx.shouldExit)){Lr(this.ctx,e),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;for(let n=0;n<this.program.rules.length&&!(this.ctx.shouldExit||this.ctx.shouldNext||this.ctx.shouldNextFile);n++){let r=this.program.rules[n];r.pattern?.type==="begin"||r.pattern?.type==="end"||await this.matchesRule(r,n)&&await Ur(this.ctx,r.action.statements)}}}async executeEnd(){if(this.program&&!this.ctx.inEndBlock){this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;for(let e of this.program.rules)if(e.pattern?.type==="end"&&(await Ur(this.ctx,e.action.statements),this.ctx.shouldExit))break;this.ctx.inEndBlock=!1}}getOutput(){return this.ctx.output}getExitCode(){return this.ctx.exitCode}getContext(){return this.ctx}async matchesRule(e,n){let r=e.pattern;if(!r)return!0;switch(r.type){case"begin":case"end":return!1;case"regex_pattern":return As(r.pattern,this.ctx.line);case"expr_pattern":return Pt(await ge(this.ctx,r.expression));case"range":{let s=await this.matchPattern(r.start),i=await this.matchPattern(r.end);return this.rangeStates[n]?(i&&(this.rangeStates[n]=!1),!0):s?(this.rangeStates[n]=!0,i&&(this.rangeStates[n]=!1),!0):!1}default:return!1}}async matchPattern(e){switch(e.type){case"regex_pattern":return As(e.pattern,this.ctx.line);case"expr_pattern":return Pt(await ge(this.ctx,e.expression));default:return!1}}}});var np=I(()=>{"use strict";F1();tp()});function L3(t){return t.replace(/\[\[:space:\]\]/g,"[ \\t\\n\\r\\f\\v]").replace(/\[\[:blank:\]\]/g,"[ \\t]").replace(/\[\[:alpha:\]\]/g,"[a-zA-Z]").replace(/\[\[:digit:\]\]/g,"[0-9]").replace(/\[\[:alnum:\]\]/g,"[a-zA-Z0-9]").replace(/\[\[:upper:\]\]/g,"[A-Z]").replace(/\[\[:lower:\]\]/g,"[a-z]").replace(/\[\[:punct:\]\]/g,"[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~]").replace(/\[\[:xdigit:\]\]/g,"[0-9A-Fa-f]").replace(/\[\[:graph:\]\]/g,"[!-~]").replace(/\[\[:print:\]\]/g,"[ -~]").replace(/\[\[:cntrl:\]\]/g,"[\\x00-\\x1f\\x7f]")}var C,M3,Ti,rp=I(()=>{"use strict";(function(t){t.NUMBER="NUMBER",t.STRING="STRING",t.REGEX="REGEX",t.IDENT="IDENT",t.BEGIN="BEGIN",t.END="END",t.IF="IF",t.ELSE="ELSE",t.WHILE="WHILE",t.DO="DO",t.FOR="FOR",t.IN="IN",t.BREAK="BREAK",t.CONTINUE="CONTINUE",t.NEXT="NEXT",t.NEXTFILE="NEXTFILE",t.EXIT="EXIT",t.RETURN="RETURN",t.DELETE="DELETE",t.FUNCTION="FUNCTION",t.PRINT="PRINT",t.PRINTF="PRINTF",t.GETLINE="GETLINE",t.PLUS="PLUS",t.MINUS="MINUS",t.STAR="STAR",t.SLASH="SLASH",t.PERCENT="PERCENT",t.CARET="CARET",t.EQ="EQ",t.NE="NE",t.LT="LT",t.GT="GT",t.LE="LE",t.GE="GE",t.MATCH="MATCH",t.NOT_MATCH="NOT_MATCH",t.AND="AND",t.OR="OR",t.NOT="NOT",t.ASSIGN="ASSIGN",t.PLUS_ASSIGN="PLUS_ASSIGN",t.MINUS_ASSIGN="MINUS_ASSIGN",t.STAR_ASSIGN="STAR_ASSIGN",t.SLASH_ASSIGN="SLASH_ASSIGN",t.PERCENT_ASSIGN="PERCENT_ASSIGN",t.CARET_ASSIGN="CARET_ASSIGN",t.INCREMENT="INCREMENT",t.DECREMENT="DECREMENT",t.QUESTION="QUESTION",t.COLON="COLON",t.COMMA="COMMA",t.SEMICOLON="SEMICOLON",t.NEWLINE="NEWLINE",t.LPAREN="LPAREN",t.RPAREN="RPAREN",t.LBRACE="LBRACE",t.RBRACE="RBRACE",t.LBRACKET="LBRACKET",t.RBRACKET="RBRACKET",t.DOLLAR="DOLLAR",t.APPEND="APPEND",t.PIPE="PIPE",t.EOF="EOF"})(C||(C={}));M3=new Map([["BEGIN",C.BEGIN],["END",C.END],["if",C.IF],["else",C.ELSE],["while",C.WHILE],["do",C.DO],["for",C.FOR],["in",C.IN],["break",C.BREAK],["continue",C.CONTINUE],["next",C.NEXT],["nextfile",C.NEXTFILE],["exit",C.EXIT],["return",C.RETURN],["delete",C.DELETE],["function",C.FUNCTION],["print",C.PRINT],["printf",C.PRINTF],["getline",C.GETLINE]]);Ti=class{input;pos=0;line=1;column=1;lastTokenType=null;constructor(e){this.input=e}tokenize(){let e=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&(e.push(n),this.lastTokenType=n.type)}return e.push(this.makeToken(C.EOF,"")),e}makeToken(e,n){return{type:e,value:n,line:this.line,column:this.column}}peek(e=0){return this.input[this.pos+e]||""}advance(){let e=this.input[this.pos++]||"";return e===`
328
+ `?(this.line++,this.column=1):this.column++,e}skipWhitespace(){for(;this.pos<this.input.length;){let e=this.peek();if(e===" "||e===" "||e==="\r")this.advance();else if(e==="\\")if(this.peek(1)===`
329
+ `)this.advance(),this.advance();else break;else if(e==="#")for(;this.pos<this.input.length&&this.peek()!==`
330
+ `;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let e=this.line,n=this.column,r=this.peek();return r===`
331
+ `?(this.advance(),{type:C.NEWLINE,value:`
332
+ `,line:e,column:n}):r==='"'?this.readString():r==="/"&&this.canBeRegex()?this.readRegex():this.isDigit(r)||r==="."&&this.isDigit(this.peek(1))?this.readNumber():this.isAlpha(r)||r==="_"?this.readIdentifier():this.readOperator()}canBeRegex(){return new Set([null,C.NEWLINE,C.SEMICOLON,C.LBRACE,C.RBRACE,C.LPAREN,C.LBRACKET,C.COMMA,C.ASSIGN,C.PLUS_ASSIGN,C.MINUS_ASSIGN,C.STAR_ASSIGN,C.SLASH_ASSIGN,C.PERCENT_ASSIGN,C.CARET_ASSIGN,C.AND,C.OR,C.NOT,C.MATCH,C.NOT_MATCH,C.QUESTION,C.COLON,C.LT,C.GT,C.LE,C.GE,C.EQ,C.NE,C.PLUS,C.MINUS,C.STAR,C.PERCENT,C.CARET,C.PRINT,C.PRINTF,C.IF,C.WHILE,C.DO,C.FOR,C.RETURN]).has(this.lastTokenType)}readString(){let e=this.line,n=this.column;this.advance();let r="";for(;this.pos<this.input.length&&this.peek()!=='"';)if(this.peek()==="\\"){this.advance();let s=this.advance();switch(s){case"n":r+=`
333
+ `;break;case"t":r+=" ";break;case"r":r+="\r";break;case"f":r+="\f";break;case"b":r+="\b";break;case"v":r+="\v";break;case"a":r+="\x07";break;case"\\":r+="\\";break;case'"':r+='"';break;case"/":r+="/";break;case"x":{let i="";for(;i.length<2&&/[0-9a-fA-F]/.test(this.peek());)i+=this.advance();i.length>0?r+=String.fromCharCode(parseInt(i,16)):r+="x";break}default:if(/[0-7]/.test(s)){let i=s;for(;i.length<3&&/[0-7]/.test(this.peek());)i+=this.advance();r+=String.fromCharCode(parseInt(i,8))}else r+=s}}else r+=this.advance();return this.peek()==='"'&&this.advance(),{type:C.STRING,value:r,line:e,column:n}}readRegex(){let e=this.line,n=this.column;this.advance();let r="";for(;this.pos<this.input.length&&this.peek()!=="/";)if(this.peek()==="\\")r+=this.advance(),this.pos<this.input.length&&(r+=this.advance());else{if(this.peek()===`
334
+ `)break;r+=this.advance()}return this.peek()==="/"&&this.advance(),r=L3(r),{type:C.REGEX,value:r,line:e,column:n}}readNumber(){let e=this.line,n=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="."&&this.isDigit(this.peek(1)))for(r+=this.advance();this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(r+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(r+=this.advance());this.isDigit(this.peek());)r+=this.advance();return{type:C.NUMBER,value:parseFloat(r),line:e,column:n}}readIdentifier(){let e=this.line,n=this.column,r="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)r+=this.advance();let s=M3.get(r);return s!==void 0?{type:s,value:r,line:e,column:n}:{type:C.IDENT,value:r,line:e,column:n}}readOperator(){let e=this.line,n=this.column,r=this.advance(),s=this.peek();switch(r){case"+":return s==="+"?(this.advance(),{type:C.INCREMENT,value:"++",line:e,column:n}):s==="="?(this.advance(),{type:C.PLUS_ASSIGN,value:"+=",line:e,column:n}):{type:C.PLUS,value:"+",line:e,column:n};case"-":return s==="-"?(this.advance(),{type:C.DECREMENT,value:"--",line:e,column:n}):s==="="?(this.advance(),{type:C.MINUS_ASSIGN,value:"-=",line:e,column:n}):{type:C.MINUS,value:"-",line:e,column:n};case"*":return s==="*"?(this.advance(),{type:C.CARET,value:"**",line:e,column:n}):s==="="?(this.advance(),{type:C.STAR_ASSIGN,value:"*=",line:e,column:n}):{type:C.STAR,value:"*",line:e,column:n};case"/":return s==="="?(this.advance(),{type:C.SLASH_ASSIGN,value:"/=",line:e,column:n}):{type:C.SLASH,value:"/",line:e,column:n};case"%":return s==="="?(this.advance(),{type:C.PERCENT_ASSIGN,value:"%=",line:e,column:n}):{type:C.PERCENT,value:"%",line:e,column:n};case"^":return s==="="?(this.advance(),{type:C.CARET_ASSIGN,value:"^=",line:e,column:n}):{type:C.CARET,value:"^",line:e,column:n};case"=":return s==="="?(this.advance(),{type:C.EQ,value:"==",line:e,column:n}):{type:C.ASSIGN,value:"=",line:e,column:n};case"!":return s==="="?(this.advance(),{type:C.NE,value:"!=",line:e,column:n}):s==="~"?(this.advance(),{type:C.NOT_MATCH,value:"!~",line:e,column:n}):{type:C.NOT,value:"!",line:e,column:n};case"<":return s==="="?(this.advance(),{type:C.LE,value:"<=",line:e,column:n}):{type:C.LT,value:"<",line:e,column:n};case">":return s==="="?(this.advance(),{type:C.GE,value:">=",line:e,column:n}):s===">"?(this.advance(),{type:C.APPEND,value:">>",line:e,column:n}):{type:C.GT,value:">",line:e,column:n};case"&":return s==="&"?(this.advance(),{type:C.AND,value:"&&",line:e,column:n}):{type:C.IDENT,value:"&",line:e,column:n};case"|":return s==="|"?(this.advance(),{type:C.OR,value:"||",line:e,column:n}):{type:C.PIPE,value:"|",line:e,column:n};case"~":return{type:C.MATCH,value:"~",line:e,column:n};case"?":return{type:C.QUESTION,value:"?",line:e,column:n};case":":return{type:C.COLON,value:":",line:e,column:n};case",":return{type:C.COMMA,value:",",line:e,column:n};case";":return{type:C.SEMICOLON,value:";",line:e,column:n};case"(":return{type:C.LPAREN,value:"(",line:e,column:n};case")":return{type:C.RPAREN,value:")",line:e,column:n};case"{":return{type:C.LBRACE,value:"{",line:e,column:n};case"}":return{type:C.RBRACE,value:"}",line:e,column:n};case"[":return{type:C.LBRACKET,value:"[",line:e,column:n};case"]":return{type:C.RBRACKET,value:"]",line:e,column:n};case"$":return{type:C.DOLLAR,value:"$",line:e,column:n};default:return{type:C.IDENT,value:r,line:e,column:n}}}isDigit(e){return e>="0"&&e<="9"}isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}isAlphaNumeric(e){return this.isDigit(e)||this.isAlpha(e)}}});function lp(t){t.expect(re.PRINT);let e=[];if(t.check(re.NEWLINE)||t.check(re.SEMICOLON)||t.check(re.RBRACE)||t.check(re.PIPE)||t.check(re.GT)||t.check(re.APPEND))e.push({type:"field",index:{type:"number",value:0}});else for(e.push(Oi(t));t.check(re.COMMA);)t.advance(),e.push(Oi(t));let n;return t.check(re.GT)?(t.advance(),n={redirect:">",file:t.parsePrimary()}):t.check(re.APPEND)&&(t.advance(),n={redirect:">>",file:t.parsePrimary()}),{type:"print",args:e,output:n}}function Oi(t){return F3(t)?Va(t,!0):Va(t,!1)}function Va(t,e){let n=e?t.parseTernary():U3(t);if(t.match(re.ASSIGN,re.PLUS_ASSIGN,re.MINUS_ASSIGN,re.STAR_ASSIGN,re.SLASH_ASSIGN,re.PERCENT_ASSIGN,re.CARET_ASSIGN)){let r=t.advance(),s=Va(t,e);if(n.type!=="variable"&&n.type!=="field"&&n.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(r.value)??"=",target:n,value:s}}return n}function F3(t){let e=0,n=t.pos;for(;n<t.tokens.length;){let r=t.tokens[n];if(r.type===re.LPAREN&&e++,r.type===re.RPAREN&&e--,r.type===re.QUESTION&&e===0)return!0;if(r.type===re.NEWLINE||r.type===re.SEMICOLON||r.type===re.RBRACE||r.type===re.COMMA||r.type===re.PIPE)return!1;n++}return!1}function U3(t){let e=sp(t);for(;t.check(re.OR);){t.advance();let n=sp(t);e={type:"binary",operator:"||",left:e,right:n}}return e}function sp(t){let e=ip(t);for(;t.check(re.AND);){t.advance();let n=ip(t);e={type:"binary",operator:"&&",left:e,right:n}}return e}function ip(t){let e=B3(t);if(t.check(re.IN)){t.advance();let n=String(t.expect(re.IDENT).value);return{type:"in",key:e,array:n}}return e}function B3(t){let e=op(t);for(;W3(t)&&!z3(t);){let n=op(t);e={type:"binary",operator:" ",left:e,right:n}}return e}function op(t){let e=ap(t);for(;t.match(re.MATCH,re.NOT_MATCH);){let n=t.advance().type===re.MATCH?"~":"!~",r=ap(t);e={type:"binary",operator:n,left:e,right:r}}return e}function ap(t){let e=t.parseAddSub();for(;t.match(re.LT,re.LE,re.GE,re.EQ,re.NE);){let n=t.advance(),r=t.parseAddSub();e={type:"binary",operator:new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:e,right:r}}return e}function W3(t){return t.match(re.NUMBER,re.STRING,re.IDENT,re.DOLLAR,re.LPAREN,re.NOT,re.MINUS,re.PLUS,re.INCREMENT,re.DECREMENT)}function z3(t){return t.match(re.AND,re.OR,re.QUESTION,re.ASSIGN,re.PLUS_ASSIGN,re.MINUS_ASSIGN,re.STAR_ASSIGN,re.SLASH_ASSIGN,re.PERCENT_ASSIGN,re.CARET_ASSIGN,re.COMMA,re.SEMICOLON,re.NEWLINE,re.RBRACE,re.RPAREN,re.RBRACKET,re.COLON,re.PIPE,re.APPEND,re.GT,re.IN)}function cp(t){t.expect(re.PRINTF);let e=t.check(re.LPAREN);e&&(t.advance(),t.skipNewlines());let n=e?t.parseExpression():Oi(t),r=[];for(;t.check(re.COMMA);)t.advance(),e&&t.skipNewlines(),r.push(e?t.parseExpression():Oi(t));e&&(t.skipNewlines(),t.expect(re.RPAREN));let s;return t.check(re.GT)?(t.advance(),s={redirect:">",file:t.parsePrimary()}):t.check(re.APPEND)&&(t.advance(),s={redirect:">>",file:t.parsePrimary()}),{type:"printf",format:n,args:r,output:s}}var re,up=I(()=>{"use strict";re={LPAREN:"LPAREN",RPAREN:"RPAREN",QUESTION:"QUESTION",NEWLINE:"NEWLINE",SEMICOLON:"SEMICOLON",RBRACE:"RBRACE",COMMA:"COMMA",PIPE:"PIPE",GT:"GT",APPEND:"APPEND",AND:"AND",OR:"OR",ASSIGN:"ASSIGN",PLUS_ASSIGN:"PLUS_ASSIGN",MINUS_ASSIGN:"MINUS_ASSIGN",STAR_ASSIGN:"STAR_ASSIGN",SLASH_ASSIGN:"SLASH_ASSIGN",PERCENT_ASSIGN:"PERCENT_ASSIGN",CARET_ASSIGN:"CARET_ASSIGN",RBRACKET:"RBRACKET",COLON:"COLON",IN:"IN",PRINT:"PRINT",PRINTF:"PRINTF",IDENT:"IDENT",LT:"LT",LE:"LE",GE:"GE",EQ:"EQ",NE:"NE",MATCH:"MATCH",NOT_MATCH:"NOT_MATCH",NUMBER:"NUMBER",STRING:"STRING",DOLLAR:"DOLLAR",NOT:"NOT",MINUS:"MINUS",PLUS:"PLUS",INCREMENT:"INCREMENT",DECREMENT:"DECREMENT"}});var Ri,fp=I(()=>{"use strict";rp();up();Ri=class{tokens=[];pos=0;parse(e){let n=new Ti(e);return this.tokens=n.tokenize(),this.pos=0,this.parseProgram()}setPos(e){this.pos=e}current(){return this.tokens[this.pos]||{type:C.EOF,value:"",line:0,column:0}}advance(){let e=this.current();return this.pos<this.tokens.length&&this.pos++,e}match(...e){return e.includes(this.current().type)}check(e){return this.current().type===e}expect(e,n){if(!this.check(e)){let r=this.current();throw new Error(n||`Expected ${e}, got ${r.type} at line ${r.line}:${r.column}`)}return this.advance()}skipNewlines(){for(;this.check(C.NEWLINE);)this.advance()}skipTerminators(){for(;this.check(C.NEWLINE)||this.check(C.SEMICOLON);)this.advance()}parseProgram(){let e=[],n=[];for(this.skipNewlines();!this.check(C.EOF)&&(this.skipNewlines(),!this.check(C.EOF));)this.check(C.FUNCTION)?e.push(this.parseFunction()):n.push(this.parseRule()),this.skipTerminators();return{functions:e,rules:n}}parseFunction(){this.expect(C.FUNCTION);let e=this.expect(C.IDENT).value;this.expect(C.LPAREN);let n=[];if(!this.check(C.RPAREN))for(n.push(this.expect(C.IDENT).value);this.check(C.COMMA);)this.advance(),n.push(this.expect(C.IDENT).value);this.expect(C.RPAREN),this.skipNewlines();let r=this.parseBlock();return{name:e,params:n,body:r}}parseRule(){let e;if(this.check(C.BEGIN))this.advance(),e={type:"begin"};else if(this.check(C.END))this.advance(),e={type:"end"};else if(this.check(C.LBRACE))e=void 0;else if(this.check(C.REGEX)){let r=this.advance();if(this.check(C.AND)||this.check(C.OR)){let s={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:r.value}};e={type:"expr_pattern",expression:this.parseLogicalOrRest(s)}}else{let s={type:"regex_pattern",pattern:r.value};if(this.check(C.COMMA)){this.advance();let i;this.check(C.REGEX)?i={type:"regex_pattern",pattern:this.advance().value}:i={type:"expr_pattern",expression:this.parseExpression()},e={type:"range",start:s,end:i}}else e=s}}else{let s={type:"expr_pattern",expression:this.parseExpression()};if(this.check(C.COMMA)){this.advance();let i;this.check(C.REGEX)?i={type:"regex_pattern",pattern:this.advance().value}:i={type:"expr_pattern",expression:this.parseExpression()},e={type:"range",start:s,end:i}}else e=s}this.skipNewlines();let n;return this.check(C.LBRACE)?n=this.parseBlock():n={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:e,action:n}}parseBlock(){this.expect(C.LBRACE),this.skipNewlines();let e=[];for(;!this.check(C.RBRACE)&&!this.check(C.EOF);)e.push(this.parseStatement()),this.skipTerminators();return this.expect(C.RBRACE),{type:"block",statements:e}}parseStatement(){if(this.check(C.SEMICOLON)||this.check(C.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(C.LBRACE))return this.parseBlock();if(this.check(C.IF))return this.parseIf();if(this.check(C.WHILE))return this.parseWhile();if(this.check(C.DO))return this.parseDoWhile();if(this.check(C.FOR))return this.parseFor();if(this.check(C.BREAK))return this.advance(),{type:"break"};if(this.check(C.CONTINUE))return this.advance(),{type:"continue"};if(this.check(C.NEXT))return this.advance(),{type:"next"};if(this.check(C.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(C.EXIT)){this.advance();let n;return!this.check(C.NEWLINE)&&!this.check(C.SEMICOLON)&&!this.check(C.RBRACE)&&!this.check(C.EOF)&&(n=this.parseExpression()),{type:"exit",code:n}}if(this.check(C.RETURN)){this.advance();let n;return!this.check(C.NEWLINE)&&!this.check(C.SEMICOLON)&&!this.check(C.RBRACE)&&!this.check(C.EOF)&&(n=this.parseExpression()),{type:"return",value:n}}if(this.check(C.DELETE)){this.advance();let n=this.parsePrimary();if(n.type!=="array_access"&&n.type!=="variable")throw new Error("delete requires array element or array");return{type:"delete",target:n}}return this.check(C.PRINT)?lp(this):this.check(C.PRINTF)?cp(this):{type:"expr_stmt",expression:this.parseExpression()}}parseIf(){this.expect(C.IF),this.expect(C.LPAREN);let e=this.parseExpression();this.expect(C.RPAREN),this.skipNewlines();let n=this.parseStatement();this.skipTerminators();let r;return this.check(C.ELSE)&&(this.advance(),this.skipNewlines(),r=this.parseStatement()),{type:"if",condition:e,consequent:n,alternate:r}}parseWhile(){this.expect(C.WHILE),this.expect(C.LPAREN);let e=this.parseExpression();this.expect(C.RPAREN),this.skipNewlines();let n=this.parseStatement();return{type:"while",condition:e,body:n}}parseDoWhile(){this.expect(C.DO),this.skipNewlines();let e=this.parseStatement();this.skipNewlines(),this.expect(C.WHILE),this.expect(C.LPAREN);let n=this.parseExpression();return this.expect(C.RPAREN),{type:"do_while",body:e,condition:n}}parseFor(){if(this.expect(C.FOR),this.expect(C.LPAREN),this.check(C.IDENT)){let i=this.advance();if(this.check(C.IN)){this.advance();let o=this.expect(C.IDENT).value;this.expect(C.RPAREN),this.skipNewlines();let a=this.parseStatement();return{type:"for_in",variable:i.value,array:o,body:a}}this.pos--}let e;this.check(C.SEMICOLON)||(e=this.parseExpression()),this.expect(C.SEMICOLON);let n;this.check(C.SEMICOLON)||(n=this.parseExpression()),this.expect(C.SEMICOLON);let r;this.check(C.RPAREN)||(r=this.parseExpression()),this.expect(C.RPAREN),this.skipNewlines();let s=this.parseStatement();return{type:"for",init:e,condition:n,update:r,body:s}}parseExpression(){return this.parseAssignment()}parseAssignment(){let e=this.parseTernary();if(this.match(C.ASSIGN,C.PLUS_ASSIGN,C.MINUS_ASSIGN,C.STAR_ASSIGN,C.SLASH_ASSIGN,C.PERCENT_ASSIGN,C.CARET_ASSIGN)){let n=this.advance(),r=this.parseAssignment();if(e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:{"=":"=","+=":"+=","-=":"-=","*=":"*=","/=":"/=","%=":"%=","^=":"^="}[n.value],target:e,value:r}}return e}parseTernary(){let e=this.parsePipeGetline();if(this.check(C.QUESTION)){this.advance();let n=this.parseExpression();this.expect(C.COLON);let r=this.parseExpression();e={type:"ternary",condition:e,consequent:n,alternate:r}}return e}parsePipeGetline(){let e=this.parseOr();if(this.check(C.PIPE)){if(this.advance(),!this.check(C.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();let n;return this.check(C.IDENT)&&(n=this.advance().value),{type:"getline",command:e,variable:n}}return e}parseOr(){let e=this.parseAnd();for(;this.check(C.OR);){this.advance();let n=this.parseAnd();e={type:"binary",operator:"||",left:e,right:n}}return e}parseLogicalOrRest(e){for(e=this.parseLogicalAndRest(e);this.check(C.OR);){this.advance();let n=this.parseAnd();e={type:"binary",operator:"||",left:e,right:n}}return e}parseLogicalAndRest(e){for(;this.check(C.AND);){this.advance();let n=this.parseIn();e={type:"binary",operator:"&&",left:e,right:n}}return e}parseAnd(){let e=this.parseIn();for(;this.check(C.AND);){this.advance();let n=this.parseIn();e={type:"binary",operator:"&&",left:e,right:n}}return e}parseIn(){let e=this.parseConcatenation();if(this.check(C.IN)){this.advance();let n=this.expect(C.IDENT).value;return{type:"in",key:e,array:n}}return e}parseConcatenation(){let e=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){let n=this.parseMatch();e={type:"binary",operator:" ",left:e,right:n}}return e}parseMatch(){let e=this.parseComparison();for(;this.match(C.MATCH,C.NOT_MATCH);){let n=this.advance().type===C.MATCH?"~":"!~",r=this.parseComparison();e={type:"binary",operator:n,left:e,right:r}}return e}parseComparison(){let e=this.parseAddSub();for(;this.match(C.LT,C.LE,C.GT,C.GE,C.EQ,C.NE);){let n=this.advance(),r=this.parseAddSub();e={type:"binary",operator:new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:e,right:r}}return e}canStartExpression(){return this.match(C.NUMBER,C.STRING,C.IDENT,C.DOLLAR,C.LPAREN,C.NOT,C.MINUS,C.PLUS,C.INCREMENT,C.DECREMENT)}isConcatTerminator(){return this.match(C.AND,C.OR,C.QUESTION,C.ASSIGN,C.PLUS_ASSIGN,C.MINUS_ASSIGN,C.STAR_ASSIGN,C.SLASH_ASSIGN,C.PERCENT_ASSIGN,C.CARET_ASSIGN,C.COMMA,C.SEMICOLON,C.NEWLINE,C.RBRACE,C.RPAREN,C.RBRACKET,C.COLON,C.PIPE,C.APPEND,C.IN)}parseAddSub(){let e=this.parseMulDiv();for(;this.match(C.PLUS,C.MINUS);){let n=this.advance().value,r=this.parseMulDiv();e={type:"binary",operator:n,left:e,right:r}}return e}parseMulDiv(){let e=this.parseUnary();for(;this.match(C.STAR,C.SLASH,C.PERCENT);){let n=this.advance(),r=this.parseUnary();e={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(n.value)??"*",left:e,right:r}}return e}parseUnary(){if(this.check(C.INCREMENT)){this.advance();let e=this.parseUnary();return e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:e}}:{type:"pre_increment",operand:e}}if(this.check(C.DECREMENT)){this.advance();let e=this.parseUnary();return e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:e}}:{type:"pre_decrement",operand:e}}if(this.match(C.NOT,C.MINUS,C.PLUS)){let e=this.advance().value,n=this.parseUnary();return{type:"unary",operator:e,operand:n}}return this.parsePower()}parsePower(){let e=this.parsePostfix();if(this.check(C.CARET)){this.advance();let n=this.parsePower();e={type:"binary",operator:"^",left:e,right:n}}return e}parsePostfix(){let e=this.parsePrimary();if(this.check(C.INCREMENT)){if(this.advance(),e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:e}}if(this.check(C.DECREMENT)){if(this.advance(),e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:e}}return e}parseFieldIndex(){if(this.check(C.INCREMENT)){this.advance();let e=this.parseFieldIndex();return e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:e}}:{type:"pre_increment",operand:e}}if(this.check(C.DECREMENT)){this.advance();let e=this.parseFieldIndex();return e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:e}}:{type:"pre_decrement",operand:e}}if(this.match(C.NOT,C.MINUS,C.PLUS)){let e=this.advance().value,n=this.parseFieldIndex();return{type:"unary",operator:e,operand:n}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let e=this.parseFieldIndexPrimary();if(this.check(C.CARET)){this.advance();let n=this.parseFieldIndexPower();e={type:"binary",operator:"^",left:e,right:n}}return e}parseFieldIndexPrimary(){if(this.check(C.NUMBER))return{type:"number",value:this.advance().value};if(this.check(C.STRING))return{type:"string",value:this.advance().value};if(this.check(C.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(C.LPAREN)){this.advance();let e=this.parseExpression();return this.expect(C.RPAREN),e}if(this.check(C.IDENT)){let e=this.advance().value;if(this.check(C.LPAREN)){this.advance();let n=[];if(!this.check(C.RPAREN))for(n.push(this.parseExpression());this.check(C.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(C.RPAREN),{type:"call",name:e,args:n}}if(this.check(C.LBRACKET)){this.advance();let n=this.parseExpression();if(this.check(C.COMMA)){let r=[n];for(;this.check(C.COMMA);)this.advance(),r.push(this.parseExpression());this.expect(C.RBRACKET);let s=r.reduce((i,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:i,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:e,key:s}}return this.expect(C.RBRACKET),{type:"array_access",array:e,key:n}}return{type:"variable",name:e}}throw new Error(`Unexpected token in field index: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}parsePrimary(){if(this.check(C.NUMBER))return{type:"number",value:this.advance().value};if(this.check(C.STRING))return{type:"string",value:this.advance().value};if(this.check(C.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(C.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(C.LPAREN)){this.advance();let e=this.parseExpression();if(this.check(C.COMMA)){let n=[e];for(;this.check(C.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(C.RPAREN),{type:"tuple",elements:n}}return this.expect(C.RPAREN),e}if(this.check(C.GETLINE)){this.advance();let e,n;return this.check(C.IDENT)&&(e=this.advance().value),this.check(C.LT)&&(this.advance(),n=this.parsePrimary()),{type:"getline",variable:e,file:n}}if(this.check(C.IDENT)){let e=this.advance().value;if(this.check(C.LPAREN)){this.advance();let n=[];if(this.skipNewlines(),!this.check(C.RPAREN))for(n.push(this.parseExpression());this.check(C.COMMA);)this.advance(),this.skipNewlines(),n.push(this.parseExpression());return this.skipNewlines(),this.expect(C.RPAREN),{type:"call",name:e,args:n}}if(this.check(C.LBRACKET)){this.advance();let n=[this.parseExpression()];for(;this.check(C.COMMA);)this.advance(),n.push(this.parseExpression());this.expect(C.RBRACKET);let r;if(n.length===1)r=n[0];else{r=n[0];for(let s=1;s<n.length;s++)r={type:"binary",operator:" ",left:{type:"binary",operator:" ",left:r,right:{type:"variable",name:"SUBSEP"}},right:n[s]}}return{type:"array_access",array:e,key:r}}return{type:"variable",name:e}}throw new Error(`Unexpected token: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}}});var dp={};se(dp,{awkCommand2:()=>j3,flagsForFuzzing:()=>G3});function qa(t){return t.replace(/\\t/g," ").replace(/\\n/g,`
335
+ `).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function pp(t){if(t===" ")return ee("\\s+");if(/[[\](){}.*+?^$|\\]/.test(t))try{return ee(t)}catch{return ee(hp(t))}return ee(hp(t))}function hp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var H3,j3,G3,mp=I(()=>{"use strict";Wn();Ne();Ve();F();he();np();fp();H3={name:"awk",summary:"pattern scanning and text processing language",usage:"awk [OPTIONS] 'PROGRAM' [FILE...]",options:["-F FS use FS as field separator","-v VAR=VAL assign VAL to variable VAR"," --help display this help and exit"]},j3={name:"awk",async execute(t,e){let n=W(t);if(Z(n))return q(H3);let r=new Rn(/\s+/),s=" ",i=Object.create(null),o=0;for(let g=0;g<n.length;g++){let w=n[g];if(w==="-F"&&g+1<n.length)s=qa(n[++g]),r=pp(s),o=g+1;else if(w.startsWith("-F"))s=qa(w.slice(2)),r=pp(s),o=g+1;else if(w==="-v"&&g+1<n.length){let E=n[++g],b=E.indexOf("=");if(b>0){let A=E.slice(0,b),N=qa(E.slice(b+1));i[A]=N}o=g+1}else{if(w.startsWith("--"))return oe("awk",w);if(w.startsWith("-")&&w.length>1){let E=w[1];if(E!=="F"&&E!=="v")return oe("awk",`-${E}`);o=g+1}else if(!w.startsWith("-")){o=g;break}}}if(o>=n.length)return{stdout:y,stderr:x(`awk: missing program
336
+ `),exitCode:1};let a=n[o],l=n.slice(o+1),c=new Ri,u;try{u=c.parse(a)}catch(g){let w=g instanceof Error?g.message:String(g);return{stdout:y,stderr:x(`awk: ${w}
337
+ `),exitCode:1}}let f={readFile:e.fs.readFile.bind(e.fs),writeFile:e.fs.writeFile.bind(e.fs),appendFile:async(g,w)=>{try{let E=await e.fs.readFile(g);await e.fs.writeFile(g,E+w)}catch{await e.fs.writeFile(g,w)}},resolvePath:e.fs.resolvePath.bind(e.fs)},p=Ma({fieldSep:r,maxIterations:e.limits?.maxAwkIterations,maxOutputSize:e.limits?.maxStringLength,fs:f,cwd:e.cwd,exec:e.exec?async g=>{let w=await e.exec(g,{cwd:e.cwd});return{stdout:R(w.stdout),stderr:R(w.stderr),exitCode:w.exitCode}}:void 0,coverage:e.coverage});p.FS=s,p.vars=Object.assign(Object.create(null),i),p.ARGC=l.length+1,p.ARGV=Object.create(null),p.ARGV[0]="awk";for(let g=0;g<l.length;g++)p.ARGV[String(g+1)]=l[g];p.ENVIRON=Rt(e.env);let h=new Cs(p);h.execute(u);let m=u.rules.some(g=>g.pattern?.type!=="begin"&&g.pattern?.type!=="end"),d=u.rules.some(g=>g.pattern?.type==="end");try{if(await h.executeBegin(),p.shouldExit)return await h.executeEnd(),{stdout:x(h.getOutput()),stderr:y,exitCode:h.getExitCode()};if(!m&&!d)return{stdout:x(h.getOutput()),stderr:y,exitCode:h.getExitCode()};let g=[];if(l.length>0)for(let w of l)try{let E=e.fs.resolvePath(e.cwd,w),A=(await e.fs.readFile(E)).split(`
338
+ `);A.length>0&&A[A.length-1]===""&&A.pop(),g.push({filename:w,lines:A})}catch{return{stdout:y,stderr:x(`awk: ${w}: No such file or directory
339
+ `),exitCode:1}}else{let w=R(e.stdin).split(`
340
+ `);w.length>0&&w[w.length-1]===""&&w.pop(),g.push({filename:"",lines:w})}for(let w of g){for(p.FILENAME=w.filename,p.FNR=0,p.lines=w.lines,p.lineIndex=-1,p.shouldNextFile=!1;p.lineIndex<w.lines.length-1&&(p.lineIndex++,await h.executeLine(w.lines[p.lineIndex]),!(p.shouldExit||p.shouldNextFile)););if(p.shouldExit)break}return await h.executeEnd(),{stdout:x(h.getOutput()),stderr:y,exitCode:h.getExitCode()}}catch(g){let w=g instanceof Error?g.message:String(g),E=g instanceof ae?ae.EXIT_CODE:2;return{stdout:x(h.getOutput()),stderr:x(`awk: ${w}
341
+ `),exitCode:E}}}};G3={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0}});function gp(t){let e=t.trim(),n=e.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!n){let o=parseFloat(e);return Number.isNaN(o)?0:o}let r=parseFloat(n[1]),s=(n[2]||"").toLowerCase(),i=V3.get(s)??1;return r*i}function yp(t){let e=t.trim().toLowerCase().slice(0,3);return q3.get(e)??0}function Z3(t,e){let n=t.split(/(\d+)/),r=e.split(/(\d+)/),s=Math.max(n.length,r.length);for(let i=0;i<s;i++){let o=n[i]||"",a=r[i]||"",l=/^\d+$/.test(o)?parseInt(o,10):null,c=/^\d+$/.test(a)?parseInt(a,10):null;if(l!==null&&c!==null){if(l!==c)return l-c}else if(o!==a)return o.localeCompare(a)}return 0}function wp(t){return t.replace(/[^a-zA-Z0-9\s]/g,"")}function Za(t,e,n){let r=n!==null?n:/\s+/,s=t.split(r),i=e.startField-1;if(i>=s.length)return"";if(e.endField===void 0){let l=s[i]||"";return e.startChar!==void 0&&(l=l.slice(e.startChar-1)),e.ignoreLeading&&(l=l.trimStart()),l}let o=Math.min(e.endField-1,s.length-1),a="";for(let l=i;l<=o&&l<s.length;l++){let c=s[l]||"";if(l===i&&e.startChar!==void 0&&(c=c.slice(e.startChar-1)),l===o&&e.endChar!==void 0){let u=l===i&&e.startChar!==void 0?e.endChar-e.startChar+1:e.endChar;c=c.slice(0,u)}l>i&&(a+=n||" "),a+=c}return e.ignoreLeading&&(a=a.trimStart()),a}function bp(t,e,n){let r=t,s=e;if(n.dictionaryOrder&&(r=wp(r),s=wp(s)),n.ignoreCase&&(r=r.toLowerCase(),s=s.toLowerCase()),n.monthSort){let i=yp(r),o=yp(s);return i-o}if(n.humanNumeric){let i=gp(r),o=gp(s);return i-o}if(n.versionSort)return Z3(r,s);if(n.numeric){let i=parseFloat(r)||0,o=parseFloat(s)||0;return i-o}return r.localeCompare(s)}function xp(t){let{keys:e,fieldDelimiter:n,numeric:r,ignoreCase:s,reverse:i,humanNumeric:o,versionSort:a,dictionaryOrder:l,monthSort:c,ignoreLeadingBlanks:u,stable:f}=t;return(p,h)=>{let m=p,d=h;if(u&&(m=m.trimStart(),d=d.trimStart()),e.length===0){let w=bp(m,d,{numeric:r,ignoreCase:s,humanNumeric:o,versionSort:a,dictionaryOrder:l,monthSort:c});if(w!==0)return i?-w:w;if(!f){let E=p.localeCompare(h);return i?-E:E}return 0}for(let g of e){let w=Za(m,g,n),E=Za(d,g,n);g.ignoreLeading&&(w=w.trimStart(),E=E.trimStart());let b={numeric:g.numeric??r,ignoreCase:g.ignoreCase??s,humanNumeric:g.humanNumeric??o,versionSort:g.versionSort??a,dictionaryOrder:g.dictionaryOrder??l,monthSort:g.monthSort??c},A=g.reverse??i,N=bp(w,E,b);if(N!==0)return A?-N:N}if(!f){let g=p.localeCompare(h);return i?-g:g}return 0}}function Ep(t,e){if(e.keys.length===0){if(e.ignoreCase){let s=new Set;return t.filter(i=>{let o=i.toLowerCase();return s.has(o)?!1:(s.add(o),!0)})}return[...new Set(t)]}let n=e.keys[0],r=new Set;return t.filter(s=>{let i=Za(s,n,e.fieldDelimiter);return(n.ignoreCase??e.ignoreCase)&&(i=i.toLowerCase()),r.has(i)?!1:(r.add(i),!0)})}var V3,q3,Ap=I(()=>{"use strict";V3=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),q3=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]])});function Pi(t){let e={startField:1},n="",r=t,s=r.match(/([bdfhMnrV]+)$/);s&&(n=s[1],r=r.slice(0,-n.length)),n.includes("n")&&(e.numeric=!0),n.includes("r")&&(e.reverse=!0),n.includes("f")&&(e.ignoreCase=!0),n.includes("b")&&(e.ignoreLeading=!0),n.includes("h")&&(e.humanNumeric=!0),n.includes("V")&&(e.versionSort=!0),n.includes("d")&&(e.dictionaryOrder=!0),n.includes("M")&&(e.monthSort=!0);let i=r.split(",");if(i.length===0||i[0]==="")return null;let o=i[0].split("."),a=parseInt(o[0],10);if(Number.isNaN(a)||a<1)return null;if(e.startField=a,o.length>1&&o[1]){let l=parseInt(o[1],10);!Number.isNaN(l)&&l>=1&&(e.startChar=l)}if(i.length>1&&i[1]){let l=i[1],c=l.match(/([bdfhMnrV]+)$/);if(c){let f=c[1];f.includes("n")&&(e.numeric=!0),f.includes("r")&&(e.reverse=!0),f.includes("f")&&(e.ignoreCase=!0),f.includes("b")&&(e.ignoreLeading=!0),f.includes("h")&&(e.humanNumeric=!0),f.includes("V")&&(e.versionSort=!0),f.includes("d")&&(e.dictionaryOrder=!0),f.includes("M")&&(e.monthSort=!0),l=l.slice(0,-f.length)}let u=l.split(".");if(u[0]){let f=parseInt(u[0],10);if(!Number.isNaN(f)&&f>=1&&(e.endField=f),u.length>1&&u[1]){let p=parseInt(u[1],10);!Number.isNaN(p)&&p>=1&&(e.endChar=p)}}}return e}var Sp=I(()=>{"use strict"});var Cp={};se(Cp,{flagsForFuzzing:()=>K3,sortCommand:()=>Q3});var Y3,Q3,K3,Np=I(()=>{"use strict";F();sr();he();Ap();Sp();Y3={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
342
+ F is a field number (1-indexed)
343
+ C is a character position within the field (1-indexed)
344
+ OPTS can be: b d f h M n r V (per-key modifiers)
345
+
346
+ Examples:
347
+ -k1 sort by first field
348
+ -k2,2 sort by second field only
349
+ -k1.3 sort by first field starting at 3rd character
350
+ -k1,2n sort by fields 1-2 numerically
351
+ -k2 -k1 sort by field 2, then by field 1`},Q3={name:"sort",async execute(t,e){let n=W(t);if(Z(n))return q(Y3);let r={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},s=[];for(let u=0;u<n.length;u++){let f=n[u];if(f==="-r"||f==="--reverse")r.reverse=!0;else if(f==="-n"||f==="--numeric-sort")r.numeric=!0;else if(f==="-u"||f==="--unique")r.unique=!0;else if(f==="-f"||f==="--ignore-case")r.ignoreCase=!0;else if(f==="-h"||f==="--human-numeric-sort")r.humanNumeric=!0;else if(f==="-V"||f==="--version-sort")r.versionSort=!0;else if(f==="-d"||f==="--dictionary-order")r.dictionaryOrder=!0;else if(f==="-M"||f==="--month-sort")r.monthSort=!0;else if(f==="-b"||f==="--ignore-leading-blanks")r.ignoreLeadingBlanks=!0;else if(f==="-s"||f==="--stable")r.stable=!0;else if(f==="-c"||f==="--check")r.checkOnly=!0;else if(f==="-o"||f==="--output")r.outputFile=n[++u]||null;else if(f.startsWith("-o"))r.outputFile=f.slice(2)||null;else if(f.startsWith("--output="))r.outputFile=f.slice(9)||null;else if(f==="-t"||f==="--field-separator")r.fieldDelimiter=n[++u]||null;else if(f.startsWith("-t"))r.fieldDelimiter=f.slice(2)||null;else if(f.startsWith("--field-separator="))r.fieldDelimiter=f.slice(18)||null;else if(f==="-k"||f==="--key"){let p=n[++u];if(p){let h=Pi(p);h&&r.keys.push(h)}}else if(f.startsWith("-k")){let p=Pi(f.slice(2));p&&r.keys.push(p)}else if(f.startsWith("--key=")){let p=Pi(f.slice(6));p&&r.keys.push(p)}else{if(f.startsWith("--"))return oe("sort",f);if(f.startsWith("-")&&!f.startsWith("--")){let p=!1;for(let h of f.slice(1))if(h==="r")r.reverse=!0;else if(h==="n")r.numeric=!0;else if(h==="u")r.unique=!0;else if(h==="f")r.ignoreCase=!0;else if(h==="h")r.humanNumeric=!0;else if(h==="V")r.versionSort=!0;else if(h==="d")r.dictionaryOrder=!0;else if(h==="M")r.monthSort=!0;else if(h==="b")r.ignoreLeadingBlanks=!0;else if(h==="s")r.stable=!0;else if(h==="c")r.checkOnly=!0;else{p=!0;break}if(p)return oe("sort",f)}else s.push(f)}}let i=await Ir(e,s,{cmdName:"sort"});if(!i.ok)return i.error;let a=R(i.content).split(`
352
+ `);a.length>0&&a[a.length-1]===""&&a.pop();let l=xp(r);if(r.checkOnly){let u=s.length>0?s[0]:"-";for(let f=1;f<a.length;f++)if(l(a[f-1],a[f])>0)return{stdout:y,stderr:x(`sort: ${u}:${f+1}: disorder: ${a[f]}
353
+ `),exitCode:1};return{stdout:y,stderr:y,exitCode:0}}a.sort(l),r.unique&&(a=Ep(a,r));let c=a.length>0?`${a.join(`
354
+ `)}
355
+ `:"";if(r.outputFile){let u=e.fs.resolvePath(e.cwd,r.outputFile);return await e.fs.writeFile(u,c),{stdout:y,stderr:y,exitCode:0}}return{stdout:x(c),stderr:y,exitCode:0}}},K3={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0}});var vp={};se(vp,{flagsForFuzzing:()=>t8,uniqCommand:()=>e8});var X3,J3,e8,t8,kp=I(()=>{"use strict";nt();F();sr();he();X3={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},J3={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},e8={name:"uniq",async execute(t,e){let n=W(t);if(Z(n))return q(X3);let r=ke("uniq",n,J3);if(!r.ok)return r.error;let{count:s,duplicatesOnly:i,uniqueOnly:o,ignoreCase:a}=r.result.flags,l=r.result.positional,c=await Ir(e,l,{cmdName:"uniq"});if(!c.ok)return c.error;let f=R(c.content).split(`
356
+ `);if(f.length>0&&f[f.length-1]===""&&f.pop(),f.length===0)return{stdout:y,stderr:y,exitCode:0};let p=[],h=f[0],m=1,d=(E,b)=>a?E.toLowerCase()===b.toLowerCase():E===b;for(let E=1;E<f.length;E++)d(f[E],h)?m++:(p.push({line:h,count:m}),h=f[E],m=1);p.push({line:h,count:m});let g=p;i?g=p.filter(E=>E.count>1):o&&(g=p.filter(E=>E.count===1));let w="";for(let{line:E,count:b}of g)s?w+=`${String(b).padStart(4)} ${E}
357
+ `:w+=`${E}
358
+ `;return{stdout:x(w),stderr:y,exitCode:0}}},t8={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Ip={};se(Ip,{commCommand:()=>r8,flagsForFuzzing:()=>s8});var n8,r8,s8,Tp=I(()=>{"use strict";F();he();n8={name:"comm",summary:"compare two sorted files line by line",usage:"comm [OPTION]... FILE1 FILE2",options:["-1 suppress column 1 (lines unique to FILE1)","-2 suppress column 2 (lines unique to FILE2)","-3 suppress column 3 (lines that appear in both files)"," --help display this help and exit"]},r8={name:"comm",async execute(t,e){let n=W(t);if(Z(n))return q(n8);let r=!1,s=!1,i=!1,o=[];for(let w of n)if(w==="-1")r=!0;else if(w==="-2")s=!0;else if(w==="-3")i=!0;else if(w==="-12"||w==="-21")r=!0,s=!0;else if(w==="-13"||w==="-31")r=!0,i=!0;else if(w==="-23"||w==="-32")s=!0,i=!0;else if(w==="-123"||w==="-132"||w==="-213"||w==="-231"||w==="-312"||w==="-321")r=!0,s=!0,i=!0;else{if(w.startsWith("-")&&w!=="-")return oe("comm",w);o.push(w)}if(o.length!==2)return{stdout:y,stderr:x(`comm: missing operand
359
+ Try 'comm --help' for more information.
360
+ `),exitCode:1};let a=async w=>{if(w==="-")return R(e.stdin);try{let E=e.fs.resolvePath(e.cwd,w);return await e.fs.readFile(E)}catch{return null}},l=await a(o[0]);if(l===null)return{stdout:y,stderr:x(`comm: ${o[0]}: No such file or directory
361
+ `),exitCode:1};let c=await a(o[1]);if(c===null)return{stdout:y,stderr:x(`comm: ${o[1]}: No such file or directory
362
+ `),exitCode:1};let u=l.split(`
363
+ `),f=c.split(`
364
+ `);u.length>0&&u[u.length-1]===""&&u.pop(),f.length>0&&f[f.length-1]===""&&f.pop();let p=0,h=0,m="",d=r?"":" ",g=(r?"":" ")+(s?"":" ");for(;p<u.length||h<f.length;)p>=u.length?(s||(m+=`${d}${f[h]}
365
+ `),h++):h>=f.length?(r||(m+=`${u[p]}
366
+ `),p++):u[p]<f[h]?(r||(m+=`${u[p]}
367
+ `),p++):u[p]>f[h]?(s||(m+=`${d}${f[h]}
368
+ `),h++):(i||(m+=`${g}${u[p]}
369
+ `),p++,h++);return{stdout:x(m),stderr:y,exitCode:0}}},s8={name:"comm",flags:[{flag:"-1",type:"boolean"},{flag:"-2",type:"boolean"},{flag:"-3",type:"boolean"}],needsArgs:!0,minArgs:2}});var Op={};se(Op,{cutCommand:()=>l8,flagsForFuzzing:()=>c8});function o8(t){let e=[],n=t.split(",");for(let r of n)if(r.includes("-")){let[s,i]=r.split("-");e.push({start:s?parseInt(s,10):1,end:i?parseInt(i,10):null})}else{let s=parseInt(r,10);e.push({start:s,end:s})}return e}function a8(t,e){let n=[];for(let r of e){let s=r.start-1,i=r.end===null?t.length:r.end;for(let o=s;o<i&&o<t.length;o++)o>=0&&!n.includes(t[o])&&n.push(t[o])}return n}var i8,l8,c8,Rp=I(()=>{"use strict";F();sr();he();i8={name:"cut",summary:"remove sections from each line of files",usage:"cut [OPTION]... [FILE]...",options:["-c LIST select only these characters","-d DELIM use DELIM instead of TAB for field delimiter","-f LIST select only these fields","-s, --only-delimited do not print lines without delimiters"," --help display this help and exit"]};l8={name:"cut",async execute(t,e){let n=W(t);if(Z(n))return q(i8);let r=" ",s=null,i=null,o=!1,a=[];for(let h=0;h<n.length;h++){let m=n[h];if(m==="-d")r=n[++h]||" ";else if(m.startsWith("-d"))r=m.slice(2);else if(m==="-f")s=n[++h];else if(m.startsWith("-f"))s=m.slice(2);else if(m==="-c")i=n[++h];else if(m.startsWith("-c"))i=m.slice(2);else if(m==="-s"||m==="--only-delimited")o=!0;else{if(m.startsWith("--"))return oe("cut",m);if(m.startsWith("-")){let d=!1;for(let g of m.slice(1))if(g==="s")o=!0;else if(!"dfc".includes(g)){d=!0;break}if(d)return oe("cut",m)}else a.push(m)}}if(!s&&!i)return{stdout:y,stderr:x(`cut: you must specify a list of bytes, characters, or fields
370
+ `),exitCode:1};let l=await Ir(e,a,{cmdName:"cut"});if(!l.ok)return l.error;let u=R(l.content).split(`
371
+ `);u.length>0&&u[u.length-1]===""&&u.pop();let f=o8(s||i||"1"),p="";for(let h of u)if(i){let m=h.split(""),d=[];for(let g of f){let w=g.start-1,E=g.end===null?m.length:g.end;for(let b=w;b<E&&b<m.length;b++)b>=0&&d.push(m[b])}p+=`${d.join("")}
372
+ `}else{if(o&&!h.includes(r))continue;let m=h.split(r),d=a8(m,f);p+=`${d.join(r)}
373
+ `}return{stdout:x(p),stderr:y,exitCode:0}}},c8={name:"cut",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-f",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"string"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0}});var $p={};se($p,{flagsForFuzzing:()=>h8,pasteCommand:()=>p8});function Pp(t,e){if(t.length===0)return"";if(t.length===1)return t[0];let n=t[0];for(let r=1;r<t.length;r++){let s=(r-1)%e.length;n+=e[s]+t[r]}return n}var u8,f8,p8,h8,Dp=I(()=>{"use strict";nt();F();he();u8={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},f8={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},p8={name:"paste",async execute(t,e){let n=W(t);if(Z(n))return q(u8);let r=ke("paste",n,f8);if(!r.ok)return r.error;let s=r.result.flags.delimiter,i=r.result.flags.serial,o=r.result.positional;if(o.length===0)return{stdout:y,stderr:x(`usage: paste [-s] [-d delimiters] file ...
374
+ `),exitCode:1};let a=e.stdin?R(e.stdin).split(`
375
+ `):[""];a.length>0&&a[a.length-1]===""&&a.pop();let l=o.filter(p=>p==="-").length,c=[],u=0;for(let p of o)if(p==="-"){let h=[];for(let m=u;m<a.length;m+=l)h.push(a[m]);c.push(h),u++}else{let h=e.fs.resolvePath(e.cwd,p);try{let d=(await e.fs.readFile(h)).split(`
376
+ `);d.length>0&&d[d.length-1]===""&&d.pop(),c.push(d)}catch{return{stdout:y,stderr:x(`paste: ${p}: No such file or directory
377
+ `),exitCode:1}}}let f="";if(i)for(let p of c)p&&(f+=`${Pp(p,s)}
378
+ `);else{let p=Math.max(...c.map(h=>h?.length??0));for(let h=0;h<p;h++){let m=[];for(let d of c)m.push(d?.[h]??"");f+=`${Pp(m,s)}
379
+ `}}return{stdout:x(f),stderr:y,exitCode:0}}};h8={name:"paste",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Mp={};se(Mp,{flagsForFuzzing:()=>w8,trCommand:()=>y8});function _p(t){let e="",n=0;for(;n<t.length;){if(t[n]==="["&&t[n+1]===":"){let r=!1;for(let[s,i]of m8)if(t.slice(n).startsWith(s)){e+=i,n+=s.length,r=!0;break}if(r)continue}if(t[n]==="\\"&&n+1<t.length){let r=t[n+1];r==="n"?e+=`
380
+ `:r==="t"?e+=" ":r==="r"?e+="\r":e+=r,n+=2;continue}if(n+2<t.length&&t[n+1]==="-"){let r=t.charCodeAt(n),s=t.charCodeAt(n+2);for(let i=r;i<=s;i++)e+=String.fromCharCode(i);n+=3;continue}e+=t[n],n++}return e}var d8,m8,g8,y8,w8,Lp=I(()=>{"use strict";nt();F();he();d8={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
381
+ a-z character range
382
+ [:alnum:] all letters and digits
383
+ [:alpha:] all letters
384
+ [:digit:] all digits
385
+ [:lower:] all lowercase letters
386
+ [:upper:] all uppercase letters
387
+ [:space:] all whitespace
388
+ [:blank:] horizontal whitespace
389
+ [:punct:] all punctuation
390
+ [:print:] all printable characters
391
+ [:graph:] all printable characters except space
392
+ [:cntrl:] all control characters
393
+ [:xdigit:] all hexadecimal digits
394
+ \\n, \\t, \\r escape sequences`},m8=new Map([["[:alnum:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"],["[:alpha:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"],["[:blank:]"," "],["[:cntrl:]",Array.from({length:32},(t,e)=>String.fromCharCode(e)).join("").concat("\x7F")],["[:digit:]","0123456789"],["[:graph:]",Array.from({length:94},(t,e)=>String.fromCharCode(33+e)).join("")],["[:lower:]","abcdefghijklmnopqrstuvwxyz"],["[:print:]",Array.from({length:95},(t,e)=>String.fromCharCode(32+e)).join("")],["[:punct:]","!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"],["[:space:]",`
395
+ \r\f\v`],["[:upper:]","ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["[:xdigit:]","0123456789ABCDEFabcdef"]]);g8={complement:{short:"c",long:"complement",type:"boolean"},complementUpper:{short:"C",type:"boolean"},delete:{short:"d",long:"delete",type:"boolean"},squeeze:{short:"s",long:"squeeze-repeats",type:"boolean"}},y8={name:"tr",async execute(t,e){let n=W(t);if(Z(n))return q(d8);let r=ke("tr",n,g8);if(!r.ok)return r.error;let s=r.result.flags.complement||r.result.flags.complementUpper,i=r.result.flags.delete,o=r.result.flags.squeeze,a=r.result.positional;if(a.length<1)return{stdout:y,stderr:x(`tr: missing operand
396
+ `),exitCode:1};if(!i&&!o&&a.length<2)return{stdout:y,stderr:x(`tr: missing operand after SET1
397
+ `),exitCode:1};let l=_p(a[0]),c=a.length>1?_p(a[1]):"",u=R(e.stdin),f=h=>{let m=l.includes(h);return s?!m:m},p="";if(i)for(let h of u)f(h)||(p+=h);else if(o&&a.length===1){let h="";for(let m of u)f(m)&&m===h||(p+=m,h=m)}else{if(s){let h=c.length>0?c[c.length-1]:"";for(let m of u)l.includes(m)?p+=m:p+=h}else{let h=new Map;for(let m=0;m<l.length;m++){let d=m<c.length?c[m]:c[c.length-1];h.set(l[m],d)}for(let m of u)p+=h.get(m)??m}if(o){let h="",m="";for(let d of p)c.includes(d)&&d===m||(h+=d,m=d);p=h}}return{stdout:x(p),stderr:y,exitCode:0}}},w8={name:"tr",flags:[{flag:"-c",type:"boolean"},{flag:"-C",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-s",type:"boolean"}],stdinType:"text",needsArgs:!0}});var Fp={};se(Fp,{flagsForFuzzing:()=>A8,rev:()=>E8});function x8(t){return Array.from(t).reverse().join("")}var b8,E8,A8,Up=I(()=>{"use strict";F();he();b8={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};E8={name:"rev",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(b8);let r=[];for(let o of n)if(o==="--"){let a=n.indexOf(o);r.push(...n.slice(a+1));break}else{if(o.startsWith("-")&&o!=="-")return oe("rev",o);r.push(o)}let s="",i=o=>{let a=o.split(`
398
+ `),l=o.endsWith(`
399
+ `)&&a[a.length-1]==="";return l&&a.pop(),a.map(x8).join(`
400
+ `)+(l?`
401
+ `:"")};if(r.length===0){let o=R(e.stdin);s=i(o)}else for(let o of r)if(o==="-"){let a=R(e.stdin);s+=i(a)}else{let a=e.fs.resolvePath(e.cwd,o),l=await e.fs.readFile(a);if(l===null)return{exitCode:1,stdout:x(s),stderr:x(`rev: ${o}: No such file or directory
402
+ `)};s+=i(l)}return{exitCode:0,stdout:x(s),stderr:y}}},A8={name:"rev",flags:[],stdinType:"text",needsFiles:!0}});var Wp={};se(Wp,{flagsForFuzzing:()=>k8,nl:()=>v8});function C8(t,e,n){let r=String(t);switch(e){case"ln":return r.padEnd(n);case"rn":return r.padStart(n);case"rz":return r.padStart(n,"0");default:return e}}function N8(t,e){switch(e){case"a":return!0;case"t":return t.trim().length>0;case"n":return!1;default:return e}}function Bp(t,e,n){if(t==="")return{output:"",nextNumber:n};let r=t.split(`
403
+ `),s=[],i=n,o=t.endsWith(`
404
+ `)&&r[r.length-1]==="";o&&r.pop();for(let a of r)if(N8(a,e.bodyStyle)){let l=C8(i,e.numberFormat,e.width);s.push(`${l}${e.separator}${a}`),i+=e.increment}else{let l=" ".repeat(e.width);s.push(`${l}${e.separator}${a}`)}return{output:s.join(`
405
+ `)+(o?`
406
+ `:""),nextNumber:i}}var S8,v8,k8,zp=I(()=>{"use strict";F();he();S8={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};v8={name:"nl",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(S8);let r={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},s=[],i=0;for(;i<n.length;){let l=n[i];if(l==="-b"&&i+1<n.length){let c=n[i+1];if(c!=="a"&&c!=="t"&&c!=="n")return{exitCode:1,stdout:y,stderr:x(`nl: invalid body numbering style: '${c}'
407
+ `)};r.bodyStyle=c,i+=2}else if(l.startsWith("-b")){let c=l.slice(2);if(c!=="a"&&c!=="t"&&c!=="n")return{exitCode:1,stdout:y,stderr:x(`nl: invalid body numbering style: '${c}'
408
+ `)};r.bodyStyle=c,i++}else if(l==="-n"&&i+1<n.length){let c=n[i+1];if(c!=="ln"&&c!=="rn"&&c!=="rz")return{exitCode:1,stdout:y,stderr:x(`nl: invalid line numbering format: '${c}'
409
+ `)};r.numberFormat=c,i+=2}else if(l.startsWith("-n")){let c=l.slice(2);if(c!=="ln"&&c!=="rn"&&c!=="rz")return{exitCode:1,stdout:y,stderr:x(`nl: invalid line numbering format: '${c}'
410
+ `)};r.numberFormat=c,i++}else if(l==="-w"&&i+1<n.length){let c=parseInt(n[i+1],10);if(Number.isNaN(c)||c<1)return{exitCode:1,stdout:y,stderr:x(`nl: invalid line number field width: '${n[i+1]}'
411
+ `)};r.width=c,i+=2}else if(l.startsWith("-w")){let c=parseInt(l.slice(2),10);if(Number.isNaN(c)||c<1)return{exitCode:1,stdout:y,stderr:x(`nl: invalid line number field width: '${l.slice(2)}'
412
+ `)};r.width=c,i++}else if(l==="-s"&&i+1<n.length)r.separator=n[i+1],i+=2;else if(l.startsWith("-s"))r.separator=l.slice(2),i++;else if(l==="-v"&&i+1<n.length){let c=parseInt(n[i+1],10);if(Number.isNaN(c))return{exitCode:1,stdout:y,stderr:x(`nl: invalid starting line number: '${n[i+1]}'
413
+ `)};r.startNumber=c,i+=2}else if(l.startsWith("-v")){let c=parseInt(l.slice(2),10);if(Number.isNaN(c))return{exitCode:1,stdout:y,stderr:x(`nl: invalid starting line number: '${l.slice(2)}'
414
+ `)};r.startNumber=c,i++}else if(l==="-i"&&i+1<n.length){let c=parseInt(n[i+1],10);if(Number.isNaN(c))return{exitCode:1,stdout:y,stderr:x(`nl: invalid line number increment: '${n[i+1]}'
415
+ `)};r.increment=c,i+=2}else if(l.startsWith("-i")){let c=parseInt(l.slice(2),10);if(Number.isNaN(c))return{exitCode:1,stdout:y,stderr:x(`nl: invalid line number increment: '${l.slice(2)}'
416
+ `)};r.increment=c,i++}else if(l==="--"){s.push(...n.slice(i+1));break}else{if(l.startsWith("-")&&l!=="-")return oe("nl",l);s.push(l),i++}}let o="",a=r.startNumber;if(s.length===0){let l=R(e.stdin);o=Bp(l,r,a).output}else for(let l of s){let c=e.fs.resolvePath(e.cwd,l),u=await e.fs.readFile(c);if(u===null)return{exitCode:1,stdout:x(o),stderr:x(`nl: ${l}: No such file or directory
417
+ `)};let f=Bp(u,r,a);o+=f.output,a=f.nextNumber}return{exitCode:0,stdout:x(o),stderr:y}}},k8={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}});var jp={};se(jp,{flagsForFuzzing:()=>P8,fold:()=>R8});function T8(t,e,n){return n?new TextEncoder().encode(t).length:t===" "?8-e%8:t==="\b"?-1:1}function O8(t,e){if(t.length===0)return t;let{width:n,breakAtSpaces:r,countBytes:s}=e,i=[],o="",a=0,l=-1,c=0;for(let u=0;u<t.length;u++){let f=t[u],p=T8(f,a,s);a+p>n&&o.length>0?r&&l>=0?(i.push(o.slice(0,l+1)),o=o.slice(l+1)+f,a=a-c-1+p,l=-1,c=0):(i.push(o),o=f,a=p,l=-1,c=0):(o+=f,a+=p,(f===" "||f===" ")&&(l=o.length-1,c=a-p))}return o.length>0&&i.push(o),i.join(`
418
+ `)}function Hp(t,e){if(t==="")return"";let n=t.split(`
419
+ `),r=t.endsWith(`
420
+ `)&&n[n.length-1]==="";return r&&n.pop(),n.map(i=>O8(i,e)).join(`
421
+ `)+(r?`
422
+ `:"")}var I8,R8,P8,Gp=I(()=>{"use strict";F();he();I8={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};R8={name:"fold",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(I8);let r={width:80,breakAtSpaces:!1,countBytes:!1},s=[],i=0;for(;i<n.length;){let a=n[i];if(a==="-w"&&i+1<n.length){let l=parseInt(n[i+1],10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:y,stderr:x(`fold: invalid number of columns: '${n[i+1]}'
423
+ `)};r.width=l,i+=2}else if(a.startsWith("-w")&&a.length>2){let l=parseInt(a.slice(2),10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:y,stderr:x(`fold: invalid number of columns: '${a.slice(2)}'
424
+ `)};r.width=l,i++}else if(a==="-s")r.breakAtSpaces=!0,i++;else if(a==="-b")r.countBytes=!0,i++;else if(a==="-bs"||a==="-sb")r.breakAtSpaces=!0,r.countBytes=!0,i++;else if(a.match(/^-[sb]+w\d+$/)){a.includes("s")&&(r.breakAtSpaces=!0),a.includes("b")&&(r.countBytes=!0);let l=a.replace(/^-[sb]+w/,""),c=parseInt(l,10);if(Number.isNaN(c)||c<1)return{exitCode:1,stdout:y,stderr:x(`fold: invalid number of columns: '${l}'
425
+ `)};r.width=c,i++}else if(a.match(/^-[sb]+w$/)&&i+1<n.length){a.includes("s")&&(r.breakAtSpaces=!0),a.includes("b")&&(r.countBytes=!0);let l=parseInt(n[i+1],10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:y,stderr:x(`fold: invalid number of columns: '${n[i+1]}'
426
+ `)};r.width=l,i+=2}else if(a==="--"){s.push(...n.slice(i+1));break}else if(a.startsWith("-")&&a!=="-"){let l=a.slice(1),c=!1;for(let u of l)if(u==="s")r.breakAtSpaces=!0;else if(u==="b")r.countBytes=!0;else{c=!0;break}if(c)return oe("fold",a);i++}else s.push(a),i++}let o="";if(s.length===0){let a=R(e.stdin);o=Hp(a,r)}else for(let a of s){let l=e.fs.resolvePath(e.cwd,a),c=await e.fs.readFile(l);if(c===null)return{exitCode:1,stdout:x(o),stderr:x(`fold: ${a}: No such file or directory
427
+ `)};o+=Hp(c,r)}return{exitCode:0,stdout:x(o),stderr:y}}},P8={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0}});var qp={};se(qp,{expand:()=>M8,flagsForFuzzing:()=>L8});function $i(t){let e=t.split(",").map(r=>r.trim()),n=[];for(let r of e){let s=parseInt(r,10);if(Number.isNaN(s)||s<1)return null;n.push(s)}for(let r=1;r<n.length;r++)if(n[r]<=n[r-1])return null;return n}function D8(t,e){if(e.length===1){let n=e[0];return n-t%n}for(let n of e)if(n>t)return n-t;if(e.length>=2){let n=e[e.length-1]-e[e.length-2],r=e[e.length-1],s=Math.floor((t-r)/n)+1;return r+s*n-t}return 1}function _8(t,e){let{tabStops:n,leadingOnly:r}=e,s="",i=0,o=!0;for(let a of t)if(a===" ")if(r&&!o)s+=a,i++;else{let l=D8(i,n);s+=" ".repeat(l),i+=l}else a!==" "&&a!==" "&&(o=!1),s+=a,i++;return s}function Vp(t,e){if(t==="")return"";let n=t.split(`
428
+ `),r=t.endsWith(`
429
+ `)&&n[n.length-1]==="";return r&&n.pop(),n.map(i=>_8(i,e)).join(`
430
+ `)+(r?`
431
+ `:"")}var $8,M8,L8,Zp=I(()=>{"use strict";F();he();$8={name:"expand",summary:"convert tabs to spaces",usage:"expand [OPTION]... [FILE]...",description:"Convert TABs in each FILE to spaces, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-i Only convert leading tabs on each line"],examples:["expand file.txt # Convert all tabs to 8 spaces","expand -t 4 file.txt # Use 4-space tabs","expand -t 4,8,12 file.txt # Custom tab stops"]};M8={name:"expand",execute:async(t,e)=>{let n=W(t);if(Z(n))return q($8);let r={tabStops:[8],leadingOnly:!1},s=[],i=0;for(;i<n.length;){let a=n[i];if(a==="-t"&&i+1<n.length){let l=$i(n[i+1]);if(!l)return{exitCode:1,stdout:y,stderr:x(`expand: invalid tab size: '${n[i+1]}'
432
+ `)};r.tabStops=l,i+=2}else if(a.startsWith("-t")&&a.length>2){let l=$i(a.slice(2));if(!l)return{exitCode:1,stdout:y,stderr:x(`expand: invalid tab size: '${a.slice(2)}'
433
+ `)};r.tabStops=l,i++}else if(a==="--tabs"&&i+1<n.length){let l=$i(n[i+1]);if(!l)return{exitCode:1,stdout:y,stderr:x(`expand: invalid tab size: '${n[i+1]}'
434
+ `)};r.tabStops=l,i+=2}else if(a.startsWith("--tabs=")){let l=$i(a.slice(7));if(!l)return{exitCode:1,stdout:y,stderr:x(`expand: invalid tab size: '${a.slice(7)}'
435
+ `)};r.tabStops=l,i++}else if(a==="-i"||a==="--initial")r.leadingOnly=!0,i++;else if(a==="--"){s.push(...n.slice(i+1));break}else{if(a.startsWith("-")&&a!=="-")return oe("expand",a);s.push(a),i++}}let o="";if(s.length===0){let a=R(e.stdin);o=Vp(a,r)}else for(let a of s){let l=e.fs.resolvePath(e.cwd,a),c=await e.fs.readFile(l);if(c===null)return{exitCode:1,stdout:x(o),stderr:x(`expand: ${a}: No such file or directory
436
+ `)};o+=Vp(c,r)}return{exitCode:0,stdout:x(o),stderr:y}}},L8={name:"expand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0}});var Kp={};se(Kp,{flagsForFuzzing:()=>W8,unexpand:()=>B8});function Di(t){let e=t.split(",").map(r=>r.trim()),n=[];for(let r of e){let s=parseInt(r,10);if(Number.isNaN(s)||s<1)return null;n.push(s)}for(let r=1;r<n.length;r++)if(n[r]<=n[r-1])return null;return n}function Yp(t,e){if(e.length===1){let n=e[0];return t+(n-t%n)}for(let n of e)if(n>t)return n;if(e.length>=2){let n=e[e.length-1]-e[e.length-2],r=e[e.length-1],s=Math.floor((t-r)/n)+1;return r+s*n}return-1}function U8(t,e){let{tabStops:n,allBlanks:r}=e,s="",i=0,o="",a=0,l=!0,c=()=>{if(o.length===0)return;let u=a+o.length;if(!r&&!l){s+=o,o="";return}let f=a,p="";for(;f<u;){let m=Yp(f,n);if(m<=u&&m>f)p+=" ",f=m;else break}let h=u-f;h>0&&(p+=" ".repeat(h)),s+=p,o=""};for(let u of t)u===" "?(o.length===0&&(a=i),o+=u,i++):u===" "?(c(),s+=u,i=Yp(i,n)):(c(),s+=u,i++,l=!1);return c(),s}function Qp(t,e){if(t==="")return"";let n=t.split(`
437
+ `),r=t.endsWith(`
438
+ `)&&n[n.length-1]==="";return r&&n.pop(),n.map(i=>U8(i,e)).join(`
439
+ `)+(r?`
440
+ `:"")}var F8,B8,W8,Xp=I(()=>{"use strict";F();he();F8={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};B8={name:"unexpand",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(F8);let r={tabStops:[8],allBlanks:!1},s=[],i=0;for(;i<n.length;){let a=n[i];if(a==="-t"&&i+1<n.length){let l=Di(n[i+1]);if(!l)return{exitCode:1,stdout:y,stderr:x(`unexpand: invalid tab size: '${n[i+1]}'
441
+ `)};r.tabStops=l,i+=2}else if(a.startsWith("-t")&&a.length>2){let l=Di(a.slice(2));if(!l)return{exitCode:1,stdout:y,stderr:x(`unexpand: invalid tab size: '${a.slice(2)}'
442
+ `)};r.tabStops=l,i++}else if(a==="--tabs"&&i+1<n.length){let l=Di(n[i+1]);if(!l)return{exitCode:1,stdout:y,stderr:x(`unexpand: invalid tab size: '${n[i+1]}'
443
+ `)};r.tabStops=l,i+=2}else if(a.startsWith("--tabs=")){let l=Di(a.slice(7));if(!l)return{exitCode:1,stdout:y,stderr:x(`unexpand: invalid tab size: '${a.slice(7)}'
444
+ `)};r.tabStops=l,i++}else if(a==="-a"||a==="--all")r.allBlanks=!0,i++;else if(a==="--"){s.push(...n.slice(i+1));break}else{if(a.startsWith("-")&&a!=="-")return oe("unexpand",a);s.push(a),i++}}let o="";if(s.length===0){let a=R(e.stdin);o=Qp(a,r)}else for(let a of s){let l=e.fs.resolvePath(e.cwd,a),c=await e.fs.readFile(l);if(c===null)return{exitCode:1,stdout:x(o),stderr:x(`unexpand: ${a}: No such file or directory
445
+ `)};o+=Qp(c,r)}return{exitCode:0,stdout:x(o),stderr:y}}},W8={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0}});var th={};se(th,{flagsForFuzzing:()=>G8,strings:()=>j8});function H8(t){return t>=32&&t<=126||t===9}function Jp(t,e){if(e===null)return"";switch(e){case"o":return`${t.toString(8).padStart(7," ")} `;case"x":return`${t.toString(16).padStart(7," ")} `;case"d":return`${t.toString(10).padStart(7," ")} `;default:return e}}function eh(t,e){let n=[],r="",s=0,i=typeof t=="string"?new TextEncoder().encode(t):t;for(let o=0;o<i.length;o++){let a=i[o];if(H8(a))r.length===0&&(s=o),r+=String.fromCharCode(a);else{if(r.length>=e.minLength){let l=Jp(s,e.offsetFormat);n.push(`${l}${r}`)}r=""}}if(r.length>=e.minLength){let o=Jp(s,e.offsetFormat);n.push(`${o}${r}`)}return n}var z8,j8,G8,nh=I(()=>{"use strict";F();he();z8={name:"strings",summary:"print the sequences of printable characters in files",usage:"strings [OPTION]... [FILE]...",description:"For each FILE, print the printable character sequences that are at least MIN characters long. If no FILE is specified, standard input is read.",options:["-n MIN Print sequences of at least MIN characters (default: 4)","-t FORMAT Print offset before each string (o=octal, x=hex, d=decimal)","-a Scan the entire file (default behavior)","-e ENCODING Select character encoding (s=7-bit, S=8-bit)"],examples:["strings file.bin # Extract strings (min 4 chars)","strings -n 8 file.bin # Extract strings (min 8 chars)","strings -t x file.bin # Show hex offset","echo 'hello' | strings # Read from stdin"]};j8={name:"strings",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(z8);let r={minLength:4,offsetFormat:null},s=[],i=0;for(;i<n.length;){let a=n[i];if(a==="-n"&&i+1<n.length){let l=Number.parseInt(n[i+1],10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:y,stderr:x(`strings: invalid minimum string length: '${n[i+1]}'
446
+ `)};r.minLength=l,i+=2}else if(a.match(/^-n\d+$/)){let l=Number.parseInt(a.slice(2),10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:y,stderr:x(`strings: invalid minimum string length: '${a.slice(2)}'
447
+ `)};r.minLength=l,i++}else if(a.match(/^-\d+$/)){let l=Number.parseInt(a.slice(1),10);if(Number.isNaN(l)||l<1)return{exitCode:1,stdout:y,stderr:x(`strings: invalid minimum string length: '${a.slice(1)}'
448
+ `)};r.minLength=l,i++}else if(a==="-t"&&i+1<n.length){let l=n[i+1];if(l!=="o"&&l!=="x"&&l!=="d")return{exitCode:1,stdout:y,stderr:x(`strings: invalid radix: '${l}'
449
+ `)};r.offsetFormat=l,i+=2}else if(a.startsWith("-t")&&a.length===3){let l=a[2];if(l!=="o"&&l!=="x"&&l!=="d")return{exitCode:1,stdout:y,stderr:x(`strings: invalid radix: '${l}'
450
+ `)};r.offsetFormat=l,i++}else if(a==="-a"||a==="--all"||a==="-")a==="-"&&s.push(a),i++;else if(a==="-e"&&i+1<n.length){let l=n[i+1];if(l!=="s"&&l!=="S")return{exitCode:1,stdout:y,stderr:x(`strings: invalid encoding: '${l}'
451
+ `)};i+=2}else if(a.startsWith("-e")&&a.length===3){let l=a[2];if(l!=="s"&&l!=="S")return{exitCode:1,stdout:y,stderr:x(`strings: invalid encoding: '${l}'
452
+ `)};i++}else if(a==="--"){s.push(...n.slice(i+1));break}else{if(a.startsWith("-")&&a!=="-")return oe("strings",a);s.push(a),i++}}let o="";if(s.length===0){let a=R(e.stdin),l=eh(a,r);o=l.length>0?`${l.join(`
453
+ `)}
454
+ `:""}else for(let a of s){let l;if(a==="-")l=R(e.stdin);else{let u=e.fs.resolvePath(e.cwd,a);if(l=await e.fs.readFile(u),l===null)return{exitCode:1,stdout:x(o),stderr:x(`strings: ${a}: No such file or directory
455
+ `)}}let c=eh(l,r);c.length>0&&(o+=`${c.join(`
456
+ `)}
457
+ `)}return{exitCode:0,stdout:x(o),stderr:y}}},G8={name:"strings",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-a",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsFiles:!0}});var sh={};se(sh,{flagsForFuzzing:()=>X8,split:()=>K8});function rh(t){let e=t.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!e)return null;let n=Number.parseInt(e[1],10);if(Number.isNaN(n)||n<1)return null;let r=(e[2]||"").toUpperCase(),i=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(r);return i===void 0?null:n*i}function q8(t,e,n){if(e)return t.toString().padStart(n,"0");let r="abcdefghijklmnopqrstuvwxyz",s="",i=t;for(let o=0;o<n;o++)s=r[i%26]+s,i=Math.floor(i/26);return s}function Z8(t,e){let n=t.split(`
458
+ `),r=t.endsWith(`
459
+ `)&&n[n.length-1]==="";r&&n.pop();let s=[];for(let i=0;i<n.length;i+=e){let o=n.slice(i,i+e),l=i+e>=n.length&&!r?o.join(`
460
+ `):`${o.join(`
461
+ `)}
462
+ `;s.push({content:l,hasContent:!0})}return s}function Y8(t,e){let r=new TextEncoder().encode(t),s=new TextDecoder,i=[];for(let o=0;o<r.length;o+=e){let a=r.slice(o,o+e);i.push({content:s.decode(a),hasContent:a.length>0})}return i}function Q8(t,e){let r=new TextEncoder().encode(t),s=new TextDecoder,i=[],o=Math.ceil(r.length/e);for(let a=0;a<e;a++){let l=a*o,c=Math.min(l+o,r.length),u=r.slice(l,c);i.push({content:s.decode(u),hasContent:u.length>0})}return i}var V8,K8,X8,ih=I(()=>{"use strict";F();he();V8={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]};K8={name:"split",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(V8);let r={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},s=[],i=0;for(;i<n.length;){let u=n[i];if(u==="-l"&&i+1<n.length){let f=Number.parseInt(n[i+1],10);if(Number.isNaN(f)||f<1)return{exitCode:1,stdout:y,stderr:x(`split: invalid number of lines: '${n[i+1]}'
463
+ `)};r.mode="lines",r.lines=f,i+=2}else if(u.match(/^-l\d+$/)){let f=Number.parseInt(u.slice(2),10);if(Number.isNaN(f)||f<1)return{exitCode:1,stdout:y,stderr:x(`split: invalid number of lines: '${u.slice(2)}'
464
+ `)};r.mode="lines",r.lines=f,i++}else if(u==="-b"&&i+1<n.length){let f=rh(n[i+1]);if(f===null)return{exitCode:1,stdout:y,stderr:x(`split: invalid number of bytes: '${n[i+1]}'
465
+ `)};r.mode="bytes",r.bytes=f,i+=2}else if(u.match(/^-b.+$/)){let f=rh(u.slice(2));if(f===null)return{exitCode:1,stdout:y,stderr:x(`split: invalid number of bytes: '${u.slice(2)}'
466
+ `)};r.mode="bytes",r.bytes=f,i++}else if(u==="-n"&&i+1<n.length){let f=Number.parseInt(n[i+1],10);if(Number.isNaN(f)||f<1)return{exitCode:1,stdout:y,stderr:x(`split: invalid number of chunks: '${n[i+1]}'
467
+ `)};r.mode="chunks",r.chunks=f,i+=2}else if(u.match(/^-n\d+$/)){let f=Number.parseInt(u.slice(2),10);if(Number.isNaN(f)||f<1)return{exitCode:1,stdout:y,stderr:x(`split: invalid number of chunks: '${u.slice(2)}'
468
+ `)};r.mode="chunks",r.chunks=f,i++}else if(u==="-a"&&i+1<n.length){let f=Number.parseInt(n[i+1],10);if(Number.isNaN(f)||f<1)return{exitCode:1,stdout:y,stderr:x(`split: invalid suffix length: '${n[i+1]}'
469
+ `)};r.suffixLength=f,i+=2}else if(u.match(/^-a\d+$/)){let f=Number.parseInt(u.slice(2),10);if(Number.isNaN(f)||f<1)return{exitCode:1,stdout:y,stderr:x(`split: invalid suffix length: '${u.slice(2)}'
470
+ `)};r.suffixLength=f,i++}else if(u==="-d"||u==="--numeric-suffixes")r.useNumericSuffix=!0,i++;else if(u.startsWith("--additional-suffix="))r.additionalSuffix=u.slice(20),i++;else if(u==="--additional-suffix"&&i+1<n.length)r.additionalSuffix=n[i+1],i+=2;else if(u==="--"){s.push(...n.slice(i+1));break}else{if(u.startsWith("-")&&u!=="-")return oe("split",u);s.push(u),i++}}let o="-",a="x";s.length>=1&&(o=s[0]),s.length>=2&&(a=s[1]);let l;if(o==="-")l=R(e.stdin);else{let u=e.fs.resolvePath(e.cwd,o),f=await e.fs.readFile(u);if(f===null)return{exitCode:1,stdout:y,stderr:x(`split: ${o}: No such file or directory
471
+ `)};l=f}if(l==="")return{exitCode:0,stdout:y,stderr:y};let c;switch(r.mode){case"lines":c=Z8(l,r.lines);break;case"bytes":c=Y8(l,r.bytes);break;case"chunks":c=Q8(l,r.chunks);break;default:return r.mode}for(let u=0;u<c.length;u++){let f=c[u];if(!f.hasContent)continue;let p=q8(u,r.useNumericSuffix,r.suffixLength),h=`${a}${p}${r.additionalSuffix}`,m=e.fs.resolvePath(e.cwd,h);await e.fs.writeFile(m,f.content)}return{exitCode:0,stdout:y,stderr:y}}},X8={name:"split",flags:[{flag:"-l",type:"value",valueHint:"number"},{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-d",type:"boolean"},{flag:"-a",type:"value",valueHint:"number"}],needsFiles:!0}});var ah={};se(ah,{column:()=>s9,flagsForFuzzing:()=>i9});function oh(t,e,n){return e?n?t.split(e):t.split(e).filter(r=>r.length>0):n?t.split(/[ \t]/):t.split(/[ \t]+/).filter(r=>r.length>0)}function t9(t){let e=[];for(let n of t)for(let r=0;r<n.length;r++){let s=n[r].length;(e[r]===void 0||s>e[r])&&(e[r]=s)}return e}function n9(t,e){if(t.length===0)return"";let n=t9(t),r=[];for(let s of t){let i=[];for(let o=0;o<s.length;o++)o===s.length-1?i.push(s[o]):i.push(s[o].padEnd(n[o]));r.push(i.join(e))}return r.join(`
472
+ `)}function r9(t,e,n){if(t.length===0)return"";let r=Math.max(...t.map(c=>c.length)),s=n.length,i=r+s,o=Math.max(1,Math.floor((e+s)/i)),a=Math.ceil(t.length/o),l=[];for(let c=0;c<a;c++){let u=[];for(let f=0;f<o;f++){let p=f*a+c;p<t.length&&(f===o-1||(f+1)*a+c>=t.length?u.push(t[p]):u.push(t[p].padEnd(r)))}l.push(u.join(n))}return l.join(`
473
+ `)}var J8,e9,s9,i9,lh=I(()=>{"use strict";nt();F();he();J8={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},e9={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};s9={name:"column",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(J8);let r=ke("column",n,e9);if(!r.ok)return r.error;let{table:s,separator:i,outputSep:o,width:a,noMerge:l}=r.result.flags,c=r.result.positional,u=o??" ",f;if(c.length===0)f=R(e.stdin);else{let g=[];for(let w of c)if(w==="-")g.push(R(e.stdin));else{let E=e.fs.resolvePath(e.cwd,w),b=await e.fs.readFile(E);if(b===null)return{exitCode:1,stdout:y,stderr:x(`column: ${w}: No such file or directory
474
+ `)};g.push(b)}f=g.join("")}if(f===""||f.trim()==="")return{exitCode:0,stdout:y,stderr:y};let p=f.split(`
475
+ `);f.endsWith(`
476
+ `)&&p[p.length-1]===""&&p.pop();let m=p.filter(g=>g.trim().length>0),d;if(s){let g=m.map(w=>oh(w,i,l));d=n9(g,u)}else{let g=[];for(let w of m){let E=oh(w,i,l);g.push(...E)}d=r9(g,a,u)}return d.length>0&&(d+=`
477
+ `),{exitCode:0,stdout:x(d),stderr:y}}},i9={name:"column",flags:[{flag:"-t",type:"boolean"},{flag:"-s",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-n",type:"boolean"}],stdinType:"text",needsFiles:!0}});var ch={};se(ch,{flagsForFuzzing:()=>f9,join:()=>u9});function a9(t,e){return e?t.split(e):t.split(/[ \t]+/).filter(n=>n.length>0)}function l9(t,e,n,r){let s=a9(t,e),i=s[n-1]??"";return r&&(i=i.toLowerCase()),{fields:s,joinKey:i,original:t}}function Ya(t,e,n){let r=n.separator??" ";if(n.outputFormat){let o=[];for(let{file:a,field:l}of n.outputFormat){let c=a===1?t:e;c&&l===0?o.push(c.joinKey):c&&c.fields[l-1]!==void 0?o.push(c.fields[l-1]):o.push(n.emptyString)}return o.join(r)}let s=[],i=t?.joinKey??e?.joinKey??"";if(s.push(i),t)for(let o=0;o<t.fields.length;o++)o!==n.field1-1&&s.push(t.fields[o]);if(e)for(let o=0;o<e.fields.length;o++)o!==n.field2-1&&s.push(e.fields[o]);return s.join(r)}function c9(t){let e=t.split(","),n=[];for(let r of e){let s=r.trim().match(/^(\d+)\.(\d+)$/);if(!s)return null;let i=Number.parseInt(s[1],10),o=Number.parseInt(s[2],10);if(i!==1&&i!==2)return null;n.push({file:i,field:o})}return n}var o9,u9,f9,uh=I(()=>{"use strict";F();he();o9={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};u9={name:"join",execute:async(t,e)=>{let n=W(t);if(Z(n))return q(o9);let r={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},s=[],i=0;for(;i<n.length;){let h=n[i];if(h==="-1"&&i+1<n.length){let m=Number.parseInt(n[i+1],10);if(Number.isNaN(m)||m<1)return{exitCode:1,stdout:y,stderr:x(`join: invalid field number: '${n[i+1]}'
478
+ `)};r.field1=m,i+=2}else if(h==="-2"&&i+1<n.length){let m=Number.parseInt(n[i+1],10);if(Number.isNaN(m)||m<1)return{exitCode:1,stdout:y,stderr:x(`join: invalid field number: '${n[i+1]}'
479
+ `)};r.field2=m,i+=2}else if((h==="-t"||h==="--field-separator")&&i+1<n.length)r.separator=n[i+1],i+=2;else if(h.startsWith("-t")&&h.length>2)r.separator=h.slice(2),i++;else if(h==="-a"&&i+1<n.length){let m=Number.parseInt(n[i+1],10);if(m!==1&&m!==2)return{exitCode:1,stdout:y,stderr:x(`join: invalid file number: '${n[i+1]}'
480
+ `)};r.printUnpairable.add(m),i+=2}else if(h.match(/^-a[12]$/))r.printUnpairable.add(Number.parseInt(h[2],10)),i++;else if(h==="-v"&&i+1<n.length){let m=Number.parseInt(n[i+1],10);if(m!==1&&m!==2)return{exitCode:1,stdout:y,stderr:x(`join: invalid file number: '${n[i+1]}'
481
+ `)};r.onlyUnpairable.add(m),i+=2}else if(h.match(/^-v[12]$/))r.onlyUnpairable.add(Number.parseInt(h[2],10)),i++;else if(h==="-e"&&i+1<n.length)r.emptyString=n[i+1],i+=2;else if(h==="-o"&&i+1<n.length){let m=c9(n[i+1]);if(!m)return{exitCode:1,stdout:y,stderr:x(`join: invalid field spec: '${n[i+1]}'
482
+ `)};r.outputFormat=m,i+=2}else if(h==="-i"||h==="--ignore-case")r.ignoreCase=!0,i++;else if(h==="--"){s.push(...n.slice(i+1));break}else{if(h.startsWith("-")&&h!=="-")return oe("join",h);s.push(h),i++}}if(s.length!==2)return{exitCode:1,stdout:y,stderr:x(s.length<2?`join: missing file operand
483
+ `:`join: extra operand
484
+ `)};let o=[];for(let h of s)if(h==="-")o.push(R(e.stdin));else{let m=e.fs.resolvePath(e.cwd,h),d=await e.fs.readFile(m);if(d===null)return{exitCode:1,stdout:y,stderr:x(`join: ${h}: No such file or directory
485
+ `)};o.push(d)}let a=(h,m)=>{let d=h.split(`
486
+ `);return h.endsWith(`
487
+ `)&&d[d.length-1]===""&&d.pop(),d.filter(g=>g.length>0).map(g=>l9(g,r.separator,m,r.ignoreCase))},l=a(o[0],r.field1),c=a(o[1],r.field2),u=new Map;for(let h of c){let m=u.get(h.joinKey);m?m.push(h):u.set(h.joinKey,[h])}let f=[],p=new Set;for(let h of l){let m=u.get(h.joinKey);if(m&&m.length>0){if(p.add(h.joinKey),r.onlyUnpairable.size===0)for(let d of m)f.push(Ya(h,d,r))}else(r.printUnpairable.has(1)||r.onlyUnpairable.has(1))&&f.push(Ya(h,null,r))}if(r.printUnpairable.has(2)||r.onlyUnpairable.has(2))for(let h of c)p.has(h.joinKey)||f.push(Ya(null,h,r));return{exitCode:0,stdout:x(f.length>0?`${f.join(`
488
+ `)}
489
+ `:""),stderr:y}}},f9={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2}});var fh={};se(fh,{flagsForFuzzing:()=>m9,teeCommand:()=>d9});var p9,h9,d9,m9,ph=I(()=>{"use strict";nt();F();he();p9={name:"tee",summary:"read from stdin and write to stdout and files",usage:"tee [OPTION]... [FILE]...",options:["-a, --append append to the given FILEs, do not overwrite"," --help display this help and exit"]},h9={append:{short:"a",long:"append",type:"boolean"}},d9={name:"tee",async execute(t,e){let n=W(t);if(Z(n))return q(p9);let r=ke("tee",n,h9);if(!r.ok)return r.error;let{append:s}=r.result.flags,i=r.result.positional,o=R(e.stdin),a="",l=0;for(let c of i)try{let u=e.fs.resolvePath(e.cwd,c);s?await e.fs.appendFile(u,o):await e.fs.writeFile(u,o)}catch{a+=`tee: ${c}: No such file or directory
490
+ `,l=1}return{stdout:x(o),stderr:x(a),exitCode:l}}},m9={name:"tee",flags:[{flag:"-a",type:"boolean"}],stdinType:"text",needsArgs:!0}});function rn(t,e){switch(t.type){case"name":{let n=t.pattern,r=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let s=r[1],i=e.name;if(t.ignoreCase){if(!i.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!i.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Ot(e.name,n,t.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=t.pattern,r=e.relativePath,s=n.split("/");for(let o=0;o<s.length-1;o++){let a=s[o];if(a&&a!=="."&&a!==".."&&!a.includes("*")&&!a.includes("?")&&!a.includes("[")){let l=`/${a}/`;if(t.ignoreCase){if(!r.toLowerCase().includes(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(l))return{matches:!1,pruned:!1,printed:!1}}}let i=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(i){let o=i[1];if(t.ignoreCase){if(!r.toLowerCase().endsWith(o.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(o))return{matches:!1,pruned:!1,printed:!1}}return{matches:Ot(r,n,t.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=t.ignoreCase?"i":"";return{matches:ee(t.pattern,n).test(e.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return t.fileType==="f"?{matches:e.isFile,pruned:!1,printed:!1}:t.fileType==="d"?{matches:e.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:e.isEmpty,pruned:!1,printed:!1};case"mtime":{let r=(Date.now()-e.mtime)/(1e3*60*60*24),s;return t.comparison==="more"?s=r>t.days:t.comparison==="less"?s=r<t.days:s=Math.floor(r)===t.days,{matches:s,pruned:!1,printed:!1}}case"newer":{let n=e.newerRefTimes.get(t.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:e.mtime>n,pruned:!1,printed:!1}}case"size":{let n=t.value;switch(t.unit){case"c":n=t.value;break;case"k":n=t.value*1024;break;case"M":n=t.value*1024*1024;break;case"G":n=t.value*1024*1024*1024;break;case"b":n=t.value*512;break}let r;return t.comparison==="more"?r=e.size>n:t.comparison==="less"?r=e.size<n:t.unit==="b"?r=Math.ceil(e.size/512)===t.value:r=e.size===n,{matches:r,pruned:!1,printed:!1}}case"perm":{let n=e.mode&511,r=t.mode&511,s;return t.matchType==="exact"?s=n===r:t.matchType==="all"?s=(n&r)===r:s=(n&r)!==0,{matches:s,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=rn(t.expr,e);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=rn(t.left,e);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let r=rn(t.right,e);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:n.printed||r.printed}}case"or":{let n=rn(t.left,e);if(n.matches)return n;let r=rn(t.right,e);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:r.printed}}}}function Ns(t){if(!t)return!1;switch(t.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return Ns(t.expr);case"and":case"or":return Ns(t.left)||Ns(t.right)}}function vs(t){if(!t)return!1;switch(t.type){case"empty":return!0;case"not":return vs(t.expr);case"and":case"or":return vs(t.left)||vs(t.right);default:return!1}}function hh(t){let e={terminalDirName:null,requiredExtension:null};if(!t)return e;let n=g9(t);if(y9(t)&&n.length===1){let i=n[0].split("/").filter(o=>o.length>0);if(i.length>=2)for(let o=i.length-2;o>=0;o--){let a=i[o];if(!a.includes("*")&&!a.includes("?")&&!a.includes("[")&&a!=="."&&a!==".."){let l=i[o+1];if(l&&(l.includes("*")||l.includes("?"))){e.terminalDirName=a;let c=l.match(/^\*(\.[a-zA-Z0-9]+)$/);c&&(e.requiredExtension=c[1])}break}}}return e}function g9(t){let e=[],n=r=>{r.type==="path"?e.push(r.pattern):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right))};return n(t),e}function y9(t){let e=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?e(n.expr):n.type==="and"||n.type==="or"?e(n.left)||e(n.right):!1;return e(t)}function dh(t){let e=[],n=r=>{r&&(r.type==="newer"?e.push(r.refPath):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right)))};return n(t),e}function ks(t){if(!t)return!0;switch(t.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return ks(t.expr);case"and":case"or":return ks(t.left)&&ks(t.right)}}function ur(t,e,n,r,s){switch(t.type){case"name":{let i=t.pattern,o=i.match(/^\*(\.[a-zA-Z0-9]+)$/);if(o){let a=o[1];if(t.ignoreCase){if(!e.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!e.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Ot(e,i,t.ignoreCase),pruned:!1,printed:!1}}case"path":{let i=t.pattern,o=i.split("/");for(let l=0;l<o.length-1;l++){let c=o[l];if(c&&c!=="."&&c!==".."&&!c.includes("*")&&!c.includes("?")&&!c.includes("[")){let u=`/${c}/`;if(t.ignoreCase){if(!n.toLowerCase().includes(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(u))return{matches:!1,pruned:!1,printed:!1}}}let a=i.match(/\*(\.[a-zA-Z0-9]+)$/);if(a){let l=a[1];if(t.ignoreCase){if(!n.toLowerCase().endsWith(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(l))return{matches:!1,pruned:!1,printed:!1}}return{matches:Ot(n,i,t.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let i=t.ignoreCase?"i":"";return{matches:ee(t.pattern,i).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return t.fileType==="f"?{matches:r,pruned:!1,printed:!1}:t.fileType==="d"?{matches:s,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let i=ur(t.expr,e,n,r,s);return{matches:!i.matches,pruned:i.pruned,printed:!1}}case"and":{let i=ur(t.left,e,n,r,s);if(!i.matches)return{matches:!1,pruned:i.pruned,printed:!1};let o=ur(t.right,e,n,r,s);return{matches:o.matches,pruned:i.pruned||o.pruned,printed:i.printed||o.printed}}case"or":{let i=ur(t.left,e,n,r,s);if(i.matches)return i;let o=ur(t.right,e,n,r,s);return{matches:o.matches,pruned:i.pruned||o.pruned,printed:o.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function Is(t){if(!t)return!1;switch(t.type){case"prune":return!0;case"not":return Is(t.expr);case"and":case"or":return Is(t.left)||Is(t.right);default:return!1}}function zn(t){switch(t.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return zn(t.expr);case"and":case"or":return zn(t.left)&&zn(t.right)}}function mh(t,e){if(!t||!e.isDirectory)return{shouldPrune:!1};if(!zn(t))return Qa(t,e);let n={name:e.name,relativePath:e.relativePath,isFile:e.isFile,isDirectory:e.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:rn(t,n).pruned}}function Qa(t,e){switch(t.type){case"or":{if(zn(t.left)){let n={name:e.name,relativePath:e.relativePath,isFile:e.isFile,isDirectory:e.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(rn(t.left,n).pruned)return{shouldPrune:!0}}return Qa(t.right,e)}case"and":{if(zn(t.left)&&zn(t.right)){let n={name:e.name,relativePath:e.relativePath,isFile:e.isFile,isDirectory:e.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:rn(t,n).pruned}}if(zn(t.left)){let n={name:e.name,relativePath:e.relativePath,isFile:e.isFile,isDirectory:e.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return rn(t.left,n).matches?Qa(t.right,e):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}var gh=I(()=>{"use strict";Ve();Aa()});function yh(t,e){let n=[],r=[],s=e;for(;s<t.length;){let o=t[s];if(o==="("||o==="\\("){n.push({type:"lparen"}),s++;continue}if(o===")"||o==="\\)"){n.push({type:"rparen"}),s++;continue}if(o==="-name"&&s+1<t.length)n.push({type:"expr",expr:{type:"name",pattern:t[++s]}});else if(o==="-iname"&&s+1<t.length)n.push({type:"expr",expr:{type:"name",pattern:t[++s],ignoreCase:!0}});else if(o==="-path"&&s+1<t.length)n.push({type:"expr",expr:{type:"path",pattern:t[++s]}});else if(o==="-ipath"&&s+1<t.length)n.push({type:"expr",expr:{type:"path",pattern:t[++s],ignoreCase:!0}});else if(o==="-regex"&&s+1<t.length)n.push({type:"expr",expr:{type:"regex",pattern:t[++s]}});else if(o==="-iregex"&&s+1<t.length)n.push({type:"expr",expr:{type:"regex",pattern:t[++s],ignoreCase:!0}});else if(o==="-type"&&s+1<t.length){let a=t[++s];if(a==="f"||a==="d")n.push({type:"expr",expr:{type:"type",fileType:a}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${a}
491
+ `,actions:[]}}else if(o==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(o==="-mtime"&&s+1<t.length){let a=t[++s],l="exact",c=a;a.startsWith("+")?(l="more",c=a.slice(1)):a.startsWith("-")&&(l="less",c=a.slice(1));let u=parseInt(c,10);Number.isNaN(u)||n.push({type:"expr",expr:{type:"mtime",days:u,comparison:l}})}else if(o==="-newer"&&s+1<t.length){let a=t[++s];n.push({type:"expr",expr:{type:"newer",refPath:a}})}else if(o==="-size"&&s+1<t.length){let a=t[++s],l="exact",c=a;a.startsWith("+")?(l="more",c=a.slice(1)):a.startsWith("-")&&(l="less",c=a.slice(1));let u=c.match(/^(\d+)([ckMGb])?$/);if(u){let f=parseInt(u[1],10),p=u[2]||"b";n.push({type:"expr",expr:{type:"size",value:f,unit:p,comparison:l}})}}else if(o==="-perm"&&s+1<t.length){let a=t[++s],l="exact",c=a;a.startsWith("-")?(l="all",c=a.slice(1)):a.startsWith("/")&&(l="any",c=a.slice(1));let u=parseInt(c,8);Number.isNaN(u)||n.push({type:"expr",expr:{type:"perm",mode:u,matchType:l}})}else if(o==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(o==="-not"||o==="!")n.push({type:"not"});else if(o==="-o"||o==="-or")n.push({type:"op",op:"or"});else if(o==="-a"||o==="-and")n.push({type:"op",op:"and"});else if(o==="-maxdepth"||o==="-mindepth")s++;else if(o!=="-depth")if(o==="-exec"){let a=[];for(s++;s<t.length&&t[s]!==";"&&t[s]!=="+";)a.push(t[s]),s++;if(s>=t.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let l=t[s]==="+";r.push({type:"exec",command:a,batchMode:l})}else if(o==="-print")n.push({type:"expr",expr:{type:"print"}}),r.push({type:"print"});else if(o==="-print0")r.push({type:"print0"});else if(o==="-printf"&&s+1<t.length){let a=t[++s];r.push({type:"printf",format:a})}else if(o==="-delete")r.push({type:"delete"});else{if(o.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${o}'
492
+ `,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:r};let i=w9(n);return i.error?{expr:null,pathIndex:s,error:i.error,actions:r}:{expr:i.expr,pathIndex:s,actions:r}}function w9(t){let e=0;function n(){let a=r();if(!a)return null;for(;e<t.length;){let l=t[e];if(l.type==="op"&&l.op==="or"){e++;let c=r();if(!c)return a;a={type:"or",left:a,right:c}}else break}return a}function r(){let a=s();if(!a)return null;for(;e<t.length;){let l=t[e];if(l.type==="op"&&l.op==="and"){e++;let c=s();if(!c)return a;a={type:"and",left:a,right:c}}else if(l.type==="expr"||l.type==="not"||l.type==="lparen"){let c=s();if(!c)return a;a={type:"and",left:a,right:c}}else break}return a}function s(){if(e<t.length&&t[e].type==="not"){e++;let a=s();return a?{type:"not",expr:a}:null}return i()}function i(){if(e>=t.length)return null;let a=t[e];if(a.type==="lparen"){e++;let l=n();return e<t.length&&t[e].type==="rparen"&&e++,l}return a.type==="expr"?(e++,a.expr):(a.type==="rparen",null)}return{expr:n()}}var wh=I(()=>{"use strict"});var xh={};se(xh,{findCommand:()=>S9,flagsForFuzzing:()=>I9});function b9(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function x9(t,e,n){t({category:"find",name:"summary",durationMs:n,details:{readdirCalls:e.readdirCalls,readdirTimeMs:e.readdirTime,statCalls:e.statCalls,statTimeMs:e.statTime,evalCalls:e.evalCalls,evalTimeMs:e.evalTime,nodeCount:e.nodeCount,batchCount:e.batchCount,batchTimeMs:e.batchTime,earlyPrunes:e.earlyPrunes,otherTimeMs:n-e.readdirTime-e.statTime-e.evalTime-e.batchTime}})}function C9(t,e){let n=Wu(t),r="",s=0;for(;s<n.length;)if(n[s]==="%"&&s+1<n.length){if(s++,n[s]==="%"){r+="%",s++;continue}let[i,o,a]=Uu(n,s);if(s+=a,s>=n.length){r+="%";break}let l=n[s],c;switch(l){case"f":c=e.name,s++;break;case"h":{let u=e.path.lastIndexOf("/");c=u>0?e.path.slice(0,u):".",s++;break}case"p":c=e.path,s++;break;case"P":{let u=e.startingPoint;e.path===u?c="":e.path.startsWith(`${u}/`)?c=e.path.slice(u.length+1):u==="."&&e.path.startsWith("./")?c=e.path.slice(2):c=e.path,s++;break}case"s":c=String(e.size),s++;break;case"d":c=String(e.depth),s++;break;case"m":c=(e.mode&511).toString(8),s++;break;case"M":c=N9(e.mode,e.isDirectory),s++;break;case"t":{let u=new Date(e.mtime);c=v9(u),s++;break}case"T":{if(s+1<n.length){let u=n[s+1],f=new Date(e.mtime);c=k9(f,u),s+=2}else c="%T",s++;break}default:r+=`%${i!==0||o!==-1?`${i}.${o}`:""}${l}`,s++;continue}r+=oi(c,i,o)}else r+=n[s],s++;return r}function N9(t,e){let n=t&511,r=e?"d":"-";return r+=n&256?"r":"-",r+=n&128?"w":"-",r+=n&64?"x":"-",r+=n&32?"r":"-",r+=n&16?"w":"-",r+=n&8?"x":"-",r+=n&4?"r":"-",r+=n&2?"w":"-",r+=n&1?"x":"-",r}function v9(t){let e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=e[t.getDay()],s=n[t.getMonth()],i=String(t.getDate()).padStart(2," "),o=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0"),c=t.getFullYear();return`${r} ${s} ${i} ${o}:${a}:${l} ${c}`}function k9(t,e){switch(e){case"@":return String(t.getTime()/1e3);case"Y":return String(t.getFullYear());case"m":return String(t.getMonth()+1).padStart(2,"0");case"d":return String(t.getDate()).padStart(2,"0");case"H":return String(t.getHours()).padStart(2,"0");case"M":return String(t.getMinutes()).padStart(2,"0");case"S":return String(t.getSeconds()).padStart(2,"0");case"T":return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`;case"F":return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;default:return`%T${e}`}}var bh,E9,A9,S9,I9,Eh=I(()=>{"use strict";F();he();na();gh();wh();bh=500;E9={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},A9=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),S9={name:"find",async execute(t,e){let n=W(t);if(Z(n))return q(E9);let r=[],s=null,i=null,o=!1,a=!1;for(let D=0;D<n.length;D++){let v=n[D];if(v==="-maxdepth"&&D+1<n.length)a=!0,s=parseInt(n[++D],10);else if(v==="-mindepth"&&D+1<n.length)a=!0,i=parseInt(n[++D],10);else if(v==="-depth")a=!0,o=!0;else if(v==="-exec")for(a=!0,D++;D<n.length&&n[D]!==";"&&n[D]!=="+";)D++;else!v.startsWith("-")&&v!==";"&&v!=="+"&&v!=="("&&v!==")"&&v!=="\\("&&v!=="\\)"&&v!=="!"?a||r.push(v):A9.has(v)?(a=!0,D++):(v.startsWith("-")||v==="("||v==="\\("||v==="!")&&(a=!0)}r.length===0&&r.push(".");let{expr:l,error:c,actions:u}=yh(n,0);if(c)return{stdout:y,stderr:x(c),exitCode:1};let f=u.some(D=>D.type==="print"),p=u.length===0,h=[],m=u.some(D=>D.type==="printf"),d=[],g="",w=0,E=dh(l),b=new Map;for(let D of E){let v=e.fs.resolvePath(e.cwd,D);try{let _=await e.fs.stat(v);b.set(D,_.mtime?.getTime()??Date.now())}catch{}}let A=u.some(D=>{if(D.type!=="printf")return!1;let v=D.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(v)}),N=Ns(l)||A,P=vs(l),O=hh(l),G=Is(l),M=ks(l),Y=typeof e.fs.readdirWithFileTypes=="function";for(let D of r){let J=function(Q){let De=i===null||Q.depth>=i,xe=!1;if(De&&l!==null){let ne=Date.now(),je;if(M)je=ur(l,Q.name,Q.relativePath,Q.isFile,Q.isDirectory);else{let Ge={name:Q.name,relativePath:Q.relativePath,isFile:Q.isFile,isDirectory:Q.isDirectory,isEmpty:Q.isEmpty,mtime:Q.stat?.mtime?.getTime()??Date.now(),size:Q.stat?.size??0,mode:Q.stat?.mode??420,newerRefTimes:b};je=rn(l,Ge)}De=je.matches,xe=f?je.printed:De,_.evalCalls++,_.evalTime+=Date.now()-ne}else De&&(xe=!0);return xe?{print:!0,printfData:m?{path:Q.relativePath,name:Q.name,size:Q.stat?.size??0,mtime:Q.stat?.mtime?.getTime()??Date.now(),mode:Q.stat?.mode??420,isDirectory:Q.isDirectory,depth:Q.depth,startingPoint:D}:null}:{print:!1,printfData:null}};var L=J;D.length>1&&D.endsWith("/")&&(D=D.slice(0,-1));let v=e.fs.resolvePath(e.cwd,D);try{await e.fs.stat(v)}catch{g+=`find: ${D}: No such file or directory
493
+ `,w=1;continue}let _=b9(),H=Date.now();async function pe(Q){let{path:fe,depth:De,typeInfo:xe}=Q;if(_.nodeCount++,s!==null&&De>s)return null;let Re,ne,je;if(xe&&!N)Re=xe.isFile,ne=xe.isDirectory;else{try{let Jn=Date.now();je=await e.fs.stat(fe),_.statCalls++,_.statTime+=Date.now()-Jn}catch{return null}if(!je)return null;Re=je.isFile,ne=je.isDirectory}let Ge;fe===v?Ge=D.split("/").pop()||D:Ge=fe.split("/").pop()||"";let Xe=fe===v?D:D==="."?`./${fe.slice(v==="/"?v.length:v.length+1)}`:D+fe.slice(v.length),lt=[],pt=null,ct=null,ut=!1;ne&&G&&!o&&(ut=mh(l,{name:Ge,relativePath:Xe,isFile:Re,isDirectory:ne}).shouldPrune,ut&&_.earlyPrunes++);let qt=s!==null&&De>=s,Zt=O.terminalDirName!==null&&Ge===O.terminalDirName,hs=!qt&&!Zt&&!ut;if(ne&&((hs||P||Zt)&&!ut)){let Jn=Date.now();if(Y&&e.fs.readdirWithFileTypes){if(pt=await e.fs.readdirWithFileTypes(fe),ct=pt.map(_t=>_t.name),_.readdirCalls++,_.readdirTime+=Date.now()-Jn,hs)lt=pt.map((_t,en)=>({path:fe==="/"?`/${_t.name}`:`${fe}/${_t.name}`,depth:De+1,typeInfo:{isFile:_t.isFile,isDirectory:_t.isDirectory},resultIndex:en}));else if(Zt){let _t=O.requiredExtension;lt=pt.filter(en=>en.isFile&&(!_t||en.name.endsWith(_t))).map((en,a7)=>({path:fe==="/"?`/${en.name}`:`${fe}/${en.name}`,depth:De+1,typeInfo:{isFile:en.isFile,isDirectory:en.isDirectory},resultIndex:a7}))}}else ct=await e.fs.readdir(fe),_.readdirCalls++,_.readdirTime+=Date.now()-Jn,hs&&(lt=ct.map((_t,en)=>({path:fe==="/"?`/${_t}`:`${fe}/${_t}`,depth:De+1,resultIndex:en})))}let ti=Re?(je?.size??0)===0:ct!==null&&ct.length===0,Nr=ut;if(!o&&l!==null&&!ut&&G){let Jn=Date.now(),_t={name:Ge,relativePath:Xe,isFile:Re,isDirectory:ne,isEmpty:ti,mtime:je?.mtime?.getTime()??Date.now(),size:je?.size??0,mode:je?.mode??420,newerRefTimes:b};Nr=rn(l,_t).pruned,_.evalCalls++,_.evalTime+=Date.now()-Jn}return{relativePath:Xe,name:Ge,isFile:Re,isDirectory:ne,isEmpty:ti,stat:je,depth:De,children:Nr?[]:lt,pruned:Nr}}async function ce(){let Q={paths:[],printfData:[]};if(o){let je=function(Ge){let Xe={paths:[],printfData:[]},lt=xe[Ge];if(!lt)return Xe;for(let ut of lt.childIndices){let qt=je(ut);Xe.paths.push(...qt.paths),Xe.printfData.push(...qt.printfData)}let{print:pt,printfData:ct}=J(lt.node);return pt&&(Xe.paths.push(lt.node.relativePath),ct&&Xe.printfData.push(ct)),Xe};var fe=je;let xe=[],Re=[{item:{path:v,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],ne=new Map;for(;Re.length>0;){let Ge=Date.now(),Xe=Re.splice(0,bh),lt=await Promise.all(Xe.map(pt=>pe(pt.item)));_.batchCount++,_.batchTime+=Date.now()-Ge;for(let pt=0;pt<Xe.length;pt++){let ct=lt[pt],ut=Xe[pt];if(!ct)continue;let qt=xe.length;if(ut.parentIndex>=0){let Zt=ne.get(ut.parentIndex)||[];Zt.push(qt),ne.set(ut.parentIndex,Zt)}xe.push({node:ct,parentIndex:ut.parentIndex,childIndices:[]});for(let Zt=0;Zt<ct.children.length;Zt++)Re.push({item:ct.children[Zt],parentIndex:qt,childOrderInParent:Zt})}}for(let[Ge,Xe]of ne)Ge>=0&&Ge<xe.length&&(xe[Ge].childIndices=Xe);if(xe.length>0){let Ge=je(0);Q.paths.push(...Ge.paths),Q.printfData.push(...Ge.printfData)}}else{let Ge=function(Xe){let lt=xe.get(Xe);lt&&(Q.paths.push(lt.path),lt.printfData&&Q.printfData.push(lt.printfData));let pt=je.get(Xe);if(pt)for(let ct of pt)Ge(ct)};var De=Ge;let xe=new Map,Re=0,ne=[{item:{path:v,depth:0,resultIndex:0},orderIndex:Re++}],je=new Map;for(;ne.length>0;){let Xe=Date.now(),lt=ne.splice(0,bh),pt=await Promise.all(lt.map(async({item:ct,orderIndex:ut})=>{let qt=await pe(ct);return qt?{node:qt,orderIndex:ut}:null}));_.batchCount++,_.batchTime+=Date.now()-Xe;for(let ct of pt){if(!ct)continue;let{node:ut,orderIndex:qt}=ct,{print:Zt,printfData:hs}=J(ut);if(Zt&&xe.set(qt,{path:ut.relativePath,printfData:hs}),ut.children.length>0){let Jo=[];for(let ti of ut.children){let Nr=Re++;Jo.push(Nr),ne.push({item:ti,orderIndex:Nr})}je.set(qt,Jo)}}}Ge(0)}return Q}let we=await ce();if(h.push(...we.paths),d.push(...we.printfData),e.trace){let Q=Date.now()-H;x9(e.trace,_,Q),e.trace({category:"find",name:"searchPath",durationMs:Q,details:{path:D,resultsFound:we.paths.length}})}}let B="";if(u.length>0)for(let D of u)switch(D.type){case"print":B+=h.length>0?`${h.join(`
494
+ `)}
495
+ `:"";break;case"print0":B+=h.length>0?`${h.join("\0")}\0`:"";break;case"delete":{let v=[...h].sort((_,H)=>H.length-_.length);for(let _ of v){let H=e.fs.resolvePath(e.cwd,_);try{await e.fs.rm(H,{recursive:!1})}catch(pe){let J=pe instanceof Error?pe.message:String(pe);g+=`find: cannot delete '${_}': ${J}
496
+ `,w=1}}break}case"printf":for(let v of d)B+=C9(D.format,v);break;case"exec":if(!e.exec)return{stdout:y,stderr:x(`find: -exec not supported in this context
497
+ `),exitCode:1};if(D.batchMode){let v=[];for(let pe of D.command)pe==="{}"?v.push(...h):v.push(pe);let _=v.map(pe=>`"${pe}"`).join(" "),H=await e.exec(_,{cwd:e.cwd});B+=R(H.stdout),g+=R(H.stderr),H.exitCode!==0&&(w=H.exitCode)}else for(let v of h){let H=D.command.map(J=>J==="{}"?v:J).map(J=>`"${J}"`).join(" "),pe=await e.exec(H,{cwd:e.cwd});B+=R(pe.stdout),g+=R(pe.stderr),pe.exitCode!==0&&(w=pe.exitCode)}break}else p&&(B=h.length>0?`${h.join(`
498
+ `)}
499
+ `:"");return{stdout:x(B),stderr:x(g),exitCode:w}}};I9={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0}});var Ah={};se(Ah,{basenameCommand:()=>O9,flagsForFuzzing:()=>R9});var T9,O9,R9,Sh=I(()=>{"use strict";F();he();T9={name:"basename",summary:"strip directory and suffix from filenames",usage:`basename NAME [SUFFIX]
500
+ basename OPTION... NAME...`,options:["-a, --multiple support multiple arguments","-s, --suffix=SUFFIX remove a trailing SUFFIX"," --help display this help and exit"]},O9={name:"basename",async execute(t,e){let n=W(t);if(Z(n))return q(T9);let r=!1,s="",i=[];for(let a=0;a<n.length;a++){let l=n[a];l==="-a"||l==="--multiple"?r=!0:l==="-s"&&a+1<n.length?(s=n[++a],r=!0):l.startsWith("--suffix=")?(s=l.slice(9),r=!0):l.startsWith("-")||i.push(l)}if(i.length===0)return{stdout:y,stderr:x(`basename: missing operand
501
+ `),exitCode:1};!r&&i.length>=2&&(s=i.pop()??"");let o=[];for(let a of i){let l=a.replace(/\/+$/,""),c=l.split("/").pop()||l;s&&c.endsWith(s)&&(c=c.slice(0,-s.length)),o.push(c)}return{stdout:x(`${o.join(`
502
+ `)}
503
+ `),stderr:y,exitCode:0}}},R9={name:"basename",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"value",valueHint:"string"}],needsArgs:!0}});var Ch={};se(Ch,{dirnameCommand:()=>$9,flagsForFuzzing:()=>D9});var P9,$9,D9,Nh=I(()=>{"use strict";F();he();P9={name:"dirname",summary:"strip last component from file name",usage:"dirname [OPTION] NAME...",options:[" --help display this help and exit"]},$9={name:"dirname",async execute(t,e){let n=W(t);if(Z(n))return q(P9);let r=n.filter(i=>!i.startsWith("-"));if(r.length===0)return{stdout:y,stderr:x(`dirname: missing operand
504
+ `),exitCode:1};let s=[];for(let i of r){let o=i.replace(/\/+$/,""),a=o.lastIndexOf("/");a===-1?s.push("."):a===0?s.push("/"):s.push(o.slice(0,a))}return{stdout:x(`${s.join(`
505
+ `)}
506
+ `),stderr:y,exitCode:0}}},D9={name:"dirname",flags:[],needsArgs:!0}});var kh={};se(kh,{flagsForFuzzing:()=>U9,treeCommand:()=>L9});async function F9(t,e,n,r,s){let i={output:"",stderr:"",dirCount:0,fileCount:0},o=t.fs.resolvePath(t.cwd,e);try{if(!(await t.fs.stat(o)).isDirectory)return i.output=`${e}
507
+ `,i.fileCount=1,i}catch{return i.stderr=`tree: ${e}: No such file or directory
508
+ `,i}if(i.output=`${e}
509
+ `,n.maxDepth!==null&&s>=n.maxDepth)return i;try{let a=[];if(t.fs.readdirWithFileTypes)a=(await t.fs.readdirWithFileTypes(o)).map(u=>({name:u.name,isDirectory:u.isDirectory}));else{let c=await t.fs.readdir(o);for(let u=0;u<c.length;u+=100){let f=c.slice(u,u+100),p=await Promise.all(f.map(async h=>{let m=o==="/"?`/${h}`:`${o}/${h}`;try{let d=await t.fs.stat(m);return{name:h,isDirectory:d.isDirectory}}catch{return null}}));a.push(...p.filter(h=>h!==null))}}let l=a.filter(c=>!(!n.showHidden&&c.name.startsWith(".")||n.directoriesOnly&&!c.isDirectory));l.sort((c,u)=>c.name.localeCompare(u.name));for(let c=0;c<l.length;c++){let u=l[c],f=o==="/"?`/${u.name}`:`${o}/${u.name}`,p=c===l.length-1,h=p?"`-- ":"|-- ",m=r+(p?" ":"| ");if(u.isDirectory){i.dirCount++;let d=n.fullPath?f:u.name;if(i.output+=`${r+h+d}
510
+ `,n.maxDepth===null||s+1<n.maxDepth){let g=await vh(t,f,n,m,s+1);i.output+=g.output,i.dirCount+=g.dirCount,i.fileCount+=g.fileCount}}else{i.fileCount++;let d=n.fullPath?f:u.name;i.output+=`${r+h+d}
511
+ `}}}catch{i.stderr=`tree: ${e}: Permission denied
512
+ `}return i}async function vh(t,e,n,r,s){let i={output:"",stderr:"",dirCount:0,fileCount:0};if(n.maxDepth!==null&&s>=n.maxDepth)return i;try{let o=[];if(t.fs.readdirWithFileTypes)o=(await t.fs.readdirWithFileTypes(e)).map(c=>({name:c.name,isDirectory:c.isDirectory}));else{let l=await t.fs.readdir(e);for(let c=0;c<l.length;c+=100){let u=l.slice(c,c+100),f=await Promise.all(u.map(async p=>{let h=e==="/"?`/${p}`:`${e}/${p}`;try{let m=await t.fs.stat(h);return{name:p,isDirectory:m.isDirectory}}catch{return null}}));o.push(...f.filter(p=>p!==null))}}let a=o.filter(l=>!(!n.showHidden&&l.name.startsWith(".")||n.directoriesOnly&&!l.isDirectory));a.sort((l,c)=>l.name.localeCompare(c.name));for(let l=0;l<a.length;l++){let c=a[l],u=e==="/"?`/${c.name}`:`${e}/${c.name}`,f=l===a.length-1,p=f?"`-- ":"|-- ",h=r+(f?" ":"| ");if(c.isDirectory){i.dirCount++;let m=n.fullPath?u:c.name;i.output+=`${r+p+m}
513
+ `;let d=await vh(t,u,n,h,s+1);i.output+=d.output,i.dirCount+=d.dirCount,i.fileCount+=d.fileCount}else{i.fileCount++;let m=n.fullPath?u:c.name;i.output+=`${r+p+m}
514
+ `}}}catch{}return i}var _9,M9,L9,U9,Ih=I(()=>{"use strict";nt();F();kr();he();_9={name:"tree",summary:"list contents of directories in a tree-like format",usage:"tree [OPTION]... [DIRECTORY]...",options:["-a include hidden files","-d list directories only","-L LEVEL limit depth of directory tree","-f print full path prefix for each file"," --help display this help and exit"]},M9={showHidden:{short:"a",type:"boolean"},directoriesOnly:{short:"d",type:"boolean"},fullPath:{short:"f",type:"boolean"},maxDepth:{short:"L",type:"number"}},L9={name:"tree",async execute(t,e){let n=W(t);if(Z(n))return q(_9);let r=ke("tree",n,M9);if(!r.ok)return r.error;let s={showHidden:r.result.flags.showHidden,directoriesOnly:r.result.flags.directoriesOnly,maxDepth:r.result.flags.maxDepth??null,fullPath:r.result.flags.fullPath},i=r.result.positional;i.length===0&&i.push(".");let o="",a="",l=0,c=0;for(let u of i){let f=await F9(e,u,s,"",0);o+=f.output,a+=f.stderr,l+=f.dirCount,c+=f.fileCount}return o+=`
515
+ ${l} director${l===1?"y":"ies"}`,s.directoriesOnly||(o+=`, ${c} file${c===1?"":"s"}`),o+=`
516
+ `,{stdout:x(o),stderr:x(a),exitCode:a?1:0}}};U9={name:"tree",flags:[{flag:"-a",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-L",type:"value",valueHint:"number"}],needsFiles:!0}});var Oh={};se(Oh,{duCommand:()=>z9,flagsForFuzzing:()=>H9});async function Th(t,e,n,r,s){let i={output:"",totalSize:0,stderr:""};try{let o=await t.fs.stat(e);if(!o.isDirectory)return i.totalSize=o.size,(r.allFiles||s===0)&&(i.output=_i(o.size,r.humanReadable)+" "+n+`
517
+ `),i;let a=0,l=[];if(t.fs.readdirWithFileTypes){let f=await t.fs.readdirWithFileTypes(e),p=f.filter(m=>m.isFile),h=f.filter(m=>m.isDirectory);for(let m=0;m<p.length;m+=100){let d=p.slice(m,m+100),g=await Promise.all(d.map(async w=>{let E=e==="/"?`/${w.name}`:`${e}/${w.name}`;try{let b=await t.fs.stat(E);return{name:w.name,isDirectory:!1,size:b.size}}catch{return{name:w.name,isDirectory:!1,size:0}}}));l.push(...g)}l.push(...h.map(m=>({name:m.name,isDirectory:!0})))}else{let f=await t.fs.readdir(e);for(let p=0;p<f.length;p+=100){let h=f.slice(p,p+100),m=await Promise.all(h.map(async d=>{let g=e==="/"?`/${d}`:`${e}/${d}`;try{let w=await t.fs.stat(g);return{name:d,isDirectory:w.isDirectory,size:w.isDirectory?void 0:w.size}}catch{return{name:d,isDirectory:!1,size:0}}}));l.push(...m)}}l.sort((f,p)=>f.name.localeCompare(p.name));let c=l.filter(f=>!f.isDirectory);for(let f of c){let p=f.size??0;if(a+=p,r.allFiles&&!r.summarize){let h=n==="."?f.name:`${n}/${f.name}`;i.output+=_i(p,r.humanReadable)+" "+h+`
518
+ `}}let u=l.filter(f=>f.isDirectory);for(let f=0;f<u.length;f+=100){let p=u.slice(f,f+100),h=await Promise.all(p.map(async m=>{let d=e==="/"?`/${m.name}`:`${e}/${m.name}`,g=n==="."?m.name:`${n}/${m.name}`;return{name:m.name,result:await Th(t,d,g,r,s+1)}}));h.sort((m,d)=>m.name.localeCompare(d.name));for(let{result:m}of h)a+=m.totalSize,r.summarize||(r.maxDepth===null||s+1<=r.maxDepth)&&(i.output+=m.output)}i.totalSize=a,(r.summarize||r.maxDepth===null||s<=r.maxDepth)&&(i.output+=`${_i(a,r.humanReadable)} ${n}
519
+ `)}catch{i.stderr=`du: cannot read directory '${n}': Permission denied
520
+ `}return i}function _i(t,e){return e?t<1024?`${t}`:t<1024*1024?`${(t/1024).toFixed(1)}K`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)}M`:`${(t/(1024*1024*1024)).toFixed(1)}G`:String(Math.ceil(t/1024)||1)}var B9,W9,z9,H9,Rh=I(()=>{"use strict";nt();F();kr();he();B9={name:"du",summary:"estimate file space usage",usage:"du [OPTION]... [FILE]...",options:["-a write counts for all files, not just directories","-h print sizes in human readable format","-s display only a total for each argument","-c produce a grand total","--max-depth=N print total for directory only if N or fewer levels deep"," --help display this help and exit"]},W9={allFiles:{short:"a",type:"boolean"},humanReadable:{short:"h",type:"boolean"},summarize:{short:"s",type:"boolean"},grandTotal:{short:"c",type:"boolean"},maxDepth:{long:"max-depth",type:"number"}},z9={name:"du",async execute(t,e){let n=W(t);if(Z(n))return q(B9);let r=ke("du",n,W9);if(!r.ok)return r.error;let s={allFiles:r.result.flags.allFiles,humanReadable:r.result.flags.humanReadable,summarize:r.result.flags.summarize,grandTotal:r.result.flags.grandTotal,maxDepth:r.result.flags.maxDepth??null},i=r.result.positional;i.length===0&&i.push(".");let o="",a="",l=0;for(let c of i){let u=e.fs.resolvePath(e.cwd,c);try{await e.fs.stat(u);let f=await Th(e,u,c,s,0);o+=f.output,l+=f.totalSize,a+=f.stderr}catch{a+=`du: cannot access '${c}': No such file or directory
521
+ `}}return s.grandTotal&&i.length>0&&(o+=`${_i(l,s.humanReadable)} total
522
+ `),{stdout:x(o),stderr:x(a),exitCode:a?1:0}}};H9={name:"du",flags:[{flag:"-a",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"--max-depth",type:"value",valueHint:"number"}],needsFiles:!0}});var Ka={};se(Ka,{envCommand:()=>G9,flagsForFuzzing:()=>Z9,printenvCommand:()=>q9,printenvFlagsForFuzzing:()=>Y9});var j9,G9,V9,q9,Z9,Y9,Xa=I(()=>{"use strict";F();he();j9={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},G9={name:"env",async execute(t,e){let n=W(t);if(Z(n))return q(j9);let r=!1,s=[],i=new Map,o=-1;for(let d=0;d<n.length;d++){let g=n[d];if(g==="-i"||g==="--ignore-environment")r=!0;else if(g==="-u"&&d+1<n.length)s.push(n[++d]);else if(g.startsWith("-u"))s.push(g.slice(2));else if(g.startsWith("--unset="))s.push(g.slice(8));else{if(g.startsWith("--")&&g!=="--")return oe("env",g);if(g.startsWith("-")&&g!=="-"){for(let w of g.slice(1))if(w!=="i"&&w!=="u")return oe("env",`-${w}`);g.includes("i")&&(r=!0)}else if(g.includes("=")&&o===-1){let w=g.indexOf("="),E=g.slice(0,w),b=g.slice(w+1);i.set(E,b)}else{o=d;break}}}let a;if(r)a=[...i.entries()];else{let d=[];for(let[E,b]of e.env)d.push([E,R(b)]);let g=d.filter(([E])=>!s.includes(E)),w=new Map(g);for(let[E,b]of i)w.set(E,b);a=[...w.entries()]}if(o===-1){let d=[];for(let[g,w]of a)d.push(`${g}=${w}`);return{stdout:x(d.join(`
523
+ `)+(d.length>0?`
524
+ `:"")),stderr:y,exitCode:0}}if(!e.exec)return{stdout:y,stderr:x(`env: command execution not supported in this context
525
+ `),exitCode:1};let l=n.slice(o),c=l[0],f=l.slice(1).map(d=>/[\s"'\\$`!*?[\]{}|&;<>()]/.test(d)?`'${d.replace(/'/g,"'\\''")}'`:d),p=["command",c,...f].join(" "),h=[...i.entries()].map(([d,g])=>`${d}="${g}"`).join(" "),m=h?`${h} ${p}`:p;return e.exec(m,{cwd:e.cwd})}},V9={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},q9={name:"printenv",async execute(t,e){let n=W(t);if(Z(n))return q(V9);let r=n.filter(o=>!o.startsWith("-"));if(r.length===0){let o=[];for(let[a,l]of e.env)o.push(`${a}=${R(l)}`);return{stdout:x(o.join(`
526
+ `)+(o.length>0?`
527
+ `:"")),stderr:y,exitCode:0}}let s=[],i=0;for(let o of r){let a=e.env.get(o);a!==void 0?s.push(R(a)):i=1}return{stdout:x(s.join(`
528
+ `)+(s.length>0?`
529
+ `:"")),stderr:y,exitCode:i}}},Z9={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},Y9={name:"printenv",flags:[]}});var Ja={};se(Ja,{aliasCommand:()=>K9,flagsForFuzzing:()=>J9,unaliasCommand:()=>X9,unaliasFlagsForFuzzing:()=>e5});var Q9,Br,K9,X9,J9,e5,el=I(()=>{"use strict";F();he();Q9={name:"alias",summary:"define or display aliases",usage:"alias [name[=value] ...]",options:[" --help display this help and exit"]},Br="BASH_ALIAS_",K9={name:"alias",async execute(t,e){let n=W(t);if(Z(n))return q(Q9);if(n.length===0){let s="";for(let i of e.env.keys())if(i.startsWith(Br)){let o=i.slice(Br.length);s+=`alias ${o}='${$(e.env,i)}'
530
+ `}return{stdout:x(s),stderr:y,exitCode:0}}let r=n[0]==="--"?n.slice(1):n;for(let s of r){let i=s.indexOf("=");if(i===-1){let o=Br+s;return e.env.get(o)?{stdout:x(`alias ${s}='${$(e.env,o)}'
531
+ `),stderr:y,exitCode:0}:{stdout:y,stderr:x(`alias: ${s}: not found
532
+ `),exitCode:1}}else{let o=s.slice(0,i),a=s.slice(i+1);(a.startsWith("'")&&a.endsWith("'")||a.startsWith('"')&&a.endsWith('"'))&&(a=a.slice(1,-1)),T(e.env,Br+o,a)}}return{stdout:y,stderr:y,exitCode:0}}},X9={name:"unalias",async execute(t,e){let n=W(t);if(Z(n))return q({name:"unalias",summary:"remove alias definitions",usage:"unalias name [name ...]",options:["-a remove all aliases"," --help display this help and exit"]});if(n.length===0)return{stdout:y,stderr:x(`unalias: usage: unalias [-a] name [name ...]
533
+ `),exitCode:1};if(n[0]==="-a"){for(let o of e.env.keys())o.startsWith(Br)&&e.env.delete(o);return{stdout:y,stderr:y,exitCode:0}}let r=n[0]==="--"?n.slice(1):n,s=!1,i="";for(let o of r){let a=Br+o;e.env.get(a)?e.env.delete(a):(i+=`unalias: ${o}: not found
534
+ `,s=!0)}return{stdout:y,stderr:x(i),exitCode:s?1:0}}},J9={name:"alias",flags:[]},e5={name:"unalias",flags:[{flag:"-a",type:"boolean"}]}});var $h={};se($h,{flagsForFuzzing:()=>r5,historyCommand:()=>n5});var t5,Ph,n5,r5,Dh=I(()=>{"use strict";F();he();t5={name:"history",summary:"display command history",usage:"history [n]",options:["-c clear the history list"," --help display this help and exit"]},Ph="BASH_HISTORY",n5={name:"history",async execute(t,e){let n=W(t);if(Z(n))return q(t5);let r=$(e.env,Ph,"[]"),s;try{s=JSON.parse(r)}catch{s=[]}if(n[0]==="-c")return T(e.env,Ph,"[]"),{stdout:y,stderr:y,exitCode:0};let i=s.length;n[0]&&/^\d+$/.test(n[0])&&(i=Math.min(parseInt(n[0],10),s.length));let o=s.length-i,a="";for(let l=o;l<s.length;l++){let c=(l+1).toString().padStart(5," ");a+=`${c} ${s[l]}
535
+ `}return{stdout:x(a),stderr:y,exitCode:0}}},r5={name:"history",flags:[{flag:"-c",type:"boolean"}]}});var _h={};se(_h,{flagsForFuzzing:()=>o5,xargsCommand:()=>i5});var s5,i5,o5,Mh=I(()=>{"use strict";F();he();s5={name:"xargs",summary:"build and execute command lines from standard input",usage:"xargs [OPTION]... [COMMAND [INITIAL-ARGS]]",options:["-I REPLACE replace occurrences of REPLACE with input","-d DELIM use DELIM as input delimiter (e.g., -d '\\n' for newline)","-n NUM use at most NUM arguments per command line","-P NUM run at most NUM processes at a time","-0, --null items are separated by null, not whitespace","-t, --verbose print commands before executing","-r, --no-run-if-empty do not run command if input is empty"," --help display this help and exit"]},i5={name:"xargs",async execute(t,e){let n=W(t);if(Z(n))return q(s5);let r=null,s=null,i=null,o=null,a=!1,l=!1,c=!1,u=0;for(let b=0;b<n.length;b++){let A=n[b];if(A==="-I"&&b+1<n.length)r=n[++b],u=b+1;else if(A==="-d"&&b+1<n.length)s=n[++b].replace(/\\n/g,`
536
+ `).replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\0/g,"\0").replace(/\\\\/g,"\\"),u=b+1;else if(A==="-n"&&b+1<n.length)i=parseInt(n[++b],10),u=b+1;else if(A==="-P"&&b+1<n.length)o=parseInt(n[++b],10),u=b+1;else if(A==="-0"||A==="--null")a=!0,u=b+1;else if(A==="-t"||A==="--verbose")l=!0,u=b+1;else if(A==="-r"||A==="--no-run-if-empty")c=!0,u=b+1;else{if(A.startsWith("--"))return oe("xargs",A);if(A.startsWith("-")&&A.length>1){for(let N of A.slice(1))if(!"0tr".includes(N))return oe("xargs",`-${N}`);A.includes("0")&&(a=!0),A.includes("t")&&(l=!0),A.includes("r")&&(c=!0),u=b+1}else if(!A.startsWith("-")){u=b;break}}}let f=n.slice(u);f.length===0&&f.push("echo");let p;if(a?p=R(e.stdin).split("\0").filter(b=>b.length>0):s!==null?p=R(e.stdin).replace(/\n$/,"").split(s).filter(A=>A.length>0):p=R(e.stdin).split(/\s+/).map(b=>b.trim()).filter(b=>b.length>0),p.length===0)return c?{stdout:y,stderr:y,exitCode:0}:{stdout:y,stderr:y,exitCode:0};let h="",m="",d=0,g=b=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(b)?`"${b.replace(/([\\"`$])/g,"\\$1")}"`:b,w=async b=>{let A=b.map(g).join(" ");return l&&(m+=`${A}
537
+ `),e.exec?e.exec(A,{cwd:e.cwd}):{stdout:x(`${A}
538
+ `),stderr:y,exitCode:0}},E=async b=>{if(o!==null&&o>1)for(let A=0;A<b.length;A+=o){let N=b.slice(A,A+o),P=await Promise.all(N.map(w));for(let O of P)h+=R(O.stdout),m+=R(O.stderr),O.exitCode!==0&&(d=O.exitCode)}else for(let A of b){let N=await w(A);h+=R(N.stdout),m+=R(N.stderr),N.exitCode!==0&&(d=N.exitCode)}};if(r!==null){let b=p.map(A=>f.map(N=>N.replaceAll(r,A)));await E(b)}else if(i!==null){let b=[];for(let A=0;A<p.length;A+=i){let N=p.slice(A,A+i);b.push([...f,...N])}await E(b)}else{let b=[...f,...p],A=await w(b);h+=R(A.stdout),m+=R(A.stderr),d=A.exitCode}return{stdout:x(h),stderr:x(m),exitCode:d}}},o5={name:"xargs",flags:[{flag:"-I",type:"value",valueHint:"string"},{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-0",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-r",type:"boolean"}],stdinType:"text"}});var tl={};se(tl,{falseCommand:()=>l5,falseFlagsForFuzzing:()=>u5,flagsForFuzzing:()=>c5,trueCommand:()=>a5});var a5,l5,c5,u5,nl=I(()=>{"use strict";F();a5={name:"true",async execute(){return{stdout:y,stderr:y,exitCode:0}}},l5={name:"false",async execute(){return{stdout:y,stderr:y,exitCode:1}}},c5={name:"true",flags:[]},u5={name:"false",flags:[]}});var Lh={};se(Lh,{clearCommand:()=>p5,flagsForFuzzing:()=>h5});var f5,p5,h5,Fh=I(()=>{"use strict";F();he();f5={name:"clear",summary:"clear the terminal screen",usage:"clear [OPTIONS]",options:[" --help display this help and exit"]},p5={name:"clear",async execute(t,e){let n=W(t);return Z(n)?q(f5):{stdout:x("\x1B[2J\x1B[H"),stderr:y,exitCode:0}}},h5={name:"clear",flags:[]}});var rl={};se(rl,{bashCommand:()=>d5,flagsForFuzzing:()=>g5,shCommand:()=>m5,shFlagsForFuzzing:()=>y5});async function Wr(t,e,n,r){if(!r.exec)return{stdout:y,stderr:x(`bash: internal error: exec function not available
539
+ `),exitCode:1};let s=Ei(r.exportedEnv||{},{0:e,"#":String(n.length),"@":n.join(" "),"*":n.join(" ")});n.forEach((a,l)=>{s[String(l+1)]=a});let i=t;if(i.startsWith("#!")){let a=i.indexOf(`
540
+ `);a!==-1&&(i=i.slice(a+1))}return await r.exec(i,{env:s,cwd:r.cwd,stdin:r.stdin})}var Uh,d5,m5,g5,y5,sl=I(()=>{"use strict";Wn();F();he();Uh={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},d5={name:"bash",async execute(t,e){let n=W(t);if(Z(n))return q(Uh);if(n[0]==="-c"&&n.length>=2){let i=n[1],o=n[2]||"bash",a=n.slice(3);return Wr(i,o,a,e)}if(n.length===0)return e.stdin?.length&&R(e.stdin).trim()?Wr(R(e.stdin),"bash",[],e):{stdout:y,stderr:y,exitCode:0};let r=n[0],s=n.slice(1);try{let i=e.fs.resolvePath(e.cwd,r),o=await e.fs.readFile(i);return Wr(o,r,s,e)}catch{return{stdout:y,stderr:x(`bash: ${r}: No such file or directory
541
+ `),exitCode:127}}}},m5={name:"sh",async execute(t,e){let n=W(t);if(Z(n))return q({...Uh,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(n[0]==="-c"&&n.length>=2){let i=n[1],o=n[2]||"sh",a=n.slice(3);return Wr(i,o,a,e)}if(n.length===0)return e.stdin?.length&&R(e.stdin).trim()?Wr(R(e.stdin),"sh",[],e):{stdout:y,stderr:y,exitCode:0};let r=n[0],s=n.slice(1);try{let i=e.fs.resolvePath(e.cwd,r),o=await e.fs.readFile(i);return Wr(o,r,s,e)}catch{return{stdout:y,stderr:x(`sh: ${r}: No such file or directory
542
+ `),exitCode:127}}}};g5={name:"bash",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"},y5={name:"sh",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"}});function Me(t){return!Bh.has(t)}function We(t,e,n){Me(e)&&(t[e]=n)}function En(t,e){return Object.hasOwn(t,e)}function rt(t){return Object.assign(Object.create(null),t)}function il(...t){return Object.assign(Object.create(null),...t)}var Bh,kk,Pn=I(()=>{"use strict";Bh=new Set(["__proto__","constructor","prototype"]),kk=new Set([...Bh,"__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])});function ol(t,e,n,r,s,i,o,a,l,c){switch(e){case"sort":return Array.isArray(t)?[[...t].sort(o)]:[null];case"sort_by":return!Array.isArray(t)||n.length===0?[null]:[[...t].sort((f,p)=>{let h=s(f,n[0],r)[0],m=s(p,n[0],r)[0];return o(h,m)})];case"bsearch":{if(!Array.isArray(t)){let f=t===null?"null":typeof t=="object"?"object":typeof t;throw new Error(`${f} (${JSON.stringify(t)}) cannot be searched from`)}return n.length===0?[null]:s(t,n[0],r).map(f=>{let p=0,h=t.length;for(;p<h;){let m=p+h>>>1;o(t[m],f)<0?p=m+1:h=m}return p<t.length&&o(t[p],f)===0?p:-p-1})}case"unique_by":{if(!Array.isArray(t)||n.length===0)return[null];let u=new Map;for(let p of t){let h=s(p,n[0],r)[0],m=JSON.stringify(h);u.has(m)||u.set(m,{item:p,key:h})}let f=[...u.values()];return f.sort((p,h)=>o(p.key,h.key)),[f.map(p=>p.item)]}case"group_by":{if(!Array.isArray(t)||n.length===0)return[null];let u=new Map;for(let f of t){let p=JSON.stringify(s(f,n[0],r)[0]);u.has(p)||u.set(p,[]),u.get(p)?.push(f)}return[[...u.values()]]}case"max":return Array.isArray(t)&&t.length>0?[t.reduce((u,f)=>o(u,f)>0?u:f)]:[null];case"max_by":return!Array.isArray(t)||t.length===0||n.length===0?[null]:[t.reduce((u,f)=>{let p=s(u,n[0],r)[0],h=s(f,n[0],r)[0];return o(p,h)>0?u:f})];case"min":return Array.isArray(t)&&t.length>0?[t.reduce((u,f)=>o(u,f)<0?u:f)]:[null];case"min_by":return!Array.isArray(t)||t.length===0||n.length===0?[null]:[t.reduce((u,f)=>{let p=s(u,n[0],r)[0],h=s(f,n[0],r)[0];return o(p,h)<0?u:f})];case"add":{let u=f=>{let p=f.filter(h=>h!==null);return p.length===0?null:p.every(h=>typeof h=="number")?p.reduce((h,m)=>h+m,0):p.every(h=>typeof h=="string")?p.join(""):p.every(h=>Array.isArray(h))?p.flat():p.every(h=>h&&typeof h=="object"&&!Array.isArray(h))?Ei(...p):null};if(n.length>=1){let f=s(t,n[0],r);return[u(f)]}return Array.isArray(t)?[u(t)]:[null]}case"any":{if(n.length>=2){try{let u=i(t,n[0],r);for(let f of u)if(s(f,n[1],r).some(a))return[!0]}catch(u){if(u instanceof c)throw u}return[!1]}return n.length===1?Array.isArray(t)?[t.some(u=>a(s(u,n[0],r)[0]))]:[!1]:Array.isArray(t)?[t.some(a)]:[!1]}case"all":{if(n.length>=2){try{let u=i(t,n[0],r);for(let f of u)if(!s(f,n[1],r).some(a))return[!1]}catch(u){if(u instanceof c)throw u}return[!0]}return n.length===1?Array.isArray(t)?[t.every(u=>a(s(u,n[0],r)[0]))]:[!0]:Array.isArray(t)?[t.every(a)]:[!0]}case"select":return n.length===0?[t]:s(t,n[0],r).some(a)?[t]:[];case"map":return n.length===0||!Array.isArray(t)?[null]:[t.flatMap(f=>s(f,n[0],r))];case"map_values":{if(n.length===0)return[null];if(Array.isArray(t))return[t.flatMap(u=>s(u,n[0],r))];if(t&&typeof t=="object"){let u=Object.create(null);for(let[f,p]of Object.entries(t)){if(!Me(f))continue;let h=s(p,n[0],r);h.length>0&&We(u,f,h[0])}return[u]}return[null]}case"has":{if(n.length===0)return[!1];let f=s(t,n[0],r)[0];return Array.isArray(t)&&typeof f=="number"?[f>=0&&f<t.length]:t&&typeof t=="object"&&typeof f=="string"?[En(t,f)]:[!1]}case"in":{if(n.length===0)return[!1];let f=s(t,n[0],r)[0];return Array.isArray(f)&&typeof t=="number"?[t>=0&&t<f.length]:f&&typeof f=="object"&&typeof t=="string"?[En(f,t)]:[!1]}case"contains":{if(n.length===0)return[!1];let u=s(t,n[0],r);return[l(t,u[0])]}case"inside":{if(n.length===0)return[!1];let u=s(t,n[0],r);return[l(u[0],t)]}default:return null}}var Wh=I(()=>{"use strict";Wn();Pn()});function al(t,e,n,r,s,i,o,a){switch(e){case"first":if(n.length>0)try{let l=i(t,n[0],r);return l.length>0?[l[0]]:[]}catch(l){if(l instanceof a)throw l;return[]}return Array.isArray(t)&&t.length>0?[t[0]]:[null];case"last":if(n.length>0){let l=s(t,n[0],r);return l.length>0?[l[l.length-1]]:[]}return Array.isArray(t)&&t.length>0?[t[t.length-1]]:[null];case"nth":{if(n.length<1)return[null];let l=s(t,n[0],r);if(n.length>1){for(let u of l)if(u<0)throw new Error("nth doesn't support negative indices");let c;try{c=i(t,n[1],r)}catch(u){if(u instanceof a)throw u;c=[]}return l.flatMap(u=>{let f=u;return f<c.length?[c[f]]:[]})}return Array.isArray(t)?l.flatMap(c=>{let u=c;if(u<0)throw new Error("nth doesn't support negative indices");return u<t.length?[t[u]]:[null]}):[null]}case"range":{if(n.length===0)return[];let l=s(t,n[0],r);if(n.length===1){let p=[];for(let h of l){let m=h;for(let d=0;d<m;d++)p.push(d)}return p}let c=s(t,n[1],r);if(n.length===2){let p=[];for(let h of l)for(let m of c){let d=h,g=m;for(let w=d;w<g;w++)p.push(w)}return p}let u=s(t,n[2],r),f=[];for(let p of l)for(let h of c)for(let m of u){let d=p,g=h,w=m;if(w!==0)if(w>0)for(let E=d;E<g;E+=w)f.push(E);else for(let E=d;E>g;E+=w)f.push(E)}return f}case"limit":return n.length<2?[]:s(t,n[0],r).flatMap(c=>{let u=c;if(u<0)throw new Error("limit doesn't support negative count");if(u===0)return[];let f;try{f=i(t,n[1],r)}catch(p){if(p instanceof a)throw p;f=[]}return f.slice(0,u)});case"isempty":{if(n.length<1)return[!0];try{return[i(t,n[0],r).length===0]}catch(l){if(l instanceof a)throw l;return[!0]}}case"isvalid":{if(n.length<1)return[!0];try{return[s(t,n[0],r).length>0]}catch(l){if(l instanceof a)throw l;return[!1]}}case"skip":return n.length<2?[]:s(t,n[0],r).flatMap(c=>{let u=c;if(u<0)throw new Error("skip doesn't support negative count");return s(t,n[1],r).slice(u)});case"until":{if(n.length<2)return[t];let l=t,c=r.limits.maxIterations;for(let u=0;u<c;u++){if(s(l,n[0],r).some(o))return[l];let p=s(l,n[1],r);if(p.length===0)return[l];l=p[0]}throw new a(`jq until: too many iterations (${c}), increase executionLimits.maxJqIterations`,"iterations")}case"while":{if(n.length<2)return[t];let l=[],c=t,u=r.limits.maxIterations;for(let f=0;f<u&&s(c,n[0],r).some(o);f++){l.push(c);let h=s(c,n[1],r);if(h.length===0)break;c=h[0]}if(l.length>=u)throw new a(`jq while: too many iterations (${u}), increase executionLimits.maxJqIterations`,"iterations");return l}case"repeat":{if(n.length===0)return[t];let l=[],c=t,u=r.limits.maxIterations;for(let f=0;f<u;f++){l.push(c);let p=s(c,n[0],r);if(p.length===0)break;c=p[0]}if(l.length>=u)throw new a(`jq repeat: too many iterations (${u}), increase executionLimits.maxJqIterations`,"iterations");return l}default:return null}}var zh=I(()=>{"use strict"});function ll(t,e,n,r,s){switch(e){case"now":return[Date.now()/1e3];case"gmtime":{if(typeof t!="number")return[null];let i=new Date(t*1e3),o=i.getUTCFullYear(),a=i.getUTCMonth(),l=i.getUTCDate(),c=i.getUTCHours(),u=i.getUTCMinutes(),f=i.getUTCSeconds(),p=i.getUTCDay(),h=Date.UTC(o,0,1),m=Math.floor((i.getTime()-h)/(1440*60*1e3));return[[o,a,l,c,u,f,p,m]]}case"mktime":{if(!Array.isArray(t))throw new Error("mktime requires parsed datetime inputs");let[i,o,a,l=0,c=0,u=0]=t;if(typeof i!="number"||typeof o!="number")throw new Error("mktime requires parsed datetime inputs");let f=Date.UTC(i,o,a??1,l??0,c??0,u??0);return[Math.floor(f/1e3)]}case"strftime":{if(n.length===0)return[null];let o=s(t,n[0],r)[0];if(typeof o!="string")throw new Error("strftime/1 requires a string format");let a;if(typeof t=="number")a=new Date(t*1e3);else if(Array.isArray(t)){let[p,h,m,d=0,g=0,w=0]=t;if(typeof p!="number"||typeof h!="number")throw new Error("strftime/1 requires parsed datetime inputs");a=new Date(Date.UTC(p,h,m??1,d??0,g??0,w??0))}else throw new Error("strftime/1 requires parsed datetime inputs");let l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"],u=(p,h=2)=>String(p).padStart(h,"0");return[o.replace(/%Y/g,String(a.getUTCFullYear())).replace(/%m/g,u(a.getUTCMonth()+1)).replace(/%d/g,u(a.getUTCDate())).replace(/%H/g,u(a.getUTCHours())).replace(/%M/g,u(a.getUTCMinutes())).replace(/%S/g,u(a.getUTCSeconds())).replace(/%A/g,l[a.getUTCDay()]).replace(/%B/g,c[a.getUTCMonth()]).replace(/%Z/g,"UTC").replace(/%%/g,"%")]}case"strptime":{if(n.length===0)return[null];if(typeof t!="string")throw new Error("strptime/1 requires a string input");let o=s(t,n[0],r)[0];if(typeof o!="string")throw new Error("strptime/1 requires a string format");if(o==="%Y-%m-%dT%H:%M:%SZ"){let l=t.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(l){let[,c,u,f,p,h,m]=l.map(Number),d=new Date(Date.UTC(c,u-1,f,p,h,m)),g=d.getUTCDay(),w=Date.UTC(c,0,1),E=Math.floor((d.getTime()-w)/(1440*60*1e3));return[[c,u-1,f,p,h,m,g,E]]}}let a=new Date(t);if(!Number.isNaN(a.getTime())){let l=a.getUTCFullYear(),c=a.getUTCMonth(),u=a.getUTCDate(),f=a.getUTCHours(),p=a.getUTCMinutes(),h=a.getUTCSeconds(),m=a.getUTCDay(),d=Date.UTC(l,0,1),g=Math.floor((a.getTime()-d)/(1440*60*1e3));return[[l,c,u,f,p,h,m,g]]}throw new Error(`Cannot parse date: ${t}`)}case"fromdate":{if(typeof t!="string")throw new Error("fromdate requires a string input");let i=new Date(t);if(Number.isNaN(i.getTime()))throw new Error(`date "${t}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(i.getTime()/1e3)]}case"todate":{if(typeof t!="number")throw new Error("todate requires a number input");return[new Date(t*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")]}default:return null}}var Hh=I(()=>{"use strict"});function sn(t){return t!==!1&&t!==null}function zr(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Ts(t,e){return typeof t=="number"&&typeof e=="number"?t-e:typeof t=="string"&&typeof e=="string"?t.localeCompare(e):0}function cl(t,e){let n=rt(t);for(let r of Object.keys(e))Me(r)&&(En(n,r)&&n[r]&&typeof n[r]=="object"&&!Array.isArray(n[r])&&e[r]&&typeof e[r]=="object"&&!Array.isArray(e[r])?We(n,r,cl(n[r],e[r])):We(n,r,e[r]));return n}function Hr(t,e=3e3){let n=0,r=t;for(;n<e;)if(Array.isArray(r)){if(r.length===0)return n+1;r=r[0],n++}else if(r!==null&&typeof r=="object"){let s=Object.keys(r);if(s.length===0)return n+1;r=r[s[0]],n++}else return n;return n}function Mi(t,e){let n=i=>i===null?0:typeof i=="boolean"?1:typeof i=="number"?2:typeof i=="string"?3:Array.isArray(i)?4:typeof i=="object"?5:6,r=n(t),s=n(e);if(r!==s)return r-s;if(typeof t=="number"&&typeof e=="number")return t-e;if(typeof t=="string"&&typeof e=="string")return t.localeCompare(e);if(typeof t=="boolean"&&typeof e=="boolean")return(t?1:0)-(e?1:0);if(Array.isArray(t)&&Array.isArray(e)){for(let i=0;i<Math.min(t.length,e.length);i++){let o=Mi(t[i],e[i]);if(o!==0)return o}return t.length-e.length}if(t&&e&&typeof t=="object"&&typeof e=="object"){let i=t,o=e,a=Object.keys(i).sort(),l=Object.keys(o).sort();for(let c=0;c<Math.min(a.length,l.length);c++){let u=a[c].localeCompare(l[c]);if(u!==0)return u}if(a.length!==l.length)return a.length-l.length;for(let c of a){let u=Mi(i[c],o[c]);if(u!==0)return u}}return 0}function Li(t,e){if(zr(t,e))return!0;if(typeof t=="string"&&typeof e=="string")return t.includes(e);if(Array.isArray(t)&&Array.isArray(e))return e.every(n=>t.some(r=>Li(r,n)));if(t&&e&&typeof t=="object"&&typeof e=="object"&&!Array.isArray(t)&&!Array.isArray(e)){let n=t,r=e;return Object.keys(r).every(s=>En(n,s)&&Li(n[s],r[s]))}return!1}var Fi=I(()=>{"use strict";Pn()});function ul(t,e,n){switch(e){case"@base64":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"utf-8").toString("base64")]:[btoa(t)]:[null];case"@base64d":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"base64").toString("utf-8")]:[atob(t)]:[null];case"@uri":return typeof t=="string"?[encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")]:[null];case"@urid":return typeof t=="string"?[decodeURIComponent(t)]:[null];case"@csv":return Array.isArray(t)?[t.map(s=>{if(s===null)return"";if(typeof s=="boolean")return s?"true":"false";if(typeof s=="number")return String(s);let i=String(s);return i.includes(",")||i.includes('"')||i.includes(`
543
+ `)||i.includes("\r")?`"${i.replace(/"/g,'""')}"`:i}).join(",")]:[null];case"@tsv":return Array.isArray(t)?[t.map(r=>String(r??"").replace(/\t/g,"\\t").replace(/\n/g,"\\n")).join(" ")]:[null];case"@json":{let r=n??w5;return Hr(t,r+1)>r?[null]:[JSON.stringify(t)]}case"@html":return typeof t=="string"?[t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")]:[null];case"@sh":return typeof t=="string"?[`'${t.replace(/'/g,"'\\''")}'`]:[null];case"@text":return typeof t=="string"?[t]:t==null?[""]:[String(t)];default:return null}}var w5,jh=I(()=>{"use strict";Fi();w5=2e3});function fl(t,e,n,r,s,i){switch(e){case"index":return n.length===0?[null]:s(t,n[0],r).map(a=>{if(typeof t=="string"&&typeof a=="string"){if(a===""&&t==="")return null;let l=t.indexOf(a);return l>=0?l:null}if(Array.isArray(t)){if(Array.isArray(a)){for(let c=0;c<=t.length-a.length;c++){let u=!0;for(let f=0;f<a.length;f++)if(!i(t[c+f],a[f])){u=!1;break}if(u)return c}return null}let l=t.findIndex(c=>i(c,a));return l>=0?l:null}return null});case"rindex":return n.length===0?[null]:s(t,n[0],r).map(a=>{if(typeof t=="string"&&typeof a=="string"){let l=t.lastIndexOf(a);return l>=0?l:null}if(Array.isArray(t)){if(Array.isArray(a)){for(let l=t.length-a.length;l>=0;l--){let c=!0;for(let u=0;u<a.length;u++)if(!i(t[l+u],a[u])){c=!1;break}if(c)return l}return null}for(let l=t.length-1;l>=0;l--)if(i(t[l],a))return l;return null}return null});case"indices":return n.length===0?[[]]:s(t,n[0],r).map(a=>{let l=[];if(typeof t=="string"&&typeof a=="string"){let c=t.indexOf(a);for(;c!==-1;)l.push(c),c=t.indexOf(a,c+1)}else if(Array.isArray(t))if(Array.isArray(a)){let c=a.length;if(c===0)for(let u=0;u<=t.length;u++)l.push(u);else for(let u=0;u<=t.length-c;u++){let f=!0;for(let p=0;p<c;p++)if(!i(t[u+p],a[p])){f=!1;break}f&&l.push(u)}}else for(let c=0;c<t.length;c++)i(t[c],a)&&l.push(c);return l});default:return null}}var Gh=I(()=>{"use strict"});function pl(t,e,n,r,s){switch(e){case"fabs":case"abs":return typeof t=="number"?[Math.abs(t)]:typeof t=="string"?[t]:[null];case"exp10":return typeof t=="number"?[10**t]:[null];case"exp2":return typeof t=="number"?[2**t]:[null];case"pow":{if(n.length<2)return[null];let i=s(t,n[0],r),o=s(t,n[1],r),a=i[0],l=o[0];return typeof a!="number"||typeof l!="number"?[null]:[a**l]}case"atan2":{if(n.length<2)return[null];let i=s(t,n[0],r),o=s(t,n[1],r),a=i[0],l=o[0];return typeof a!="number"||typeof l!="number"?[null]:[Math.atan2(a,l)]}case"hypot":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[Math.hypot(t,i)]}case"fma":{if(typeof t!="number"||n.length<2)return[null];let i=s(t,n[0],r)[0],o=s(t,n[1],r)[0];return[t*i+o]}case"copysign":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[Math.sign(i)*Math.abs(t)]}case"drem":case"remainder":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[t-Math.round(t/i)*i]}case"fdim":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[Math.max(0,t-i)]}case"fmax":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[Math.max(t,i)]}case"fmin":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[Math.min(t,i)]}case"ldexp":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[t*2**i]}case"scalbn":case"scalbln":{if(typeof t!="number"||n.length===0)return[null];let i=s(t,n[0],r)[0];return[t*2**i]}case"nearbyint":return typeof t=="number"?[Math.round(t)]:[null];case"logb":return typeof t=="number"?[Math.floor(Math.log2(Math.abs(t)))]:[null];case"significand":if(typeof t=="number"){let i=Math.floor(Math.log2(Math.abs(t)));return[t/2**i]}return[null];case"frexp":if(typeof t=="number"){if(t===0)return[[0,0]];let i=Math.floor(Math.log2(Math.abs(t)))+1;return[[t/2**i,i]]}return[null];case"modf":if(typeof t=="number"){let i=Math.trunc(t);return[[t-i,i]]}return[null];default:return null}}var Vh=I(()=>{"use strict"});function hl(t,e,n,r,s,i,o,a){switch(e){case"recurse":{if(n.length===0){let h=[],m=d=>{if(h.push(d),Array.isArray(d))for(let g of d)m(g);else if(d&&typeof d=="object")for(let g of Object.keys(d))m(d[g])};return m(t),h}let l=[],c=n.length>=2?n[1]:null,u=1e4,f=0,p=h=>{if(f++>u||c&&!s(h,c,r).some(i))return;l.push(h);let m=s(h,n[0],r);for(let d of m)d!=null&&p(d)};return p(t),l}case"recurse_down":return a(t,"recurse",n,r);case"walk":{if(n.length===0)return[t];let l=new WeakSet,c=u=>{if(u&&typeof u=="object"){if(l.has(u))return u;l.add(u)}let f;if(Array.isArray(u))f=u.map(c);else if(u&&typeof u=="object"){let h=Object.create(null);for(let[m,d]of Object.entries(u))Me(m)&&We(h,m,c(d));f=h}else f=u;return s(f,n[0],r)[0]};return[c(t)]}case"transpose":{if(!Array.isArray(t))return[null];if(t.length===0)return[[]];let l=Math.max(...t.map(u=>Array.isArray(u)?u.length:0)),c=[];for(let u=0;u<l;u++)c.push(t.map(f=>Array.isArray(f)?f[u]:null));return[c]}case"combinations":{if(n.length>0){let f=s(t,n[0],r)[0];if(!Array.isArray(t)||f<0)return[];if(f===0)return[[]];let p=[],h=(m,d)=>{if(d===f){p.push([...m]);return}for(let g of t)m.push(g),h(m,d+1),m.pop()};return h([],0),p}if(!Array.isArray(t))return[];if(t.length===0)return[[]];for(let u of t)if(!Array.isArray(u))return[];let l=[],c=(u,f)=>{if(u===t.length){l.push([...f]);return}let p=t[u];for(let h of p)f.push(h),c(u+1,f),f.pop()};return c(0,[]),l}case"parent":{if(r.root===void 0||r.currentPath===void 0)return[];let l=r.currentPath;if(l.length===0)return[];let c=n.length>0?s(t,n[0],r)[0]:1;if(c>=0){if(c>l.length)return[];let u=l.slice(0,l.length-c);return[o(r.root,u)]}else{let u=-c-1;if(u>=l.length)return[t];let f=l.slice(0,u);return[o(r.root,f)]}}case"parents":{if(r.root===void 0||r.currentPath===void 0)return[[]];let l=r.currentPath,c=[];for(let u=l.length-1;u>=0;u--)c.push(o(r.root,l.slice(0,u)));return[c]}case"root":return r.root!==void 0?[r.root]:[];default:return null}}var qh=I(()=>{"use strict";Pn()});function dl(t,e,n,r,s){switch(e){case"keys":return Array.isArray(t)?[t.map((i,o)=>o)]:t&&typeof t=="object"?[Object.keys(t).sort()]:[null];case"keys_unsorted":return Array.isArray(t)?[t.map((i,o)=>o)]:t&&typeof t=="object"?[Object.keys(t)]:[null];case"length":return typeof t=="string"?[t.length]:Array.isArray(t)?[t.length]:t&&typeof t=="object"?[Object.keys(t).length]:t===null?[0]:typeof t=="number"?[Math.abs(t)]:[null];case"utf8bytelength":{if(typeof t=="string")return[new TextEncoder().encode(t).length];let i=t===null?"null":Array.isArray(t)?"array":typeof t,o=i==="array"||i==="object"?JSON.stringify(t):String(t);throw new Error(`${i} (${o}) only strings have UTF-8 byte length`)}case"to_entries":return t&&typeof t=="object"&&!Array.isArray(t)?[Object.entries(t).map(([i,o])=>({key:i,value:o}))]:[null];case"from_entries":if(Array.isArray(t)){let i=Object.create(null);for(let o of t)if(o&&typeof o=="object"){let a=o,l=a.key??a.Key??a.name??a.Name??a.k,c=a.value??a.Value??a.v;if(l!==void 0){let u=String(l);Me(u)&&We(i,u,c)}}return[i]}return[null];case"with_entries":{if(n.length===0)return[t];if(t&&typeof t=="object"&&!Array.isArray(t)){let o=Object.entries(t).map(([l,c])=>({key:l,value:c})).flatMap(l=>s(l,n[0],r)),a=Object.create(null);for(let l of o)if(l&&typeof l=="object"){let c=l,u=c.key??c.name??c.k,f=c.value??c.v;if(u!==void 0){let p=String(u);Me(p)&&We(a,p,f)}}return[a]}return[null]}case"reverse":return Array.isArray(t)?[[...t].reverse()]:typeof t=="string"?[t.split("").reverse().join("")]:[null];case"flatten":return Array.isArray(t)?(n.length>0?s(t,n[0],r):[Number.POSITIVE_INFINITY]).map(o=>{let a=o;if(a<0)throw new Error("flatten depth must not be negative");return t.flat(a)}):[null];case"unique":if(Array.isArray(t)){let i=new Set,o=[];for(let a of t){let l=JSON.stringify(a);i.has(l)||(i.add(l),o.push(a))}return[o]}return[null];case"tojson":case"tojsonstream":{let i=r.limits.maxDepth??b5;return Hr(t,i+1)>i?[null]:[JSON.stringify(t)]}case"fromjson":{if(typeof t=="string"){let i=t.trim().toLowerCase();if(i==="nan")return[Number.NaN];if(i==="inf"||i==="infinity")return[Number.POSITIVE_INFINITY];if(i==="-inf"||i==="-infinity")return[Number.NEGATIVE_INFINITY];try{return[JSON.parse(t)]}catch{throw new Error(`Invalid JSON: ${t}`)}}return[t]}case"tostring":return typeof t=="string"?[t]:[JSON.stringify(t)];case"tonumber":if(typeof t=="number")return[t];if(typeof t=="string"){let i=Number(t);if(Number.isNaN(i))throw new Error(`${JSON.stringify(t)} cannot be parsed as a number`);return[i]}throw new Error(`${typeof t} cannot be parsed as a number`);case"toboolean":{if(typeof t=="boolean")return[t];if(typeof t=="string"){if(t==="true")return[!0];if(t==="false")return[!1];throw new Error(`string (${JSON.stringify(t)}) cannot be parsed as a boolean`)}let i=t===null?"null":Array.isArray(t)?"array":typeof t,o=i==="array"||i==="object"?JSON.stringify(t):String(t);throw new Error(`${i} (${o}) cannot be parsed as a boolean`)}case"tostream":{let i=[],o=(a,l)=>{if(a===null||typeof a!="object")i.push([l,a]);else if(Array.isArray(a))if(a.length===0)i.push([l,[]]);else for(let c=0;c<a.length;c++)o(a[c],[...l,c]);else{let c=Object.keys(a);if(c.length===0)i.push([l,Object.create(null)]);else for(let u of c)o(a[u],[...l,u])}};return o(t,[]),i.push([[]]),i}case"fromstream":{if(n.length===0)return[t];let i=s(t,n[0],r),o=null;for(let a of i){if(!Array.isArray(a)||a.length===1&&Array.isArray(a[0])&&a[0].length===0||a.length!==2)continue;let[l,c]=a;if(!Array.isArray(l))continue;if(l.length===0){o=c;continue}o===null&&(o=typeof l[0]=="number"?[]:{});let u=o;for(let p=0;p<l.length-1;p++){let h=l[p],m=l[p+1];if(Array.isArray(u)&&typeof h=="number"){for(;u.length<=h;)u.push(null);u[h]===null&&(u[h]=typeof m=="number"?[]:{}),u=u[h]}else if(u&&typeof u=="object"&&!Array.isArray(u)){let d=String(h);if(!Me(d))continue;let g=u;(g[d]===null||g[d]===void 0)&&We(g,d,typeof m=="number"?[]:{}),u=g[d]}}let f=l[l.length-1];if(Array.isArray(u)&&typeof f=="number"){for(;u.length<=f;)u.push(null);u[f]=c}else if(u&&typeof u=="object"&&!Array.isArray(u)){let p=String(f);Me(p)&&We(u,p,c)}}return[o]}case"truncate_stream":{let i=typeof t=="number"?Math.floor(t):0;if(n.length===0)return[];let o=[],a=s(t,n[0],r);for(let l of a)if(Array.isArray(l)){if(l.length===1&&Array.isArray(l[0])){let c=l[0];c.length>i&&o.push([c.slice(i)]);continue}if(l.length===2&&Array.isArray(l[0])){let c=l[0],u=l[1];c.length>i&&o.push([c.slice(i),u])}}return o}default:return null}}var b5,Zh=I(()=>{"use strict";Pn();Fi();b5=2e3});function ml(t,e,n,r,s,i,o,a,l,c){switch(e){case"getpath":{if(n.length===0)return[null];let u=s(t,n[0],r),f=[];for(let p of u){let h=p,m=t;for(let d of h){if(m==null){m=null;break}if(Array.isArray(m)&&typeof d=="number")m=m[d];else if(typeof m=="object"&&typeof d=="string"){let g=m;if(!Object.hasOwn(g,d)){m=null;break}m=g[d]}else{m=null;break}}f.push(m)}return f}case"setpath":{if(n.length<2)return[null];let f=s(t,n[0],r)[0],h=s(t,n[1],r)[0];return[o(t,f,h)]}case"delpaths":{if(n.length===0)return[t];let f=s(t,n[0],r)[0],p=t;for(let h of f.sort((m,d)=>d.length-m.length))p=a(p,h);return[p]}case"path":{if(n.length===0)return[[]];let u=[];return c(t,n[0],r,[],u),u}case"del":return n.length===0?[t]:[l(t,n[0],r)];case"pick":{if(n.length===0)return[null];let u=[];for(let p of n)c(t,p,r,[],u);let f=null;for(let p of u){for(let m of p)if(typeof m=="number"&&m<0)throw new Error("Out of bounds negative array index");let h=t;for(let m of p){if(h==null)break;if(Array.isArray(h)&&typeof m=="number")h=h[m];else if(typeof h=="object"&&typeof m=="string"){let d=h;if(!Object.hasOwn(d,m)){h=null;break}h=d[m]}else{h=null;break}}f=o(f,p,h)}return[f]}case"paths":{let u=[],f=(p,h)=>{if(p&&typeof p=="object")if(Array.isArray(p))for(let m=0;m<p.length;m++)u.push([...h,m]),f(p[m],[...h,m]);else for(let m of Object.keys(p))u.push([...h,m]),f(p[m],[...h,m])};return f(t,[]),n.length>0?u.filter(p=>{let h=t;for(let d of p)if(Array.isArray(h)&&typeof d=="number")h=h[d];else if(h&&typeof h=="object"&&typeof d=="string"){let g=h;if(!Object.hasOwn(g,d))return!1;h=g[d]}else return!1;return s(h,n[0],r).some(i)}):u}case"leaf_paths":{let u=[],f=(p,h)=>{if(p===null||typeof p!="object")u.push(h);else if(Array.isArray(p))for(let m=0;m<p.length;m++)f(p[m],[...h,m]);else for(let m of Object.keys(p))f(p[m],[...h,m])};return f(t,[]),u}default:return null}}var Yh=I(()=>{"use strict"});function gl(t,e,n,r,s,i){switch(e){case"IN":{if(n.length===0)return[!1];if(n.length===1){let c=s(t,n[0],r);for(let u of c)if(i(t,u))return[!0];return[!1]}let o=s(t,n[0],r),a=s(t,n[1],r),l=new Set(a.map(c=>JSON.stringify(c)));for(let c of o)if(l.has(JSON.stringify(c)))return[!0];return[!1]}case"INDEX":{if(n.length===0)return[{}];if(n.length===1){let l=s(t,n[0],r),c=Object.create(null);for(let u of l){let f=String(u);Me(f)&&We(c,f,u)}return[c]}if(n.length===2){let l=s(t,n[0],r),c=Object.create(null);for(let u of l){let f=s(u,n[1],r);if(f.length>0){let p=String(f[0]);Me(p)&&We(c,p,u)}}return[c]}let o=s(t,n[0],r),a=Object.create(null);for(let l of o){let c=s(l,n[1],r),u=s(l,n[2],r);if(c.length>0&&u.length>0){let f=String(c[0]);Me(f)&&We(a,f,u[0])}}return[a]}case"JOIN":{if(n.length<2)return[null];let o=s(t,n[0],r)[0];if(!o||typeof o!="object"||Array.isArray(o))return[null];let a=o;if(!Array.isArray(t))return[null];let l=[];for(let c of t){let u=s(c,n[1],r),f=u.length>0?String(u[0]):"",p=En(a,f)?a[f]:null;l.push([c,p])}return[l]}default:return null}}var Qh=I(()=>{"use strict";Pn()});function yl(t,e,n,r,s){switch(e){case"join":{if(!Array.isArray(t))return[null];let i=n.length>0?s(t,n[0],r):[""];for(let o of t)if(Array.isArray(o)||o!==null&&typeof o=="object")throw new Error("cannot join: contains arrays or objects");return i.map(o=>t.map(a=>a===null?"":typeof a=="string"?a:String(a)).join(String(o)))}case"split":{if(typeof t!="string"||n.length===0)return[null];let i=s(t,n[0],r),o=String(i[0]);return[t.split(o)]}case"splits":{if(typeof t!="string"||n.length===0)return[];let i=s(t,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(t,n[1],r)[0]):"g";return ee(o,a.includes("g")?a:`${a}g`).split(t)}catch{return[]}}case"scan":{if(typeof t!="string"||n.length===0)return[];let i=s(t,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(t,n[1],r)[0]):"";return[...ee(o,a.includes("g")?a:`${a}g`).matchAll(t)].map(u=>u.length>1?u.slice(1):u[0])}catch{return[]}}case"test":{if(typeof t!="string"||n.length===0)return[!1];let i=s(t,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(t,n[1],r)[0]):"";return[ee(o,a).test(t)]}catch{return[!1]}}case"match":{if(typeof t!="string"||n.length===0)return[null];let i=s(t,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(t,n[1],r)[0]):"",c=ee(o,`${a}d`).exec(t);if(!c)return[];let u=c.indices;return[{offset:c.index,length:c[0].length,string:c[0],captures:c.slice(1).map((f,p)=>({offset:u?.[p+1]?.[0]??null,length:f?.length??0,string:f??"",name:null}))}]}catch{return[null]}}case"capture":{if(typeof t!="string"||n.length===0)return[null];let i=s(t,n[0],r),o=String(i[0]);try{let a=n.length>1?String(s(t,n[1],r)[0]):"",c=ee(o,a).match(t);return!c||!c.groups?[{}]:[c.groups]}catch{return[null]}}case"sub":{if(typeof t!="string"||n.length<2)return[null];let i=s(t,n[0],r),o=s(t,n[1],r),a=String(i[0]),l=String(o[0]);try{let c=n.length>2?String(s(t,n[2],r)[0]):"";return[ee(a,c).replace(t,l)]}catch{return[t]}}case"gsub":{if(typeof t!="string"||n.length<2)return[null];let i=s(t,n[0],r),o=s(t,n[1],r),a=String(i[0]),l=String(o[0]);try{let c=n.length>2?String(s(t,n[2],r)[0]):"g",u=c.includes("g")?c:`${c}g`;return[ee(a,u).replace(t,l)]}catch{return[t]}}case"ascii_downcase":return typeof t=="string"?[t.replace(/[A-Z]/g,i=>String.fromCharCode(i.charCodeAt(0)+32))]:[null];case"ascii_upcase":return typeof t=="string"?[t.replace(/[a-z]/g,i=>String.fromCharCode(i.charCodeAt(0)-32))]:[null];case"ltrimstr":{if(typeof t!="string"||n.length===0)return[t];let i=s(t,n[0],r),o=String(i[0]);return[t.startsWith(o)?t.slice(o.length):t]}case"rtrimstr":{if(typeof t!="string"||n.length===0)return[t];let i=s(t,n[0],r),o=String(i[0]);return o===""?[t]:[t.endsWith(o)?t.slice(0,-o.length):t]}case"trimstr":{if(typeof t!="string"||n.length===0)return[t];let i=s(t,n[0],r),o=String(i[0]);if(o==="")return[t];let a=t;return a.startsWith(o)&&(a=a.slice(o.length)),a.endsWith(o)&&(a=a.slice(0,-o.length)),[a]}case"trim":if(typeof t=="string")return[t.trim()];throw new Error("trim input must be a string");case"ltrim":if(typeof t=="string")return[t.trimStart()];throw new Error("trim input must be a string");case"rtrim":if(typeof t=="string")return[t.trimEnd()];throw new Error("trim input must be a string");case"startswith":{if(typeof t!="string"||n.length===0)return[!1];let i=s(t,n[0],r);return[t.startsWith(String(i[0]))]}case"endswith":{if(typeof t!="string"||n.length===0)return[!1];let i=s(t,n[0],r);return[t.endsWith(String(i[0]))]}case"ascii":return typeof t=="string"&&t.length>0?[t.charCodeAt(0)]:[null];case"explode":return typeof t=="string"?[Array.from(t).map(i=>i.codePointAt(0))]:[null];case"implode":if(!Array.isArray(t))throw new Error("implode input must be an array");return[t.map(a=>{if(typeof a=="string")throw new Error(`string (${JSON.stringify(a)}) can't be imploded, unicode codepoint needs to be numeric`);if(typeof a!="number"||Number.isNaN(a))throw new Error("number (null) can't be imploded, unicode codepoint needs to be numeric");let l=Math.trunc(a);return l<0||l>1114111||l>=55296&&l<=57343?String.fromCodePoint(65533):String.fromCodePoint(l)}).join("")];default:return null}}var Kh=I(()=>{"use strict";Ve()});function wl(t,e){switch(e){case"type":return t===null?["null"]:Array.isArray(t)?["array"]:typeof t=="boolean"?["boolean"]:typeof t=="number"?["number"]:typeof t=="string"?["string"]:typeof t=="object"?["object"]:["null"];case"infinite":return[Number.POSITIVE_INFINITY];case"nan":return[Number.NaN];case"isinfinite":return[typeof t=="number"&&!Number.isFinite(t)];case"isnan":return[typeof t=="number"&&Number.isNaN(t)];case"isnormal":return[typeof t=="number"&&Number.isFinite(t)&&t!==0];case"isfinite":return[typeof t=="number"&&Number.isFinite(t)];case"numbers":return typeof t=="number"?[t]:[];case"strings":return typeof t=="string"?[t]:[];case"booleans":return typeof t=="boolean"?[t]:[];case"nulls":return t===null?[t]:[];case"arrays":return Array.isArray(t)?[t]:[];case"objects":return t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"iterables":return Array.isArray(t)||t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"scalars":return!Array.isArray(t)&&!(t&&typeof t=="object")?[t]:[];case"values":return t===null?[]:[t];case"not":return t===!1||t===null?[!0]:[!1];case"null":return[null];case"true":return[!0];case"false":return[!1];case"empty":return[];default:return null}}var Xh=I(()=>{"use strict"});var Jh=I(()=>{"use strict";Wh();zh();Hh();jh();Gh();Vh();qh();Zh();Yh();Qh();Kh();Xh()});function Ui(t,e,n){if(e.length===0)return n;let[r,...s]=e;if(typeof r=="number"){if(t&&typeof t=="object"&&!Array.isArray(t))throw new Error("Cannot index object with number");if(r>536870911)throw new Error("Array index too large");if(r<0)throw new Error("Out of bounds negative array index");let l=Array.isArray(t)?[...t]:[];for(;l.length<=r;)l.push(null);return l[r]=Ui(l[r],s,n),l}if(Array.isArray(t))throw new Error("Cannot index array with string");if(!Me(r))return t??Object.create(null);let i=t&&typeof t=="object"&&!Array.isArray(t)?rt(t):Object.create(null),o=Object.hasOwn(i,r)?i[r]:void 0;return We(i,r,Ui(o,s,n)),i}function Bi(t,e){if(e.length===0)return null;if(e.length===1){let s=e[0];if(Array.isArray(t)&&typeof s=="number"){let i=[...t];return i.splice(s,1),i}if(t&&typeof t=="object"&&!Array.isArray(t)){let i=String(s);if(!Me(i))return t;let o=rt(t);return delete o[i],o}return t}let[n,...r]=e;if(Array.isArray(t)&&typeof n=="number"){let s=[...t];return s[n]=Bi(s[n],r),s}if(t&&typeof t=="object"&&!Array.isArray(t)){let s=String(n);if(!Me(s))return t;let i=rt(t);return Object.hasOwn(i,s)&&We(i,s,Bi(i[s],r)),i}return t}var ed=I(()=>{"use strict";Pn()});function A5(t){return{vars:new Map,limits:{maxIterations:t?.limits?.maxIterations??x5,maxDepth:t?.limits?.maxDepth??rd},env:t?.env,coverage:t?.coverage}}function Hi(t,e,n){let r=new Map(t.vars);return r.set(e,n),{vars:r,limits:t.limits,env:t.env,root:t.root,currentPath:t.currentPath,funcs:t.funcs,labels:t.labels,coverage:t.coverage}}function Os(t,e,n){switch(e.type){case"var":return Hi(t,e.name,n);case"array":{if(!Array.isArray(n))return null;let r=t;for(let s=0;s<e.elements.length;s++){let i=e.elements[s],o=s<n.length?n[s]:null,a=Os(r,i,o);if(a===null)return null;r=a}return r}case"object":{if(n===null||typeof n!="object"||Array.isArray(n))return null;let r=n,s=t;for(let i of e.fields){let o;if(typeof i.key=="string")o=i.key;else{let c=X(n,i.key,t);if(c.length===0)return null;o=String(c[0])}let a=En(r,o)?r[o]:null;i.keyVar&&(s=Hi(s,i.keyVar,a));let l=Os(s,i.pattern,a);if(l===null)return null;s=l}return s}}}function S5(t,e){let n=t;for(let r of e)if(n&&typeof n=="object")if(Array.isArray(n))if(typeof r=="number")n=n[r];else return;else{let s=n;if(typeof r=="string"&&Object.hasOwn(s,r))n=s[r];else return}else return;return n}function Hn(t){if(t.type==="Identity")return[];if(t.type==="Field"){let e=t.base?Hn(t.base):[];return e===null?null:[...e,t.name]}if(t.type==="Index"&&t.index.type==="Literal"){let e=t.base?Hn(t.base):[];if(e===null)return null;let n=t.index.value;return typeof n=="number"||typeof n=="string"?[...e,n]:null}if(t.type==="Pipe"){let e=Hn(t.left);return e===null?null:bl(e,t.right)}if(t.type==="Call"){if(t.name==="parent"||t.name==="root")return null;if(t.name==="first"&&t.args.length===0)return[0];if(t.name==="last"&&t.args.length===0)return[-1]}return null}function bl(t,e){if(e.type==="Call"){if(e.name==="parent"){let n=1;if(e.args.length>0&&e.args[0].type==="Literal"){let r=e.args[0].value;typeof r=="number"&&(n=r)}if(n>=0)return t.slice(0,Math.max(0,t.length-n));{let r=-n-1;return t.slice(0,Math.min(r,t.length))}}if(e.name==="root")return[]}if(e.type==="Field"){let n=Hn(e);if(n!==null)return[...t,...n]}if(e.type==="Index"&&e.index.type==="Literal"){let n=Hn(e);if(n!==null)return[...t,...n]}if(e.type==="Pipe"){let n=bl(t,e.left);return n===null?null:bl(n,e.right)}return e.type==="Identity"?t:null}function td(t,e,n){if(e.type==="Comma"){let r=[];try{r.push(...X(t,e.left,n))}catch(s){if(s instanceof ae)throw s;if(r.length>0)return r;throw new Error("evaluation failed")}try{r.push(...X(t,e.right,n))}catch(s){if(s instanceof ae)throw s;return r}return r}return X(t,e,n)}function X(t,e,n){let r=n&&"vars"in n?n:A5(n);switch(r.root===void 0&&(r={...r,root:t,currentPath:[]}),r.coverage?.hit(`jq:node:${e.type}`),e.type){case"Identity":return[t];case"Field":return(e.base?X(t,e.base,r):[t]).flatMap(i=>{if(i&&typeof i=="object"&&!Array.isArray(i)){let a=i;if(!Object.hasOwn(a,e.name))return[null];let l=a[e.name];return[l===void 0?null:l]}if(i===null)return[null];let o=Array.isArray(i)?"array":typeof i;throw new Error(`Cannot index ${o} with string "${e.name}"`)});case"Index":return(e.base?X(t,e.base,r):[t]).flatMap(i=>X(i,e.index,r).flatMap(a=>{if(typeof a=="number"&&Array.isArray(i)){if(Number.isNaN(a))return[null];let l=Math.trunc(a),c=l<0?i.length+l:l;return c>=0&&c<i.length?[i[c]]:[null]}if(typeof a=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){let l=i;return Object.hasOwn(l,a)?[l[a]]:[null]}return[null]}));case"Slice":return(e.base?X(t,e.base,r):[t]).flatMap(i=>{if(i===null)return[null];if(!Array.isArray(i)&&typeof i!="string")throw new Error(`Cannot slice ${typeof i} (${JSON.stringify(i)})`);let o=i.length,a=e.start?X(t,e.start,r):[0],l=e.end?X(t,e.end,r):[o];return a.flatMap(c=>l.map(u=>{let f=c,p=u,h=Number.isNaN(f)?0:Number.isInteger(f)?f:Math.floor(f),m=Number.isNaN(p)?o:Number.isInteger(p)?p:Math.ceil(p),d=nd(h,o),g=nd(m,o);return Array.isArray(i),i.slice(d,g)}))});case"Iterate":return(e.base?X(t,e.base,r):[t]).flatMap(i=>Array.isArray(i)?i:i&&typeof i=="object"?Object.values(i):[]);case"Pipe":{let s=X(t,e.left,r),i=Hn(e.left),o=[];for(let a of s)try{if(i!==null){let l={...r,currentPath:[...r.currentPath??[],...i]};o.push(...X(a,e.right,l))}else o.push(...X(a,e.right,r))}catch(l){throw l instanceof jr?l.withPrependedResults(o):l}return o}case"Comma":{let s=X(t,e.left,r),i=X(t,e.right,r);return[...s,...i]}case"Literal":return[e.value];case"Array":return e.elements?[X(t,e.elements,r)]:[[]];case"Object":{let s=[Object.create(null)];for(let i of e.entries){let o=typeof i.key=="string"?[i.key]:X(t,i.key,r),a=X(t,i.value,r),l=[];for(let c of s)for(let u of o){if(typeof u!="string"){let f=u===null?"null":Array.isArray(u)?"array":typeof u;throw new Error(`Cannot use ${f} (${JSON.stringify(u)}) as object key`)}if(!Me(u)){for(let f of a)l.push(rt(c));continue}for(let f of a){let p=rt(c);We(p,u,f),l.push(p)}}s.length=0,s.push(...l)}return s}case"Paren":return X(t,e.expr,r);case"BinaryOp":return v5(t,e.op,e.left,e.right,r);case"UnaryOp":return X(t,e.operand,r).map(i=>{if(e.op==="-"){if(typeof i=="number")return-i;if(typeof i=="string"){let o=a=>a.length>5?`"${a.slice(0,3)}...`:JSON.stringify(a);throw new Error(`string (${o(i)}) cannot be negated`)}return null}return e.op==="not"?!sn(i):null});case"Cond":return X(t,e.cond,r).flatMap(i=>{if(sn(i))return X(t,e.then,r);for(let o of e.elifs)if(X(t,o.cond,r).some(sn))return X(t,o.then,r);return e.else?X(t,e.else,r):[t]});case"Try":try{return X(t,e.body,r)}catch(s){if(e.catch){let i=s instanceof zi?s.value:s instanceof Error?s.message:String(s);return X(i,e.catch,r)}return[]}case"Call":return sd(t,e.name,e.args,r);case"VarBind":return X(t,e.value,r).flatMap(i=>{let o=null,a=[];e.pattern?a.push(e.pattern):e.name&&a.push({type:"var",name:e.name}),e.alternatives&&a.push(...e.alternatives);for(let l of a)if(o=Os(r,l,i),o!==null)break;return o===null?[]:X(t,e.body,o)});case"VarRef":{if(e.name==="$ENV")return[r.env?Rt(r.env):Object.create(null)];let s=r.vars.get(e.name);return s!==void 0?[s]:[null]}case"Recurse":{let s=[],i=new WeakSet,o=a=>{if(a&&typeof a=="object"){if(i.has(a))return;i.add(a)}if(s.push(a),Array.isArray(a))for(let l of a)o(l);else if(a&&typeof a=="object")for(let l of Object.keys(a))o(a[l])};return o(t),s}case"Optional":try{return X(t,e.expr,r)}catch{return[]}case"StringInterp":return[e.parts.map(i=>typeof i=="string"?i:X(t,i,r).map(a=>typeof a=="string"?a:JSON.stringify(a)).join("")).join("")];case"UpdateOp":return[C5(t,e.path,e.op,e.value,r)];case"Reduce":{let s=X(t,e.expr,r),i=X(t,e.init,r)[0],o=r.limits.maxDepth??rd;for(let a of s){let l;if(e.pattern){if(l=Os(r,e.pattern,a),l===null)continue}else l=Hi(r,e.varName,a);if(i=X(i,e.update,l)[0],Hr(i,o+1)>o)return[null]}return[i]}case"Foreach":{let s=X(t,e.expr,r),i=X(t,e.init,r)[0],o=[];for(let a of s)try{let l;if(e.pattern){if(l=Os(r,e.pattern,a),l===null)continue}else l=Hi(r,e.varName,a);if(i=X(i,e.update,l)[0],e.extract){let c=X(i,e.extract,l);o.push(...c)}else o.push(i)}catch(l){throw l instanceof jr?l.withPrependedResults(o):l}return o}case"Label":try{return X(t,e.body,{...r,labels:new Set([...r.labels??[],e.name])})}catch(s){if(s instanceof jr&&s.label===e.name)return s.partialResults;throw s}case"Break":throw new jr(e.name);case"Def":{let s=new Map(r.funcs??[]),i=`${e.name}/${e.params.length}`;s.set(i,{params:e.params,body:e.funcBody,closure:new Map(r.funcs??[])});let o={...r,funcs:s};return X(t,e.body,o)}default:{let s=e;throw new Error(`Unknown AST node type: ${s.type}`)}}}function nd(t,e){return t<0?Math.max(0,e+t):Math.min(t,e)}function C5(t,e,n,r,s){function i(l,c){switch(n){case"=":return c;case"|=":return X(l,r,s)[0]??null;case"+=":return typeof l=="number"&&typeof c=="number"||typeof l=="string"&&typeof c=="string"?l+c:Array.isArray(l)&&Array.isArray(c)?[...l,...c]:l&&c&&typeof l=="object"&&typeof c=="object"?il(l,c):c;case"-=":return typeof l=="number"&&typeof c=="number"?l-c:l;case"*=":return typeof l=="number"&&typeof c=="number"?l*c:l;case"/=":return typeof l=="number"&&typeof c=="number"?l/c:l;case"%=":return typeof l=="number"&&typeof c=="number"?l%c:l;case"//=":return l===null||l===!1?c:l;default:return c}}function o(l,c,u){switch(c.type){case"Identity":return u(l);case"Field":{if(!Me(c.name))return l;if(c.base)return o(l,c.base,f=>{if(f&&typeof f=="object"&&!Array.isArray(f)){let p=rt(f),h=Object.hasOwn(p,c.name)?p[c.name]:void 0;return We(p,c.name,u(h)),p}return f});if(l&&typeof l=="object"&&!Array.isArray(l)){let f=rt(l),p=Object.hasOwn(f,c.name)?f[c.name]:void 0;return We(f,c.name,u(p)),f}return l}case"Index":{let p=X(t,c.index,s)[0];if(typeof p=="number"&&Number.isNaN(p))throw new Error("Cannot set array element at NaN index");if(typeof p=="number"&&!Number.isInteger(p)&&(p=Math.trunc(p)),c.base)return o(l,c.base,h=>{if(typeof p=="number"&&Array.isArray(h)){let m=[...h],d=p<0?m.length+p:p;if(d>=0){for(;m.length<=d;)m.push(null);m[d]=u(m[d])}return m}if(typeof p=="string"&&h&&typeof h=="object"&&!Array.isArray(h)){if(!Me(p))return h;let m=rt(h),d=Object.hasOwn(m,p)?m[p]:void 0;return We(m,p,u(d)),m}return h});if(typeof p=="number"){if(p>536870911)throw new Error("Array index too large");if(p<0&&(!l||!Array.isArray(l)))throw new Error("Out of bounds negative array index");if(Array.isArray(l)){let m=[...l],d=p<0?m.length+p:p;if(d>=0){for(;m.length<=d;)m.push(null);m[d]=u(m[d])}return m}if(l==null){let m=[];for(;m.length<=p;)m.push(null);return m[p]=u(null),m}return l}if(typeof p=="string"&&l&&typeof l=="object"&&!Array.isArray(l)){if(!Me(p))return l;let h=rt(l),m=Object.hasOwn(h,p)?h[p]:void 0;return We(h,p,u(m)),h}return l}case"Iterate":{let f=p=>{if(Array.isArray(p))return p.map(h=>u(h));if(p&&typeof p=="object"){let h=Object.create(null);for(let[m,d]of Object.entries(p))Me(m)&&We(h,m,u(d));return h}return p};return c.base?o(l,c.base,f):f(l)}case"Pipe":{let f=o(l,c.left,p=>p);return o(f,c.right,u)}default:return u(l)}}return o(t,e,l=>{if(n==="|=")return i(l,l);let c=X(t,r,s);return i(l,c[0]??null)})}function N5(t,e,n){function r(i,o,a){switch(o.type){case"Identity":return a;case"Field":{if(!Me(o.name))return i;if(o.base){let l=X(i,o.base,n)[0],c=r(l,{type:"Field",name:o.name},a);return r(i,o.base,c)}if(i&&typeof i=="object"&&!Array.isArray(i)){let l=rt(i);return We(l,o.name,a),l}return i}case"Index":{if(o.base){let u=X(i,o.base,n)[0],f=r(u,{type:"Index",index:o.index},a);return r(i,o.base,f)}let c=X(t,o.index,n)[0];if(typeof c=="number"&&Array.isArray(i)){let u=[...i],f=c<0?u.length+c:c;return f>=0&&f<u.length&&(u[f]=a),u}if(typeof c=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){if(!Me(c))return i;let u=rt(i);return We(u,c,a),u}return i}default:return i}}function s(i,o){switch(o.type){case"Identity":return null;case"Field":{if(!Me(o.name))return i;if(o.base){let l=X(i,o.base,n)[0];if(l==null)return i;let c=s(l,{type:"Field",name:o.name});return r(i,o.base,c)}if(i&&typeof i=="object"&&!Array.isArray(i)){if(!Me(o.name))return i;let l=rt(i);return delete l[o.name],l}return i}case"Index":{if(o.base){let u=X(i,o.base,n)[0];if(u==null)return i;let f=s(u,{type:"Index",index:o.index});return r(i,o.base,f)}let c=X(t,o.index,n)[0];if(typeof c=="number"&&Array.isArray(i)){let u=[...i],f=c<0?u.length+c:c;return f>=0&&f<u.length&&u.splice(f,1),u}if(typeof c=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){if(!Me(c))return i;let u=rt(i);return delete u[c],u}return i}case"Iterate":return Array.isArray(i)?[]:i&&typeof i=="object"?Object.create(null):i;case"Pipe":{let u=function(h,m,d){switch(m.type){case"Identity":return d;case"Field":{if(!Me(m.name))return h;if(h&&typeof h=="object"&&!Array.isArray(h)){let g=rt(h);return We(g,m.name,d),g}return h}case"Index":{let w=X(t,m.index,n)[0];if(typeof w=="number"&&Array.isArray(h)){let E=[...h],b=w<0?E.length+w:w;return b>=0&&b<E.length&&(E[b]=d),E}if(typeof w=="string"&&h&&typeof h=="object"&&!Array.isArray(h)){if(!Me(w))return h;let E=rt(h);return We(E,w,d),E}return h}case"Pipe":{let g=X(h,m.left,n)[0],w=u(g,m.right,d);return u(h,m.left,w)}default:return h}};var a=u;let l=o.left,c=o.right,f=X(i,l,n)[0];if(f==null)return i;let p=s(f,c);return u(i,l,p)}default:return i}}return s(t,e)}function v5(t,e,n,r,s){if(e==="and")return X(t,n,s).flatMap(l=>sn(l)?X(t,r,s).map(u=>sn(u)):[!1]);if(e==="or")return X(t,n,s).flatMap(l=>sn(l)?[!0]:X(t,r,s).map(u=>sn(u)));if(e==="//"){let l=X(t,n,s).filter(c=>c!=null&&c!==!1);return l.length>0?l:X(t,r,s)}let i=X(t,n,s),o=X(t,r,s);return i.flatMap(a=>o.map(l=>{switch(e){case"+":return a===null?l:l===null?a:typeof a=="number"&&typeof l=="number"||typeof a=="string"&&typeof l=="string"?a+l:Array.isArray(a)&&Array.isArray(l)?[...a,...l]:a&&l&&typeof a=="object"&&typeof l=="object"&&!Array.isArray(a)&&!Array.isArray(l)?il(a,l):null;case"-":if(typeof a=="number"&&typeof l=="number")return a-l;if(Array.isArray(a)&&Array.isArray(l)){let c=new Set(l.map(u=>JSON.stringify(u)));return a.filter(u=>!c.has(JSON.stringify(u)))}if(typeof a=="string"&&typeof l=="string"){let c=u=>u.length>10?`"${u.slice(0,10)}...`:JSON.stringify(u);throw new Error(`string (${c(a)}) and string (${c(l)}) cannot be subtracted`)}return null;case"*":return typeof a=="number"&&typeof l=="number"?a*l:typeof a=="string"&&typeof l=="number"?a.repeat(l):a&&l&&typeof a=="object"&&typeof l=="object"&&!Array.isArray(a)&&!Array.isArray(l)?cl(a,l):null;case"/":if(typeof a=="number"&&typeof l=="number"){if(l===0)throw new Error(`number (${a}) and number (${l}) cannot be divided because the divisor is zero`);return a/l}return typeof a=="string"&&typeof l=="string"?a.split(l):null;case"%":if(typeof a=="number"&&typeof l=="number"){if(l===0)throw new Error(`number (${a}) and number (${l}) cannot be divided (remainder) because the divisor is zero`);return!Number.isFinite(a)&&!Number.isNaN(a)?!Number.isFinite(l)&&!Number.isNaN(l)&&a<0&&l>0?-1:0:a%l}return null;case"==":return zr(a,l);case"!=":return!zr(a,l);case"<":return Ts(a,l)<0;case"<=":return Ts(a,l)<=0;case">":return Ts(a,l)>0;case">=":return Ts(a,l)>=0;default:return null}}))}function sd(t,e,n,r){let s=E5.get(e);if(s)return typeof t=="number"?[s(t)]:[null];let i=pl(t,e,n,r,X);if(i!==null)return i;let o=yl(t,e,n,r,X);if(o!==null)return o;let a=ll(t,e,n,r,X);if(a!==null)return a;let l=ul(t,e,r.limits.maxDepth);if(l!==null)return l;let c=wl(t,e);if(c!==null)return c;let u=dl(t,e,n,r,X);if(u!==null)return u;let f=ol(t,e,n,r,X,td,Mi,sn,Li,ae);if(f!==null)return f;let p=ml(t,e,n,r,X,sn,Ui,Bi,N5,Wi);if(p!==null)return p;let h=fl(t,e,n,r,X,zr);if(h!==null)return h;let m=al(t,e,n,r,X,td,sn,ae);if(m!==null)return m;let d=hl(t,e,n,r,X,sn,S5,sd);if(d!==null)return d;let g=gl(t,e,n,r,X,zr);if(g!==null)return g;switch(e){case"builtins":return[["add/0","all/0","all/1","all/2","any/0","any/1","any/2","arrays/0","ascii/0","ascii_downcase/0","ascii_upcase/0","booleans/0","bsearch/1","builtins/0","combinations/0","combinations/1","contains/1","debug/0","del/1","delpaths/1","empty/0","env/0","error/0","error/1","explode/0","first/0","first/1","flatten/0","flatten/1","floor/0","from_entries/0","fromdate/0","fromjson/0","getpath/1","gmtime/0","group_by/1","gsub/2","gsub/3","has/1","implode/0","IN/1","IN/2","INDEX/1","INDEX/2","index/1","indices/1","infinite/0","inside/1","isempty/1","isnan/0","isnormal/0","isvalid/1","iterables/0","join/1","keys/0","keys_unsorted/0","last/0","last/1","length/0","limit/2","ltrimstr/1","map/1","map_values/1","match/1","match/2","max/0","max_by/1","min/0","min_by/1","mktime/0","modulemeta/1","nan/0","not/0","nth/1","nth/2","null/0","nulls/0","numbers/0","objects/0","path/1","paths/0","paths/1","pick/1","range/1","range/2","range/3","recurse/0","recurse/1","recurse_down/0","repeat/1","reverse/0","rindex/1","rtrimstr/1","scalars/0","scan/1","scan/2","select/1","setpath/2","skip/2","sort/0","sort_by/1","split/1","splits/1","splits/2","sqrt/0","startswith/1","strftime/1","strings/0","strptime/1","sub/2","sub/3","test/1","test/2","to_entries/0","toboolean/0","todate/0","tojson/0","tostream/0","fromstream/1","truncate_stream/1","tonumber/0","tostring/0","transpose/0","trim/0","ltrim/0","rtrim/0","type/0","unique/0","unique_by/1","until/2","utf8bytelength/0","values/0","walk/1","while/2","with_entries/1"]];case"error":{let w=n.length>0?X(t,n[0],r)[0]:t;throw new zi(w)}case"env":return[r.env?Rt(r.env):Object.create(null)];case"debug":return[t];case"input_line_number":return[1];default:{let w=`${e}/${n.length}`,E=r.funcs?.get(w);if(E){let b=E.closure??r.funcs??new Map,A=new Map(b);A.set(w,E);for(let P=0;P<E.params.length;P++){let O=E.params[P],G=n[P];if(G){let M=X(t,G,r),Y;if(M.length===0)Y={type:"Call",name:"empty",args:[]};else if(M.length===1)Y={type:"Literal",value:M[0]};else{Y={type:"Literal",value:M[M.length-1]};for(let B=M.length-2;B>=0;B--)Y={type:"Comma",left:{type:"Literal",value:M[B]},right:Y}}A.set(`${O}/0`,{params:[],body:Y})}}let N={...r,funcs:A};return X(t,E.body,N)}throw new Error(`Unknown function: ${e}`)}}}function Wi(t,e,n,r,s){if(e.type==="Comma"){let a=e;Wi(t,a.left,n,r,s),Wi(t,a.right,n,r,s);return}let i=Hn(e);if(i!==null){s.push([...r,...i]);return}if(e.type==="Iterate"){if(Array.isArray(t))for(let a=0;a<t.length;a++)s.push([...r,a]);else if(t&&typeof t=="object")for(let a of Object.keys(t))s.push([...r,a]);return}if(e.type==="Recurse"){let a=(l,c)=>{if(s.push([...r,...c]),l&&typeof l=="object")if(Array.isArray(l))for(let u=0;u<l.length;u++)a(l[u],[...c,u]);else for(let u of Object.keys(l))a(l[u],[...c,u])};a(t,[]);return}if(e.type==="Pipe"){let a=Hn(e.left);if(a!==null){let l=X(t,e.left,n);for(let c of l)Wi(c,e.right,n,[...r,...a],s);return}}X(t,e,n).length>0&&s.push(r)}var jr,zi,x5,rd,E5,id=I(()=>{"use strict";Wn();Ne();Jh();ed();Pn();Fi();jr=class t extends Error{label;partialResults;constructor(e,n=[]){super(`break ${e}`),this.label=e,this.partialResults=n,this.name="BreakError"}withPrependedResults(e){return new t(this.label,[...e,...this.partialResults])}},zi=class extends Error{value;constructor(e){super(typeof e=="string"?e:JSON.stringify(e)),this.value=e,this.name="JqError"}},x5=1e4,rd=2e3,E5=new Map([["floor",Math.floor],["ceil",Math.ceil],["round",Math.round],["sqrt",Math.sqrt],["log",Math.log],["log10",Math.log10],["log2",Math.log2],["exp",Math.exp],["sin",Math.sin],["cos",Math.cos],["tan",Math.tan],["asin",Math.asin],["acos",Math.acos],["atan",Math.atan],["sinh",Math.sinh],["cosh",Math.cosh],["tanh",Math.tanh],["asinh",Math.asinh],["acosh",Math.acosh],["atanh",Math.atanh],["cbrt",Math.cbrt],["expm1",Math.expm1],["log1p",Math.log1p],["trunc",Math.trunc]])});function ad(t){let e=[],n=0,r=(c=0)=>t[n+c],s=()=>t[n++],i=()=>n>=t.length,o=c=>c>="0"&&c<="9",a=c=>c>="a"&&c<="z"||c>="A"&&c<="Z"||c==="_",l=c=>a(c)||o(c);for(;!i();){let c=n,u=s();if(!(u===" "||u===" "||u===`
544
+ `||u==="\r")){if(u==="#"){for(;!i()&&r()!==`
545
+ `;)s();continue}if(u==="."&&r()==="."){s(),e.push({type:"DOTDOT",pos:c});continue}if(u==="="&&r()==="="){s(),e.push({type:"EQ",pos:c});continue}if(u==="!"&&r()==="="){s(),e.push({type:"NE",pos:c});continue}if(u==="<"&&r()==="="){s(),e.push({type:"LE",pos:c});continue}if(u===">"&&r()==="="){s(),e.push({type:"GE",pos:c});continue}if(u==="/"&&r()==="/"){s(),r()==="="?(s(),e.push({type:"UPDATE_ALT",pos:c})):e.push({type:"ALT",pos:c});continue}if(u==="+"&&r()==="="){s(),e.push({type:"UPDATE_ADD",pos:c});continue}if(u==="-"&&r()==="="){s(),e.push({type:"UPDATE_SUB",pos:c});continue}if(u==="*"&&r()==="="){s(),e.push({type:"UPDATE_MUL",pos:c});continue}if(u==="/"&&r()==="="){s(),e.push({type:"UPDATE_DIV",pos:c});continue}if(u==="%"&&r()==="="){s(),e.push({type:"UPDATE_MOD",pos:c});continue}if(u==="="&&r()!=="="){e.push({type:"ASSIGN",pos:c});continue}if(u==="."){e.push({type:"DOT",pos:c});continue}if(u==="|"){r()==="="?(s(),e.push({type:"UPDATE_PIPE",pos:c})):e.push({type:"PIPE",pos:c});continue}if(u===","){e.push({type:"COMMA",pos:c});continue}if(u===":"){e.push({type:"COLON",pos:c});continue}if(u===";"){e.push({type:"SEMICOLON",pos:c});continue}if(u==="("){e.push({type:"LPAREN",pos:c});continue}if(u===")"){e.push({type:"RPAREN",pos:c});continue}if(u==="["){e.push({type:"LBRACKET",pos:c});continue}if(u==="]"){e.push({type:"RBRACKET",pos:c});continue}if(u==="{"){e.push({type:"LBRACE",pos:c});continue}if(u==="}"){e.push({type:"RBRACE",pos:c});continue}if(u==="?"){e.push({type:"QUESTION",pos:c});continue}if(u==="+"){e.push({type:"PLUS",pos:c});continue}if(u==="-"){e.push({type:"MINUS",pos:c});continue}if(u==="*"){e.push({type:"STAR",pos:c});continue}if(u==="/"){e.push({type:"SLASH",pos:c});continue}if(u==="%"){e.push({type:"PERCENT",pos:c});continue}if(u==="<"){e.push({type:"LT",pos:c});continue}if(u===">"){e.push({type:"GT",pos:c});continue}if(o(u)){let f=u;for(;!i()&&(o(r())||r()==="."||r()==="e"||r()==="E");)(r()==="e"||r()==="E")&&(t[n+1]==="+"||t[n+1]==="-")&&(f+=s()),f+=s();e.push({type:"NUMBER",value:Number(f),pos:c});continue}if(u==='"'){let f="";for(;!i()&&r()!=='"';)if(r()==="\\"){if(s(),i())break;let p=s();switch(p){case"n":f+=`
546
+ `;break;case"r":f+="\r";break;case"t":f+=" ";break;case"\\":f+="\\";break;case'"':f+='"';break;case"(":f+="\\(";break;default:f+=p}}else f+=s();i()||s(),e.push({type:"STRING",value:f,pos:c});continue}if(a(u)||u==="$"||u==="@"){let f=u;for(;!i()&&l(r());)f+=s();let p=od.get(f);p?e.push({type:p,value:f,pos:c}):e.push({type:"IDENT",value:f,pos:c});continue}throw new Error(`Unexpected character '${u}' at position ${c}`)}}return e.push({type:"EOF",pos:n}),e}function ld(t){let e=ad(t);return new xl(e).parse()}var od,ji,xl,cd=I(()=>{"use strict";od=new Map([["and","AND"],["or","OR"],["not","NOT"],["if","IF"],["then","THEN"],["elif","ELIF"],["else","ELSE"],["end","END"],["as","AS"],["try","TRY"],["catch","CATCH"],["true","TRUE"],["false","FALSE"],["null","NULL"],["reduce","REDUCE"],["foreach","FOREACH"],["label","LABEL"],["break","BREAK"],["def","DEF"]]),ji=new Set(od.values());xl=class t{tokens;pos=0;constructor(e){this.tokens=e}peek(e=0){return this.tokens[this.pos+e]??{type:"EOF",pos:-1}}advance(){return this.tokens[this.pos++]}check(e){return this.peek().type===e}match(...e){for(let n of e)if(this.check(n))return this.advance();return null}expect(e,n){if(!this.check(e))throw new Error(`${n} at position ${this.peek().pos}, got ${this.peek().type}`);return this.advance()}isFieldNameAfterDot(e=0){let n=this.peek(e),r=this.peek(e+1);return r.type==="STRING"?!0:r.type==="IDENT"||ji.has(r.type)?r.pos===n.pos+1:!1}isIdentLike(){let e=this.peek().type;return e==="IDENT"||ji.has(e)}consumeFieldNameAfterDot(e){let n=this.peek();return n.type==="STRING"?this.advance().value:(n.type==="IDENT"||ji.has(n.type))&&n.pos===e.pos+1?this.advance().value:null}parse(){let e=this.parseExpr();if(!this.check("EOF"))throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`);return e}parseExpr(){return this.parsePipe()}parsePattern(){if(this.match("LBRACKET")){let r=[];if(!this.check("RBRACKET"))for(r.push(this.parsePattern());this.match("COMMA")&&!this.check("RBRACKET");)r.push(this.parsePattern());return this.expect("RBRACKET","Expected ']' after array pattern"),{type:"array",elements:r}}if(this.match("LBRACE")){let r=[];if(!this.check("RBRACE"))for(r.push(this.parsePatternField());this.match("COMMA")&&!this.check("RBRACE");)r.push(this.parsePatternField());return this.expect("RBRACE","Expected '}' after object pattern"),{type:"object",fields:r}}let e=this.expect("IDENT","Expected variable name in pattern"),n=e.value;if(!n.startsWith("$"))throw new Error(`Variable name must start with $ at position ${e.pos}`);return{type:"var",name:n}}parsePatternField(){if(this.match("LPAREN")){let n=this.parseExpr();this.expect("RPAREN","Expected ')' after computed key"),this.expect("COLON","Expected ':' after computed key");let r=this.parsePattern();return{key:n,pattern:r}}let e=this.peek();if(e.type==="IDENT"||ji.has(e.type)){let n=e.value;if(n.startsWith("$")){if(this.advance(),this.match("COLON")){let r=this.parsePattern();return{key:n.slice(1),pattern:r,keyVar:n}}return{key:n.slice(1),pattern:{type:"var",name:n}}}if(this.advance(),this.match("COLON")){let r=this.parsePattern();return{key:n,pattern:r}}return{key:n,pattern:{type:"var",name:`$${n}`}}}throw new Error(`Expected field name in object pattern at position ${e.pos}`)}parsePipe(){let e=this.parseComma();for(;this.match("PIPE");){let n=this.parseComma();e={type:"Pipe",left:e,right:n}}return e}parseComma(){let e=this.parseVarBind();for(;this.match("COMMA");){let n=this.parseVarBind();e={type:"Comma",left:e,right:n}}return e}parseVarBind(){let e=this.parseUpdate();if(this.match("AS")){let n=this.parsePattern(),r=[];for(;this.check("QUESTION")&&this.peekAhead(1)?.type==="ALT";)this.advance(),this.advance(),r.push(this.parsePattern());this.expect("PIPE","Expected '|' after variable binding");let s=this.parseExpr();return n.type==="var"&&r.length===0?{type:"VarBind",name:n.name,value:e,body:s}:{type:"VarBind",name:n.type==="var"?n.name:"",value:e,body:s,pattern:n.type!=="var"?n:void 0,alternatives:r.length>0?r:void 0}}return e}peekAhead(e){let n=this.pos+e;return n<this.tokens.length?this.tokens[n]:void 0}parseUpdate(){let e=this.parseAlt(),n=new Map([["ASSIGN","="],["UPDATE_ADD","+="],["UPDATE_SUB","-="],["UPDATE_MUL","*="],["UPDATE_DIV","/="],["UPDATE_MOD","%="],["UPDATE_ALT","//="],["UPDATE_PIPE","|="]]),r=this.match("ASSIGN","UPDATE_ADD","UPDATE_SUB","UPDATE_MUL","UPDATE_DIV","UPDATE_MOD","UPDATE_ALT","UPDATE_PIPE");if(r){let s=this.parseVarBind(),i=n.get(r.type);if(i)return{type:"UpdateOp",op:i,path:e,value:s}}return e}parseAlt(){let e=this.parseOr();for(;this.match("ALT");){let n=this.parseOr();e={type:"BinaryOp",op:"//",left:e,right:n}}return e}parseOr(){let e=this.parseAnd();for(;this.match("OR");){let n=this.parseAnd();e={type:"BinaryOp",op:"or",left:e,right:n}}return e}parseAnd(){let e=this.parseNot();for(;this.match("AND");){let n=this.parseNot();e={type:"BinaryOp",op:"and",left:e,right:n}}return e}parseNot(){return this.parseComparison()}parseComparison(){let e=this.parseAddSub(),n=new Map([["EQ","=="],["NE","!="],["LT","<"],["LE","<="],["GT",">"],["GE",">="]]),r=this.match("EQ","NE","LT","LE","GT","GE");if(r){let s=n.get(r.type);if(s){let i=this.parseAddSub();e={type:"BinaryOp",op:s,left:e,right:i}}}return e}parseAddSub(){let e=this.parseMulDiv();for(;;)if(this.match("PLUS")){let n=this.parseMulDiv();e={type:"BinaryOp",op:"+",left:e,right:n}}else if(this.match("MINUS")){let n=this.parseMulDiv();e={type:"BinaryOp",op:"-",left:e,right:n}}else break;return e}parseMulDiv(){let e=this.parseUnary();for(;;)if(this.match("STAR")){let n=this.parseUnary();e={type:"BinaryOp",op:"*",left:e,right:n}}else if(this.match("SLASH")){let n=this.parseUnary();e={type:"BinaryOp",op:"/",left:e,right:n}}else if(this.match("PERCENT")){let n=this.parseUnary();e={type:"BinaryOp",op:"%",left:e,right:n}}else break;return e}parseUnary(){return this.match("MINUS")?{type:"UnaryOp",op:"-",operand:this.parseUnary()}:this.parsePostfix()}parsePostfix(){let e=this.parsePrimary();for(;;)if(this.match("QUESTION"))e={type:"Optional",expr:e};else if(this.check("DOT")&&this.isFieldNameAfterDot())this.advance(),e={type:"Field",name:this.advance().value,base:e};else if(this.check("LBRACKET"))if(this.advance(),this.match("RBRACKET"))e={type:"Iterate",base:e};else if(this.check("COLON")){this.advance();let n=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),e={type:"Slice",end:n,base:e}}else{let n=this.parseExpr();if(this.match("COLON")){let r=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),e={type:"Slice",start:n,end:r,base:e}}else this.expect("RBRACKET","Expected ']'"),e={type:"Index",index:n,base:e}}else break;return e}parsePrimary(){if(this.match("DOTDOT"))return{type:"Recurse"};if(this.check("DOT")){let e=this.advance();if(this.check("LBRACKET")){if(this.advance(),this.match("RBRACKET"))return{type:"Iterate"};if(this.check("COLON")){this.advance();let s=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",end:s}}let r=this.parseExpr();if(this.match("COLON")){let s=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",start:r,end:s}}return this.expect("RBRACKET","Expected ']'"),{type:"Index",index:r}}let n=this.consumeFieldNameAfterDot(e);return n!==null?{type:"Field",name:n}:{type:"Identity"}}if(this.match("TRUE"))return{type:"Literal",value:!0};if(this.match("FALSE"))return{type:"Literal",value:!1};if(this.match("NULL"))return{type:"Literal",value:null};if(this.check("NUMBER"))return{type:"Literal",value:this.advance().value};if(this.check("STRING")){let n=this.advance().value;return n.includes("\\(")?this.parseStringInterpolation(n):{type:"Literal",value:n}}if(this.match("LBRACKET")){if(this.match("RBRACKET"))return{type:"Array"};let e=this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Array",elements:e}}if(this.match("LBRACE"))return this.parseObjectConstruction();if(this.match("LPAREN")){let e=this.parseExpr();return this.expect("RPAREN","Expected ')'"),{type:"Paren",expr:e}}if(this.match("IF"))return this.parseIf();if(this.match("TRY")){let e=this.parsePostfix(),n;return this.match("CATCH")&&(n=this.parsePostfix()),{type:"Try",body:e,catch:n}}if(this.match("REDUCE")){let e=this.parseAddSub();this.expect("AS","Expected 'as' after reduce expression");let n=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let r=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let s=this.parseExpr();this.expect("RPAREN","Expected ')' after update expression");let i=n.type==="var"?n.name:"";return{type:"Reduce",expr:e,varName:i,init:r,update:s,pattern:n.type!=="var"?n:void 0}}if(this.match("FOREACH")){let e=this.parseAddSub();this.expect("AS","Expected 'as' after foreach expression");let n=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let r=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let s=this.parseExpr(),i;this.match("SEMICOLON")&&(i=this.parseExpr()),this.expect("RPAREN","Expected ')' after expressions");let o=n.type==="var"?n.name:"";return{type:"Foreach",expr:e,varName:o,init:r,update:s,extract:i,pattern:n.type!=="var"?n:void 0}}if(this.match("LABEL")){let e=this.expect("IDENT","Expected label name (e.g., $out)"),n=e.value;if(!n.startsWith("$"))throw new Error(`Label name must start with $ at position ${e.pos}`);this.expect("PIPE","Expected '|' after label name");let r=this.parseExpr();return{type:"Label",name:n,body:r}}if(this.match("BREAK")){let e=this.expect("IDENT","Expected label name to break to"),n=e.value;if(!n.startsWith("$"))throw new Error(`Break label must start with $ at position ${e.pos}`);return{type:"Break",name:n}}if(this.match("DEF")){let n=this.expect("IDENT","Expected function name after def").value,r=[];if(this.match("LPAREN")){if(!this.check("RPAREN")){let o=this.expect("IDENT","Expected parameter name");for(r.push(o.value);this.match("SEMICOLON");){let a=this.expect("IDENT","Expected parameter name");r.push(a.value)}}this.expect("RPAREN","Expected ')' after parameters")}this.expect("COLON","Expected ':' after function name");let s=this.parseExpr();this.expect("SEMICOLON","Expected ';' after function body");let i=this.parseExpr();return{type:"Def",name:n,params:r,funcBody:s,body:i}}if(this.match("NOT"))return{type:"Call",name:"not",args:[]};if(this.check("IDENT")){let n=this.advance().value;if(n.startsWith("$"))return{type:"VarRef",name:n};if(this.match("LPAREN")){let r=[];if(!this.check("RPAREN"))for(r.push(this.parseExpr());this.match("SEMICOLON");)r.push(this.parseExpr());return this.expect("RPAREN","Expected ')'"),{type:"Call",name:n,args:r}}return{type:"Call",name:n,args:[]}}throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`)}parseObjectConstruction(){let e=[];if(!this.check("RBRACE"))do{let n,r;if(this.match("LPAREN"))n=this.parseExpr(),this.expect("RPAREN","Expected ')'"),this.expect("COLON","Expected ':'"),r=this.parseObjectValue();else if(this.isIdentLike()){let s=this.advance().value;this.match("COLON")?(n=s,r=this.parseObjectValue()):(n=s,r={type:"Field",name:s})}else if(this.check("STRING"))n=this.advance().value,this.expect("COLON","Expected ':'"),r=this.parseObjectValue();else throw new Error(`Expected object key at position ${this.peek().pos}`);e.push({key:n,value:r})}while(this.match("COMMA"));return this.expect("RBRACE","Expected '}'"),{type:"Object",entries:e}}parseObjectValue(){let e=this.parseVarBind();for(;this.match("PIPE");){let n=this.parseVarBind();e={type:"Pipe",left:e,right:n}}return e}parseIf(){let e=this.parseExpr();this.expect("THEN","Expected 'then'");let n=this.parseExpr(),r=[];for(;this.match("ELIF");){let i=this.parseExpr();this.expect("THEN","Expected 'then' after elif");let o=this.parseExpr();r.push({cond:i,then:o})}let s;return this.match("ELSE")&&(s=this.parseExpr()),this.expect("END","Expected 'end'"),{type:"Cond",cond:e,then:n,elifs:r,else:s}}parseStringInterpolation(e){let n=[],r="",s=0;for(;s<e.length;)if(e[s]==="\\"&&e[s+1]==="("){r&&(n.push(r),r=""),s+=2;let i=1,o="";for(;s<e.length&&i>0;)e[s]==="("?i++:e[s]===")"&&i--,i>0&&(o+=e[s]),s++;let a=ad(o),l=new t(a);n.push(l.parse())}else r+=e[s],s++;return r&&n.push(r),{type:"StringInterp",parts:n}}}});var ud=I(()=>{"use strict";id();cd()});var pd={};se(pd,{flagsForFuzzing:()=>T5,jqCommand:()=>I5});function fd(t){let e=[],n=0,r=t.length;for(;n<r;){for(;n<r&&/\s/.test(t[n]);)n++;if(n>=r)break;let s=n,i=t[n];if(i==="{"||i==="["){let o=i,a=i==="{"?"}":"]",l=1,c=!1,u=!1;for(n++;n<r&&l>0;){let f=t[n];u?u=!1:f==="\\"?u=!0:f==='"'?c=!c:c||(f===o?l++:f===a&&l--),n++}if(l!==0)throw new Error(`Unexpected end of JSON input at position ${n} (unclosed ${o})`);e.push(JSON.parse(t.slice(s,n)))}else if(i==='"'){let o=!1;for(n++;n<r;){let a=t[n];if(o)o=!1;else if(a==="\\")o=!0;else if(a==='"'){n++;break}n++}e.push(JSON.parse(t.slice(s,n)))}else if(i==="-"||i>="0"&&i<="9"){for(;n<r&&/[\d.eE+-]/.test(t[n]);)n++;e.push(JSON.parse(t.slice(s,n)))}else if(t.slice(n,n+4)==="true")e.push(!0),n+=4;else if(t.slice(n,n+5)==="false")e.push(!1),n+=5;else if(t.slice(n,n+4)==="null")e.push(null),n+=4;else{let o=t.slice(n,n+10);throw new Error(`Invalid JSON at position ${s}: unexpected '${o.split(/\s/)[0]}'`)}}return e}function Rs(t,e,n,r,s,i=0){if(t===null||t===void 0)return"null";if(typeof t=="boolean")return String(t);if(typeof t=="number")return Number.isFinite(t)?String(t):"null";if(typeof t=="string")return n?t:JSON.stringify(t);let o=s?" ":" ";if(Array.isArray(t))return t.length===0?"[]":e?`[${t.map(l=>Rs(l,!0,!1,r,s)).join(",")}]`:`[
547
+ ${t.map(l=>o.repeat(i+1)+Rs(l,!1,!1,r,s,i+1)).join(`,
548
+ `)}
549
+ ${o.repeat(i)}]`;if(typeof t=="object"){let a=Object.keys(t);return r&&(a=a.sort()),a.length===0?"{}":e?`{${a.map(c=>`${JSON.stringify(c)}:${Rs(t[c],!0,!1,r,s)}`).join(",")}}`:`{
550
+ ${a.map(c=>{let u=Rs(t[c],!1,!1,r,s,i+1);return`${o.repeat(i+1)}${JSON.stringify(c)}: ${u}`}).join(`,
551
+ `)}
552
+ ${o.repeat(i)}}`}return String(t)}var k5,I5,T5,hd=I(()=>{"use strict";Ne();F();sr();he();ud();k5={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE]",options:["-r, --raw-output output strings without quotes","-c, --compact compact output (no pretty printing)","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --help display this help and exit"]};I5={name:"jq",async execute(t,e){let n=W(t);if(Z(n))return q(k5);let r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1,u=!1,f=".",p=!1,h=[];for(let d=0;d<n.length;d++){let g=n[d];if(g==="-r"||g==="--raw-output")r=!0;else if(g==="-c"||g==="--compact-output")s=!0;else if(g==="-e"||g==="--exit-status")i=!0;else if(g==="-s"||g==="--slurp")o=!0;else if(g==="-n"||g==="--null-input")a=!0;else if(g==="-j"||g==="--join-output")l=!0;else if(!(g==="-a"||g==="--ascii")){if(g==="-S"||g==="--sort-keys")c=!0;else if(!(g==="-C"||g==="--color")){if(!(g==="-M"||g==="--monochrome"))if(g==="--tab")u=!0;else if(g==="-")h.push("-");else{if(g.startsWith("--"))return oe("jq",g);if(g.startsWith("-")){for(let w of g.slice(1))if(w==="r")r=!0;else if(w==="c")s=!0;else if(w==="e")i=!0;else if(w==="s")o=!0;else if(w==="n")a=!0;else if(w==="j")l=!0;else if(w!=="a"){if(w==="S")c=!0;else if(w!=="C"){if(w!=="M")return oe("jq",`-${w}`)}}}else p?h.push(g):(f=g,p=!0)}}}}let m=[];if(!a)if(h.length===0||h.length===1&&h[0]==="-")m.push({source:"stdin",content:R(e.stdin)});else{let d=await rr(e,h,{cmdName:"jq",stopOnError:!0});if(d.exitCode!==0)return{stdout:y,stderr:x(d.stderr),exitCode:2};m=d.files.map(g=>({source:g.filename||"stdin",content:R(g.content)}))}try{let d=ld(f),g=[],w={limits:e.limits?{maxIterations:e.limits.maxJqIterations}:void 0,env:si(e.env),coverage:e.coverage};if(a)g=X(null,d,w);else if(o){let O=[];for(let{content:G}of m){let M=G.trim();M&&O.push(...fd(M))}g=X(O,d,w)}else for(let{content:O}of m){let G=O.trim();if(!G)continue;let M=fd(G);for(let Y of M)g.push(...X(Y,d,w))}let E=g.map(O=>Rs(O,s,r,c,u)),b=l?"":`
553
+ `,A=E.join(b),N=e.limits?.maxStringLength;if(N!==void 0&&N>0&&A.length>N)throw new ae(`jq: output size limit exceeded (${N} bytes)`,"string_length");let P=i&&(g.length===0||g.every(O=>O==null||O===!1))?1:0;return{stdout:x(A?l?A:`${A}
554
+ `:""),stderr:y,exitCode:P}}catch(d){if(d instanceof ae)return{stdout:y,stderr:x(`jq: ${d.message}
555
+ `),exitCode:ae.EXIT_CODE};let g=d.message;return g.includes("Unknown function")?{stdout:y,stderr:x(`jq: error: ${g}
556
+ `),exitCode:3}:{stdout:y,stderr:x(`jq: parse error: ${g}
557
+ `),exitCode:5}}}},T5={name:"jq",flags:[{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"json",needsArgs:!0}});var md={};se(md,{base64Command:()=>P5,flagsForFuzzing:()=>$5});async function dd(t,e,n){if(e.length===0||e.length===1&&e[0]==="-")return{ok:!0,data:t.stdin};let r=[];for(let a of e){if(a==="-"){r.push(t.stdin);continue}try{let l=t.fs.resolvePath(t.cwd,a),c=await t.fs.readFileBuffer(l);r.push(c)}catch{return{ok:!1,error:{stdout:y,stderr:x(`${n}: ${a}: No such file or directory
558
+ `),exitCode:1}}}}let s=r.reduce((a,l)=>a+l.length,0),i=new Uint8Array(s),o=0;for(let a of r)i.set(a,o),o+=a.length;return{ok:!0,data:i}}var O5,R5,P5,$5,gd=I(()=>{"use strict";nt();F();he();O5={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},R5={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};P5={name:"base64",async execute(t,e){let n=W(t);if(Z(n))return q(O5);let r=ke("base64",n,R5);if(!r.ok)return r.error;let s=r.result.flags.decode,i=r.result.flags.wrap,o=r.result.positional;try{if(s){let c=await dd(e,o,"base64");if(!c.ok)return c.error;if(typeof Buffer<"u"){let m=Buffer.from(c.data).toString("utf8").replace(/\s/g,""),d=Buffer.from(m,"base64");return{stdout:new Uint8Array(d.buffer,d.byteOffset,d.byteLength),stderr:y,exitCode:0}}let f=String.fromCharCode(...c.data).replace(/\s/g,""),p=atob(f);return{stdout:x(p),stderr:y,exitCode:0}}let a=await dd(e,o,"base64");if(!a.ok)return a.error;let l;if(typeof Buffer<"u"?l=Buffer.from(a.data).toString("base64"):l=btoa(String.fromCharCode(...a.data)),i>0){let c=[];for(let u=0;u<l.length;u+=i)c.push(l.slice(u,u+i));l=c.join(`
559
+ `)+(l.length>0?`
560
+ `:"")}return{stdout:x(l),stderr:y,exitCode:0}}catch{return{stdout:y,stderr:x(`base64: invalid input
561
+ `),exitCode:1}}}},$5={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}});var wd={};se(wd,{diffCommand:()=>M5,flagsForFuzzing:()=>L5});import*as yd from"diff";var D5,_5,M5,L5,bd=I(()=>{"use strict";nt();F();he();D5={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:["-u, --unified output unified diff format (default)","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --help display this help and exit"]},_5={unified:{short:"u",long:"unified",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},M5={name:"diff",async execute(t,e){let n=W(t);if(Z(n))return q(D5);let r=ke("diff",n,_5);if(!r.ok)return r.error;let s=r.result.flags.brief,i=r.result.flags.reportSame,o=r.result.flags.ignoreCase,a=r.result.positional;if(r.result.flags.unified,a.length<2)return{stdout:y,stderr:x(`diff: missing operand
562
+ `),exitCode:2};let l,c,[u,f]=a;try{l=u==="-"?e.stdin:await e.fs.readFileBuffer(e.fs.resolvePath(e.cwd,u))}catch{return{stdout:y,stderr:x(`diff: ${u}: No such file or directory
563
+ `),exitCode:2}}try{c=f==="-"?e.stdin:await e.fs.readFileBuffer(e.fs.resolvePath(e.cwd,f))}catch{return{stdout:y,stderr:x(`diff: ${f}: No such file or directory
564
+ `),exitCode:2}}let p=l.length===c.length&&l.every((w,E)=>w===c[E]),h=R(l),m=R(c),d=p;if(!d&&o&&(d=h.toLowerCase()===m.toLowerCase()),d)return i?{stdout:x(`Files ${u} and ${f} are identical
565
+ `),stderr:y,exitCode:0}:{stdout:y,stderr:y,exitCode:0};if(s)return{stdout:x(`Files ${u} and ${f} differ
566
+ `),stderr:y,exitCode:1};let g=yd.createTwoFilesPatch(u,f,h,m,"","",{context:3});return{stdout:x(g),stderr:y,exitCode:1}}},L5={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2}});var xd={};se(xd,{dateCommand:()=>H5,flagsForFuzzing:()=>j5});function At(t,e=2){return String(t).padStart(e,"0")}function W5(t){let e=-t.getTimezoneOffset();return`${e>=0?"+":"-"}${At(Math.floor(Math.abs(e)/60))}${At(Math.abs(e)%60)}`}function Gi(t,e,n){let r=n?{Y:t.getUTCFullYear(),m:t.getUTCMonth(),D:t.getUTCDate(),H:t.getUTCHours(),M:t.getUTCMinutes(),S:t.getUTCSeconds(),w:t.getUTCDay()}:{Y:t.getFullYear(),m:t.getMonth(),D:t.getDate(),H:t.getHours(),M:t.getMinutes(),S:t.getSeconds(),w:t.getDay()},s="",i=0;for(;i<e.length;){if(e[i]==="%"&&i+1<e.length){let o=e[++i];switch(o){case"%":s+="%";break;case"a":s+=U5[r.w];break;case"b":case"h":s+=B5[r.m];break;case"d":s+=At(r.D);break;case"e":s+=String(r.D).padStart(2," ");break;case"F":s+=`${r.Y}-${At(r.m+1)}-${At(r.D)}`;break;case"H":s+=At(r.H);break;case"I":s+=At(r.H%12||12);break;case"m":s+=At(r.m+1);break;case"M":s+=At(r.M);break;case"n":s+=`
567
+ `;break;case"p":s+=r.H<12?"AM":"PM";break;case"P":s+=r.H<12?"am":"pm";break;case"R":s+=`${At(r.H)}:${At(r.M)}`;break;case"s":s+=Math.floor(t.getTime()/1e3);break;case"S":s+=At(r.S);break;case"t":s+=" ";break;case"T":s+=`${At(r.H)}:${At(r.M)}:${At(r.S)}`;break;case"u":s+=r.w||7;break;case"w":s+=r.w;break;case"y":s+=At(r.Y%100);break;case"Y":s+=r.Y;break;case"z":s+=n?"+0000":W5(t);break;case"Z":s+=n?"UTC":Intl.DateTimeFormat().resolvedOptions().timeZone;break;default:s+=`%${o}`}}else s+=e[i];i++}return s}function z5(t){let e=new Date(t);if(!Number.isNaN(e.getTime()))return e;if(/^\d+$/.test(t))return new Date(Number.parseInt(t,10)*1e3);let n=t.toLowerCase();return n==="now"||n==="today"?new Date:n==="yesterday"?new Date(Date.now()-864e5):n==="tomorrow"?new Date(Date.now()+864e5):null}var F5,U5,B5,H5,j5,Ed=I(()=>{"use strict";F();he();F5={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING","-u, --utc print Coordinated Universal Time (UTC)","-I, --iso-8601 output date/time in ISO 8601 format","-R, --rfc-email output RFC 5322 date format"," --help display this help and exit"]},U5=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],B5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];H5={name:"date",async execute(t,e){let n=W(t);if(Z(n))return q(F5);let r=!1,s=null,i=null,o=!1,a=!1;for(let u=0;u<n.length;u++){let f=n[u];if(f==="-u"||f==="--utc")r=!0;else if(f==="-d"||f==="--date")s=n[++u]??"";else if(f.startsWith("--date="))s=f.slice(7);else if(f==="-I"||f==="--iso-8601")o=!0;else if(f==="-R"||f==="--rfc-email")a=!0;else if(f.startsWith("+"))i=f.slice(1);else{if(f.startsWith("--"))return oe("date",f);if(f.startsWith("-"))for(let p of f.slice(1))if(p==="u")r=!0;else if(p==="I")o=!0;else if(p==="R")a=!0;else return oe("date",`-${p}`)}}let l=s!==null?z5(s):new Date;if(!l)return{stdout:y,stderr:x(`date: invalid date '${s}'
568
+ `),exitCode:1};let c;return i?c=Gi(l,i,r):o?c=Gi(l,"%Y-%m-%dT%H:%M:%S%z",r):a?c=Gi(l,"%a, %d %b %Y %H:%M:%S %z",r):c=Gi(l,"%a %b %e %H:%M:%S %Z %Y",r),{stdout:x(`${c}
569
+ `),stderr:y,exitCode:0}}},j5={name:"date",flags:[{flag:"-d",type:"value",valueHint:"string"},{flag:"-u",type:"boolean"},{flag:"-I",type:"boolean"},{flag:"-R",type:"boolean"}]}});var Ad={};se(Ad,{flagsForFuzzing:()=>Z5,sleepCommand:()=>q5});function V5(t){let e=t.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!e)return null;let n=parseFloat(e[1]);switch(e[2]||"s"){case"s":return n*1e3;case"m":return n*60*1e3;case"h":return n*60*60*1e3;case"d":return n*24*60*60*1e3;default:return null}}var G5,q5,Z5,Sd=I(()=>{"use strict";F();he();G5={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be:
570
+ s - seconds (default)
571
+ m - minutes
572
+ h - hours
573
+ d - days
574
+
575
+ NUMBER may be a decimal number.`,options:[" --help display this help and exit"]};q5={name:"sleep",async execute(t,e){let n=W(t);if(Z(n))return q(G5);if(n.length===0)return{stdout:y,stderr:x(`sleep: missing operand
576
+ `),exitCode:1};let r=0;for(let s of n){let i=V5(s);if(i===null)return{stdout:y,stderr:x(`sleep: invalid time interval '${s}'
577
+ `),exitCode:1};r+=i}return e.sleep?await e.sleep(r):await new Promise(s=>setTimeout(s,r)),{stdout:y,stderr:y,exitCode:0}}},Z5={name:"sleep",flags:[],needsArgs:!0}});var Cd={};se(Cd,{flagsForFuzzing:()=>X5,timeoutCommand:()=>K5});function Q5(t){let e=t.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!e)return null;let n=parseFloat(e[1]);switch(e[2]||"s"){case"s":return n*1e3;case"m":return n*60*1e3;case"h":return n*60*60*1e3;case"d":return n*24*60*60*1e3;default:return null}}var Y5,K5,X5,Nd=I(()=>{"use strict";F();he();Y5={name:"timeout",summary:"run a command with a time limit",usage:"timeout [OPTION] DURATION COMMAND [ARG]...",description:`Start COMMAND, and kill it if still running after DURATION.
578
+
579
+ DURATION is a number with optional suffix:
580
+ s - seconds (default)
581
+ m - minutes
582
+ h - hours
583
+ d - days`,options:["-k, --kill-after=DURATION send KILL signal after DURATION if still running","-s, --signal=SIGNAL specify signal to send (default: TERM)"," --preserve-status exit with same status as COMMAND, even on timeout"," --foreground run command in foreground"," --help display this help and exit"]};K5={name:"timeout",async execute(t,e){let n=W(t);if(Z(n))return q(Y5);let r=!1,s=0;for(let h=0;h<n.length;h++){let m=n[h];if(m==="--preserve-status")r=!0,s=h+1;else if(m==="--foreground")s=h+1;else if(m==="-k"||m==="--kill-after")h++,s=h+1;else if(m.startsWith("--kill-after="))s=h+1;else if(m==="-s"||m==="--signal")h++,s=h+1;else if(m.startsWith("--signal="))s=h+1;else{if(m.startsWith("--")&&m!=="--")return oe("timeout",m);if(m.startsWith("-")&&m.length>1&&m!=="--")if(m.startsWith("-k"))s=h+1;else if(m.startsWith("-s"))s=h+1;else return oe("timeout",m);else{s=h;break}}}let i=n.slice(s);if(i.length===0)return{stdout:y,stderr:x(`timeout: missing operand
584
+ `),exitCode:1};let o=i[0],a=Q5(o);if(a===null)return{stdout:y,stderr:x(`timeout: invalid time interval '${o}'
585
+ `),exitCode:1};let l=i.slice(1);if(l.length===0)return{stdout:y,stderr:x(`timeout: missing operand
586
+ `),exitCode:1};if(!e.exec)return{stdout:y,stderr:x(`timeout: exec not available
587
+ `),exitCode:1};let c=l.map(h=>h.includes(" ")||h.includes(" ")?`'${h.replace(/'/g,"'\\''")}'`:h).join(" "),u=new Promise(h=>{setTimeout(()=>h({timedOut:!0}),a)}),f=e.exec(c,{cwd:e.cwd}).then(h=>({timedOut:!1,result:h})),p=await Promise.race([u,f]);return p.timedOut?{stdout:y,stderr:y,exitCode:124}:p.result}},X5={name:"timeout",flags:[{flag:"-k",type:"value",valueHint:"string"},{flag:"-s",type:"value",valueHint:"string"},{flag:"--preserve-status",type:"boolean"},{flag:"--foreground",type:"boolean"}],needsArgs:!0,minArgs:2}});var vd={};se(vd,{flagsForFuzzing:()=>tw,timeCommand:()=>J5});function ew(t){let e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return e>0?`${e}:${n.toString().padStart(2,"0")}:${r.toFixed(2).padStart(5,"0")}`:`${n}:${r.toFixed(2).padStart(5,"0")}`}var J5,tw,kd=I(()=>{"use strict";Wn();F();J5={name:"time",async execute(t,e){let n=W(t),r="%e %M",s=null,i=!1,o=!1,a=0;for(;a<n.length;){let d=n[a];if(d==="-f"||d==="--format"){if(a++,a>=n.length)return{stdout:y,stderr:x(`time: missing argument to '-f'
588
+ `),exitCode:1};r=n[a],a++}else if(d==="-o"||d==="--output"){if(a++,a>=n.length)return{stdout:y,stderr:x(`time: missing argument to '-o'
589
+ `),exitCode:1};s=n[a],a++}else if(d==="-a"||d==="--append")i=!0,a++;else if(d==="-v"||d==="--verbose")r=`Command being timed: %C
590
+ Elapsed (wall clock) time: %e seconds
591
+ Maximum resident set size (kbytes): %M`,a++;else if(d==="-p"||d==="--portability")o=!0,a++;else if(d==="--"){a++;break}else if(d.startsWith("-"))a++;else break}let l=n.slice(a);if(l.length===0)return{stdout:y,stderr:y,exitCode:0};let c=performance.now(),u=l.join(" "),f;try{if(!e.exec)return{stdout:y,stderr:x(`time: exec not available
592
+ `),exitCode:1};f=await e.exec(u,{env:Rt(e.env),cwd:e.cwd})}catch(d){f={stdout:y,stderr:x(`time: ${d.message}
593
+ `),exitCode:127}}let h=(performance.now()-c)/1e3,m;if(o?m=`real ${h.toFixed(2)}
594
+ user 0.00
595
+ sys 0.00
596
+ `:(m=r.replace(/%e/g,h.toFixed(2)).replace(/%E/g,ew(h)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,u),m.endsWith(`
597
+ `)||(m+=`
598
+ `)),s)try{let d=e.fs.resolvePath(e.cwd,s);if(i&&await e.fs.exists(d)){let g=await e.fs.readFile(d);await e.fs.writeFile(d,g+m)}else await e.fs.writeFile(d,m)}catch(d){return{stdout:f.stdout,stderr:j(f.stderr,x(`time: cannot write to '${s}': ${d.message}
599
+ `)),exitCode:f.exitCode}}else f={...f,stderr:j(f.stderr,x(m))};return f}};tw={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0}});var Id={};se(Id,{flagsForFuzzing:()=>rw,seqCommand:()=>nw});var nw,rw,Td=I(()=>{"use strict";F();nw={name:"seq",async execute(t){let e=W(t),n=`
600
+ `,r=!1,s=[],i=0;for(;i<e.length;){let d=e[i];if(d==="-s"&&i+1<e.length){n=e[i+1],i+=2;continue}if(d==="-w"){r=!0,i++;continue}if(d==="--"){i++;break}if(d.startsWith("-")&&d!=="-"){if(d.startsWith("-s")&&d.length>2){n=d.slice(2),i++;continue}if((d==="-ws"||d==="-sw")&&(r=!0,i+1<e.length)){n=e[i+1],i+=2;continue}}s.push(d),i++}for(;i<e.length;)s.push(e[i]),i++;if(s.length===0)return{stdout:y,stderr:x(`seq: missing operand
601
+ `),exitCode:1};let o=1,a=1,l;if(s.length===1?l=parseFloat(s[0]):s.length===2?(o=parseFloat(s[0]),l=parseFloat(s[1])):(o=parseFloat(s[0]),a=parseFloat(s[1]),l=parseFloat(s[2])),Number.isNaN(o)||Number.isNaN(a)||Number.isNaN(l)){let d=s.find(g=>Number.isNaN(parseFloat(g)));return{stdout:y,stderr:x(`seq: invalid floating point argument: '${d}'
602
+ `),exitCode:1}}if(a===0)return{stdout:y,stderr:x(`seq: invalid Zero increment value: '0'
603
+ `),exitCode:1};let c=[],u=d=>{let g=String(d),w=g.indexOf(".");return w===-1?0:g.length-w-1},f=Math.max(u(o),u(a),u(l)),p=1e5,h=0;if(a>0)for(let d=o;d<=l+1e-10&&!(h++>p);d+=a)c.push(f>0?d.toFixed(f):String(Math.round(d)));else for(let d=o;d>=l-1e-10&&!(h++>p);d+=a)c.push(f>0?d.toFixed(f):String(Math.round(d)));if(r&&c.length>0){let d=Math.max(...c.map(g=>g.replace("-","").length));for(let g=0;g<c.length;g++){let w=c[g].startsWith("-"),b=(w?c[g].slice(1):c[g]).padStart(d,"0");c[g]=w?`-${b}`:b}}let m=c.join(n);return{stdout:x(m?`${m}
604
+ `:""),stderr:y,exitCode:0}}},rw={name:"seq",flags:[{flag:"-s",type:"value",valueHint:"string"},{flag:"-w",type:"boolean"}],needsArgs:!0}});var Od={};se(Od,{exprCommand:()=>sw,flagsForFuzzing:()=>ow});function iw(t){if(t.length===1)return t[0];let e=0;function n(){let c=r();for(;e<t.length&&t[e]==="|";){e++;let u=r();if(c!=="0"&&c!=="")return c;c=u}return c}function r(){let c=s();for(;e<t.length&&t[e]==="&";){e++;let u=s();(c==="0"||c===""||u==="0"||u==="")&&(c="0")}return c}function s(){let c=i();for(;e<t.length;){let u=t[e];if(["=","!=","<",">","<=",">="].includes(u)){e++;let f=i(),p=parseInt(c,10),h=parseInt(f,10),m=!Number.isNaN(p)&&!Number.isNaN(h),d;u==="="?d=m?p===h:c===f:u==="!="?d=m?p!==h:c!==f:u==="<"?d=m?p<h:c<f:u===">"?d=m?p>h:c>f:u==="<="?d=m?p<=h:c<=f:d=m?p>=h:c>=f,c=d?"1":"0"}else break}return c}function i(){let c=o();for(;e<t.length;){let u=t[e];if(u==="+"||u==="-"){e++;let f=o(),p=parseInt(c,10),h=parseInt(f,10);if(Number.isNaN(p)||Number.isNaN(h))throw new Error("non-integer argument");c=String(u==="+"?p+h:p-h)}else break}return c}function o(){let c=a();for(;e<t.length;){let u=t[e];if(u==="*"||u==="/"||u==="%"){e++;let f=a(),p=parseInt(c,10),h=parseInt(f,10);if(Number.isNaN(p)||Number.isNaN(h))throw new Error("non-integer argument");if((u==="/"||u==="%")&&h===0)throw new Error("division by zero");u==="*"?c=String(p*h):u==="/"?c=String(Math.trunc(p/h)):c=String(p%h)}else break}return c}function a(){let c=l();for(;e<t.length&&t[e]===":";){e++;let u=l(),p=ee(`^${u}`).match(c);p?c=p[1]!==void 0?p[1]:String(p[0].length):c="0"}return c}function l(){if(e>=t.length)throw new Error("syntax error");let c=t[e];if(c==="match"){e++;let u=l(),f=l(),h=ee(f).match(u);return h?h[1]!==void 0?h[1]:String(h[0].length):"0"}if(c==="substr"){e++;let u=l(),f=parseInt(l(),10),p=parseInt(l(),10);if(Number.isNaN(f)||Number.isNaN(p))throw new Error("non-integer argument");return u.substring(f-1,f-1+p)}if(c==="index"){e++;let u=l(),f=l();for(let p=0;p<u.length;p++)if(f.includes(u[p]))return String(p+1);return"0"}if(c==="length"){e++;let u=l();return String(u.length)}if(c==="("){e++;let u=n();if(e>=t.length||t[e]!==")")throw new Error("syntax error");return e++,u}return e++,c}return n()}var sw,ow,Rd=I(()=>{"use strict";Ve();F();sw={name:"expr",async execute(t,e){let n=W(t);if(n.length===0)return{stdout:y,stderr:x(`expr: missing operand
605
+ `),exitCode:2};try{let r=iw(n),s=r==="0"||r===""?1:0;return{stdout:x(`${r}
606
+ `),stderr:y,exitCode:s}}catch(r){return{stdout:y,stderr:x(`expr: ${r.message}
607
+ `),exitCode:2}}}};ow={name:"expr",flags:[],needsArgs:!0}});function lw(t){function e(h,m){return h<<m|h>>>32-m}let n=new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]),r=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],s=t.length*8,i=(t.length%64<56?56:120)-t.length%64,o=new Uint8Array(t.length+i+8);o.set(t),o[t.length]=128;let a=new DataView(o.buffer);a.setUint32(o.length-8,s>>>0,!0),a.setUint32(o.length-4,Math.floor(s/4294967296),!0);let l=1732584193,c=4023233417,u=2562383102,f=271733878;for(let h=0;h<o.length;h+=64){let m=new Uint32Array(16);for(let b=0;b<16;b++)m[b]=a.getUint32(h+b*4,!0);let d=l,g=c,w=u,E=f;for(let b=0;b<64;b++){let A,N;b<16?(A=g&w|~g&E,N=b):b<32?(A=E&g|~E&w,N=(5*b+1)%16):b<48?(A=g^w^E,N=(3*b+5)%16):(A=w^(g|~E),N=7*b%16),A=A+d+n[b]+m[N]>>>0,d=E,E=w,w=g,g=g+e(A,r[b])>>>0}l=l+d>>>0,c=c+g>>>0,u=u+w>>>0,f=f+E>>>0}let p=new Uint8Array(16);return new DataView(p.buffer).setUint32(0,l,!0),new DataView(p.buffer).setUint32(4,c,!0),new DataView(p.buffer).setUint32(8,u,!0),new DataView(p.buffer).setUint32(12,f,!0),Array.from(p).map(h=>h.toString(16).padStart(2,"0")).join("")}async function Pd(t,e){if(t==="md5")return lw(e);let n=aw.get(t);if(!n)throw new Error(`Unknown algorithm: ${t}`);let r=await globalThis.crypto.subtle.digest(n,new Uint8Array(e).buffer);return Array.from(new Uint8Array(r)).map(s=>s.toString(16).padStart(2,"0")).join("")}function Gr(t,e,n){let r={name:t,summary:n,usage:`${t} [OPTION]... [FILE]...`,options:["-c, --check read checksums from FILEs and check them"," --help display this help and exit"]};return{name:t,async execute(s,i){let o=W(s);if(Z(o))return q(r);let a=!1,l=[];for(let p of o)if(p==="-c"||p==="--check")a=!0;else if(!(p==="-b"||p==="-t"||p==="--binary"||p==="--text")){if(p.startsWith("-")&&p!=="-")return oe(t,p);l.push(p)}l.length===0&&l.push("-");let c=async p=>{if(p==="-")return i.stdin;try{return await i.fs.readFileBuffer(i.fs.resolvePath(i.cwd,p))}catch{return null}};if(a){let p=0,h="";for(let m of l){let d=m==="-"?R(i.stdin):await i.fs.readFile(i.fs.resolvePath(i.cwd,m)).catch(()=>null);if(d===null)return{stdout:y,stderr:x(`${t}: ${m}: No such file or directory
608
+ `),exitCode:1};for(let g of d.split(`
609
+ `)){let w=g.match(/^([a-fA-F0-9]+)\s+[* ]?(.+)$/);if(!w)continue;let[,E,b]=w,A=await c(b);if(A===null){h+=`${b}: FAILED open or read
610
+ `,p++;continue}let N=await Pd(e,A)===E.toLowerCase();h+=`${b}: ${N?"OK":"FAILED"}
611
+ `,N||p++}}return p>0&&(h+=`${t}: WARNING: ${p} computed checksum${p>1?"s":""} did NOT match
612
+ `),{stdout:x(h),stderr:y,exitCode:p>0?1:0}}let u="",f=0;for(let p of l){let h=await c(p);if(h===null){u+=`${t}: ${p}: No such file or directory
613
+ `,f=1;continue}u+=`${await Pd(e,h)} ${p}
614
+ `}return{stdout:x(u),stderr:y,exitCode:f}}}}var aw,Vi=I(()=>{"use strict";F();he();aw=new Map([["sha1","SHA-1"],["sha256","SHA-256"]])});var $d={};se($d,{flagsForFuzzing:()=>uw,md5sumCommand:()=>cw});var cw,uw,Dd=I(()=>{"use strict";Vi();cw=Gr("md5sum","md5","compute MD5 message digest"),uw={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}});var _d={};se(_d,{flagsForFuzzing:()=>pw,sha1sumCommand:()=>fw});var fw,pw,Md=I(()=>{"use strict";Vi();fw=Gr("sha1sum","sha1","compute SHA1 message digest"),pw={name:"sha1sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}});var Ld={};se(Ld,{flagsForFuzzing:()=>dw,sha256sumCommand:()=>hw});var hw,dw,Fd=I(()=>{"use strict";Vi();hw=Gr("sha256sum","sha256","compute SHA256 message digest"),dw={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}});var Ud=ri(El=>{El.read=function(t,e,n,r,s){var i,o,a=s*8-r-1,l=(1<<a)-1,c=l>>1,u=-7,f=n?s-1:0,p=n?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-u)-1,h>>=-u,u+=a;u>0;i=i*256+t[e+f],f+=p,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=r;u>0;o=o*256+t[e+f],f+=p,u-=8);if(i===0)i=1-c;else{if(i===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-c}return(h?-1:1)*o*Math.pow(2,i-r)};El.write=function(t,e,n,r,s,i){var o,a,l,c=i*8-s-1,u=(1<<c)-1,f=u>>1,p=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,m=r?1:-1,d=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=p/l:e+=p*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*l-1)*Math.pow(2,s),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,s),o=0));s>=8;t[n+h]=a&255,h+=m,a/=256,s-=8);for(o=o<<s|a,c+=s;c>0;t[n+h]=o&255,h+=m,o/=256,c-=8);t[n+h-m]|=d*128}});function Bd(t,e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":return typeof globalThis.TextDecoder<"u"?new globalThis.TextDecoder("utf-8").decode(t):gw(t);case"utf-16le":return yw(t);case"ascii":return ww(t);case"latin1":case"iso-8859-1":return bw(t);case"windows-1252":return xw(t);default:throw new RangeError(`Encoding '${e}' not supported`)}}function gw(t){let e="",n=0;for(;n<t.length;){let r=t[n++];if(r<128)e+=String.fromCharCode(r);else if(r<224){let s=t[n++]&63;e+=String.fromCharCode((r&31)<<6|s)}else if(r<240){let s=t[n++]&63,i=t[n++]&63;e+=String.fromCharCode((r&15)<<12|s<<6|i)}else{let s=t[n++]&63,i=t[n++]&63,o=t[n++]&63,a=(r&7)<<18|s<<12|i<<6|o;a-=65536,e+=String.fromCharCode(55296+(a>>10&1023),56320+(a&1023))}}return e}function yw(t){let e="";for(let n=0;n<t.length;n+=2)e+=String.fromCharCode(t[n]|t[n+1]<<8);return e}function ww(t){return String.fromCharCode(...t.map(e=>e&127))}function bw(t){return String.fromCharCode(...t)}function xw(t){let e="";for(let n of t)n>=128&&n<=159&&Al[n]?e+=Al[n]:e+=String.fromCharCode(n);return e}var Al,mw,Wd=I(()=>{Al={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},mw={};for(let[t,e]of Object.entries(Al))mw[e]=Number.parseInt(t)});function Ft(t){return new DataView(t.buffer,t.byteOffset)}var zd,Hd,et,Vr,st,jd,Gd,Vd,Ut,Ps=I(()=>{zd=Du(Ud(),1);Wd();Hd={len:1,get(t,e){return Ft(t).getUint8(e)},put(t,e,n){return Ft(t).setUint8(e,n),e+1}},et={len:2,get(t,e){return Ft(t).getUint16(e,!0)},put(t,e,n){return Ft(t).setUint16(e,n,!0),e+2}},Vr={len:2,get(t,e){return Ft(t).getUint16(e)},put(t,e,n){return Ft(t).setUint16(e,n),e+2}},st={len:4,get(t,e){return Ft(t).getUint32(e,!0)},put(t,e,n){return Ft(t).setUint32(e,n,!0),e+4}},jd={len:4,get(t,e){return Ft(t).getUint32(e)},put(t,e,n){return Ft(t).setUint32(e,n),e+4}},Gd={len:4,get(t,e){return Ft(t).getInt32(e)},put(t,e,n){return Ft(t).setInt32(e,n),e+4}},Vd={len:8,get(t,e){return Ft(t).getBigUint64(e,!0)},put(t,e,n){return Ft(t).setBigUint64(e,n,!0),e+8}},Ut=class{constructor(e,n){this.len=e,this.encoding=n}get(e,n=0){let r=e.subarray(n,n+this.len);return Bd(r,this.encoding)}}});var Aw,Ze,fr,$s=I(()=>{Aw="End-Of-Stream",Ze=class extends Error{constructor(){super(Aw),this.name="EndOfStreamError"}},fr=class extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}}});var qd=I(()=>{});var pr,qi=I(()=>{$s();pr=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,n=!1){let r=await this.read(e,n);return this.peekQueue.push(e.subarray(0,r)),r}async read(e,n=!1){if(e.length===0)return 0;let r=this.readFromPeekBuffer(e);if(this.endOfStream||(r+=await this.readRemainderFromStream(e.subarray(r),n)),r===0&&!n)throw new Ze;return r}readFromPeekBuffer(e){let n=e.length,r=0;for(;this.peekQueue.length>0&&n>0;){let s=this.peekQueue.pop();if(!s)throw new Error("peekData should be defined");let i=Math.min(s.length,n);e.set(s.subarray(0,i),r),r+=i,n-=i,i<s.length&&this.peekQueue.push(s.subarray(i))}return r}async readRemainderFromStream(e,n){let r=0;for(;r<e.length&&!this.endOfStream;){if(this.interrupted)throw new fr;let s=await this.readFromStream(e.subarray(r),n);if(s===0)break;r+=s}if(!n&&r<e.length)throw new Ze;return r}}});var Zd=I(()=>{$s();qd();qi()});var Zi,Yd=I(()=>{qi();Zi=class extends pr{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}}});var Ds,Sl=I(()=>{Yd();Ds=class extends Zi{async readFromStream(e,n){if(e.length===0)return 0;let r=await this.reader.read(new Uint8Array(e.length),{min:n?void 0:e.length});return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value),r.value.length):0}}});var qr,Cl=I(()=>{$s();qi();qr=class extends pr{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,n){let r=Math.min(n.length,e.length);return e.set(n.subarray(0,r)),r<n.length?this.buffer=n.subarray(r):this.buffer=null,r}async readFromStream(e,n){if(e.length===0)return 0;let r=0;for(this.buffer&&(r+=this.writeChunk(e,this.buffer));r<e.length&&!this.endOfStream;){let s=await this.reader.read();if(s.done){this.endOfStream=!0;break}s.value&&(r+=this.writeChunk(e.subarray(r),s.value))}if(!n&&r===0&&this.endOfStream)throw new Ze;return r}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}});function Nl(t){try{let e=t.getReader({mode:"byob"});return e instanceof ReadableStreamDefaultReader?new qr(e):new Ds(e)}catch(e){if(e instanceof TypeError)return new qr(t.getReader());throw e}}var Qd=I(()=>{Sl();Cl()});var hr=I(()=>{$s();Zd();Sl();Cl();Qd()});var $n,_s=I(()=>{hr();$n=class{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(e,n=this.position){let r=new Uint8Array(e.len);if(await this.readBuffer(r,{position:n})<e.len)throw new Ze;return e.get(r,0)}async peekToken(e,n=this.position){let r=new Uint8Array(e.len);if(await this.peekBuffer(r,{position:n})<e.len)throw new Ze;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new Ze;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new Ze;return e.get(this.numBuffer,0)}async ignore(e){if(this.fileInfo.size!==void 0){let n=this.fileInfo.size-this.position;if(e>n)return this.position+=n,n}return this.position+=e,e}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(e,n){if(!this.supportsRandomAccess()&&n&&n.position!==void 0&&n.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...n}}abort(){return Promise.resolve()}}});var Cw,Yi,Kd=I(()=>{_s();hr();Cw=256e3,Yi=class extends $n{constructor(e,n){super(n),this.streamReader=e,this.fileInfo=n?.fileInfo??{}}async readBuffer(e,n){let r=this.normalizeOptions(e,n),s=r.position-this.position;if(s>0)return await this.ignore(s),this.readBuffer(e,n);if(s<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return 0;let i=await this.streamReader.read(e.subarray(0,r.length),r.mayBeLess);if(this.position+=i,(!n||!n.mayBeLess)&&i<r.length)throw new Ze;return i}async peekBuffer(e,n){let r=this.normalizeOptions(e,n),s=0;if(r.position){let i=r.position-this.position;if(i>0){let o=new Uint8Array(r.length+i);return s=await this.peekBuffer(o,{mayBeLess:r.mayBeLess}),e.set(o.subarray(i)),s-i}if(i<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{s=await this.streamReader.peek(e.subarray(0,r.length),r.mayBeLess)}catch(i){if(n?.mayBeLess&&i instanceof Ze)return 0;throw i}if(!r.mayBeLess&&s<r.length)throw new Ze}return s}async ignore(e){let n=Math.min(Cw,e),r=new Uint8Array(n),s=0;for(;s<e;){let i=e-s,o=await this.readBuffer(r,{length:Math.min(n,i)});if(o<0)return o;s+=o}return s}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}});var Qi,Xd=I(()=>{hr();_s();Qi=class extends $n{constructor(e,n){super(n),this.uint8Array=e,this.fileInfo={...n?.fileInfo??{},size:e.length}}async readBuffer(e,n){n?.position&&(this.position=n.position);let r=await this.peekBuffer(e,n);return this.position+=r,r}async peekBuffer(e,n){let r=this.normalizeOptions(e,n),s=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&s<r.length)throw new Ze;return e.set(this.uint8Array.subarray(r.position,r.position+s)),s}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}});var Ki,Jd=I(()=>{hr();_s();Ki=class extends $n{constructor(e,n){super(n),this.blob=e,this.fileInfo={...n?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,n){n?.position&&(this.position=n.position);let r=await this.peekBuffer(e,n);return this.position+=r,r}async peekBuffer(e,n){let r=this.normalizeOptions(e,n),s=Math.min(this.blob.size-r.position,r.length);if(!r.mayBeLess&&s<r.length)throw new Ze;let i=await this.blob.slice(r.position,r.position+s).arrayBuffer();return e.set(new Uint8Array(i)),s}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}});function e0(t,e){let n=Nl(t),r=e??{},s=r.onClose;return r.onClose=async()=>{if(await n.close(),s)return s()},new Yi(n,r)}function t0(t,e){return new Qi(t,e)}function n0(t,e){return new Ki(t,e)}var r0=I(()=>{hr();Kd();Xd();Jd();hr();_s()});var i0=ri((zT,s0)=>{var Zr=1e3,Yr=Zr*60,Qr=Yr*60,dr=Qr*24,vw=dr*7,kw=dr*365.25;s0.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return Iw(t);if(n==="number"&&isFinite(t))return e.long?Ow(t):Tw(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Iw(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*kw;case"weeks":case"week":case"w":return n*vw;case"days":case"day":case"d":return n*dr;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qr;case"minutes":case"minute":case"mins":case"min":case"m":return n*Yr;case"seconds":case"second":case"secs":case"sec":case"s":return n*Zr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Tw(t){var e=Math.abs(t);return e>=dr?Math.round(t/dr)+"d":e>=Qr?Math.round(t/Qr)+"h":e>=Yr?Math.round(t/Yr)+"m":e>=Zr?Math.round(t/Zr)+"s":t+"ms"}function Ow(t){var e=Math.abs(t);return e>=dr?Xi(t,e,dr,"day"):e>=Qr?Xi(t,e,Qr,"hour"):e>=Yr?Xi(t,e,Yr,"minute"):e>=Zr?Xi(t,e,Zr,"second"):t+" ms"}function Xi(t,e,n,r){var s=e>=n*1.5;return Math.round(t/n)+" "+r+(s?"s":"")}});var a0=ri((HT,o0)=>{function Rw(t){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=a,n.humanize=i0(),n.destroy=c,Object.keys(t).forEach(u=>{n[u]=t[u]}),n.names=[],n.skips=[],n.formatters={};function e(u){let f=0;for(let p=0;p<u.length;p++)f=(f<<5)-f+u.charCodeAt(p),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=e;function n(u){let f,p=null,h,m;function d(...g){if(!d.enabled)return;let w=d,E=Number(new Date),b=E-(f||E);w.diff=b,w.prev=f,w.curr=E,f=E,g[0]=n.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let A=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(P,O)=>{if(P==="%%")return"%";A++;let G=n.formatters[O];if(typeof G=="function"){let M=g[A];P=G.call(w,M),g.splice(A,1),A--}return P}),n.formatArgs.call(w,g),(w.log||n.log).apply(w,g)}return d.namespace=u,d.useColors=n.useColors(),d.color=n.selectColor(u),d.extend=r,d.destroy=n.destroy,Object.defineProperty(d,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==n.namespaces&&(h=n.namespaces,m=n.enabled(u)),m),set:g=>{p=g}}),typeof n.init=="function"&&n.init(d),d}function r(u,f){let p=n(this.namespace+(typeof f>"u"?":":f)+u);return p.log=this.log,p}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of f)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function i(u,f){let p=0,h=0,m=-1,d=0;for(;p<u.length;)if(h<f.length&&(f[h]===u[p]||f[h]==="*"))f[h]==="*"?(m=h,d=p,h++):(p++,h++);else if(m!==-1)h=m+1,d++,p=d;else return!1;for(;h<f.length&&f[h]==="*";)h++;return h===f.length}function o(){let u=[...n.names,...n.skips.map(f=>"-"+f)].join(",");return n.enable(""),u}function a(u){for(let f of n.skips)if(i(u,f))return!1;for(let f of n.names)if(i(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}o0.exports=Rw});var l0=ri((Bt,Ji)=>{Bt.formatArgs=$w;Bt.save=Dw;Bt.load=_w;Bt.useColors=Pw;Bt.storage=Mw();Bt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Bt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Pw(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function $w(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Ji.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),t.splice(r,0,e)}Bt.log=console.debug||console.log||(()=>{});function Dw(t){try{t?Bt.storage.setItem("debug",t):Bt.storage.removeItem("debug")}catch{}}function _w(){let t;try{t=Bt.storage.getItem("debug")||Bt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Mw(){try{return localStorage}catch{}}Ji.exports=a0()(Bt);var{formatters:Lw}=Ji.exports;Lw.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var mr,vl,c0,u0,f0,p0=I(()=>{Ps();mr={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},vl={get(t){return{signature:st.get(t,0),compressedSize:st.get(t,8),uncompressedSize:st.get(t,12)}},len:16},c0={get(t){let e=et.get(t,6);return{signature:st.get(t,0),minVersion:et.get(t,4),dataDescriptor:!!(e&8),compressedMethod:et.get(t,8),compressedSize:st.get(t,18),uncompressedSize:st.get(t,22),filenameLength:et.get(t,26),extraFieldLength:et.get(t,28),filename:null}},len:30},u0={get(t){return{signature:st.get(t,0),nrOfThisDisk:et.get(t,4),nrOfThisDiskWithTheStart:et.get(t,6),nrOfEntriesOnThisDisk:et.get(t,8),nrOfEntriesOfSize:et.get(t,10),sizeOfCd:st.get(t,12),offsetOfStartOfCd:st.get(t,16),zipFileCommentLength:et.get(t,20)}},len:22},f0={get(t){let e=et.get(t,8);return{signature:st.get(t,0),minVersion:et.get(t,6),dataDescriptor:!!(e&8),compressedMethod:et.get(t,10),compressedSize:st.get(t,20),uncompressedSize:st.get(t,24),filenameLength:et.get(t,28),extraFieldLength:et.get(t,30),fileCommentLength:et.get(t,32),relativeOffsetOfLocalHeader:st.get(t,42),filename:null}},len:46}});function d0(t){let e=new Uint8Array(st.len);return st.put(e,0,t),e}function Uw(t,e){let n=t.length,r=e.length;if(r>n)return-1;for(let s=0;s<=n-r;s++){let i=!0;for(let o=0;o<r;o++)if(t[s+o]!==e[o]){i=!1;break}if(i)return s}return-1}function Bw(t){let e=t.reduce((s,i)=>s+i.length,0),n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.length;return n}var h0,An,kl,Fw,eo,Ms,m0=I(()=>{Ps();h0=Du(l0(),1);p0();An=(0,h0.default)("tokenizer:inflate"),kl=256*1024,Fw=d0(mr.DataDescriptor),eo=d0(mr.EndOfCentralDirectory),Ms=class t{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(kl)}async isZip(){return await this.peekSignature()===mr.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(st)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,n=Math.min(16*1024,e.fileInfo.size),r=this.syncBuffer.subarray(0,n);await this.tokenizer.readBuffer(r,{position:e.fileInfo.size-n});for(let s=r.length-4;s>=0;s--)if(r[s]===eo[0]&&r[s+1]===eo[1]&&r[s+2]===eo[2]&&r[s+3]===eo[3])return e.fileInfo.size-n+s;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){An("Cannot reading central-directory without random-read support");return}An("Reading central-directory...");let e=this.tokenizer.position,n=await this.findEndOfCentralDirectoryLocator();if(n>0){An("Central-directory 32-bit signature found");let r=await this.tokenizer.readToken(u0,n),s=[];this.tokenizer.setPosition(r.offsetOfStartOfCd);for(let i=0;i<r.nrOfEntriesOfSize;++i){let o=await this.tokenizer.readToken(f0);if(o.signature!==mr.CentralFileHeader)throw new Error("Expected Central-File-Header signature");o.filename=await this.tokenizer.readToken(new Ut(o.filenameLength,"utf-8")),await this.tokenizer.ignore(o.extraFieldLength),await this.tokenizer.ignore(o.fileCommentLength),s.push(o),An(`Add central-directory file-entry: n=${i+1}/${s.length}: filename=${s[i].filename}`)}return this.tokenizer.setPosition(e),s}this.tokenizer.setPosition(e)}async unzip(e){let n=await this.readCentralDirectory();if(n)return this.iterateOverCentralDirectory(n,e);let r=!1;do{let s=await this.readLocalFileHeader();if(!s)break;let i=e(s);r=!!i.stop;let o;if(await this.tokenizer.ignore(s.extraFieldLength),s.dataDescriptor&&s.compressedSize===0){let a=[],l=kl;An("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let c=-1;for(;c<0&&l===kl;){l=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),c=Uw(this.syncBuffer.subarray(0,l),Fw);let u=c>=0?c:l;if(i.handler){let f=new Uint8Array(u);await this.tokenizer.readBuffer(f),a.push(f)}else await this.tokenizer.ignore(u)}An(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),i.handler&&await this.inflate(s,Bw(a),i.handler)}else i.handler?(An(`Reading compressed-file-data: ${s.compressedSize} bytes`),o=new Uint8Array(s.compressedSize),await this.tokenizer.readBuffer(o),await this.inflate(s,o,i.handler)):(An(`Ignoring compressed-file-data: ${s.compressedSize} bytes`),await this.tokenizer.ignore(s.compressedSize));if(An(`Reading data-descriptor at pos=${this.tokenizer.position}`),s.dataDescriptor&&(await this.tokenizer.readToken(vl)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-vl.len}`)}while(!r)}async iterateOverCentralDirectory(e,n){for(let r of e){let s=n(r);if(s.handler){this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);let i=await this.readLocalFileHeader();if(i){await this.tokenizer.ignore(i.extraFieldLength);let o=new Uint8Array(r.compressedSize);await this.tokenizer.readBuffer(o),await this.inflate(i,o,s.handler)}}if(s.stop)break}}async inflate(e,n,r){if(e.compressedMethod===0)return r(n);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);An(`Decompress filename=${e.filename}, compressed-size=${n.length}`);let s=await t.decompressDeflateRaw(n);return r(s)}static async decompressDeflateRaw(e){let n=new ReadableStream({start(i){i.enqueue(e),i.close()}}),r=new DecompressionStream("deflate-raw"),s=n.pipeThrough(r);try{let o=await new Response(s).arrayBuffer();return new Uint8Array(o)}catch(i){let o=i instanceof Error?`Failed to deflate ZIP entry: ${i.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(o)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(st);if(e===mr.LocalFileHeader){let n=await this.tokenizer.readToken(c0);return n.filename=await this.tokenizer.readToken(new Ut(n.filenameLength,"utf-8")),n}if(e===mr.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var Ls,g0=I(()=>{Ls=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(n){let r=new Uint8Array(1024),s=await e.readBuffer(r,{mayBeLess:!0});if(s===0){n.close();return}n.enqueue(r.subarray(0,s))}}).pipeThrough(new DecompressionStream("gzip"))}}});var y0=I(()=>{m0();g0()});function Il(t){let{byteLength:e}=t;if(e===6)return t.getUint16(0)*2**32+t.getUint32(2);if(e===5)return t.getUint8(0)*2**32+t.getUint32(1);if(e===4)return t.getUint32(0);if(e===3)return t.getUint8(0)*2**16+t.getUint16(1);if(e===2)return t.getUint16(0);if(e===1)return t.getUint8(0)}var JT,eO,tO,w0=I(()=>{JT={utf8:new globalThis.TextDecoder("utf8")},eO=new globalThis.TextEncoder,tO=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"))});function b0(t,e){if(e==="utf-16le"){let n=[];for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);n.push(s&255,s>>8&255)}return n}if(e==="utf-16be"){let n=[];for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);n.push(s>>8&255,s&255)}return n}return[...t].map(n=>n.charCodeAt(0))}function x0(t,e=0){let n=Number.parseInt(new Ut(6).get(t,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let s=e;s<e+148;s++)r+=t[s];for(let s=e+156;s<e+512;s++)r+=t[s];return n===r}var E0,A0=I(()=>{Ps();E0={get:(t,e)=>t[e+3]&127|t[e+2]<<7|t[e+1]<<14|t[e]<<21,len:4}});var S0,C0,N0=I(()=>{S0=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],C0=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});async function v0(t,e){return new Rl(e).fromBuffer(t)}function Ol(t){switch(t=t.toLowerCase(),t){case"application/epub+zip":return{ext:"epub",mime:t};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:t};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:t};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:t};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:t};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:t};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:t};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:t};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:t};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:t};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:t};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:t};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:t};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:t};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:t};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:t};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function Sn(t,e,n){n={offset:0,...n};for(let[r,s]of e.entries())if(n.mask){if(s!==(n.mask[r]&t[r+n.offset]))return!1}else if(s!==t[r+n.offset])return!1;return!0}var Tl,Rl,uO,fO,k0=I(()=>{Ps();r0();y0();w0();A0();N0();Tl=4100;Rl=class{constructor(e){this.options={mpegOffsetTolerance:0,...e},this.detectors=[...e?.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:e?.signal}}async fromTokenizer(e){let n=e.position;for(let r of this.detectors){let s=await r.detect(e);if(s)return s;if(n!==e.position)return}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let n=e instanceof Uint8Array?e:new Uint8Array(e);if(n?.length>1)return this.fromTokenizer(t0(n,this.tokenizerOptions))}async fromBlob(e){let n=n0(e,this.tokenizerOptions);try{return await this.fromTokenizer(n)}finally{await n.close()}}async fromStream(e){let n=e0(e,this.tokenizerOptions);try{return await this.fromTokenizer(n)}finally{await n.close()}}async toDetectionStream(e,n){let{sampleSize:r=Tl}=n,s,i,o=e.getReader({mode:"byob"});try{let{value:c,done:u}=await o.read(new Uint8Array(r));if(i=c,!u&&c)try{s=await this.fromBuffer(c.subarray(0,r))}catch(f){if(!(f instanceof Ze))throw f;s=void 0}i=c}finally{o.releaseLock()}let a=new TransformStream({async start(c){c.enqueue(i)},transform(c,u){u.enqueue(c)}}),l=e.pipeThrough(a);return l.fileType=s,l}check(e,n){return Sn(this.buffer,e,n)}checkString(e,n){return this.check(b0(e,n?.encoding),n)}detectConfident=async e=>{if(this.buffer=new Uint8Array(Tl),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.detectConfident(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8])){let r=new Ls(e).inflate(),s=!0;try{let i;try{i=await this.fromStream(r)}catch{s=!1}if(i&&i.ext==="tar")return{ext:"tar.gz",mime:"application/gzip"}}finally{s&&await r.cancel()}return{ext:"gz",mime:"application/gzip"}}if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);let n=await e.readToken(E0);return e.position+n>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(n),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let n;return await new Ms(e).unzip(r=>{switch(r.filename){case"META-INF/mozilla.rsa":return n={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return n={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return{async handler(s){let i=new TextDecoder("utf-8").decode(s).trim();n=Ol(i)},stop:!0};case"[Content_Types].xml":return{async handler(s){let i=new TextDecoder("utf-8").decode(s),o=i.indexOf('.main+xml"');if(o===-1){let a="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";i.includes(`ContentType="${a}"`)&&(n=Ol(a))}else{i=i.slice(0,Math.max(0,o));let a=i.lastIndexOf('"'),l=i.slice(Math.max(0,a+1));n=Ol(l)}},stop:!0};default:return/classes\d*\.dex/.test(r.filename)?(n={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}}).catch(r=>{if(!(r instanceof Ze))throw r}),n??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let n=new Uint8Array(8);return await e.readBuffer(n),Sn(n,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Sn(n,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Sn(n,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Sn(n,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Sn(n,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Sn(n,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let n=await this.readTiffHeader(!1);if(n)return n}if(this.check([77,77])){let n=await this.readTiffHeader(!0);if(n)return n}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function n(){let a=await e.peekNumber(Hd),l=128,c=0;for(;(a&l)===0&&l!==0;)++c,l>>=1;let u=new Uint8Array(c+1);return await e.readBuffer(u),u}async function r(){let a=await n(),l=await n();l[0]^=128>>l.length-1;let c=Math.min(6,l.length),u=new DataView(a.buffer),f=new DataView(l.buffer,l.length-c,c);return{id:Il(u),len:Il(f)}}async function s(a){for(;a>0;){let l=await r();if(l.id===17026)return(await e.readToken(new Ut(l.len))).replaceAll(/\00.*$/g,"");await e.ignore(l.len),--a}}let i=await r();switch(await s(i.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let n=new Ut(4,"latin1").get(this.buffer,2);if(n.match("^d*")&&n>=1e3&&n<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new Ut(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
615
+ `,"\r"," "," ","\0"].some(n=>this.checkString(n,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){await e.ignore(8);async function n(){return{length:await e.readToken(Gd),type:await e.readToken(new Ut(4,"latin1"))}}do{let r=await n();if(r.length<0)return;switch(r.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(r.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let n=new Ut(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(n){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return n.startsWith("3g")?n.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
616
+ `))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function n(){let r=new Uint8Array(16);return await e.readBuffer(r),{id:r,size:Number(await e.readToken(Vd))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){let r=await n(),s=r.size-24;if(Sn(r.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let i=new Uint8Array(16);if(s-=await e.readBuffer(i),Sn(i,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Sn(i,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(s)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new Ut(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let n=new DataView(this.buffer.buffer).getUint32(12,!0);if(n>12&&this.buffer.length>=n+16)try{let r=new TextDecoder().decode(this.buffer.subarray(16,n+16));if(JSON.parse(r).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&x0(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let n="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:n})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:n})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
617
+ `,{offset:2,encoding:n})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{if(this.buffer=new Uint8Array(Tl),await e.peekBuffer(this.buffer,{length:Math.min(8,e.fileInfo.size),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,e.fileInfo.size),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let n=0;n<=this.options.mpegOffsetTolerance;++n){let r=this.scanMpeg(n);if(r)return r}};async readTiffTag(e){let n=await this.tokenizer.readToken(e?Vr:et);switch(this.tokenizer.ignore(10),n){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let n=await this.tokenizer.readToken(e?Vr:et);for(let r=0;r<n;++r){let s=await this.readTiffTag(e);if(s)return s}}async readTiffHeader(e){let n=(e?Vr:et).get(this.buffer,2),r=(e?jd:st).get(this.buffer,4);if(n===42){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8){let i=(e?Vr:et).get(this.buffer,8),o=(e?Vr:et).get(this.buffer,10);if(i===28&&o===254||i===31&&o===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}return await this.tokenizer.ignore(r),await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(n===43)return{ext:"tif",mime:"image/tiff"}}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},uO=new Set(S0),fO=new Set(C0)});var I0={};se(I0,{fileCommand:()=>Zw,flagsForFuzzing:()=>Yw});function jw(t,e){let n=Hw.get(t);if(n)return n;let[r,s]=e.split("/"),i=s?.split("+")[0]?.replace(/-/g," ")||t;switch(r){case"image":return`${i.toUpperCase()} image data`;case"audio":return`${i.toUpperCase()} audio`;case"video":return`${i.toUpperCase()} video`;case"font":return`${i} font`;case"model":return`${i} 3D model`;case"application":return s?.includes("zip")||s?.includes("compressed")?`${i} archive data`:s?.includes("executable")?`${i} executable`:`${t.toUpperCase()} data`;default:return`${t.toUpperCase()} data`}}function Gw(t){let e=t.split("/").pop()||t;if(e.startsWith(".")&&!e.includes(".",1))return e;let n=e.lastIndexOf(".");return n===-1||n===0?"":e.slice(n).toLowerCase()}function Vw(t,e){if(t.startsWith("#!")){let c=t.split(`
618
+ `)[0];return c.includes("python")?{description:"Python script, ASCII text executable",mime:"text/x-python"}:c.includes("node")||c.includes("bun")||c.includes("deno")?{description:"JavaScript script, ASCII text executable",mime:"text/javascript"}:c.includes("bash")?{description:"Bourne-Again shell script, ASCII text executable",mime:"text/x-shellscript"}:c.includes("sh")?{description:"POSIX shell script, ASCII text executable",mime:"text/x-shellscript"}:c.includes("ruby")?{description:"Ruby script, ASCII text executable",mime:"text/x-ruby"}:c.includes("perl")?{description:"Perl script, ASCII text executable",mime:"text/x-perl"}:{description:"script, ASCII text executable",mime:"text/plain"}}let n=t.trimStart();if(n.startsWith("<?xml"))return{description:"XML document",mime:"application/xml"};if(n.startsWith("<!DOCTYPE html")||n.toLowerCase().startsWith("<html"))return{description:"HTML document",mime:"text/html"};let r=t.includes(`\r
619
+ `),s=t.includes("\r")&&!r,i="";r?i=", with CRLF line terminators":s&&(i=", with CR line terminators");let o=Gw(e),a=o?zw.get(o):void 0;if(a)return a.mime.startsWith("text/")&&i?{description:`${a.description}${i}`,mime:a.mime}:a;let l=!1;for(let c=0;c<Math.min(t.length,8192);c++)if(t.charCodeAt(c)>127){l=!0;break}return l?{description:`UTF-8 Unicode text${i}`,mime:"text/plain; charset=utf-8"}:{description:`ASCII text${i}`,mime:"text/plain"}}async function qw(t,e){if(e.length===0)return{description:"empty",mime:"inode/x-empty"};let n=await v0(e);if(n)return{description:jw(n.ext,n.mime),mime:n.mime};let r=new TextDecoder("utf-8",{fatal:!1}).decode(e);return Vw(r,t)}var Ww,zw,Hw,Zw,Yw,T0=I(()=>{"use strict";k0();F();he();Ww={name:"file",summary:"determine file type",usage:"file [OPTION]... FILE...",options:["-b, --brief do not prepend filenames to output","-i, --mime output MIME type strings","-L, --dereference follow symlinks"," --help display this help and exit"]},zw=new Map([[".js",{description:"JavaScript source",mime:"text/javascript"}],[".mjs",{description:"JavaScript module",mime:"text/javascript"}],[".cjs",{description:"CommonJS module",mime:"text/javascript"}],[".ts",{description:"TypeScript source",mime:"text/typescript"}],[".tsx",{description:"TypeScript JSX source",mime:"text/typescript"}],[".jsx",{description:"JavaScript JSX source",mime:"text/javascript"}],[".py",{description:"Python script",mime:"text/x-python"}],[".rb",{description:"Ruby script",mime:"text/x-ruby"}],[".go",{description:"Go source",mime:"text/x-go"}],[".rs",{description:"Rust source",mime:"text/x-rust"}],[".c",{description:"C source",mime:"text/x-c"}],[".h",{description:"C header",mime:"text/x-c"}],[".cpp",{description:"C++ source",mime:"text/x-c++"}],[".hpp",{description:"C++ header",mime:"text/x-c++"}],[".java",{description:"Java source",mime:"text/x-java"}],[".sh",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".bash",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".zsh",{description:"Zsh shell script",mime:"text/x-shellscript"}],[".json",{description:"JSON data",mime:"application/json"}],[".yaml",{description:"YAML data",mime:"text/yaml"}],[".yml",{description:"YAML data",mime:"text/yaml"}],[".xml",{description:"XML document",mime:"application/xml"}],[".csv",{description:"CSV text",mime:"text/csv"}],[".toml",{description:"TOML data",mime:"text/toml"}],[".html",{description:"HTML document",mime:"text/html"}],[".htm",{description:"HTML document",mime:"text/html"}],[".css",{description:"CSS stylesheet",mime:"text/css"}],[".svg",{description:"SVG image",mime:"image/svg+xml"}],[".md",{description:"Markdown document",mime:"text/markdown"}],[".markdown",{description:"Markdown document",mime:"text/markdown"}],[".txt",{description:"ASCII text",mime:"text/plain"}],[".rst",{description:"reStructuredText",mime:"text/x-rst"}],[".env",{description:"ASCII text",mime:"text/plain"}],[".gitignore",{description:"ASCII text",mime:"text/plain"}],[".dockerignore",{description:"ASCII text",mime:"text/plain"}]]),Hw=new Map([["jpg","JPEG image data"],["jpeg","JPEG image data"],["png","PNG image data"],["gif","GIF image data"],["webp","WebP image data"],["bmp","PC bitmap"],["ico","MS Windows icon resource"],["tif","TIFF image data"],["tiff","TIFF image data"],["psd","Adobe Photoshop Document"],["avif","AVIF image"],["heic","HEIC image"],["heif","HEIF image"],["jxl","JPEG XL image"],["icns","Mac OS X icon"],["svg","SVG Scalable Vector Graphics image"],["pdf","PDF document"],["epub","EPUB document"],["mobi","Mobipocket E-book"],["djvu","DjVu document"],["zip","Zip archive data"],["gz","gzip compressed data"],["gzip","gzip compressed data"],["bz2","bzip2 compressed data"],["xz","XZ compressed data"],["tar","POSIX tar archive"],["rar","RAR archive data"],["7z","7-zip archive data"],["lz","lzip compressed data"],["lzma","LZMA compressed data"],["zst","Zstandard compressed data"],["cab","Microsoft Cabinet archive"],["ar","Unix ar archive"],["rpm","RPM package"],["deb","Debian binary package"],["apk","Android Package"],["dmg","Apple disk image"],["iso","ISO 9660 CD-ROM filesystem data"],["vhd","Microsoft Virtual Hard Disk"],["vhdx","Microsoft Virtual Hard Disk (new format)"],["qcow2","QEMU QCOW Image"],["mp3","Audio file with ID3"],["m4a","MPEG-4 audio"],["aac","AAC audio"],["wav","RIFF (little-endian) data, WAVE audio"],["flac","FLAC audio bitstream data"],["ogg","Ogg data"],["oga","Ogg audio"],["opus","Ogg Opus audio"],["aiff","AIFF audio"],["wma","Windows Media Audio"],["amr","AMR audio"],["mid","MIDI audio"],["midi","MIDI audio"],["ape","Monkey's Audio"],["mp4","ISO Media, MPEG-4"],["m4v","MPEG-4 video"],["webm","WebM"],["avi","RIFF (little-endian) data, AVI"],["mov","ISO Media, Apple QuickTime movie"],["mkv","Matroska data"],["wmv","Windows Media Video"],["flv","Flash Video"],["3gp","3GPP multimedia"],["3g2","3GPP2 multimedia"],["ogv","Ogg video"],["mts","MPEG transport stream"],["m2ts","MPEG transport stream"],["ts","MPEG transport stream"],["mpg","MPEG video"],["mpeg","MPEG video"],["exe","PE32 executable"],["dll","PE32 DLL"],["elf","ELF executable"],["mach","Mach-O executable"],["wasm","WebAssembly (wasm) binary module"],["dex","Android Dalvik executable"],["class","Java class file"],["swf","Adobe Flash"],["doc","Microsoft Word Document"],["docx","Microsoft Word 2007+ Document"],["xls","Microsoft Excel Spreadsheet"],["xlsx","Microsoft Excel 2007+ Spreadsheet"],["ppt","Microsoft PowerPoint Presentation"],["pptx","Microsoft PowerPoint 2007+ Presentation"],["odt","OpenDocument Text"],["ods","OpenDocument Spreadsheet"],["odp","OpenDocument Presentation"],["ttf","TrueType Font"],["otf","OpenType Font"],["woff","Web Open Font Format"],["woff2","Web Open Font Format 2"],["eot","Embedded OpenType font"],["stl","Stereolithography CAD"],["obj","Wavefront 3D Object"],["gltf","GL Transmission Format"],["glb","GL Transmission Format (binary)"],["sqlite","SQLite 3.x database"],["mdb","Microsoft Access Database"],["xml","XML document"],["json","JSON data"],["macho","Mach-O binary"],["ics","iCalendar data"],["vcf","vCard data"],["msi","Microsoft Installer"],["ps","PostScript"],["ai","Adobe Illustrator"],["indd","Adobe InDesign"],["sketch","Sketch design file"],["fig","Figma design file"],["xd","Adobe XD"],["blend","Blender"],["fbx","Autodesk FBX"],["lnk","MS Windows shortcut"],["alias","Mac OS alias"],["torrent","BitTorrent file"],["pcap","pcap capture file"],["arrow","Apache Arrow"],["parquet","Apache Parquet"]]);Zw={name:"file",async execute(t,e){let n=W(t);if(Z(n))return q(Ww);let r=!1,s=!1,i=[];for(let l of n)if(l.startsWith("--")){if(l==="--brief")r=!0;else if(l==="--mime"||l==="--mime-type")s=!0;else if(l!=="--dereference")return oe("file",l)}else if(l.startsWith("-")&&l!=="-"){for(let c of l.slice(1))if(c==="b")r=!0;else if(c==="i")s=!0;else if(c!=="L")return oe("file",`-${c}`)}else i.push(l);if(i.length===0)return{stdout:y,stderr:x(`Usage: file [-bLi] FILE...
620
+ `),exitCode:1};let o="",a=0;for(let l of i)try{let c=e.fs.resolvePath(e.cwd,l);if((await e.fs.stat(c)).isDirectory){let m=s?"inode/directory":"directory";o+=r?`${m}
621
+ `:`${l}: ${m}
622
+ `;continue}let f=await e.fs.readFileBuffer(c),p=await qw(l,f),h=s?p.mime:p.description;o+=r?`${h}
623
+ `:`${l}: ${h}
624
+ `}catch{o+=r?`cannot open
625
+ `:`${l}: cannot open (No such file or directory)
626
+ `,a=1}return{stdout:x(o),stderr:y,exitCode:a}}},Yw={name:"file",flags:[{flag:"-b",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-L",type:"boolean"}],needsArgs:!0}});var O0={};se(O0,{flagsForFuzzing:()=>Jw,htmlToMarkdownCommand:()=>Xw});import Qw from"turndown";var Kw,Xw,Jw,R0=I(()=>{"use strict";F();he();Kw={name:"html-to-markdown",summary:"convert HTML to Markdown (BashEnv extension)",usage:"html-to-markdown [OPTION]... [FILE]",description:["Convert HTML content to Markdown format using the turndown library.","This is a non-standard BashEnv extension command, not available in regular bash.","","Read HTML from FILE or standard input and output Markdown to standard output.","Commonly used with curl to convert web pages:"," curl -s https://example.com | html-to-markdown","","Supported HTML elements:"," - Headings (h1-h6) \u2192 # Markdown headings"," - Paragraphs (p) \u2192 Plain text with blank lines"," - Links (a) \u2192 [text](url)"," - Images (img) \u2192 ![alt](src)"," - Bold/Strong \u2192 **text**"," - Italic/Em \u2192 _text_"," - Code (code, pre) \u2192 `inline` or fenced blocks"," - Lists (ul, ol, li) \u2192 - or 1. items"," - Blockquotes \u2192 > quoted text"," - Horizontal rules (hr) \u2192 ---"],options:["-b, --bullet=CHAR bullet character for unordered lists (-, +, or *)","-c, --code=FENCE fence style for code blocks (``` or ~~~)","-r, --hr=STRING string for horizontal rules (default: ---)"," --heading-style=STYLE"," heading style: 'atx' for # headings (default),"," 'setext' for underlined headings (h1/h2 only)"," --help display this help and exit"],examples:["echo '<h1>Hello</h1><p>World</p>' | html-to-markdown","html-to-markdown page.html","curl -s https://example.com | html-to-markdown > page.md"]},Xw={name:"html-to-markdown",async execute(t,e){let n=W(t);if(Z(n))return q(Kw);let r="-",s="```",i="---",o="atx",a=[];for(let c=0;c<n.length;c++){let u=n[c];if(u==="-b"||u==="--bullet")r=n[++c]??"-";else if(u.startsWith("--bullet="))r=u.slice(9);else if(u==="-c"||u==="--code")s=n[++c]??"```";else if(u.startsWith("--code="))s=u.slice(7);else if(u==="-r"||u==="--hr")i=n[++c]??"---";else if(u.startsWith("--hr="))i=u.slice(5);else if(u.startsWith("--heading-style=")){let f=u.slice(16);(f==="setext"||f==="atx")&&(o=f)}else if(u==="-")a.push("-");else{if(u.startsWith("--"))return oe("html-to-markdown",u);if(u.startsWith("-"))return oe("html-to-markdown",u);a.push(u)}}let l;if(a.length===0||a.length===1&&a[0]==="-")l=R(e.stdin);else try{let c=e.fs.resolvePath(e.cwd,a[0]);l=await e.fs.readFile(c)}catch{return{stdout:y,stderr:x(`html-to-markdown: ${a[0]}: No such file or directory
627
+ `),exitCode:1}}if(!l.trim())return{stdout:y,stderr:y,exitCode:0};try{let c=new Qw({bulletListMarker:r,codeBlockStyle:"fenced",fence:s,hr:i,headingStyle:o});c.remove(["script","style","footer"]);let u=c.turndown(l).trim();return{stdout:x(`${u}
628
+ `),stderr:y,exitCode:0}}catch(c){return{stdout:y,stderr:x(`html-to-markdown: conversion error: ${c.message}
629
+ `),exitCode:1}}}},Jw={name:"html-to-markdown",flags:[],stdinType:"text"}});var P0={};se(P0,{flagsForFuzzing:()=>rb,helpCommand:()=>nb});function tb(t){let e=[],n=new Set(t);e.push(`Available commands:
630
+ `);let r=[];for(let[s,i]of eb){let o=i.filter(a=>n.has(a));if(o.length>0){e.push(` ${s}:`),e.push(` ${o.join(", ")}
631
+ `);for(let a of o)n.delete(a)}}for(let s of n)r.push(s);return r.length>0&&(e.push(" Other:"),e.push(` ${r.sort().join(", ")}
632
+ `)),e.push("Use '<command> --help' for details on a specific command."),`${e.join(`
633
+ `)}
634
+ `}var eb,nb,rb,$0=I(()=>{"use strict";F();eb=new Map([["File operations",["ls","cat","head","tail","wc","touch","mkdir","rm","cp","mv","ln","chmod","stat","readlink"]],["Text processing",["grep","sed","awk","sort","uniq","cut","tr","tee","diff"]],["Search",["find"]],["Navigation & paths",["pwd","basename","dirname","tree","du"]],["Environment & shell",["echo","printf","env","printenv","export","alias","unalias","history","clear","true","false","bash","sh"]],["Data processing",["xargs","jq","base64","date"]],["Network",["curl","html-to-markdown"]]]);nb={name:"help",async execute(t,e){let n=W(t);if(n.includes("--help")||n.includes("-h"))return{stdout:x(`help - display available commands
635
+
636
+ Usage: help [command]
637
+
638
+ Options:
639
+ -h, --help Show this help message
640
+
641
+ If a command name is provided, shows help for that command.
642
+ Otherwise, lists all available commands.
643
+ `),stderr:y,exitCode:0};if(n.length>0&&e.exec){let s=n[0];return e.exec(`${s} --help`,{cwd:e.cwd})}let r=e.getRegisteredCommands?.()??[];return{stdout:x(tb(r)),stderr:y,exitCode:0}}},rb={name:"help",flags:[]}});var D0={};se(D0,{flagsForFuzzing:()=>ab,whichCommand:()=>ob});var sb,ib,ob,ab,_0=I(()=>{"use strict";nt();F();he();sb={name:"which",summary:"locate a command",usage:"which [-as] program ...",options:["-a List all instances of executables found","-s No output, just return 0 if found, 1 if not","--help display this help and exit"]},ib={showAll:{short:"a",type:"boolean"},silent:{short:"s",type:"boolean"}},ob={name:"which",async execute(t,e){let n=W(t);if(Z(n))return q(sb);let r=ke("which",n,ib);if(!r.ok)return r.error;let s=r.result.flags.showAll,i=r.result.flags.silent,o=r.result.positional;if(o.length===0)return{stdout:y,stderr:y,exitCode:1};let l=$(e.env,"PATH","/usr/bin:/bin").split(":"),c="",u=!0;for(let f of o){let p=!1;for(let h of l){if(!h)continue;let m=`${h}/${f}`;if(await e.fs.exists(m)&&(p=!0,i||(c+=`${m}
644
+ `),!s))break}p||(u=!1)}return{stdout:x(c),stderr:y,exitCode:u?0:1}}},ab={name:"which",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"boolean"}],needsArgs:!0}});var M0={};se(M0,{flagsForFuzzing:()=>ub,tac:()=>cb});async function lb(t,e){let n=W(t);if(n.length>0&&n[0]!=="-"){let i=n[0].startsWith("/")?n[0]:`${e.cwd}/${n[0]}`;try{let a=(await e.fs.readFile(i)).split(`
645
+ `);a[a.length-1]===""&&a.pop();let l=a.reverse();return{stdout:x(l.length>0?`${l.join(`
646
+ `)}
647
+ `:""),stderr:y,exitCode:0}}catch{return{stdout:y,stderr:x(`tac: ${n[0]}: No such file or directory
648
+ `),exitCode:1}}}let r=R(e.stdin).split(`
649
+ `);r[r.length-1]===""&&r.pop();let s=r.reverse();return{stdout:x(s.length>0?`${s.join(`
650
+ `)}
651
+ `:""),stderr:y,exitCode:0}}var cb,ub,L0=I(()=>{"use strict";F();cb={name:"tac",execute:lb},ub={name:"tac",flags:[],stdinType:"text",needsFiles:!0}});var F0={};se(F0,{flagsForFuzzing:()=>hb,hostname:()=>pb});async function fb(t,e){return{stdout:x(`localhost
652
+ `),stderr:y,exitCode:0}}var pb,hb,U0=I(()=>{"use strict";F();pb={name:"hostname",execute:fb},hb={name:"hostname",flags:[]}});var B0={};se(B0,{flagsForFuzzing:()=>gb,whoami:()=>mb});async function db(t,e){return{stdout:x(`user
653
+ `),stderr:y,exitCode:0}}var mb,gb,W0=I(()=>{"use strict";F();mb={name:"whoami",execute:db},gb={name:"whoami",flags:[]}});var z0={};se(z0,{flagsForFuzzing:()=>bb,od:()=>wb});async function yb(t,e){let n=W(t),r="octal",s=[],i=[];for(let m=0;m<n.length;m++){let d=n[m];if(d==="-c")s.push("char");else if(d==="-An"||d==="-A"&&n[m+1]==="n")r="none",d==="-A"&&m++;else if(d==="-t"&&n[m+1]){let g=n[++m];g==="x1"?s.push("hex"):g==="c"?s.push("char"):g.startsWith("o")&&s.push("octal")}else(!d.startsWith("-")||d==="-")&&i.push(d)}s.length===0&&s.push("octal");let o=e.stdin;if(i.length>0&&i[0]!=="-"){let m=i[0].startsWith("/")?i[0]:`${e.cwd}/${i[0]}`;try{o=await e.fs.readFileBuffer(m)}catch{return{stdout:y,stderr:x(`od: ${i[0]}: No such file or directory
654
+ `),exitCode:1}}}let a=s.includes("char");function l(m){return m===0?" \\0":m===7?" \\a":m===8?" \\b":m===9?" \\t":m===10?" \\n":m===11?" \\v":m===12?" \\f":m===13?" \\r":m>=32&&m<127?` ${String.fromCharCode(m)}`:` ${m.toString(8).padStart(3,"0")}`}function c(m){return a?` ${m.toString(16).padStart(2,"0")}`:` ${m.toString(16).padStart(2,"0")}`}function u(m){return` ${m.toString(8).padStart(3,"0")}`}let f=Array.from(o),p=16,h=[];for(let m=0;m<f.length;m+=p){let d=f.slice(m,m+p);for(let g=0;g<s.length;g++){let w=s[g],E;w==="char"?E=d.map(l):w==="hex"?E=d.map(c):E=d.map(u);let b="";g===0&&r!=="none"?b=`${m.toString(8).padStart(7,"0")} `:(g>0||r==="none")&&(b=r==="none"?"":" "),h.push(b+E.join(""))}}return r!=="none"&&f.length>0&&h.push(f.length.toString(8).padStart(7,"0")),{stdout:x(h.length>0?`${h.join(`
655
+ `)}
656
+ `:""),stderr:y,exitCode:0}}var wb,bb,H0=I(()=>{"use strict";F();wb={name:"od",execute:yb},bb={name:"od",flags:[{flag:"-c",type:"boolean"},{flag:"-A",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-N",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}});var no={};se(no,{flagsForFuzzing:()=>Ob,gunzipCommand:()=>Ib,gunzipFlagsForFuzzing:()=>Rb,gzipCommand:()=>kb,zcatCommand:()=>Tb,zcatFlagsForFuzzing:()=>Pb});import{constants as Pl,gunzipSync as $l,gzipSync as j0}from"node:zlib";function G0(t){return t.best?Pl.Z_BEST_COMPRESSION:t.level8?8:t.level7?7:t.level6?6:t.level5?5:t.level4?4:t.level3?3:t.level2?2:t.fast?Pl.Z_BEST_SPEED:Pl.Z_DEFAULT_COMPRESSION}function V0(t){if(t.length<10)return{originalName:null,mtime:null,headerSize:0};if(t[0]!==31||t[1]!==139)return{originalName:null,mtime:null,headerSize:0};let e=t[3],n=t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r=10;if(e&4){if(r+2>t.length)return{originalName:null,mtime:null,headerSize:0};let i=t[r]|t[r+1]<<8;r+=2+i}let s=null;if(e&8){let i=r;for(;r<t.length&&t[r]!==0;)r++;r<t.length&&(s=new TextDecoder().decode(t.slice(i,r)),r++)}if(e&16){for(;r<t.length&&t[r]!==0;)r++;r++}return e&2&&(r+=2),{originalName:s,mtime:n>0?new Date(n*1e3):null,headerSize:r}}function Cb(t){if(t.length<4)return 0;let e=t.length;return t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24}function to(t){return t.length>=2&&t[0]===31&&t[1]===139}async function q0(t,e,n,r,s,i){let o=n.suffix,a,l,c;if(e==="-"||e==="")if(c=t.stdin,s){if(!to(c))return n.quiet?{stdout:y,stderr:"",exitCode:1}:{stdout:y,stderr:`${r}: stdin: not in gzip format
657
+ `,exitCode:1};try{return{stdout:$l(c),stderr:"",exitCode:0}}catch(u){let f=u instanceof Error?u.message:"unknown error";return{stdout:y,stderr:`${r}: stdin: ${f}
658
+ `,exitCode:1}}}else{let u=G0(n);return{stdout:j0(c,{level:u}),stderr:"",exitCode:0}}a=t.fs.resolvePath(t.cwd,e);try{if((await t.fs.stat(a)).isDirectory)return n.recursive?await Z0(t,a,n,r,s,i):n.quiet?{stdout:y,stderr:"",exitCode:1}:{stdout:y,stderr:`${r}: ${e}: is a directory -- ignored
659
+ `,exitCode:1}}catch{return{stdout:y,stderr:`${r}: ${e}: No such file or directory
660
+ `,exitCode:1}}try{c=await t.fs.readFileBuffer(a)}catch{return{stdout:y,stderr:`${r}: ${e}: No such file or directory
661
+ `,exitCode:1}}if(s){if(!e.endsWith(o))return n.quiet?{stdout:y,stderr:"",exitCode:1}:{stdout:y,stderr:`${r}: ${e}: unknown suffix -- ignored
662
+ `,exitCode:1};if(!to(c))return n.quiet?{stdout:y,stderr:"",exitCode:1}:{stdout:y,stderr:`${r}: ${e}: not in gzip format
663
+ `,exitCode:1};let u;try{u=$l(c)}catch(f){let p=f instanceof Error?f.message:"unknown error";return{stdout:y,stderr:`${r}: ${e}: ${p}
664
+ `,exitCode:1}}if(i)return{stdout:u,stderr:"",exitCode:0};if(n.name){let f=V0(c);f.originalName?l=t.fs.resolvePath(t.cwd,f.originalName):l=a.slice(0,-o.length)}else l=a.slice(0,-o.length);if(!n.force)try{return await t.fs.stat(l),{stdout:y,stderr:`${r}: ${l} already exists; not overwritten
665
+ `,exitCode:1}}catch{}if(await t.fs.writeFile(l,u),!n.keep&&!i&&await t.fs.rm(a),n.verbose){let f=c.length>0?((1-c.length/u.length)*100).toFixed(1):"0.0";return{stdout:y,stderr:`${e}: ${f}% -- replaced with ${l.split("/").pop()}
666
+ `,exitCode:0}}return{stdout:y,stderr:"",exitCode:0}}else{if(e.endsWith(o))return n.quiet?{stdout:y,stderr:"",exitCode:1}:{stdout:y,stderr:`${r}: ${e} already has ${o} suffix -- unchanged
667
+ `,exitCode:1};let u=G0(n),f;try{f=j0(c,{level:u})}catch(p){let h=p instanceof Error?p.message:"unknown error";return{stdout:y,stderr:`${r}: ${e}: ${h}
668
+ `,exitCode:1}}if(i)return{stdout:f,stderr:"",exitCode:0};if(l=a+o,!n.force)try{return await t.fs.stat(l),{stdout:y,stderr:`${r}: ${l} already exists; not overwritten
669
+ `,exitCode:1}}catch{}if(await t.fs.writeFile(l,f),!n.keep&&!i&&await t.fs.rm(a),n.verbose){let p=c.length>0?((1-f.length/c.length)*100).toFixed(1):"0.0";return{stdout:y,stderr:`${e}: ${p}% -- replaced with ${l.split("/").pop()}
670
+ `,exitCode:0}}return{stdout:y,stderr:"",exitCode:0}}}async function Z0(t,e,n,r,s,i){let o=await t.fs.readdir(e),a=y,l="",c=0;for(let u of o){let f=t.fs.resolvePath(e,u),p=await t.fs.stat(f);if(p.isDirectory){let h=await Z0(t,f,n,r,s,i);a=j(a,h.stdout),l+=h.stderr,h.exitCode!==0&&(c=h.exitCode)}else if(p.isFile){let h=n.suffix;if(s&&!u.endsWith(h)||!s&&u.endsWith(h))continue;let m=f.startsWith(`${t.cwd}/`)?f.slice(t.cwd.length+1):f,d=await q0(t,m,n,r,s,i);a=j(a,d.stdout),l+=d.stderr,d.exitCode!==0&&(c=d.exitCode)}}return{stdout:a,stderr:l,exitCode:c}}async function Nb(t,e,n,r){let s;if(e==="-"||e==="")s=t.stdin;else{let f=t.fs.resolvePath(t.cwd,e);try{s=await t.fs.readFileBuffer(f)}catch{return{stdout:y,stderr:`${r}: ${e}: No such file or directory
671
+ `,exitCode:1}}}if(!to(s))return n.quiet?{stdout:y,stderr:"",exitCode:1}:{stdout:y,stderr:`${r}: ${e}: not in gzip format
672
+ `,exitCode:1};let i=s.length,o=Cb(s),a=o>0?((1-i/o)*100).toFixed(1):"0.0",c=V0(s).originalName||(e==="-"?"":e.replace(/\.gz$/,"")),u=`${i.toString().padStart(10)} ${o.toString().padStart(10)} ${a.padStart(5)}% ${c}
673
+ `;return{stdout:x(u),stderr:"",exitCode:0}}async function vb(t,e,n,r){let s;if(e==="-"||e==="")s=t.stdin;else{let i=t.fs.resolvePath(t.cwd,e);try{s=await t.fs.readFileBuffer(i)}catch{return{stdout:y,stderr:`${r}: ${e}: No such file or directory
674
+ `,exitCode:1}}}if(!to(s))return n.quiet?{stdout:y,stderr:"",exitCode:1}:{stdout:y,stderr:`${r}: ${e}: not in gzip format
675
+ `,exitCode:1};try{return $l(s),n.verbose?{stdout:y,stderr:`${e}: OK
676
+ `,exitCode:0}:{stdout:y,stderr:"",exitCode:0}}catch(i){let o=i instanceof Error?i.message:"invalid";return{stdout:y,stderr:`${r}: ${e}: ${o}
677
+ `,exitCode:1}}}async function Dl(t,e,n){let r=W(t),s=n==="zcat"?Ab:n==="gunzip"?Eb:xb;if(Z(r))return q(s);let i=ke(n,r,Sb);if(!i.ok)return R(i.error.stderr).includes("unrecognized option"),i.error;let o=i.result.flags,a=i.result.positional,l=n==="gunzip"||n==="zcat"||o.decompress||o.uncompress,c=n==="zcat"||o.stdout||o.toStdout;if(o.list){a.length===0&&(a=["-"]);let h=x(` compressed uncompressed ratio uncompressed_name
678
+ `),m="",d=0;for(let g of a){let w=await Nb(e,g,o,n);h=j(h,w.stdout),m+=w.stderr,w.exitCode!==0&&(d=w.exitCode)}return{stdout:h,stderr:x(m),exitCode:d}}if(o.test){a.length===0&&(a=["-"]);let h=y,m="",d=0;for(let g of a){let w=await vb(e,g,o,n);h=j(h,w.stdout),m+=w.stderr,w.exitCode!==0&&(d=w.exitCode)}return{stdout:h,stderr:x(m),exitCode:d}}a.length===0&&(a=["-"]);let u=y,f="",p=0;for(let h of a){let m=await q0(e,h,o,n,l,c);u=j(u,m.stdout),f+=m.stderr,m.exitCode!==0&&(p=m.exitCode)}return{stdout:u,stderr:x(f),exitCode:p}}var xb,Eb,Ab,Sb,kb,Ib,Tb,Ob,Rb,Pb,ro=I(()=>{"use strict";nt();F();he();xb={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
679
+
680
+ When no FILE is given, or when FILE is -, read from standard input.
681
+
682
+ With -d, decompress instead.`,options:["-c, --stdout write to standard output, keep original files","-d, --decompress decompress","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not save or restore the original name and timestamp","-N, --name save or restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode","-1, --fast compress faster","-9, --best compress better"," --help display this help and exit"]},Eb={name:"gunzip",summary:"decompress files",usage:"gunzip [OPTION]... [FILE]...",description:`Decompress FILEs (by default, in-place).
683
+
684
+ When no FILE is given, or when FILE is -, read from standard input.`,options:["-c, --stdout write to standard output, keep original files","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not restore the original name and timestamp","-N, --name restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},Ab={name:"zcat",summary:"decompress files to stdout",usage:"zcat [OPTION]... [FILE]...",description:`Decompress FILEs to standard output.
685
+
686
+ When no FILE is given, or when FILE is -, read from standard input.`,options:["-f, --force force; read compressed data even from a terminal","-l, --list list compressed file contents","-q, --quiet suppress all warnings","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},Sb={stdout:{short:"c",long:"stdout",type:"boolean"},toStdout:{long:"to-stdout",type:"boolean"},decompress:{short:"d",long:"decompress",type:"boolean"},uncompress:{long:"uncompress",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},keep:{short:"k",long:"keep",type:"boolean"},list:{short:"l",long:"list",type:"boolean"},noName:{short:"n",long:"no-name",type:"boolean"},name:{short:"N",long:"name",type:"boolean"},quiet:{short:"q",long:"quiet",type:"boolean"},recursive:{short:"r",long:"recursive",type:"boolean"},suffix:{short:"S",long:"suffix",type:"string",default:".gz"},test:{short:"t",long:"test",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},fast:{short:"1",long:"fast",type:"boolean"},level2:{short:"2",type:"boolean"},level3:{short:"3",type:"boolean"},level4:{short:"4",type:"boolean"},level5:{short:"5",type:"boolean"},level6:{short:"6",type:"boolean"},level7:{short:"7",type:"boolean"},level8:{short:"8",type:"boolean"},best:{short:"9",long:"best",type:"boolean"}};kb={name:"gzip",async execute(t,e){return Dl(t,e,"gzip")}},Ib={name:"gunzip",async execute(t,e){return Dl(t,e,"gunzip")}},Tb={name:"zcat",async execute(t,e){return Dl(t,e,"zcat")}},Ob={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},Rb={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},Pb={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0}});function _l(t){let e=t.indexOf("=");if(e>=0){let n=t.slice(0,e),r=t.slice(e+1);return n?`${encodeURIComponent(n)}=${encodeURIComponent(r)}`:encodeURIComponent(r)}return encodeURIComponent(t)}function Ml(t){let e=t.indexOf("=");if(e<0)return null;let n=t.slice(0,e),r=t.slice(e+1),s,i,o=r.match(/;type=([^;]+)$/);o&&(i=o[1],r=r.slice(0,-o[0].length));let a=r.match(/;filename=([^;]+)/);return a&&(s=a[1],r=r.replace(a[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(s=s??r.slice(1).split("/").pop()),{name:n,value:r,filename:s,contentType:i}}function Y0(t,e){let n=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let s of t){let i=s.value;if(i.startsWith("@")||i.startsWith("<")){let a=i.slice(1);i=e.get(a)??""}let o=`--${n}\r
687
+ `;s.filename?(o+=`Content-Disposition: form-data; name="${s.name}"; filename="${s.filename}"\r
688
+ `,s.contentType&&(o+=`Content-Type: ${s.contentType}\r
689
+ `)):o+=`Content-Disposition: form-data; name="${s.name}"\r
690
+ `,o+=`\r
691
+ ${i}\r
692
+ `,r.push(o)}return r.push(`--${n}--\r
693
+ `),{body:r.join(""),boundary:n}}var Ll=I(()=>{"use strict"});var Q0,K0=I(()=>{"use strict";Q0={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data"," --data-urlencode DATA URL-encode and POST data","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]}});function X0(t){let e={method:"GET",headers:Object.create(null),dataBinary:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1};for(let n=0;n<t.length;n++){let r=t[n];if(r==="-X"||r==="--request")e.method=t[++n]??"GET";else if(r.startsWith("-X"))e.method=r.slice(2);else if(r.startsWith("--request="))e.method=r.slice(10);else if(r==="-H"||r==="--header"){let s=t[++n];if(s){let i=s.indexOf(":");if(i>0){let o=s.slice(0,i).trim(),a=s.slice(i+1).trim();e.headers[o]=a}}}else if(r.startsWith("--header=")){let s=r.slice(9),i=s.indexOf(":");if(i>0){let o=s.slice(0,i).trim(),a=s.slice(i+1).trim();e.headers[o]=a}}else if(r==="-d"||r==="--data"||r==="--data-raw")e.data=t[++n]??"",e.method==="GET"&&(e.method="POST");else if(r.startsWith("-d"))e.data=r.slice(2),e.method==="GET"&&(e.method="POST");else if(r.startsWith("--data="))e.data=r.slice(7),e.method==="GET"&&(e.method="POST");else if(r.startsWith("--data-raw="))e.data=r.slice(11),e.method==="GET"&&(e.method="POST");else if(r==="--data-binary")e.data=t[++n]??"",e.dataBinary=!0,e.method==="GET"&&(e.method="POST");else if(r.startsWith("--data-binary="))e.data=r.slice(14),e.dataBinary=!0,e.method==="GET"&&(e.method="POST");else if(r==="--data-urlencode"){let s=t[++n]??"";e.data=(e.data?`${e.data}&`:"")+_l(s),e.method==="GET"&&(e.method="POST")}else if(r.startsWith("--data-urlencode=")){let s=r.slice(17);e.data=(e.data?`${e.data}&`:"")+_l(s),e.method==="GET"&&(e.method="POST")}else if(r==="-F"||r==="--form"){let s=t[++n]??"",i=Ml(s);i&&e.formFields.push(i),e.method==="GET"&&(e.method="POST")}else if(r.startsWith("--form=")){let s=r.slice(7),i=Ml(s);i&&e.formFields.push(i),e.method==="GET"&&(e.method="POST")}else if(r==="-u"||r==="--user")e.user=t[++n];else if(r.startsWith("-u"))e.user=r.slice(2);else if(r.startsWith("--user="))e.user=r.slice(7);else if(r==="-A"||r==="--user-agent")e.headers["User-Agent"]=t[++n]??"";else if(r.startsWith("-A"))e.headers["User-Agent"]=r.slice(2);else if(r.startsWith("--user-agent="))e.headers["User-Agent"]=r.slice(13);else if(r==="-e"||r==="--referer")e.headers.Referer=t[++n]??"";else if(r.startsWith("-e"))e.headers.Referer=r.slice(2);else if(r.startsWith("--referer="))e.headers.Referer=r.slice(10);else if(r==="-b"||r==="--cookie")e.headers.Cookie=t[++n]??"";else if(r.startsWith("-b"))e.headers.Cookie=r.slice(2);else if(r.startsWith("--cookie="))e.headers.Cookie=r.slice(9);else if(r==="-c"||r==="--cookie-jar")e.cookieJar=t[++n];else if(r.startsWith("--cookie-jar="))e.cookieJar=r.slice(13);else if(r==="-T"||r==="--upload-file")e.uploadFile=t[++n],e.method==="GET"&&(e.method="PUT");else if(r.startsWith("--upload-file="))e.uploadFile=r.slice(14),e.method==="GET"&&(e.method="PUT");else if(r==="-m"||r==="--max-time"){let s=parseFloat(t[++n]??"0");!Number.isNaN(s)&&s>0&&(e.timeoutMs=s*1e3)}else if(r.startsWith("--max-time=")){let s=parseFloat(r.slice(11));!Number.isNaN(s)&&s>0&&(e.timeoutMs=s*1e3)}else if(r==="--connect-timeout"){let s=parseFloat(t[++n]??"0");!Number.isNaN(s)&&s>0&&e.timeoutMs===void 0&&(e.timeoutMs=s*1e3)}else if(r.startsWith("--connect-timeout=")){let s=parseFloat(r.slice(18));!Number.isNaN(s)&&s>0&&e.timeoutMs===void 0&&(e.timeoutMs=s*1e3)}else if(r==="-o"||r==="--output")e.outputFile=t[++n];else if(r.startsWith("--output="))e.outputFile=r.slice(9);else if(r==="-O"||r==="--remote-name")e.useRemoteName=!0;else if(r==="-I"||r==="--head")e.headOnly=!0,e.method="HEAD";else if(r==="-i"||r==="--include")e.includeHeaders=!0;else if(r==="-s"||r==="--silent")e.silent=!0;else if(r==="-S"||r==="--show-error")e.showError=!0;else if(r==="-f"||r==="--fail")e.failSilently=!0;else if(r==="-L"||r==="--location")e.followRedirects=!0;else if(r==="--max-redirs")n++;else if(!r.startsWith("--max-redirs="))if(r==="-w"||r==="--write-out")e.writeOut=t[++n];else if(r.startsWith("--write-out="))e.writeOut=r.slice(12);else if(r==="-v"||r==="--verbose")e.verbose=!0;else{if(r.startsWith("--")&&r!=="--")return oe("curl",r);if(r.startsWith("-")&&r!=="-")for(let s of r.slice(1))switch(s){case"s":e.silent=!0;break;case"S":e.showError=!0;break;case"f":e.failSilently=!0;break;case"L":e.followRedirects=!0;break;case"I":e.headOnly=!0,e.method="HEAD";break;case"i":e.includeHeaders=!0;break;case"O":e.useRemoteName=!0;break;case"v":e.verbose=!0;break;default:return oe("curl",`-${s}`)}else r.startsWith("-")||(e.url=r)}}return e}var J0=I(()=>{"use strict";he();Ll()});function Fl(t){return Object.entries(t).map(([e,n])=>`${e}: ${n}`).join(`\r
694
+ `)}function em(t){try{return new URL(t).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function Ul(t,e){let n=t;return n=n.replace(/%\{http_code\}/g,String(e.status)),n=n.replace(/%\{content_type\}/g,e.headers["content-type"]||""),n=n.replace(/%\{url_effective\}/g,e.url),n=n.replace(/%\{size_download\}/g,String(e.bodyLength)),n=n.replace(/\\n/g,`
695
+ `),n}var tm=I(()=>{"use strict"});var nm={};se(nm,{curlCommand:()=>Lb});async function $b(t,e){if(t.uploadFile){let n=e.fs.resolvePath(e.cwd,t.uploadFile);return{body:await e.fs.readFile(n)}}if(t.formFields.length>0){let n=new Map;for(let i of t.formFields)if(i.value.startsWith("@")||i.value.startsWith("<")){let o=e.fs.resolvePath(e.cwd,i.value.slice(1));try{let a=await e.fs.readFile(o);n.set(i.value.slice(1),a)}catch{n.set(i.value.slice(1),"")}}let{body:r,boundary:s}=Y0(t.formFields,n);return{body:r,contentType:`multipart/form-data; boundary=${s}`}}return t.data!==void 0?{body:t.data}:{}}function Db(t,e){let n=rt(t.headers??{});if(t.user){let r=Buffer.from(t.user).toString("base64");n.Authorization=`Basic ${r}`}return e&&!n["Content-Type"]&&(n["Content-Type"]=e),n}async function _b(t,e,n){if(!t.cookieJar)return;let r=e["set-cookie"];if(!r)return;let s=n.fs.resolvePath(n.cwd,t.cookieJar);await n.fs.writeFile(s,r)}function Mb(t,e,n){let r="";if(t.verbose){r+=`> ${t.method} ${n}
696
+ `;for(let[s,i]of Object.entries(t.headers))r+=`> ${s}: ${i}
697
+ `;r+=`>
698
+ `,r+=`< HTTP/1.1 ${e.status} ${e.statusText}
699
+ `;for(let[s,i]of Object.entries(e.headers))r+=`< ${s}: ${i}
700
+ `;r+=`<
701
+ `}return t.includeHeaders&&!t.verbose&&(r+=`HTTP/1.1 ${e.status} ${e.statusText}\r
702
+ `,r+=Fl(e.headers),r+=`\r
703
+ \r
704
+ `),t.headOnly?t.includeHeaders||t.verbose||(r+=`HTTP/1.1 ${e.status} ${e.statusText}\r
705
+ `,r+=Fl(e.headers),r+=`\r
706
+ `):r+=e.body,t.writeOut&&(r+=Ul(t.writeOut,{status:e.status,headers:e.headers,url:e.url,bodyLength:e.body.length})),r}var Lb,rm=I(()=>{"use strict";Qt();F();he();Pn();Ll();K0();J0();tm();Lb={name:"curl",async execute(t,e){let n=W(t);if(Z(n))return q(Q0);let r=X0(n);if("exitCode"in r)return r;let s=r;if(!s.url)return{stdout:y,stderr:x(`curl: no URL specified
707
+ `),exitCode:2};if(!e.fetch)return{stdout:y,stderr:x(`curl: internal error: fetch not available
708
+ `),exitCode:1};let i=s.url;i.match(/^https?:\/\//)||(i=`https://${i}`);try{let{body:o,contentType:a}=await $b(s,e),l=Db(s,a),c=await e.fetch(i,{method:s.method,headers:Object.keys(l).length>0?l:void 0,body:o,followRedirects:s.followRedirects,timeoutMs:s.timeoutMs});if(await _b(s,c.headers,e),s.failSilently&&c.status>=400){let f=s.showError||!s.silent?`curl: (22) The requested URL returned error: ${c.status}
709
+ `:"";return{stdout:y,stderr:x(f),exitCode:22}}let u=Mb(s,c,i);if(s.outputFile||s.useRemoteName){let f=s.outputFile||em(i),p=e.fs.resolvePath(e.cwd,f);await e.fs.writeFile(p,s.headOnly?"":c.body),s.verbose||(u=""),s.writeOut&&(u=Ul(s.writeOut,{status:c.status,headers:c.headers,url:c.url,bodyLength:c.body.length}))}return{stdout:x(u),stderr:y,exitCode:0}}catch(o){let a=qe(o),l=1;a.includes("Network access denied")?l=7:a.includes("HTTP method")&&a.includes("not allowed")?l=3:a.includes("Redirect target not in allow-list")||a.includes("Too many redirects")?l=47:a.includes("aborted")&&(l=28);let u=!s.silent||s.showError?`curl: (${l}) ${a}
710
+ `:"";return{stdout:y,stderr:x(u),exitCode:l}}}}});function Dn(){return typeof process>"u"?{pid:1,ppid:0,uid:1e3,gid:1e3}:{pid:process.pid,ppid:process.ppid,uid:process.getuid?.()??1e3,gid:process.getgid?.()??1e3}}function dm(){let{pid:t,ppid:e,uid:n,gid:r}=Dn();return`Name: bash
711
+ State: R (running)
712
+ Pid: ${t}
713
+ PPid: ${e}
714
+ Uid: ${n} ${n} ${n} ${n}
715
+ Gid: ${r} ${r} ${r} ${r}
716
+ `}var pm,hm,oo=I(()=>{"use strict";pm="5.1.0(1)-release",hm="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT"});function ym(t){let e=t.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!e)return!1;let n=t.slice(e[0].length);if(n===""||n==="+")return!0;if(n[0]==="["){let r=0,s=0;for(;s<n.length;s++)if(n[s]==="[")r++;else if(n[s]==="]"&&(r--,r===0))break;if(r!==0||s>=n.length)return!1;let i=n.slice(s+1);return i===""||i==="+"}return!1}function wm(t){let e=0;for(let n=0;n<t.length;n++){let r=t[n];if(r==="[")e++;else if(r==="]")e--;else{if(e===0&&r==="=")return n;if(e===0&&r==="+"&&t[n+1]==="=")return n+1}}return-1}function tx(t){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t)}function bm(t){return t===" "||t===" "||t===`
717
+ `||t===";"||t==="&"||t==="|"||t==="("||t===")"||t==="<"||t===">"}var S,jn,gm,Xb,Jb,ex,ao,Gn=I(()=>{"use strict";(function(t){t.EOF="EOF",t.NEWLINE="NEWLINE",t.SEMICOLON="SEMICOLON",t.AMP="AMP",t.PIPE="PIPE",t.PIPE_AMP="PIPE_AMP",t.AND_AND="AND_AND",t.OR_OR="OR_OR",t.BANG="BANG",t.LESS="LESS",t.GREAT="GREAT",t.DLESS="DLESS",t.DGREAT="DGREAT",t.LESSAND="LESSAND",t.GREATAND="GREATAND",t.LESSGREAT="LESSGREAT",t.DLESSDASH="DLESSDASH",t.CLOBBER="CLOBBER",t.TLESS="TLESS",t.AND_GREAT="AND_GREAT",t.AND_DGREAT="AND_DGREAT",t.LPAREN="LPAREN",t.RPAREN="RPAREN",t.LBRACE="LBRACE",t.RBRACE="RBRACE",t.DSEMI="DSEMI",t.SEMI_AND="SEMI_AND",t.SEMI_SEMI_AND="SEMI_SEMI_AND",t.DBRACK_START="DBRACK_START",t.DBRACK_END="DBRACK_END",t.DPAREN_START="DPAREN_START",t.DPAREN_END="DPAREN_END",t.IF="IF",t.THEN="THEN",t.ELSE="ELSE",t.ELIF="ELIF",t.FI="FI",t.FOR="FOR",t.WHILE="WHILE",t.UNTIL="UNTIL",t.DO="DO",t.DONE="DONE",t.CASE="CASE",t.ESAC="ESAC",t.IN="IN",t.FUNCTION="FUNCTION",t.SELECT="SELECT",t.TIME="TIME",t.COPROC="COPROC",t.WORD="WORD",t.NAME="NAME",t.NUMBER="NUMBER",t.ASSIGNMENT_WORD="ASSIGNMENT_WORD",t.FD_VARIABLE="FD_VARIABLE",t.COMMENT="COMMENT",t.HEREDOC_CONTENT="HEREDOC_CONTENT"})(S||(S={}));jn=class extends Error{line;column;constructor(e,n,r){super(`line ${n}: ${e}`),this.line=n,this.column=r,this.name="LexerError"}},gm=new Map([["if",S.IF],["then",S.THEN],["else",S.ELSE],["elif",S.ELIF],["fi",S.FI],["for",S.FOR],["while",S.WHILE],["until",S.UNTIL],["do",S.DO],["done",S.DONE],["case",S.CASE],["esac",S.ESAC],["in",S.IN],["function",S.FUNCTION],["select",S.SELECT],["time",S.TIME],["coproc",S.COPROC]]);Xb=[[";",";","&",S.SEMI_SEMI_AND],["<","<","<",S.TLESS],["&",">",">",S.AND_DGREAT]],Jb=[["[","[",S.DBRACK_START],["]","]",S.DBRACK_END],["(","(",S.DPAREN_START],[")",")",S.DPAREN_END],["&","&",S.AND_AND],["|","|",S.OR_OR],[";",";",S.DSEMI],[";","&",S.SEMI_AND],["|","&",S.PIPE_AMP],[">",">",S.DGREAT],["<","&",S.LESSAND],[">","&",S.GREATAND],["<",">",S.LESSGREAT],[">","|",S.CLOBBER],["&",">",S.AND_GREAT]],ex=new Map([["|",S.PIPE],["&",S.AMP],[";",S.SEMICOLON],["(",S.LPAREN],[")",S.RPAREN],["<",S.LESS],[">",S.GREAT]]);ao=class{input;pos=0;line=1;column=1;tokens=[];pendingHeredocs=[];dparenDepth=0;constructor(e){this.input=e}tokenize(){let n=this.input.length,r=this.tokens,s=this.pendingHeredocs;for(;this.pos<n;){if(s.length>0&&r.length>0&&r[r.length-1].type===S.NEWLINE){this.readHeredocContent();continue}if(this.skipWhitespace(),this.pos>=n)break;let i=this.nextToken();i&&r.push(i)}return r.push({type:S.EOF,value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),r}skipWhitespace(){let e=this.input,n=e.length,r=this.pos,s=this.column,i=this.line;for(;r<n;){let o=e[r];if(o===" "||o===" ")r++,s++;else if(o==="\\"&&e[r+1]===`
718
+ `)r+=2,i++,s=1;else break}this.pos=r,this.column=s,this.line=i}nextToken(){let e=this.input,n=this.pos,r=this.line,s=this.column,i=e[n],o=e[n+1],a=e[n+2];if(i==="#"&&this.dparenDepth===0)return this.readComment(n,r,s);if(i===`
719
+ `)return this.pos=n+1,this.line++,this.column=1,{type:S.NEWLINE,value:`
720
+ `,start:n,end:n+1,line:r,column:s};if(i==="<"&&o==="<"&&a==="-")return this.pos=n+3,this.column=s+3,this.registerHeredocFromLookahead(!0),this.makeToken(S.DLESSDASH,"<<-",n,r,s);for(let[c,u,f,p]of Xb)if(i===c&&o===u&&a===f)return this.pos=n+3,this.column=s+3,this.makeToken(p,c+u+f,n,r,s);if(i==="<"&&o==="<")return this.pos=n+2,this.column=s+2,this.registerHeredocFromLookahead(!1),this.makeToken(S.DLESS,"<<",n,r,s);if(i==="("&&o==="(")return this.dparenDepth>0?(this.pos=n+1,this.column=s+1,this.dparenDepth++,this.makeToken(S.LPAREN,"(",n,r,s)):this.looksLikeNestedSubshells(n+2)||this.dparenClosesWithSpacedParens(n+2)?(this.pos=n+1,this.column=s+1,this.makeToken(S.LPAREN,"(",n,r,s)):(this.pos=n+2,this.column=s+2,this.dparenDepth=1,this.makeToken(S.DPAREN_START,"((",n,r,s));if(i===")"&&o===")")return this.dparenDepth===1?(this.pos=n+2,this.column=s+2,this.dparenDepth=0,this.makeToken(S.DPAREN_END,"))",n,r,s)):this.dparenDepth>1?(this.pos=n+1,this.column=s+1,this.dparenDepth--,this.makeToken(S.RPAREN,")",n,r,s)):(this.pos=n+1,this.column=s+1,this.makeToken(S.RPAREN,")",n,r,s));for(let[c,u,f]of Jb)if(!(c==="("&&u==="("||c===")"&&u===")")&&!(this.dparenDepth>0&&c===";"&&(f===S.DSEMI||f===S.SEMI_AND||f===S.SEMI_SEMI_AND))&&i===c&&o===u){if(f===S.DBRACK_START||f===S.DBRACK_END){let p=e[n+2];if(p!==void 0&&p!==" "&&p!==" "&&p!==`
721
+ `&&p!==";"&&p!=="&"&&p!=="|"&&p!=="("&&p!==")"&&p!=="<"&&p!==">")break}return this.pos=n+2,this.column=s+2,this.makeToken(f,c+u,n,r,s)}if(i==="("&&this.dparenDepth>0)return this.pos=n+1,this.column=s+1,this.dparenDepth++,this.makeToken(S.LPAREN,"(",n,r,s);if(i===")"&&this.dparenDepth>1)return this.pos=n+1,this.column=s+1,this.dparenDepth--,this.makeToken(S.RPAREN,")",n,r,s);let l=ex.get(i);if(l!==void 0)return this.pos=n+1,this.column=s+1,this.makeToken(l,i,n,r,s);if(i==="{"){let c=this.scanFdVariable(n);return c!==null?(this.pos=c.end,this.column=s+(c.end-n),{type:S.FD_VARIABLE,value:c.varname,start:n,end:c.end,line:r,column:s}):o==="}"?(this.pos=n+2,this.column=s+2,{type:S.WORD,value:"{}",start:n,end:n+2,line:r,column:s,quoted:!1,singleQuoted:!1}):this.scanBraceExpansion(n)!==null?this.readWordWithBraceExpansion(n,r,s):this.scanLiteralBraceWord(n)!==null?this.readWordWithBraceExpansion(n,r,s):o!==void 0&&o!==" "&&o!==" "&&o!==`
722
+ `?this.readWord(n,r,s):(this.pos=n+1,this.column=s+1,this.makeToken(S.LBRACE,"{",n,r,s))}return i==="}"?this.isWordCharFollowing(n+1)?this.readWord(n,r,s):(this.pos=n+1,this.column=s+1,this.makeToken(S.RBRACE,"}",n,r,s)):i==="!"?o==="="?(this.pos=n+2,this.column=s+2,this.makeToken(S.WORD,"!=",n,r,s)):(this.pos=n+1,this.column=s+1,this.makeToken(S.BANG,"!",n,r,s)):this.readWord(n,r,s)}looksLikeNestedSubshells(e){let n=this.input,r=n.length,s=e;for(;s<r&&(n[s]===" "||n[s]===" ");)s++;if(s>=r)return!1;let i=n[s];if(i==="(")return this.looksLikeNestedSubshells(s+1);let o=/[a-zA-Z_]/.test(i),a=i==="!"||i==="[";if(!o&&!a)return!1;let l=s;for(;l<r&&/[a-zA-Z0-9_\-.]/.test(n[l]);)l++;if(l===s)return a;let c=l;for(;c<r&&(n[c]===" "||n[c]===" ");)c++;if(c>=r)return!1;let u=n[c];if(u==="="&&n[c+1]!=="="||u===`
723
+ `||l===c&&/[+\-*/%<>&|^!~?:]/.test(u)&&u!=="-"||u===")"&&n[c+1]===")")return!1;if(c>l&&(u==="-"||u==='"'||u==="'"||u==="$"||/[a-zA-Z_/.]/.test(u))){let f=c;for(;f<r&&n[f]!==`
724
+ `;){if(n[f]===")")return!0;f++}return!1}if(u===")"){let f=c+1;for(;f<r&&(n[f]===" "||n[f]===" ");)f++;if(n[f]==="|"&&n[f+1]==="|"||n[f]==="&"&&n[f+1]==="&"||n[f]===";"||n[f]==="|"&&n[f+1]!=="|")return!0}return!1}makeToken(e,n,r,s,i){return{type:e,value:n,start:r,end:this.pos,line:s,column:i}}readComment(e,n,r){let s=this.input,i=s.length,o=this.pos;for(;o<i&&s[o]!==`
725
+ `;)o++;let a=s.slice(e,o);return this.pos=o,this.column=r+(o-e),{type:S.COMMENT,value:a,start:e,end:o,line:n,column:r}}readWord(e,n,r){let s=this.input,i=s.length,o=this.pos,a=o;for(;o<i;){let b=s[o];if(b===" "||b===" "||b===`
726
+ `||b===";"||b==="&"||b==="|"||b==="("||b===")"||b==="<"||b===">"||b==="'"||b==='"'||b==="\\"||b==="$"||b==="`"||b==="{"||b==="}"||b==="~"||b==="*"||b==="?"||b==="[")break;o++}if(o>a){let b=s[o];if(!(b==="("&&o>a&&"@*+?!".includes(s[o-1]))){if(o>=i||b===" "||b===" "||b===`
727
+ `||b===";"||b==="&"||b==="|"||b==="("||b===")"||b==="<"||b===">"){let A=s.slice(a,o);this.pos=o,this.column=r+(o-a);let N=gm.get(A);if(N!==void 0)return{type:N,value:A,start:e,end:o,line:n,column:r};let P=wm(A);return P>0&&ym(A.slice(0,P))?{type:S.ASSIGNMENT_WORD,value:A,start:e,end:o,line:n,column:r}:/^[0-9]+$/.test(A)?{type:S.NUMBER,value:A,start:e,end:o,line:n,column:r}:/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(A)?{type:S.NAME,value:A,start:e,end:o,line:n,column:r,quoted:!1,singleQuoted:!1}:{type:S.WORD,value:A,start:e,end:o,line:n,column:r,quoted:!1,singleQuoted:!1}}}}o=this.pos;let l=this.column,c=this.line,u="",f=!1,p=!1,h=!1,m=!1,d=s[o]==='"'||s[o]==="'",g=!1,w=0;for(;o<i;){let b=s[o];if(!h&&!m){if(b==="("&&u.length>0&&"@*+?!".includes(u[u.length-1])){let A=this.scanExtglobPattern(o);if(A!==null){u+=A.content,o=A.end,l+=A.content.length;continue}}if(b==="["&&w===0){if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u)){let A=o+1<i?s[o+1]:"";if(A==="^"||A==="!"){u+=b,o++,l++;continue}w=1,u+=b,o++,l++;continue}}else if(b==="["&&w>0){u.length>0&&u[u.length-1]!=="\\"&&w++,u+=b,o++,l++;continue}else if(b==="]"&&w>0){u.length>0&&u[u.length-1]!=="\\"&&w--,u+=b,o++,l++;continue}if(w>0){if(b===`
728
+ `)break;u+=b,o++,l++;continue}if(b===" "||b===" "||b===`
729
+ `||b===";"||b==="&"||b==="|"||b==="("||b===")"||b==="<"||b===">")break}if(b==="$"&&o+1<i&&s[o+1]==="'"&&!h&&!m){for(u+="$'",o+=2,l+=2;o<i&&s[o]!=="'";)s[o]==="\\"&&o+1<i?(u+=s[o]+s[o+1],o+=2,l+=2):(u+=s[o],o++,l++);o<i&&(u+="'",o++,l++);continue}if(b==="$"&&o+1<i&&s[o+1]==='"'&&!h&&!m){o++,l++,m=!0,f=!0,u===""&&(d=!0),o++,l++;continue}if(b==="'"&&!m){if(h)if(h=!1,!d||g)u+=b;else{let A=o+1<i?s[o+1]:"";A&&!bm(A)&&A!=="'"&&(A==='"'?(g=!0,u+=b,p=!1,f=!1):(g=!0,u+=b))}else h=!0,d&&!g?(p=!0,f=!0):u+=b;o++,l++;continue}if(b==='"'&&!h){if(m)if(m=!1,!d||g)u+=b;else{let A=o+1<i?s[o+1]:"";A&&!bm(A)&&A!=='"'&&(A==="'"?(g=!0,u+=b,p=!1,f=!1):(g=!0,u+=b))}else m=!0,d&&!g?f=!0:u+=b;o++,l++;continue}if(b==="\\"&&!h&&o+1<i){let A=s[o+1];if(A===`
730
+ `){o+=2,c++,l=1;continue}if(m){if(A==='"'||A==="\\"||A==="$"||A==="`"||A===`
731
+ `){if(A===`
732
+ `){o+=2,l=1,c++;continue}u+=b+A,o+=2,l+=2;continue}}else{A==="\\"||A==='"'||A==="'"||A==="`"||A==="*"||A==="?"||A==="["||A==="]"||A==="("||A===")"||A==="$"||A==="-"||A==="."||A==="^"||A==="+"||A==="{"||A==="}"?u+=b+A:u+=A,o+=2,l+=2;continue}}if(b==="$"&&o+1<i&&s[o+1]==="("&&!h){u+=b,o++,l++,u+=s[o],o++,l++;let A=1,N=!1,P=!1,O=0,G=!1,M="",Y=s[o]==="("&&!this.dollarDparenIsSubshell(o);for(;A>0&&o<i;){let B=s[o];if(u+=B,N)B==="'"&&(N=!1);else if(P)B==="\\"&&o+1<i?(u+=s[o+1],o++,l++):B==='"'&&(P=!1);else if(B==="'")N=!0,M="";else if(B==='"')P=!0,M="";else if(B==="\\"&&o+1<i)u+=s[o+1],o++,l++,M="";else if(B==="$"&&o+1<i&&s[o+1]==="{"){o++,l++,u+=s[o],o++,l++;let L=1,D=!1,v=!1;for(;L>0&&o<i;){let _=s[o];if(_==="\\"&&o+1<i&&!D){u+=_,o++,l++,u+=s[o],o++,l++;continue}u+=_,D?_==="'"&&(D=!1):v?_==='"'&&(v=!1):_==="'"?D=!0:_==='"'?v=!0:_==="{"?L++:_==="}"&&L--,_===`
733
+ `?(c++,l=0):l++,o++}M="";continue}else if(B==="#"&&!Y&&(M===""||/\s/.test(s[o-1]||""))){for(;o+1<i&&s[o+1]!==`
734
+ `;)o++,l++,u+=s[o];M=""}else/[a-zA-Z_]/.test(B)?M+=B:(M==="case"?(O++,G=!1):M==="in"&&O>0?G=!0:M==="esac"&&O>0&&(O--,G=!1),M="",B==="("?o>0&&s[o-1]==="$"?A++:G||A++:B===")"?G?G=!1:A--:B===";"&&O>0&&o+1<i&&s[o+1]===";"&&(G=!0));B===`
735
+ `&&(c++,l=0,M=""),o++,l++}continue}if(b==="$"&&o+1<i&&s[o+1]==="["&&!h){u+=b,o++,l++,u+=s[o],o++,l++;let A=1;for(;A>0&&o<i;){let N=s[o];u+=N,N==="["?A++:N==="]"?A--:N===`
736
+ `&&(c++,l=0),o++,l++}continue}if(b==="$"&&o+1<i&&s[o+1]==="{"&&!h){u+=b,o++,l++,u+=s[o],o++,l++;let A=1,N=!1,P=!1,O=c,G=l,M=c,Y=l;for(;A>0&&o<i;){let B=s[o];if(B==="\\"&&o+1<i&&s[o+1]===`
737
+ `){o+=2,c++,l=1;continue}if(B==="\\"&&o+1<i&&!N){u+=B,o++,l++,u+=s[o],o++,l++;continue}u+=B,N?B==="'"&&(N=!1):P?B==='"'&&(P=!1):B==="'"?(N=!0,O=c,G=l):B==='"'?(P=!0,M=c,Y=l):B==="{"?A++:B==="}"&&A--,B===`
738
+ `&&(c++,l=0),o++,l++}if(N)throw new jn("unexpected EOF while looking for matching `''",O,G);if(P)throw new jn("unexpected EOF while looking for matching `\"'",M,Y);continue}if(b==="$"&&o+1<i&&!h){let A=s[o+1];if(A==="#"||A==="?"||A==="$"||A==="!"||A==="@"||A==="*"||A==="-"||A>="0"&&A<="9"){u+=b+A,o+=2,l+=2;continue}}if(b==="`"&&!h){for(u+=b,o++,l++;o<i&&s[o]!=="`";){let A=s[o];u+=A,A==="\\"&&o+1<i&&(u+=s[o+1],o++,l++),A===`
739
+ `&&(c++,l=0),o++,l++}o<i&&(u+=s[o],o++,l++);continue}u+=b,o++,b===`
740
+ `?(c++,l=1):l++}if(this.pos=o,this.column=l,this.line=c,g&&d&&(u=s[e]+u,f=!1,p=!1),h||m){let b=h?"'":'"';throw new jn(`unexpected EOF while looking for matching \`${b}'`,n,r)}if(!d&&u.length>=2){if(u[0]==="'"&&u[u.length-1]==="'"){let b=u.slice(1,-1);!b.includes("'")&&!b.includes('"')&&(u=b,f=!0,p=!0)}else if(u[0]==='"'&&u[u.length-1]==='"'){let b=u.slice(1,-1),A=!1;for(let N=0;N<b.length;N++){if(b[N]==='"'){A=!0;break}b[N]==="\\"&&N+1<b.length&&N++}A||(u=b,f=!0,p=!1)}}if(u==="")return{type:S.WORD,value:"",start:e,end:o,line:n,column:r,quoted:f,singleQuoted:p};let E=gm.get(u);if(!f&&E!==void 0)return{type:E,value:u,start:e,end:o,line:n,column:r};if(!d){let b=wm(u);if(b>0&&ym(u.slice(0,b)))return{type:S.ASSIGNMENT_WORD,value:u,start:e,end:o,line:n,column:r,quoted:f,singleQuoted:p}}return/^[0-9]+$/.test(u)?{type:S.NUMBER,value:u,start:e,end:o,line:n,column:r}:tx(u)?{type:S.NAME,value:u,start:e,end:o,line:n,column:r,quoted:f,singleQuoted:p}:{type:S.WORD,value:u,start:e,end:o,line:n,column:r,quoted:f,singleQuoted:p}}readHeredocContent(){for(;this.pendingHeredocs.length>0;){let e=this.pendingHeredocs.shift();if(!e)break;let n=this.pos,r=this.line,s=this.column,i="";for(;this.pos<this.input.length;){let o=this.pos,a="";for(;this.pos<this.input.length&&this.input[this.pos]!==`
741
+ `;)a+=this.input[this.pos],this.pos++,this.column++;if((e.stripTabs?a.replace(/^\t+/,""):a)===e.delimiter){this.pos<this.input.length&&this.input[this.pos]===`
742
+ `&&(this.pos++,this.line++,this.column=1);break}if(i+=a,i.length>10485760)throw new jn("Heredoc size limit exceeded (10485760 bytes)",r,s);this.pos<this.input.length&&this.input[this.pos]===`
743
+ `&&(i+=`
744
+ `,this.pos++,this.line++,this.column=1)}this.tokens.push({type:S.HEREDOC_CONTENT,value:i,start:n,end:this.pos,line:r,column:s})}}addPendingHeredoc(e,n,r){this.pendingHeredocs.push({delimiter:e,stripTabs:n,quoted:r})}registerHeredocFromLookahead(e){let n=this.pos,r=this.column;for(;this.pos<this.input.length&&(this.input[this.pos]===" "||this.input[this.pos]===" ");)this.pos++,this.column++;let s="",i=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(/[\s;<>&|()]/.test(o))break;if(o==="'"||o==='"'){i=!0;let a=o;for(this.pos++,this.column++;this.pos<this.input.length&&this.input[this.pos]!==a;)s+=this.input[this.pos],this.pos++,this.column++;this.pos<this.input.length&&this.input[this.pos]===a&&(this.pos++,this.column++)}else o==="\\"?(i=!0,this.pos++,this.column++,this.pos<this.input.length&&(s+=this.input[this.pos],this.pos++,this.column++)):(s+=o,this.pos++,this.column++)}this.pos=n,this.column=r,s&&this.pendingHeredocs.push({delimiter:s,stripTabs:e,quoted:i})}isWordCharFollowing(e){if(e>=this.input.length)return!1;let n=this.input[e];return!(n===" "||n===" "||n===`
745
+ `||n===";"||n==="&"||n==="|"||n==="("||n===")"||n==="<"||n===">")}readWordWithBraceExpansion(e,n,r){let s=this.input,i=s.length,o=e,a=r;for(;o<i;){let c=s[o];if(c===" "||c===" "||c===`
746
+ `||c===";"||c==="&"||c==="|"||c==="("||c===")"||c==="<"||c===">")break;if(c==="{"){if(this.scanBraceExpansion(o)!==null){let f=1;for(o++,a++;o<i&&f>0;)s[o]==="{"?f++:s[o]==="}"&&f--,o++,a++;continue}o++,a++;continue}if(c==="}"){o++,a++;continue}if(c==="$"&&o+1<i&&s[o+1]==="("){o++,a++,o++,a++;let u=1;for(;u>0&&o<i;)s[o]==="("?u++:s[o]===")"&&u--,o++,a++;continue}if(c==="$"&&o+1<i&&s[o+1]==="{"){o++,a++,o++,a++;let u=1;for(;u>0&&o<i;)s[o]==="{"?u++:s[o]==="}"&&u--,o++,a++;continue}if(c==="`"){for(o++,a++;o<i&&s[o]!=="`";)s[o]==="\\"&&o+1<i?(o+=2,a+=2):(o++,a++);o<i&&(o++,a++);continue}o++,a++}let l=s.slice(e,o);return this.pos=o,this.column=a,{type:S.WORD,value:l,start:e,end:o,line:n,column:r,quoted:!1,singleQuoted:!1}}scanBraceExpansion(e){let n=this.input,r=n.length,s=e+1,i=1,o=!1,a=!1;for(;s<r&&i>0;){let l=n[s];if(l==="{")i++,s++;else if(l==="}")i--,s++;else if(l===","&&i===1)o=!0,s++;else if(l==="."&&s+1<r&&n[s+1]===".")a=!0,s+=2;else{if(l===" "||l===" "||l===`
747
+ `||l===";"||l==="&"||l==="|")return null;s++}}return i===0&&(o||a)?n.slice(e,s):null}scanLiteralBraceWord(e){let n=this.input,r=n.length,s=e+1,i=1;for(;s<r&&i>0;){let o=n[s];if(o==="{")i++,s++;else if(o==="}"){if(i--,i===0)return n.slice(e,s+1);s++}else{if(o===" "||o===" "||o===`
748
+ `||o===";"||o==="&"||o==="|")return null;s++}}return null}scanExtglobPattern(e){let n=this.input,r=n.length,s=e+1,i=1;for(;s<r&&i>0;){let o=n[s];if(o==="\\"&&s+1<r){s+=2;continue}if("@*+?!".includes(o)&&s+1<r&&n[s+1]==="("){s++,i++,s++;continue}if(o==="(")i++,s++;else if(o===")")i--,s++;else{if(o===`
749
+ `)return null;s++}}return i===0?{content:n.slice(e,s),end:s}:null}scanFdVariable(e){let n=this.input,r=n.length,s=e+1,i=s;for(;s<r;){let u=n[s];if(s===i){if(!(u>="a"&&u<="z"||u>="A"&&u<="Z"||u==="_"))return null}else if(!(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||u==="_"))break;s++}if(s===i)return null;let o=n.slice(i,s);if(s>=r||n[s]!=="}"||(s++,s>=r))return null;let a=n[s],l=s+1<r?n[s+1]:"";return a===">"||a==="<"||a==="&"&&(l===">"||l==="<")?{varname:o,end:s}:null}dollarDparenIsSubshell(e){let n=this.input,r=n.length,s=e+1,i=2,o=!1,a=!1,l=!1;for(;s<r&&i>0;){let c=n[s];if(o){c==="'"&&(o=!1),c===`
750
+ `&&(l=!0),s++;continue}if(a){if(c==="\\"){s+=2;continue}c==='"'&&(a=!1),c===`
751
+ `&&(l=!0),s++;continue}if(c==="'"){o=!0,s++;continue}if(c==='"'){a=!0,s++;continue}if(c==="\\"){s+=2;continue}if(c===`
752
+ `&&(l=!0),c==="("){i++,s++;continue}if(c===")"){if(i--,i===1){let u=s+1;if(u<r&&n[u]===")")return!1;let f=u,p=!1;for(;f<r&&(n[f]===" "||n[f]===" "||n[f]===`
753
+ `);)p=!0,f++;if(p&&f<r&&n[f]===")"||l)return!0}if(i===0)return!1;s++;continue}s++}return!1}dparenClosesWithSpacedParens(e){let n=this.input,r=n.length,s=e,i=2,o=!1,a=!1;for(;s<r&&i>0;){let l=n[s];if(o){l==="'"&&(o=!1),s++;continue}if(a){if(l==="\\"){s+=2;continue}l==='"'&&(a=!1),s++;continue}if(l==="'"){o=!0,s++;continue}if(l==='"'){a=!0,s++;continue}if(l==="\\"){s+=2;continue}if(l==="("){i++,s++;continue}if(l===")"){if(i--,i===1){let c=s+1;if(c<r&&n[c]===")")return!1;let u=c,f=!1;for(;u<r&&(n[u]===" "||n[u]===" "||n[u]===`
754
+ `);)f=!0,u++;if(f&&u<r&&n[u]===")")return!0}if(i===0)return!1;s++;continue}if(i===1&&(l==="|"&&s+1<r&&n[s+1]==="|"||l==="&"&&s+1<r&&n[s+1]==="&"||l==="|"&&s+1<r&&n[s+1]!=="|"))return!0;s++}return!1}}});var Vl,ql,xm,Zl,Em,Am,Sm,dt,yr=I(()=>{"use strict";Gn();Vl=1e6,ql=1e5,xm=1e6,Zl=200,Em=new Set([S.LESS,S.GREAT,S.DLESS,S.DGREAT,S.LESSAND,S.GREATAND,S.LESSGREAT,S.DLESSDASH,S.CLOBBER,S.TLESS,S.AND_GREAT,S.AND_DGREAT]),Am=new Set([S.LESS,S.GREAT,S.DLESS,S.DGREAT,S.LESSAND,S.GREATAND,S.LESSGREAT,S.DLESSDASH,S.CLOBBER,S.TLESS]),Sm=new Set([S.LESS,S.GREAT,S.DLESS,S.DGREAT,S.LESSAND,S.GREATAND,S.LESSGREAT,S.DLESSDASH,S.CLOBBER,S.TLESS,S.AND_GREAT,S.AND_DGREAT]),dt=class extends Error{line;column;token;constructor(e,n,r,s=void 0){super(`Parse error at ${n}:${r}: ${e}`),this.line=n,this.column=r,this.token=s,this.name="ParseException"}}});var te,wr=I(()=>{"use strict";te={script(t){return{type:"Script",statements:t}},statement(t,e=[],n=!1,r,s){let i={type:"Statement",pipelines:t,operators:e,background:n};return r&&(i.deferredError=r),s!==void 0&&(i.sourceText=s),i},pipeline(t,e=!1,n=!1,r=!1,s){return{type:"Pipeline",commands:t,negated:e,timed:n,timePosix:r,pipeStderr:s}},simpleCommand(t,e=[],n=[],r=[]){return{type:"SimpleCommand",name:t,args:e,assignments:n,redirections:r}},word(t){return{type:"Word",parts:t}},literal(t){return{type:"Literal",value:t}},bytes(t){return{type:"Bytes",value:t}},singleQuoted(t){return{type:"SingleQuoted",value:t}},doubleQuoted(t){return{type:"DoubleQuoted",parts:t}},escaped(t){return{type:"Escaped",value:t}},parameterExpansion(t,e=null){return{type:"ParameterExpansion",parameter:t,operation:e}},commandSubstitution(t,e=!1){return{type:"CommandSubstitution",body:t,legacy:e}},arithmeticExpansion(t){return{type:"ArithmeticExpansion",expression:t}},assignment(t,e,n=!1,r=null){return{type:"Assignment",name:t,value:e,append:n,array:r}},redirection(t,e,n=null,r){let s={type:"Redirection",fd:n,operator:t,target:e};return r&&(s.fdVariable=r),s},hereDoc(t,e,n=!1,r=!1){return{type:"HereDoc",delimiter:t,content:e,stripTabs:n,quoted:r}},ifNode(t,e=null,n=[]){return{type:"If",clauses:t,elseBody:e,redirections:n}},forNode(t,e,n,r=[]){return{type:"For",variable:t,words:e,body:n,redirections:r}},whileNode(t,e,n=[]){return{type:"While",condition:t,body:e,redirections:n}},untilNode(t,e,n=[]){return{type:"Until",condition:t,body:e,redirections:n}},caseNode(t,e,n=[]){return{type:"Case",word:t,items:e,redirections:n}},caseItem(t,e,n=";;"){return{type:"CaseItem",patterns:t,body:e,terminator:n}},subshell(t,e=[]){return{type:"Subshell",body:t,redirections:e}},group(t,e=[]){return{type:"Group",body:t,redirections:e}},functionDef(t,e,n=[],r){return{type:"FunctionDef",name:t,body:e,redirections:n,sourceFile:r}},conditionalCommand(t,e=[],n){return{type:"ConditionalCommand",expression:t,redirections:e,line:n}},arithmeticCommand(t,e=[],n){return{type:"ArithmeticCommand",expression:t,redirections:e,line:n}}}});function Ye(t,e){for(;e<t.length;){if(t[e]==="\\"&&t[e+1]===`
755
+ `){e+=2;continue}if(/\s/.test(t[e])){e++;continue}break}return e}function Fs(t){if(t.includes("#")){let[e,n]=t.split("#"),r=Number.parseInt(e,10);if(r<2||r>64)return Number.NaN;if(r<=36)return Number.parseInt(n,r);let s=0;for(let i of n){let o;if(/[0-9]/.test(i))o=i.charCodeAt(0)-48;else if(/[a-z]/.test(i))o=i.charCodeAt(0)-97+10;else if(/[A-Z]/.test(i))o=i.charCodeAt(0)-65+36;else if(i==="@")o=62;else if(i==="_")o=63;else return Number.NaN;if(o>=r)return Number.NaN;s=s*r+o}return s}return t.startsWith("0x")||t.startsWith("0X")?Number.parseInt(t.slice(2),16):t.startsWith("0")&&t.length>1&&/^[0-9]+$/.test(t)?/[89]/.test(t)?Number.NaN:Number.parseInt(t,8):Number.parseInt(t,10)}function Cm(t,e,n,r){if(n.slice(r,r+3)!=="$((")return null;let s=r+3,i=1,o=s;for(;s<n.length-1&&i>0;)n[s]==="("&&n[s+1]==="("?(i++,s+=2):n[s]===")"&&n[s+1]===")"?(i--,i>0&&(s+=2)):s++;let a=n.slice(o,s),{expr:l}=t(e,a,0);return s+=2,{expr:{type:"ArithNested",expression:l},pos:s}}function Nm(t,e){if(t.slice(e,e+2)!=="$'")return null;let n=e+2,r="";for(;n<t.length&&t[n]!=="'";)if(t[n]==="\\"&&n+1<t.length){let i=t[n+1];switch(i){case"n":r+=`
756
+ `;break;case"t":r+=" ";break;case"r":r+="\r";break;case"\\":r+="\\";break;case"'":r+="'";break;default:r+=i}n+=2}else r+=t[n],n++;t[n]==="'"&&n++;let s=Number.parseInt(r,10);return{expr:{type:"ArithNumber",value:Number.isNaN(s)?0:s},pos:n}}function vm(t,e){if(t.slice(e,e+2)!=='$"')return null;let n=e+2,r="";for(;n<t.length&&t[n]!=='"';)t[n]==="\\"&&n+1<t.length?(r+=t[n+1],n+=2):(r+=t[n],n++);t[n]==='"'&&n++;let s=Number.parseInt(r,10);return{expr:{type:"ArithNumber",value:Number.isNaN(s)?0:s},pos:n}}var lo,km=I(()=>{"use strict";lo=["=","+=","-=","*=","/=","%=","<<=",">>=","&=","|=","^="]});function nx(t){let e="",n=0;for(;n<t.length;)if(t[n]==='"'){for(n++;n<t.length&&t[n]!=='"';)t[n]==="\\"&&n+1<t.length?(e+=t[n+1],n+=2):(e+=t[n],n++);n<t.length&&n++}else e+=t[n],n++;return e}function Te(t,e){let n=nx(e),{expr:r,pos:s}=Kt(t,n,0),i=Ye(n,s);if(i<n.length){let o=e.slice(i).trim();if(o)return{type:"ArithmeticExpression",originalText:e,expression:{type:"ArithSyntaxError",errorToken:o,message:`${o}: syntax error: invalid arithmetic operator (error token is "${o}")`}}}return{type:"ArithmeticExpression",expression:r,originalText:e}}function Wt(t,e){return{expr:{type:"ArithSyntaxError",errorToken:t,message:`syntax error: operand expected (error token is "${t}")`},pos:e}}function zt(t,e){return Ye(t,e)>=t.length}function Kt(t,e,n){return rx(t,e,n)}function rx(t,e,n){let{expr:r,pos:s}=Us(t,e,n);for(s=Ye(e,s);e[s]===",";){if(s++,zt(e,s))return Wt(",",s);let{expr:o,pos:a}=Us(t,e,s);r={type:"ArithBinary",operator:",",left:r,right:o},s=Ye(e,a)}return{expr:r,pos:s}}function Us(t,e,n){let{expr:r,pos:s}=sx(t,e,n);if(s=Ye(e,s),e[s]==="?"){s++;let{expr:i,pos:o}=Kt(t,e,s);if(s=Ye(e,o),e[s]===":"){s++;let{expr:a,pos:l}=Kt(t,e,s);return{expr:{type:"ArithTernary",condition:r,consequent:i,alternate:a},pos:l}}}return{expr:r,pos:s}}function sx(t,e,n){let{expr:r,pos:s}=Im(t,e,n);for(;s=Ye(e,s),e.slice(s,s+2)==="||";){if(s+=2,zt(e,s))return Wt("||",s);let{expr:o,pos:a}=Im(t,e,s);r={type:"ArithBinary",operator:"||",left:r,right:o},s=a}return{expr:r,pos:s}}function Im(t,e,n){let{expr:r,pos:s}=Tm(t,e,n);for(;s=Ye(e,s),e.slice(s,s+2)==="&&";){if(s+=2,zt(e,s))return Wt("&&",s);let{expr:o,pos:a}=Tm(t,e,s);r={type:"ArithBinary",operator:"&&",left:r,right:o},s=a}return{expr:r,pos:s}}function Tm(t,e,n){let{expr:r,pos:s}=Om(t,e,n);for(;s=Ye(e,s),e[s]==="|"&&e[s+1]!=="|";){if(s++,zt(e,s))return Wt("|",s);let{expr:o,pos:a}=Om(t,e,s);r={type:"ArithBinary",operator:"|",left:r,right:o},s=a}return{expr:r,pos:s}}function Om(t,e,n){let{expr:r,pos:s}=Rm(t,e,n);for(;s=Ye(e,s),e[s]==="^";){if(s++,zt(e,s))return Wt("^",s);let{expr:o,pos:a}=Rm(t,e,s);r={type:"ArithBinary",operator:"^",left:r,right:o},s=a}return{expr:r,pos:s}}function Rm(t,e,n){let{expr:r,pos:s}=Pm(t,e,n);for(;s=Ye(e,s),e[s]==="&"&&e[s+1]!=="&";){if(s++,zt(e,s))return Wt("&",s);let{expr:o,pos:a}=Pm(t,e,s);r={type:"ArithBinary",operator:"&",left:r,right:o},s=a}return{expr:r,pos:s}}function Pm(t,e,n){let{expr:r,pos:s}=$m(t,e,n);for(;s=Ye(e,s),e.slice(s,s+2)==="=="||e.slice(s,s+2)==="!=";){let i=e.slice(s,s+2);if(s+=2,zt(e,s))return Wt(i,s);let{expr:o,pos:a}=$m(t,e,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}return{expr:r,pos:s}}function $m(t,e,n){let{expr:r,pos:s}=Yl(t,e,n);for(;;)if(s=Ye(e,s),e.slice(s,s+2)==="<="||e.slice(s,s+2)===">="){let i=e.slice(s,s+2);if(s+=2,zt(e,s))return Wt(i,s);let{expr:o,pos:a}=Yl(t,e,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}else if(e[s]==="<"||e[s]===">"){let i=e[s];if(s++,zt(e,s))return Wt(i,s);let{expr:o,pos:a}=Yl(t,e,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}else break;return{expr:r,pos:s}}function Yl(t,e,n){let{expr:r,pos:s}=Dm(t,e,n);for(;s=Ye(e,s),e.slice(s,s+2)==="<<"||e.slice(s,s+2)===">>";){let i=e.slice(s,s+2);if(s+=2,zt(e,s))return Wt(i,s);let{expr:o,pos:a}=Dm(t,e,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}return{expr:r,pos:s}}function Dm(t,e,n){let{expr:r,pos:s}=_m(t,e,n);for(;s=Ye(e,s),(e[s]==="+"||e[s]==="-")&&e[s+1]!==e[s];){let i=e[s];if(s++,zt(e,s))return Wt(i,s);let{expr:o,pos:a}=_m(t,e,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}return{expr:r,pos:s}}function _m(t,e,n){let{expr:r,pos:s}=co(t,e,n);for(;;)if(s=Ye(e,s),e[s]==="*"&&e[s+1]!=="*"){if(s++,zt(e,s))return Wt("*",s);let{expr:o,pos:a}=co(t,e,s);r={type:"ArithBinary",operator:"*",left:r,right:o},s=a}else if(e[s]==="/"||e[s]==="%"){let i=e[s];if(s++,zt(e,s))return Wt(i,s);let{expr:o,pos:a}=co(t,e,s);r={type:"ArithBinary",operator:i,left:r,right:o},s=a}else break;return{expr:r,pos:s}}function co(t,e,n){let{expr:r,pos:s}=Ql(t,e,n),i=Ye(e,s);if(e.slice(i,i+2)==="**"){if(i+=2,zt(e,i))return Wt("**",i);let{expr:a,pos:l}=co(t,e,i);return{expr:{type:"ArithBinary",operator:"**",left:r,right:a},pos:l}}return{expr:r,pos:s}}function Ql(t,e,n){let r=Ye(e,n);if(e.slice(r,r+2)==="++"||e.slice(r,r+2)==="--"){let s=e.slice(r,r+2);r+=2;let{expr:i,pos:o}=Ql(t,e,r);return{expr:{type:"ArithUnary",operator:s,operand:i,prefix:!0},pos:o}}if(e[r]==="+"||e[r]==="-"||e[r]==="!"||e[r]==="~"){let s=e[r];r++;let{expr:i,pos:o}=Ql(t,e,r);return{expr:{type:"ArithUnary",operator:s,operand:i,prefix:!0},pos:o}}return ox(t,e,r)}function ix(t,e){let n=t[e];return n==="$"||n==="`"}function ox(t,e,n){let{expr:r,pos:s}=Mm(t,e,n,!1),i=[r];for(;ix(e,s);){let{expr:a,pos:l}=Mm(t,e,s,!0);i.push(a),s=l}i.length>1&&(r={type:"ArithConcat",parts:i});let o;if(e[s]==="["&&r.type==="ArithConcat"){s++;let{expr:a,pos:l}=Kt(t,e,s);o=a,s=l,e[s]==="]"&&s++}if(o&&r.type==="ArithConcat"&&(r={type:"ArithDynamicElement",nameExpr:r,subscript:o},o=void 0),s=Ye(e,s),r.type==="ArithConcat"||r.type==="ArithVariable"||r.type==="ArithDynamicElement"){for(let a of lo)if(e.slice(s,s+a.length)===a&&e.slice(s,s+a.length+1)!=="=="){s+=a.length;let{expr:l,pos:c}=Us(t,e,s);return r.type==="ArithDynamicElement"?{expr:{type:"ArithDynamicAssignment",operator:a,target:r.nameExpr,subscript:r.subscript,value:l},pos:c}:r.type==="ArithConcat"?{expr:{type:"ArithDynamicAssignment",operator:a,target:r,value:l},pos:c}:{expr:{type:"ArithAssignment",operator:a,variable:r.name,value:l},pos:c}}}if(e.slice(s,s+2)==="++"||e.slice(s,s+2)==="--"){let a=e.slice(s,s+2);return s+=2,{expr:{type:"ArithUnary",operator:a,operand:r,prefix:!1},pos:s}}return{expr:r,pos:s}}function Mm(t,e,n,r=!1){let s=Ye(e,n),i=Cm(Kt,t,e,s);if(i)return i;let o=Nm(e,s);if(o)return o;let a=vm(e,s);if(a)return a;if(e.slice(s,s+2)==="$("&&e[s+2]!=="("){s+=2;let c=1,u=s;for(;s<e.length&&c>0;)e[s]==="("?c++:e[s]===")"&&c--,c>0&&s++;let f=e.slice(u,s);return s++,{expr:{type:"ArithCommandSubst",command:f},pos:s}}if(e[s]==="`"){s++;let c=s;for(;s<e.length&&e[s]!=="`";)s++;let u=e.slice(c,s);return e[s]==="`"&&s++,{expr:{type:"ArithCommandSubst",command:u},pos:s}}if(e[s]==="("){s++;let{expr:c,pos:u}=Kt(t,e,s);return s=Ye(e,u),e[s]===")"&&s++,{expr:{type:"ArithGroup",expression:c},pos:s}}if(e[s]==="'"){s++;let c="";for(;s<e.length&&e[s]!=="'";)c+=e[s],s++;e[s]==="'"&&s++;let u=Number.parseInt(c,10);return{expr:{type:"ArithSingleQuote",content:c,value:Number.isNaN(u)?0:u},pos:s}}if(e[s]==='"'){s++;let c="";for(;s<e.length&&e[s]!=='"';)e[s]==="\\"&&s+1<e.length?(c+=e[s+1],s+=2):(c+=e[s],s++);e[s]==='"'&&s++;let u=c.trim();if(!u)return{expr:{type:"ArithNumber",value:0},pos:s};let{expr:f}=Kt(t,u,0);return{expr:f,pos:s}}if(/[0-9]/.test(e[s])){let c="",u=!1,f=!1;for(;s<e.length;){let h=e[s];if(u)if(/[0-9a-zA-Z@_]/.test(h))c+=h,s++;else break;else if(h==="#")u=!0,c+=h,s++;else if(c==="0"&&(h==="x"||h==="X")&&s+1<e.length&&/[0-9a-fA-F]/.test(e[s+1]))f=!0,c+=h,s++;else if(f&&/[0-9a-fA-F]/.test(h))c+=h,s++;else if(!f&&/[0-9]/.test(h))c+=h,s++;else break}if(s<e.length&&/[a-zA-Z_]/.test(e[s])){let h=c;for(;s<e.length&&/[a-zA-Z0-9_]/.test(e[s]);)h+=e[s],s++;return{expr:{type:"ArithSyntaxError",errorToken:h,message:`${h}: value too great for base (error token is "${h}")`},pos:s}}if(e[s]==="."&&/[0-9]/.test(e[s+1]))throw new Be(`${c}.${e[s+1]}...: syntax error: invalid arithmetic operator`);if(e[s]==="["){let h=e.slice(s).trim();return{expr:{type:"ArithNumberSubscript",number:c,errorToken:h},pos:e.length}}return{expr:{type:"ArithNumber",value:Fs(c)},pos:s}}if(e[s]==="$"&&e[s+1]==="{"){let c=s+2,u=1,f=c;for(;f<e.length&&u>0;)e[f]==="{"?u++:e[f]==="}"&&u--,u>0&&f++;let p=e.slice(c,f),h=f+1;if(e[h]==="#"){let m=h+1;for(;m<e.length&&/[0-9a-zA-Z@_]/.test(e[m]);)m++;let d=e.slice(h+1,m);return{expr:{type:"ArithDynamicBase",baseExpr:p,value:d},pos:m}}if(/[0-9]/.test(e[h])||e[h]==="x"||e[h]==="X"){let m=h;if(e[h]==="x"||e[h]==="X")for(m++;m<e.length&&/[0-9a-fA-F]/.test(e[m]);)m++;else for(;m<e.length&&/[0-9]/.test(e[m]);)m++;let d=e.slice(h,m);return{expr:{type:"ArithDynamicNumber",prefix:p,suffix:d},pos:m}}return s=h,{expr:{type:"ArithBracedExpansion",content:p},pos:s}}if(e[s]==="$"&&s+1<e.length&&/[0-9]/.test(e[s+1])){s++;let c="";for(;s<e.length&&/[0-9]/.test(e[s]);)c+=e[s],s++;return{expr:{type:"ArithVariable",name:c,hasDollarPrefix:!0},pos:s}}if(e[s]==="$"&&s+1<e.length&&/[*@#?\-!$]/.test(e[s+1])){let c=e[s+1];return s+=2,{expr:{type:"ArithSpecialVar",name:c},pos:s}}let l=!1;if(e[s]==="$"&&s+1<e.length&&/[a-zA-Z_]/.test(e[s+1])&&(l=!0,s++),s<e.length&&/[a-zA-Z_]/.test(e[s])){let c="";for(;s<e.length&&/[a-zA-Z0-9_]/.test(e[s]);)c+=e[s],s++;if(e[s]==="["&&!r){s++;let u;if(e[s]==="'"||e[s]==='"'){let p=e[s];for(s++,u="";s<e.length&&e[s]!==p;)u+=e[s],s++;e[s]===p&&s++,s=Ye(e,s),e[s]==="]"&&s++}let f;if(u===void 0){let{expr:p,pos:h}=Kt(t,e,s);f=p,s=h,e[s]==="]"&&s++}if(s=Ye(e,s),e[s]==="["&&f)return{expr:{type:"ArithDoubleSubscript",array:c,index:f},pos:s};if(!r){for(let p of lo)if(e.slice(s,s+p.length)===p&&e.slice(s,s+p.length+1)!=="=="){s+=p.length;let{expr:h,pos:m}=Us(t,e,s);return{expr:{type:"ArithAssignment",operator:p,variable:c,subscript:f,stringKey:u,value:h},pos:m}}}return{expr:{type:"ArithArrayElement",array:c,index:f,stringKey:u},pos:s}}if(s=Ye(e,s),!r){for(let u of lo)if(e.slice(s,s+u.length)===u&&e.slice(s,s+u.length+1)!=="=="){s+=u.length;let{expr:f,pos:p}=Us(t,e,s);return{expr:{type:"ArithAssignment",operator:u,variable:c,value:f},pos:p}}}return{expr:{type:"ArithVariable",name:c,hasDollarPrefix:l},pos:s}}if(e[s]==="#"){let c=s+1;for(;c<e.length&&e[c]!==`
757
+ `;)c++;let u=e.slice(s,c).trim()||"#";return{expr:{type:"ArithSyntaxError",errorToken:u,message:`${u}: syntax error: invalid arithmetic operator (error token is "${u}")`},pos:e.length}}return{expr:{type:"ArithNumber",value:0},pos:s}}var St=I(()=>{"use strict";Ne();km()});function Um(t,e,n){let r=n+1;for(;r<e.length&&/[a-zA-Z0-9_-]/.test(e[r]);)r++;return r}function Kl(t,e,n,r,s){let i=1,o=n+1;for(;o<e.length&&i>0;)e[o]===r?i++:e[o]===s&&i--,i>0&&o++;return i===0?o:-1}function br(t,e,n){let r=n,s=1;for(;r<e.length&&s>0;){let i=e[r];if(i==="\\"&&r+1<e.length){r+=2;continue}if(i==="'"){let o=e.indexOf("'",r+1);if(o!==-1){r=o+1;continue}}if(i==='"'){for(r++;r<e.length&&e[r]!=='"';)e[r]==="\\"&&r+1<e.length?r+=2:r++;r<e.length&&r++;continue}i==="{"?s++:i==="}"&&s--,s>0&&r++}return r}function Bm(t,e,n){let r=n,s=!1;for(;r<e.length;){let i=e[r];if(i==="/"&&s||i==="}")break;if(i==="'"){let o=e.indexOf("'",r+1);if(o!==-1){r=o+1,s=!0;continue}}if(i==='"'){for(r++;r<e.length&&e[r]!=='"';)e[r]==="\\"&&r+1<e.length?r+=2:r++;r<e.length&&r++,s=!0;continue}i==="\\"?(r+=2,s=!0):(r++,s=!0)}return r}function Wm(t,e,n){let r=n,s="";for(;r<e.length;){let i=e[r];if(i==="*"||i==="?")s+=i,r++;else if(i==="["){let o=ax(e,r);o===-1?(s+=i,r++):(s+=e.slice(r,o+1),r=o+1)}else break}return{pattern:s,endIndex:r}}function ax(t,e){let n=e+1;for(n<t.length&&t[n]==="^"&&n++,n<t.length&&t[n]==="]"&&n++;n<t.length;){let r=t[n];if(r==="\\"&&n+1<t.length){let s=t[n+1];if(s==='"'||s==="'")return-1;n+=2;continue}if(r==="]")return n;if(r==='"'||r==="$"||r==="`")return-1;if(r==="'"){let s=t.indexOf("'",n+1);if(s!==-1){n=s+1;continue}}if(r==="["&&n+1<t.length&&t[n+1]===":"){let s=t.indexOf(":]",n+2);if(s!==-1){n=s+2;continue}}if(r==="["&&n+1<t.length&&(t[n+1]==="."||t[n+1]==="=")){let i=`${t[n+1]}]`,o=t.indexOf(i,n+2);if(o!==-1){n=o+2;continue}}n++}return-1}function uo(t,e){e<128?t.push(e):e<2048?t.push(192|e>>6,128|e&63):e<65536?t.push(224|e>>12,128|e>>6&63,128|e&63):t.push(240|e>>18,128|e>>12&63,128|e>>6&63,128|e&63)}function Bs(t,e){for(let n=0;n<e.length;){let r=e.codePointAt(n);if(r===void 0)break;uo(t,r),n+=r>65535?2:1}}function zm(t,e,n){let r=[],s=n;for(;s<e.length&&e[s]!=="'";){let i=e[s];if(i==="\\"&&s+1<e.length)switch(e[s+1]){case"n":r.push(10),s+=2;break;case"t":r.push(9),s+=2;break;case"r":r.push(13),s+=2;break;case"\\":r.push(92),s+=2;break;case"'":r.push(39),s+=2;break;case'"':r.push(34),s+=2;break;case"a":r.push(7),s+=2;break;case"b":r.push(8),s+=2;break;case"e":case"E":r.push(27),s+=2;break;case"f":r.push(12),s+=2;break;case"v":r.push(11),s+=2;break;case"x":{let a=s;for(;a+1<e.length&&e[a]==="\\"&&e[a+1]==="x";){let l=e.slice(a+2,a+4),c=parseInt(l,16);if(!Number.isNaN(c)&&l.length>0)r.push(c),a+=2+l.length;else break}a===s?(Bs(r,"\\x"),s+=2):s=a;break}case"u":{let a=e.slice(s+2,s+6),l=parseInt(a,16);Number.isNaN(l)?(Bs(r,"\\u"),s+=2):(uo(r,l),s+=6);break}case"U":{let a=e.slice(s+2,s+10),l=parseInt(a,16);!Number.isNaN(l)&&l<=1114111?(uo(r,l),s+=2+a.length):(Bs(r,"\\U"),s+=2);break}case"c":{if(s+2<e.length){let l=e[s+2].charCodeAt(0)&31;r.push(l),s+=3}else Bs(r,"\\c"),s+=2;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let a="",l=s+1;for(;l<e.length&&l<s+4&&/[0-7]/.test(e[l]);)a+=e[l],l++;let c=parseInt(a,8);r.push(c&255),s=l;break}default:Bs(r,i),s++}else{let o=i.codePointAt(0);o!==void 0?(uo(r,o),s+=o>65535?2:1):s++}}return s<e.length&&e[s]==="'"&&s++,{part:te.bytes(new Uint8Array(r)),endIndex:s}}function Xl(t,e){let n=e.trim();return n===""?{type:"ArithmeticExpression",expression:{type:"ArithNumber",value:0}}:Te(t,n)}function Fm(t){let e=[],n="",r=0;for(let s=0;s<t.length;s++){let i=t[s];i==="{"?(r++,n+=i):i==="}"?(r--,n+=i):i===","&&r===0?(e.push(n),n=""):n+=i}return e.push(n),e}function Hm(t,e,n,r){let s=Kl(t,e,n,"{","}");if(s===-1)return null;let i=e.slice(n+1,s),o=i.match(/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/);if(o)return{part:{type:"BraceExpansion",items:[{type:"Range",start:Number.parseInt(o[1],10),end:Number.parseInt(o[2],10),step:o[3]?Number.parseInt(o[3],10):void 0,startStr:o[1],endStr:o[2]}]},endIndex:s+1};let a=i.match(/^([a-zA-Z])\.\.([a-zA-Z])(?:\.\.(-?\d+))?$/);return a?{part:{type:"BraceExpansion",items:[{type:"Range",start:a[1],end:a[2],step:a[3]?Number.parseInt(a[3],10):void 0}]},endIndex:s+1}:i.includes(",")&&r?{part:{type:"BraceExpansion",items:Fm(i).map(u=>({type:"Word",word:te.word(r(t,u,!1,!1,!1))}))},endIndex:s+1}:i.includes(",")?{part:{type:"BraceExpansion",items:Fm(i).map(u=>({type:"Word",word:te.word([te.literal(u)])}))},endIndex:s+1}:null}function Jl(t,e){let n="";for(let r of e.parts)switch(r.type){case"Literal":n+=r.value;break;case"Bytes":{let s=new TextDecoder;n+=s.decode(r.value);break}case"SingleQuoted":n+=`'${r.value}'`;break;case"Escaped":n+=r.value;break;case"DoubleQuoted":n+='"';for(let s of r.parts)s.type==="Literal"||s.type==="Escaped"?n+=s.value:s.type==="ParameterExpansion"&&(n+=`\${${s.parameter}}`);n+='"';break;case"ParameterExpansion":n+=`\${${r.parameter}}`;break;case"Glob":n+=r.pattern;break;case"TildeExpansion":n+="~",r.user&&(n+=r.user);break;case"BraceExpansion":{n+="{";let s=[];for(let i of r.items)if(i.type==="Range"){let o=i.startStr??String(i.start),a=i.endStr??String(i.end);i.step!==void 0?s.push(`${o}..${a}..${i.step}`):s.push(`${o}..${a}`)}else s.push(Jl(t,i.word));s.length===1&&r.items[0].type==="Range"?n+=s[0]:n+=s.join(","),n+="}";break}default:n+=r.type}return n}function jm(t,e){return{[S.LESS]:"<",[S.GREAT]:">",[S.DGREAT]:">>",[S.LESSAND]:"<&",[S.GREATAND]:">&",[S.LESSGREAT]:"<>",[S.CLOBBER]:">|",[S.TLESS]:"<<<",[S.AND_GREAT]:"&>",[S.AND_DGREAT]:"&>>",[S.DLESS]:"<",[S.DLESSDASH]:"<"}[e]||">"}var ec=I(()=>{"use strict";wr();St();Gn()});function fo(t){let e=t.current(),n=e.type;if(n===S.NUMBER){let r=t.peek(1);return e.end!==r.start?!1:Am.has(r.type)}if(n===S.FD_VARIABLE){let r=t.peek(1);return Sm.has(r.type)}return Em.has(n)}function po(t){let e=null,n;t.check(S.NUMBER)?e=Number.parseInt(t.advance().value,10):t.check(S.FD_VARIABLE)&&(n=t.advance().value);let r=t.advance(),s=jm(t,r.type);if(r.type===S.DLESS||r.type===S.DLESSDASH)return lx(t,s,e,r.type===S.DLESSDASH);t.isWord()||t.error("Expected redirection target");let i=t.parseWord();return te.redirection(s,i,e,n)}function lx(t,e,n,r){t.isWord()||t.error("Expected here-document delimiter");let s=t.advance(),i=s.value,o=s.quoted||!1;(i.startsWith("'")&&i.endsWith("'")||i.startsWith('"')&&i.endsWith('"'))&&(i=i.slice(1,-1));let a=te.redirection(r?"<<-":"<<",te.hereDoc(i,te.word([]),r,o),n);return t.addPendingHeredoc(a,i,r,o),a}function Vm(t){let e=t.current().line,n=[],r=null,s=[],i=[];for(;t.check(S.ASSIGNMENT_WORD)||fo(t);)t.checkIterationLimit(),t.check(S.ASSIGNMENT_WORD)?n.push(cx(t)):i.push(po(t));if(t.isWord())r=t.parseWord();else if(n.length>0&&(t.check(S.DBRACK_START)||t.check(S.DPAREN_START))){let a=t.advance();r=te.word([te.literal(a.value)])}for(;(!t.isStatementEnd()||t.check(S.RBRACE))&&!t.check(S.PIPE,S.PIPE_AMP);)if(t.checkIterationLimit(),fo(t))i.push(po(t));else if(t.check(S.RBRACE)){let a=t.advance();s.push(t.parseWordFromString(a.value,!1,!1))}else if(t.check(S.LBRACE)){let a=t.advance();s.push(t.parseWordFromString(a.value,!1,!1))}else if(t.check(S.DBRACK_END)){let a=t.advance();s.push(t.parseWordFromString(a.value,!1,!1))}else if(t.isWord())s.push(t.parseWord());else if(t.check(S.ASSIGNMENT_WORD)){let a=t.advance(),l=a.value,c=l.endsWith("="),u=l.endsWith("=(");if((c||u)&&(u||t.check(S.LPAREN))){let f=u?l.slice(0,-2):l.slice(0,-1);u||t.expect(S.LPAREN);let p=tc(t);t.expect(S.RPAREN);let h=p.map(d=>Jl(t,d)),m=`${f}=(${h.join(" ")})`;s.push(t.parseWordFromString(m,!1,!1))}else s.push(t.parseWordFromString(l,a.quoted,a.singleQuoted))}else if(t.check(S.LPAREN))t.error("syntax error near unexpected token `('");else break;let o=te.simpleCommand(r,s,n,i);return o.line=e,o}function cx(t){let e=t.expect(S.ASSIGNMENT_WORD),n=e.value,r=n.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);r||t.error(`Invalid assignment: ${n}`);let s=r[0],i,o=s.length;if(n[o]==="["){let f=0,p=o+1;for(;o<n.length;o++)if(n[o]==="[")f++;else if(n[o]==="]"&&(f--,f===0))break;f!==0&&t.error(`Invalid assignment: ${n}`),i=n.slice(p,o),o++}let a=n[o]==="+";a&&o++,n[o]!=="="&&t.error(`Invalid assignment: ${n}`),o++;let l=n.slice(o);if(l==="("){let f=tc(t);t.expect(S.RPAREN);let p=i!==void 0?`${s}[${i}]`:s;return te.assignment(p,null,a,f)}if(l===""&&t.check(S.LPAREN)){let f=t.current();if(e.end===f.start){t.advance();let p=tc(t);t.expect(S.RPAREN);let h=i!==void 0?`${s}[${i}]`:s;return te.assignment(h,null,a,p)}}let c=l?t.parseWordFromString(l,e.quoted,e.singleQuoted,!0):null,u=i!==void 0?`${s}[${i}]`:s;return te.assignment(u,c,a,null)}function tc(t){let e=[];for(t.skipNewlines();!t.check(S.RPAREN,S.EOF);)t.checkIterationLimit(),t.isWord()?e.push(t.parseWord()):ux.has(t.current().type)?t.error(`syntax error near unexpected token \`${t.current().value}'`):t.advance(),t.skipNewlines();return e}var ux,qm=I(()=>{"use strict";wr();Gn();yr();ec();ux=new Set([S.AMP,S.PIPE,S.PIPE_AMP,S.SEMICOLON,S.AND_AND,S.OR_OR,S.DSEMI,S.SEMI_AND,S.SEMI_SEMI_AND])});function nc(t,e){t.expect(S.IF);let n=[],r=t.parseCompoundList();t.expect(S.THEN);let s=t.parseCompoundList();if(s.length===0){let a=t.check(S.FI)?"fi":t.check(S.ELSE)?"else":t.check(S.ELIF)?"elif":"fi";t.error(`syntax error near unexpected token \`${a}'`)}for(n.push({condition:r,body:s});t.check(S.ELIF);){t.advance();let a=t.parseCompoundList();t.expect(S.THEN);let l=t.parseCompoundList();if(l.length===0){let c=t.check(S.FI)?"fi":t.check(S.ELSE)?"else":t.check(S.ELIF)?"elif":"fi";t.error(`syntax error near unexpected token \`${c}'`)}n.push({condition:a,body:l})}let i=null;t.check(S.ELSE)&&(t.advance(),i=t.parseCompoundList(),i.length===0&&t.error("syntax error near unexpected token `fi'")),t.expect(S.FI);let o=e?.skipRedirections?[]:t.parseOptionalRedirections();return te.ifNode(n,i,o)}function rc(t,e){let n=t.expect(S.FOR);if(t.check(S.DPAREN_START))return px(t,e,n.line);t.isWord()||t.error("Expected variable name in for loop");let s=t.advance().value,i=null;if(t.skipNewlines(),t.check(S.IN))for(t.advance(),i=[];!t.check(S.SEMICOLON,S.NEWLINE,S.DO,S.EOF)&&t.isWord();)i.push(t.parseWord());t.check(S.SEMICOLON)&&t.advance(),t.skipNewlines(),t.expect(S.DO);let o=t.parseCompoundList();t.expect(S.DONE);let a=e?.skipRedirections?[]:t.parseOptionalRedirections();return te.forNode(s,i,o,a)}function px(t,e,n){t.expect(S.DPAREN_START);let r=null,s=null,i=null,o=["","",""],a=0,l=0;for(;!t.check(S.DPAREN_END,S.EOF);){let f=t.advance();if(f.type===S.SEMICOLON&&l===0){if(a++,a>2)break}else f.value==="("&&l++,f.value===")"&&l--,o[a]+=f.value}t.expect(S.DPAREN_END),o[0].trim()&&(r=Te(t,o[0].trim())),o[1].trim()&&(s=Te(t,o[1].trim())),o[2].trim()&&(i=Te(t,o[2].trim())),t.skipNewlines(),t.check(S.SEMICOLON)&&t.advance(),t.skipNewlines();let c;t.check(S.LBRACE)?(t.advance(),c=t.parseCompoundList(),t.expect(S.RBRACE)):(t.expect(S.DO),c=t.parseCompoundList(),t.expect(S.DONE));let u=e?.skipRedirections?[]:t.parseOptionalRedirections();return{type:"CStyleFor",init:r,condition:s,update:i,body:c,redirections:u,line:n}}function sc(t,e){t.expect(S.WHILE);let n=t.parseCompoundList();t.expect(S.DO);let r=t.parseCompoundList();r.length===0&&t.error("syntax error near unexpected token `done'"),t.expect(S.DONE);let s=e?.skipRedirections?[]:t.parseOptionalRedirections();return te.whileNode(n,r,s)}function ic(t,e){t.expect(S.UNTIL);let n=t.parseCompoundList();t.expect(S.DO);let r=t.parseCompoundList();r.length===0&&t.error("syntax error near unexpected token `done'"),t.expect(S.DONE);let s=e?.skipRedirections?[]:t.parseOptionalRedirections();return te.untilNode(n,r,s)}function oc(t,e){t.expect(S.CASE),t.isWord()||t.error("Expected word after 'case'");let n=t.parseWord();t.skipNewlines(),t.expect(S.IN),t.skipNewlines();let r=[];for(;!t.check(S.ESAC,S.EOF);){t.checkIterationLimit();let i=t.getPos(),o=hx(t);if(o&&r.push(o),t.skipNewlines(),t.getPos()===i&&!o)break}t.expect(S.ESAC);let s=e?.skipRedirections?[]:t.parseOptionalRedirections();return te.caseNode(n,r,s)}function hx(t){t.check(S.LPAREN)&&t.advance();let e=[];for(;t.isWord()&&(e.push(t.parseWord()),t.check(S.PIPE));)t.advance();if(e.length===0)return null;t.expect(S.RPAREN),t.skipNewlines();let n=[];for(;!t.check(S.DSEMI,S.SEMI_AND,S.SEMI_SEMI_AND,S.ESAC,S.EOF);){t.checkIterationLimit(),t.isWord()&&t.peek(1).type===S.RPAREN&&t.error("syntax error near unexpected token `)'"),t.check(S.LPAREN)&&t.peek(1).type===S.WORD&&t.error(`syntax error near unexpected token \`${t.peek(1).value}'`);let s=t.getPos(),i=t.parseStatement();if(i&&n.push(i),t.skipSeparators(!1),t.getPos()===s&&!i)break}let r=";;";return t.check(S.DSEMI)?(t.advance(),r=";;"):t.check(S.SEMI_AND)?(t.advance(),r=";&"):t.check(S.SEMI_SEMI_AND)&&(t.advance(),r=";;&"),te.caseItem(e,n,r)}function ac(t,e){t.expect(S.LPAREN);let n=t.parseCompoundList();t.expect(S.RPAREN);let r=e?.skipRedirections?[]:t.parseOptionalRedirections();return te.subshell(n,r)}function lc(t,e){t.expect(S.LBRACE);let n=t.parseCompoundList();t.expect(S.RBRACE);let r=e?.skipRedirections?[]:t.parseOptionalRedirections();return te.group(n,r)}var Zm=I(()=>{"use strict";wr();St();Gn()});function Ym(t){return t.isWord()||t.check(S.LBRACE)||t.check(S.RBRACE)||t.check(S.ASSIGNMENT_WORD)}function Qm(t){if(t.check(S.BANG)&&t.peek(1).type===S.LPAREN){t.advance(),t.advance();let e=1,n="!(";for(;e>0&&!t.check(S.EOF);)if(t.check(S.LPAREN))e++,n+="(",t.advance();else if(t.check(S.RPAREN))e--,e>0&&(n+=")"),t.advance();else if(t.isWord())n+=t.advance().value;else if(t.check(S.PIPE))n+="|",t.advance();else break;return n+=")",t.parseWordFromString(n,!1,!1,!1,!1,!0)}return t.parseWordNoBraceExpansion()}function uc(t){return t.skipNewlines(),yx(t)}function yx(t){let e=Km(t);for(t.skipNewlines();t.check(S.OR_OR);){t.advance(),t.skipNewlines();let n=Km(t);e={type:"CondOr",left:e,right:n},t.skipNewlines()}return e}function Km(t){let e=cc(t);for(t.skipNewlines();t.check(S.AND_AND);){t.advance(),t.skipNewlines();let n=cc(t);e={type:"CondAnd",left:e,right:n},t.skipNewlines()}return e}function cc(t){return t.skipNewlines(),t.check(S.BANG)?(t.advance(),t.skipNewlines(),{type:"CondNot",operand:cc(t)}):wx(t)}function wx(t){if(t.check(S.LPAREN)){t.advance();let e=uc(t);return t.expect(S.RPAREN),{type:"CondGroup",expression:e}}if(Ym(t)){let e=t.current(),n=e.value;if(mx.includes(n)&&!e.quoted){if(t.advance(),t.check(S.DBRACK_END)&&t.error(`Expected operand after ${n}`),Ym(t)){let i=t.parseWordNoBraceExpansion();return{type:"CondUnary",operator:n,operand:i}}let s=t.current();t.error(`unexpected argument \`${s.value}' to conditional unary operator`)}let r=t.parseWordNoBraceExpansion();if(t.isWord()&&gx.includes(t.current().value)){let s=t.advance().value,i;return s==="=~"?i=bx(t):s==="=="||s==="!="?i=Qm(t):i=t.parseWordNoBraceExpansion(),{type:"CondBinary",operator:s,left:r,right:i}}if(t.check(S.LESS)){t.advance();let s=t.parseWordNoBraceExpansion();return{type:"CondBinary",operator:"<",left:r,right:s}}if(t.check(S.GREAT)){t.advance();let s=t.parseWordNoBraceExpansion();return{type:"CondBinary",operator:">",left:r,right:s}}if(t.isWord()&&t.current().value==="="){t.advance();let s=Qm(t);return{type:"CondBinary",operator:"==",left:r,right:s}}return{type:"CondWord",word:r}}t.error("Expected conditional expression")}function bx(t){let e=[],n=0,r=-1,s=t.getInput(),i=()=>t.check(S.DBRACK_END)||t.check(S.AND_AND)||t.check(S.OR_OR)||t.check(S.NEWLINE)||t.check(S.EOF);for(;!i();){let o=t.current(),a=r>=0&&o.start>r;if(n===0&&a)break;if(n>0&&a){let l=s.slice(r,o.start);e.push({type:"Literal",value:l})}if(t.isWord()||t.check(S.ASSIGNMENT_WORD)){let l=t.parseWordForRegex();e.push(...l.parts),r=t.peek(-1).end}else if(t.check(S.LPAREN)){let l=t.advance();e.push({type:"Literal",value:"("}),n++,r=l.end}else if(t.check(S.DPAREN_START)){let l=t.advance();e.push({type:"Literal",value:"(("}),n+=2,r=l.end}else if(t.check(S.DPAREN_END))if(n>=2){let l=t.advance();e.push({type:"Literal",value:"))"}),n-=2,r=l.end}else{if(n===1)break;break}else if(t.check(S.RPAREN))if(n>0){let l=t.advance();e.push({type:"Literal",value:")"}),n--,r=l.end}else break;else if(t.check(S.PIPE)){let l=t.advance();e.push({type:"Literal",value:"|"}),r=l.end}else if(t.check(S.SEMICOLON))if(n>0){let l=t.advance();e.push({type:"Literal",value:";"}),r=l.end}else break;else if(n>0&&t.check(S.LESS)){let l=t.advance();e.push({type:"Literal",value:"<"}),r=l.end}else if(n>0&&t.check(S.GREAT)){let l=t.advance();e.push({type:"Literal",value:">"}),r=l.end}else if(n>0&&t.check(S.DGREAT)){let l=t.advance();e.push({type:"Literal",value:">>"}),r=l.end}else if(n>0&&t.check(S.DLESS)){let l=t.advance();e.push({type:"Literal",value:"<<"}),r=l.end}else if(n>0&&t.check(S.LESSAND)){let l=t.advance();e.push({type:"Literal",value:"<&"}),r=l.end}else if(n>0&&t.check(S.GREATAND)){let l=t.advance();e.push({type:"Literal",value:">&"}),r=l.end}else if(n>0&&t.check(S.LESSGREAT)){let l=t.advance();e.push({type:"Literal",value:"<>"}),r=l.end}else if(n>0&&t.check(S.CLOBBER)){let l=t.advance();e.push({type:"Literal",value:">|"}),r=l.end}else if(n>0&&t.check(S.TLESS)){let l=t.advance();e.push({type:"Literal",value:"<<<"}),r=l.end}else if(n>0&&t.check(S.AMP)){let l=t.advance();e.push({type:"Literal",value:"&"}),r=l.end}else if(n>0&&t.check(S.LBRACE)){let l=t.advance();e.push({type:"Literal",value:"{"}),r=l.end}else if(n>0&&t.check(S.RBRACE)){let l=t.advance();e.push({type:"Literal",value:"}"}),r=l.end}else break}return e.length===0&&t.error("Expected regex pattern after =~"),{type:"Word",parts:e}}var mx,gx,Xm=I(()=>{"use strict";Gn();mx=["-a","-b","-c","-d","-e","-f","-g","-h","-k","-p","-r","-s","-t","-u","-w","-x","-G","-L","-N","-O","-S","-z","-n","-o","-v","-R"],gx=["==","!=","=~","<",">","-eq","-ne","-lt","-le","-gt","-ge","-nt","-ot","-ef"]});function Ex(t,e){let n=1,r=e+1;for(;r<t.length&&n>0;){let s=t[r];if(s==="\\"){r+=2;continue}if("@*+?!".includes(s)&&r+1<t.length&&t[r+1]==="("){r++,n++,r++;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function Ax(t,e,n){let r=n+1,s=e[r];if("@*#?$!-0123456789".includes(s))return{part:te.parameterExpansion(s),endIndex:r+1};let i="";for(;r<e.length&&/[a-zA-Z0-9_]/.test(e[r]);)i+=e[r],r++;return{part:te.parameterExpansion(i),endIndex:r}}function Sx(t,e,n,r=!1){let s=n+2,i=!1;e[s]==="!"&&(i=!0,s++);let o=!1;e[s]==="#"&&!/[}:#%/^,]/.test(e[s+1]||"}")&&(o=!0,s++);let a="",l=e[s];if(/[@*#?$!-]/.test(l)&&!/[a-zA-Z0-9_]/.test(e[s+1]||""))a=l,s++;else for(;s<e.length&&/[a-zA-Z0-9_]/.test(e[s]);)a+=e[s],s++;if(e[s]==="["){let u=Kl(t,e,s,"[","]");if(a+=e.slice(s,u+1),s=u+1,e[s]==="["){let f=1,p=s;for(;p<e.length&&f>0;)e[p]==="{"?f++:e[p]==="}"&&f--,f>0&&p++;let h=e.slice(n+2,p);return{part:te.parameterExpansion("",{type:"BadSubstitution",text:h}),endIndex:p+1}}}if(a===""&&!i&&!o&&e[s]!=="}"){let u=1,f=s;for(;f<e.length&&u>0;)e[f]==="{"?u++:e[f]==="}"&&u--,u>0&&f++;if(u>0)throw new dt("unexpected EOF while looking for matching '}'",0,0);let p=e.slice(n+2,f);return{part:te.parameterExpansion("",{type:"BadSubstitution",text:p}),endIndex:f+1}}let c=null;if(i){let u=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(u)if(s<e.length&&e[s]!=="}"&&/[:=\-+?#%/^,@]/.test(e[s])){let f=fc(t,e,s,a,r);f.operation?(c={type:"Indirection",innerOp:f.operation},s=f.endIndex):(c={type:"ArrayKeys",array:u[1],star:u[2]==="*"},a="")}else c={type:"ArrayKeys",array:u[1],star:u[2]==="*"},a="";else if(e[s]==="*"||e[s]==="@"&&!/[QPaAEKkuUL]/.test(e[s+1]||"")){let f=e[s];s++,c={type:"VarNamePrefix",prefix:a,star:f==="*"},a=""}else if(s<e.length&&e[s]!=="}"&&/[:=\-+?#%/^,@]/.test(e[s])){let f=fc(t,e,s,a,r);f.operation?(c={type:"Indirection",innerOp:f.operation},s=f.endIndex):c={type:"Indirection"}}else c={type:"Indirection"}}else if(o)if(e[s]===":")for(c={type:"LengthSliceError"};s<e.length&&e[s]!=="}";)s++;else e[s]!=="}"&&/[-+=?]/.test(e[s])?t.error(`\${#${a}${e.slice(s,e.indexOf("}",s))}}: bad substitution`):e[s]==="/"?t.error(`\${#${a}${e.slice(s,e.indexOf("}",s))}}: bad substitution`):c={type:"Length"};if(!c&&s<e.length&&e[s]!=="}"){let u=fc(t,e,s,a,r);c=u.operation,s=u.endIndex}if(s<e.length&&e[s]!=="}"){let u=e[s];if(!/[:\-+=?#%/^,@[]/.test(u)){let f=s;for(;f<e.length&&e[f]!=="}";)f++;let p=e.slice(n,f+1);t.error(`\${${p.slice(2,-1)}}: bad substitution`)}}for(;s<e.length&&e[s]!=="}";)s++;if(s>=e.length)throw new dt("unexpected EOF while looking for matching '}'",0,0);return{part:te.parameterExpansion(a,c),endIndex:s+1}}function fc(t,e,n,r,s=!1){let i=n,o=e[i],a=e[i+1]||"";if(o===":"){let l=a;if("-=?+".includes(l)){i+=2;let w=br(t,e,i),E=e.slice(i,w),b=Vn(t,E,!1,!1,!0,!1,s,!1,!1,!0),A=te.word(b.length>0?b:[te.literal("")]);if(l==="-")return{operation:{type:"DefaultValue",word:A,checkEmpty:!0},endIndex:w};if(l==="=")return{operation:{type:"AssignDefault",word:A,checkEmpty:!0},endIndex:w};if(l==="?")return{operation:{type:"ErrorIfUnset",word:A,checkEmpty:!0},endIndex:w};if(l==="+")return{operation:{type:"UseAlternative",word:A,checkEmpty:!0},endIndex:w}}i++;let c=br(t,e,i),u=e.slice(i,c),f=-1,p=0,h=0;for(let g=0;g<u.length;g++){let w=u[g];if(w==="("||w==="[")p++;else if(w===")"||w==="]")p--;else if(w==="?"&&p===0)h++;else if(w===":"&&p===0)if(h>0)h--;else{f=g;break}}let m=f>=0?u.slice(0,f):u,d=f>=0?u.slice(f+1):null;return{operation:{type:"Substring",offset:Xl(t,m),length:d!==null?Xl(t,d):null},endIndex:c}}if("-=?+".includes(o)){i++;let l=br(t,e,i),c=e.slice(i,l),u=Vn(t,c,!1,!1,!0,!1,s,!1,!1,!0),f=te.word(u.length>0?u:[te.literal("")]);if(o==="-")return{operation:{type:"DefaultValue",word:f,checkEmpty:!1},endIndex:l};if(o==="=")return{operation:{type:"AssignDefault",word:f,checkEmpty:!1},endIndex:l};if(o==="?")return{operation:{type:"ErrorIfUnset",word:c?f:null,checkEmpty:!1},endIndex:l};if(o==="+")return{operation:{type:"UseAlternative",word:f,checkEmpty:!1},endIndex:l}}if(o==="#"||o==="%"){let l=a===o,c=o==="#"?"prefix":"suffix";i+=l?2:1;let u=br(t,e,i),f=e.slice(i,u),p=Vn(t,f,!1,!1,!1);return{operation:{type:"PatternRemoval",pattern:te.word(p.length>0?p:[te.literal("")]),side:c,greedy:l},endIndex:u}}if(o==="/"){let l=a==="/";i+=l?2:1;let c=null;e[i]==="#"?(c="start",i++):e[i]==="%"&&(c="end",i++);let u;c!==null&&(e[i]==="/"||e[i]==="}")?u=i:u=Bm(t,e,i);let f=e.slice(i,u),p=Vn(t,f,!1,!1,!1),h=te.word(p.length>0?p:[te.literal("")]),m=null,d=u;if(e[u]==="/"){let g=u+1,w=br(t,e,g),E=e.slice(g,w),b=Vn(t,E,!1,!1,!1);m=te.word(b.length>0?b:[te.literal("")]),d=w}return{operation:{type:"PatternReplacement",pattern:h,replacement:m,all:l,anchor:c},endIndex:d}}if(o==="^"||o===","){let l=a===o,c=o==="^"?"upper":"lower";i+=l?2:1;let u=br(t,e,i),f=e.slice(i,u),p=f?te.word([te.literal(f)]):null;return{operation:{type:"CaseModification",direction:c,all:l,pattern:p},endIndex:u}}return o==="@"&&/[QPaAEKkuUL]/.test(a)?{operation:{type:"Transform",operator:a},endIndex:i+2}:{operation:null,endIndex:i}}function pc(t,e,n,r=!1){let s=n+1;if(s>=e.length)return{part:te.literal("$"),endIndex:s};let i=e[s];if(i==="("&&e[s+1]==="(")return t.isDollarDparenSubshell(e,n)?t.parseCommandSubstitution(e,n):t.parseArithmeticExpansion(e,n);if(i==="["){let o=1,a=s+1;for(;a<e.length&&o>0;)e[a]==="["?o++:e[a]==="]"&&o--,o>0&&a++;if(o===0){let l=e.slice(s+1,a),c=Te(t,l);return{part:te.arithmeticExpansion(c),endIndex:a+1}}}return i==="("?t.parseCommandSubstitution(e,n):i==="{"?Sx(t,e,n,r):/[a-zA-Z_0-9@*#?$!-]/.test(i)?Ax(t,e,n):{part:te.literal("$"),endIndex:s}}function Jm(t,e){let n=[],r=0,s="",i=()=>{s&&(n.push(te.literal(s)),s="")};for(;r<e.length;){let o=e[r];if(o==="\\"&&r+1<e.length){let a=e[r+1];if(a==="$"||a==="`"||a==='"'||a==="\\"){s+=a,r+=2;continue}s+=o,r++;continue}if(o==="$"){i();let{part:a,endIndex:l}=pc(t,e,r,!0);a&&n.push(a),r=l;continue}if(o==="`"){i();let{part:a,endIndex:l}=t.parseBacktickSubstitution(e,r,!0);n.push(a),r=l;continue}s+=o,r++}return i(),n}function Cx(t,e,n){let r=[],s=n,i="",o=()=>{i&&(r.push(te.literal(i)),i="")};for(;s<e.length&&e[s]!=='"';){let a=e[s];if(a==="\\"&&s+1<e.length){let l=e[s+1];if('"\\$`\n'.includes(l)){i+=l,s+=2;continue}i+=a,s++;continue}if(a==="$"){o();let{part:l,endIndex:c}=pc(t,e,s,!0);l&&r.push(l),s=c;continue}if(a==="`"){o();let{part:l,endIndex:c}=t.parseBacktickSubstitution(e,s,!0);r.push(l),s=c;continue}i+=a,s++}return o(),{part:te.doubleQuoted(r),endIndex:s}}function Vn(t,e,n=!1,r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1){if(r)return[te.singleQuoted(e)];if(n){let m=Jm(t,e);return[te.doubleQuoted(m)]}if(e.length>=2&&e[0]==='"'&&e[e.length-1]==='"'){let m=e.slice(1,-1),d=!1;for(let g=0;g<m.length;g++){if(m[g]==='"'){d=!0;break}m[g]==="\\"&&g+1<m.length&&g++}if(!d){let g=Jm(t,m);return[te.doubleQuoted(g)]}}let u=[],f=0,p="",h=()=>{p&&(u.push(te.literal(p)),p="")};for(;f<e.length;){let m=e[f];if(m==="\\"&&f+1<e.length){let d=e[f+1];if(l){h(),u.push(te.escaped(d)),f+=2;continue}let g=i?d==="$"||d==="`"||d===`
758
+ `:d==="$"||d==="`"||d==='"'||d==="'"||d===`
759
+ `||c&&d==="}",w=o?"*?[]\\".includes(d):"*?[]\\(){}.^+".includes(d);g?p+=d:w?(h(),u.push(te.escaped(d))):p+=`\\${d}`,f+=2;continue}if(m==="'"&&!o&&!i){h();let d=e.indexOf("'",f+1);if(d===-1){p+=e.slice(f);break}u.push(te.singleQuoted(e.slice(f+1,d))),f=d+1;continue}if(m==='"'&&!i){h();let{part:d,endIndex:g}=Cx(t,e,f+1);u.push(d),f=g+1;continue}if(m==="$"&&e[f+1]==="'"){h();let{part:d,endIndex:g}=zm(t,e,f+2);u.push(d),f=g;continue}if(m==="$"){h();let{part:d,endIndex:g}=pc(t,e,f);d&&u.push(d),f=g;continue}if(m==="`"){h();let{part:d,endIndex:g}=t.parseBacktickSubstitution(e,f);u.push(d),f=g;continue}if(m==="~"){let d=f>0?e[f-1]:"";if(f===0||d==="="||s&&d===":"){let w=Um(t,e,f),E=e[w];if(E===void 0||E==="/"||E===":"){h();let b=e.slice(f+1,w)||null;u.push({type:"TildeExpansion",user:b}),f=w;continue}}}if("@*+?!".includes(m)&&f+1<e.length&&e[f+1]==="("){let d=Ex(e,f+1);if(d!==-1){h();let g=e.slice(f,d+1);u.push({type:"Glob",pattern:g}),f=d+1;continue}}if(m==="*"||m==="?"||m==="["){h();let{pattern:d,endIndex:g}=Wm(t,e,f);u.push({type:"Glob",pattern:d}),f=g;continue}if(m==="{"&&!s&&!a){let d=Hm(t,e,f,Vn);if(d){h(),u.push(d.part),f=d.endIndex;continue}}p+=m,f++}return h(),u}var e2=I(()=>{"use strict";wr();St();yr();ec()});function t2(t,e){let n=t.length,r=e+3,s=2,i=!1,o=!1;for(;r<n&&s>0;){let a=t[r];if(i){a==="'"&&(i=!1),r++;continue}if(o){if(a==="\\"){r+=2;continue}a==='"'&&(o=!1),r++;continue}if(a==="'"){i=!0,r++;continue}if(a==='"'){o=!0,r++;continue}if(a==="\\"){r+=2;continue}if(a==="("){s++,r++;continue}if(a===")"){if(s--,s===1){let l=r+1;return!(l<n&&t[l]===")")}if(s===0)return!1;r++;continue}if(s===1&&(a==="|"&&r+1<n&&t[r+1]==="|"||a==="&"&&r+1<n&&t[r+1]==="&"||a==="|"&&r+1<n&&t[r+1]!=="|"))return!0;r++}return!1}function n2(t,e,n,r){let s=e+2,i=1,o=s,a=!1,l=!1,c=0,u=!1,f="";for(;o<t.length&&i>0;){let d=t[o];a?d==="'"&&(a=!1):l?d==="\\"&&o+1<t.length?o++:d==='"'&&(l=!1):d==="'"?(a=!0,f=""):d==='"'?(l=!0,f=""):d==="\\"&&o+1<t.length?(o++,f=""):/[a-zA-Z_]/.test(d)?f+=d:(f==="case"?(c++,u=!1):f==="in"&&c>0?u=!0:f==="esac"&&c>0&&(c--,u=!1),f="",d==="("?o>0&&t[o-1]==="$"?i++:u||i++:d===")"?u?u=!1:i--:d===";"&&c>0&&o+1<t.length&&t[o+1]===";"&&(u=!0)),i>0&&o++}i>0&&r("unexpected EOF while looking for matching `)'");let p=t.slice(s,o),m=n().parse(p);return{part:te.commandSubstitution(m,!1),endIndex:o+1}}function r2(t,e,n,r,s){let o=e+1,a="";for(;o<t.length&&t[o]!=="`";)if(t[o]==="\\"){let u=t[o+1];u==="$"||u==="`"||u==="\\"||u===`
760
+ `||n&&u==='"'?(u!==`
761
+ `&&(a+=u),o+=2):(a+=t[o],o++)}else a+=t[o],o++;o>=t.length&&s("unexpected EOF while looking for matching ``'");let c=r().parse(a);return{part:te.commandSubstitution(c,!0),endIndex:o+1}}var s2=I(()=>{"use strict";wr()});function Cn(t){return new ye().parse(t)}var ye,it=I(()=>{"use strict";wr();St();qm();Zm();Xm();e2();Gn();s2();yr();yr();ye=class t{tokens=[];pos=0;pendingHeredocs=[];parseIterations=0;parseDepth=0;_input="";getInput(){return this._input}checkIterationLimit(){if(this.parseIterations++,this.parseIterations>xm)throw new dt("Maximum parse iterations exceeded (possible infinite loop)",this.current().line,this.current().column)}enterDepth(){if(this.parseDepth++,this.parseDepth>Zl)throw new dt(`Maximum parser nesting depth exceeded (${Zl})`,this.current().line,this.current().column);return()=>{this.parseDepth--}}parse(e){if(e.length>Vl)throw new dt(`Input too large: ${e.length} bytes exceeds limit of ${Vl}`,1,1);this._input=e;let n=new ao(e);if(this.tokens=n.tokenize(),this.tokens.length>ql)throw new dt(`Too many tokens: ${this.tokens.length} exceeds limit of ${ql}`,1,1);return this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}parseTokens(e){return this.tokens=e,this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}current(){return this.tokens[this.pos]||this.tokens[this.tokens.length-1]}peek(e=0){return this.tokens[this.pos+e]||this.tokens[this.tokens.length-1]}advance(){let e=this.current();return this.pos<this.tokens.length-1&&this.pos++,e}getPos(){return this.pos}check(e,n,r,s,...i){let o=this.tokens[this.pos]?.type;return o===e||n!==void 0&&o===n||r!==void 0&&o===r||s!==void 0&&o===s?!0:i.length>0?i.includes(o):!1}expect(e,n){if(this.check(e))return this.advance();let r=this.current();throw new dt(n||`Expected ${e}, got ${r.type}`,r.line,r.column,r)}error(e){let n=this.current();throw new dt(e,n.line,n.column,n)}skipNewlines(){for(;this.check(S.NEWLINE,S.COMMENT);)this.check(S.NEWLINE)?(this.advance(),this.processHeredocs()):this.advance()}skipSeparators(e=!0){for(;;){if(this.check(S.NEWLINE)){this.advance(),this.processHeredocs();continue}if(this.check(S.SEMICOLON,S.COMMENT)){this.advance();continue}if(e&&this.check(S.DSEMI,S.SEMI_AND,S.SEMI_SEMI_AND)){this.advance();continue}break}}addPendingHeredoc(e,n,r,s){this.pendingHeredocs.push({redirect:e,delimiter:n,stripTabs:r,quoted:s})}processHeredocs(){for(let e of this.pendingHeredocs)if(this.check(S.HEREDOC_CONTENT)){let n=this.advance(),r;e.quoted?r=te.word([te.literal(n.value)]):r=this.parseWordFromString(n.value,!1,!1,!1,!0),e.redirect.target=te.hereDoc(e.delimiter,r,e.stripTabs,e.quoted)}this.pendingHeredocs=[]}isStatementEnd(){return this.check(S.EOF,S.NEWLINE,S.SEMICOLON,S.AMP,S.AND_AND,S.OR_OR,S.RPAREN,S.RBRACE,S.DSEMI,S.SEMI_AND,S.SEMI_SEMI_AND)}isCommandStart(){let e=this.current().type;return e===S.WORD||e===S.NAME||e===S.NUMBER||e===S.ASSIGNMENT_WORD||e===S.IF||e===S.FOR||e===S.WHILE||e===S.UNTIL||e===S.CASE||e===S.LPAREN||e===S.LBRACE||e===S.DPAREN_START||e===S.DBRACK_START||e===S.FUNCTION||e===S.BANG||e===S.TIME||e===S.IN||e===S.LESS||e===S.GREAT||e===S.DLESS||e===S.DGREAT||e===S.LESSAND||e===S.GREATAND||e===S.LESSGREAT||e===S.DLESSDASH||e===S.CLOBBER||e===S.TLESS||e===S.AND_GREAT||e===S.AND_DGREAT}parseScript(){let e=[],r=0;for(this.skipNewlines();!this.check(S.EOF);){r++,r>1e4&&this.error("Parser stuck: too many iterations (>10000)");let s=this.checkUnexpectedToken();if(s){e.push(s),this.skipSeparators(!1);continue}let i=this.pos,o=this.parseStatement();o&&e.push(o),this.skipSeparators(!1),this.check(S.DSEMI,S.SEMI_AND,S.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${this.current().value}'`),this.pos===i&&!this.check(S.EOF)&&this.advance()}return te.script(e)}checkUnexpectedToken(){let e=this.current().type,n=this.current().value;if((e===S.DO||e===S.DONE||e===S.THEN||e===S.ELSE||e===S.ELIF||e===S.FI||e===S.ESAC)&&this.error(`syntax error near unexpected token \`${n}'`),e===S.RBRACE||e===S.RPAREN){let r=`syntax error near unexpected token \`${n}'`;return this.advance(),te.statement([te.pipeline([te.simpleCommand(null,[],[],[])])],[],!1,{message:r,token:n})}return(e===S.DSEMI||e===S.SEMI_AND||e===S.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${n}'`),e===S.SEMICOLON&&this.error(`syntax error near unexpected token \`${n}'`),(e===S.PIPE||e===S.PIPE_AMP)&&this.error(`syntax error near unexpected token \`${n}'`),null}parseStatement(){if(this.skipNewlines(),!this.isCommandStart())return null;let e=this.current().start,n=[],r=[],s=!1,i=this.parsePipeline();for(n.push(i);this.check(S.AND_AND,S.OR_OR);){let l=this.advance();r.push(l.type===S.AND_AND?"&&":"||"),this.skipNewlines();let c=this.parsePipeline();n.push(c)}this.check(S.AMP)&&(this.advance(),s=!0);let o=this.pos>0?this.tokens[this.pos-1].end:e,a=this._input.slice(e,o);return te.statement(n,r,s,void 0,a)}parsePipeline(){let e=!1,n=!1;this.check(S.TIME)&&(this.advance(),e=!0,this.check(S.WORD,S.NAME)&&this.current().value==="-p"&&(this.advance(),n=!0));let r=0;for(;this.check(S.BANG);)this.advance(),r++;let s=r%2===1,i=[],o=[],a=this.parseCommand();for(i.push(a);this.check(S.PIPE,S.PIPE_AMP);){let l=this.advance();this.skipNewlines(),o.push(l.type===S.PIPE_AMP);let c=this.parseCommand();i.push(c)}return te.pipeline(i,s,e,n,o.length>0?o:void 0)}parseCommand(){return this.check(S.IF)?nc(this):this.check(S.FOR)?rc(this):this.check(S.WHILE)?sc(this):this.check(S.UNTIL)?ic(this):this.check(S.CASE)?oc(this):this.check(S.LPAREN)?ac(this):this.check(S.LBRACE)?lc(this):this.check(S.DPAREN_START)?this.dparenClosesWithSpacedParens()?this.parseNestedSubshellsFromDparen():this.parseArithmeticCommand():this.check(S.DBRACK_START)?this.parseConditionalCommand():this.check(S.FUNCTION)?this.parseFunctionDef():this.check(S.NAME,S.WORD)&&this.peek(1).type===S.LPAREN&&this.peek(2).type===S.RPAREN?this.parseFunctionDef():Vm(this)}dparenClosesWithSpacedParens(){let e=1,n=1;for(;n<this.tokens.length-this.pos;){let r=this.peek(n);if(r.type===S.EOF)return!1;if(r.type===S.DPAREN_START||r.type===S.LPAREN)e++;else if(r.type===S.DPAREN_END){if(e-=2,e<=0)return!1}else if(r.type===S.RPAREN&&(e--,e===0&&this.peek(n+1).type===S.RPAREN))return!0;n++}return!1}parseNestedSubshellsFromDparen(){this.advance();let e=this.parseCompoundList();this.expect(S.RPAREN),this.expect(S.RPAREN);let n=this.parseOptionalRedirections(),r=te.subshell(e,[]);return te.subshell([te.statement([te.pipeline([r],!1,!1,!1)])],n)}isWord(){let e=this.current().type;return e===S.WORD||e===S.NAME||e===S.NUMBER||e===S.IF||e===S.FOR||e===S.WHILE||e===S.UNTIL||e===S.CASE||e===S.FUNCTION||e===S.ELSE||e===S.ELIF||e===S.FI||e===S.THEN||e===S.DO||e===S.DONE||e===S.ESAC||e===S.IN||e===S.SELECT||e===S.TIME||e===S.COPROC||e===S.BANG}parseWord(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted)}parseWordNoBraceExpansion(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted,!1,!1,!0)}parseWordForRegex(){let e=this.advance();return this.parseWordFromString(e.value,e.quoted,e.singleQuoted,!1,!1,!0,!0)}parseWordFromString(e,n=!1,r=!1,s=!1,i=!1,o=!1,a=!1){let l=Vn(this,e,n,r,s,i,!1,o,a);return te.word(l)}parseCommandSubstitution(e,n){return n2(e,n,()=>new t,r=>this.error(r))}parseBacktickSubstitution(e,n,r=!1){return r2(e,n,r,()=>new t,s=>this.error(s))}isDollarDparenSubshell(e,n){return t2(e,n)}parseArithmeticExpansion(e,n){let r=n+3,s=1,i=0,o=r;for(;o<e.length-1&&s>0;)e[o]==="$"&&e[o+1]==="("?e[o+2]==="("?(s++,o+=3):(i++,o+=2):e[o]==="("&&e[o+1]==="("?(s++,o+=2):e[o]===")"&&e[o+1]===")"?i>0?(i--,o++):(s--,s>0&&(o+=2)):e[o]==="("?(i++,o++):(e[o]===")"&&i>0&&i--,o++);let a=e.slice(r,o),l=this.parseArithmeticExpression(a);return{part:te.arithmeticExpansion(l),endIndex:o+2}}parseArithmeticCommand(){let e=this.expect(S.DPAREN_START),n="",r=1,s=0,i=!1,o=!1;for(;r>0&&!this.check(S.EOF);){if(i){if(i=!1,s>0){s--,n+=")";continue}if(this.check(S.RPAREN)){r--,o=!0,this.advance();continue}if(this.check(S.DPAREN_END)){r--,o=!0;continue}n+=")";continue}if(this.check(S.DPAREN_START))r++,n+="((",this.advance();else if(this.check(S.DPAREN_END))s>=2?(s-=2,n+="))",this.advance()):s===1?(s--,n+=")",i=!0,this.advance()):(r--,o=!0,r>0&&(n+="))"),this.advance());else if(this.check(S.LPAREN))s++,n+="(",this.advance();else if(this.check(S.RPAREN))s>0&&s--,n+=")",this.advance();else{let c=this.current().value,u=n.length>0?n[n.length-1]:"";n.length>0&&!n.endsWith(" ")&&!(c==="="&&/[|&^+\-*/%<>]$/.test(n))&&!(c==="<"&&u==="<")&&!(c===">"&&u===">")&&(n+=" "),n+=c,this.advance()}}o||this.expect(S.DPAREN_END);let a=this.parseArithmeticExpression(n.trim()),l=this.parseOptionalRedirections();return te.arithmeticCommand(a,l,e.line)}parseConditionalCommand(){let e=this.expect(S.DBRACK_START),n=uc(this);this.expect(S.DBRACK_END);let r=this.parseOptionalRedirections();return te.conditionalCommand(n,r,e.line)}parseFunctionDef(){let e;if(this.check(S.FUNCTION)){if(this.advance(),this.check(S.NAME)||this.check(S.WORD))e=this.advance().value;else{let s=this.current();throw new dt("Expected function name",s.line,s.column,s)}this.check(S.LPAREN)&&(this.advance(),this.expect(S.RPAREN))}else e=this.advance().value,e.includes("$")&&this.error(`\`${e}': not a valid identifier`),this.expect(S.LPAREN),this.expect(S.RPAREN);this.skipNewlines();let n=this.parseCompoundCommandBody({forFunctionBody:!0}),r=this.parseOptionalRedirections();return te.functionDef(e,n,r)}parseCompoundCommandBody(e){let n=e?.forFunctionBody;if(this.check(S.LBRACE))return lc(this,{skipRedirections:n});if(this.check(S.LPAREN))return ac(this,{skipRedirections:n});if(this.check(S.IF))return nc(this,{skipRedirections:n});if(this.check(S.FOR))return rc(this,{skipRedirections:n});if(this.check(S.WHILE))return sc(this,{skipRedirections:n});if(this.check(S.UNTIL))return ic(this,{skipRedirections:n});if(this.check(S.CASE))return oc(this,{skipRedirections:n});this.error("Expected compound command for function body")}parseCompoundList(){let e=this.enterDepth(),n=[];for(this.skipNewlines();!this.check(S.EOF,S.FI,S.ELSE,S.ELIF,S.THEN,S.DO,S.DONE,S.ESAC,S.RPAREN,S.RBRACE,S.DSEMI,S.SEMI_AND,S.SEMI_SEMI_AND)&&this.isCommandStart();){this.checkIterationLimit();let r=this.pos,s=this.parseStatement();if(s&&n.push(s),this.skipSeparators(),this.pos===r&&!s)break}return e(),n}parseOptionalRedirections(){let e=[];for(;fo(this);){this.checkIterationLimit();let n=this.pos;if(e.push(po(this)),this.pos===n)break}return e}parseArithmeticExpression(e){return Te(this,e)}}});function dc(t){return kx.get(t)??""}function u2(t){let e=[],n="",r=0;for(;r<t.length;){let s=t[r];if(s==="["){for(n+=s,r++,r<t.length&&(t[r]==="!"||t[r]==="^")&&(n+=t[r],r++),r<t.length&&t[r]==="]"&&(n+=t[r],r++);r<t.length&&t[r]!=="]";){if(t[r]==="["&&r+1<t.length&&t[r+1]===":"){let i=t.indexOf(":]",r+2);if(i!==-1){n+=t.slice(r,i+2),r=i+2;continue}}if(t[r]==="\\"&&r+1<t.length){n+=t[r]+t[r+1],r+=2;continue}n+=t[r],r++}r<t.length&&t[r]==="]"&&(n+=t[r],r++)}else s===":"?(n!==""&&e.push(n),n="",r++):s==="\\"&&r+1<t.length?(n+=s+t[r+1],r+=2):(n+=s,r++)}return n!==""&&e.push(n),e}function f2(t){let e="^";for(let n=0;n<t.length;n++){let r=t[n];if(r==="*")e+="[^/]*";else if(r==="?")e+="[^/]";else if(r==="["){let s=n+1,i="[";s<t.length&&(t[s]==="^"||t[s]==="!")&&(i+="^",s++),s<t.length&&t[s]==="]"&&(i+="\\]",s++);let o=s;for(;o<t.length;){if(t[o]==="\\"&&o+1<t.length){o+=2;continue}if(t[o]==="["&&o+1<t.length&&t[o+1]===":"){let l=t.indexOf(":]",o+2);if(l!==-1){o=l+2;continue}}if(t[o]==="]")break;o++}let a=s;for(;s<t.length&&t[s]!=="]";){if(t[s]==="["&&s+1<t.length&&t[s+1]===":"){let l=t.indexOf(":]",s+2);if(l!==-1){let c=t.slice(s+2,l),u=dc(c);i+=u,s=l+2;continue}}if(t[s]==="\\"&&s+1<t.length){i+=`\\${t[s+1]}`,s+=2;continue}if(t[s]==="-"){let l=s===a,c=s+1===o;l||c?i+="\\-":i+="-"}else i+=t[s];s++}i+="]",e+=i,n=s}else if(r==="\\"&&n+1<t.length){let s=t[n+1];/[.+^${}()|\\*?[\]]/.test(s)?e+=`\\${s}`:e+=s,n++}else/[.+^${}()|]/.test(r)?e+=`\\${r}`:e+=r}return e+="$",ee(e)}function mc(t,e){let n=1,r=e+1;for(;r<t.length&&n>0;){let s=t[r];if(s==="\\"){r+=2;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function gc(t){let e=[],n="",r=0,s=!1,i=0;for(;i<t.length;){let o=t[i];if(o==="'"&&!s){s=!0,n+="\0QUOTE_START\0",i++;continue}if(o==="'"&&s){s=!1,n+="\0QUOTE_END\0",i++;continue}if(s){n+=o,i++;continue}if(o==="\\"){n+=o,i+1<t.length?(n+=t[i+1],i+=2):i++;continue}o==="("?(r++,n+=o):o===")"?(r--,n+=o):o==="|"&&r===0?(e.push(n),n=""):n+=o,i++}return e.push(n),e}var kx,p2=I(()=>{"use strict";Ve();kx=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9a-fA-F"]])});var qn,ho=I(()=>{"use strict";Ne();Ve();F();kr();p2();qn=class{fs;cwd;globignorePatterns=[];hasGlobignore=!1;globstar=!1;nullglob=!1;failglob=!1;dotglob=!1;extglob=!1;globskipdots=!0;ops={count:0};maxOps;constructor(e,n,r,s){this.fs=e,this.cwd=n,typeof s=="boolean"?(this.globstar=s,this.maxOps=1e5):s?(this.globstar=s.globstar??!1,this.nullglob=s.nullglob??!1,this.failglob=s.failglob??!1,this.dotglob=s.dotglob??!1,this.extglob=s.extglob??!1,this.globskipdots=s.globskipdots??!0,this.maxOps=s.maxGlobOperations??1e5):this.maxOps=1e5;let i=r?.get("GLOBIGNORE");if(i!==void 0){let o=R(i);o!==""&&(this.hasGlobignore=!0,this.globignorePatterns=u2(o))}}checkOpsLimit(){if(++this.ops.count>this.maxOps)throw new ae(`Glob operation limit exceeded (${this.maxOps})`,"glob_operations")}hasNullglob(){return this.nullglob}hasFailglob(){return this.failglob}filterGlobignore(e){return!this.hasGlobignore&&!this.globskipdots?e:e.filter(n=>{let r=n.split("/").pop()||n;if((this.hasGlobignore||this.globskipdots)&&(r==="."||r===".."))return!1;if(this.hasGlobignore){for(let s of this.globignorePatterns)if(this.matchGlobignorePattern(n,s))return!1}return!0})}matchGlobignorePattern(e,n){return f2(n).test(e)}isGlobPattern(e){return!!(e.includes("*")||e.includes("?")||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}async expandArgs(e,n){let r=e.map((o,a)=>(n?.[a]??!1)||!this.isGlobPattern(o)?null:this.expand(o)),s=await Promise.all(r.map(o=>o||Promise.resolve(null))),i=[];for(let o=0;o<e.length;o++){let a=s[o];a===null?i.push(e[o]):a.length>0?i.push(...a):i.push(e[o])}return i}async expand(e){let n;if(e.includes("**")&&this.globstar&&this.isGlobstarValid(e))n=await this.expandRecursive(e);else{let r=e.replace(/\*\*+/g,"*");n=await this.expandSimple(r)}return this.filterGlobignore(n)}isGlobstarValid(e){let n=e.split("/");for(let r of n)if(r.includes("**")&&r!=="**")return!1;return!0}hasGlobChars(e){return!!(e.includes("*")||e.includes("?")||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}async expandSimple(e){let n=e.startsWith("/"),r=e.split("/").filter(c=>c!==""),s=-1;for(let c=0;c<r.length;c++)if(this.hasGlobChars(r[c])){s=c;break}if(s===-1)return[e];let i,o;if(s===0)n?(i="/",o="/"):(i=this.cwd,o="");else{let c=r.slice(0,s);n?(i=`/${c.join("/")}`,o=`/${c.join("/")}`):(i=this.fs.resolvePath(this.cwd,c.join("/")),o=c.join("/"))}let a=r.slice(s);return(await this.expandSegments(i,o,a)).sort()}async expandSegments(e,n,r){if(this.checkOpsLimit(),r.length===0)return[n];let[s,...i]=r,o=[];try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let a=await this.fs.readdirWithFileTypes(e),l=[],c=[...a],u=this.dotglob||this.hasGlobignore;if(s.startsWith(".")||this.dotglob){let p=a.some(m=>m.name==="."),h=a.some(m=>m.name==="..");p||c.push({name:".",isFile:!1,isDirectory:!0,isSymbolicLink:!1}),h||c.push({name:"..",isFile:!1,isDirectory:!0,isSymbolicLink:!1})}for(let p of c)if(!(p.name.startsWith(".")&&!s.startsWith(".")&&!u)&&this.matchPattern(p.name,s)){let h=e==="/"?`/${p.name}`:`${e}/${p.name}`,m;n===""?m=p.name:n==="/"?m=`/${p.name}`:m=`${n}/${p.name}`,i.length===0?l.push(Promise.resolve([m])):p.isDirectory&&l.push(this.expandSegments(h,m,i))}let f=await Promise.all(l);for(let p of f)o.push(...p)}else{this.checkOpsLimit();let a=await this.fs.readdir(e),l=[],c=[...a],u=this.dotglob||this.hasGlobignore;(s.startsWith(".")||this.dotglob)&&(a.includes(".")||c.push("."),a.includes("..")||c.push(".."));for(let p of c)if(!(p.startsWith(".")&&!s.startsWith(".")&&!u)&&this.matchPattern(p,s)){let h=e==="/"?`/${p}`:`${e}/${p}`,m;n===""?m=p:n==="/"?m=`/${p}`:m=`${n}/${p}`,i.length===0?l.push(Promise.resolve([m])):l.push((async()=>{try{if(this.checkOpsLimit(),(await this.fs.stat(h)).isDirectory)return this.expandSegments(h,m,i)}catch(d){if(d instanceof ae)throw d}return[]})())}let f=await Promise.all(l);for(let p of f)o.push(...p)}}catch(a){if(a instanceof ae)throw a}return o}async expandRecursive(e){let n=[],r=e.indexOf("**"),s=e.slice(0,r).replace(/\/$/,"")||".",o=e.slice(r+2).replace(/^\//,"");return o.includes("**")&&this.isGlobstarValid(o)?(await this.walkDirectoryMultiGlobstar(s,o,n),[...new Set(n)].sort()):(await this.walkDirectory(s,o,n),n.sort())}async walkDirectoryMultiGlobstar(e,n,r){this.checkOpsLimit();let s=this.fs.resolvePath(this.cwd,e);try{this.checkOpsLimit();let i=this.fs.readdirWithFileTypes?await this.fs.readdirWithFileTypes(s):null;if(i){let o=[];for(let c of i){let u=e==="."?c.name:`${e}/${c.name}`;c.isDirectory&&o.push(u)}let a=e==="."?n:`${e}/${n}`,l=await this.expandRecursive(a);r.push(...l);for(let c=0;c<o.length;c+=100){let u=o.slice(c,c+100);await Promise.all(u.map(f=>this.walkDirectoryMultiGlobstar(f,n,r)))}}else{this.checkOpsLimit();let o=await this.fs.readdir(s),a=[];for(let u of o){let f=e==="."?u:`${e}/${u}`,p=this.fs.resolvePath(this.cwd,f);try{this.checkOpsLimit(),(await this.fs.stat(p)).isDirectory&&a.push(f)}catch(h){if(h instanceof ae)throw h}}let l=e==="."?n:`${e}/${n}`,c=await this.expandRecursive(l);r.push(...c);for(let u=0;u<a.length;u+=100){let f=a.slice(u,u+100);await Promise.all(f.map(p=>this.walkDirectoryMultiGlobstar(p,n,r)))}}}catch(i){if(i instanceof ae)throw i}}async walkDirectory(e,n,r){this.checkOpsLimit();let s=this.fs.resolvePath(this.cwd,e);try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let i=await this.fs.readdirWithFileTypes(s),o=[],a=[];for(let l of i){let c=e==="."?l.name:`${e}/${l.name}`;l.isDirectory?a.push(c):n&&this.matchPattern(l.name,n)&&o.push(c)}r.push(...o);for(let l=0;l<a.length;l+=100){let c=a.slice(l,l+100);await Promise.all(c.map(u=>this.walkDirectory(u,n,r)))}}else{this.checkOpsLimit();let i=await this.fs.readdir(s),o=[];for(let l=0;l<i.length;l+=100){let c=i.slice(l,l+100),u=await Promise.all(c.map(async f=>{let p=e==="."?f:`${e}/${f}`,h=this.fs.resolvePath(this.cwd,p);try{this.checkOpsLimit();let m=await this.fs.stat(h);return{name:f,path:p,isDirectory:m.isDirectory}}catch(m){if(m instanceof ae)throw m;return null}}));o.push(...u.filter(f=>f!==null))}for(let l of o)!l.isDirectory&&n&&this.matchPattern(l.name,n)&&r.push(l.path);let a=o.filter(l=>l.isDirectory);for(let l=0;l<a.length;l+=100){let c=a.slice(l,l+100);await Promise.all(c.map(u=>this.walkDirectory(u.path,n,r)))}}}catch(i){if(i instanceof ae)throw i}}matchPattern(e,n){return this.patternToRegex(n).test(e)}patternToRegex(e){let n=this.patternToRegexStr(e);return ee(`^${n}$`)}patternToRegexStr(e){let n="",r=!1;for(let s=0;s<e.length;s++){if(e.slice(s,s+13)==="\0QUOTE_START\0"){r=!0,s+=12;continue}if(e.slice(s,s+11)==="\0QUOTE_END\0"){r=!1,s+=10;continue}let i=e[s];if(r){/[.+^${}()|\\*?[\]]/.test(i)?n+=`\\${i}`:n+=i;continue}if(this.extglob&&(i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&s+1<e.length&&e[s+1]==="("){let o=mc(e,s+1);if(o!==-1){let a=e.slice(s+2,o),l=gc(a),c=l.map(f=>this.patternToRegexStr(f)),u=c.length>0?c.join("|"):"(?:)";if(i==="@")n+=`(?:${u})`;else if(i==="*")n+=`(?:${u})*`;else if(i==="+")n+=`(?:${u})+`;else if(i==="?")n+=`(?:${u})?`;else if(i==="!")if(o<e.length-1){let p=l.map(m=>this.computePatternLength(m));if(p.every(m=>m!==null)&&p.every(m=>m===p[0])&&p[0]!==null){let m=p[0];if(m===0)n+="(?:.+)";else{let d=[];m>0&&d.push(`.{0,${m-1}}`),d.push(`.{${m+1},}`),d.push(`(?!(?:${u})).{${m}}`),n+=`(?:${d.join("|")})`}}else n+=`(?:(?!(?:${u})).)*?`}else n+=`(?!(?:${u})$).*`;s=o;continue}}if(i==="*")n+=".*";else if(i==="?")n+=".";else if(i==="["){let o=s+1,a="[";o<e.length&&(e[o]==="^"||e[o]==="!")&&(a+="^",o++),o<e.length&&e[o]==="]"&&(a+="\\]",o++);let l=o;for(;l<e.length;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}if(e[l]==="["&&l+1<e.length&&e[l+1]===":"){let u=e.indexOf(":]",l+2);if(u!==-1){l=u+2;continue}}if(e[l]==="]")break;l++}let c=o;for(;o<e.length&&e[o]!=="]";){if(e[o]==="["&&o+1<e.length&&e[o+1]===":"){let u=e.indexOf(":]",o+2);if(u!==-1){let f=e.slice(o+2,u),p=dc(f);a+=p,o=u+2;continue}}if(e[o]==="\\"&&o+1<e.length){a+=`\\${e[o+1]}`,o+=2;continue}if(e[o]==="-"){let u=o===c,f=o+1===l;u||f?a+="\\-":a+="-"}else a+=e[o];o++}a+="]",n+=a,s=o}else if(i==="\\"&&s+1<e.length){let o=e[s+1];/[.+^${}()|\\*?[\]]/.test(o)?n+=`\\${o}`:n+=o,s++}else/[.+^${}()|]/.test(i)?n+=`\\${i}`:n+=i}return n}computePatternLength(e){let n=0,r=0,s=!1;for(;r<e.length;){if(e.slice(r,r+13)==="\0QUOTE_START\0"){s=!0,r+=13;continue}if(e.slice(r,r+11)==="\0QUOTE_END\0"){s=!1,r+=11;continue}let i=e[r];if(s){n+=1,r++;continue}if((i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&r+1<e.length&&e[r+1]==="("){let o=mc(e,r+1);if(o!==-1){if(i==="@"){let a=e.slice(r+2,o),c=gc(a).map(u=>this.computePatternLength(u));if(c.every(u=>u!==null)&&c.every(u=>u===c[0])){n+=c[0],r=o+1;continue}return null}return null}}if(i==="*")return null;if(i==="?"){n+=1,r++;continue}if(i==="["){let o=e.indexOf("]",r+1);if(o!==-1){n+=1,r=o+1;continue}n+=1,r++;continue}if(i==="\\"){n+=1,r+=2;continue}n+=1,r++}return n}}});function yc(t){for(let e=0;e<t.length;e++){if(t[e]==="\\"){e++;continue}if(t[e]==="$"){let n=t[e+1];if(n==="{"||n&&/[a-zA-Z_]/.test(n))return!0}}return!1}function Ix(t){if(!t.operation)return!1;let e=t.operation,n;if((e.type==="DefaultValue"||e.type==="AssignDefault"||e.type==="UseAlternative"||e.type==="ErrorIfUnset")&&(n=e.word?.parts),!n)return!1;for(let r of n)if(r.type==="DoubleQuoted"||r.type==="SingleQuoted"||r.type==="Bytes")return!0;return!1}function h2(t){if(!t.operation)return!1;let e=t.operation,n;if((e.type==="DefaultValue"||e.type==="AssignDefault"||e.type==="UseAlternative"||e.type==="ErrorIfUnset")&&(n=e.word?.parts),!n||n.length===0)return!1;for(let r of n)if(r.type!=="DoubleQuoted"&&r.type!=="SingleQuoted"&&r.type!=="Bytes")return!1;return!0}function Ws(t){let e=!1,n=!1,r=!1,s=!1,i=!1,o=!1,a=!1;for(let l of t){if((l.type==="SingleQuoted"||l.type==="DoubleQuoted"||l.type==="Bytes")&&(e=!0,l.type==="DoubleQuoted"))for(let c of l.parts)c.type==="ParameterExpansion"&&(c.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/)&&(!c.operation||c.operation.type==="PatternRemoval"||c.operation.type==="PatternReplacement")&&(s=!0),(c.operation?.type==="VarNamePrefix"||c.operation?.type==="ArrayKeys")&&(o=!0),c.operation?.type==="Indirection"&&(a=!0));l.type==="CommandSubstitution"&&(n=!0),l.type==="ParameterExpansion"&&(i=!0,(l.parameter==="@"||l.parameter==="*")&&(r=!0),Ix(l)&&(e=!0),(l.operation?.type==="VarNamePrefix"||l.operation?.type==="ArrayKeys")&&(o=!0),l.operation?.type==="Indirection"&&(a=!0)),l.type==="Glob"&&yc(l.pattern)&&(i=!0)}return{hasQuoted:e,hasCommandSub:n,hasArrayVar:r,hasArrayAtExpansion:s,hasParamExpansion:i,hasVarNamePrefixExpansion:o,hasIndirection:a}}var mo=I(()=>{"use strict"});function ot(t,e){let n=`${e}_`,r=[];for(let s of t.state.env.keys())if(s.startsWith(n)){let i=s.slice(n.length),o=Number.parseInt(i,10);!Number.isNaN(o)&&String(o)===i&&r.push(o)}return r.sort((s,i)=>s-i)}function Nn(t,e){let n=`${e}_`;for(let r of t.state.env.keys())r.startsWith(n)&&t.state.env.delete(r)}function hn(t,e){let n=`${e}_`,r=`${e}__length`,s=[];for(let i of t.state.env.keys())if(i!==r&&i.startsWith(n)){let o=i.slice(n.length);if(o.startsWith("_length"))continue;s.push(o)}return s.sort()}function go(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function wc(t){if(t.parts.length<2)return null;let e=t.parts[0],n=t.parts[1];if(e.type!=="Glob"||!e.pattern.startsWith("["))return null;let r,s=n,i=1;if(n.type==="Literal"&&n.value.startsWith("]")){let f=n.value.slice(1);if(f.startsWith("+=")||f.startsWith("="))r=e.pattern.slice(1);else if(f===""){if(t.parts.length<3)return null;let p=t.parts[2];if(p.type!=="Literal"||!p.value.startsWith("=")&&!p.value.startsWith("+="))return null;r=e.pattern.slice(1),s=p,i=2}else return null}else if(e.pattern==="["&&(n.type==="DoubleQuoted"||n.type==="SingleQuoted")){if(t.parts.length<3)return null;let f=t.parts[2];if(f.type!=="Literal"||!f.value.startsWith("]=")&&!f.value.startsWith("]+="))return null;if(n.type==="SingleQuoted")r=n.value;else{r="";for(let p of n.parts)(p.type==="Literal"||p.type==="Escaped")&&(r+=p.value)}s=f,i=2}else if(e.pattern.endsWith("]")){if(n.type!=="Literal"||!n.value.startsWith("=")&&!n.value.startsWith("+="))return null;r=e.pattern.slice(1,-1)}else return null;r=go(r);let o;if(s.type!=="Literal")return null;s.value.startsWith("]=")||s.value.startsWith("]+=")?o=s.value.slice(1):o=s.value;let a=o.startsWith("+=");if(!a&&!o.startsWith("="))return null;let l=[],c=a?2:1,u=o.slice(c);u&&l.push({type:"Literal",value:u});for(let f=i+1;f<t.parts.length;f++){let p=t.parts[f];p.type==="BraceExpansion"?l.push({type:"Literal",value:Tx(p)}):l.push(p)}return{key:r,valueParts:l,append:a}}function Tx(t){return`{${t.items.map(n=>{if(n.type==="Range"){let r=n.startStr??String(n.start),s=n.endStr??String(n.end),i=`${r}..${s}`;return n.step&&(i+=`..${n.step}`),i}return Xr(n.word)}).join(",")}}`}function Xr(t){let e="";for(let n of t.parts)switch(n.type){case"Literal":e+=n.value;break;case"Glob":e+=n.pattern;break;case"SingleQuoted":e+=n.value;break;case"DoubleQuoted":for(let r of n.parts)(r.type==="Literal"||r.type==="Escaped")&&(e+=r.value);break;case"Escaped":e+=n.value;break;case"BraceExpansion":e+="{",e+=n.items.map(r=>r.type==="Range"?`${r.startStr}..${r.endStr}${r.step?`..${r.step}`:""}`:Xr(r.word)).join(","),e+="}";break;case"TildeExpansion":e+="~",n.user&&(e+=n.user);break}return e}var on=I(()=>{"use strict"});function ft(t){return t.get("IFS")===void 0?Ox:$(t,"IFS")}function wt(t){let e=t.get("IFS");return e===void 0?!1:e.length===0}function yo(t){let e=ft(t);if(e==="")return!0;for(let n of e)if(n!==" "&&n!==" "&&n!==`
762
+ `)return!1;return!0}function d2(t){return t.split("").map(e=>/[\\^$.*+?()[\]{}|-]/.test(e)?`\\${e}`:e===" "?"\\t":e===`
763
+ `?"\\n":e).join("")}function be(t){let e=t.get("IFS");return e===void 0?" ":e.length===0?"":$(t,"IFS")[0]||""}function Px(t){return Rx.includes(t)}function bc(t){let e=new Set,n=new Set;for(let r of t)Px(r)?e.add(r):n.add(r);return{whitespace:e,nonWhitespace:n}}function xc(t,e,n,r){if(e==="")return t===""?{words:[],wordStarts:[]}:{words:[t],wordStarts:[0]};let{whitespace:s,nonWhitespace:i}=bc(e),o=[],a=[],l=0;for(;l<t.length&&s.has(t[l]);)l++;if(l>=t.length)return{words:[],wordStarts:[]};if(i.has(t[l]))for(o.push(""),a.push(l),l++;l<t.length&&s.has(t[l]);)l++;for(;l<t.length&&!(n!==void 0&&o.length>=n);){let c=l;for(a.push(c);l<t.length;){let u=t[l];if(!r&&u==="\\"){l++,l<t.length&&l++;continue}if(s.has(u)||i.has(u))break;l++}if(o.push(t.substring(c,l)),l>=t.length)break;for(;l<t.length&&s.has(t[l]);)l++;if(l<t.length&&i.has(t[l])){for(l++;l<t.length&&s.has(t[l]);)l++;for(;l<t.length&&i.has(t[l])&&!(n!==void 0&&o.length>=n);)for(o.push(""),a.push(l),l++;l<t.length&&s.has(t[l]);)l++}}return{words:o,wordStarts:a}}function wo(t,e){if(e==="")return{words:t?[t]:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};if(t==="")return{words:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};let{whitespace:n,nonWhitespace:r}=bc(e),s=[],i=0,o=!1,a=!1,l=i;for(;i<t.length&&n.has(t[i]);)i++;if(i>l&&(o=!0),i>=t.length)return{words:[],hadLeadingDelimiter:!0,hadTrailingDelimiter:!0};if(r.has(t[i]))for(s.push(""),i++;i<t.length&&n.has(t[i]);)i++;for(;i<t.length;){let c=i;for(;i<t.length;){let f=t[i];if(n.has(f)||r.has(f))break;i++}if(s.push(t.substring(c,i)),i>=t.length){a=!1;break}let u=i;for(;i<t.length&&n.has(t[i]);)i++;if(i<t.length&&r.has(t[i])){for(i++;i<t.length&&n.has(t[i]);)i++;for(;i<t.length&&r.has(t[i]);)for(s.push(""),i++;i<t.length&&n.has(t[i]);)i++}i>=t.length&&i>u&&(a=!0)}return{words:s,hadLeadingDelimiter:o,hadTrailingDelimiter:a}}function He(t,e){return wo(t,e).words}function $x(t,e){for(let n of t)if(e.has(n))return!0;return!1}function m2(t,e,n){if(e==="")return t;let{whitespace:r,nonWhitespace:s}=bc(e),i=t.length;for(;i>0&&r.has(t[i-1]);){if(!n&&i>=2){let a=0,l=i-2;for(;l>=0&&t[l]==="\\";)a++,l--;if(a%2===1)break}i--}let o=t.substring(0,i);if(o.length>=1&&s.has(o[o.length-1])){if(!n&&o.length>=2){let l=0,c=o.length-2;for(;c>=0&&o[c]==="\\";)l++,c--;if(l%2===1)return o}let a=o.substring(0,o.length-1);if(!$x(a,s))return a}return o}var Ox,Rx,Xt=I(()=>{"use strict";F();Ox=`
764
+ `;Rx=`
765
+ `});function _e(t,e){return t.state.namerefs?.has(e)??!1}function _n(t,e){t.state.namerefs??=new Set,t.state.namerefs.add(e)}function g2(t,e){t.state.namerefs?.delete(e),t.state.boundNamerefs?.delete(e),t.state.invalidNamerefs?.delete(e)}function y2(t,e){t.state.invalidNamerefs??=new Set,t.state.invalidNamerefs.add(e)}function w2(t,e){return t.state.invalidNamerefs?.has(e)??!1}function Ec(t,e){t.state.boundNamerefs??=new Set,t.state.boundNamerefs.add(e)}function bo(t,e){let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let s=n[1],i=Array.from(t.state.env.keys()).some(a=>a.startsWith(`${s}_`)&&!a.includes("__")),o=t.state.associativeArrays?.has(s)??!1;return i||o}return Array.from(t.state.env.keys()).some(s=>s.startsWith(`${e}_`)&&!s.includes("__"))?!0:t.state.env.has(e)}function bt(t,e,n=100){if(!_e(t,e)||w2(t,e))return e;let r=new Set,s=e;for(;n-- >0;){if(r.has(s))return;if(r.add(s),!_e(t,s))return s;let i=$(t.state.env,s);if(i===""||!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(i))return s;s=i}}function xr(t,e){if(_e(t,e))return $(t.state.env,e)}function b2(t,e,n,r=100){if(!_e(t,e)||w2(t,e))return e;let s=new Set,i=e;for(;r-- >0;){if(s.has(i))return;if(s.add(i),!_e(t,i))return i;let o=$(t.state.env,i);if(o==="")return n!==void 0?/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)&&bo(t,n)?i:null:i;if(!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(o))return i;i=o}}var an=I(()=>{"use strict";F()});function Ct(t,e=""){return t!==void 0?R(t):e}function Dx(t,e){let n=e.replace(/\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(r,s)=>Ct(t.state.env.get(s)));return n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(r,s)=>Ct(t.state.env.get(s))),n}function me(t,e){return e==="FUNCNAME"?(t.state.funcNameStack??[]).map((i,o)=>[o,i]):e==="BASH_LINENO"?(t.state.callLineStack??[]).map((i,o)=>[o,String(i)]):e==="BASH_SOURCE"?(t.state.sourceStack??[]).map((i,o)=>[o,i]):t.state.associativeArrays?.has(e)?hn(t,e).map(i=>[i,Ct(t.state.env.get(`${e}_${i}`))]):ot(t,e).map(s=>[s,Ct(t.state.env.get(`${e}_${s}`))])}function Mn(t,e){return e==="FUNCNAME"?(t.state.funcNameStack?.length??0)>0:e==="BASH_LINENO"?(t.state.callLineStack?.length??0)>0:e==="BASH_SOURCE"?(t.state.sourceStack?.length??0)>0:t.state.associativeArrays?.has(e)?hn(t,e).length>0:ot(t,e).length>0}async function Oe(t,e,n=!0,r=!1){switch(e){case"?":return String(t.state.lastExitCode);case"$":return String(Dn().pid);case"#":return Ct(t.state.env.get("#"),"0");case"@":return Ct(t.state.env.get("@"));case"_":return R(t.state.lastArg);case"-":{let o="";return o+="h",t.state.options.errexit&&(o+="e"),t.state.options.noglob&&(o+="f"),t.state.options.nounset&&(o+="u"),t.state.options.verbose&&(o+="v"),t.state.options.xtrace&&(o+="x"),o+="B",t.state.options.noclobber&&(o+="C"),o+="s",o}case"*":{let o=Number.parseInt(Ct(t.state.env.get("#"),"0"),10);if(o===0)return"";let a=[];for(let l=1;l<=o;l++)a.push(Ct(t.state.env.get(String(l))));return a.join(be(t.state.env))}case"0":return Ct(t.state.env.get("0"),"bash");case"PWD":return t.state.env.has("PWD")?Ct(t.state.env.get("PWD")):"";case"OLDPWD":return t.state.env.has("OLDPWD")?Ct(t.state.env.get("OLDPWD")):"";case"PPID":{let{ppid:o}=Dn();return String(o)}case"UID":{let{uid:o}=Dn();return String(o)}case"EUID":return String(Dn().uid);case"RANDOM":return String(Math.floor(Math.random()*32768));case"SECONDS":return String(Math.floor((Date.now()-t.state.startTime)/1e3));case"BASH_VERSION":return pm;case"!":return String(t.state.lastBackgroundPid);case"BASHPID":return String(t.state.bashPid);case"LINENO":return String(t.state.currentLine);case"FUNCNAME":{let o=t.state.funcNameStack?.[0];if(o!==void 0)return o;if(n&&t.state.options.nounset)throw new It("FUNCNAME");return""}case"BASH_LINENO":{let o=t.state.callLineStack?.[0];if(o!==void 0)return String(o);if(n&&t.state.options.nounset)throw new It("BASH_LINENO");return""}case"BASH_SOURCE":{let o=t.state.sourceStack?.[0];if(o!==void 0)return o;if(n&&t.state.options.nounset)throw new It("BASH_SOURCE");return""}}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/.test(e))throw new Tt(`\${${e}}`);let s=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(s){let o=s[1],a=s[2];if(_e(t,o)){let f=bt(t,o);if(f&&f!==o){if(f.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return"";o=f}}if(a==="@"||a==="*"){let f=me(t,o);if(f.length>0)return f.map(([,h])=>h).join(" ");let p=t.state.env.get(o);return p!==void 0?R(p):""}if(o==="FUNCNAME"){let f=Number.parseInt(a,10);return!Number.isNaN(f)&&f>=0?t.state.funcNameStack?.[f]??"":""}if(o==="BASH_LINENO"){let f=Number.parseInt(a,10);if(!Number.isNaN(f)&&f>=0){let p=t.state.callLineStack?.[f];return p!==void 0?String(p):""}return""}if(o==="BASH_SOURCE"){let f=Number.parseInt(a,10);return!Number.isNaN(f)&&f>=0?t.state.sourceStack?.[f]??"":""}if(t.state.associativeArrays?.has(o)){let f=go(a);f=Dx(t,f);let p=t.state.env.get(`${o}_${f}`);if(p===void 0&&n&&t.state.options.nounset)throw new It(`${o}[${a}]`);return Ct(p)}let c;if(/^-?\d+$/.test(a))c=Number.parseInt(a,10);else try{let f=new ye,p=Te(f,a);c=await ue(t,p.expression)}catch{let f=t.state.env.get(a);c=f?Number.parseInt(R(f),10):0,Number.isNaN(c)&&(c=0)}if(c<0){let f=me(t,o),p=t.state.currentLine;if(f.length===0)return t.state.expansionStderr=(t.state.expansionStderr||"")+`bash: line ${p}: ${o}: bad array subscript
766
+ `,"";let m=Math.max(...f.map(([d])=>typeof d=="number"?d:0))+1+c;return m<0?(t.state.expansionStderr=(t.state.expansionStderr||"")+`bash: line ${p}: ${o}: bad array subscript
767
+ `,""):Ct(t.state.env.get(`${o}_${m}`))}let u=t.state.env.get(`${o}_${c}`);if(u!==void 0)return R(u);if(c===0){let f=t.state.env.get(o);if(f!==void 0)return R(f)}if(n&&t.state.options.nounset)throw new It(`${o}[${c}]`);return""}if(/^[1-9][0-9]*$/.test(e)){let o=t.state.env.get(e);if(o===void 0&&n&&t.state.options.nounset)throw new It(e);return Ct(o)}if(_e(t,e)){let o=bt(t,e);if(o===void 0)return"";if(o!==e)return await Oe(t,o,n,r);let a=t.state.env.get(e),l=Ct(a);if((a===void 0||l==="")&&n&&t.state.options.nounset)throw new It(e);return l}let i=t.state.env.get(e);if(i!==void 0)return t.state.tempEnvBindings?.some(o=>o.has(e))&&(t.state.accessedTempEnvVars=t.state.accessedTempEnvVars||new Set,t.state.accessedTempEnvVars.add(e)),R(i);if(Mn(t,e)){let o=t.state.env.get(`${e}_0`);return o!==void 0?R(o):""}if(n&&t.state.options.nounset)throw new It(e);return""}function x2(t,e){if(/^[?$#@_\-*!]$/.test(e)||/^(PWD|OLDPWD|PPID|UID|EUID|RANDOM|SECONDS|BASH_VERSION|BASHPID|LINENO|FUNCNAME|BASH_LINENO|BASH_SOURCE|0)$/.test(e)||e.includes("[")||_e(t,e))return null;let n=t.state.env.get(e);return n!==void 0?(t.state.tempEnvBindings?.some(r=>r.has(e))&&(t.state.accessedTempEnvVars=t.state.accessedTempEnvVars||new Set,t.state.accessedTempEnvVars.add(e)),n):(/^[1-9][0-9]*$/.test(e),null)}async function vn(t,e){if(new Set(["?","$","#","_","-","0","PPID","UID","EUID","RANDOM","SECONDS","BASH_VERSION","!","BASHPID","LINENO"]).has(e))return!0;if(e==="@"||e==="*")return Number.parseInt(Ct(t.state.env.get("#"),"0"),10)>0;if(e==="PWD"||e==="OLDPWD")return t.state.env.has(e);let r=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(r){let s=r[1],i=r[2];if(_e(t,s)){let l=bt(t,s);if(l&&l!==s){if(l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return!1;s=l}}if(i==="@"||i==="*")return me(t,s).length>0?!0:t.state.env.has(s);if(t.state.associativeArrays?.has(s)){let l=go(i);return t.state.env.has(`${s}_${l}`)}let a;if(/^-?\d+$/.test(i))a=Number.parseInt(i,10);else try{let l=new ye,c=Te(l,i);a=await ue(t,c.expression)}catch{let l=t.state.env.get(i);a=l?Number.parseInt(R(l),10):0,Number.isNaN(a)&&(a=0)}if(a<0){let l=me(t,s);if(l.length===0)return!1;let u=Math.max(...l.map(([f])=>typeof f=="number"?f:0))+1+a;return u<0?!1:t.state.env.has(`${s}_${u}`)}return t.state.env.has(`${s}_${a}`)}if(_e(t,e)){let s=bt(t,e);return s===void 0||s===e?t.state.env.has(e):vn(t,s)}return!!(t.state.env.has(e)||Mn(t,e))}var Ht=I(()=>{"use strict";St();it();oo();F();$t();Ne();on();Xt();an()});async function E2(t,e){let n="",r=0;for(;r<e.length;){if(e[r]==="$"){if(e[r+1]==="{"){let s=1,i=r+2;for(;i<e.length&&s>0;)e[i]==="{"?s++:e[i]==="}"&&s--,i++;n+=e.slice(r,i),r=i;continue}if(e[r+1]==="("){let s=1,i=r+2;for(;i<e.length&&s>0;)e[i]==="("?s++:e[i]===")"&&s--,i++;n+=e.slice(r,i),r=i;continue}if(/[a-zA-Z_]/.test(e[r+1]||"")){let s=r+1;for(;s<e.length&&/[a-zA-Z0-9_]/.test(e[s]);)s++;let i=e.slice(r+1,s),o=await Oe(t,i);n+=o,r=s;continue}if(/[0-9]/.test(e[r+1]||"")){let s=r+1;for(;s<e.length&&/[0-9]/.test(e[s]);)s++;let i=e.slice(r+1,s),o=await Oe(t,i);n+=o,r=s;continue}if(/[*@#?\-!$]/.test(e[r+1]||"")){let s=e[r+1],i=await Oe(t,s);n+=i,r+=2;continue}}if(e[r]==='"'){for(n+='"',r++;r<e.length&&e[r]!=='"';)if(e[r]==="$"&&/[a-zA-Z_]/.test(e[r+1]||"")){let s=r+1;for(;s<e.length&&/[a-zA-Z0-9_]/.test(e[s]);)s++;let i=e.slice(r+1,s),o=await Oe(t,i);n+=o,r=s}else e[r]==="\\"?(n+=e[r],r++,r<e.length&&(n+=e[r],r++)):(n+=e[r],r++);r<e.length&&(n+='"',r++);continue}n+=e[r],r++}return n}async function Ac(t,e){let n=e,r=e.startsWith('"')&&e.endsWith('"'),s=e.startsWith("'")&&e.endsWith("'");if((r||s)&&(n=e.slice(1,-1)),s)return n;let i="",o=0;for(;o<n.length;)if(n[o]==="$")if(n[o+1]==="("){let a=1,l=o+2;for(;l<n.length&&a>0;)n[l]==="("&&n[l-1]==="$"||n[l]==="("?a++:n[l]===")"&&a--,l++;let c=n.slice(o+2,l-1);if(t.execFn){let u=await t.execFn(c);i+=R(u.stdout).replace(/\n+$/,""),Mt(u.stderr)||(t.state.expansionStderr=(t.state.expansionStderr||"")+R(u.stderr))}o=l}else if(n[o+1]==="{"){let a=1,l=o+2;for(;l<n.length&&a>0;)n[l]==="{"?a++:n[l]==="}"&&a--,l++;let c=n.slice(o+2,l-1),u=await Oe(t,c);i+=u,o=l}else if(/[a-zA-Z_]/.test(n[o+1]||"")){let a=o+1;for(;a<n.length&&/[a-zA-Z0-9_]/.test(n[a]);)a++;let l=n.slice(o+1,a),c=await Oe(t,l);i+=c,o=a}else i+=n[o],o++;else if(n[o]==="`"){let a=o+1;for(;a<n.length&&n[a]!=="`";)a++;let l=n.slice(o+1,a);if(t.execFn){let c=await t.execFn(l);i+=R(c.stdout).replace(/\n+$/,""),Mt(c.stderr)||(t.state.expansionStderr=(t.state.expansionStderr||"")+R(c.stderr))}o=a+1}else i+=n[o],o++;return i}var A2=I(()=>{"use strict";F();Ht()});function _x(t,e,n,r,s){let i=n??1;i===0&&(i=1);let o=Math.abs(i),a=[],l=0;r?.match(/^-?0\d/)&&(l=Math.max(l,r.replace(/^-/,"").length)),s?.match(/^-?0\d/)&&(l=Math.max(l,s.replace(/^-/,"").length));let c=u=>{if(l>0){let f=u<0,p=String(Math.abs(u)).padStart(l,"0");return f?`-${p}`:p}return String(u)};if(t<=e)for(let u=t,f=0;u<=e&&f<xo;u+=o,f++)a.push(c(u));else for(let u=t,f=0;u>=e&&f<xo;u-=o,f++)a.push(c(u));return a}function Mx(t,e,n){let r=n??1;r===0&&(r=1);let s=t.charCodeAt(0),i=e.charCodeAt(0),o=Math.abs(r),a=t>="A"&&t<="Z",l=t>="a"&&t<="z",c=e>="A"&&e<="Z",u=e>="a"&&e<="z";if(a&&u||l&&c){let p=n!==void 0?`..${n}`:"";throw new Tr(`{${t}..${e}${p}}: invalid sequence`)}let f=[];if(s<=i)for(let p=s,h=0;p<=i&&h<xo;p+=o,h++)f.push(String.fromCharCode(p));else for(let p=s,h=0;p>=i&&h<xo;p-=o,h++)f.push(String.fromCharCode(p));return f}function Sc(t,e,n,r,s){let i=n!==void 0?`..${n}`:"";return typeof t=="number"&&typeof e=="number"?{expanded:_x(t,e,n,r,s),literal:`{${t}..${e}${i}}`}:typeof t=="string"&&typeof e=="string"?{expanded:Mx(t,e,n),literal:`{${t}..${e}${i}}`}:{expanded:null,literal:`{${t}..${e}${i}}`}}var xo,S2=I(()=>{"use strict";Ne();xo=1e4});function C2(t){if(t.statements.length!==1)return null;let e=t.statements[0];if(e.operators.length!==0||e.pipelines.length!==1)return null;let n=e.pipelines[0];if(n.negated||n.commands.length!==1)return null;let r=n.commands[0];if(r.type!=="SimpleCommand")return null;let s=r;if(s.name!==null||s.args.length!==0||s.assignments.length!==0||s.redirections.length!==1)return null;let i=s.redirections[0];return i.operator!=="<"||i.target.type!=="Word"?null:{target:i.target}}var N2=I(()=>{"use strict"});function kn(t,e){return!!(/[*?[]/.test(t)||e&&/[@*+?!]\(/.test(t))}function Cc(t){let e="",n=0;for(;n<t.length;)t[n]==="\\"&&n+1<t.length?(e+=t[n+1],n+=2):(e+=t[n],n++);return e}function Nt(t){return t.replace(/([*?[\]\\()|])/g,"\\$1")}function Jr(t){return t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var es=I(()=>{"use strict"});function Ie(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ts=I(()=>{"use strict"});function Ce(t,e,n=!1){let r="",s=0;for(;s<t.length;){let i=t[s];if(n&&(i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&s+1<t.length&&t[s+1]==="("){let o=Lx(t,s+1);if(o!==-1){let a=t.slice(s+2,o),c=Fx(a).map(f=>Ce(f,e,n)),u=c.length>0?c.join("|"):"(?:)";i==="@"?r+=`(?:${u})`:i==="*"?r+=`(?:${u})*`:i==="+"?r+=`(?:${u})+`:i==="?"?r+=`(?:${u})?`:i==="!"&&(r+=`(?!(?:${u})$).*`),s=o+1;continue}}if(i==="\\")if(s+1<t.length){let o=t[s+1];/[\\^$.|+(){}[\]*?]/.test(o)?r+=`\\${o}`:r+=o,s+=2}else r+="\\\\",s++;else if(i==="*")r+=e?".*":".*?",s++;else if(i==="?")r+=".",s++;else if(i==="["){let o=Ux(t,s);if(o===-1)r+="\\[",s++;else{let a=t.slice(s+1,o);r+=Bx(a),s=o+1}}else/[\^$.|+(){}]/.test(i)?(r+=`\\${i}`,s++):(r+=i,s++)}return r}function Lx(t,e){let n=1,r=e+1;for(;r<t.length&&n>0;){let s=t[r];if(s==="\\"){r+=2;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function Fx(t){let e=[],n="",r=0,s=0;for(;s<t.length;){let i=t[s];if(i==="\\"){n+=i,s+1<t.length?(n+=t[s+1],s+=2):s++;continue}i==="("?(r++,n+=i):i===")"?(r--,n+=i):i==="|"&&r===0?(e.push(n),n=""):n+=i,s++}return e.push(n),e}function Ux(t,e){let n=e+1;for(n<t.length&&t[n]==="^"&&n++,n<t.length&&t[n]==="]"&&n++;n<t.length;){if(t[n]==="\\"&&n+1<t.length){n+=2;continue}if(t[n]==="]")return n;if(t[n]==="'"){let r=t.indexOf("'",n+1);if(r!==-1){n=r+1;continue}}if(t[n]==="["&&n+1<t.length&&t[n+1]===":"){let r=t.indexOf(":]",n+2);if(r!==-1){n=r+2;continue}}n++}return-1}function Bx(t){let e="[",n=0;for((t[0]==="^"||t[0]==="!")&&(e+="^",n++);n<t.length;){if(t[n]==="'"){let s=t.indexOf("'",n+1);if(s!==-1){let i=t.slice(n+1,s);for(let o of i)o==="\\"?e+="\\\\":o==="]"?e+="\\]":o==="^"&&e==="["?e+="\\^":e+=o;n=s+1;continue}}if(t[n]==="["&&n+1<t.length&&t[n+1]===":"){let s=t.indexOf(":]",n+2);if(s!==-1){let i=t.slice(n+2,s);e+=zx(i),n=s+2;continue}}let r=t[n];r==="\\"?n+1<t.length?(e+=`\\${t[n+1]}`,n+=2):(e+="\\\\",n++):r==="-"&&n>0&&n<t.length-1?(e+="-",n++):r==="^"&&n===0?(e+="^",n++):(r==="]"&&n===0?e+="\\]":e+=r,n++)}return e+="]",e}function zx(t){return Wx.get(t)??""}var Wx,ns=I(()=>{"use strict";Wx=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]])});function Ln(t,e,n,r){if(n==="prefix")return ee(`^${e}`,"s").replace(t,"");let s=ee(`${e}$`,"s");if(r)return s.replace(t,"");for(let i=t.length;i>=0;i--){let o=t.slice(i);if(s.test(o))return t.slice(0,i)}return t}function rs(t,e){let n=Array.from(t.state.env.keys()),r=new Set,s=t.state.associativeArrays??new Set,i=new Set;for(let a of n){let l=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);l&&i.add(l[1]);let c=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);c&&i.add(c[1])}let o=a=>{for(let l of s){let c=`${l}_`;if(a.startsWith(c)&&a!==l)return!0}return!1};for(let a of n)if(a.startsWith(e))if(a.includes("__")){let l=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);l?.[1].startsWith(e)&&r.add(l[1])}else if(/_\d+$/.test(a)){let l=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);l?.[1].startsWith(e)&&r.add(l[1])}else o(a)||r.add(a);return[...r].sort()}var Er=I(()=>{"use strict";Ve()});function Hx(t,e){let n=(i,o=2)=>String(i).padStart(o,"0");if(t===""){let i=n(e.getHours()),o=n(e.getMinutes()),a=n(e.getSeconds());return`${i}:${o}:${a}`}let r="",s=0;for(;s<t.length;)if(t[s]==="%"){if(s+1>=t.length){r+="%",s++;continue}let i=t[s+1];switch(i){case"H":r+=n(e.getHours());break;case"M":r+=n(e.getMinutes());break;case"S":r+=n(e.getSeconds());break;case"d":r+=n(e.getDate());break;case"m":r+=n(e.getMonth()+1);break;case"Y":r+=e.getFullYear();break;case"y":r+=n(e.getFullYear()%100);break;case"I":{let o=e.getHours()%12;o===0&&(o=12),r+=n(o);break}case"p":r+=e.getHours()<12?"AM":"PM";break;case"P":r+=e.getHours()<12?"am":"pm";break;case"%":r+="%";break;case"a":{r+=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.getDay()];break}case"b":{r+=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()];break}default:r+=`%${i}`}s+=2}else r+=t[s],s++;return r}function zs(t,e){let n="",r=0,s=t.state.env.has("USER")?$(t.state.env,"USER"):$(t.state.env,"LOGNAME","user"),i=$(t.state.env,"HOSTNAME","localhost"),o=i.split(".")[0],a=$(t.state.env,"PWD","/"),l=$(t.state.env,"HOME","/"),c=a.startsWith(l)?`~${a.slice(l.length)}`:a,u=a.split("/").pop()||a,f=new Date,p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=$(t.state.env,"__COMMAND_NUMBER","1");for(;r<e.length;){let d=e[r];if(d==="\\"){if(r+1>=e.length){n+="\\",r++;continue}let g=e[r+1];if(g>="0"&&g<="7"){let w="",E=r+1;for(;E<e.length&&E<r+4&&e[E]>="0"&&e[E]<="7";)w+=e[E],E++;let b=Number.parseInt(w,8)%256;n+=String.fromCharCode(b),r=E;continue}switch(g){case"\\":n+="\\",r+=2;break;case"a":n+="\x07",r+=2;break;case"e":n+="\x1B",r+=2;break;case"n":n+=`
768
+ `,r+=2;break;case"r":n+="\r",r+=2;break;case"$":n+="$",r+=2;break;case"[":case"]":r+=2;break;case"u":n+=s,r+=2;break;case"h":n+=o,r+=2;break;case"H":n+=i,r+=2;break;case"w":n+=c,r+=2;break;case"W":n+=u,r+=2;break;case"d":{let w=String(f.getDate()).padStart(2," ");n+=`${p[f.getDay()]} ${h[f.getMonth()]} ${w}`,r+=2;break}case"t":{let w=String(f.getHours()).padStart(2,"0"),E=String(f.getMinutes()).padStart(2,"0"),b=String(f.getSeconds()).padStart(2,"0");n+=`${w}:${E}:${b}`,r+=2;break}case"T":{let w=f.getHours()%12;w===0&&(w=12);let E=String(w).padStart(2,"0"),b=String(f.getMinutes()).padStart(2,"0"),A=String(f.getSeconds()).padStart(2,"0");n+=`${E}:${b}:${A}`,r+=2;break}case"@":{let w=f.getHours()%12;w===0&&(w=12);let E=String(w).padStart(2,"0"),b=String(f.getMinutes()).padStart(2,"0"),A=f.getHours()<12?"AM":"PM";n+=`${E}:${b} ${A}`,r+=2;break}case"A":{let w=String(f.getHours()).padStart(2,"0"),E=String(f.getMinutes()).padStart(2,"0");n+=`${w}:${E}`,r+=2;break}case"D":if(r+2<e.length&&e[r+2]==="{"){let w=e.indexOf("}",r+3);if(w!==-1){let E=e.slice(r+3,w);n+=Hx(E,f),r=w+1}else n+="\\D",r+=2}else n+="\\D",r+=2;break;case"s":n+="bash",r+=2;break;case"v":n+="5.0",r+=2;break;case"V":n+="5.0.0",r+=2;break;case"j":n+="0",r+=2;break;case"l":n+="tty",r+=2;break;case"#":n+=m,r+=2;break;case"!":n+=m,r+=2;break;case"x":n+="\\x",r+=2;break;default:n+=`\\${g}`,r+=2}}else n+=d,r++}return n}var Nc=I(()=>{"use strict";F()});function Zn(t){if(t==="")return"''";if(/[\n\r\t\x00-\x1f\x7f']/.test(t)){let n="$'";for(let r of t)switch(r){case"'":n+="\\'";break;case"\\":n+="\\\\";break;case`
769
+ `:n+="\\n";break;case"\r":n+="\\r";break;case" ":n+="\\t";break;default:{let s=r.charCodeAt(0);s<32||s===127?n+=`\\${s.toString(8).padStart(3,"0")}`:n+=r}}return`${n}'`}return`'${t}'`}var vc=I(()=>{"use strict"});function jt(t,e){t.state.readonlyVars=t.state.readonlyVars||new Set,t.state.readonlyVars.add(e)}function In(t,e){return t.state.readonlyVars?.has(e)??!1}function ht(t,e,n="bash"){if(In(t,e)){let r=`${n}: ${e}: readonly variable
770
+ `;throw new Ee(1,y,x(r))}return null}function dn(t,e){let n=t.state.exportedVars?.has(e)??!1;if(t.state.exportedVars=t.state.exportedVars||new Set,t.state.exportedVars.add(e),t.state.localScopes.length>0&&t.state.localScopes[t.state.localScopes.length-1].has(e)&&!n){for(t.state.localExportedVars||(t.state.localExportedVars=[]);t.state.localExportedVars.length<t.state.localScopes.length;)t.state.localExportedVars.push(new Set);t.state.localExportedVars[t.state.localExportedVars.length-1].add(e)}}function Eo(t,e){t.state.exportedVars?.delete(e)}var Yn=I(()=>{"use strict";F();Ne()});function Qn(t,e){if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))return"";let n="",r=t.state.env.has(`${e}__length`)||Array.from(t.state.env.keys()).some(i=>i.startsWith(`${e}_`)&&/^[0-9]+$/.test(i.slice(e.length+1))),s=t.state.associativeArrays?.has(e)??!1;return r&&!s&&(n+="a"),s&&(n+="A"),t.state.integerVars?.has(e)&&(n+="i"),_e(t,e)&&(n+="n"),In(t,e)&&(n+="r"),t.state.exportedVars?.has(e)&&(n+="x"),n}var Ao=I(()=>{"use strict";an();Yn()});async function v2(t,e,n,r){return t.coverage?.hit("bash:expansion:default_value"),(n.isUnset||e.checkEmpty&&n.isEmpty)&&e.word?r(t,e.word.parts,n.inDoubleQuotes):n.effectiveValue}async function k2(t,e,n,r,s){if(t.coverage?.hit("bash:expansion:assign_default"),(r.isUnset||n.checkEmpty&&r.isEmpty)&&n.word){let o=await s(t,n.word.parts,r.inDoubleQuotes),a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(a){let[,l,c]=a,u;if(/^\d+$/.test(c))u=Number.parseInt(c,10);else{try{let p=new ye,h=Te(p,c);u=await ue(t,h.expression)}catch{let p=t.state.env.get(c);u=p?Number.parseInt(R(p),10):0}Number.isNaN(u)&&(u=0)}T(t.state.env,`${l}_${u}`,o);let f=Number.parseInt($(t.state.env,`${l}__length`,"0"),10);u>=f&&T(t.state.env,`${l}__length`,String(u+1))}else T(t.state.env,e,o);return o}return r.effectiveValue}async function I2(t,e,n,r,s){if(t.coverage?.hit("bash:expansion:error_if_unset"),r.isUnset||n.checkEmpty&&r.isEmpty){let o=n.word?await s(t,n.word.parts,r.inDoubleQuotes):`${e}: parameter null or not set`;throw new Ee(1,y,x(`bash: ${o}
771
+ `))}return r.effectiveValue}async function T2(t,e,n,r){return t.coverage?.hit("bash:expansion:use_alternative"),!(n.isUnset||e.checkEmpty&&n.isEmpty)&&e.word?r(t,e.word.parts,n.inDoubleQuotes):""}async function O2(t,e,n,r,s){t.coverage?.hit("bash:expansion:pattern_removal");let i="",o=t.state.shoptOptions.extglob;if(n.pattern)for(let l of n.pattern.parts)if(l.type==="Glob")i+=Ce(l.pattern,n.greedy,o);else if(l.type==="Literal")i+=Ce(l.value,n.greedy,o);else if(l.type==="SingleQuoted"||l.type==="Escaped")i+=Ie(l.value);else if(l.type==="DoubleQuoted"){let c=await r(t,l.parts);i+=Ie(c)}else if(l.type==="ParameterExpansion"){let c=await s(t,l);i+=Ce(c,n.greedy,o)}else{let c=await s(t,l);i+=Ie(c)}if(n.side==="prefix")return ee(`^${i}`,"s").replace(e,"");let a=ee(`${i}$`,"s");if(n.greedy)return a.replace(e,"");for(let l=e.length;l>=0;l--){let c=e.slice(l);if(a.test(c))return e.slice(0,l)}return e}async function R2(t,e,n,r,s){t.coverage?.hit("bash:expansion:pattern_replacement");let i="",o=t.state.shoptOptions.extglob;if(n.pattern)for(let c of n.pattern.parts)if(c.type==="Glob")i+=Ce(c.pattern,!0,o);else if(c.type==="Literal")i+=Ce(c.value,!0,o);else if(c.type==="SingleQuoted"||c.type==="Escaped")i+=Ie(c.value);else if(c.type==="DoubleQuoted"){let u=await r(t,c.parts);i+=Ie(u)}else if(c.type==="ParameterExpansion"){let u=await s(t,c);i+=Ce(u,!0,o)}else{let u=await s(t,c);i+=Ie(u)}let a=n.replacement?await r(t,n.replacement.parts):"";if(n.anchor==="start"?i=`^${i}`:n.anchor==="end"&&(i=`${i}$`),i==="")return e;let l=n.all?"gs":"s";try{let c=ee(i,l);if(n.all){let u="",f=0,p=c.exec(e);for(;p!==null&&!(p[0].length===0&&p.index===e.length);)u+=e.slice(f,p.index)+a,f=p.index+p[0].length,p[0].length===0&&f++,p=c.exec(e);return u+=e.slice(f),u}return c.replace(e,a)}catch{return e}}function P2(t,e,n){t.coverage?.hit("bash:expansion:length");let r=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(r){let s=r[1],i=me(t,s);return i.length>0?String(i.length):t.state.env.has(s)?"1":"0"}if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)&&Mn(t,e)){if(e==="FUNCNAME"){let i=t.state.funcNameStack?.[0]||"";return String([...i].length)}if(e==="BASH_LINENO"){let i=t.state.callLineStack?.[0];return String(i!==void 0?[...String(i)].length:0)}let s=$(t.state.env,`${e}_0`);return String([...s].length)}return String([...n].length)}async function $2(t,e,n,r){t.coverage?.hit("bash:expansion:substring");let s=await ue(t,r.offset.expression),i=r.length?await ue(t,r.length.expression):void 0;if(e==="@"||e==="*"){let c=Number.parseInt($(t.state.env,"#","0"),10),u=[];for(let m=1;m<=c;m++)u.push($(t.state.env,String(m)));let f=$(t.state.env,"0","bash"),p,h;if(s<=0)if(p=[f,...u],s<0){if(h=p.length+s,h<0)return""}else h=0;else p=u,h=s-1;if(h<0||h>=p.length)return"";if(i!==void 0){let m=i<0?p.length+i:h+i;return p.slice(h,Math.max(h,m)).join(" ")}return p.slice(h).join(" ")}let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(o){let c=o[1];if(t.state.associativeArrays?.has(c))throw new Ee(1,y,x(`bash: \${${c}[@]: 0: 3}: bad substitution
772
+ `));let u=me(t,c),f=0;if(s<0){if(u.length>0){let p=u[u.length-1][0],m=(typeof p=="number"?p:0)+1+s;if(m<0||(f=u.findIndex(([d])=>typeof d=="number"&&d>=m),f<0))return""}}else if(f=u.findIndex(([p])=>typeof p=="number"&&p>=s),f<0)return"";if(i!==void 0){if(i<0)throw new Be(`${o[1]}[@]: substring expression < 0`);return u.slice(f,f+i).map(([,p])=>p).join(" ")}return u.slice(f).map(([,p])=>p).join(" ")}let a=[...n],l=s;if(l<0&&(l=Math.max(0,a.length+l)),i!==void 0){if(i<0){let c=a.length+i;return a.slice(l,Math.max(l,c)).join("")}return a.slice(l,l+i).join("")}return a.slice(l).join("")}async function D2(t,e,n,r,s){if(t.coverage?.hit("bash:expansion:case_modification"),n.pattern){let i=t.state.shoptOptions.extglob,o="";for(let f of n.pattern.parts)if(f.type==="Glob")o+=Ce(f.pattern,!0,i);else if(f.type==="Literal")o+=Ce(f.value,!0,i);else if(f.type==="SingleQuoted"||f.type==="Escaped")o+=Ie(f.value);else if(f.type==="DoubleQuoted"){let p=await r(t,f.parts);o+=Ie(p)}else if(f.type==="ParameterExpansion"){let p=await s(t,f);o+=Ce(p,!0,i)}let a=ee(`^(?:${o})$`),l=n.direction==="upper"?f=>f.toUpperCase():f=>f.toLowerCase(),c="",u=!1;for(let f of e)!n.all&&u?c+=f:a.test(f)?(c+=l(f),u=!0):c+=f;return c}return n.direction==="upper"?n.all?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1):n.all?e.toLowerCase():e.charAt(0).toLowerCase()+e.slice(1)}function _2(t,e,n,r,s){t.coverage?.hit("bash:expansion:transform");let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(i&&s.operator==="Q")return me(t,i[1]).map(([,c])=>Zn(c)).join(" ");if(i&&s.operator==="a")return Qn(t,i[1]);let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[.+\]$/);if(o&&s.operator==="a")return Qn(t,o[1]);switch(s.operator){case"Q":return r?"":Zn(n);case"P":return zs(t,n);case"a":return Qn(t,e);case"A":return r?"":`${e}=${Zn(n)}`;case"E":return n.replace(/\\([\\abefnrtv'"?])/g,(a,l)=>{switch(l){case"\\":return"\\";case"a":return"\x07";case"b":return"\b";case"e":return"\x1B";case"f":return"\f";case"n":return`
773
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"'":return"'";case'"':return'"';case"?":return"?";default:return l}});case"K":case"k":return r?"":Zn(n);case"u":return n.charAt(0).toUpperCase()+n.slice(1);case"U":return n.toUpperCase();case"L":return n.toLowerCase();default:return n}}async function M2(t,e,n,r,s,i,o=!1){if(t.coverage?.hit("bash:expansion:indirection"),_e(t,e))return xr(t,e)||"";let a=/^[a-zA-Z_][a-zA-Z0-9_]*\[([@*])\]$/.test(e);if(r){if(s.innerOp?.type==="UseAlternative")return"";throw new Tt(`\${!${e}}`)}let l=n;if(a&&(l===""||l.includes(" ")))throw new Tt(`\${!${e}}`);let c=l.match(/^[a-zA-Z_][a-zA-Z0-9_]*\[(.+)\]$/);if(c&&c[1].includes("~"))throw new Tt(`\${!${e}}`);if(s.innerOp){let u={type:"ParameterExpansion",parameter:l,operation:s.innerOp};return i(t,u,o)}return await Oe(t,l)}function L2(t,e){t.coverage?.hit("bash:expansion:array_keys");let r=me(t,e.array).map(([s])=>String(s));return e.star?r.join(be(t.state.env)):r.join(" ")}function F2(t,e){t.coverage?.hit("bash:expansion:var_name_prefix");let n=rs(t,e.prefix);return e.star?n.join(be(t.state.env)):n.join(" ")}function U2(t,e,n,r){let s=Number.parseInt($(t.state.env,"#","0"),10),i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(e==="*")return{isEmpty:s===0,effectiveValue:n};if(e==="@")return{isEmpty:s===0||s===1&&$(t.state.env,"1")==="",effectiveValue:n};if(i){let[,o,a]=i,l=me(t,o);if(l.length===0)return{isEmpty:!0,effectiveValue:""};if(a==="*"){let c=be(t.state.env),u=l.map(([,f])=>f).join(c);return{isEmpty:r?u==="":!1,effectiveValue:u}}return{isEmpty:l.length===1&&l.every(([,c])=>c===""),effectiveValue:l.map(([,c])=>c).join(" ")}}return{isEmpty:n==="",effectiveValue:n}}var B2=I(()=>{"use strict";St();it();Ve();F();$t();Ne();Xt();an();ts();ns();Er();Nc();vc();Ht();Ao()});function W2(t){let e=0;for(;e<t.length;){let n=t[e];if(n==="\\"&&e+1<t.length){e+=2;continue}if(n==="'"){let r=t.indexOf("'",e+1);if(r!==-1){e=r+1;continue}}if(n==="$"&&e+1<t.length&&t[e+1]==="("||n==="`")return!0;e++}return!1}function z2(t,e){let n=1,r=e,s=!1,i=!1;for(;r<t.length&&n>0;){let o=t[r];if(o==="\\"&&!s&&r+1<t.length){r+=2;continue}if(o==="'"&&!i){s=!s,r++;continue}if(o==='"'&&!s){i=!i,r++;continue}if(!s&&!i){if(o==="(")n++;else if(o===")"&&(n--,n===0))return r}r++}return-1}async function So(t,e){let n=new ye,r;try{r=n.parse(e)}catch{return""}let s=t.state.bashPid;t.state.bashPid=t.state.nextVirtualPid++;let i=new Map(t.state.env),o=t.state.cwd,a=t.state.suppressVerbose;t.state.suppressVerbose=!0;try{let l=await t.executeScript(r),c=l.exitCode;return t.state.env=i,t.state.cwd=o,t.state.suppressVerbose=a,t.state.lastExitCode=c,T(t.state.env,"?",String(c)),Mt(l.stderr)||(t.state.expansionStderr=(t.state.expansionStderr||"")+R(l.stderr)),t.state.bashPid=s,R(l.stdout).replace(/\n+$/,"")}catch(l){if(t.state.env=i,t.state.cwd=o,t.state.bashPid=s,t.state.suppressVerbose=a,l instanceof ae)throw l;return l instanceof Ee?(t.state.lastExitCode=l.exitCode,T(t.state.env,"?",String(l.exitCode)),l.stdout?R(l.stdout).replace(/\n+$/,""):""):""}}function kc(t,e){let n="",r=0;for(;r<e.length;){let s=e[r];if(s==="'"){let i=e.indexOf("'",r+1);if(i!==-1){let o=e.slice(r+1,i);n+=Nt(o),r=i+1;continue}}if(s==='"'){let i=-1,o=r+1;for(;o<e.length;){if(e[o]==="\\"){o+=2;continue}if(e[o]==='"'){i=o;break}o++}if(i!==-1){let a=e.slice(r+1,i),l=jx(t,a);n+=Nt(l),r=i+1;continue}}if(s==="$"&&r+1<e.length){let i=e[r+1];if(i==="{"){let o=e.indexOf("}",r+2);if(o!==-1){let a=e.slice(r+2,o);n+=$(t.state.env,a),r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<e.length&&/[a-zA-Z0-9_]/.test(e[o]);)o++;let a=e.slice(r+1,o);n+=$(t.state.env,a),r=o;continue}}if(s==="\\"&&r+1<e.length){n+=s+e[r+1],r+=2;continue}n+=s,r++}return n}function jx(t,e){let n="",r=0;for(;r<e.length;){let s=e[r];if(s==="\\"&&r+1<e.length){let i=e[r+1];if(i==="$"||i==="`"||i==="\\"||i==='"'){n+=i,r+=2;continue}n+=s,r++;continue}if(s==="$"&&r+1<e.length){let i=e[r+1];if(i==="{"){let o=e.indexOf("}",r+2);if(o!==-1){let a=e.slice(r+2,o);n+=$(t.state.env,a),r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<e.length&&/[a-zA-Z0-9_]/.test(e[o]);)o++;let a=e.slice(r+1,o);n+=$(t.state.env,a),r=o;continue}}n+=s,r++}return n}async function H2(t,e){let n="",r=0;for(;r<e.length;){let s=e[r];if(s==="'"){let i=e.indexOf("'",r+1);if(i!==-1){let o=e.slice(r+1,i);n+=Nt(o),r=i+1;continue}}if(s==='"'){let i=-1,o=r+1;for(;o<e.length;){if(e[o]==="\\"){o+=2;continue}if(e[o]==='"'){i=o;break}o++}if(i!==-1){let a=e.slice(r+1,i),l=await Gx(t,a);n+=Nt(l),r=i+1;continue}}if(s==="$"&&r+1<e.length&&e[r+1]==="("){let i=z2(e,r+2);if(i!==-1){let o=e.slice(r+2,i),a=await So(t,o);n+=a,r=i+1;continue}}if(s==="`"){let i=e.indexOf("`",r+1);if(i!==-1){let o=e.slice(r+1,i),a=await So(t,o);n+=a,r=i+1;continue}}if(s==="$"&&r+1<e.length){let i=e[r+1];if(i==="{"){let o=e.indexOf("}",r+2);if(o!==-1){let a=e.slice(r+2,o);n+=$(t.state.env,a),r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<e.length&&/[a-zA-Z0-9_]/.test(e[o]);)o++;let a=e.slice(r+1,o);n+=$(t.state.env,a),r=o;continue}}if(s==="\\"&&r+1<e.length){n+=s+e[r+1],r+=2;continue}n+=s,r++}return n}async function Gx(t,e){let n="",r=0;for(;r<e.length;){let s=e[r];if(s==="\\"&&r+1<e.length){let i=e[r+1];if(i==="$"||i==="`"||i==="\\"||i==='"'){n+=i,r+=2;continue}n+=s,r++;continue}if(s==="$"&&r+1<e.length&&e[r+1]==="("){let i=z2(e,r+2);if(i!==-1){let o=e.slice(r+2,i),a=await So(t,o);n+=a,r=i+1;continue}}if(s==="`"){let i=e.indexOf("`",r+1);if(i!==-1){let o=e.slice(r+1,i),a=await So(t,o);n+=a,r=i+1;continue}}if(s==="$"&&r+1<e.length){let i=e[r+1];if(i==="{"){let o=e.indexOf("}",r+2);if(o!==-1){let a=e.slice(r+2,o);n+=$(t.state.env,a),r=o+1;continue}}else if(/[a-zA-Z_]/.test(i)){let o=r+1;for(;o<e.length&&/[a-zA-Z0-9_]/.test(e[o]);)o++;let a=e.slice(r+1,o);n+=$(t.state.env,a),r=o;continue}}n+=s,r++}return n}var j2=I(()=>{"use strict";it();F();Ne();es()});function G2(t,e){if(!e.startsWith("~"))return e;t.coverage?.hit("bash:expansion:tilde");let n=t.state.env.has("HOME")?$(t.state.env,"HOME"):"/home/user";if(e==="~"||e.startsWith("~/"))return n+e.slice(1);let r=1;for(;r<e.length&&/[a-zA-Z0-9_-]/.test(e[r]);)r++;let s=e.slice(1,r),i=e.slice(r);return i!==""&&!i.startsWith("/")?e:s==="root"?`/root${i}`:e}var V2=I(()=>{"use strict";F()});async function Vx(t,e,n,r){let s="";for(let i of e.parts)if(i.type==="Glob")s+=Ce(i.pattern,!0,t.state.shoptOptions.extglob);else if(i.type==="Literal")s+=Ce(i.value,!0,t.state.shoptOptions.extglob);else if(i.type==="SingleQuoted"||i.type==="Escaped")s+=Ie(i.value);else if(i.type==="DoubleQuoted"){let o=await n(t,i.parts);s+=Ie(o)}else if(i.type==="ParameterExpansion"){let o=await r(t,i);s+=Ce(o,!0,t.state.shoptOptions.extglob)}else{let o=await r(t,i);s+=Ie(o)}return s}async function q2(t,e,n,r){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let s=e[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion"||s.parts[0].operation?.type!=="PatternReplacement")return null;let i=s.parts[0],o=i.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!o)return null;let a=o[1],l=o[2]==="*",c=i.operation,u=me(t,a),f=u.map(([,g])=>g);if(u.length===0&&t.state.env.has(a)&&f.push($(t.state.env,a)),f.length===0)return{values:[],quoted:!0};let p="";c.pattern&&(p=await Vx(t,c.pattern,n,r));let h=c.replacement?await n(t,c.replacement.parts):"",m=p;c.anchor==="start"?m=`^${p}`:c.anchor==="end"&&(m=`${p}$`);let d=[];try{let g=ee(m,c.all?"g":"");for(let w of f)d.push(g.replace(w,h))}catch{d.push(...f)}if(l){let g=be(t.state.env);return{values:[d.join(g)],quoted:!0}}return{values:d,quoted:!0}}async function Z2(t,e,n,r){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let s=e[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion"||s.parts[0].operation?.type!=="PatternRemoval")return null;let i=s.parts[0],o=i.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!o)return null;let a=o[1],l=o[2]==="*",c=i.operation,u=me(t,a),f=u.map(([,d])=>d);if(u.length===0&&t.state.env.has(a)&&f.push($(t.state.env,a)),f.length===0)return{values:[],quoted:!0};let p="",h=t.state.shoptOptions.extglob;if(c.pattern)for(let d of c.pattern.parts)if(d.type==="Glob")p+=Ce(d.pattern,c.greedy,h);else if(d.type==="Literal")p+=Ce(d.value,c.greedy,h);else if(d.type==="SingleQuoted"||d.type==="Escaped")p+=Ie(d.value);else if(d.type==="DoubleQuoted"){let g=await n(t,d.parts);p+=Ie(g)}else if(d.type==="ParameterExpansion"){let g=await r(t,d);p+=Ce(g,c.greedy,h)}else{let g=await r(t,d);p+=Ie(g)}let m=[];for(let d of f)m.push(Ln(d,p,c.side,c.greedy));if(l){let d=be(t.state.env);return{values:[m.join(d)],quoted:!0}}return{values:m,quoted:!0}}var Y2=I(()=>{"use strict";Ve();F();Xt();ts();ns();Er();Ht()});async function Q2(t,e){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let n=e[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||n.parts[0].operation?.type!=="DefaultValue"&&n.parts[0].operation?.type!=="UseAlternative"&&n.parts[0].operation?.type!=="AssignDefault")return null;let r=n.parts[0],s=r.operation,i=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/),o,a=!1;if(i){let l=i[1];a=i[2]==="*";let c=me(t,l),u=c.length>0||t.state.env.has(l),f=c.length===0||c.length===1&&c.every(([,h])=>h===""),p=s.checkEmpty??!1;if(s.type==="UseAlternative"?o=u&&!(p&&f):o=!u||p&&f,!o){if(c.length>0){let h=c.map(([,m])=>m);if(a){let m=be(t.state.env);return{values:[h.join(m)],quoted:!0}}return{values:h,quoted:!0}}return t.state.env.has(l)?{values:[$(t.state.env,l)],quoted:!0}:{values:[],quoted:!0}}}else{let l=r.parameter,c=await vn(t,l),u=await Oe(t,l),f=u==="",p=s.checkEmpty??!1;if(s.type==="UseAlternative"?o=c&&!(p&&f):o=!c||p&&f,!o)return{values:[u],quoted:!0}}if(o&&s.word){let l=s.word.parts,c=null,u=!1;for(let f of l)if(f.type==="ParameterExpansion"&&!f.operation){let p=f.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(p){c=p[1],u=p[2]==="*";break}}if(c){let f=me(t,c);if(f.length>0){let p=f.map(([,h])=>h);if(u||a){let h=be(t.state.env);return{values:[p.join(h)],quoted:!0}}return{values:p,quoted:!0}}return t.state.env.has(c)?{values:[$(t.state.env,c)],quoted:!0}:{values:[],quoted:!0}}}return null}async function K2(t,e,n,r,s){if(!n||e.length!==1||e[0].type!=="DoubleQuoted")return null;let i=e[0],o=-1,a="",l=!1,c=null;for(let d=0;d<i.parts.length;d++){let g=i.parts[d];if(g.type==="ParameterExpansion"&&(g.operation?.type==="PatternRemoval"||g.operation?.type==="PatternReplacement")){let w=g.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(w){o=d,a=w[1],l=w[2]==="*",c=g.operation;break}}}if(o===-1||o===0&&o===i.parts.length-1)return null;let u="";for(let d=0;d<o;d++)u+=await r(t,i.parts[d]);let f="";for(let d=o+1;d<i.parts.length;d++)f+=await r(t,i.parts[d]);let p=me(t,a),h=p.map(([,d])=>d);if(p.length===0)if(t.state.env.has(a))h=[$(t.state.env,a)];else{if(l)return{values:[u+f],quoted:!0};let d=u+f;return{values:d?[d]:[],quoted:!0}}if(c?.type==="PatternRemoval"){let d=c,g="",w=t.state.shoptOptions.extglob;if(d.pattern)for(let E of d.pattern.parts)if(E.type==="Glob")g+=Ce(E.pattern,d.greedy,w);else if(E.type==="Literal")g+=Ce(E.value,d.greedy,w);else if(E.type==="SingleQuoted"||E.type==="Escaped")g+=Ie(E.value);else if(E.type==="DoubleQuoted"){let b=await s(t,E.parts);g+=Ie(b)}else if(E.type==="ParameterExpansion"){let b=await r(t,E);g+=Ce(b,d.greedy,w)}else{let b=await r(t,E);g+=Ie(b)}h=h.map(E=>Ln(E,g,d.side,d.greedy))}else if(c?.type==="PatternReplacement"){let d=c,g="";if(d.pattern)for(let b of d.pattern.parts)if(b.type==="Glob")g+=Ce(b.pattern,!0,t.state.shoptOptions.extglob);else if(b.type==="Literal")g+=Ce(b.value,!0,t.state.shoptOptions.extglob);else if(b.type==="SingleQuoted"||b.type==="Escaped")g+=Ie(b.value);else if(b.type==="DoubleQuoted"){let A=await s(t,b.parts);g+=Ie(A)}else if(b.type==="ParameterExpansion"){let A=await r(t,b);g+=Ce(A,!0,t.state.shoptOptions.extglob)}else{let A=await r(t,b);g+=Ie(A)}let w=d.replacement?await s(t,d.replacement.parts):"",E=g;d.anchor==="start"?E=`^${g}`:d.anchor==="end"&&(E=`${g}$`);try{let b=ee(E,d.all?"g":"");h=h.map(A=>b.replace(A,w))}catch{}}if(l){let d=be(t.state.env);return{values:[u+h.join(d)+f],quoted:!0}}return h.length===1?{values:[u+h[0]+f],quoted:!0}:{values:[u+h[0],...h.slice(1,-1),h[h.length-1]+f],quoted:!0}}async function X2(t,e,n,r){if(!n||e.length!==1||e[0].type!=="DoubleQuoted")return null;let s=e[0],i=-1,o="",a=!1;for(let h=0;h<s.parts.length;h++){let m=s.parts[h];if(m.type==="ParameterExpansion"&&!m.operation){let d=m.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(d){i=h,o=d[1],a=d[2]==="*";break}}}if(i===-1)return null;let l="";for(let h=0;h<i;h++)l+=await r(t,s.parts[h]);let c="";for(let h=i+1;h<s.parts.length;h++)c+=await r(t,s.parts[h]);let u=me(t,o),f=u.map(([,h])=>h);if(u.length===0){let h=t.state.env.get(o);if(h!==void 0)return{values:[l+R(h)+c],quoted:!0};if(a)return{values:[l+c],quoted:!0};let m=l+c;return{values:m?[m]:[],quoted:!0}}if(a){let h=be(t.state.env);return{values:[l+f.join(h)+c],quoted:!0}}return f.length===1?{values:[l+f[0]+c],quoted:!0}:{values:[l+f[0],...f.slice(1,-1),f[f.length-1]+c],quoted:!0}}var J2=I(()=>{"use strict";Ve();F();Xt();ts();ns();Er();Ht()});async function eg(t,e,n){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let r=e[0];if(r.parts.length!==1||r.parts[0].type!=="ParameterExpansion"||r.parts[0].operation?.type!=="Substring")return null;let s=r.parts[0],i=s.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!i)return null;let o=i[1],a=i[2]==="*",l=s.operation;if(t.state.associativeArrays?.has(o))throw new Ee(1,y,x(`bash: \${${o}[@]: 0: 3}: bad substitution
774
+ `));let c=l.offset?await n(t,l.offset.expression):0,u=l.length?await n(t,l.length.expression):void 0,f=me(t,o),p=0;if(c<0){if(f.length>0){let m=f[f.length-1][0],g=(typeof m=="number"?m:0)+1+c;if(g<0)return{values:[],quoted:!0};p=f.findIndex(([w])=>typeof w=="number"&&w>=g),p<0&&(p=f.length)}}else p=f.findIndex(([m])=>typeof m=="number"&&m>=c),p<0&&(p=f.length);let h;if(u!==void 0){if(u<0)throw new Be(`${o}[@]: substring expression < 0`);h=f.slice(p,p+u).map(([,m])=>m)}else h=f.slice(p).map(([,m])=>m);if(h.length===0)return{values:[],quoted:!0};if(a){let m=be(t.state.env);return{values:[h.join(m)],quoted:!0}}return{values:h,quoted:!0}}function tg(t,e){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let n=e[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||n.parts[0].operation?.type!=="Transform")return null;let r=n.parts[0],s=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!s)return null;let i=s[1],o=s[2]==="*",a=r.operation,l=me(t,i);if(l.length===0){if(t.state.env.has(i)){let f=$(t.state.env,i),p;switch(a.operator){case"a":p="";break;case"P":p=zs(t,f);break;case"Q":p=Zn(f);break;default:p=f}return{values:[p],quoted:!0}}return o?{values:[""],quoted:!0}:{values:[],quoted:!0}}let c=Qn(t,i),u;switch(a.operator){case"a":u=l.map(()=>c);break;case"P":u=l.map(([,f])=>zs(t,f));break;case"Q":u=l.map(([,f])=>Zn(f));break;case"u":u=l.map(([,f])=>f.charAt(0).toUpperCase()+f.slice(1));break;case"U":u=l.map(([,f])=>f.toUpperCase());break;case"L":u=l.map(([,f])=>f.toLowerCase());break;default:u=l.map(([,f])=>f)}if(o){let f=be(t.state.env);return{values:[u.join(f)],quoted:!0}}return{values:u,quoted:!0}}var ng=I(()=>{"use strict";F();Ne();Xt();Nc();vc();Ht();Ao()});function rg(t,e){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let n=e[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion")return null;let r=n.parts[0];if(r.operation)return null;let s=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!s)return null;let i=s[1];if(_e(t,i)){let a=xr(t,i);if(a?.endsWith("[@]")||a?.endsWith("[*]"))return{values:[],quoted:!0}}let o=me(t,i);return o.length>0?{values:o.map(([,a])=>a),quoted:!0}:t.state.env.has(i)?{values:[$(t.state.env,i)],quoted:!0}:{values:[],quoted:!0}}function sg(t,e){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let n=e[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||n.parts[0].operation)return null;let s=n.parts[0].parameter;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)||!_e(t,s))return null;let i=xr(t,s);if(!i)return null;let o=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!o)return null;let a=o[1],l=me(t,a);return l.length>0?{values:l.map(([,c])=>c),quoted:!0}:t.state.env.has(a)?{values:[$(t.state.env,a)],quoted:!0}:{values:[],quoted:!0}}var ig=I(()=>{"use strict";F();an();Ht()});async function og(t,e,n,r,s){if(!n||e.length!==1||e[0].type!=="DoubleQuoted")return null;let i=e[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||i.parts[0].operation?.type!=="Indirection")return null;let o=i.parts[0],a=o.operation,l=await Oe(t,o.parameter),c=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!c){if(!a.innerOp&&(l==="@"||l==="*")){let h=Number.parseInt($(t.state.env,"#","0"),10),m=[];for(let d=1;d<=h;d++)m.push($(t.state.env,String(d))||"");return l==="*"?{values:[m.join(be(t.state.env))],quoted:!0}:{values:m,quoted:!0}}return null}let u=c[1],f=c[2]==="*",p=me(t,u);if(a.innerOp){if(a.innerOp.type==="Substring")return qx(t,p,u,f,a.innerOp);if(a.innerOp.type==="DefaultValue"||a.innerOp.type==="UseAlternative"||a.innerOp.type==="AssignDefault"||a.innerOp.type==="ErrorIfUnset")return Zx(t,p,u,f,a.innerOp,s);if(a.innerOp.type==="Transform"&&a.innerOp.operator==="a"){let m=Qn(t,u),d=p.map(()=>m);return f?{values:[d.join(be(t.state.env))],quoted:!0}:{values:d,quoted:!0}}let h=[];for(let[,m]of p){let d={type:"ParameterExpansion",parameter:"_indirect_elem_",operation:a.innerOp},g=t.state.env.get("_indirect_elem_");T(t.state.env,"_indirect_elem_",m);try{let w=await r(t,d,!0);h.push(w)}finally{g!==void 0?t.state.env.set("_indirect_elem_",g):t.state.env.delete("_indirect_elem_")}}return f?{values:[h.join(be(t.state.env))],quoted:!0}:{values:h,quoted:!0}}if(p.length>0){let h=p.map(([,m])=>m);return f?{values:[h.join(be(t.state.env))],quoted:!0}:{values:h,quoted:!0}}return t.state.env.has(u)?{values:[$(t.state.env,u)],quoted:!0}:{values:[],quoted:!0}}async function qx(t,e,n,r,s){let i=s.offset?await ue(t,s.offset.expression):0,o=s.length?await ue(t,s.length.expression):void 0,a=0;if(i<0){if(e.length>0){let u=e[e.length-1][0],p=(typeof u=="number"?u:0)+1+i;if(p<0)return{values:[],quoted:!0};if(a=e.findIndex(([h])=>typeof h=="number"&&h>=p),a<0)return{values:[],quoted:!0}}}else if(a=e.findIndex(([u])=>typeof u=="number"&&u>=i),a<0)return{values:[],quoted:!0};let l;if(o!==void 0){if(o<0)throw new Be(`${n}[@]: substring expression < 0`);l=e.slice(a,a+o)}else l=e.slice(a);let c=l.map(([,u])=>u);return r?{values:[c.join(be(t.state.env))],quoted:!0}:{values:c,quoted:!0}}async function Zx(t,e,n,r,s,i){let o=s.checkEmpty??!1,a=e.map(([,u])=>u),l=e.length===0,c=e.length===0;if(s.type==="UseAlternative")return!c&&!(o&&l)&&s.word?{values:[await i(t,s.word.parts,!0)],quoted:!0}:{values:[],quoted:!0};if(s.type==="DefaultValue")return(c||o&&l)&&s.word?{values:[await i(t,s.word.parts,!0)],quoted:!0}:r?{values:[a.join(be(t.state.env))],quoted:!0}:{values:a,quoted:!0};if(s.type==="AssignDefault"){if((c||o&&l)&&s.word){let f=await i(t,s.word.parts,!0);return T(t.state.env,`${n}_0`,f),T(t.state.env,`${n}__length`,"1"),{values:[f],quoted:!0}}return r?{values:[a.join(be(t.state.env))],quoted:!0}:{values:a,quoted:!0}}return r?{values:[a.join(be(t.state.env))],quoted:!0}:{values:a,quoted:!0}}async function ag(t,e){if(e.length!==1||e[0].type!=="ParameterExpansion"||e[0].operation?.type!=="UseAlternative"&&e[0].operation?.type!=="DefaultValue")return null;let n=e[0],r=n.operation,s=r?.word;if(!s||s.parts.length!==1||s.parts[0].type!=="DoubleQuoted")return null;let i=s.parts[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||i.parts[0].operation?.type!=="Indirection")return null;let o=i.parts[0],l=(await Oe(t,o.parameter)).match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!l)return null;let c=await vn(t,n.parameter),u=await Oe(t,n.parameter)==="",f=r.checkEmpty??!1,p;if(r.type==="UseAlternative"?p=c&&!(f&&u):p=!c||f&&u,p){let h=l[1],m=l[2]==="*",d=me(t,h);if(d.length>0){let g=d.map(([,w])=>w);return m?{values:[g.join(be(t.state.env))],quoted:!0}:{values:g,quoted:!0}}return t.state.env.has(h)?{values:[$(t.state.env,h)],quoted:!0}:{values:[],quoted:!0}}return{values:[],quoted:!1}}async function lg(t,e){if(e.length!==1||e[0].type!=="ParameterExpansion"||e[0].operation?.type!=="Indirection")return null;let n=e[0],s=n.operation.innerOp;if(!s||s.type!=="UseAlternative"&&s.type!=="DefaultValue")return null;let i=s.word;if(!i||i.parts.length!==1||i.parts[0].type!=="DoubleQuoted")return null;let o=i.parts[0];if(o.parts.length!==1||o.parts[0].type!=="ParameterExpansion"||o.parts[0].operation?.type!=="Indirection")return null;let a=o.parts[0],c=(await Oe(t,a.parameter)).match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!c)return null;let u=await Oe(t,n.parameter),f=await vn(t,n.parameter),p=u==="",h=s.checkEmpty??!1,m;if(s.type==="UseAlternative"?m=f&&!(h&&p):m=!f||h&&p,m){let d=c[1],g=c[2]==="*",w=me(t,d);if(w.length>0){let E=w.map(([,b])=>b);return g?{values:[E.join(be(t.state.env))],quoted:!0}:{values:E,quoted:!0}}return t.state.env.has(d)?{values:[$(t.state.env,d)],quoted:!0}:{values:[],quoted:!0}}return{values:[],quoted:!1}}var cg=I(()=>{"use strict";F();$t();Ne();Xt();Ht();Ao()});function ug(t){let e=Number.parseInt($(t.state.env,"#","0"),10),n=[];for(let r=1;r<=e;r++)n.push($(t.state.env,String(r))||"");return n}async function fg(t,e,n,r){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let s=e[0],i=-1,o=!1;for(let E=0;E<s.parts.length;E++){let b=s.parts[E];if(b.type==="ParameterExpansion"&&(b.parameter==="@"||b.parameter==="*")&&b.operation?.type==="Substring"){i=E,o=b.parameter==="*";break}}if(i===-1)return null;let l=s.parts[i].operation,c=l.offset?await n(t,l.offset.expression):0,u=l.length?await n(t,l.length.expression):void 0,f=Number.parseInt($(t.state.env,"#","0"),10),p=[];for(let E=1;E<=f;E++)p.push($(t.state.env,String(E))||"");let h=$(t.state.env,"0","bash"),m;if(c<=0){let E=[h,...p],b=E.length+c;if(b<0)m=[];else{let A=c<0?b:0;if(u!==void 0){let N=u<0?E.length+u:A+u;m=E.slice(A,Math.max(A,N))}else m=E.slice(A)}}else{let E=c-1;if(E>=p.length)m=[];else if(u!==void 0){let b=u<0?p.length+u:E+u;m=p.slice(E,Math.max(E,b))}else m=p.slice(E)}let d="";for(let E=0;E<i;E++)d+=await r(t,s.parts[E]);let g="";for(let E=i+1;E<s.parts.length;E++)g+=await r(t,s.parts[E]);if(m.length===0){let E=d+g;return{values:E?[E]:[],quoted:!0}}if(o){let E=be(t.state.env);return{values:[d+m.join(E)+g],quoted:!0}}return m.length===1?{values:[d+m[0]+g],quoted:!0}:{values:[d+m[0],...m.slice(1,-1),m[m.length-1]+g],quoted:!0}}async function pg(t,e,n,r){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let s=e[0],i=-1,o=!1;for(let w=0;w<s.parts.length;w++){let E=s.parts[w];if(E.type==="ParameterExpansion"&&(E.parameter==="@"||E.parameter==="*")&&E.operation?.type==="PatternReplacement"){i=w,o=E.parameter==="*";break}}if(i===-1)return null;let l=s.parts[i].operation,c=ug(t),u="";for(let w=0;w<i;w++)u+=await n(t,s.parts[w]);let f="";for(let w=i+1;w<s.parts.length;w++)f+=await n(t,s.parts[w]);if(c.length===0){let w=u+f;return{values:w?[w]:[],quoted:!0}}let p="";if(l.pattern)for(let w of l.pattern.parts)if(w.type==="Glob")p+=Ce(w.pattern,!0,t.state.shoptOptions.extglob);else if(w.type==="Literal")p+=Ce(w.value,!0,t.state.shoptOptions.extglob);else if(w.type==="SingleQuoted"||w.type==="Escaped")p+=Ie(w.value);else if(w.type==="DoubleQuoted"){let E=await r(t,w.parts);p+=Ie(E)}else if(w.type==="ParameterExpansion"){let E=await n(t,w);p+=Ce(E,!0,t.state.shoptOptions.extglob)}else{let E=await n(t,w);p+=Ie(E)}let h=l.replacement?await r(t,l.replacement.parts):"",m=p;l.anchor==="start"?m=`^${p}`:l.anchor==="end"&&(m=`${p}$`);let d=[];try{let w=ee(m,l.all?"g":"");for(let E of c)d.push(w.replace(E,h))}catch{d.push(...c)}if(o){let w=be(t.state.env);return{values:[u+d.join(w)+f],quoted:!0}}return d.length===1?{values:[u+d[0]+f],quoted:!0}:{values:[u+d[0],...d.slice(1,-1),d[d.length-1]+f],quoted:!0}}async function hg(t,e,n,r){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let s=e[0],i=-1,o=!1;for(let g=0;g<s.parts.length;g++){let w=s.parts[g];if(w.type==="ParameterExpansion"&&(w.parameter==="@"||w.parameter==="*")&&w.operation?.type==="PatternRemoval"){i=g,o=w.parameter==="*";break}}if(i===-1)return null;let l=s.parts[i].operation,c=ug(t),u="";for(let g=0;g<i;g++)u+=await n(t,s.parts[g]);let f="";for(let g=i+1;g<s.parts.length;g++)f+=await n(t,s.parts[g]);if(c.length===0){let g=u+f;return{values:g?[g]:[],quoted:!0}}let p="",h=t.state.shoptOptions.extglob;if(l.pattern)for(let g of l.pattern.parts)if(g.type==="Glob")p+=Ce(g.pattern,l.greedy,h);else if(g.type==="Literal")p+=Ce(g.value,l.greedy,h);else if(g.type==="SingleQuoted"||g.type==="Escaped")p+=Ie(g.value);else if(g.type==="DoubleQuoted"){let w=await r(t,g.parts);p+=Ie(w)}else if(g.type==="ParameterExpansion"){let w=await n(t,g);p+=Ce(w,l.greedy,h)}else{let w=await n(t,g);p+=Ie(w)}let m=[];for(let g of c)m.push(Ln(g,p,l.side,l.greedy));if(o){let g=be(t.state.env);return{values:[u+m.join(g)+f],quoted:!0}}return m.length===1?{values:[u+m[0]+f],quoted:!0}:{values:[u+m[0],...m.slice(1,-1),m[m.length-1]+f],quoted:!0}}async function dg(t,e,n){if(e.length!==1||e[0].type!=="DoubleQuoted")return null;let r=e[0],s=-1,i=!1;for(let p=0;p<r.parts.length;p++){let h=r.parts[p];if(h.type==="ParameterExpansion"&&(h.parameter==="@"||h.parameter==="*")){s=p,i=h.parameter==="*";break}}if(s===-1)return null;let o=r.parts[s];if(o.type==="ParameterExpansion"&&o.operation)return null;let a=Number.parseInt($(t.state.env,"#","0"),10),l="";for(let p=0;p<s;p++)l+=await n(t,r.parts[p]);let c="";for(let p=s+1;p<r.parts.length;p++)c+=await n(t,r.parts[p]);if(a===0){if(i)return{values:[l+c],quoted:!0};let p=l+c;return{values:p?[p]:[],quoted:!0}}let u=[];for(let p=1;p<=a;p++)u.push($(t.state.env,String(p))||"");if(i){let p=be(t.state.env);return{values:[l+u.join(p)+c],quoted:!0}}return u.length===1?{values:[l+u[0]+c],quoted:!0}:{values:[l+u[0],...u.slice(1,-1),u[u.length-1]+c],quoted:!0}}var mg=I(()=>{"use strict";Ve();F();Xt();ts();ns();Er()});function Yx(t){return new qn(t.fs,t.state.cwd,t.state.env,{globstar:t.state.shoptOptions.globstar,nullglob:t.state.shoptOptions.nullglob,failglob:t.state.shoptOptions.failglob,dotglob:t.state.shoptOptions.dotglob,extglob:t.state.shoptOptions.extglob,globskipdots:t.state.shoptOptions.globskipdots,maxGlobOperations:t.limits.maxGlobOperations})}async function Co(t,e){if(t.state.options.noglob)return e;let n=Yx(t),r=[];for(let s of e)if(kn(s,t.state.shoptOptions.extglob)){let i=await n.expand(s);if(i.length>0)r.push(...i);else{if(n.hasFailglob())throw new yn(s);n.hasNullglob()||r.push(s)}}else r.push(s);return r}async function gg(t,e,n,r){let s=-1,i="",o=!1;for(let E=0;E<e.length;E++){let b=e[E];if(b.type==="ParameterExpansion"&&b.operation?.type==="PatternReplacement"){let A=b.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(A){s=E,i=A[1],o=A[2]==="*";break}}}if(s===-1)return null;let l=e[s].operation,c=me(t,i),u=c.map(([,E])=>E);if(c.length===0&&t.state.env.has(i)&&(u=[$(t.state.env,i)]),u.length===0)return{values:[],quoted:!1};let f="";if(l.pattern)for(let E of l.pattern.parts)if(E.type==="Glob")f+=Ce(E.pattern,!0,t.state.shoptOptions.extglob);else if(E.type==="Literal")f+=Ce(E.value,!0,t.state.shoptOptions.extglob);else if(E.type==="SingleQuoted"||E.type==="Escaped")f+=Ie(E.value);else if(E.type==="DoubleQuoted"){let b=await n(t,E.parts);f+=Ie(b)}else if(E.type==="ParameterExpansion"){let b=await r(t,E);f+=Ce(b,!0,t.state.shoptOptions.extglob)}else{let b=await r(t,E);f+=Ie(b)}let p=l.replacement?await n(t,l.replacement.parts):"",h=f;l.anchor==="start"?h=`^${f}`:l.anchor==="end"&&(h=`${f}$`);let m=[];try{let E=ee(h,l.all?"g":"");for(let b of u)m.push(E.replace(b,p))}catch{m.push(...u)}let d=ft(t.state.env),g=wt(t.state.env);if(o){let E=be(t.state.env),b=m.join(E);return g?{values:b?[b]:[],quoted:!1}:{values:He(b,d),quoted:!1}}if(g)return{values:m,quoted:!1};let w=[];for(let E of m)E===""?w.push(""):w.push(...He(E,d));return{values:w,quoted:!1}}async function yg(t,e,n,r){let s=-1,i="",o=!1;for(let w=0;w<e.length;w++){let E=e[w];if(E.type==="ParameterExpansion"&&E.operation?.type==="PatternRemoval"){let b=E.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(b){s=w,i=b[1],o=b[2]==="*";break}}}if(s===-1)return null;let l=e[s].operation,c=me(t,i),u=c.map(([,w])=>w);if(c.length===0&&t.state.env.has(i)&&(u=[$(t.state.env,i)]),u.length===0)return{values:[],quoted:!1};let f="",p=t.state.shoptOptions.extglob;if(l.pattern)for(let w of l.pattern.parts)if(w.type==="Glob")f+=Ce(w.pattern,l.greedy,p);else if(w.type==="Literal")f+=Ce(w.value,l.greedy,p);else if(w.type==="SingleQuoted"||w.type==="Escaped")f+=Ie(w.value);else if(w.type==="DoubleQuoted"){let E=await n(t,w.parts);f+=Ie(E)}else if(w.type==="ParameterExpansion"){let E=await r(t,w);f+=Ce(E,l.greedy,p)}else{let E=await r(t,w);f+=Ie(E)}let h=[];for(let w of u)h.push(Ln(w,f,l.side,l.greedy));let m=ft(t.state.env),d=wt(t.state.env);if(o){let w=be(t.state.env),E=h.join(w);return d?{values:E?[E]:[],quoted:!1}:{values:He(E,m),quoted:!1}}if(d)return{values:h,quoted:!1};let g=[];for(let w of h)w===""?g.push(""):g.push(...He(w,m));return{values:g,quoted:!1}}async function wg(t,e,n,r){let s=-1,i=!1;for(let g=0;g<e.length;g++){let w=e[g];if(w.type==="ParameterExpansion"&&(w.parameter==="@"||w.parameter==="*")&&w.operation?.type==="PatternRemoval"){s=g,i=w.parameter==="*";break}}if(s===-1)return null;let a=e[s].operation,l=Number.parseInt($(t.state.env,"#","0"),10),c=[];for(let g=1;g<=l;g++)c.push($(t.state.env,String(g))||"");if(c.length===0)return{values:[],quoted:!1};let u="",f=t.state.shoptOptions.extglob;if(a.pattern)for(let g of a.pattern.parts)if(g.type==="Glob")u+=Ce(g.pattern,a.greedy,f);else if(g.type==="Literal")u+=Ce(g.value,a.greedy,f);else if(g.type==="SingleQuoted"||g.type==="Escaped")u+=Ie(g.value);else if(g.type==="DoubleQuoted"){let w=await n(t,g.parts);u+=Ie(w)}else if(g.type==="ParameterExpansion"){let w=await r(t,g);u+=Ce(w,a.greedy,f)}else{let w=await r(t,g);u+=Ie(w)}let p=[];for(let g of c)p.push(Ln(g,u,a.side,a.greedy));let h=ft(t.state.env),m=wt(t.state.env);if(i){let g=be(t.state.env),w=p.join(g);return m?{values:w?[w]:[],quoted:!1}:{values:He(w,h),quoted:!1}}if(m)return{values:p,quoted:!1};let d=[];for(let g of p)g===""?d.push(""):d.push(...He(g,h));return{values:d,quoted:!1}}async function bg(t,e,n,r){let s=-1,i=!1;for(let b=0;b<e.length;b++){let A=e[b];if(A.type==="ParameterExpansion"&&(A.parameter==="@"||A.parameter==="*")&&A.operation?.type==="Substring"){s=b,i=A.parameter==="*";break}}if(s===-1)return null;let a=e[s].operation,l=a.offset?await n(t,a.offset.expression):0,c=a.length?await n(t,a.length.expression):void 0,u=Number.parseInt($(t.state.env,"#","0"),10),f=[];for(let b=1;b<=u;b++)f.push($(t.state.env,String(b))||"");let p=$(t.state.env,"0","bash"),h;if(l<=0){let b=[p,...f],A=b.length+l;if(A<0)h=[];else{let N=l<0?A:0;if(c!==void 0){let P=c<0?b.length+c:N+c;h=b.slice(N,Math.max(N,P))}else h=b.slice(N)}}else{let b=l-1;if(b>=f.length)h=[];else if(c!==void 0){let A=c<0?f.length+c:b+c;h=f.slice(b,Math.max(b,A))}else h=f.slice(b)}let m="";for(let b=0;b<s;b++)m+=await r(t,e[b]);let d="";for(let b=s+1;b<e.length;b++)d+=await r(t,e[b]);let g=ft(t.state.env),w=wt(t.state.env);if(h.length===0){let b=m+d;return b?w?{values:[b],quoted:!1}:{values:He(b,g),quoted:!1}:{values:[],quoted:!1}}let E;if(i){let b=be(t.state.env),A=m+h.join(b)+d;w?E=A?[A]:[]:E=He(A,g)}else if(w)h.length===1?E=[m+h[0]+d]:E=[m+h[0],...h.slice(1,-1),h[h.length-1]+d];else{E=[];for(let b=0;b<h.length;b++){let A=h[b];if(b===0&&(A=m+A),b===h.length-1&&(A=A+d),A==="")E.push("");else{let N=He(A,g);E.push(...N)}}}return{values:await Co(t,E),quoted:!1}}async function xg(t,e){if(e.length!==1||e[0].type!=="ParameterExpansion"||e[0].parameter!=="@"&&e[0].parameter!=="*"||e[0].operation)return null;let n=e[0].parameter==="*",r=Number.parseInt($(t.state.env,"#","0"),10);if(r===0)return{values:[],quoted:!1};let s=[];for(let c=1;c<=r;c++)s.push($(t.state.env,String(c))||"");let i=ft(t.state.env),o=wt(t.state.env),a=yo(t.state.env),l;if(n)if(o)l=s.filter(c=>c!=="");else{let c=be(t.state.env),u=s.join(c);l=He(u,i)}else if(o)l=s.filter(c=>c!=="");else if(a){l=[];for(let c of s){if(c==="")continue;let u=He(c,i);l.push(...u)}}else{l=[];for(let c of s)if(c==="")l.push("");else{let u=He(c,i);l.push(...u)}for(;l.length>0&&l[l.length-1]==="";)l.pop()}return{values:await Co(t,l),quoted:!1}}async function Eg(t,e){if(e.length!==1||e[0].type!=="ParameterExpansion"||e[0].operation)return null;let n=e[0].parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!n)return null;let r=n[1],s=n[2]==="*",i=me(t,r),o;if(i.length===0)if(t.state.env.has(r))o=[$(t.state.env,r)];else return{values:[],quoted:!1};else o=i.map(([,f])=>f);let a=ft(t.state.env),l=wt(t.state.env),c=yo(t.state.env),u;if(s)if(l)u=o.filter(f=>f!=="");else{let f=be(t.state.env),p=o.join(f);u=He(p,a)}else if(l)u=o.filter(f=>f!=="");else if(c){u=[];for(let f of o){if(f==="")continue;let p=He(f,a);u.push(...p)}}else{u=[];for(let f of o)if(f==="")u.push("");else{let p=He(f,a);u.push(...p)}for(;u.length>0&&u[u.length-1]==="";)u.pop()}return{values:await Co(t,u),quoted:!1}}function Ag(t,e){if(e.length!==1||e[0].type!=="ParameterExpansion"||e[0].operation?.type!=="VarNamePrefix")return null;let n=e[0].operation,r=rs(t,n.prefix);if(r.length===0)return{values:[],quoted:!1};let s=ft(t.state.env),i=wt(t.state.env),o;if(n.star)if(i)o=r;else{let a=be(t.state.env),l=r.join(a);o=He(l,s)}else if(i)o=r;else{o=[];for(let a of r){let l=He(a,s);o.push(...l)}}return{values:o,quoted:!1}}function Sg(t,e){if(e.length!==1||e[0].type!=="ParameterExpansion"||e[0].operation?.type!=="ArrayKeys")return null;let n=e[0].operation,s=me(t,n.array).map(([l])=>String(l));if(s.length===0)return{values:[],quoted:!1};let i=ft(t.state.env),o=wt(t.state.env),a;if(n.star)if(o)a=s;else{let l=be(t.state.env),c=s.join(l);a=He(c,i)}else if(o)a=s;else{a=[];for(let l of s){let c=He(l,i);a.push(...c)}}return{values:a,quoted:!1}}async function Cg(t,e,n){let r=-1;for(let p=0;p<e.length;p++){let h=e[p];if(h.type==="ParameterExpansion"&&(h.parameter==="@"||h.parameter==="*")&&!h.operation){r=p;break}}if(r===-1||e.length<=1)return null;let s=Number.parseInt($(t.state.env,"#","0"),10),i=[];for(let p=1;p<=s;p++)i.push($(t.state.env,String(p))||"");let o="";for(let p=0;p<r;p++)o+=await n(t,e[p]);let a="";for(let p=r+1;p<e.length;p++)a+=await n(t,e[p]);let l=ft(t.state.env),c=wt(t.state.env),u=yo(t.state.env);if(s===0){let p=o+a;return{values:p?[p]:[],quoted:!1}}let f;{let p=[];for(let h=0;h<i.length;h++){let m=i[h];h===0&&(m=o+m),h===i.length-1&&(m=m+a),p.push(m)}if(c)f=p.filter(h=>h!=="");else if(u){f=[];for(let h of p){if(h==="")continue;let m=He(h,l);f.push(...m)}}else{f=[];for(let h of p)if(h==="")f.push("");else{let m=He(h,l);f.push(...m)}for(;f.length>0&&f[f.length-1]==="";)f.pop()}}return f.length===0?{values:[],quoted:!1}:{values:await Co(t,f),quoted:!1}}var Ng=I(()=>{"use strict";Ve();ho();F();Ne();Xt();ts();es();ns();Er();Ht()});async function Ig(t,e,n){t.coverage?.hit("bash:expansion:word_glob");let r=e.parts,{hasQuoted:s,hasCommandSub:i,hasArrayVar:o,hasArrayAtExpansion:a,hasParamExpansion:l,hasVarNamePrefixExpansion:c,hasIndirection:u}=Ws(r),p=n.hasBraceExpansion(r)?await n.expandWordWithBracesAsync(t,e):null;if(p&&p.length>1)return Qx(t,p,s);let h=await Kx(t,r,a,c,u,n);if(h!==null)return h;let m=await Jx(t,r,n);if(m!==null)return m;let d=await eE(t,r,n);if(d!==null)return d;let g=await nE(t,r,n.expandPart);if(g!==null)return kg(t,g);if((i||o||l)&&!wt(t.state.env)){let E=ft(t.state.env),b=n.buildIfsCharClassPattern(E),A=await n.smartWordSplit(t,r,E,b,n.expandPart);return kg(t,A)}let w=await n.expandWordAsync(t,e);return rE(t,e,r,w,s,n.expandWordForGlobbing)}async function Qx(t,e,n){let r=[];for(let s of e)if(!(!n&&s===""))if(!n&&!t.state.options.noglob&&kn(s,t.state.shoptOptions.extglob)){let i=await No(t,s);r.push(...i)}else r.push(s);return{values:r,quoted:!1}}async function Kx(t,e,n,r,s,i){if(n){let o=rg(t,e);if(o!==null)return o}{let o=sg(t,e);if(o!==null)return o}{let o=await Q2(t,e);if(o!==null)return o}{let o=await K2(t,e,n,i.expandPart,i.expandWordPartsAsync);if(o!==null)return o}{let o=await X2(t,e,n,i.expandPart);if(o!==null)return o}{let o=await eg(t,e,i.evaluateArithmetic);if(o!==null)return o}{let o=tg(t,e);if(o!==null)return o}{let o=await q2(t,e,i.expandWordPartsAsync,i.expandPart);if(o!==null)return o}{let o=await Z2(t,e,i.expandWordPartsAsync,i.expandPart);if(o!==null)return o}if(r&&e.length===1&&e[0].type==="DoubleQuoted"){let o=Xx(t,e);if(o!==null)return o}{let o=await og(t,e,s,i.expandParameterAsync,i.expandWordPartsAsync);if(o!==null)return o}{let o=await ag(t,e);if(o!==null)return o}{let o=await lg(t,e);if(o!==null)return o}return null}function Xx(t,e){let n=e[0];if(n.type!=="DoubleQuoted")return null;if(n.parts.length===1&&n.parts[0].type==="ParameterExpansion"&&n.parts[0].operation?.type==="VarNamePrefix"){let r=n.parts[0].operation,s=rs(t,r.prefix);return r.star?{values:[s.join(be(t.state.env))],quoted:!0}:{values:s,quoted:!0}}if(n.parts.length===1&&n.parts[0].type==="ParameterExpansion"&&n.parts[0].operation?.type==="ArrayKeys"){let r=n.parts[0].operation,i=me(t,r.array).map(([o])=>String(o));return r.star?{values:[i.join(be(t.state.env))],quoted:!0}:{values:i,quoted:!0}}return null}async function Jx(t,e,n){{let r=await fg(t,e,n.evaluateArithmetic,n.expandPart);if(r!==null)return r}{let r=await pg(t,e,n.expandPart,n.expandWordPartsAsync);if(r!==null)return r}{let r=await hg(t,e,n.expandPart,n.expandWordPartsAsync);if(r!==null)return r}{let r=await dg(t,e,n.expandPart);if(r!==null)return r}return null}async function eE(t,e,n){{let r=await gg(t,e,n.expandWordPartsAsync,n.expandPart);if(r!==null)return r}{let r=await yg(t,e,n.expandWordPartsAsync,n.expandPart);if(r!==null)return r}{let r=await wg(t,e,n.expandWordPartsAsync,n.expandPart);if(r!==null)return r}{let r=await bg(t,e,n.evaluateArithmetic,n.expandPart);if(r!==null)return r}{let r=await xg(t,e);if(r!==null)return r}{let r=await Eg(t,e);if(r!==null)return r}{let r=Ag(t,e);if(r!==null)return r}{let r=Sg(t,e);if(r!==null)return r}{let r=await Cg(t,e,n.expandPart);if(r!==null)return r}return null}function vg(t){if(t.type!=="DoubleQuoted")return null;for(let e=0;e<t.parts.length;e++){let n=t.parts[e];if(n.type!=="ParameterExpansion"||n.operation)continue;let r=n.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(r)return{type:"array",name:r[1],atIndex:e,isStar:r[2]==="*"};if(n.parameter==="@"||n.parameter==="*")return{type:"positional",atIndex:e,isStar:n.parameter==="*"}}return null}async function tE(t,e,n,r){let s="";for(let a=0;a<n.atIndex;a++)s+=await r(t,e.parts[a]);let i="";for(let a=n.atIndex+1;a<e.parts.length;a++)i+=await r(t,e.parts[a]);let o;if(n.type==="array")o=me(t,n.name).map(([,l])=>l),o.length===0&&t.state.env.has(n.name)&&(o=[$(t.state.env,n.name)]);else{let a=Number.parseInt($(t.state.env,"#","0"),10);o=[];for(let l=1;l<=a;l++)o.push($(t.state.env,String(l))||"")}if(n.isStar){let a=be(t.state.env),l=o.join(a);return[s+l+i]}if(o.length===0){let a=s+i;return a?[a]:[]}return o.length===1?[s+o[0]+i]:[s+o[0],...o.slice(1,-1),o[o.length-1]+i]}async function nE(t,e,n){if(e.length<2)return null;let r=!1;for(let l of e)if(vg(l)){r=!0;break}if(!r)return null;let s=ft(t.state.env),i=wt(t.state.env),o=[];for(let l of e){let c=vg(l);if(c&&l.type==="DoubleQuoted"){let u=await tE(t,l,c,n);o.push(u)}else if(l.type==="DoubleQuoted"||l.type==="SingleQuoted"){let u=await n(t,l);o.push([u])}else if(l.type==="Literal")o.push([l.value]);else if(l.type==="ParameterExpansion"){let u=await n(t,l);if(i)o.push(u?[u]:[]);else{let f=He(u,s);o.push(f)}}else{let u=await n(t,l);if(i)o.push(u?[u]:[]);else{let f=He(u,s);o.push(f)}}}let a=[];for(let l of o)if(l.length!==0)if(a.length===0)a.push(...l);else{let c=a.length-1;a[c]=a[c]+l[0];for(let u=1;u<l.length;u++)a.push(l[u])}return a}async function kg(t,e){if(t.state.options.noglob)return{values:e,quoted:!1};let n=[];for(let r of e)if(kn(r,t.state.shoptOptions.extglob)){let s=await No(t,r);n.push(...s)}else n.push(r);return{values:n,quoted:!1}}async function No(t,e){let n=new qn(t.fs,t.state.cwd,t.state.env,{globstar:t.state.shoptOptions.globstar,nullglob:t.state.shoptOptions.nullglob,failglob:t.state.shoptOptions.failglob,dotglob:t.state.shoptOptions.dotglob,extglob:t.state.shoptOptions.extglob,globskipdots:t.state.shoptOptions.globskipdots,maxGlobOperations:t.limits.maxGlobOperations}),r=await n.expand(e);if(r.length>0)return r;if(n.hasFailglob())throw new yn(e);return n.hasNullglob()?[]:[e]}async function rE(t,e,n,r,s,i){let o=n.some(a=>a.type==="Glob");if(!t.state.options.noglob&&o){let a=await i(t,e);if(kn(a,t.state.shoptOptions.extglob)){let c=await No(t,a);if(c.length>0&&c[0]!==a)return{values:c,quoted:!1};if(c.length===0)return{values:[],quoted:!1}}let l=Cc(r);if(!wt(t.state.env)){let c=ft(t.state.env);return{values:He(l,c),quoted:!1}}return{values:[l],quoted:!1}}if(!s&&!t.state.options.noglob&&kn(r,t.state.shoptOptions.extglob)){let a=await i(t,e);if(kn(a,t.state.shoptOptions.extglob)){let l=await No(t,a);if(l.length>0&&l[0]!==a)return{values:l,quoted:!1}}}if(r===""&&!s)return{values:[],quoted:!1};if(o&&!s){let a=Cc(r);if(!wt(t.state.env)){let l=ft(t.state.env);return{values:He(a,l),quoted:!1}}return{values:[a],quoted:!1}}return{values:[r],quoted:s}}var Tg=I(()=>{"use strict";ho();F();Ne();Xt();mo();Y2();J2();ng();ig();es();cg();Er();mg();Ng();Ht()});async function Rg(t,e){let n=e.operation;if(!n||n.type!=="DefaultValue"&&n.type!=="AssignDefault"&&n.type!=="UseAlternative")return null;let r=n.word;if(!r||r.parts.length===0)return null;let s=await vn(t,e.parameter),o=await Oe(t,e.parameter,!1)==="",a=n.checkEmpty??!1,l;return n.type==="UseAlternative"?l=s&&!(a&&o):l=!s||a&&o,l?r.parts:null}function sE(t){return t.type==="SingleQuoted"?!0:t.type==="DoubleQuoted"?t.parts.every(n=>n.type==="Literal"):!1}async function iE(t,e){if(e.type!=="ParameterExpansion")return null;let n=await Rg(t,e);if(!n||n.length<=1)return null;let r=n.some(i=>sE(i)),s=n.some(i=>i.type==="Literal"||i.type==="ParameterExpansion"||i.type==="CommandSubstitution"||i.type==="ArithmeticExpansion");return r&&s?n:null}function oE(t){return t.type==="DoubleQuoted"||t.type==="SingleQuoted"||t.type==="Literal"?!1:t.type==="Glob"?yc(t.pattern):!(!(t.type==="ParameterExpansion"||t.type==="CommandSubstitution"||t.type==="ArithmeticExpansion")||t.type==="ParameterExpansion"&&h2(t))}async function Pg(t,e,n,r,s){if(t.coverage?.hit("bash:expansion:word_split"),e.length===1&&e[0].type==="ParameterExpansion"){let p=e[0],h=await Rg(t,p);if(h&&h.length>0&&h.length>1&&h.some(d=>d.type==="DoubleQuoted"||d.type==="SingleQuoted")&&h.some(d=>d.type==="Literal"||d.type==="ParameterExpansion"||d.type==="CommandSubstitution"||d.type==="ArithmeticExpansion"))return Og(t,h,n,r,s)}let i=[],o=!1;for(let p of e){let h=oE(p),m=p.type==="DoubleQuoted"||p.type==="SingleQuoted",d=h?await iE(t,p):null,g=await s(t,p);i.push({value:g,isSplittable:h,isQuoted:m,mixedDefaultParts:d??void 0}),h&&(o=!0)}if(!o){let p=i.map(h=>h.value).join("");return p?[p]:[]}let a=[],l="",c=!1,u=!1,f=!1;for(let p of i)if(!p.isSplittable)u?p.isQuoted&&p.value===""?(l!==""&&a.push(l),a.push(""),c=!0,l="",u=!1,f=!0):p.value!==""?(l!==""&&a.push(l),l=p.value,u=!1,f=!1):(l+=p.value,f=!1):(l+=p.value,f=p.isQuoted&&p.value==="");else if(p.mixedDefaultParts){let h=await Og(t,p.mixedDefaultParts,n,r,s);if(h.length!==0)if(h.length===1)l+=h[0],c=!0;else{l+=h[0],a.push(l),c=!0;for(let m=1;m<h.length-1;m++)a.push(h[m]);l=h[h.length-1]}u=!1,f=!1}else{let{words:h,hadLeadingDelimiter:m,hadTrailingDelimiter:d}=wo(p.value,n);if(f&&m&&l===""&&(a.push(""),c=!0),h.length===0)d&&(u=!0);else if(h.length===1)l+=h[0],c=!0,u=d;else{l+=h[0],a.push(l),c=!0;for(let g=1;g<h.length-1;g++)a.push(h[g]);l=h[h.length-1],u=d}f=!1}return l!==""?a.push(l):a.length===0&&c&&a.push(""),a}function aE(t,e){return t.length>0&&e.includes(t[0])}async function Og(t,e,n,r,s){let i=[];for(let u of e){let p=!(u.type==="DoubleQuoted"||u.type==="SingleQuoted"),h=await s(t,u);i.push({value:h,isSplittable:p})}let o=[],a="",l=!1,c=!1;for(let u of i)if(!u.isSplittable)c&&u.value!==""?(a!==""&&o.push(a),a=u.value,c=!1):a+=u.value;else{aE(u.value,n)&&a!==""&&(o.push(a),a="",l=!0);let{words:p,hadTrailingDelimiter:h}=wo(u.value,n);if(p.length===0)h&&(c=!0);else if(p.length===1)a+=p[0],l=!0,c=h;else{a+=p[0],o.push(a),l=!0;for(let m=1;m<p.length-1;m++)o.push(p[m]);a=p[p.length-1],c=h}}return a!==""?o.push(a):o.length===0&&l&&o.push(""),o}var $g=I(()=>{"use strict";Ht();Xt();mo()});function Dg(t){switch(t.type){case"Literal":return t.value;case"SingleQuoted":return t.value;case"Escaped":return t.value;case"Bytes":return R(t.value);default:return null}}function _g(t){switch(t.type){case"Bytes":return t.value;case"Literal":return x(t.value);case"SingleQuoted":return x(t.value);case"Escaped":return x(t.value);default:return null}}function Mg(t){switch(t.type){case"SingleQuoted":case"Escaped":case"DoubleQuoted":case"Bytes":return!0;case"Literal":return t.value==="";default:return!1}}var Lg=I(()=>{"use strict";F()});var _c={};se(_c,{escapeGlobChars:()=>Nt,escapeRegexChars:()=>Jr,expandRedirectTarget:()=>Gs,expandWord:()=>de,expandWordForPattern:()=>Pc,expandWordForRegex:()=>Rc,expandWordToBytes:()=>Ar,expandWordWithGlob:()=>gn,getArrayElements:()=>me,getVariable:()=>Oe,hasQuotedMultiValueAt:()=>js,isArray:()=>Mn,isWordFullyQuoted:()=>Oc});function Tc(t,e,n){if(t.length>e)throw new ae(`${n}: string length limit exceeded (${e} bytes)`,"string_length")}async function mn(t,e,n=!1){let r=[];for(let s of e)r.push(await ln(t,s,n));return r.join("")}function lE(t){return Mg(t)}function Oc(t){if(t.parts.length===0)return!0;for(let e of t.parts)if(!lE(e))return!1;return!0}function cE(t,e,n=!1){let r=Dg(e);if(r!==null)return r;switch(e.type){case"TildeExpansion":if(n)return e.user===null?"~":`~${e.user}`;if(t.coverage?.hit("bash:expansion:tilde"),e.user===null){let s=t.state.env.get("HOME");return s!==void 0?R(s):"/home/user"}return e.user==="root"?"/root":`~${e.user}`;case"Glob":return kc(t,e.pattern);default:return null}}async function de(t,e){return $c(t,e)}async function Rc(t,e){let n=[];for(let r of e.parts)if(r.type==="Escaped")n.push(`\\${r.value}`);else if(r.type==="SingleQuoted")n.push(r.value);else if(r.type==="DoubleQuoted"){let s=await mn(t,r.parts);n.push(s)}else if(r.type==="TildeExpansion"){let s=await ln(t,r);n.push(Jr(s))}else n.push(await ln(t,r));return n.join("")}async function Pc(t,e){let n=[];for(let r of e.parts)if(r.type==="Escaped"){let s=r.value;"()|*?[]".includes(s)?n.push(`\\${s}`):n.push(s)}else if(r.type==="SingleQuoted")n.push(Nt(r.value));else if(r.type==="Bytes")n.push(Nt(R(r.value)));else if(r.type==="DoubleQuoted"){let s=await mn(t,r.parts);n.push(Nt(s))}else n.push(await ln(t,r));return n.join("")}async function Fg(t,e){let n=[];for(let r of e.parts)if(r.type==="SingleQuoted")n.push(Nt(r.value));else if(r.type==="Bytes")n.push(Nt(R(r.value)));else if(r.type==="Escaped"){let s=r.value;"*?[]\\()|".includes(s)?n.push(`\\${s}`):n.push(s)}else if(r.type==="DoubleQuoted"){let s=await mn(t,r.parts);n.push(Nt(s))}else r.type==="Glob"?W2(r.pattern)?n.push(await H2(t,r.pattern)):n.push(kc(t,r.pattern)):r.type==="Literal"?n.push(r.value):n.push(await ln(t,r));return n.join("")}function vo(t){for(let e of t)if(e.type==="BraceExpansion"||e.type==="DoubleQuoted"&&vo(e.parts))return!0;return!1}async function Ug(t,e,n={count:0}){if(n.count>Ic)return[[]];let r=[[]];for(let s of e)if(s.type==="BraceExpansion"){let i=[],o=!1,a="";for(let u of s.items)if(u.type==="Range"){let f=Sc(u.start,u.end,u.step,u.startStr,u.endStr);if(f.expanded)for(let p of f.expanded)n.count++,i.push(p);else{o=!0,a=f.literal;break}}else{let f=await Ug(t,u.word.parts,n);for(let p of f){n.count++;let h=[];for(let m of p)typeof m=="string"?h.push(m):h.push(await ln(t,m));i.push(h.join(""))}}if(o){for(let u of r)n.count++,u.push(a);continue}if(r.length*i.length>uE||n.count>Ic)return r;let c=[];for(let u of r)for(let f of i){if(n.count++,n.count>Ic)return c.length>0?c:r;c.push([...u,f])}r=c}else for(let i of r)n.count++,i.push(s);return r}async function Bg(t,e){let n=e.parts;if(!vo(n))return[await de(t,e)];let r=await Ug(t,n),s=[];for(let i of r){let o=[];for(let a of i)typeof a=="string"?o.push(a):o.push(await ln(t,a));s.push(G2(t,o.join("")))}return s}function fE(){return{expandWordAsync:$c,expandWordForGlobbing:Fg,expandWordWithBracesAsync:Bg,expandWordPartsAsync:mn,expandPart:ln,expandParameterAsync:Hs,hasBraceExpansion:vo,evaluateArithmetic:ue,buildIfsCharClassPattern:d2,smartWordSplit:Pg}}async function gn(t,e){return Ig(t,e,fE())}function pE(t){for(let e of t){if(e.type==="ParameterExpansion")return e.parameter;if(e.type==="Literal")return e.value}return""}function js(t,e){if(Number.parseInt($(t.state.env,"#","0"),10)<2)return!1;function r(s){for(let i of s)if(i.type==="DoubleQuoted"){for(let o of i.parts)if(o.type==="ParameterExpansion"&&o.parameter==="@"&&!o.operation)return!0}return!1}return r(e.parts)}async function Gs(t,e){if(js(t,e))return{error:`bash: $@: ambiguous redirect
775
+ `};let n=e.parts,{hasQuoted:r}=Ws(n);if(vo(n)&&(await Bg(t,e)).length>1)return{error:`bash: ${n.map(h=>h.type==="Literal"?h.value:h.type==="BraceExpansion"?`{${h.items.map(d=>{if(d.type==="Range"){let g=d.step?`..${d.step}`:"";return`${d.startStr??d.start}..${d.endStr??d.end}${g}`}return d.word.parts.map(g=>g.type==="Literal"?g.value:"").join("")}).join(",")}}`:"").join("")}: ambiguous redirect
776
+ `};let s=await $c(t,e),{hasParamExpansion:i,hasCommandSub:o}=Ws(n);if((i||o)&&!r&&!wt(t.state.env)){let f=ft(t.state.env);if(He(s,f).length>1)return{error:`bash: $${pE(n)}: ambiguous redirect
777
+ `}}if(r||t.state.options.noglob)return{target:s};let l=await Fg(t,e);if(!kn(l,t.state.shoptOptions.extglob))return{target:s};let c=new qn(t.fs,t.state.cwd,t.state.env,{globstar:t.state.shoptOptions.globstar,nullglob:t.state.shoptOptions.nullglob,failglob:t.state.shoptOptions.failglob,dotglob:t.state.shoptOptions.dotglob,extglob:t.state.shoptOptions.extglob,globskipdots:t.state.shoptOptions.globskipdots,maxGlobOperations:t.limits.maxGlobOperations}),u=await c.expand(l);return u.length===0?c.hasFailglob()?{error:`bash: no match: ${s}
778
+ `}:{target:s}:u.length===1?{target:u[0]}:{error:`bash: ${s}: ambiguous redirect
779
+ `}}async function $c(t,e){let n=e.parts,r=n.length;if(r===1){let o=await ln(t,n[0]);return Tc(o,t.limits.maxStringLength,"word expansion"),o}let s=[];for(let o=0;o<r;o++)s.push(await ln(t,n[o]));let i=s.join("");return Tc(i,t.limits.maxStringLength,"word expansion"),i}async function Ar(t,e){let n=e.parts;if(n.length===0)return y;let r=y;for(let s of n)r=j(r,await Dc(t,s));return r}async function Dc(t,e,n=!1){let r=_g(e);if(r!==null)return r;if(e.type==="ParameterExpansion"&&!e.operation){let s=x2(t,e.parameter);return s!==null?s:x(await Hs(t,e,n))}if(e.type==="DoubleQuoted"){let s=y;for(let i of e.parts)s=j(s,await Dc(t,i,!0));return s}return e.type==="CommandSubstitution"?Wg(t,e):x(await zg(t,e,n))}async function Wg(t,e){let n=C2(e.body);if(n)try{let u=await de(t,n.target),f=u.startsWith("/")?u:`${t.state.cwd}/${u}`,p=await t.fs.readFile(f);t.state.lastExitCode=0,T(t.state.env,"?","0");let h=p.replace(/\n+$/,"");return Tc(h,t.limits.maxStringLength,"command substitution"),x(h)}catch(u){if(u instanceof ae)throw u;return t.state.lastExitCode=1,T(t.state.env,"?","1"),y}let r=t.substitutionDepth??0,s=t.limits.maxSubstitutionDepth;if(r>=s)throw new ae(`Command substitution nesting limit exceeded (${s})`,"substitution_depth");let i=t.substitutionDepth;t.substitutionDepth=r+1;let o=t.state.bashPid;t.state.bashPid=t.state.nextVirtualPid++;let a=new Map(t.state.env),l=t.state.cwd,c=t.state.suppressVerbose;t.state.suppressVerbose=!0;try{let u=await t.executeScript(e.body),f=u.exitCode;t.state.env=a,t.state.cwd=l,t.state.suppressVerbose=c,t.state.lastExitCode=f,T(t.state.env,"?",String(f)),Mt(u.stderr)||(t.state.expansionStderr=(t.state.expansionStderr||"")+R(u.stderr)),t.state.bashPid=o,t.substitutionDepth=i;let p=vr(u.stdout);if(p.length>t.limits.maxStringLength)throw new ae(`command substitution: string length limit exceeded (${t.limits.maxStringLength} bytes)`,"string_length");return p}catch(u){if(t.state.env=a,t.state.cwd=l,t.state.bashPid=o,t.substitutionDepth=i,t.state.suppressVerbose=c,u instanceof ae)throw u;if(u instanceof Ee){t.state.lastExitCode=u.exitCode,T(t.state.env,"?",String(u.exitCode)),Mt(u.stderr)||(t.state.expansionStderr=(t.state.expansionStderr||"")+R(u.stderr));let f=vr(u.stdout);if(f.length>t.limits.maxStringLength)throw new ae(`command substitution: string length limit exceeded (${t.limits.maxStringLength} bytes)`,"string_length");return f}throw u}}async function zg(t,e,n=!1){if(e.type==="ParameterExpansion")return Hs(t,e,n);let r=cE(t,e,n);if(r!==null)return r;switch(e.type){case"DoubleQuoted":{let s=[];for(let i of e.parts)s.push(await zg(t,i,!0));return s.join("")}case"CommandSubstitution":{let s=await Wg(t,e);return R(s)}case"ArithmeticExpansion":{let s=e.expression.originalText;if(s&&/\$[a-zA-Z_][a-zA-Z0-9_]*(?![{[(])/.test(s)){let o=await E2(t,s),a=new ye,l=Te(a,o);return String(await ue(t,l.expression,!0))}return String(await ue(t,e.expression.expression,!0))}case"BraceExpansion":{let s=[];for(let i of e.items)if(i.type==="Range"){let o=Sc(i.start,i.end,i.step,i.startStr,i.endStr);if(o.expanded)s.push(...o.expanded);else return o.literal}else s.push(await de(t,i.word));return s.join(" ")}default:return""}}async function ln(t,e,n=!1){return R(await Dc(t,e,n))}async function Hs(t,e,n=!1){let{parameter:r}=e,{operation:s}=e,i=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(i){let[,p,h]=i;if(t.state.associativeArrays?.has(p)||h.includes("$(")||h.includes("`")||h.includes("${")){let d=await Ac(t,h);r=`${p}[${d}]`}}else if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)&&_e(t,r)){let p=bt(t,r);if(p&&p!==r){let h=p.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(h){let[,m,d]=h;if(t.state.associativeArrays?.has(m)||d.includes("$(")||d.includes("`")||d.includes("${")){let w=await Ac(t,d);r=`${m}[${w}]`}}}}let o=s&&(s.type==="DefaultValue"||s.type==="AssignDefault"||s.type==="UseAlternative"||s.type==="ErrorIfUnset"),a=await Oe(t,r,!o);if(!s)return a;let l=!await vn(t,r),{isEmpty:c,effectiveValue:u}=U2(t,r,a,n),f={value:a,isUnset:l,isEmpty:c,effectiveValue:u,inDoubleQuotes:n};switch(s.type){case"DefaultValue":return v2(t,s,f,mn);case"AssignDefault":return k2(t,r,s,f,mn);case"ErrorIfUnset":return I2(t,r,s,f,mn);case"UseAlternative":return T2(t,s,f,mn);case"PatternRemoval":return O2(t,a,s,mn,ln);case"PatternReplacement":return R2(t,a,s,mn,ln);case"Length":return P2(t,r,a);case"LengthSliceError":throw new Tt(r);case"BadSubstitution":throw new Tt(s.text);case"Substring":return $2(t,r,a,s);case"CaseModification":return D2(t,a,s,mn,Hs);case"Transform":return _2(t,r,a,l,s);case"Indirection":return M2(t,r,a,l,s,Hs,n);case"ArrayKeys":return L2(t,s);case"VarNamePrefix":return F2(t,s);default:return a}}var uE,Ic,Dt=I(()=>{"use strict";St();it();ho();F();$t();Ne();mo();A2();S2();N2();es();B2();j2();V2();Ht();Tg();$g();Xt();an();Lg();es();Ht();uE=1e4,Ic=1e5});function hE(t,e,n){switch(n){case"+":return t+e;case"-":return t-e;case"*":return t*e;case"/":if(e===0)throw new Be("division by 0");return Math.trunc(t/e);case"%":if(e===0)throw new Be("division by 0");return t%e;case"**":if(e<0)throw new Be("exponent less than 0");return t**e;case"<<":return t<<e;case">>":return t>>e;case"<":return t<e?1:0;case"<=":return t<=e?1:0;case">":return t>e?1:0;case">=":return t>=e?1:0;case"==":return t===e?1:0;case"!=":return t!==e?1:0;case"&":return t&e;case"|":return t|e;case"^":return t^e;case",":return e;default:return 0}}function Hg(t,e,n){switch(n){case"=":return e;case"+=":return t+e;case"-=":return t-e;case"*=":return t*e;case"/=":return e!==0?Math.trunc(t/e):0;case"%=":return e!==0?t%e:0;case"<<=":return t<<e;case">>=":return t>>e;case"&=":return t&e;case"|=":return t|e;case"^=":return t^e;default:return e}}function dE(t,e){switch(e){case"-":return-t;case"+":return+t;case"!":return t===0?1:0;case"~":return~t;default:return t}}async function mE(t,e){let n=t.state.env.get(e);if(n!==void 0)return R(n);let r=t.state.env.get(`${e}_0`);return r!==void 0?R(r):await Oe(t,e)}function gE(t){if(!t)return 0;let e=Number.parseInt(t,10);if(!Number.isNaN(e)&&/^-?\d+$/.test(t.trim()))return e;let n=t.trim();if(!n)return 0;try{let r=new ye,{expr:s,pos:i}=Kt(r,n,0);if(i<n.length){let o=n.slice(i).trim().split(/\s+/)[0];throw new Be(`${n}: syntax error in expression (error token is "${o}")`)}return s.type==="ArithNumber"?s.value:e||0}catch(r){if(r instanceof Be)throw r;let s=n.split(/\s+/).slice(1)[0]||n;throw new Be(`${n}: syntax error in expression (error token is "${s}")`)}}async function Mc(t,e){if(!e)return 0;let n=Number.parseInt(e,10);if(!Number.isNaN(n)&&/^-?\d+$/.test(e.trim()))return n;let r=e.trim();if(!r)return 0;let s=new ye,{expr:i,pos:o}=Kt(s,r,0);if(o<r.length){let a=r.slice(o).trim(),l=a.split(/\s+/)[0]||a;throw new Be(`syntax error in expression (error token is "${l}")`,y,y)}return await ue(t,i)}async function Lc(t,e,n=new Set){if(n.has(e))return 0;n.add(e);let r=await mE(t,e);if(!r)return 0;let s=Number.parseInt(r,10);if(!Number.isNaN(s)&&/^-?\d+$/.test(r.trim()))return s;let i=r.trim();if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(i))return await Lc(t,i,n);let o=new ye,{expr:a,pos:l}=Kt(o,i,0);if(l<i.length){let c=i.slice(l).trim(),u=c.split(/\s+/)[0]||c;throw new Be(`${i}: syntax error in expression (error token is "${u}")`)}return await ue(t,a)}async function ko(t,e){if(e.startsWith("#")){let p=e.slice(1),h=p.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(h){let d=h[1],g=me(t,d);return String(g.length)}let m=$(t.state.env,p);return String(m.length)}if(e.startsWith("!")){let p=e.slice(1),h=$(t.state.env,p);return $(t.state.env,h)}let n=[":-",":=",":?",":+","-","=","?","+"],r=-1,s="";for(let p of n){let h=e.indexOf(p);h>0&&(r===-1||h<r)&&(r=h,s=p)}if(r===-1)return await Oe(t,e);let i=e.slice(0,r),o=e.slice(r+s.length),a=t.state.env.get(i),l=a===void 0,c=a!==void 0?R(a):"",u=c==="",f=s.startsWith(":");switch(s){case":-":case"-":return l||f&&u?o:c;case":=":case"=":return l||f&&u?(T(t.state.env,i,o),o):c;case":+":case"+":return!(l||f&&u)?o:"";case":?":case"?":{if(l||f&&u)throw new Error(o||`${i}: parameter null or not set`);return c}default:return c}}async function ue(t,e,n=!1){switch(e.type){case"ArithNumber":if(Number.isNaN(e.value))throw new Be("value too great for base");return e.value;case"ArithVariable":return await Lc(t,e.name);case"ArithSpecialVar":{let s=(await Oe(t,e.name)).trim();if(!s)return 0;let i=Number.parseInt(s,10);if(!Number.isNaN(i)&&/^-?\d+$/.test(s))return i;let o=new ye,{expr:a}=Kt(o,s,0);return await ue(t,a)}case"ArithNested":return await ue(t,e.expression);case"ArithCommandSubst":{if(t.execFn){let r=await t.execFn(e.command);r.stderr.length>0&&(t.state.expansionStderr=(t.state.expansionStderr||"")+R(r.stderr));let s=R(vr(r.stdout)).trim();return Number.parseInt(s,10)||0}return 0}case"ArithBracedExpansion":{let r=await ko(t,e.content);return Number.parseInt(r,10)||0}case"ArithDynamicBase":{let r=await ko(t,e.baseExpr),s=Number.parseInt(r,10);if(s<2||s>64)return 0;let i=`${s}#${e.value}`;return Fs(i)}case"ArithDynamicNumber":{let s=await ko(t,e.prefix)+e.suffix;return Fs(s)}case"ArithArrayElement":{let r=t.state.associativeArrays?.has(e.array),s=async i=>{let o=t.state.env.get(i);return o!==void 0?await Mc(t,R(o)):0};if(e.stringKey!==void 0)return await s(`${e.array}_${e.stringKey}`);if(r&&e.index?.type==="ArithVariable"&&!e.index.hasDollarPrefix)return await s(`${e.array}_${e.index.name}`);if(r&&e.index?.type==="ArithVariable"&&e.index.hasDollarPrefix){let i=await Oe(t,e.index.name);return await s(`${e.array}_${i}`)}if(e.index){let i=await ue(t,e.index,n);if(i<0){let l=me(t,e.array),c=t.state.currentLine;if(l.length===0)return t.state.expansionStderr=(t.state.expansionStderr||"")+`bash: line ${c}: ${e.array}: bad array subscript
780
+ `,0;let f=Math.max(...l.map(([p])=>typeof p=="number"?p:0))+1+i;if(f<0)return t.state.expansionStderr=(t.state.expansionStderr||"")+`bash: line ${c}: ${e.array}: bad array subscript
781
+ `,0;i=f}let o=`${e.array}_${i}`,a=t.state.env.get(o);if(a!==void 0)return Mc(t,R(a));if(i===0){let l=t.state.env.get(e.array);if(l!==void 0)return Mc(t,R(l))}if(t.state.options.nounset&&!Array.from(t.state.env.keys()).some(c=>c===e.array||c.startsWith(`${e.array}_`)))throw new It(`${e.array}[${i}]`);return 0}return 0}case"ArithDoubleSubscript":throw new Be("double subscript",y,y);case"ArithNumberSubscript":throw new Be(`${e.number}${e.errorToken}: syntax error: invalid arithmetic operator (error token is "${e.errorToken}")`);case"ArithSyntaxError":throw new Be(e.message,y,y,!0);case"ArithSingleQuote":{if(n)throw new Be(`syntax error: operand expected (error token is "'${e.content}'")`);return e.value}case"ArithBinary":{if(e.operator==="||")return await ue(t,e.left,n)||await ue(t,e.right,n)?1:0;if(e.operator==="&&")return await ue(t,e.left,n)&&await ue(t,e.right,n)?1:0;let r=await ue(t,e.left,n),s=await ue(t,e.right,n);return hE(r,s,e.operator)}case"ArithUnary":{let r=await ue(t,e.operand,n);if(e.operator==="++"||e.operator==="--"){if(e.operand.type==="ArithVariable"){let s=e.operand.name,i=Number.parseInt(await Oe(t,s),10)||0,o=e.operator==="++"?i+1:i-1;return T(t.state.env,s,String(o)),e.prefix?o:i}if(e.operand.type==="ArithArrayElement"){let s=e.operand.array,i=t.state.associativeArrays?.has(s),o;if(e.operand.stringKey!==void 0)o=`${s}_${e.operand.stringKey}`;else if(i&&e.operand.index?.type==="ArithVariable"&&!e.operand.index.hasDollarPrefix)o=`${s}_${e.operand.index.name}`;else if(i&&e.operand.index?.type==="ArithVariable"&&e.operand.index.hasDollarPrefix){let c=await Oe(t,e.operand.index.name);o=`${s}_${c}`}else if(e.operand.index){let c=await ue(t,e.operand.index,n);o=`${s}_${c}`}else return r;let a=Number.parseInt($(t.state.env,o,"0"),10)||0,l=e.operator==="++"?a+1:a-1;return T(t.state.env,o,String(l)),e.prefix?l:a}if(e.operand.type==="ArithConcat"){let s="";for(let i of e.operand.parts)s+=await ss(t,i,n);if(s&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)){let i=Number.parseInt($(t.state.env,s,"0"),10)||0,o=e.operator==="++"?i+1:i-1;return T(t.state.env,s,String(o)),e.prefix?o:i}}if(e.operand.type==="ArithDynamicElement"){let s="";if(e.operand.nameExpr.type==="ArithConcat")for(let i of e.operand.nameExpr.parts)s+=await ss(t,i,n);else e.operand.nameExpr.type==="ArithVariable"&&(s=e.operand.nameExpr.hasDollarPrefix?await Oe(t,e.operand.nameExpr.name):e.operand.nameExpr.name);if(s&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)){let i=await ue(t,e.operand.subscript,n),o=`${s}_${i}`,a=Number.parseInt($(t.state.env,o,"0"),10)||0,l=e.operator==="++"?a+1:a-1;return T(t.state.env,o,String(l)),e.prefix?l:a}}return r}return dE(r,e.operator)}case"ArithTernary":return await ue(t,e.condition,n)?await ue(t,e.consequent,n):await ue(t,e.alternate,n);case"ArithAssignment":{let r=e.variable,s=r;if(e.stringKey!==void 0)s=`${r}_${e.stringKey}`;else if(e.subscript){let l=t.state.associativeArrays?.has(r);if(l&&e.subscript.type==="ArithVariable"&&!e.subscript.hasDollarPrefix)s=`${r}_${e.subscript.name}`;else if(l&&e.subscript.type==="ArithVariable"&&e.subscript.hasDollarPrefix){let c=await Oe(t,e.subscript.name);s=`${r}_${c||"\\"}`}else if(l){let c=await ue(t,e.subscript,n);s=`${r}_${c}`}else{let c=await ue(t,e.subscript,n);if(c<0){let u=me(t,r);u.length>0&&(c=Math.max(...u.map(([p])=>typeof p=="number"?p:0))+1+c)}s=`${r}_${c}`}}let i=Number.parseInt($(t.state.env,s,"0"),10)||0,o=await ue(t,e.value,n),a=Hg(i,o,e.operator);return T(t.state.env,s,String(a)),a}case"ArithGroup":return await ue(t,e.expression,n);case"ArithConcat":{let r="";for(let s of e.parts)r+=await ss(t,s,n);return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)?await Lc(t,r):Number.parseInt(r,10)||0}case"ArithDynamicAssignment":{let r="";if(e.target.type==="ArithConcat")for(let l of e.target.parts)r+=await ss(t,l,n);else e.target.type==="ArithVariable"&&(r=e.target.hasDollarPrefix?await Oe(t,e.target.name):e.target.name);if(!r||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r))return 0;let s=r;if(e.subscript){let l=await ue(t,e.subscript,n);s=`${r}_${l}`}let i=Number.parseInt($(t.state.env,s,"0"),10)||0,o=await ue(t,e.value,n),a=Hg(i,o,e.operator);return T(t.state.env,s,String(a)),a}case"ArithDynamicElement":{let r="";if(e.nameExpr.type==="ArithConcat")for(let a of e.nameExpr.parts)r+=await ss(t,a,n);else e.nameExpr.type==="ArithVariable"&&(r=e.nameExpr.hasDollarPrefix?await Oe(t,e.nameExpr.name):e.nameExpr.name);if(!r||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r))return 0;let s=await ue(t,e.subscript,n),i=`${r}_${s}`,o=t.state.env.get(i);return o!==void 0?gE(R(o)):0}default:return 0}}async function ss(t,e,n=!1){switch(e.type){case"ArithNumber":return String(e.value);case"ArithSingleQuote":return String(await ue(t,e,n));case"ArithVariable":return e.hasDollarPrefix?await Oe(t,e.name):e.name;case"ArithSpecialVar":return await Oe(t,e.name);case"ArithBracedExpansion":return await ko(t,e.content);case"ArithCommandSubst":{if(t.execFn){let r=await t.execFn(e.command);return R(vr(r.stdout)).trim()}return"0"}case"ArithConcat":{let r="";for(let s of e.parts)r+=await ss(t,s,n);return r}default:return String(await ue(t,e,n))}}var $t=I(()=>{"use strict";St();it();F();Ne();Dt()});var Bl=[{name:"echo",load:async()=>(await Promise.resolve().then(()=>(Mu(),_u))).echoCommand},{name:"cat",load:async()=>(await Promise.resolve().then(()=>(Fu(),Lu))).catCommand},{name:"printf",load:async()=>(await Promise.resolve().then(()=>(Qu(),Yu))).printfCommand},{name:"ls",load:async()=>(await Promise.resolve().then(()=>(ef(),Ju))).lsCommand},{name:"mkdir",load:async()=>(await Promise.resolve().then(()=>(nf(),tf))).mkdirCommand},{name:"rmdir",load:async()=>(await Promise.resolve().then(()=>(af(),of))).rmdirCommand},{name:"touch",load:async()=>(await Promise.resolve().then(()=>(cf(),lf))).touchCommand},{name:"rm",load:async()=>(await Promise.resolve().then(()=>(ff(),uf))).rmCommand},{name:"cp",load:async()=>(await Promise.resolve().then(()=>(hf(),pf))).cpCommand},{name:"mv",load:async()=>(await Promise.resolve().then(()=>(mf(),df))).mvCommand},{name:"ln",load:async()=>(await Promise.resolve().then(()=>(yf(),gf))).lnCommand},{name:"chmod",load:async()=>(await Promise.resolve().then(()=>(xf(),bf))).chmodCommand},{name:"pwd",load:async()=>(await Promise.resolve().then(()=>(Af(),Ef))).pwdCommand},{name:"readlink",load:async()=>(await Promise.resolve().then(()=>(Cf(),Sf))).readlinkCommand},{name:"head",load:async()=>(await Promise.resolve().then(()=>(If(),kf))).headCommand},{name:"tail",load:async()=>(await Promise.resolve().then(()=>(Of(),Tf))).tailCommand},{name:"wc",load:async()=>(await Promise.resolve().then(()=>($f(),Pf))).wcCommand},{name:"stat",load:async()=>(await Promise.resolve().then(()=>(Mf(),_f))).statCommand},{name:"grep",load:async()=>(await Promise.resolve().then(()=>(wi(),yi))).grepCommand},{name:"fgrep",load:async()=>(await Promise.resolve().then(()=>(wi(),yi))).fgrepCommand},{name:"egrep",load:async()=>(await Promise.resolve().then(()=>(wi(),yi))).egrepCommand},{name:"rg",load:async()=>(await Promise.resolve().then(()=>(v1(),N1))).rgCommand},{name:"sed",load:async()=>(await Promise.resolve().then(()=>(L1(),M1))).sedCommand},{name:"awk",load:async()=>(await Promise.resolve().then(()=>(mp(),dp))).awkCommand2},{name:"sort",load:async()=>(await Promise.resolve().then(()=>(Np(),Cp))).sortCommand},{name:"uniq",load:async()=>(await Promise.resolve().then(()=>(kp(),vp))).uniqCommand},{name:"comm",load:async()=>(await Promise.resolve().then(()=>(Tp(),Ip))).commCommand},{name:"cut",load:async()=>(await Promise.resolve().then(()=>(Rp(),Op))).cutCommand},{name:"paste",load:async()=>(await Promise.resolve().then(()=>(Dp(),$p))).pasteCommand},{name:"tr",load:async()=>(await Promise.resolve().then(()=>(Lp(),Mp))).trCommand},{name:"rev",load:async()=>(await Promise.resolve().then(()=>(Up(),Fp))).rev},{name:"nl",load:async()=>(await Promise.resolve().then(()=>(zp(),Wp))).nl},{name:"fold",load:async()=>(await Promise.resolve().then(()=>(Gp(),jp))).fold},{name:"expand",load:async()=>(await Promise.resolve().then(()=>(Zp(),qp))).expand},{name:"unexpand",load:async()=>(await Promise.resolve().then(()=>(Xp(),Kp))).unexpand},{name:"strings",load:async()=>(await Promise.resolve().then(()=>(nh(),th))).strings},{name:"split",load:async()=>(await Promise.resolve().then(()=>(ih(),sh))).split},{name:"column",load:async()=>(await Promise.resolve().then(()=>(lh(),ah))).column},{name:"join",load:async()=>(await Promise.resolve().then(()=>(uh(),ch))).join},{name:"tee",load:async()=>(await Promise.resolve().then(()=>(ph(),fh))).teeCommand},{name:"find",load:async()=>(await Promise.resolve().then(()=>(Eh(),xh))).findCommand},{name:"basename",load:async()=>(await Promise.resolve().then(()=>(Sh(),Ah))).basenameCommand},{name:"dirname",load:async()=>(await Promise.resolve().then(()=>(Nh(),Ch))).dirnameCommand},{name:"tree",load:async()=>(await Promise.resolve().then(()=>(Ih(),kh))).treeCommand},{name:"du",load:async()=>(await Promise.resolve().then(()=>(Rh(),Oh))).duCommand},{name:"env",load:async()=>(await Promise.resolve().then(()=>(Xa(),Ka))).envCommand},{name:"printenv",load:async()=>(await Promise.resolve().then(()=>(Xa(),Ka))).printenvCommand},{name:"alias",load:async()=>(await Promise.resolve().then(()=>(el(),Ja))).aliasCommand},{name:"unalias",load:async()=>(await Promise.resolve().then(()=>(el(),Ja))).unaliasCommand},{name:"history",load:async()=>(await Promise.resolve().then(()=>(Dh(),$h))).historyCommand},{name:"xargs",load:async()=>(await Promise.resolve().then(()=>(Mh(),_h))).xargsCommand},{name:"true",load:async()=>(await Promise.resolve().then(()=>(nl(),tl))).trueCommand},{name:"false",load:async()=>(await Promise.resolve().then(()=>(nl(),tl))).falseCommand},{name:"clear",load:async()=>(await Promise.resolve().then(()=>(Fh(),Lh))).clearCommand},{name:"bash",load:async()=>(await Promise.resolve().then(()=>(sl(),rl))).bashCommand},{name:"sh",load:async()=>(await Promise.resolve().then(()=>(sl(),rl))).shCommand},{name:"jq",load:async()=>(await Promise.resolve().then(()=>(hd(),pd))).jqCommand},{name:"base64",load:async()=>(await Promise.resolve().then(()=>(gd(),md))).base64Command},{name:"diff",load:async()=>(await Promise.resolve().then(()=>(bd(),wd))).diffCommand},{name:"date",load:async()=>(await Promise.resolve().then(()=>(Ed(),xd))).dateCommand},{name:"sleep",load:async()=>(await Promise.resolve().then(()=>(Sd(),Ad))).sleepCommand},{name:"timeout",load:async()=>(await Promise.resolve().then(()=>(Nd(),Cd))).timeoutCommand},{name:"time",load:async()=>(await Promise.resolve().then(()=>(kd(),vd))).timeCommand},{name:"seq",load:async()=>(await Promise.resolve().then(()=>(Td(),Id))).seqCommand},{name:"expr",load:async()=>(await Promise.resolve().then(()=>(Rd(),Od))).exprCommand},{name:"md5sum",load:async()=>(await Promise.resolve().then(()=>(Dd(),$d))).md5sumCommand},{name:"sha1sum",load:async()=>(await Promise.resolve().then(()=>(Md(),_d))).sha1sumCommand},{name:"sha256sum",load:async()=>(await Promise.resolve().then(()=>(Fd(),Ld))).sha256sumCommand},{name:"file",load:async()=>(await Promise.resolve().then(()=>(T0(),I0))).fileCommand},{name:"html-to-markdown",load:async()=>(await Promise.resolve().then(()=>(R0(),O0))).htmlToMarkdownCommand},{name:"help",load:async()=>(await Promise.resolve().then(()=>($0(),P0))).helpCommand},{name:"which",load:async()=>(await Promise.resolve().then(()=>(_0(),D0))).whichCommand},{name:"tac",load:async()=>(await Promise.resolve().then(()=>(L0(),M0))).tac},{name:"hostname",load:async()=>(await Promise.resolve().then(()=>(U0(),F0))).hostname},{name:"whoami",load:async()=>(await Promise.resolve().then(()=>(W0(),B0))).whoami},{name:"od",load:async()=>(await Promise.resolve().then(()=>(H0(),z0))).od},{name:"gzip",load:async()=>(await Promise.resolve().then(()=>(ro(),no))).gzipCommand},{name:"gunzip",load:async()=>(await Promise.resolve().then(()=>(ro(),no))).gunzipCommand},{name:"zcat",load:async()=>(await Promise.resolve().then(()=>(ro(),no))).zcatCommand}],Fb=[],im=[{name:"curl",load:async()=>(await Promise.resolve().then(()=>(rm(),nm))).curlCommand}],sm=new Map;function Wl(t){return{name:t.name,async execute(e,n){let r=sm.get(t.name);return r||(r=await t.load(),sm.set(t.name,r)),n.coverage,r.execute(e,n)}}}function Ub(){return Bl.map(t=>t.name)}function Bb(){return im.map(t=>t.name)}function om(t){return(t?Bl.filter(n=>t.includes(n.name)):Bl).map(Wl)}function am(){return im.map(Wl)}function lm(){return Fb.map(Wl)}F();function cm(t){return"load"in t&&typeof t.load=="function"}function Wb(t,e){return{name:t,async execute(n,r){let s={...r,env:si(r.env)},i=await e(W(n),s);return typeof i.stdout=="string"?{stdout:x(i.stdout),stderr:x(i.stderr),exitCode:i.exitCode}:i}}}function um(t){let e=null;return{name:t.name,async execute(n,r){return e||(e=await t.load()),e.execute(n,r)}}}var zb=new TextEncoder,Hb=new TextDecoder;function zl(t,e){if(t instanceof Uint8Array)return t;if(e==="base64")return Uint8Array.from(atob(t),n=>n.charCodeAt(0));if(e==="hex"){let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=parseInt(t.slice(r,r+2),16);return n}if(e==="binary"||e==="latin1"){if(t.length<=65536)return Uint8Array.from(t,s=>s.charCodeAt(0));let r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r}return zb.encode(t)}function fm(t,e){if(e==="base64")return btoa(String.fromCharCode(...t));if(e==="hex")return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("");if(e==="binary"||e==="latin1"){if(typeof Buffer<"u")return Buffer.from(t).toString(e);let n=65536;if(t.length<=n)return String.fromCharCode(...t);let r="";for(let s=0;s<t.length;s+=n){let i=t.subarray(s,s+n);r+=String.fromCharCode(...i)}return r}return Hb.decode(t)}function so(t){if(t!=null)return typeof t=="string"?t:t.encoding??void 0}var io=new TextEncoder;function jb(t){return typeof t=="object"&&t!==null&&!(t instanceof Uint8Array)&&"content"in t}function yt(t,e){if(t.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${e} '${t}'`)}var gr=class{data=new Map;constructor(e){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),e)for(let[n,r]of Object.entries(e))jb(r)?this.writeFileSync(n,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(n,r)}normalizePath(e){if(!e||e==="/")return"/";let n=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;n.startsWith("/")||(n=`/${n}`);let r=n.split("/").filter(i=>i&&i!=="."),s=[];for(let i of r)i===".."?s.pop():s.push(i);return`/${s.join("/")}`||"/"}dirname(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.lastIndexOf("/");return r===0?"/":n.slice(0,r)}ensureParentDirs(e){let n=this.dirname(e);n!=="/"&&(this.data.has(n)||(this.ensureParentDirs(n),this.data.set(n,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(e,n,r,s){yt(e,"write");let i=this.normalizePath(e);this.ensureParentDirs(i);let o=so(r),a=zl(n,o);this.data.set(i,{type:"file",content:a,mode:s?.mode??420,mtime:s?.mtime??new Date})}async readFile(e,n){let r=await this.readFileBuffer(e),s=so(n);return fm(r,s)}async readFileBuffer(e){yt(e,"open");let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${e}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${e}'`);return r.content instanceof Uint8Array?r.content:io.encode(r.content)}async writeFile(e,n,r){this.writeFileSync(e,n,r)}async appendFile(e,n,r){yt(e,"append");let s=this.normalizePath(e),i=this.data.get(s);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${e}'`);let o=so(r),a=zl(n,o);if(i?.type==="file"){let l=i.content instanceof Uint8Array?i.content:io.encode(i.content),c=new Uint8Array(l.length+a.length);c.set(l),c.set(a,l.length),this.data.set(s,{type:"file",content:c,mode:i.mode,mtime:new Date})}else this.writeFileSync(e,n,r)}async exists(e){if(e.includes("\0"))return!1;try{let n=this.resolvePathWithSymlinks(e);return this.data.has(n)}catch{return!1}}async stat(e){yt(e,"stat");let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${e}'`);let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=io.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}async lstat(e){yt(e,"lstat");let n=this.resolveIntermediateSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${e}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=io.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}resolveSymlink(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=this.dirname(e);return this.normalizePath(r==="/"?`/${n}`:`${r}/${n}`)}resolveIntermediateSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/");if(r.length<=1)return n;let s="",i=new Set;for(let o=0;o<r.length-1;o++){let a=r[o];s=`${s}/${a}`;let l=this.data.get(s),c=0,u=40;for(;l&&l.type==="symlink"&&c<u;){if(i.has(s))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`);i.add(s),s=this.resolveSymlink(s,l.target),l=this.data.get(s),c++}if(c>=u)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`)}return`${s}/${r[r.length-1]}`}resolvePathWithSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/"),s="",i=new Set;for(let o of r){s=`${s}/${o}`;let a=this.data.get(s),l=0,c=40;for(;a&&a.type==="symlink"&&l<c;){if(i.has(s))throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`);i.add(s),s=this.resolveSymlink(s,a.target),a=this.data.get(s),l++}if(l>=c)throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`)}return s}async mkdir(e,n){this.mkdirSync(e,n)}mkdirSync(e,n){yt(e,"mkdir");let r=this.normalizePath(e);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${e}'`);if(!n?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${e}'`);return}let s=this.dirname(r);if(s!=="/"&&!this.data.has(s))if(n?.recursive)this.mkdirSync(s,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(e){return(await this.readdirWithFileTypes(e)).map(r=>r.name)}async readdirWithFileTypes(e){yt(e,"scandir");let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);let s=new Set;for(;r&&r.type==="symlink";){if(s.has(n))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${e}'`);s.add(n),n=this.resolveSymlink(n,r.target),r=this.data.get(n)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);let i=n==="/"?"/":`${n}/`,o=new Map;for(let[a,l]of this.data.entries())if(a!==n&&a.startsWith(i)){let c=a.slice(i.length),u=c.split("/")[0];u&&!c.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(e,n){yt(e,"rm");let r=this.normalizePath(e),s=this.data.get(r);if(!s){if(n?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${e}'`)}if(s.type==="directory"){let i=await this.readdir(r);if(i.length>0){if(!n?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${e}'`);for(let o of i){let a=r==="/"?`/${o}`:`${r}/${o}`;await this.rm(a,n)}}}this.data.delete(r)}async cp(e,n,r){yt(e,"cp"),yt(n,"cp");let s=this.normalizePath(e),i=this.normalizePath(n),o=this.data.get(s);if(!o)throw new Error(`ENOENT: no such file or directory, cp '${e}'`);if(o.type==="file")this.ensureParentDirs(i),this.data.set(i,{...o});else if(o.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${e}'`);await this.mkdir(i,{recursive:!0});let a=await this.readdir(s);for(let l of a){let c=s==="/"?`/${l}`:`${s}/${l}`,u=i==="/"?`/${l}`:`${i}/${l}`;await this.cp(c,u,r)}}}async mv(e,n){await this.cp(e,n,{recursive:!0}),await this.rm(e,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=e==="/"?`/${n}`:`${e}/${n}`;return this.normalizePath(r)}async chmod(e,n){yt(e,"chmod");let r=this.normalizePath(e),s=this.data.get(r);if(!s)throw new Error(`ENOENT: no such file or directory, chmod '${e}'`);s.mode=n}async symlink(e,n){yt(n,"symlink");let r=this.normalizePath(n);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${n}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:e,mode:511,mtime:new Date})}async link(e,n){yt(e,"link"),yt(n,"link");let r=this.normalizePath(e),s=this.normalizePath(n),i=this.data.get(r);if(!i)throw new Error(`ENOENT: no such file or directory, link '${e}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${e}'`);if(this.data.has(s))throw new Error(`EEXIST: file already exists, link '${n}'`);this.ensureParentDirs(s),this.data.set(s,{type:"file",content:i.content,mode:i.mode,mtime:i.mtime})}async readlink(e){yt(e,"readlink");let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${e}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${e}'`);return r.target}async realpath(e){yt(e,"realpath");let n=this.resolvePathWithSymlinks(e);if(!this.data.has(n))throw new Error(`ENOENT: no such file or directory, realpath '${e}'`);return n}async utimes(e,n,r){yt(e,"utimes");let s=this.normalizePath(e),i=this.resolvePathWithSymlinks(s),o=this.data.get(i);if(!o)throw new Error(`ENOENT: no such file or directory, utimes '${e}'`);o.mtime=r}};oo();function Gb(t){let e=t;return typeof e.mkdirSync=="function"&&typeof e.writeFileSync=="function"}function Vb(t,e){t.mkdirSync("/bin",{recursive:!0}),t.mkdirSync("/usr/bin",{recursive:!0}),e&&(t.mkdirSync("/home/user",{recursive:!0}),t.mkdirSync("/tmp",{recursive:!0}))}function qb(t){t.mkdirSync("/dev",{recursive:!0}),t.writeFileSync("/dev/null",""),t.writeFileSync("/dev/zero",new Uint8Array(0)),t.writeFileSync("/dev/stdin",""),t.writeFileSync("/dev/stdout",""),t.writeFileSync("/dev/stderr","")}function Zb(t){t.mkdirSync("/proc/self/fd",{recursive:!0}),t.writeFileSync("/proc/version",`${hm}
782
+ `),t.writeFileSync("/proc/self/exe","/bin/bash"),t.writeFileSync("/proc/self/cmdline","bash\0"),t.writeFileSync("/proc/self/comm",`bash
783
+ `),t.writeFileSync("/proc/self/status",dm()),t.writeFileSync("/proc/self/fd/0","/dev/stdin"),t.writeFileSync("/proc/self/fd/1","/dev/stdout"),t.writeFileSync("/proc/self/fd/2","/dev/stderr")}function mm(t,e){Gb(t)&&(Vb(t,e),qb(t),Zb(t))}Wn();Ne();F();var Yb=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],Qb=["braceexpand","hashall","interactive-comments"];function Hl(t){let e=[],n=[...Qb.map(r=>({name:r,enabled:!0})),...Yb.map(r=>({name:r,enabled:t[r]}))].sort((r,s)=>r.name.localeCompare(s.name));for(let r of n)r.enabled&&e.push(r.name);return e.join(":")}function Kr(t){T(t.state.env,"SHELLOPTS",Hl(t.state.options))}var Kb=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function jl(t){let e=[];for(let n of Kb)t[n]&&e.push(n);return e.join(":")}function Gl(t){T(t.state.env,"BASHOPTS",jl(t.state.shoptOptions))}Wn();yr();F();it();yr();F();var vx="BASH_ALIAS_";function i2(t){return t.parts.length!==1?!1:t.parts[0].type==="Literal"}function o2(t){if(t.parts.length!==1)return null;let e=t.parts[0];return e.type==="Literal"?e.value:null}function a2(t,e){let n=t.env.get(`${vx}${e}`);return n!==void 0?R(n):void 0}function hc(t,e,n){if(!e.name||!i2(e.name))return e;let r=o2(e.name);if(!r)return e;let s=a2(t,r);if(!s||n.has(r))return e;try{n.add(r);let i=new ye,o=s,a=s.endsWith(" ");if(!a)for(let f of e.args){let p=c2(f);o+=` ${p}`}let l;try{l=i.parse(o)}catch(f){if(f instanceof dt)throw f;return e}if(l.statements.length!==1||l.statements[0].pipelines.length!==1||l.statements[0].pipelines[0].commands.length!==1)return l2(e,s);let c=l.statements[0].pipelines[0].commands[0];if(c.type!=="SimpleCommand")return l2(e,s);let u={...c,assignments:[...e.assignments,...c.assignments],redirections:[...c.redirections,...e.redirections],line:e.line};if(a&&e.args.length>0&&(u={...u,args:[...u.args,...e.args]},u.args.length>0)){let f=u.args[0];if(i2(f)){let p=o2(f);if(p&&a2(t,p)){let h={type:"SimpleCommand",name:f,args:u.args.slice(1),assignments:[],redirections:[]},m=hc(t,h,n);m!==h&&(u={...u,name:m.name,args:[...m.args]})}}}return u}catch(i){throw n.delete(r),i}}function l2(t,e){let n=e;for(let o of t.args){let a=c2(o);n+=` ${a}`}let r=new ye,s=r.parseWordFromString("eval",!1,!1),i=r.parseWordFromString(`'${n.replace(/'/g,"'\\''")}'`,!1,!1);return{type:"SimpleCommand",name:s,args:[i],assignments:t.assignments,redirections:t.redirections,line:t.line}}function c2(t){let e="";for(let n of t.parts)switch(n.type){case"Literal":e+=n.value.replace(/([\s"'$`\\*?[\]{}()<>|&;#!])/g,"\\$1");break;case"SingleQuoted":e+=`'${n.value}'`;break;case"DoubleQuoted":e+=`"${n.parts.map(r=>r.type==="Literal"?r.value:`$${r.type}`).join("")}"`;break;case"ParameterExpansion":e+=`\${${n.parameter}}`;break;case"CommandSubstitution":e+="$(...)";break;case"ArithmeticExpansion":e+=`$((${n.expression}))`;break;case"Glob":e+=n.pattern;break;default:break}return e}$t();Dt();on();async function jg(t,e){let n=e.parts.map(u=>u.type==="Literal"?u.value:"\0").join(""),r=n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);if(!r||!n.endsWith(")"))return null;let s=r[1],i=[],o=!1,a="",l=!1;for(let u of e.parts)if(u.type==="Literal"){let f=u.value;if(!o){let p=f.indexOf("=(");p!==-1&&(o=!0,f=f.slice(p+2))}if(o){f.endsWith(")")&&(f=f.slice(0,-1));let p=f.split(/(\s+)/);for(let h of p)/^\s+$/.test(h)?(a||l)&&(i.push(a),a="",l=!1):h&&(a+=h)}}else if(o)if(u.type==="BraceExpansion")if(/^\[.+\]=/.test(a))a+=Xr({type:"Word",parts:[u]});else{(a||l)&&(i.push(a),a="",l=!1);let p=await gn(t,{type:"Word",parts:[u]});i.push(...p.values)}else{(u.type==="SingleQuoted"||u.type==="DoubleQuoted"||u.type==="Escaped")&&(l=!0);let f=await de(t,{type:"Word",parts:[u]});a+=f}(a||l)&&i.push(a);let c=i.map(u=>/^\[.+\]=/.test(u)?u:u===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(u)&&!u.startsWith("'")&&!u.startsWith('"')?`'${u.replace(/'/g,"'\\''")}'`:u);return`${s}=(${c.join(" ")})`}async function Gg(t,e){let n=-1,r=-1,s=!1;for(let d=0;d<e.parts.length;d++){let g=e.parts[d];if(g.type==="Literal"){let w=g.value.indexOf("+=");if(w!==-1){let b=g.value.slice(0,w);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(b)){n=d,r=w,s=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(b)){n=d,r=w,s=!0;break}}let E=g.value.indexOf("=");if(E!==-1&&(E===0||g.value[E-1]!=="+")){let b=g.value.slice(0,E);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(b)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(b)){n=d,r=E;break}}}}if(n===-1)return null;let i=e.parts.slice(0,n),o=e.parts[n];if(o.type!=="Literal")return null;let a=s?2:1,l=o.value.slice(0,r),c=o.value.slice(r+a),u=e.parts.slice(n+1),f="";for(let d of i)f+=await de(t,{type:"Word",parts:[d]});f+=l;let p={type:"Word",parts:c!==""?[{type:"Literal",value:c},...u]:u},h=p.parts.length>0?await de(t,p):"";return`${f}${s?"+=":"="}${h}`}var yE=["tar","yq","xan","sqlite3","python3","python"];function Vg(t){return yE.includes(t)}F();F();Ne();F();Ne();var Se=Object.freeze({stdout:y,stderr:y,exitCode:0});function Jt(t=y){return{stdout:t,stderr:y,exitCode:0}}function Fe(t){return{stdout:x(t),stderr:y,exitCode:0}}function V(t,e=1){return{stdout:y,stderr:x(t),exitCode:e}}function K(t,e,n){return{stdout:t,stderr:e,exitCode:n}}function at(t){return{stdout:y,stderr:y,exitCode:t?0:1}}function Fn(t,e,n=y,r=y){throw new ae(t,e,n,r)}function Fc(t,e){if(t.state.loopDepth===0){if(t.state.parentHasLoopContext)throw new wn;return Se}if(e.length>1)throw new Ee(1,y,x(`bash: break: too many arguments
784
+ `));let n=1;if(e.length>0){let r=Number.parseInt(e[0],10);if(Number.isNaN(r)||r<1)throw new Ee(128,y,x(`bash: break: ${e[0]}: numeric argument required
785
+ `));n=r}throw new xt(n)}F();async function Uc(t,e){let n,r=!1,s=!1,i=0;for(;i<e.length;)if(e[i]==="--"){i++;break}else if(e[i]==="-L")s=!1,i++;else if(e[i]==="-P")s=!0,i++;else if(e[i].startsWith("-")&&e[i]!=="-")i++;else break;let o=e.slice(i);if(o.length===0?n=$(t.state.env,"HOME","/"):o[0]==="~"?n=$(t.state.env,"HOME","/"):o[0]==="-"?(n=t.state.previousDir,r=!0):n=o[0],!n.startsWith("/")&&!n.startsWith("./")&&!n.startsWith("../")&&n!=="."&&n!==".."){let f=t.state.env.get("CDPATH");if(f){let p=R(f??y).split(":").filter(h=>h);for(let h of p){let m=h.startsWith("/")?`${h}/${n}`:`${t.state.cwd}/${h}/${n}`;try{if((await t.fs.stat(m)).isDirectory){n=m,r=!0;break}}catch{}}}}let l=(n.startsWith("/")?n:`${t.state.cwd}/${n}`).split("/").filter(f=>f&&f!=="."),c="";for(let f of l)if(f==="..")c=c.split("/").slice(0,-1).join("/")||"/";else{c=c?`${c}/${f}`:`/${f}`;try{if(!(await t.fs.stat(c)).isDirectory)return V(`bash: cd: ${n}: Not a directory
786
+ `)}catch{return V(`bash: cd: ${n}: No such file or directory
787
+ `)}}let u=c||"/";if(s)try{u=await t.fs.realpath(u)}catch{}return t.state.previousDir=t.state.cwd,t.state.cwd=u,T(t.state.env,"PWD",t.state.cwd),T(t.state.env,"OLDPWD",t.state.previousDir),r?Fe(`${u}
788
+ `):Jt()}it();F();St();it();Ve();F();$t();Dt();on();function Bc(t,e){return t.fs.resolvePath(t.state.cwd,e)}var wE=["-e","-a","-f","-d","-r","-w","-x","-s","-L","-h","-k","-g","-u","-G","-O","-b","-c","-p","-S","-t","-N"];function Io(t){return wE.includes(t)}async function To(t,e,n){let r=Bc(t,n);switch(e){case"-e":case"-a":return t.fs.exists(r);case"-f":return await t.fs.exists(r)?(await t.fs.stat(r)).isFile:!1;case"-d":return await t.fs.exists(r)?(await t.fs.stat(r)).isDirectory:!1;case"-r":return await t.fs.exists(r)?((await t.fs.stat(r)).mode&256)!==0:!1;case"-w":return await t.fs.exists(r)?((await t.fs.stat(r)).mode&128)!==0:!1;case"-x":return await t.fs.exists(r)?((await t.fs.stat(r)).mode&64)!==0:!1;case"-s":return await t.fs.exists(r)?(await t.fs.stat(r)).size>0:!1;case"-L":case"-h":try{return(await t.fs.lstat(r)).isSymbolicLink}catch{return!1}case"-k":return await t.fs.exists(r)?((await t.fs.stat(r)).mode&512)!==0:!1;case"-g":return await t.fs.exists(r)?((await t.fs.stat(r)).mode&1024)!==0:!1;case"-u":return await t.fs.exists(r)?((await t.fs.stat(r)).mode&2048)!==0:!1;case"-G":case"-O":return t.fs.exists(r);case"-b":return!1;case"-c":return["/dev/null","/dev/zero","/dev/random","/dev/urandom","/dev/tty","/dev/stdin","/dev/stdout","/dev/stderr"].some(i=>r===i||r.endsWith(i));case"-p":return!1;case"-S":return!1;case"-t":return!1;case"-N":return t.fs.exists(r);default:return!1}}var bE=["-nt","-ot","-ef"];function Oo(t){return bE.includes(t)}async function Ro(t,e,n,r){let s=Bc(t,n),i=Bc(t,r);switch(e){case"-nt":try{let o=await t.fs.stat(s),a=await t.fs.stat(i);return o.mtime>a.mtime}catch{return!1}case"-ot":try{let o=await t.fs.stat(s),a=await t.fs.stat(i);return o.mtime<a.mtime}catch{return!1}case"-ef":try{if(!await t.fs.exists(s)||!await t.fs.exists(i))return!1;let o=t.fs.resolvePath(t.state.cwd,s),a=t.fs.resolvePath(t.state.cwd,i);return o===a}catch{return!1}default:return!1}}var xE=new Set(["-eq","-ne","-lt","-le","-gt","-ge"]);function Po(t){return xE.has(t)}function $o(t,e,n){switch(t){case"-eq":return e===n;case"-ne":return e!==n;case"-lt":return e<n;case"-le":return e<=n;case"-gt":return e>n;case"-ge":return e>=n}}function Vs(t){return t==="="||t==="=="||t==="!="}function Do(t,e,n,r=!1,s=!1,i=!1){if(r){let a=is(e,n,s,i);return t==="!="?!a:a}if(s){let a=e.toLowerCase()===n.toLowerCase();return t==="!="?!a:a}let o=e===n;return t==="!="?!o:o}var EE=new Set(["-z","-n"]);function _o(t){return EE.has(t)}function Mo(t,e){switch(t){case"-z":return e==="";case"-n":return e!==""}}St();it();F();$t();on();async function Lo(t,e){let n=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let r=n[1],s=n[2];if(t.state.associativeArrays?.has(r)){let a=s;return(a.startsWith("'")&&a.endsWith("'")||a.startsWith('"')&&a.endsWith('"'))&&(a=a.slice(1,-1)),a=a.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(l,c)=>$(t.state.env,c)),t.state.env.has(`${r}_${a}`)}let o;try{let a=new ye,l=Te(a,s);o=await ue(t,l.expression)}catch{if(/^-?\d+$/.test(s))o=Number.parseInt(s,10);else{let a=$(t.state.env,s);o=a?Number.parseInt(a,10):0}}if(o<0){let a=ot(t,r),l=t.state.currentLine;if(a.length===0)return t.state.expansionStderr=(t.state.expansionStderr||"")+`bash: line ${l}: ${r}: bad array subscript
789
+ `,!1;if(o=Math.max(...a)+1+o,o<0)return t.state.expansionStderr=(t.state.expansionStderr||"")+`bash: line ${l}: ${r}: bad array subscript
790
+ `,!1}return t.state.env.has(`${r}_${o}`)}return t.state.env.has(e)?!0:t.state.associativeArrays?.has(e)?hn(t,e).length>0:ot(t,e).length>0}async function Kn(t,e){switch(e.type){case"CondBinary":{let n=await de(t,e.left),r=e.right.parts.length>0&&e.right.parts.every(i=>i.type==="SingleQuoted"||i.type==="DoubleQuoted"||i.type==="Escaped"&&e.operator!=="=~"),s;if(e.operator==="=~")if(r){let i=await de(t,e.right);s=Jr(i)}else s=await Rc(t,e.right);else Vs(e.operator)&&!r?s=await Pc(t,e.right):s=await de(t,e.right);if(Vs(e.operator)){let i=t.state.shoptOptions.nocasematch;return Do(e.operator,n,s,!r,i,!0)}if(Po(e.operator))return $o(e.operator,await Zg(t,n),await Zg(t,s));if(Oo(e.operator))return Ro(t,e.operator,n,s);switch(e.operator){case"=~":try{let i=t.state.shoptOptions.nocasematch,o=NE(s),l=ee(o,i?"i":"").match(n);if(Nn(t,"BASH_REMATCH"),l)for(let c=0;c<l.length;c++)T(t.state.env,`BASH_REMATCH_${c}`,l[c]||"");return l!==null}catch{throw new Error("syntax error in regular expression")}case"<":return n<s;case">":return n>s;default:return!1}}case"CondUnary":{let n=await de(t,e.operand);return Io(e.operator)?To(t,e.operator,n):_o(e.operator)?Mo(e.operator,n):e.operator==="-v"?await Lo(t,n):e.operator==="-o"?zc(t,n):!1}case"CondNot":return t.state.shoptOptions.extglob&&e.operand.type==="CondGroup"&&e.operand.expression.type==="CondWord"?`!(${await de(t,e.operand.expression.word)})`!=="":!await Kn(t,e.operand);case"CondAnd":return await Kn(t,e.left)?await Kn(t,e.right):!1;case"CondOr":return await Kn(t,e.left)?!0:await Kn(t,e.right);case"CondGroup":return await Kn(t,e.expression);case"CondWord":return await de(t,e.word)!=="";default:return!1}}async function qs(t,e){if(e.length===0)return K(y,y,1);if(e.length===1)return at(!!e[0]);if(e.length===2){let r=e[0],s=e[1];return r==="("?V(`test: '(' without matching ')'
791
+ `,2):Io(r)?at(await To(t,r,s)):_o(r)?at(Mo(r,s)):r==="!"?at(!s):r==="-v"?at(await Lo(t,s)):r==="-o"?at(zc(t,s)):r==="="||r==="=="||r==="!="||r==="<"||r===">"||r==="-eq"||r==="-ne"||r==="-lt"||r==="-le"||r==="-gt"||r==="-ge"||r==="-nt"||r==="-ot"||r==="-ef"?V(`test: ${r}: unary operator expected
792
+ `,2):K(y,y,1)}if(e.length===3){let r=e[0],s=e[1],i=e[2];if(Vs(s))return at(Do(s,r,i));if(Po(s)){let o=Fo(r),a=Fo(i);return!o.valid||!a.valid?K(y,y,2):at($o(s,o.value,a.value))}if(Oo(s))return at(await Ro(t,s,r,i));switch(s){case"-a":return at(r!==""&&i!=="");case"-o":return at(r!==""||i!=="");case">":return at(r>i);case"<":return at(r<i)}if(r==="!"){let o=await qs(t,[s,i]);return K(y,o.stderr,o.exitCode===0?1:o.exitCode===1?0:o.exitCode)}if(r==="("&&i===")")return at(s!=="")}if(e.length===4){if(e[0]==="!"){let r=await qs(t,e.slice(1));return K(y,r.stderr,r.exitCode===0?1:r.exitCode===1?0:r.exitCode)}if(e[0]==="("&&e[3]===")")return qs(t,[e[1],e[2]])}let n=await Qg(t,e,0);return n.pos<e.length?V(`test: too many arguments
793
+ `,2):at(n.value)}async function Qg(t,e,n){return AE(t,e,n)}async function AE(t,e,n){let{value:r,pos:s}=await qg(t,e,n);for(;e[s]==="-o";){let i=await qg(t,e,s+1);r=r||i.value,s=i.pos}return{value:r,pos:s}}async function qg(t,e,n){let{value:r,pos:s}=await Wc(t,e,n);for(;e[s]==="-a";){let i=await Wc(t,e,s+1);r=r&&i.value,s=i.pos}return{value:r,pos:s}}async function Wc(t,e,n){if(e[n]==="!"){let{value:r,pos:s}=await Wc(t,e,n+1);return{value:!r,pos:s}}return SE(t,e,n)}async function SE(t,e,n){let r=e[n];if(r==="("){let{value:i,pos:o}=await Qg(t,e,n+1);return{value:i,pos:e[o]===")"?o+1:o}}let s=e[n+1];if(Vs(s)){let i=r,o=e[n+2]??"";return{value:Do(s,i,o),pos:n+3}}if(Po(s)){let i=Fo(r),o=Fo(e[n+2]??"0");return!i.valid||!o.valid?{value:!1,pos:n+3}:{value:$o(s,i.value,o.value),pos:n+3}}if(Oo(s)){let i=r,o=e[n+2]??"";return{value:await Ro(t,s,i,o),pos:n+3}}if(Io(r)){let i=e[n+1]??"";return{value:await To(t,r,i),pos:n+2}}if(_o(r)){let i=e[n+1]??"";return{value:Mo(r,i),pos:n+2}}if(r==="-v"){let i=e[n+1]??"";return{value:await Lo(t,i),pos:n+2}}if(r==="-o"){let i=e[n+1]??"";return{value:zc(t,i),pos:n+2}}return{value:r!==void 0&&r!=="",pos:n+1}}function is(t,e,n=!1,r=!1){let s=`^${Kg(e,r)}$`;return ee(s,n?"is":"s").test(t)}function Kg(t,e){let n="";for(let r=0;r<t.length;r++){let s=t[r];if(e&&(s==="@"||s==="*"||s==="+"||s==="?"||s==="!")&&r+1<t.length&&t[r+1]==="("){let i=Xg(t,r+1);if(i!==-1){let o=t.slice(r+2,i),a=Jg(o),l=a.map(u=>Kg(u,e)),c=l.length>0?l.join("|"):"(?:)";if(s==="@")n+=`(?:${c})`;else if(s==="*")n+=`(?:${c})*`;else if(s==="+")n+=`(?:${c})+`;else if(s==="?")n+=`(?:${c})?`;else if(s==="!")if(i<t.length-1){let f=a.map(h=>e6(h,e));if(f.every(h=>h!==null)&&f.every(h=>h===f[0])&&f[0]!==null){let h=f[0];if(h===0)n+="(?:.+)";else{let m=[];h>0&&m.push(`.{0,${h-1}}`),m.push(`.{${h+1},}`),m.push(`(?!(?:${c})).{${h}}`),n+=`(?:${m.join("|")})`}}else n+=`(?:(?!(?:${c})).)*?`}else n+=`(?!(?:${c})$).*`;r=i;continue}}if(s==="\\")if(r+1<t.length){let i=t[r+1];/[\\^$.|+(){}[\]*?]/.test(i)?n+=`\\${i}`:n+=i,r++}else n+="\\\\";else if(s==="*")n+=".*";else if(s==="?")n+=".";else if(s==="["){let i=t.indexOf("]",r+1);i!==-1?(n+=t.slice(r,i+1),r=i):n+="\\["}else/[\\^$.|+(){}]/.test(s)?n+=`\\${s}`:n+=s}return n}function Xg(t,e){let n=1,r=e+1;for(;r<t.length&&n>0;){let s=t[r];if(s==="\\"){r+=2;continue}if(s==="(")n++;else if(s===")"&&(n--,n===0))return r;r++}return-1}function Jg(t){let e=[],n="",r=0,s=0;for(;s<t.length;){let i=t[s];if(i==="\\"){n+=i,s+1<t.length?(n+=t[s+1],s+=2):s++;continue}i==="("?(r++,n+=i):i===")"?(r--,n+=i):i==="|"&&r===0?(e.push(n),n=""):n+=i,s++}return e.push(n),e}function e6(t,e){let n=0,r=0;for(;r<t.length;){let s=t[r];if(e&&(s==="@"||s==="*"||s==="+"||s==="?"||s==="!")&&r+1<t.length&&t[r+1]==="("){let i=Xg(t,r+1);if(i!==-1){if(s==="@"){let o=t.slice(r+2,i),l=Jg(o).map(c=>e6(c,e));if(l.every(c=>c!==null)&&l.every(c=>c===l[0])){n+=l[0],r=i+1;continue}return null}return null}}if(s==="*")return null;if(s==="?"){n+=1,r++;continue}if(s==="["){let i=t.indexOf("]",r+1);if(i!==-1){n+=1,r=i+1;continue}n+=1,r++;continue}if(s==="\\"){n+=1,r+=2;continue}n+=1,r++}return n}function zc(t,e){let r=new Map([["errexit",()=>t.state.options.errexit===!0],["nounset",()=>t.state.options.nounset===!0],["pipefail",()=>t.state.options.pipefail===!0],["xtrace",()=>t.state.options.xtrace===!0],["e",()=>t.state.options.errexit===!0],["u",()=>t.state.options.nounset===!0],["x",()=>t.state.options.xtrace===!0]]).get(e);return r?r():!1}async function Zg(t,e){if(e=e.trim(),e==="")return 0;if(/^[+-]?(\d+#[a-zA-Z0-9@_]+|0[xX][0-9a-fA-F]+|0[0-7]+|\d+)$/.test(e))return Yg(e);try{let n=new ye,r=Te(n,e);return await ue(t,r.expression)}catch{return Yg(e)}}function CE(t,e){let n=0;for(let r of t){let s;if(r>="0"&&r<="9")s=r.charCodeAt(0)-48;else if(r>="a"&&r<="z")s=r.charCodeAt(0)-97+10;else if(r>="A"&&r<="Z")s=r.charCodeAt(0)-65+36;else if(r==="@")s=62;else if(r==="_")s=63;else return Number.NaN;if(s>=e)return Number.NaN;n=n*e+s}return n}function Yg(t){if(t=t.trim(),t==="")return 0;let e=!1;t.startsWith("-")?(e=!0,t=t.slice(1)):t.startsWith("+")&&(t=t.slice(1));let n,r=t.match(/^(\d+)#([a-zA-Z0-9@_]+)$/);if(r){let s=Number.parseInt(r[1],10);s>=2&&s<=64?n=CE(r[2],s):n=0}else/^0[xX][0-9a-fA-F]+$/.test(t)?n=Number.parseInt(t,16):/^0[0-7]+$/.test(t)?n=Number.parseInt(t,8):n=Number.parseInt(t,10);return Number.isNaN(n)&&(n=0),e?-n:n}function Fo(t){if(t=t.trim(),t==="")return{value:0,valid:!0};let e=!1;if(t.startsWith("-")?(e=!0,t=t.slice(1)):t.startsWith("+")&&(t=t.slice(1)),!/^\d+$/.test(t))return{value:0,valid:!1};let n=Number.parseInt(t,10);return Number.isNaN(n)?{value:0,valid:!1}:{value:e?-n:n,valid:!0}}function NE(t){let e="",n=0;for(;n<t.length;)if(t[n]==="\\"&&n+1<t.length)e+=t[n]+t[n+1],n+=2;else if(t[n]==="["){let r=vE(t,n);e+=r.converted,n=r.endIndex}else e+=t[n],n++;return e}function vE(t,e){let n=e+1,r="[";n<t.length&&(t[n]==="^"||t[n]==="!")&&(r+="^",n++);let s=!1;n<t.length&&t[n]==="]"&&(s=!0,n++);let i=!1;n<t.length&&t[n]==="["&&n+1<t.length&&t[n+1]!==":"&&(i=!0,n++);let o="",a=!1;for(;n<t.length;){let l=t[n];if(l==="]"){a=!0,n++;break}if(l==="["&&n+1<t.length&&t[n+1]===":"){let c=t.indexOf(":]",n+2);if(c!==-1){let u=t.slice(n+2,c);o+=kE(u),n=c+2;continue}}if(l==="["&&n+1<t.length){let c=t[n+1];if(c==="."||c==="="){let u=`${c}]`,f=t.indexOf(u,n+2);if(f!==-1){let p=t.slice(n+2,f);o+=p,n=f+2;continue}}}if(l==="\\"&&n+1<t.length){o+=l+t[n+1],n+=2;continue}o+=l,n++}return a?(s&&(r+="\\]"),i&&(r+="\\["),r+=o,r+="]",{converted:r,endIndex:n}):{converted:"\\[",endIndex:e+1}}function kE(t){return new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]).get(t)??""}Dt();F();St();it();F();$t();Yn();function Tn(t){let e=[],n="",r=!1,s=!1,i=!1,o=!1;for(let a of t){if(i){n+=a,i=!1,o=!0;continue}if(a==="\\"){i=!0;continue}if(a==="'"&&!s){r||(o=!0),r=!r;continue}if(a==='"'&&!r){s||(o=!0),s=!s;continue}if((a===" "||a===" "||a===`
794
+ `)&&!r&&!s){o&&(e.push(n),n="",o=!1);continue}n+=a,o=!0}return o&&e.push(n),e}function Uo(t){let e=[],n=0;for(;n<t.length;){for(;n<t.length&&/\s/.test(t[n]);)n++;if(n>=t.length)break;if(t[n]!=="["){n++;continue}n++;let r="";if(t[n]==="'"||t[n]==='"'){let i=t[n];for(n++;n<t.length&&t[n]!==i;)r+=t[n],n++;t[n]===i&&n++}else for(;n<t.length&&t[n]!=="]"&&t[n]!=="=";)r+=t[n],n++;for(;n<t.length&&t[n]!=="]";)n++;if(t[n]==="]"&&n++,t[n]!=="=")continue;n++;let s="";if(t[n]==="'"||t[n]==='"'){let i=t[n];for(n++;n<t.length&&t[n]!==i;)t[n]==="\\"&&n+1<t.length&&n++,s+=t[n],n++;t[n]===i&&n++}else for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;e.push([r,s])}return e}function t6(t){let e=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(e)return{name:e[1],isArray:!0,arrayElements:Tn(e[2])};let n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([^\]]+)\]=(.*)$/s);if(n)return{name:n[1],isArray:!1,arrayIndex:n[2],value:n[3]};if(t.includes("=")){let r=t.indexOf("=");return{name:t.slice(0,r),isArray:!1,value:t.slice(r+1)}}return{name:t,isArray:!1}}async function IE(t,e){try{let n=new ye,r=Te(n,e);return await ue(t,r.expression)}catch{let n=parseInt(e,10);return Number.isNaN(n)?0:n}}async function n6(t,e,n={}){let{name:r,isArray:s,arrayElements:i,value:o,arrayIndex:a}=e,{makeReadonly:l=!1,checkReadonly:c=!0}=n;if(c){let u=ht(t,r);if(u)return u}if(s&&i){for(let u=0;u<i.length;u++)T(t.state.env,`${r}_${u}`,i[u]);T(t.state.env,`${r}__length`,String(i.length))}else if(a!==void 0&&o!==void 0){let u=await IE(t,a);T(t.state.env,`${r}_${u}`,o);let f=parseInt($(t.state.env,`${r}__length`,"0"),10);u>=f&&T(t.state.env,`${r}__length`,String(u+1))}else o!==void 0&&T(t.state.env,r,o);return l&&jt(t,r),null}function Xn(t,e){t.state.localVarDepth=t.state.localVarDepth||new Map,t.state.localVarDepth.set(e,t.state.callDepth)}function os(t,e){return t.state.localVarDepth?.get(e)}function Bo(t,e){t.state.localVarDepth?.delete(e)}function r6(t,e,n){t.state.localVarStack=t.state.localVarStack||new Map;let r=t.state.localVarStack.get(e)||[];r.push({value:n,scopeIndex:t.state.localScopes.length-1}),t.state.localVarStack.set(e,r)}function Wo(t,e){let n=t.state.localVarStack?.get(e);if(!(!n||n.length===0))return n.pop()}function s6(t,e){if(t.state.localVarStack)for(let[n,r]of t.state.localVarStack.entries()){for(;r.length>0&&r[r.length-1].scopeIndex===e;)r.pop();r.length===0&&t.state.localVarStack.delete(n)}}Ne();Dt();var Hc=new Set([":",".","break","continue","eval","exec","exit","export","readonly","return","set","shift","trap","unset"]);function i6(t){return Hc.has(t)}var jc=new Set(["if","then","else","elif","fi","case","esac","for","select","while","until","do","done","in","function","{","}","time","[[","]]","!"]),as=new Set([":","true","false","cd","export","unset","exit","local","set","break","continue","return","eval","shift","getopts","compgen","complete","compopt","pushd","popd","dirs","source",".","read","mapfile","readarray","declare","typeset","readonly","let","command","shopt","exec","test","[","echo","printf","pwd","alias","unalias","type","hash","ulimit","umask","trap","times","wait","kill","jobs","fg","bg","disown","suspend","fc","history","help","enable","builtin","caller"]);F();Dt();async function Sr(t,e,n,r){try{if((await t.fs.stat(e)).isDirectory)return`bash: ${n}: Is a directory
795
+ `;if(r.checkNoclobber&&t.state.options.noclobber&&!r.isClobber&&n!=="/dev/null")return`bash: ${n}: cannot overwrite existing file
796
+ `}catch{}return null}function TE(t){if(!t.startsWith("__rw__:"))return null;let e=t.slice(7),n=e.indexOf(":");if(n===-1)return null;let r=Number.parseInt(e.slice(0,n),10);if(Number.isNaN(r)||r<0)return null;let s=n+1,i=e.slice(s,s+r),o=s+r+1,a=e.slice(o),l=a.indexOf(":");if(l===-1)return null;let c=Number.parseInt(a.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;let u=a.slice(l+1);return{path:i,position:c,content:u}}async function o6(t,e){let n=new Map;for(let r=0;r<e.length;r++){let s=e[r];if(s.target.type==="HereDoc")continue;if(s.operator===">&"||s.operator==="<&"){if(js(t,s.target))return{targets:n,error:`bash: $@: ambiguous redirect
797
+ `};n.set(r,await de(t,s.target))}else{let o=await Gs(t,s.target);if("error"in o)return{targets:n,error:o.error};n.set(r,o.target)}}return{targets:n}}function OE(t){t.state.nextFd===void 0&&(t.state.nextFd=10);let e=t.state.nextFd;return t.state.nextFd++,e}async function zo(t,e){for(let n of e){if(!n.fdVariable)continue;if(t.state.fileDescriptors||(t.state.fileDescriptors=new Map),(n.operator===">&"||n.operator==="<&")&&n.target.type==="Word"&&await de(t,n.target)==="-"){if(t.state.env.has(n.fdVariable)){let i=Number.parseInt($(t.state.env,n.fdVariable),10);Number.isNaN(i)||t.state.fileDescriptors.delete(i)}continue}let r=OE(t);if(T(t.state.env,n.fdVariable,String(r)),n.target.type==="Word"){let s=await de(t,n.target);if(n.operator===">&"||n.operator==="<&"){let i=Number.parseInt(s,10);if(!Number.isNaN(i)){let o=t.state.fileDescriptors.get(i);o!==void 0&&t.state.fileDescriptors.set(r,o);continue}}if(n.operator===">"||n.operator===">>"||n.operator===">|"||n.operator==="&>"||n.operator==="&>>"){let i=t.fs.resolvePath(t.state.cwd,s);(n.operator===">"||n.operator===">|"||n.operator==="&>")&&await t.fs.writeFile(i,y),t.state.fileDescriptors.set(r,`__file__:${i}`)}else if(n.operator==="<<<")t.state.fileDescriptors.set(r,`${s}
798
+ `);else if(n.operator==="<"||n.operator==="<>")try{let i=t.fs.resolvePath(t.state.cwd,s),o=await t.fs.readFile(i);t.state.fileDescriptors.set(r,o)}catch{return K(y,x(`bash: ${s}: No such file or directory
799
+ `),1)}}}return null}async function On(t,e){for(let n of e){if(n.target.type==="HereDoc")continue;let r=n.operator===">&";if(n.operator!==">"&&n.operator!==">|"&&n.operator!=="&>"&&!r)continue;let s;if(r){if(s=await de(t,n.target),s==="-"||!Number.isNaN(Number.parseInt(s,10))||n.fd!=null)continue}else{let a=await Gs(t,n.target);if("error"in a)return K(y,x(a.error),1);s=a.target}let i=t.fs.resolvePath(t.state.cwd,s),o=n.operator===">|";if(i.includes("\0"))return K(y,x(`bash: ${s}: No such file or directory
800
+ `),1);try{let a=await t.fs.stat(i);if(a.isDirectory)return K(y,x(`bash: ${s}: Is a directory
801
+ `),1);if(t.state.options.noclobber&&!o&&!a.isDirectory&&s!=="/dev/null")return K(y,x(`bash: ${s}: cannot overwrite existing file
802
+ `),1)}catch{}if(s!=="/dev/null"&&s!=="/dev/stdout"&&s!=="/dev/stderr"&&s!=="/dev/full"&&await t.fs.writeFile(i,""),s==="/dev/full")return K(y,x(`bash: /dev/full: No space left on device
803
+ `),1)}return null}async function Qe(t,e,n,r){let{stdout:s,stderr:i,exitCode:o}=e;for(let c=0;c<n.length;c++){let u=n[c];if(u.target.type==="HereDoc")continue;let f,p=r?.get(c);if(p!==void 0)f=p;else if(u.operator===">&"||u.operator==="<&"){if(js(t,u.target)){i=j(i,x(`bash: $@: ambiguous redirect
804
+ `)),o=1,s=y;continue}f=await de(t,u.target)}else{let m=await Gs(t,u.target);if("error"in m){i=j(i,x(m.error)),o=1,s=y;continue}f=m.target}if(!u.fdVariable){if(f.includes("\0")){i=j(i,x(`bash: ${f.replace(/\0/g,"")}: No such file or directory
805
+ `)),o=1,s=y;continue}switch(u.operator){case">":case">|":{let h=u.fd??1,m=u.operator===">|";if(h===1){if(f==="/dev/stdout")break;if(f==="/dev/stderr"){i=j(i,s),s=y;break}if(f==="/dev/full"){i=j(i,x(`bash: echo: write error: No space left on device
806
+ `)),o=1,s=y;break}let d=t.fs.resolvePath(t.state.cwd,f),g=await Sr(t,d,f,{checkNoclobber:!0,isClobber:m});if(g){i=j(i,x(g)),o=1,s=y;break}await t.fs.writeFile(d,s),s=y}else if(h===2){if(f==="/dev/stderr")break;if(f==="/dev/stdout"){s=j(s,i),i=y;break}if(f==="/dev/full"){i=j(i,x(`bash: echo: write error: No space left on device
807
+ `)),o=1;break}if(f==="/dev/null")i=y;else{let d=t.fs.resolvePath(t.state.cwd,f),g=await Sr(t,d,f,{checkNoclobber:!0,isClobber:m});if(g){i=j(i,x(g)),o=1;break}await t.fs.writeFile(d,i),i=y}}break}case">>":{let h=u.fd??1;if(h===1){if(f==="/dev/stdout")break;if(f==="/dev/stderr"){i=j(i,s),s=y;break}if(f==="/dev/full"){i=j(i,x(`bash: echo: write error: No space left on device
808
+ `)),o=1,s=y;break}let m=t.fs.resolvePath(t.state.cwd,f),d=await Sr(t,m,f,{});if(d){i=j(i,x(d)),o=1,s=y;break}await t.fs.appendFile(m,s),s=y}else if(h===2){if(f==="/dev/stderr")break;if(f==="/dev/stdout"){s=j(s,i),i=y;break}if(f==="/dev/full"){i=j(i,x(`bash: echo: write error: No space left on device
809
+ `)),o=1;break}let m=t.fs.resolvePath(t.state.cwd,f),d=await Sr(t,m,f,{});if(d){i=j(i,x(d)),o=1;break}await t.fs.appendFile(m,i),i=y}break}case">&":case"<&":{let h=u.fd??1;if(f==="-")break;if(f.endsWith("-")){let m=f.slice(0,-1),d=Number.parseInt(m,10);if(!Number.isNaN(d)){let g=t.state.fileDescriptors?.get(d);g!==void 0?(t.state.fileDescriptors||(t.state.fileDescriptors=new Map),t.state.fileDescriptors.set(h,g),d>=3&&t.state.fileDescriptors?.delete(d)):d===1||d===2?(t.state.fileDescriptors||(t.state.fileDescriptors=new Map),t.state.fileDescriptors.set(h,`__dupout__:${d}`)):d===0?(t.state.fileDescriptors||(t.state.fileDescriptors=new Map),t.state.fileDescriptors.set(h,`__dupin__:${d}`)):d>=3&&(i=j(i,x(`bash: ${d}: Bad file descriptor
810
+ `)),o=1)}break}if(f==="2"||f==="&2")h===1&&(i=j(i,s),s=y);else if(f==="1"||f==="&1")h===2?(s=j(s,i),i=y):(s=j(s,i),i=y);else{let m=Number.parseInt(f,10);if(Number.isNaN(m)){if(u.operator===">&"){let d=t.fs.resolvePath(t.state.cwd,f),g=await Sr(t,d,f,{checkNoclobber:!0});if(g){i=x(g),o=1,s=y;break}if(u.fd==null){let w=j(s,i);await t.fs.writeFile(d,w),s=y,i=y}else h===1?(await t.fs.writeFile(d,s),s=y):h===2&&(await t.fs.writeFile(d,i),i=y)}}else{let d=t.state.fileDescriptors?.get(m);if(d?.startsWith("__file__:")){let g=d.slice(9);h===1?(await t.fs.appendFile(g,s),s=y):h===2&&(await t.fs.appendFile(g,i),i=y)}else if(d?.startsWith("__rw__:")){let g=TE(d);g&&(h===1?(await t.fs.appendFile(g.path,s),s=y):h===2&&(await t.fs.appendFile(g.path,i),i=y))}else if(d?.startsWith("__dupout__:")){let g=Number.parseInt(d.slice(11),10);if(g!==1)if(g===2)h===1&&(i=j(i,s),s=y);else{let w=t.state.fileDescriptors?.get(g);if(w?.startsWith("__file__:")){let E=w.slice(9);h===1?(await t.fs.appendFile(E,s),s=y):h===2&&(await t.fs.appendFile(E,i),i=y)}}}else d?.startsWith("__dupin__:")?(i=j(i,x(`bash: ${m}: Bad file descriptor
811
+ `)),o=1,s=y):m>=3&&(i=j(i,x(`bash: ${m}: Bad file descriptor
812
+ `)),o=1,s=y)}}break}case"&>":{if(f==="/dev/full"){i=x(`bash: echo: write error: No space left on device
813
+ `),o=1,s=y;break}let h=t.fs.resolvePath(t.state.cwd,f),m=await Sr(t,h,f,{checkNoclobber:!0});if(m){i=x(m),o=1,s=y;break}let d=j(s,i);await t.fs.writeFile(h,d),s=y,i=y;break}case"&>>":{if(f==="/dev/full"){i=x(`bash: echo: write error: No space left on device
814
+ `),o=1,s=y;break}let h=t.fs.resolvePath(t.state.cwd,f),m=await Sr(t,h,f,{});if(m){i=x(m),o=1,s=y;break}let d=j(s,i);await t.fs.appendFile(h,d),s=y,i=y;break}}}}let a=t.state.fileDescriptors?.get(1);if(a){if(a==="__dupout__:2")i=j(i,s),s=y;else if(a.startsWith("__file__:")){let c=a.slice(9);await t.fs.appendFile(c,s),s=y}else if(a.startsWith("__file_append__:")){let c=a.slice(16);await t.fs.appendFile(c,s),s=y}}let l=t.state.fileDescriptors?.get(2);if(l){if(l==="__dupout__:1")s=j(s,i),i=y;else if(l.startsWith("__file__:")){let c=l.slice(9);await t.fs.appendFile(c,i),i=y}else if(l.startsWith("__file_append__:")){let c=l.slice(16);await t.fs.appendFile(c,i),i=y}}return K(s,i,o)}function a6(t,e){if(t.state.options.posix&&Hc.has(e.name)){let r=`bash: line ${t.state.currentLine}: \`${e.name}': is a special builtin
815
+ `;throw new Ee(2,y,x(r))}let n={...e,sourceFile:e.sourceFile??t.state.currentSource??"main"};return t.state.functions.set(e.name,n),Se}async function RE(t,e){let n=y;for(let r of e)if((r.operator==="<<"||r.operator==="<<-")&&r.target.type==="HereDoc"){let s=r.target,i=await de(t,s.content);s.stripTabs&&(i=i.split(`
816
+ `).map(a=>a.replace(/^\t+/,"")).join(`
817
+ `)),(r.fd??0)===0&&(n=x(i))}else if(r.operator==="<<<"&&r.target.type==="Word")n=x(`${await de(t,r.target)}
818
+ `);else if(r.operator==="<"&&r.target.type==="Word"){let s=await de(t,r.target),i=t.fs.resolvePath(t.state.cwd,s);try{n=x(await t.fs.readFile(i))}catch{}}return n}async function Ho(t,e,n,r=y,s){t.state.callDepth++,t.state.callDepth>t.limits.maxCallDepth&&(t.state.callDepth--,Fn(`${e.name}: maximum recursion depth (${t.limits.maxCallDepth}) exceeded, increase executionLimits.maxCallDepth`,"recursion")),t.state.funcNameStack||(t.state.funcNameStack=[]),t.state.callLineStack||(t.state.callLineStack=[]),t.state.sourceStack||(t.state.sourceStack=[]),t.state.funcNameStack.unshift(e.name),t.state.callLineStack.unshift(s??t.state.currentLine),t.state.sourceStack.unshift(e.sourceFile??"main"),t.state.localScopes.push(new Map),t.state.localExportedVars||(t.state.localExportedVars=[]),t.state.localExportedVars.push(new Set);let i=new Map;for(let c=0;c<n.length;c++)i.set(String(c+1),$(t.state.env,String(c+1))),T(t.state.env,String(c+1),n[c]);i.set("@",$(t.state.env,"@")),i.set("#",$(t.state.env,"#")),T(t.state.env,"@",n.join(" ")),T(t.state.env,"#",String(n.length));let o=()=>{let c=t.state.localScopes.length-1,u=t.state.localScopes.pop();if(u)for(let[f,p]of u)p===void 0?t.state.env.delete(f):t.state.env.set(f,p);if(s6(t,c),t.state.fullyUnsetLocals)for(let[f,p]of t.state.fullyUnsetLocals.entries())p===c&&t.state.fullyUnsetLocals.delete(f);if(t.state.localExportedVars&&t.state.localExportedVars.length>0){let f=t.state.localExportedVars.pop();if(f)for(let p of f)t.state.exportedVars?.delete(p)}for(let[f,p]of i)p===void 0?t.state.env.delete(f):T(t.state.env,f,p);t.state.funcNameStack?.shift(),t.state.callLineStack?.shift(),t.state.sourceStack?.shift(),t.state.callDepth--},{targets:a,error:l}=await o6(t,e.redirections);if(l)return o(),K(y,x(l),1);try{let c=await RE(t,e.redirections),u=r.length>0?r:c,f=await t.executeCommand(e.body,u);return o(),Qe(t,f,e.redirections,a)}catch(c){if(o(),c instanceof mt){let u=K(c.stdout,c.stderr,c.exitCode);return Qe(t,u,e.redirections,a)}throw c}}var c6=["!","[[","]]","case","do","done","elif","else","esac","fi","for","function","if","in","then","time","until","while","{","}"],Vc=[".",":","[","alias","bg","bind","break","builtin","caller","cd","command","compgen","complete","compopt","continue","declare","dirs","disown","echo","enable","eval","exec","exit","export","false","fc","fg","getopts","hash","help","history","jobs","kill","let","local","logout","mapfile","popd","printf","pushd","pwd","read","readarray","readonly","return","set","shift","shopt","source","suspend","test","times","trap","true","type","typeset","ulimit","umask","unalias","unset","wait"],PE=["autocd","assoc_expand_once","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","dotglob","execfail","expand_aliases","extdebug","extglob","extquote","failglob","force_fignore","globasciiranges","globstar","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lastpipe","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","nocaseglob","nocasematch","nullglob","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath","xpg_echo"],$E=Vc;async function qc(t,e){let n=[],r=null,s="",i="",o=null,a=!1,l=!1,c=!1,u=null,f=null,p=null,h=[],m=["alias","arrayvar","binding","builtin","command","directory","disabled","enabled","export","file","function","group","helptopic","hostname","job","keyword","running","service","setopt","shopt","signal","stopped","user","variable"];for(let A=0;A<e.length;A++){let N=e[A];if(N==="-v")n.push("variable");else if(N==="-e")n.push("export");else if(N==="-f")n.push("file");else if(N==="-d")n.push("directory");else if(N==="-k")n.push("keyword");else if(N==="-A"){if(A++,A>=e.length)return V(`compgen: -A: option requires an argument
819
+ `,2);let P=e[A];if(!m.includes(P))return V(`compgen: ${P}: invalid action name
820
+ `,2);n.push(P)}else if(N==="-W"){if(A++,A>=e.length)return V(`compgen: -W: option requires an argument
821
+ `,2);r=e[A]}else if(N==="-P"){if(A++,A>=e.length)return V(`compgen: -P: option requires an argument
822
+ `,2);s=e[A]}else if(N==="-S"){if(A++,A>=e.length)return V(`compgen: -S: option requires an argument
823
+ `,2);i=e[A]}else if(N==="-o"){if(A++,A>=e.length)return V(`compgen: -o: option requires an argument
824
+ `,2);let P=e[A];if(P==="plusdirs")a=!0;else if(P==="dirnames")l=!0;else if(P==="default")c=!0;else if(!(P==="filenames"||P==="nospace"||P==="bashdefault"||P==="noquote"))return V(`compgen: ${P}: invalid option name
825
+ `,2)}else if(N==="-F"){if(A++,A>=e.length)return V(`compgen: -F: option requires an argument
826
+ `,2);f=e[A]}else if(N==="-C"){if(A++,A>=e.length)return V(`compgen: -C: option requires an argument
827
+ `,2);p=e[A]}else if(N==="-X"){if(A++,A>=e.length)return V(`compgen: -X: option requires an argument
828
+ `,2);u=e[A]}else if(N==="-G"){if(A++,A>=e.length)return V(`compgen: -G: option requires an argument
829
+ `,2)}else if(N==="--"){h.push(...e.slice(A+1));break}else N.startsWith("-")||h.push(N)}o=h[0]??null;let d=[];if(l){let A=await Gc(t,o);d.push(...A)}if(c){let A=await l6(t,o);d.push(...A)}for(let A of n)if(A==="variable"){let N=DE(t,o);d.push(...N)}else if(A==="export"){let N=_E(t,o);d.push(...N)}else if(A==="function"){let N=ME(t,o);d.push(...N)}else if(A==="builtin"){let N=LE(o);d.push(...N)}else if(A==="keyword"){let N=FE(o);d.push(...N)}else if(A==="alias"){let N=UE(t,o);d.push(...N)}else if(A==="shopt"){let N=BE(o);d.push(...N)}else if(A==="helptopic"){let N=WE(o);d.push(...N)}else if(A==="directory"){let N=await Gc(t,o);d.push(...N)}else if(A==="file"){let N=await l6(t,o);d.push(...N)}else if(A==="user"){let N=zE(o);d.push(...N)}else if(A==="command"){let N=await HE(t,o);d.push(...N)}if(r!==null)try{let A=await jE(t,r),N=GE(t,A);for(let P of N)(o===null||P.startsWith(o))&&d.push(P)}catch{return K(y,y,1)}if(a){let A=await Gc(t,o);for(let N of A)d.includes(N)||d.push(N)}let g="";if(f!==null){let A=t.state.functions.get(f);if(A){let N=new Map;N.set("COMP_WORDS__length",$(t.state.env,"COMP_WORDS__length")),T(t.state.env,"COMP_WORDS__length","0"),N.set("COMP_CWORD",$(t.state.env,"COMP_CWORD")),T(t.state.env,"COMP_CWORD","-1"),N.set("COMP_LINE",$(t.state.env,"COMP_LINE")),T(t.state.env,"COMP_LINE",""),N.set("COMP_POINT",$(t.state.env,"COMP_POINT")),T(t.state.env,"COMP_POINT","0");let P=new Map;for(let G of t.state.env.keys())(G==="COMPREPLY"||G.startsWith("COMPREPLY_")||G==="COMPREPLY__length")&&(P.set(G,$(t.state.env,G)),t.state.env.delete(G));let O=["compgen",h[0]??"",""];try{let G=await Ho(t,A,O,y);if(G.exitCode!==0)return ls(t,N),ls(t,P),K(y,G.stderr,1);g=R(G.stdout);let M=VE(t);d.push(...M)}catch{return ls(t,N),ls(t,P),K(y,y,1)}ls(t,N),ls(t,P)}}if(p!==null)try{let A=Cn(p),N=await t.executeScript(A);if(N.exitCode!==0)return K(y,N.stderr,N.exitCode);if(N.stdout.length>0){let P=R(N.stdout).split(`
830
+ `);for(let O of P)O.length>0&&d.push(O)}}catch(A){if(A.name==="ParseException")return V(`compgen: -C: ${A.message}
831
+ `,2);throw A}let w=d;if(u!==null){let A=u.startsWith("!"),N=A?u.slice(1):u;w=d.filter(P=>{let O=is(P,N,!1,!0);return A?O:!O})}if(w.length===0&&o!==null)return K(x(g),y,1);let E=w.map(A=>`${s}${A}${i}`).join(`
832
+ `),b=g+(E?`${E}
833
+ `:"");return Fe(b)}function DE(t,e){let n=new Set;for(let s of t.state.env.keys()){if(s.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(s)||s.endsWith("__length"))continue;let i=s.split("_")[0];/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)?n.add(s):i&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(i)&&t.state.env.has(`${i}__length`)&&n.add(i)}let r=Array.from(n);return e!==null&&(r=r.filter(s=>s.startsWith(e))),r.sort()}function _E(t,e){let n=t.state.exportedVars??new Set,r=Array.from(n);return e!==null&&(r=r.filter(s=>s.startsWith(e))),r=r.filter(s=>s.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(s)||s.endsWith("__length")?!1:t.state.env.has(s)),r.sort()}function ME(t,e){let n=Array.from(t.state.functions.keys());return e!==null&&(n=n.filter(r=>r.startsWith(e))),n.sort()}function LE(t){let e=[...Vc];return t!==null&&(e=e.filter(n=>n.startsWith(t))),e.sort()}function FE(t){let e=[...c6];return t!==null&&(e=e.filter(n=>n.startsWith(t))),e.sort()}function UE(t,e){let n=[];for(let s of t.state.env.keys())if(s.startsWith("BASH_ALIAS_")){let i=s.slice(11);n.push(i)}let r=n;return e!==null&&(r=r.filter(s=>s.startsWith(e))),r.sort()}function BE(t){let e=[...PE];return t!==null&&(e=e.filter(n=>n.startsWith(t))),e.sort()}function WE(t){let e=[...$E];return t!==null&&(e=e.filter(n=>n.startsWith(t))),e.sort()}async function Gc(t,e){let n=[];try{let r=t.state.cwd,s=e??"";if(e){let o=e.lastIndexOf("/");if(o!==-1){let a=e.slice(0,o)||"/";s=e.slice(o+1),a.startsWith("/")?r=a:r=`${t.state.cwd}/${a}`}}let i=await t.fs.readdir(r);for(let o of i){let a=`${r}/${o}`;try{if((await t.fs.stat(a)).isDirectory&&(!s||o.startsWith(s)))if(e?.includes("/")){let c=e.lastIndexOf("/"),u=e.slice(0,c+1);n.push(u+o)}else n.push(o)}catch{}}}catch{}return n.sort()}async function l6(t,e){let n=[];try{let r=t.state.cwd,s=e??"";if(e){let o=e.lastIndexOf("/");if(o!==-1){let a=e.slice(0,o)||"/";s=e.slice(o+1),a.startsWith("/")?r=a:r=`${t.state.cwd}/${a}`}}let i=await t.fs.readdir(r);for(let o of i)if(!s||o.startsWith(s))if(e?.includes("/")){let a=e.lastIndexOf("/"),l=e.slice(0,a+1);n.push(l+o)}else n.push(o)}catch{}return n.sort()}function zE(t){return["root","nobody"]}async function HE(t,e){let n=new Set;for(let i of Vc)n.add(i);for(let i of t.state.functions.keys())n.add(i);for(let i of t.state.env.keys())i.startsWith("BASH_ALIAS_")&&n.add(i.slice(11));for(let i of c6)n.add(i);let r=$(t.state.env,"PATH","/usr/bin:/bin");for(let i of r.split(":"))if(i)try{let o=await t.fs.readdir(i);for(let a of o)n.add(a)}catch{}let s=Array.from(n);return e!==null&&(s=s.filter(i=>i.startsWith(e))),s.sort()}async function jE(t,e){let r=new ye().parseWordFromString(e,!1,!1);return await de(t,r)}function GE(t,e){let n=$(t.state.env,"IFS",`
834
+ `);if(n.length===0)return[e];let r=new Set(n.split("")),s=[],i="",o=0;for(;o<e.length;){let a=e[o];if(a==="\\"&&o+1<e.length){let l=e[o+1];i+=l,o+=2}else r.has(a)?(i.length>0&&(s.push(i),i=""),o++):(i+=a,o++)}return i.length>0&&s.push(i),s}function ls(t,e){for(let[n,r]of e)r===void 0?t.state.env.delete(n):T(t.state.env,n,r)}function VE(t){let e=[];if(t.state.env.get("COMPREPLY__length")!==void 0){let s=me(t,"COMPREPLY");for(let[,i]of s)e.push(i)}else t.state.env.has("COMPREPLY")&&e.push($(t.state.env,"COMPREPLY"));return e}F();var qE=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function Yc(t,e){t.state.completionSpecs||(t.state.completionSpecs=new Map);let n=!1,r=!1,s=!1,i,o,a,l=[],c=[],u=[];for(let f=0;f<e.length;f++){let p=e[f];if(p==="-p")n=!0;else if(p==="-r")r=!0;else if(p==="-D")s=!0;else if(p==="-W"){if(f++,f>=e.length)return V(`complete: -W: option requires an argument
835
+ `,2);i=e[f]}else if(p==="-F"){if(f++,f>=e.length)return V(`complete: -F: option requires an argument
836
+ `,2);o=e[f]}else if(p==="-o"){if(f++,f>=e.length)return V(`complete: -o: option requires an argument
837
+ `,2);let h=e[f];if(!qE.includes(h))return V(`complete: ${h}: invalid option name
838
+ `,2);l.push(h)}else if(p==="-A"){if(f++,f>=e.length)return V(`complete: -A: option requires an argument
839
+ `,2);c.push(e[f])}else if(p==="-C"){if(f++,f>=e.length)return V(`complete: -C: option requires an argument
840
+ `,2);a=e[f]}else if(p==="-G"){if(f++,f>=e.length)return V(`complete: -G: option requires an argument
841
+ `,2)}else if(p==="-P"){if(f++,f>=e.length)return V(`complete: -P: option requires an argument
842
+ `,2)}else if(p==="-S"){if(f++,f>=e.length)return V(`complete: -S: option requires an argument
843
+ `,2)}else if(p==="-X"){if(f++,f>=e.length)return V(`complete: -X: option requires an argument
844
+ `,2)}else if(p==="--"){u.push(...e.slice(f+1));break}else p.startsWith("-")||u.push(p)}if(r){if(u.length===0)return t.state.completionSpecs.clear(),Jt();for(let f of u)t.state.completionSpecs.delete(f);return Jt()}if(n)return u.length===0?Zc(t):Zc(t,u);if(e.length===0||u.length===0&&!i&&!o&&!a&&l.length===0&&c.length===0&&!s)return Zc(t);if(o&&u.length===0&&!s)return V(`complete: -F: option requires a command name
845
+ `,2);if(s){let f={isDefault:!0};return i!==void 0&&(f.wordlist=i),o!==void 0&&(f.function=o),a!==void 0&&(f.command=a),l.length>0&&(f.options=l),c.length>0&&(f.actions=c),t.state.completionSpecs.set("__default__",f),Jt()}for(let f of u){let p=Object.create(null);i!==void 0&&(p.wordlist=i),o!==void 0&&(p.function=o),a!==void 0&&(p.command=a),l.length>0&&(p.options=l),c.length>0&&(p.actions=c),t.state.completionSpecs.set(f,p)}return Jt(y)}function Zc(t,e){let n=t.state.completionSpecs;if(!n||n.size===0){if(e&&e.length>0){let i="";for(let o of e)i+=`complete: ${o}: no completion specification
846
+ `;return K(y,x(i),1)}return Jt()}let r=[],s=e||Array.from(n.keys());for(let i of s){if(i==="__default__")continue;let o=n.get(i);if(!o){if(e)return K(x(r.join(`
847
+ `)+(r.length>0?`
848
+ `:"")),x(`complete: ${i}: no completion specification
849
+ `),1);continue}let a="complete";if(o.options)for(let l of o.options)a+=` -o ${l}`;if(o.actions)for(let l of o.actions)a+=` -A ${l}`;o.wordlist!==void 0&&(o.wordlist.includes(" ")||o.wordlist.includes("'")?a+=` -W '${o.wordlist}'`:a+=` -W ${o.wordlist}`),o.function!==void 0&&(a+=` -F ${o.function}`),o.isDefault&&(a+=" -D"),a+=` ${i}`,r.push(a)}return r.length===0?Jt():Fe(`${r.join(`
850
+ `)}
851
+ `)}var u6=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function Qc(t,e){t.state.completionSpecs||(t.state.completionSpecs=new Map);let n=!1,r=!1,s=[],i=[],o=[];for(let a=0;a<e.length;a++){let l=e[a];if(l==="-D")n=!0;else if(l==="-E")r=!0;else if(l==="-o"){if(a++,a>=e.length)return V(`compopt: -o: option requires an argument
852
+ `,2);let c=e[a];if(!u6.includes(c))return V(`compopt: ${c}: invalid option name
853
+ `,2);s.push(c)}else if(l==="+o"){if(a++,a>=e.length)return V(`compopt: +o: option requires an argument
854
+ `,2);let c=e[a];if(!u6.includes(c))return V(`compopt: ${c}: invalid option name
855
+ `,2);i.push(c)}else if(l==="--"){o.push(...e.slice(a+1));break}else!l.startsWith("-")&&!l.startsWith("+")&&o.push(l)}if(n){let a=t.state.completionSpecs.get("__default__")??{isDefault:!0},l=new Set(a.options??[]);for(let c of s)l.add(c);for(let c of i)l.delete(c);return a.options=l.size>0?Array.from(l):void 0,t.state.completionSpecs.set("__default__",a),Jt()}if(r){let a=t.state.completionSpecs.get("__empty__")??{},l=new Set(a.options??[]);for(let c of s)l.add(c);for(let c of i)l.delete(c);return a.options=l.size>0?Array.from(l):void 0,t.state.completionSpecs.set("__empty__",a),Jt()}if(o.length>0){for(let a of o){let l=t.state.completionSpecs.get(a)??{},c=new Set(l.options??[]);for(let u of s)c.add(u);for(let u of i)c.delete(u);l.options=c.size>0?Array.from(c):void 0,t.state.completionSpecs.set(a,l)}return Jt()}return V(`compopt: not currently executing completion function
856
+ `,1)}F();Ne();function Kc(t,e){if(t.state.loopDepth===0){if(t.state.parentHasLoopContext)throw new wn;return Se}if(e.length>1)throw new Ee(1,y,x(`bash: continue: too many arguments
857
+ `));let n=1;if(e.length>0){let r=Number.parseInt(e[0],10);if(Number.isNaN(r)||r<1)throw new Ee(1,y,x(`bash: continue: ${e[0]}: numeric argument required
858
+ `));n=r}throw new Et(n)}St();it();F();$t();on();an();Yn();F();function tt(t,e){let n=$(t.state.env,"HOME","/home/user");return e.split(":").map(i=>i==="~"?n:i==="~root"?"/root":i.startsWith("~/")?n+i.slice(1):i.startsWith("~root/")?`/root${i.slice(5)}`:i).join(":")}F();on();an();function Xc(t){for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);if(n<32||n===127)return!0}return!1}function Jc(t){let e="$'";for(let n=0;n<t.length;n++){let r=t[n],s=t.charCodeAt(n);s===7?e+="\\a":s===8?e+="\\b":s===9?e+="\\t":s===10?e+="\\n":s===11?e+="\\v":s===12?e+="\\f":s===13?e+="\\r":s===27?e+="\\e":s===39?e+="\\'":s===92?e+="\\\\":s<32||s===127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=r}return e+="'",e}function jo(t){return Xc(t)?Jc(t):/^[a-zA-Z0-9_/.:\-@%+,=]*$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function Cr(t){return Xc(t)?Jc(t):`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function eu(t){return Xc(t)?Jc(t):`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function f6(t,e){let n="";return t.state.integerVars?.has(e)&&(n+="i"),t.state.lowercaseVars?.has(e)&&(n+="l"),_e(t,e)&&(n+="n"),t.state.readonlyVars?.has(e)&&(n+="r"),t.state.uppercaseVars?.has(e)&&(n+="u"),t.state.exportedVars?.has(e)&&(n+="x"),n===""?"--":`-${n}`}function tu(t){return t===""?"''":/[\s'\\]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}function p6(t,e){let n="",r="",s=!1;for(let i of e){let o=f6(t,i);if(t.state.associativeArrays?.has(i)){let c=hn(t,i);if(c.length===0)n+=`declare -A ${i}=()
859
+ `;else{let u=c.map(f=>{let p=$(t.state.env,`${i}_${f}`,""),h=tu(p);return`['${f}']=${h}`});n+=`declare -A ${i}=(${u.join(" ")})
860
+ `}continue}let l=ot(t,i);if(l.length>0){let c=l.map(u=>{let f=$(t.state.env,`${i}_${u}`,"");return`[${u}]=${Cr(f)}`});n+=`declare -a ${i}=(${c.join(" ")})
861
+ `;continue}if(t.state.env.has(`${i}__length`)){n+=`declare -a ${i}=()
862
+ `;continue}if(t.state.env.has(i)){let c=$(t.state.env,i);n+=`declare ${o} ${i}=${eu(c)}
863
+ `}else{let c=t.state.declaredVars?.has(i),u=t.state.localVarDepth?.has(i);c||u?n+=`declare ${o} ${i}
864
+ `:(r+=`bash: declare: ${i}: not found
865
+ `,s=!0)}}return K(x(n),x(r),s?1:0)}function h6(t,e){let{filterExport:n,filterReadonly:r,filterNameref:s,filterIndexedArray:i,filterAssocArray:o}=e,a=n||r||s||i||o,l="",c=new Set;for(let f of t.state.env.keys()){if(f.startsWith("BASH_"))continue;if(f.endsWith("__length")){let h=f.slice(0,-8);c.add(h);continue}let p=f.lastIndexOf("_");if(p>0){let h=f.slice(0,p),m=f.slice(p+1);if(/^\d+$/.test(m)||t.state.associativeArrays?.has(h)){c.add(h);continue}}c.add(f)}if(t.state.localVarDepth)for(let f of t.state.localVarDepth.keys())c.add(f);if(t.state.associativeArrays)for(let f of t.state.associativeArrays)c.add(f);let u=Array.from(c).sort();for(let f of u){let p=f6(t,f),h=t.state.associativeArrays?.has(f),m=ot(t,f),d=!h&&(m.length>0||t.state.env.has(`${f}__length`));if(!(a&&(o&&!h||i&&!d||n&&!t.state.exportedVars?.has(f)||r&&!t.state.readonlyVars?.has(f)||s&&!_e(t,f)))){if(h){let g=hn(t,f);if(g.length===0)l+=`declare -A ${f}=()
866
+ `;else{let w=g.map(E=>{let b=$(t.state.env,`${f}_${E}`,""),A=tu(b);return`['${E}']=${A}`});l+=`declare -A ${f}=(${w.join(" ")})
867
+ `}continue}if(m.length>0){let g=m.map(w=>{let E=$(t.state.env,`${f}_${w}`,"");return`[${w}]=${Cr(E)}`});l+=`declare -a ${f}=(${g.join(" ")})
868
+ `;continue}if(t.state.env.has(`${f}__length`)){l+=`declare -a ${f}=()
869
+ `;continue}if(t.state.env.has(f)){let g=$(t.state.env,f);l+=`declare ${p} ${f}=${eu(g)}
870
+ `}}}return Fe(l)}function d6(t){let e="",n=Array.from(t.state.associativeArrays??[]).sort();for(let r of n){let s=hn(t,r);if(s.length===0)e+=`declare -A ${r}=()
871
+ `;else{let i=s.map(o=>{let a=$(t.state.env,`${r}_${o}`,""),l=tu(a);return`['${o}']=${l}`});e+=`declare -A ${r}=(${i.join(" ")})
872
+ `}}return Fe(e)}function m6(t){let e="",n=new Set;for(let s of t.state.env.keys()){if(s.startsWith("BASH_"))continue;if(s.endsWith("__length")){let o=s.slice(0,-8);t.state.associativeArrays?.has(o)||n.add(o);continue}let i=s.lastIndexOf("_");if(i>0){let o=s.slice(0,i),a=s.slice(i+1);/^\d+$/.test(a)&&(t.state.associativeArrays?.has(o)||n.add(o))}}let r=Array.from(n).sort();for(let s of r){let i=ot(t,s);if(i.length===0)e+=`declare -a ${s}=()
873
+ `;else{let o=i.map(a=>{let l=$(t.state.env,`${s}_${a}`,"");return`[${a}]=${Cr(l)}`});e+=`declare -a ${s}=(${o.join(" ")})
874
+ `}}return Fe(e)}function g6(t){let e="",n=new Set;for(let s of t.state.env.keys()){if(s.startsWith("BASH_"))continue;if(s.endsWith("__length")){let o=s.slice(0,-8);n.add(o);continue}let i=s.lastIndexOf("_");if(i>0){let o=s.slice(0,i),a=s.slice(i+1);if(/^\d+$/.test(a)||t.state.associativeArrays?.has(o)){n.add(o);continue}}n.add(s)}let r=Array.from(n).sort();for(let s of r)t.state.associativeArrays?.has(s)||ot(t,s).length>0||t.state.env.has(`${s}__length`)||t.state.env.has(s)&&(e+=`${s}=${jo($(t.state.env,s))}
875
+ `);return Fe(e)}function nu(t,e){t.state.integerVars??=new Set,t.state.integerVars.add(e)}function Zs(t,e){return t.state.integerVars?.has(e)??!1}function ru(t,e){t.state.lowercaseVars??=new Set,t.state.lowercaseVars.add(e),t.state.uppercaseVars?.delete(e)}function ZE(t,e){return t.state.lowercaseVars?.has(e)??!1}function su(t,e){t.state.uppercaseVars??=new Set,t.state.uppercaseVars.add(e),t.state.lowercaseVars?.delete(e)}function YE(t,e){return t.state.uppercaseVars?.has(e)??!1}function cs(t,e,n){return ZE(t,e)?n.toLowerCase():YE(t,e)?n.toUpperCase():n}async function y6(t,e){try{let n=new ye,r=Te(n,e),s=await ue(t,r.expression);return String(s)}catch{return"0"}}function QE(t){let e=t.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!e)return null;let n=e[0],r=n.length;if(t[r]!=="[")return null;let s=0,i=r+1;for(;r<t.length;r++)if(t[r]==="[")s++;else if(t[r]==="]"&&(s--,s===0))break;if(s!==0)return null;let o=t.slice(i,r);if(r++,t[r]!=="=")return null;r++;let a=t.slice(r);return{name:n,indexExpr:o,value:a}}async function iu(t,e){let n=!1,r=!1,s=!1,i=!1,o=!1,a=!1,l=!1,c=!1,u=!1,f=!1,p=!1,h=!1,m=!1,d=!1,g=!1,w=[];for(let M=0;M<e.length;M++){let Y=e[M];if(Y==="-a")n=!0;else if(Y==="-A")r=!0;else if(Y==="-r")s=!0;else if(Y==="-x")i=!0;else if(Y==="-p")o=!0;else if(Y==="-n")a=!0;else if(Y==="+n")l=!0;else if(Y==="+a")c=!0;else if(Y==="+x")u=!0;else if(Y==="--"){w.push(...e.slice(M+1));break}else if(Y.startsWith("+")){for(let B of Y.slice(1))if(B==="n")l=!0;else if(B==="a")c=!0;else if(B==="x")u=!0;else if(B!=="r"){if(B!=="i"){if(!(B==="f"||B==="F"))return K(y,x(`bash: typeset: +${B}: invalid option
876
+ `),2)}}}else if(Y==="-i")f=!0;else if(Y==="-l")p=!0;else if(Y==="-u")h=!0;else if(Y==="-f")m=!0;else if(Y==="-F")d=!0;else if(Y==="-g")g=!0;else if(Y.startsWith("-"))for(let B of Y.slice(1))if(B==="a")n=!0;else if(B==="A")r=!0;else if(B==="r")s=!0;else if(B==="x")i=!0;else if(B==="p")o=!0;else if(B==="n")a=!0;else if(B==="i")f=!0;else if(B==="l")p=!0;else if(B==="u")h=!0;else if(B==="f")m=!0;else if(B==="F")d=!0;else if(B==="g")g=!0;else return K(y,x(`bash: typeset: -${B}: invalid option
877
+ `),2);else w.push(Y)}let b=t.state.localScopes.length>0&&!g,A=M=>{if(!b)return;let Y=t.state.localScopes[t.state.localScopes.length-1];Y.has(M)||Y.set(M,t.state.env.get(M))},N=M=>{if(!b)return;let Y=t.state.localScopes[t.state.localScopes.length-1];Y.has(M)||Y.set(M,t.state.env.get(M));let B=`${M}_`;for(let D of t.state.env.keys())D.startsWith(B)&&!D.includes("__")&&(Y.has(D)||Y.set(D,t.state.env.get(D)));let L=`${M}__length`;t.state.env.has(L)&&!Y.has(L)&&Y.set(L,t.state.env.get(L))},P=M=>{b&&Xn(t,M)};if(d){if(w.length===0){let B=Array.from(t.state.functions.keys()).sort(),L="";for(let D of B)L+=`declare -f ${D}
878
+ `;return Fe(L)}let M=!0,Y="";for(let B of w)t.state.functions.has(B)?Y+=`${B}
879
+ `:M=!1;return K(x(Y),y,M?0:1)}if(m){if(w.length===0){let Y="",B=Array.from(t.state.functions.keys()).sort();for(let L of B)Y+=`${L} ()
880
+ {
881
+ # function body
882
+ }
883
+ `;return Fe(Y)}let M=!0;for(let Y of w)t.state.functions.has(Y)||(M=!1);return K(y,y,M?0:1)}if(o&&w.length>0)return p6(t,w);if(o&&w.length===0)return h6(t,{filterExport:i,filterReadonly:s,filterNameref:a,filterIndexedArray:n,filterAssocArray:r});if(w.length===0&&r&&!o)return d6(t);if(w.length===0&&n&&!o)return m6(t);if(w.length===0&&!o)return g6(t);let O="",G=0;for(let M of w){let Y=M.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(Y&&!c){let v=Y[1],_=Y[2];if(r&&ot(t,v).length>0){O+=`bash: declare: ${v}: cannot convert indexed to associative array
884
+ `,G=1;continue}if((n||!r&&!n)&&t.state.associativeArrays?.has(v)){O+=`bash: declare: ${v}: cannot convert associative to indexed array
885
+ `,G=1;continue}if(N(v),r&&(t.state.associativeArrays??=new Set,t.state.associativeArrays.add(v)),Nn(t,v),t.state.env.delete(v),t.state.env.delete(`${v}__length`),r&&_.includes("[")){let H=Uo(_);for(let[pe,J]of H){let ce=tt(t,J);T(t.state.env,`${v}_${pe}`,ce)}}else if(r){let H=Tn(_);for(let pe=0;pe<H.length;pe+=2){let J=H[pe],ce=pe+1<H.length?tt(t,H[pe+1]):"";T(t.state.env,`${v}_${J}`,ce)}}else{let H=Tn(_);if(H.some(J=>/^\[[^\]]+\]=/.test(J))){let J=0;for(let ce of H){let we=ce.match(/^\[([^\]]+)\]=(.*)$/);if(we){let Q=we[1],fe=we[2],De=tt(t,fe),xe;if(/^-?\d+$/.test(Q))xe=Number.parseInt(Q,10);else try{let Re=new ye,ne=Te(Re,Q);xe=await ue(t,ne.expression)}catch{xe=0}T(t.state.env,`${v}_${xe}`,De),J=xe+1}else{let Q=tt(t,ce);T(t.state.env,`${v}_${J}`,Q),J++}}}else{for(let J=0;J<H.length;J++)T(t.state.env,`${v}_${J}`,H[J]);T(t.state.env,`${v}__length`,String(H.length))}}P(v),s&&jt(t,v),i&&dn(t,v);continue}if(l){let v=M.includes("=")?M.slice(0,M.indexOf("=")):M;if(g2(t,v),!M.includes("="))continue}if(u){let v=M.includes("=")?M.slice(0,M.indexOf("=")):M;if(Eo(t,v),!M.includes("="))continue}let B=QE(M);if(B){let{name:v,indexExpr:_,value:H}=B,pe=ht(t,v);if(pe)return pe;N(v);let J;try{let we=new ye,Q=Te(we,_);J=await ue(t,Q.expression)}catch{let we=parseInt(_,10);J=Number.isNaN(we)?0:we}T(t.state.env,`${v}_${J}`,H);let ce=parseInt($(t.state.env,`${v}__length`,"0"),10);J>=ce&&T(t.state.env,`${v}__length`,String(J+1)),P(v),s&&jt(t,v),i&&dn(t,v);continue}let L=M.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(L&&!c){let v=L[1],_=L[2],H=ht(t,v);if(H)return H;N(v);let pe=Tn(_);if(t.state.associativeArrays?.has(v)){let J=Uo(_);for(let[ce,we]of J){let Q=tt(t,we);T(t.state.env,`${v}_${ce}`,Q)}}else{let J=ot(t,v),ce=0,we=t.state.env.get(v);J.length===0&&we!==void 0?(t.state.env.set(`${v}_0`,we),t.state.env.delete(v),ce=1):J.length>0&&(ce=Math.max(...J)+1);for(let fe=0;fe<pe.length;fe++)T(t.state.env,`${v}_${ce+fe}`,tt(t,pe[fe]));let Q=ce+pe.length;T(t.state.env,`${v}__length`,String(Q))}P(v),s&&jt(t,v),i&&dn(t,v);continue}let D=M.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(D){let v=D[1],_=tt(t,D[2]),H=ht(t,v);if(H)return H;A(v),f&&nu(t,v),p&&ru(t,v),h&&su(t,v);let J=ot(t,v).length>0||t.state.associativeArrays?.has(v);if(Zs(t,v)){let ce=$(t.state.env,v,"0"),we=parseInt(ce,10)||0,Q=parseInt(await y6(t,_),10)||0;_=String(we+Q),T(t.state.env,v,_)}else if(J){_=cs(t,v,_);let ce=`${v}_0`,we=$(t.state.env,ce);T(t.state.env,ce,we+_)}else{_=cs(t,v,_);let ce=$(t.state.env,v);T(t.state.env,v,ce+_)}P(v),s&&jt(t,v),i&&dn(t,v),t.state.options.allexport&&!u&&(t.state.exportedVars=t.state.exportedVars||new Set,t.state.exportedVars.add(v));continue}if(M.includes("=")){let v=M.indexOf("="),_=M.slice(0,v),H=M.slice(v+1);if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(_)){O+=`bash: typeset: \`${_}': not a valid identifier
886
+ `,G=1;continue}let pe=ht(t,_);if(pe)return pe;if(A(_),a){if(H!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(H)){O+=`bash: declare: \`${H}': invalid variable name for name reference
887
+ `,G=1;continue}T(t.state.env,_,H),_n(t,_),H!==""&&bo(t,H)&&Ec(t,_),P(_),s&&jt(t,_),i&&dn(t,_);continue}if(f&&nu(t,_),p&&ru(t,_),h&&su(t,_),Zs(t,_)&&(H=await y6(t,H)),H=cs(t,_,H),_e(t,_)){let J=bt(t,_);J&&J!==_?T(t.state.env,J,H):T(t.state.env,_,H)}else T(t.state.env,_,H);P(_),s&&jt(t,_),i&&dn(t,_),t.state.options.allexport&&!u&&(t.state.exportedVars=t.state.exportedVars||new Set,t.state.exportedVars.add(_))}else{let v=M;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(v)){O+=`bash: typeset: \`${v}': not a valid identifier
888
+ `,G=1;continue}if(n||r?N(v):A(v),a){_n(t,v);let H=$(t.state.env,v);H!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(H)?y2(t,v):H&&bo(t,H)&&Ec(t,v),P(v),s&&jt(t,v),i&&dn(t,v);continue}if(f&&nu(t,v),p&&ru(t,v),h&&su(t,v),r){if(ot(t,v).length>0){O+=`bash: declare: ${v}: cannot convert indexed to associative array
889
+ `,G=1;continue}t.state.associativeArrays??=new Set,t.state.associativeArrays.add(v)}let _=Array.from(t.state.env.keys()).some(H=>H.startsWith(`${v}_`)&&!H.startsWith(`${v}__length`));!t.state.env.has(v)&&!_&&(n||r?T(t.state.env,`${v}__length`,"0"):(t.state.declaredVars??=new Set,t.state.declaredVars.add(v))),P(v),s&&jt(t,v),i&&dn(t,v)}}return K(y,x(O),G)}async function ou(t,e){let n=!1,r=!1,s=!1,i=[];for(let o=0;o<e.length;o++){let a=e[o];if(a==="-a")n=!0;else if(a==="-A")r=!0;else if(a==="-p")s=!0;else if(a==="--"){i.push(...e.slice(o+1));break}else a.startsWith("-")||i.push(a)}if(i.length===0){let o="",a=Array.from(t.state.readonlyVars||[]).sort();for(let l of a){let c=t.state.env.get(l);if(c!==void 0){let u=R(c??y).replace(/\\/g,"\\\\").replace(/"/g,'\\"');o+=`declare -r ${l}="${u}"
890
+ `}}return Fe(o)}for(let o of i){let a=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(a){let f=a[1],p=a[2],h=ht(t,f);if(h)return h;let m=Tn(p);if(t.state.associativeArrays?.has(f)){let d=Uo(p);for(let[g,w]of d){let E=tt(t,w);T(t.state.env,`${f}_${g}`,E)}}else{let d=ot(t,f),g=0,w=t.state.env.get(f);d.length===0&&w!==void 0?(t.state.env.set(`${f}_0`,w),t.state.env.delete(f),g=1):d.length>0&&(g=Math.max(...d)+1);for(let b=0;b<m.length;b++)T(t.state.env,`${f}_${g+b}`,tt(t,m[b]));let E=g+m.length;T(t.state.env,`${f}__length`,String(E))}jt(t,f);continue}let l=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(l){let f=l[1],p=tt(t,l[2]),h=ht(t,f);if(h)return h;let m=$(t.state.env,f);T(t.state.env,f,m+p),jt(t,f);continue}let c=t6(o);if(c.value===void 0&&!c.isArray){jt(t,c.name);continue}let u=await n6(t,c,{makeReadonly:!0});if(u)return u}return Se}F();function au(t){return t.state.directoryStack??=[],t.state.directoryStack}function Ys(t,e){return e&&t===e?"~":e&&t.startsWith(`${e}/`)?`~${t.slice(e.length)}`:t}function KE(t){let e=t.split("/").filter(r=>r&&r!=="."),n=[];for(let r of e)r===".."?n.pop():n.push(r);return`/${n.join("/")}`}async function lu(t,e){let n=au(t),r;for(let a=0;a<e.length;a++){let l=e[a];if(l==="--"){if(a+1<e.length){if(r!==void 0)return V(`bash: pushd: too many arguments
891
+ `,2);r=e[a+1],a++}}else{if(l.startsWith("-")&&l!=="-")return V(`bash: pushd: ${l}: invalid option
892
+ `,2);if(r!==void 0)return V(`bash: pushd: too many arguments
893
+ `,2);r=l}}if(r===void 0){if(n.length<2)return V(`bash: pushd: no other directory
894
+ `,1);let a=n[0];n[0]=n[1],n[1]=a,r=n[0]}let s;if(r.startsWith("/"))s=r;else if(r===".."){let a=t.state.cwd.split("/").filter(l=>l);a.pop(),s=`/${a.join("/")}`}else r==="."?s=t.state.cwd:r.startsWith("~")?s=$(t.state.env,"HOME","/")+r.slice(1):s=`${t.state.cwd}/${r}`;s=KE(s);try{if(!(await t.fs.stat(s)).isDirectory)return V(`bash: pushd: ${r}: Not a directory
895
+ `,1)}catch{return V(`bash: pushd: ${r}: No such file or directory
896
+ `,1)}n.unshift(t.state.cwd),t.state.previousDir=t.state.cwd,t.state.cwd=s,T(t.state.env,"PWD",s),T(t.state.env,"OLDPWD",t.state.previousDir);let i=$(t.state.env,"HOME",""),o=`${[s,...n].map(a=>Ys(a,i)).join(" ")}
897
+ `;return Fe(o)}function cu(t,e){let n=au(t);for(let o of e)if(o!=="--")return o.startsWith("-")&&o!=="-"?V(`bash: popd: ${o}: invalid option
898
+ `,2):V(`bash: popd: too many arguments
899
+ `,2);if(n.length===0)return V(`bash: popd: directory stack empty
900
+ `,1);let r=n.shift();if(!r)return V(`bash: popd: directory stack empty
901
+ `,1);t.state.previousDir=t.state.cwd,t.state.cwd=r,T(t.state.env,"PWD",r),T(t.state.env,"OLDPWD",t.state.previousDir);let s=$(t.state.env,"HOME",""),i=`${[r,...n].map(o=>Ys(o,s)).join(" ")}
902
+ `;return Fe(i)}function uu(t,e){let n=au(t),r=!1,s=!1,i=!1,o=!1;for(let u of e)if(u!=="--")if(u.startsWith("-"))for(let f of u.slice(1))if(f==="c")r=!0;else if(f==="l")s=!0;else if(f==="p")i=!0;else if(f==="v")i=!0,o=!0;else return V(`bash: dirs: -${f}: invalid option
903
+ `,2);else return V(`bash: dirs: too many arguments
904
+ `,1);if(r)return t.state.directoryStack=[],Se;let a=[t.state.cwd,...n],l=$(t.state.env,"HOME",""),c;return o?(c=a.map((u,f)=>{let p=s?u:Ys(u,l);return` ${f} ${p}`}).join(`
905
+ `),c+=`
906
+ `):i?c=a.map(u=>s?u:Ys(u,l)).join(`
907
+ `)+`
908
+ `:c=a.map(u=>s?u:Ys(u,l)).join(" ")+`
909
+ `,Fe(c)}it();Ne();async function Go(t,e,n){let r=e;if(r.length>0){let a=r[0];if(a==="--")r=r.slice(1);else if(a.startsWith("-")&&a!=="-"&&a.length>1)return V(`bash: eval: ${a}: invalid option
910
+ eval: usage: eval [arg ...]
911
+ `,2)}if(r.length===0)return Se;let s=r.join(" ");if(s.trim()==="")return Se;let i=t.state.groupStdin,o=n??t.state.groupStdin;o!==void 0&&(t.state.groupStdin=o);try{let a=Cn(s);return await t.executeScript(a)}catch(a){if(a instanceof xt||a instanceof Et||a instanceof mt||a instanceof Ee)throw a;if(a.name==="ParseException")return V(`bash: eval: ${a.message}
912
+ `);throw a}finally{t.state.groupStdin=i}}F();Ne();function fu(t,e){let n,r=y;if(e.length===0)n=t.state.lastExitCode;else{let s=e[0],i=Number.parseInt(s,10);s===""||Number.isNaN(i)||!/^-?\d+$/.test(s)?(r=x(`bash: exit: ${s}: numeric argument required
913
+ `),n=2):n=(i%256+256)%256}throw new Ee(n,y,r)}F();Yn();function pu(t,e){let n=!1,r=[];for(let o of e)o==="-n"?n=!0:o==="-p"||o==="--"||r.push(o);if(r.length===0&&!n){let o="",a=t.state.exportedVars??new Set,l=Array.from(a).sort();for(let c of l){let u=t.state.env.get(c);if(u!==void 0){let f=R(u??y).replace(/\\/g,"\\\\").replace(/"/g,'\\"');o+=`declare -x ${c}="${f}"
914
+ `}}return Fe(o)}if(n){for(let o of r){let a,l;if(o.includes("=")){let c=o.indexOf("=");a=o.slice(0,c),l=tt(t,o.slice(c+1)),T(t.state.env,a,l)}else a=o;Eo(t,a)}return Se}let s="",i=0;for(let o of r){let a,l,c=!1,u=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(u)a=u[1],l=tt(t,u[2]),c=!0;else if(o.includes("=")){let f=o.indexOf("=");a=o.slice(0,f),l=tt(t,o.slice(f+1))}else a=o;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a)){s+=`bash: export: \`${o}': not a valid identifier
915
+ `,i=1;continue}if(l!==void 0)if(c){let f=$(t.state.env,a);T(t.state.env,a,f+l)}else T(t.state.env,a,l);else t.state.env.has(a)||T(t.state.env,a,"");dn(t,a)}return K(y,x(s),i)}F();function Vo(t,e){if(e.length<2)return V(`bash: getopts: usage: getopts optstring name [arg ...]
916
+ `);let n=e[0],r=e[1],s=!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r),i=n.startsWith(":"),o=i?n.slice(1):n,a;if(e.length>2)a=e.slice(2);else{let d=Number.parseInt($(t.state.env,"#","0"),10);a=[];for(let g=1;g<=d;g++)a.push($(t.state.env,String(g))||"")}let l=Number.parseInt($(t.state.env,"OPTIND","1"),10);l<1&&(l=1);let c=Number.parseInt($(t.state.env,"__GETOPTS_CHARINDEX","0"),10);if(T(t.state.env,"OPTARG",""),l>a.length)return s||T(t.state.env,r,"?"),T(t.state.env,"OPTIND",String(a.length+1)),T(t.state.env,"__GETOPTS_CHARINDEX","0"),{exitCode:s?2:1,stdout:y,stderr:y};let u=a[l-1];if(!u||u==="-"||!u.startsWith("-"))return s||T(t.state.env,r,"?"),{exitCode:s?2:1,stdout:y,stderr:y};if(u==="--")return T(t.state.env,"OPTIND",String(l+1)),T(t.state.env,"__GETOPTS_CHARINDEX","0"),s||T(t.state.env,r,"?"),{exitCode:s?2:1,stdout:y,stderr:y};let f=c===0?1:c,p=u[f];if(!p)return T(t.state.env,"OPTIND",String(l+1)),T(t.state.env,"__GETOPTS_CHARINDEX","0"),Vo(t,e);let h=o.indexOf(p);if(h===-1){let d="";return i?T(t.state.env,"OPTARG",p):d=`bash: illegal option -- ${p}
917
+ `,s||T(t.state.env,r,"?"),f+1<u.length?(T(t.state.env,"__GETOPTS_CHARINDEX",String(f+1)),T(t.state.env,"OPTIND",String(l))):(T(t.state.env,"OPTIND",String(l+1)),T(t.state.env,"__GETOPTS_CHARINDEX","0")),{exitCode:s?2:0,stdout:y,stderr:x(d)}}if(h+1<o.length&&o[h+1]===":")if(f+1<u.length)T(t.state.env,"OPTARG",u.slice(f+1)),T(t.state.env,"OPTIND",String(l+1)),T(t.state.env,"__GETOPTS_CHARINDEX","0");else{if(l>=a.length){let d="";return i?(T(t.state.env,"OPTARG",p),s||T(t.state.env,r,":")):(d=`bash: option requires an argument -- ${p}
918
+ `,s||T(t.state.env,r,"?")),T(t.state.env,"OPTIND",String(l+1)),T(t.state.env,"__GETOPTS_CHARINDEX","0"),{exitCode:s?2:0,stdout:y,stderr:x(d)}}T(t.state.env,"OPTARG",a[l]),T(t.state.env,"OPTIND",String(l+2)),T(t.state.env,"__GETOPTS_CHARINDEX","0")}else f+1<u.length?(T(t.state.env,"__GETOPTS_CHARINDEX",String(f+1)),T(t.state.env,"OPTIND",String(l))):(T(t.state.env,"OPTIND",String(l+1)),T(t.state.env,"__GETOPTS_CHARINDEX","0"));return s||T(t.state.env,r,p),{exitCode:s?2:0,stdout:y,stderr:y}}F();async function hu(t,e){t.state.hashTable||(t.state.hashTable=new Map);let n=!1,r=!1,s=!1,i=!1,o=!1,a="",l=[],c=0;for(;c<e.length;){let m=e[c];if(m==="--"){c++,l.push(...e.slice(c));break}if(m==="-r")n=!0,c++;else if(m==="-d")r=!0,c++;else if(m==="-l")s=!0,c++;else if(m==="-t")o=!0,c++;else if(m==="-p"){if(i=!0,c++,c>=e.length)return V(`bash: hash: -p: option requires an argument
919
+ `,1);a=e[c],c++}else if(m.startsWith("-")&&m.length>1){for(let d of m.slice(1))if(d==="r")n=!0;else if(d==="d")r=!0;else if(d==="l")s=!0;else if(d==="t")o=!0;else return d==="p"?V(`bash: hash: -p: option requires an argument
920
+ `,1):V(`bash: hash: -${d}: invalid option
921
+ `,1);c++}else l.push(m),c++}if(n)return t.state.hashTable.clear(),Se;if(r){if(l.length===0)return V(`bash: hash: -d: option requires an argument
922
+ `,1);let m=!1,d="";for(let g of l)t.state.hashTable.has(g)?t.state.hashTable.delete(g):(d+=`bash: hash: ${g}: not found
923
+ `,m=!0);return m?V(d,1):Se}if(o){if(l.length===0)return V(`bash: hash: -t: option requires an argument
924
+ `,1);let m="",d=!1,g="";for(let w of l){let E=t.state.hashTable.get(w);E?l.length>1?m+=`${w} ${E}
925
+ `:m+=`${E}
926
+ `:(g+=`bash: hash: ${w}: not found
927
+ `,d=!0)}return d?{exitCode:1,stdout:x(m),stderr:x(g)}:Fe(m)}if(i){if(l.length===0)return V(`bash: hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]
928
+ `,1);let m=l[0];return t.state.hashTable.set(m,a),Se}if(l.length===0){if(t.state.hashTable.size===0)return Fe(`hash: hash table empty
929
+ `);let m="";if(s)for(let[d,g]of t.state.hashTable)m+=`builtin hash -p ${g} ${d}
930
+ `;else{m=`hits command
931
+ `;for(let[,d]of t.state.hashTable)m+=` 1 ${d}
932
+ `}return Fe(m)}let u=!1,f="",h=$(t.state.env,"PATH","/usr/bin:/bin").split(":");for(let m of l){if(m.includes("/")){f+=`bash: hash: ${m}: cannot use / in name
933
+ `,u=!0;continue}let d=!1;for(let g of h){if(!g)continue;let w=`${g}/${m}`;if(await t.fs.exists(w)){t.state.hashTable.set(m,w),d=!0;break}}d||(f+=`bash: hash: ${m}: not found
934
+ `,u=!0)}return u?V(f,1):Se}Ve();F();var w6=new Map([[":",[": [arguments]",`Null command.
935
+ No effect; the command does nothing.
936
+ Exit Status:
937
+ Always succeeds.`]],[".",[". filename [arguments]",`Execute commands from a file in the current shell.
938
+ Read and execute commands from FILENAME in the current shell.
939
+ The entries in $PATH are used to find the directory containing FILENAME.
940
+ Exit Status:
941
+ Returns the status of the last command executed in FILENAME.`]],["[",["[ arg... ]",`Evaluate conditional expression.
942
+ This is a synonym for the "test" builtin, but the last argument must
943
+ be a literal \`]', to match the opening \`['.`]],["alias",["alias [-p] [name[=value] ... ]",`Define or display aliases.
944
+ Without arguments, \`alias' prints the list of aliases in the reusable
945
+ form \`alias NAME=VALUE' on standard output.
946
+ Exit Status:
947
+ alias returns true unless a NAME is supplied for which no alias has been
948
+ defined.`]],["bg",["bg [job_spec ...]",`Move jobs to the background.
949
+ Place the jobs identified by each JOB_SPEC in the background, as if they
950
+ had been started with \`&'.`]],["break",["break [n]",`Exit for, while, or until loops.
951
+ Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing
952
+ loops.
953
+ Exit Status:
954
+ The exit status is 0 unless N is not greater than or equal to 1.`]],["builtin",["builtin [shell-builtin [arg ...]]",`Execute shell builtins.
955
+ Execute SHELL-BUILTIN with arguments ARGs without performing command
956
+ lookup. This is useful when you wish to reimplement a shell builtin
957
+ as a shell function, but need to execute the builtin within the function.
958
+ Exit Status:
959
+ Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
960
+ not a shell builtin.`]],["caller",["caller [expr]",`Return the context of the current subroutine call.
961
+ Without EXPR, returns "$line $filename". With EXPR, returns
962
+ "$line $subroutine $filename"; this extra information can be used to
963
+ provide a stack trace.
964
+ Exit Status:
965
+ Returns 0 unless the shell is not executing a subroutine call or
966
+ EXPR is invalid.`]],["cd",["cd [-L|-P] [dir]",`Change the shell working directory.
967
+ Change the current directory to DIR. The default DIR is the value of the
968
+ HOME shell variable.
969
+
970
+ The variable CDPATH defines the search path for the directory containing
971
+ DIR. Alternative directory names in CDPATH are separated by a colon (:).
972
+ A null directory name is the same as the current directory. If DIR begins
973
+ with a slash (/), then CDPATH is not used.
974
+
975
+ If the directory is not found, and the shell option \`cdable_vars' is set,
976
+ the word is assumed to be a variable name. If that variable has a value,
977
+ its value is used for DIR.
978
+
979
+ Options:
980
+ -L force symbolic links to be followed
981
+ -P use the physical directory structure without following symbolic
982
+ links
983
+
984
+ The default is to follow symbolic links, as if \`-L' were specified.
985
+
986
+ Exit Status:
987
+ Returns 0 if the directory is changed; non-zero otherwise.`]],["command",["command [-pVv] command [arg ...]",`Execute a simple command or display information about commands.
988
+ Runs COMMAND with ARGS suppressing shell function lookup, or display
989
+ information about the specified COMMANDs.
990
+
991
+ Options:
992
+ -p use a default value for PATH that is guaranteed to find all of
993
+ the standard utilities
994
+ -v print a description of COMMAND similar to the \`type' builtin
995
+ -V print a more verbose description of each COMMAND
996
+
997
+ Exit Status:
998
+ Returns exit status of COMMAND, or failure if COMMAND is not found.`]],["compgen",["compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]",`Display possible completions depending on the options.
999
+ Intended to be used from within a shell function generating possible
1000
+ completions. If the optional WORD argument is supplied, matches against
1001
+ WORD are generated.
1002
+ Exit Status:
1003
+ Returns success unless an invalid option is supplied or an error occurs.`]],["complete",["complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]",`Specify how arguments are to be completed.
1004
+ For each NAME, specify how arguments are to be completed.
1005
+ Exit Status:
1006
+ Returns success unless an invalid option is supplied or an error occurs.`]],["continue",["continue [n]",`Resume for, while, or until loops.
1007
+ Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.
1008
+ If N is specified, resumes the Nth enclosing loop.
1009
+ Exit Status:
1010
+ The exit status is 0 unless N is not greater than or equal to 1.`]],["declare",["declare [-aAfFgilnrtux] [-p] [name[=value] ...]",`Set variable values and attributes.
1011
+ Declare variables and give them attributes. If no NAMEs are given,
1012
+ display the attributes and values of all variables.
1013
+
1014
+ Options:
1015
+ -a to make NAMEs indexed arrays (if supported)
1016
+ -A to make NAMEs associative arrays (if supported)
1017
+ -i to make NAMEs have the \`integer' attribute
1018
+ -l to convert the value of each NAME to lower case on assignment
1019
+ -n make NAME a reference to the variable named by its value
1020
+ -r to make NAMEs readonly
1021
+ -t to make NAMEs have the \`trace' attribute
1022
+ -u to convert the value of each NAME to upper case on assignment
1023
+ -x to make NAMEs export
1024
+
1025
+ Exit Status:
1026
+ Returns success unless an invalid option is supplied or a variable
1027
+ assignment error occurs.`]],["dirs",["dirs [-clpv] [+N] [-N]",`Display directory stack.
1028
+ Display the list of currently remembered directories. Directories
1029
+ find their way onto the list with the \`pushd' command; you can get
1030
+ back up through the list with the \`popd' command.
1031
+ Exit Status:
1032
+ Returns success unless an invalid option is supplied or an error occurs.`]],["disown",["disown [-h] [-ar] [jobspec ...]",`Remove jobs from current shell.
1033
+ Without any JOBSPECs, remove the current job.`]],["echo",["echo [-neE] [arg ...]",`Write arguments to the standard output.
1034
+ Display the ARGs, separated by a single space character and followed by a
1035
+ newline, on the standard output.
1036
+
1037
+ Options:
1038
+ -n do not append a newline
1039
+ -e enable interpretation of the following backslash escapes
1040
+ -E explicitly suppress interpretation of backslash escapes
1041
+
1042
+ Exit Status:
1043
+ Returns success unless a write error occurs.`]],["enable",["enable [-a] [-dnps] [-f filename] [name ...]",`Enable and disable shell builtins.
1044
+ Enables and disables builtin shell commands.
1045
+ Exit Status:
1046
+ Returns success unless NAME is not a shell builtin or an error occurs.`]],["eval",["eval [arg ...]",`Execute arguments as a shell command.
1047
+ Combine ARGs into a single string, use the result as input to the shell,
1048
+ and execute the resulting commands.
1049
+ Exit Status:
1050
+ Returns exit status of command or success if command is null.`]],["exec",["exec [-cl] [-a name] [command [arguments ...]] [redirection ...]",`Replace the shell with the given command.
1051
+ Execute COMMAND, replacing this shell with the specified program.
1052
+ ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,
1053
+ any redirections take effect in the current shell.
1054
+ Exit Status:
1055
+ Returns success unless COMMAND is not found or a redirection error occurs.`]],["exit",["exit [n]",`Exit the shell.
1056
+ Exits the shell with a status of N. If N is omitted, the exit status
1057
+ is that of the last command executed.`]],["export",["export [-fn] [name[=value] ...] or export -p",`Set export attribute for shell variables.
1058
+ Marks each NAME for automatic export to the environment of subsequently
1059
+ executed commands. If VALUE is supplied, assign VALUE before exporting.
1060
+
1061
+ Options:
1062
+ -f refer to shell functions
1063
+ -n remove the export property from each NAME
1064
+ -p display a list of all exported variables and functions
1065
+
1066
+ Exit Status:
1067
+ Returns success unless an invalid option is given or NAME is invalid.`]],["false",["false",`Return an unsuccessful result.
1068
+ Exit Status:
1069
+ Always fails.`]],["fc",["fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]",`Display or execute commands from the history list.
1070
+ Exit Status:
1071
+ Returns success or status of executed command.`]],["fg",["fg [job_spec]",`Move job to the foreground.
1072
+ Place the job identified by JOB_SPEC in the foreground, making it the
1073
+ current job.`]],["getopts",["getopts optstring name [arg]",`Parse option arguments.
1074
+ Getopts is used by shell procedures to parse positional parameters
1075
+ as options.
1076
+
1077
+ OPTSTRING contains the option letters to be recognized; if a letter
1078
+ is followed by a colon, the option is expected to have an argument,
1079
+ which should be separated from it by white space.
1080
+ Exit Status:
1081
+ Returns success if an option is found; fails if the end of options is
1082
+ encountered or an error occurs.`]],["hash",["hash [-lr] [-p pathname] [-dt] [name ...]",`Remember or display program locations.
1083
+ Determine and remember the full pathname of each command NAME.
1084
+ Exit Status:
1085
+ Returns success unless NAME is not found or an invalid option is given.`]],["help",["help [-s] [pattern ...]",`Display information about builtin commands.
1086
+ Displays brief summaries of builtin commands. If PATTERN is
1087
+ specified, gives detailed help on all commands matching PATTERN,
1088
+ otherwise the list of help topics is printed.
1089
+
1090
+ Options:
1091
+ -s output only a short usage synopsis for each topic matching
1092
+ PATTERN
1093
+
1094
+ Exit Status:
1095
+ Returns success unless PATTERN is not found.`]],["history",["history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]",`Display or manipulate the history list.
1096
+ Display the history list with line numbers, prefixing each modified
1097
+ entry with a \`*'.
1098
+ Exit Status:
1099
+ Returns success unless an invalid option is given or an error occurs.`]],["jobs",["jobs [-lnprs] [jobspec ...] or jobs -x command [args]",`Display status of jobs.
1100
+ Lists the active jobs.
1101
+ Exit Status:
1102
+ Returns success unless an invalid option is given or an error occurs.`]],["kill",["kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]",`Send a signal to a job.
1103
+ Send the processes identified by PID or JOBSPEC the signal named by
1104
+ SIGSPEC or SIGNUM.
1105
+ Exit Status:
1106
+ Returns success unless an invalid option is given or an error occurs.`]],["let",["let arg [arg ...]",`Evaluate arithmetic expressions.
1107
+ Evaluate each ARG as an arithmetic expression. Evaluation is done in
1108
+ fixed-width integers with no check for overflow, though division by 0
1109
+ is trapped and flagged as an error.
1110
+ Exit Status:
1111
+ If the last ARG evaluates to 0, let returns 1; 0 is returned otherwise.`]],["local",["local [option] name[=value] ...",`Define local variables.
1112
+ Create a local variable called NAME, and give it VALUE. OPTION can
1113
+ be any option accepted by \`declare'.
1114
+
1115
+ Local can only be used within a function; it makes the variable NAME
1116
+ have a visible scope restricted to that function and its children.
1117
+ Exit Status:
1118
+ Returns success unless an invalid option is supplied, a variable
1119
+ assignment error occurs, or the shell is not executing a function.`]],["logout",["logout [n]",`Exit a login shell.
1120
+ Exits a login shell with exit status N. Returns an error if not executed
1121
+ in a login shell.`]],["mapfile",["mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]",`Read lines from the standard input into an indexed array variable.
1122
+ Read lines from the standard input into the indexed array variable ARRAY,
1123
+ or from file descriptor FD if the -u option is supplied.
1124
+
1125
+ Options:
1126
+ -d delim Use DELIM to terminate lines, instead of newline
1127
+ -n count Copy at most COUNT lines
1128
+ -O origin Begin assigning to ARRAY at index ORIGIN
1129
+ -s count Discard the first COUNT lines read
1130
+ -t Remove a trailing DELIM from each line read (default newline)
1131
+ -u fd Read lines from file descriptor FD instead of standard input
1132
+
1133
+ Exit Status:
1134
+ Returns success unless an invalid option is given or ARRAY is readonly.`]],["popd",["popd [-n] [+N | -N]",`Remove directories from stack.
1135
+ Removes entries from the directory stack.
1136
+ Exit Status:
1137
+ Returns success unless an invalid argument is supplied or the directory
1138
+ change fails.`]],["printf",["printf [-v var] format [arguments]",`Formats and prints ARGUMENTS under control of the FORMAT.
1139
+
1140
+ Options:
1141
+ -v var assign the output to shell variable VAR rather than
1142
+ display it on the standard output
1143
+
1144
+ FORMAT is a character string which contains three types of objects: plain
1145
+ characters, which are simply copied to standard output; character escape
1146
+ sequences, which are converted and copied to the standard output; and
1147
+ format specifications, each of which causes printing of the next successive
1148
+ argument.
1149
+ Exit Status:
1150
+ Returns success unless an invalid option is given or a write or assignment
1151
+ error occurs.`]],["pushd",["pushd [-n] [+N | -N | dir]",`Add directories to stack.
1152
+ Adds a directory to the top of the directory stack, or rotates
1153
+ the stack, making the new top of the stack the current working
1154
+ directory.
1155
+ Exit Status:
1156
+ Returns success unless an invalid argument is supplied or the directory
1157
+ change fails.`]],["pwd",["pwd [-LP]",`Print the name of the current working directory.
1158
+
1159
+ Options:
1160
+ -L print the value of $PWD if it names the current working
1161
+ directory
1162
+ -P print the physical directory, without any symbolic links
1163
+
1164
+ By default, \`pwd' behaves as if \`-L' were specified.
1165
+ Exit Status:
1166
+ Returns 0 unless an invalid option is given or the current directory
1167
+ cannot be read.`]],["read",["read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]",`Read a line from the standard input and split it into fields.
1168
+ Reads a single line from the standard input, or from file descriptor FD
1169
+ if the -u option is supplied. The line is split into fields as with word
1170
+ splitting, and the first word is assigned to the first NAME, the second
1171
+ word to the second NAME, and so on, with any leftover words assigned to
1172
+ the last NAME.
1173
+ Exit Status:
1174
+ The return code is zero, unless end-of-file is encountered, read times out,
1175
+ or an invalid file descriptor is supplied as the argument to -u.`]],["readarray",["readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]","Read lines from a file into an array variable.\n A synonym for `mapfile'."]],["readonly",["readonly [-aAf] [name[=value] ...] or readonly -p",`Mark shell variables as unchangeable.
1176
+ Mark each NAME as read-only; the values of these NAMEs may not be
1177
+ changed by subsequent assignment.
1178
+ Exit Status:
1179
+ Returns success unless an invalid option is given or NAME is invalid.`]],["return",["return [n]",`Return from a shell function.
1180
+ Causes a function or sourced script to exit with the return value
1181
+ specified by N. If N is omitted, the return status is that of the
1182
+ last command executed within the function or script.
1183
+ Exit Status:
1184
+ Returns N, or failure if the shell is not executing a function or script.`]],["set",["set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]",`Set or unset values of shell options and positional parameters.
1185
+ Change the value of shell attributes and positional parameters, or
1186
+ display the names and values of shell variables.
1187
+
1188
+ Options:
1189
+ -e Exit immediately if a command exits with a non-zero status.
1190
+ -u Treat unset variables as an error when substituting.
1191
+ -x Print commands and their arguments as they are executed.
1192
+ -o option-name
1193
+ Set the variable corresponding to option-name
1194
+
1195
+ Exit Status:
1196
+ Returns success unless an invalid option is given.`]],["shift",["shift [n]",`Shift positional parameters.
1197
+ Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is
1198
+ not given, it is assumed to be 1.
1199
+ Exit Status:
1200
+ Returns success unless N is negative or greater than $#.`]],["shopt",["shopt [-pqsu] [-o] [optname ...]",`Set and unset shell options.
1201
+ Change the setting of each shell option OPTNAME. Without any option
1202
+ arguments, list each supplied OPTNAME, or all shell options if no
1203
+ OPTNAMEs are given, with an indication of whether or not each is set.
1204
+
1205
+ Options:
1206
+ -o restrict OPTNAMEs to those defined for use with \`set -o'
1207
+ -p print each shell option with an indication of its status
1208
+ -q suppress output
1209
+ -s enable (set) each OPTNAME
1210
+ -u disable (unset) each OPTNAME
1211
+
1212
+ Exit Status:
1213
+ Returns success if OPTNAME is enabled; fails if an invalid option is
1214
+ given or OPTNAME is disabled.`]],["source",["source filename [arguments]",`Execute commands from a file in the current shell.
1215
+ Read and execute commands from FILENAME in the current shell.
1216
+ The entries in $PATH are used to find the directory containing FILENAME.
1217
+ Exit Status:
1218
+ Returns the status of the last command executed in FILENAME.`]],["suspend",["suspend [-f]",`Suspend shell execution.
1219
+ Suspend the execution of this shell until it receives a SIGCONT signal.`]],["test",["test [expr]",`Evaluate conditional expression.
1220
+ Exits with a status of 0 (true) or 1 (false) depending on
1221
+ the evaluation of EXPR. Expressions may be unary or binary.
1222
+ Exit Status:
1223
+ Returns success if EXPR evaluates to true; fails if EXPR evaluates to
1224
+ false or an invalid argument is given.`]],["times",["times",`Display process times.
1225
+ Prints the accumulated user and system times for the shell and all of its
1226
+ child processes.
1227
+ Exit Status:
1228
+ Always succeeds.`]],["trap",["trap [-lp] [[arg] signal_spec ...]",`Trap signals and other events.
1229
+ Defines and activates handlers to be run when the shell receives signals
1230
+ or other conditions.
1231
+ Exit Status:
1232
+ Returns success unless a SIGSPEC is invalid or an invalid option is given.`]],["true",["true",`Return a successful result.
1233
+ Exit Status:
1234
+ Always succeeds.`]],["type",["type [-afptP] name [name ...]",`Display information about command type.
1235
+ For each NAME, indicate how it would be interpreted if used as a
1236
+ command name.
1237
+
1238
+ Options:
1239
+ -a display all locations containing an executable named NAME
1240
+ -f suppress shell function lookup
1241
+ -P force a PATH search for each NAME, even if it is an alias,
1242
+ builtin, or function, and returns the name of the disk file
1243
+ that would be executed
1244
+ -p returns either the name of the disk file that would be executed,
1245
+ or nothing if \`type -t NAME' would not return \`file'
1246
+ -t output a single word which is one of \`alias', \`keyword',
1247
+ \`function', \`builtin', \`file' or \`', if NAME is an alias,
1248
+ shell reserved word, shell function, shell builtin, disk file,
1249
+ or not found, respectively
1250
+
1251
+ Exit Status:
1252
+ Returns success if all of the NAMEs are found; fails if any are not found.`]],["typeset",["typeset [-aAfFgilnrtux] [-p] name[=value] ...","Set variable values and attributes.\n A synonym for `declare'."]],["ulimit",["ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]",`Modify shell resource limits.
1253
+ Provides control over the resources available to the shell and processes
1254
+ it creates, on systems that allow such control.
1255
+ Exit Status:
1256
+ Returns success unless an invalid option is supplied or an error occurs.`]],["umask",["umask [-p] [-S] [mode]",`Display or set file mode mask.
1257
+ Sets the user file-creation mask to MODE. If MODE is omitted, prints
1258
+ the current value of the mask.
1259
+ Exit Status:
1260
+ Returns success unless MODE is invalid or an invalid option is given.`]],["unalias",["unalias [-a] name [name ...]",`Remove each NAME from the list of defined aliases.
1261
+ Exit Status:
1262
+ Returns success unless a NAME is not an existing alias.`]],["unset",["unset [-f] [-v] [-n] [name ...]",`Unset values and attributes of shell variables and functions.
1263
+ For each NAME, remove the corresponding variable or function.
1264
+
1265
+ Options:
1266
+ -f treat each NAME as a shell function
1267
+ -v treat each NAME as a shell variable
1268
+ -n treat each NAME as a name reference and unset the variable itself
1269
+ rather than the variable it references
1270
+
1271
+ Without options, unset first tries to unset a variable, and if that fails,
1272
+ tries to unset a function.
1273
+ Exit Status:
1274
+ Returns success unless an invalid option is given or a NAME is read-only.`]],["wait",["wait [-fn] [id ...]",`Wait for job completion and return exit status.
1275
+ Waits for each process identified by an ID, which may be a process ID or a
1276
+ job specification, and reports its termination status.
1277
+ Exit Status:
1278
+ Returns the status of the last ID; fails if ID is invalid or an invalid
1279
+ option is given.`]]]),b6=[...w6.keys()].sort();function du(t,e){let n=!1,r=[],s=0;for(;s<e.length;){let l=e[s];if(l==="--"){for(s++;s<e.length;)r.push(e[s]),s++;break}if(l.startsWith("-")&&l.length>1){for(let c=1;c<l.length;c++){let u=l[c];if(u==="s")n=!0;else return V(`bash: help: -${u}: invalid option
1280
+ `,2)}s++}else r.push(l),s++}if(r.length===0)return JE();let i="",o=!1,a="";for(let l of r){let c=XE(l);if(c.length===0){a+=`bash: help: no help topics match \`${l}'. Try \`help help' or \`man -k ${l}' or \`info ${l}'.
1281
+ `,o=!0;continue}for(let u of c){let f=w6.get(u);if(!f)continue;let[p,h]=f;n?i+=`${u}: ${p}
1282
+ `:i+=`${u}: ${p}
1283
+ ${h}
1284
+ `}}return{exitCode:o?1:0,stdout:x(i),stderr:x(a)}}function XE(t){let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,"."),n=ee(`^${e}$`);return b6.filter(r=>n.test(r))}function JE(){let t=[];t.push("just-bash shell builtins"),t.push("These shell commands are defined internally. Type `help' to see this list."),t.push("Type `help name' to find out more about the function `name'."),t.push("");let e=36,n=b6.slice(),r=Math.ceil(n.length/2);for(let s=0;s<r;s++){let i=n[s]||"",o=n[s+r]||"",a=i.padEnd(e);t.push(o?`${a}${o}`:i)}return Fe(`${t.join(`
1285
+ `)}
1286
+ `)}it();F();$t();function eA(t){let e=[],n="",r=0;for(let s of t){for(let i of s)i==="("?r++:i===")"&&r--;n?n+=` ${s}`:n=s,r===0&&(e.push(n),n="")}return n&&e.push(n),e}async function mu(t,e){if(e.length===0)return V(`bash: let: expression expected
1287
+ `);let n=eA(e),r=0;for(let s of n)try{let o=Cn(`(( ${s} ))`).statements[0];if(o&&o.pipelines.length>0&&o.pipelines[0].commands.length>0){let a=o.pipelines[0].commands[0];a.type==="ArithmeticCommand"&&(r=await ue(t,a.expression.expression))}}catch(i){return V(`bash: let: ${s}: ${i.message}
1288
+ `)}return K(y,y,r===0?1:0)}St();it();F();$t();on();an();Yn();async function gu(t,e){if(t.state.localScopes.length===0)return V(`bash: local: can only be used in a function
1289
+ `);let n=t.state.localScopes[t.state.localScopes.length-1],r="",s=0,i=!1,o=!1,a=!1,l=[];for(let c of e)if(c==="-n")i=!0;else if(c==="-a")o=!0;else if(c==="-p")a=!0;else if(c.startsWith("-")&&!c.includes("="))for(let u of c.slice(1))u==="n"?i=!0:u==="a"?o=!0:u==="p"&&(a=!0);else l.push(c);if(l.length===0){let c="",u=Array.from(n.keys()).filter(f=>!f.includes("_")||!f.match(/_\d+$/)).filter(f=>!f.includes("__length")).sort();for(let f of u){let p=t.state.env.get(f);if(p!==void 0){let h=R(p);c+=`${f}=${h}
1290
+ `}}return K(x(c),y,0)}for(let c of l){let u,f,p=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(p){u=p[1];let w=p[2];if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u)){r+=`bash: local: \`${c}': not a valid identifier
1291
+ `,s=1;continue}if(ht(t,u,"bash"),!n.has(u)){n.set(u,t.state.env.get(u));let A=`${u}_`;for(let N of t.state.env.keys())N.startsWith(A)&&!N.includes("__")&&(n.has(N)||n.set(N,t.state.env.get(N)))}let E=`${u}_`;for(let A of t.state.env.keys())A.startsWith(E)&&!A.includes("__")&&t.state.env.delete(A);let b=Tn(w);for(let A=0;A<b.length;A++)T(t.state.env,`${u}_${A}`,b[A]);T(t.state.env,`${u}__length`,String(b.length)),Xn(t,u),i&&_n(t,u);continue}let h=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(h){u=h[1];let w=h[2];if(ht(t,u,"bash"),!n.has(u)){n.set(u,t.state.env.get(u));let O=`${u}_`;for(let M of t.state.env.keys())M.startsWith(O)&&!M.includes("__")&&(n.has(M)||n.set(M,t.state.env.get(M)));let G=`${u}__length`;t.state.env.has(G)&&!n.has(G)&&n.set(G,t.state.env.get(G))}let E=Tn(w),b=ot(t,u),A=0,N=t.state.env.get(u);b.length===0&&N!==void 0?(t.state.env.set(`${u}_0`,N),t.state.env.delete(u),A=1):b.length>0&&(A=Math.max(...b)+1);for(let O=0;O<E.length;O++)T(t.state.env,`${u}_${A+O}`,tt(t,E[O]));let P=A+E.length;T(t.state.env,`${u}__length`,String(P)),Xn(t,u),i&&_n(t,u);continue}let m=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(m){u=m[1];let w=tt(t,m[2]);ht(t,u,"bash"),n.has(u)||n.set(u,t.state.env.get(u));let E=$(t.state.env,u);T(t.state.env,u,E+w),Xn(t,u),i&&_n(t,u);continue}let d=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([^\]]+)\]=(.*)$/s);if(d){u=d[1];let w=d[2],E=tt(t,d[3]);if(ht(t,u,"bash"),!n.has(u)){n.set(u,t.state.env.get(u));let N=`${u}_`;for(let O of t.state.env.keys())O.startsWith(N)&&!O.includes("__")&&(n.has(O)||n.set(O,t.state.env.get(O)));let P=`${u}__length`;t.state.env.has(P)&&!n.has(P)&&n.set(P,t.state.env.get(P))}let b;try{let N=new ye,P=Te(N,w);b=await ue(t,P.expression)}catch{let N=parseInt(w,10);b=Number.isNaN(N)?0:N}T(t.state.env,`${u}_${b}`,E);let A=parseInt($(t.state.env,`${u}__length`,"0"),10);b>=A&&T(t.state.env,`${u}__length`,String(b+1)),Xn(t,u),i&&_n(t,u);continue}if(c.includes("=")){let w=c.indexOf("=");u=c.slice(0,w),f=tt(t,c.slice(w+1))}else u=c;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u)){r+=`bash: local: \`${c}': not a valid identifier
1292
+ `,s=1;continue}let g=n.has(u);if(f!==void 0){let w=t.state.env.get(u);if(t.state.tempEnvBindings){let E=t.state.accessedTempEnvVars?.has(u),b=t.state.mutatedTempEnvVars?.has(u);if(!E&&!b)for(let A=t.state.tempEnvBindings.length-1;A>=0;A--){let N=t.state.tempEnvBindings[A];if(N.has(u)){w=N.get(u);break}}}r6(t,u,w)}if(!g){let w=t.state.env.get(u);if(t.state.tempEnvBindings)for(let E=t.state.tempEnvBindings.length-1;E>=0;E--){let b=t.state.tempEnvBindings[E];if(b.has(u)){w=b.get(u);break}}if(n.set(u,w),o){let E=`${u}_`;for(let A of t.state.env.keys())A.startsWith(E)&&!A.includes("__")&&(n.has(A)||n.set(A,t.state.env.get(A)));let b=`${u}__length`;t.state.env.has(b)&&!n.has(b)&&n.set(b,t.state.env.get(b))}}if(o&&f===void 0){let w=`${u}_`;for(let E of t.state.env.keys())E.startsWith(w)&&!E.includes("__")&&t.state.env.delete(E);T(t.state.env,`${u}__length`,"0")}else if(f!==void 0){if(ht(t,u,"bash"),i&&f!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(f)){r+=`bash: local: \`${f}': invalid variable name for name reference
1293
+ `,s=1;continue}T(t.state.env,u,f),t.state.options.allexport&&(t.state.exportedVars=t.state.exportedVars||new Set,t.state.exportedVars.add(u))}else{let w=t.state.tempEnvBindings?.some(E=>E.has(u));!g&&!w&&t.state.env.delete(u)}Xn(t,u),i&&_n(t,u)}return K(y,x(r),s)}F();on();function yu(t,e,n){let r=R(n),s=`
1294
+ `,i=0,o=0,a=0,l=!1,c="MAPFILE",u=0;for(;u<e.length;){let b=e[u];b==="-d"&&u+1<e.length?(s=e[u+1]===""?"\0":e[u+1]||`
1295
+ `,u+=2):b==="-n"&&u+1<e.length?(i=Number.parseInt(e[u+1],10)||0,u+=2):b==="-O"&&u+1<e.length?(o=Number.parseInt(e[u+1],10)||0,u+=2):b==="-s"&&u+1<e.length?(a=Number.parseInt(e[u+1],10)||0,u+=2):b==="-t"?(l=!0,u++):b==="-u"||b==="-C"||b==="-c"?u+=2:(b.startsWith("-")||(c=b),u++)}let f=r;!f&&t.state.groupStdin!==void 0&&(f=R(t.state.groupStdin));let p=[],h=f,m=0,d=0,g=t.limits?.maxArrayElements??1e5;for(;h.length>0;){let b=h.indexOf(s);if(b===-1){if(h.length>0){if(d<a)d++;else if(i===0||m<i){if(o+m>=g)return K(y,x(`mapfile: array element limit exceeded (${g})
1296
+ `),1);let P=h,O=P.indexOf("\0");O!==-1&&(P=P.substring(0,O)),p.push(P),m++}}break}let A=h.substring(0,b),N=A.indexOf("\0");if(N!==-1&&(A=A.substring(0,N)),!l&&s!=="\0"&&(A+=s),h=h.substring(b+s.length),d<a){d++;continue}if(i>0&&m>=i)break;if(o+m>=g)return K(y,x(`mapfile: array element limit exceeded (${g})
1297
+ `),1);p.push(A),m++}o===0&&Nn(t,c);for(let b=0;b<p.length;b++)T(t.state.env,`${c}_${o+b}`,p[b]);let w=parseInt($(t.state.env,`${c}__length`,"0"),10),E=o+p.length;return T(t.state.env,`${c}__length`,String(Math.max(w,E))),t.state.groupStdin!==void 0&&!r&&(t.state.groupStdin=y),K(y,y,0)}F();on();Xt();function tA(t){if(!t.startsWith("__rw__:"))return null;let e=t.slice(7),n=e.indexOf(":");if(n===-1)return null;let r=Number.parseInt(e.slice(0,n),10);if(Number.isNaN(r)||r<0)return null;let s=n+1,i=e.slice(s,s+r),o=s+r+1,a=e.slice(o),l=a.indexOf(":");if(l===-1)return null;let c=Number.parseInt(a.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;let u=a.slice(l+1);return{path:i,position:c,content:u}}function nA(t,e,n){return`__rw__:${t.length}:${t}:${e}:${n}`}function wu(t,e,n,r=-1){let s=R(n),i=!1,o=`
1298
+ `,a="",l=-1,c=-1,u=null,f=-1,p=-1,h=[],m=0,d=!1,g=(L,D)=>{let v=1;for(;v<L.length;){let _=L[v];if(_==="r")i=!0,v++;else if(_==="s")v++;else{if(_==="d")return v+1<L.length?(o=L.substring(v+1),{nextArgIndex:D+1}):D+1<e.length?(o=e[D+1],{nextArgIndex:D+2}):{nextArgIndex:D+1};if(_==="n"){if(v+1<L.length){let H=L.substring(v+1);return l=Number.parseInt(H,10),(Number.isNaN(l)||l<0)&&(d=!0,l=0),{nextArgIndex:D+1}}else if(D+1<e.length)return l=Number.parseInt(e[D+1],10),(Number.isNaN(l)||l<0)&&(d=!0,l=0),{nextArgIndex:D+2};return{nextArgIndex:D+1}}else if(_==="N"){if(v+1<L.length){let H=L.substring(v+1);return c=Number.parseInt(H,10),(Number.isNaN(c)||c<0)&&(d=!0,c=0),{nextArgIndex:D+1}}else if(D+1<e.length)return c=Number.parseInt(e[D+1],10),(Number.isNaN(c)||c<0)&&(d=!0,c=0),{nextArgIndex:D+2};return{nextArgIndex:D+1}}else{if(_==="a")return v+1<L.length?(u=L.substring(v+1),{nextArgIndex:D+1}):D+1<e.length?(u=e[D+1],{nextArgIndex:D+2}):{nextArgIndex:D+1};if(_==="p")return v+1<L.length?(a=L.substring(v+1),{nextArgIndex:D+1}):D+1<e.length?(a=e[D+1],{nextArgIndex:D+2}):{nextArgIndex:D+1};if(_==="u"){if(v+1<L.length){let H=L.substring(v+1);return f=Number.parseInt(H,10),Number.isNaN(f)||f<0?{nextArgIndex:-2}:{nextArgIndex:D+1}}else if(D+1<e.length)return f=Number.parseInt(e[D+1],10),Number.isNaN(f)||f<0?{nextArgIndex:-2}:{nextArgIndex:D+2};return{nextArgIndex:D+1}}else if(_==="t"){if(v+1<L.length){let H=L.substring(v+1);return p=Number.parseFloat(H),Number.isNaN(p)&&(p=0),{nextArgIndex:D+1}}else if(D+1<e.length)return p=Number.parseFloat(e[D+1]),Number.isNaN(p)&&(p=0),{nextArgIndex:D+2};return{nextArgIndex:D+1}}else if(_==="e"||_==="i"||_==="P"){if(_==="i"&&D+1<e.length)return{nextArgIndex:D+2};v++}else v++}}}return{nextArgIndex:D+1}};for(;m<e.length;){let L=e[m];if(L.startsWith("-")&&L.length>1&&L!=="--"){let D=g(L,m);if(D.nextArgIndex===-1)return{stdout:y,stderr:y,exitCode:2};if(D.nextArgIndex===-2)return{stdout:y,stderr:y,exitCode:1};m=D.nextArgIndex}else if(L==="--")for(m++;m<e.length;)h.push(e[m]),m++;else h.push(L),m++}if(d)return K(y,y,1);if(h.length===0&&u===null&&h.push("REPLY"),p===0){if(u)Nn(t,u);else{for(let L of h)T(t.state.env,L,"");h.length===0&&T(t.state.env,"REPLY","")}return K(y,y,0)}if(p<0&&p!==-1)return K(y,y,1);let w=s;f>=0?t.state.fileDescriptors?w=t.state.fileDescriptors.get(f)||"":w="":!w&&t.state.groupStdin!==void 0&&(w=R(t.state.groupStdin));let E=o===""?"\0":o,b="",A=0,N=!0,P=L=>{if(f>=0&&t.state.fileDescriptors)t.state.fileDescriptors.set(f,w.substring(L));else if(r>=0&&t.state.fileDescriptors){let D=t.state.fileDescriptors.get(r);if(D?.startsWith("__rw__:")){let v=tA(D);if(v){let _=v.position+L;t.state.fileDescriptors.set(r,nA(v.path,_,v.content))}}}else t.state.groupStdin!==void 0&&!s&&(t.state.groupStdin=x(w.substring(L)))};if(c>=0){let L=Math.min(c,w.length);b=w.substring(0,L),A=L,N=L>=c,P(A);let D=h[0]||"REPLY";T(t.state.env,D,b);for(let v=1;v<h.length;v++)T(t.state.env,h[v],"");return K(y,y,N?0:1)}else if(l>=0){let L=0,D=0,v=!1;for(;D<w.length&&L<l;){let _=w[D];if(_===E){A=D+1,v=!0;break}if(!i&&_==="\\"&&D+1<w.length){let H=w[D+1];if(H===E&&E===`
1299
+ `){D+=2,A=D;continue}if(H===E){D+=2,L++,b+=H,A=D;continue}b+=H,D+=2,L++,A=D}else b+=_,D++,L++,A=D}N=L>=l||v,P(A)}else{A=0;let L=0;for(;L<w.length;){let D=w[L];if(D===E){A=L+E.length,N=!0;break}if(!i&&D==="\\"&&L+1<w.length){let v=w[L+1];if(v===`
1300
+ `){L+=2;continue}if(v===E){b+=v,L+=2;continue}b+=D,b+=v,L+=2;continue}b+=D,L++}if(L>=w.length&&(N=!1,A=L,b.length===0&&w.length===0)){for(let D of h)T(t.state.env,D,"");return u&&Nn(t,u),K(y,y,1)}P(A)}E===`
1301
+ `&&b.endsWith(`
1302
+ `)&&(b=b.slice(0,-1));let O=L=>i?L:L.replace(/\\(.)/g,"$1");if(h.length===1&&h[0]==="REPLY")return T(t.state.env,"REPLY",O(b)),K(y,y,N?0:1);let G=ft(t.state.env);if(u){let{words:L}=xc(b,G,void 0,i),D=t.limits?.maxArrayElements??1e5;if(L.length>D)return K(y,x(`read: array element limit exceeded (${D})
1303
+ `),1);Nn(t,u);for(let v=0;v<L.length;v++)T(t.state.env,`${u}_${v}`,O(L[v]));return K(y,y,N?0:1)}let M=h.length,{words:Y,wordStarts:B}=xc(b,G,M,i);for(let L=0;L<h.length;L++){let D=h[L];if(L<h.length-1)T(t.state.env,D,O(Y[L]??""));else if(L<B.length){let v=b.substring(B[L]);v=m2(v,G,i),v=O(v),T(t.state.env,D,v)}else T(t.state.env,D,"")}return K(y,y,N?0:1)}Ne();function bu(t,e){if(t.state.callDepth===0&&t.state.sourceDepth===0)return V("bash: return: can only `return' from a function or sourced script\n");let n=t.state.lastExitCode;if(e.length>0){let r=e[0],s=Number.parseInt(r,10);if(r===""||Number.isNaN(s)||!/^-?\d+$/.test(r))return V(`bash: return: ${r}: numeric argument required
1304
+ `,2);n=(s%256+256)%256}throw new mt(n)}F();Ne();on();var qo=`set: usage: set [-eux] [+eux] [-o option] [+o option]
1305
+ Options:
1306
+ -e Exit immediately if a command exits with non-zero status
1307
+ +e Disable -e
1308
+ -u Treat unset variables as an error when substituting
1309
+ +u Disable -u
1310
+ -x Print commands and their arguments as they are executed
1311
+ +x Disable -x
1312
+ -o errexit Same as -e
1313
+ +o errexit Disable errexit
1314
+ -o nounset Same as -u
1315
+ +o nounset Disable nounset
1316
+ -o pipefail Return status of last failing command in pipeline
1317
+ +o pipefail Disable pipefail
1318
+ -o xtrace Same as -x
1319
+ +o xtrace Disable xtrace
1320
+ `,x6=new Map([["e","errexit"],["u","nounset"],["x","xtrace"],["v","verbose"],["f","noglob"],["C","noclobber"],["a","allexport"],["n","noexec"],["h",null],["b",null],["m",null],["B",null],["H",null],["P",null],["T",null],["E",null],["p",null]]),E6=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["noclobber","noclobber"],["noglob","noglob"],["allexport","allexport"],["noexec","noexec"],["posix","posix"],["vi","vi"],["emacs","emacs"],["notify",null],["monitor",null],["braceexpand",null],["histexpand",null],["physical",null],["functrace",null],["errtrace",null],["privileged",null],["hashall",null],["ignoreeof",null],["interactive-comments",null],["keyword",null],["onecmd",null]]),A6=["errexit","nounset","pipefail","verbose","xtrace","posix","allexport","noclobber","noglob","noexec","vi","emacs"],S6=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"];function C6(t,e,n){e!==null&&(n&&(e==="vi"?t.state.options.emacs=!1:e==="emacs"&&(t.state.options.vi=!1)),t.state.options[e]=n,Kr(t))}function rA(t,e){return e+1<t.length&&!t[e+1].startsWith("-")&&!t[e+1].startsWith("+")}function sA(t,e){let n=ot(t,e);if(n.length===0)return`${e}=()`;let r=n.map(s=>{let i=$(t.state.env,`${e}_${s}`,"");return`[${s}]=${Cr(i)}`});return`${e}=(${r.join(" ")})`}function iA(t){return/^[a-zA-Z0-9_]+$/.test(t)?t:`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function oA(t,e){let n=hn(t,e);if(n.length===0)return`${e}=()`;let r=n.map(s=>{let i=$(t.state.env,`${e}_${s}`,"");return`[${iA(s)}]=${Cr(i)}`});return`${e}=(${r.join(" ")} )`}function aA(t){let e=new Set,n=t.state.associativeArrays??new Set;for(let r of t.state.env.keys()){let s=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(s){let i=s[1];n.has(i)||e.add(i)}}return e}function lA(t){return t.state.associativeArrays??new Set}function Eu(t,e){if(e.includes("--help"))return Fe(qo);if(e.length===0){let r=aA(t),s=lA(t),i=l=>{for(let c of s){let u=`${c}_`,f=`${c}__length`;if(l!==f&&l.startsWith(u)){if(l.slice(u.length).startsWith("_length"))continue;return!0}}return!1},o=[];for(let[l,c]of t.state.env){if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(l)||r.has(l)||s.has(l))continue;let u=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(u&&r.has(u[1]))continue;let f=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);f&&r.has(f[1])||i(l)||f&&s.has(f[1])||o.push([l,R(c)])}let a=[];for(let[l,c]of o.sort(([u],[f])=>u<f?-1:u>f?1:0))a.push(`${l}=${jo(c)}`);for(let l of[...r].sort((c,u)=>c<u?-1:c>u?1:0))a.push(sA(t,l));for(let l of[...s].sort((c,u)=>c<u?-1:c>u?1:0))a.push(oA(t,l));return a.sort((l,c)=>{let u=l.split("=")[0],f=c.split("=")[0];return u<f?-1:u>f?1:0}),Fe(a.length>0?`${a.join(`
1321
+ `)}
1322
+ `:"")}let n=0;for(;n<e.length;){let r=e[n];if((r==="-o"||r==="+o")&&rA(e,n)){let s=e[n+1];if(!E6.has(s)){let i=`bash: set: ${s}: invalid option name
1323
+ ${qo}`;if(t.state.options.posix)throw new Yt(1,y,x(i));return V(i)}C6(t,E6.get(s)??null,r==="-o"),n+=2;continue}if(r==="-o"){let s=A6.map(a=>`${a.padEnd(16)}${t.state.options[a]?"on":"off"}`),i=S6.map(a=>`${a.padEnd(16)}off`),o=[...s,...i].sort();return Fe(`${o.join(`
1324
+ `)}
1325
+ `)}if(r==="+o"){let s=A6.map(a=>`set ${t.state.options[a]?"-o":"+o"} ${a}`),i=S6.map(a=>`set +o ${a}`),o=[...s,...i].sort();return Fe(`${o.join(`
1326
+ `)}
1327
+ `)}if(r.length>1&&(r[0]==="-"||r[0]==="+")&&r[1]!=="-"){let s=r[0]==="-";for(let i=1;i<r.length;i++){let o=r[i];if(!x6.has(o)){let a=`bash: set: ${r[0]}${o}: invalid option
1328
+ ${qo}`;if(t.state.options.posix)throw new Yt(1,y,x(a));return V(a)}C6(t,x6.get(o)??null,s)}n++;continue}if(r==="--")return xu(t,e.slice(n+1)),Se;if(r==="-"){if(t.state.options.xtrace=!1,t.state.options.verbose=!1,Kr(t),n+1<e.length)return xu(t,e.slice(n+1)),Se;n++;continue}if(r==="+"){n++;continue}if(r.startsWith("-")||r.startsWith("+")){let s=`bash: set: ${r}: invalid option
1329
+ ${qo}`;if(t.state.options.posix)throw new Yt(1,y,x(s));return V(s)}return xu(t,e.slice(n)),Se}return Se}function xu(t,e){let n=1;for(;t.state.env.has(String(n));)t.state.env.delete(String(n)),n++;for(let r=0;r<e.length;r++)T(t.state.env,String(r+1),e[r]);T(t.state.env,"#",String(e.length)),T(t.state.env,"@",e.join(" ")),T(t.state.env,"*",e.join(" "))}F();Ne();function Au(t,e){let n=1;if(e.length>0){let o=Number.parseInt(e[0],10);if(Number.isNaN(o)||o<0){let a=`bash: shift: ${e[0]}: numeric argument required
1330
+ `;if(t.state.options.posix)throw new Yt(1,y,x(a));return V(a)}n=o}let r=Number.parseInt($(t.state.env,"#","0"),10);if(n>r){let o=`bash: shift: shift count out of range
1331
+ `;if(t.state.options.posix)throw new Yt(1,y,x(o));return V(o)}if(n===0)return Se;let s=[];for(let o=1;o<=r;o++)s.push($(t.state.env,String(o))||"");let i=s.slice(n);for(let o=1;o<=r;o++)t.state.env.delete(String(o));for(let o=0;o<i.length;o++)T(t.state.env,String(o+1),i[o]);return T(t.state.env,"#",String(i.length)),T(t.state.env,"@",i.join(" ")),Se}it();F();Ne();async function Su(t,e){let n=e;if(n.length>0&&n[0]==="--"&&(n=n.slice(1)),n.length===0)return K(y,x(`bash: source: filename argument required
1332
+ `),2);let r=n[0],s=null,i=null;if(r.includes("/")){let c=t.fs.resolvePath(t.state.cwd,r);try{i=await t.fs.readFile(c),s=c}catch{}}else{let u=$(t.state.env,"PATH","").split(":").filter(f=>f);for(let f of u){let p=t.fs.resolvePath(t.state.cwd,`${f}/${r}`);try{if((await t.fs.stat(p)).isDirectory)continue;i=await t.fs.readFile(p),s=p;break}catch{}}if(i===null){let f=t.fs.resolvePath(t.state.cwd,r);try{i=await t.fs.readFile(f),s=f}catch{}}}if(i===null)return V(`bash: ${r}: No such file or directory
1333
+ `);let o=new Map;if(n.length>1){for(let u=1;u<=9;u++)o.set(String(u),$(t.state.env,String(u)));o.set("#",$(t.state.env,"#")),o.set("@",$(t.state.env,"@"));let c=n.slice(1);T(t.state.env,"#",String(c.length)),T(t.state.env,"@",c.join(" "));for(let u=0;u<c.length&&u<9;u++)T(t.state.env,String(u+1),c[u]);for(let u=c.length+1;u<=9;u++)t.state.env.delete(String(u))}let a=t.state.currentSource,l=()=>{if(t.state.sourceDepth--,t.state.currentSource=a,n.length>1)for(let[c,u]of o)u===void 0?t.state.env.delete(c):T(t.state.env,c,u)};t.state.sourceDepth++,t.state.currentSource=r;try{let c=Cn(i),u=await t.executeScript(c);return l(),u}catch(c){if(l(),c instanceof Ee)throw c;if(c instanceof mt)return K(c.stdout,c.stderr,c.exitCode);if(c.name==="ParseException")return V(`bash: ${r}: ${c.message}
1334
+ `);throw c}}St();it();F();$t();Ht();Dt();an();Yn();function N6(t){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t)}function cA(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')}async function v6(t,e){if(cA(e))return null;try{let n=new ye,r=Te(n,e);return await ue(t,r.expression)}catch{let n=parseInt(e,10);return Number.isNaN(n)?0:n}}function k6(t,e){if(t.state.localVarStack?.has(e)){let r=Wo(t,e);if(r){r.value===void 0?t.state.env.delete(e):t.state.env.set(e,r.value);let s=t.state.localVarStack?.get(e);if(!s||s.length===0)Bo(t,e),t.state.localVarStack?.delete(e),t.state.fullyUnsetLocals=t.state.fullyUnsetLocals||new Map,t.state.fullyUnsetLocals.set(e,r.scopeIndex),Cu(t,e);else{let i=s[s.length-1];t.state.localVarDepth=t.state.localVarDepth||new Map,t.state.localVarDepth.set(e,i.scopeIndex+1)}return!0}return t.state.env.delete(e),Bo(t,e),t.state.localVarStack?.delete(e),t.state.fullyUnsetLocals=t.state.fullyUnsetLocals||new Map,t.state.fullyUnsetLocals.set(e,0),!0}for(let r=t.state.localScopes.length-1;r>=0;r--){let s=t.state.localScopes[r];if(s.has(e)){let i=s.get(e);i===void 0?t.state.env.delete(e):t.state.env.set(e,i),s.delete(e);let o=!1;for(let a=r-1;a>=0;a--)if(t.state.localScopes[a].has(e)){t.state.localVarDepth&&t.state.localVarDepth.set(e,a+1),o=!0;break}return o||Bo(t,e),!0}}return!1}function Cu(t,e){if(!t.state.tempEnvBindings||t.state.tempEnvBindings.length===0)return!1;for(let n=t.state.tempEnvBindings.length-1;n>=0;n--){let r=t.state.tempEnvBindings[n];if(r.has(e)){let s=r.get(e);return s===void 0?t.state.env.delete(e):t.state.env.set(e,s),r.delete(e),!0}}return!1}async function I6(t,e){if(e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(e.startsWith('"')&&e.endsWith('"')){let n=e.slice(1,-1),s=new ye().parseWordFromString(n,!0,!1);return de(t,s)}if(e.includes("$")){let r=new ye().parseWordFromString(e,!1,!1);return de(t,r)}return e}async function Nu(t,e){let n="both",r="",s=0;for(let i of e){if(i==="-v"){n="variable";continue}if(i==="-f"){n="function";continue}if(n==="function"){t.state.functions.delete(i);continue}if(n==="variable"){let c=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(c){let p=c[1],h=c[2];if(h==="@"||h==="*"){let b=me(t,p);for(let[A]of b)t.state.env.delete(`${p}_${A}`);t.state.env.delete(p);continue}let m=t.state.associativeArrays?.has(p);if(m){let b=await I6(t,h);t.state.env.delete(`${p}_${b}`);continue}let d=Mn(t,p),g=t.state.declaredVars?.has(p);if((t.state.env.has(p)||g)&&!d&&!m){r+=`bash: unset: ${p}: not an array variable
1335
+ `,s=1;continue}let E=await v6(t,h);if(E===null&&d){r+=`bash: unset: ${h}: not a valid identifier
1336
+ `,s=1;continue}if(E===null)continue;if(E<0){let b=me(t,p),A=b.length,N=t.state.currentLine;if(A===0){r+=`bash: line ${N}: unset: [${E}]: bad array subscript
1337
+ `,s=1;continue}let P=A+E;if(P<0){r+=`bash: line ${N}: unset: [${E}]: bad array subscript
1338
+ `,s=1;continue}let O=b[P][0];t.state.env.delete(`${p}_${O}`);continue}t.state.env.delete(`${p}_${E}`);continue}if(!N6(i)){r+=`bash: unset: \`${i}': not a valid identifier
1339
+ `,s=1;continue}let u=i;if(_e(t,i)){let p=bt(t,i);p&&p!==i&&(u=p)}if(In(t,u)){r+=`bash: unset: ${u}: cannot unset: readonly variable
1340
+ `,s=1;continue}let f=os(t,u);if(f!==void 0&&f!==t.state.callDepth)k6(t,u);else if(t.state.fullyUnsetLocals?.has(u))t.state.env.delete(u);else if(f!==void 0){let p=t.state.accessedTempEnvVars?.has(u),h=t.state.mutatedTempEnvVars?.has(u);if((p||h)&&t.state.localVarStack?.has(u)){let m=Wo(t,u);m?m.value===void 0?t.state.env.delete(u):t.state.env.set(u,m.value):t.state.env.delete(u)}else t.state.env.delete(u)}else Cu(t,u)||t.state.env.delete(u);t.state.exportedVars?.delete(u);continue}let o=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(o){let c=o[1],u=o[2];if(u==="@"||u==="*"){let d=me(t,c);for(let[g]of d)t.state.env.delete(`${c}_${g}`);t.state.env.delete(c);continue}let f=t.state.associativeArrays?.has(c);if(f){let d=await I6(t,u);t.state.env.delete(`${c}_${d}`);continue}let p=Mn(t,c);if(t.state.env.has(c)&&!p&&!f){r+=`bash: unset: ${c}: not an array variable
1341
+ `,s=1;continue}let m=await v6(t,u);if(m===null&&p){r+=`bash: unset: ${u}: not a valid identifier
1342
+ `,s=1;continue}if(m===null)continue;if(m<0){let d=me(t,c),g=d.length,w=t.state.currentLine;if(g===0){r+=`bash: line ${w}: unset: [${m}]: bad array subscript
1343
+ `,s=1;continue}let E=g+m;if(E<0){r+=`bash: line ${w}: unset: [${m}]: bad array subscript
1344
+ `,s=1;continue}let b=d[E][0];t.state.env.delete(`${c}_${b}`);continue}t.state.env.delete(`${c}_${m}`);continue}if(!N6(i)){r+=`bash: unset: \`${i}': not a valid identifier
1345
+ `,s=1;continue}let a=i;if(_e(t,i)){let c=bt(t,i);c&&c!==i&&(a=c)}if(In(t,a)){r+=`bash: unset: ${a}: cannot unset: readonly variable
1346
+ `,s=1;continue}let l=os(t,a);if(l!==void 0&&l!==t.state.callDepth)k6(t,a);else if(t.state.fullyUnsetLocals?.has(a))t.state.env.delete(a);else if(l!==void 0){let c=t.state.accessedTempEnvVars?.has(a),u=t.state.mutatedTempEnvVars?.has(a);if((c||u)&&t.state.localVarStack?.has(a)){let f=Wo(t,a);f?f.value===void 0?t.state.env.delete(a):t.state.env.set(a,f.value):t.state.env.delete(a)}else t.state.env.delete(a)}else Cu(t,a)||t.state.env.delete(a);t.state.exportedVars?.delete(a),t.state.functions.delete(i)}return K(y,x(r),s)}F();var vu=["extglob","dotglob","nullglob","failglob","globstar","globskipdots","nocaseglob","nocasematch","expand_aliases","lastpipe","xpg_echo"],uA=["autocd","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","execfail","extdebug","extquote","force_fignore","globasciiranges","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath"];function Zo(t){return vu.includes(t)}function fA(t){return uA.includes(t)}function T6(t,e){let n=!1,r=!1,s=!1,i=!1,o=!1,a=[],l=0;for(;l<e.length;){let p=e[l];if(p==="--"){l++;break}if(p.startsWith("-")&&p.length>1){for(let h=1;h<p.length;h++){let m=p[h];switch(m){case"s":n=!0;break;case"u":r=!0;break;case"p":s=!0;break;case"q":i=!0;break;case"o":o=!0;break;default:return{exitCode:2,stdout:y,stderr:x(`shopt: -${m}: invalid option
1347
+ `)}}}l++}else break}for(;l<e.length;)a.push(e[l]),l++;if(o)return pA(t,a,n,r,s,i);if(n&&r)return{exitCode:1,stdout:y,stderr:x(`shopt: cannot set and unset shell options simultaneously
1348
+ `)};if(a.length===0){if(n||r){let h=[];for(let m of vu){let d=t.state.shoptOptions[m];n&&d?h.push(s?`shopt -s ${m}`:`${m} on`):r&&!d&&h.push(s?`shopt -u ${m}`:`${m} off`)}return{exitCode:0,stdout:h.length>0?x(`${h.join(`
1349
+ `)}
1350
+ `):y,stderr:y}}let p=[];for(let h of vu){let m=t.state.shoptOptions[h];p.push(s?`shopt ${m?"-s":"-u"} ${h}`:`${h} ${m?"on":"off"}`)}return{exitCode:0,stdout:x(`${p.join(`
1351
+ `)}
1352
+ `),stderr:y}}let c=!1,u="",f=[];for(let p of a){if(!Zo(p)&&!fA(p)){u+=`shopt: ${p}: invalid shell option name
1353
+ `,c=!0;continue}if(n)Zo(p)&&(t.state.shoptOptions[p]=!0,Gl(t));else if(r)Zo(p)&&(t.state.shoptOptions[p]=!1,Gl(t));else if(Zo(p)){let h=t.state.shoptOptions[p];i?h||(c=!0):s?(f.push(`shopt ${h?"-s":"-u"} ${p}`),h||(c=!0)):(f.push(`${p} ${h?"on":"off"}`),h||(c=!0))}else i?c=!0:s?(f.push(`shopt -u ${p}`),c=!0):(f.push(`${p} off`),c=!0)}return{exitCode:c?1:0,stdout:f.length>0?x(`${f.join(`
1354
+ `)}
1355
+ `):y,stderr:x(u)}}function pA(t,e,n,r,s,i){let o=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["posix","posix"],["allexport","allexport"],["noclobber","noclobber"],["noglob","noglob"],["noexec","noexec"],["vi","vi"],["emacs","emacs"]]),a=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"],l=[...o.keys(),...a].sort();if(e.length===0){let p=[];for(let h of l){let m=a.includes(h),d=o.get(h),g=m||!d?!1:t.state.options[d];n&&!g||r&&g||p.push(s?`set ${g?"-o":"+o"} ${h}`:`${h} ${g?"on":"off"}`)}return{exitCode:0,stdout:p.length>0?x(`${p.join(`
1356
+ `)}
1357
+ `):y,stderr:y}}let c=!1,u="",f=[];for(let p of e){let h=o.has(p),m=a.includes(p);if(!h&&!m){u+=`shopt: ${p}: invalid option name
1358
+ `,c=!0;continue}if(m){n||r||(i?c=!0:s?(f.push(`set +o ${p}`),c=!0):(f.push(`${p} off`),c=!0));continue}let d=o.get(p);if(d)if(n)d==="vi"?t.state.options.emacs=!1:d==="emacs"&&(t.state.options.vi=!1),t.state.options[d]=!0,Kr(t);else if(r)t.state.options[d]=!1,Kr(t);else{let g=t.state.options[d];i?g||(c=!0):s?(f.push(`set ${g?"-o":"+o"} ${p}`),g||(c=!0)):(f.push(`${p} ${g?"on":"off"}`),g||(c=!0))}}return{exitCode:c?1:0,stdout:f.length>0?x(`${f.join(`
1359
+ `)}
1360
+ `):y,stderr:x(u)}}F();async function O6(t,e,n){if(e.includes("/")){let o=t.fs.resolvePath(t.state.cwd,e);if(!await t.fs.exists(o))return{error:"not_found",path:o};let a=o.split("/").pop()||e,l=t.commands.get(a);try{let c=await t.fs.stat(o);return c.isDirectory?{error:"permission_denied",path:o}:l?{cmd:l,path:o}:(c.mode&73)!==0?{script:!0,path:o}:{error:"permission_denied",path:o}}catch{return{error:"not_found",path:o}}}if(!n&&t.state.hashTable){let o=t.state.hashTable.get(e);if(o)if(await t.fs.exists(o)){let a=t.commands.get(e);if(a)return{cmd:a,path:o};try{let l=await t.fs.stat(o);if(!l.isDirectory&&(l.mode&73)!==0)return{script:!0,path:o}}catch{}}else t.state.hashTable.delete(e)}let s=(n??$(t.state.env,"PATH","/usr/bin:/bin")).split(":");for(let o of s){if(!o)continue;let l=`${o.startsWith("/")?o:t.fs.resolvePath(t.state.cwd,o)}/${e}`;if(await t.fs.exists(l))try{let c=await t.fs.stat(l);if(c.isDirectory)continue;let u=(c.mode&73)!==0,f=t.commands.get(e),p=o==="/bin"||o==="/usr/bin";if(f&&p)return{cmd:f,path:l};if(u){if(f&&!p)return{script:!0,path:l};if(!f)return{script:!0,path:l}}}catch{}}if(!await t.fs.exists("/usr/bin")){let o=t.commands.get(e);if(o)return{cmd:o,path:`/usr/bin/${e}`}}return null}async function Yo(t,e){let n=[];if(e.includes("/")){let i=t.fs.resolvePath(t.state.cwd,e);if(await t.fs.exists(i))try{let o=await t.fs.stat(i);o.isDirectory||(o.mode&73)!==0&&n.push(e)}catch{}return n}let s=$(t.state.env,"PATH","/usr/bin:/bin").split(":");for(let i of s){if(!i)continue;let a=`${i.startsWith("/")?i:t.fs.resolvePath(t.state.cwd,i)}/${e}`;if(await t.fs.exists(a)){try{if((await t.fs.stat(a)).isDirectory)continue}catch{continue}n.push(i.startsWith("/")?a:`${i}/${e}`)}}return n}Ne();Qt();F();async function D6(t,e,n,r){let s=!1,i=!1,o=!1,a=!1,l=!1,c=[];for(let d of e)if(d.startsWith("-")&&d.length>1)for(let g of d.slice(1))g==="t"?s=!0:g==="p"?i=!0:g==="P"?o=!0:g==="a"?a=!0:g==="f"&&(l=!0);else c.push(d);let u="",f="",p=0,h=!1,m=!1;for(let d of c){let g=!1;if(o){if(a){let P=await r(d);if(P.length>0){for(let O of P)u+=`${O}
1361
+ `;h=!0,g=!0}}else{let P=await n(d);P&&(u+=`${P}
1362
+ `,h=!0,g=!0)}g||(m=!0);continue}let w=!l&&t.state.functions.has(d);if(a&&w){if(!i)if(s)u+=`function
1363
+ `;else{let P=t.state.functions.get(d),O=P?R6(d,P):`${d} is a function
1364
+ `;u+=O}g=!0}let E=t.state.env.get(`BASH_ALIAS_${d}`);if(E!==void 0&&(a||!g)&&(i||(s?u+=`alias
1365
+ `:u+=`${d} is aliased to \`${R(E)}'
1366
+ `),g=!0,!a)||jc.has(d)&&(a||!g)&&(i||(s?u+=`keyword
1367
+ `:u+=`${d} is a shell keyword
1368
+ `),g=!0,!a))continue;if(!a&&w&&!g){if(!i)if(s)u+=`function
1369
+ `;else{let P=t.state.functions.get(d),O=P?R6(d,P):`${d} is a function
1370
+ `;u+=O}g=!0;continue}if(!(as.has(d)&&(a||!g)&&(i||(s?u+=`builtin
1371
+ `:u+=`${d} is a shell builtin
1372
+ `),g=!0,!a))){if(a){let P=await r(d);for(let O of P)i?u+=`${O}
1373
+ `:s?u+=`file
1374
+ `:u+=`${d} is ${O}
1375
+ `,h=!0,g=!0}else if(!g){let P=await n(d);P&&(i?u+=`${P}
1376
+ `:s?u+=`file
1377
+ `:u+=`${d} is ${P}
1378
+ `,h=!0,g=!0)}if(!g&&(m=!0,!s&&!i)){let P=!0;if(d.includes("/")){let O=t.fs.resolvePath(t.state.cwd,d);await t.fs.exists(O)&&(P=!1)}P&&(f+=`bash: type: ${d}: not found
1379
+ `)}}}return i?p=m&&!h?1:0:p=m?1:0,K(x(u),x(f),p)}function R6(t,e){let n;return e.body.type==="Group"?n=e.body.body.map(s=>Qs(s)).join("; "):n=Qs(e.body),`${t} is a function
1380
+ ${t} ()
1381
+ {
1382
+ ${n}
1383
+ }
1384
+ `}function Qs(t){if(Array.isArray(t))return t.map(e=>Qs(e)).join("; ");if(t.type==="Statement"){let e=[];for(let n=0;n<t.pipelines.length;n++){let r=t.pipelines[n];e.push(hA(r)),t.operators[n]&&e.push(t.operators[n])}return e.join(" ")}if(t.type==="SimpleCommand"){let e=t,n=[];e.name&&n.push(P6(e.name));for(let r of e.args)n.push(P6(r));return n.join(" ")}return t.type==="Group"?`{ ${t.body.map(r=>Qs(r)).join("; ")}; }`:"..."}function hA(t){let e=t.commands.map(n=>Qs(n));return(t.negated?"! ":"")+e.join(" | ")}function P6(t){let e="";for(let n of t.parts)n.type==="Literal"?e+=n.value:n.type==="DoubleQuoted"?e+=`"${n.parts.map(r=>$6(r)).join("")}"`:n.type==="SingleQuoted"?e+=`'${n.value}'`:e+=$6(n);return e}function $6(t){let e=t;return e.type==="Literal"?e.value??"":e.type==="Variable"?`$${e.name}`:""}async function _6(t,e,n,r){let s="",i="",o=0;for(let a of e){if(!a){o=1;continue}let l=t.state.env.get(`BASH_ALIAS_${a}`);if(l!==void 0)r?s+=`${a} is an alias for "${R(l)}"
1385
+ `:s+=`alias ${a}='${R(l)}'
1386
+ `;else if(jc.has(a))r?s+=`${a} is a shell keyword
1387
+ `:s+=`${a}
1388
+ `;else if(as.has(a))r?s+=`${a} is a shell builtin
1389
+ `:s+=`${a}
1390
+ `;else if(t.state.functions.has(a))r?s+=`${a} is a function
1391
+ `:s+=`${a}
1392
+ `;else if(a.includes("/")){let c=t.fs.resolvePath(t.state.cwd,a),u=!1;if(await t.fs.exists(c))try{let f=await t.fs.stat(c);f.isDirectory||(f.mode&73)!==0&&(r?s+=`${a} is ${a}
1393
+ `:s+=`${a}
1394
+ `,u=!0)}catch{}u||(r&&(i+=`${a}: not found
1395
+ `),o=1)}else if(t.commands.has(a)){let u=$(t.state.env,"PATH","/usr/bin:/bin").split(":"),f=null;for(let p of u){if(!p)continue;let h=`${p}/${a}`;try{let m=await t.fs.stat(h);if(!m.isDirectory&&(m.mode&73)!==0){f=h;break}}catch{}}f||(f=`/usr/bin/${a}`),r?s+=`${a} is ${f}
1396
+ `:s+=`${f}
1397
+ `}else r&&(i+=`${a}: not found
1398
+ `),o=1}return K(x(s),x(i),o)}async function M6(t,e){if(e.includes("/")){let s=t.fs.resolvePath(t.state.cwd,e);if(await t.fs.exists(s)){try{let i=await t.fs.stat(s);if(i.isDirectory||!((i.mode&73)!==0))return null}catch{return null}return e}return null}let r=$(t.state.env,"PATH","/usr/bin:/bin").split(":");for(let s of r){if(!s)continue;let o=`${s.startsWith("/")?s:t.fs.resolvePath(t.state.cwd,s)}/${e}`;if(await t.fs.exists(o)){try{if((await t.fs.stat(o)).isDirectory)continue}catch{continue}return`${s}/${e}`}}if(t.commands.has(e)){for(let s of r)if(s==="/usr/bin"||s==="/bin")return`${s}/${e}`;return`/usr/bin/${e}`}return null}async function L6(t,e,n,r,s,i,o,a){let{ctx:l,runCommand:c}=t,u=W(n);if(l.coverage&&as.has(e)&&l.coverage.hit(`bash:builtin:${e}`),e==="export")return pu(l,u);if(e==="unset")return Nu(l,u);if(e==="exit")return fu(l,u);if(e==="local")return gu(l,u);if(e==="set")return Eu(l,u);if(e==="break")return Fc(l,u);if(e==="continue")return Kc(l,u);if(e==="return")return bu(l,u);if(e==="eval"&&l.state.options.posix)return Go(l,u,s);if(e==="shift")return Au(l,u);if(e==="getopts")return Vo(l,u);if(e==="compgen")return qc(l,u);if(e==="complete")return Yc(l,u);if(e==="compopt")return Qc(l,u);if(e==="pushd")return await lu(l,u);if(e==="popd")return cu(l,u);if(e==="dirs")return uu(l,u);if(e==="source"||e===".")return Su(l,u);if(e==="read")return wu(l,u,s,a);if(e==="mapfile"||e==="readarray")return yu(l,u,s);if(e==="declare"||e==="typeset")return iu(l,u);if(e==="readonly")return ou(l,u);if(!i){let f=l.state.functions.get(e);if(f)return Ho(l,f,u,s)}if(e==="eval")return Go(l,u,s);if(e==="cd")return await Uc(l,u);if(e===":"||e==="true")return Se;if(e==="false")return at(!1);if(e==="let")return mu(l,u);if(e==="command")return dA(t,u,s);if(e==="builtin")return mA(t,u,s);if(e==="shopt")return T6(l,u);if(e==="exec"){if(n.length===0)return Se;let[f,...p]=n;return c(R(f),p,[],s,!1,!1,-1)}if(e==="wait")return Se;if(e==="type")return await D6(l,u,f=>M6(l,f),f=>Yo(l,f));if(e==="hash")return hu(l,u);if(e==="help")return du(l,u);if(e==="["||e==="test"){let f=u;if(e==="["){if(u[u.length-1]!=="]")return V("[: missing `]'\n",2);f=u.slice(0,-1)}return qs(l,f)}return null}async function dA(t,e,n){let{ctx:r,runCommand:s}=t;if(e.length===0)return Se;let i=!1,o=!1,a=!1,l=e;for(;l.length>0&&l[0].startsWith("-");){let f=l[0];if(f==="--"){l=l.slice(1);break}for(let p of f.slice(1))p==="p"?i=!0:p==="V"?o=!0:p==="v"&&(a=!0);l=l.slice(1)}if(l.length===0)return Se;if(a||o)return await _6(r,l,a,o);let[c,...u]=l;return s(c,u.map(f=>x(f)),[],n,!0,i,-1)}async function mA(t,e,n){let{runCommand:r}=t;if(e.length===0)return Se;let s=e;if(s[0]==="--"&&(s=s.slice(1),s.length===0))return Se;let i=s[0];if(!as.has(i))return V(`bash: builtin: ${i}: not a shell builtin
1399
+ `);let[,...o]=s;return r(i,o.map(a=>x(a)),[],n,!0,!1,-1)}async function F6(t,e,n,r,s){let{ctx:i,buildExportedEnv:o,executeUserScript:a}=t,c=await O6(i,e,s?"/usr/bin:/bin":void 0);if(!c)return Vg(e)?V(`bash: ${e}: command not available in browser environments. Exclude '${e}' from your commands or use the Node.js bundle.
1400
+ `,127):V(`bash: ${e}: command not found
1401
+ `,127);if("error"in c)return c.error==="permission_denied"?V(`bash: ${e}: Permission denied
1402
+ `,126):V(`bash: ${e}: No such file or directory
1403
+ `,127);if("script"in c)return e.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(e,c.path)),await a(c.path,n,r);let{cmd:u,path:f}=c;e.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(e,f));let p=Mt(r)?i.state.groupStdin??y:r,h=o(),m={fs:i.fs,cwd:i.state.cwd,env:i.state.env,exportedEnv:h,stdin:p,limits:i.limits,exec:i.execFn,fetch:i.fetch,getRegisteredCommands:()=>Array.from(i.commands.keys()),sleep:i.sleep,trace:i.trace,fileDescriptors:i.state.fileDescriptors,xpgEcho:i.state.shoptOptions.xpg_echo,coverage:i.coverage};try{return await u.execute(n,m)}catch(d){if(d instanceof ae)throw d;return V(`${e}: ${qe(d)}
1404
+ `)}}F();$t();Ne();Dt();F();async function ku(t,e){let n=t.state.inCondition;t.state.inCondition=!0;let r=y,s=y,i=0;try{for(let o of e){let a=await t.executeStatement(o);r=j(r,a.stdout),s=j(s,a.stderr),i=a.exitCode}}finally{t.state.inCondition=n}return{stdout:r,stderr:s,exitCode:i}}F();Ne();Qt();function Ks(t,e,n,r){if(t instanceof xt)return e=j(e,t.stdout),n=j(n,t.stderr),t.levels>1&&r>1?(t.levels--,t.stdout=e,t.stderr=n,{action:"rethrow",stdout:e,stderr:n,error:t}):{action:"break",stdout:e,stderr:n};if(t instanceof Et)return e=j(e,t.stdout),n=j(n,t.stderr),t.levels>1&&r>1?(t.levels--,t.stdout=e,t.stderr=n,{action:"rethrow",stdout:e,stderr:n,error:t}):{action:"continue",stdout:e,stderr:n};if(t instanceof mt||t instanceof Lt||t instanceof Ee||t instanceof ae)return t.prependOutput(e,n),{action:"rethrow",stdout:e,stderr:n,error:t};let s=qe(t);return{action:"error",stdout:e,stderr:j(n,x(`${s}
1405
+ `)),exitCode:1}}F();Ne();Qt();async function Qo(t,e,n=y,r=y){let s=n,i=r,o=0;try{for(let a of e){let l=await t.executeStatement(a);s=j(s,l.stdout),i=j(i,l.stderr),o=l.exitCode}}catch(a){if(ii(a)||a instanceof Lt||a instanceof Ee||a instanceof ae||a instanceof wn)throw a.prependOutput(s,i),a;return{stdout:s,stderr:j(i,x(`${qe(a)}
1406
+ `)),exitCode:1}}return{stdout:s,stderr:i,exitCode:o}}async function U6(t,e){let n=y,r=y;for(let s of e.clauses){let i=await ku(t,s.condition);if(n=j(n,i.stdout),r=j(r,i.stderr),i.exitCode===0)return Qo(t,s.body,n,r)}return e.elseBody?Qo(t,e.elseBody,n,r):{stdout:n,stderr:r,exitCode:0}}async function B6(t,e){let n=await On(t,e.redirections);if(n)return n;let r=y,s=y,i=0,o=0;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e.variable))return V(`bash: \`${e.variable}': not a valid identifier
1407
+ `);let a=[];if(e.words===null)a=$(t.state.env,"@","").split(" ").filter(Boolean);else if(e.words.length===0)a=[];else try{for(let c of e.words){let u=await gn(t,c);a.push(...u.values)}}catch(c){if(c instanceof yn)return{stdout:y,stderr:c.stderr,exitCode:1};throw c}t.state.loopDepth++;try{for(let c of a){o++,o>t.limits.maxLoopIterations&&Fn(`for loop: too many iterations (${t.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",r,s),T(t.state.env,e.variable,c);try{for(let u of e.body){let f=await t.executeStatement(u);r=j(r,f.stdout),s=j(s,f.stderr),i=f.exitCode}}catch(u){let f=Ks(u,r,s,t.state.loopDepth);if(r=f.stdout,s=f.stderr,f.action==="break")break;if(f.action==="continue")continue;if(f.action==="error"){let p=K(r,s,f.exitCode??1);return Qe(t,p,e.redirections)}throw f.error}}}finally{t.state.loopDepth--}let l=K(r,s,i);return Qe(t,l,e.redirections)}async function W6(t,e){let n=await On(t,e.redirections);if(n)return n;let r=e.line;r!==void 0&&(t.state.currentLine=r);let s=y,i=y,o=0,a=0;e.init&&await ue(t,e.init.expression),t.state.loopDepth++;try{for(;a++,a>t.limits.maxLoopIterations&&Fn(`for loop: too many iterations (${t.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",s,i),!(e.condition&&(r!==void 0&&(t.state.currentLine=r),await ue(t,e.condition.expression)===0));){try{for(let c of e.body){let u=await t.executeStatement(c);s=j(s,u.stdout),i=j(i,u.stderr),o=u.exitCode}}catch(c){let u=Ks(c,s,i,t.state.loopDepth);if(s=u.stdout,i=u.stderr,u.action==="break")break;if(u.action==="continue"){e.update&&await ue(t,e.update.expression);continue}if(u.action==="error"){let f=K(s,i,u.exitCode??1);return Qe(t,f,e.redirections)}throw u.error}e.update&&await ue(t,e.update.expression)}}finally{t.state.loopDepth--}let l=K(s,i,o);return Qe(t,l,e.redirections)}async function z6(t,e,n=y){let r=y,s=y,i=0,o=0,a=n;for(let c of e.redirections)if((c.operator==="<<"||c.operator==="<<-")&&c.target.type==="HereDoc"){let u=c.target,f=await de(t,u.content);u.stripTabs&&(f=f.split(`
1408
+ `).map(p=>p.replace(/^\t+/,"")).join(`
1409
+ `)),a=x(f)}else if(c.operator==="<<<"&&c.target.type==="Word")a=x(`${await de(t,c.target)}
1410
+ `);else if(c.operator==="<"&&c.target.type==="Word")try{let u=await de(t,c.target),f=t.fs.resolvePath(t.state.cwd,u);a=x(await t.fs.readFile(f))}catch{let u=await de(t,c.target);return V(`bash: ${u}: No such file or directory
1411
+ `)}let l=t.state.groupStdin;a.length>0&&(t.state.groupStdin=a),t.state.loopDepth++;try{for(;;){o++,o>t.limits.maxLoopIterations&&Fn(`while loop: too many iterations (${t.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",r,s);let c=0,u=!1,f=!1,p=t.state.inCondition;t.state.inCondition=!0;try{for(let h of e.condition){let m=await t.executeStatement(h);r=j(r,m.stdout),s=j(s,m.stderr),c=m.exitCode}}catch(h){if(h instanceof xt){if(r=j(r,h.stdout),s=j(s,h.stderr),h.levels>1&&t.state.loopDepth>1)throw h.levels--,h.stdout=r,h.stderr=s,t.state.inCondition=p,h;u=!0}else if(h instanceof Et){if(r=j(r,h.stdout),s=j(s,h.stderr),h.levels>1&&t.state.loopDepth>1)throw h.levels--,h.stdout=r,h.stderr=s,t.state.inCondition=p,h;f=!0}else throw t.state.inCondition=p,h}finally{t.state.inCondition=p}if(u)break;if(!f){if(c!==0)break;try{for(let h of e.body){let m=await t.executeStatement(h);r=j(r,m.stdout),s=j(s,m.stderr),i=m.exitCode}}catch(h){let m=Ks(h,r,s,t.state.loopDepth);if(r=m.stdout,s=m.stderr,m.action==="break")break;if(m.action==="continue")continue;if(m.action==="error")return K(r,s,m.exitCode??1);throw m.error}}}}finally{t.state.loopDepth--,t.state.groupStdin=l}return K(r,s,i)}async function H6(t,e){let n=y,r=y,s=0,i=0;t.state.loopDepth++;try{for(;;){i++,i>t.limits.maxLoopIterations&&Fn(`until loop: too many iterations (${t.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",n,r);let o=await ku(t,e.condition);if(n=j(n,o.stdout),r=j(r,o.stderr),o.exitCode===0)break;try{for(let a of e.body){let l=await t.executeStatement(a);n=j(n,l.stdout),r=j(r,l.stderr),s=l.exitCode}}catch(a){let l=Ks(a,n,r,t.state.loopDepth);if(n=l.stdout,r=l.stderr,l.action==="break")break;if(l.action==="continue")continue;if(l.action==="error")return K(n,r,l.exitCode??1);throw l.error}}}finally{t.state.loopDepth--}return K(n,r,s)}async function j6(t,e){let n=await On(t,e.redirections);if(n)return n;let r=y,s=y,i=0,o=await de(t,e.word),a=!1;for(let c=0;c<e.items.length;c++){let u=e.items[c],f=a;if(!a)for(let p of u.patterns){let h=await de(t,p);Oc(p)&&(h=Nt(h));let m=t.state.shoptOptions.nocasematch,d=t.state.shoptOptions.extglob;if(is(o,h,m,d)){f=!0;break}}if(f){let p=await Qo(t,u.body,r,s);if(r=p.stdout,s=p.stderr,i=p.exitCode,u.terminator===";;")break;u.terminator===";&"?a=!0:a=!1}else a=!1}let l=K(r,s,i);return Qe(t,l,e.redirections)}Ne();Dt();an();function Iu(t,e){if(t.parts.length!==1)return!1;let n=t.parts[0];return n.type!=="Literal"?!1:e.includes(n.value)}function G6(t){if(!t.startsWith("__rw__:"))return null;let e=t.slice(7),n=e.indexOf(":");if(n===-1)return null;let r=Number.parseInt(e.slice(0,n),10);if(Number.isNaN(r)||r<0)return null;let s=n+1,i=e.slice(s,s+r),o=s+r+1,a=e.slice(o),l=a.indexOf(":");if(l===-1)return null;let c=Number.parseInt(a.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;let u=a.slice(l+1);return{path:i,position:c,content:u}}it();F();Dt();var V6="+ ";async function q6(t){let e=t.state.env.get("PS4");if(e===void 0)return V6;let n=R(e);if(n==="")return"";try{let s=new ye().parseWordFromString(n,!1,!1);return await de(t,s)}catch{return t.state.expansionStderr=`${t.state.expansionStderr||""}bash: ${n}: bad substitution
1412
+ `,n||V6}}function gA(t){return t.map(e=>yA(e)).join(" ")}function yA(t){if(t==="")return"''";if(!/[\s'"\\$`!*?[\]{}|&;<>()~#\n\t]/.test(t))return t;let n=/[\x00-\x1f\x7f]/.test(t),r=t.includes(`
1413
+ `),s=t.includes(" "),i=t.includes("\\"),o=t.includes("'");if(n||r||s||i){let l="";for(let c of t){let u=c.charCodeAt(0);c===`
1414
+ `?l+="\\n":c===" "?l+="\\t":c==="\\"?l+="\\\\":c==="'"?l+="'":c==='"'?l+='"':u<32||u===127?u<256?l+=`\\x${u.toString(16).padStart(2,"0")}`:l+=`\\u${u.toString(16).padStart(4,"0")}`:l+=c}return`$'${l}'`}return o?`"${t.replace(/([\\$`"])/g,"\\$1")}"`:`'${t}'`}async function Z6(t,e,n){if(!t.state.options.xtrace)return"";let r=await q6(t),s=[e,...n],i=gA(s);return`${r}${i}
1415
+ `}async function Y6(t,e,n){return t.state.options.xtrace?`${await q6(t)}${e}=${n}
1416
+ `:""}F();Ne();async function Q6(t,e,n){let r=e.timed?performance.now():0,s=y,i=Se,o=0,a=[],l=e.commands.length>1,c=t.state.lastArg;for(let f=0;f<e.commands.length;f++){let p=e.commands[f],h=f===e.commands.length-1,m=f===0;l&&(t.state.lastArg=x(""),m||(t.state.groupStdin=void 0));let g=l&&(!h||!t.state.shoptOptions.lastpipe)?new Map(t.state.env):null,w;try{w=await n(p,s)}catch(E){if(E instanceof Tt)w={stdout:E.stdout,stderr:E.stderr,exitCode:1};else if(E instanceof Ee&&e.commands.length>1)w={stdout:E.stdout,stderr:E.stderr,exitCode:E.exitCode};else if(E instanceof Lt&&e.commands.length>1)w={stdout:E.stdout,stderr:E.stderr,exitCode:E.exitCode};else throw g&&(t.state.env=g),E}g&&(t.state.env=g),a.push(w.exitCode),w.exitCode!==0&&(o=w.exitCode),h?i=w:e.pipeStderr?.[f]??!1?(s=j(w.stderr,w.stdout),i={stdout:y,stderr:y,exitCode:w.exitCode}):(s=w.stdout,i={stdout:y,stderr:w.stderr,exitCode:w.exitCode})}if(e.commands.length>1||e.commands.length===1&&e.commands[0].type==="SimpleCommand"){for(let f of t.state.env.keys())f.startsWith("PIPESTATUS_")&&t.state.env.delete(f);for(let f=0;f<a.length;f++)T(t.state.env,`PIPESTATUS_${f}`,String(a[f]));T(t.state.env,"PIPESTATUS__length",String(a.length))}if(t.state.options.pipefail&&o!==0&&(i={...i,exitCode:o}),e.negated&&(i={...i,exitCode:i.exitCode===0?1:0}),e.timed){let p=(performance.now()-r)/1e3,h=Math.floor(p/60),m=p%60,d;e.timePosix?d=`real ${p.toFixed(2)}
1417
+ user 0.00
1418
+ sys 0.00
1419
+ `:d=`
1420
+ real ${`${h}m${m.toFixed(3)}s`}
1421
+ user 0m0.000s
1422
+ sys 0m0.000s
1423
+ `,i={...i,stderr:j(i.stderr,x(d))}}return l&&!t.state.shoptOptions.lastpipe&&(t.state.lastArg=c),i}St();it();F();$t();Ne();Dt();on();an();Yn();async function K6(t,e){let n=new Map,r="";for(let s of e.assignments){let i=s.name;if(s.array){let f=await wA(t,e,i,s.array,s.append,n);if(f.error)return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:f.error};if(r+=f.xtraceOutput,f.continueToNext)continue}let o=s.value?await de(t,s.value):"",a=s.value?await Ar(t,s.value):y;if(i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[\]$/))return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:V(`bash: ${i}: bad array subscript
1424
+ `)};let c=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(c){let f=await SA(t,e,c[1],c[2],o,s.append,n);if(f.error)return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:f.error};if(f.continueToNext)continue}let u=await NA(t,e,i,o,s.append,n,a);if(u.error)return{continueToNext:!1,xtraceOutput:r,tempAssignments:n,error:u.error};r+=u.xtraceOutput,u.continueToNext}return{continueToNext:!1,xtraceOutput:r,tempAssignments:n}}async function wA(t,e,n,r,s,i){let o="";if(/\[.+\]$/.test(n))return{continueToNext:!1,xtraceOutput:"",error:V(`bash: ${n}: cannot assign list to array member
1425
+ `)};if(_e(t,n)){let u=xr(t,n);if(u===void 0||u==="")throw new Ee(1,y,y);let f=bt(t,n);if(f&&/^[a-zA-Z_][a-zA-Z0-9_]*\[@\]$/.test(f))return{continueToNext:!1,xtraceOutput:"",error:V(`bash: ${n}: cannot assign list to array member
1426
+ `)}}if(In(t,n)){if(e.name)return o+=`bash: ${n}: readonly variable
1427
+ `,{continueToNext:!0,xtraceOutput:o};let u=ht(t,n);if(u)return{continueToNext:!1,xtraceOutput:"",error:u}}let a=t.state.associativeArrays?.has(n),l=bA(r),c=()=>{let u=`${n}_`;for(let f of t.state.env.keys())f.startsWith(u)&&!f.includes("__")&&t.state.env.delete(f);t.state.env.delete(n)};if(a&&l?await xA(t,e,n,r,s,c,u=>{o+=u}):l?await EA(t,n,r,s,c):await AA(t,n,r,s,c),e.name){i.set(n,t.state.env.get(n));let f=`(${r.map(p=>Xr(p)).join(" ")})`;T(t.state.env,n,f)}return{continueToNext:!0,xtraceOutput:o}}function bA(t){return t.some(e=>{if(e.parts.length>=2){let n=e.parts[0],r=e.parts[1];if(n.type!=="Glob"||!n.pattern.startsWith("["))return!1;if(n.pattern==="["&&(r.type==="DoubleQuoted"||r.type==="SingleQuoted")){if(e.parts.length<3)return!1;let s=e.parts[2];return s.type!=="Literal"?!1:s.value.startsWith("]=")||s.value.startsWith("]+=")}return r.type!=="Literal"?!1:r.value.startsWith("]")?r.value.startsWith("]=")||r.value.startsWith("]+="):n.pattern.endsWith("]")?r.value.startsWith("=")||r.value.startsWith("+="):!1}return!1})}async function xA(t,e,n,r,s,i,o){let a=[];for(let l of r){let c=wc(l);if(c){let{key:u,valueParts:f,append:p}=c,h;f.length>0?h=await de(t,{type:"Word",parts:f}):h="",h=tt(t,h),a.push({type:"keyed",key:u,value:h,append:p})}else{let u=await de(t,l);a.push({type:"invalid",expandedValue:u})}}s||i();for(let l of a)if(l.type==="keyed")if(l.append){let c=$(t.state.env,`${n}_${l.key}`,"");T(t.state.env,`${n}_${l.key}`,c+l.value)}else T(t.state.env,`${n}_${l.key}`,l.value);else{let c=e.line??t.state.currentLine??1;o(`bash: line ${c}: ${n}: ${l.expandedValue}: must use subscript when assigning associative array
1428
+ `)}}async function EA(t,e,n,r,s){let i=[];for(let a of n){let l=wc(a);if(l){let{key:c,valueParts:u,append:f}=l,p;u.length>0?p=await de(t,{type:"Word",parts:u}):p="",p=tt(t,p),i.push({type:"keyed",indexExpr:c,value:p,append:f})}else{let c=await gn(t,a);i.push({type:"non-keyed",values:c.values})}}r||s();let o=0;for(let a of i)if(a.type==="keyed"){let l;try{let c=new ye,u=Te(c,a.indexExpr);l=await ue(t,u.expression,!1)}catch{if(/^-?\d+$/.test(a.indexExpr))l=Number.parseInt(a.indexExpr,10);else{let c=$(t.state.env,a.indexExpr);l=c?Number.parseInt(c,10):0,Number.isNaN(l)&&(l=0)}}if(a.append){let c=$(t.state.env,`${e}_${l}`,"");T(t.state.env,`${e}_${l}`,c+a.value)}else T(t.state.env,`${e}_${l}`,a.value);o=l+1}else for(let l of a.values)T(t.state.env,`${e}_${o++}`,l)}async function AA(t,e,n,r,s){let i=[];for(let a of n){let l=await gn(t,a);i.push(...l.values)}let o=0;if(r){let a=me(t,e);if(a.length>0)o=Math.max(...a.map(([c])=>typeof c=="number"?c:0))+1;else{let l=t.state.env.get(e);l!==void 0&&(t.state.env.set(`${e}_0`,l),t.state.env.delete(e),o=1)}}else s();for(let a=0;a<i.length;a++)T(t.state.env,`${e}_${o+a}`,i[a]);r||T(t.state.env,`${e}__length`,String(i.length))}async function SA(t,e,n,r,s,i,o){let a=n;if(_e(t,n)){let f=bt(t,n);if(f&&f!==n){if(f.includes("["))return{continueToNext:!1,xtraceOutput:"",error:V(`bash: \`${f}': not a valid identifier
1429
+ `)};a=f}}if(In(t,a)){if(e.name)return{continueToNext:!0,xtraceOutput:""};let f=ht(t,a);if(f)return{continueToNext:!1,xtraceOutput:"",error:f}}let l=t.state.associativeArrays?.has(a),c;if(l)c=await X6(t,a,r);else{let f=await CA(t,a,r);if(f.error)return{continueToNext:!1,xtraceOutput:"",error:f.error};c=`${a}_${f.index}`}let u=i?$(t.state.env,c)+s:s;if(e.name)o.set(c,t.state.env.get(c)),T(t.state.env,c,u);else{let f=os(t,a);if(f!==void 0&&f===t.state.callDepth&&t.state.localScopes.length>0){let p=t.state.localScopes[t.state.localScopes.length-1];p.has(c)||p.set(c,t.state.env.get(c))}T(t.state.env,c,u)}return{continueToNext:!0,xtraceOutput:""}}async function X6(t,e,n){let r;if(n.startsWith("'")&&n.endsWith("'"))r=n.slice(1,-1);else if(n.startsWith('"')&&n.endsWith('"')){let s=n.slice(1,-1),o=new ye().parseWordFromString(s,!0,!1);r=await de(t,o)}else if(n.includes("$")){let i=new ye().parseWordFromString(n,!1,!1);r=await de(t,i)}else r=n;return`${e}_${r}`}async function CA(t,e,n){let r=n;n.startsWith('"')&&n.endsWith('"')&&n.length>=2&&(r=n.slice(1,-1));let s;if(/^-?\d+$/.test(r))s=Number.parseInt(r,10);else{try{let i=new ye,o=Te(i,r);s=await ue(t,o.expression,!1)}catch(i){if(i instanceof Be){let l=`bash: line ${t.state.currentLine}: ${n}: ${i.message}
1430
+ `;if(i.fatal)throw new Ee(1,y,x(l));return{index:0,error:V(l)}}let o=$(t.state.env,n);s=o?Number.parseInt(o,10):0}Number.isNaN(s)&&(s=0)}if(s<0){let i=me(t,e);if(i.length===0){let a=t.state.currentLine;return{index:0,error:V(`bash: line ${a}: ${e}[${n}]: bad array subscript
1431
+ `)}}if(s=Math.max(...i.map(([a])=>typeof a=="number"?a:0))+1+s,s<0){let a=t.state.currentLine;return{index:0,error:V(`bash: line ${a}: ${e}[${n}]: bad array subscript
1432
+ `)}}}return{index:s}}async function NA(t,e,n,r,s,i,o){let a="",l=n,c=null;if(_e(t,n)){let d=b2(t,n,r);if(d===void 0)return{continueToNext:!1,xtraceOutput:"",error:V(`bash: ${n}: circular name reference
1433
+ `)};if(d===null)return{continueToNext:!0,xtraceOutput:""};l=d;let g=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);g&&(c={arrayName:g[1],subscriptExpr:g[2]},l=g[1])}if(In(t,l)){if(e.name)return a+=`bash: ${l}: readonly variable
1434
+ `,{continueToNext:!0,xtraceOutput:a};let d=ht(t,l);if(d)return{continueToNext:!1,xtraceOutput:"",error:d}}let u,f=!!o&&!s&&!c;if(Zs(t,l)){f=!1;try{let d=new ye;if(s){let w=`(${$(t.state.env,l,"0")}) + (${r})`,E=Te(d,w);u=String(await ue(t,E.expression))}else{let g=Te(d,r);u=String(await ue(t,g.expression))}}catch{u="0"}}else{let{isArray:d}=await Promise.resolve().then(()=>(Dt(),_c)),g=d(t,l);g&&(f=!1);let w=g?`${l}_0`:l;u=s?$(t.state.env,w)+r:r}let p=cs(t,l,u);p!==u&&(f=!1),u=p,a+=await Y6(t,l,u);let h=l;if(c)h=await vA(t,c);else{let{isArray:d}=await Promise.resolve().then(()=>(Dt(),_c));d(t,l)&&(h=`${l}_0`,f=!1)}let m=f?()=>t.state.env.set(h,o):()=>T(t.state.env,h,u);return e.name?(i.set(h,t.state.env.get(h)),m()):(m(),t.state.options.allexport&&(t.state.exportedVars=t.state.exportedVars||new Set,t.state.exportedVars.add(l)),t.state.tempEnvBindings?.some(d=>d.has(l))&&(t.state.mutatedTempEnvVars=t.state.mutatedTempEnvVars||new Set,t.state.mutatedTempEnvVars.add(l))),{continueToNext:!1,xtraceOutput:a}}async function vA(t,e){let{arrayName:n,subscriptExpr:r}=e;if(t.state.associativeArrays?.has(n))return X6(t,n,r);let i;if(/^-?\d+$/.test(r))i=Number.parseInt(r,10);else{try{let o=new ye,a=Te(o,r);i=await ue(t,a.expression,!1)}catch{let o=$(t.state.env,r);i=o?Number.parseInt(o,10):0}Number.isNaN(i)&&(i=0)}if(i<0){let o=me(t,n);o.length>0&&(i=Math.max(...o.map(l=>l[0]))+1+i)}return`${n}_${i}`}it();F();Ne();Dt();Qt();async function J6(t,e,n,r){let s=await On(t,e.redirections);if(s)return s;let i=new Map(t.state.env),o=t.state.cwd,a={...t.state.options},l=new Map(t.state.functions),c=t.state.localScopes,u=t.state.localVarStack,f=t.state.localVarDepth,p=t.state.fullyUnsetLocals;if(t.state.localScopes=c.map(O=>new Map(O)),u){t.state.localVarStack=new Map;for(let[O,G]of u.entries())t.state.localVarStack.set(O,G.map(M=>({...M})))}f&&(t.state.localVarDepth=new Map(f)),p&&(t.state.fullyUnsetLocals=new Map(p));let h=t.state.loopDepth,m=t.state.parentHasLoopContext;t.state.parentHasLoopContext=h>0,t.state.loopDepth=0;let d=t.state.lastArg,g=t.state.bashPid;t.state.bashPid=t.state.nextVirtualPid++;let w=t.state.groupStdin;Mt(n)||(t.state.groupStdin=n);let E=y,b=y,A=0,N=()=>{t.state.env=i,t.state.cwd=o,t.state.options=a,t.state.functions=l,t.state.localScopes=c,t.state.localVarStack=u,t.state.localVarDepth=f,t.state.fullyUnsetLocals=p,t.state.loopDepth=h,t.state.parentHasLoopContext=m,t.state.groupStdin=w,t.state.bashPid=g,t.state.lastArg=d};try{for(let O of e.body){let G=await r(O);E=j(E,G.stdout),b=j(b,G.stderr),A=G.exitCode}}catch(O){if(N(),O instanceof ae)throw O;if(O instanceof wn){E=j(E,O.stdout),b=j(b,O.stderr);let M=K(E,b,0);return Qe(t,M,e.redirections)}if(O instanceof xt||O instanceof Et){E=j(E,O.stdout),b=j(b,O.stderr);let M=K(E,b,0);return Qe(t,M,e.redirections)}if(O instanceof Ee){E=j(E,O.stdout),b=j(b,O.stderr);let M=K(E,b,O.exitCode);return Qe(t,M,e.redirections)}if(O instanceof mt){E=j(E,O.stdout),b=j(b,O.stderr);let M=K(E,b,O.exitCode);return Qe(t,M,e.redirections)}if(O instanceof Lt){let M=K(j(E,O.stdout),j(b,O.stderr),O.exitCode);return Qe(t,M,e.redirections)}let G=K(E,j(b,x(`${qe(O)}
1435
+ `)),1);return Qe(t,G,e.redirections)}N();let P=K(E,b,A);return Qe(t,P,e.redirections)}async function e7(t,e,n,r){let s=y,i=y,o=0,a=await zo(t,e.redirections);if(a)return a;let l=n;for(let f of e.redirections)if((f.operator==="<<"||f.operator==="<<-")&&f.target.type==="HereDoc"){let p=f.target,h=await de(t,p.content);p.stripTabs&&(h=h.split(`
1436
+ `).map(d=>d.replace(/^\t+/,"")).join(`
1437
+ `));let m=f.fd??0;m!==0?(t.state.fileDescriptors||(t.state.fileDescriptors=new Map),t.state.fileDescriptors.set(m,h)):l=x(h)}else if(f.operator==="<<<"&&f.target.type==="Word")l=x(`${await de(t,f.target)}
1438
+ `);else if(f.operator==="<"&&f.target.type==="Word")try{let p=await de(t,f.target),h=t.fs.resolvePath(t.state.cwd,p);l=x(await t.fs.readFile(h))}catch{let p=await de(t,f.target);return V(`bash: ${p}: No such file or directory
1439
+ `)}let c=t.state.groupStdin;Mt(l)||(t.state.groupStdin=l);try{for(let f of e.body){let p=await r(f);s=j(s,p.stdout),i=j(i,p.stderr),o=p.exitCode}}catch(f){if(t.state.groupStdin=c,f instanceof ae)throw f;if(ii(f)||f instanceof Lt||f instanceof Ee)throw f.prependOutput(s,i),f;return K(s,j(i,x(`${qe(f)}
1440
+ `)),1)}t.state.groupStdin=c;let u=K(s,i,o);return Qe(t,u,e.redirections)}async function t7(t,e,n,r,s){let i;try{i=await t.fs.readFile(e)}catch{return V(`bash: ${e}: No such file or directory
1441
+ `,127)}if(i.startsWith("#!")){let g=i.indexOf(`
1442
+ `);g!==-1&&(i=i.slice(g+1))}let o=new Map(t.state.env),a=t.state.cwd,l={...t.state.options},c=t.state.loopDepth,u=t.state.parentHasLoopContext,f=t.state.lastArg,p=t.state.bashPid,h=t.state.groupStdin,m=t.state.currentSource;t.state.parentHasLoopContext=c>0,t.state.loopDepth=0,t.state.bashPid=t.state.nextVirtualPid++,Mt(r)||(t.state.groupStdin=r),t.state.currentSource=e,T(t.state.env,"0",e),T(t.state.env,"#",String(n.length)),T(t.state.env,"@",n.join(" ")),T(t.state.env,"*",n.join(" "));for(let g=0;g<n.length&&g<9;g++)T(t.state.env,String(g+1),n[g]);for(let g=n.length+1;g<=9;g++)t.state.env.delete(String(g));let d=()=>{t.state.env=o,t.state.cwd=a,t.state.options=l,t.state.loopDepth=c,t.state.parentHasLoopContext=u,t.state.lastArg=f,t.state.bashPid=p,t.state.groupStdin=h,t.state.currentSource=m};try{let w=new ye().parse(i),E=await s(w);return d(),E}catch(g){if(d(),g instanceof Ee||g instanceof ae)throw g;if(g.name==="ParseException")return V(`bash: ${e}: ${g.message}
1443
+ `);throw g}}function kA(t,e){for(let n of e.parts)switch(n.type){case"Bytes":case"Literal":case"SingleQuoted":case"Escaped":continue;case"DoubleQuoted":for(let r of n.parts)switch(r.type){case"Bytes":case"Literal":case"SingleQuoted":case"Escaped":continue;case"ParameterExpansion":if(r.operation||r.parameter==="@"||r.parameter==="*"||r.parameter.endsWith("[@]")||r.parameter.endsWith("[*]"))return!1;if(_e(t,r.parameter)){let s=bt(t,r.parameter);if(s&&(s.endsWith("[@]")||s.endsWith("[*]")))return!1}continue;case"CommandSubstitution":continue;default:return!1}continue;case"ParameterExpansion":return!1;default:return!1}return e.parts.length>0}var Xs=class{ctx;constructor(e,n){this.ctx={state:n,fs:e.fs,commands:e.commands,limits:e.limits,execFn:e.exec,executeScript:this.executeScript.bind(this),executeStatement:this.executeStatement.bind(this),executeCommand:this.executeCommand.bind(this),fetch:e.fetch,sleep:e.sleep,trace:e.trace,coverage:e.coverage}}buildExportedEnv(){let e=this.ctx.state.exportedVars,n=this.ctx.state.tempExportedVars,r=new Set;if(e)for(let i of e)r.add(i);if(n)for(let i of n)r.add(i);if(r.size===0)return Object.create(null);let s=Object.create(null);for(let i of r)this.ctx.state.env.has(i)&&(s[i]=$(this.ctx.state.env,i));return s}async executeScript(e){let n=y,r=y,s=0;for(let i of e.statements)try{let o=await this.executeStatement(i);n=j(n,o.stdout),r=j(r,o.stderr),s=o.exitCode,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s))}catch(o){if(o instanceof Ee)throw o.prependOutput(n,r),o;if(o instanceof Yt)return n=j(n,o.stdout),r=j(r,o.stderr),s=o.exitCode,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Rt(this.ctx.state.env)};if(o instanceof ae)throw o;if(o instanceof Lt)return n=j(n,o.stdout),r=j(r,o.stderr),s=o.exitCode,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Rt(this.ctx.state.env)};if(o instanceof It)return n=j(n,o.stdout),r=j(r,o.stderr),s=1,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Rt(this.ctx.state.env)};if(o instanceof Tt)return n=j(n,o.stdout),r=j(r,o.stderr),s=1,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s)),{stdout:n,stderr:r,exitCode:s,env:Rt(this.ctx.state.env)};if(o instanceof Be){n=j(n,o.stdout),r=j(r,o.stderr),s=1,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s));continue}if(o instanceof Tr){n=j(n,o.stdout),r=j(r,o.stderr),s=1,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s));continue}if(o instanceof xt||o instanceof Et){if(this.ctx.state.loopDepth>0)throw o.prependOutput(n,r),o;n=j(n,o.stdout),r=j(r,o.stderr);continue}throw o instanceof mt&&o.prependOutput(n,r),o}return{stdout:n,stderr:r,exitCode:s,env:Rt(this.ctx.state.env)}}async executeUserScript(e,n,r=y){return t7(this.ctx,e,W(n),r,s=>this.executeScript(s))}async executeStatement(e){if(this.ctx.state.commandCount++,this.ctx.state.commandCount>this.ctx.limits.maxCommandCount&&Fn(`too many commands executed (>${this.ctx.limits.maxCommandCount}), increase executionLimits.maxCommandCount`,"commands"),e.deferredError)throw new dt(e.deferredError.message,e.line??1,1);if(this.ctx.state.options.noexec)return Se;this.ctx.state.errexitSafe=!1;let n=y,r=y;this.ctx.state.options.verbose&&!this.ctx.state.suppressVerbose&&e.sourceText&&(r=j(r,x(`${e.sourceText}
1444
+ `)));let s=0,i=-1,o=!1;for(let c=0;c<e.pipelines.length;c++){let u=e.pipelines[c],f=c>0?e.operators[c-1]:null;if(f==="&&"&&s!==0||f==="||"&&s===0)continue;let p=await this.executePipeline(u);n=j(n,p.stdout),r=j(r,p.stderr),s=p.exitCode,i=c,o=u.negated,this.ctx.state.lastExitCode=s,T(this.ctx.state.env,"?",String(s))}let a=i<e.pipelines.length-1,l=this.ctx.state.errexitSafe;if(this.ctx.state.errexitSafe=a||o||l,this.ctx.state.options.errexit&&s!==0&&i===e.pipelines.length-1&&!o&&!this.ctx.state.inCondition&&!l)throw new Lt(s,n,r);return{stdout:n,stderr:r,exitCode:s}}async executePipeline(e){return Q6(this.ctx,e,(n,r)=>this.executeCommand(n,r))}async executeCommand(e,n){switch(this.ctx.coverage?.hit(`bash:cmd:${e.type}`),e.type){case"SimpleCommand":return this.executeSimpleCommand(e,n);case"If":return U6(this.ctx,e);case"For":return B6(this.ctx,e);case"CStyleFor":return W6(this.ctx,e);case"While":return z6(this.ctx,e,n);case"Until":return H6(this.ctx,e);case"Case":return j6(this.ctx,e);case"Subshell":return this.executeSubshell(e,n);case"Group":return this.executeGroup(e,n);case"FunctionDef":return a6(this.ctx,e);case"ArithmeticCommand":return this.executeArithmeticCommand(e);case"ConditionalCommand":return this.executeConditionalCommand(e);default:return Se}}async executeSimpleCommand(e,n){try{return await this.executeSimpleCommandInner(e,n)}catch(r){if(r instanceof yn)return{stdout:y,stderr:r.stderr,exitCode:1};throw r}}async executeSimpleCommandInner(e,n){if(e.line!==void 0&&(this.ctx.state.currentLine=e.line),this.ctx.state.shoptOptions.expand_aliases&&e.name){let A=e,N=100;for(;N>0;){let P=this.expandAlias(A);if(P===A)break;A=P,N--}this.aliasExpansionStack.clear(),A!==e&&(e=A)}this.ctx.state.expansionStderr="";let r=await K6(this.ctx,e);if(r.error)return r.error;let s=r.tempAssignments,i=r.xtraceOutput;if(!e.name){if(e.redirections.length>0){let N=await On(this.ctx,e.redirections);if(N)return N;let P={stdout:y,stderr:x(i),exitCode:0};return Qe(this.ctx,P,e.redirections)}this.ctx.state.lastArg=x("");let A=(this.ctx.state.expansionStderr||"")+i;return this.ctx.state.expansionStderr="",{stdout:y,stderr:x(A),exitCode:this.ctx.state.lastExitCode}}let o=e.name&&Iu(e.name,["local","declare","typeset","export","readonly"]),a=Array.from(s.keys());if(a.length>0&&!o){this.ctx.state.tempExportedVars=this.ctx.state.tempExportedVars||new Set;for(let A of a)this.ctx.state.tempExportedVars.add(A)}let l=await zo(this.ctx,e.redirections);if(l){for(let[A,N]of s)N===void 0?this.ctx.state.env.delete(A):this.ctx.state.env.set(A,N);return l}let c=-1;for(let A of e.redirections){if((A.operator==="<<"||A.operator==="<<-")&&A.target.type==="HereDoc"){let N=A.target,P=A.fd??0;if(P===0&&!N.stripTabs)n=await Ar(this.ctx,N.content);else{let O=await de(this.ctx,N.content);N.stripTabs&&(O=O.split(`
1445
+ `).map(G=>G.replace(/^\t+/,"")).join(`
1446
+ `)),P!==0?(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),this.ctx.state.fileDescriptors.set(P,O)):n=x(O)}continue}if(A.operator==="<<<"&&A.target.type==="Word"){let N=await Ar(this.ctx,A.target);n=j(N,x(`
1447
+ `));continue}if(A.operator==="<"&&A.target.type==="Word")try{let N=await de(this.ctx,A.target),P=this.ctx.fs.resolvePath(this.ctx.state.cwd,N);n=await this.ctx.fs.readFileBuffer(P)}catch{let N=await de(this.ctx,A.target);for(let[P,O]of s)O===void 0?this.ctx.state.env.delete(P):this.ctx.state.env.set(P,O);return V(`bash: ${N}: No such file or directory
1448
+ `)}if(A.operator==="<&"&&A.target.type==="Word"){let N=await de(this.ctx,A.target),P=Number.parseInt(N,10);if(!Number.isNaN(P)&&this.ctx.state.fileDescriptors){let O=this.ctx.state.fileDescriptors.get(P);if(O!==void 0)if(O.startsWith("__rw__:")){let G=G6(O);G&&(n=x(G.content.slice(G.position)),c=P)}else O.startsWith("__file__:")||O.startsWith("__file_append__:")||(n=x(O))}}}let u=await de(this.ctx,e.name),f=[],p=[];if(Iu(e.name,["local","declare","typeset","export","readonly"])&&(u==="local"||u==="declare"||u==="typeset"||u==="export"||u==="readonly"))for(let A of e.args){let N=await jg(this.ctx,A);if(N)f.push(x(N)),p.push(!0);else{let P=await Gg(this.ctx,A);if(P!==null)f.push(x(P)),p.push(!0);else{let O=await gn(this.ctx,A);for(let G of O.values)f.push(x(G)),p.push(O.quoted)}}}else for(let A of e.args)if(kA(this.ctx,A))f.push(await Ar(this.ctx,A)),p.push(!0);else{let N=await gn(this.ctx,A);for(let P of N.values)f.push(x(P)),p.push(N.quoted)}if(!u){if(e.name.parts.every(N=>N.type==="CommandSubstitution"||N.type==="ParameterExpansion"||N.type==="ArithmeticExpansion")){if(f.length>0){let N=R(f.shift());return p.shift(),await this.runCommand(N,f,p,n,!1,!1,c)}return{stdout:y,stderr:y,exitCode:this.ctx.state.lastExitCode}}return V(`bash: : command not found
1449
+ `,127)}if(u==="exec"&&(f.length===0||R(f[0])==="--")){for(let A of e.redirections){if(A.target.type==="HereDoc"||A.fdVariable)continue;let N=await de(this.ctx,A.target),P=A.fd??(A.operator==="<"||A.operator==="<>"?0:1);switch(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),A.operator){case">":case">|":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,N);await this.ctx.fs.writeFile(O,"","utf8"),this.ctx.state.fileDescriptors.set(P,`__file__:${O}`);break}case">>":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,N);this.ctx.state.fileDescriptors.set(P,`__file_append__:${O}`);break}case"<":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,N);try{let G=await this.ctx.fs.readFile(O);this.ctx.state.fileDescriptors.set(P,G)}catch{return V(`bash: ${N}: No such file or directory
1450
+ `)}break}case"<>":{let O=this.ctx.fs.resolvePath(this.ctx.state.cwd,N);try{let G=await this.ctx.fs.readFile(O);this.ctx.state.fileDescriptors.set(P,`__rw__:${O.length}:${O}:0:${G}`)}catch{await this.ctx.fs.writeFile(O,"","utf8"),this.ctx.state.fileDescriptors.set(P,`__rw__:${O.length}:${O}:0:`)}break}case">&":{if(N==="-")this.ctx.state.fileDescriptors.delete(P);else if(N.endsWith("-")){let O=N.slice(0,-1),G=Number.parseInt(O,10);if(!Number.isNaN(G)){let M=this.ctx.state.fileDescriptors.get(G);M!==void 0?this.ctx.state.fileDescriptors.set(P,M):this.ctx.state.fileDescriptors.set(P,`__dupout__:${G}`),this.ctx.state.fileDescriptors.delete(G)}}else{let O=Number.parseInt(N,10);Number.isNaN(O)||this.ctx.state.fileDescriptors.set(P,`__dupout__:${O}`)}break}case"<&":{if(N==="-")this.ctx.state.fileDescriptors.delete(P);else if(N.endsWith("-")){let O=N.slice(0,-1),G=Number.parseInt(O,10);if(!Number.isNaN(G)){let M=this.ctx.state.fileDescriptors.get(G);M!==void 0?this.ctx.state.fileDescriptors.set(P,M):this.ctx.state.fileDescriptors.set(P,`__dupin__:${G}`),this.ctx.state.fileDescriptors.delete(G)}}else{let O=Number.parseInt(N,10);Number.isNaN(O)||this.ctx.state.fileDescriptors.set(P,`__dupin__:${O}`)}break}}}for(let[A,N]of s)N===void 0?this.ctx.state.env.delete(A):this.ctx.state.env.set(A,N);if(this.ctx.state.tempExportedVars)for(let A of s.keys())this.ctx.state.tempExportedVars.delete(A);return Se}let m=await Z6(this.ctx,u,f.map(A=>R(A)));s.size>0&&(this.ctx.state.tempEnvBindings=this.ctx.state.tempEnvBindings||[],this.ctx.state.tempEnvBindings.push(new Map(s)));let d,g=null;try{d=await this.runCommand(u,f,p,n,!1,!1,c)}catch(A){if(A instanceof xt||A instanceof Et)g=A,d=Se;else throw A}let w=i+m;if(w&&(d={...d,stderr:j(x(w),d.stderr)}),d=await Qe(this.ctx,d,e.redirections),g)throw g;if(f.length>0){let A=R(f[f.length-1]);if((u==="declare"||u==="local"||u==="typeset")&&/^[a-zA-Z_][a-zA-Z0-9_]*=\(/.test(A)){let N=A.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);N&&(A=N[1])}this.ctx.state.lastArg=x(A)}else this.ctx.state.lastArg=x(u);let E=i6(u)&&u!=="unset"&&u!=="eval";if(!this.ctx.state.options.posix||!E)for(let[A,N]of s)this.ctx.state.fullyUnsetLocals?.has(A)||(N===void 0?this.ctx.state.env.delete(A):this.ctx.state.env.set(A,N));if(this.ctx.state.tempExportedVars)for(let A of s.keys())this.ctx.state.tempExportedVars.delete(A);return s.size>0&&this.ctx.state.tempEnvBindings&&this.ctx.state.tempEnvBindings.pop(),this.ctx.state.expansionStderr&&(d={...d,stderr:j(x(this.ctx.state.expansionStderr),d.stderr)},this.ctx.state.expansionStderr=""),d}async runCommand(e,n,r,s,i=!1,o=!1,a=-1){let l={ctx:this.ctx,runCommand:(u,f,p,h,m,d,g)=>this.runCommand(u,f,p,h,m,d,g),buildExportedEnv:()=>this.buildExportedEnv(),executeUserScript:(u,f,p)=>this.executeUserScript(u,f,p)},c=await L6(l,e,n,r,s,i,o,a);return c!==null?c:F6(l,e,n,s,o)}aliasExpansionStack=new Set;expandAlias(e){return hc(this.ctx.state,e,this.aliasExpansionStack)}async findCommandInPath(e){return Yo(this.ctx,e)}async executeSubshell(e,n=y){return J6(this.ctx,e,n,r=>this.executeStatement(r))}async executeGroup(e,n=y){return e7(this.ctx,e,n,r=>this.executeStatement(r))}async executeArithmeticCommand(e){e.line!==void 0&&(this.ctx.state.currentLine=e.line);let n=await On(this.ctx,e.redirections);if(n)return n;try{let r=await ue(this.ctx,e.expression.expression),s=at(r!==0);return this.ctx.state.expansionStderr&&(s={...s,stderr:j(x(this.ctx.state.expansionStderr),s.stderr)},this.ctx.state.expansionStderr=""),Qe(this.ctx,s,e.redirections)}catch(r){let s=V(`bash: arithmetic expression: ${r.message}
1451
+ `);return Qe(this.ctx,s,e.redirections)}}async executeConditionalCommand(e){e.line!==void 0&&(this.ctx.state.currentLine=e.line);let n=await On(this.ctx,e.redirections);if(n)return n;try{let r=await Kn(this.ctx,e.expression),s=at(r);return this.ctx.state.expansionStderr&&(s={...s,stderr:j(x(this.ctx.state.expansionStderr),s.stderr)},this.ctx.state.expansionStderr=""),Qe(this.ctx,s,e.redirections)}catch(r){let s=r instanceof Be?1:2,i=V(`bash: conditional expression: ${r.message}
1452
+ `,s);return Qe(this.ctx,i,e.redirections)}}};var Gt={maxCallDepth:100,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:3e4,maxGlobOperations:1e5,maxStringLength:10485760,maxArrayElements:1e5,maxHeredocSize:10485760,maxSubstitutionDepth:50};function n7(t){return t?{maxCallDepth:t.maxCallDepth??Gt.maxCallDepth,maxCommandCount:t.maxCommandCount??Gt.maxCommandCount,maxLoopIterations:t.maxLoopIterations??Gt.maxLoopIterations,maxAwkIterations:t.maxAwkIterations??Gt.maxAwkIterations,maxSedIterations:t.maxSedIterations??Gt.maxSedIterations,maxJqIterations:t.maxJqIterations??Gt.maxJqIterations,maxSqliteTimeoutMs:t.maxSqliteTimeoutMs??Gt.maxSqliteTimeoutMs,maxPythonTimeoutMs:t.maxPythonTimeoutMs??Gt.maxPythonTimeoutMs,maxGlobOperations:t.maxGlobOperations??Gt.maxGlobOperations,maxStringLength:t.maxStringLength??Gt.maxStringLength,maxArrayElements:t.maxArrayElements??Gt.maxArrayElements,maxHeredocSize:t.maxHeredocSize??Gt.maxHeredocSize,maxSubstitutionDepth:t.maxSubstitutionDepth??Gt.maxSubstitutionDepth}:{...Gt}}function r7(t){try{let e=new URL(t);return{origin:e.origin,pathname:e.pathname,href:e.href}}catch{return null}}function IA(t){let e=r7(t);return e?{origin:e.origin,pathPrefix:e.pathname}:null}function TA(t,e){let n=r7(t);if(!n)return!1;let r=IA(e);return!r||n.origin!==r.origin?!1:r.pathPrefix==="/"||r.pathPrefix===""?!0:n.pathname.startsWith(r.pathPrefix)}function Tu(t,e){return!e||e.length===0?!1:e.some(n=>TA(t,n))}var us=class extends Error{constructor(e){super(`Network access denied: URL not in allow-list: ${e}`),this.name="NetworkAccessDeniedError"}},fs=class extends Error{constructor(e){super(`Too many redirects (max: ${e})`),this.name="TooManyRedirectsError"}},ps=class extends Error{constructor(e){super(`Redirect target not in allow-list: ${e}`),this.name="RedirectNotAllowedError"}},Ko=class extends Error{constructor(e,n){super(`HTTP method '${e}' not allowed. Allowed methods: ${n.join(", ")}`),this.name="MethodNotAllowedError"}},Js=class extends Error{constructor(e){super(`Response body too large (max: ${e} bytes)`),this.name="ResponseTooLargeError"}};var OA=20,RA=3e4,PA=10485760,$A=["GET","HEAD"],DA=new Set(["GET","HEAD","OPTIONS"]),_A=new Set([301,302,303,307,308]);function Ou(t){let e=t.maxRedirects??OA,n=t.timeoutMs??RA,r=t.maxResponseSize??PA,s=t.dangerouslyAllowFullInternetAccess?["GET","HEAD","POST","PUT","DELETE","PATCH","OPTIONS"]:t.allowedMethods??$A;function i(l){if(!t.dangerouslyAllowFullInternetAccess&&!Tu(l,t.allowedUrlPrefixes??[]))throw new us(l)}function o(l){if(t.dangerouslyAllowFullInternetAccess)return;let c=l.toUpperCase();if(!s.includes(c))throw new Ko(c,s)}async function a(l,c={}){let u=c.method?.toUpperCase()??"GET";i(l),o(u);let f=l,p=0,h=c.followRedirects??!0,m=c.timeoutMs!==void 0?Math.min(c.timeoutMs,n):n;for(;;){let d=new AbortController,g=setTimeout(()=>d.abort(),m);try{let w={method:u,headers:c.headers,signal:d.signal,redirect:"manual"};c.body&&!DA.has(u)&&(w.body=c.body);let E=await fetch(f,w);if(_A.has(E.status)&&h){let b=E.headers.get("location");if(!b)return await s7(E,f,r);let A=new URL(b,f).href;if(!t.dangerouslyAllowFullInternetAccess&&!Tu(A,t.allowedUrlPrefixes??[]))throw new ps(A);if(p++,p>e)throw new fs(e);f=A;continue}return await s7(E,f,r)}finally{clearTimeout(g)}}}return a}async function s7(t,e,n){let r=Object.create(null);if(t.headers.forEach((i,o)=>{r[o.toLowerCase()]=i}),n>0){let i=t.headers.get("content-length");if(i){let o=parseInt(i,10);if(!Number.isNaN(o)&&o>n)throw new Js(n)}}let s;if(n>0&&t.body){let i=t.body.getReader(),o=new TextDecoder,a=[],l=0;for(;;){let{done:c,value:u}=await i.read();if(c)break;if(l+=u.byteLength,l>n)throw i.cancel(),new Js(n);a.push(o.decode(u,{stream:!0}))}a.push(o.decode()),s=a.join("")}else s=await t.text();return{status:t.status,statusText:t.statusText,headers:r,body:s,url:e}}Gn();it();function i7(){let t=[{prop:"Function",target:globalThis,violationType:"function_constructor",strategy:"throw",reason:"Function constructor allows arbitrary code execution"},{prop:"eval",target:globalThis,violationType:"eval",strategy:"throw",reason:"eval() allows arbitrary code execution"},{prop:"setTimeout",target:globalThis,violationType:"setTimeout",strategy:"throw",reason:"setTimeout with string argument allows code execution"},{prop:"setInterval",target:globalThis,violationType:"setInterval",strategy:"throw",reason:"setInterval with string argument allows code execution"},{prop:"setImmediate",target:globalThis,violationType:"setImmediate",strategy:"throw",reason:"setImmediate could be used to escape sandbox context"},{prop:"env",target:process,violationType:"process_env",strategy:"throw",reason:"process.env could leak sensitive environment variables"},{prop:"binding",target:process,violationType:"process_binding",strategy:"throw",reason:"process.binding provides access to native Node.js modules"},{prop:"_linkedBinding",target:process,violationType:"process_binding",strategy:"throw",reason:"process._linkedBinding provides access to native Node.js modules"},{prop:"dlopen",target:process,violationType:"process_dlopen",strategy:"throw",reason:"process.dlopen allows loading native addons"},{prop:"WeakRef",target:globalThis,violationType:"weak_ref",strategy:"throw",reason:"WeakRef could be used to leak references outside sandbox"},{prop:"FinalizationRegistry",target:globalThis,violationType:"finalization_registry",strategy:"throw",reason:"FinalizationRegistry could be used to leak references outside sandbox"},{prop:"Reflect",target:globalThis,violationType:"reflect",strategy:"freeze",reason:"Reflect provides introspection capabilities"},{prop:"Proxy",target:globalThis,violationType:"proxy",strategy:"throw",reason:"Proxy allows intercepting and modifying object behavior"},{prop:"WebAssembly",target:globalThis,violationType:"webassembly",strategy:"throw",reason:"WebAssembly allows executing arbitrary compiled code"},{prop:"SharedArrayBuffer",target:globalThis,violationType:"shared_array_buffer",strategy:"throw",reason:"SharedArrayBuffer could enable side-channel communication or timing attacks"},{prop:"Atomics",target:globalThis,violationType:"atomics",strategy:"throw",reason:"Atomics could enable side-channel communication or timing attacks"}];try{let e=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&t.push({prop:"constructor",target:Object.getPrototypeOf(async()=>{}),violationType:"async_function_constructor",strategy:"throw",reason:"AsyncFunction constructor allows arbitrary async code execution"})}catch{}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&t.push({prop:"constructor",target:Object.getPrototypeOf(function*(){}),violationType:"generator_function_constructor",strategy:"throw",reason:"GeneratorFunction constructor allows arbitrary generator code execution"})}catch{}try{let e=Object.getPrototypeOf(async function*(){}).constructor;e&&e!==Function&&e!==Object.getPrototypeOf(async()=>{}).constructor&&t.push({prop:"constructor",target:Object.getPrototypeOf(async function*(){}),violationType:"async_generator_function_constructor",strategy:"throw",reason:"AsyncGeneratorFunction constructor allows arbitrary async generator code execution"})}catch{}return t.filter(e=>{try{return e.target[e.prop]!==void 0}catch{return!1}})}var ei=!0;function o7(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Pu=null;if(!ei)try{let{createRequire:t}=await import("node:module");Pu=t(import.meta.url)("node:async_hooks").AsyncLocalStorage}catch(t){console.debug("[DefenseInDepthBox] AsyncLocalStorage not available, defense-in-depth disabled:",t instanceof Error?t.message:t)}var MA=`
1453
+
1454
+ This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`,vt=class extends Error{violation;constructor(e,n){super(e+MA),this.violation=n,this.name="SecurityViolationError"}},Vt=!ei&&Pu?new Pu:null,LA=1e3,Ru={enabled:!0,auditMode:!1};function FA(t){return t===void 0?{...Ru,enabled:!1}:typeof t=="boolean"?{...Ru,enabled:t}:{...Ru,...t}}var Xo=class t{static instance=null;config;refCount=0;originalDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(e){this.config=e}static getInstance(e){return t.instance||(t.instance=new t(FA(e))),t.instance}static resetInstance(){t.instance&&(t.instance.forceDeactivate(),t.instance=null)}static isInSandboxedContext(){return Vt?Vt?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(Vt)return Vt?.getStore()?.executionId}updateConfig(e){this.config={...this.config,...e}}activate(){if(ei||!this.config.enabled){let n=o7();return{run:r=>r(),deactivate:()=>{},executionId:n}}this.refCount++,this.refCount===1&&(this.applyPatches(),this.activationTime=Date.now());let e=o7();return{run:n=>Vt.run({sandboxActive:!0,executionId:e},n),deactivate:()=>{this.refCount--,this.refCount===0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount<0&&(this.refCount=0)},executionId:e}}forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount=0}isActive(){return this.refCount>0}getStats(){return{violationsBlocked:this.violations.length,violations:[...this.violations],activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}clearViolations(){this.violations=[]}getPathForTarget(e,n){return e===globalThis?`globalThis.${n}`:e===process?`process.${n}`:e===Error?`Error.${n}`:e===Function.prototype?`Function.prototype.${n}`:e===Object.prototype?`Object.prototype.${n}`:`<object>.${n}`}shouldBlock(){return ei||this.config.auditMode||!Vt?!1:Vt?.getStore()?.sandboxActive===!0}recordViolation(e,n,r){let s={timestamp:Date.now(),type:e,message:r,path:n,stack:new Error().stack,executionId:Vt?.getStore()?.executionId};if(this.violations.length<LA&&this.violations.push(s),this.config.onViolation)try{this.config.onViolation(s)}catch(i){console.debug("[DefenseInDepthBox] onViolation callback threw:",i instanceof Error?i.message:i)}return s}createBlockingProxy(e,n,r){let s=this;return new Proxy(e,{apply(i,o,a){if(s.shouldBlock()){let l=`${n} is blocked during script execution`,c=s.recordViolation(r,n,l);throw new vt(l,c)}return s.config.auditMode&&Vt?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} called (audit mode)`),Reflect.apply(i,o,a)},construct(i,o,a){if(s.shouldBlock()){let l=`${n} constructor is blocked during script execution`,c=s.recordViolation(r,n,l);throw new vt(l,c)}return s.config.auditMode&&Vt?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} constructor called (audit mode)`),Reflect.construct(i,o,a)}})}createBlockingObjectProxy(e,n,r){let s=this;return new Proxy(e,{get(i,o,a){if(s.shouldBlock()){let l=`${n}.${String(o)}`,c=`${l} is blocked during script execution`,u=s.recordViolation(r,l,c);throw new vt(c,u)}if(s.config.auditMode&&Vt?.getStore()?.sandboxActive===!0){let l=`${n}.${String(o)}`;s.recordViolation(r,l,`${l} accessed (audit mode)`)}return Reflect.get(i,o,a)},set(i,o,a,l){if(s.shouldBlock()){let c=`${n}.${String(o)}`,u=`${c} modification is blocked during script execution`,f=s.recordViolation(r,c,u);throw new vt(u,f)}return Reflect.set(i,o,a,l)},ownKeys(i){if(s.shouldBlock()){let o=`${n} enumeration is blocked during script execution`,a=s.recordViolation(r,n,o);throw new vt(o,a)}return Reflect.ownKeys(i)},getOwnPropertyDescriptor(i,o){if(s.shouldBlock()){let a=`${n}.${String(o)}`,l=`${a} descriptor access is blocked during script execution`,c=s.recordViolation(r,a,l);throw new vt(l,c)}return Reflect.getOwnPropertyDescriptor(i,o)},has(i,o){if(s.shouldBlock()){let a=`${n}.${String(o)}`,l=`${a} existence check is blocked during script execution`,c=s.recordViolation(r,a,l);throw new vt(l,c)}return Reflect.has(i,o)}})}applyPatches(){let e=i7();for(let n of e)this.applyPatch(n);this.protectConstructorChain(),this.protectErrorPrepareStackTrace(),this.protectModuleLoad(),this.protectProcessMainModule()}protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,"Function.prototype.constructor","function_constructor");try{let e=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"AsyncFunction.prototype.constructor","async_function_constructor")}catch(e){console.debug("[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"GeneratorFunction.prototype.constructor","generator_function_constructor")}catch(e){console.debug("[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(async function*(){}).constructor,n=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&e!==n&&this.patchPrototypeConstructor(e.prototype,"AsyncGeneratorFunction.prototype.constructor","async_generator_function_constructor")}catch(e){console.debug("[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}}protectErrorPrepareStackTrace(){let e=this;try{let n=Object.getOwnPropertyDescriptor(Error,"prepareStackTrace");this.originalDescriptors.push({target:Error,prop:"prepareStackTrace",descriptor:n});let r=n?.value;Object.defineProperty(Error,"prepareStackTrace",{get(){return r},set(s){if(e.shouldBlock()){let i="Error.prepareStackTrace modification is blocked during script execution",o=e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",i);throw new vt(i,o)}e.config.auditMode&&Vt?.getStore()?.sandboxActive===!0&&e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),r=s},configurable:!0})}catch(n){console.debug("[DefenseInDepthBox] Could not protect Error.prepareStackTrace:",n instanceof Error?n.message:n)}}patchPrototypeConstructor(e,n,r){let s=this;try{let i=Object.getOwnPropertyDescriptor(e,"constructor");this.originalDescriptors.push({target:e,prop:"constructor",descriptor:i});let o=i?.value;Object.defineProperty(e,"constructor",{get(){if(s.shouldBlock()){let a=`${n} access is blocked during script execution`,l=s.recordViolation(r,n,a);throw new vt(a,l)}return s.config.auditMode&&Vt?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} accessed (audit mode)`),o},set(a){if(s.shouldBlock()){let l=`${n} modification is blocked during script execution`,c=s.recordViolation(r,n,l);throw new vt(l,c)}Object.defineProperty(this,"constructor",{value:a,writable:!0,configurable:!0})},configurable:!0})}catch(i){console.debug(`[DefenseInDepthBox] Could not patch ${n}:`,i instanceof Error?i.message:i)}}protectProcessMainModule(){if(typeof process>"u")return;let e=this;try{let n=Object.getOwnPropertyDescriptor(process,"mainModule");this.originalDescriptors.push({target:process,prop:"mainModule",descriptor:n});let r=n?.value;r!==void 0&&Object.defineProperty(process,"mainModule",{get(){if(e.shouldBlock()){let s="process.mainModule access is blocked during script execution",i=e.recordViolation("process_main_module","process.mainModule",s);throw new vt(s,i)}return e.config.auditMode&&Vt?.getStore()?.sandboxActive===!0&&e.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),r},set(s){if(e.shouldBlock()){let i="process.mainModule modification is blocked during script execution",o=e.recordViolation("process_main_module","process.mainModule",i);throw new vt(i,o)}Object.defineProperty(process,"mainModule",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(n){console.debug("[DefenseInDepthBox] Could not protect process.mainModule:",n instanceof Error?n.message:n)}}protectModuleLoad(){if(!ei)try{let e=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(e=o.constructor)}if(!e&&typeof ni<"u"&&typeof ni.main<"u"&&(e=ni.main.constructor),!e||typeof e._load!="function")return;let n=e._load,r=Object.getOwnPropertyDescriptor(e,"_load");this.originalDescriptors.push({target:e,prop:"_load",descriptor:r});let i=this.createBlockingProxy(n,"Module._load","module_load");Object.defineProperty(e,"_load",{value:i,writable:!0,configurable:!0})}catch(e){console.debug("[DefenseInDepthBox] Could not protect Module._load:",e instanceof Error?e.message:e)}}applyPatch(e){let{target:n,prop:r,violationType:s,strategy:i}=e;try{let o=n[r];if(o===void 0)return;let a=Object.getOwnPropertyDescriptor(n,r);if(this.originalDescriptors.push({target:n,prop:r,descriptor:a}),i==="freeze")typeof o=="object"&&o!==null&&Object.freeze(o);else{let l=this.getPathForTarget(n,r),c=typeof o=="function"?this.createBlockingProxy(o,l,s):this.createBlockingObjectProxy(o,l,s);Object.defineProperty(n,r,{value:c,writable:!0,configurable:!0})}}catch(o){let a=this.getPathForTarget(n,r);console.debug(`[DefenseInDepthBox] Could not patch ${a}:`,o instanceof Error?o.message:o)}}restorePatches(){for(let e=this.originalDescriptors.length-1;e>=0;e--){let{target:n,prop:r,descriptor:s}=this.originalDescriptors[e];try{s?Object.defineProperty(n,r,s):delete n[r]}catch(i){let o=this.getPathForTarget(n,r);console.debug(`[DefenseInDepthBox] Could not restore ${o}:`,i instanceof Error?i.message:i)}}this.originalDescriptors=[]}};oo();F();var $u=class{fs;commands=new Map;useDefaultLayout=!1;limits;secureFetch;sleepFn;traceFn;logger;defenseInDepthConfig;coverageWriter;state;constructor(e={}){let n=e.fs??new gr(e.files);this.fs=n,this.useDefaultLayout=!e.cwd&&!e.files;let r=e.cwd||(this.useDefaultLayout?"/home/user":"/"),s=new Map,i=[["HOME",this.useDefaultLayout?"/home/user":"/"],["PATH","/usr/bin:/bin"],["IFS",`
1455
+ `],["OSTYPE","linux-gnu"],["MACHTYPE","x86_64-pc-linux-gnu"],["HOSTTYPE","x86_64"],["HOSTNAME","localhost"],["PWD",r],["OLDPWD",r],["OPTIND","1"]];for(let[o,a]of i)T(s,o,a);for(let[o,a]of Object.entries(e.env??{}))T(s,o,a);if(this.limits=n7({...e.executionLimits,...e.maxCallDepth!==void 0&&{maxCallDepth:e.maxCallDepth},...e.maxCommandCount!==void 0&&{maxCommandCount:e.maxCommandCount},...e.maxLoopIterations!==void 0&&{maxLoopIterations:e.maxLoopIterations}}),e.network&&(this.secureFetch=Ou(e.network)),this.sleepFn=e.sleep,this.traceFn=e.trace,this.logger=e.logger,this.defenseInDepthConfig=e.defenseInDepth,this.coverageWriter=e.coverage,this.state={env:s,cwd:r,previousDir:"/home/user",functions:new Map,localScopes:[],callDepth:0,sourceDepth:0,commandCount:0,lastExitCode:0,lastArg:y,startTime:Date.now(),lastBackgroundPid:0,bashPid:Dn().pid,nextVirtualPid:Dn().pid+1,currentLine:1,options:{errexit:!1,pipefail:!1,nounset:!1,xtrace:!1,verbose:!1,posix:!1,allexport:!1,noclobber:!1,noglob:!1,noexec:!1,vi:!1,emacs:!1},shoptOptions:{extglob:!1,dotglob:!1,nullglob:!1,failglob:!1,globstar:!1,globskipdots:!0,nocaseglob:!1,nocasematch:!1,expand_aliases:!1,lastpipe:!1,xpg_echo:!1},inCondition:!1,loopDepth:0,exportedVars:new Set(["HOME","PATH","PWD","OLDPWD",...Object.keys(e.env||{})]),readonlyVars:new Set(["SHELLOPTS","BASHOPTS"]),hashTable:new Map},T(this.state.env,"SHELLOPTS",Hl(this.state.options)),T(this.state.env,"BASHOPTS",jl(this.state.shoptOptions)),mm(n,this.useDefaultLayout),r!=="/"&&n instanceof gr)try{n.mkdirSync(r,{recursive:!0})}catch{}for(let o of om(e.commands))this.registerCommand(o);if(e.network)for(let o of am())this.registerCommand(o);if(e.python)for(let o of lm())this.registerCommand(o);if(e.customCommands)for(let o of e.customCommands)cm(o)?this.registerCommand(um(o)):this.registerCommand(o)}registerCommand(e){this.commands.set(e.name,e);let n=this.fs;if(typeof n.writeFileSync=="function"){let r=`#!/bin/bash
1456
+ # Built-in command: ${e.name}
1457
+ `;try{n.writeFileSync(`/bin/${e.name}`,r)}catch{}try{n.writeFileSync(`/usr/bin/${e.name}`,r)}catch{}}}logResult(e){return this.logger&&(e.stdout.length>0&&this.logger.debug("stdout",{output:R(e.stdout)}),e.stderr.length>0&&this.logger.info("stderr",{output:R(e.stderr)}),this.logger.info("exit",{exitCode:e.exitCode})),e}async exec(e,n){if(this.state.callDepth===0&&(this.state.commandCount=0),this.state.commandCount++,this.state.commandCount>this.limits.maxCommandCount)return{stdout:y,stderr:x(`bash: maximum command count (${this.limits.maxCommandCount}) exceeded (possible infinite loop). Increase with executionLimits.maxCommandCount option.
1458
+ `),exitCode:1,env:pn(this.state.env,n?.env)};if(!e.trim())return{stdout:y,stderr:y,exitCode:0,env:pn(this.state.env,n?.env)};this.logger?.info("exec",{command:e});let r=n?.cwd??this.state.cwd,s,i=r;if(n?.cwd)if(n.env&&"PWD"in n.env)s=n.env.PWD;else if(n?.env&&!("PWD"in n.env))try{s=await this.fs.realpath(r),i=s}catch{s=r}else s=r;let o=new Map(this.state.env);if(n?.env)for(let[f,p]of Object.entries(n.env))T(o,f,p);s!==void 0&&T(o,"PWD",s);let a={...this.state,env:o,cwd:i,functions:new Map(this.state.functions),localScopes:[...this.state.localScopes],options:{...this.state.options},hashTable:this.state.hashTable,groupStdin:n?.stdin||void 0},l=e;n?.rawScript||(l=UA(e));let u=(this.defenseInDepthConfig?Xo.getInstance(this.defenseInDepthConfig):null)?.activate();try{let f=async()=>{let p=Cn(l),h={fs:this.fs,commands:this.commands,limits:this.limits,exec:this.exec.bind(this),fetch:this.secureFetch,sleep:this.sleepFn,trace:this.traceFn,coverage:this.coverageWriter},d=await new Xs(h,a).executeScript(p);return this.logResult(d)};return u?await u.run(f):await f()}catch(f){if(f instanceof Ee)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:f.exitCode,env:pn(this.state.env,n?.env)});if(f instanceof Yt)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:f.exitCode,env:pn(this.state.env,n?.env)});if(f instanceof Be)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:1,env:pn(this.state.env,n?.env)});if(f instanceof ae)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:ae.EXIT_CODE,env:pn(this.state.env,n?.env)});if(f instanceof vt)return this.logResult({stdout:y,stderr:x(`bash: security violation: ${f.message}
1459
+ `),exitCode:1,env:pn(this.state.env,n?.env)});if(f.name==="ParseException")return this.logResult({stdout:y,stderr:x(`bash: syntax error: ${f.message}
1460
+ `),exitCode:2,env:pn(this.state.env,n?.env)});if(f instanceof jn)return this.logResult({stdout:y,stderr:x(`bash: ${f.message}
1461
+ `),exitCode:2,env:pn(this.state.env,n?.env)});if(f instanceof RangeError)return this.logResult({stdout:y,stderr:x(`bash: ${f.message}
1462
+ `),exitCode:1,env:pn(this.state.env,n?.env)});throw f}finally{u?.deactivate()}}async readFile(e){return this.fs.readFile(this.fs.resolvePath(this.state.cwd,e))}async writeFile(e,n){return this.fs.writeFile(this.fs.resolvePath(this.state.cwd,e),n)}getCwd(){return this.state.cwd}getEnv(){return Rt(this.state.env)}};function UA(t){let e=t.split(`
1463
+ `),n=[],r=[];for(let s=0;s<e.length;s++){let i=e[s];if(r.length>0){let l=r[r.length-1];if((l.stripTabs?i.replace(/^\t+/,""):i)===l.delimiter){n.push(i.trimStart()),r.pop();continue}n.push(i);continue}let o=i.trimStart();n.push(o);let a=/<<(-?)\s*(['"]?)([\w-]+)\2/g;for(let l of o.matchAll(a)){let c=l[1]==="-",u=l[3];r.push({delimiter:u,stripTabs:c})}}return n.join(`
1464
+ `)}export{$u as Bash,gr as InMemoryFs,us as NetworkAccessDeniedError,ps as RedirectNotAllowedError,fs as TooManyRedirectsError,Wb as defineCommand,Ub as getCommandNames,Bb as getNetworkCommandNames};
1465
+ /*! Bundled license information:
1466
+
1467
+ re2js/build/index.esm.js:
1468
+ (*!
1469
+ * re2js
1470
+ * RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
1471
+ *
1472
+ * @version v1.2.1
1473
+ * @author Alexey Vasiliev
1474
+ * @homepage https://github.com/le0pard/re2js#readme
1475
+ * @repository github:le0pard/re2js
1476
+ * @license MIT
1477
+ *)
1478
+
1479
+ ieee754/index.js:
1480
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
1481
+ */