just-bash 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/README.md +6 -0
- package/dist/bin/chunks/awk2-EPZ2CEQT.js +3 -0
- package/dist/bin/chunks/base64-D7ZXJQN6.js +3 -0
- package/dist/bin/chunks/bash-4Q4RMIZL.js +3 -0
- package/dist/bin/chunks/cat-AST5Y57Y.js +3 -0
- package/dist/bin/chunks/chmod-BFP7P5CD.js +3 -0
- package/dist/bin/chunks/chunk-26O2G5LX.js +34 -0
- package/dist/bin/chunks/chunk-2RDKEB6Z.js +15 -0
- package/dist/bin/chunks/chunk-35U2THFB.js +3 -0
- package/dist/bin/chunks/chunk-3F7UWBEM.js +17 -0
- package/dist/bin/chunks/chunk-3WLAERUX.js +3 -0
- package/dist/bin/chunks/chunk-3WZIZUMC.js +8 -0
- package/dist/bin/chunks/chunk-4ARWO6Y3.js +4 -0
- package/dist/bin/chunks/chunk-4HVMRZ5N.js +8 -0
- package/dist/bin/chunks/chunk-5AS7PRVN.js +34 -0
- package/dist/bin/chunks/chunk-5GYAEVIB.js +10 -0
- package/dist/bin/chunks/chunk-5IPYW47P.js +27 -0
- package/dist/bin/chunks/chunk-5ZTIV6TI.js +20 -0
- package/dist/bin/chunks/chunk-6C2YS7G6.js +14 -0
- package/dist/bin/chunks/chunk-74MYVPDY.js +3 -0
- package/dist/bin/chunks/chunk-74UP5NWP.js +3 -0
- package/dist/bin/chunks/chunk-7DPD5PK3.js +3 -0
- package/dist/bin/chunks/chunk-7LJGZPVP.js +18 -0
- package/dist/bin/chunks/chunk-7NEXHFSS.js +3 -0
- package/dist/bin/chunks/chunk-7XFMCB5C.js +21 -0
- package/dist/bin/chunks/chunk-A53Y4KDG.js +7 -0
- package/dist/bin/chunks/chunk-AALAYQ6J.js +17 -0
- package/dist/bin/chunks/chunk-AM4WIHAG.js +10 -0
- package/dist/bin/chunks/chunk-BC5OXEFJ.js +3 -0
- package/dist/bin/chunks/chunk-C5ABXV4P.js +15 -0
- package/dist/bin/chunks/chunk-CT6P7ILU.js +3 -0
- package/dist/bin/chunks/chunk-CYHG3NVG.js +9 -0
- package/dist/bin/chunks/chunk-D7PDAJWE.js +7 -0
- package/dist/bin/chunks/chunk-DB3G3UVZ.js +5 -0
- package/dist/bin/chunks/chunk-EIUU35ZP.js +37 -0
- package/dist/bin/chunks/chunk-EMHJNKV5.js +20 -0
- package/dist/bin/chunks/chunk-EPWMLTS6.js +9 -0
- package/dist/bin/chunks/chunk-F4QFFLWZ.js +8 -0
- package/dist/bin/chunks/chunk-F5R5O2Y6.js +9 -0
- package/dist/bin/chunks/chunk-FBEYY2HM.js +13 -0
- package/dist/bin/chunks/chunk-FIJBWMXU.js +12 -0
- package/dist/bin/chunks/chunk-FMVH4N2P.js +5 -0
- package/dist/bin/chunks/chunk-G6W2HMNY.js +7 -0
- package/dist/bin/chunks/chunk-GFI5BHZX.js +3 -0
- package/dist/bin/chunks/chunk-GJAVHEWO.js +143 -0
- package/dist/bin/chunks/chunk-GUVSOVQU.js +8 -0
- package/dist/bin/chunks/chunk-H22PAKR6.js +3 -0
- package/dist/bin/chunks/chunk-HXOJHK2Z.js +8 -0
- package/dist/bin/chunks/chunk-IAAYIH44.js +3 -0
- package/dist/bin/chunks/chunk-J7W2CRXT.js +7 -0
- package/dist/bin/chunks/chunk-JNWWOKCN.js +6 -0
- package/dist/bin/chunks/chunk-JQLGE4OW.js +22 -0
- package/dist/bin/chunks/chunk-K3U4M4MF.js +7 -0
- package/dist/bin/chunks/chunk-KRXYOWIP.js +12 -0
- package/dist/bin/chunks/chunk-L4L2QFS4.js +10 -0
- package/dist/bin/chunks/chunk-LU6ZEQNN.js +13 -0
- package/dist/bin/chunks/chunk-MLMKRR7L.js +12 -0
- package/dist/bin/chunks/chunk-MVN5WALS.js +7 -0
- package/dist/bin/chunks/chunk-MYOGTYIH.js +22 -0
- package/dist/bin/chunks/chunk-NF5LHCVV.js +275 -0
- package/dist/bin/chunks/chunk-OUGDZVL6.js +10 -0
- package/dist/bin/chunks/chunk-QCNQD6ME.js +11 -0
- package/dist/bin/chunks/chunk-QIDBJNMB.js +3 -0
- package/dist/bin/chunks/chunk-QKTQYL37.js +9 -0
- package/dist/bin/chunks/chunk-R6CMNMNX.js +22 -0
- package/dist/bin/chunks/chunk-RCP3WQND.js +7 -0
- package/dist/bin/chunks/chunk-RJG4JS32.js +6 -0
- package/dist/bin/chunks/chunk-SIMSIBUA.js +13 -0
- package/dist/bin/chunks/chunk-TNB7M24H.js +87 -0
- package/dist/bin/chunks/chunk-TU6P6AC2.js +4 -0
- package/dist/bin/chunks/chunk-TX4WSLXK.js +101 -0
- package/dist/bin/chunks/chunk-U4UY6P77.js +3 -0
- package/dist/bin/chunks/chunk-U5BNATW4.js +3 -0
- package/dist/bin/chunks/chunk-U7VJCJQR.js +16 -0
- package/dist/bin/chunks/chunk-VJE2PQW6.js +15 -0
- package/dist/bin/chunks/chunk-W4ENG3BR.js +44 -0
- package/dist/bin/chunks/chunk-XUFO4QPW.js +65 -0
- package/dist/bin/chunks/chunk-XVKL2UZA.js +4 -0
- package/dist/bin/chunks/chunk-YCUNLSHF.js +12 -0
- package/dist/bin/chunks/chunk-YDH7Q5WV.js +6 -0
- package/dist/bin/chunks/chunk-YDWLU56G.js +26 -0
- package/dist/bin/chunks/chunk-YILPYZYP.js +16 -0
- package/dist/bin/chunks/chunk-YZQ4SVJV.js +13 -0
- package/dist/bin/chunks/chunk-ZKLKNN6B.js +3 -0
- package/dist/bin/chunks/column-EGAQ7QMC.js +3 -0
- package/dist/bin/chunks/comm-JEJ6GWEA.js +3 -0
- package/dist/bin/chunks/cp-7AH7TSQ6.js +3 -0
- package/dist/bin/chunks/curl-7FCZQCFU.js +31 -0
- package/dist/bin/chunks/cut-OVTLUT2B.js +3 -0
- package/dist/bin/chunks/date-MKP5YWWY.js +3 -0
- package/dist/bin/chunks/diff-R6QTSWD2.js +3 -0
- package/dist/bin/chunks/dist-Q3QP7DWN.js +141 -0
- package/dist/bin/chunks/du-M2PB5NUH.js +3 -0
- package/dist/bin/chunks/env-EUSAZGWO.js +3 -0
- package/dist/bin/chunks/expand-B4CPOZN5.js +3 -0
- package/dist/bin/chunks/expr-AQBMSEFL.js +3 -0
- package/dist/bin/chunks/file-22CVQBNS.js +3 -0
- package/dist/bin/chunks/find-QYLHUYOP.js +3 -0
- package/dist/bin/chunks/flag-coverage-CTPK5ZWJ.js +3 -0
- package/dist/bin/chunks/fold-E6A5I4DW.js +3 -0
- package/dist/bin/chunks/grep-HI55D7F7.js +3 -0
- package/dist/bin/chunks/gzip-2GJMVXCF.js +3 -0
- package/dist/bin/chunks/head-ZQIB2GSI.js +3 -0
- package/dist/bin/chunks/html-to-markdown-7ZNLM4SQ.js +3 -0
- package/dist/bin/chunks/join-KCYMLQ3V.js +3 -0
- package/dist/bin/chunks/jq-KNI4FJIL.js +3 -0
- package/dist/bin/chunks/js-exec-OWDAX677.js +1617 -0
- package/dist/bin/chunks/ls-QCAGDEDW.js +3 -0
- package/dist/bin/chunks/md5sum-OPJ77ZY7.js +3 -0
- package/dist/bin/chunks/mkdir-3XFSFVPC.js +3 -0
- package/dist/bin/chunks/mktemp-5FA55IJS.js +3 -0
- package/dist/bin/chunks/mv-UASF6NAX.js +3 -0
- package/dist/bin/chunks/nl-HUDE6DQC.js +3 -0
- package/dist/bin/chunks/od-CECQKF5P.js +3 -0
- package/dist/bin/chunks/paste-SH5RZ4ZO.js +3 -0
- package/dist/bin/chunks/printf-PQKUEWX5.js +3 -0
- package/dist/bin/chunks/python3-UE36ZXQT.js +23 -0
- package/dist/bin/chunks/readlink-4Z75K3AI.js +3 -0
- package/dist/bin/chunks/rev-6SA3VC3J.js +3 -0
- package/dist/bin/chunks/rg-ULWB5MQG.js +3 -0
- package/dist/bin/chunks/rm-NPIAQT6U.js +3 -0
- package/dist/bin/chunks/rmdir-57J3AGQU.js +3 -0
- package/dist/bin/chunks/sed-XV7BZPKI.js +3 -0
- package/dist/bin/chunks/seq-ZVBT2JEI.js +3 -0
- package/dist/bin/chunks/sha1sum-JGOB5K4J.js +3 -0
- package/dist/bin/chunks/sha256sum-S5DS6Q6N.js +3 -0
- package/dist/bin/chunks/sort-UOMFLGRW.js +3 -0
- package/dist/bin/chunks/split-IBL3NIVH.js +3 -0
- package/dist/bin/chunks/sqlite3-YIM3BYLS.js +3 -0
- package/dist/bin/chunks/stat-RKSIL4YV.js +3 -0
- package/dist/bin/chunks/strings-AL7T5GDQ.js +3 -0
- package/dist/bin/chunks/tac-36B6LBNS.js +3 -0
- package/dist/bin/chunks/tail-G4PLDIOK.js +3 -0
- package/dist/bin/chunks/tar-YG6SY2RU.js +3 -0
- package/dist/bin/chunks/tee-NP4ULCWD.js +3 -0
- package/dist/bin/chunks/time-ZMFJL7MD.js +3 -0
- package/dist/bin/chunks/timeout-EJIGKZUX.js +3 -0
- package/dist/bin/chunks/touch-YE5LMLLE.js +3 -0
- package/dist/bin/chunks/tr-7KFUMSUF.js +3 -0
- package/dist/bin/chunks/unexpand-67EBVEPB.js +3 -0
- package/dist/bin/chunks/uniq-SZDRNEYK.js +3 -0
- package/dist/bin/chunks/wc-VLOME6PL.js +3 -0
- package/dist/bin/chunks/xan-FVGJAHFV.js +3 -0
- package/dist/bin/chunks/xan-view-LYATQWQB.js +3 -0
- package/dist/bin/chunks/xargs-CLQL2WFV.js +3 -0
- package/dist/bin/chunks/yes-OOBLAITP.js +3 -0
- package/dist/bin/chunks/yq-YQ4YFM26.js +3 -0
- package/dist/bin/just-bash.js +347 -345
- package/dist/bin/shell/chunks/awk2-EPZ2CEQT.js +3 -0
- package/dist/bin/shell/chunks/base64-D7ZXJQN6.js +3 -0
- package/dist/bin/shell/chunks/bash-4Q4RMIZL.js +3 -0
- package/dist/bin/shell/chunks/cat-AST5Y57Y.js +3 -0
- package/dist/bin/shell/chunks/chmod-BFP7P5CD.js +3 -0
- package/dist/bin/shell/chunks/chunk-26O2G5LX.js +34 -0
- package/dist/bin/shell/chunks/chunk-2RDKEB6Z.js +15 -0
- package/dist/bin/shell/chunks/chunk-35U2THFB.js +3 -0
- package/dist/bin/shell/chunks/chunk-3F7UWBEM.js +17 -0
- package/dist/bin/shell/chunks/chunk-3WLAERUX.js +3 -0
- package/dist/bin/shell/chunks/chunk-3WZIZUMC.js +8 -0
- package/dist/bin/shell/chunks/chunk-4ARWO6Y3.js +4 -0
- package/dist/bin/shell/chunks/chunk-4HVMRZ5N.js +8 -0
- package/dist/bin/shell/chunks/chunk-5AS7PRVN.js +34 -0
- package/dist/bin/shell/chunks/chunk-5GYAEVIB.js +10 -0
- package/dist/bin/shell/chunks/chunk-5IPYW47P.js +27 -0
- package/dist/bin/shell/chunks/chunk-5ZTIV6TI.js +20 -0
- package/dist/bin/shell/chunks/chunk-6C2YS7G6.js +14 -0
- package/dist/bin/shell/chunks/chunk-74MYVPDY.js +3 -0
- package/dist/bin/shell/chunks/chunk-74UP5NWP.js +3 -0
- package/dist/bin/shell/chunks/chunk-7DPD5PK3.js +3 -0
- package/dist/bin/shell/chunks/chunk-7LJGZPVP.js +18 -0
- package/dist/bin/shell/chunks/chunk-7NEXHFSS.js +3 -0
- package/dist/bin/shell/chunks/chunk-7XFMCB5C.js +21 -0
- package/dist/bin/shell/chunks/chunk-A53Y4KDG.js +7 -0
- package/dist/bin/shell/chunks/chunk-AALAYQ6J.js +17 -0
- package/dist/bin/shell/chunks/chunk-AM4WIHAG.js +10 -0
- package/dist/bin/shell/chunks/chunk-BC5OXEFJ.js +3 -0
- package/dist/bin/shell/chunks/chunk-C5ABXV4P.js +15 -0
- package/dist/bin/shell/chunks/chunk-CT6P7ILU.js +3 -0
- package/dist/bin/shell/chunks/chunk-CYHG3NVG.js +9 -0
- package/dist/bin/shell/chunks/chunk-D7PDAJWE.js +7 -0
- package/dist/bin/shell/chunks/chunk-DB3G3UVZ.js +5 -0
- package/dist/bin/shell/chunks/chunk-EIUU35ZP.js +37 -0
- package/dist/bin/shell/chunks/chunk-EMHJNKV5.js +20 -0
- package/dist/bin/shell/chunks/chunk-EPWMLTS6.js +9 -0
- package/dist/bin/shell/chunks/chunk-F4QFFLWZ.js +8 -0
- package/dist/bin/shell/chunks/chunk-F5R5O2Y6.js +9 -0
- package/dist/bin/shell/chunks/chunk-FBEYY2HM.js +13 -0
- package/dist/bin/shell/chunks/chunk-FIJBWMXU.js +12 -0
- package/dist/bin/shell/chunks/chunk-FMVH4N2P.js +5 -0
- package/dist/bin/shell/chunks/chunk-G6W2HMNY.js +7 -0
- package/dist/bin/shell/chunks/chunk-GFI5BHZX.js +3 -0
- package/dist/bin/shell/chunks/chunk-GJAVHEWO.js +143 -0
- package/dist/bin/shell/chunks/chunk-GUVSOVQU.js +8 -0
- package/dist/bin/shell/chunks/chunk-H22PAKR6.js +3 -0
- package/dist/bin/shell/chunks/chunk-HXOJHK2Z.js +8 -0
- package/dist/bin/shell/chunks/chunk-IAAYIH44.js +3 -0
- package/dist/bin/shell/chunks/chunk-J7W2CRXT.js +7 -0
- package/dist/bin/shell/chunks/chunk-JNWWOKCN.js +6 -0
- package/dist/bin/shell/chunks/chunk-JQLGE4OW.js +22 -0
- package/dist/bin/shell/chunks/chunk-K3U4M4MF.js +7 -0
- package/dist/bin/shell/chunks/chunk-KRXYOWIP.js +12 -0
- package/dist/bin/shell/chunks/chunk-L4L2QFS4.js +10 -0
- package/dist/bin/shell/chunks/chunk-LU6ZEQNN.js +13 -0
- package/dist/bin/shell/chunks/chunk-MLMKRR7L.js +12 -0
- package/dist/bin/shell/chunks/chunk-MVN5WALS.js +7 -0
- package/dist/bin/shell/chunks/chunk-MYOGTYIH.js +22 -0
- package/dist/bin/shell/chunks/chunk-NF5LHCVV.js +275 -0
- package/dist/bin/shell/chunks/chunk-OUGDZVL6.js +10 -0
- package/dist/bin/shell/chunks/chunk-QCNQD6ME.js +11 -0
- package/dist/bin/shell/chunks/chunk-QIDBJNMB.js +3 -0
- package/dist/bin/shell/chunks/chunk-QKTQYL37.js +9 -0
- package/dist/bin/shell/chunks/chunk-R6CMNMNX.js +22 -0
- package/dist/bin/shell/chunks/chunk-RCP3WQND.js +7 -0
- package/dist/bin/shell/chunks/chunk-RJG4JS32.js +6 -0
- package/dist/bin/shell/chunks/chunk-SIMSIBUA.js +13 -0
- package/dist/bin/shell/chunks/chunk-TNB7M24H.js +87 -0
- package/dist/bin/shell/chunks/chunk-TU6P6AC2.js +4 -0
- package/dist/bin/shell/chunks/chunk-TX4WSLXK.js +101 -0
- package/dist/bin/shell/chunks/chunk-U4UY6P77.js +3 -0
- package/dist/bin/shell/chunks/chunk-U5BNATW4.js +3 -0
- package/dist/bin/shell/chunks/chunk-U7VJCJQR.js +16 -0
- package/dist/bin/shell/chunks/chunk-VJE2PQW6.js +15 -0
- package/dist/bin/shell/chunks/chunk-W4ENG3BR.js +44 -0
- package/dist/bin/shell/chunks/chunk-XUFO4QPW.js +65 -0
- package/dist/bin/shell/chunks/chunk-XVKL2UZA.js +4 -0
- package/dist/bin/shell/chunks/chunk-YCUNLSHF.js +12 -0
- package/dist/bin/shell/chunks/chunk-YDH7Q5WV.js +6 -0
- package/dist/bin/shell/chunks/chunk-YDWLU56G.js +26 -0
- package/dist/bin/shell/chunks/chunk-YILPYZYP.js +16 -0
- package/dist/bin/shell/chunks/chunk-YZQ4SVJV.js +13 -0
- package/dist/bin/shell/chunks/chunk-ZKLKNN6B.js +3 -0
- package/dist/bin/shell/chunks/column-EGAQ7QMC.js +3 -0
- package/dist/bin/shell/chunks/comm-JEJ6GWEA.js +3 -0
- package/dist/bin/shell/chunks/cp-7AH7TSQ6.js +3 -0
- package/dist/bin/shell/chunks/curl-7FCZQCFU.js +31 -0
- package/dist/bin/shell/chunks/cut-OVTLUT2B.js +3 -0
- package/dist/bin/shell/chunks/date-MKP5YWWY.js +3 -0
- package/dist/bin/shell/chunks/diff-R6QTSWD2.js +3 -0
- package/dist/bin/shell/chunks/dist-Q3QP7DWN.js +141 -0
- package/dist/bin/shell/chunks/du-M2PB5NUH.js +3 -0
- package/dist/bin/shell/chunks/env-EUSAZGWO.js +3 -0
- package/dist/bin/shell/chunks/expand-B4CPOZN5.js +3 -0
- package/dist/bin/shell/chunks/expr-AQBMSEFL.js +3 -0
- package/dist/bin/shell/chunks/file-22CVQBNS.js +3 -0
- package/dist/bin/shell/chunks/find-QYLHUYOP.js +3 -0
- package/dist/bin/shell/chunks/flag-coverage-CTPK5ZWJ.js +3 -0
- package/dist/bin/shell/chunks/fold-E6A5I4DW.js +3 -0
- package/dist/bin/shell/chunks/grep-HI55D7F7.js +3 -0
- package/dist/bin/shell/chunks/gzip-2GJMVXCF.js +3 -0
- package/dist/bin/shell/chunks/head-ZQIB2GSI.js +3 -0
- package/dist/bin/shell/chunks/html-to-markdown-7ZNLM4SQ.js +3 -0
- package/dist/bin/shell/chunks/join-KCYMLQ3V.js +3 -0
- package/dist/bin/shell/chunks/jq-KNI4FJIL.js +3 -0
- package/dist/bin/shell/chunks/js-exec-OWDAX677.js +1617 -0
- package/dist/bin/shell/chunks/ls-QCAGDEDW.js +3 -0
- package/dist/bin/shell/chunks/md5sum-OPJ77ZY7.js +3 -0
- package/dist/bin/shell/chunks/mkdir-3XFSFVPC.js +3 -0
- package/dist/bin/shell/chunks/mktemp-5FA55IJS.js +3 -0
- package/dist/bin/shell/chunks/mv-UASF6NAX.js +3 -0
- package/dist/bin/shell/chunks/nl-HUDE6DQC.js +3 -0
- package/dist/bin/shell/chunks/od-CECQKF5P.js +3 -0
- package/dist/bin/shell/chunks/paste-SH5RZ4ZO.js +3 -0
- package/dist/bin/shell/chunks/printf-PQKUEWX5.js +3 -0
- package/dist/bin/shell/chunks/python3-UE36ZXQT.js +23 -0
- package/dist/bin/shell/chunks/readlink-4Z75K3AI.js +3 -0
- package/dist/bin/shell/chunks/rev-6SA3VC3J.js +3 -0
- package/dist/bin/shell/chunks/rg-ULWB5MQG.js +3 -0
- package/dist/bin/shell/chunks/rm-NPIAQT6U.js +3 -0
- package/dist/bin/shell/chunks/rmdir-57J3AGQU.js +3 -0
- package/dist/bin/shell/chunks/sed-XV7BZPKI.js +3 -0
- package/dist/bin/shell/chunks/seq-ZVBT2JEI.js +3 -0
- package/dist/bin/shell/chunks/sha1sum-JGOB5K4J.js +3 -0
- package/dist/bin/shell/chunks/sha256sum-S5DS6Q6N.js +3 -0
- package/dist/bin/shell/chunks/sort-UOMFLGRW.js +3 -0
- package/dist/bin/shell/chunks/split-IBL3NIVH.js +3 -0
- package/dist/bin/shell/chunks/sqlite3-YIM3BYLS.js +3 -0
- package/dist/bin/shell/chunks/stat-RKSIL4YV.js +3 -0
- package/dist/bin/shell/chunks/strings-AL7T5GDQ.js +3 -0
- package/dist/bin/shell/chunks/tac-36B6LBNS.js +3 -0
- package/dist/bin/shell/chunks/tail-G4PLDIOK.js +3 -0
- package/dist/bin/shell/chunks/tar-YG6SY2RU.js +3 -0
- package/dist/bin/shell/chunks/tee-NP4ULCWD.js +3 -0
- package/dist/bin/shell/chunks/time-ZMFJL7MD.js +3 -0
- package/dist/bin/shell/chunks/timeout-EJIGKZUX.js +3 -0
- package/dist/bin/shell/chunks/touch-YE5LMLLE.js +3 -0
- package/dist/bin/shell/chunks/tr-7KFUMSUF.js +3 -0
- package/dist/bin/shell/chunks/unexpand-67EBVEPB.js +3 -0
- package/dist/bin/shell/chunks/uniq-SZDRNEYK.js +3 -0
- package/dist/bin/shell/chunks/wc-VLOME6PL.js +3 -0
- package/dist/bin/shell/chunks/xan-FVGJAHFV.js +3 -0
- package/dist/bin/shell/chunks/xan-view-LYATQWQB.js +3 -0
- package/dist/bin/shell/chunks/xargs-CLQL2WFV.js +3 -0
- package/dist/bin/shell/chunks/yes-OOBLAITP.js +3 -0
- package/dist/bin/shell/chunks/yq-YQ4YFM26.js +3 -0
- package/dist/bin/shell/shell.js +385 -383
- package/dist/bundle/browser.js +873 -863
- package/dist/bundle/chunks/awk2-LEEKKBPN.js +2 -0
- package/dist/bundle/chunks/base64-GBEVK7UP.js +2 -0
- package/dist/bundle/chunks/bash-QTX2IUM4.js +2 -0
- package/dist/bundle/chunks/cat-UBR2ABBH.js +2 -0
- package/dist/bundle/chunks/chmod-5VBARXGU.js +2 -0
- package/dist/bundle/chunks/chunk-2LOOLBWC.js +33 -0
- package/dist/bundle/chunks/chunk-34XJ6PLO.js +20 -0
- package/dist/bundle/chunks/chunk-3DUKINTI.js +7 -0
- package/dist/bundle/chunks/chunk-3VXY25LY.js +2 -0
- package/dist/bundle/chunks/chunk-5G2D2EZB.js +7 -0
- package/dist/bundle/chunks/chunk-5Q4R6KJE.js +4 -0
- package/dist/bundle/chunks/chunk-5ZVTEBKG.js +7 -0
- package/dist/bundle/chunks/chunk-77XFWF43.js +13 -0
- package/dist/bundle/chunks/chunk-B2EYYRZX.js +9 -0
- package/dist/bundle/chunks/chunk-BC3VKZCL.js +10 -0
- package/dist/bundle/chunks/chunk-BEIP3OYT.js +6 -0
- package/dist/bundle/chunks/chunk-BLTFJFWH.js +2 -0
- package/dist/bundle/chunks/chunk-C2GCPQ2D.js +15 -0
- package/dist/bundle/chunks/chunk-CGCA7SGA.js +25 -0
- package/dist/bundle/chunks/chunk-CIY4XCGA.js +2 -0
- package/dist/bundle/chunks/chunk-CXBOPNEG.js +11 -0
- package/dist/bundle/chunks/chunk-CYJQAYUX.js +142 -0
- package/dist/bundle/chunks/chunk-D55UUXDJ.js +100 -0
- package/dist/bundle/chunks/chunk-EOMWWW4L.js +33 -0
- package/dist/bundle/chunks/chunk-ER6ZGLPS.js +26 -0
- package/dist/bundle/chunks/chunk-EZHC6HLV.js +3 -0
- package/dist/bundle/chunks/chunk-FBRDM6EM.js +12 -0
- package/dist/bundle/chunks/chunk-FDAXSABU.js +11 -0
- package/dist/bundle/chunks/chunk-FEKEA5Y2.js +2 -0
- package/dist/bundle/chunks/chunk-GEANXVKK.js +15 -0
- package/dist/bundle/chunks/chunk-GIQ3LRFL.js +21 -0
- package/dist/bundle/chunks/chunk-HBIJBKHP.js +14 -0
- package/dist/bundle/chunks/chunk-IDYF47VD.js +11 -0
- package/dist/bundle/chunks/chunk-IH6MZAKK.js +6 -0
- package/dist/bundle/chunks/chunk-IIWAWB3H.js +274 -0
- package/dist/bundle/chunks/chunk-IQGNPH54.js +8 -0
- package/dist/bundle/chunks/chunk-IVYY6YFV.js +7 -0
- package/dist/bundle/chunks/chunk-IXOG2DXK.js +14 -0
- package/dist/bundle/chunks/chunk-J6QAN4PZ.js +6 -0
- package/dist/bundle/chunks/chunk-JMGGZYF2.js +2 -0
- package/dist/bundle/chunks/chunk-JU5GJH4X.js +9 -0
- package/dist/bundle/chunks/chunk-JWGTQTBU.js +16 -0
- package/dist/bundle/chunks/chunk-KQSMX4HM.js +11 -0
- package/dist/bundle/chunks/chunk-KZMK2KYL.js +43 -0
- package/dist/bundle/chunks/chunk-L4MC7WH4.js +14 -0
- package/dist/bundle/chunks/chunk-L5AKA7GO.js +5 -0
- package/dist/bundle/chunks/chunk-LBKOJW6K.js +2 -0
- package/dist/bundle/chunks/chunk-LNJ6EIKX.js +2 -0
- package/dist/bundle/chunks/chunk-LQXMSLW5.js +16 -0
- package/dist/bundle/chunks/chunk-MOOFDAFS.js +7 -0
- package/dist/bundle/chunks/chunk-N3VQQRLQ.js +8 -0
- package/dist/bundle/chunks/chunk-NJUHQKMR.js +3 -0
- package/dist/bundle/chunks/chunk-NOZTFL4F.js +12 -0
- package/dist/bundle/chunks/chunk-OEZKBUXP.js +8 -0
- package/dist/bundle/chunks/chunk-OZMQI3HV.js +17 -0
- package/dist/bundle/chunks/chunk-POI4XBDP.js +6 -0
- package/dist/bundle/chunks/chunk-PV2DCWLJ.js +6 -0
- package/dist/bundle/chunks/chunk-Q6ZH76O4.js +2 -0
- package/dist/bundle/chunks/chunk-QECDICRF.js +9 -0
- package/dist/bundle/chunks/chunk-QJTRVYQA.js +5 -0
- package/dist/bundle/chunks/chunk-QZPG6UCH.js +9 -0
- package/dist/bundle/chunks/chunk-R23EAHN5.js +2 -0
- package/dist/bundle/chunks/chunk-R3HY2GCO.js +3 -0
- package/dist/bundle/chunks/chunk-RQTEROQ5.js +6 -0
- package/dist/bundle/chunks/chunk-SAE7VUIM.js +21 -0
- package/dist/bundle/chunks/chunk-SBG7KYI4.js +12 -0
- package/dist/bundle/chunks/chunk-SRNYBHIU.js +21 -0
- package/dist/bundle/chunks/chunk-T7CFNHX6.js +2 -0
- package/dist/bundle/chunks/chunk-U3UTFNHI.js +2 -0
- package/dist/bundle/chunks/chunk-UQZ5HJXB.js +64 -0
- package/dist/bundle/chunks/chunk-US6XQQ6W.js +19 -0
- package/dist/bundle/chunks/chunk-UZ4TKNEJ.js +2 -0
- package/dist/bundle/chunks/chunk-VW6FDS6X.js +2 -0
- package/dist/bundle/chunks/chunk-W4A6TADR.js +36 -0
- package/dist/bundle/chunks/chunk-WAL3MOLR.js +6 -0
- package/dist/bundle/chunks/chunk-WFEUQRHM.js +2 -0
- package/dist/bundle/chunks/chunk-WNAEYQTE.js +8 -0
- package/dist/bundle/chunks/chunk-WOSSFIAE.js +12 -0
- package/dist/bundle/chunks/chunk-WTG3OCY4.js +5 -0
- package/dist/bundle/chunks/chunk-XIEMQVCO.js +19 -0
- package/dist/bundle/chunks/chunk-YFGP6M45.js +7 -0
- package/dist/bundle/chunks/chunk-ZARLSKBF.js +2 -0
- package/dist/bundle/chunks/chunk-ZVANIJV2.js +4 -0
- package/dist/bundle/chunks/column-46NX3HG3.js +2 -0
- package/dist/bundle/chunks/comm-QHEYSM4I.js +2 -0
- package/dist/bundle/chunks/cp-AQ4Y4WVV.js +2 -0
- package/dist/bundle/chunks/curl-LMCQFYWH.js +30 -0
- package/dist/bundle/chunks/cut-A6NXJGOH.js +2 -0
- package/dist/bundle/chunks/date-YMEJ62OQ.js +2 -0
- package/dist/bundle/chunks/diff-SECJC7CN.js +2 -0
- package/dist/bundle/chunks/du-JOLY42MC.js +2 -0
- package/dist/bundle/chunks/env-MI6QVNMM.js +2 -0
- package/dist/bundle/chunks/expand-YVEZTU7W.js +2 -0
- package/dist/bundle/chunks/expr-U7WETT5R.js +2 -0
- package/dist/bundle/chunks/file-6QDI3H7G.js +2 -0
- package/dist/bundle/chunks/find-UYQIFSZI.js +2 -0
- package/dist/bundle/chunks/flag-coverage-5YCE6ILG.js +2 -0
- package/dist/bundle/chunks/fold-A24KLKHY.js +2 -0
- package/dist/bundle/chunks/grep-ZELVZ7JB.js +2 -0
- package/dist/bundle/chunks/gzip-3IFADYVU.js +2 -0
- package/dist/bundle/chunks/head-5YWCKNNQ.js +2 -0
- package/dist/bundle/chunks/html-to-markdown-EOWI2I5J.js +2 -0
- package/dist/bundle/chunks/join-MSZXRLNV.js +2 -0
- package/dist/bundle/chunks/jq-MKA6BDYV.js +2 -0
- package/dist/bundle/chunks/js-exec-CNDWLKWB.js +1616 -0
- package/dist/bundle/chunks/ls-WMN4WCCI.js +2 -0
- package/dist/bundle/chunks/md5sum-OCX4NZ2Q.js +2 -0
- package/dist/bundle/chunks/mkdir-YJMG55FX.js +2 -0
- package/dist/bundle/chunks/mktemp-RA55VAN3.js +2 -0
- package/dist/bundle/chunks/mv-NTJL2AHI.js +2 -0
- package/dist/bundle/chunks/nl-Z5DVHZ3S.js +2 -0
- package/dist/bundle/chunks/od-TRWBMEIO.js +2 -0
- package/dist/bundle/chunks/paste-VPYCLIL6.js +2 -0
- package/dist/bundle/chunks/printf-BNADL4RX.js +2 -0
- package/dist/bundle/chunks/python3-TIKLWPZJ.js +22 -0
- package/dist/bundle/chunks/readlink-HGACDFRD.js +2 -0
- package/dist/bundle/chunks/rev-W57N4M5B.js +2 -0
- package/dist/bundle/chunks/rg-IN3KT335.js +2 -0
- package/dist/bundle/chunks/rm-CDVWO5CO.js +2 -0
- package/dist/bundle/chunks/rmdir-HI3UE4KQ.js +2 -0
- package/dist/bundle/chunks/sed-MXZDFQ7I.js +2 -0
- package/dist/bundle/chunks/seq-E3UP3G65.js +2 -0
- package/dist/bundle/chunks/sha1sum-QUWYL7G6.js +2 -0
- package/dist/bundle/chunks/sha256sum-FGHIABMA.js +2 -0
- package/dist/bundle/chunks/sort-ATCMEITA.js +2 -0
- package/dist/bundle/chunks/split-YZFCWIZI.js +2 -0
- package/dist/bundle/chunks/sqlite3-JL36RFBZ.js +2 -0
- package/dist/bundle/chunks/stat-APUQD6WQ.js +2 -0
- package/dist/bundle/chunks/strings-WA2ZGNUN.js +2 -0
- package/dist/bundle/chunks/tac-OCV6R4TG.js +2 -0
- package/dist/bundle/chunks/tail-IBKQAMFW.js +2 -0
- package/dist/bundle/chunks/tar-WJV4DGKA.js +2 -0
- package/dist/bundle/chunks/tee-VOXQ2UGV.js +2 -0
- package/dist/bundle/chunks/time-GOHAC6VO.js +2 -0
- package/dist/bundle/chunks/timeout-FVGYB3MD.js +2 -0
- package/dist/bundle/chunks/touch-57OKADDG.js +2 -0
- package/dist/bundle/chunks/tr-M4D6SICQ.js +2 -0
- package/dist/bundle/chunks/unexpand-SYZZ5ZBE.js +2 -0
- package/dist/bundle/chunks/uniq-TUUUYPVF.js +2 -0
- package/dist/bundle/chunks/wc-HQPGW3KR.js +2 -0
- package/dist/bundle/chunks/xan-CZJZCC57.js +2 -0
- package/dist/bundle/chunks/xan-view-HETEUD3G.js +2 -0
- package/dist/bundle/chunks/xargs-WFPZZ3FK.js +2 -0
- package/dist/bundle/chunks/yes-ACSNSE7T.js +2 -0
- package/dist/bundle/chunks/yq-XDJLIJPZ.js +2 -0
- package/dist/bundle/index.cjs +1042 -993
- package/dist/bundle/index.js +345 -343
- package/dist/commands/awk/interpreter/fields.d.ts +16 -0
- package/dist/commands/js-exec/module-shims.d.ts +1 -1
- package/dist/commands/rg/rg-options.d.ts +2 -0
- package/dist/commands/search-engine/matcher.d.ts +2 -0
- package/dist/interpreter/builtin-dispatch.d.ts +9 -3
- package/dist/interpreter/fd-table.d.ts +4 -1
- package/dist/interpreter/helpers/errors.d.ts +5 -0
- package/dist/interpreter/pipeline-execution.d.ts +1 -1
- package/dist/interpreter/redirections.d.ts +25 -10
- package/dist/interpreter/types.d.ts +2 -0
- package/dist/types.d.ts +15 -0
- package/dist/utils/string-builder.d.ts +9 -0
- package/package.json +2 -2
- package/dist/bin/chunks/awk2-U22OR5B5.js +0 -3
- package/dist/bin/chunks/base64-2KKH5BCT.js +0 -3
- package/dist/bin/chunks/bash-CFCBBWVH.js +0 -3
- package/dist/bin/chunks/cat-V45MVNBT.js +0 -3
- package/dist/bin/chunks/chmod-A54R4UUQ.js +0 -3
- package/dist/bin/chunks/chunk-2NJJXU4K.js +0 -27
- package/dist/bin/chunks/chunk-2YLY6FJA.js +0 -10
- package/dist/bin/chunks/chunk-3LKMI5IX.js +0 -34
- package/dist/bin/chunks/chunk-3VSWQCPN.js +0 -18
- package/dist/bin/chunks/chunk-44SKMHU6.js +0 -16
- package/dist/bin/chunks/chunk-5SKEZPTU.js +0 -12
- package/dist/bin/chunks/chunk-5SR55TXB.js +0 -16
- package/dist/bin/chunks/chunk-6D75E4LV.js +0 -3
- package/dist/bin/chunks/chunk-6DAR25KN.js +0 -12
- package/dist/bin/chunks/chunk-6SAZRW7E.js +0 -15
- package/dist/bin/chunks/chunk-723HNGID.js +0 -13
- package/dist/bin/chunks/chunk-7FGDUBSN.js +0 -14
- package/dist/bin/chunks/chunk-7X4QBCFW.js +0 -36
- package/dist/bin/chunks/chunk-AINNAQBQ.js +0 -6
- package/dist/bin/chunks/chunk-AL7RVSF4.js +0 -8
- package/dist/bin/chunks/chunk-ARYCSNJJ.js +0 -101
- package/dist/bin/chunks/chunk-BCJ42NCM.js +0 -15
- package/dist/bin/chunks/chunk-BJF6B4YW.js +0 -22
- package/dist/bin/chunks/chunk-BOXG6XBN.js +0 -143
- package/dist/bin/chunks/chunk-CPKBPQ2C.js +0 -3
- package/dist/bin/chunks/chunk-DA3RFNKK.js +0 -17
- package/dist/bin/chunks/chunk-DH7M46D3.js +0 -20
- package/dist/bin/chunks/chunk-DTGQQKI2.js +0 -87
- package/dist/bin/chunks/chunk-ECZAFQ22.js +0 -9
- package/dist/bin/chunks/chunk-ETWDDV6I.js +0 -10
- package/dist/bin/chunks/chunk-HFW2LXQV.js +0 -13
- package/dist/bin/chunks/chunk-HRKG3ZK2.js +0 -8
- package/dist/bin/chunks/chunk-I4IRHQDW.js +0 -3
- package/dist/bin/chunks/chunk-IKUY74NG.js +0 -3
- package/dist/bin/chunks/chunk-ILXMFIYG.js +0 -7
- package/dist/bin/chunks/chunk-IMVXTSPG.js +0 -275
- package/dist/bin/chunks/chunk-ISW2U76N.js +0 -17
- package/dist/bin/chunks/chunk-K5KT6DMM.js +0 -4
- package/dist/bin/chunks/chunk-KG2KXL4Y.js +0 -3
- package/dist/bin/chunks/chunk-LCP3IKI7.js +0 -9
- package/dist/bin/chunks/chunk-LG6IN6SW.js +0 -34
- package/dist/bin/chunks/chunk-LMFAALLO.js +0 -21
- package/dist/bin/chunks/chunk-LXFMIXGA.js +0 -3
- package/dist/bin/chunks/chunk-M5ZBECGM.js +0 -22
- package/dist/bin/chunks/chunk-MA6BMA4M.js +0 -3
- package/dist/bin/chunks/chunk-MPQMTLXN.js +0 -3
- package/dist/bin/chunks/chunk-MUIYG2RB.js +0 -65
- package/dist/bin/chunks/chunk-MYTNZ7MA.js +0 -7
- package/dist/bin/chunks/chunk-NGMFI3RH.js +0 -15
- package/dist/bin/chunks/chunk-NLMTGTSG.js +0 -11
- package/dist/bin/chunks/chunk-O74FSWB4.js +0 -4
- package/dist/bin/chunks/chunk-OBVTFHVP.js +0 -7
- package/dist/bin/chunks/chunk-OOKVPG5D.js +0 -6
- package/dist/bin/chunks/chunk-PL4EU7Y2.js +0 -3
- package/dist/bin/chunks/chunk-Q3LE3Y66.js +0 -13
- package/dist/bin/chunks/chunk-QCGH2ZOW.js +0 -13
- package/dist/bin/chunks/chunk-QKWMWSV3.js +0 -3
- package/dist/bin/chunks/chunk-QL33F2W6.js +0 -8
- package/dist/bin/chunks/chunk-S5Z7DMIE.js +0 -26
- package/dist/bin/chunks/chunk-SQ7SZZMW.js +0 -8
- package/dist/bin/chunks/chunk-SQUH76NP.js +0 -3
- package/dist/bin/chunks/chunk-TGRZ42DS.js +0 -12
- package/dist/bin/chunks/chunk-THTKNRO6.js +0 -7
- package/dist/bin/chunks/chunk-TQXLQEIT.js +0 -9
- package/dist/bin/chunks/chunk-TZ3S7MY6.js +0 -12
- package/dist/bin/chunks/chunk-U6BXPMLD.js +0 -7
- package/dist/bin/chunks/chunk-U6DBRMD5.js +0 -5
- package/dist/bin/chunks/chunk-URRH3GPG.js +0 -10
- package/dist/bin/chunks/chunk-VBU3UEG5.js +0 -7
- package/dist/bin/chunks/chunk-VLWZ6L7C.js +0 -4
- package/dist/bin/chunks/chunk-VTHA5UK5.js +0 -7
- package/dist/bin/chunks/chunk-WBST7XJW.js +0 -9
- package/dist/bin/chunks/chunk-WDV2ECOC.js +0 -3
- package/dist/bin/chunks/chunk-WEQ5WM2M.js +0 -20
- package/dist/bin/chunks/chunk-WFVCEB5T.js +0 -3
- package/dist/bin/chunks/chunk-WZ7MIBLR.js +0 -37
- package/dist/bin/chunks/chunk-X45GP3AQ.js +0 -3
- package/dist/bin/chunks/chunk-XEQ7KSRM.js +0 -5
- package/dist/bin/chunks/chunk-YIANER7Y.js +0 -8
- package/dist/bin/chunks/chunk-YYZSYLJO.js +0 -6
- package/dist/bin/chunks/chunk-Z3KAV6YJ.js +0 -10
- package/dist/bin/chunks/chunk-Z5KICK5X.js +0 -22
- package/dist/bin/chunks/column-LHHS4D3K.js +0 -3
- package/dist/bin/chunks/comm-URDMZCXL.js +0 -3
- package/dist/bin/chunks/cp-HPLQA35N.js +0 -3
- package/dist/bin/chunks/curl-FIRG3RB6.js +0 -31
- package/dist/bin/chunks/cut-KP3S36XS.js +0 -3
- package/dist/bin/chunks/date-FJUBX7TJ.js +0 -3
- package/dist/bin/chunks/diff-JSJ56EOK.js +0 -3
- package/dist/bin/chunks/dist-4NZ74CRE.js +0 -141
- package/dist/bin/chunks/du-WEF5YWQK.js +0 -3
- package/dist/bin/chunks/env-2TSVF4W7.js +0 -3
- package/dist/bin/chunks/expand-P6SNTBGZ.js +0 -3
- package/dist/bin/chunks/expr-FLWT4OCO.js +0 -3
- package/dist/bin/chunks/file-JLUCGBCB.js +0 -3
- package/dist/bin/chunks/find-XGVQ6N6L.js +0 -3
- package/dist/bin/chunks/flag-coverage-4JYKIAVV.js +0 -3
- package/dist/bin/chunks/fold-YEY7X54W.js +0 -3
- package/dist/bin/chunks/grep-DCPCPQOS.js +0 -3
- package/dist/bin/chunks/gzip-6DZIKNBW.js +0 -3
- package/dist/bin/chunks/head-TLFXMM2T.js +0 -3
- package/dist/bin/chunks/html-to-markdown-E22RLT2U.js +0 -3
- package/dist/bin/chunks/join-UQKXU2QP.js +0 -3
- package/dist/bin/chunks/jq-GDM3OBBK.js +0 -3
- package/dist/bin/chunks/js-exec-VU6F6WLS.js +0 -1578
- package/dist/bin/chunks/ls-67NUUIYT.js +0 -3
- package/dist/bin/chunks/md5sum-Z6KAYGDK.js +0 -3
- package/dist/bin/chunks/mkdir-AWDWRBKC.js +0 -3
- package/dist/bin/chunks/mktemp-L6OGMDUO.js +0 -3
- package/dist/bin/chunks/mv-4BJSOT4Y.js +0 -3
- package/dist/bin/chunks/nl-XHWFVVKH.js +0 -3
- package/dist/bin/chunks/od-SI75GLRE.js +0 -3
- package/dist/bin/chunks/paste-5TSIBDF7.js +0 -3
- package/dist/bin/chunks/printf-CNXNRQ3I.js +0 -3
- package/dist/bin/chunks/python3-GUWCSSDP.js +0 -23
- package/dist/bin/chunks/readlink-URO5XTBB.js +0 -3
- package/dist/bin/chunks/rev-CZTQCNOZ.js +0 -3
- package/dist/bin/chunks/rg-RVULUPDH.js +0 -3
- package/dist/bin/chunks/rm-UCUTHC3I.js +0 -3
- package/dist/bin/chunks/rmdir-J3HM7GGM.js +0 -3
- package/dist/bin/chunks/sed-MCLGHZOI.js +0 -3
- package/dist/bin/chunks/seq-I54NZE75.js +0 -3
- package/dist/bin/chunks/sha1sum-CATBXX76.js +0 -3
- package/dist/bin/chunks/sha256sum-YGSNBVY3.js +0 -3
- package/dist/bin/chunks/sort-M3DO25D5.js +0 -3
- package/dist/bin/chunks/split-VZO7223N.js +0 -3
- package/dist/bin/chunks/sqlite3-HXVFVP4Z.js +0 -3
- package/dist/bin/chunks/stat-UJ37RBMM.js +0 -3
- package/dist/bin/chunks/strings-J2X2Z6N2.js +0 -3
- package/dist/bin/chunks/tac-DG4BMYM5.js +0 -3
- package/dist/bin/chunks/tail-5TSF5YM4.js +0 -3
- package/dist/bin/chunks/tar-ZGZZDQXO.js +0 -3
- package/dist/bin/chunks/tee-L4HKV5PD.js +0 -3
- package/dist/bin/chunks/time-J2DAZUIN.js +0 -3
- package/dist/bin/chunks/timeout-ATTDYXLX.js +0 -3
- package/dist/bin/chunks/touch-TVQAUQOG.js +0 -3
- package/dist/bin/chunks/tr-6RPFASYV.js +0 -3
- package/dist/bin/chunks/unexpand-JPOQORZF.js +0 -3
- package/dist/bin/chunks/uniq-K5VRDP4Q.js +0 -3
- package/dist/bin/chunks/wc-VSQBRD6B.js +0 -3
- package/dist/bin/chunks/xan-CCS53B7D.js +0 -3
- package/dist/bin/chunks/xan-view-KOXASOEV.js +0 -3
- package/dist/bin/chunks/xargs-HMISWW4I.js +0 -3
- package/dist/bin/chunks/yes-ELH3XQWY.js +0 -3
- package/dist/bin/chunks/yq-GSCDUHGM.js +0 -3
- package/dist/bin/shell/chunks/awk2-U22OR5B5.js +0 -3
- package/dist/bin/shell/chunks/base64-2KKH5BCT.js +0 -3
- package/dist/bin/shell/chunks/bash-CFCBBWVH.js +0 -3
- package/dist/bin/shell/chunks/cat-V45MVNBT.js +0 -3
- package/dist/bin/shell/chunks/chmod-A54R4UUQ.js +0 -3
- package/dist/bin/shell/chunks/chunk-2NJJXU4K.js +0 -27
- package/dist/bin/shell/chunks/chunk-2YLY6FJA.js +0 -10
- package/dist/bin/shell/chunks/chunk-3LKMI5IX.js +0 -34
- package/dist/bin/shell/chunks/chunk-3VSWQCPN.js +0 -18
- package/dist/bin/shell/chunks/chunk-44SKMHU6.js +0 -16
- package/dist/bin/shell/chunks/chunk-5SKEZPTU.js +0 -12
- package/dist/bin/shell/chunks/chunk-5SR55TXB.js +0 -16
- package/dist/bin/shell/chunks/chunk-6D75E4LV.js +0 -3
- package/dist/bin/shell/chunks/chunk-6DAR25KN.js +0 -12
- package/dist/bin/shell/chunks/chunk-6SAZRW7E.js +0 -15
- package/dist/bin/shell/chunks/chunk-723HNGID.js +0 -13
- package/dist/bin/shell/chunks/chunk-7FGDUBSN.js +0 -14
- package/dist/bin/shell/chunks/chunk-7X4QBCFW.js +0 -36
- package/dist/bin/shell/chunks/chunk-AINNAQBQ.js +0 -6
- package/dist/bin/shell/chunks/chunk-AL7RVSF4.js +0 -8
- package/dist/bin/shell/chunks/chunk-ARYCSNJJ.js +0 -101
- package/dist/bin/shell/chunks/chunk-BCJ42NCM.js +0 -15
- package/dist/bin/shell/chunks/chunk-BJF6B4YW.js +0 -22
- package/dist/bin/shell/chunks/chunk-BOXG6XBN.js +0 -143
- package/dist/bin/shell/chunks/chunk-CPKBPQ2C.js +0 -3
- package/dist/bin/shell/chunks/chunk-DA3RFNKK.js +0 -17
- package/dist/bin/shell/chunks/chunk-DH7M46D3.js +0 -20
- package/dist/bin/shell/chunks/chunk-DTGQQKI2.js +0 -87
- package/dist/bin/shell/chunks/chunk-ECZAFQ22.js +0 -9
- package/dist/bin/shell/chunks/chunk-ETWDDV6I.js +0 -10
- package/dist/bin/shell/chunks/chunk-HFW2LXQV.js +0 -13
- package/dist/bin/shell/chunks/chunk-HRKG3ZK2.js +0 -8
- package/dist/bin/shell/chunks/chunk-I4IRHQDW.js +0 -3
- package/dist/bin/shell/chunks/chunk-IKUY74NG.js +0 -3
- package/dist/bin/shell/chunks/chunk-ILXMFIYG.js +0 -7
- package/dist/bin/shell/chunks/chunk-IMVXTSPG.js +0 -275
- package/dist/bin/shell/chunks/chunk-ISW2U76N.js +0 -17
- package/dist/bin/shell/chunks/chunk-K5KT6DMM.js +0 -4
- package/dist/bin/shell/chunks/chunk-KG2KXL4Y.js +0 -3
- package/dist/bin/shell/chunks/chunk-LCP3IKI7.js +0 -9
- package/dist/bin/shell/chunks/chunk-LG6IN6SW.js +0 -34
- package/dist/bin/shell/chunks/chunk-LMFAALLO.js +0 -21
- package/dist/bin/shell/chunks/chunk-LXFMIXGA.js +0 -3
- package/dist/bin/shell/chunks/chunk-M5ZBECGM.js +0 -22
- package/dist/bin/shell/chunks/chunk-MA6BMA4M.js +0 -3
- package/dist/bin/shell/chunks/chunk-MPQMTLXN.js +0 -3
- package/dist/bin/shell/chunks/chunk-MUIYG2RB.js +0 -65
- package/dist/bin/shell/chunks/chunk-MYTNZ7MA.js +0 -7
- package/dist/bin/shell/chunks/chunk-NGMFI3RH.js +0 -15
- package/dist/bin/shell/chunks/chunk-NLMTGTSG.js +0 -11
- package/dist/bin/shell/chunks/chunk-O74FSWB4.js +0 -4
- package/dist/bin/shell/chunks/chunk-OBVTFHVP.js +0 -7
- package/dist/bin/shell/chunks/chunk-OOKVPG5D.js +0 -6
- package/dist/bin/shell/chunks/chunk-PL4EU7Y2.js +0 -3
- package/dist/bin/shell/chunks/chunk-Q3LE3Y66.js +0 -13
- package/dist/bin/shell/chunks/chunk-QCGH2ZOW.js +0 -13
- package/dist/bin/shell/chunks/chunk-QKWMWSV3.js +0 -3
- package/dist/bin/shell/chunks/chunk-QL33F2W6.js +0 -8
- package/dist/bin/shell/chunks/chunk-S5Z7DMIE.js +0 -26
- package/dist/bin/shell/chunks/chunk-SQ7SZZMW.js +0 -8
- package/dist/bin/shell/chunks/chunk-SQUH76NP.js +0 -3
- package/dist/bin/shell/chunks/chunk-TGRZ42DS.js +0 -12
- package/dist/bin/shell/chunks/chunk-THTKNRO6.js +0 -7
- package/dist/bin/shell/chunks/chunk-TQXLQEIT.js +0 -9
- package/dist/bin/shell/chunks/chunk-TZ3S7MY6.js +0 -12
- package/dist/bin/shell/chunks/chunk-U6BXPMLD.js +0 -7
- package/dist/bin/shell/chunks/chunk-U6DBRMD5.js +0 -5
- package/dist/bin/shell/chunks/chunk-URRH3GPG.js +0 -10
- package/dist/bin/shell/chunks/chunk-VBU3UEG5.js +0 -7
- package/dist/bin/shell/chunks/chunk-VLWZ6L7C.js +0 -4
- package/dist/bin/shell/chunks/chunk-VTHA5UK5.js +0 -7
- package/dist/bin/shell/chunks/chunk-WBST7XJW.js +0 -9
- package/dist/bin/shell/chunks/chunk-WDV2ECOC.js +0 -3
- package/dist/bin/shell/chunks/chunk-WEQ5WM2M.js +0 -20
- package/dist/bin/shell/chunks/chunk-WFVCEB5T.js +0 -3
- package/dist/bin/shell/chunks/chunk-WZ7MIBLR.js +0 -37
- package/dist/bin/shell/chunks/chunk-X45GP3AQ.js +0 -3
- package/dist/bin/shell/chunks/chunk-XEQ7KSRM.js +0 -5
- package/dist/bin/shell/chunks/chunk-YIANER7Y.js +0 -8
- package/dist/bin/shell/chunks/chunk-YYZSYLJO.js +0 -6
- package/dist/bin/shell/chunks/chunk-Z3KAV6YJ.js +0 -10
- package/dist/bin/shell/chunks/chunk-Z5KICK5X.js +0 -22
- package/dist/bin/shell/chunks/column-LHHS4D3K.js +0 -3
- package/dist/bin/shell/chunks/comm-URDMZCXL.js +0 -3
- package/dist/bin/shell/chunks/cp-HPLQA35N.js +0 -3
- package/dist/bin/shell/chunks/curl-FIRG3RB6.js +0 -31
- package/dist/bin/shell/chunks/cut-KP3S36XS.js +0 -3
- package/dist/bin/shell/chunks/date-FJUBX7TJ.js +0 -3
- package/dist/bin/shell/chunks/diff-JSJ56EOK.js +0 -3
- package/dist/bin/shell/chunks/dist-4NZ74CRE.js +0 -141
- package/dist/bin/shell/chunks/du-WEF5YWQK.js +0 -3
- package/dist/bin/shell/chunks/env-2TSVF4W7.js +0 -3
- package/dist/bin/shell/chunks/expand-P6SNTBGZ.js +0 -3
- package/dist/bin/shell/chunks/expr-FLWT4OCO.js +0 -3
- package/dist/bin/shell/chunks/file-JLUCGBCB.js +0 -3
- package/dist/bin/shell/chunks/find-XGVQ6N6L.js +0 -3
- package/dist/bin/shell/chunks/flag-coverage-4JYKIAVV.js +0 -3
- package/dist/bin/shell/chunks/fold-YEY7X54W.js +0 -3
- package/dist/bin/shell/chunks/grep-DCPCPQOS.js +0 -3
- package/dist/bin/shell/chunks/gzip-6DZIKNBW.js +0 -3
- package/dist/bin/shell/chunks/head-TLFXMM2T.js +0 -3
- package/dist/bin/shell/chunks/html-to-markdown-E22RLT2U.js +0 -3
- package/dist/bin/shell/chunks/join-UQKXU2QP.js +0 -3
- package/dist/bin/shell/chunks/jq-GDM3OBBK.js +0 -3
- package/dist/bin/shell/chunks/js-exec-VU6F6WLS.js +0 -1578
- package/dist/bin/shell/chunks/ls-67NUUIYT.js +0 -3
- package/dist/bin/shell/chunks/md5sum-Z6KAYGDK.js +0 -3
- package/dist/bin/shell/chunks/mkdir-AWDWRBKC.js +0 -3
- package/dist/bin/shell/chunks/mktemp-L6OGMDUO.js +0 -3
- package/dist/bin/shell/chunks/mv-4BJSOT4Y.js +0 -3
- package/dist/bin/shell/chunks/nl-XHWFVVKH.js +0 -3
- package/dist/bin/shell/chunks/od-SI75GLRE.js +0 -3
- package/dist/bin/shell/chunks/paste-5TSIBDF7.js +0 -3
- package/dist/bin/shell/chunks/printf-CNXNRQ3I.js +0 -3
- package/dist/bin/shell/chunks/python3-GUWCSSDP.js +0 -23
- package/dist/bin/shell/chunks/readlink-URO5XTBB.js +0 -3
- package/dist/bin/shell/chunks/rev-CZTQCNOZ.js +0 -3
- package/dist/bin/shell/chunks/rg-RVULUPDH.js +0 -3
- package/dist/bin/shell/chunks/rm-UCUTHC3I.js +0 -3
- package/dist/bin/shell/chunks/rmdir-J3HM7GGM.js +0 -3
- package/dist/bin/shell/chunks/sed-MCLGHZOI.js +0 -3
- package/dist/bin/shell/chunks/seq-I54NZE75.js +0 -3
- package/dist/bin/shell/chunks/sha1sum-CATBXX76.js +0 -3
- package/dist/bin/shell/chunks/sha256sum-YGSNBVY3.js +0 -3
- package/dist/bin/shell/chunks/sort-M3DO25D5.js +0 -3
- package/dist/bin/shell/chunks/split-VZO7223N.js +0 -3
- package/dist/bin/shell/chunks/sqlite3-HXVFVP4Z.js +0 -3
- package/dist/bin/shell/chunks/stat-UJ37RBMM.js +0 -3
- package/dist/bin/shell/chunks/strings-J2X2Z6N2.js +0 -3
- package/dist/bin/shell/chunks/tac-DG4BMYM5.js +0 -3
- package/dist/bin/shell/chunks/tail-5TSF5YM4.js +0 -3
- package/dist/bin/shell/chunks/tar-ZGZZDQXO.js +0 -3
- package/dist/bin/shell/chunks/tee-L4HKV5PD.js +0 -3
- package/dist/bin/shell/chunks/time-J2DAZUIN.js +0 -3
- package/dist/bin/shell/chunks/timeout-ATTDYXLX.js +0 -3
- package/dist/bin/shell/chunks/touch-TVQAUQOG.js +0 -3
- package/dist/bin/shell/chunks/tr-6RPFASYV.js +0 -3
- package/dist/bin/shell/chunks/unexpand-JPOQORZF.js +0 -3
- package/dist/bin/shell/chunks/uniq-K5VRDP4Q.js +0 -3
- package/dist/bin/shell/chunks/wc-VSQBRD6B.js +0 -3
- package/dist/bin/shell/chunks/xan-CCS53B7D.js +0 -3
- package/dist/bin/shell/chunks/xan-view-KOXASOEV.js +0 -3
- package/dist/bin/shell/chunks/xargs-HMISWW4I.js +0 -3
- package/dist/bin/shell/chunks/yes-ELH3XQWY.js +0 -3
- package/dist/bin/shell/chunks/yq-GSCDUHGM.js +0 -3
- package/dist/bundle/chunks/awk2-V7KYQWCD.js +0 -2
- package/dist/bundle/chunks/base64-QPSYZAAJ.js +0 -2
- package/dist/bundle/chunks/bash-HIEWVHJ2.js +0 -2
- package/dist/bundle/chunks/cat-54BXBS6X.js +0 -2
- package/dist/bundle/chunks/chmod-4OPV4QKK.js +0 -2
- package/dist/bundle/chunks/chunk-2KNTH3KH.js +0 -9
- package/dist/bundle/chunks/chunk-2VWG4LDT.js +0 -11
- package/dist/bundle/chunks/chunk-2WBUTDF5.js +0 -2
- package/dist/bundle/chunks/chunk-3HDTNUL3.js +0 -6
- package/dist/bundle/chunks/chunk-3KWM4FFA.js +0 -12
- package/dist/bundle/chunks/chunk-4AKAIZPW.js +0 -15
- package/dist/bundle/chunks/chunk-4IMUNIUJ.js +0 -21
- package/dist/bundle/chunks/chunk-5ATEFZLC.js +0 -4
- package/dist/bundle/chunks/chunk-5BMPT6SF.js +0 -19
- package/dist/bundle/chunks/chunk-5QWGR2WA.js +0 -21
- package/dist/bundle/chunks/chunk-5UTZMNI5.js +0 -64
- package/dist/bundle/chunks/chunk-5VCAQBXL.js +0 -17
- package/dist/bundle/chunks/chunk-65LVAUWW.js +0 -7
- package/dist/bundle/chunks/chunk-6D3WD6YU.js +0 -3
- package/dist/bundle/chunks/chunk-6R4OQQWP.js +0 -16
- package/dist/bundle/chunks/chunk-6WGIZV3E.js +0 -13
- package/dist/bundle/chunks/chunk-72JHTO7E.js +0 -2
- package/dist/bundle/chunks/chunk-7GA3QWJJ.js +0 -33
- package/dist/bundle/chunks/chunk-7M672HB6.js +0 -21
- package/dist/bundle/chunks/chunk-AFFAMSJT.js +0 -14
- package/dist/bundle/chunks/chunk-ANCQ4SCV.js +0 -2
- package/dist/bundle/chunks/chunk-B3NGH6KE.js +0 -5
- package/dist/bundle/chunks/chunk-B5Z5HTFY.js +0 -14
- package/dist/bundle/chunks/chunk-B6OSJB22.js +0 -26
- package/dist/bundle/chunks/chunk-BM3X75NC.js +0 -36
- package/dist/bundle/chunks/chunk-CGI6V2HW.js +0 -11
- package/dist/bundle/chunks/chunk-CHHWTPDH.js +0 -3
- package/dist/bundle/chunks/chunk-D5ZJISRS.js +0 -11
- package/dist/bundle/chunks/chunk-DIRWTBKE.js +0 -19
- package/dist/bundle/chunks/chunk-DIWMSSQY.js +0 -2
- package/dist/bundle/chunks/chunk-DPZVOEUP.js +0 -6
- package/dist/bundle/chunks/chunk-EFORKKSH.js +0 -8
- package/dist/bundle/chunks/chunk-EGTVQWAP.js +0 -20
- package/dist/bundle/chunks/chunk-EJFBIRMD.js +0 -6
- package/dist/bundle/chunks/chunk-EQQGPAXI.js +0 -9
- package/dist/bundle/chunks/chunk-EXXOLIVE.js +0 -35
- package/dist/bundle/chunks/chunk-FIMO5HLX.js +0 -2
- package/dist/bundle/chunks/chunk-FT6ODGOU.js +0 -2
- package/dist/bundle/chunks/chunk-FZRQOL3C.js +0 -7
- package/dist/bundle/chunks/chunk-GLAFXDZC.js +0 -4
- package/dist/bundle/chunks/chunk-GN6CQ3J4.js +0 -2
- package/dist/bundle/chunks/chunk-H42OAUJL.js +0 -12
- package/dist/bundle/chunks/chunk-H53EPEGD.js +0 -12
- package/dist/bundle/chunks/chunk-HDOXCDVK.js +0 -7
- package/dist/bundle/chunks/chunk-HIQEVPXM.js +0 -2
- package/dist/bundle/chunks/chunk-J2OBOJ64.js +0 -2
- package/dist/bundle/chunks/chunk-LVDUF74R.js +0 -7
- package/dist/bundle/chunks/chunk-M4LDT7V7.js +0 -6
- package/dist/bundle/chunks/chunk-MDE25PQK.js +0 -15
- package/dist/bundle/chunks/chunk-MHDZERK4.js +0 -6
- package/dist/bundle/chunks/chunk-MHZF23KB.js +0 -33
- package/dist/bundle/chunks/chunk-N6W6FM4N.js +0 -8
- package/dist/bundle/chunks/chunk-NRLE7KYI.js +0 -6
- package/dist/bundle/chunks/chunk-OB46N7Q7.js +0 -2
- package/dist/bundle/chunks/chunk-OQ7C4FYO.js +0 -2
- package/dist/bundle/chunks/chunk-P5BOIHWV.js +0 -6
- package/dist/bundle/chunks/chunk-PPDMRIJ7.js +0 -11
- package/dist/bundle/chunks/chunk-PPHGMG47.js +0 -142
- package/dist/bundle/chunks/chunk-R6ZGLVXI.js +0 -9
- package/dist/bundle/chunks/chunk-RCRHDT54.js +0 -274
- package/dist/bundle/chunks/chunk-RIIUVFUS.js +0 -7
- package/dist/bundle/chunks/chunk-SQX6WQXB.js +0 -7
- package/dist/bundle/chunks/chunk-SRB6FXRH.js +0 -2
- package/dist/bundle/chunks/chunk-T4INBNHX.js +0 -8
- package/dist/bundle/chunks/chunk-TUQG2YRH.js +0 -5
- package/dist/bundle/chunks/chunk-U7UNEMLJ.js +0 -2
- package/dist/bundle/chunks/chunk-UHHCL65P.js +0 -3
- package/dist/bundle/chunks/chunk-UK2K3DHN.js +0 -8
- package/dist/bundle/chunks/chunk-VDJ53ESK.js +0 -9
- package/dist/bundle/chunks/chunk-VGCXKMXN.js +0 -10
- package/dist/bundle/chunks/chunk-W5DWRFSU.js +0 -2
- package/dist/bundle/chunks/chunk-W5J5ADJF.js +0 -100
- package/dist/bundle/chunks/chunk-XHFP44Y4.js +0 -5
- package/dist/bundle/chunks/chunk-Y32R7EZP.js +0 -25
- package/dist/bundle/chunks/chunk-Y62SXZKJ.js +0 -12
- package/dist/bundle/chunks/chunk-YUFU7O6I.js +0 -16
- package/dist/bundle/chunks/chunk-YZH7FUSY.js +0 -14
- package/dist/bundle/chunks/column-F5JDBRV6.js +0 -2
- package/dist/bundle/chunks/comm-DTWKU2MC.js +0 -2
- package/dist/bundle/chunks/cp-LTFB4EUA.js +0 -2
- package/dist/bundle/chunks/curl-XCX2ZQEA.js +0 -30
- package/dist/bundle/chunks/cut-IRSHL3BB.js +0 -2
- package/dist/bundle/chunks/date-FN2DXAEE.js +0 -2
- package/dist/bundle/chunks/diff-VDB6RXHO.js +0 -2
- package/dist/bundle/chunks/du-DOWSRLXR.js +0 -2
- package/dist/bundle/chunks/env-VUUMB47B.js +0 -2
- package/dist/bundle/chunks/expand-2BPPGGSM.js +0 -2
- package/dist/bundle/chunks/expr-GZ4DABKB.js +0 -2
- package/dist/bundle/chunks/file-UI6QJAAU.js +0 -2
- package/dist/bundle/chunks/find-JTXDH3MR.js +0 -2
- package/dist/bundle/chunks/flag-coverage-EDO3VM43.js +0 -2
- package/dist/bundle/chunks/fold-QJBPHRFJ.js +0 -2
- package/dist/bundle/chunks/grep-OZCR76FT.js +0 -2
- package/dist/bundle/chunks/gzip-GQC6CWVL.js +0 -2
- package/dist/bundle/chunks/head-J6RVJFRS.js +0 -2
- package/dist/bundle/chunks/html-to-markdown-7OG5VWYG.js +0 -2
- package/dist/bundle/chunks/join-KQ4Z5OD4.js +0 -2
- package/dist/bundle/chunks/jq-FCG2IUBK.js +0 -2
- package/dist/bundle/chunks/js-exec-NDLXDUBN.js +0 -1577
- package/dist/bundle/chunks/ls-MQTYWW4T.js +0 -2
- package/dist/bundle/chunks/md5sum-JEDX55KS.js +0 -2
- package/dist/bundle/chunks/mkdir-4A5W3RXH.js +0 -2
- package/dist/bundle/chunks/mktemp-XKIE5N3X.js +0 -2
- package/dist/bundle/chunks/mv-ZPIATQJL.js +0 -2
- package/dist/bundle/chunks/nl-RFXH2GNX.js +0 -2
- package/dist/bundle/chunks/od-LUHOH7CG.js +0 -2
- package/dist/bundle/chunks/paste-U57ZU47S.js +0 -2
- package/dist/bundle/chunks/printf-V42QCPHL.js +0 -2
- package/dist/bundle/chunks/python3-SDFCGIU4.js +0 -22
- package/dist/bundle/chunks/readlink-YNNS6F7K.js +0 -2
- package/dist/bundle/chunks/rev-EPOS3MFH.js +0 -2
- package/dist/bundle/chunks/rg-F4SX2PHI.js +0 -2
- package/dist/bundle/chunks/rm-3XUUYAXQ.js +0 -2
- package/dist/bundle/chunks/rmdir-OGSEXEF4.js +0 -2
- package/dist/bundle/chunks/sed-MBB5SXGD.js +0 -2
- package/dist/bundle/chunks/seq-IN77HD3S.js +0 -2
- package/dist/bundle/chunks/sha1sum-BLPZJ6MP.js +0 -2
- package/dist/bundle/chunks/sha256sum-VJZ4PHQ4.js +0 -2
- package/dist/bundle/chunks/sort-PV2NEQHF.js +0 -2
- package/dist/bundle/chunks/split-6R2TSQY6.js +0 -2
- package/dist/bundle/chunks/sqlite3-7MBPFI6W.js +0 -2
- package/dist/bundle/chunks/stat-YLVJ4L67.js +0 -2
- package/dist/bundle/chunks/strings-WTD7Q2EF.js +0 -2
- package/dist/bundle/chunks/tac-YXC4HBTR.js +0 -2
- package/dist/bundle/chunks/tail-UGFWX3YY.js +0 -2
- package/dist/bundle/chunks/tar-BNHPWTOY.js +0 -2
- package/dist/bundle/chunks/tee-OOWSWHRQ.js +0 -2
- package/dist/bundle/chunks/time-N6J6DC6C.js +0 -2
- package/dist/bundle/chunks/timeout-ZHCL5KTP.js +0 -2
- package/dist/bundle/chunks/touch-W4DF6Z4T.js +0 -2
- package/dist/bundle/chunks/tr-4NGL47UU.js +0 -2
- package/dist/bundle/chunks/unexpand-YD5BWFH4.js +0 -2
- package/dist/bundle/chunks/uniq-OVOW532K.js +0 -2
- package/dist/bundle/chunks/wc-RUR7HE5O.js +0 -2
- package/dist/bundle/chunks/xan-7R3I2DJO.js +0 -2
- package/dist/bundle/chunks/xan-view-S4ZILLPU.js +0 -2
- package/dist/bundle/chunks/xargs-L7TJHOJT.js +0 -2
- package/dist/bundle/chunks/yes-I7SAR7XX.js +0 -2
- package/dist/bundle/chunks/yq-IOMBQYB2.js +0 -2
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as Ie}from"./chunk-DLL7UR66.js";import{a as B,b as U}from"./chunk-CHWP6GRK.js";import{a as O,b as X}from"./chunk-7GA3QWJJ.js";import{a as z}from"./chunk-U7UNEMLJ.js";import{a as $}from"./chunk-CBM6J4AL.js";import{e as ve}from"./chunk-DIWMSSQY.js";import{l as w}from"./chunk-EFORKKSH.js";import{a as V,d as ee}from"./chunk-GN6CQ3J4.js";import{a as Re,b as Ae,c as pe}from"./chunk-QAYAQNCG.js";var Qe=1e4,Ze=100,Ye=new X(/\s+/);function fe(e={}){let{fieldSep:t=Ye,maxIterations:n=Qe,maxRecursionDepth:r=Ze,maxOutputSize:s=0,maxArrayElements:a=1e5,fs:o,cwd:l,exec:c,coverage:u,requireDefenseContext:f}=e;return{FS:" ",OFS:" ",ORS:`
|
|
3
|
-
`,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,getlineCommandStreams:new Map,getlineFileStreams:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:r,maxOutputSize:s,maxArrayElements:a,arrayElementCount:0,recordsProcessed:0,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:o,cwd:l,exec:c,coverage:u,requireDefenseContext:f}}function ke(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}function F(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function L(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}var be=10*1024*1024;function Ee(e){return new ve(e,"awk string",()=>new w(`string size limit exceeded (${e} bytes)`,"string_length"))}function _(e){return e.maxOutputSize>0?e.maxOutputSize:be}function te(e,t,n,r,s){let a=Ee(s),o=0,l=0,c=0;for(let u of t.matchAll(e)){let f=u.index??0;l++,a.append(e.slice(o,f)),n(l)?(a.append(r(u)),c++):a.append(u[0]),o=f+u[0].length}return a.append(e.slice(o)),{value:a.build(),replacements:c}}async function ne(e,t){if(e.type==="regex")return e.pattern;let n=L(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function Oe(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(F(await t.evalExpr(e.index)))}`:"$0":"$0"}function Le(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return L(t.vars[e]??"")}function Te(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let r=parseInt(e.slice(1),10)-1;for(;n.fields.length<=r;)n.fields.push("");n.fields[r]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function Je(e,t,n){return e.length===0?t.line.length:L(await n.evalExpr(e[0])).length}async function et(e,t,n){if(e.length<2)return"";let r=L(await n.evalExpr(e[0])),s=Math.floor(F(await n.evalExpr(e[1])))-1;if(e.length>=3){let a=Math.floor(F(await n.evalExpr(e[2])));return r.substr(Math.max(0,s),a)}return r.substr(Math.max(0,s))}async function tt(e,t,n){if(e.length<2)return 0;let r=L(await n.evalExpr(e[0])),s=L(await n.evalExpr(e[1])),a=r.indexOf(s);return a===-1?0:a+1}async function nt(e,t,n){if(e.length<2)return 0;let r=L(await n.evalExpr(e[0])),s=e[1];if(s.type!=="variable")return 0;let a=s.name,o=t.FS;if(e.length>=3){let f=e[2];if(f.type==="regex")o=O(f.pattern);else{let k=L(await n.evalExpr(f));o=k===" "?O("\\s+"):k}}else t.FS===" "&&(o=O("\\s+"));let l=Object.keys(t.arrays[a]??{}).length,c=t.maxArrayElements-t.arrayElementCount+l,u=typeof o=="string"?r.split(o,c+1):o.split(r,c+1);if(u.length>c)throw new w(`array element limit exceeded (${t.maxArrayElements})`,"array_elements");t.arrays[a]=Object.create(null);for(let f=0;f<u.length;f++)t.arrays[a][String(f+1)]=u[f];return t.arrayElementCount+=u.length-l,u.length}async function it(e,t,n){if(e.length<2)return 0;let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=await Oe(e[2],n),o=Le(a,t);try{let l=O(r,"g"),c=te(o,l,u=>u===1,u=>Pe(s,u[0],_(t)),_(t));return Te(a,c.value,t),c.replacements}catch(l){return z(l),0}}async function rt(e,t,n){if(e.length<2)return 0;let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=await Oe(e[2],n),o=Le(a,t);try{let l=O(r,"g"),c=te(o,l,()=>!0,u=>Pe(s,u[0],_(t)),_(t));return Te(a,c.value,t),c.replacements}catch(l){return z(l),0}}function Pe(e,t,n){let r=Ee(n),s=0;for(;s<e.length;)if(e[s]==="\\"&&s+1<e.length){let a=e[s+1];a==="&"?(r.append("&"),s+=2):a==="\\"?(r.append("\\"),s+=2):(r.append(e[s+1]),s+=2)}else e[s]==="&"?(r.append(t),s++):(r.append(e[s]),s++);return r.build()}async function st(e,t,n){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let r=L(await n.evalExpr(e[0])),s=await ne(e[1],n);try{let o=O(s).exec(r);if(o)return t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART}catch{}return t.RSTART=0,t.RLENGTH=-1,0}async function at(e,t,n){if(e.length<3)return"";let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=L(await n.evalExpr(e[2])),o=e.length>=4?L(await n.evalExpr(e[3])):t.line;try{let l=a.toLowerCase()==="g",c=l?0:parseInt(a,10)||1;if(l){let u=O(r,"g");return te(o,u,()=>!0,f=>Ce(s,f[0],f.slice(1),_(t)),_(t)).value}else{let u=O(r,"g");return te(o,u,f=>f===c,f=>Ce(s,f[0],f.slice(1),_(t)),_(t)).value}}catch(l){return z(l),o}}function Ce(e,t,n,r){let s=Ee(r),a=0;for(;a<e.length;)if(e[a]==="\\"&&a+1<e.length){let o=e[a+1];if(o==="&")s.append("&"),a+=2;else if(o==="0")s.append(t),a+=2;else if(o>="1"&&o<="9"){let l=parseInt(o,10)-1;s.append(n[l]||""),a+=2}else o==="n"?(s.append(`
|
|
4
|
-
`),a+=2):o==="t"?(s.append(" "),a+=2):(s.append(o),a+=2)}else e[a]==="&"?(s.append(t),a++):(s.append(e[a]),a++);return s.build()}async function ot(e,t,n){return e.length===0?"":L(await n.evalExpr(e[0])).toLowerCase()}async function lt(e,t,n){return e.length===0?"":L(await n.evalExpr(e[0])).toUpperCase()}async function ut(e,t,n){if(e.length===0)return"";let r=L(await n.evalExpr(e[0])),s=[];for(let a=1;a<e.length;a++)s.push(await n.evalExpr(e[a]));return ie(r,s,_(t))}async function ct(e,t,n){return e.length===0?0:Math.floor(F(await n.evalExpr(e[0])))}async function ht(e,t,n){return e.length===0?0:Math.sqrt(F(await n.evalExpr(e[0])))}async function pt(e,t,n){return e.length===0?0:Math.sin(F(await n.evalExpr(e[0])))}async function ft(e,t,n){return e.length===0?0:Math.cos(F(await n.evalExpr(e[0])))}async function dt(e,t,n){let r=e.length>0?F(await n.evalExpr(e[0])):0,s=e.length>1?F(await n.evalExpr(e[1])):0;return Math.atan2(r,s)}async function Et(e,t,n){return e.length===0?0:Math.log(F(await n.evalExpr(e[0])))}async function mt(e,t,n){return e.length===0?1:Math.exp(F(await n.evalExpr(e[0])))}function Nt(e,t,n){return t.random?t.random():Math.random()}async function yt(e,t,n){let r=e.length>0?F(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=r,r}function wt(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function de(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}var gt=1e4;function ie(e,t,n=be){let r=0,s="",a=0,o=0,l=Math.min(gt,n),c=u=>{let f=V(u);if(f>n-a)throw new w(`formatted string size limit exceeded (${n} bytes)`,"string_length");s+=u,a+=f};for(;o<e.length;)if(e[o]==="%"&&o+1<e.length){let u=o+1,f="",k="",C="",A,T=u;for(;u<e.length&&/\d/.test(e[u]);)u++;u>T&&e[u]==="$"?(A=parseInt(e.substring(T,u),10)-1,u++):u=T;let he=()=>{if(u<e.length){if(u+1<e.length&&(e[u]==="h"&&e[u+1]==="h"||e[u]==="l"&&e[u+1]==="l")){u+=2;return}/[lzjh]/.test(e[u])&&u++}};for(;u<e.length&&/[-+ #0]/.test(e[u]);)f+=e[u++];if(e[u]==="*"){let p=t[r++],N=p!==void 0?Math.floor(Number(p)):0;if(!Number.isFinite(N)||!Number.isSafeInteger(N))throw new w(`printf width limit exceeded (${l} bytes)`,"string_length");N<0?(f+="-",k=String(-N)):k=String(N),u++}else for(;u<e.length&&/\d/.test(e[u]);)k+=e[u++];if(k&&parseInt(k,10)>l)throw new w(`printf width limit exceeded (${l} bytes)`,"string_length");if(e[u]==="."){if(u++,e[u]==="*"){let p=t[r++],N=p!==void 0?Math.floor(Number(p)):0;if(!Number.isFinite(N)||!Number.isSafeInteger(N))throw new w(`printf precision limit exceeded (${l} bytes)`,"string_length");C=N<0?"":String(N),u++}else for(;u<e.length&&/\d/.test(e[u]);)C+=e[u++];if(C&&parseInt(C,10)>l)throw new w(`printf precision limit exceeded (${l} bytes)`,"string_length")}he();let W=e[u],y=t[A!==void 0?A:r];switch(W){case"s":{let p=y!==void 0?String(y):"";if(C&&(p=p.substring(0,parseInt(C,10))),k){let N=parseInt(k,10);f.includes("-")?p=p.padEnd(N):p=p.padStart(N)}c(p),A===void 0&&r++;break}case"d":case"i":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=p<0,g=Math.abs(p).toString();if(C){let x=parseInt(C,10);g=g.padStart(x,"0")}let d="";N?d="-":f.includes("+")?d="+":f.includes(" ")&&(d=" ");let I=d+g;if(k){let x=parseInt(k,10);f.includes("-")?I=I.padEnd(x):f.includes("0")&&!C?I=d+g.padStart(x-d.length,"0"):I=I.padStart(x)}c(I),A===void 0&&r++;break}case"f":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p.toFixed(N);if(k){let d=parseInt(k,10);f.includes("-")?g=g.padEnd(d):g=g.padStart(d)}c(g),A===void 0&&r++;break}case"e":case"E":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p.toExponential(N);if(W==="E"&&(g=g.toUpperCase()),k){let d=parseInt(k,10);f.includes("-")?g=g.padEnd(d):g=g.padStart(d)}c(g),A===void 0&&r++;break}case"g":case"G":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p!==0?Math.floor(Math.log10(Math.abs(p))):0,d;if(p===0?d="0":g<-4||g>=N?(d=p.toExponential(N-1),W==="G"&&(d=d.toUpperCase())):d=p.toPrecision(N),d.includes(".")&&(d=d.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),d.includes("e")&&(d=d.replace(/\.?0+e/,"e")),k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"x":case"X":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=Math.abs(p).toString(16);if(W==="X"&&(N=N.toUpperCase()),C){let I=parseInt(C,10);N=N.padStart(I,"0")}let g=p<0?"-":"",d=g+N;if(k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):f.includes("0")&&!C?d=g+N.padStart(I-g.length,"0"):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"o":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=Math.abs(p).toString(8);if(C){let I=parseInt(C,10);N=N.padStart(I,"0")}let g=p<0?"-":"",d=g+N;if(k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):f.includes("0")&&!C?d=g+N.padStart(I-g.length,"0"):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"c":{c(typeof y=="number"?String.fromCharCode(y):String(y??"").charAt(0)||""),A===void 0&&r++;break}case"%":c("%");break;default:c(e.substring(o,u+1))}o=u+1}else if(e[o]==="\\"&&o+1<e.length){let u=e[o+1];switch(u){case"n":c(`
|
|
5
|
-
`);break;case"t":c(" ");break;case"r":c("\r");break;case"\\":c("\\");break;default:c(u)}o+=2}else c(e[o++]);return s}var Me=new Map([["length",Je],["substr",et],["index",tt],["split",nt],["sub",it],["gsub",rt],["match",st],["gensub",at],["tolower",ot],["toupper",lt],["sprintf",ut],["int",ct],["sqrt",ht],["sin",pt],["cos",ft],["atan2",dt],["log",Et],["exp",mt],["rand",Nt],["srand",yt],["system",wt("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",de("systime")],["mktime",de("mktime")],["strftime",de("strftime")]]);function P(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function b(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function v(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function me(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function Z(e,t){try{return O(e).test(t)}catch{return!1}}function Fe(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function re(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function Ne(e,t,n){if(t===0)e.line=v(n),e.fields=Fe(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=v(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function K(e,t){e.line=t,e.fields=Fe(e,t),e.NF=e.fields.length}function De(e,t){if(e.FS=t,t===" ")e.fieldSep=new X(/\s+/);else try{e.fieldSep=O(t)}catch{e.fieldSep=O(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}function se(e,t){switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return e.vars[t]??""}function j(e,t,n){switch(t){case"FS":De(e,v(n));return;case"OFS":e.OFS=v(n);return;case"ORS":e.ORS=v(n);return;case"OFMT":e.OFMT=v(n);return;case"NR":e.NR=Math.floor(b(n));return;case"NF":{let r=Math.floor(b(n));if(r<e.NF)e.fields=e.fields.slice(0,r),e.line=e.fields.join(e.OFS);else if(r>e.NF){for(;e.fields.length<r;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=r;return}case"FNR":e.FNR=Math.floor(b(n));return;case"FILENAME":e.FILENAME=v(n);return;case"RSTART":e.RSTART=Math.floor(b(n));return;case"RLENGTH":e.RLENGTH=Math.floor(b(n));return;case"SUBSEP":e.SUBSEP=v(n);return}e.vars[t]=n}function Y(e,t){let n=t,r=new Set,s=e.arrayAliases.get(n);for(;s!==void 0&&!r.has(n);)r.add(n),n=s,s=e.arrayAliases.get(n);return n}function ae(e,t,n){if(t==="ARGV")return e.ARGV[n]??"";if(t==="ENVIRON")return e.ENVIRON[n]??"";let r=Y(e,t);return e.arrays[r]?.[n]??""}function ye(e,t,n,r){let s=Y(e,t);if(e.arrays[s]||(e.arrays[s]=Object.create(null)),!(n in e.arrays[s])){if(e.arrayElementCount>=e.maxArrayElements)throw new w(`array element limit exceeded (${e.maxArrayElements})`,"array_elements");e.arrayElementCount++}e.arrays[s][n]=r}function xe(e,t,n){if(t==="ARGV")return e.ARGV[n]!==void 0;if(t==="ENVIRON")return e.ENVIRON[n]!==void 0;let r=Y(e,t);return e.arrays[r]?.[n]!==void 0}function _e(e,t,n){let r=Y(e,t);e.arrays[r]&&(n in e.arrays[r]&&e.arrayElementCount--,delete e.arrays[r][n])}function Ge(e,t){let n=Y(e,t);e.arrayElementCount-=Object.keys(e.arrays[n]??{}).length,delete e.arrays[n]}var Be=null;function Ue(e){Be=e}function M(e,t){B(e.requireDefenseContext,"awk",t)}function R(e,t,n){return U(e.requireDefenseContext,"awk",t,n)}async function E(e,t){switch(M(e,"expression evaluation"),e.coverage?.hit(`awk:expr:${t.type}`),t.type){case"number":return t.value;case"string":return t.value;case"regex":return Z(t.pattern,e.line)?1:0;case"field":return St(e,t);case"variable":return se(e,t.name);case"array_access":return Rt(e,t);case"binary":return At(e,t);case"unary":return kt(e,t);case"ternary":return P(await R(e,"ternary condition evaluation",()=>E(e,t.condition)))?await R(e,"ternary consequent evaluation",()=>E(e,t.consequent)):await R(e,"ternary alternate evaluation",()=>E(e,t.alternate));case"call":return Ct(e,t.name,t.args);case"assignment":return Ot(e,t);case"pre_increment":return Lt(e,t.operand);case"pre_decrement":return Tt(e,t.operand);case"post_increment":return Pt(e,t.operand);case"post_decrement":return Mt(e,t.operand);case"in":return Ft(e,t.key,t.array);case"getline":return Dt(e,t.variable,t.file,t.command);case"tuple":return Gt(e,t.elements);default:return""}}async function St(e,t){M(e,"field reference evaluation");let n=Math.floor(b(await R(e,"field index evaluation",()=>E(e,t.index))));return re(e,n)}async function Rt(e,t){M(e,"array access evaluation");let n=v(await R(e,"array key evaluation",()=>E(e,t.key)));return ae(e,t.array,n)}async function At(e,t){M(e,"binary expression evaluation");let n=t.operator;if(n==="||")return P(await R(e,"logical-or left evaluation",()=>E(e,t.left)))||P(await R(e,"logical-or right evaluation",()=>E(e,t.right)))?1:0;if(n==="&&")return P(await R(e,"logical-and left evaluation",()=>E(e,t.left)))&&P(await R(e,"logical-and right evaluation",()=>E(e,t.right)))?1:0;if(n==="~"){let l=await R(e,"regex left evaluation",()=>E(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let c=t.right.type==="regex"?t.right.pattern:v(await R(e,"regex right evaluation",()=>E(e,t.right)));try{return O(c).test(v(l))?1:0}catch{return 0}}if(n==="!~"){let l=await R(e,"negated-regex left evaluation",()=>E(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let c=t.right.type==="regex"?t.right.pattern:v(await R(e,"negated-regex right evaluation",()=>E(e,t.right)));try{return O(c).test(v(l))?0:1}catch{return 1}}let r=await R(e,"binary left evaluation",()=>E(e,t.left)),s=await R(e,"binary right evaluation",()=>E(e,t.right));if(n===" "){let l=v(r)+v(s);if(e.maxOutputSize>0&&l.length>e.maxOutputSize)throw new w(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output);return l}if(vt(n))return It(r,s,n);let a=b(r),o=b(s);return ke(a,o,n)}function vt(e){return["<","<=",">",">=","==","!="].includes(e)}function It(e,t,n){let r=me(e),s=me(t);if(r&&s){let l=b(e),c=b(t);switch(n){case"<":return l<c?1:0;case"<=":return l<=c?1:0;case">":return l>c?1:0;case">=":return l>=c?1:0;case"==":return l===c?1:0;case"!=":return l!==c?1:0}}let a=v(e),o=v(t);switch(n){case"<":return a<o?1:0;case"<=":return a<=o?1:0;case">":return a>o?1:0;case">=":return a>=o?1:0;case"==":return a===o?1:0;case"!=":return a!==o?1:0}return 0}async function kt(e,t){M(e,"unary expression evaluation");let n=await R(e,"unary operand evaluation",()=>E(e,t.operand));switch(t.operator){case"!":return P(n)?0:1;case"-":return-b(n);case"+":return+b(n);default:return n}}async function Ct(e,t,n){M(e,"function call evaluation");let r=Me.get(t);if(r)return r(n,e,{evalExpr:a=>E(e,a)});let s=e.functions.get(t);return s?bt(e,s,n):""}async function bt(e,t,n){if(M(e,"user function call"),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new w(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let r=Object.create(null);for(let l of t.params)r[l]=e.vars[l];let s=[];for(let l=0;l<t.params.length;l++){let c=t.params[l];if(l<n.length){let u=n[l];u.type==="variable"&&(e.arrayAliases.set(c,u.name),s.push(c));let f=await R(e,"user function argument evaluation",()=>E(e,u));e.vars[c]=f}else e.vars[c]=""}e.hasReturn=!1,e.returnValue=void 0;let a=Be;a&&await R(e,"user function body execution",()=>a(e,t.body.statements));let o=e.returnValue??"";for(let l of t.params)r[l]!==void 0?e.vars[l]=r[l]:delete e.vars[l];for(let l of s)e.arrayAliases.delete(l);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,o}async function Ot(e,t){M(e,"assignment evaluation");let n=await R(e,"assignment value evaluation",()=>E(e,t.value)),r=t.target,s=t.operator,a;if(s==="=")a=n;else{let o;if(r.type==="field"){let u=Math.floor(b(await R(e,"assignment field index",()=>E(e,r.index))));o=re(e,u)}else if(r.type==="variable")o=se(e,r.name);else{let u=v(await R(e,"assignment array key",()=>E(e,r.key)));o=ae(e,r.array,u)}let l=b(o),c=b(n);switch(s){case"+=":a=l+c;break;case"-=":a=l-c;break;case"*=":a=l*c;break;case"/=":a=c!==0?l/c:0;break;case"%=":a=c!==0?l%c:0;break;case"^=":a=l**c;break;default:a=n}}if(r.type==="field"){let o=Math.floor(b(await R(e,"assignment target field index",()=>E(e,r.index))));Ne(e,o,a)}else if(r.type==="variable")j(e,r.name,a);else{let o=v(await R(e,"assignment target array key",()=>E(e,r.key)));ye(e,r.array,o,a)}return a}async function oe(e,t,n,r){M(e,"inc/dec evaluation");let s;if(t.type==="field"){let a=Math.floor(b(await R(e,"inc/dec field index",()=>E(e,t.index))));s=b(re(e,a)),Ne(e,a,s+n)}else if(t.type==="variable")s=b(se(e,t.name)),j(e,t.name,s+n);else{let a=v(await R(e,"inc/dec array key",()=>E(e,t.key)));s=b(ae(e,t.array,a)),ye(e,t.array,a,s+n)}return r?s+n:s}async function Lt(e,t){return oe(e,t,1,!0)}async function Tt(e,t){return oe(e,t,-1,!0)}async function Pt(e,t){return oe(e,t,1,!1)}async function Mt(e,t){return oe(e,t,-1,!1)}async function Ft(e,t,n){M(e,"in-expression evaluation");let r;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let s=[];for(let a of t.elements)s.push(v(await R(e,"tuple key element evaluation",()=>E(e,a))));r=s.join(e.SUBSEP)}else r=v(await R(e,"in-expression key evaluation",()=>E(e,t)));return xe(e,n,r)?1:0}async function Dt(e,t,n,r){if(M(e,"getline evaluation"),r)return xt(e,t,r);if(n)return _t(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let s=e.lineIndex+1;if(s>=e.lines.length)return 0;let a=e.lines[s];return t?j(e,t,a):K(e,a),e.NR++,e.lineIndex=s,1}async function xt(e,t,n){let r=e.exec;if(!r)return-1;M(e,"getline command source");let s=v(await R(e,"getline command expression",()=>E(e,n))),a=e.getlineCommandStreams.get(s);if(!a)try{let c=await R(e,"getline command exec",()=>r(s)),f=ee(c.stdout).split(`
|
|
6
|
-
`);f.length>0&&f[f.length-1]===""&&f.pop(),a={lines:f,index:-1},e.getlineCommandStreams.set(s,a)}catch(c){if(c instanceof $)throw c;return-1}let o=a.index+1;if(o>=a.lines.length)return 0;let l=a.lines[o];return a.index=o,t?j(e,t,l):K(e,l),1}async function _t(e,t,n){let r=e.fs;if(!r||!e.cwd)return-1;M(e,"getline file source");let s=v(await R(e,"getline filename evaluation",()=>E(e,n)));if(s==="/dev/null")return 0;let a=r.resolvePath(e.cwd,s),o=e.getlineFileStreams.get(a);if(!o)try{let f=(await R(e,"getline file read",()=>r.readFile(a))).split(`
|
|
7
|
-
`);f.length>0&&f[f.length-1]===""&&f.pop(),o={lines:f,index:-1},e.getlineFileStreams.set(a,o)}catch(u){if(u instanceof $)throw u;return-1}let l=o.index+1;if(l>=o.lines.length)return 0;let c=o.lines[l];return o.index=l,t?j(e,t,c):K(e,c),1}async function Gt(e,t){if(M(e,"tuple evaluation"),t.length===0)return"";for(let n=0;n<t.length-1;n++)await R(e,"tuple intermediate element",()=>E(e,t[n]));return R(e,"tuple final element",()=>E(e,t[t.length-1]))}Ue(q);function we(e){if(e.maxOutputSize>0&&e.output.length>e.maxOutputSize)throw new w(`awk: output size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output)}function D(e,t){B(e.requireDefenseContext,"awk",t)}function S(e,t,n){return U(e.requireDefenseContext,"awk",t,n)}async function q(e,t){D(e,"block execution");for(let n of t)if(await S(e,"statement execution",()=>H(e,n)),Bt(e))break}function Bt(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}async function H(e,t){switch(D(e,"single statement execution"),e.coverage?.hit(`awk:stmt:${t.type}`),t.type){case"block":await S(e,"nested block statement",()=>q(e,t.statements));break;case"expr_stmt":await S(e,"expression statement",()=>E(e,t.expression));break;case"print":await S(e,"print statement",()=>Ut(e,t.args,t.output));break;case"printf":await S(e,"printf statement",()=>$t(e,t.format,t.args,t.output));break;case"if":await S(e,"if statement",()=>Ht(e,t));break;case"while":await S(e,"while statement",()=>Wt(e,t));break;case"do_while":await S(e,"do-while statement",()=>Vt(e,t));break;case"for":await S(e,"for statement",()=>zt(e,t));break;case"for_in":await S(e,"for-in statement",()=>Xt(e,t));break;case"break":e.loopBreak=!0;break;case"continue":e.loopContinue=!0;break;case"next":e.shouldNext=!0;break;case"nextfile":e.shouldNextFile=!0;break;case"exit":e.shouldExit=!0;{let n=t.code;e.exitCode=n?Math.floor(b(await S(e,"exit code expression",()=>E(e,n)))):0}break;case"return":e.hasReturn=!0;{let n=t.value;e.returnValue=n?await S(e,"return expression",()=>E(e,n)):""}break;case"delete":await S(e,"delete statement",()=>Kt(e,t.target));break}}async function Ut(e,t,n){D(e,"print execution");let r=[];for(let a of t){let o=await S(e,"print argument evaluation",()=>E(e,a));typeof o=="number"?Number.isInteger(o)&&Math.abs(o)<Number.MAX_SAFE_INTEGER?r.push(String(o)):r.push(ie(e.OFMT,[o],e.maxOutputSize||void 0)):r.push(v(o))}let s=r.join(e.OFS)+e.ORS;n?await S(e,"print redirection write",()=>$e(e,n.redirect,n.file,s)):(e.output+=s,we(e))}async function $t(e,t,n,r){D(e,"printf execution");let s=v(await S(e,"printf format evaluation",()=>E(e,t))),a=[];for(let c of n)a.push(await S(e,"printf argument evaluation",()=>E(e,c)));let o=e.maxOutputSize>0?Math.max(0,e.maxOutputSize-V(e.output)):void 0,l=ie(s,a,o);r?await S(e,"printf redirection write",()=>$e(e,r.redirect,r.file,l)):(e.output+=l,we(e))}async function $e(e,t,n,r){D(e,"file write execution");let s=e.fs;if(!s||!e.cwd){e.output+=r,we(e);return}let a=v(await S(e,"redirection filename evaluation",()=>E(e,n))),o=s.resolvePath(e.cwd,a);t===">"?e.openedFiles.has(o)?await S(e,"redirection append write",()=>s.appendFile(o,r)):(await S(e,"redirection overwrite write",()=>s.writeFile(o,r)),e.openedFiles.add(o)):(e.openedFiles.has(o)||e.openedFiles.add(o),await S(e,"redirection append mode write",()=>s.appendFile(o,r)))}async function Ht(e,t){if(D(e,"if execution"),P(await S(e,"if condition evaluation",()=>E(e,t.condition))))await S(e,"if consequent execution",()=>H(e,t.consequent));else if(t.alternate){let n=t.alternate;await S(e,"if alternate execution",()=>H(e,n))}}async function Wt(e,t){D(e,"while execution");let n=0;for(;P(await S(e,"while condition evaluation",()=>E(e,t.condition)));){if(n++,n>e.maxIterations)throw new w(`awk: while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await S(e,"while body execution",()=>H(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function Vt(e,t){D(e,"do-while execution");let n=0;do{if(n++,n>e.maxIterations)throw new w(`awk: do-while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await S(e,"do-while body execution",()=>H(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}while(P(await S(e,"do-while condition evaluation",()=>E(e,t.condition))))}async function zt(e,t){D(e,"for execution");let n=t.init,r=t.condition,s=t.update;n&&await S(e,"for init evaluation",()=>E(e,n));let a=0;for(;!r||P(await S(e,"for condition evaluation",()=>E(e,r)));){if(a++,a>e.maxIterations)throw new w(`awk: for loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await S(e,"for body execution",()=>H(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break;s&&await S(e,"for update evaluation",()=>E(e,s))}}async function Xt(e,t){D(e,"for-in execution");let n=e.arrays[t.array];if(n)for(let r of Object.keys(n)){if(e.vars[t.variable]=r,e.loopContinue=!1,await S(e,"for-in body execution",()=>H(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function Kt(e,t){if(D(e,"delete execution"),t.type==="array_access"){let n=v(await S(e,"delete key evaluation",()=>E(e,t.key)));_e(e,t.array,n)}else t.type==="variable"&&Ge(e,t.name)}var J=class{ctx;program=null;rangeStates=[];constructor(t){this.ctx=t}assertDefenseContext(t){B(this.ctx.requireDefenseContext,"awk",t)}withDefenseContext(t,n){return U(this.ctx.requireDefenseContext,"awk",t,n)}execute(t){this.assertDefenseContext("program initialization"),this.program=t,this.ctx.output="";for(let n of t.functions)this.ctx.functions.set(n.name,n);this.rangeStates=t.rules.map(()=>!1)}async executeBegin(){if(this.assertDefenseContext("BEGIN execution entry"),!!this.program){for(let t of this.program.rules)if(t.pattern?.type==="begin"&&(await this.withDefenseContext("BEGIN block execution",()=>q(this.ctx,t.action.statements)),this.ctx.shouldExit))break}}async executeLine(t){if(this.assertDefenseContext("line execution entry"),!(!this.program||this.ctx.shouldExit)){if(this.ctx.recordsProcessed++,this.ctx.recordsProcessed>this.ctx.maxIterations)throw new w(`record limit exceeded (${this.ctx.maxIterations})`,"iterations");K(this.ctx,t),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.withDefenseContext("rule match",()=>this.matchesRule(r,n))&&await this.withDefenseContext("rule block execution",()=>q(this.ctx,r.action.statements))}}}async executeEnd(){if(this.assertDefenseContext("END execution entry"),!!this.program&&!this.ctx.inEndBlock){this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;for(let t of this.program.rules)if(t.pattern?.type==="end"&&(await this.withDefenseContext("END block execution",()=>q(this.ctx,t.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(t,n){this.assertDefenseContext("rule matching");let r=t.pattern;if(!r)return!0;switch(r.type){case"begin":case"end":return!1;case"regex_pattern":return Z(r.pattern,this.ctx.line);case"expr_pattern":return P(await this.withDefenseContext("expression pattern evaluation",()=>E(this.ctx,r.expression)));case"range":{let s=await this.withDefenseContext("range start pattern",()=>this.matchPattern(r.start)),a=await this.withDefenseContext("range end pattern",()=>this.matchPattern(r.end));return this.rangeStates[n]?(a&&(this.rangeStates[n]=!1),!0):s?(this.rangeStates[n]=!0,a&&(this.rangeStates[n]=!1),!0):!1}default:return!1}}async matchPattern(t){switch(this.assertDefenseContext("pattern matching"),t.type){case"regex_pattern":return Z(t.pattern,this.ctx.line);case"expr_pattern":return P(await this.withDefenseContext("nested expression pattern",()=>E(this.ctx,t.expression)));default:return!1}}};var i;(function(e){e.NUMBER="NUMBER",e.STRING="STRING",e.REGEX="REGEX",e.IDENT="IDENT",e.BEGIN="BEGIN",e.END="END",e.IF="IF",e.ELSE="ELSE",e.WHILE="WHILE",e.DO="DO",e.FOR="FOR",e.IN="IN",e.BREAK="BREAK",e.CONTINUE="CONTINUE",e.NEXT="NEXT",e.NEXTFILE="NEXTFILE",e.EXIT="EXIT",e.RETURN="RETURN",e.DELETE="DELETE",e.FUNCTION="FUNCTION",e.PRINT="PRINT",e.PRINTF="PRINTF",e.GETLINE="GETLINE",e.PLUS="PLUS",e.MINUS="MINUS",e.STAR="STAR",e.SLASH="SLASH",e.PERCENT="PERCENT",e.CARET="CARET",e.EQ="EQ",e.NE="NE",e.LT="LT",e.GT="GT",e.LE="LE",e.GE="GE",e.MATCH="MATCH",e.NOT_MATCH="NOT_MATCH",e.AND="AND",e.OR="OR",e.NOT="NOT",e.ASSIGN="ASSIGN",e.PLUS_ASSIGN="PLUS_ASSIGN",e.MINUS_ASSIGN="MINUS_ASSIGN",e.STAR_ASSIGN="STAR_ASSIGN",e.SLASH_ASSIGN="SLASH_ASSIGN",e.PERCENT_ASSIGN="PERCENT_ASSIGN",e.CARET_ASSIGN="CARET_ASSIGN",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.QUESTION="QUESTION",e.COLON="COLON",e.COMMA="COMMA",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.LBRACKET="LBRACKET",e.RBRACKET="RBRACKET",e.DOLLAR="DOLLAR",e.APPEND="APPEND",e.PIPE="PIPE",e.EOF="EOF"})(i||(i={}));var jt=new Map([["BEGIN",i.BEGIN],["END",i.END],["if",i.IF],["else",i.ELSE],["while",i.WHILE],["do",i.DO],["for",i.FOR],["in",i.IN],["break",i.BREAK],["continue",i.CONTINUE],["next",i.NEXT],["nextfile",i.NEXTFILE],["exit",i.EXIT],["return",i.RETURN],["delete",i.DELETE],["function",i.FUNCTION],["print",i.PRINT],["printf",i.PRINTF],["getline",i.GETLINE]]);function qt(e){return e.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 Qt=new Set([i.COMMA,i.LBRACE,i.AND,i.OR,i.QUESTION,i.COLON,i.DO,i.ELSE,i.IF,i.WHILE]),le=class{maxTokens;input;pos=0;line=1;column=1;lastTokenType=null;constructor(t,n=1e5){this.maxTokens=n,this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();if(n){if(t.length>=this.maxTokens)throw new w(`awk: token limit exceeded (${this.maxTokens})`,"array_elements");t.push(n),this.lastTokenType=n.type}}if(t.length>=this.maxTokens)throw new w(`awk: token limit exceeded (${this.maxTokens})`,"array_elements");return t.push(this.makeToken(i.EOF,"")),t}makeToken(t,n){return{type:t,value:n,line:this.line,column:this.column}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
|
|
8
|
-
`?(this.line++,this.column=1):this.column++,t}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.peek();if(t===" "||t===" "||t==="\r")this.advance();else if(t==="\\")if(this.peek(1)===`
|
|
9
|
-
`)this.advance(),this.advance();else break;else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
|
|
10
|
-
`;)this.advance();else break}}nextToken(){for(this.skipWhitespace();this.peek()===`
|
|
11
|
-
`&&this.lastTokenType!==null&&Qt.has(this.lastTokenType);)this.advance(),this.skipWhitespace();if(this.pos>=this.input.length)return null;let t=this.line,n=this.column,r=this.peek();return r===`
|
|
12
|
-
`?(this.advance(),{type:i.NEWLINE,value:`
|
|
13
|
-
`,line:t,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,i.NEWLINE,i.SEMICOLON,i.LBRACE,i.RBRACE,i.LPAREN,i.LBRACKET,i.COMMA,i.ASSIGN,i.PLUS_ASSIGN,i.MINUS_ASSIGN,i.STAR_ASSIGN,i.SLASH_ASSIGN,i.PERCENT_ASSIGN,i.CARET_ASSIGN,i.AND,i.OR,i.NOT,i.MATCH,i.NOT_MATCH,i.QUESTION,i.COLON,i.LT,i.GT,i.LE,i.GE,i.EQ,i.NE,i.PLUS,i.MINUS,i.STAR,i.PERCENT,i.CARET,i.PRINT,i.PRINTF,i.IF,i.WHILE,i.DO,i.FOR,i.RETURN]).has(this.lastTokenType)}readString(){let t=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+=`
|
|
14
|
-
`;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 a="";for(;a.length<2&&/[0-9a-fA-F]/.test(this.peek());)a+=this.advance();a.length>0?r+=String.fromCharCode(parseInt(a,16)):r+="x";break}default:if(/[0-7]/.test(s)){let a=s;for(;a.length<3&&/[0-7]/.test(this.peek());)a+=this.advance();r+=String.fromCharCode(parseInt(a,8))}else r+=s}}else r+=this.advance();return this.peek()==='"'&&this.advance(),{type:i.STRING,value:r,line:t,column:n}}readRegex(){let t=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()===`
|
|
15
|
-
`)break;r+=this.advance()}return this.peek()==="/"&&this.advance(),r=qt(r),{type:i.REGEX,value:r,line:t,column:n}}readNumber(){let t=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:i.NUMBER,value:parseFloat(r),line:t,column:n}}readIdentifier(){let t=this.line,n=this.column,r="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)r+=this.advance();let s=jt.get(r);return s!==void 0?{type:s,value:r,line:t,column:n}:{type:i.IDENT,value:r,line:t,column:n}}readOperator(){let t=this.line,n=this.column,r=this.advance(),s=this.peek();switch(r){case"+":return s==="+"?(this.advance(),{type:i.INCREMENT,value:"++",line:t,column:n}):s==="="?(this.advance(),{type:i.PLUS_ASSIGN,value:"+=",line:t,column:n}):{type:i.PLUS,value:"+",line:t,column:n};case"-":return s==="-"?(this.advance(),{type:i.DECREMENT,value:"--",line:t,column:n}):s==="="?(this.advance(),{type:i.MINUS_ASSIGN,value:"-=",line:t,column:n}):{type:i.MINUS,value:"-",line:t,column:n};case"*":return s==="*"?(this.advance(),{type:i.CARET,value:"**",line:t,column:n}):s==="="?(this.advance(),{type:i.STAR_ASSIGN,value:"*=",line:t,column:n}):{type:i.STAR,value:"*",line:t,column:n};case"/":return s==="="?(this.advance(),{type:i.SLASH_ASSIGN,value:"/=",line:t,column:n}):{type:i.SLASH,value:"/",line:t,column:n};case"%":return s==="="?(this.advance(),{type:i.PERCENT_ASSIGN,value:"%=",line:t,column:n}):{type:i.PERCENT,value:"%",line:t,column:n};case"^":return s==="="?(this.advance(),{type:i.CARET_ASSIGN,value:"^=",line:t,column:n}):{type:i.CARET,value:"^",line:t,column:n};case"=":return s==="="?(this.advance(),{type:i.EQ,value:"==",line:t,column:n}):{type:i.ASSIGN,value:"=",line:t,column:n};case"!":return s==="="?(this.advance(),{type:i.NE,value:"!=",line:t,column:n}):s==="~"?(this.advance(),{type:i.NOT_MATCH,value:"!~",line:t,column:n}):{type:i.NOT,value:"!",line:t,column:n};case"<":return s==="="?(this.advance(),{type:i.LE,value:"<=",line:t,column:n}):{type:i.LT,value:"<",line:t,column:n};case">":return s==="="?(this.advance(),{type:i.GE,value:">=",line:t,column:n}):s===">"?(this.advance(),{type:i.APPEND,value:">>",line:t,column:n}):{type:i.GT,value:">",line:t,column:n};case"&":return s==="&"?(this.advance(),{type:i.AND,value:"&&",line:t,column:n}):{type:i.IDENT,value:"&",line:t,column:n};case"|":return s==="|"?(this.advance(),{type:i.OR,value:"||",line:t,column:n}):{type:i.PIPE,value:"|",line:t,column:n};case"~":return{type:i.MATCH,value:"~",line:t,column:n};case"?":return{type:i.QUESTION,value:"?",line:t,column:n};case":":return{type:i.COLON,value:":",line:t,column:n};case",":return{type:i.COMMA,value:",",line:t,column:n};case";":return{type:i.SEMICOLON,value:";",line:t,column:n};case"(":return{type:i.LPAREN,value:"(",line:t,column:n};case")":return{type:i.RPAREN,value:")",line:t,column:n};case"{":return{type:i.LBRACE,value:"{",line:t,column:n};case"}":return{type:i.RBRACE,value:"}",line:t,column:n};case"[":return{type:i.LBRACKET,value:"[",line:t,column:n};case"]":return{type:i.RBRACKET,value:"]",line:t,column:n};case"$":return{type:i.DOLLAR,value:"$",line:t,column:n};default:return{type:i.IDENT,value:r,line:t,column:n}}}isDigit(t){return t>="0"&&t<="9"}isAlpha(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isAlphaNumeric(t){return this.isDigit(t)||this.isAlpha(t)}};var h={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"};function Xe(e){e.expect(h.PRINT);let t=[];if(e.check(h.NEWLINE)||e.check(h.SEMICOLON)||e.check(h.RBRACE)||e.check(h.PIPE)||e.check(h.GT)||e.check(h.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(e.assertArrayLength(t.length),t.push(ue(e));e.check(h.COMMA);)e.advance(),e.assertArrayLength(t.length),t.push(ue(e));let n;return e.check(h.GT)?(e.advance(),n={redirect:">",file:e.parsePrimary()}):e.check(h.APPEND)&&(e.advance(),n={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:n}}function ue(e){return Zt(e)?ge(e,!0):ge(e,!1)}function ge(e,t){let n=t?e.parseTernary():Yt(e);if(e.match(h.ASSIGN,h.PLUS_ASSIGN,h.MINUS_ASSIGN,h.STAR_ASSIGN,h.SLASH_ASSIGN,h.PERCENT_ASSIGN,h.CARET_ASSIGN)){let r=e.advance(),s=e.withDepth(()=>ge(e,t));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 Zt(e){let t=0,n=e.pos;for(;n<e.tokens.length;){e.useOperation();let r=e.tokens[n];if(r.type===h.LPAREN&&t++,r.type===h.RPAREN&&t--,r.type===h.QUESTION&&t===0)return!0;if(r.type===h.NEWLINE||r.type===h.SEMICOLON||r.type===h.RBRACE||r.type===h.COMMA||r.type===h.PIPE)return!1;n++}return!1}function Yt(e){let t=He(e);for(;e.check(h.OR);){e.advance();let n=He(e);t={type:"binary",operator:"||",left:t,right:n}}return t}function He(e){let t=We(e);for(;e.check(h.AND);){e.advance();let n=We(e);t={type:"binary",operator:"&&",left:t,right:n}}return t}function We(e){let t=Jt(e);if(e.check(h.IN)){e.advance();let n=String(e.expect(h.IDENT).value);return{type:"in",key:t,array:n}}return t}function Jt(e){let t=Ve(e);for(;en(e)&&!tn(e);){let n=Ve(e);t={type:"binary",operator:" ",left:t,right:n}}return t}function Ve(e){let t=ze(e);for(;e.match(h.MATCH,h.NOT_MATCH);){let n=e.advance().type===h.MATCH?"~":"!~",r=ze(e);t={type:"binary",operator:n,left:t,right:r}}return t}function ze(e){let t=e.parseAddSub();for(;e.match(h.LT,h.LE,h.GE,h.EQ,h.NE);){let n=e.advance(),r=e.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:r}}return t}function en(e){return e.match(h.NUMBER,h.STRING,h.IDENT,h.DOLLAR,h.LPAREN,h.NOT,h.MINUS,h.PLUS,h.INCREMENT,h.DECREMENT)}function tn(e){return e.match(h.AND,h.OR,h.QUESTION,h.ASSIGN,h.PLUS_ASSIGN,h.MINUS_ASSIGN,h.STAR_ASSIGN,h.SLASH_ASSIGN,h.PERCENT_ASSIGN,h.CARET_ASSIGN,h.COMMA,h.SEMICOLON,h.NEWLINE,h.RBRACE,h.RPAREN,h.RBRACKET,h.COLON,h.PIPE,h.APPEND,h.GT,h.IN)}function Ke(e){e.expect(h.PRINTF);let t=e.check(h.LPAREN);t&&(e.advance(),e.skipNewlines());let n=t?e.parseExpression():ue(e),r=[];for(;e.check(h.COMMA);)e.advance(),t&&e.skipNewlines(),e.assertArrayLength(r.length),r.push(t?e.parseExpression():ue(e));t&&(e.skipNewlines(),e.expect(h.RPAREN));let s;return e.check(h.GT)?(e.advance(),s={redirect:">",file:e.parsePrimary()}):e.check(h.APPEND)&&(e.advance(),s={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:n,args:r,output:s}}var ce=class{tokens=[];pos=0;depth=0;operations=0;limits;constructor(t={}){this.limits={maxSourceLength:t.maxSourceLength??10*1024*1024,maxTokens:t.maxTokens??1e5,maxDepth:t.maxDepth??100,maxOperations:t.maxOperations??1e5}}parse(t){if(t.length>this.limits.maxSourceLength)throw new w(`awk: source length limit exceeded (${this.limits.maxSourceLength})`,"string_length");let n=new le(t,this.limits.maxTokens);this.tokens=n.tokenize(),this.pos=0,this.depth=0,this.operations=0;let r=0;for(let s of this.tokens)if(this.useOperation(),s.type===i.LPAREN||s.type===i.LBRACKET||s.type===i.LBRACE){if(r++,r>this.limits.maxDepth)throw new w(`awk: parser depth limit exceeded (${this.limits.maxDepth})`,"recursion")}else(s.type===i.RPAREN||s.type===i.RBRACKET||s.type===i.RBRACE)&&(r=Math.max(0,r-1));return this.parseProgram()}setPos(t){this.pos=t}current(){return this.tokens[this.pos]||{type:i.EOF,value:"",line:0,column:0}}advance(){this.useOperation();let t=this.current();return this.pos<this.tokens.length&&this.pos++,t}useOperation(t=1){if(t>this.limits.maxOperations-this.operations)throw new w(`awk: parser operation limit exceeded (${this.limits.maxOperations})`,"iterations");this.operations+=t}withDepth(t){if(this.depth>=this.limits.maxDepth)throw new w(`awk: parser depth limit exceeded (${this.limits.maxDepth})`,"recursion");this.depth++;try{return t()}finally{this.depth--}}assertArrayLength(t){if(t>=this.limits.maxTokens)throw new w(`awk: AST array limit exceeded (${this.limits.maxTokens})`,"array_elements")}match(...t){return t.includes(this.current().type)}check(t){return this.current().type===t}expect(t,n){if(!this.check(t)){let r=this.current();throw new Error(n||`Expected ${t}, got ${r.type} at line ${r.line}:${r.column}`)}return this.advance()}skipNewlines(){for(;this.check(i.NEWLINE);)this.advance()}skipTerminators(){for(;this.check(i.NEWLINE)||this.check(i.SEMICOLON);)this.advance()}parseProgram(){let t=[],n=[];for(this.skipNewlines();!this.check(i.EOF)&&(this.skipNewlines(),!this.check(i.EOF));)this.check(i.FUNCTION)?t.push(this.parseFunction()):n.push(this.parseRule()),this.skipTerminators();return{functions:t,rules:n}}parseFunction(){this.expect(i.FUNCTION);let t=this.expect(i.IDENT).value;this.expect(i.LPAREN);let n=[];if(!this.check(i.RPAREN))for(n.push(this.expect(i.IDENT).value);this.check(i.COMMA);)this.advance(),n.push(this.expect(i.IDENT).value);this.expect(i.RPAREN),this.skipNewlines();let r=this.parseBlock();return{name:t,params:n,body:r}}parseRule(){let t;if(this.check(i.BEGIN))this.advance(),t={type:"begin"};else if(this.check(i.END))this.advance(),t={type:"end"};else if(this.check(i.LBRACE))t=void 0;else if(this.check(i.REGEX)){let r=this.advance();if(this.check(i.AND)||this.check(i.OR)){let s={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:r.value}};t={type:"expr_pattern",expression:this.parseLogicalOrRest(s)}}else{let s={type:"regex_pattern",pattern:r.value};if(this.check(i.COMMA)){this.advance();let a;this.check(i.REGEX)?a={type:"regex_pattern",pattern:this.advance().value}:a={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:a}}else t=s}}else{let s={type:"expr_pattern",expression:this.parseExpression()};if(this.check(i.COMMA)){this.advance();let a;this.check(i.REGEX)?a={type:"regex_pattern",pattern:this.advance().value}:a={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:a}}else t=s}this.skipNewlines();let n;return this.check(i.LBRACE)?n=this.parseBlock():n={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:t,action:n}}parseBlock(){this.expect(i.LBRACE),this.skipNewlines();let t=[];for(;!this.check(i.RBRACE)&&!this.check(i.EOF);)t.push(this.parseStatement()),this.skipTerminators();return this.expect(i.RBRACE),{type:"block",statements:t}}parseStatement(){return this.withDepth(()=>this.parseStatementAtDepth())}parseStatementAtDepth(){if(this.check(i.SEMICOLON)||this.check(i.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(i.LBRACE))return this.parseBlock();if(this.check(i.IF))return this.parseIf();if(this.check(i.WHILE))return this.parseWhile();if(this.check(i.DO))return this.parseDoWhile();if(this.check(i.FOR))return this.parseFor();if(this.check(i.BREAK))return this.advance(),{type:"break"};if(this.check(i.CONTINUE))return this.advance(),{type:"continue"};if(this.check(i.NEXT))return this.advance(),{type:"next"};if(this.check(i.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(i.EXIT)){this.advance();let n;return!this.check(i.NEWLINE)&&!this.check(i.SEMICOLON)&&!this.check(i.RBRACE)&&!this.check(i.EOF)&&(n=this.parseExpression()),{type:"exit",code:n}}if(this.check(i.RETURN)){this.advance();let n;return!this.check(i.NEWLINE)&&!this.check(i.SEMICOLON)&&!this.check(i.RBRACE)&&!this.check(i.EOF)&&(n=this.parseExpression()),{type:"return",value:n}}if(this.check(i.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(i.PRINT)?Xe(this):this.check(i.PRINTF)?Ke(this):{type:"expr_stmt",expression:this.parseExpression()}}parseIf(){this.expect(i.IF),this.expect(i.LPAREN);let t=this.parseExpression();this.expect(i.RPAREN),this.skipNewlines();let n=this.parseStatement();this.skipTerminators();let r;return this.check(i.ELSE)&&(this.advance(),this.skipNewlines(),r=this.parseStatement()),{type:"if",condition:t,consequent:n,alternate:r}}parseWhile(){this.expect(i.WHILE),this.expect(i.LPAREN);let t=this.parseExpression();this.expect(i.RPAREN),this.skipNewlines();let n=this.parseStatement();return{type:"while",condition:t,body:n}}parseDoWhile(){this.expect(i.DO),this.skipNewlines();let t=this.parseStatement();this.skipNewlines(),this.expect(i.WHILE),this.expect(i.LPAREN);let n=this.parseExpression();return this.expect(i.RPAREN),{type:"do_while",body:t,condition:n}}parseFor(){if(this.expect(i.FOR),this.expect(i.LPAREN),this.check(i.IDENT)){let a=this.advance();if(this.check(i.IN)){this.advance();let o=this.expect(i.IDENT).value;this.expect(i.RPAREN),this.skipNewlines();let l=this.parseStatement();return{type:"for_in",variable:a.value,array:o,body:l}}this.pos--}let t;this.check(i.SEMICOLON)||(t=this.parseExpression()),this.expect(i.SEMICOLON);let n;this.check(i.SEMICOLON)||(n=this.parseExpression()),this.expect(i.SEMICOLON);let r;this.check(i.RPAREN)||(r=this.parseExpression()),this.expect(i.RPAREN),this.skipNewlines();let s=this.parseStatement();return{type:"for",init:t,condition:n,update:r,body:s}}parseExpression(){return this.withDepth(()=>this.parseAssignment())}parseAssignment(){let t=this.parseTernary();if(this.match(i.ASSIGN,i.PLUS_ASSIGN,i.MINUS_ASSIGN,i.STAR_ASSIGN,i.SLASH_ASSIGN,i.PERCENT_ASSIGN,i.CARET_ASSIGN)){let n=this.advance(),r=this.parseExpression();if(t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid assignment target");let s=new Set(["=","+=","-=","*=","/=","%=","^="]),a=n.value;if(!s.has(a))throw new Error(`Unknown assignment operator: ${a}`);return{type:"assignment",operator:a,target:t,value:r}}return t}parseTernary(){let t=this.parsePipeGetline();if(this.check(i.QUESTION)){this.advance();let n=this.parseExpression();this.expect(i.COLON);let r=this.parseExpression();t={type:"ternary",condition:t,consequent:n,alternate:r}}return t}parsePipeGetline(){let t=this.parseOr();if(this.check(i.PIPE)){if(this.advance(),!this.check(i.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();let n;return this.check(i.IDENT)&&(n=this.advance().value),{type:"getline",command:t,variable:n}}return t}parseOr(){let t=this.parseAnd();for(;this.check(i.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalOrRest(t){for(t=this.parseLogicalAndRest(t);this.check(i.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalAndRest(t){for(;this.check(i.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseAnd(){let t=this.parseIn();for(;this.check(i.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseIn(){let t=this.parseConcatenation();if(this.check(i.IN)){this.advance();let n=this.expect(i.IDENT).value;return{type:"in",key:t,array:n}}return t}parseConcatenation(){let t=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){let n=this.parseMatch();t={type:"binary",operator:" ",left:t,right:n}}return t}parseMatch(){let t=this.parseComparison();for(;this.match(i.MATCH,i.NOT_MATCH);){let n=this.advance().type===i.MATCH?"~":"!~",r=this.parseComparison();t={type:"binary",operator:n,left:t,right:r}}return t}parseComparison(){let t=this.parseAddSub();for(;this.match(i.LT,i.LE,i.GT,i.GE,i.EQ,i.NE);){let n=this.advance(),r=this.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:r}}return t}canStartExpression(){return this.match(i.NUMBER,i.STRING,i.IDENT,i.DOLLAR,i.LPAREN,i.NOT,i.MINUS,i.PLUS,i.INCREMENT,i.DECREMENT)}isConcatTerminator(){return this.match(i.AND,i.OR,i.QUESTION,i.ASSIGN,i.PLUS_ASSIGN,i.MINUS_ASSIGN,i.STAR_ASSIGN,i.SLASH_ASSIGN,i.PERCENT_ASSIGN,i.CARET_ASSIGN,i.COMMA,i.SEMICOLON,i.NEWLINE,i.RBRACE,i.RPAREN,i.RBRACKET,i.COLON,i.PIPE,i.APPEND,i.IN)}parseAddSub(){let t=this.parseMulDiv();for(;this.match(i.PLUS,i.MINUS);){let n=this.advance().value,r=this.parseMulDiv();t={type:"binary",operator:n,left:t,right:r}}return t}parseMulDiv(){let t=this.parseUnary();for(;this.match(i.STAR,i.SLASH,i.PERCENT);){let n=this.advance(),r=this.parseUnary();t={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(n.value)??"*",left:t,right:r}}return t}parseUnary(){if(this.check(i.INCREMENT)){this.advance();let t=this.withDepth(()=>this.parseUnary());return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(i.DECREMENT)){this.advance();let t=this.withDepth(()=>this.parseUnary());return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(i.NOT,i.MINUS,i.PLUS)){let t=this.advance().value,n=this.withDepth(()=>this.parseUnary());return{type:"unary",operator:t,operand:n}}return this.parsePower()}parsePower(){let t=this.parsePostfix();if(this.check(i.CARET)){this.advance();let n=this.withDepth(()=>this.parsePower());t={type:"binary",operator:"^",left:t,right:n}}return t}parsePostfix(){let t=this.parsePrimary();if(this.check(i.INCREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:t}}if(this.check(i.DECREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:t}}return t}parseFieldIndex(){if(this.check(i.INCREMENT)){this.advance();let t=this.withDepth(()=>this.parseFieldIndex());return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(i.DECREMENT)){this.advance();let t=this.withDepth(()=>this.parseFieldIndex());return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(i.NOT,i.MINUS,i.PLUS)){let t=this.advance().value,n=this.withDepth(()=>this.parseFieldIndex());return{type:"unary",operator:t,operand:n}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let t=this.parseFieldIndexPrimary();if(this.check(i.CARET)){this.advance();let n=this.withDepth(()=>this.parseFieldIndexPower());t={type:"binary",operator:"^",left:t,right:n}}return t}parseFieldIndexPrimary(){if(this.check(i.NUMBER))return{type:"number",value:this.advance().value};if(this.check(i.STRING))return{type:"string",value:this.advance().value};if(this.check(i.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(i.LPAREN)){this.advance();let t=this.parseExpression();return this.expect(i.RPAREN),t}if(this.check(i.IDENT)){let t=this.advance().value;if(this.check(i.LPAREN)){this.advance();let n=[];if(!this.check(i.RPAREN))for(n.push(this.parseExpression());this.check(i.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(i.RPAREN),{type:"call",name:t,args:n}}if(this.check(i.LBRACKET)){this.advance();let n=this.parseExpression();if(this.check(i.COMMA)){let r=[n];for(;this.check(i.COMMA);)this.advance(),r.push(this.parseExpression());this.expect(i.RBRACKET);let s=r.reduce((a,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:a,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:t,key:s}}return this.expect(i.RBRACKET),{type:"array_access",array:t,key:n}}return{type:"variable",name:t}}throw new Error(`Unexpected token in field index: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}parsePrimary(){if(this.check(i.NUMBER))return{type:"number",value:this.advance().value};if(this.check(i.STRING))return{type:"string",value:this.advance().value};if(this.check(i.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(i.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(i.LPAREN)){this.advance();let t=this.parseExpression();if(this.check(i.COMMA)){let n=[t];for(;this.check(i.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(i.RPAREN),{type:"tuple",elements:n}}return this.expect(i.RPAREN),t}if(this.check(i.GETLINE)){this.advance();let t,n;return this.check(i.IDENT)&&(t=this.advance().value),this.check(i.LT)&&(this.advance(),n=this.parsePrimary()),{type:"getline",variable:t,file:n}}if(this.check(i.IDENT)){let t=this.advance().value;if(this.check(i.LPAREN)){this.advance();let n=[];if(this.skipNewlines(),!this.check(i.RPAREN))for(n.push(this.parseExpression());this.check(i.COMMA);)this.advance(),this.skipNewlines(),n.push(this.parseExpression());return this.skipNewlines(),this.expect(i.RPAREN),{type:"call",name:t,args:n}}if(this.check(i.LBRACKET)){this.advance();let n=[this.parseExpression()];for(;this.check(i.COMMA);)this.advance(),n.push(this.parseExpression());this.expect(i.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:t,key:r}}return{type:"variable",name:t}}throw new Error(`Unexpected token: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}};var nn={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"]},mi={name:"awk",async execute(e,t){B(t.requireDefenseContext,"awk","execution entry");let n=(m,y)=>U(t.requireDefenseContext,"awk",m,y);if(Ae(e))return Re(nn);let r=new X(/\s+/),s=" ",a=Object.create(null),o=0;for(let m=0;m<e.length;m++){let y=e[m];if(y==="-F"&&m+1<e.length)s=Se(e[++m]),r=je(s),o=m+1;else if(y.startsWith("-F"))s=Se(y.slice(2)),r=je(s),o=m+1;else if(y==="-v"&&m+1<e.length){let p=e[++m],N=p.indexOf("=");if(N>0){let g=p.slice(0,N),d=Se(p.slice(N+1));a[g]=d}o=m+1}else{if(y.startsWith("--"))return pe("awk",y);if(y.startsWith("-")&&y.length>1){let p=y[1];if(p!=="F"&&p!=="v")return pe("awk",`-${p}`);o=m+1}else if(!y.startsWith("-")){o=m;break}}}if(o>=e.length)return{stdout:"",stderr:`awk: missing program
|
|
16
|
-
`,exitCode:1};let l=e[o],c=e.slice(o+1),u=new ce({maxSourceLength:t.limits.maxStringLength,maxTokens:t.limits.maxAwkParserTokens,maxDepth:t.limits.maxAwkParserDepth,maxOperations:t.limits.maxAwkParserOperations}),f;try{f=u.parse(l)}catch(m){return z(m),{stdout:"",stderr:`awk: ${m instanceof Error?m.message:String(m)}
|
|
17
|
-
`,exitCode:1}}let k={readFile:t.fs.readFile.bind(t.fs),writeFile:t.fs.writeFile.bind(t.fs),appendFile:async(m,y)=>{try{let p=await n("appendFile read",()=>t.fs.readFile(m));await n("appendFile write",()=>t.fs.writeFile(m,p+y))}catch(p){if(p instanceof $)throw p;await n("appendFile create",()=>t.fs.writeFile(m,y))}},resolvePath:t.fs.resolvePath.bind(t.fs)},C=t.exec,A=fe({fieldSep:r,maxIterations:t.limits.maxAwkIterations,maxOutputSize:Math.min(t.limits.maxStringLength,t.limits.maxOutputSize),maxArrayElements:t.limits.maxArrayElements,fs:k,cwd:t.cwd,exec:C?m=>n("command pipe exec",()=>C(m,{cwd:t.cwd,signal:t.signal})):void 0,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext});A.FS=s,A.vars=Object.assign(Object.create(null),a),A.ARGC=c.length+1,A.ARGV=Object.create(null),A.ARGV[0]="awk";for(let m=0;m<c.length;m++)A.ARGV[String(m+1)]=c[m];A.ENVIRON=Ie(t.env);let T=new J(A);T.execute(f);let he=f.rules.some(m=>m.pattern?.type!=="begin"&&m.pattern?.type!=="end"),W=f.rules.some(m=>m.pattern?.type==="end");try{if(await n("BEGIN execution",()=>T.executeBegin()),A.shouldExit)return await n("END execution after BEGIN exit",()=>T.executeEnd()),{stdout:T.getOutput(),stderr:"",exitCode:T.getExitCode()};if(!he&&!W)return{stdout:T.getOutput(),stderr:"",exitCode:T.getExitCode()};let m=Math.min(t.limits.maxInputBytes,t.limits.maxStringLength),y=t.limits.maxArrayElements,p=0,N=async(g,d)=>{let I=V(d);if(I>m-p)throw new w(`aggregate input size limit exceeded (${m} bytes)`,"string_length");p+=I;let x=d.length>0?1:0;for(let Q=0;Q<d.length;Q++)if(d.charCodeAt(Q)===10&&x++,x>y+1)throw new w(`record array limit exceeded (${y})`,"array_elements");let G=d.split(`
|
|
18
|
-
`);if(G.length>0&&G[G.length-1]===""&&G.pop(),G.length>y)throw new w(`record array limit exceeded (${y})`,"array_elements");for(A.FILENAME=g,A.FNR=0,A.lines=G,A.lineIndex=-1,A.shouldNextFile=!1;A.lineIndex<G.length-1;){A.lineIndex++;let Q=A.lineIndex;if(await n("line execution",()=>T.executeLine(G[Q])),A.shouldExit||A.shouldNextFile)break}};if(c.length>0)for(let g of c){let d;try{let I=t.fs.resolvePath(t.cwd,g);if((await n("input file stat",()=>t.fs.stat(I))).size>m-p)throw new w(`aggregate input size limit exceeded (${m} bytes)`,"string_length");d=await n("input file read",()=>t.fs.readFile(I))}catch(I){if(I instanceof $||I instanceof w)throw I;return{stdout:"",stderr:`awk: ${g}: No such file or directory
|
|
19
|
-
`,exitCode:1}}if(await n("input processing",()=>N(g,d)),A.shouldExit)break}else await n("stdin processing",()=>N("",ee(t.stdin)));return await n("END execution",()=>T.executeEnd()),{stdout:T.getOutput(),stderr:"",exitCode:T.getExitCode()}}catch(m){if(m instanceof $)throw m;let y=m instanceof Error?m.message:String(m),p=m instanceof w?w.EXIT_CODE:2;return{stdout:T.getOutput(),stderr:`awk: ${y}
|
|
20
|
-
`,exitCode:p}}}};function Se(e){return e.replace(/\\t/g," ").replace(/\\n/g,`
|
|
21
|
-
`).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function je(e){if(e===" ")return O("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return O(e)}catch{return O(qe(e))}return O(qe(e))}function qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ni={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{mi as a,Ni as b};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as h}from"./chunk-UHHCL65P.js";import{a as y,b as w,c as g}from"./chunk-QAYAQNCG.js";var $={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING, not 'now'","-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"]};function N(e){try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),!0}catch{return!1}}function S(e,a){let i=new Intl.DateTimeFormat("en-US",{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),t=o=>i.find(l=>l.type===o)?.value??"00",r=Number.parseInt(t("hour"),10)%24,s=new Date(`${t("year")}-${t("month")}-${t("day")}T${String(r).padStart(2,"0")}:${t("minute")}:${t("second")}Z`);return Number.isNaN(s.getTime())?null:s}function I(e,a){let i=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/);if(!i)return null;let[,t,r,s,o="00",l="00",c="00"]=i,p=new Date(`${t}-${r}-${s}T${o}:${l}:${c}Z`);if(Number.isNaN(p.getTime()))return null;try{let u=p;for(let d=0;d<3;d++){let f=S(u,a);if(f===null)return null;let m=f.getTime()-p.getTime();if(m===0)return u;u=new Date(u.getTime()-m)}return u}catch{return null}}function b(e,a){if(e.startsWith("@")){let r=e.slice(1);if(!/^-?\d+$/.test(r))return null;let s=Number(r);if(!Number.isSafeInteger(s))return null;let o=new Date(s*1e3);return Number.isNaN(o.getTime())?null:o}let i=e.toLowerCase().trim();if(i==="now"||i==="today")return new Date;if(i==="yesterday")return new Date(Date.now()-864e5);if(i==="tomorrow")return new Date(Date.now()+864e5);if(a&&!/Z$/i.test(e)&&!/[+-]\d{2}:?\d{2}$/.test(e)){let r=I(e,a);if(r)return r}let t=new Date(e);return Number.isNaN(t.getTime())?null:t}var x={name:"date",async execute(e,a){if(w(e))return y($);let i=!1,t=null,r=null,s=!1,o=!1;for(let m=0;m<e.length;m++){let n=e[m];if(n==="-u"||n==="--utc")i=!0;else if(n==="-d"||n==="--date")t=e[++m]??"";else if(n.startsWith("--date="))t=n.slice(7);else if(n==="-I"||n==="--iso-8601")s=!0;else if(n==="-R"||n==="--rfc-email")o=!0;else if(n.startsWith("+"))r=n.slice(1);else{if(n.startsWith("--"))return g("date",n);if(n.startsWith("-"))for(let T of n.slice(1))if(T==="u")i=!0;else if(T==="I")s=!0;else if(T==="R")o=!0;else return g("date",`-${T}`)}}let l=a.env.get("TZ");l&&!N(l)&&(l=void 0);let c=i?"UTC":l??"UTC",p=t!==null?b(t,l):new Date;if(!p)return{stdout:"",stderr:`date: invalid date '${t}'
|
|
3
|
-
`,exitCode:1};let u=Math.floor(p.getTime()/1e3),d,f={maxOperations:a.limits.maxLoopIterations,maxOutputBytes:Math.min(a.limits.maxStringLength,a.limits.maxOutputSize)-1};return r?d=h(r,u,c,f):s?d=h("%Y-%m-%dT%H:%M:%S%z",u,c,f):o?d=h("%a, %d %b %Y %H:%M:%S %z",u,c,f):d=h("%a %b %e %H:%M:%S %Z %Y",u,c,f),{stdout:`${d}
|
|
4
|
-
`,stderr:"",exitCode:0}}},z={name:"date",flags:[{flag:"-d",type:"value",valueHint:"string"},{flag:"-u",type:"boolean"},{flag:"-I",type:"boolean"},{flag:"-R",type:"boolean"}]};export{x as a,z as b};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{e as X}from"./chunk-DIWMSSQY.js";import{d as I}from"./chunk-2WBUTDF5.js";import{l as W,m as Z}from"./chunk-EFORKKSH.js";import{a as G}from"./chunk-GN6CQ3J4.js";import{a as V}from"./chunk-QIQMJJZ4.js";import{a as q,b as Q}from"./chunk-QAYAQNCG.js";function h(s,t,e){if(G(e)>s.limits.maxOutputSize-G(t))throw new W(`ls: output size limit exceeded (${s.limits.maxOutputSize} bytes)`,"output_size");return t+e}function tt(s,t){if(t>s.limits.maxArrayElements)throw new W(`ls: array element limit exceeded (${s.limits.maxArrayElements})`,"array_elements")}function ot(s,t,e){tt(s,e),t.reserve(e)}function x(s,t){let e=new X(s.limits.maxOutputSize,"ls");for(let l=0;l<t.length;l++)l>0&&e.append(`
|
|
3
|
-
`),e.append(t[l]);return t.length>0&&e.append(`
|
|
4
|
-
`),e.build()}function j(s){if(s<1024)return String(s);if(s<1024*1024){let e=s/1024;return e<10?`${e.toFixed(1)}K`:`${Math.round(e)}K`}if(s<1024*1024*1024){let e=s/1048576;return e<10?`${e.toFixed(1)}M`:`${Math.round(e)}M`}let t=s/(1024*1024*1024);return t<10?`${t.toFixed(1)}G`:`${Math.round(t)}G`}function B(s){let e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s.getMonth()],l=String(s.getDate()).padStart(2," "),m=new Date,g=new Date(m.getTime()-4320*60*60*1e3);if(s>g){let D=String(s.getHours()).padStart(2,"0"),u=String(s.getMinutes()).padStart(2,"0");return`${e} ${l} ${D}:${u}`}let b=s.getFullYear();return`${e} ${l} ${b}`}function H(s){return s.isDirectory?"/":s.isSymbolicLink?"@":(s.mode&73)!==0?"*":""}var it={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","-F, --classify append indicator (one of */=>@) to entries","-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"]},at={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"},classifyFiles:{short:"F",long:"classify",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},gt={name:"ls",async execute(s,t){if(Q(s))return q(it);let e=V("ls",s,at);if(!e.ok)return e.error;let l=e.result.flags.showAll,m=e.result.flags.showAlmostAll,g=e.result.flags.longFormat,b=e.result.flags.humanReadable,D=e.result.flags.recursive,u=e.result.flags.reverse,w=e.result.flags.classifyFiles,P=e.result.flags.directoryOnly,R=lt(s,e.result.flags.sortBySize,e.result.flags.sortByTime);e.result.flags.onePerLine;let z=e.result.positional;z.length===0&&z.push(".");let $="",E="",C=0,O=new I({limits:t.limits,signal:t.signal,executionScope:t.executionScope,site:"ls"});if(P){for(let n of await K(z,t,R,u,O)){O.visit(0);let i=t.fs.resolvePath(t.cwd,n);try{let v=await t.fs.stat(i);if(g){let L=v.isDirectory?"drwxr-xr-x":"-rw-r--r--",c=w?H(await t.fs.lstat(i)):"",S=v.size??0,y=b?j(S).padStart(5):String(S).padStart(5),f=v.mtime??new Date(0),o=B(f);$=h(t,$,`${L} 1 user user ${y} ${o} ${n}${c}
|
|
5
|
-
`)}else{let L=w?H(await t.fs.lstat(i)):"";$=h(t,$,`${n}${L}
|
|
6
|
-
`)}}catch{E=h(t,E,`ls: cannot access '${n}': No such file or directory
|
|
7
|
-
`),C=2}}return{stdout:$,stderr:E,exitCode:C}}let d=[],p=[];for(let n of z){O.visit(0);try{(await t.fs.stat(t.fs.resolvePath(t.cwd,n))).isDirectory?(p.length>0&&O.reserve(1),p.push(n)):d.push(n)}catch{E=h(t,E,`ls: ${n}: No such file or directory
|
|
8
|
-
`),C=2}}let k=async(n,i)=>{let v=await et(n,t,l,m,g,D,i,u,b,R,w,!1,O,0,new Set,!0);$=h(t,$,v.stdout),E=h(t,E,v.stderr),v.exitCode!==0&&(C=v.exitCode)};for(let n of await K(d,t,R,u,O))await k(n,!1);let N=z.length>1;for(let n of await K(p,t,R,u,O))$&&($=h(t,$,`
|
|
9
|
-
`)),await k(n,N);return{stdout:$,stderr:E,exitCode:C}}};function lt(s,t,e){if(!t&&!e)return"name";if(t!==e)return t?"size":"time";let l="name";for(let m of s){if(m==="--")break;if(!(!m.startsWith("-")||m.startsWith("--")))for(let g of m.slice(1))g==="S"?l="size":g==="t"&&(l="time")}return l}async function K(s,t,e,l,m){return await U(s,g=>t.fs.resolvePath(t.cwd,g),t,e,l,m)}async function U(s,t,e,l,m,g){let b=[...s];if(l==="name")b.sort();else{g?.checkpoint(b.length);let D=new Map;for(let u of b)try{let w=await e.fs.lstat(t(u));D.set(u,l==="size"?w.size??0:(w.mtime??new Date(0)).getTime())}catch{D.set(u,0)}b.sort((u,w)=>{let P=(D.get(w)??0)-(D.get(u)??0);return P!==0?P:u<w?-1:u>w?1:0})}return m&&b.reverse(),b}async function et(s,t,e,l,m,g,b,D=!1,u=!1,w="name",P=!1,R=!1,z=new I({limits:t.limits,signal:t.signal,executionScope:t.executionScope,site:"ls"}),$=0,E=new Set,C=!1){let O=e||l,d=t.fs.resolvePath(t.cwd,s);try{C||z.visit($);let p=await t.fs.stat(d);if(!p.isDirectory){let c=P?H(await t.fs.lstat(d)):"";if(m){let S=p.size??0,y=u?j(S).padStart(5):String(S).padStart(5),f=p.mtime??new Date(0),o=B(f);return{stdout:`-rw-r--r-- 1 user user ${y} ${o} ${s}${c}
|
|
10
|
-
`,stderr:"",exitCode:0}}return{stdout:`${s}${c}
|
|
11
|
-
`,stderr:"",exitCode:0}}let k=p.identity??(p.dev!==void 0&&p.ino!==void 0?`${String(p.dev)}:${String(p.ino)}`:await t.fs.realpath(d).catch(()=>{}));if(k!==void 0&&E.has(k))return{stdout:"",stderr:`ls: ${s}: symbolic link cycle detected
|
|
12
|
-
`,exitCode:2};let N=new Set(E);k!==void 0&&N.add(k);let n=await t.fs.readdir(d);z.checkpoint(),ot(t,z,n.length+(e?2:0)),O||(n=n.filter(c=>!c.startsWith("."))),n=await U(n,c=>d==="/"?`/${c}`:`${d}/${c}`,t,w,!1,z),e&&(n=[".","..",...n]),D&&n.reverse();let i="",v="",L=0;if((g||b)&&(i=h(t,i,`${s}:
|
|
13
|
-
`)),m){i=h(t,i,`total ${n.length}
|
|
14
|
-
`);let c=n.filter(o=>o==="."||o===".."),S=n.filter(o=>o!=="."&&o!=="..");for(let o of c)i=h(t,i,`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${o}
|
|
15
|
-
`);let y=[];for(let o=0;o<S.length;o+=100){let F=S.slice(o,o+100),r=await Promise.all(F.map(async a=>{let M=d==="/"?`/${a}`:`${d}/${a}`;try{let A=await t.fs.stat(M),J=A.isDirectory?"drwxr-xr-x":"-rw-r--r--",_=P?H(await t.fs.lstat(M)):"",Y=A.size??0,st=u?j(Y).padStart(5):String(Y).padStart(5),rt=A.mtime??new Date(0),nt=B(rt);return{name:a,line:`${J} 1 user user ${st} ${nt} ${a}${_}
|
|
16
|
-
`}}catch{return{name:a,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${a}
|
|
17
|
-
`}}}));y.push(...r)}let f=new Map(S.map((o,F)=>[o,F]));y.sort((o,F)=>(f.get(o.name)??0)-(f.get(F.name)??0));for(let{line:o}of y)i=h(t,i,o)}else if(P){let c=[],S=n.filter(f=>f!=="."&&f!==".."),y=n.filter(f=>f==="."||f==="..");for(let f of y)c.push(`${f}/`);for(let f=0;f<S.length;f+=100){let o=S.slice(f,f+100),F=await Promise.all(o.map(async r=>{let a=d==="/"?`/${r}`:`${d}/${r}`;try{let M=await t.fs.lstat(a);return`${r}${H(M)}`}catch{return r}}));c.push(...F)}i=h(t,i,x(t,c))}else i=h(t,i,x(t,n));if(g){let c=n.filter(r=>r!=="."&&r!==".."),S=new Set(c),y=[];if(t.fs.readdirWithFileTypes){let r=await t.fs.readdirWithFileTypes(d);z.checkpoint(),tt(t,r.length),y=r.filter(a=>a.isDirectory&&S.has(a.name)).map(a=>({name:a.name,isDirectory:!0}))}else for(let r=0;r<c.length;r+=100){let a=c.slice(r,r+100),M=await Promise.all(a.map(async A=>{let J=d==="/"?`/${A}`:`${d}/${A}`;try{let _=await t.fs.stat(J);return{name:A,isDirectory:_.isDirectory}}catch{return{name:A,isDirectory:!1}}}));y.push(...M.filter(A=>A.isDirectory))}let f=await U(y.map(r=>r.name),r=>d==="/"?`/${r}`:`${d}/${r}`,t,w,D,z),o=new Map(f.map((r,a)=>[r,a]));y.sort((r,a)=>(o.get(r.name)??0)-(o.get(a.name)??0));let F=[];for(let r of y){let a=s==="."?`./${r.name}`:`${s}/${r.name}`,M=await et(a,t,e,l,m,g,!1,D,u,w,P,!0,z,$+1,N);F.push({name:r.name,result:M})}F.sort((r,a)=>(o.get(r.name)??0)-(o.get(a.name)??0));for(let{result:r}of F)i=h(t,i,`
|
|
18
|
-
`),i=h(t,i,r.stdout),v=h(t,v,r.stderr),r.exitCode!==0&&(L=r.exitCode)}return{stdout:i,stderr:v,exitCode:L}}catch(p){if(p instanceof W||p instanceof Z)throw p;return{stdout:"",stderr:`ls: ${s}: No such file or directory
|
|
19
|
-
`,exitCode:2}}}var yt={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:"-F",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0};export{gt as a,yt as b};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as E}from"./chunk-U7UNEMLJ.js";import{a as h}from"./chunk-2WBUTDF5.js";import{l as $}from"./chunk-EFORKKSH.js";import{a as k}from"./chunk-GN6CQ3J4.js";import{a as C,b as L,c as F}from"./chunk-QAYAQNCG.js";var A={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, ..."]},S=1e5,_=0;function U(e){return Uint8Array.from(e,t=>t.charCodeAt(0))}function N(e){let t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;let i=Number(t[1]);if(!Number.isSafeInteger(i)||i<1)return null;let u=(t[2]||"").toUpperCase(),a=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return a===void 0||i>Math.floor(Number.MAX_SAFE_INTEGER/a)?null:i*a}function x(e){if(!/^[0-9]+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)&&t>=1?t:null}function H(e,t,i){if(t)return e.toString().padStart(i,"0");let u="abcdefghijklmnopqrstuvwxyz",n=new Array(i),a=e;for(let o=i-1;o>=0;o--)n[o]=u[a%26],a=Math.floor(a/26);return n.join("")}function B(e,t){let i=[],u=0,n=0;for(let a=0;a<e.length;a++)e[a]===10&&(n++,n===t&&(i.push(e.subarray(u,a+1)),u=a+1,n=0));return u<e.length&&i.push(e.subarray(u)),i}function T(e,t){let i=[];for(let u=0;u<e.length;u+=t)i.push(e.subarray(u,u+t));return i}function X(e,t){let i=[],u=Math.ceil(e.length/t);for(let n=0;n<t;n++){let a=n*u,o=Math.min(a+u,e.length);a<o&&i.push(e.subarray(a,o))}return i}function z(e,t){let i=e?10**t:26**t;return Number.isSafeInteger(i)?i:Number.MAX_SAFE_INTEGER}function G(e){if(e.existence!=="unknown")return e.existence==="existing"?e.stableIdentity:e.canonicalPath===void 0?void 0:`missing:${e.canonicalPath}`}function I(e,t){return e.existence!==t.existence||e.existence==="unknown"||t.existence==="unknown"?!1:e.existence==="missing"&&t.existence==="missing"?e.canonicalPath===t.canonicalPath:e.existence==="existing"&&t.existence==="existing"?e.stableIdentity!==void 0&&e.stableIdentity===t.stableIdentity:!1}async function M(e,t,i){let u=t.lastIndexOf("/"),n=u<=0?"/":t.slice(0,u),a=t.slice(u+1);for(let o=0;o<100;o++){let d=_++,c=e.fs.resolvePath(n,`.${a}.just-bash-split-${i}-${d}`),p=await h(e.fs,c);if(p.existence==="missing")return c;if(p.existence==="unknown")break}throw new Error("unable to allocate transaction path")}var Z={name:"split",execute:async(e,t)=>{if(L(e))return C(A);let i={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],n=0;for(;n<e.length;){let s=e[n];if(s==="-l"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${e[n+1]}'
|
|
3
|
-
`};i.mode="lines",i.lines=l,n+=2}else if(s.match(/^-l\d+$/)){let l=x(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s.slice(2)}'
|
|
4
|
-
`};i.mode="lines",i.lines=l,n++}else if(s==="-b"&&n+1<e.length){let l=N(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${e[n+1]}'
|
|
5
|
-
`};i.mode="bytes",i.bytes=l,n+=2}else if(s.match(/^-b.+$/)){let l=N(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s.slice(2)}'
|
|
6
|
-
`};i.mode="bytes",i.bytes=l,n++}else if(s==="-n"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${e[n+1]}'
|
|
7
|
-
`};i.mode="chunks",i.chunks=l,n+=2}else if(s.match(/^-n\d+$/)){let l=x(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${s.slice(2)}'
|
|
8
|
-
`};i.mode="chunks",i.chunks=l,n++}else if(s==="-a"&&n+1<e.length){let l=x(e[n+1]);if(l===null||l>Math.min(t.limits.maxStringLength,t.limits.maxArrayElements))return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${e[n+1]}'
|
|
9
|
-
`};i.suffixLength=l,n+=2}else if(s.match(/^-a\d+$/)){let l=x(s.slice(2));if(l===null||l>Math.min(t.limits.maxStringLength,t.limits.maxArrayElements))return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${s.slice(2)}'
|
|
10
|
-
`};i.suffixLength=l,n++}else if(s==="-d"||s==="--numeric-suffixes")i.useNumericSuffix=!0,n++;else if(s.startsWith("--additional-suffix="))i.additionalSuffix=s.slice(20),n++;else if(s==="--additional-suffix"&&n+1<e.length)i.additionalSuffix=e[n+1],n+=2;else if(s==="--"){u.push(...e.slice(n+1));break}else{if(s.startsWith("-")&&s!=="-")return F("split",s);u.push(s),n++}}let a="-",o="x";if(u.length>=1&&(a=u[0]),u.length>=2&&(o=u[1]),u.length>2)return{exitCode:1,stdout:"",stderr:`split: extra operand '${u[2]}'
|
|
11
|
-
`};if(k(o)>t.limits.maxStringLength||k(i.additionalSuffix)>t.limits.maxStringLength||i.suffixLength>t.limits.maxStringLength-Math.min(t.limits.maxStringLength,k(o))-Math.min(t.limits.maxStringLength,k(i.additionalSuffix)))return{exitCode:1,stdout:"",stderr:`split: output filename exceeds configured string limit
|
|
12
|
-
`};let d,c=null,p;if(a==="-"){let s=t.stdin.length;p=t.executionScope?.reserveBytes("split transaction",s*2,"split"),d=U(t.stdin)}else{c=t.fs.resolvePath(t.cwd,a);try{let s=await t.fs.stat(c);if(p=t.executionScope?.reserveBytes("split transaction",s.size*2,"split"),d=await t.fs.readFileBuffer(c),d.byteLength>s.size)throw new $("split: input grew while being read","string_length");t.executionScope?.consumeInput(d.byteLength,"split")}catch(s){return p?.release(),E(s),{exitCode:1,stdout:"",stderr:`split: ${a}: No such file or directory
|
|
13
|
-
`}}}try{if(d.length===0)return{exitCode:0,stdout:"",stderr:""};if(i.mode==="chunks"&&i.chunks>S)return{exitCode:1,stdout:"",stderr:`split: too many output files (${i.chunks}), limit is ${S}
|
|
14
|
-
`};let s;switch(i.mode){case"lines":s=B(d,i.lines);break;case"bytes":s=T(d,i.bytes);break;case"chunks":s=X(d,i.chunks);break;default:return i.mode}if(s.length>S)return{exitCode:1,stdout:"",stderr:`split: too many output files (${s.length}), limit is ${S}
|
|
15
|
-
`};let l=z(i.useNumericSuffix,i.suffixLength);if(s.length>l)return{exitCode:1,stdout:"",stderr:`split: output file suffixes exhausted at ${l} files
|
|
16
|
-
`};t.executionScope?.consumeWork(s.length*i.suffixLength,"split suffix generation");let m=[],P=new Set,f=c?await h(t.fs,c):null;if(f?.existence==="unknown")return{exitCode:1,stdout:"",stderr:`split: cannot safely identify input file
|
|
17
|
-
`};for(let r=0;r<s.length;r++){let y=H(r,i.useNumericSuffix,i.suffixLength),b=`${o}${y}${i.additionalSuffix}`,v=t.fs.resolvePath(t.cwd,b),g=await h(t.fs,v),w=G(g);if(g.existence==="unknown"||w===void 0)return{exitCode:1,stdout:"",stderr:`split: cannot safely identify output file '${b}'
|
|
18
|
-
`};if(w!==void 0&&P.has(w))return{exitCode:1,stdout:"",stderr:`split: duplicate output file '${b}'
|
|
19
|
-
`};if(f!==null&&(f.existence==="existing"&&g.existence==="existing"&&f.stableIdentity!==void 0&&f.stableIdentity===g.stableIdentity||f.canonicalPath!==void 0&&f.canonicalPath===g.canonicalPath))return{exitCode:1,stdout:"",stderr:`split: output file '${b}' would overwrite input
|
|
20
|
-
`};w!==void 0&&P.add(w),m.push({path:v,displayName:b,content:s[r],initialIdentity:g,stagePath:"",committed:!1})}try{for(let r of m)r.stagePath=await M(t,r.path,"stage"),await t.fs.writeFile(r.stagePath,r.content);if(c!==null&&f!==null&&!I(f,await h(t.fs,c)))throw new Error("input identity changed during split");for(let r of m){let y=await h(t.fs,r.path);if(!I(r.initialIdentity,y))throw new Error("output identity changed during split");if(f?.existence==="existing"&&y.existence==="existing"&&f.stableIdentity===y.stableIdentity)throw new Error("output aliases input")}for(let r of m){if(!I(r.initialIdentity,await h(t.fs,r.path)))throw new Error("output identity changed during split");r.initialIdentity.existence==="existing"&&(r.backupPath=await M(t,r.path,"backup"),await t.fs.mv(r.path,r.backupPath)),await t.fs.mv(r.stagePath,r.path),r.committed=!0}for(let r of m)r.backupPath&&(await t.fs.rm(r.backupPath,{force:!0,recursive:!0}).catch(()=>{}),r.backupPath=void 0)}catch{for(let r of[...m].reverse())r.committed&&await t.fs.rm(r.path,{force:!0,recursive:!0}).catch(()=>{}),r.backupPath&&await t.fs.mv(r.backupPath,r.path).catch(()=>{}),r.stagePath&&await t.fs.rm(r.stagePath,{force:!0,recursive:!0}).catch(()=>{});return{exitCode:1,stdout:"",stderr:`split: failed to write output
|
|
21
|
-
`}}return{exitCode:0,stdout:"",stderr:""}}finally{p?.release()}}},Y={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};export{Z as a,Y as b};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as _}from"./chunk-WZQNMEQW.js";import{a as $e}from"./chunk-TDD4NFYE.js";import{a as D}from"./chunk-7GA3QWJJ.js";import{b as le}from"./chunk-CBM6J4AL.js";import{a as q}from"./chunk-GN6CQ3J4.js";import{a as Se,b as Be,c as fe}from"./chunk-QAYAQNCG.js";var nt="file",it="link",st="symlink",Le="directory",at={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},ot={0:nt,1:it,2:st,3:"character-device",4:"block-device",5:Le,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},ct=new Uint8Array(512),V=new Uint8Array(0),I=new TextEncoder,Q=new TextDecoder;function P(e,t,r,n){n&&I.encodeInto(n,e.subarray(t,t+r))}function j(e,t,r,n){if(n===void 0)return;let i=n.toString(8).padStart(r-1,"0");I.encodeInto(i,e.subarray(t,t+r-1))}function F(e,t,r){let n=e.indexOf(0,t),i=n===-1||n>t+r?t+r:n;return Q.decode(e.subarray(t,i))}function me(e,t,r){let n=0,i=t+r;for(let s=t;s<i;s++){let a=e[s];if(a===0)break;a!==32&&(n=n*8+(a-48))}return n}function Y(e,t,r){if(e[t]&128){let n=0;n=e[t]&127;for(let i=1;i<r;i++)n=n*256+e[t+i];if(!Number.isSafeInteger(n))throw new Error("TAR number too large");return n}return me(e,t,r)}var M=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ne(e){if(e==null)return V;if(e instanceof Uint8Array)return e;if(typeof e=="string")return I.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var Te=(e,t)=>{let r=e.split("/").filter(Boolean);return t>=r.length?"":r.slice(t).join("/")};function he(e,t){let{strip:r,filter:n,map:i}=t;if(!r&&!n&&!i)return e;let s={...e};if(r&&r>0){let o=Te(s.name,r);if(!o)return null;if(s.name=s.type==="directory"&&!o.endsWith("/")?`${o}/`:o,s.linkname){let c=s.linkname.startsWith("/");if(c||s.type==="link"){let l=Te(s.linkname,r);s.linkname=c?`/${l}`||"/":l}}}if(n?.(s)===!1)return null;let a=i?i(s):s;return a&&(!a.name||!a.name.trim()||a.name==="."||a.name==="/")?null:a}var K=256;function lt(){let e=new Array(K),t=e.length-1,r=0,n=0,i=0,s=o=>{let c=e[r];o===c.length?(e[r]=V,r=r+1&t):e[r]=c.subarray(o),i-=o,i===0&&e.length>K&&(e=new Array(K),t=K-1,r=0,n=0)};function a(o,c){if(c){let y=0,d=Math.min(o,i);for(;d>0;){let m=e[r],p=Math.min(d,m.length),b=p===m.length?m:m.subarray(0,p);if(s(p),d-=p,y+=p,!c(b))break}return y}if(i<o)return null;if(o===0)return V;let l=e[r];if(l.length>=o){let y=l.length===o?l:l.subarray(0,o);return s(o),y}let f=new Uint8Array(o),u=0,h=o;for(;h>0;){let y=e[r],d=Math.min(h,y.length);f.set(d===y.length?y:y.subarray(0,d),u),u+=d,h-=d,s(d)}return f}return{push:o=>{if(o.length===0)return;let c=n+1&t;if(c===r){let l=e.length,f=l*2,u=new Array(f),h=n-r+l&l-1;if(r<n)for(let y=0;y<h;y++)u[y]=e[r+y];else if(h>0){let y=l-r;for(let d=0;d<y;d++)u[d]=e[r+d];for(let d=0;d<n;d++)u[y+d]=e[d]}e=u,t=f-1,r=0,n=h,c=n+1&t}e[n]=o,n=c,i+=o.length},available:()=>i,peek:o=>{if(i<o)return null;if(o===0)return V;let c=e[r];if(c.length>=o)return c.length===o?c:c.subarray(0,o);let l=new Uint8Array(o),f=0,u=r;for(;f<o;){let h=e[u],y=Math.min(o-f,h.length);y===h.length?l.set(h,f):l.set(h.subarray(0,y),f),f+=y,u=u+1&t}return l},discard:o=>{if(o>i)throw new Error("Too many bytes consumed");if(o===0)return;let c=o;for(;c>0;){let l=e[r],f=Math.min(c,l.length);s(f),c-=f}},pull:a}}var de=32,ft=48;function ut(e){let t=me(e,148,8),r=0;for(let n=0;n<e.length;n++)n>=148&&n<156?r+=de:r+=e[n];return t===r}function dt(e){e.fill(de,148,156);let t=0;for(let r of e)t+=r;for(let r=153;r>=148;r--)e[r]=(t&7)+ft,t>>=3;e[154]=0,e[155]=de}var mt=256;function ht(e){let t={};I.encode(e.name).length>100&&Ue(e.name)===null&&(t.path=e.name),e.linkname&&I.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&I.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&I.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let r=Object.entries(t);if(r.length===0)return null;let n=I.encode(r.map(([i,s])=>{let a=`${i}=${s}
|
|
3
|
-
`,o=I.encode(a).length+1,c=o+String(o).length;return c=o+String(c).length,`${c} ${a}`}).join(""));return{paxHeader:Pe({name:Q.decode(I.encode(`PaxHeader/${e.name}`).slice(0,100)),size:n.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:n}}function Ue(e){let t=I.encode(e).length;if(t<=100||t>mt)return null;for(let r=e.length-1;r>0;r--){if(e[r]!=="/")continue;let n=e.slice(0,r),i=e.slice(r+1);if(I.encode(n).length<=155&&I.encode(i).length<=100)return{prefix:n,name:i}}return null}function Pe(e){let t=new Uint8Array(512),r=M(e)?0:e.size??0,n=e.name,i="";if(!e.pax?.path){let s=Ue(n);s&&(n=s.name,i=s.prefix)}return P(t,0,100,n),j(t,100,8,e.mode??(e.type==="directory"?493:420)),j(t,108,8,e.uid??0),j(t,116,8,e.gid??0),j(t,124,12,r),j(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),P(t,156,1,at[e.type??"file"]),P(t,157,100,e.linkname),P(t,257,6,"ustar\0"),P(t,263,2,"00"),P(t,265,32,e.uname),P(t,297,32,e.gname),P(t,345,155,i),dt(t),t}function pt(e,t){if(t&&!ut(e))throw new Error("Invalid tar header checksum.");let r=F(e,156,1),n={name:F(e,0,100),mode:me(e,100,8),uid:Y(e,108,8),gid:Y(e,116,8),size:Y(e,124,12),mtime:new Date(Y(e,136,12)*1e3),type:ot[r]||"file",linkname:F(e,157,100)},i=F(e,257,6);return i.trim()==="ustar"&&(n.uname=F(e,265,32),n.gname=F(e,297,32)),i==="ustar"&&(n.prefix=F(e,345,155)),n}var Ie={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>/^\d+$/.test(e)&&Number.isSafeInteger(+e)?+e:NaN],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function gt(e){let t=Object.create(null),r=Object.create(null),n=!1,i=0;for(;i<e.length;){let s=e.indexOf(32,i);if(s===-1)break;let a=parseInt(Q.decode(e.subarray(i,s)),10);if(!(a>0))break;let o=i+a,c=Q.decode(e.subarray(s+1,o-1)),l=c.indexOf("=");if(l>0){let f=c.slice(0,l),u=c.slice(l+1);if(r[f]=u,n=!0,Object.hasOwn(Ie,f)){let[h,y]=Ie[f],d=y(u);(typeof d=="string"||!Number.isNaN(d))&&(t[h]=d)}}i=o}return n&&(t.pax=r),t}function Oe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function yt(e){switch(e){case"pax-global-header":case"pax-header":return gt;case"gnu-long-name":return t=>({name:F(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:F(t,0,t.length)});default:return}}function wt(e){let t=Pe(e),r=ht(e);if(!r)return[t];let n=-r.paxBody.length&511,i=n>0?[ct.subarray(0,n)]:[];return[r.paxHeader,r.paxBody,...i,t]}var ue=0,H=1,xt=8*1024*1024,J=new Error("Tar archive is truncated.");function pe(e={}){let t=e.strict??!1,{available:r,peek:n,push:i,discard:s,pull:a}=lt(),o=ue,c=!1,l=!1,f=!1,u=null,h={},y={},d={isEntryActive:()=>o===H,isBodyComplete:()=>!u||u.remaining===0,canFinish:()=>!u||r()>=u.remaining+u.padding,bodyBytes:()=>u&&u.remaining>0?Math.min(u.remaining,r()):0,write(m){if(c)throw new Error("Archive already ended.");i(m)},end(){c=!0},readHeader(){if(o!==ue)throw new Error("Cannot read header while an entry is active");if(!l)for(;!l;){if(r()<512){if(c){if(r()>0&&t)throw J;l=!0;return}return null}let m=n(512);if(Fe(m)){if(r()<512*2){if(c){if(t)throw J;l=!0;return}return null}if(Fe(n(512*2).subarray(512))){s(512*2),l=!0,f=!0;return}if(t)throw new Error("Invalid tar header.");s(512);continue}let p;try{p=pt(m,t)}catch(z){if(t)throw z;s(512);continue}let b=yt(p.type);if(b){if(p.size>xt)throw new Error("Tar metadata entry exceeds maximum size.");let z=p.size+(-p.size&511);if(r()<512+z){if(c&&t)throw J;return null}s(512);let C=b(a(z).subarray(0,p.size));y.pax&&(y={});let A=p.type==="pax-global-header"?h:y;for(let W in C)A[W]=C[W];continue}s(512);let w=p;p.prefix&&(w.name=`${p.prefix}/${w.name}`),Oe(w,h),Oe(w,y);let S=w.size;return M(w)?(S=0,w.size=0):w.name.endsWith("/")&&w.type==="file"&&(w.type=Le,w.size=0),y={},u={header:w,remaining:S,padding:-S&511},o=H,w}},streamBody(m){if(o!==H||!u||u.remaining===0)return 0;let p=Math.min(u.remaining,r());if(p===0)return 0;let b=a(p,m);return u.remaining-=b,b},skipPadding(){if(o!==H||!u)return!0;if(u.remaining>0)throw new Error("Body not fully consumed");return r()<u.padding?!1:(s(u.padding),u=null,o=ue,!0)},skipEntry(){if(o!==H||!u)return!0;let m=Math.min(u.remaining,r());return m>0&&(s(m),u.remaining-=m),u.remaining>0?!1:d.skipPadding()},validateEOF(){if(t){if(!f)throw J;if(r()>0&&a(r()).some(m=>m!==0))throw new Error("Invalid EOF.")}}};return d}function Fe(e){if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let r=0;r<t.length;r++)if(t[r]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}var bt=new Uint8Array(512*2);function Re(e,t,r){let n=null,i=0,s=!1,a=o=>{let c=new Error(o);throw t(c),c};return{add(o){s&&a("No new tar entries after finalize."),n!==null&&a("Previous entry must be completed before adding a new one");let c=M(o)?0:o.size;(!Number.isSafeInteger(c)||c<0)&&a("Invalid tar entry size.");try{let l=wt({...o,size:c});for(let f of l)e(f);n={...o,size:c},i=0}catch(l){t(l)}},write(o){n||a("No active tar entry."),s&&a("Cannot write data after finalize.");let c=i+o.length;c>n.size&&a(`"${n.name}" exceeds given size of ${n.size} bytes.`);try{i=c,e(o)}catch(l){t(l)}},endEntry(){n||a("No active entry to end."),s&&a("Cannot end entry after finalize.");try{i!==n.size&&a(`Size mismatch for "${n.name}".`);let o=-n.size&511;o>0&&e(new Uint8Array(o)),n=null,i=0}catch(o){throw t(o),o}},finalize(){s&&a("Archive has already been finalized"),n!==null&&a("Cannot finalize while an entry is still active");try{e(bt),s=!0,r&&r()}catch(o){t(o)}}}}function De(){return new CompressionStream("gzip")}function We(){return new DecompressionStream("gzip")}function zt(){let e,t;return{readable:new ReadableStream({start(r){e=r,t=Re(r.enqueue.bind(r),r.error.bind(r),r.close.bind(r))}}),controller:{add(r){let n=M(r);return t.add(r),n&&t.endEntry(),new WritableStream({write(i){t.write(i)},close(){n||t.endEntry()},abort(i){e.error(i)}})},finalize(){t.finalize()},error(r){e.error(r)}}}}async function _e(e){let t=[],r=e.getReader(),n=0;try{for(;;){let{done:a,value:o}=await r.read();if(a)break;t.push(o),n+=o.length}let i=new Uint8Array(n),s=0;for(let a of t)i.set(a,s),s+=a.length;return i}finally{r.releaseLock()}}var Me=e=>e.pipeTo(new WritableStream);function vt(e={}){let t=pe(e),r=e.strict??!1,n=null,i=null,s=!1,a=!1,o=!1,c=!1,l=()=>{try{i?.close()}catch{}i=null},f=d=>{if(!c){c=!0;try{i?.error(d)}catch{}i=null;try{n.error(d)}catch{}n=null}},u=()=>{if(!c){c=!0,l();try{n.close()}catch{}n=null}},h=()=>{if(r)throw new Error("Tar archive is truncated.");u()},y=()=>{if(!(s||c||!n)){s=!0;try{for(;;){if(a){o&&(t.validateEOF(),u());break}if(t.isEntryActive()){if(o&&!t.canFinish()){h();break}if(i){if((i.desiredSize??1)<=0)break;if(t.streamBody(d=>(i.enqueue(d),(i.desiredSize??1)>0))===0&&!t.isBodyComplete()){o&&h();break}}else if(!t.skipEntry()){o&&h();break}if(t.isBodyComplete()&&(l(),!t.skipPadding())){o&&h();break}}else{if((n.desiredSize??0)<0)break;let d=t.readHeader();if(d===null){o&&u();break}if(d===void 0){if(o){t.validateEOF(),u();break}a=!0;break}n.enqueue({header:d,body:new ReadableStream({start(m){d.size===0?m.close():i=m},pull:y,cancel(){i=null,y()}})})}}}catch(d){throw f(d),d}finally{s=!1}}};return{readable:new ReadableStream({start(d){n=d},pull:y,cancel(d){d!==void 0?f(d):u()}},{highWaterMark:2}),writable:new WritableStream({write(d){try{if(a&&r&&d.some(m=>m!==0))throw new Error("Invalid EOF.");t.write(d),y()}catch(m){throw f(m),m}},close(){try{o=!0,t.end(),y()}catch(d){throw f(d),d}},abort(d){f(d)}})}}async function je(e){let{readable:t,controller:r}=zt();return await(async()=>{for(let n of e){let i=r.add(n.header),s="body"in n?n.body:n.data;if(!s){await i.close();continue}if(s instanceof ReadableStream)await s.pipeTo(i);else if(s instanceof Blob)await s.stream().pipeTo(i);else try{let a=await Ne(s);if(a.length>0){let o=i.getWriter();await o.write(a),await o.close()}else await i.close()}catch{throw new TypeError(`Unsupported content type for entry "${n.header.name}".`)}}})().then(()=>r.finalize()).catch(n=>r.error(n)),_e(t)}async function He(e,t={}){if(!(e instanceof ReadableStream))return kt(e instanceof Uint8Array?e:new Uint8Array(e),t);let r=[],n=e.pipeThrough(vt(t));for await(let i of n){let s;try{s=he(i.header,t)}catch(a){throw await i.body.cancel(),a}if(s===null){await Me(i.body);continue}M(s)?(await Me(i.body),r.push({header:s})):r.push({header:s,data:await _e(i.body)})}return r}function kt(e,t){let r=pe(t),n=t.strict??!1,i=[];for(r.write(e),r.end();;){let s=r.readHeader();if(s===void 0)break;if(s===null){if(n)throw new Error("Tar archive is truncated.");break}let a=he(s,t);if(a===null){let h=r.skipEntry();if(!h&&n)throw new Error("Tar archive is truncated.");if(!h)break;continue}if(M(a)){let h=r.skipEntry();if(!h&&n)throw new Error("Tar archive is truncated.");if(i.push({header:a}),!h)break;continue}let o=s.size;if(o<0||!r.canFinish()){if(n)throw new Error("Tar archive is truncated.");o=r.bodyBytes()}let c=new Uint8Array(o),l=0;r.streamBody(h=>(c.set(h,l),l+=h.length,!0));let f=r.isBodyComplete(),u=!0;if(f&&(u=r.skipPadding(),!u&&n))throw new Error("Tar archive is truncated.");if(i.push({header:a,data:c}),!f||!u)break}return r.validateEOF(),i}import Lt from"seek-bzip";var Ct=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let r=t<<24;for(let n=0;n<8;n++)r=r&2147483648?r<<1^79764919:r<<1;e[t]=r>>>0}return e})();function At(e,t){return(e<<8^Ct[(e>>>24^t)&255])>>>0}var ge=class{maxOutputBytes;buffer=[];current=0;bitCount=0;constructor(t=Number.MAX_SAFE_INTEGER){if(this.maxOutputBytes=t,!Number.isSafeInteger(t)||t<0)throw new Error("Invalid bzip2 output limit")}pushByte(t){if(this.buffer.length>=this.maxOutputBytes)throw new Error(`bzip2 output exceeds limit (${this.maxOutputBytes} bytes)`);this.buffer.push(t)}writeBits(t,r){for(let n=t-1;n>=0;n--)this.current=this.current<<1|r>>>n&1,this.bitCount++,this.bitCount===8&&(this.pushByte(this.current),this.current=0,this.bitCount=0)}writeBit(t){this.current=this.current<<1|t&1,this.bitCount++,this.bitCount===8&&(this.pushByte(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.pushByte(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function Et(e){let t=[],r=0;for(;r<e.length;){let n=e[r],i=1;for(;r+i<e.length&&e[r+i]===n&&i<255;)i++;i>=4?(t.push(n,n,n,n),t.push(i-4),r+=i):(t.push(n),r++)}return new Uint8Array(t)}function St(e){let t=e.length;if(t===0)return{transformed:new Uint8Array(0),pointer:0};let r=Bt(e),n=new Uint8Array(t),i=0;for(let s=0;s<t;s++)r[s]===0?(i=s,n[s]=e[t-1]):n[s]=e[r[s]-1];return{transformed:n,pointer:i}}function Bt(e){let t=e.length,r=new Int32Array(t),n=new Int32Array(t);for(let i=0;i<t;i++)r[i]=i,n[i]=e[i];for(let i=1;i<t;i*=2){let s=n.slice();r.sort((a,o)=>s[a]!==s[o]?s[a]-s[o]:s[(a+i)%t]-s[(o+i)%t]),n[r[0]]=0;for(let a=1;a<t;a++)s[r[a]]===s[r[a-1]]&&s[(r[a]+i)%t]===s[(r[a-1]+i)%t]?n[r[a]]=n[r[a-1]]:n[r[a]]=n[r[a-1]]+1;if(n[r[t-1]]===t-1)break}return r}function $t(e,t){let r=[];for(let a=0;a<256;a++)t[a]&&r.push(a);let n=new Array(256).fill(-1);for(let a=0;a<r.length;a++)n[r[a]]=a;let i=new Uint16Array(e.length),s=r.slice();for(let a=0;a<e.length;a++){let o=e[a],c=0;for(;s[c]!==o;)c++;if(i[a]=c,c>0){let l=s[c];for(let f=c;f>0;f--)s[f]=s[f-1];s[0]=l}}return{encoded:i,length:e.length}}function Tt(e,t,r){let s=r+1,a=[],o=0;for(;o<t;)if(e[o]===0){let l=0;for(;o<t&&e[o]===0;)l++,o++;let f=l;for(;f>0;)f--,f&1?a.push(1):a.push(0),f>>>=1}else a.push(e[o]+1),o++;a.push(s);let c=new Uint16Array(a.length);for(let l=0;l<a.length;l++)c[l]=a[l];return{symbols:c,length:a.length,eob:s}}function Xe(e,t,r){if(t<=1){let l=new Array(e.length).fill(0);for(let f=0;f<e.length;f++)e[f]>0&&(l[f]=1);return{codeLengths:l,maxLen:1,minLen:1}}let n=[];for(let l=0;l<e.length;l++)e[l]>0&&n.push({freq:e[l],symbol:l,left:null,right:null});if(n.length===0)return{codeLengths:new Array(e.length).fill(0),maxLen:0,minLen:0};if(n.length===1){let l=new Array(e.length).fill(0);return l[n[0].symbol]=1,{codeLengths:l,maxLen:1,minLen:1}}for(;n.length>1;){n.sort((u,h)=>u.freq-h.freq);let l=n.shift(),f=n.shift();n.push({freq:l.freq+f.freq,symbol:-1,left:l,right:f})}let i=new Array(e.length).fill(0);function s(l,f){if(!l.left&&!l.right){i[l.symbol]=f;return}l.left&&s(l.left,f+1),l.right&&s(l.right,f+1)}s(n[0],0);let a=!0;for(;a;){a=!1;for(let l=0;l<i.length;l++)i[l]>r&&(i[l]=r,a=!0);if(a){let l=0;for(let f=0;f<i.length;f++)i[f]>0&&(l+=1/(1<<i[f]));if(l>1)for(let f=1;f<r&&l>1;f++)for(let u=0;u<i.length&&l>1;u++)i[u]===f&&(i[u]++,l-=1/(1<<f)-1/(1<<f+1));a=!1;for(let f=0;f<i.length;f++)if(i[f]>r){a=!0;break}}}let o=r,c=0;for(let l=0;l<i.length;l++)i[l]>0&&(i[l]<o&&(o=i[l]),i[l]>c&&(c=i[l]));return{codeLengths:i,maxLen:c,minLen:o}}function It(e,t){let r=new Array(t).fill(0),n=e.slice(0,t),i=Math.max(...n,0),s=new Array(i+1).fill(0);for(let c=0;c<t;c++)n[c]>0&&s[n[c]]++;let a=new Array(i+1).fill(0),o=0;for(let c=1;c<=i;c++)o=o+s[c-1]<<1,a[c]=o;for(let c=0;c<t;c++)n[c]>0&&(r[c]=a[n[c]]++);return{codes:r,lengths:n}}function Ot(e,t,r){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,r),e.writeBit(0);let n=Et(t),{transformed:i,pointer:s}=St(n);e.writeBits(24,s);let a=new Array(256).fill(!1);for(let g=0;g<i.length;g++)a[i[g]]=!0;let o=new Array(16).fill(!1);for(let g=0;g<16;g++)for(let x=0;x<16;x++)if(a[g*16+x]){o[g]=!0;break}for(let g=0;g<16;g++)e.writeBit(o[g]?1:0);for(let g=0;g<16;g++)if(o[g])for(let x=0;x<16;x++)e.writeBit(a[g*16+x]?1:0);let c=0;for(let g=0;g<256;g++)a[g]&&c++;let{encoded:l,length:f}=$t(i,a),{symbols:u,length:h}=Tt(l,f,c),y=c+2,d=50,m=Math.ceil(h/d),p;h<200?p=2:h<600?p=3:h<1200?p=4:h<2400?p=5:p=6,p>m&&(p=Math.max(2,m));let b=[];for(let g=0;g<p;g++)b.push(new Array(y).fill(0));let w=new Int32Array(m);for(let g=0;g<m;g++)w[g]=g%p;for(let g=0;g<m;g++){let x=g*d,v=Math.min(x+d,h),T=w[g];for(let E=x;E<v;E++)b[T][u[E]]++}function S(g){for(let x=0;x<y;x++)g[x]<1&&(g[x]=1)}let z=[];for(let g=0;g<p;g++)S(b[g]),z.push(Xe(b[g],y,20));for(let g=0;g<4;g++){for(let x=0;x<p;x++)b[x].fill(0);for(let x=0;x<m;x++){let v=x*d,T=Math.min(v+d,h),E=0,Z=1/0;for(let U=0;U<p;U++){let oe=0;for(let ce=v;ce<T;ce++)oe+=z[U].codeLengths[u[ce]]||20;oe<Z&&(Z=oe,E=U)}w[x]=E;for(let U=v;U<T;U++)b[E][u[U]]++}for(let x=0;x<p;x++)S(b[x]),z[x]=Xe(b[x],y,20)}e.writeBits(3,p),e.writeBits(15,m);let C=[],A=[];for(let g=0;g<p;g++)A.push(g);for(let g=0;g<m;g++){let x=w[g],v=0;for(;A[v]!==x;)v++;if(C.push(v),v>0){let T=A[v];for(let E=v;E>0;E--)A[E]=A[E-1];A[0]=T}}for(let g=0;g<m;g++){for(let x=0;x<C[g];x++)e.writeBit(1);e.writeBit(0)}for(let g=0;g<p;g++){let x=z[g].codeLengths,v=x[0];e.writeBits(5,v);for(let T=0;T<y;T++){let E=x[T];for(;v<E;)e.writeBit(1),e.writeBit(0),v++;for(;v>E;)e.writeBit(1),e.writeBit(1),v--;e.writeBit(0)}}for(let g=0;g<p;g++){let{codes:x,lengths:v}=It(z[g].codeLengths,y);z[g]=Object.assign(z[g],{_codes:x,_lengths:v})}let W=0,G=0;for(let g=0;g<h;g++){(G===0||G>=d)&&(g>0&&W++,G=0);let x=w[W],v=z[x],T=u[g],E=v._lengths[T],Z=v._codes[T];E>0&&e.writeBits(E,Z),G++}}var Ft=10*1024*1024;function Ge(e,t=9,r=Ft,n=Number.MAX_SAFE_INTEGER){if(t<1||t>9)throw new Error("Block size level must be 1-9");if(e.length>r)throw new Error(`Input too large for bzip2 compression (${e.length} bytes, max ${r})`);let i=t*1e5,s=new ge(n);s.writeBits(8,66),s.writeBits(8,90),s.writeBits(8,104),s.writeBits(8,48+t);let a=0,o=0;for(;o<e.length;){let c=Math.min(o+i,e.length),l=e.subarray(o,c),f=4294967295;for(let u=0;u<l.length;u++)f=At(f,l[u]);f=~f>>>0,a=(a<<1|a>>>31)>>>0,a=(a^f)>>>0,Ot(s,l,f),o=c}return s.writeBits(24,1536581),s.writeBits(24,3690640),s.writeBits(32,a),s.finish()}var ee=null,te=null;async function Ze(){if(ee)return ee;if(te)throw te;try{return ee=await le.runTrustedAsync(()=>import("node-liblzma")),ee}catch{throw te=new Error("xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies."),te}}var re=null,ne=null;async function qe(){if(re)return re;if(ne)throw ne;try{return re=await le.runTrustedAsync(()=>import("@mongodb-js/zstd")),re}catch{throw ne=new Error("zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd"),ne}}var ye=1024*1024*1024,$=512,Nt=1e6;function X(e,t){let r=e??t;if(!Number.isSafeInteger(r)||r<=0)throw new Error("Archive limits must be positive safe integers");return r}function O(e){return{maxArchiveSize:X(e?.maxArchiveSize,ye),maxEntries:X(e?.maxEntries,Nt),maxEntrySize:X(e?.maxEntrySize,ye),maxCompressedSize:X(e?.maxCompressedSize,e?.maxArchiveSize??ye),maxExpansionRatio:X(e?.maxExpansionRatio,1e4),signal:e?.signal,executionScope:e?.executionScope,allowTrustedWholeBufferCodecs:e?.allowTrustedWholeBufferCodecs??!0}}function Ut(e,t){if(e.length>t.maxEntries)throw new Error(`Too many archive entries (max ${t.maxEntries})`);let r=i=>{if(!Number.isSafeInteger(i)||i<0||i>t.maxArchiveSize-n)throw new Error(`Archive too large (max ${t.maxArchiveSize} bytes)`);n+=i},n=$*2;for(let i of e){t.signal?.throwIfAborted();let s=i.isDirectory||i.isSymlink?0:typeof i.content=="string"?q(i.content):i.content?.length??0;if(s>t.maxEntrySize)throw new Error(`Archive entry too large (max ${t.maxEntrySize} bytes)`);let a=i.isDirectory&&!i.name.endsWith("/")?`${i.name}/`:i.name,o=q(a),c=q(i.linkTarget??"");if(o>t.maxArchiveSize||c>t.maxArchiveSize)throw new Error(`Archive too large (max ${t.maxArchiveSize} bytes)`);let l=0;if(o>100&&(l+=o+64),c>100&&(l+=c+64),!Number.isSafeInteger(l))throw new Error(`Archive too large (max ${t.maxArchiveSize} bytes)`);let f=Math.ceil(s/$)*$;if(r($+f),l>0){let u=Math.ceil(l/$)*$;r($+u)}}return n}function ie(e,t,r){return e.executionScope?.reserveBytes(t,r,`tar: ${t}`)}function Pt(e){let t=e.subarray(124,136);if((t[0]&128)!==0){let i=t[0]&127;for(let s=1;s<t.length;s++)if(i=i*256+t[s],!Number.isSafeInteger(i))return;return i}let r=new TextDecoder("ascii").decode(t).replace(/\0.*$/,"").trim();if(r==="")return 0;if(!/^[0-7]+$/.test(r))return;let n=Number.parseInt(r,8);return Number.isSafeInteger(n)?n:void 0}function Rt(e,t){let r=0,n=0;for(;r+$<=e.length;){t.signal?.throwIfAborted();let i=e.subarray(r,r+$);if(i.every(o=>o===0))return;if(n++,n>t.maxEntries)return`Too many entries (max ${t.maxEntries})`;let s=Pt(i);if(s===void 0)return"Invalid tar archive format";if(s>t.maxEntrySize)return`Archive entry too large (max ${t.maxEntrySize} bytes)`;let a=Math.ceil(s/$)*$;if(!Number.isSafeInteger(a)||(r+=$+a,r>e.length))return"Invalid tar archive format"}return r===e.length?void 0:"Invalid tar archive format"}function Mt(e){let t="file";e.isDirectory?t="directory":e.isSymlink&&(t="symlink");let r=e.name;e.isDirectory&&!r.endsWith("/")&&(r+="/");let n;e.content!==void 0&&(typeof e.content=="string"?n=new TextEncoder().encode(e.content):n=e.content);let i=e.isDirectory||e.isSymlink?0:n?.length??0;return{header:{name:r,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:i,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??"",uname:"user",gname:"user"},body:n}}async function R(e,t){let r=O(t),n=Ut(e,r),i=ie(r,"archive construction",n);try{let s=e.map(Mt),a=await je(s);if(r.signal?.throwIfAborted(),a.length>r.maxArchiveSize)throw new Error(`Archive too large (max ${r.maxArchiveSize} bytes)`);return a}finally{i?.release()}}async function Ye(e,t){let r=O(t),n=await R(e,r),i=ie(r,"gzip input",n.byteLength),s=new _({maxInputBytes:r.maxArchiveSize,maxOutputBytes:r.maxCompressedSize,signal:r.signal,label:"gzip archive"});s.acceptInput(n.length);let c=new ReadableStream({start(h){h.enqueue(n),h.close()}}).pipeThrough(De()).getReader(),l=[],f=[],u=0;try{for(;;){let{done:y,value:d}=await c.read();if(y)break;try{s.acceptOutput(d.length);let m=ie(r,"gzip chunks",d.byteLength);m&&f.push(m)}catch(m){throw await c.cancel(),m}u+=d.length,l.push(d)}let h=ie(r,"gzip result",u);try{let y=new Uint8Array(u),d=0;for(let m of l)y.set(m,d),d+=m.length;return y}finally{h?.release()}}finally{for(let h of f)h.release();i?.release()}}async function L(e,t){let r=O(t);if(e.length>r.maxArchiveSize)return{entries:[],error:`Archive too large (max ${r.maxArchiveSize} bytes)`};if(e.length<$||e.length%$!==0)return{entries:[],error:"Invalid tar archive format"};let n=Rt(e,r);if(n)return{entries:[],error:n};try{let i=await He(e),s=[];for(let a of i){if(r.signal?.throwIfAborted(),s.length>=r.maxEntries)return{entries:[],error:`Too many entries (max ${r.maxEntries})`};let o=a.data??new Uint8Array(0);if(a.header.size>r.maxEntrySize||o.length>r.maxEntrySize)return{entries:[],error:`Archive entry too large (max ${r.maxEntrySize} bytes)`};let c="file";switch(a.header.type){case"directory":c="directory";break;case"symlink":c="symlink";break;case"link":c="hardlink";break;case"file":c="file";break;default:c="other"}s.push({name:a.header.name,mode:a.header.mode??420,uid:a.header.uid??0,gid:a.header.gid??0,size:a.header.size,mtime:a.header.mtime??new Date,type:c,linkTarget:a.header.linkname||void 0,content:o})}return{entries:s}}catch(i){let s=i instanceof Error?i.message:"Unknown error";return{entries:[],error:s}}}async function we(e,t){let r=O(t);if(e.length>r.maxCompressedSize)return{entries:[],error:`Archive too large (max ${r.maxCompressedSize} bytes)`};try{let n=new _({maxInputBytes:r.maxCompressedSize,maxOutputBytes:r.maxArchiveSize,maxExpansionRatio:r.maxExpansionRatio,signal:r.signal,label:"gzip archive"});n.acceptInput(e.length);let a=new ReadableStream({start(u){u.enqueue(e),u.close()}}).pipeThrough(We()).getReader(),o=[],c=0;for(;;){let{done:u,value:h}=await a.read();if(u)break;try{n.acceptOutput(h.length)}catch(y){throw await a.cancel(),y}c+=h.length,o.push(h)}let l=new Uint8Array(c),f=0;for(let u of o)l.set(u,f),f+=u.length;return L(l,r)}catch(n){let i=n instanceof Error?n.message:"Unknown error";return{entries:[],error:`Decompression failed: ${i}`}}}function xe(e){return e.length>=2&&e[0]===31&&e[1]===139}function be(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function ze(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function Dt(e,t){let r=new _({maxInputBytes:t.maxCompressedSize,maxOutputBytes:t.maxArchiveSize,maxExpansionRatio:t.maxExpansionRatio,signal:t.signal,label:"bzip2 archive"});r.acceptInput(e.length);let n=Math.min(64*1024,t.maxArchiveSize),i=[],s=Buffer.allocUnsafe(n),a=0,o=0,c={writeByte(l){r.acceptOutput(1),a===s.length&&(i.push(s),s=Buffer.allocUnsafe(n),a=0),s[a++]=l,o++}};return Lt.decode(Buffer.from(e),c),a>0&&i.push(s.subarray(0,a)),new Uint8Array(Buffer.concat(i,o))}async function Wt(e,t){let r=new _({maxInputBytes:t.maxArchiveSize,maxOutputBytes:t.maxCompressedSize,signal:t.signal,label:"bzip2 archive"});r.acceptInput(e.length);let n=await Ge(e,9,t.maxArchiveSize,t.maxCompressedSize);return r.acceptOutput(n.length),n}async function _t(e){let r=(await Ze()).unxzSync(Buffer.from(e));return new Uint8Array(r)}async function jt(e){let r=(await Ze()).xzSync(Buffer.from(e));return new Uint8Array(r)}async function Ke(e,t){let r=O(t),n=await R(e,r);return Wt(n,r)}async function Je(e,t){let r=O(t);if(t?.allowNativeCodecs===!1||!r.allowTrustedWholeBufferCodecs)throw new Error("xz compression is disabled by configuration. Enable native and trusted whole-buffer codecs to use it.");let n=await R(e,r),i=await jt(n);if(r.signal?.throwIfAborted(),i.length>r.maxCompressedSize)throw new Error(`xz archive: output exceeds limit (${r.maxCompressedSize} bytes)`);return i}async function ve(e,t){let r=O({...t,maxArchiveSize:t?.maxDecompressedSize??t?.maxArchiveSize});if(e.length>r.maxCompressedSize)return{entries:[],error:`Archive too large (max ${r.maxCompressedSize} bytes)`};try{let n=await Dt(e,r);return L(n,r)}catch(n){let i=n instanceof Error?n.message:"Unknown error";return i===`bzip2 archive: output exceeds limit (${r.maxArchiveSize} bytes)`?{entries:[],error:`Decompressed archive too large (max ${r.maxArchiveSize} bytes)`}:{entries:[],error:i}}}async function ke(e,t){let r=O(t);if(t?.allowNativeCodecs===!1||!r.allowTrustedWholeBufferCodecs)return{entries:[],error:"xz decompression is disabled by configuration. Enable native and trusted whole-buffer codecs, or decompress the archive externally before extraction."};if(e.length>r.maxCompressedSize)return{entries:[],error:`Archive too large (max ${r.maxCompressedSize} bytes)`};try{let n=await _t(e);return r.signal?.throwIfAborted(),n.length>r.maxArchiveSize?{entries:[],error:`Trusted xz codec produced data over limit (${r.maxArchiveSize} bytes)`}:L(n,r)}catch(n){let i=n instanceof Error?n.message:"Unknown error";return{entries:[],error:i}}}function Ce(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Ht(e){let r=await(await qe()).compress(Buffer.from(e),3);return new Uint8Array(r)}async function Xt(e){let r=await(await qe()).decompress(Buffer.from(e));return new Uint8Array(r)}async function Ve(e,t){let r=O(t);if(t?.allowNativeCodecs===!1||!r.allowTrustedWholeBufferCodecs)throw new Error("zstd compression is disabled by configuration. Enable native and trusted whole-buffer codecs to use it.");let n=await R(e,r),i=await Ht(n);if(r.signal?.throwIfAborted(),i.length>r.maxCompressedSize)throw new Error(`zstd archive: output exceeds limit (${r.maxCompressedSize} bytes)`);return i}async function Ae(e,t){let r=O(t);if(t?.allowNativeCodecs===!1||!r.allowTrustedWholeBufferCodecs)return{entries:[],error:"zstd decompression is disabled by configuration. Enable native and trusted whole-buffer codecs, or decompress the archive externally before extraction."};if(e.length>r.maxCompressedSize)return{entries:[],error:`Archive too large (max ${r.maxCompressedSize} bytes)`};try{let n=await Xt(e);return r.signal?.throwIfAborted(),n.length>r.maxArchiveSize?{entries:[],error:`Trusted zstd codec produced data over limit (${r.maxArchiveSize} bytes)`}:L(n,r)}catch(n){let i=n instanceof Error?n.message:"Unknown error";return{entries:[],error:i}}}function Qe(e){let t=e.length>0&&e[0]!==""&&!e[0].startsWith("-")?Gt(e):e,r={create:!1,append:!1,update:!1,extract:!1,list:!1,file:"",autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:"",preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:"",excludeFrom:"",wildcards:!1},n=[],i=0;for(;i<t.length;){let s=t[i];if(s.startsWith("-")&&!s.startsWith("--")&&s.length>2){if(/^-\d+$/.test(s)){n.push(s),i++;continue}for(let a=1;a<s.length;a++){let o=s[a];switch(o){case"c":r.create=!0;break;case"r":r.append=!0;break;case"u":r.update=!0;break;case"x":r.extract=!0;break;case"t":r.list=!0;break;case"a":r.autoCompress=!0;break;case"z":r.gzip=!0;break;case"j":r.bzip2=!0;break;case"J":r.xz=!0;break;case"v":r.verbose=!0;break;case"O":r.toStdout=!0;break;case"k":r.keepOldFiles=!0;break;case"m":r.touch=!0;break;case"p":r.preserve=!0;break;case"P":r.absoluteNames=!0;break;case"f":if(a<s.length-1)r.file=s.substring(a+1),a=s.length;else{if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
|
|
4
|
-
`,exitCode:2}};r.file=t[i]}break;case"C":if(a<s.length-1)r.directory=s.substring(a+1),a=s.length;else{if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
|
|
5
|
-
`,exitCode:2}};r.directory=t[i]}break;case"T":if(a<s.length-1)r.filesFrom=s.substring(a+1),a=s.length;else{if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
|
|
6
|
-
`,exitCode:2}};r.filesFrom=t[i]}break;case"X":if(a<s.length-1)r.excludeFrom=s.substring(a+1),a=s.length;else{if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
|
|
7
|
-
`,exitCode:2}};r.excludeFrom=t[i]}break;default:return{ok:!1,error:fe("tar",`-${o}`)}}}i++;continue}if(s==="-c"||s==="--create")r.create=!0;else if(s==="-r"||s==="--append")r.append=!0;else if(s==="-u"||s==="--update")r.update=!0;else if(s==="-x"||s==="--extract"||s==="--get")r.extract=!0;else if(s==="-t"||s==="--list")r.list=!0;else if(s==="-a"||s==="--auto-compress")r.autoCompress=!0;else if(s==="-z"||s==="--gzip"||s==="--gunzip")r.gzip=!0;else if(s==="-j"||s==="--bzip2")r.bzip2=!0;else if(s==="-J"||s==="--xz")r.xz=!0;else if(s==="--zstd")r.zstd=!0;else if(s==="-v"||s==="--verbose")r.verbose=!0;else if(s==="-O"||s==="--to-stdout")r.toStdout=!0;else if(s==="-k"||s==="--keep-old-files")r.keepOldFiles=!0;else if(s==="-m"||s==="--touch")r.touch=!0;else if(s==="--wildcards")r.wildcards=!0;else if(s==="-p"||s==="--preserve"||s==="--preserve-permissions")r.preserve=!0;else if(s==="-P"||s==="--absolute-names")r.absoluteNames=!0;else if(s==="-f"||s==="--file"){if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
|
|
8
|
-
`,exitCode:2}};r.file=t[i]}else if(s.startsWith("--file="))r.file=s.substring(7);else if(s==="-C"||s==="--directory"){if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
|
|
9
|
-
`,exitCode:2}};r.directory=t[i]}else if(s.startsWith("--directory="))r.directory=s.substring(12);else if(s.startsWith("--strip-components=")||s.startsWith("--strip=")){let a=s.includes("--strip-components=")?s.substring(19):s.substring(8),o=parseInt(a,10);if(Number.isNaN(o)||o<0)return{ok:!1,error:{stdout:"",stderr:`tar: invalid number for --strip: '${a}'
|
|
10
|
-
`,exitCode:2}};r.strip=o}else if(s.startsWith("--exclude="))r.exclude.push(s.substring(10));else if(s==="--exclude"){if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option '--exclude' requires an argument
|
|
11
|
-
`,exitCode:2}};r.exclude.push(t[i])}else if(s==="-T"||s==="--files-from"){if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
|
|
12
|
-
`,exitCode:2}};r.filesFrom=t[i]}else if(s.startsWith("--files-from="))r.filesFrom=s.substring(13);else if(s==="-X"||s==="--exclude-from"){if(i++,i>=t.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
|
|
13
|
-
`,exitCode:2}};r.excludeFrom=t[i]}else if(s.startsWith("--exclude-from="))r.excludeFrom=s.substring(15);else if(s==="--"){n.push(...t.slice(i+1));break}else{if(s.startsWith("-"))return{ok:!1,error:fe("tar",s)};n.push(s)}i++}return{ok:!0,options:r,files:n}}function Gt(e){let t=e[0],r=[],n=1;for(let i of t)r.push(`-${i}`),"fCTX".includes(i)&&n<e.length&&(r.push(e[n]),n++);return r.push(...e.slice(n)),r}var et=100;function k(e){return{maxArchiveSize:e.limits.maxArchiveBytes,maxCompressedSize:e.limits.maxArchiveCompressedBytes,maxEntrySize:e.limits.maxArchiveEntryBytes,maxEntries:e.limits.maxArchiveEntries,signal:e.signal,executionScope:e.executionScope}}function B(e){return e.signal?.aborted===!0}function N(){return{stdout:"",stderr:`tar: operation aborted
|
|
14
|
-
`,exitCode:126}}var Zt={name:"tar",summary:"manipulate tape archives",usage:"tar [options] [file...]",description:["Create, extract, or list contents of tar archives.","","One of -c, -r, -u, -x, or -t is required to specify the operation."],options:["-c, --create create a new archive","-r, --append append files to the end of an archive","-u, --update only append files newer than copy in archive","-x, --extract extract files from an archive","-t, --list list contents of an archive","-f, --file=ARCHIVE use archive file ARCHIVE","-a, --auto-compress use archive suffix to determine compression","-z, --gzip filter archive through gzip","-j, --bzip2 filter archive through bzip2","-J, --xz filter archive through xz","--zstd filter archive through zstd","-v, --verbose verbosely list files processed","-O, --to-stdout extract files to standard output","-k, --keep-old-files don't replace existing files when extracting","-m, --touch don't extract file modified time","-C, --directory=DIR change to directory DIR before performing operations","-p, --preserve preserve permissions","-P, --absolute-names do not strip leading '/' or block '..' paths","-T, --files-from=FILE read files to extract/create from FILE","-X, --exclude-from=FILE read exclude patterns from FILE","--strip=N strip N leading path components on extraction","--exclude=PATTERN exclude files matching PATTERN","--wildcards use wildcards for pattern matching"," --help display this help and exit"],examples:["tar -cvf archive.tar file1 file2 Create archive from files","tar -czvf archive.tar.gz dir/ Create gzip-compressed archive","tar -cjvf archive.tar.bz2 dir/ Create bzip2-compressed archive","tar -rf archive.tar newfile.txt Append file to archive","tar -uf archive.tar dir/ Update archive with newer files","tar -xvf archive.tar Extract archive","tar -xvf archive.tar -C /tmp Extract to /tmp","tar -tvf archive.tar List archive contents","tar -xzf archive.tar.gz Extract gzip archive","tar -xf archive.tar file1.txt Extract specific file","tar -xOf archive.tar file.txt Extract file to stdout","tar -xf archive.tar --wildcards '*.txt' Extract matching files"]};function Ee(e,t){let r=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;for(let n of t){let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,".");if(D(`^${i}$`).test(e)||D(`^${i}/`).test(e)||!n.includes("/")&&D(`^${i}$`).test(r))return!0}return!1}function se(e,t){let r=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,"."),n=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;return D(`^${r}$`).test(e)||D(`^${r}$`).test(n)}function tt(e,t){if(t<=0)return e;let r=e.split("/").filter(n=>n!=="");return r.length<=t?"":r.slice(t).join("/")}function rt(e){return e.split("/").some(t=>t==="..")}function qt(e,t){if(t)return{safePath:e};let r=e.replace(/^\/+/,"");return r.length===0?{safePath:""}:rt(r)?{error:"Path contains '..'"}:{safePath:r}}function Yt(e){let r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],n=e.getDate().toString().padStart(2," "),i=e.getHours().toString().padStart(2,"0"),s=e.getMinutes().toString().padStart(2,"0");return`${r} ${n} ${i}:${s}`}async function ae(e,t,r,n){let i=[],s=[],a=e.fs.resolvePath(t,r);if(B(e))return{entries:i,errors:["tar: operation aborted"]};try{let o=await e.fs.stat(a);if(B(e))return{entries:i,errors:["tar: operation aborted"]};if(Ee(r,n))return{entries:i,errors:s};if(o.isDirectory){i.push({name:r,isDirectory:!0,mode:o.mode,mtime:o.mtime});let c=await e.fs.readdir(a);if(B(e))return{entries:i,errors:["tar: operation aborted"]};for(let l=0;l<c.length;l+=et){if(B(e))return{entries:i,errors:["tar: operation aborted"]};let f=c.slice(l,l+et),u=await Promise.all(f.map(h=>ae(e,t,r?`${r}/${h}`:h,n)));for(let h of u)i.push(...h.entries),s.push(...h.errors)}}else if(o.isFile){let c=await e.fs.readFileBuffer(a);if(B(e))return{entries:i,errors:["tar: operation aborted"]};i.push({name:r,content:c,mode:o.mode,mtime:o.mtime})}else if(o.isSymbolicLink){let c=await e.fs.readlink(a);if(B(e))return{entries:i,errors:["tar: operation aborted"]};i.push({name:r,isSymlink:!0,linkTarget:c,mode:o.mode,mtime:o.mtime})}}catch(o){let c=o instanceof Error?o.message:"unknown error";s.push(`tar: ${r}: ${c}`)}return{entries:i,errors:s}}async function Kt(e,t,r){if(r.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to create an empty archive
|
|
15
|
-
`,exitCode:2};let n=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,i=[],s=[],a="";for(let f of r){if(B(e))return N();let{entries:u,errors:h}=await ae(e,n,f,t.exclude);if(i.push(...u),s.push(...h),t.verbose)for(let y of u)a+=`${y.name}${y.isDirectory?"/":""}
|
|
16
|
-
`}if(i.length===0&&s.length>0)return{stdout:"",stderr:`${s.join(`
|
|
17
|
-
`)}
|
|
18
|
-
`,exitCode:2};let o;try{t.gzip?o=await Ye(i,k(e)):t.bzip2?o=await Ke(i,k(e)):t.xz?o=await Je(i,k(e)):t.zstd?o=await Ve(i,k(e)):o=await R(i,k(e))}catch(f){return{stdout:"",stderr:`tar: error creating archive: ${f instanceof Error?f.message:"unknown error"}
|
|
19
|
-
`,exitCode:2}}let c="";if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(f,o)}catch(u){let h=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${h}
|
|
20
|
-
`,exitCode:2}}}else c=Buffer.from(o).toString("latin1");let l=a;return s.length>0&&(l+=`${s.join(`
|
|
21
|
-
`)}
|
|
22
|
-
`),{stdout:c,stderr:l,exitCode:s.length>0?2:0,stdoutKind:c.length>0?"bytes":"text"}}async function Jt(e,t,r){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
|
|
23
|
-
`,exitCode:2};if(r.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to append nothing to archive
|
|
24
|
-
`,exitCode:2};let n=e.fs.resolvePath(e.cwd,t.file),i;try{i=await e.fs.readFileBuffer(n)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
25
|
-
`,exitCode:2}}let s=await L(i,k(e));if(s.error)return{stdout:"",stderr:`tar: ${s.error}
|
|
26
|
-
`,exitCode:2};let a=s.entries.map(d=>({name:d.name,content:d.content,mode:d.mode,mtime:d.mtime,isDirectory:d.type==="directory",isSymlink:d.type==="symlink",linkTarget:d.linkTarget,uid:d.uid,gid:d.gid})),o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let d of r){let{entries:m,errors:p}=await ae(e,o,d,t.exclude);if(c.push(...m),l.push(...p),t.verbose)for(let b of m)f+=`${b.name}${b.isDirectory?"/":""}
|
|
27
|
-
`}let u=[...a,...c],h;try{h=await R(u,k(e))}catch(d){return{stdout:"",stderr:`tar: error creating archive: ${d instanceof Error?d.message:"unknown error"}
|
|
28
|
-
`,exitCode:2}}try{await e.fs.writeFile(n,h)}catch(d){let m=d instanceof Error?d.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${m}
|
|
29
|
-
`,exitCode:2}}let y=f;return l.length>0&&(y+=`${l.join(`
|
|
30
|
-
`)}
|
|
31
|
-
`),{stdout:"",stderr:y,exitCode:l.length>0?2:0}}async function Vt(e,t,r){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot update stdin/stdout
|
|
32
|
-
`,exitCode:2};if(r.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to update with nothing
|
|
33
|
-
`,exitCode:2};let n=e.fs.resolvePath(e.cwd,t.file),i;try{i=await e.fs.readFileBuffer(n)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
34
|
-
`,exitCode:2}}let s=await L(i,k(e));if(s.error)return{stdout:"",stderr:`tar: ${s.error}
|
|
35
|
-
`,exitCode:2};let a=new Map;for(let p of s.entries)a.set(p.name,p.mtime);let o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let p of r){let{entries:b,errors:w}=await ae(e,o,p,t.exclude);l.push(...w);for(let S of b){let z=a.get(S.name);(!z||S.mtime&&S.mtime.getTime()>z.getTime())&&(c.push(S),t.verbose&&(f+=`${S.name}${S.isDirectory?"/":""}
|
|
36
|
-
`))}}if(c.length===0){let p="";return l.length>0&&(p=`${l.join(`
|
|
37
|
-
`)}
|
|
38
|
-
`),{stdout:"",stderr:p,exitCode:l.length>0?2:0}}let u=new Set(c.map(p=>p.name)),y=[...s.entries.filter(p=>!u.has(p.name)).map(p=>({name:p.name,content:p.content,mode:p.mode,mtime:p.mtime,isDirectory:p.type==="directory",isSymlink:p.type==="symlink",linkTarget:p.linkTarget,uid:p.uid,gid:p.gid})),...c],d;try{d=await R(y,k(e))}catch(p){return{stdout:"",stderr:`tar: error creating archive: ${p instanceof Error?p.message:"unknown error"}
|
|
39
|
-
`,exitCode:2}}try{await e.fs.writeFile(n,d)}catch(p){let b=p instanceof Error?p.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${b}
|
|
40
|
-
`,exitCode:2}}let m=f;return l.length>0&&(m+=`${l.join(`
|
|
41
|
-
`)}
|
|
42
|
-
`),{stdout:"",stderr:m,exitCode:l.length>0?2:0}}async function Qt(e,t,r){let n;if(t.file&&t.file!=="-"){let m=e.fs.resolvePath(e.cwd,t.file);try{n=await e.fs.readFileBuffer(m)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
43
|
-
`,exitCode:2}}}else n=Uint8Array.from(e.stdin,m=>m.charCodeAt(0));let i,s=t.gzip||xe(n),a=t.bzip2||be(n),o=t.xz||ze(n),c=t.zstd||Ce(n);if(s?i=await we(n,k(e)):a?i=await ve(n,k(e)):o?i=await ke(n,k(e)):c?i=await Ae(n,k(e)):i=await L(n,k(e)),i.error)return{stdout:"",stderr:`tar: ${i.error}
|
|
44
|
-
`,exitCode:2};let l=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,f=t.absoluteNames?r:r.map(m=>m.replace(/^\/+/,"")).filter(m=>m.length>0),u="",h="",y=[];if(t.directory&&!t.toStdout){if(B(e))return N();try{await e.fs.mkdir(l,{recursive:!0})}catch{}}for(let m of i.entries){if(B(e))return N();let p=tt(m.name,t.strip);if(!p)continue;let b=qt(p,t.absoluteNames);if(b.error){y.push(`tar: ${p}: ${b.error}`);continue}let w=b.safePath??"";if(!w)continue;let S=w.endsWith("/")?w.slice(0,-1):w;if(f.length>0){let C;if(t.wildcards?C=f.some(A=>se(w,A)||se(S,A)||w.startsWith(`${A}/`)):C=f.some(A=>w===A||w.startsWith(`${A}/`)||S===A),!C)continue}if(Ee(w,t.exclude))continue;let z=e.fs.resolvePath(l,w);try{if(m.type==="directory"){if(t.toStdout)continue;if(B(e))return N();await e.fs.mkdir(z,{recursive:!0}),t.verbose&&(u+=`${w}
|
|
45
|
-
`)}else if(m.type==="file"){if(t.toStdout){h+=new TextDecoder().decode(m.content),t.verbose&&(u+=`${w}
|
|
46
|
-
`);continue}if(t.keepOldFiles)try{await e.fs.stat(z),t.verbose&&(u+=`${w}: not overwritten, file exists
|
|
47
|
-
`);continue}catch{}let C=z.substring(0,z.lastIndexOf("/"));if(C)try{await e.fs.mkdir(C,{recursive:!0})}catch{}if(B(e))return N();if(await e.fs.writeFile(z,m.content),t.preserve&&m.mode)try{await e.fs.chmod(z,m.mode)}catch{}t.verbose&&(u+=`${w}
|
|
48
|
-
`)}else if(m.type==="symlink"&&m.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(m.linkTarget.startsWith("/")||rt(m.linkTarget))){y.push(`tar: ${w}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(z),t.verbose&&(u+=`${w}: not overwritten, file exists
|
|
49
|
-
`);continue}catch{}let C=z.substring(0,z.lastIndexOf("/"));if(C)try{await e.fs.mkdir(C,{recursive:!0})}catch{}try{if(B(e))return N();await e.fs.symlink(m.linkTarget,z)}catch{}t.verbose&&(u+=`${w}
|
|
50
|
-
`)}}catch(C){if(B(e))return N();let A=C instanceof Error?C.message:"unknown error";y.push(`tar: ${w}: ${A}`)}}let d=u;return y.length>0&&(d+=`${y.join(`
|
|
51
|
-
`)}
|
|
52
|
-
`),{stdout:h,stderr:d,exitCode:y.length>0?2:0}}async function er(e,t,r){let n;if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{n=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
53
|
-
`,exitCode:2}}}else n=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));let i,s=t.gzip||xe(n),a=t.bzip2||be(n),o=t.xz||ze(n),c=t.zstd||Ce(n);if(s?i=await we(n,k(e)):a?i=await ve(n,k(e)):o?i=await ke(n,k(e)):c?i=await Ae(n,k(e)):i=await L(n,k(e)),i.error)return{stdout:"",stderr:`tar: ${i.error}
|
|
54
|
-
`,exitCode:2};let l="";for(let f of i.entries){if(B(e))return N();let u=tt(f.name,t.strip);if(!u)continue;let h=u.endsWith("/")?u.slice(0,-1):u;if(r.length>0){let y;if(t.wildcards?y=r.some(d=>se(u,d)||se(h,d)||u.startsWith(`${d}/`)):y=r.some(d=>u===d||u.startsWith(`${d}/`)||h===d),!y)continue}if(!Ee(u,t.exclude))if(t.verbose){let y=f.type==="directory",d=$e(f.mode,y),m=`${f.uid}/${f.gid}`,p=f.size.toString().padStart(8," "),b=Yt(f.mtime),w=`${d} ${m.padEnd(10)} ${p} ${b} ${u}`;f.type==="symlink"&&f.linkTarget&&(w+=` -> ${f.linkTarget}`),l+=`${w}
|
|
55
|
-
`}else l+=`${u}
|
|
56
|
-
`}return{stdout:l,stderr:"",exitCode:0}}var zr={name:"tar",async execute(e,t){if(B(t))return N();if(Be(e))return Se(Zt);let r=Qe(e);if(!r.ok)return r.error;let{options:n,files:i}=r,s=[n.create,n.append,n.update,n.extract,n.list].filter(Boolean).length;if(s===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
|
|
57
|
-
`,exitCode:2};if(s>1)return{stdout:"",stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
|
|
58
|
-
`,exitCode:2};if(n.autoCompress&&n.file&&n.create){let c=n.file.toLowerCase();c.endsWith(".tar.gz")||c.endsWith(".tgz")?n.gzip=!0:c.endsWith(".tar.bz2")||c.endsWith(".tbz2")?n.bzip2=!0:c.endsWith(".tar.xz")||c.endsWith(".txz")?n.xz=!0:(c.endsWith(".tar.zst")||c.endsWith(".tzst"))&&(n.zstd=!0)}let a=[n.gzip,n.bzip2,n.xz,n.zstd].filter(Boolean).length;if(a>1)return{stdout:"",stderr:`tar: You may not specify more than one compression option
|
|
59
|
-
`,exitCode:2};if((n.append||n.update)&&a>0)return{stdout:"",stderr:`tar: Cannot append/update compressed archives - decompress first
|
|
60
|
-
`,exitCode:2};let o=i;if(n.filesFrom){let c=t.fs.resolvePath(t.cwd,n.filesFrom);try{let f=(await t.fs.readFile(c)).split(`
|
|
61
|
-
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));o=[...i,...f]}catch{return{stdout:"",stderr:`tar: ${n.filesFrom}: Cannot open: No such file or directory
|
|
62
|
-
`,exitCode:2}}}if(n.excludeFrom){let c=t.fs.resolvePath(t.cwd,n.excludeFrom);try{let f=(await t.fs.readFile(c)).split(`
|
|
63
|
-
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));n.exclude.push(...f)}catch{return{stdout:"",stderr:`tar: ${n.excludeFrom}: Cannot open: No such file or directory
|
|
64
|
-
`,exitCode:2}}}return n.create?Kt(t,n,o):n.append?Jt(t,n,o):n.update?Vt(t,n,o):n.extract?Qt(t,n,o):er(t,n,o)}},vr={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{zr as a,vr as b};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{l as h}from"./chunk-EFORKKSH.js";import{a as c,d as p}from"./chunk-GN6CQ3J4.js";import{a as N,b as v,c as y}from"./chunk-QAYAQNCG.js";var x={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"]};function $(i,r,s){let l=String(i);switch(r){case"ln":return l.padEnd(s);case"rn":return l.padStart(s);case"rz":return l.padStart(s,"0");default:return r}}function S(i,r){switch(r){case"a":return!0;case"t":return i.trim().length>0;case"n":return!1;default:return r}}function w(i,r,s,l){if(i==="")return{output:"",nextNumber:s};let o=i.split(`
|
|
3
|
-
`),d=[],t=0,u=s,f=i.endsWith(`
|
|
4
|
-
`)&&o[o.length-1]==="";f&&o.pop();for(let n of o){let e=d.length>0?1:0,m=c(r.separator)+c(n);if(S(n,r.bodyStyle)){let a=Math.max(String(u).length,r.width)+m+e;if(a>l-t)throw new h(`nl: output size limit exceeded (${l} bytes)`,"output_size");let b=`${$(u,r.numberFormat,r.width)}${r.separator}${n}`;d.push(b),t+=a,u+=r.increment}else{let a=r.width+m+e;if(a>l-t)throw new h(`nl: output size limit exceeded (${l} bytes)`,"output_size");let b=`${" ".repeat(r.width)}${r.separator}${n}`;d.push(b),t+=a}}if(f&&t+1>l)throw new h(`nl: output size limit exceeded (${l} bytes)`,"output_size");return{output:d.join(`
|
|
5
|
-
`)+(f?`
|
|
6
|
-
`:""),nextNumber:u}}var I={name:"nl",execute:async(i,r)=>{if(v(i))return N(x);let s={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},l=[],o=Math.min(r.limits.maxStringLength,r.limits.maxOutputSize),d=o,t=0;for(;t<i.length;){let n=i[t];if(n==="-b"&&t+1<i.length){let e=i[t+1];if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
7
|
-
`};s.bodyStyle=e,t+=2}else if(n.startsWith("-b")){let e=n.slice(2);if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
8
|
-
`};s.bodyStyle=e,t++}else if(n==="-n"&&t+1<i.length){let e=i[t+1];if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
9
|
-
`};s.numberFormat=e,t+=2}else if(n.startsWith("-n")){let e=n.slice(2);if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
10
|
-
`};s.numberFormat=e,t++}else if(n==="-w"&&t+1<i.length){let e=/^\d+$/.test(i[t+1])?Number(i[t+1]):NaN;if(!Number.isSafeInteger(e)||e<1||e>o)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${i[t+1]}'
|
|
11
|
-
`};s.width=e,t+=2}else if(n.startsWith("-w")){let e=/^\d+$/.test(n.slice(2))?Number(n.slice(2)):NaN;if(!Number.isSafeInteger(e)||e<1||e>o)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${n.slice(2)}'
|
|
12
|
-
`};s.width=e,t++}else if(n==="-s"&&t+1<i.length)s.separator=i[t+1],t+=2;else if(n.startsWith("-s"))s.separator=n.slice(2),t++;else if(n==="-v"&&t+1<i.length){let e=parseInt(i[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${i[t+1]}'
|
|
13
|
-
`};s.startNumber=e,t+=2}else if(n.startsWith("-v")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${n.slice(2)}'
|
|
14
|
-
`};s.startNumber=e,t++}else if(n==="-i"&&t+1<i.length){let e=parseInt(i[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${i[t+1]}'
|
|
15
|
-
`};s.increment=e,t+=2}else if(n.startsWith("-i")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${n.slice(2)}'
|
|
16
|
-
`};s.increment=e,t++}else if(n==="--"){l.push(...i.slice(t+1));break}else{if(n.startsWith("-")&&n!=="-")return y("nl",n);l.push(n),t++}}let u="",f=s.startNumber;if(l.length===0){let n=p(r.stdin)??"";u=w(n,s,f,d).output}else for(let n of l){let e=r.fs.resolvePath(r.cwd,n),m=await r.fs.readFile(e);if(m===null)return{exitCode:1,stdout:u,stderr:`nl: ${n}: No such file or directory
|
|
17
|
-
`};let a=w(m,s,f,d-c(u));u+=a.output,f=a.nextNumber}return{exitCode:0,stdout:u,stderr:""}}},L={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};export{I as a,L as b};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as _}from"./chunk-CHHWTPDH.js";import{a as p}from"./chunk-U7UNEMLJ.js";import{l as g}from"./chunk-EFORKKSH.js";import{a as L}from"./chunk-QIQMJJZ4.js";import{a as S,b as C}from"./chunk-QAYAQNCG.js";var E={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"]},F={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};function a(t,e,u,i){if(t>e)throw new g(`base64: ${u} limit exceeded (${e} bytes)`,i)}function k(t){let e=[];for(let i=0;i<t.length;i+=32768)e.push(String.fromCharCode(...t.subarray(i,i+32768)));return e.join("")}function B(t){if(t.length===0)return 0;let e=t.endsWith("==")?2:t.endsWith("=")?1:0;return Math.max(0,Math.ceil(t.length/4)*3-e)}async function x(t,e,u){let i=Math.min(t.limits.maxInputBytes,t.limits.maxStringLength),o=t.stdin;if(e.length===0||e.length===1&&e[0]==="-")return a(o.length,i,"input size","string_length"),{ok:!0,data:Uint8Array.from(o,n=>n.charCodeAt(0))};let c=[],s=0;for(let n of e){if(n==="-"){a(s+o.length,i,"input size","string_length"),c.push(Uint8Array.from(o,r=>r.charCodeAt(0))),s+=o.length;continue}try{let r=t.fs.resolvePath(t.cwd,n),l=await t.fs.stat(r);a(s+l.size,i,"input size","string_length");let f=await t.fs.readFileBuffer(r);a(s+f.length,i,"input size","string_length"),_(t,f.length,u),c.push(f),s+=f.length}catch(r){return p(r),{ok:!1,error:{stdout:"",stderr:`${u}: ${n}: No such file or directory
|
|
3
|
-
`,exitCode:1}}}}let d=new Uint8Array(s),h=0;for(let n of c)d.set(n,h),h+=n.length;return{ok:!0,data:d}}var T={name:"base64",async execute(t,e){if(C(t))return S(E);let u=L("base64",t,F);if(!u.ok)return u.error;let i=u.result.flags.decode,o=u.result.flags.wrap,c=u.result.positional;if(!Number.isSafeInteger(o)||o<0)return{stdout:"",stderr:`base64: invalid wrap size
|
|
4
|
-
`,exitCode:1};try{if(i){let r=await x(e,c,"base64");if(!r.ok)return r.error;if(typeof Buffer<"u"){let y=Buffer.from(r.data).toString("utf8").replace(/\s/g,""),z=B(y);a(z,e.limits.maxStringLength,"decoded size","string_length"),a(z,e.limits.maxOutputSize,"output size","output_size");let w=Buffer.from(y,"base64");return a(w.length,e.limits.maxOutputSize,"output size","output_size"),{stdout:w.toString("latin1"),stderr:"",exitCode:0,stdoutEncoding:"binary"}}let f=k(r.data).replace(/\s/g,""),m=B(f);a(m,e.limits.maxStringLength,"decoded size","string_length"),a(m,e.limits.maxOutputSize,"output size","output_size");let b=atob(f);return a(b.length,e.limits.maxOutputSize,"output size","output_size"),{stdout:b,stderr:"",exitCode:0,stdoutEncoding:"binary"}}let s=await x(e,c,"base64");if(!s.ok)return s.error;let d=Math.ceil(s.data.length/3)*4,h=o>0&&d>0?Math.ceil(d/o):0;if(h>e.limits.maxArrayElements)throw new g(`base64: wrapped line limit exceeded (${e.limits.maxArrayElements})`,"array_elements");a(d,e.limits.maxStringLength,"encoded size","string_length"),a(d+h,e.limits.maxOutputSize,"output size","output_size");let n;if(typeof Buffer<"u"?n=Buffer.from(s.data).toString("base64"):n=btoa(k(s.data)),o>0){let r=[];for(let l=0;l<n.length;l+=o)r.push(n.slice(l,l+o));n=r.join(`
|
|
5
|
-
`)+(n.length>0?`
|
|
6
|
-
`:"")}return{stdout:n,stderr:"",exitCode:0}}catch(s){return p(s),{stdout:"",stderr:`base64: invalid input
|
|
7
|
-
`,exitCode:1}}}},W={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{T as a,W as b};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{l as r}from"./chunk-EFORKKSH.js";import{a as c}from"./chunk-GN6CQ3J4.js";var f=10*1024*1024;function h(t,a,n){let e=n==="width"?Math.abs(t):t;if(!Number.isFinite(t)||!Number.isSafeInteger(t)||e<0||e>a)throw new r(`format ${n} limit exceeded (${a} bytes)`,"string_length")}function b(t,a,n,e=f){h(a,e,"width"),n!==-1&&h(n,e,"precision");let s=t;n>=0&&s.length>n&&(s=s.slice(0,n));let l=Math.abs(a);if(l>s.length){if(c(s)+l-s.length>e)throw new r(`formatted value size limit exceeded (${e} bytes)`,"string_length");a<0?s=s.padEnd(l," "):s=s.padStart(l," ")}if(c(s)>e)throw new r(`formatted value size limit exceeded (${e} bytes)`,"string_length");return s}function p(t,a,n=f){let e=a,s=0,l=-1,i=!1;for(e<t.length&&t[e]==="-"&&(i=!0,e++);e<t.length&&/\d/.test(t[e]);)s=s*10+parseInt(t[e],10),e++;if(e<t.length&&t[e]===".")for(e++,l=0;e<t.length&&/\d/.test(t[e]);)l=l*10+parseInt(t[e],10),e++;return i&&s>0&&(s=-s),h(s,n,"width"),l!==-1&&h(l,n,"precision"),[s,l,e-a]}function u(t,a=f){if(c(t)>a)throw new r(`escaped string size limit exceeded (${a} bytes)`,"string_length");let n="",e=0;for(;e<t.length;)if(t[e]==="\\"&&e+1<t.length)switch(t[e+1]){case"n":n+=`
|
|
3
|
-
`,e+=2;break;case"t":n+=" ",e+=2;break;case"r":n+="\r",e+=2;break;case"\\":n+="\\",e+=2;break;case"a":n+="\x07",e+=2;break;case"b":n+="\b",e+=2;break;case"f":n+="\f",e+=2;break;case"v":n+="\v",e+=2;break;case"e":case"E":n+="\x1B",e+=2;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let l="",i=e+1;for(;i<t.length&&i<e+4&&/[0-7]/.test(t[i]);)l+=t[i],i++;n+=String.fromCharCode(parseInt(l,8)),e=i;break}case"x":{let l=[],i=e;for(;i+3<t.length&&t[i]==="\\"&&t[i+1]==="x"&&/[0-9a-fA-F]{2}/.test(t.slice(i+2,i+4));)l.push(parseInt(t.slice(i+2,i+4),16)),i+=4;if(l.length>0){try{let o=new TextDecoder("utf-8",{fatal:!0});n+=o.decode(new Uint8Array(l))}catch{for(let o of l)n+=String.fromCharCode(o)}e=i}else n+=t[e],e++;break}case"u":{let l="",i=e+2;for(;i<t.length&&i<e+6&&/[0-9a-fA-F]/.test(t[i]);)l+=t[i],i++;l?(n+=String.fromCodePoint(parseInt(l,16)),e=i):(n+="\\u",e+=2);break}case"U":{let l="",i=e+2;for(;i<t.length&&i<e+10&&/[0-9a-fA-F]/.test(t[i]);)l+=t[i],i++;l?(n+=String.fromCodePoint(parseInt(l,16)),e=i):(n+="\\U",e+=2);break}default:n+=t[e],e++}else n+=t[e],e++;return n}export{h as a,b,p as c,u as d};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{c as O}from"./chunk-CHHWTPDH.js";import{d as F}from"./chunk-GN6CQ3J4.js";import{a as N,b as w,c as k}from"./chunk-QAYAQNCG.js";var P=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),D=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 x(u){let r=u.trim(),e=r.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!e){let n=parseFloat(r);return Number.isNaN(n)?0:n}let l=parseFloat(e[1]),s=(e[2]||"").toLowerCase(),i=P.get(s)??1;return l*i}function M(u){let r=u.trim().toLowerCase().slice(0,3);return D.get(r)??0}function q(u,r){let e=u.split(/(\d+)/),l=r.split(/(\d+)/),s=Math.max(e.length,l.length);for(let i=0;i<s;i++){let n=e[i]||"",d=l[i]||"",o=/^\d+$/.test(n)?parseInt(n,10):null,c=/^\d+$/.test(d)?parseInt(d,10):null;if(o!==null&&c!==null){if(o!==c)return o-c}else if(n!==d)return n.localeCompare(d)}return 0}function L(u){return u.replace(/[^a-zA-Z0-9\s]/g,"")}function v(u,r,e){let l=e!==null?e:/\s+/,s=u.split(l),i=r.startField-1;if(i>=s.length)return"";if(r.endField===void 0){let o=s[i]||"";return r.startChar!==void 0&&(o=o.slice(r.startChar-1)),r.ignoreLeading&&(o=o.trimStart()),o}let n=Math.min(r.endField-1,s.length-1),d="";for(let o=i;o<=n&&o<s.length;o++){let c=s[o]||"";if(o===i&&r.startChar!==void 0&&(c=c.slice(r.startChar-1)),o===n&&r.endChar!==void 0){let t=o===i&&r.startChar!==void 0?r.endChar-r.startChar+1:r.endChar;c=c.slice(0,t)}o>i&&(d+=e||" "),d+=c}return r.ignoreLeading&&(d=d.trimStart()),d}function I(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=L(l),s=L(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=M(l),n=M(s);return i-n}if(e.humanNumeric){let i=x(l),n=x(s);return i-n}if(e.versionSort)return q(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function B(u){let{keys:r,fieldDelimiter:e,numeric:l,ignoreCase:s,reverse:i,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c,ignoreLeadingBlanks:t,stable:a}=u;return(f,C)=>{let g=f,b=C;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=I(g,b,{numeric:l,ignoreCase:s,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c});if(h!==0)return i?-h:h;if(!a){let p=f.localeCompare(C);return i?-p:p}return 0}for(let m of r){let h=v(g,m,e),p=v(b,m,e);m.ignoreLeading&&(h=h.trimStart(),p=p.trimStart());let V={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},A=m.reverse??i,S=I(h,p,V);if(S!==0)return A?-S:S}if(!a){let m=f.localeCompare(C);return i?-m:m}return 0}}function E(u,r){if(r.keys.length===0){if(r.ignoreCase){let s=new Set;return u.filter(i=>{let n=i.toLowerCase();return s.has(n)?!1:(s.add(n),!0)})}return[...new Set(u)]}let e=r.keys[0],l=new Set;return u.filter(s=>{let i=v(s,e,r.fieldDelimiter);return(e.ignoreCase??r.ignoreCase)&&(i=i.toLowerCase()),l.has(i)?!1:(l.add(i),!0)})}function y(u){let r={startField:1},e="",l=u,s=l.match(/([bdfhMnrV]+)$/);s&&(e=s[1],l=l.slice(0,-e.length)),e.includes("n")&&(r.numeric=!0),e.includes("r")&&(r.reverse=!0),e.includes("f")&&(r.ignoreCase=!0),e.includes("b")&&(r.ignoreLeading=!0),e.includes("h")&&(r.humanNumeric=!0),e.includes("V")&&(r.versionSort=!0),e.includes("d")&&(r.dictionaryOrder=!0),e.includes("M")&&(r.monthSort=!0);let i=l.split(",");if(i.length===0||i[0]==="")return null;let n=i[0].split("."),d=parseInt(n[0],10);if(Number.isNaN(d)||d<1)return null;if(r.startField=d,n.length>1&&n[1]){let o=parseInt(n[1],10);!Number.isNaN(o)&&o>=1&&(r.startChar=o)}if(i.length>1&&i[1]){let o=i[1],c=o.match(/([bdfhMnrV]+)$/);if(c){let a=c[1];a.includes("n")&&(r.numeric=!0),a.includes("r")&&(r.reverse=!0),a.includes("f")&&(r.ignoreCase=!0),a.includes("b")&&(r.ignoreLeading=!0),a.includes("h")&&(r.humanNumeric=!0),a.includes("V")&&(r.versionSort=!0),a.includes("d")&&(r.dictionaryOrder=!0),a.includes("M")&&(r.monthSort=!0),o=o.slice(0,-a.length)}let t=o.split(".");if(t[0]){let a=parseInt(t[0],10);if(!Number.isNaN(a)&&a>=1&&(r.endField=a),t.length>1&&t[1]){let f=parseInt(t[1],10);!Number.isNaN(f)&&f>=1&&(r.endChar=f)}}}return r}var H={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]]
|
|
3
|
-
F is a field number (1-indexed)
|
|
4
|
-
C is a character position within the field (1-indexed)
|
|
5
|
-
OPTS can be: b d f h M n r V (per-key modifiers)
|
|
6
|
-
|
|
7
|
-
Examples:
|
|
8
|
-
-k1 sort by first field
|
|
9
|
-
-k2,2 sort by second field only
|
|
10
|
-
-k1.3 sort by first field starting at 3rd character
|
|
11
|
-
-k1,2n sort by fields 1-2 numerically
|
|
12
|
-
-k2 -k1 sort by field 2, then by field 1`},R={name:"sort",async execute(u,r){if(w(u))return N(H);let e={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},l=[];for(let c=0;c<u.length;c++){let t=u[c];if(t==="-r"||t==="--reverse")e.reverse=!0;else if(t==="-n"||t==="--numeric-sort")e.numeric=!0;else if(t==="-u"||t==="--unique")e.unique=!0;else if(t==="-f"||t==="--ignore-case")e.ignoreCase=!0;else if(t==="-h"||t==="--human-numeric-sort")e.humanNumeric=!0;else if(t==="-V"||t==="--version-sort")e.versionSort=!0;else if(t==="-d"||t==="--dictionary-order")e.dictionaryOrder=!0;else if(t==="-M"||t==="--month-sort")e.monthSort=!0;else if(t==="-b"||t==="--ignore-leading-blanks")e.ignoreLeadingBlanks=!0;else if(t==="-s"||t==="--stable")e.stable=!0;else if(t==="-c"||t==="--check")e.checkOnly=!0;else if(t==="-o"||t==="--output")e.outputFile=u[++c]||null;else if(t.startsWith("-o"))e.outputFile=t.slice(2)||null;else if(t.startsWith("--output="))e.outputFile=t.slice(9)||null;else if(t==="-t"||t==="--field-separator")e.fieldDelimiter=u[++c]||null;else if(t.startsWith("-t"))e.fieldDelimiter=t.slice(2)||null;else if(t.startsWith("--field-separator="))e.fieldDelimiter=t.slice(18)||null;else if(t==="-k"||t==="--key"){let a=u[++c];if(a){let f=y(a);f&&e.keys.push(f)}}else if(t.startsWith("-k")){let a=y(t.slice(2));a&&e.keys.push(a)}else if(t.startsWith("--key=")){let a=y(t.slice(6));a&&e.keys.push(a)}else{if(t.startsWith("--"))return k("sort",t);if(t.startsWith("-")&&!t.startsWith("--")){let a=!1;for(let f of t.slice(1))if(f==="r")e.reverse=!0;else if(f==="n")e.numeric=!0;else if(f==="u")e.unique=!0;else if(f==="f")e.ignoreCase=!0;else if(f==="h")e.humanNumeric=!0;else if(f==="V")e.versionSort=!0;else if(f==="d")e.dictionaryOrder=!0;else if(f==="M")e.monthSort=!0;else if(f==="b")e.ignoreLeadingBlanks=!0;else if(f==="s")e.stable=!0;else if(f==="c")e.checkOnly=!0;else{a=!0;break}if(a)return k("sort",t)}else l.push(t)}}let s=await O(r,l,{cmdName:"sort"});if(!s.ok)return s.error;let n=F(s.content).split(`
|
|
13
|
-
`);n.length>0&&n[n.length-1]===""&&n.pop();let d=B(e);if(e.checkOnly){let c=l.length>0?l[0]:"-";for(let t=1;t<n.length;t++)if(d(n[t-1],n[t])>0)return{stdout:"",stderr:`sort: ${c}:${t+1}: disorder: ${n[t]}
|
|
14
|
-
`,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}n.sort(d),e.unique&&(n=E(n,e));let o=n.length>0?`${n.join(`
|
|
15
|
-
`)}
|
|
16
|
-
`:"";if(e.outputFile){let c=r.fs.resolvePath(r.cwd,e.outputFile);return await r.fs.writeFile(c,o),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0}}},Y={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};export{R as a,Y as b};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{d as g}from"./chunk-GN6CQ3J4.js";import{a as y,b as $,c as F}from"./chunk-QAYAQNCG.js";var b={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"]},E={name:"comm",async execute(m,a){if($(m))return y(b);let r=!1,l=!1,f=!1,i=[];for(let e of m)if(e==="-1")r=!0;else if(e==="-2")l=!0;else if(e==="-3")f=!0;else if(e==="-12"||e==="-21")r=!0,l=!0;else if(e==="-13"||e==="-31")r=!0,f=!0;else if(e==="-23"||e==="-32")l=!0,f=!0;else if(e==="-123"||e==="-132"||e==="-213"||e==="-231"||e==="-312"||e==="-321")r=!0,l=!0,f=!0;else{if(e.startsWith("-")&&e!=="-")return F("comm",e);i.push(e)}if(i.length!==2)return{stdout:"",stderr:`comm: missing operand
|
|
3
|
-
Try 'comm --help' for more information.
|
|
4
|
-
`,exitCode:1};let p=async e=>{if(e==="-")return g(a.stdin);try{let x=a.fs.resolvePath(a.cwd,e);return await a.fs.readFile(x)}catch{return null}},c=await p(i[0]);if(c===null)return{stdout:"",stderr:`comm: ${i[0]}: No such file or directory
|
|
5
|
-
`,exitCode:1};let d=await p(i[1]);if(d===null)return{stdout:"",stderr:`comm: ${i[1]}: No such file or directory
|
|
6
|
-
`,exitCode:1};let t=c.split(`
|
|
7
|
-
`),s=d.split(`
|
|
8
|
-
`);t.length>0&&t[t.length-1]===""&&t.pop(),s.length>0&&s[s.length-1]===""&&s.pop();let n=0,o=0,u="",h=r?"":" ",w=(r?"":" ")+(l?"":" ");for(;n<t.length||o<s.length;)n>=t.length?(l||(u+=`${h}${s[o]}
|
|
9
|
-
`),o++):o>=s.length?(r||(u+=`${t[n]}
|
|
10
|
-
`),n++):t[n]<s[o]?(r||(u+=`${t[n]}
|
|
11
|
-
`),n++):t[n]>s[o]?(l||(u+=`${h}${s[o]}
|
|
12
|
-
`),o++):(f||(u+=`${w}${t[n]}
|
|
13
|
-
`),n++,o++);return{stdout:u,stderr:"",exitCode:0}}},L={name:"comm",flags:[{flag:"-1",type:"boolean"},{flag:"-2",type:"boolean"},{flag:"-3",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,L as b};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as l,b as n,d as s}from"./chunk-CGI6V2HW.js";import{a,b as i}from"./chunk-QAYAQNCG.js";var m={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"]},d={name:"tail",async execute(t,r){if(i(t))return a(m);let e=l(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:f}=e.options;return n(r,e.options,"tail",u=>s(u,o,p,f??!1))}},c={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};export{d as a,c as b};
|