@inkeep/open-knowledge 0.0.0-dev-20260427210233 → 0.0.0-dev-20260427210535

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/dist/alias-JE7RI5QX-TirEebNy.mjs +1 -0
  2. package/dist/awk2-POPGKRAI-DigGXYmO.mjs +1 -0
  3. package/dist/banner-BxI1wnW9.mjs +3 -0
  4. package/dist/base64-4YMZCVJ5-B4GnvJtR.mjs +1 -0
  5. package/dist/basename-AA2KJYZQ-DlZHEU5f.mjs +1 -0
  6. package/dist/bash-IJWYRKFO-BA1gxmDh.mjs +1 -0
  7. package/dist/build-D4l8tfO0.mjs +2 -0
  8. package/dist/cat-RDUMLXKC-CAQOzqfy.mjs +1 -0
  9. package/dist/chmod-SYMGL4JA-BC2VVHCa.mjs +1 -0
  10. package/dist/{chokidar-DhL3M6Oj.mjs → chokidar-CblsKfnx.mjs} +3 -3
  11. package/dist/chunk-24IMIIXA-Bz7rlZT3.mjs +2 -0
  12. package/dist/chunk-3THT3N7L-klp8GP84.mjs +2 -0
  13. package/dist/chunk-3ZUFRYJ4-C93H8j0V.mjs +2 -0
  14. package/dist/chunk-44UOCSGV-BUBpWxXm.mjs +2 -0
  15. package/dist/chunk-4GTNDTRF-_OVmXcJ-.mjs +8 -0
  16. package/dist/chunk-4HHKTUW3-Dm69hDaZ.mjs +3 -0
  17. package/dist/chunk-4Q4SM6WR-DDQRsilN.mjs +5 -0
  18. package/dist/chunk-55VFSPNA-DVZfQAzN.mjs +3 -0
  19. package/dist/chunk-5QMZ5MUS-DWTkM0vM.mjs +5 -0
  20. package/dist/chunk-5QVNJEHU-BvsipSFW.mjs +9 -0
  21. package/dist/chunk-5V6VZH6T-BCr5_GDF.mjs +2 -0
  22. package/dist/chunk-62RKD26F-D-luOa0m.mjs +21 -0
  23. package/dist/chunk-64BAICW3-CTJNEx4Q.mjs +2 -0
  24. package/dist/chunk-74CEPOFO-D1bzz49u.mjs +23 -0
  25. package/dist/chunk-7L36YK2X-RiPZFKaV.mjs +3 -0
  26. package/dist/chunk-7TSDKFEO-a-GUGBTu.mjs +2 -0
  27. package/dist/chunk-A4HU7SVR-hefV_YmW.mjs +3 -0
  28. package/dist/chunk-A4JSPFCI-U-xWmMMC.mjs +7 -0
  29. package/dist/chunk-A5O5YHGN-C7BVq0eF.mjs +2 -0
  30. package/dist/chunk-A65PWWJC-D7J5l9eq.mjs +3 -0
  31. package/dist/chunk-A7A2DBEE-PLfkXLI4.mjs +7 -0
  32. package/dist/chunk-A7ICOL4V-Drb3XsEL.mjs +14 -0
  33. package/dist/chunk-ALLTKNUZ-BMiTDN50.mjs +6 -0
  34. package/dist/chunk-APT7OOP2-CXHnSuct.mjs +2 -0
  35. package/dist/chunk-BBXLRYSX-DURjrblE.mjs +6 -0
  36. package/dist/chunk-BRGMQKJV-CdrkqzRA.mjs +63 -0
  37. package/dist/chunk-CR5AFCPT-ROmyDFrB.mjs +24 -0
  38. package/dist/chunk-CWQS3NFK-DFdwmFxJ.mjs +2 -0
  39. package/dist/chunk-D4J545R4-C8nMOauR.mjs +12 -0
  40. package/dist/chunk-D6CWQ5DW-B-J4LN9N.mjs +6 -0
  41. package/dist/chunk-D7MEQ3VN-Csvth_Ss.mjs +5 -0
  42. package/dist/chunk-DCAAORBQ-BdrR5ttw.mjs +2 -0
  43. package/dist/chunk-DXB73IDG-C774okS0.mjs +2 -0
  44. package/dist/chunk-EEXR5ZDP-C5AJH114.mjs +3 -0
  45. package/dist/chunk-EIZGF4BS-8bsVXqW0.mjs +9 -0
  46. package/dist/chunk-F23WWYKW-DST0dB7V.mjs +17 -0
  47. package/dist/chunk-F55TLFGB-DqkrAMO5.mjs +10 -0
  48. package/dist/chunk-FEIOJCZD-C4x0A4rb.mjs +75 -0
  49. package/dist/chunk-GCTKCWKD-Deqi1D_N.mjs +4 -0
  50. package/dist/chunk-GFQRA5P5-1fzItQ8F.mjs +8 -0
  51. package/dist/chunk-GOV5EKKI-PN17n-Z0.mjs +10 -0
  52. package/dist/chunk-GXVXFKBA-993FoPmq.mjs +6 -0
  53. package/dist/chunk-HDQ56CKY-pGV4pOJA.mjs +16 -0
  54. package/dist/chunk-HJQJAYMS-Ci3vsKQW.mjs +3 -0
  55. package/dist/chunk-HJWBQKYG-UZig4wUt.mjs +6 -0
  56. package/dist/chunk-HWBSOZZR-Dikp87Ww.mjs +37 -0
  57. package/dist/chunk-HWKDQ44K-CPSjqtR_.mjs +4 -0
  58. package/dist/chunk-I57KEIP3-B1DoH8rp.mjs +11 -0
  59. package/dist/chunk-IPJHKYVM-BbWncVr2.mjs +2 -0
  60. package/dist/chunk-J642UCRS-DB77Y2Wt.mjs +2 -0
  61. package/dist/chunk-JVPRLUMK-DnQCNjpq.mjs +8 -0
  62. package/dist/chunk-KMEYNNUA-DfdK88O_.mjs +16 -0
  63. package/dist/chunk-LL3S3NLB-DxXgE3kY.mjs +2 -0
  64. package/dist/chunk-LPQPILI2-BXfU9TgM.mjs +12 -0
  65. package/dist/chunk-LTZRCH7N-GAjTFNwG.mjs +32 -0
  66. package/dist/chunk-LWEGUNWT-BALY4RLC.mjs +8 -0
  67. package/dist/chunk-MDDMCKUK-D6GWoJsI.mjs +7 -0
  68. package/dist/chunk-MDLLFABN-oBQf6bGE.mjs +73 -0
  69. package/dist/chunk-MHTUABJP-dKmK6Hw7.mjs +9 -0
  70. package/dist/chunk-MIZPJHVH-z-geAni9.mjs +8 -0
  71. package/dist/chunk-MLXIYONF-DB-C8Hx8.mjs +16 -0
  72. package/dist/chunk-MYE6AGBJ-B4pRo9ma.mjs +17 -0
  73. package/dist/chunk-NAERJDUW-CX0lf-xx.mjs +9 -0
  74. package/dist/chunk-NCNPKYJZ-BFGan4lR.mjs +3 -0
  75. package/dist/chunk-NUYSJFDK-D2NXm2ND.mjs +8 -0
  76. package/dist/chunk-NYQYO467-Degkom4D.mjs +33 -0
  77. package/dist/chunk-OARHFVLG-CY8D2Qov.mjs +21 -0
  78. package/dist/chunk-OCLXQMOG-BMsyLQhm.mjs +7 -0
  79. package/dist/chunk-OCS6LSEM-BHslttnj.mjs +14 -0
  80. package/dist/chunk-OJDRYQWQ-BV5MVRVg.mjs +2 -0
  81. package/dist/chunk-OL3S66CO-Bmgu4tW4.mjs +100 -0
  82. package/dist/chunk-PBXLG62G-lGjqkk78.mjs +9 -0
  83. package/dist/chunk-PP6PSHAB-DMC_XCfO.mjs +5 -0
  84. package/dist/chunk-PYSFUGCK-CY7pclEB.mjs +11 -0
  85. package/dist/chunk-QCDB2VPH-D1RuXtOm.mjs +7 -0
  86. package/dist/chunk-QJ7O6ZN3-BH67tCjg.mjs +6 -0
  87. package/dist/chunk-R6QSAL5T-CtbJTvt9.mjs +2 -0
  88. package/dist/chunk-R6VWJ2ZL-B0CcMPyK.mjs +2 -0
  89. package/dist/chunk-RPNGRAAP-BughPjdR.mjs +8 -0
  90. package/dist/chunk-SDNKECQQ-C3GEf3VZ.mjs +6 -0
  91. package/dist/chunk-SYMJJMQ4-CWTh95-4.mjs +22 -0
  92. package/dist/chunk-T56QNPHK-DlKQeuXU.mjs +15 -0
  93. package/dist/chunk-TLSUDHID-B8UnqY4U.mjs +7 -0
  94. package/dist/chunk-TOMNU26N-BcdbBQ2p.mjs +5 -0
  95. package/dist/chunk-TXBZCHCQ-l48TczF5.mjs +6 -0
  96. package/dist/chunk-UNYNJIFU-DwPQMz0F.mjs +140 -0
  97. package/dist/chunk-V7TAPXDL-CnKUp2df.mjs +28 -0
  98. package/dist/chunk-VJFXDYWH-IiUXkKX0.mjs +11 -0
  99. package/dist/chunk-VLGZJRPG-D4NVKJYL.mjs +17 -0
  100. package/dist/chunk-VOBGTVA6-BT7gUxqf.mjs +7 -0
  101. package/dist/chunk-VYOJP4TV-BvibOnKG.mjs +14 -0
  102. package/dist/chunk-WKFATFPP-DCZdrA8x.mjs +5 -0
  103. package/dist/chunk-X2AJGDEF-BaH6i1Rq.mjs +2 -0
  104. package/dist/chunk-XHM67O4N-Cg35xc6b.mjs +2 -0
  105. package/dist/chunk-XKQRETAK-cVWA9gEB.mjs +2 -0
  106. package/dist/chunk-XORM457F-CRToN1RQ.mjs +288 -0
  107. package/dist/chunk-XVDPCNWR-CtK-Xs2O.mjs +12 -0
  108. package/dist/chunk-YCFVLTST-Ox9Z0Nk6.mjs +13 -0
  109. package/dist/chunk-YFG2CMIF-Csgr05KV.mjs +5 -0
  110. package/dist/chunk-YNYSPYQ5-BpP11HXS.mjs +34 -0
  111. package/dist/chunk-YS3AZT3J-BEZxz_aQ.mjs +9 -0
  112. package/dist/chunk-YTNYSM6T-DuBR2-TM.mjs +12 -0
  113. package/dist/chunk-Z6LRHWXI-DbRghyzT.mjs +14 -0
  114. package/dist/chunk-Z7JVV2SM-BzR-yvwK.mjs +12 -0
  115. package/dist/clear-5CZ5X4YR-B5oRhK00.mjs +1 -0
  116. package/dist/cli.mjs +798 -67
  117. package/dist/colors-BnZ-i-vb.mjs +1 -0
  118. package/dist/colors-DoPZvo1q.mjs +2 -0
  119. package/dist/column-WLPMMSTS-fFssyAvW.mjs +1 -0
  120. package/dist/comm-5SLSESQG-DRcwK9Gt.mjs +1 -0
  121. package/dist/constants-BZWlp7wi.mjs +2 -0
  122. package/dist/cp-XOYR4ABJ-BUZu7KNi.mjs +1 -0
  123. package/dist/curl-47BFPSFW-Kn_Na_aU.mjs +26 -0
  124. package/dist/cut-OPC3VAGB-BIRZEN2Y.mjs +1 -0
  125. package/dist/date-DD7FVA2V-DRxppxbV.mjs +1 -0
  126. package/dist/diff-HJF2MPDN-Yo3lE_58.mjs +1 -0
  127. package/dist/dirname-LEMTZZFS-2cTXnmQf.mjs +1 -0
  128. package/dist/dist-BCyi1oM7.mjs +116 -0
  129. package/dist/{dist-mmLEboji.mjs → dist-BWvkug8h.mjs} +34 -50
  130. package/dist/dist-Bx5GgBdJ.mjs +1 -0
  131. package/dist/dist-DRC09WNZ.mjs +199 -0
  132. package/dist/dist-bundle-BSdjl7Rj.mjs +2 -0
  133. package/dist/dist-bundle-BmF5_Mcp.mjs +1 -0
  134. package/dist/du-WO2ENHXQ-B5uda2-L.mjs +1 -0
  135. package/dist/echo-O45JWWI2-B9QCpaZR.mjs +1 -0
  136. package/dist/env-5EPCWSXR--4eujSrM.mjs +1 -0
  137. package/dist/esm-29fM6BBO.mjs +20 -0
  138. package/dist/{esm-DcyORBXm.mjs → esm-BFkWzFey.mjs} +1 -1
  139. package/dist/{execAsync-CUVyYd50.mjs → execAsync-0jii24p9.mjs} +1 -1
  140. package/dist/{execAsync-DXwNXlSG.mjs → execAsync-Czqc-yAz.mjs} +1 -1
  141. package/dist/{execAsync-r1zz6x3t.mjs → execAsync-DgmLXmTx.mjs} +1 -1
  142. package/dist/expand-DTNXU4LQ-BWwDphsm.mjs +1 -0
  143. package/dist/expansion-ENLSRCXJ-BBTiIHJS.mjs +1 -0
  144. package/dist/expr-5T3UU5KE-D5OdgUlD.mjs +1 -0
  145. package/dist/file-ZIGAJ4YS-zZfB3nws.mjs +1 -0
  146. package/dist/find-TPUOAIUQ-DaW1-9Vm.mjs +1 -0
  147. package/dist/flag-coverage-QT4N2Z44-B8zntJyb.mjs +2 -0
  148. package/dist/fold-LDSORVYE-CAfX9d8n.mjs +1 -0
  149. package/dist/{getMachineId-bsd-BrpAo1fJ.mjs → getMachineId-bsd-C1M346yz.mjs} +2 -2
  150. package/dist/{getMachineId-bsd-DZHdCHYD.mjs → getMachineId-bsd-CPESl3L6.mjs} +2 -2
  151. package/dist/{getMachineId-bsd-o7HphUWK.mjs → getMachineId-bsd-DEUypOXJ.mjs} +2 -2
  152. package/dist/{getMachineId-darwin-3D3eRDVl.mjs → getMachineId-darwin-0hBTy7c8.mjs} +2 -2
  153. package/dist/{getMachineId-darwin-CsteOFjK.mjs → getMachineId-darwin-CJK3eX9q.mjs} +2 -2
  154. package/dist/{getMachineId-darwin-D-BjJUXV.mjs → getMachineId-darwin-Vupnt-kR.mjs} +2 -2
  155. package/dist/{getMachineId-linux-C-EpqTRh.mjs → getMachineId-linux-B2nkqMir.mjs} +2 -2
  156. package/dist/{getMachineId-linux-CceeieLZ.mjs → getMachineId-linux-BGQn48cN.mjs} +2 -2
  157. package/dist/{getMachineId-linux-BELE5feP.mjs → getMachineId-linux-CIp07XEX.mjs} +2 -2
  158. package/dist/{getMachineId-unsupported-CUPNvbj5.mjs → getMachineId-unsupported-BnsanXR2.mjs} +2 -2
  159. package/dist/{getMachineId-unsupported-CrmDv6SC.mjs → getMachineId-unsupported-CH1Q20xN.mjs} +2 -2
  160. package/dist/{getMachineId-unsupported-C9qPEPHy.mjs → getMachineId-unsupported-DfSmC7Gy.mjs} +2 -2
  161. package/dist/{getMachineId-win-AH3HxM3-.mjs → getMachineId-win-BmmB_8yL.mjs} +2 -2
  162. package/dist/{getMachineId-win-BHtOEO59.mjs → getMachineId-win-DlPRChXs.mjs} +2 -2
  163. package/dist/{getMachineId-win-CFHq48vo.mjs → getMachineId-win-JnMJbIaW.mjs} +2 -2
  164. package/dist/git-handle-BhGnmvTB-BMB_49Sb.mjs +10 -0
  165. package/dist/git-handle-BhGnmvTB-Di8EsrYa.mjs +1 -0
  166. package/dist/grep-3AIAIJVR-C9A_aSMK.mjs +1 -0
  167. package/dist/gzip-AQXSGOVS-CL228lzk.mjs +1 -0
  168. package/dist/head-HT2B6D2J-DyNkF3aY.mjs +1 -0
  169. package/dist/help-VVWX7SA5-D5WzpTIY.mjs +1 -0
  170. package/dist/history-J4QRNGRO-DUTsR2Sf.mjs +1 -0
  171. package/dist/hostname-BK6HG2DE-zmNkhqtV.mjs +1 -0
  172. package/dist/html-to-markdown-TFCECAGV-Ux5cbjMV.mjs +1 -0
  173. package/dist/index.d.mts +2118 -54
  174. package/dist/index.mjs +1 -1
  175. package/dist/init-AF92T0LI.mjs +1 -0
  176. package/dist/{init-CsbZPgm9.mjs → init-CDQXH2-i.mjs} +6 -6
  177. package/dist/init-DOiFaqRI.mjs +254 -0
  178. package/dist/init-SDAphqYo.mjs +1 -0
  179. package/dist/{is-object-CEU0BgQ5.mjs → is-object-BNVklKxg.mjs} +1 -1
  180. package/dist/join-GG2LDHE5-B6C3-ghI.mjs +1 -0
  181. package/dist/jq-ODXZBPLY-Uj_VahOC.mjs +1 -0
  182. package/dist/js-exec-M6UR76J5-DSk5_wnx.mjs +97 -0
  183. package/dist/{keepalive-DCcA7pmC.mjs → keepalive-CZzB5k1h.mjs} +1 -1
  184. package/dist/lib-Dl2j2VNl.mjs +2 -0
  185. package/dist/libesm-DC4M2SkF.mjs +14 -0
  186. package/dist/ln-4TRFBYAT-DiYK6FgR.mjs +1 -0
  187. package/dist/loader-B-hHIGF7.mjs +3 -0
  188. package/dist/loader-DsgFEqrz.mjs +1 -0
  189. package/dist/ls-KSXFZCWH-B0la1Q-P.mjs +1 -0
  190. package/dist/lzma-0LJzVZpl.mjs +2 -0
  191. package/dist/md5sum-INMIK4DX-DAG8dmoX.mjs +1 -0
  192. package/dist/mkdir-TDEMSB6C-CRMB4_AE.mjs +1 -0
  193. package/dist/mv-Z6MORUFL-1iTO8NY5.mjs +1 -0
  194. package/dist/nl-U5YJDM32-IRiMqQcZ.mjs +1 -0
  195. package/dist/od-VJEF2UR5-PasvdXXR.mjs +1 -0
  196. package/dist/{open-browser-ryHU9Kmc.mjs → open-browser-BzMQ6cLf.mjs} +1 -1
  197. package/dist/paste-7N6AFSDS-C3M5_YM6.mjs +1 -0
  198. package/dist/paths-CcbqTPyR.mjs +2 -0
  199. package/dist/paths-DtSqXz-J.mjs +1 -0
  200. package/dist/preview-C9fc_Jna.mjs +1 -0
  201. package/dist/preview-DsHKavXe.mjs +3 -0
  202. package/dist/printf-CX64KX2P-uTOF6Zpa.mjs +1 -0
  203. package/dist/pwd-D4OZ7N27-DNkGMjtD.mjs +1 -0
  204. package/dist/python3-AUFTPCU6-MeZyx8_A.mjs +12 -0
  205. package/dist/readlink-MI4GCHJF-DRVZBAvY.mjs +1 -0
  206. package/dist/rev-XOSYPP45-q2MQLs41.mjs +1 -0
  207. package/dist/rg-FOQSCCX3-Cssz8GNh.mjs +1 -0
  208. package/dist/rm-RTZG23RL-fjvVauiI.mjs +1 -0
  209. package/dist/rmdir-XTQXT7RK-C13HY1h7.mjs +1 -0
  210. package/dist/{rolldown-runtime-wcPFST8Q-DriDJLQM.mjs → rolldown-runtime-wcPFST8Q-BB0WpHs3.mjs} +1 -1
  211. package/dist/sed-VFTTATXJ-DO49xc40.mjs +1 -0
  212. package/dist/seq-RN5ZUASB-D9r6kc_Z.mjs +1 -0
  213. package/dist/server-lock-CH0GCP_4-DXqutMlt.mjs +2 -0
  214. package/dist/server-lock-CH0GCP_4-MazZqjDk.mjs +1 -0
  215. package/dist/sha1sum-VJPNLNU6-4uBt63v6.mjs +1 -0
  216. package/dist/sha256sum-PI32XWXY-_uaXSgBK.mjs +1 -0
  217. package/dist/sleep-VZFPZFWA-CS7jDpXp.mjs +1 -0
  218. package/dist/sort-DCNRDA7U-Dmp_2ZoH.mjs +1 -0
  219. package/dist/split-SITCSYCZ-Cu9ifXuc.mjs +1 -0
  220. package/dist/sqlite3-56UMWEY3-D1Xq8d4g.mjs +1 -0
  221. package/dist/src-BkszjXGW.mjs +1 -0
  222. package/dist/start-BMH5fwi_.mjs +2 -0
  223. package/dist/start-jYZEQp_g.mjs +1 -0
  224. package/dist/stat-BT5A227F-Dqepjl-k.mjs +1 -0
  225. package/dist/strings-7PLOGTPD-g6FhPS64.mjs +1 -0
  226. package/dist/tac-SJGXQ4T2-DczI7HKk.mjs +1 -0
  227. package/dist/tail-S5ULNTJU-Bk22kVUG.mjs +1 -0
  228. package/dist/tar-ANUBEFJY-1lwT6ndQ.mjs +1 -0
  229. package/dist/tee-O7VXZDCO-Ftqr8Jad.mjs +1 -0
  230. package/dist/time-DEUO3QV2-BtzQ0nVf.mjs +1 -0
  231. package/dist/timeout-VRKMCG72-Cpzi9cz-.mjs +1 -0
  232. package/dist/touch-DX2IJOQ4-ewCHfbB3.mjs +1 -0
  233. package/dist/tr-2HXZRDSW-DrrobhxR.mjs +1 -0
  234. package/dist/tree-LYXBS7DC-DZnTMKSh.mjs +1 -0
  235. package/dist/true-WHJNXCHG-BaLssNp9.mjs +1 -0
  236. package/dist/unexpand-RGTMIGZM-BOmSL08U.mjs +1 -0
  237. package/dist/uniq-SUNANL47-Cn_JDmUJ.mjs +1 -0
  238. package/dist/wc-TQB3VNOX-DkOBrQlr.mjs +1 -0
  239. package/dist/which-XZHEH76L-DxZJ58G5.mjs +1 -0
  240. package/dist/whoami-DGKU3D2X-Bn1LP0m_.mjs +1 -0
  241. package/dist/{wrapper-DDHUdYtj.mjs → wrapper-BTT6637Z.mjs} +1 -1
  242. package/dist/xan-BXDXYEIB-_Vtao535.mjs +1 -0
  243. package/dist/xan-view-ECQUO7AJ-6vlhfSF-.mjs +1 -0
  244. package/dist/xargs-I6EZUCYF-dHdg4qaj.mjs +1 -0
  245. package/dist/yq-MJMAR36V-pRBq87Ya.mjs +1 -0
  246. package/package.json +1 -1
  247. package/dist/banner-B9XXjTZc.mjs +0 -3
  248. package/dist/colors-CMt7h9Vn.mjs +0 -1
  249. package/dist/colors-Jf5QUiX2.mjs +0 -2
  250. package/dist/constants-DCYrT5Qy.mjs +0 -2
  251. package/dist/dist-B8mg-f6q.mjs +0 -1
  252. package/dist/dist-D4iyaPjq.mjs +0 -161
  253. package/dist/git-handle-BhGnmvTB-BLKTZ5Yk.mjs +0 -1
  254. package/dist/git-handle-BhGnmvTB-DnqwJBAv.mjs +0 -2
  255. package/dist/init-B61XMkrc.mjs +0 -5
  256. package/dist/init-BCFZ-B8u.mjs +0 -1
  257. package/dist/init-CS5xVRRu.mjs +0 -1
  258. package/dist/loader-BpHan16x.mjs +0 -1
  259. package/dist/loader-DjYfoioW.mjs +0 -3
  260. package/dist/paths-CWuZnjHL.mjs +0 -1
  261. package/dist/paths-HVMMTnqB.mjs +0 -2
  262. package/dist/preview-D5D9OVCW.mjs +0 -1
  263. package/dist/preview-Lo1Amm1Z.mjs +0 -3
  264. package/dist/server-lock-CH0GCP_4-DCYOtKMW.mjs +0 -2
  265. package/dist/server-lock-CH0GCP_4-DHiJeSSV.mjs +0 -1
  266. package/dist/src-B08b0hiw.mjs +0 -1
  267. package/dist/start-BccdyuHF.mjs +0 -2
  268. package/dist/start-CsashZvR.mjs +0 -1
@@ -0,0 +1,6 @@
1
+ import{t as e}from"./chunk-YNYSPYQ5-BpP11HXS.mjs";import{i as t}from"./chunk-GFQRA5P5-1fzItQ8F.mjs";import{r as n,t as r}from"./chunk-OJDRYQWQ-BV5MVRVg.mjs";import{t as i}from"./chunk-24IMIIXA-Bz7rlZT3.mjs";import{a,c as o,i as s,n as c,o as l,r as u,t as d}from"./chunk-7TSDKFEO-a-GUGBTu.mjs";function f(e,t,n,i,s,c,u,d,f,p){switch(t){case`sort`:return Array.isArray(e)?[[...e].sort(u)]:[null];case`sort_by`:return!Array.isArray(e)||n.length===0?[null]:[[...e].sort((e,t)=>{let r=s(e,n[0],i)[0],a=s(t,n[0],i)[0];return u(r,a)})];case`bsearch`:if(!Array.isArray(e))throw Error(`${e===null?`null`:typeof e==`object`?`object`:typeof e} (${JSON.stringify(e)}) cannot be searched from`);return n.length===0?[null]:s(e,n[0],i).map(t=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;u(e[i],t)<0?n=i+1:r=i}return n<e.length&&u(e[n],t)===0?n:-n-1});case`unique_by`:{if(!Array.isArray(e)||n.length===0)return[null];let t=new Map;for(let r of e){let e=s(r,n[0],i)[0],a=JSON.stringify(e);t.has(a)||t.set(a,{item:r,key:e})}let r=[...t.values()];return r.sort((e,t)=>u(e.key,t.key)),[r.map(e=>e.item)]}case`group_by`:{if(!Array.isArray(e)||n.length===0)return[null];let t=new Map;for(let r of e){let e=JSON.stringify(s(r,n[0],i)[0]);t.has(e)||t.set(e,[]),t.get(e)?.push(r)}return[[...t.values()]]}case`max`:return Array.isArray(e)&&e.length>0?[e.reduce((e,t)=>u(e,t)>0?e:t)]:[null];case`max_by`:return!Array.isArray(e)||e.length===0||n.length===0?[null]:[e.reduce((e,t)=>{let r=s(e,n[0],i)[0],a=s(t,n[0],i)[0];return u(r,a)>0?e:t})];case`min`:return Array.isArray(e)&&e.length>0?[e.reduce((e,t)=>u(e,t)<0?e:t)]:[null];case`min_by`:return!Array.isArray(e)||e.length===0||n.length===0?[null]:[e.reduce((e,t)=>{let r=s(e,n[0],i)[0],a=s(t,n[0],i)[0];return u(r,a)<0?e:t})];case`add`:{let t=e=>{let t=e.filter(e=>e!==null);return t.length===0?null:t.every(e=>typeof e==`number`)?t.reduce((e,t)=>e+t,0):t.every(e=>typeof e==`string`)?t.join(``):t.every(e=>Array.isArray(e))?t.flat():t.every(e=>e&&typeof e==`object`&&!Array.isArray(e))?r(...t):null};return n.length>=1?[t(s(e,n[0],i))]:Array.isArray(e)?[t(e)]:[null]}case`any`:if(n.length>=2){try{let t=c(e,n[0],i);for(let e of t)if(s(e,n[1],i).some(d))return[!0]}catch(e){if(e instanceof p)throw e}return[!1]}return n.length===1?Array.isArray(e)?[e.some(e=>d(s(e,n[0],i)[0]))]:[!1]:Array.isArray(e)?[e.some(d)]:[!1];case`all`:if(n.length>=2){try{let t=c(e,n[0],i);for(let e of t)if(!s(e,n[1],i).some(d))return[!1]}catch(e){if(e instanceof p)throw e}return[!0]}return n.length===1?Array.isArray(e)?[e.every(e=>d(s(e,n[0],i)[0]))]:[!0]:Array.isArray(e)?[e.every(d)]:[!0];case`select`:return n.length===0||s(e,n[0],i).some(d)?[e]:[];case`map`:return n.length===0||!Array.isArray(e)?[null]:[e.flatMap(e=>s(e,n[0],i))];case`map_values`:if(n.length===0)return[null];if(Array.isArray(e))return[e.flatMap(e=>s(e,n[0],i))];if(e&&typeof e==`object`){let t=Object.create(null);for(let[r,o]of Object.entries(e)){if(!l(r))continue;let e=s(o,n[0],i);e.length>0&&a(t,r,e[0])}return[t]}return[null];case`has`:{if(n.length===0)return[!1];let t=s(e,n[0],i)[0];return Array.isArray(e)&&typeof t==`number`?[t>=0&&t<e.length]:e&&typeof e==`object`&&typeof t==`string`?[o(e,t)]:[!1]}case`in`:{if(n.length===0)return[!1];let t=s(e,n[0],i)[0];return Array.isArray(t)&&typeof e==`number`?[e>=0&&e<t.length]:t&&typeof t==`object`&&typeof e==`string`?[o(t,e)]:[!1]}case`contains`:return n.length===0?[!1]:[f(e,s(e,n[0],i)[0])];case`inside`:return n.length===0?[!1]:[f(s(e,n[0],i)[0],e)];default:return null}}function p(e,t,n,r,i,a,o,s){switch(t){case`first`:if(n.length>0)try{let t=a(e,n[0],r);return t.length>0?[t[0]]:[]}catch(e){if(e instanceof s)throw e;return[]}return Array.isArray(e)&&e.length>0?[e[0]]:[null];case`last`:if(n.length>0){let t=i(e,n[0],r);return t.length>0?[t[t.length-1]]:[]}return Array.isArray(e)&&e.length>0?[e[e.length-1]]:[null];case`nth`:{if(n.length<1)return[null];let t=i(e,n[0],r);if(n.length>1){for(let e of t)if(e<0)throw Error(`nth doesn't support negative indices`);let i;try{i=a(e,n[1],r)}catch(e){if(e instanceof s)throw e;i=[]}return t.flatMap(e=>{let t=e;return t<i.length?[i[t]]:[]})}return Array.isArray(e)?t.flatMap(t=>{let n=t;if(n<0)throw Error(`nth doesn't support negative indices`);return n<e.length?[e[n]]:[null]}):[null]}case`range`:{if(n.length===0)return[];let t=Math.max(r.limits.maxIterations*100,1e6),a=e=>e.length>=t,o=i(e,n[0],r);if(n.length===1){let e=[];for(let t of o){let n=t;for(let t=0;t<n;t++)if(e.push(t),a(e))return e}return e}let s=i(e,n[1],r);if(n.length===2){let e=[];for(let t of o)for(let n of s){let r=t,i=n;for(let t=r;t<i;t++)if(e.push(t),a(e))return e}return e}let c=i(e,n[2],r),l=[];for(let e of o)for(let t of s)for(let n of c){let r=e,i=t,o=n;if(o!==0){if(o>0){for(let e=r;e<i;e+=o)if(l.push(e),a(l))return l}else for(let e=r;e>i;e+=o)if(l.push(e),a(l))return l}}return l}case`limit`:return n.length<2?[]:i(e,n[0],r).flatMap(t=>{let i=t;if(i<0)throw Error(`limit doesn't support negative count`);if(i===0)return[];let o;try{o=a(e,n[1],r)}catch(e){if(e instanceof s)throw e;o=[]}return o.slice(0,i)});case`isempty`:if(n.length<1)return[!0];try{return[a(e,n[0],r).length===0]}catch(e){if(e instanceof s)throw e;return[!0]}case`isvalid`:if(n.length<1)return[!0];try{return[i(e,n[0],r).length>0]}catch(e){if(e instanceof s)throw e;return[!1]}case`skip`:return n.length<2?[]:i(e,n[0],r).flatMap(t=>{let a=t;if(a<0)throw Error(`skip doesn't support negative count`);return i(e,n[1],r).slice(a)});case`until`:{if(n.length<2)return[e];let t=e,a=r.limits.maxIterations;for(let e=0;e<a;e++){if(i(t,n[0],r).some(o))return[t];let e=i(t,n[1],r);if(e.length===0)return[t];t=e[0]}throw new s(`jq until: too many iterations (${a}), increase executionLimits.maxJqIterations`,`iterations`)}case`while`:{if(n.length<2)return[e];let t=[],a=e,c=r.limits.maxIterations;for(let e=0;e<c&&i(a,n[0],r).some(o);e++){t.push(a);let e=i(a,n[1],r);if(e.length===0)break;a=e[0]}if(t.length>=c)throw new s(`jq while: too many iterations (${c}), increase executionLimits.maxJqIterations`,`iterations`);return t}case`repeat`:{if(n.length===0)return[e];let t=[],a=e,o=r.limits.maxIterations;for(let e=0;e<o;e++){t.push(a);let e=i(a,n[0],r);if(e.length===0)break;a=e[0]}if(t.length>=o)throw new s(`jq repeat: too many iterations (${o}), increase executionLimits.maxJqIterations`,`iterations`);return t}default:return null}}function m(e,t,n,r,i){switch(t){case`now`:return[Date.now()/1e3];case`gmtime`:{if(typeof e!=`number`)return[null];let t=new Date(e*1e3),n=t.getUTCFullYear(),r=t.getUTCMonth(),i=t.getUTCDate(),a=t.getUTCHours(),o=t.getUTCMinutes(),s=t.getUTCSeconds(),c=t.getUTCDay(),l=Date.UTC(n,0,1);return[[n,r,i,a,o,s,c,Math.floor((t.getTime()-l)/(1440*60*1e3))]]}case`mktime`:{if(!Array.isArray(e))throw Error(`mktime requires parsed datetime inputs`);let[t,n,r,i=0,a=0,o=0]=e;if(typeof t!=`number`||typeof n!=`number`)throw Error(`mktime requires parsed datetime inputs`);return[Math.floor(Date.UTC(t,n,r??1,i??0,a??0,o??0)/1e3)]}case`strftime`:{if(n.length===0)return[null];let t=i(e,n[0],r)[0];if(typeof t!=`string`)throw Error(`strftime/1 requires a string format`);let a;if(typeof e==`number`)a=new Date(e*1e3);else if(Array.isArray(e)){let[t,n,r,i=0,o=0,s=0]=e;if(typeof t!=`number`||typeof n!=`number`)throw Error(`strftime/1 requires parsed datetime inputs`);a=new Date(Date.UTC(t,n,r??1,i??0,o??0,s??0))}else throw Error(`strftime/1 requires parsed datetime inputs`);let o=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],s=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],c=(e,t=2)=>String(e).padStart(t,`0`);return[t.replace(/%Y/g,String(a.getUTCFullYear())).replace(/%m/g,c(a.getUTCMonth()+1)).replace(/%d/g,c(a.getUTCDate())).replace(/%H/g,c(a.getUTCHours())).replace(/%M/g,c(a.getUTCMinutes())).replace(/%S/g,c(a.getUTCSeconds())).replace(/%A/g,o[a.getUTCDay()]).replace(/%B/g,s[a.getUTCMonth()]).replace(/%Z/g,`UTC`).replace(/%%/g,`%`)]}case`strptime`:{if(n.length===0)return[null];if(typeof e!=`string`)throw Error(`strptime/1 requires a string input`);let t=i(e,n[0],r)[0];if(typeof t!=`string`)throw Error(`strptime/1 requires a string format`);if(t===`%Y-%m-%dT%H:%M:%SZ`){let t=e.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(t){let[,e,n,r,i,a,o]=t.map(Number),s=new Date(Date.UTC(e,n-1,r,i,a,o)),c=s.getUTCDay(),l=Date.UTC(e,0,1),u=Math.floor((s.getTime()-l)/(1440*60*1e3));return[[e,n-1,r,i,a,o,c,u]]}}let a=new Date(e);if(!Number.isNaN(a.getTime())){let e=a.getUTCFullYear(),t=a.getUTCMonth(),n=a.getUTCDate(),r=a.getUTCHours(),i=a.getUTCMinutes(),o=a.getUTCSeconds(),s=a.getUTCDay(),c=Date.UTC(e,0,1);return[[e,t,n,r,i,o,s,Math.floor((a.getTime()-c)/(1440*60*1e3))]]}throw Error(`Cannot parse date: ${e}`)}case`fromdate`:{if(typeof e!=`string`)throw Error(`fromdate requires a string input`);let t=new Date(e);if(Number.isNaN(t.getTime()))throw Error(`date "${e}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(t.getTime()/1e3)]}case`todate`:if(typeof e!=`number`)throw Error(`todate requires a number input`);return[new Date(e*1e3).toISOString().replace(/\.\d{3}Z$/,`Z`)];default:return null}}function h(e){return e!==!1&&e!==null}function g(e,t){return JSON.stringify(e)===JSON.stringify(t)}function _(e,t){return typeof e==`number`&&typeof t==`number`?e-t:typeof e==`string`&&typeof t==`string`?e.localeCompare(t):0}function v(e,t){let n=c(e);for(let e of Object.keys(t)){if(!l(e))continue;let r=o(n,e)?u(n[e]):null,i=u(t[e]);r&&i?a(n,e,v(r,i)):a(n,e,t[e])}return n}function y(e,t=3e3){let n=0,r=e;for(;n<t;)if(Array.isArray(r)){if(r.length===0)return n+1;r=r[0],n++}else if(typeof r==`object`&&r){let e=Object.keys(r);if(e.length===0)return n+1;r=r[e[0]],n++}else return n;return n}function b(e,t){let n=e=>e===null?0:typeof e==`boolean`?1:typeof e==`number`?2:typeof e==`string`?3:Array.isArray(e)?4:typeof e==`object`?5:6,r=n(e),i=n(t);if(r!==i)return r-i;if(typeof e==`number`&&typeof t==`number`)return e-t;if(typeof e==`string`&&typeof t==`string`)return e.localeCompare(t);if(typeof e==`boolean`&&typeof t==`boolean`)return(e?1:0)-(t?1:0);if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<Math.min(e.length,t.length);n++){let r=b(e[n],t[n]);if(r!==0)return r}return e.length-t.length}let a=u(e),o=u(t);if(a&&o){let e=Object.keys(a).sort(),t=Object.keys(o).sort();for(let n=0;n<Math.min(e.length,t.length);n++){let r=e[n].localeCompare(t[n]);if(r!==0)return r}if(e.length!==t.length)return e.length-t.length;for(let t of e){let e=b(a[t],o[t]);if(e!==0)return e}}return 0}function x(e,t){if(g(e,t))return!0;if(typeof e==`string`&&typeof t==`string`)return e.includes(t);if(Array.isArray(e)&&Array.isArray(t))return t.every(t=>e.some(e=>x(e,t)));let n=u(e),r=u(t);return n&&r?Object.keys(r).every(e=>o(n,e)&&x(n[e],r[e])):!1}var S=2e3;function C(e,t,n){switch(t){case`@base64`:return typeof e==`string`?typeof Buffer<`u`?[Buffer.from(e,`utf-8`).toString(`base64`)]:[btoa(e)]:[null];case`@base64d`:return typeof e==`string`?typeof Buffer<`u`?[Buffer.from(e,`base64`).toString(`utf-8`)]:[atob(e)]:[null];case`@uri`:return typeof e==`string`?[encodeURIComponent(e).replace(/!/g,`%21`).replace(/'/g,`%27`).replace(/\(/g,`%28`).replace(/\)/g,`%29`).replace(/\*/g,`%2A`)]:[null];case`@urid`:return typeof e==`string`?[decodeURIComponent(e)]:[null];case`@csv`:return Array.isArray(e)?[e.map(e=>{if(e===null)return``;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return String(e);let t=String(e);return t.includes(`,`)||t.includes(`"`)||t.includes(`
2
+ `)||t.includes(`\r`)?`"${t.replace(/"/g,`""`)}"`:t}).join(`,`)]:[null];case`@tsv`:return Array.isArray(e)?[e.map(e=>String(e??``).replace(/\t/g,`\\t`).replace(/\n/g,`\\n`)).join(` `)]:[null];case`@json`:{let t=n??S;return y(e,t+1)>t?[null]:[JSON.stringify(e)]}case`@html`:return typeof e==`string`?[e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/'/g,`&apos;`).replace(/"/g,`&quot;`)]:[null];case`@sh`:return typeof e==`string`?[`'${e.replace(/'/g,`'\\''`)}'`]:[null];case`@text`:return typeof e==`string`?[e]:e==null?[``]:[String(e)];default:return null}}function w(e,t,n,r,i,a){switch(t){case`index`:return n.length===0?[null]:i(e,n[0],r).map(t=>{if(typeof e==`string`&&typeof t==`string`){if(t===``&&e===``)return null;let n=e.indexOf(t);return n>=0?n:null}if(Array.isArray(e)){if(Array.isArray(t)){for(let n=0;n<=e.length-t.length;n++){let r=!0;for(let i=0;i<t.length;i++)if(!a(e[n+i],t[i])){r=!1;break}if(r)return n}return null}let n=e.findIndex(e=>a(e,t));return n>=0?n:null}return null});case`rindex`:return n.length===0?[null]:i(e,n[0],r).map(t=>{if(typeof e==`string`&&typeof t==`string`){let n=e.lastIndexOf(t);return n>=0?n:null}if(Array.isArray(e)){if(Array.isArray(t)){for(let n=e.length-t.length;n>=0;n--){let r=!0;for(let i=0;i<t.length;i++)if(!a(e[n+i],t[i])){r=!1;break}if(r)return n}return null}for(let n=e.length-1;n>=0;n--)if(a(e[n],t))return n;return null}return null});case`indices`:return n.length===0?[[]]:i(e,n[0],r).map(t=>{let n=[];if(typeof e==`string`&&typeof t==`string`){let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1)}else if(Array.isArray(e))if(Array.isArray(t)){let r=t.length;if(r===0)for(let t=0;t<=e.length;t++)n.push(t);else for(let i=0;i<=e.length-r;i++){let o=!0;for(let n=0;n<r;n++)if(!a(e[i+n],t[n])){o=!1;break}o&&n.push(i)}}else for(let r=0;r<e.length;r++)a(e[r],t)&&n.push(r);return n});default:return null}}function T(e,t,n,r,i){switch(t){case`fabs`:case`abs`:return typeof e==`number`?[Math.abs(e)]:typeof e==`string`?[e]:[null];case`exp10`:return typeof e==`number`?[10**e]:[null];case`exp2`:return typeof e==`number`?[2**e]:[null];case`pow`:{if(n.length<2)return[null];let t=i(e,n[0],r),a=i(e,n[1],r),o=t[0],s=a[0];return typeof o!=`number`||typeof s!=`number`?[null]:[o**s]}case`atan2`:{if(n.length<2)return[null];let t=i(e,n[0],r),a=i(e,n[1],r),o=t[0],s=a[0];return typeof o!=`number`||typeof s!=`number`?[null]:[Math.atan2(o,s)]}case`hypot`:{if(typeof e!=`number`||n.length===0)return[null];let t=i(e,n[0],r)[0];return[Math.hypot(e,t)]}case`fma`:{if(typeof e!=`number`||n.length<2)return[null];let t=i(e,n[0],r)[0],a=i(e,n[1],r)[0];return[e*t+a]}case`copysign`:{if(typeof e!=`number`||n.length===0)return[null];let t=i(e,n[0],r)[0];return[Math.sign(t)*Math.abs(e)]}case`drem`:case`remainder`:{if(typeof e!=`number`||n.length===0)return[null];let t=i(e,n[0],r)[0];return[e-Math.round(e/t)*t]}case`fdim`:{if(typeof e!=`number`||n.length===0)return[null];let t=i(e,n[0],r)[0];return[Math.max(0,e-t)]}case`fmax`:{if(typeof e!=`number`||n.length===0)return[null];let t=i(e,n[0],r)[0];return[Math.max(e,t)]}case`fmin`:{if(typeof e!=`number`||n.length===0)return[null];let t=i(e,n[0],r)[0];return[Math.min(e,t)]}case`ldexp`:return typeof e!=`number`||n.length===0?[null]:[e*2**i(e,n[0],r)[0]];case`scalbn`:case`scalbln`:return typeof e!=`number`||n.length===0?[null]:[e*2**i(e,n[0],r)[0]];case`nearbyint`:return typeof e==`number`?[Math.round(e)]:[null];case`logb`:return typeof e==`number`?[Math.floor(Math.log2(Math.abs(e)))]:[null];case`significand`:return typeof e==`number`?[e/2**Math.floor(Math.log2(Math.abs(e)))]:[null];case`frexp`:if(typeof e==`number`){if(e===0)return[[0,0]];let t=Math.floor(Math.log2(Math.abs(e)))+1;return[[e/2**t,t]]}return[null];case`modf`:if(typeof e==`number`){let t=Math.trunc(e);return[[e-t,t]]}return[null];default:return null}}function E(e,t,n,r,i,o,s,c){switch(t){case`recurse`:{if(n.length===0){let t=[],n=e=>{if(t.push(e),Array.isArray(e))for(let t of e)n(t);else if(e&&typeof e==`object`)for(let t of Object.keys(e))n(e[t])};return n(e),t}let t=[],a=n.length>=2?n[1]:null,s=0,c=e=>{if(s++>1e4||a&&!i(e,a,r).some(o))return;t.push(e);let l=i(e,n[0],r);for(let e of l)e!=null&&c(e)};return c(e),t}case`recurse_down`:return c(e,`recurse`,n,r);case`walk`:{if(n.length===0)return[e];let t=new WeakSet,o=e=>{if(e&&typeof e==`object`){if(t.has(e))return e;t.add(e)}let s;if(Array.isArray(e))s=e.map(o);else if(e&&typeof e==`object`){let t=Object.create(null);for(let[n,r]of Object.entries(e))l(n)&&a(t,n,o(r));s=t}else s=e;return i(s,n[0],r)[0]};return[o(e)]}case`transpose`:{if(!Array.isArray(e))return[null];if(e.length===0)return[[]];let t=Math.max(...e.map(e=>Array.isArray(e)?e.length:0)),n=[];for(let r=0;r<t;r++)n.push(e.map(e=>Array.isArray(e)?e[r]:null));return[n]}case`combinations`:{if(n.length>0){let t=i(e,n[0],r)[0];if(!Array.isArray(e)||t<0)return[];if(t===0)return[[]];let a=[],o=(n,r)=>{if(r===t){a.push([...n]);return}for(let t of e)n.push(t),o(n,r+1),n.pop()};return o([],0),a}if(!Array.isArray(e))return[];if(e.length===0)return[[]];for(let t of e)if(!Array.isArray(t))return[];let t=[],a=(n,r)=>{if(n===e.length){t.push([...r]);return}let i=e[n];for(let e of i)r.push(e),a(n+1,r),r.pop()};return a(0,[]),t}case`parent`:{if(r.root===void 0||r.currentPath===void 0)return[];let t=r.currentPath;if(t.length===0)return[];let a=n.length>0?i(e,n[0],r)[0]:1;if(a>=0){if(a>t.length)return[];let e=t.slice(0,t.length-a);return[s(r.root,e)]}else{let n=-a-1;if(n>=t.length)return[e];let i=t.slice(0,n);return[s(r.root,i)]}}case`parents`:{if(r.root===void 0||r.currentPath===void 0)return[[]];let e=r.currentPath,t=[];for(let n=e.length-1;n>=0;n--)t.push(s(r.root,e.slice(0,n)));return[t]}case`root`:return r.root===void 0?[]:[r.root];default:return null}}var D=2e3;function O(e,t,n,r,i){switch(t){case`keys`:return Array.isArray(e)?[e.map((e,t)=>t)]:e&&typeof e==`object`?[Object.keys(e).sort()]:[null];case`keys_unsorted`:return Array.isArray(e)?[e.map((e,t)=>t)]:e&&typeof e==`object`?[Object.keys(e)]:[null];case`length`:return typeof e==`string`||Array.isArray(e)?[e.length]:e&&typeof e==`object`?[Object.keys(e).length]:e===null?[0]:typeof e==`number`?[Math.abs(e)]:[null];case`utf8bytelength`:{if(typeof e==`string`)return[new TextEncoder().encode(e).length];let t=e===null?`null`:Array.isArray(e)?`array`:typeof e,n=t===`array`||t===`object`?JSON.stringify(e):String(e);throw Error(`${t} (${n}) only strings have UTF-8 byte length`)}case`to_entries`:{let t=u(e);return t?[Object.entries(t).map(([e,t])=>({key:e,value:t}))]:[null]}case`from_entries`:if(Array.isArray(e)){let t=Object.create(null);for(let n of e){let e=u(n);if(e){let n=e.key??e.Key??e.name??e.Name??e.k,r=e.value??e.Value??e.v;if(n!==void 0){let e=String(n);l(e)&&a(t,e,r)}}}return[t]}return[null];case`with_entries`:{if(n.length===0)return[e];let t=u(e);if(t){let e=Object.entries(t).map(([e,t])=>({key:e,value:t})).flatMap(e=>i(e,n[0],r)),o=Object.create(null);for(let t of e){let e=u(t);if(e){let t=e.key??e.name??e.k,n=e.value??e.v;if(t!==void 0){let e=String(t);l(e)&&a(o,e,n)}}}return[o]}return[null]}case`reverse`:return Array.isArray(e)?[[...e].reverse()]:typeof e==`string`?[e.split(``).reverse().join(``)]:[null];case`flatten`:return Array.isArray(e)?(n.length>0?i(e,n[0],r):[1/0]).map(t=>{let n=t;if(n<0)throw Error(`flatten depth must not be negative`);return e.flat(n)}):[null];case`unique`:if(Array.isArray(e)){let t=new Set,n=[];for(let r of e){let e=JSON.stringify(r);t.has(e)||(t.add(e),n.push(r))}return[n]}return[null];case`tojson`:case`tojsonstream`:{let t=r.limits.maxDepth??D;return y(e,t+1)>t?[null]:[JSON.stringify(e)]}case`fromjson`:if(typeof e==`string`){let t=e.trim().toLowerCase();if(t===`nan`)return[NaN];if(t===`inf`||t===`infinity`)return[1/0];if(t===`-inf`||t===`-infinity`)return[-1/0];try{return[d(JSON.parse(e))]}catch{throw Error(`Invalid JSON: ${e}`)}}return[e];case`tostring`:return typeof e==`string`?[e]:[JSON.stringify(e)];case`tonumber`:if(typeof e==`number`)return[e];if(typeof e==`string`){let t=Number(e);if(Number.isNaN(t))throw Error(`${JSON.stringify(e)} cannot be parsed as a number`);return[t]}throw Error(`${typeof e} cannot be parsed as a number`);case`toboolean`:{if(typeof e==`boolean`)return[e];if(typeof e==`string`){if(e===`true`)return[!0];if(e===`false`)return[!1];throw Error(`string (${JSON.stringify(e)}) cannot be parsed as a boolean`)}let t=e===null?`null`:Array.isArray(e)?`array`:typeof e,n=t===`array`||t===`object`?JSON.stringify(e):String(e);throw Error(`${t} (${n}) cannot be parsed as a boolean`)}case`tostream`:{let t=[],n=(e,r)=>{if(typeof e!=`object`||!e)t.push([r,e]);else if(Array.isArray(e))if(e.length===0)t.push([r,[]]);else for(let t=0;t<e.length;t++)n(e[t],[...r,t]);else{let i=Object.keys(e);if(i.length===0)t.push([r,Object.create(null)]);else for(let t of i)n(e[t],[...r,t])}};return n(e,[]),t.push([[]]),t}case`fromstream`:{if(n.length===0)return[e];let t=i(e,n[0],r),o=null;for(let e of t){if(!Array.isArray(e)||e.length===1&&Array.isArray(e[0])&&e[0].length===0||e.length!==2)continue;let[t,n]=e;if(!Array.isArray(t))continue;if(t.length===0){o=n;continue}o===null&&(o=typeof t[0]==`number`?[]:Object.create(null));let r=o;for(let e=0;e<t.length-1;e++){let n=t[e],i=t[e+1];if(Array.isArray(r)&&typeof n==`number`){for(;r.length<=n;)r.push(null);r[n]===null&&(r[n]=typeof i==`number`?[]:Object.create(null)),r=r[n]}else{let e=u(r);if(e){let t=String(n);if(!l(t))continue;(e[t]===null||e[t]===void 0)&&a(e,t,typeof i==`number`?[]:Object.create(null)),r=e[t]}}}let i=t[t.length-1];if(Array.isArray(r)&&typeof i==`number`){for(;r.length<=i;)r.push(null);r[i]=n}else{let e=u(r);if(e){let t=String(i);l(t)&&a(e,t,n)}}}return[o]}case`truncate_stream`:{let t=typeof e==`number`?Math.floor(e):0;if(n.length===0)return[];let a=[],o=i(e,n[0],r);for(let e of o)if(Array.isArray(e)){if(e.length===1&&Array.isArray(e[0])){let n=e[0];n.length>t&&a.push([n.slice(t)]);continue}if(e.length===2&&Array.isArray(e[0])){let n=e[0],r=e[1];n.length>t&&a.push([n.slice(t),r])}}return a}default:return null}}function ee(e,t,n,r,i,a,o,s,c,l){switch(t){case`getpath`:{if(n.length===0)return[null];let t=i(e,n[0],r),a=[];for(let n of t){let t=n,r=e;for(let e of t){if(r==null){r=null;break}if(Array.isArray(r)&&typeof e==`number`)r=r[e];else if(typeof e==`string`){let t=u(r);if(!t||!Object.hasOwn(t,e)){r=null;break}r=t[e]}else{r=null;break}}a.push(r)}return a}case`setpath`:{if(n.length<2)return[null];let t=i(e,n[0],r)[0],a=i(e,n[1],r)[0];return[o(e,t,a)]}case`delpaths`:{if(n.length===0)return[e];let t=i(e,n[0],r)[0],a=e;for(let e of t.sort((e,t)=>t.length-e.length))a=s(a,e);return[a]}case`path`:{if(n.length===0)return[[]];let t=[];return l(e,n[0],r,[],t),t}case`del`:return n.length===0?[e]:[c(e,n[0],r)];case`pick`:{if(n.length===0)return[null];let t=[];for(let i of n)l(e,i,r,[],t);let i=null;for(let n of t){for(let e of n)if(typeof e==`number`&&e<0)throw Error(`Out of bounds negative array index`);let t=e;for(let e of n){if(t==null)break;if(Array.isArray(t)&&typeof e==`number`)t=t[e];else if(typeof e==`string`){let n=u(t);if(!n||!Object.hasOwn(n,e)){t=null;break}t=n[e]}else{t=null;break}}i=o(i,n,t)}return[i]}case`paths`:{let t=[],o=(e,n)=>{if(e&&typeof e==`object`)if(Array.isArray(e))for(let r=0;r<e.length;r++)t.push([...n,r]),o(e[r],[...n,r]);else for(let r of Object.keys(e))t.push([...n,r]),o(e[r],[...n,r])};return o(e,[]),n.length>0?t.filter(t=>{let o=e;for(let e of t)if(Array.isArray(o)&&typeof e==`number`)o=o[e];else if(typeof e==`string`){let t=u(o);if(!t||!Object.hasOwn(t,e))return!1;o=t[e]}else return!1;return i(o,n[0],r).some(a)}):t}case`leaf_paths`:{let t=[],n=(e,r)=>{if(typeof e!=`object`||!e)t.push(r);else if(Array.isArray(e))for(let t=0;t<e.length;t++)n(e[t],[...r,t]);else for(let t of Object.keys(e))n(e[t],[...r,t])};return n(e,[]),t}default:return null}}function k(e,t,n,r,i,s){switch(t){case`IN`:{if(n.length===0)return[!1];if(n.length===1){let t=i(e,n[0],r);for(let n of t)if(s(e,n))return[!0];return[!1]}let t=i(e,n[0],r),a=i(e,n[1],r),o=new Set(a.map(e=>JSON.stringify(e)));for(let e of t)if(o.has(JSON.stringify(e)))return[!0];return[!1]}case`INDEX`:{if(n.length===0)return[Object.create(null)];if(n.length===1){let t=i(e,n[0],r),o=Object.create(null);for(let e of t){let t=String(e);l(t)&&a(o,t,e)}return[o]}if(n.length===2){let t=i(e,n[0],r),o=Object.create(null);for(let e of t){let t=i(e,n[1],r);if(t.length>0){let n=String(t[0]);l(n)&&a(o,n,e)}}return[o]}let t=i(e,n[0],r),o=Object.create(null);for(let e of t){let t=i(e,n[1],r),s=i(e,n[2],r);if(t.length>0&&s.length>0){let e=String(t[0]);l(e)&&a(o,e,s[0])}}return[o]}case`JOIN`:{if(n.length<2)return[null];let t=u(i(e,n[0],r)[0]);if(!t||!Array.isArray(e))return[null];let a=[];for(let s of e){let e=i(s,n[1],r),c=e.length>0?String(e[0]):``,l=o(t,c)?t[c]:null;a.push([s,l])}return[a]}default:return null}}function A(t,n,r,i,a){switch(n){case`join`:{if(!Array.isArray(t))return[null];let e=r.length>0?a(t,r[0],i):[``];for(let e of t)if(Array.isArray(e)||typeof e==`object`&&e)throw Error(`cannot join: contains arrays or objects`);return e.map(e=>t.map(e=>e===null?``:typeof e==`string`?e:String(e)).join(String(e)))}case`split`:{if(typeof t!=`string`||r.length===0)return[null];let e=a(t,r[0],i),n=String(e[0]);return[t.split(n)]}case`splits`:{if(typeof t!=`string`||r.length===0)return[];let n=a(t,r[0],i),o=String(n[0]);try{let n=r.length>1?String(a(t,r[1],i)[0]):`g`;return e(o,n.includes(`g`)?n:`${n}g`).split(t)}catch{return[]}}case`scan`:{if(typeof t!=`string`||r.length===0)return[];let n=a(t,r[0],i),o=String(n[0]);try{let n=r.length>1?String(a(t,r[1],i)[0]):``;return[...e(o,n.includes(`g`)?n:`${n}g`).matchAll(t)].map(e=>e.length>1?e.slice(1):e[0])}catch{return[]}}case`test`:{if(typeof t!=`string`||r.length===0)return[!1];let n=a(t,r[0],i),o=String(n[0]);try{return[e(o,r.length>1?String(a(t,r[1],i)[0]):``).test(t)]}catch{return[!1]}}case`match`:{if(typeof t!=`string`||r.length===0)return[null];let n=a(t,r[0],i),o=String(n[0]);try{let n=e(o,`${r.length>1?String(a(t,r[1],i)[0]):``}d`).exec(t);if(!n)return[];let s=n.indices;return[{offset:n.index,length:n[0].length,string:n[0],captures:n.slice(1).map((e,t)=>({offset:s?.[t+1]?.[0]??null,length:e?.length??0,string:e??``,name:null}))}]}catch{return[null]}}case`capture`:{if(typeof t!=`string`||r.length===0)return[null];let n=a(t,r[0],i),o=String(n[0]);try{let n=e(o,r.length>1?String(a(t,r[1],i)[0]):``).match(t);return!n||!n.groups?[Object.create(null)]:[n.groups]}catch{return[null]}}case`sub`:{if(typeof t!=`string`||r.length<2)return[null];let n=a(t,r[0],i),o=a(t,r[1],i),s=String(n[0]),c=String(o[0]);try{return[e(s,r.length>2?String(a(t,r[2],i)[0]):``).replace(t,c)]}catch{return[t]}}case`gsub`:{if(typeof t!=`string`||r.length<2)return[null];let n=a(t,r[0],i),o=a(t,r[1],i),s=String(n[0]),c=String(o[0]);try{let n=r.length>2?String(a(t,r[2],i)[0]):`g`;return[e(s,n.includes(`g`)?n:`${n}g`).replace(t,c)]}catch{return[t]}}case`ascii_downcase`:return typeof t==`string`?[t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))]:[null];case`ascii_upcase`:return typeof t==`string`?[t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))]:[null];case`ltrimstr`:{if(typeof t!=`string`||r.length===0)return[t];let e=a(t,r[0],i),n=String(e[0]);return[t.startsWith(n)?t.slice(n.length):t]}case`rtrimstr`:{if(typeof t!=`string`||r.length===0)return[t];let e=a(t,r[0],i),n=String(e[0]);return n===``?[t]:[t.endsWith(n)?t.slice(0,-n.length):t]}case`trimstr`:{if(typeof t!=`string`||r.length===0)return[t];let e=a(t,r[0],i),n=String(e[0]);if(n===``)return[t];let o=t;return o.startsWith(n)&&(o=o.slice(n.length)),o.endsWith(n)&&(o=o.slice(0,-n.length)),[o]}case`trim`:if(typeof t==`string`)return[t.trim()];throw Error(`trim input must be a string`);case`ltrim`:if(typeof t==`string`)return[t.trimStart()];throw Error(`trim input must be a string`);case`rtrim`:if(typeof t==`string`)return[t.trimEnd()];throw Error(`trim input must be a string`);case`startswith`:{if(typeof t!=`string`||r.length===0)return[!1];let e=a(t,r[0],i);return[t.startsWith(String(e[0]))]}case`endswith`:{if(typeof t!=`string`||r.length===0)return[!1];let e=a(t,r[0],i);return[t.endsWith(String(e[0]))]}case`ascii`:return typeof t==`string`&&t.length>0?[t.charCodeAt(0)]:[null];case`explode`:return typeof t==`string`?[Array.from(t).map(e=>e.codePointAt(0))]:[null];case`implode`:if(!Array.isArray(t))throw Error(`implode input must be an array`);return[t.map(e=>{if(typeof e==`string`)throw Error(`string (${JSON.stringify(e)}) can't be imploded, unicode codepoint needs to be numeric`);if(typeof e!=`number`||Number.isNaN(e))throw Error(`number (null) can't be imploded, unicode codepoint needs to be numeric`);let t=Math.trunc(e);return t<0||t>1114111||t>=55296&&t<=57343?String.fromCodePoint(65533):String.fromCodePoint(t)}).join(``)];default:return null}}function j(e,t){switch(t){case`type`:return e===null?[`null`]:Array.isArray(e)?[`array`]:typeof e==`boolean`?[`boolean`]:typeof e==`number`?[`number`]:typeof e==`string`?[`string`]:typeof e==`object`?[`object`]:[`null`];case`infinite`:return[1/0];case`nan`:return[NaN];case`isinfinite`:return[typeof e==`number`&&!Number.isFinite(e)];case`isnan`:return[typeof e==`number`&&Number.isNaN(e)];case`isnormal`:return[typeof e==`number`&&Number.isFinite(e)&&e!==0];case`isfinite`:return[typeof e==`number`&&Number.isFinite(e)];case`numbers`:return typeof e==`number`?[e]:[];case`strings`:return typeof e==`string`?[e]:[];case`booleans`:return typeof e==`boolean`?[e]:[];case`nulls`:return e===null?[e]:[];case`arrays`:return Array.isArray(e)?[e]:[];case`objects`:return e&&typeof e==`object`&&!Array.isArray(e)?[e]:[];case`iterables`:return Array.isArray(e)||e&&typeof e==`object`&&!Array.isArray(e)?[e]:[];case`scalars`:return!Array.isArray(e)&&!(e&&typeof e==`object`)?[e]:[];case`values`:return e===null?[]:[e];case`not`:return e===!1||e===null?[!0]:[!1];case`null`:return[null];case`true`:return[!0];case`false`:return[!1];case`empty`:return[];default:return null}}function M(e,t,n){if(t.length===0)return n;let[r,...i]=t;if(typeof r==`number`){if(e&&typeof e==`object`&&!Array.isArray(e))throw Error(`Cannot index object with number`);if(r>536870911)throw Error(`Array index too large`);if(r<0)throw Error(`Out of bounds negative array index`);let t=Array.isArray(e)?[...e]:[];for(;t.length<=r;)t.push(null);return t[r]=M(t[r],i,n),t}if(Array.isArray(e))throw Error(`Cannot index array with string`);if(!l(r))return e??Object.create(null);let o=u(e),s=o?c(o):Object.create(null);return a(s,r,M(Object.hasOwn(s,r)?s[r]:void 0,i,n)),s}function N(e,t){if(t.length===0)return null;if(t.length===1){let n=t[0];if(Array.isArray(e)&&typeof n==`number`){let t=[...e];return t.splice(n,1),t}if(e&&typeof e==`object`&&!Array.isArray(e)){let t=String(n);if(!l(t))return e;let r=c(e);return delete r[t],r}return e}let[n,...r]=t;if(Array.isArray(e)&&typeof n==`number`){let t=[...e];return t[n]=N(t[n],r),t}if(e&&typeof e==`object`&&!Array.isArray(e)){let t=String(n);if(!l(t))return e;let i=c(e);return Object.hasOwn(i,t)&&a(i,t,N(i[t],r)),i}return e}var P=class e extends Error{label;partialResults;constructor(e,t=[]){super(`break ${e}`),this.label=e,this.partialResults=t,this.name=`BreakError`}withPrependedResults(t){return new e(this.label,[...t,...this.partialResults])}},F=class extends Error{value;constructor(e){super(typeof e==`string`?e:JSON.stringify(e)),this.value=e,this.name=`JqError`}},I=1e4,L=2e3,te=new Map([[`floor`,Math.floor],[`ceil`,Math.ceil],[`round`,Math.round],[`sqrt`,Math.sqrt],[`log`,Math.log],[`log10`,Math.log10],[`log2`,Math.log2],[`exp`,Math.exp],[`sin`,Math.sin],[`cos`,Math.cos],[`tan`,Math.tan],[`asin`,Math.asin],[`acos`,Math.acos],[`atan`,Math.atan],[`sinh`,Math.sinh],[`cosh`,Math.cosh],[`tanh`,Math.tanh],[`asinh`,Math.asinh],[`acosh`,Math.acosh],[`atanh`,Math.atanh],[`cbrt`,Math.cbrt],[`expm1`,Math.expm1],[`log1p`,Math.log1p],[`trunc`,Math.trunc]]);function ne(e){return{vars:new Map,limits:{maxIterations:e?.limits?.maxIterations??I,maxDepth:e?.limits?.maxDepth??L},env:e?.env,coverage:e?.coverage,requireDefenseContext:e?.requireDefenseContext,defenseContextChecked:!1}}function R(e,t,n){let r=new Map(e.vars);return r.set(t,n),{vars:r,limits:e.limits,env:e.env,requireDefenseContext:e.requireDefenseContext,defenseContextChecked:e.defenseContextChecked,root:e.root,currentPath:e.currentPath,funcs:e.funcs,labels:e.labels,coverage:e.coverage}}function z(e,t,n){switch(t.type){case`var`:return R(e,t.name,n);case`array`:{if(!Array.isArray(n))return null;let r=e;for(let e=0;e<t.elements.length;e++){let i=t.elements[e],a=e<n.length?n[e]:null,o=z(r,i,a);if(o===null)return null;r=o}return r}case`object`:{let r=u(n);if(!r)return null;let i=e;for(let a of t.fields){let t;if(typeof a.key==`string`)t=a.key;else{let r=W(n,a.key,e);if(r.length===0)return null;t=String(r[0])}let s=o(r,t)?r[t]:null;a.keyVar&&(i=R(i,a.keyVar,s));let c=z(i,a.pattern,s);if(c===null)return null;i=c}return i}}}function B(e,t){let n=e;for(let e of t)if(n&&typeof n==`object`)if(Array.isArray(n))if(typeof e==`number`)n=n[e];else return;else{let t=u(n);if(t&&typeof e==`string`&&Object.hasOwn(t,e))n=t[e];else return}else return;return n}function V(e){if(e.type===`Identity`)return[];if(e.type===`Field`){let t=e.base?V(e.base):[];return t===null?null:[...t,e.name]}if(e.type===`Index`&&e.index.type===`Literal`){let t=e.base?V(e.base):[];if(t===null)return null;let n=e.index.value;return typeof n==`number`||typeof n==`string`?[...t,n]:null}if(e.type===`Pipe`){let t=V(e.left);return t===null?null:H(t,e.right)}if(e.type===`Call`){if(e.name===`parent`||e.name===`root`)return null;if(e.name===`first`&&e.args.length===0)return[0];if(e.name===`last`&&e.args.length===0)return[-1]}return null}function H(e,t){if(t.type===`Call`){if(t.name===`parent`){let n=1;if(t.args.length>0&&t.args[0].type===`Literal`){let e=t.args[0].value;typeof e==`number`&&(n=e)}if(n>=0)return e.slice(0,Math.max(0,e.length-n));{let t=-n-1;return e.slice(0,Math.min(t,e.length))}}if(t.name===`root`)return[]}if(t.type===`Field`){let n=V(t);if(n!==null)return[...e,...n]}if(t.type===`Index`&&t.index.type===`Literal`){let n=V(t);if(n!==null)return[...e,...n]}if(t.type===`Pipe`){let n=H(e,t.left);return n===null?null:H(n,t.right)}return t.type===`Identity`?e:null}function U(e,n,r){if(n.type===`Comma`){let i=[];try{i.push(...W(e,n.left,r))}catch(e){if(e instanceof t)throw e;if(i.length>0)return i;throw Error(`evaluation failed`)}try{i.push(...W(e,n.right,r))}catch(e){if(e instanceof t)throw e;return i}return i}return W(e,n,r)}function W(e,t,r){let o=r&&`vars`in r?r:ne(r);switch(o.defenseContextChecked||(i(o.requireDefenseContext,`query-engine`,`evaluation`),o={...o,defenseContextChecked:!0}),o.root===void 0&&(o={...o,root:e,currentPath:[]}),o.coverage?.hit(`jq:node:${t.type}`),t.type){case`Identity`:return[e];case`Field`:return(t.base?W(e,t.base,o):[e]).flatMap(e=>{let n=u(e);if(n){if(!Object.hasOwn(n,t.name))return[null];let e=n[t.name];return[e===void 0?null:e]}if(e===null)return[null];throw Error(`Cannot index ${Array.isArray(e)?`array`:typeof e} with string "${t.name}"`)});case`Index`:return(t.base?W(e,t.base,o):[e]).flatMap(e=>W(e,t.index,o).flatMap(t=>{if(typeof t==`number`&&Array.isArray(e)){if(Number.isNaN(t))return[null];let n=Math.trunc(t),r=n<0?e.length+n:n;return r>=0&&r<e.length?[e[r]]:[null]}if(typeof t==`string`){let n=u(e);return!n||!Object.hasOwn(n,t)?[null]:[n[t]]}return[null]}));case`Slice`:return(t.base?W(e,t.base,o):[e]).flatMap(n=>{if(n===null)return[null];if(!Array.isArray(n)&&typeof n!=`string`)throw Error(`Cannot slice ${typeof n} (${JSON.stringify(n)})`);let r=n.length,i=t.start?W(e,t.start,o):[0],a=t.end?W(e,t.end,o):[r];return i.flatMap(e=>a.map(t=>{let i=e,a=t,o=Number.isNaN(i)?0:Number.isInteger(i)?i:Math.floor(i),s=Number.isNaN(a)?r:Number.isInteger(a)?a:Math.ceil(a),c=G(o,r),l=G(s,r);return n.slice(c,l)}))});case`Iterate`:return(t.base?W(e,t.base,o):[e]).flatMap(e=>Array.isArray(e)?e:e&&typeof e==`object`?Object.values(e):[]);case`Pipe`:{let n=W(e,t.left,o),r=V(t.left),i=[];for(let e of n)try{if(r!==null){let n={...o,currentPath:[...o.currentPath??[],...r]};i.push(...W(e,t.right,n))}else i.push(...W(e,t.right,o))}catch(e){throw e instanceof P?e.withPrependedResults(i):e}return i}case`Comma`:{let n=W(e,t.left,o),r=W(e,t.right,o);return[...n,...r]}case`Literal`:return[t.value];case`Array`:return t.elements?[W(e,t.elements,o)]:[[]];case`Object`:{let n=[Object.create(null)];for(let r of t.entries){let t=typeof r.key==`string`?[r.key]:W(e,r.key,o),i=W(e,r.value,o),s=[];for(let e of n)for(let n of t){if(typeof n!=`string`)throw Error(`Cannot use ${n===null?`null`:Array.isArray(n)?`array`:typeof n} (${JSON.stringify(n)}) as object key`);if(!l(n)){for(let t of i)s.push(c(e));continue}for(let t of i){let r=c(e);a(r,n,t),s.push(r)}}n.length=0,n.push(...s)}return n}case`Paren`:return W(e,t.expr,o);case`BinaryOp`:return J(e,t.op,t.left,t.right,o);case`UnaryOp`:return W(e,t.operand,o).map(e=>{if(t.op===`-`){if(typeof e==`number`)return-e;if(typeof e==`string`)throw Error(`string (${(e=>e.length>5?`"${e.slice(0,3)}...`:JSON.stringify(e))(e)}) cannot be negated`);return null}return t.op===`not`?!h(e):null});case`Cond`:return W(e,t.cond,o).flatMap(n=>{if(h(n))return W(e,t.then,o);for(let n of t.elifs)if(W(e,n.cond,o).some(h))return W(e,n.then,o);return t.else?W(e,t.else,o):[e]});case`Try`:try{return W(e,t.body,o)}catch(e){return t.catch?W(e instanceof F?e.value:e instanceof Error?e.message:String(e),t.catch,o):[]}case`Call`:return Y(e,t.name,t.args,o);case`VarBind`:return W(e,t.value,o).flatMap(n=>{let r=null,i=[];t.pattern?i.push(t.pattern):t.name&&i.push({type:`var`,name:t.name}),t.alternatives&&i.push(...t.alternatives);for(let e of i)if(r=z(o,e,n),r!==null)break;return r===null?[]:W(e,t.body,r)});case`VarRef`:{if(t.name===`$ENV`)return[o.env?n(o.env):Object.create(null)];let e=o.vars.get(t.name);return e===void 0?[null]:[e]}case`Recurse`:{let t=[],n=new WeakSet,r=e=>{if(e&&typeof e==`object`){if(n.has(e))return;n.add(e)}if(t.push(e),Array.isArray(e))for(let t of e)r(t);else if(e&&typeof e==`object`)for(let t of Object.keys(e))r(e[t])};return r(e),t}case`Optional`:try{return W(e,t.expr,o)}catch{return[]}case`StringInterp`:return[t.parts.map(t=>typeof t==`string`?t:W(e,t,o).map(e=>typeof e==`string`?e:JSON.stringify(e)).join(``)).join(``)];case`UpdateOp`:return[K(e,t.path,t.op,t.value,o)];case`Reduce`:{let n=W(e,t.expr,o),r=W(e,t.init,o)[0],i=o.limits.maxDepth??L;for(let e of n){let n;if(t.pattern){if(n=z(o,t.pattern,e),n===null)continue}else n=R(o,t.varName,e);if(r=W(r,t.update,n)[0],y(r,i+1)>i)return[null]}return[r]}case`Foreach`:{let n=W(e,t.expr,o),r=W(e,t.init,o)[0],i=[];for(let e of n)try{let n;if(t.pattern){if(n=z(o,t.pattern,e),n===null)continue}else n=R(o,t.varName,e);if(r=W(r,t.update,n)[0],t.extract){let e=W(r,t.extract,n);i.push(...e)}else i.push(r)}catch(e){throw e instanceof P?e.withPrependedResults(i):e}return i}case`Label`:try{return W(e,t.body,{...o,labels:new Set([...o.labels??[],t.name])})}catch(e){if(e instanceof P&&e.label===t.name)return e.partialResults;throw e}case`Break`:throw new P(t.name);case`Def`:{let n=new Map(o.funcs??[]),r=`${t.name}/${t.params.length}`;n.set(r,{params:t.params,body:t.funcBody,closure:new Map(o.funcs??[])});let i={...o,funcs:n};return W(e,t.body,i)}default:throw Error(`Unknown AST node type: ${t.type}`)}}function G(e,t){return e<0?Math.max(0,t+e):Math.min(e,t)}function K(e,t,n,r,i){function o(e,t){switch(n){case`=`:return t;case`|=`:return W(e,r,i)[0]??null;case`+=`:return typeof e==`number`&&typeof t==`number`||typeof e==`string`&&typeof t==`string`?e+t:Array.isArray(e)&&Array.isArray(t)?[...e,...t]:e&&t&&typeof e==`object`&&typeof t==`object`?s(e,t):t;case`-=`:return typeof e==`number`&&typeof t==`number`?e-t:e;case`*=`:return typeof e==`number`&&typeof t==`number`?e*t:e;case`/=`:return typeof e==`number`&&typeof t==`number`?e/t:e;case`%=`:return typeof e==`number`&&typeof t==`number`?e%t:e;case`//=`:return e===null||e===!1?t:e;default:return t}}function u(t,n,r){switch(n.type){case`Identity`:return r(t);case`Field`:if(!l(n.name))return t;if(n.base)return u(t,n.base,e=>{if(e&&typeof e==`object`&&!Array.isArray(e)){let t=c(e),i=Object.hasOwn(t,n.name)?t[n.name]:void 0;return a(t,n.name,r(i)),t}return e});if(t&&typeof t==`object`&&!Array.isArray(t)){let e=c(t),i=Object.hasOwn(e,n.name)?e[n.name]:void 0;return a(e,n.name,r(i)),e}return t;case`Index`:{let o=W(e,n.index,i)[0];if(typeof o==`number`&&Number.isNaN(o))throw Error(`Cannot set array element at NaN index`);if(typeof o==`number`&&!Number.isInteger(o)&&(o=Math.trunc(o)),n.base)return u(t,n.base,e=>{if(typeof o==`number`&&Array.isArray(e)){let t=[...e],n=o<0?t.length+o:o;if(n>=0){for(;t.length<=n;)t.push(null);t[n]=r(t[n])}return t}if(typeof o==`string`&&e&&typeof e==`object`&&!Array.isArray(e)){if(!l(o))return e;let t=c(e),n=Object.hasOwn(t,o)?t[o]:void 0;return a(t,o,r(n)),t}return e});if(typeof o==`number`){if(o>536870911)throw Error(`Array index too large`);if(o<0&&(!t||!Array.isArray(t)))throw Error(`Out of bounds negative array index`);if(Array.isArray(t)){let e=[...t],n=o<0?e.length+o:o;if(n>=0){for(;e.length<=n;)e.push(null);e[n]=r(e[n])}return e}if(t==null){let e=[];for(;e.length<=o;)e.push(null);return e[o]=r(null),e}return t}if(typeof o==`string`&&t&&typeof t==`object`&&!Array.isArray(t)){if(!l(o))return t;let e=c(t),n=Object.hasOwn(e,o)?e[o]:void 0;return a(e,o,r(n)),e}return t}case`Iterate`:{let e=e=>{if(Array.isArray(e))return e.map(e=>r(e));if(e&&typeof e==`object`){let t=Object.create(null);for(let[n,i]of Object.entries(e))l(n)&&a(t,n,r(i));return t}return e};return n.base?u(t,n.base,e):e(t)}case`Pipe`:return u(u(t,n.left,e=>e),n.right,r);default:return r(t)}}return u(e,t,t=>n===`|=`?o(t,t):o(t,W(e,r,i)[0]??null))}function q(e,t,n){function r(t,i,o){switch(i.type){case`Identity`:return o;case`Field`:if(!l(i.name))return t;if(i.base){let e=W(t,i.base,n)[0],a=r(e,{type:`Field`,name:i.name},o);return r(t,i.base,a)}if(t&&typeof t==`object`&&!Array.isArray(t)){let e=c(t);return a(e,i.name,o),e}return t;case`Index`:{if(i.base){let e=W(t,i.base,n)[0],a=r(e,{type:`Index`,index:i.index},o);return r(t,i.base,a)}let s=W(e,i.index,n)[0];if(typeof s==`number`&&Array.isArray(t)){let e=[...t],n=s<0?e.length+s:s;return n>=0&&n<e.length&&(e[n]=o),e}if(typeof s==`string`&&t&&typeof t==`object`&&!Array.isArray(t)){if(!l(s))return t;let e=c(t);return a(e,s,o),e}return t}default:return t}}function i(t,o){switch(o.type){case`Identity`:return null;case`Field`:if(!l(o.name))return t;if(o.base){let e=W(t,o.base,n)[0];if(e==null)return t;let a=i(e,{type:`Field`,name:o.name});return r(t,o.base,a)}if(t&&typeof t==`object`&&!Array.isArray(t)){if(!l(o.name))return t;let e=c(t);return delete e[o.name],e}return t;case`Index`:{if(o.base){let e=W(t,o.base,n)[0];if(e==null)return t;let a=i(e,{type:`Index`,index:o.index});return r(t,o.base,a)}let a=W(e,o.index,n)[0];if(typeof a==`number`&&Array.isArray(t)){let e=[...t],n=a<0?e.length+a:a;return n>=0&&n<e.length&&e.splice(n,1),e}if(typeof a==`string`&&t&&typeof t==`object`&&!Array.isArray(t)){if(!l(a))return t;let e=c(t);return delete e[a],e}return t}case`Iterate`:return Array.isArray(t)?[]:t&&typeof t==`object`?Object.create(null):t;case`Pipe`:{let r=function(t,i,o){switch(i.type){case`Identity`:return o;case`Field`:if(!l(i.name))return t;if(t&&typeof t==`object`&&!Array.isArray(t)){let e=c(t);return a(e,i.name,o),e}return t;case`Index`:{let r=W(e,i.index,n)[0];if(typeof r==`number`&&Array.isArray(t)){let e=[...t],n=r<0?e.length+r:r;return n>=0&&n<e.length&&(e[n]=o),e}if(typeof r==`string`&&t&&typeof t==`object`&&!Array.isArray(t)){if(!l(r))return t;let e=c(t);return a(e,r,o),e}return t}case`Pipe`:{let e=W(t,i.left,n)[0],a=r(e,i.right,o);return r(t,i.left,a)}default:return t}},s=o.left,u=o.right,d=W(t,s,n)[0];return d==null?t:r(t,s,i(d,u))}default:return t}}return i(e,t)}function J(e,t,n,r,i){if(t===`and`)return W(e,n,i).flatMap(t=>h(t)?W(e,r,i).map(e=>h(e)):[!1]);if(t===`or`)return W(e,n,i).flatMap(t=>h(t)?[!0]:W(e,r,i).map(e=>h(e)));if(t===`//`){let t=W(e,n,i).filter(e=>e!=null&&e!==!1);return t.length>0?t:W(e,r,i)}let a=W(e,n,i),o=W(e,r,i);return a.flatMap(e=>o.map(n=>{switch(t){case`+`:return e===null?n:n===null?e:typeof e==`number`&&typeof n==`number`||typeof e==`string`&&typeof n==`string`?e+n:Array.isArray(e)&&Array.isArray(n)?[...e,...n]:e&&n&&typeof e==`object`&&typeof n==`object`&&!Array.isArray(e)&&!Array.isArray(n)?s(e,n):null;case`-`:if(typeof e==`number`&&typeof n==`number`)return e-n;if(Array.isArray(e)&&Array.isArray(n)){let t=new Set(n.map(e=>JSON.stringify(e)));return e.filter(e=>!t.has(JSON.stringify(e)))}if(typeof e==`string`&&typeof n==`string`){let t=e=>e.length>10?`"${e.slice(0,10)}...`:JSON.stringify(e);throw Error(`string (${t(e)}) and string (${t(n)}) cannot be subtracted`)}return null;case`*`:if(typeof e==`number`&&typeof n==`number`)return e*n;if(typeof e==`string`&&typeof n==`number`)return e.repeat(n);{let t=u(e),r=u(n);if(t&&r)return v(t,r)}return null;case`/`:if(typeof e==`number`&&typeof n==`number`){if(n===0)throw Error(`number (${e}) and number (${n}) cannot be divided because the divisor is zero`);return e/n}return typeof e==`string`&&typeof n==`string`?e.split(n):null;case`%`:if(typeof e==`number`&&typeof n==`number`){if(n===0)throw Error(`number (${e}) and number (${n}) cannot be divided (remainder) because the divisor is zero`);return!Number.isFinite(e)&&!Number.isNaN(e)?!Number.isFinite(n)&&!Number.isNaN(n)&&e<0&&n>0?-1:0:e%n}return null;case`==`:return g(e,n);case`!=`:return!g(e,n);case`<`:return _(e,n)<0;case`<=`:return _(e,n)<=0;case`>`:return _(e,n)>0;case`>=`:return _(e,n)>=0;default:return null}}))}function Y(e,r,i,a){let o=te.get(r);if(o)return typeof e==`number`?[o(e)]:[null];let s=T(e,r,i,a,W);if(s!==null)return s;let c=A(e,r,i,a,W);if(c!==null)return c;let l=m(e,r,i,a,W);if(l!==null)return l;let u=C(e,r,a.limits.maxDepth);if(u!==null)return u;let d=j(e,r);if(d!==null)return d;let _=O(e,r,i,a,W);if(_!==null)return _;let v=f(e,r,i,a,W,U,b,h,x,t);if(v!==null)return v;let y=ee(e,r,i,a,W,h,M,N,q,X);if(y!==null)return y;let S=w(e,r,i,a,W,g);if(S!==null)return S;let D=p(e,r,i,a,W,U,h,t);if(D!==null)return D;let P=E(e,r,i,a,W,h,B,Y);if(P!==null)return P;let I=k(e,r,i,a,W,g);if(I!==null)return I;switch(r){case`builtins`:return[`add/0.all/0.all/1.all/2.any/0.any/1.any/2.arrays/0.ascii/0.ascii_downcase/0.ascii_upcase/0.booleans/0.bsearch/1.builtins/0.combinations/0.combinations/1.contains/1.debug/0.del/1.delpaths/1.empty/0.env/0.error/0.error/1.explode/0.first/0.first/1.flatten/0.flatten/1.floor/0.from_entries/0.fromdate/0.fromjson/0.getpath/1.gmtime/0.group_by/1.gsub/2.gsub/3.has/1.implode/0.IN/1.IN/2.INDEX/1.INDEX/2.index/1.indices/1.infinite/0.inside/1.isempty/1.isnan/0.isnormal/0.isvalid/1.iterables/0.join/1.keys/0.keys_unsorted/0.last/0.last/1.length/0.limit/2.ltrimstr/1.map/1.map_values/1.match/1.match/2.max/0.max_by/1.min/0.min_by/1.mktime/0.modulemeta/1.nan/0.not/0.nth/1.nth/2.null/0.nulls/0.numbers/0.objects/0.path/1.paths/0.paths/1.pick/1.range/1.range/2.range/3.recurse/0.recurse/1.recurse_down/0.repeat/1.reverse/0.rindex/1.rtrimstr/1.scalars/0.scan/1.scan/2.select/1.setpath/2.skip/2.sort/0.sort_by/1.split/1.splits/1.splits/2.sqrt/0.startswith/1.strftime/1.strings/0.strptime/1.sub/2.sub/3.test/1.test/2.to_entries/0.toboolean/0.todate/0.tojson/0.tostream/0.fromstream/1.truncate_stream/1.tonumber/0.tostring/0.transpose/0.trim/0.ltrim/0.rtrim/0.type/0.unique/0.unique_by/1.until/2.utf8bytelength/0.values/0.walk/1.while/2.with_entries/1`.split(`.`)];case`error`:throw new F(i.length>0?W(e,i[0],a)[0]:e);case`env`:return[a.env?n(a.env):Object.create(null)];case`debug`:return[e];case`input_line_number`:return[1];default:{let t=`${r}/${i.length}`,n=a.funcs?.get(t);if(n){let r=n.closure??a.funcs??new Map,o=new Map(r);o.set(t,n);for(let t=0;t<n.params.length;t++){let r=n.params[t],s=i[t];if(s){let t=W(e,s,a),n;if(t.length===0)n={type:`Call`,name:`empty`,args:[]};else if(t.length===1)n={type:`Literal`,value:t[0]};else{n={type:`Literal`,value:t[t.length-1]};for(let e=t.length-2;e>=0;e--)n={type:`Comma`,left:{type:`Literal`,value:t[e]},right:n}}o.set(`${r}/0`,{params:[],body:n})}}let s={...a,funcs:o};return W(e,n.body,s)}throw Error(`Unknown function: ${r}`)}}}function X(e,t,n,r,i){if(t.type===`Comma`){let a=t;X(e,a.left,n,r,i),X(e,a.right,n,r,i);return}let a=V(t);if(a!==null){i.push([...r,...a]);return}if(t.type===`Iterate`){if(Array.isArray(e))for(let t=0;t<e.length;t++)i.push([...r,t]);else if(e&&typeof e==`object`)for(let t of Object.keys(e))i.push([...r,t]);return}if(t.type===`Recurse`){let t=(e,n)=>{if(i.push([...r,...n]),e&&typeof e==`object`)if(Array.isArray(e))for(let r=0;r<e.length;r++)t(e[r],[...n,r]);else for(let r of Object.keys(e))t(e[r],[...n,r])};t(e,[]);return}if(t.type===`Pipe`){let a=V(t.left);if(a!==null){let o=W(e,t.left,n);for(let e of o)X(e,t.right,n,[...r,...a],i);return}}W(e,t,n).length>0&&i.push(r)}var Z=new Map([[`and`,`AND`],[`or`,`OR`],[`not`,`NOT`],[`if`,`IF`],[`then`,`THEN`],[`elif`,`ELIF`],[`else`,`ELSE`],[`end`,`END`],[`as`,`AS`],[`try`,`TRY`],[`catch`,`CATCH`],[`true`,`TRUE`],[`false`,`FALSE`],[`null`,`NULL`],[`reduce`,`REDUCE`],[`foreach`,`FOREACH`],[`label`,`LABEL`],[`break`,`BREAK`],[`def`,`DEF`]]),Q=new Set(Z.values());function $(e){let t=[],n=0,r=(t=0)=>e[n+t],i=()=>e[n++],a=()=>n>=e.length,o=e=>e>=`0`&&e<=`9`,s=e=>e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`,c=e=>s(e)||o(e);for(;!a();){let l=n,u=i();if(!(u===` `||u===` `||u===`
3
+ `||u===`\r`)){if(u===`#`){for(;!a()&&r()!==`
4
+ `;)i();continue}if(u===`.`&&r()===`.`){i(),t.push({type:`DOTDOT`,pos:l});continue}if(u===`=`&&r()===`=`){i(),t.push({type:`EQ`,pos:l});continue}if(u===`!`&&r()===`=`){i(),t.push({type:`NE`,pos:l});continue}if(u===`<`&&r()===`=`){i(),t.push({type:`LE`,pos:l});continue}if(u===`>`&&r()===`=`){i(),t.push({type:`GE`,pos:l});continue}if(u===`/`&&r()===`/`){i(),r()===`=`?(i(),t.push({type:`UPDATE_ALT`,pos:l})):t.push({type:`ALT`,pos:l});continue}if(u===`+`&&r()===`=`){i(),t.push({type:`UPDATE_ADD`,pos:l});continue}if(u===`-`&&r()===`=`){i(),t.push({type:`UPDATE_SUB`,pos:l});continue}if(u===`*`&&r()===`=`){i(),t.push({type:`UPDATE_MUL`,pos:l});continue}if(u===`/`&&r()===`=`){i(),t.push({type:`UPDATE_DIV`,pos:l});continue}if(u===`%`&&r()===`=`){i(),t.push({type:`UPDATE_MOD`,pos:l});continue}if(u===`=`&&r()!==`=`){t.push({type:`ASSIGN`,pos:l});continue}if(u===`.`){t.push({type:`DOT`,pos:l});continue}if(u===`|`){r()===`=`?(i(),t.push({type:`UPDATE_PIPE`,pos:l})):t.push({type:`PIPE`,pos:l});continue}if(u===`,`){t.push({type:`COMMA`,pos:l});continue}if(u===`:`){t.push({type:`COLON`,pos:l});continue}if(u===`;`){t.push({type:`SEMICOLON`,pos:l});continue}if(u===`(`){t.push({type:`LPAREN`,pos:l});continue}if(u===`)`){t.push({type:`RPAREN`,pos:l});continue}if(u===`[`){t.push({type:`LBRACKET`,pos:l});continue}if(u===`]`){t.push({type:`RBRACKET`,pos:l});continue}if(u===`{`){t.push({type:`LBRACE`,pos:l});continue}if(u===`}`){t.push({type:`RBRACE`,pos:l});continue}if(u===`?`){t.push({type:`QUESTION`,pos:l});continue}if(u===`+`){t.push({type:`PLUS`,pos:l});continue}if(u===`-`){t.push({type:`MINUS`,pos:l});continue}if(u===`*`){t.push({type:`STAR`,pos:l});continue}if(u===`/`){t.push({type:`SLASH`,pos:l});continue}if(u===`%`){t.push({type:`PERCENT`,pos:l});continue}if(u===`<`){t.push({type:`LT`,pos:l});continue}if(u===`>`){t.push({type:`GT`,pos:l});continue}if(o(u)){let s=u;for(;!a()&&(o(r())||r()===`.`||r()===`e`||r()===`E`);)(r()===`e`||r()===`E`)&&(e[n+1]===`+`||e[n+1]===`-`)&&(s+=i()),s+=i();t.push({type:`NUMBER`,value:Number(s),pos:l});continue}if(u===`"`){let e=``;for(;!a()&&r()!==`"`;)if(r()===`\\`){if(i(),a())break;let t=i();switch(t){case`n`:e+=`
5
+ `;break;case`r`:e+=`\r`;break;case`t`:e+=` `;break;case`\\`:e+=`\\`;break;case`"`:e+=`"`;break;case`(`:e+=`\\(`;break;default:e+=t}}else e+=i();a()||i(),t.push({type:`STRING`,value:e,pos:l});continue}if(s(u)||u===`$`||u===`@`){let e=u;for(;!a()&&c(r());)e+=i();let n=Z.get(e);n?t.push({type:n,value:e,pos:l}):t.push({type:`IDENT`,value:e,pos:l});continue}throw Error(`Unexpected character '${u}' at position ${l}`)}}return t.push({type:`EOF`,pos:n}),t}var re=class e{tokens;pos=0;constructor(e){this.tokens=e}peek(e=0){return this.tokens[this.pos+e]??{type:`EOF`,pos:-1}}advance(){return this.tokens[this.pos++]}check(e){return this.peek().type===e}match(...e){for(let t of e)if(this.check(t))return this.advance();return null}expect(e,t){if(!this.check(e))throw Error(`${t} at position ${this.peek().pos}, got ${this.peek().type}`);return this.advance()}isFieldNameAfterDot(e=0){let t=this.peek(e),n=this.peek(e+1);return n.type===`STRING`?!0:n.type===`IDENT`||Q.has(n.type)?n.pos===t.pos+1:!1}isIdentLike(){let e=this.peek().type;return e===`IDENT`||Q.has(e)}consumeFieldNameAfterDot(e){let t=this.peek();return t.type===`STRING`||(t.type===`IDENT`||Q.has(t.type))&&t.pos===e.pos+1?this.advance().value:null}parse(){let e=this.parseExpr();if(!this.check(`EOF`))throw Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`);return e}parseExpr(){return this.parsePipe()}parsePattern(){if(this.match(`LBRACKET`)){let e=[];if(!this.check(`RBRACKET`))for(e.push(this.parsePattern());this.match(`COMMA`)&&!this.check(`RBRACKET`);)e.push(this.parsePattern());return this.expect(`RBRACKET`,`Expected ']' after array pattern`),{type:`array`,elements:e}}if(this.match(`LBRACE`)){let e=[];if(!this.check(`RBRACE`))for(e.push(this.parsePatternField());this.match(`COMMA`)&&!this.check(`RBRACE`);)e.push(this.parsePatternField());return this.expect(`RBRACE`,`Expected '}' after object pattern`),{type:`object`,fields:e}}let e=this.expect(`IDENT`,`Expected variable name in pattern`),t=e.value;if(!t.startsWith(`$`))throw Error(`Variable name must start with $ at position ${e.pos}`);return{type:`var`,name:t}}parsePatternField(){if(this.match(`LPAREN`)){let e=this.parseExpr();return this.expect(`RPAREN`,`Expected ')' after computed key`),this.expect(`COLON`,`Expected ':' after computed key`),{key:e,pattern:this.parsePattern()}}let e=this.peek();if(e.type===`IDENT`||Q.has(e.type)){let t=e.value;if(t.startsWith(`$`)){if(this.advance(),this.match(`COLON`)){let e=this.parsePattern();return{key:t.slice(1),pattern:e,keyVar:t}}return{key:t.slice(1),pattern:{type:`var`,name:t}}}return this.advance(),this.match(`COLON`)?{key:t,pattern:this.parsePattern()}:{key:t,pattern:{type:`var`,name:`$${t}`}}}throw Error(`Expected field name in object pattern at position ${e.pos}`)}parsePipe(){let e=this.parseComma();for(;this.match(`PIPE`);){let t=this.parseComma();e={type:`Pipe`,left:e,right:t}}return e}parseComma(){let e=this.parseVarBind();for(;this.match(`COMMA`);){let t=this.parseVarBind();e={type:`Comma`,left:e,right:t}}return e}parseVarBind(){let e=this.parseUpdate();if(this.match(`AS`)){let t=this.parsePattern(),n=[];for(;this.check(`QUESTION`)&&this.peekAhead(1)?.type===`ALT`;)this.advance(),this.advance(),n.push(this.parsePattern());this.expect(`PIPE`,`Expected '|' after variable binding`);let r=this.parseExpr();return t.type===`var`&&n.length===0?{type:`VarBind`,name:t.name,value:e,body:r}:{type:`VarBind`,name:t.type===`var`?t.name:``,value:e,body:r,pattern:t.type===`var`?void 0:t,alternatives:n.length>0?n:void 0}}return e}peekAhead(e){let t=this.pos+e;return t<this.tokens.length?this.tokens[t]:void 0}parseUpdate(){let e=this.parseAlt(),t=new Map([[`ASSIGN`,`=`],[`UPDATE_ADD`,`+=`],[`UPDATE_SUB`,`-=`],[`UPDATE_MUL`,`*=`],[`UPDATE_DIV`,`/=`],[`UPDATE_MOD`,`%=`],[`UPDATE_ALT`,`//=`],[`UPDATE_PIPE`,`|=`]]),n=this.match(`ASSIGN`,`UPDATE_ADD`,`UPDATE_SUB`,`UPDATE_MUL`,`UPDATE_DIV`,`UPDATE_MOD`,`UPDATE_ALT`,`UPDATE_PIPE`);if(n){let r=this.parseVarBind(),i=t.get(n.type);if(i)return{type:`UpdateOp`,op:i,path:e,value:r}}return e}parseAlt(){let e=this.parseOr();for(;this.match(`ALT`);){let t=this.parseOr();e={type:`BinaryOp`,op:`//`,left:e,right:t}}return e}parseOr(){let e=this.parseAnd();for(;this.match(`OR`);){let t=this.parseAnd();e={type:`BinaryOp`,op:`or`,left:e,right:t}}return e}parseAnd(){let e=this.parseNot();for(;this.match(`AND`);){let t=this.parseNot();e={type:`BinaryOp`,op:`and`,left:e,right:t}}return e}parseNot(){return this.parseComparison()}parseComparison(){let e=this.parseAddSub(),t=new Map([[`EQ`,`==`],[`NE`,`!=`],[`LT`,`<`],[`LE`,`<=`],[`GT`,`>`],[`GE`,`>=`]]),n=this.match(`EQ`,`NE`,`LT`,`LE`,`GT`,`GE`);if(n){let r=t.get(n.type);if(r){let t=this.parseAddSub();e={type:`BinaryOp`,op:r,left:e,right:t}}}return e}parseAddSub(){let e=this.parseMulDiv();for(;;)if(this.match(`PLUS`)){let t=this.parseMulDiv();e={type:`BinaryOp`,op:`+`,left:e,right:t}}else if(this.match(`MINUS`)){let t=this.parseMulDiv();e={type:`BinaryOp`,op:`-`,left:e,right:t}}else break;return e}parseMulDiv(){let e=this.parseUnary();for(;;)if(this.match(`STAR`)){let t=this.parseUnary();e={type:`BinaryOp`,op:`*`,left:e,right:t}}else if(this.match(`SLASH`)){let t=this.parseUnary();e={type:`BinaryOp`,op:`/`,left:e,right:t}}else if(this.match(`PERCENT`)){let t=this.parseUnary();e={type:`BinaryOp`,op:`%`,left:e,right:t}}else break;return e}parseUnary(){return this.match(`MINUS`)?{type:`UnaryOp`,op:`-`,operand:this.parseUnary()}:this.parsePostfix()}parsePostfix(){let e=this.parsePrimary();for(;;)if(this.match(`QUESTION`))e={type:`Optional`,expr:e};else if(this.check(`DOT`)&&this.isFieldNameAfterDot())this.advance(),e={type:`Field`,name:this.advance().value,base:e};else if(this.check(`LBRACKET`))if(this.advance(),this.match(`RBRACKET`))e={type:`Iterate`,base:e};else if(this.check(`COLON`)){this.advance();let t=this.check(`RBRACKET`)?void 0:this.parseExpr();this.expect(`RBRACKET`,`Expected ']'`),e={type:`Slice`,end:t,base:e}}else{let t=this.parseExpr();if(this.match(`COLON`)){let n=this.check(`RBRACKET`)?void 0:this.parseExpr();this.expect(`RBRACKET`,`Expected ']'`),e={type:`Slice`,start:t,end:n,base:e}}else this.expect(`RBRACKET`,`Expected ']'`),e={type:`Index`,index:t,base:e}}else break;return e}parsePrimary(){if(this.match(`DOTDOT`))return{type:`Recurse`};if(this.check(`DOT`)){let e=this.advance();if(this.check(`LBRACKET`)){if(this.advance(),this.match(`RBRACKET`))return{type:`Iterate`};if(this.check(`COLON`)){this.advance();let e=this.check(`RBRACKET`)?void 0:this.parseExpr();return this.expect(`RBRACKET`,`Expected ']'`),{type:`Slice`,end:e}}let e=this.parseExpr();if(this.match(`COLON`)){let t=this.check(`RBRACKET`)?void 0:this.parseExpr();return this.expect(`RBRACKET`,`Expected ']'`),{type:`Slice`,start:e,end:t}}return this.expect(`RBRACKET`,`Expected ']'`),{type:`Index`,index:e}}let t=this.consumeFieldNameAfterDot(e);return t===null?{type:`Identity`}:{type:`Field`,name:t}}if(this.match(`TRUE`))return{type:`Literal`,value:!0};if(this.match(`FALSE`))return{type:`Literal`,value:!1};if(this.match(`NULL`))return{type:`Literal`,value:null};if(this.check(`NUMBER`))return{type:`Literal`,value:this.advance().value};if(this.check(`STRING`)){let e=this.advance().value;return e.includes(`\\(`)?this.parseStringInterpolation(e):{type:`Literal`,value:e}}if(this.match(`LBRACKET`)){if(this.match(`RBRACKET`))return{type:`Array`};let e=this.parseExpr();return this.expect(`RBRACKET`,`Expected ']'`),{type:`Array`,elements:e}}if(this.match(`LBRACE`))return this.parseObjectConstruction();if(this.match(`LPAREN`)){let e=this.parseExpr();return this.expect(`RPAREN`,`Expected ')'`),{type:`Paren`,expr:e}}if(this.match(`IF`))return this.parseIf();if(this.match(`TRY`)){let e=this.parsePostfix(),t;return this.match(`CATCH`)&&(t=this.parsePostfix()),{type:`Try`,body:e,catch:t}}if(this.match(`REDUCE`)){let e=this.parseAddSub();this.expect(`AS`,`Expected 'as' after reduce expression`);let t=this.parsePattern();this.expect(`LPAREN`,`Expected '(' after variable`);let n=this.parseExpr();this.expect(`SEMICOLON`,`Expected ';' after init expression`);let r=this.parseExpr();return this.expect(`RPAREN`,`Expected ')' after update expression`),{type:`Reduce`,expr:e,varName:t.type===`var`?t.name:``,init:n,update:r,pattern:t.type===`var`?void 0:t}}if(this.match(`FOREACH`)){let e=this.parseAddSub();this.expect(`AS`,`Expected 'as' after foreach expression`);let t=this.parsePattern();this.expect(`LPAREN`,`Expected '(' after variable`);let n=this.parseExpr();this.expect(`SEMICOLON`,`Expected ';' after init expression`);let r=this.parseExpr(),i;return this.match(`SEMICOLON`)&&(i=this.parseExpr()),this.expect(`RPAREN`,`Expected ')' after expressions`),{type:`Foreach`,expr:e,varName:t.type===`var`?t.name:``,init:n,update:r,extract:i,pattern:t.type===`var`?void 0:t}}if(this.match(`LABEL`)){let e=this.expect(`IDENT`,`Expected label name (e.g., $out)`),t=e.value;if(!t.startsWith(`$`))throw Error(`Label name must start with $ at position ${e.pos}`);return this.expect(`PIPE`,`Expected '|' after label name`),{type:`Label`,name:t,body:this.parseExpr()}}if(this.match(`BREAK`)){let e=this.expect(`IDENT`,`Expected label name to break to`),t=e.value;if(!t.startsWith(`$`))throw Error(`Break label must start with $ at position ${e.pos}`);return{type:`Break`,name:t}}if(this.match(`DEF`)){let e=this.expect(`IDENT`,`Expected function name after def`).value,t=[];if(this.match(`LPAREN`)){if(!this.check(`RPAREN`)){let e=this.expect(`IDENT`,`Expected parameter name`);for(t.push(e.value);this.match(`SEMICOLON`);){let e=this.expect(`IDENT`,`Expected parameter name`);t.push(e.value)}}this.expect(`RPAREN`,`Expected ')' after parameters`)}this.expect(`COLON`,`Expected ':' after function name`);let n=this.parseExpr();return this.expect(`SEMICOLON`,`Expected ';' after function body`),{type:`Def`,name:e,params:t,funcBody:n,body:this.parseExpr()}}if(this.match(`NOT`))return{type:`Call`,name:`not`,args:[]};if(this.check(`IDENT`)){let e=this.advance().value;if(e.startsWith(`$`))return{type:`VarRef`,name:e};if(this.match(`LPAREN`)){let t=[];if(!this.check(`RPAREN`))for(t.push(this.parseExpr());this.match(`SEMICOLON`);)t.push(this.parseExpr());return this.expect(`RPAREN`,`Expected ')'`),{type:`Call`,name:e,args:t}}return{type:`Call`,name:e,args:[]}}throw Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`)}parseObjectConstruction(){let e=[];if(!this.check(`RBRACE`))do{let t,n;if(this.match(`LPAREN`))t=this.parseExpr(),this.expect(`RPAREN`,`Expected ')'`),this.expect(`COLON`,`Expected ':'`),n=this.parseObjectValue();else if(this.isIdentLike()){let e=this.advance().value;this.match(`COLON`)?(t=e,n=this.parseObjectValue()):(t=e,n={type:`Field`,name:e})}else if(this.check(`STRING`))t=this.advance().value,this.expect(`COLON`,`Expected ':'`),n=this.parseObjectValue();else throw Error(`Expected object key at position ${this.peek().pos}`);e.push({key:t,value:n})}while(this.match(`COMMA`));return this.expect(`RBRACE`,`Expected '}'`),{type:`Object`,entries:e}}parseObjectValue(){let e=this.parseVarBind();for(;this.match(`PIPE`);){let t=this.parseVarBind();e={type:`Pipe`,left:e,right:t}}return e}parseIf(){let e=this.parseExpr();this.expect(`THEN`,`Expected 'then'`);let t=this.parseExpr(),n=[];for(;this.match(`ELIF`);){let e=this.parseExpr();this.expect(`THEN`,`Expected 'then' after elif`);let t=this.parseExpr();n.push({cond:e,then:t})}let r;return this.match(`ELSE`)&&(r=this.parseExpr()),this.expect(`END`,`Expected 'end'`),{type:`Cond`,cond:e,then:t,elifs:n,else:r}}parseStringInterpolation(t){let n=[],r=``,i=0;for(;i<t.length;)if(t[i]===`\\`&&t[i+1]===`(`){r&&=(n.push(r),``),i+=2;let a=1,o=``;for(;i<t.length&&a>0;)t[i]===`(`?a++:t[i]===`)`&&a--,a>0&&(o+=t[i]),i++;let s=new e($(o));n.push(s.parse())}else r+=t[i],i++;return r&&n.push(r),{type:`StringInterp`,parts:n}}};function ie(e){return new re($(e)).parse()}export{W as n,ie as t};
6
+ //# sourceMappingURL=chunk-BBXLRYSX-DURjrblE.mjs.map
@@ -0,0 +1,63 @@
1
+ import{o as e,t}from"./chunk-FK9Q3tQk.mjs";import{t as n}from"./chunk-YNYSPYQ5-BpP11HXS.mjs";import{t as r}from"./chunk-5QMZ5MUS-DWTkM0vM.mjs";import{n as i,r as a,t as o}from"./chunk-74CEPOFO-D1bzz49u.mjs";import{t as s}from"./chunk-X2AJGDEF-BaH6i1Rq.mjs";var c=t(((e,t)=>{var n=[0,1,3,7,15,31,63,127,255],r=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};r.prototype._ensureByte=function(){this.hasByte||=(this.curByte=this.stream.readByte(),!0)},r.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=n[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&n[e]<<i)>>i,this.bitOffset+=e,e=0}}return t},r.prototype.seek=function(e){var t=e%8,n=(e-t)/8;this.bitOffset=t,this.stream.seek(n),this.hasByte=!1},r.prototype.pi=function(){var e=new Buffer(6),t;for(t=0;t<e.length;t++)e[t]=this.read(8);return e.toString(`hex`)},t.exports=r})),l=t(((e,t)=>{var n=function(){};n.prototype.readByte=function(){throw Error(`abstract method readByte() not implemented`)},n.prototype.read=function(e,t,n){for(var r=0;r<n;){var i=this.readByte();if(i<0)return r===0?-1:r;e[t++]=i,r++}return r},n.prototype.seek=function(e){throw Error(`abstract method seek() not implemented`)},n.prototype.writeByte=function(e){throw Error(`abstract method readByte() not implemented`)},n.prototype.write=function(e,t,n){var r;for(r=0;r<n;r++)this.writeByte(e[t++]);return n},n.prototype.flush=function(){},t.exports=n})),u=t(((e,t)=>{t.exports=(function(){var e=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]);return function(){var t=4294967295;this.getCRC=function(){return~t>>>0},this.updateCRC=function(n){t=t<<8^e[(t>>>24^n)&255]},this.updateCRCRun=function(n,r){for(;r-- >0;)t=t<<8^e[(t>>>24^n)&255]}}})()})),d=t(((e,t)=>{t.exports={name:`seek-bzip`,version:`2.0.0`,contributors:[`C. Scott Ananian (http://cscott.net)`,`Eli Skeggs`,`Kevin Kwok`,`Rob Landley (http://landley.net)`],description:`a pure-JavaScript Node.JS module for random-access decoding bzip2 data`,main:`./lib/index.js`,repository:{type:`git`,url:`https://github.com/cscott/seek-bzip.git`},license:`MIT`,bin:{"seek-bunzip":`./bin/seek-bunzip`,"seek-table":`./bin/seek-bzip-table`},directories:{test:`test`},dependencies:{commander:`^6.0.0`},devDependencies:{fibers:`^5.0.0`,mocha:`^8.1.0`},scripts:{test:`mocha`}}})),f=e(t(((e,t)=>{var n=c(),r=l(),i=u(),a=d(),o=20,s=258,f=0,p=1,m=2,h=6,g=50,_=`314159265359`,v=`177245385090`,y=function(e,t){var n=e[t],r;for(r=t;r>0;r--)e[r]=e[r-1];return e[0]=n,n},b={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},x={};x[b.LAST_BLOCK]=`Bad file checksum`,x[b.NOT_BZIP_DATA]=`Not bzip data`,x[b.UNEXPECTED_INPUT_EOF]=`Unexpected input EOF`,x[b.UNEXPECTED_OUTPUT_EOF]=`Unexpected output EOF`,x[b.DATA_ERROR]=`Data error`,x[b.OUT_OF_MEMORY]=`Out of memory`,x[b.OBSOLETE_INPUT]=`Obsolete (pre 0.9.5) bzip format not supported.`;var S=function(e,t){var n=x[e]||`unknown error`;t&&(n+=`: `+t);var r=TypeError(n);throw r.errorCode=e,r},C=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};C.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new i,!0):(this.writeCount=-1,!1)},C.prototype._start_bunzip=function(e,t){var r=new Buffer(4);(e.read(r,0,4)!==4||String.fromCharCode(r[0],r[1],r[2])!==`BZh`)&&S(b.NOT_BZIP_DATA,`bad magic`);var i=r[3]-48;(i<1||i>9)&&S(b.NOT_BZIP_DATA,`level out of range`),this.reader=new n(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0},C.prototype._get_next_block=function(){var e,t,n,r=this.reader,i=r.pi();if(i===v)return!1;i!==_&&S(b.NOT_BZIP_DATA),this.targetBlockCRC=r.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,r.read(1)&&S(b.OBSOLETE_INPUT);var a=r.read(24);a>this.dbufSize&&S(b.DATA_ERROR,`initial position out of bounds`);var c=r.read(16),l=new Buffer(256),u=0;for(e=0;e<16;e++)if(c&1<<15-e){var d=e*16;for(n=r.read(16),t=0;t<16;t++)n&1<<15-t&&(l[u++]=d+t)}var x=r.read(3);(x<m||x>h)&&S(b.DATA_ERROR);var C=r.read(15);C===0&&S(b.DATA_ERROR);var w=new Buffer(256);for(e=0;e<x;e++)w[e]=e;var T=new Buffer(C);for(e=0;e<C;e++){for(t=0;r.read(1);t++)t>=x&&S(b.DATA_ERROR);T[e]=y(w,t)}var E=u+2,D=[],O;for(t=0;t<x;t++){var k=new Buffer(E),A=new Uint16Array(o+1);for(c=r.read(5),e=0;e<E;e++){for(;(c<1||c>o)&&S(b.DATA_ERROR),r.read(1);)r.read(1)?c--:c++;k[e]=c}var j=M=k[0],M;for(e=1;e<E;e++)k[e]>M?M=k[e]:k[e]<j&&(j=k[e]);O={},D.push(O),O.permute=new Uint16Array(s),O.limit=new Uint32Array(o+2),O.base=new Uint32Array(o+1),O.minLen=j,O.maxLen=M;var N=0;for(e=j;e<=M;e++)for(A[e]=O.limit[e]=0,c=0;c<E;c++)k[c]===e&&(O.permute[N++]=c);for(e=0;e<E;e++)A[k[e]]++;for(N=c=0,e=j;e<M;e++)N+=A[e],O.limit[e]=N-1,N<<=1,c+=A[e],O.base[e+1]=N-c;O.limit[M+1]=Number.MAX_VALUE,O.limit[M]=N+A[M]-1,O.base[j]=0}var P=new Uint32Array(256);for(e=0;e<256;e++)w[e]=e;var F=0,I=0,L=0,R,z=this.dbuf=new Uint32Array(this.dbufSize);for(E=0;;){for(E--||(E=g-1,L>=C&&S(b.DATA_ERROR),O=D[T[L++]]),e=O.minLen,t=r.read(e);e>O.maxLen&&S(b.DATA_ERROR),!(t<=O.limit[e]);e++)t=t<<1|r.read(1);t-=O.base[e],(t<0||t>=s)&&S(b.DATA_ERROR);var B=O.permute[t];if(B===f||B===p){F||(F=1,c=0),B===f?c+=F:c+=2*F,F<<=1;continue}if(F)for(F=0,I+c>this.dbufSize&&S(b.DATA_ERROR),R=l[w[0]],P[R]+=c;c--;)z[I++]=R;if(B>u)break;I>=this.dbufSize&&S(b.DATA_ERROR),e=B-1,R=y(w,e),R=l[R],P[R]++,z[I++]=R}for((a<0||a>=I)&&S(b.DATA_ERROR),t=0,e=0;e<256;e++)n=t+P[e],P[e]=t,t=n;for(e=0;e<I;e++)R=z[e]&255,z[P[R]]|=e<<8,P[R]++;var V=0,ee=0,te=0;return I&&(V=z[a],ee=V&255,V>>=8,te=-1),this.writePos=V,this.writeCurrent=ee,this.writeCount=I,this.writeRun=te,!0},C.prototype._read_bunzip=function(e,t){var n,r,i;if(this.writeCount<0)return 0;var a=this.dbuf,o=this.writePos,s=this.writeCurrent,c=this.writeCount;this.outputsize;for(var l=this.writeRun;c;){for(c--,r=s,o=a[o],s=o&255,o>>=8,l++===3?(n=s,i=r,s=-1):(n=1,i=s),this.blockCRC.updateCRCRun(i,n);n--;)this.outputStream.writeByte(i),this.nextoutput++;s!=r&&(l=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&S(b.DATA_ERROR,`Bad block CRC (got `+this.blockCRC.getCRC().toString(16)+` expected `+this.targetBlockCRC.toString(16)+`)`),this.nextoutput};var w=function(e){if(`readByte`in e)return e;var t=new r;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(e){this.pos=e},t.eof=function(){return this.pos>=e.length},t},T=function(e){var t=new r,n=!0;if(e)if(typeof e==`number`)t.buffer=new Buffer(e),n=!1;else if(`writeByte`in e)return e;else t.buffer=e,n=!1;else t.buffer=new Buffer(16384);return t.pos=0,t.writeByte=function(e){if(n&&this.pos>=this.buffer.length){var t=new Buffer(this.buffer.length*2);this.buffer.copy(t),this.buffer=t}this.buffer[this.pos++]=e},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!n)throw TypeError(`outputsize does not match decoded input`);var e=new Buffer(this.pos);this.buffer.copy(e,0,0,this.pos),this.buffer=e}return this.buffer},t._coerced=!0,t};C.Err=b,C.decode=function(e,t,n){for(var r=w(e),i=T(t),a=new C(r,i);!(`eof`in r&&r.eof());)if(a._init_block())a._read_bunzip();else{var o=a.reader.read(32)>>>0;if(o!==a.streamCRC&&S(b.DATA_ERROR,`Bad stream CRC (got `+a.streamCRC.toString(16)+` expected `+o.toString(16)+`)`),n&&`eof`in r&&!r.eof())a._start_bunzip(r,i);else break}if(`getBuffer`in i)return i.getBuffer()},C.decodeBlock=function(e,t,n){var r=w(e),a=T(n),o=new C(r,a);if(o.reader.seek(t),o._get_next_block()&&(o.blockCRC=new i,o.writeCopies=0,o._read_bunzip()),`getBuffer`in a)return a.getBuffer()},C.table=function(e,t,n){var i=new r;i.delegate=w(e),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var a=new r;a.pos=0,a.writeByte=function(){this.pos++};for(var o=new C(i,a),s=o.dbufSize;!(`eof`in i&&i.eof());){var c=i.pos*8+o.reader.bitOffset;if(o.reader.hasByte&&(c-=8),o._init_block()){var l=a.pos;o._read_bunzip(),t(c,a.pos-l)}else if(o.reader.read(32),n&&`eof`in i&&!i.eof())o._start_bunzip(i,a),console.assert(o.dbufSize===s,`shouldn't change block size within multistream file`);else break}},C.Stream=r,C.version=a.version,C.license=a.license,t.exports=C}))(),1),p=`file`,m=`link`,h=`symlink`,g=`directory`,_={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`},v={0:p,1:m,2:h,3:`character-device`,4:`block-device`,5:g,6:`fifo`,x:`pax-header`,g:`pax-global-header`,L:`gnu-long-name`,K:`gnu-long-link-name`},y=new Uint8Array(512),b=new Uint8Array,x=new TextEncoder,S=new TextDecoder;function C(e,t,n,r){r&&x.encodeInto(r,e.subarray(t,t+n))}function w(e,t,n,r){if(r===void 0)return;let i=r.toString(8).padStart(n-1,`0`);x.encodeInto(i,e.subarray(t,t+n-1))}function T(e,t,n){let r=e.indexOf(0,t),i=r===-1||r>t+n?t+n:r;return S.decode(e.subarray(t,i))}function E(e,t,n){let r=0,i=t+n;for(let n=t;n<i;n++){let t=e[n];if(t===0)break;t!==32&&(r=r*8+(t-48))}return r}function D(e,t,n){if(e[t]&128){let r=0;r=e[t]&127;for(let i=1;i<n;i++)r=r*256+e[t+i];if(!Number.isSafeInteger(r))throw Error(`TAR number too large`);return r}return E(e,t,n)}var O=e=>e.type===g||e.type===h||e.type===m;async function k(e){if(e==null)return b;if(e instanceof Uint8Array)return e;if(typeof e==`string`)return x.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw TypeError(`Unsupported content type for entry body.`)}function A(e,t){let{strip:n,filter:r,map:i}=t;if(!n&&!r&&!i)return e;let a={...e};if(n&&n>0){let e=a.name.split(`/`).filter(Boolean);if(n>=e.length)return null;let t=e.slice(n).join(`/`);if(a.name=a.type===g&&!t.endsWith(`/`)?`${t}/`:t,a.linkname?.startsWith(`/`)){let e=a.linkname.split(`/`).filter(Boolean);a.linkname=n>=e.length?`/`:`/${e.slice(n).join(`/`)}`}}if(r?.(a)===!1)return null;let o=i?i(a):a;return o&&(!o.name||!o.name.trim()||o.name===`.`||o.name===`/`)?null:o}var j=32,M=48;function N(e){let t=E(e,148,8),n=0;for(let t=0;t<e.length;t++)t>=148&&t<156?n+=j:n+=e[t];return t===n}function P(e){e.fill(j,148,156);let t=0;for(let n of e)t+=n;for(let n=153;n>=148;n--)e[n]=(t&7)+M,t>>=3;e[154]=0,e[155]=j}function F(e){let t={};e.name.length>100&&I(e.name)===null&&(t.path=e.name),e.linkname&&e.linkname.length>100&&(t.linkpath=e.linkname),e.uname&&e.uname.length>32&&(t.uname=e.uname),e.gname&&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 n=Object.entries(t);if(n.length===0)return null;let r=x.encode(n.map(([e,t])=>{let n=`${e}=${t}
2
+ `,r=x.encode(n).length+1,i=r+String(r).length;return i=r+String(i).length,`${i} ${n}`}).join(``));return{paxHeader:L({name:S.decode(x.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:`pax-header`,mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function I(e){if(e.length<=100)return null;let t=e.length-100-1,n=e.lastIndexOf(`/`,155);return n>0&&n>=t?{prefix:e.slice(0,n),name:e.slice(n+1)}:null}function L(e){let t=new Uint8Array(512),n=O(e)?0:e.size??0,r=e.name,i=``;if(!e.pax?.path){let e=I(r);e&&(r=e.name,i=e.prefix)}return C(t,0,100,r),w(t,100,8,e.mode??(e.type===g?493:420)),w(t,108,8,e.uid??0),w(t,116,8,e.gid??0),w(t,124,12,n),w(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),C(t,156,1,_[e.type??p]),C(t,157,100,e.linkname),C(t,257,6,`ustar\0`),C(t,263,2,`00`),C(t,265,32,e.uname),C(t,297,32,e.gname),C(t,345,155,i),P(t),t}function R(e,t){if(t&&!N(e))throw Error(`Invalid tar header checksum.`);let n=T(e,156,1),r={name:T(e,0,100),mode:E(e,100,8),uid:D(e,108,8),gid:D(e,116,8),size:D(e,124,12),mtime:new Date(D(e,136,12)*1e3),type:v[n]||p,linkname:T(e,157,100)},i=T(e,257,6);return i.trim()===`ustar`&&(r.uname=T(e,265,32),r.gname=T(e,297,32)),i===`ustar`&&(r.prefix=T(e,345,155)),r}var z={path:[`name`,e=>e],linkpath:[`linkname`,e=>e],size:[`size`,e=>parseInt(e,10)],mtime:[`mtime`,parseFloat],uid:[`uid`,e=>parseInt(e,10)],gid:[`gid`,e=>parseInt(e,10)],uname:[`uname`,e=>e],gname:[`gname`,e=>e]};function B(e){let t=new TextDecoder(`utf-8`),n={},r={},i=0;for(;i<e.length;){let a=e.indexOf(32,i);if(a===-1)break;let o=parseInt(t.decode(e.subarray(i,a)),10);if(Number.isNaN(o)||o===0)break;let s=i+o,[c,l]=t.decode(e.subarray(a+1,s-1)).split(`=`,2);if(c&&l!==void 0){r[c]=l;let e=z[c];if(e){let[t,r]=e,i=r(l);(typeof i==`string`||!Number.isNaN(i))&&(n[t]=i)}}i=s}return Object.keys(r).length>0&&(n.pax=r),n}function V(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 ee(e){switch(e){case`pax-global-header`:case`pax-header`:return B;case`gnu-long-name`:return e=>({name:T(e,0,e.length)});case`gnu-long-link-name`:return e=>({linkname:T(e,0,e.length)});default:return}}function te(e){let t=L(e),n=F(e);if(!n)return[t];let r=-n.paxBody.length&511,i=r>0?[y.subarray(0,r)]:[];return[n.paxHeader,n.paxBody,...i,t]}var ne=new Uint8Array(512*2);function re(e,t,n){let r=null,i=0,a=!1;return{add(n){if(a){let e=Error(`No new tar entries after finalize.`);throw t(e),e}if(r!==null){let e=Error(`Previous entry must be completed before adding a new one`);throw t(e),e}try{let t=O(n)?0:n.size??0,a=te({...n,size:t});for(let t of a)e(t);r={...n,size:t},i=0}catch(e){t(e)}},write(n){if(!r){let e=Error(`No active tar entry.`);throw t(e),e}if(a){let e=Error(`Cannot write data after finalize.`);throw t(e),e}let o=i+n.length;if(o>r.size){let e=Error(`"${r.name}" exceeds given size of ${r.size} bytes.`);throw t(e),e}try{i=o,e(n)}catch(e){t(e)}},endEntry(){if(!r){let e=Error(`No active entry to end.`);throw t(e),e}if(a){let e=Error(`Cannot end entry after finalize.`);throw t(e),e}try{if(i!==r.size){let e=Error(`Size mismatch for "${r.name}".`);throw t(e),e}let n=-r.size&511;n>0&&e(new Uint8Array(n)),r=null,i=0}catch(e){throw t(e),e}},finalize(){if(a){let e=Error(`Archive has already been finalized`);throw t(e),e}if(r!==null){let e=Error(`Cannot finalize while an entry is still active`);throw t(e),e}try{e(ne),a=!0,n&&n()}catch(e){t(e)}}}}var H=256;function ie(){let e=Array(H),t=e.length-1,n=0,r=0,i=0,a=a=>{let o=e[n];a===o.length?(e[n]=b,n=n+1&t):e[n]=o.subarray(a),i-=a,i===0&&e.length>H&&(e=Array(H),t=H-1,n=0,r=0)};function o(t,r){if(r){let o=0,s=Math.min(t,i);for(;s>0;){let t=e[n],i=Math.min(s,t.length),c=i===t.length?t:t.subarray(0,i);if(a(i),s-=i,o+=i,!r(c))break}return o}if(i<t)return null;if(t===0)return b;let o=e[n];if(o.length>=t){let e=o.length===t?o:o.subarray(0,t);return a(t),e}let s=new Uint8Array(t),c=0,l=t;for(;l>0;){let t=e[n],r=Math.min(l,t.length);s.set(r===t.length?t:t.subarray(0,r),c),c+=r,l-=r,a(r)}return s}return{push:a=>{if(a.length===0)return;let o=r+1&t;if(o===n){let i=e.length,a=i*2,s=Array(a),c=r-n+i&i-1;if(n<r)for(let t=0;t<c;t++)s[t]=e[n+t];else if(c>0){let t=i-n;for(let r=0;r<t;r++)s[r]=e[n+r];for(let n=0;n<r;n++)s[t+n]=e[n]}e=s,t=a-1,n=0,r=c,o=r+1&t}e[r]=a,r=o,i+=a.length},available:()=>i,peek:r=>{if(i<r)return null;if(r===0)return b;let a=e[n];if(a.length>=r)return a.length===r?a:a.subarray(0,r);let o=new Uint8Array(r),s=0,c=n;for(;s<r;){let n=e[c],i=Math.min(r-s,n.length);i===n.length?o.set(n,s):o.set(n.subarray(0,i),s),s+=i,c=c+1&t}return o},discard:t=>{if(t>i)throw Error(`Too many bytes consumed`);if(t===0)return;let r=t;for(;r>0;){let t=e[n],i=Math.min(r,t.length);a(i),r-=i}},pull:o}}var ae=0,U=1,W=Error(`Tar archive is truncated.`);function oe(e={}){let t=e.strict??!1,{available:n,peek:r,push:i,discard:a,pull:o}=ie(),s=ae,c=!1,l=!1,u=!1,d=null,f={},p={},m={isEntryActive:()=>s===U,isBodyComplete:()=>!d||d.remaining===0,write(e){if(c)throw Error(`Archive already ended.`);i(e)},end(){c=!0},readHeader(){if(s!==ae)throw Error(`Cannot read header while an entry is active`);if(!l)for(;!l;){if(n()<512){if(c){if(n()>0&&t)throw W;l=!0;return}return null}let e=r(512);if(se(e)){if(n()<512*2){if(c){if(t)throw W;l=!0;return}return null}if(se(r(512*2).subarray(512))){a(512*2),l=!0,u=!0;return}if(t)throw Error(`Invalid tar header.`);a(512);continue}let i;try{i=R(e,t)}catch(e){if(t)throw e;a(512);continue}let m=ee(i.type);if(m){let e=i.size+511&-512;if(n()<512+e){if(c&&t)throw W;return null}a(512);let r=m(o(e).subarray(0,i.size)),s=i.type===`pax-global-header`?f:p;for(let e in r)s[e]=r[e];continue}a(512);let h=i;return i.prefix&&(h.name=`${i.prefix}/${h.name}`),V(h,f),V(h,p),p={},d={header:h,remaining:h.size,padding:-h.size&511},s=U,h}},streamBody(e){if(s!==U||!d||d.remaining===0)return 0;let t=Math.min(d.remaining,n());if(t===0)return 0;let r=o(t,e);return d.remaining-=r,r},skipPadding(){if(s!==U||!d)return!0;if(d.remaining>0)throw Error(`Body not fully consumed`);return n()<d.padding?!1:(a(d.padding),d=null,s=ae,!0)},skipEntry(){if(s!==U||!d)return!0;let e=Math.min(d.remaining,n());return e>0&&(a(e),d.remaining-=e),d.remaining>0?!1:m.skipPadding()},validateEOF(){if(t){if(!u)throw W;if(n()>0&&o(n()).some(e=>e!==0))throw Error(`Invalid EOF.`)}}};return m}function se(e){if(e.byteOffset%8==0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let e=0;e<t.length;e++)if(t[e]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function ce(){return new CompressionStream(`gzip`)}function le(){return new DecompressionStream(`gzip`)}function ue(){let e,t;return{readable:new ReadableStream({start(n){e=n,t=re(n.enqueue.bind(n),n.error.bind(n),n.close.bind(n))}}),controller:{add(n){let r=O(n),i={...n};return r&&(i.size=0),t.add(i),r&&t.endEntry(),new WritableStream({write(e){t.write(e)},close(){r||t.endEntry()},abort(t){e.error(t)}})},finalize(){t.finalize()},error(t){e.error(t)}}}}async function de(e){let t=[],n=e.getReader(),r=0;try{for(;;){let{done:e,value:i}=await n.read();if(e)break;t.push(i),r+=i.length}let e=new Uint8Array(r),i=0;for(let n of t)e.set(n,i),i+=n.length;return e}finally{n.releaseLock()}}var fe=e=>e.pipeTo(new WritableStream);function pe(e={}){let t=oe(e),n=null,r=!1,i=e=>{if(!r){r=!0;try{for(;;)if(t.isEntryActive()){if(n){if(t.streamBody(e=>(n.enqueue(e),!0))===0&&!t.isBodyComplete())break}else if(!t.skipEntry())break;if(t.isBodyComplete()){try{n?.close()}catch{}if(n=null,!t.skipPadding())break}}else{let r=t.readHeader();if(r==null)break;e.enqueue({header:r,body:new ReadableStream({start(e){r.size===0?e.close():n=e},pull:()=>i(e),cancel(){n=null,i(e)}})})}}catch(e){try{n?.error(e)}catch{}throw n=null,e}finally{r=!1}}};return new TransformStream({transform(e,r){try{t.write(e),i(r)}catch(e){try{n?.error(e)}catch{}throw e}},flush(e){try{if(t.end(),i(e),t.validateEOF(),t.isEntryActive()&&!t.isBodyComplete())try{n?.close()}catch{}}catch(e){try{n?.error(e)}catch{}throw e}}},void 0,{highWaterMark:1})}async function me(e){let{readable:t,controller:n}=ue();return await(async()=>{for(let t of e){let e=n.add(t.header),r=`body`in t?t.body:t.data;if(!r){await e.close();continue}if(r instanceof ReadableStream)await r.pipeTo(e);else if(r instanceof Blob)await r.stream().pipeTo(e);else try{let t=await k(r);if(t.length>0){let n=e.getWriter();await n.write(t),await n.close()}else await e.close()}catch{throw TypeError(`Unsupported content type for entry "${t.header.name}".`)}}})().then(()=>n.finalize()).catch(e=>n.error(e)),new Uint8Array(await de(t))}async function he(e,t={}){let n=e instanceof ReadableStream?e:new ReadableStream({start(t){t.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),t.close()}}),r=[],i=n.pipeThrough(pe(t));for await(let e of i){let n;try{n=A(e.header,t)}catch(t){throw await e.body.cancel(),t}if(n===null){await fe(e.body);continue}O(n)?(await fe(e.body),r.push({header:n})):r.push({header:n,data:await de(e.body)})}return r}var ge=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t<<24;for(let e=0;e<8;e++)n=n&2147483648?n<<1^79764919:n<<1;e[t]=n>>>0}return e})();function _e(e,t){return(e<<8^ge[(e>>>24^t)&255])>>>0}var ve=class{buffer=[];current=0;bitCount=0;writeBits(e,t){for(let n=e-1;n>=0;n--)this.current=this.current<<1|t>>>n&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(e){this.current=this.current<<1|e&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function ye(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=1;for(;n+i<e.length&&e[n+i]===r&&i<255;)i++;i>=4?(t.push(r,r,r,r),t.push(i-4),n+=i):(t.push(r),n++)}return new Uint8Array(t)}function be(e){let t=e.length;if(t===0)return{transformed:new Uint8Array,pointer:0};let n=xe(e),r=new Uint8Array(t),i=0;for(let a=0;a<t;a++)n[a]===0?(i=a,r[a]=e[t-1]):r[a]=e[n[a]-1];return{transformed:r,pointer:i}}function xe(e){let t=e.length,n=new Int32Array(t),r=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i,r[i]=e[i];for(let e=1;e<t;e*=2){let i=r.slice();n.sort((n,r)=>i[n]===i[r]?i[(n+e)%t]-i[(r+e)%t]:i[n]-i[r]),r[n[0]]=0;for(let a=1;a<t;a++)i[n[a]]===i[n[a-1]]&&i[(n[a]+e)%t]===i[(n[a-1]+e)%t]?r[n[a]]=r[n[a-1]]:r[n[a]]=r[n[a-1]]+1;if(r[n[t-1]]===t-1)break}return n}function Se(e,t){let n=[];for(let e=0;e<256;e++)t[e]&&n.push(e);let r=Array(256).fill(-1);for(let e=0;e<n.length;e++)r[n[e]]=e;let i=new Uint16Array(e.length),a=n.slice();for(let t=0;t<e.length;t++){let n=e[t],r=0;for(;a[r]!==n;)r++;if(i[t]=r,r>0){let e=a[r];for(let e=r;e>0;e--)a[e]=a[e-1];a[0]=e}}return{encoded:i,length:e.length}}function Ce(e,t,n){let r=n+1,i=[],a=0;for(;a<t;)if(e[a]===0){let n=0;for(;a<t&&e[a]===0;)n++,a++;let r=n;for(;r>0;)r--,r&1?i.push(1):i.push(0),r>>>=1}else i.push(e[a]+1),a++;i.push(r);let o=new Uint16Array(i.length);for(let e=0;e<i.length;e++)o[e]=i[e];return{symbols:o,length:i.length,eob:r}}function we(e,t,n){if(t<=1){let t=Array(e.length).fill(0);for(let n=0;n<e.length;n++)e[n]>0&&(t[n]=1);return{codeLengths:t,maxLen:1,minLen:1}}let r=[];for(let t=0;t<e.length;t++)e[t]>0&&r.push({freq:e[t],symbol:t,left:null,right:null});if(r.length===0)return{codeLengths:Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let t=Array(e.length).fill(0);return t[r[0].symbol]=1,{codeLengths:t,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((e,t)=>e.freq-t.freq);let e=r.shift(),t=r.shift();r.push({freq:e.freq+t.freq,symbol:-1,left:e,right:t})}let i=Array(e.length).fill(0);function a(e,t){if(!e.left&&!e.right){i[e.symbol]=t;return}e.left&&a(e.left,t+1),e.right&&a(e.right,t+1)}a(r[0],0);let o=!0;for(;o;){o=!1;for(let e=0;e<i.length;e++)i[e]>n&&(i[e]=n,o=!0);if(o){let e=0;for(let t=0;t<i.length;t++)i[t]>0&&(e+=1/(1<<i[t]));if(e>1)for(let t=1;t<n&&e>1;t++)for(let n=0;n<i.length&&e>1;n++)i[n]===t&&(i[n]++,e-=1/(1<<t)-1/(1<<t+1));o=!1;for(let e=0;e<i.length;e++)if(i[e]>n){o=!0;break}}}let s=n,c=0;for(let e=0;e<i.length;e++)i[e]>0&&(i[e]<s&&(s=i[e]),i[e]>c&&(c=i[e]));return{codeLengths:i,maxLen:c,minLen:s}}function Te(e,t){let n=Array(t).fill(0),r=e.slice(0,t),i=Math.max(...r,0),a=Array(i+1).fill(0);for(let e=0;e<t;e++)r[e]>0&&a[r[e]]++;let o=Array(i+1).fill(0),s=0;for(let e=1;e<=i;e++)s=s+a[e-1]<<1,o[e]=s;for(let e=0;e<t;e++)r[e]>0&&(n[e]=o[r[e]]++);return{codes:n,lengths:r}}function Ee(e,t,n){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,n),e.writeBit(0);let{transformed:r,pointer:i}=be(ye(t));e.writeBits(24,i);let a=Array(256).fill(!1);for(let e=0;e<r.length;e++)a[r[e]]=!0;let o=Array(16).fill(!1);for(let e=0;e<16;e++)for(let t=0;t<16;t++)if(a[e*16+t]){o[e]=!0;break}for(let t=0;t<16;t++)e.writeBit(o[t]?1:0);for(let t=0;t<16;t++)if(o[t])for(let n=0;n<16;n++)e.writeBit(a[t*16+n]?1:0);let s=0;for(let e=0;e<256;e++)a[e]&&s++;let{encoded:c,length:l}=Se(r,a),{symbols:u,length:d}=Ce(c,l,s),f=s+2,p=Math.ceil(d/50),m;m=d<200?2:d<600?3:d<1200?4:d<2400?5:6,m>p&&(m=Math.max(2,p));let h=[];for(let e=0;e<m;e++)h.push(Array(f).fill(0));let g=new Int32Array(p);for(let e=0;e<p;e++)g[e]=e%m;for(let e=0;e<p;e++){let t=e*50,n=Math.min(t+50,d),r=g[e];for(let e=t;e<n;e++)h[r][u[e]]++}function _(e){for(let t=0;t<f;t++)e[t]<1&&(e[t]=1)}let v=[];for(let e=0;e<m;e++)_(h[e]),v.push(we(h[e],f,20));for(let e=0;e<4;e++){for(let e=0;e<m;e++)h[e].fill(0);for(let e=0;e<p;e++){let t=e*50,n=Math.min(t+50,d),r=0,i=1/0;for(let e=0;e<m;e++){let a=0;for(let r=t;r<n;r++)a+=v[e].codeLengths[u[r]]||20;a<i&&(i=a,r=e)}g[e]=r;for(let e=t;e<n;e++)h[r][u[e]]++}for(let e=0;e<m;e++)_(h[e]),v[e]=we(h[e],f,20)}e.writeBits(3,m),e.writeBits(15,p);let y=[],b=[];for(let e=0;e<m;e++)b.push(e);for(let e=0;e<p;e++){let t=g[e],n=0;for(;b[n]!==t;)n++;if(y.push(n),n>0){let e=b[n];for(let e=n;e>0;e--)b[e]=b[e-1];b[0]=e}}for(let t=0;t<p;t++){for(let n=0;n<y[t];n++)e.writeBit(1);e.writeBit(0)}for(let t=0;t<m;t++){let n=v[t].codeLengths,r=n[0];e.writeBits(5,r);for(let t=0;t<f;t++){let i=n[t];for(;r<i;)e.writeBit(1),e.writeBit(0),r++;for(;r>i;)e.writeBit(1),e.writeBit(1),r--;e.writeBit(0)}}for(let e=0;e<m;e++){let{codes:t,lengths:n}=Te(v[e].codeLengths,f);v[e]=Object.assign(v[e],{_codes:t,_lengths:n})}let x=0,S=0;for(let t=0;t<d;t++){(S===0||S>=50)&&(t>0&&x++,S=0);let n=v[g[x]],r=u[t],i=n._lengths[r],a=n._codes[r];i>0&&e.writeBits(i,a),S++}}var De=10*1024*1024;function Oe(e,t=9,n=De){if(t<1||t>9)throw Error(`Block size level must be 1-9`);if(e.length>n)throw Error(`Input too large for bzip2 compression (${e.length} bytes, max ${n})`);let r=t*1e5,i=new ve;i.writeBits(8,66),i.writeBits(8,90),i.writeBits(8,104),i.writeBits(8,48+t);let a=0,o=0;for(;o<e.length;){let t=Math.min(o+r,e.length),n=e.subarray(o,t),s=4294967295;for(let e=0;e<n.length;e++)s=_e(s,n[e]);s=~s>>>0,a=(a<<1|a>>>31)>>>0,a=(a^s)>>>0,Ee(i,n,s),o=t}return i.writeBits(24,1536581),i.writeBits(24,3690640),i.writeBits(32,a),i.finish()}var G=null,K=null;async function ke(){if(G)return G;if(K)throw K;try{return G=await r.runTrustedAsync(()=>import(`./lzma-0LJzVZpl.mjs`)),G}catch{throw K=Error(`xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies.`),K}}var q=null,J=null;async function Ae(){if(q)return q;if(J)throw J;try{return q=await r.runTrustedAsync(()=>import(`./lib-Dl2j2VNl.mjs`).then(t=>e(t.default,1))),q}catch{throw J=Error(`zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd`),J}}var Y=100*1024*1024,je=512,Me=1e4;function Ne(e){let t=`file`;e.isDirectory?t=`directory`:e.isSymlink&&(t=`symlink`);let n=e.name;e.isDirectory&&!n.endsWith(`/`)&&(n+=`/`);let r;e.content!==void 0&&(r=typeof e.content==`string`?new TextEncoder().encode(e.content):e.content);let i=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:n,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:r}}async function X(e){return me(e.map(Ne))}async function Pe(e){let t=await X(e),n=new ReadableStream({start(e){e.enqueue(t),e.close()}}).pipeThrough(ce()).getReader(),r=[];for(;;){let{done:e,value:t}=await n.read();if(e)break;r.push(t)}let i=r.reduce((e,t)=>e+t.length,0),a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return a}async function Z(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};if(e.length<je||e.length%je!==0)return{entries:[],error:`Invalid tar archive format`};try{let t=await he(e),n=[];for(let e of t){if(n.length>=Me)return{entries:n,error:`Too many entries (max ${Me})`};let t=`file`;switch(e.header.type){case`directory`:t=`directory`;break;case`symlink`:t=`symlink`;break;case`link`:t=`hardlink`;break;case`file`:t=`file`;break;default:t=`other`}n.push({name:e.header.name,mode:e.header.mode??420,uid:e.header.uid??0,gid:e.header.gid??0,size:e.header.size,mtime:e.header.mtime??new Date,type:t,linkTarget:e.header.linkname||void 0,content:e.data??new Uint8Array})}return{entries:n}}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}async function Fe(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=new ReadableStream({start(t){t.enqueue(e),t.close()}}).pipeThrough(le()).getReader(),n=[],r=0;for(;;){let{done:e,value:i}=await t.read();if(e)break;if(r+=i.length,r>Y)return await t.cancel(),{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`};n.push(i)}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;return Z(i)}catch(e){return{entries:[],error:`Decompression failed: ${e instanceof Error?e.message:`Unknown error`}`}}}function Ie(e){return e.length>=2&&e[0]===31&&e[1]===139}function Le(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function Re(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 ze(e){let t=f.default.decode(Buffer.from(e));return new Uint8Array(t)}async function Be(e){return Oe(e,9)}async function Ve(e){let t=(await ke()).unxzSync(Buffer.from(e));return new Uint8Array(t)}async function He(e){let t=(await ke()).xzSync(Buffer.from(e));return new Uint8Array(t)}async function Ue(e){return Be(await X(e))}async function We(e,t){if(!t?.allowNativeCodecs)throw Error(`xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.`);return He(await X(e))}async function Ge(e){if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await ze(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}async function Ke(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:`xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction.`};if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await Ve(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}function qe(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Je(e){let t=await(await Ae()).compress(Buffer.from(e),3);return new Uint8Array(t)}async function Ye(e){let t=await(await Ae()).decompress(Buffer.from(e));return new Uint8Array(t)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw Error(`zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.`);return Je(await X(e))}async function Ze(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:`zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction.`};if(e.length>Y)return{entries:[],error:`Archive too large (max ${Y} bytes)`};try{let t=await Ye(e);return t.length>Y?{entries:[],error:`Decompressed archive too large (max ${Y} bytes)`}:Z(t)}catch(e){return{entries:[],error:e instanceof Error?e.message:`Unknown error`}}}function Qe(e){let t={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=[],r=0;for(;r<e.length;){let a=e[r];if(a.startsWith(`-`)&&!a.startsWith(`--`)&&a.length>2){if(/^-\d+$/.test(a)){n.push(a),r++;continue}for(let n=1;n<a.length;n++){let o=a[n];switch(o){case`c`:t.create=!0;break;case`r`:t.append=!0;break;case`u`:t.update=!0;break;case`x`:t.extract=!0;break;case`t`:t.list=!0;break;case`a`:t.autoCompress=!0;break;case`z`:t.gzip=!0;break;case`j`:t.bzip2=!0;break;case`J`:t.xz=!0;break;case`v`:t.verbose=!0;break;case`O`:t.toStdout=!0;break;case`k`:t.keepOldFiles=!0;break;case`m`:t.touch=!0;break;case`p`:t.preserve=!0;break;case`P`:t.absoluteNames=!0;break;case`f`:if(n<a.length-1)t.file=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'f'
3
+ `,exitCode:2}};t.file=e[r]}break;case`C`:if(n<a.length-1)t.directory=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'C'
4
+ `,exitCode:2}};t.directory=e[r]}break;case`T`:if(n<a.length-1)t.filesFrom=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'T'
5
+ `,exitCode:2}};t.filesFrom=e[r]}break;case`X`:if(n<a.length-1)t.excludeFrom=a.substring(n+1),n=a.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'X'
6
+ `,exitCode:2}};t.excludeFrom=e[r]}break;default:return{ok:!1,error:i(`tar`,`-${o}`)}}}r++;continue}if(a===`-c`||a===`--create`)t.create=!0;else if(a===`-r`||a===`--append`)t.append=!0;else if(a===`-u`||a===`--update`)t.update=!0;else if(a===`-x`||a===`--extract`||a===`--get`)t.extract=!0;else if(a===`-t`||a===`--list`)t.list=!0;else if(a===`-a`||a===`--auto-compress`)t.autoCompress=!0;else if(a===`-z`||a===`--gzip`||a===`--gunzip`)t.gzip=!0;else if(a===`-j`||a===`--bzip2`)t.bzip2=!0;else if(a===`-J`||a===`--xz`)t.xz=!0;else if(a===`--zstd`)t.zstd=!0;else if(a===`-v`||a===`--verbose`)t.verbose=!0;else if(a===`-O`||a===`--to-stdout`)t.toStdout=!0;else if(a===`-k`||a===`--keep-old-files`)t.keepOldFiles=!0;else if(a===`-m`||a===`--touch`)t.touch=!0;else if(a===`--wildcards`)t.wildcards=!0;else if(a===`-p`||a===`--preserve`||a===`--preserve-permissions`)t.preserve=!0;else if(a===`-P`||a===`--absolute-names`)t.absoluteNames=!0;else if(a===`-f`||a===`--file`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'f'
7
+ `,exitCode:2}};t.file=e[r]}else if(a.startsWith(`--file=`))t.file=a.substring(7);else if(a===`-C`||a===`--directory`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'C'
8
+ `,exitCode:2}};t.directory=e[r]}else if(a.startsWith(`--directory=`))t.directory=a.substring(12);else if(a.startsWith(`--strip-components=`)||a.startsWith(`--strip=`)){let e=a.includes(`--strip-components=`)?a.substring(19):a.substring(8),n=parseInt(e,10);if(Number.isNaN(n)||n<0)return{ok:!1,error:{stdout:``,stderr:`tar: invalid number for --strip: '${e}'
9
+ `,exitCode:2}};t.strip=n}else if(a.startsWith(`--exclude=`))t.exclude.push(a.substring(10));else if(a===`--exclude`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option '--exclude' requires an argument
10
+ `,exitCode:2}};t.exclude.push(e[r])}else if(a===`-T`||a===`--files-from`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'T'
11
+ `,exitCode:2}};t.filesFrom=e[r]}else if(a.startsWith(`--files-from=`))t.filesFrom=a.substring(13);else if(a===`-X`||a===`--exclude-from`){if(r++,r>=e.length)return{ok:!1,error:{stdout:``,stderr:`tar: option requires an argument -- 'X'
12
+ `,exitCode:2}};t.excludeFrom=e[r]}else if(a.startsWith(`--exclude-from=`))t.excludeFrom=a.substring(15);else if(a===`--`){n.push(...e.slice(r+1));break}else{if(a.startsWith(`-`))return{ok:!1,error:i(`tar`,a)};n.push(a)}r++}return{ok:!0,options:t,files:n}}var $e=100,et={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 tt(e,t){let r=e.includes(`/`)?e.substring(e.lastIndexOf(`/`)+1):e;for(let i of t){let t=i.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`<<<GLOBSTAR>>>`).replace(/\*/g,`[^/]*`).replace(/<<<GLOBSTAR>>>/g,`.*`).replace(/\?/g,`.`);if(n(`^${t}$`).test(e)||n(`^${t}/`).test(e)||!i.includes(`/`)&&n(`^${t}$`).test(r))return!0}return!1}function Q(e,t){let r=t.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`<<<GLOBSTAR>>>`).replace(/\*/g,`[^/]*`).replace(/<<<GLOBSTAR>>>/g,`.*`).replace(/\?/g,`.`),i=e.includes(`/`)?e.substring(e.lastIndexOf(`/`)+1):e;return n(`^${r}$`).test(e)||n(`^${r}$`).test(i)}function nt(e,t){if(t<=0)return e;let n=e.split(`/`).filter(e=>e!==``);return n.length<=t?``:n.slice(t).join(`/`)}function rt(e){return e.split(`/`).some(e=>e===`..`)}function it(e,t){if(t)return{safePath:e};let n=e.replace(/^\/+/,``);return n.length===0?{safePath:``}:rt(n)?{error:`Path contains '..'`}:{safePath:n}}function at(e){return`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][e.getMonth()]} ${e.getDate().toString().padStart(2,` `)} ${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`}async function $(e,t,n,r){let i=[],a=[],o=e.fs.resolvePath(t,n);try{let s=await e.fs.stat(o);if(tt(n,r))return{entries:i,errors:a};if(s.isDirectory){i.push({name:n,isDirectory:!0,mode:s.mode,mtime:s.mtime});let c=await e.fs.readdir(o);for(let o=0;o<c.length;o+=$e){let s=c.slice(o,o+$e),l=await Promise.all(s.map(i=>$(e,t,n?`${n}/${i}`:i,r)));for(let e of l)i.push(...e.entries),a.push(...e.errors)}}else if(s.isFile){let t=await e.fs.readFileBuffer(o);i.push({name:n,content:t,mode:s.mode,mtime:s.mtime})}else if(s.isSymbolicLink){let t=await e.fs.readlink(o);i.push({name:n,isSymlink:!0,linkTarget:t,mode:s.mode,mtime:s.mtime})}}catch(e){let t=e instanceof Error?e.message:`unknown error`;a.push(`tar: ${n}: ${t}`)}return{entries:i,errors:a}}async function ot(e,t,n){if(n.length===0)return{stdout:``,stderr:`tar: Cowardly refusing to create an empty archive
13
+ `,exitCode:2};let r=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,i=[],a=[],o=``;for(let s of n){let{entries:n,errors:c}=await $(e,r,s,t.exclude);if(i.push(...n),a.push(...c),t.verbose)for(let e of n)o+=`${e.name}${e.isDirectory?`/`:``}
14
+ `}if(i.length===0&&a.length>0)return{stdout:``,stderr:`${a.join(`
15
+ `)}
16
+ `,exitCode:2};let s;try{s=t.gzip?await Pe(i):t.bzip2?await Ue(i):t.xz?await We(i):t.zstd?await Xe(i):await X(i)}catch(e){return{stdout:``,stderr:`tar: error creating archive: ${e instanceof Error?e.message:`unknown error`}
17
+ `,exitCode:2}}let c=``;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(n,s)}catch(e){let n=e instanceof Error?e.message:`unknown error`;return{stdout:``,stderr:`tar: ${t.file}: ${n}
18
+ `,exitCode:2}}}else c=Buffer.from(s).toString(`latin1`);let l=o;return a.length>0&&(l+=`${a.join(`
19
+ `)}
20
+ `),{stdout:c,stderr:l,exitCode:a.length>0?2:0}}async function st(e,t,n){if(!t.file||t.file===`-`)return{stdout:``,stderr:`tar: Cannot append to stdin/stdout
21
+ `,exitCode:2};if(n.length===0)return{stdout:``,stderr:`tar: Cowardly refusing to append nothing to archive
22
+ `,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),i;try{i=await e.fs.readFileBuffer(r)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
23
+ `,exitCode:2}}let a=await Z(i);if(a.error)return{stdout:``,stderr:`tar: ${a.error}
24
+ `,exitCode:2};let o=a.entries.map(e=>({name:e.name,content:e.content,mode:e.mode,mtime:e.mtime,isDirectory:e.type===`directory`,isSymlink:e.type===`symlink`,linkTarget:e.linkTarget,uid:e.uid,gid:e.gid})),s=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],u=``;for(let r of n){let{entries:n,errors:i}=await $(e,s,r,t.exclude);if(c.push(...n),l.push(...i),t.verbose)for(let e of n)u+=`${e.name}${e.isDirectory?`/`:``}
25
+ `}let d=[...o,...c],f;try{f=await X(d)}catch(e){return{stdout:``,stderr:`tar: error creating archive: ${e instanceof Error?e.message:`unknown error`}
26
+ `,exitCode:2}}try{await e.fs.writeFile(r,f)}catch(e){let n=e instanceof Error?e.message:`unknown error`;return{stdout:``,stderr:`tar: ${t.file}: ${n}
27
+ `,exitCode:2}}let p=u;return l.length>0&&(p+=`${l.join(`
28
+ `)}
29
+ `),{stdout:``,stderr:p,exitCode:l.length>0?2:0}}async function ct(e,t,n){if(!t.file||t.file===`-`)return{stdout:``,stderr:`tar: Cannot update stdin/stdout
30
+ `,exitCode:2};if(n.length===0)return{stdout:``,stderr:`tar: Cowardly refusing to update with nothing
31
+ `,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),i;try{i=await e.fs.readFileBuffer(r)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
32
+ `,exitCode:2}}let a=await Z(i);if(a.error)return{stdout:``,stderr:`tar: ${a.error}
33
+ `,exitCode:2};let o=new Map;for(let e of a.entries)o.set(e.name,e.mtime);let s=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],u=``;for(let r of n){let{entries:n,errors:i}=await $(e,s,r,t.exclude);l.push(...i);for(let e of n){let n=o.get(e.name);(!n||e.mtime&&e.mtime.getTime()>n.getTime())&&(c.push(e),t.verbose&&(u+=`${e.name}${e.isDirectory?`/`:``}
34
+ `))}}if(c.length===0){let e=``;return l.length>0&&(e=`${l.join(`
35
+ `)}
36
+ `),{stdout:``,stderr:e,exitCode:l.length>0?2:0}}let d=new Set(c.map(e=>e.name)),f=[...a.entries.filter(e=>!d.has(e.name)).map(e=>({name:e.name,content:e.content,mode:e.mode,mtime:e.mtime,isDirectory:e.type===`directory`,isSymlink:e.type===`symlink`,linkTarget:e.linkTarget,uid:e.uid,gid:e.gid})),...c],p;try{p=await X(f)}catch(e){return{stdout:``,stderr:`tar: error creating archive: ${e instanceof Error?e.message:`unknown error`}
37
+ `,exitCode:2}}try{await e.fs.writeFile(r,p)}catch(e){let n=e instanceof Error?e.message:`unknown error`;return{stdout:``,stderr:`tar: ${t.file}: ${n}
38
+ `,exitCode:2}}let m=u;return l.length>0&&(m+=`${l.join(`
39
+ `)}
40
+ `),{stdout:``,stderr:m,exitCode:l.length>0?2:0}}async function lt(e,t,n){let r;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
41
+ `,exitCode:2}}}else r=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));let i,a=t.gzip||Ie(r),o=t.bzip2||Le(r),s=t.xz||Re(r),c=t.zstd||qe(r);if(i=a?await Fe(r):o?await Ge(r):s?await Ke(r):c?await Ze(r):await Z(r),i.error)return{stdout:``,stderr:`tar: ${i.error}
42
+ `,exitCode:2};let l=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,u=t.absoluteNames?n:n.map(e=>e.replace(/^\/+/,``)).filter(e=>e.length>0),d=``,f=``,p=[];if(t.directory&&!t.toStdout)try{await e.fs.mkdir(l,{recursive:!0})}catch{}for(let n of i.entries){let r=nt(n.name,t.strip);if(!r)continue;let i=it(r,t.absoluteNames);if(i.error){p.push(`tar: ${r}: ${i.error}`);continue}let a=i.safePath??``;if(!a)continue;let o=a.endsWith(`/`)?a.slice(0,-1):a;if(u.length>0){let e;if(e=t.wildcards?u.some(e=>Q(a,e)||Q(o,e)||a.startsWith(`${e}/`)):u.some(e=>a===e||a.startsWith(`${e}/`)||o===e),!e)continue}if(tt(a,t.exclude))continue;let s=e.fs.resolvePath(l,a);try{if(n.type===`directory`){if(t.toStdout)continue;await e.fs.mkdir(s,{recursive:!0}),t.verbose&&(d+=`${a}
43
+ `)}else if(n.type===`file`){if(t.toStdout){f+=new TextDecoder().decode(n.content),t.verbose&&(d+=`${a}
44
+ `);continue}if(t.keepOldFiles)try{await e.fs.stat(s),t.verbose&&(d+=`${a}: not overwritten, file exists
45
+ `);continue}catch{}let r=s.substring(0,s.lastIndexOf(`/`));if(r)try{await e.fs.mkdir(r,{recursive:!0})}catch{}if(await e.fs.writeFile(s,n.content),t.preserve&&n.mode)try{await e.fs.chmod(s,n.mode)}catch{}t.verbose&&(d+=`${a}
46
+ `)}else if(n.type===`symlink`&&n.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(n.linkTarget.startsWith(`/`)||rt(n.linkTarget))){p.push(`tar: ${a}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(s),t.verbose&&(d+=`${a}: not overwritten, file exists
47
+ `);continue}catch{}let r=s.substring(0,s.lastIndexOf(`/`));if(r)try{await e.fs.mkdir(r,{recursive:!0})}catch{}try{await e.fs.symlink(n.linkTarget,s)}catch{}t.verbose&&(d+=`${a}
48
+ `)}}catch(e){let t=e instanceof Error?e.message:`unknown error`;p.push(`tar: ${a}: ${t}`)}}let m=d;return p.length>0&&(m+=`${p.join(`
49
+ `)}
50
+ `),{stdout:f,stderr:m,exitCode:p.length>0?2:0}}async function ut(e,t,n){let r;if(t.file&&t.file!==`-`){let n=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(n)}catch{return{stdout:``,stderr:`tar: ${t.file}: Cannot open: No such file or directory
51
+ `,exitCode:2}}}else r=Uint8Array.from(e.stdin,e=>e.charCodeAt(0));let i,a=t.gzip||Ie(r),o=t.bzip2||Le(r),c=t.xz||Re(r),l=t.zstd||qe(r);if(i=a?await Fe(r):o?await Ge(r):c?await Ke(r):l?await Ze(r):await Z(r),i.error)return{stdout:``,stderr:`tar: ${i.error}
52
+ `,exitCode:2};let u=``;for(let e of i.entries){let r=nt(e.name,t.strip);if(!r)continue;let i=r.endsWith(`/`)?r.slice(0,-1):r;if(n.length>0){let e;if(e=t.wildcards?n.some(e=>Q(r,e)||Q(i,e)||r.startsWith(`${e}/`)):n.some(e=>r===e||r.startsWith(`${e}/`)||i===e),!e)continue}if(!tt(r,t.exclude))if(t.verbose){let t=e.type===`directory`,n=s(e.mode,t),i=`${e.uid}/${e.gid}`,a=e.size.toString().padStart(8,` `),o=at(e.mtime),c=`${n} ${i.padEnd(10)} ${a} ${o} ${r}`;e.type===`symlink`&&e.linkTarget&&(c+=` -> ${e.linkTarget}`),u+=`${c}
53
+ `}else u+=`${r}
54
+ `}return{stdout:u,stderr:``,exitCode:0}}var dt={name:`tar`,async execute(e,t){if(o(e))return a(et);let n=Qe(e);if(!n.ok)return n.error;let{options:r,files:i}=n,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:``,stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
55
+ `,exitCode:2};if(s>1)return{stdout:``,stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
56
+ `,exitCode:2};if(r.autoCompress&&r.file&&r.create){let e=r.file.toLowerCase();e.endsWith(`.tar.gz`)||e.endsWith(`.tgz`)?r.gzip=!0:e.endsWith(`.tar.bz2`)||e.endsWith(`.tbz2`)?r.bzip2=!0:e.endsWith(`.tar.xz`)||e.endsWith(`.txz`)?r.xz=!0:(e.endsWith(`.tar.zst`)||e.endsWith(`.tzst`))&&(r.zstd=!0)}let c=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(c>1)return{stdout:``,stderr:`tar: You may not specify more than one compression option
57
+ `,exitCode:2};if((r.append||r.update)&&c>0)return{stdout:``,stderr:`tar: Cannot append/update compressed archives - decompress first
58
+ `,exitCode:2};let l=i;if(r.filesFrom){let e=t.fs.resolvePath(t.cwd,r.filesFrom);try{let n=(await t.fs.readFile(e)).split(`
59
+ `).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`));l=[...i,...n]}catch{return{stdout:``,stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory
60
+ `,exitCode:2}}}if(r.excludeFrom){let e=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let n=(await t.fs.readFile(e)).split(`
61
+ `).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`));r.exclude.push(...n)}catch{return{stdout:``,stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory
62
+ `,exitCode:2}}}return r.create?ot(t,r,l):r.append?st(t,r,l):r.update?ct(t,r,l):r.extract?lt(t,r,l):ut(t,r,l)}},ft={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{dt as n,ft as t};
63
+ //# sourceMappingURL=chunk-BRGMQKJV-CdrkqzRA.mjs.map
@@ -0,0 +1,24 @@
1
+ import{a as e,r as t,t as n}from"./chunk-DXB73IDG-C774okS0.mjs";import{n as r,r as i,t as a}from"./chunk-74CEPOFO-D1bzz49u.mjs";import{open as o}from"node:fs/promises";var s=t(e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(p?-1:1)*(1/0);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}}),c=t((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}}),l=t((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=i,n.enabled=s,n.humanize=c(),n.destroy=u,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(typeof t>`u`?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function l(e){return e instanceof Error?e.stack||e.message:e}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n}),u=t((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=l()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}}),d=t((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}}),f=t((e,t)=>{var r=n(`os`),i=n(`tty`),a=d(),{env:o}=process,s;a(`no-color`)||a(`no-colors`)||a(`color=false`)||a(`color=never`)?s=0:(a(`color`)||a(`colors`)||a(`color=true`)||a(`color=always`))&&(s=1),`FORCE_COLOR`in o&&(s=o.FORCE_COLOR===`true`?1:o.FORCE_COLOR===`false`?0:o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3));function c(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(s===0)return 0;if(a(`color=16m`)||a(`color=full`)||a(`color=truecolor`))return 3;if(a(`color=256`))return 2;if(e&&!t&&s===void 0)return 0;let n=s||0;if(o.TERM===`dumb`)return n;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in o)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in o)||o.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if(o.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in o){let e=parseInt((o.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(o.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||`COLORTERM`in o?1:n}function u(e){return c(l(e,e&&e.isTTY))}t.exports={supportsColor:u,stdout:c(l(!0,i.isatty(1))),stderr:c(l(!0,i.isatty(2)))}}),p=t((e,t)=>{var r=n(`tty`),i=n(`util`);e.init=p,e.log=c,e.formatArgs=o,e.save=u,e.load=d,e.useColors=a,e.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=f();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function a(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:r.isatty(process.stderr.fd)}function o(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \x1B[0m`;e[0]=a+e[0].split(`
2
+ `).join(`
3
+ `+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+n+` `+e[0]}function s(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function c(...t){return process.stderr.write(i.formatWithOptions(e.inspectOpts,...t)+`
4
+ `)}function u(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function d(){return process.env.DEBUG}function p(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=l()(e);var{formatters:m}=t.exports;m.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split(`
5
+ `).map(e=>e.trim()).join(` `)},m.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}),m=t((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=u():t.exports=p()}),h=`End-Of-Stream`,g=class extends Error{constructor(){super(h),this.name=`EndOfStreamError`}},_=class extends Error{constructor(e=`The operation was aborted`){super(e),this.name=`AbortError`}},v=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){let n=await this.read(e,t);return this.peekQueue.push(e.subarray(0,n)),n}async read(e,t=!1){if(e.length===0)return 0;let n=this.readFromPeekBuffer(e);if(this.endOfStream||(n+=await this.readRemainderFromStream(e.subarray(n),t)),n===0&&!t)throw new g;return n}readFromPeekBuffer(e){let t=e.length,n=0;for(;this.peekQueue.length>0&&t>0;){let r=this.peekQueue.pop();if(!r)throw Error(`peekData should be defined`);let i=Math.min(r.length,t);e.set(r.subarray(0,i),n),n+=i,t-=i,i<r.length&&this.peekQueue.push(r.subarray(i))}return n}async readRemainderFromStream(e,t){let n=0;for(;n<e.length&&!this.endOfStream;){if(this.interrupted)throw new _;let r=await this.readFromStream(e.subarray(n),t);if(r===0)break;n+=r}if(!t&&n<e.length)throw new g;return n}},y=class extends v{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}},ee=class extends y{async readFromStream(e,t){if(e.length===0)return 0;let n=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return n.done&&(this.endOfStream=n.done),n.value?(e.set(n.value),n.value.length):0}},b=class extends v{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){let n=Math.min(t.length,e.length);return e.set(t.subarray(0,n)),n<t.length?this.buffer=t.subarray(n):this.buffer=null,n}async readFromStream(e,t){if(e.length===0)return 0;let n=0;for(this.buffer&&(n+=this.writeChunk(e,this.buffer));n<e.length&&!this.endOfStream;){let t=await this.reader.read();if(t.done){this.endOfStream=!0;break}t.value&&(n+=this.writeChunk(e.subarray(n),t.value))}if(!t&&n===0&&this.endOfStream)throw new g;return n}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}};function x(e){try{let t=e.getReader({mode:`byob`});return t instanceof ReadableStreamDefaultReader?new b(t):new ee(t)}catch(t){if(t instanceof TypeError)return new b(e.getReader());throw t}}var S=class{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener(`abort`,()=>{this.abort()})}async readToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new g;return e.get(n,0)}async peekToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new g;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new g;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new g;return e.get(this.numBuffer,0)}async ignore(e){if(this.fileInfo.size!==void 0){let t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position<this.position)throw Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}},C=256e3,w=class extends S{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){let n=this.normalizeOptions(e,t),r=n.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw Error("`options.position` must be equal or greater than `tokenizer.position`");if(n.length===0)return 0;let i=await this.streamReader.read(e.subarray(0,n.length),n.mayBeLess);if(this.position+=i,(!t||!t.mayBeLess)&&i<n.length)throw new g;return i}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=0;if(n.position){let t=n.position-this.position;if(t>0){let i=new Uint8Array(n.length+t);return r=await this.peekBuffer(i,{mayBeLess:n.mayBeLess}),e.set(i.subarray(t)),r-t}if(t<0)throw Error(`Cannot peek from a negative offset in a stream`)}if(n.length>0){try{r=await this.streamReader.peek(e.subarray(0,n.length),n.mayBeLess)}catch(e){if(t?.mayBeLess&&e instanceof g)return 0;throw e}if(!n.mayBeLess&&r<n.length)throw new g}return r}async ignore(e){let t=Math.min(C,e),n=new Uint8Array(t),r=0;for(;r<e;){let i=e-r,a=await this.readBuffer(n,{length:Math.min(t,i)});if(a<0)return a;r+=a}return r}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}},T=class extends S{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){t?.position&&(this.position=t.position);let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new g;return e.set(this.uint8Array.subarray(n.position,n.position+r)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}},E=class extends S{constructor(e,t){super(t),this.blob=e,this.fileInfo={...t?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,t){t?.position&&(this.position=t.position);let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=Math.min(this.blob.size-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new g;let i=await this.blob.slice(n.position,n.position+r).arrayBuffer();return e.set(new Uint8Array(i)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}};function D(e,t){let n=x(e),r=t??{},i=r.onClose;return r.onClose=async()=>{if(await n.close(),i)return i()},new w(n,r)}function te(e,t){return new T(e,t)}function ne(e,t){return new E(e,t)}(class e extends S{static async fromFile(t){let n=await o(t,`r`);return new e(n,{fileInfo:{path:t,size:(await n.stat()).size}})}constructor(e,t){super(t),this.fileHandle=e,this.fileInfo=t.fileInfo}async readBuffer(e,t){let n=this.normalizeOptions(e,t);if(this.position=n.position,n.length===0)return 0;let r=await this.fileHandle.read(e,0,n.length,n.position);if(this.position+=r.bytesRead,r.bytesRead<n.length&&(!t||!t.mayBeLess))throw new g;return r.bytesRead}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=await this.fileHandle.read(e,0,n.length,n.position);if(!n.mayBeLess&&r.bytesRead<n.length)throw new g;return r.bytesRead}async close(){return await this.fileHandle.close(),super.close()}setPosition(e){this.position=e}supportsRandomAccess(){return!0}}).fromFile,e(s(),1);var O={128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`},re={};for(let[e,t]of Object.entries(O))re[t]=Number.parseInt(e);function ie(e,t=`utf-8`){switch(t.toLowerCase()){case`utf-8`:case`utf8`:return typeof globalThis.TextDecoder<`u`?new globalThis.TextDecoder(`utf-8`).decode(e):ae(e);case`utf-16le`:return oe(e);case`ascii`:return se(e);case`latin1`:case`iso-8859-1`:return ce(e);case`windows-1252`:return k(e);default:throw RangeError(`Encoding '${t}' not supported`)}}function ae(e){let t=``,n=0;for(;n<e.length;){let r=e[n++];if(r<128)t+=String.fromCharCode(r);else if(r<224){let i=e[n++]&63;t+=String.fromCharCode((r&31)<<6|i)}else if(r<240){let i=e[n++]&63,a=e[n++]&63;t+=String.fromCharCode((r&15)<<12|i<<6|a)}else{let i=e[n++]&63,a=e[n++]&63,o=e[n++]&63,s=(r&7)<<18|i<<12|a<<6|o;s-=65536,t+=String.fromCharCode(55296+(s>>10&1023),56320+(s&1023))}}return t}function oe(e){let t=``;for(let n=0;n<e.length;n+=2)t+=String.fromCharCode(e[n]|e[n+1]<<8);return t}function se(e){return String.fromCharCode(...e.map(e=>e&127))}function ce(e){return String.fromCharCode(...e)}function k(e){let t=``;for(let n of e)n>=128&&n<=159&&O[n]?t+=O[n]:t+=String.fromCharCode(n);return t}function A(e){return new DataView(e.buffer,e.byteOffset)}var j={len:1,get(e,t){return A(e).getUint8(t)},put(e,t,n){return A(e).setUint8(t,n),t+1}},M={len:2,get(e,t){return A(e).getUint16(t,!0)},put(e,t,n){return A(e).setUint16(t,n,!0),t+2}},N={len:2,get(e,t){return A(e).getUint16(t)},put(e,t,n){return A(e).setUint16(t,n),t+2}},P={len:4,get(e,t){return A(e).getUint32(t,!0)},put(e,t,n){return A(e).setUint32(t,n,!0),t+4}},F={len:4,get(e,t){return A(e).getUint32(t)},put(e,t,n){return A(e).setUint32(t,n),t+4}},I={len:4,get(e,t){return A(e).getInt32(t)},put(e,t,n){return A(e).setInt32(t,n),t+4}},L={len:8,get(e,t){return A(e).getBigUint64(t,!0)},put(e,t,n){return A(e).setBigUint64(t,n,!0),t+8}},R=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){return ie(e.subarray(t,t+this.len),this.encoding)}},z=e(m(),1),B={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},V={get(e){return{signature:P.get(e,0),compressedSize:P.get(e,8),uncompressedSize:P.get(e,12)}},len:16},H={get(e){let t=M.get(e,6);return{signature:P.get(e,0),minVersion:M.get(e,4),dataDescriptor:!!(t&8),compressedMethod:M.get(e,8),compressedSize:P.get(e,18),uncompressedSize:P.get(e,22),filenameLength:M.get(e,26),extraFieldLength:M.get(e,28),filename:null}},len:30},U={get(e){return{signature:P.get(e,0),nrOfThisDisk:M.get(e,4),nrOfThisDiskWithTheStart:M.get(e,6),nrOfEntriesOnThisDisk:M.get(e,8),nrOfEntriesOfSize:M.get(e,10),sizeOfCd:P.get(e,12),offsetOfStartOfCd:P.get(e,16),zipFileCommentLength:M.get(e,20)}},len:22},W={get(e){let t=M.get(e,8);return{signature:P.get(e,0),minVersion:M.get(e,6),dataDescriptor:!!(t&8),compressedMethod:M.get(e,10),compressedSize:P.get(e,20),uncompressedSize:P.get(e,24),filenameLength:M.get(e,28),extraFieldLength:M.get(e,30),fileCommentLength:M.get(e,32),relativeOffsetOfLocalHeader:P.get(e,42),filename:null}},len:46};function G(e){let t=new Uint8Array(P.len);return P.put(t,0,e),t}var K=(0,z.default)(`tokenizer:inflate`),q=256*1024,le=G(B.DataDescriptor),J=G(B.EndOfCentralDirectory),ue=class e{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(q)}async isZip(){return await this.peekSignature()===B.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(P)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),n=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(n,{position:e.fileInfo.size-t});for(let r=n.length-4;r>=0;r--)if(n[r]===J[0]&&n[r+1]===J[1]&&n[r+2]===J[2]&&n[r+3]===J[3])return e.fileInfo.size-t+r;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){K(`Cannot reading central-directory without random-read support`);return}K(`Reading central-directory...`);let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){K(`Central-directory 32-bit signature found`);let n=await this.tokenizer.readToken(U,t),r=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);for(let e=0;e<n.nrOfEntriesOfSize;++e){let t=await this.tokenizer.readToken(W);if(t.signature!==B.CentralFileHeader)throw Error(`Expected Central-File-Header signature`);t.filename=await this.tokenizer.readToken(new R(t.filenameLength,`utf-8`)),await this.tokenizer.ignore(t.extraFieldLength),await this.tokenizer.ignore(t.fileCommentLength),r.push(t),K(`Add central-directory file-entry: n=${e+1}/${r.length}: filename=${r[e].filename}`)}return this.tokenizer.setPosition(e),r}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let n=!1;do{let t=await this.readLocalFileHeader();if(!t)break;let r=e(t);n=!!r.stop;let i;if(await this.tokenizer.ignore(t.extraFieldLength),t.dataDescriptor&&t.compressedSize===0){let e=[],n=q;K(`Compressed-file-size unknown, scanning for next data-descriptor-signature....`);let i=-1;for(;i<0&&n===q;){n=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),i=de(this.syncBuffer.subarray(0,n),le);let t=i>=0?i:n;if(r.handler){let n=new Uint8Array(t);await this.tokenizer.readBuffer(n),e.push(n)}else await this.tokenizer.ignore(t)}K(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),r.handler&&await this.inflate(t,fe(e),r.handler)}else r.handler?(K(`Reading compressed-file-data: ${t.compressedSize} bytes`),i=new Uint8Array(t.compressedSize),await this.tokenizer.readBuffer(i),await this.inflate(t,i,r.handler)):(K(`Ignoring compressed-file-data: ${t.compressedSize} bytes`),await this.tokenizer.ignore(t.compressedSize));if(K(`Reading data-descriptor at pos=${this.tokenizer.position}`),t.dataDescriptor&&(await this.tokenizer.readToken(V)).signature!==134695760)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-V.len}`)}while(!n)}async iterateOverCentralDirectory(e,t){for(let n of e){let e=t(n);if(e.handler){this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);let t=await this.readLocalFileHeader();if(t){await this.tokenizer.ignore(t.extraFieldLength);let r=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(r),await this.inflate(t,r,e.handler)}}if(e.stop)break}}async inflate(t,n,r){if(t.compressedMethod===0)return r(n);if(t.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);return K(`Decompress filename=${t.filename}, compressed-size=${n.length}`),r(await e.decompressDeflateRaw(n))}static async decompressDeflateRaw(e){let t=new ReadableStream({start(t){t.enqueue(e),t.close()}}),n=new DecompressionStream(`deflate-raw`),r=t.pipeThrough(n);try{let e=await new Response(r).arrayBuffer();return new Uint8Array(e)}catch(e){let t=e instanceof Error?`Failed to deflate ZIP entry: ${e.message}`:`Unknown decompression error in ZIP entry`;throw TypeError(t)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(P);if(e===B.LocalFileHeader){let e=await this.tokenizer.readToken(H);return e.filename=await this.tokenizer.readToken(new R(e.filenameLength,`utf-8`)),e}if(e===B.CentralFileHeader)return!1;throw Error(e===3759263696?`Encrypted ZIP`:`Unexpected signature`)}};function de(e,t){let n=e.length,r=t.length;if(r>n)return-1;for(let i=0;i<=n-r;i++){let n=!0;for(let a=0;a<r;a++)if(e[i+a]!==t[a]){n=!1;break}if(n)return i}return-1}function fe(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var pe=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let n=new Uint8Array(1024),r=await e.readBuffer(n,{mayBeLess:!0});if(r===0){t.close();return}t.enqueue(n.subarray(0,r))}}).pipeThrough(new DecompressionStream(`gzip`))}};new globalThis.TextDecoder(`utf8`),new globalThis.TextEncoder,Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Y(e){let{byteLength:t}=e;if(t===6)return e.getUint16(0)*2**32+e.getUint32(2);if(t===5)return e.getUint8(0)*2**32+e.getUint32(1);if(t===4)return e.getUint32(0);if(t===3)return e.getUint8(0)*2**16+e.getUint16(1);if(t===2)return e.getUint16(0);if(t===1)return e.getUint8(0)}function me(e,t){if(t===`utf-16le`){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t.push(r&255,r>>8&255)}return t}if(t===`utf-16be`){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t.push(r>>8&255,r&255)}return t}return[...e].map(e=>e.charCodeAt(0))}function he(e,t=0){let n=Number.parseInt(new R(6).get(e,148).replace(/\0.*$/,``).trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let n=t;n<t+148;n++)r+=e[n];for(let n=t+156;n<t+512;n++)r+=e[n];return n===r}var ge={get:(e,t)=>e[t+3]&127|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},_e=`jpg,png,apng,gif,webp,flif,xcf,cr2,cr3,orf,arw,dng,nef,rw2,raf,tif,bmp,icns,jxr,psd,indd,zip,tar,rar,gz,bz2,7z,dmg,mp4,mid,mkv,webm,mov,avi,mpg,mp2,mp3,m4a,oga,ogg,ogv,opus,flac,wav,spx,amr,pdf,epub,elf,macho,exe,swf,rtf,wasm,woff,woff2,eot,ttf,otf,ttc,ico,flv,ps,xz,sqlite,nes,crx,xpi,cab,deb,ar,rpm,Z,lz,cfb,mxf,mts,blend,bpg,docx,pptx,xlsx,3gp,3g2,j2c,jp2,jpm,jpx,mj2,aif,qcp,odt,ods,odp,xml,mobi,heic,cur,ktx,ape,wv,dcm,ics,glb,pcap,dsf,lnk,alias,voc,ac3,m4v,m4p,m4b,f4v,f4p,f4b,f4a,mie,asf,ogm,ogx,mpc,arrow,shp,aac,mp1,it,s3m,xm,skp,avif,eps,lzh,pgp,asar,stl,chm,3mf,zst,jxl,vcf,jls,pst,dwg,parquet,class,arj,cpio,ace,avro,icc,fbx,vsdx,vtt,apk,drc,lz4,potx,xltx,dotx,xltm,ott,ots,otp,odg,otg,xlsm,docm,dotm,potm,pptm,jar,jmp,rm,sav,ppsm,ppsx,tar.gz,reg,dat`.split(`,`),ve=`image/jpeg,image/png,image/gif,image/webp,image/flif,image/x-xcf,image/x-canon-cr2,image/x-canon-cr3,image/tiff,image/bmp,image/vnd.ms-photo,image/vnd.adobe.photoshop,application/x-indesign,application/epub+zip,application/x-xpinstall,application/vnd.ms-powerpoint.slideshow.macroenabled.12,application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.presentation,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/zip,application/x-tar,application/x-rar-compressed,application/gzip,application/x-bzip2,application/x-7z-compressed,application/x-apple-diskimage,application/vnd.apache.arrow.file,video/mp4,audio/midi,video/matroska,video/webm,video/quicktime,video/vnd.avi,audio/wav,audio/qcelp,audio/x-ms-asf,video/x-ms-asf,application/vnd.ms-asf,video/mpeg,video/3gpp,audio/mpeg,audio/mp4,video/ogg,audio/ogg,audio/ogg; codecs=opus,application/ogg,audio/flac,audio/ape,audio/wavpack,audio/amr,application/pdf,application/x-elf,application/x-mach-binary,application/x-msdownload,application/x-shockwave-flash,application/rtf,application/wasm,font/woff,font/woff2,application/vnd.ms-fontobject,font/ttf,font/otf,font/collection,image/x-icon,video/x-flv,application/postscript,application/eps,application/x-xz,application/x-sqlite3,application/x-nintendo-nes-rom,application/x-google-chrome-extension,application/vnd.ms-cab-compressed,application/x-deb,application/x-unix-archive,application/x-rpm,application/x-compress,application/x-lzip,application/x-cfb,application/x-mie,application/mxf,video/mp2t,application/x-blender,image/bpg,image/j2c,image/jp2,image/jpx,image/jpm,image/mj2,audio/aiff,application/xml,application/x-mobipocket-ebook,image/heif,image/heif-sequence,image/heic,image/heic-sequence,image/icns,image/ktx,application/dicom,audio/x-musepack,text/calendar,text/vcard,text/vtt,model/gltf-binary,application/vnd.tcpdump.pcap,audio/x-dsf,application/x.ms.shortcut,application/x.apple.alias,audio/x-voc,audio/vnd.dolby.dd-raw,audio/x-m4a,image/apng,image/x-olympus-orf,image/x-sony-arw,image/x-adobe-dng,image/x-nikon-nef,image/x-panasonic-rw2,image/x-fujifilm-raf,video/x-m4v,video/3gpp2,application/x-esri-shape,audio/aac,audio/x-it,audio/x-s3m,audio/x-xm,video/MP1S,video/MP2P,application/vnd.sketchup.skp,image/avif,application/x-lzh-compressed,application/pgp-encrypted,application/x-asar,model/stl,application/vnd.ms-htmlhelp,model/3mf,image/jxl,application/zstd,image/jls,application/vnd.ms-outlook,image/vnd.dwg,application/vnd.apache.parquet,application/java-vm,application/x-arj,application/x-cpio,application/x-ace-compressed,application/avro,application/vnd.iccprofile,application/x.autodesk.fbx,application/vnd.visio,application/vnd.android.package-archive,application/vnd.google.draco,application/x-lz4,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vnd.ms-excel.template.macroenabled.12,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-template,application/vnd.ms-excel.sheet.macroenabled.12,application/vnd.ms-word.document.macroenabled.12,application/vnd.ms-word.template.macroenabled.12,application/vnd.ms-powerpoint.template.macroenabled.12,application/vnd.ms-powerpoint.presentation.macroenabled.12,application/java-archive,application/vnd.rn-realmedia,application/x-spss-sav,application/x-ms-regedit,application/x-ft-windows-registry-hive,application/x-jmp-data`.split(`,`),X=4100;async function ye(e,t){return new be(t).fromBuffer(e)}function Z(e){switch(e=e.toLowerCase(),e){case`application/epub+zip`:return{ext:`epub`,mime:e};case`application/vnd.oasis.opendocument.text`:return{ext:`odt`,mime:e};case`application/vnd.oasis.opendocument.text-template`:return{ext:`ott`,mime:e};case`application/vnd.oasis.opendocument.spreadsheet`:return{ext:`ods`,mime:e};case`application/vnd.oasis.opendocument.spreadsheet-template`:return{ext:`ots`,mime:e};case`application/vnd.oasis.opendocument.presentation`:return{ext:`odp`,mime:e};case`application/vnd.oasis.opendocument.presentation-template`:return{ext:`otp`,mime:e};case`application/vnd.oasis.opendocument.graphics`:return{ext:`odg`,mime:e};case`application/vnd.oasis.opendocument.graphics-template`:return{ext:`otg`,mime:e};case`application/vnd.openxmlformats-officedocument.presentationml.slideshow`:return{ext:`ppsx`,mime:e};case`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`:return{ext:`xlsx`,mime:e};case`application/vnd.ms-excel.sheet.macroenabled`:return{ext:`xlsm`,mime:`application/vnd.ms-excel.sheet.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.spreadsheetml.template`:return{ext:`xltx`,mime:e};case`application/vnd.ms-excel.template.macroenabled`:return{ext:`xltm`,mime:`application/vnd.ms-excel.template.macroenabled.12`};case`application/vnd.ms-powerpoint.slideshow.macroenabled`:return{ext:`ppsm`,mime:`application/vnd.ms-powerpoint.slideshow.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:return{ext:`docx`,mime:e};case`application/vnd.ms-word.document.macroenabled`:return{ext:`docm`,mime:`application/vnd.ms-word.document.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.wordprocessingml.template`:return{ext:`dotx`,mime:e};case`application/vnd.ms-word.template.macroenabledtemplate`:return{ext:`dotm`,mime:`application/vnd.ms-word.template.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.presentationml.template`:return{ext:`potx`,mime:e};case`application/vnd.ms-powerpoint.template.macroenabled`:return{ext:`potm`,mime:`application/vnd.ms-powerpoint.template.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.presentationml.presentation`:return{ext:`pptx`,mime:e};case`application/vnd.ms-powerpoint.presentation.macroenabled`:return{ext:`pptm`,mime:`application/vnd.ms-powerpoint.presentation.macroenabled.12`};case`application/vnd.ms-visio.drawing`:return{ext:`vsdx`,mime:`application/vnd.visio`};case`application/vnd.ms-package.3dmanufacturing-3dmodel+xml`:return{ext:`3mf`,mime:`model/3mf`};default:}}function Q(e,t,n){n={offset:0,...n};for(let[r,i]of t.entries())if(n.mask){if(i!==(n.mask[r]&e[r+n.offset]))return!1}else if(i!==e[r+n.offset])return!1;return!0}var be=class{constructor(e){this.options={mpegOffsetTolerance:0,...e},this.detectors=[...e?.customDetectors??[],{id:`core`,detect:this.detectConfident},{id:`core.imprecise`,detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:e?.signal}}async fromTokenizer(e){let t=e.position;for(let n of this.detectors){let r=await n.detect(e);if(r)return r;if(t!==e.position)return}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(te(t,this.tokenizerOptions))}async fromBlob(e){let t=ne(e,this.tokenizerOptions);try{return await this.fromTokenizer(t)}finally{await t.close()}}async fromStream(e){let t=D(e,this.tokenizerOptions);try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){let{sampleSize:n=X}=t,r,i,a=e.getReader({mode:`byob`});try{let{value:e,done:t}=await a.read(new Uint8Array(n));if(i=e,!t&&e)try{r=await this.fromBuffer(e.subarray(0,n))}catch(e){if(!(e instanceof g))throw e;r=void 0}i=e}finally{a.releaseLock()}let o=new TransformStream({async start(e){e.enqueue(i)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(o);return s.fileType=r,s}check(e,t){return Q(this.buffer,e,t)}checkString(e,t){return this.check(me(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(X),e.fileInfo.size===void 0&&(e.fileInfo.size=2**53-1),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:`bmp`,mime:`image/bmp`};if(this.check([11,119]))return{ext:`ac3`,mime:`audio/vnd.dolby.dd-raw`};if(this.check([120,1]))return{ext:`dmg`,mime:`application/x-apple-diskimage`};if(this.check([77,90]))return{ext:`exe`,mime:`application/x-msdownload`};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString(`PS-Adobe-`,{offset:2})&&this.checkString(` EPSF-`,{offset:14})?{ext:`eps`,mime:`application/eps`}:{ext:`ps`,mime:`application/postscript`};if(this.check([31,160])||this.check([31,157]))return{ext:`Z`,mime:`application/x-compress`};if(this.check([199,113]))return{ext:`cpio`,mime:`application/x-cpio`};if(this.check([96,234]))return{ext:`arj`,mime:`application/x-arj`};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.detectConfident(e);if(this.check([71,73,70]))return{ext:`gif`,mime:`image/gif`};if(this.check([73,73,188]))return{ext:`jxr`,mime:`image/vnd.ms-photo`};if(this.check([31,139,8])){let t=new pe(e).inflate(),n=!0;try{let e;try{e=await this.fromStream(t)}catch{n=!1}if(e&&e.ext===`tar`)return{ext:`tar.gz`,mime:`application/gzip`}}finally{n&&await t.cancel()}return{ext:`gz`,mime:`application/gzip`}}if(this.check([66,90,104]))return{ext:`bz2`,mime:`application/x-bzip2`};if(this.checkString(`ID3`)){await e.ignore(6);let t=await e.readToken(ge);return e.position+t>e.fileInfo.size?{ext:`mp3`,mime:`audio/mpeg`}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString(`MP+`))return{ext:`mpc`,mime:`audio/x-musepack`};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:`swf`,mime:`application/x-shockwave-flash`};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:`jls`,mime:`image/jls`}:{ext:`jpg`,mime:`image/jpeg`};if(this.check([79,98,106,1]))return{ext:`avro`,mime:`application/avro`};if(this.checkString(`FLIF`))return{ext:`flif`,mime:`image/flif`};if(this.checkString(`8BPS`))return{ext:`psd`,mime:`image/vnd.adobe.photoshop`};if(this.checkString(`MPCK`))return{ext:`mpc`,mime:`audio/x-musepack`};if(this.checkString(`FORM`))return{ext:`aif`,mime:`audio/aiff`};if(this.checkString(`icns`,{offset:0}))return{ext:`icns`,mime:`image/icns`};if(this.check([80,75,3,4])){let t;return await new ue(e).unzip(e=>{switch(e.filename){case`META-INF/mozilla.rsa`:return t={ext:`xpi`,mime:`application/x-xpinstall`},{stop:!0};case`META-INF/MANIFEST.MF`:return t={ext:`jar`,mime:`application/java-archive`},{stop:!0};case`mimetype`:return{async handler(e){t=Z(new TextDecoder(`utf-8`).decode(e).trim())},stop:!0};case`[Content_Types].xml`:return{async handler(e){let n=new TextDecoder(`utf-8`).decode(e),r=n.indexOf(`.main+xml"`);if(r===-1){let e=`application/vnd.ms-package.3dmanufacturing-3dmodel+xml`;n.includes(`ContentType="${e}"`)&&(t=Z(e))}else{n=n.slice(0,Math.max(0,r));let e=n.lastIndexOf(`"`);t=Z(n.slice(Math.max(0,e+1)))}},stop:!0};default:return/classes\d*\.dex/.test(e.filename)?(t={ext:`apk`,mime:`application/vnd.android.package-archive`},{stop:!0}):{}}}).catch(e=>{if(!(e instanceof g))throw e}),t??{ext:`zip`,mime:`application/zip`}}if(this.checkString(`OggS`)){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),Q(t,[79,112,117,115,72,101,97,100])?{ext:`opus`,mime:`audio/ogg; codecs=opus`}:Q(t,[128,116,104,101,111,114,97])?{ext:`ogv`,mime:`video/ogg`}:Q(t,[1,118,105,100,101,111,0])?{ext:`ogm`,mime:`video/ogg`}:Q(t,[127,70,76,65,67])?{ext:`oga`,mime:`audio/ogg`}:Q(t,[83,112,101,101,120,32,32])?{ext:`spx`,mime:`audio/ogg`}:Q(t,[1,118,111,114,98,105,115])?{ext:`ogg`,mime:`audio/ogg`}:{ext:`ogx`,mime:`application/ogg`}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:`zip`,mime:`application/zip`};if(this.checkString(`MThd`))return{ext:`mid`,mime:`audio/midi`};if(this.checkString(`wOFF`)&&(this.check([0,1,0,0],{offset:4})||this.checkString(`OTTO`,{offset:4})))return{ext:`woff`,mime:`font/woff`};if(this.checkString(`wOF2`)&&(this.check([0,1,0,0],{offset:4})||this.checkString(`OTTO`,{offset:4})))return{ext:`woff2`,mime:`font/woff2`};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:`pcap`,mime:`application/vnd.tcpdump.pcap`};if(this.checkString(`DSD `))return{ext:`dsf`,mime:`audio/x-dsf`};if(this.checkString(`LZIP`))return{ext:`lz`,mime:`application/x-lzip`};if(this.checkString(`fLaC`))return{ext:`flac`,mime:`audio/flac`};if(this.check([66,80,71,251]))return{ext:`bpg`,mime:`image/bpg`};if(this.checkString(`wvpk`))return{ext:`wv`,mime:`audio/wavpack`};if(this.checkString(`%PDF`))return{ext:`pdf`,mime:`application/pdf`};if(this.check([0,97,115,109]))return{ext:`wasm`,mime:`application/wasm`};if(this.check([73,73])){let e=await this.readTiffHeader(!1);if(e)return e}if(this.check([77,77])){let e=await this.readTiffHeader(!0);if(e)return e}if(this.checkString(`MAC `))return{ext:`ape`,mime:`audio/ape`};if(this.check([26,69,223,163])){async function t(){let t=await e.peekNumber(j),n=128,r=0;for(;(t&n)===0&&n!==0;)++r,n>>=1;let i=new Uint8Array(r+1);return await e.readBuffer(i),i}async function n(){let e=await t(),n=await t();n[0]^=128>>n.length-1;let r=Math.min(6,n.length),i=new DataView(e.buffer),a=new DataView(n.buffer,n.length-r,r);return{id:Y(i),len:Y(a)}}async function r(t){for(;t>0;){let r=await n();if(r.id===17026)return(await e.readToken(new R(r.len))).replaceAll(/\00.*$/g,``);await e.ignore(r.len),--t}}switch(await r((await n()).len)){case`webm`:return{ext:`webm`,mime:`video/webm`};case`matroska`:return{ext:`mkv`,mime:`video/matroska`};default:return}}if(this.checkString(`SQLi`))return{ext:`sqlite`,mime:`application/x-sqlite3`};if(this.check([78,69,83,26]))return{ext:`nes`,mime:`application/x-nintendo-nes-rom`};if(this.checkString(`Cr24`))return{ext:`crx`,mime:`application/x-google-chrome-extension`};if(this.checkString(`MSCF`)||this.checkString(`ISc(`))return{ext:`cab`,mime:`application/vnd.ms-cab-compressed`};if(this.check([237,171,238,219]))return{ext:`rpm`,mime:`application/x-rpm`};if(this.check([197,208,211,198]))return{ext:`eps`,mime:`application/eps`};if(this.check([40,181,47,253]))return{ext:`zst`,mime:`application/zstd`};if(this.check([127,69,76,70]))return{ext:`elf`,mime:`application/x-elf`};if(this.check([33,66,68,78]))return{ext:`pst`,mime:`application/vnd.ms-outlook`};if(this.checkString(`PAR1`)||this.checkString(`PARE`))return{ext:`parquet`,mime:`application/vnd.apache.parquet`};if(this.checkString(`ttcf`))return{ext:`ttc`,mime:`font/collection`};if(this.check([207,250,237,254]))return{ext:`macho`,mime:`application/x-mach-binary`};if(this.check([4,34,77,24]))return{ext:`lz4`,mime:`application/x-lz4`};if(this.checkString(`regf`))return{ext:`dat`,mime:`application/x-ft-windows-registry-hive`};if(this.checkString(`$FL2`)||this.checkString(`$FL3`))return{ext:`sav`,mime:`application/x-spss-sav`};if(this.check([79,84,84,79,0]))return{ext:`otf`,mime:`font/otf`};if(this.checkString(`#!AMR`))return{ext:`amr`,mime:`audio/amr`};if(this.checkString(`{\\rtf`))return{ext:`rtf`,mime:`application/rtf`};if(this.check([70,76,86,1]))return{ext:`flv`,mime:`video/x-flv`};if(this.checkString(`IMPM`))return{ext:`it`,mime:`audio/x-it`};if(this.checkString(`-lh0-`,{offset:2})||this.checkString(`-lh1-`,{offset:2})||this.checkString(`-lh2-`,{offset:2})||this.checkString(`-lh3-`,{offset:2})||this.checkString(`-lh4-`,{offset:2})||this.checkString(`-lh5-`,{offset:2})||this.checkString(`-lh6-`,{offset:2})||this.checkString(`-lh7-`,{offset:2})||this.checkString(`-lzs-`,{offset:2})||this.checkString(`-lz4-`,{offset:2})||this.checkString(`-lz5-`,{offset:2})||this.checkString(`-lhd-`,{offset:2}))return{ext:`lzh`,mime:`application/x-lzh-compressed`};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:`mpg`,mime:`video/MP1S`};if(this.check([68],{offset:4,mask:[196]}))return{ext:`mpg`,mime:`video/MP2P`}}if(this.checkString(`ITSF`))return{ext:`chm`,mime:`application/vnd.ms-htmlhelp`};if(this.check([202,254,186,190]))return{ext:`class`,mime:`application/java-vm`};if(this.checkString(`.RMF`))return{ext:`rm`,mime:`application/vnd.rn-realmedia`};if(this.checkString(`DRACO`))return{ext:`drc`,mime:`application/vnd.google.draco`};if(this.check([253,55,122,88,90,0]))return{ext:`xz`,mime:`application/x-xz`};if(this.checkString(`<?xml `))return{ext:`xml`,mime:`application/xml`};if(this.check([55,122,188,175,39,28]))return{ext:`7z`,mime:`application/x-7z-compressed`};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:`rar`,mime:`application/x-rar-compressed`};if(this.checkString(`solid `))return{ext:`stl`,mime:`model/stl`};if(this.checkString(`AC`)){let e=new R(4,`latin1`).get(this.buffer,2);if(e.match(`^d*`)&&e>=1e3&&e<=1050)return{ext:`dwg`,mime:`image/vnd.dwg`}}if(this.checkString(`070707`))return{ext:`cpio`,mime:`application/x-cpio`};if(this.checkString(`BLENDER`))return{ext:`blend`,mime:`application/x-blender`};if(this.checkString(`!<arch>`))return await e.ignore(8),await e.readToken(new R(13,`ascii`))===`debian-binary`?{ext:`deb`,mime:`application/x-deb`}:{ext:`ar`,mime:`application/x-unix-archive`};if(this.checkString(`WEBVTT`)&&[`
6
+ `,`\r`,` `,` `,`\0`].some(e=>this.checkString(e,{offset:6})))return{ext:`vtt`,mime:`text/vtt`};if(this.check([137,80,78,71,13,10,26,10])){await e.ignore(8);async function t(){return{length:await e.readToken(I),type:await e.readToken(new R(4,`latin1`))}}do{let n=await t();if(n.length<0)return;switch(n.type){case`IDAT`:return{ext:`png`,mime:`image/png`};case`acTL`:return{ext:`apng`,mime:`image/apng`};default:await e.ignore(n.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:`png`,mime:`image/png`}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:`arrow`,mime:`application/vnd.apache.arrow.file`};if(this.check([103,108,84,70,2,0,0,0]))return{ext:`glb`,mime:`model/gltf-binary`};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:`mov`,mime:`video/quicktime`};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:`orf`,mime:`image/x-olympus-orf`};if(this.checkString(`gimp xcf `))return{ext:`xcf`,mime:`image/x-xcf`};if(this.checkString(`ftyp`,{offset:4})&&this.buffer[8]&96){let e=new R(4,`latin1`).get(this.buffer,8).replace(`\0`,` `).trim();switch(e){case`avif`:case`avis`:return{ext:`avif`,mime:`image/avif`};case`mif1`:return{ext:`heic`,mime:`image/heif`};case`msf1`:return{ext:`heic`,mime:`image/heif-sequence`};case`heic`:case`heix`:return{ext:`heic`,mime:`image/heic`};case`hevc`:case`hevx`:return{ext:`heic`,mime:`image/heic-sequence`};case`qt`:return{ext:`mov`,mime:`video/quicktime`};case`M4V`:case`M4VH`:case`M4VP`:return{ext:`m4v`,mime:`video/x-m4v`};case`M4P`:return{ext:`m4p`,mime:`video/mp4`};case`M4B`:return{ext:`m4b`,mime:`audio/mp4`};case`M4A`:return{ext:`m4a`,mime:`audio/x-m4a`};case`F4V`:return{ext:`f4v`,mime:`video/mp4`};case`F4P`:return{ext:`f4p`,mime:`video/mp4`};case`F4A`:return{ext:`f4a`,mime:`audio/mp4`};case`F4B`:return{ext:`f4b`,mime:`audio/mp4`};case`crx`:return{ext:`cr3`,mime:`image/x-canon-cr3`};default:return e.startsWith(`3g`)?e.startsWith(`3g2`)?{ext:`3g2`,mime:`video/3gpp2`}:{ext:`3gp`,mime:`video/3gpp`}:{ext:`mp4`,mime:`video/mp4`}}}if(this.checkString(`REGEDIT4\r
7
+ `))return{ext:`reg`,mime:`application/x-ms-regedit`};if(this.check([82,73,70,70])){if(this.checkString(`WEBP`,{offset:8}))return{ext:`webp`,mime:`image/webp`};if(this.check([65,86,73],{offset:8}))return{ext:`avi`,mime:`video/vnd.avi`};if(this.check([87,65,86,69],{offset:8}))return{ext:`wav`,mime:`audio/wav`};if(this.check([81,76,67,77],{offset:8}))return{ext:`qcp`,mime:`audio/qcelp`}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:`rw2`,mime:`image/x-panasonic-rw2`};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function t(){let t=new Uint8Array(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(L))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){let n=await t(),r=n.size-24;if(Q(n.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let t=new Uint8Array(16);if(r-=await e.readBuffer(t),Q(t,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:`asf`,mime:`audio/x-ms-asf`};if(Q(t,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:`asf`,mime:`video/x-ms-asf`};break}await e.ignore(r)}return{ext:`asf`,mime:`application/vnd.ms-asf`}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:`ktx`,mime:`image/ktx`};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:`mie`,mime:`application/x-mie`};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:`shp`,mime:`application/x-esri-shape`};if(this.check([255,79,255,81]))return{ext:`j2c`,mime:`image/j2c`};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new R(4,`ascii`))){case`jp2 `:return{ext:`jp2`,mime:`image/jp2`};case`jpx `:return{ext:`jpx`,mime:`image/jpx`};case`jpm `:return{ext:`jpm`,mime:`image/jpm`};case`mjp2`:return{ext:`mj2`,mime:`image/mj2`};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:`jxl`,mime:`image/jxl`};if(this.check([254,255]))return this.checkString(`<?xml `,{offset:2,encoding:`utf-16be`})?{ext:`xml`,mime:`application/xml`}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:`cfb`,mime:`application/x-cfb`};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:`icc`,mime:`application/vnd.iccprofile`};if(this.checkString(`**ACE`,{offset:7})&&this.checkString(`**`,{offset:12}))return{ext:`ace`,mime:`application/x-ace-compressed`};if(this.checkString(`BEGIN:`)){if(this.checkString(`VCARD`,{offset:6}))return{ext:`vcf`,mime:`text/vcard`};if(this.checkString(`VCALENDAR`,{offset:6}))return{ext:`ics`,mime:`text/calendar`}}if(this.checkString(`FUJIFILMCCD-RAW`))return{ext:`raf`,mime:`image/x-fujifilm-raf`};if(this.checkString(`Extended Module:`))return{ext:`xm`,mime:`audio/x-xm`};if(this.checkString(`Creative Voice File`))return{ext:`voc`,mime:`audio/x-voc`};if(this.check([4,0,0,0])&&this.buffer.length>=16){let e=new DataView(this.buffer.buffer).getUint32(12,!0);if(e>12&&this.buffer.length>=e+16)try{let t=new TextDecoder().decode(this.buffer.subarray(16,e+16));if(JSON.parse(t).files)return{ext:`asar`,mime:`application/x-asar`}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:`mxf`,mime:`application/mxf`};if(this.checkString(`SCRM`,{offset:44}))return{ext:`s3m`,mime:`audio/x-s3m`};if(this.check([71])&&this.check([71],{offset:188})||this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:`mts`,mime:`video/mp2t`};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:`mobi`,mime:`application/x-mobipocket-ebook`};if(this.check([68,73,67,77],{offset:128}))return{ext:`dcm`,mime:`application/dicom`};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:`lnk`,mime:`application/x.ms.shortcut`};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:`alias`,mime:`application/x.apple.alias`};if(this.checkString(`Kaydara FBX Binary \0`))return{ext:`fbx`,mime:`application/x.autodesk.fbx`};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:`eot`,mime:`application/vnd.ms-fontobject`};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:`indd`,mime:`application/x-indesign`};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:`jmp`,mime:`application/x-jmp-data`};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString(`ustar`,{offset:257})&&(this.checkString(`\0`,{offset:262})||this.checkString(` `,{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&he(this.buffer))return{ext:`tar`,mime:`application/x-tar`};if(this.check([255,254])){let e=`utf-16le`;return this.checkString(`<?xml `,{offset:2,encoding:e})?{ext:`xml`,mime:`application/xml`}:this.check([255,14],{offset:2})&&this.checkString(`SketchUp Model`,{offset:4,encoding:e})?{ext:`skp`,mime:`application/vnd.sketchup.skp`}:this.checkString(`Windows Registry Editor Version 5.00\r
8
+ `,{offset:2,encoding:e})?{ext:`reg`,mime:`application/x-ms-regedit`}:void 0}if(this.checkString(`-----BEGIN PGP MESSAGE-----`))return{ext:`pgp`,mime:`application/pgp-encrypted`}};detectImprecise=async e=>{if(this.buffer=new Uint8Array(X),await e.peekBuffer(this.buffer,{length:Math.min(8,e.fileInfo.size),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:`mpg`,mime:`video/mpeg`};if(this.check([0,1,0,0,0]))return{ext:`ttf`,mime:`font/ttf`};if(this.check([0,0,1,0]))return{ext:`ico`,mime:`image/x-icon`};if(this.check([0,0,2,0]))return{ext:`cur`,mime:`image/x-icon`};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,e.fileInfo.size),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let e=0;e<=this.options.mpegOffsetTolerance;++e){let t=this.scanMpeg(e);if(t)return t}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?N:M);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:`arw`,mime:`image/x-sony-arw`};case 50706:return{ext:`dng`,mime:`image/x-adobe-dng`};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?N:M);for(let n=0;n<t;++n){let t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){let t=(e?N:M).get(this.buffer,2),n=(e?F:P).get(this.buffer,4);if(t===42){if(n>=6){if(this.checkString(`CR`,{offset:8}))return{ext:`cr2`,mime:`image/x-canon-cr2`};if(n>=8){let t=(e?N:M).get(this.buffer,8),n=(e?N:M).get(this.buffer,10);if(t===28&&n===254||t===31&&n===11)return{ext:`nef`,mime:`image/x-nikon-nef`}}}return await this.tokenizer.ignore(n),await this.readTiffIFD(e)??{ext:`tif`,mime:`image/tiff`}}if(t===43)return{ext:`tif`,mime:`image/tiff`}}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]}),{ext:`aac`,mime:`audio/aac`};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:`mp3`,mime:`audio/mpeg`};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:`mp2`,mime:`audio/mpeg`};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:`mp1`,mime:`audio/mpeg`}}}};new Set(_e),new Set(ve);var $={name:`file`,summary:`determine file type`,usage:`file [OPTION]... FILE...`,options:[`-b, --brief do not prepend filenames to output`,`-i, --mime output MIME type strings`,`-L, --dereference follow symlinks`,` --help display this help and exit`]},xe=new Map([[`.js`,{description:`JavaScript source`,mime:`text/javascript`}],[`.mjs`,{description:`JavaScript module`,mime:`text/javascript`}],[`.cjs`,{description:`CommonJS module`,mime:`text/javascript`}],[`.ts`,{description:`TypeScript source`,mime:`text/typescript`}],[`.tsx`,{description:`TypeScript JSX source`,mime:`text/typescript`}],[`.jsx`,{description:`JavaScript JSX source`,mime:`text/javascript`}],[`.py`,{description:`Python script`,mime:`text/x-python`}],[`.rb`,{description:`Ruby script`,mime:`text/x-ruby`}],[`.go`,{description:`Go source`,mime:`text/x-go`}],[`.rs`,{description:`Rust source`,mime:`text/x-rust`}],[`.c`,{description:`C source`,mime:`text/x-c`}],[`.h`,{description:`C header`,mime:`text/x-c`}],[`.cpp`,{description:`C++ source`,mime:`text/x-c++`}],[`.hpp`,{description:`C++ header`,mime:`text/x-c++`}],[`.java`,{description:`Java source`,mime:`text/x-java`}],[`.sh`,{description:`Bourne-Again shell script`,mime:`text/x-shellscript`}],[`.bash`,{description:`Bourne-Again shell script`,mime:`text/x-shellscript`}],[`.zsh`,{description:`Zsh shell script`,mime:`text/x-shellscript`}],[`.json`,{description:`JSON data`,mime:`application/json`}],[`.yaml`,{description:`YAML data`,mime:`text/yaml`}],[`.yml`,{description:`YAML data`,mime:`text/yaml`}],[`.xml`,{description:`XML document`,mime:`application/xml`}],[`.csv`,{description:`CSV text`,mime:`text/csv`}],[`.toml`,{description:`TOML data`,mime:`text/toml`}],[`.html`,{description:`HTML document`,mime:`text/html`}],[`.htm`,{description:`HTML document`,mime:`text/html`}],[`.css`,{description:`CSS stylesheet`,mime:`text/css`}],[`.svg`,{description:`SVG image`,mime:`image/svg+xml`}],[`.md`,{description:`Markdown document`,mime:`text/markdown`}],[`.markdown`,{description:`Markdown document`,mime:`text/markdown`}],[`.txt`,{description:`ASCII text`,mime:`text/plain`}],[`.rst`,{description:`reStructuredText`,mime:`text/x-rst`}],[`.env`,{description:`ASCII text`,mime:`text/plain`}],[`.gitignore`,{description:`ASCII text`,mime:`text/plain`}],[`.dockerignore`,{description:`ASCII text`,mime:`text/plain`}]]),Se=new Map([[`jpg`,`JPEG image data`],[`jpeg`,`JPEG image data`],[`png`,`PNG image data`],[`gif`,`GIF image data`],[`webp`,`WebP image data`],[`bmp`,`PC bitmap`],[`ico`,`MS Windows icon resource`],[`tif`,`TIFF image data`],[`tiff`,`TIFF image data`],[`psd`,`Adobe Photoshop Document`],[`avif`,`AVIF image`],[`heic`,`HEIC image`],[`heif`,`HEIF image`],[`jxl`,`JPEG XL image`],[`icns`,`Mac OS X icon`],[`svg`,`SVG Scalable Vector Graphics image`],[`pdf`,`PDF document`],[`epub`,`EPUB document`],[`mobi`,`Mobipocket E-book`],[`djvu`,`DjVu document`],[`zip`,`Zip archive data`],[`gz`,`gzip compressed data`],[`gzip`,`gzip compressed data`],[`bz2`,`bzip2 compressed data`],[`xz`,`XZ compressed data`],[`tar`,`POSIX tar archive`],[`rar`,`RAR archive data`],[`7z`,`7-zip archive data`],[`lz`,`lzip compressed data`],[`lzma`,`LZMA compressed data`],[`zst`,`Zstandard compressed data`],[`cab`,`Microsoft Cabinet archive`],[`ar`,`Unix ar archive`],[`rpm`,`RPM package`],[`deb`,`Debian binary package`],[`apk`,`Android Package`],[`dmg`,`Apple disk image`],[`iso`,`ISO 9660 CD-ROM filesystem data`],[`vhd`,`Microsoft Virtual Hard Disk`],[`vhdx`,`Microsoft Virtual Hard Disk (new format)`],[`qcow2`,`QEMU QCOW Image`],[`mp3`,`Audio file with ID3`],[`m4a`,`MPEG-4 audio`],[`aac`,`AAC audio`],[`wav`,`RIFF (little-endian) data, WAVE audio`],[`flac`,`FLAC audio bitstream data`],[`ogg`,`Ogg data`],[`oga`,`Ogg audio`],[`opus`,`Ogg Opus audio`],[`aiff`,`AIFF audio`],[`wma`,`Windows Media Audio`],[`amr`,`AMR audio`],[`mid`,`MIDI audio`],[`midi`,`MIDI audio`],[`ape`,`Monkey's Audio`],[`mp4`,`ISO Media, MPEG-4`],[`m4v`,`MPEG-4 video`],[`webm`,`WebM`],[`avi`,`RIFF (little-endian) data, AVI`],[`mov`,`ISO Media, Apple QuickTime movie`],[`mkv`,`Matroska data`],[`wmv`,`Windows Media Video`],[`flv`,`Flash Video`],[`3gp`,`3GPP multimedia`],[`3g2`,`3GPP2 multimedia`],[`ogv`,`Ogg video`],[`mts`,`MPEG transport stream`],[`m2ts`,`MPEG transport stream`],[`ts`,`MPEG transport stream`],[`mpg`,`MPEG video`],[`mpeg`,`MPEG video`],[`exe`,`PE32 executable`],[`dll`,`PE32 DLL`],[`elf`,`ELF executable`],[`mach`,`Mach-O executable`],[`wasm`,`WebAssembly (wasm) binary module`],[`dex`,`Android Dalvik executable`],[`class`,`Java class file`],[`swf`,`Adobe Flash`],[`doc`,`Microsoft Word Document`],[`docx`,`Microsoft Word 2007+ Document`],[`xls`,`Microsoft Excel Spreadsheet`],[`xlsx`,`Microsoft Excel 2007+ Spreadsheet`],[`ppt`,`Microsoft PowerPoint Presentation`],[`pptx`,`Microsoft PowerPoint 2007+ Presentation`],[`odt`,`OpenDocument Text`],[`ods`,`OpenDocument Spreadsheet`],[`odp`,`OpenDocument Presentation`],[`ttf`,`TrueType Font`],[`otf`,`OpenType Font`],[`woff`,`Web Open Font Format`],[`woff2`,`Web Open Font Format 2`],[`eot`,`Embedded OpenType font`],[`stl`,`Stereolithography CAD`],[`obj`,`Wavefront 3D Object`],[`gltf`,`GL Transmission Format`],[`glb`,`GL Transmission Format (binary)`],[`sqlite`,`SQLite 3.x database`],[`mdb`,`Microsoft Access Database`],[`xml`,`XML document`],[`json`,`JSON data`],[`macho`,`Mach-O binary`],[`ics`,`iCalendar data`],[`vcf`,`vCard data`],[`msi`,`Microsoft Installer`],[`ps`,`PostScript`],[`ai`,`Adobe Illustrator`],[`indd`,`Adobe InDesign`],[`sketch`,`Sketch design file`],[`fig`,`Figma design file`],[`xd`,`Adobe XD`],[`blend`,`Blender`],[`fbx`,`Autodesk FBX`],[`lnk`,`MS Windows shortcut`],[`alias`,`Mac OS alias`],[`torrent`,`BitTorrent file`],[`pcap`,`pcap capture file`],[`arrow`,`Apache Arrow`],[`parquet`,`Apache Parquet`]]);function Ce(e,t){let n=Se.get(e);if(n)return n;let[r,i]=t.split(`/`),a=i?.split(`+`)[0]?.replace(/-/g,` `)||e;switch(r){case`image`:return`${a.toUpperCase()} image data`;case`audio`:return`${a.toUpperCase()} audio`;case`video`:return`${a.toUpperCase()} video`;case`font`:return`${a} font`;case`model`:return`${a} 3D model`;case`application`:return i?.includes(`zip`)||i?.includes(`compressed`)?`${a} archive data`:i?.includes(`executable`)?`${a} executable`:`${e.toUpperCase()} data`;default:return`${e.toUpperCase()} data`}}function we(e){let t=e.split(`/`).pop()||e;if(t.startsWith(`.`)&&!t.includes(`.`,1))return t;let n=t.lastIndexOf(`.`);return n===-1||n===0?``:t.slice(n).toLowerCase()}function Te(e,t){if(e.startsWith(`#!`)){let t=e.split(`
9
+ `)[0];return t.includes(`python`)?{description:`Python script, ASCII text executable`,mime:`text/x-python`}:t.includes(`node`)||t.includes(`bun`)||t.includes(`deno`)?{description:`JavaScript script, ASCII text executable`,mime:`text/javascript`}:t.includes(`bash`)?{description:`Bourne-Again shell script, ASCII text executable`,mime:`text/x-shellscript`}:t.includes(`sh`)?{description:`POSIX shell script, ASCII text executable`,mime:`text/x-shellscript`}:t.includes(`ruby`)?{description:`Ruby script, ASCII text executable`,mime:`text/x-ruby`}:t.includes(`perl`)?{description:`Perl script, ASCII text executable`,mime:`text/x-perl`}:{description:`script, ASCII text executable`,mime:`text/plain`}}let n=e.trimStart();if(n.startsWith(`<?xml`))return{description:`XML document`,mime:`application/xml`};if(n.startsWith(`<!DOCTYPE html`)||n.toLowerCase().startsWith(`<html`))return{description:`HTML document`,mime:`text/html`};let r=e.includes(`\r
10
+ `),i=e.includes(`\r`)&&!r,a=``;r?a=`, with CRLF line terminators`:i&&(a=`, with CR line terminators`);let o=we(t),s=o?xe.get(o):void 0;if(s)return s.mime.startsWith(`text/`)&&a?{description:`${s.description}${a}`,mime:s.mime}:s;let c=!1;for(let t=0;t<Math.min(e.length,8192);t++)if(e.charCodeAt(t)>127){c=!0;break}return c?{description:`UTF-8 Unicode text${a}`,mime:`text/plain; charset=utf-8`}:{description:`ASCII text${a}`,mime:`text/plain`}}async function Ee(e,t){if(t.length===0)return{description:`empty`,mime:`inode/x-empty`};let n=await ye(t);return n?{description:Ce(n.ext,n.mime),mime:n.mime}:Te(new TextDecoder(`utf-8`,{fatal:!1}).decode(t),e)}var De={name:`file`,async execute(e,t){if(a(e))return i($);let n=!1,o=!1,s=[];for(let t of e)if(t.startsWith(`--`)){if(t===`--brief`)n=!0;else if(t===`--mime`||t===`--mime-type`)o=!0;else if(t!==`--dereference`)return r(`file`,t)}else if(t.startsWith(`-`)&&t!==`-`){for(let e of t.slice(1))if(e===`b`)n=!0;else if(e===`i`)o=!0;else if(e!==`L`)return r(`file`,`-${e}`)}else s.push(t);if(s.length===0)return{stdout:``,stderr:`Usage: file [-bLi] FILE...
11
+ `,exitCode:1};let c=``,l=0;for(let e of s)try{let r=t.fs.resolvePath(t.cwd,e);if((await t.fs.stat(r)).isDirectory){let t=o?`inode/directory`:`directory`;c+=n?`${t}
12
+ `:`${e}: ${t}
13
+ `;continue}let i=await Ee(e,await t.fs.readFileBuffer(r)),a=o?i.mime:i.description;c+=n?`${a}
14
+ `:`${e}: ${a}
15
+ `}catch{c+=n?`cannot open
16
+ `:`${e}: cannot open (No such file or directory)
17
+ `,l=1}return{stdout:c,stderr:``,exitCode:l}}},Oe={name:`file`,flags:[{flag:`-b`,type:`boolean`},{flag:`-i`,type:`boolean`},{flag:`-L`,type:`boolean`}],needsArgs:!0};
18
+ /*! Bundled license information:
19
+
20
+ ieee754/index.js:
21
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
22
+ */
23
+ export{Oe as n,De as t};
24
+ //# sourceMappingURL=chunk-CR5AFCPT-ROmyDFrB.mjs.map
@@ -0,0 +1,2 @@
1
+ var e=globalThis.SharedArrayBuffer,t=globalThis.Atomics,n=performance.now.bind(performance),r=globalThis.Headers;export{e as i,t as n,n as r,r as t};
2
+ //# sourceMappingURL=chunk-CWQS3NFK-DFdwmFxJ.mjs.map
@@ -0,0 +1,12 @@
1
+ import{n as e,r as t,t as n}from"./chunk-74CEPOFO-D1bzz49u.mjs";var r={name:`fold`,summary:`wrap each input line to fit in specified width`,usage:`fold [OPTION]... [FILE]...`,description:`Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.`,options:[`-w WIDTH Use WIDTH columns instead of 80`,`-s Break at spaces`,`-b Count bytes rather than columns`],examples:[`fold -w 40 file.txt # Wrap at 40 columns`,`fold -sw 40 file.txt # Word wrap at 40 columns`,`echo 'long line' | fold -w 5 # Force wrap at 5`]};function i(e,t,n){return n?new TextEncoder().encode(e).length:e===` `?8-t%8:e===`\b`?-1:1}function a(e,t){if(e.length===0)return e;let{width:n,breakAtSpaces:r,countBytes:a}=t,o=[],s=``,c=0,l=-1,u=0;for(let t=0;t<e.length;t++){let d=e[t],f=i(d,c,a);c+f>n&&s.length>0?r&&l>=0?(o.push(s.slice(0,l+1)),s=s.slice(l+1)+d,c=c-u-1+f,l=-1,u=0):(o.push(s),s=d,c=f,l=-1,u=0):(s+=d,c+=f,(d===` `||d===` `)&&(l=s.length-1,u=c-f))}return s.length>0&&o.push(s),o.join(`
2
+ `)}function o(e,t){if(e===``)return``;let n=e.split(`
3
+ `),r=e.endsWith(`
4
+ `)&&n[n.length-1]===``;return r&&n.pop(),n.map(e=>a(e,t)).join(`
5
+ `)+(r?`
6
+ `:``)}var s={name:`fold`,execute:async(i,a)=>{if(n(i))return t(r);let s={width:80,breakAtSpaces:!1,countBytes:!1},c=[],l=0;for(;l<i.length;){let t=i[l];if(t===`-w`&&l+1<i.length){let e=parseInt(i[l+1],10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:``,stderr:`fold: invalid number of columns: '${i[l+1]}'
7
+ `};s.width=e,l+=2}else if(t.startsWith(`-w`)&&t.length>2){let e=parseInt(t.slice(2),10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:``,stderr:`fold: invalid number of columns: '${t.slice(2)}'
8
+ `};s.width=e,l++}else if(t===`-s`)s.breakAtSpaces=!0,l++;else if(t===`-b`)s.countBytes=!0,l++;else if(t===`-bs`||t===`-sb`)s.breakAtSpaces=!0,s.countBytes=!0,l++;else if(t.match(/^-[sb]+w\d+$/)){t.includes(`s`)&&(s.breakAtSpaces=!0),t.includes(`b`)&&(s.countBytes=!0);let e=t.replace(/^-[sb]+w/,``),n=parseInt(e,10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:``,stderr:`fold: invalid number of columns: '${e}'
9
+ `};s.width=n,l++}else if(t.match(/^-[sb]+w$/)&&l+1<i.length){t.includes(`s`)&&(s.breakAtSpaces=!0),t.includes(`b`)&&(s.countBytes=!0);let e=parseInt(i[l+1],10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:``,stderr:`fold: invalid number of columns: '${i[l+1]}'
10
+ `};s.width=e,l+=2}else if(t===`--`){c.push(...i.slice(l+1));break}else if(t.startsWith(`-`)&&t!==`-`){let n=t.slice(1),r=!1;for(let e of n)if(e===`s`)s.breakAtSpaces=!0;else if(e===`b`)s.countBytes=!0;else{r=!0;break}if(r)return e(`fold`,t);l++}else c.push(t),l++}let u=``;if(c.length===0)u=o(a.stdin??``,s);else for(let e of c){let t=a.fs.resolvePath(a.cwd,e),n=await a.fs.readFile(t);if(n===null)return{exitCode:1,stdout:u,stderr:`fold: ${e}: No such file or directory
11
+ `};u+=o(n,s)}return{exitCode:0,stdout:u,stderr:``}}},c={name:`fold`,flags:[{flag:`-w`,type:`value`,valueHint:`number`},{flag:`-s`,type:`boolean`},{flag:`-b`,type:`boolean`}],stdinType:`text`,needsFiles:!0};export{c as n,s as t};
12
+ //# sourceMappingURL=chunk-D4J545R4-C8nMOauR.mjs.map
@@ -0,0 +1,6 @@
1
+ import{t as e}from"./chunk-OJDRYQWQ-BV5MVRVg.mjs";import{r as t,t as n}from"./chunk-74CEPOFO-D1bzz49u.mjs";var r={name:`bash`,summary:`execute shell commands or scripts`,usage:`bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]`,options:[`-c COMMAND execute COMMAND string`,` --help display this help and exit`],notes:[`Without -c, reads and executes commands from SCRIPT_FILE.`,`Arguments are passed as $1, $2, etc. to the script.`,`$0 is set to the script name (or "bash" with -c).`]},i={name:`bash`,async execute(e,i){if(n(e))return t(r);if(e[0]===`-c`&&e.length>=2){let t=e[1];return o(t,e[2]||`bash`,e.slice(3),i)}if(e.length===0)return i.stdin?.trim()?o(i.stdin,`bash`,[],i):{stdout:``,stderr:``,exitCode:0};let a=e[0],s=e.slice(1);try{let e=i.fs.resolvePath(i.cwd,a);return o(await i.fs.readFile(e),a,s,i)}catch{return{stdout:``,stderr:`bash: ${a}: No such file or directory
2
+ `,exitCode:127}}}},a={name:`sh`,async execute(e,i){if(n(e))return t({...r,name:`sh`,summary:`execute shell commands or scripts (POSIX shell)`});if(e[0]===`-c`&&e.length>=2){let t=e[1];return o(t,e[2]||`sh`,e.slice(3),i)}if(e.length===0)return i.stdin?.trim()?o(i.stdin,`sh`,[],i):{stdout:``,stderr:``,exitCode:0};let a=e[0],s=e.slice(1);try{let e=i.fs.resolvePath(i.cwd,a);return o(await i.fs.readFile(e),a,s,i)}catch{return{stdout:``,stderr:`sh: ${a}: No such file or directory
3
+ `,exitCode:127}}}};async function o(t,n,r,i){if(!i.exec)return{stdout:``,stderr:`bash: internal error: exec function not available
4
+ `,exitCode:1};let a=e(i.exportedEnv||{},{0:n,"#":String(r.length),"@":r.join(` `),"*":r.join(` `)});r.forEach((e,t)=>{a[String(t+1)]=e});let o=t;if(o.startsWith(`#!`)){let e=o.indexOf(`
5
+ `);e!==-1&&(o=o.slice(e+1))}return await i.exec(o,{env:a,cwd:i.cwd,stdin:i.stdin,signal:i.signal})}var s={name:`bash`,flags:[{flag:`-c`,type:`value`,valueHint:`string`}],stdinType:`text`},c={name:`sh`,flags:[{flag:`-c`,type:`value`,valueHint:`string`}],stdinType:`text`};export{i,c as n,s as r,a as t};
6
+ //# sourceMappingURL=chunk-D6CWQ5DW-B-J4LN9N.mjs.map
@@ -0,0 +1,5 @@
1
+ import{n as e,r as t,t as n}from"./chunk-74CEPOFO-D1bzz49u.mjs";var r={name:`date`,summary:`display the current time in the given FORMAT`,usage:`date [OPTION]... [+FORMAT]`,options:[`-d, --date=STRING display time described by STRING`,`-u, --utc print Coordinated Universal Time (UTC)`,`-I, --iso-8601 output date/time in ISO 8601 format`,`-R, --rfc-email output RFC 5322 date format`,` --help display this help and exit`]},i=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],a=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function o(e,t=2){return String(e).padStart(t,`0`)}function s(e,t,n){let r={Y:e.getUTCFullYear(),m:e.getUTCMonth(),D:e.getUTCDate(),H:e.getUTCHours(),M:e.getUTCMinutes(),S:e.getUTCSeconds(),w:e.getUTCDay()},s=``,c=0;for(;c<t.length;){if(t[c]===`%`&&c+1<t.length){let n=t[++c];switch(n){case`%`:s+=`%`;break;case`a`:s+=i[r.w];break;case`b`:case`h`:s+=a[r.m];break;case`d`:s+=o(r.D);break;case`e`:s+=String(r.D).padStart(2,` `);break;case`F`:s+=`${r.Y}-${o(r.m+1)}-${o(r.D)}`;break;case`H`:s+=o(r.H);break;case`I`:s+=o(r.H%12||12);break;case`m`:s+=o(r.m+1);break;case`M`:s+=o(r.M);break;case`n`:s+=`
2
+ `;break;case`p`:s+=r.H<12?`AM`:`PM`;break;case`P`:s+=r.H<12?`am`:`pm`;break;case`R`:s+=`${o(r.H)}:${o(r.M)}`;break;case`s`:s+=Math.floor(e.getTime()/1e3);break;case`S`:s+=o(r.S);break;case`t`:s+=` `;break;case`T`:s+=`${o(r.H)}:${o(r.M)}:${o(r.S)}`;break;case`u`:s+=r.w||7;break;case`w`:s+=r.w;break;case`y`:s+=o(r.Y%100);break;case`Y`:s+=r.Y;break;case`z`:s+=`+0000`;break;case`Z`:s+=`UTC`;break;default:s+=`%${n}`}}else s+=t[c];c++}return s}function c(e){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t;if(/^\d+$/.test(e))return new Date(Number.parseInt(e,10)*1e3);let n=e.toLowerCase();return n===`now`||n===`today`?new Date:n===`yesterday`?new Date(Date.now()-864e5):n===`tomorrow`?new Date(Date.now()+864e5):null}var l={name:`date`,async execute(i,a){if(n(i))return t(r);let o=!1,l=null,u=null,d=!1,f=!1;for(let t=0;t<i.length;t++){let n=i[t];if(n===`-u`||n===`--utc`)o=!0;else if(n===`-d`||n===`--date`)l=i[++t]??``;else if(n.startsWith(`--date=`))l=n.slice(7);else if(n===`-I`||n===`--iso-8601`)d=!0;else if(n===`-R`||n===`--rfc-email`)f=!0;else if(n.startsWith(`+`))u=n.slice(1);else{if(n.startsWith(`--`))return e(`date`,n);if(n.startsWith(`-`))for(let t of n.slice(1))if(t===`u`)o=!0;else if(t===`I`)d=!0;else if(t===`R`)f=!0;else return e(`date`,`-${t}`)}}let p=l===null?new Date:c(l);if(!p)return{stdout:``,stderr:`date: invalid date '${l}'
3
+ `,exitCode:1};let m;return m=u?s(p,u,o):d?s(p,`%Y-%m-%dT%H:%M:%S%z`,o):f?s(p,`%a, %d %b %Y %H:%M:%S %z`,o):s(p,`%a %b %e %H:%M:%S %Z %Y`,o),{stdout:`${m}
4
+ `,stderr:``,exitCode:0}}},u={name:`date`,flags:[{flag:`-d`,type:`value`,valueHint:`string`},{flag:`-u`,type:`boolean`},{flag:`-I`,type:`boolean`},{flag:`-R`,type:`boolean`}]};export{l as n,u as t};
5
+ //# sourceMappingURL=chunk-D7MEQ3VN-Csvth_Ss.mjs.map
@@ -0,0 +1,2 @@
1
+ import{r as e,t}from"./chunk-74CEPOFO-D1bzz49u.mjs";import{i as n,n as r,r as i}from"./chunk-HDQ56CKY-pGV4pOJA.mjs";var a={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`]},o={name:`tail`,async execute(o,s){if(t(o))return e(a);let c=r(o,`tail`);if(!c.ok)return c.error;let{lines:l,bytes:u,fromLine:d}=c.options;return i(s,c.options,`tail`,e=>n(e,l,u,d??!1))}},s={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{o as n,s as t};
2
+ //# sourceMappingURL=chunk-DCAAORBQ-BdrR5ttw.mjs.map
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./chunk-FK9Q3tQk.mjs";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(t=>typeof e<`u`?e:typeof Proxy<`u`?new Proxy(t,{get:(t,n)=>(typeof e<`u`?e:t)[n]}):t)(function(t){if(typeof e<`u`)return e.apply(this,arguments);throw Error(`Dynamic require of "`+t+`" is not supported`)}),c=(e,t)=>()=>(e&&(t=e(e=0)),t),l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},d=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!o.call(e,c)&&c!==a&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},f=(e,r,i)=>(i=e==null?{}:t(a(e)),d(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),p=e=>d(n({},`__esModule`,{value:!0}),e);export{f as a,u as i,c as n,p as o,l as r,s as t};
2
+ //# sourceMappingURL=chunk-DXB73IDG-C774okS0.mjs.map
@@ -0,0 +1,3 @@
1
+ function e(e,t,n){let r=e;n>=0&&r.length>n&&(r=r.slice(0,n));let i=Math.abs(t);return i>r.length&&(r=t<0?r.padEnd(i,` `):r.padStart(i,` `)),r}function t(e,t){let n=t,r=0,i=-1,a=!1;for(n<e.length&&e[n]===`-`&&(a=!0,n++);n<e.length&&/\d/.test(e[n]);)r=r*10+parseInt(e[n],10),n++;if(n<e.length&&e[n]===`.`)for(n++,i=0;n<e.length&&/\d/.test(e[n]);)i=i*10+parseInt(e[n],10),n++;return a&&r>0&&(r=-r),[r,i,n-t]}function n(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`\\`&&n+1<e.length)switch(e[n+1]){case`n`:t+=`
2
+ `,n+=2;break;case`t`:t+=` `,n+=2;break;case`r`:t+=`\r`,n+=2;break;case`\\`:t+=`\\`,n+=2;break;case`a`:t+=`\x07`,n+=2;break;case`b`:t+=`\b`,n+=2;break;case`f`:t+=`\f`,n+=2;break;case`v`:t+=`\v`,n+=2;break;case`e`:case`E`:t+=`\x1B`,n+=2;break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:{let r=``,i=n+1;for(;i<e.length&&i<n+4&&/[0-7]/.test(e[i]);)r+=e[i],i++;t+=String.fromCharCode(parseInt(r,8)),n=i;break}case`x`:{let r=[],i=n;for(;i+3<e.length&&e[i]===`\\`&&e[i+1]===`x`&&/[0-9a-fA-F]{2}/.test(e.slice(i+2,i+4));)r.push(parseInt(e.slice(i+2,i+4),16)),i+=4;if(r.length>0){try{let e=new TextDecoder(`utf-8`,{fatal:!0});t+=e.decode(new Uint8Array(r))}catch{for(let e of r)t+=String.fromCharCode(e)}n=i}else t+=e[n],n++;break}case`u`:{let r=``,i=n+2;for(;i<e.length&&i<n+6&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;r?(t+=String.fromCodePoint(parseInt(r,16)),n=i):(t+=`\\u`,n+=2);break}case`U`:{let r=``,i=n+2;for(;i<e.length&&i<n+10&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;r?(t+=String.fromCodePoint(parseInt(r,16)),n=i):(t+=`\\U`,n+=2);break}default:t+=e[n],n++}else t+=e[n],n++;return t}export{e as n,n as r,t};
3
+ //# sourceMappingURL=chunk-EEXR5ZDP-C5AJH114.mjs.map