just-binary 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +1 -1
  2. package/dist/AGENTS.md +1 -1
  3. package/dist/bin/chunks/chunk-H7TGYILF.js +3 -0
  4. package/dist/bin/chunks/chunk-XSBNCA43.js +7 -0
  5. package/dist/bin/chunks/flag-coverage-O3TGZMW3.js +2 -0
  6. package/dist/bin/{shell/chunks/seq-6C6VEGIG.js → chunks/seq-IDAAUGIL.js} +1 -1
  7. package/dist/bin/chunks/yes-A2LPETVU.js +2 -0
  8. package/dist/bin/just-bash.js +1 -1
  9. package/dist/bin/shell/chunks/chunk-H7TGYILF.js +3 -0
  10. package/dist/bin/shell/chunks/chunk-XSBNCA43.js +7 -0
  11. package/dist/bin/shell/chunks/flag-coverage-O3TGZMW3.js +2 -0
  12. package/dist/bin/{chunks/seq-6C6VEGIG.js → shell/chunks/seq-IDAAUGIL.js} +1 -1
  13. package/dist/bin/shell/chunks/yes-A2LPETVU.js +2 -0
  14. package/dist/bin/shell/shell.js +1 -1
  15. package/dist/bundle/browser.js +580 -579
  16. package/dist/bundle/chunks/chunk-6RAG3BOS.js +2 -0
  17. package/dist/bundle/chunks/chunk-R7SSLDTN.js +6 -0
  18. package/dist/bundle/chunks/flag-coverage-33IDWH3V.js +1 -0
  19. package/dist/bundle/chunks/{seq-UCWX6HDA.js → seq-SXS6YKWX.js} +1 -1
  20. package/dist/bundle/chunks/yes-2J55KNKF.js +1 -0
  21. package/dist/bundle/index.js +1 -1
  22. package/dist/commands/registry.d.ts +1 -1
  23. package/dist/commands/seq/seq.d.ts +5 -0
  24. package/dist/commands/yes/yes.d.ts +14 -0
  25. package/package.json +1 -1
  26. package/dist/bin/chunks/chunk-HT4IVOYZ.js +0 -7
  27. package/dist/bin/chunks/flag-coverage-JBJRZ3PO.js +0 -2
  28. package/dist/bin/shell/chunks/chunk-HT4IVOYZ.js +0 -7
  29. package/dist/bin/shell/chunks/flag-coverage-JBJRZ3PO.js +0 -2
  30. package/dist/bundle/chunks/chunk-OYIATQ5V.js +0 -6
  31. package/dist/bundle/chunks/flag-coverage-FK7Z2EY4.js +0 -1
package/README.md CHANGED
@@ -304,7 +304,7 @@ pnpm shell --no-network
304
304
 
305
305
  ### Shell Utilities
306
306
 
307
- `alias`, `bash`, `chmod`, `clear`, `date`, `expr`, `false`, `help`, `history`, `seq`, `sh`, `sleep`, `time`, `timeout`, `true`, `unalias`, `which`, `whoami`
307
+ `alias`, `bash`, `chmod`, `clear`, `date`, `expr`, `false`, `help`, `history`, `seq`, `sh`, `sleep`, `time`, `timeout`, `true`, `unalias`, `which`, `whoami`, `yes`
308
308
 
309
309
  ### Network Commands
310
310
 
package/dist/AGENTS.md CHANGED
@@ -70,7 +70,7 @@ const result = await bash.exec("cat input.txt | grep pattern");
70
70
 
71
71
  **File operations**: `basename`, `chmod`, `cp`, `dirname`, `du`, `file`, `find`, `ln`, `ls`, `mkdir`, `mv`, `od`, `pwd`, `readlink`, `rm`, `rmdir`, `split`, `stat`, `touch`, `tree`
72
72
 
73
- **Utilities**: `alias`, `base64`, `bash`, `clear`, `curl`, `date`, `diff`, `echo`, `env`, `expr`, `false`, `gzip`, `gunzip`, `help`, `history`, `hostname`, `html-to-markdown`, `md5sum`, `printenv`, `printf`, `seq`, `sh`, `sha1sum`, `sha256sum`, `sleep`, `tar`, `tee`, `time`, `timeout`, `true`, `unalias`, `which`, `whoami`, `zcat`
73
+ **Utilities**: `alias`, `base64`, `bash`, `clear`, `curl`, `date`, `diff`, `echo`, `env`, `expr`, `false`, `gzip`, `gunzip`, `help`, `history`, `hostname`, `html-to-markdown`, `md5sum`, `printenv`, `printf`, `seq`, `sh`, `sha1sum`, `sha256sum`, `sleep`, `tar`, `tee`, `time`, `timeout`, `true`, `unalias`, `which`, `whoami`, `yes`, `zcat`
74
74
 
75
75
  All commands support `--help` for usage details.
76
76
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{b as c}from"./chunk-RAUBS6MJ.js";import{k as r}from"./chunk-463VWH7H.js";var h={name:"yes",async execute(a){let n=r(a),d=`${n.length===0?"y":n.join(" ")}
3
+ `,t=new TextEncoder().encode(d),l=16*1024,o=Math.max(1,Math.floor(l/t.length)),m=t.length*o,s=new Uint8Array(m);for(let e=0;e<o;e++)s.set(t,e*t.length);return{stdout:new ReadableStream({pull(e){e.enqueue(s)}}),stderr:c(),exitCode:0}}},p={name:"yes",flags:[]};export{h as a,p as b};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import{b as a,e as g}from"./chunk-RAUBS6MJ.js";import{k as v}from"./chunk-463VWH7H.js";var V={name:"seq",async execute(u){let s=v(u),l=`
3
+ `,f=!1,r=[],t=0;for(;t<s.length;){let e=s[t];if(e==="-s"&&t+1<s.length){l=s[t+1],t+=2;continue}if(e==="-w"){f=!0,t++;continue}if(e==="--"){t++;break}if(e.startsWith("-")&&e!=="-"){if(e.startsWith("-s")&&e.length>2){l=e.slice(2),t++;continue}if((e==="-ws"||e==="-sw")&&(f=!0,t+1<s.length)){l=s[t+1],t+=2;continue}}r.push(e),t++}for(;t<s.length;)r.push(s[t]),t++;if(r.length===0)return{stdout:a(),stderr:g(`seq: missing operand
4
+ `),exitCode:1};let o=1,d=1,i;if(r.length===1?i=parseFloat(r[0]):r.length===2?(o=parseFloat(r[0]),i=parseFloat(r[1])):(o=parseFloat(r[0]),d=parseFloat(r[1]),i=parseFloat(r[2])),Number.isNaN(o)||Number.isNaN(d)||Number.isNaN(i)){let e=r.find(n=>Number.isNaN(parseFloat(n)));return{stdout:a(),stderr:g(`seq: invalid floating point argument: '${e}'
5
+ `),exitCode:1}}if(d===0)return{stdout:a(),stderr:g(`seq: invalid Zero increment value: '0'
6
+ `),exitCode:1};let m=Math.max(b(o),b(d),b(i)),q=0;if(f){let e=w(o,m).replace(/^-/,""),n=w(i,m).replace(/^-/,"");q=Math.max(e.length,n.length)}let y=e=>{let n=w(e,m);if(!f)return n;let N=n.startsWith("-"),C=(N?n.slice(1):n).padStart(q,"0");return N?`-${C}`:C},h=d>0;if(h&&o>i)return{stdout:a(),stderr:a(),exitCode:0};if(!h&&o<i)return{stdout:a(),stderr:a(),exitCode:0};let S=16*1024,c=o,p=!0,x=!1,W=new TextEncoder;return{stdout:new ReadableStream({pull(e){if(x){e.close();return}let n="";for(;n.length<S;){if(h?c>i+1e-10:c<i-1e-10){x=!0,p||(n+=`
7
+ `);break}let F=y(c);p?(n+=F,p=!1):n+=l+F,c+=d}n.length>0?e.enqueue(W.encode(n)):x&&e.close()}}),stderr:a(),exitCode:0}}};function b(u){let s=String(u),l=s.indexOf(".");return l===-1?0:s.length-l-1}function w(u,s){return s>0?u.toFixed(s):String(Math.round(u))}var A={name:"seq",flags:[{flag:"-s",type:"value",valueHint:"string"},{flag:"-w",type:"boolean"}],needsArgs:!0};export{V as a,A as b};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{b as yr}from"./chunk-YG67AAKF.js";import{d as Ir,e as Mr,f as jr}from"./chunk-ASU2EQWZ.js";import{b as Ar}from"./chunk-4W52T6KS.js";import{b as $r}from"./chunk-23CC4423.js";import{b as Sr}from"./chunk-7YOACDUK.js";import"./chunk-23EV7RYO.js";import"./chunk-TACNCKUC.js";import{b as Tr}from"./chunk-EHJW6FCX.js";import{b as hr}from"./chunk-GUZJZK5O.js";import{b as wr}from"./chunk-SDTTNNEH.js";import{b as xr}from"./chunk-5KQNIOZS.js";import{b as vr}from"./chunk-Z73LISDU.js";import{b as kr}from"./chunk-5IL5CXJC.js";import{b as qr}from"./chunk-V3N6H3L5.js";import{b as Cr}from"./chunk-KAWPUEQM.js";import{b as br}from"./chunk-PRQYRYWV.js";import{b as nr}from"./chunk-ECBMSCPX.js";import{b as tr}from"./chunk-HY6WUGWS.js";import{b as lr}from"./chunk-7J7OY2YE.js";import{b as ur}from"./chunk-HEO6EBJ2.js";import{b as pr}from"./chunk-XSBNCA43.js";import{b as er}from"./chunk-WXI44VNZ.js";import{b as dr}from"./chunk-NNVWOCET.js";import{b as cr}from"./chunk-YER5PEKD.js";import"./chunk-I2N72LXH.js";import{b as rr}from"./chunk-3VDZW42W.js";import{c as or,d as ar}from"./chunk-SZM4GZ4H.js";import{b as sr}from"./chunk-VWJBSJYM.js";import{b as ir}from"./chunk-H7TGYILF.js";import{c as gr,d as mr}from"./chunk-RFIBBYTO.js";import{b as Fr}from"./chunk-YGAHXCGB.js";import"./chunk-N7P3SUNH.js";import"./chunk-UYBH3FNE.js";import{b as zr}from"./chunk-D44C6YVE.js";import{b as fr}from"./chunk-RIV3HSPK.js";import{b as Q}from"./chunk-QXOUI5BS.js";import{b as R}from"./chunk-44ROJVH3.js";import{b as U}from"./chunk-UAZICDKU.js";import{b as V}from"./chunk-AN2KBMAK.js";import{b as W}from"./chunk-444WPTN5.js";import{c as X,d as Y}from"./chunk-67SBKZZD.js";import{c as Z,d as _}from"./chunk-D34QBGQ3.js";import{b as N}from"./chunk-XB426ZI7.js";import{b as E}from"./chunk-2IOUIOWE.js";import{b as G}from"./chunk-U4LP6WPJ.js";import{b as H}from"./chunk-Q2BKN6MV.js";import{b as J}from"./chunk-AZQ66C5R.js";import{b as K}from"./chunk-6U6CK6V4.js";import{b as L}from"./chunk-IAUA3FL7.js";import{b as O}from"./chunk-ZZPPBMHW.js";import{b as P}from"./chunk-SL4D2YES.js";import{b as M}from"./chunk-GIVPKQT5.js";import{b as j}from"./chunk-LVSKOXVG.js";import{b as A}from"./chunk-X7PEK6W7.js";import{b as $}from"./chunk-MPX22C7Y.js";import{b as S}from"./chunk-4VVLCPRH.js";import{b as T}from"./chunk-B4GXMUCA.js";import{b as B}from"./chunk-RUNWFUUE.js";import{b as D}from"./chunk-JU5KTPFP.js";import{b as h}from"./chunk-IQY3I4OH.js";import{b as w}from"./chunk-66PXNTAV.js";import"./chunk-RZ6FAJ25.js";import{b as x}from"./chunk-DMTOGHTU.js";import{b as v}from"./chunk-RX4PT2U7.js";import{d as k,e as q,f as C}from"./chunk-CE2ILL65.js";import"./chunk-GIFF636B.js";import{b}from"./chunk-4Y3GINAY.js";import"./chunk-BXOX2H2G.js";import{b as y}from"./chunk-EXCMJ23H.js";import{b as I}from"./chunk-FVFLR7NF.js";import{b as n}from"./chunk-XRZNW2KP.js";import{b as t}from"./chunk-NSSLXYEG.js";import{b as l}from"./chunk-HZM5PBQF.js";import{b as u}from"./chunk-CD3NCHIB.js";import{b as p}from"./chunk-QKQUVK53.js";import{b as e}from"./chunk-446TXLPR.js";import{b as d}from"./chunk-OH3VVXF7.js";import{b as c}from"./chunk-QFPJQSDK.js";import"./chunk-RUESYAVK.js";import"./chunk-CAXM2HMK.js";import"./chunk-SE4C7FJY.js";import{b as i}from"./chunk-PZ46XEZ4.js";import{b as g}from"./chunk-PKKBPSVJ.js";import"./chunk-Z72PSRMX.js";import{b as m}from"./chunk-L2KFCEBW.js";import"./chunk-K2K4KPOQ.js";import"./chunk-XILOLP4K.js";import{b as F}from"./chunk-RMG637UR.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-RAL2LVDX.js";import{b as f}from"./chunk-IPWJZ22H.js";import"./chunk-4VDEBYW7.js";import"./chunk-7VWUKGDV.js";import"./chunk-DFAHK2EQ.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";var Gr=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,y,I,M,j,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,yr,Ir,Mr,jr,Ar,$r,ir,Sr,Tr];function Br(){return Gr}var Dr=new Map;for(let r of Br())Dr.set(r.name,new Set(r.flags.map(o=>o.flag)));function fa(r,o,Er){let a=Dr.get(o);if(!(!a||a.size===0))for(let s of Er)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{fa as emitFlagCoverage};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a,b}from"./chunk-HT4IVOYZ.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";export{b as flagsForFuzzing,a as seqCommand};
2
+ import{a,b}from"./chunk-XSBNCA43.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";export{b as flagsForFuzzing,a as seqCommand};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{a,b}from"./chunk-H7TGYILF.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";export{b as flagsForFuzzing,a as yesCommand};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{A as ds,C as Pr,D as xr,E as me,F as je,G as ie,H as Ce,I as Tt,J as Nr,K as V,L as Tr,M as Or,N as Te,O as hs,P as Ot,Q as Ze,R as X,a as vr,b as as,c as br,d as Sr,e as xt,f as se,g as G,h as Pe,i as ae,j as xe,k as We,l as ls,m as Nt,n as Er,o as cs,p as $r,q as pe,r as Re,s as Ar,t as _r,u as us,v as fs,w as Ne,x as Cr,y as kr,z as _e}from"./chunks/chunk-YJFLWG5Q.js";import{a as wr}from"./chunks/chunk-RUESYAVK.js";import{a as Me,b as Ae}from"./chunks/chunk-CAXM2HMK.js";import{a as ft}from"./chunks/chunk-SE4C7FJY.js";import{a as ve,b as be,c as he,d as Ee,e as yr,f as Z,g as Be,h as Ct,i as kt,j as gr,k as ue,l as Fe,m as Pt,n as $e}from"./chunks/chunk-XILOLP4K.js";import"./chunks/chunk-OBH7XN5N.js";import{a as Ie}from"./chunks/chunk-4VDEBYW7.js";import{a as ct,b as w,c as te,d as de,e as x,f as Y,g as qe,h as D,i as os,j as ut}from"./chunks/chunk-RAUBS6MJ.js";import{a as _t,g as F,h as B,i as H,j as mr,k as lt,l as T,m as g}from"./chunks/chunk-463VWH7H.js";import{resolve as fi}from"node:path";var Ye=[{name:"echo",load:async()=>(await import("./chunks/echo-5EBIR54T.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-D4E4FTXJ.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-OCMANWQ5.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-SLO257WP.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-EOATYYLD.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5MNK2AUK.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-J6X4OW3P.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-BZWDOVUX.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-7TMSGOID.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-QUAFQDCT.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-PZ7JHGH2.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-OY5CP5QF.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-PQGDLYLZ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-F66ORZVY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YZQN4BHR.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-EI24LQBP.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-NNQHXBLM.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-6QXPS4BF.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-LTQYHOCO.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-HN3E3YFB.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-GM5WBRLU.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-FT4OVPSS.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-C3ZUQTF4.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-LMDA7QZC.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-P6LPALWP.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-6XYPZQXQ.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-2C3Q77EZ.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-67WGH7WN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-WZC4GKMG.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-SK55D7OX.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-672ZQYZF.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-AUQHJMGI.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-7CJI5ESD.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-AXXLODUK.js")).split},{name:"column",load:async()=>(await import("./chunks/column-5CUPANJY.js")).column},{name:"join",load:async()=>(await import("./chunks/join-ZK67SMQ3.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-6TEQ3DXN.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-BXGQE44U.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-XCXGYZPS.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-3LHNBKNB.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-RLXLQJVI.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-DEYTW2KI.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-W57S3E3C.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-I7QRUR36.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-P5EG7Z6I.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-2BGA6KZ3.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-KLZ4B6VS.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-SGBANTKE.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-KYJ2OPHH.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-CPJ3WJE7.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-LPVVIBNB.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-GJWZLHLN.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-6C6VEGIG.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-SWYNZXDP.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-WYOOUOWI.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-Y2J25KOM.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-NFAAGL44.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-MIXTZ4NP.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-2AHE4ET2.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-R7JNUPU2.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-QKNHOQPQ.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-Q5VNKVXE.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-NPAYFT3O.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-KIB3RVBF.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-IMVAQQIR.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ye.push({name:"tar",load:async()=>(await import("./chunks/tar-M7QCUJ4B.js")).tarCommand}),Ye.push({name:"yq",load:async()=>(await import("./chunks/yq-W7OKSS7Z.js")).yqCommand}),Ye.push({name:"xan",load:async()=>(await import("./chunks/xan-BGDVQKRZ.js")).xanCommand}),Ye.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-DUARNSNG.js")).sqlite3Command}));var ps=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ps.push({name:"python3",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).python3Command}),ps.push({name:"python",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).pythonCommand}));var yi=[{name:"curl",load:async()=>(await import("./chunks/curl-P6DHVAKR.js")).curlCommand}],Dr=new Map;function ms(e){return{name:e.name,async execute(t,s){let r=Dr.get(e.name);if(r||(r=await e.load(),Dr.set(e.name,r)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:n}=await import("./chunks/flag-coverage-JBJRZ3PO.js"),{decodeArgs:i}=await import("./chunks/bytes-C34BYEMS.js");n(s.coverage,e.name,i(t))}return r.execute(t,s)}}}function Ir(e){return(e?Ye.filter(s=>e.includes(s.name)):Ye).map(ms)}function Rr(){return yi.map(ms)}function Lr(){return ps.map(ms)}function Fr(e){return"load"in e&&typeof e.load=="function"}function Mr(e){let t=null;return{name:e.name,async execute(s,r){return t||(t=await e.load()),t.execute(s,r)}}}var gi=new TextEncoder;function wi(e){return typeof e=="object"&&e!==null&&typeof e.getReader=="function"}function vi(e,t){if(e instanceof Uint8Array)return e;if(t==="base64")return Uint8Array.from(atob(e),s=>s.charCodeAt(0));if(t==="hex"){let s=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)s[r/2]=parseInt(e.slice(r,r+2),16);return s}if(t==="binary"||t==="latin1"){if(e.length<=65536)return Uint8Array.from(e,n=>n.charCodeAt(0));let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}return gi.encode(e)}function zr(e){if(e.length===0)return[];if(e.length<=ct)return[e];let t=[];for(let s=0;s<e.length;s+=ct)t.push(e.subarray(s,Math.min(s+ct,e.length)));return t}function Xe(e,t){let s=vi(e,t);return{chunks:zr(s),size:s.length}}async function Ke(e,t){if(wi(e)){let s=[],r=0;for await(let n of ut(e))if(n.length<=ct)s.push(n),r+=n.length;else for(let i of zr(n))s.push(i),r+=i.length;return{chunks:s,size:r}}return Xe(e,t)}function Dt(e,t){if(t==="base64")return btoa(wr(Wr(e)));if(t==="hex"){let n="";for(let i of e)for(let o=0;o<i.length;o++)n+=i[o].toString(16).padStart(2,"0");return n}if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(Wr(e)).toString(t);let n=65536,i="";for(let o of e)if(o.length<=n)i+=String.fromCharCode(...o);else for(let a=0;a<o.length;a+=n){let l=o.subarray(a,a+n);i+=String.fromCharCode(...l)}return i}let s=new TextDecoder,r="";for(let n of e)n.length>0&&(r+=s.decode(n,{stream:!0}));return r+=s.decode(),r}function Wr(e){let t=0;for(let n of e)t+=n.length;if(t===0)return new Uint8Array(0);if(e.length===1)return e[0];let s=new Uint8Array(t),r=0;for(let n of e)s.set(n,r),r+=n.length;return s}function Le(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}function bi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&!(e instanceof ReadableStream)&&"content"in e}function oe(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var dt=class{data=new Map;constructor(t){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),t)for(let[s,r]of Object.entries(t))if(bi(r)){if(r.content instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,r.content,void 0,{mode:r.mode,mtime:r.mtime})}else{if(r instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,r)}}normalizePath(t){if(!t||t==="/")return"/";let s=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;s.startsWith("/")||(s=`/${s}`);let r=s.split("/").filter(i=>i&&i!=="."),n=[];for(let i of r)i===".."?n.pop():n.push(i);return`/${n.join("/")}`||"/"}dirname(t){let s=this.normalizePath(t);if(s==="/")return"/";let r=s.lastIndexOf("/");return r===0?"/":s.slice(0,r)}ensureParentDirs(t){let s=this.dirname(t);s!=="/"&&(this.data.has(s)||(this.ensureParentDirs(s),this.data.set(s,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(t,s,r,n){oe(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=Le(r),{chunks:a,size:l}=Xe(s,o);this.data.set(i,{type:"file",chunks:a,size:l,mode:n?.mode??420,mtime:n?.mtime??new Date})}async readFile(t){oe(t,"open");let s=this.resolvePathWithSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);return de(r.chunks)}async readFileText(t,s){oe(t,"open");let r=this.resolvePathWithSymlinks(t),n=this.data.get(r);if(!n)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(n.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);let i=Le(s);return Dt(n.chunks,i)}async writeFile(t,s,r){oe(t,"write");let n=this.normalizePath(t);this.ensureParentDirs(n);let i=Le(r),{chunks:o,size:a}=await Ke(s,i);this.data.set(n,{type:"file",chunks:o,size:a,mode:420,mtime:new Date})}async appendFile(t,s,r){oe(t,"append");let n=this.normalizePath(t),i=this.data.get(n);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${t}'`);let o=Le(r),{chunks:a,size:l}=await Ke(s,o);i?.type==="file"?this.data.set(n,{type:"file",chunks:[...i.chunks,...a],size:i.size+l,mode:i.mode,mtime:new Date}):(this.ensureParentDirs(n),this.data.set(n,{type:"file",chunks:a,size:l,mode:420,mtime:new Date}))}async exists(t){if(t.includes("\0"))return!1;try{let s=this.resolvePathWithSymlinks(t);return this.data.has(s)}catch{return!1}}async stat(t){oe(t,"stat");let s=this.resolvePathWithSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);let n=0;return r.type==="file"&&(n=r.size),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}async lstat(t){oe(t,"lstat");let s=this.resolveIntermediateSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};let n=0;return r.type==="file"&&(n=r.size),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}resolveSymlink(t,s){if(s.startsWith("/"))return this.normalizePath(s);let r=this.dirname(t);return this.normalizePath(r==="/"?`/${s}`:`${r}/${s}`)}resolveIntermediateSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let r=s.slice(1).split("/");if(r.length<=1)return s;let n="",i=new Set;for(let o=0;o<r.length-1;o++){let a=r[o];n=`${n}/${a}`;let l=this.data.get(n),u=0,c=40;for(;l&&l.type==="symlink"&&u<c;){if(i.has(n))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(n),n=this.resolveSymlink(n,l.target),l=this.data.get(n),u++}if(u>=c)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`)}return`${n}/${r[r.length-1]}`}resolvePathWithSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let r=s.slice(1).split("/"),n="",i=new Set;for(let o of r){n=`${n}/${o}`;let a=this.data.get(n),l=0,u=40;for(;a&&a.type==="symlink"&&l<u;){if(i.has(n))throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`);i.add(n),n=this.resolveSymlink(n,a.target),a=this.data.get(n),l++}if(l>=u)throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`)}return n}async mkdir(t,s){this.mkdirSync(t,s)}mkdirSync(t,s){oe(t,"mkdir");let r=this.normalizePath(t);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(!s?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${t}'`);return}let n=this.dirname(r);if(n!=="/"&&!this.data.has(n))if(s?.recursive)this.mkdirSync(n,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(t){return(await this.readdirWithFileTypes(t)).map(r=>r.name)}async readdirWithFileTypes(t){oe(t,"scandir");let s=this.normalizePath(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let n=new Set;for(;r&&r.type==="symlink";){if(n.has(s))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);n.add(s),s=this.resolveSymlink(s,r.target),r=this.data.get(s)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let i=s==="/"?"/":`${s}/`,o=new Map;for(let[a,l]of this.data.entries())if(a!==s&&a.startsWith(i)){let u=a.slice(i.length),c=u.split("/")[0];c&&!u.includes("/",c.length)&&!o.has(c)&&o.set(c,{name:c,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,s){oe(t,"rm");let r=this.normalizePath(t),n=this.data.get(r);if(!n){if(s?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}if(n.type==="directory"){let i=await this.readdir(r);if(i.length>0){if(!s?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let o of i){let a=r==="/"?`/${o}`:`${r}/${o}`;await this.rm(a,s)}}}this.data.delete(r)}async cp(t,s,r){oe(t,"cp"),oe(s,"cp");let n=this.normalizePath(t),i=this.normalizePath(s),o=this.data.get(n);if(!o)throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(o.type==="file")this.ensureParentDirs(i),this.data.set(i,{type:"file",chunks:[...o.chunks],size:o.size,mode:o.mode,mtime:o.mtime});else if(o.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);await this.mkdir(i,{recursive:!0});let a=await this.readdir(n);for(let l of a){let u=n==="/"?`/${l}`:`${n}/${l}`,c=i==="/"?`/${l}`:`${i}/${l}`;await this.cp(u,c,r)}}}async mv(t,s){await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(t,s){if(s.startsWith("/"))return this.normalizePath(s);let r=t==="/"?`/${s}`:`${t}/${s}`;return this.normalizePath(r)}async chmod(t,s){oe(t,"chmod");let r=this.normalizePath(t),n=this.data.get(r);if(!n)throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);n.mode=s}async symlink(t,s){oe(s,"symlink");let r=this.normalizePath(s);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${s}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:t,mode:511,mtime:new Date})}async link(t,s){oe(t,"link"),oe(s,"link");let r=this.normalizePath(t),n=this.normalizePath(s),i=this.data.get(r);if(!i)throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${t}'`);if(this.data.has(n))throw new Error(`EEXIST: file already exists, link '${s}'`);this.ensureParentDirs(n),this.data.set(n,{type:"file",chunks:[...i.chunks],size:i.size,mode:i.mode,mtime:i.mtime})}async readlink(t){oe(t,"readlink");let s=this.normalizePath(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return r.target}async realpath(t){oe(t,"realpath");let s=this.resolvePathWithSymlinks(t);if(!this.data.has(s))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return s}async utimes(t,s,r){oe(t,"utimes");let n=this.normalizePath(t),i=this.resolvePathWithSymlinks(n),o=this.data.get(i);if(!o)throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);o.mtime=r}};function Si(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function Ei(e,t){e.mkdirSync("/bin",{recursive:!0}),e.mkdirSync("/usr/bin",{recursive:!0}),t&&(e.mkdirSync("/home/user",{recursive:!0}),e.mkdirSync("/tmp",{recursive:!0}))}function $i(e){e.mkdirSync("/dev",{recursive:!0}),e.writeFileSync("/dev/null",""),e.writeFileSync("/dev/zero",new Uint8Array(0)),e.writeFileSync("/dev/stdin",""),e.writeFileSync("/dev/stdout",""),e.writeFileSync("/dev/stderr","")}function Ai(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${vr}
2
+ import{A as ds,C as Pr,D as xr,E as me,F as je,G as ie,H as Ce,I as Tt,J as Nr,K as V,L as Tr,M as Or,N as Te,O as hs,P as Ot,Q as Ze,R as X,a as vr,b as as,c as br,d as Sr,e as xt,f as se,g as G,h as Pe,i as ae,j as xe,k as We,l as ls,m as Nt,n as Er,o as cs,p as $r,q as pe,r as Re,s as Ar,t as _r,u as us,v as fs,w as Ne,x as Cr,y as kr,z as _e}from"./chunks/chunk-YJFLWG5Q.js";import{a as wr}from"./chunks/chunk-RUESYAVK.js";import{a as Me,b as Ae}from"./chunks/chunk-CAXM2HMK.js";import{a as ft}from"./chunks/chunk-SE4C7FJY.js";import{a as ve,b as be,c as he,d as Ee,e as yr,f as Z,g as Be,h as Ct,i as kt,j as gr,k as ue,l as Fe,m as Pt,n as $e}from"./chunks/chunk-XILOLP4K.js";import"./chunks/chunk-OBH7XN5N.js";import{a as Ie}from"./chunks/chunk-4VDEBYW7.js";import{a as ct,b as w,c as te,d as de,e as x,f as Y,g as qe,h as D,i as os,j as ut}from"./chunks/chunk-RAUBS6MJ.js";import{a as _t,g as F,h as B,i as H,j as mr,k as lt,l as T,m as g}from"./chunks/chunk-463VWH7H.js";import{resolve as fi}from"node:path";var Ye=[{name:"echo",load:async()=>(await import("./chunks/echo-5EBIR54T.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-D4E4FTXJ.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-OCMANWQ5.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-SLO257WP.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-EOATYYLD.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5MNK2AUK.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-J6X4OW3P.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-BZWDOVUX.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-7TMSGOID.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-QUAFQDCT.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-PZ7JHGH2.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-OY5CP5QF.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-PQGDLYLZ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-F66ORZVY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YZQN4BHR.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-EI24LQBP.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-NNQHXBLM.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-6QXPS4BF.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-LTQYHOCO.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-HN3E3YFB.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-GM5WBRLU.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-FT4OVPSS.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-C3ZUQTF4.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-LMDA7QZC.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-P6LPALWP.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-6XYPZQXQ.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-2C3Q77EZ.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-67WGH7WN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-WZC4GKMG.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-SK55D7OX.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-672ZQYZF.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-AUQHJMGI.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-7CJI5ESD.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-AXXLODUK.js")).split},{name:"column",load:async()=>(await import("./chunks/column-5CUPANJY.js")).column},{name:"join",load:async()=>(await import("./chunks/join-ZK67SMQ3.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-6TEQ3DXN.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-BXGQE44U.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-XCXGYZPS.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-3LHNBKNB.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-RLXLQJVI.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-DEYTW2KI.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-W57S3E3C.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-I7QRUR36.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-P5EG7Z6I.js")).clearCommand},{name:"yes",load:async()=>(await import("./chunks/yes-A2LPETVU.js")).yesCommand},{name:"bash",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-2BGA6KZ3.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-KLZ4B6VS.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-SGBANTKE.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-KYJ2OPHH.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-CPJ3WJE7.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-LPVVIBNB.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-GJWZLHLN.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-IDAAUGIL.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-SWYNZXDP.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-WYOOUOWI.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-Y2J25KOM.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-NFAAGL44.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-MIXTZ4NP.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-2AHE4ET2.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-R7JNUPU2.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-QKNHOQPQ.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-Q5VNKVXE.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-NPAYFT3O.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-KIB3RVBF.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-IMVAQQIR.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ye.push({name:"tar",load:async()=>(await import("./chunks/tar-M7QCUJ4B.js")).tarCommand}),Ye.push({name:"yq",load:async()=>(await import("./chunks/yq-W7OKSS7Z.js")).yqCommand}),Ye.push({name:"xan",load:async()=>(await import("./chunks/xan-BGDVQKRZ.js")).xanCommand}),Ye.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-DUARNSNG.js")).sqlite3Command}));var ps=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ps.push({name:"python3",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).python3Command}),ps.push({name:"python",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).pythonCommand}));var yi=[{name:"curl",load:async()=>(await import("./chunks/curl-P6DHVAKR.js")).curlCommand}],Dr=new Map;function ms(e){return{name:e.name,async execute(t,s){let r=Dr.get(e.name);if(r||(r=await e.load(),Dr.set(e.name,r)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:n}=await import("./chunks/flag-coverage-O3TGZMW3.js"),{decodeArgs:i}=await import("./chunks/bytes-C34BYEMS.js");n(s.coverage,e.name,i(t))}return r.execute(t,s)}}}function Ir(e){return(e?Ye.filter(s=>e.includes(s.name)):Ye).map(ms)}function Rr(){return yi.map(ms)}function Lr(){return ps.map(ms)}function Fr(e){return"load"in e&&typeof e.load=="function"}function Mr(e){let t=null;return{name:e.name,async execute(s,r){return t||(t=await e.load()),t.execute(s,r)}}}var gi=new TextEncoder;function wi(e){return typeof e=="object"&&e!==null&&typeof e.getReader=="function"}function vi(e,t){if(e instanceof Uint8Array)return e;if(t==="base64")return Uint8Array.from(atob(e),s=>s.charCodeAt(0));if(t==="hex"){let s=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)s[r/2]=parseInt(e.slice(r,r+2),16);return s}if(t==="binary"||t==="latin1"){if(e.length<=65536)return Uint8Array.from(e,n=>n.charCodeAt(0));let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}return gi.encode(e)}function zr(e){if(e.length===0)return[];if(e.length<=ct)return[e];let t=[];for(let s=0;s<e.length;s+=ct)t.push(e.subarray(s,Math.min(s+ct,e.length)));return t}function Xe(e,t){let s=vi(e,t);return{chunks:zr(s),size:s.length}}async function Ke(e,t){if(wi(e)){let s=[],r=0;for await(let n of ut(e))if(n.length<=ct)s.push(n),r+=n.length;else for(let i of zr(n))s.push(i),r+=i.length;return{chunks:s,size:r}}return Xe(e,t)}function Dt(e,t){if(t==="base64")return btoa(wr(Wr(e)));if(t==="hex"){let n="";for(let i of e)for(let o=0;o<i.length;o++)n+=i[o].toString(16).padStart(2,"0");return n}if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(Wr(e)).toString(t);let n=65536,i="";for(let o of e)if(o.length<=n)i+=String.fromCharCode(...o);else for(let a=0;a<o.length;a+=n){let l=o.subarray(a,a+n);i+=String.fromCharCode(...l)}return i}let s=new TextDecoder,r="";for(let n of e)n.length>0&&(r+=s.decode(n,{stream:!0}));return r+=s.decode(),r}function Wr(e){let t=0;for(let n of e)t+=n.length;if(t===0)return new Uint8Array(0);if(e.length===1)return e[0];let s=new Uint8Array(t),r=0;for(let n of e)s.set(n,r),r+=n.length;return s}function Le(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}function bi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&!(e instanceof ReadableStream)&&"content"in e}function oe(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var dt=class{data=new Map;constructor(t){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),t)for(let[s,r]of Object.entries(t))if(bi(r)){if(r.content instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,r.content,void 0,{mode:r.mode,mtime:r.mtime})}else{if(r instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,r)}}normalizePath(t){if(!t||t==="/")return"/";let s=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;s.startsWith("/")||(s=`/${s}`);let r=s.split("/").filter(i=>i&&i!=="."),n=[];for(let i of r)i===".."?n.pop():n.push(i);return`/${n.join("/")}`||"/"}dirname(t){let s=this.normalizePath(t);if(s==="/")return"/";let r=s.lastIndexOf("/");return r===0?"/":s.slice(0,r)}ensureParentDirs(t){let s=this.dirname(t);s!=="/"&&(this.data.has(s)||(this.ensureParentDirs(s),this.data.set(s,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(t,s,r,n){oe(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=Le(r),{chunks:a,size:l}=Xe(s,o);this.data.set(i,{type:"file",chunks:a,size:l,mode:n?.mode??420,mtime:n?.mtime??new Date})}async readFile(t){oe(t,"open");let s=this.resolvePathWithSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);return de(r.chunks)}async readFileText(t,s){oe(t,"open");let r=this.resolvePathWithSymlinks(t),n=this.data.get(r);if(!n)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(n.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);let i=Le(s);return Dt(n.chunks,i)}async writeFile(t,s,r){oe(t,"write");let n=this.normalizePath(t);this.ensureParentDirs(n);let i=Le(r),{chunks:o,size:a}=await Ke(s,i);this.data.set(n,{type:"file",chunks:o,size:a,mode:420,mtime:new Date})}async appendFile(t,s,r){oe(t,"append");let n=this.normalizePath(t),i=this.data.get(n);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${t}'`);let o=Le(r),{chunks:a,size:l}=await Ke(s,o);i?.type==="file"?this.data.set(n,{type:"file",chunks:[...i.chunks,...a],size:i.size+l,mode:i.mode,mtime:new Date}):(this.ensureParentDirs(n),this.data.set(n,{type:"file",chunks:a,size:l,mode:420,mtime:new Date}))}async exists(t){if(t.includes("\0"))return!1;try{let s=this.resolvePathWithSymlinks(t);return this.data.has(s)}catch{return!1}}async stat(t){oe(t,"stat");let s=this.resolvePathWithSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);let n=0;return r.type==="file"&&(n=r.size),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}async lstat(t){oe(t,"lstat");let s=this.resolveIntermediateSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};let n=0;return r.type==="file"&&(n=r.size),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}resolveSymlink(t,s){if(s.startsWith("/"))return this.normalizePath(s);let r=this.dirname(t);return this.normalizePath(r==="/"?`/${s}`:`${r}/${s}`)}resolveIntermediateSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let r=s.slice(1).split("/");if(r.length<=1)return s;let n="",i=new Set;for(let o=0;o<r.length-1;o++){let a=r[o];n=`${n}/${a}`;let l=this.data.get(n),u=0,c=40;for(;l&&l.type==="symlink"&&u<c;){if(i.has(n))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(n),n=this.resolveSymlink(n,l.target),l=this.data.get(n),u++}if(u>=c)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`)}return`${n}/${r[r.length-1]}`}resolvePathWithSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let r=s.slice(1).split("/"),n="",i=new Set;for(let o of r){n=`${n}/${o}`;let a=this.data.get(n),l=0,u=40;for(;a&&a.type==="symlink"&&l<u;){if(i.has(n))throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`);i.add(n),n=this.resolveSymlink(n,a.target),a=this.data.get(n),l++}if(l>=u)throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`)}return n}async mkdir(t,s){this.mkdirSync(t,s)}mkdirSync(t,s){oe(t,"mkdir");let r=this.normalizePath(t);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(!s?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${t}'`);return}let n=this.dirname(r);if(n!=="/"&&!this.data.has(n))if(s?.recursive)this.mkdirSync(n,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(t){return(await this.readdirWithFileTypes(t)).map(r=>r.name)}async readdirWithFileTypes(t){oe(t,"scandir");let s=this.normalizePath(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let n=new Set;for(;r&&r.type==="symlink";){if(n.has(s))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);n.add(s),s=this.resolveSymlink(s,r.target),r=this.data.get(s)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let i=s==="/"?"/":`${s}/`,o=new Map;for(let[a,l]of this.data.entries())if(a!==s&&a.startsWith(i)){let u=a.slice(i.length),c=u.split("/")[0];c&&!u.includes("/",c.length)&&!o.has(c)&&o.set(c,{name:c,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,s){oe(t,"rm");let r=this.normalizePath(t),n=this.data.get(r);if(!n){if(s?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}if(n.type==="directory"){let i=await this.readdir(r);if(i.length>0){if(!s?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let o of i){let a=r==="/"?`/${o}`:`${r}/${o}`;await this.rm(a,s)}}}this.data.delete(r)}async cp(t,s,r){oe(t,"cp"),oe(s,"cp");let n=this.normalizePath(t),i=this.normalizePath(s),o=this.data.get(n);if(!o)throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(o.type==="file")this.ensureParentDirs(i),this.data.set(i,{type:"file",chunks:[...o.chunks],size:o.size,mode:o.mode,mtime:o.mtime});else if(o.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);await this.mkdir(i,{recursive:!0});let a=await this.readdir(n);for(let l of a){let u=n==="/"?`/${l}`:`${n}/${l}`,c=i==="/"?`/${l}`:`${i}/${l}`;await this.cp(u,c,r)}}}async mv(t,s){await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(t,s){if(s.startsWith("/"))return this.normalizePath(s);let r=t==="/"?`/${s}`:`${t}/${s}`;return this.normalizePath(r)}async chmod(t,s){oe(t,"chmod");let r=this.normalizePath(t),n=this.data.get(r);if(!n)throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);n.mode=s}async symlink(t,s){oe(s,"symlink");let r=this.normalizePath(s);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${s}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:t,mode:511,mtime:new Date})}async link(t,s){oe(t,"link"),oe(s,"link");let r=this.normalizePath(t),n=this.normalizePath(s),i=this.data.get(r);if(!i)throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${t}'`);if(this.data.has(n))throw new Error(`EEXIST: file already exists, link '${s}'`);this.ensureParentDirs(n),this.data.set(n,{type:"file",chunks:[...i.chunks],size:i.size,mode:i.mode,mtime:i.mtime})}async readlink(t){oe(t,"readlink");let s=this.normalizePath(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return r.target}async realpath(t){oe(t,"realpath");let s=this.resolvePathWithSymlinks(t);if(!this.data.has(s))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return s}async utimes(t,s,r){oe(t,"utimes");let n=this.normalizePath(t),i=this.resolvePathWithSymlinks(n),o=this.data.get(i);if(!o)throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);o.mtime=r}};function Si(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function Ei(e,t){e.mkdirSync("/bin",{recursive:!0}),e.mkdirSync("/usr/bin",{recursive:!0}),t&&(e.mkdirSync("/home/user",{recursive:!0}),e.mkdirSync("/tmp",{recursive:!0}))}function $i(e){e.mkdirSync("/dev",{recursive:!0}),e.writeFileSync("/dev/null",""),e.writeFileSync("/dev/zero",new Uint8Array(0)),e.writeFileSync("/dev/stdin",""),e.writeFileSync("/dev/stdout",""),e.writeFileSync("/dev/stderr","")}function Ai(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${vr}
3
3
  `),e.writeFileSync("/proc/self/exe","/bin/bash"),e.writeFileSync("/proc/self/cmdline","bash\0"),e.writeFileSync("/proc/self/comm",`bash
4
4
  `),e.writeFileSync("/proc/self/status",br()),e.writeFileSync("/proc/self/fd/0","/dev/stdin"),e.writeFileSync("/proc/self/fd/1","/dev/stdout"),e.writeFileSync("/proc/self/fd/2","/dev/stderr")}function Vr(e,t){Si(e)&&(Ei(e,t),$i(e),Ai(e))}var _i=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],Ci=["braceexpand","hashall","interactive-comments"];function ys(e){let t=[],s=[...Ci.map(r=>({name:r,enabled:!0})),..._i.map(r=>({name:r,enabled:e[r]}))].sort((r,n)=>r.name.localeCompare(n.name));for(let r of s)r.enabled&&t.push(r.name);return t.join(":")}function Qe(e){g(e.state.env,"SHELLOPTS",ys(e.state.options))}var ki=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function gs(e){let t=[];for(let s of ki)e[s]&&t.push(s);return t.join(":")}function ws(e){g(e.state.env,"BASHOPTS",gs(e.state.shoptOptions))}var Pi="BASH_ALIAS_";function Br(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function jr(e){if(e.parts.length!==1)return null;let t=e.parts[0];return t.type==="Literal"?t.value:null}function Hr(e,t){let s=e.env.get(`${Pi}${t}`);return s!==void 0?H(s):void 0}function vs(e,t,s){if(!t.name||!Br(t.name))return t;let r=jr(t.name);if(!r)return t;let n=Hr(e,r);if(!n||s.has(r))return t;try{s.add(r);let i=new G,o=n,a=n.endsWith(" ");if(!a)for(let f of t.args){let h=Gr(f);o+=` ${h}`}let l;try{l=i.parse(o)}catch(f){if(f instanceof xt)throw f;return t}if(l.statements.length!==1||l.statements[0].pipelines.length!==1||l.statements[0].pipelines[0].commands.length!==1)return Ur(t,n);let u=l.statements[0].pipelines[0].commands[0];if(u.type!=="SimpleCommand")return Ur(t,n);let c={...u,assignments:[...t.assignments,...u.assignments],redirections:[...u.redirections,...t.redirections],line:t.line};if(a&&t.args.length>0&&(c={...c,args:[...c.args,...t.args]},c.args.length>0)){let f=c.args[0];if(Br(f)){let h=jr(f);if(h&&Hr(e,h)){let d={type:"SimpleCommand",name:f,args:c.args.slice(1),assignments:[],redirections:[]},m=vs(e,d,s);m!==d&&(c={...c,name:m.name,args:[...m.args]})}}}return c}catch(i){throw s.delete(r),i}}function Ur(e,t){let s=t;for(let o of e.args){let a=Gr(o);s+=` ${a}`}let r=new G,n=r.parseWordFromString("eval",!1,!1),i=r.parseWordFromString(`'${s.replace(/'/g,"'\\''")}'`,!1,!1);return{type:"SimpleCommand",name:n,args:[i],assignments:e.assignments,redirections:e.redirections,line:e.line}}function Gr(e){let t="";for(let s of e.parts)switch(s.type){case"Literal":t+=s.value.replace(/([\s"'$`\\*?[\]{}()<>|&;#!])/g,"\\$1");break;case"SingleQuoted":t+=`'${s.value}'`;break;case"DoubleQuoted":t+=`"${s.parts.map(r=>r.type==="Literal"?r.value:`$${r.type}`).join("")}"`;break;case"ParameterExpansion":t+=`\${${s.parameter}}`;break;case"CommandSubstitution":t+="$(...)";break;case"ArithmeticExpansion":t+=`$((${s.expression}))`;break;case"Glob":t+=s.pattern;break;default:break}return t}async function qr(e,t){let s=t.parts.map(c=>c.type==="Literal"?c.value:"\0").join(""),r=s.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);if(!r||!s.endsWith(")"))return null;let n=r[1],i=[],o=!1,a="",l=!1;for(let c of t.parts)if(c.type==="Literal"){let f=c.value;if(!o){let h=f.indexOf("=(");h!==-1&&(o=!0,f=f.slice(h+2))}if(o){f.endsWith(")")&&(f=f.slice(0,-1));let h=f.split(/(\s+)/);for(let d of h)/^\s+$/.test(d)?(a||l)&&(i.push(a),a="",l=!1):d&&(a+=d)}}else if(o)if(c.type==="BraceExpansion")if(/^\[.+\]=/.test(a))a+=Nt({type:"Word",parts:[c]});else{(a||l)&&(i.push(a),a="",l=!1);let h=await Te(e,{type:"Word",parts:[c]});i.push(...h.values)}else{(c.type==="SingleQuoted"||c.type==="DoubleQuoted"||c.type==="Escaped")&&(l=!0);let f=await V(e,{type:"Word",parts:[c]});a+=f}(a||l)&&i.push(a);let u=i.map(c=>/^\[.+\]=/.test(c)?c:c===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(c)&&!c.startsWith("'")&&!c.startsWith('"')?`'${c.replace(/'/g,"'\\''")}'`:c);return`${n}=(${u.join(" ")})`}async function Zr(e,t){let s=-1,r=-1,n=!1;for(let p=0;p<t.parts.length;p++){let v=t.parts[p];if(v.type==="Literal"){let y=v.value.indexOf("+=");if(y!==-1){let _=v.value.slice(0,y);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(_)){s=p,r=y,n=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(_)){s=p,r=y,n=!0;break}}let E=v.value.indexOf("=");if(E!==-1&&(E===0||v.value[E-1]!=="+")){let _=v.value.slice(0,E);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(_)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(_)){s=p,r=E;break}}}}if(s===-1)return null;let i=t.parts.slice(0,s),o=t.parts[s];if(o.type!=="Literal")return null;let a=n?2:1,l=o.value.slice(0,r),u=o.value.slice(r+a),c=t.parts.slice(s+1),f="";for(let p of i)f+=await V(e,{type:"Word",parts:[p]});f+=l;let h={type:"Word",parts:u!==""?[{type:"Literal",value:u},...c]:c},d=h.parts.length>0?await V(e,h):"";return`${f}${n?"+=":"="}${d}`}var xi=["tar","yq","xan","sqlite3","python3","python"];function Yr(e){return xi.includes(e)}function j(){return{stdout:w(),stderr:w(),exitCode:0}}var Je={get stdout(){return w()},get stderr(){return w()},exitCode:0};function Se(e=w()){return{stdout:e,stderr:w(),exitCode:0}}function q(e){return{stdout:x(e),stderr:w(),exitCode:0}}function C(e,t=1){return{stdout:w(),stderr:x(e),exitCode:t}}function R(e,t,s){return{stdout:e instanceof Uint8Array?te(e):e,stderr:t instanceof Uint8Array?te(t):t,exitCode:s}}function ee(e){return{stdout:w(),stderr:w(),exitCode:e?0:1}}function ke(e,t,s,r){let n=s===void 0?w():s instanceof Uint8Array?te(s):s,i=r===void 0?void 0:r instanceof Uint8Array?te(r):r;throw new ue(e,t,n,i)}function bs(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Fe;return j()}if(t.length>1)throw new Z(1,w(),x(`bash: break: too many arguments
5
5
  `));let s=1;if(t.length>0){let r=Number.parseInt(t[0],10);if(Number.isNaN(r)||r<1)throw new Z(128,w(),x(`bash: break: ${t[0]}: numeric argument required
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{b as c}from"./chunk-RAUBS6MJ.js";import{k as r}from"./chunk-463VWH7H.js";var h={name:"yes",async execute(a){let n=r(a),d=`${n.length===0?"y":n.join(" ")}
3
+ `,t=new TextEncoder().encode(d),l=16*1024,o=Math.max(1,Math.floor(l/t.length)),m=t.length*o,s=new Uint8Array(m);for(let e=0;e<o;e++)s.set(t,e*t.length);return{stdout:new ReadableStream({pull(e){e.enqueue(s)}}),stderr:c(),exitCode:0}}},p={name:"yes",flags:[]};export{h as a,p as b};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import{b as a,e as g}from"./chunk-RAUBS6MJ.js";import{k as v}from"./chunk-463VWH7H.js";var V={name:"seq",async execute(u){let s=v(u),l=`
3
+ `,f=!1,r=[],t=0;for(;t<s.length;){let e=s[t];if(e==="-s"&&t+1<s.length){l=s[t+1],t+=2;continue}if(e==="-w"){f=!0,t++;continue}if(e==="--"){t++;break}if(e.startsWith("-")&&e!=="-"){if(e.startsWith("-s")&&e.length>2){l=e.slice(2),t++;continue}if((e==="-ws"||e==="-sw")&&(f=!0,t+1<s.length)){l=s[t+1],t+=2;continue}}r.push(e),t++}for(;t<s.length;)r.push(s[t]),t++;if(r.length===0)return{stdout:a(),stderr:g(`seq: missing operand
4
+ `),exitCode:1};let o=1,d=1,i;if(r.length===1?i=parseFloat(r[0]):r.length===2?(o=parseFloat(r[0]),i=parseFloat(r[1])):(o=parseFloat(r[0]),d=parseFloat(r[1]),i=parseFloat(r[2])),Number.isNaN(o)||Number.isNaN(d)||Number.isNaN(i)){let e=r.find(n=>Number.isNaN(parseFloat(n)));return{stdout:a(),stderr:g(`seq: invalid floating point argument: '${e}'
5
+ `),exitCode:1}}if(d===0)return{stdout:a(),stderr:g(`seq: invalid Zero increment value: '0'
6
+ `),exitCode:1};let m=Math.max(b(o),b(d),b(i)),q=0;if(f){let e=w(o,m).replace(/^-/,""),n=w(i,m).replace(/^-/,"");q=Math.max(e.length,n.length)}let y=e=>{let n=w(e,m);if(!f)return n;let N=n.startsWith("-"),C=(N?n.slice(1):n).padStart(q,"0");return N?`-${C}`:C},h=d>0;if(h&&o>i)return{stdout:a(),stderr:a(),exitCode:0};if(!h&&o<i)return{stdout:a(),stderr:a(),exitCode:0};let S=16*1024,c=o,p=!0,x=!1,W=new TextEncoder;return{stdout:new ReadableStream({pull(e){if(x){e.close();return}let n="";for(;n.length<S;){if(h?c>i+1e-10:c<i-1e-10){x=!0,p||(n+=`
7
+ `);break}let F=y(c);p?(n+=F,p=!1):n+=l+F,c+=d}n.length>0?e.enqueue(W.encode(n)):x&&e.close()}}),stderr:a(),exitCode:0}}};function b(u){let s=String(u),l=s.indexOf(".");return l===-1?0:s.length-l-1}function w(u,s){return s>0?u.toFixed(s):String(Math.round(u))}var A={name:"seq",flags:[{flag:"-s",type:"value",valueHint:"string"},{flag:"-w",type:"boolean"}],needsArgs:!0};export{V as a,A as b};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{b as yr}from"./chunk-YG67AAKF.js";import{d as Ir,e as Mr,f as jr}from"./chunk-ASU2EQWZ.js";import{b as Ar}from"./chunk-4W52T6KS.js";import{b as $r}from"./chunk-23CC4423.js";import{b as Sr}from"./chunk-7YOACDUK.js";import"./chunk-23EV7RYO.js";import"./chunk-TACNCKUC.js";import{b as Tr}from"./chunk-EHJW6FCX.js";import{b as hr}from"./chunk-GUZJZK5O.js";import{b as wr}from"./chunk-SDTTNNEH.js";import{b as xr}from"./chunk-5KQNIOZS.js";import{b as vr}from"./chunk-Z73LISDU.js";import{b as kr}from"./chunk-5IL5CXJC.js";import{b as qr}from"./chunk-V3N6H3L5.js";import{b as Cr}from"./chunk-KAWPUEQM.js";import{b as br}from"./chunk-PRQYRYWV.js";import{b as nr}from"./chunk-ECBMSCPX.js";import{b as tr}from"./chunk-HY6WUGWS.js";import{b as lr}from"./chunk-7J7OY2YE.js";import{b as ur}from"./chunk-HEO6EBJ2.js";import{b as pr}from"./chunk-XSBNCA43.js";import{b as er}from"./chunk-WXI44VNZ.js";import{b as dr}from"./chunk-NNVWOCET.js";import{b as cr}from"./chunk-YER5PEKD.js";import"./chunk-I2N72LXH.js";import{b as rr}from"./chunk-3VDZW42W.js";import{c as or,d as ar}from"./chunk-SZM4GZ4H.js";import{b as sr}from"./chunk-VWJBSJYM.js";import{b as ir}from"./chunk-H7TGYILF.js";import{c as gr,d as mr}from"./chunk-RFIBBYTO.js";import{b as Fr}from"./chunk-YGAHXCGB.js";import"./chunk-N7P3SUNH.js";import"./chunk-UYBH3FNE.js";import{b as zr}from"./chunk-D44C6YVE.js";import{b as fr}from"./chunk-RIV3HSPK.js";import{b as Q}from"./chunk-QXOUI5BS.js";import{b as R}from"./chunk-44ROJVH3.js";import{b as U}from"./chunk-UAZICDKU.js";import{b as V}from"./chunk-AN2KBMAK.js";import{b as W}from"./chunk-444WPTN5.js";import{c as X,d as Y}from"./chunk-67SBKZZD.js";import{c as Z,d as _}from"./chunk-D34QBGQ3.js";import{b as N}from"./chunk-XB426ZI7.js";import{b as E}from"./chunk-2IOUIOWE.js";import{b as G}from"./chunk-U4LP6WPJ.js";import{b as H}from"./chunk-Q2BKN6MV.js";import{b as J}from"./chunk-AZQ66C5R.js";import{b as K}from"./chunk-6U6CK6V4.js";import{b as L}from"./chunk-IAUA3FL7.js";import{b as O}from"./chunk-ZZPPBMHW.js";import{b as P}from"./chunk-SL4D2YES.js";import{b as M}from"./chunk-GIVPKQT5.js";import{b as j}from"./chunk-LVSKOXVG.js";import{b as A}from"./chunk-X7PEK6W7.js";import{b as $}from"./chunk-MPX22C7Y.js";import{b as S}from"./chunk-4VVLCPRH.js";import{b as T}from"./chunk-B4GXMUCA.js";import{b as B}from"./chunk-RUNWFUUE.js";import{b as D}from"./chunk-JU5KTPFP.js";import{b as h}from"./chunk-IQY3I4OH.js";import{b as w}from"./chunk-66PXNTAV.js";import"./chunk-RZ6FAJ25.js";import{b as x}from"./chunk-DMTOGHTU.js";import{b as v}from"./chunk-RX4PT2U7.js";import{d as k,e as q,f as C}from"./chunk-CE2ILL65.js";import"./chunk-GIFF636B.js";import{b}from"./chunk-4Y3GINAY.js";import"./chunk-BXOX2H2G.js";import{b as y}from"./chunk-EXCMJ23H.js";import{b as I}from"./chunk-FVFLR7NF.js";import{b as n}from"./chunk-XRZNW2KP.js";import{b as t}from"./chunk-NSSLXYEG.js";import{b as l}from"./chunk-HZM5PBQF.js";import{b as u}from"./chunk-CD3NCHIB.js";import{b as p}from"./chunk-QKQUVK53.js";import{b as e}from"./chunk-446TXLPR.js";import{b as d}from"./chunk-OH3VVXF7.js";import{b as c}from"./chunk-QFPJQSDK.js";import"./chunk-RUESYAVK.js";import"./chunk-CAXM2HMK.js";import"./chunk-SE4C7FJY.js";import{b as i}from"./chunk-PZ46XEZ4.js";import{b as g}from"./chunk-PKKBPSVJ.js";import"./chunk-Z72PSRMX.js";import{b as m}from"./chunk-L2KFCEBW.js";import"./chunk-K2K4KPOQ.js";import"./chunk-XILOLP4K.js";import{b as F}from"./chunk-RMG637UR.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-RAL2LVDX.js";import{b as f}from"./chunk-IPWJZ22H.js";import"./chunk-4VDEBYW7.js";import"./chunk-7VWUKGDV.js";import"./chunk-DFAHK2EQ.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";var Gr=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,y,I,M,j,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,yr,Ir,Mr,jr,Ar,$r,ir,Sr,Tr];function Br(){return Gr}var Dr=new Map;for(let r of Br())Dr.set(r.name,new Set(r.flags.map(o=>o.flag)));function fa(r,o,Er){let a=Dr.get(o);if(!(!a||a.size===0))for(let s of Er)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{fa as emitFlagCoverage};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a,b}from"./chunk-HT4IVOYZ.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";export{b as flagsForFuzzing,a as seqCommand};
2
+ import{a,b}from"./chunk-XSBNCA43.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";export{b as flagsForFuzzing,a as seqCommand};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{a,b}from"./chunk-H7TGYILF.js";import"./chunk-RAUBS6MJ.js";import"./chunk-463VWH7H.js";export{b as flagsForFuzzing,a as yesCommand};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{A as hs,C as Tn,D as On,E as ye,F as He,G as ie,H as Pe,I as Tt,J as Dn,K as V,L as In,M as Rn,N as De,O as ps,P as Ot,Q as Ze,R as X,a as En,b as ls,c as $n,d as An,e as Nt,f as se,g as G,h as xe,i as le,j as Te,k as ze,l as cs,m as xt,n as _n,o as us,p as Cn,q as me,r as Le,s as kn,t as Pn,u as fs,v as ds,w as Oe,x as Nn,y as xn,z as ke}from"./chunks/chunk-YJFLWG5Q.js";import{a as Sn}from"./chunks/chunk-RUESYAVK.js";import{a as We,b as Ce}from"./chunks/chunk-CAXM2HMK.js";import{a as ut}from"./chunks/chunk-SE4C7FJY.js";import{a as be,b as Se,c as pe,d as $e,e as vn,f as Z,g as je,h as Ct,i as kt,j as bn,k as fe,l as Fe,m as Pt,n as Ae}from"./chunks/chunk-XILOLP4K.js";import"./chunks/chunk-OBH7XN5N.js";import{a as _e}from"./chunks/chunk-4VDEBYW7.js";import{a as lt,b as w,c as te,d as he,e as N,f as Y,g as ct,h as D,i as as,j as _t}from"./chunks/chunk-RAUBS6MJ.js";import{a as At,g as M,h as B,i as H,j as wn,k as at,l as T,m as g}from"./chunks/chunk-463VWH7H.js";import*as hi from"node:fs";import*as pi from"node:readline";var Ye=[{name:"echo",load:async()=>(await import("./chunks/echo-5EBIR54T.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-D4E4FTXJ.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-OCMANWQ5.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-SLO257WP.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-EOATYYLD.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5MNK2AUK.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-J6X4OW3P.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-BZWDOVUX.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-7TMSGOID.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-QUAFQDCT.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-PZ7JHGH2.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-OY5CP5QF.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-PQGDLYLZ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-F66ORZVY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YZQN4BHR.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-EI24LQBP.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-NNQHXBLM.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-6QXPS4BF.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-LTQYHOCO.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-HN3E3YFB.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-GM5WBRLU.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-FT4OVPSS.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-C3ZUQTF4.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-LMDA7QZC.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-P6LPALWP.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-6XYPZQXQ.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-2C3Q77EZ.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-67WGH7WN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-WZC4GKMG.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-SK55D7OX.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-672ZQYZF.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-AUQHJMGI.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-7CJI5ESD.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-AXXLODUK.js")).split},{name:"column",load:async()=>(await import("./chunks/column-5CUPANJY.js")).column},{name:"join",load:async()=>(await import("./chunks/join-ZK67SMQ3.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-6TEQ3DXN.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-BXGQE44U.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-XCXGYZPS.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-3LHNBKNB.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-RLXLQJVI.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-DEYTW2KI.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-W57S3E3C.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-I7QRUR36.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-P5EG7Z6I.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-2BGA6KZ3.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-KLZ4B6VS.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-SGBANTKE.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-KYJ2OPHH.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-CPJ3WJE7.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-LPVVIBNB.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-GJWZLHLN.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-6C6VEGIG.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-SWYNZXDP.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-WYOOUOWI.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-Y2J25KOM.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-NFAAGL44.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-MIXTZ4NP.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-2AHE4ET2.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-R7JNUPU2.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-QKNHOQPQ.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-Q5VNKVXE.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-NPAYFT3O.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-KIB3RVBF.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-IMVAQQIR.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ye.push({name:"tar",load:async()=>(await import("./chunks/tar-M7QCUJ4B.js")).tarCommand}),Ye.push({name:"yq",load:async()=>(await import("./chunks/yq-W7OKSS7Z.js")).yqCommand}),Ye.push({name:"xan",load:async()=>(await import("./chunks/xan-BGDVQKRZ.js")).xanCommand}),Ye.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-DUARNSNG.js")).sqlite3Command}));var ms=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ms.push({name:"python3",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).python3Command}),ms.push({name:"python",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).pythonCommand}));var wi=[{name:"curl",load:async()=>(await import("./chunks/curl-P6DHVAKR.js")).curlCommand}],Ln=new Map;function ys(e){return{name:e.name,async execute(t,s){let n=Ln.get(e.name);if(n||(n=await e.load(),Ln.set(e.name,n)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:r}=await import("./chunks/flag-coverage-JBJRZ3PO.js"),{decodeArgs:i}=await import("./chunks/bytes-C34BYEMS.js");r(s.coverage,e.name,i(t))}return n.execute(t,s)}}}function Mn(e){return(e?Ye.filter(s=>e.includes(s.name)):Ye).map(ys)}function Fn(){return wi.map(ys)}function Wn(){return ms.map(ys)}function zn(e){return"load"in e&&typeof e.load=="function"}function Vn(e){let t=null;return{name:e.name,async execute(s,n){return t||(t=await e.load()),t.execute(s,n)}}}var vi=new TextEncoder;function bi(e){return typeof e=="object"&&e!==null&&typeof e.getReader=="function"}function Si(e,t){if(e instanceof Uint8Array)return e;if(t==="base64")return Uint8Array.from(atob(e),s=>s.charCodeAt(0));if(t==="hex"){let s=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)s[n/2]=parseInt(e.slice(n,n+2),16);return s}if(t==="binary"||t==="latin1"){if(e.length<=65536)return Uint8Array.from(e,r=>r.charCodeAt(0));let n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}return vi.encode(e)}function jn(e){if(e.length===0)return[];if(e.length<=lt)return[e];let t=[];for(let s=0;s<e.length;s+=lt)t.push(e.subarray(s,Math.min(s+lt,e.length)));return t}function Xe(e,t){let s=Si(e,t);return{chunks:jn(s),size:s.length}}async function Ke(e,t){if(bi(e)){let s=[],n=0;for await(let r of _t(e))if(r.length<=lt)s.push(r),n+=r.length;else for(let i of jn(r))s.push(i),n+=i.length;return{chunks:s,size:n}}return Xe(e,t)}function Dt(e,t){if(t==="base64")return btoa(Sn(Bn(e)));if(t==="hex"){let r="";for(let i of e)for(let o=0;o<i.length;o++)r+=i[o].toString(16).padStart(2,"0");return r}if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(Bn(e)).toString(t);let r=65536,i="";for(let o of e)if(o.length<=r)i+=String.fromCharCode(...o);else for(let a=0;a<o.length;a+=r){let c=o.subarray(a,a+r);i+=String.fromCharCode(...c)}return i}let s=new TextDecoder,n="";for(let r of e)r.length>0&&(n+=s.decode(r,{stream:!0}));return n+=s.decode(),n}function Bn(e){let t=0;for(let r of e)t+=r.length;if(t===0)return new Uint8Array(0);if(e.length===1)return e[0];let s=new Uint8Array(t),n=0;for(let r of e)s.set(r,n),n+=r.length;return s}function Me(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}function Ei(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&!(e instanceof ReadableStream)&&"content"in e}function oe(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var ft=class{data=new Map;constructor(t){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),t)for(let[s,n]of Object.entries(t))if(Ei(n)){if(n.content instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,n.content,void 0,{mode:n.mode,mtime:n.mtime})}else{if(n instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,n)}}normalizePath(t){if(!t||t==="/")return"/";let s=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;s.startsWith("/")||(s=`/${s}`);let n=s.split("/").filter(i=>i&&i!=="."),r=[];for(let i of n)i===".."?r.pop():r.push(i);return`/${r.join("/")}`||"/"}dirname(t){let s=this.normalizePath(t);if(s==="/")return"/";let n=s.lastIndexOf("/");return n===0?"/":s.slice(0,n)}ensureParentDirs(t){let s=this.dirname(t);s!=="/"&&(this.data.has(s)||(this.ensureParentDirs(s),this.data.set(s,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(t,s,n,r){oe(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=Me(n),{chunks:a,size:c}=Xe(s,o);this.data.set(i,{type:"file",chunks:a,size:c,mode:r?.mode??420,mtime:r?.mtime??new Date})}async readFile(t){oe(t,"open");let s=this.resolvePathWithSymlinks(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(n.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);return he(n.chunks)}async readFileText(t,s){oe(t,"open");let n=this.resolvePathWithSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);let i=Me(s);return Dt(r.chunks,i)}async writeFile(t,s,n){oe(t,"write");let r=this.normalizePath(t);this.ensureParentDirs(r);let i=Me(n),{chunks:o,size:a}=await Ke(s,i);this.data.set(r,{type:"file",chunks:o,size:a,mode:420,mtime:new Date})}async appendFile(t,s,n){oe(t,"append");let r=this.normalizePath(t),i=this.data.get(r);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${t}'`);let o=Me(n),{chunks:a,size:c}=await Ke(s,o);i?.type==="file"?this.data.set(r,{type:"file",chunks:[...i.chunks,...a],size:i.size+c,mode:i.mode,mtime:new Date}):(this.ensureParentDirs(r),this.data.set(r,{type:"file",chunks:a,size:c,mode:420,mtime:new Date}))}async exists(t){if(t.includes("\0"))return!1;try{let s=this.resolvePathWithSymlinks(t);return this.data.has(s)}catch{return!1}}async stat(t){oe(t,"stat");let s=this.resolvePathWithSymlinks(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);let r=0;return n.type==="file"&&(r=n.size),{isFile:n.type==="file",isDirectory:n.type==="directory",isSymbolicLink:!1,mode:n.mode,size:r,mtime:n.mtime||new Date}}async lstat(t){oe(t,"lstat");let s=this.resolveIntermediateSymlinks(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);if(n.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:n.mode,size:n.target.length,mtime:n.mtime||new Date};let r=0;return n.type==="file"&&(r=n.size),{isFile:n.type==="file",isDirectory:n.type==="directory",isSymbolicLink:!1,mode:n.mode,size:r,mtime:n.mtime||new Date}}resolveSymlink(t,s){if(s.startsWith("/"))return this.normalizePath(s);let n=this.dirname(t);return this.normalizePath(n==="/"?`/${s}`:`${n}/${s}`)}resolveIntermediateSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let n=s.slice(1).split("/");if(n.length<=1)return s;let r="",i=new Set;for(let o=0;o<n.length-1;o++){let a=n[o];r=`${r}/${a}`;let c=this.data.get(r),u=0,l=40;for(;c&&c.type==="symlink"&&u<l;){if(i.has(r))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(r),r=this.resolveSymlink(r,c.target),c=this.data.get(r),u++}if(u>=l)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`)}return`${r}/${n[n.length-1]}`}resolvePathWithSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let n=s.slice(1).split("/"),r="",i=new Set;for(let o of n){r=`${r}/${o}`;let a=this.data.get(r),c=0,u=40;for(;a&&a.type==="symlink"&&c<u;){if(i.has(r))throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`);i.add(r),r=this.resolveSymlink(r,a.target),a=this.data.get(r),c++}if(c>=u)throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`)}return r}async mkdir(t,s){this.mkdirSync(t,s)}mkdirSync(t,s){oe(t,"mkdir");let n=this.normalizePath(t);if(this.data.has(n)){if(this.data.get(n)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(!s?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${t}'`);return}let r=this.dirname(n);if(r!=="/"&&!this.data.has(r))if(s?.recursive)this.mkdirSync(r,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.data.set(n,{type:"directory",mode:493,mtime:new Date})}async readdir(t){return(await this.readdirWithFileTypes(t)).map(n=>n.name)}async readdirWithFileTypes(t){oe(t,"scandir");let s=this.normalizePath(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let r=new Set;for(;n&&n.type==="symlink";){if(r.has(s))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);r.add(s),s=this.resolveSymlink(s,n.target),n=this.data.get(s)}if(!n)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(n.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let i=s==="/"?"/":`${s}/`,o=new Map;for(let[a,c]of this.data.entries())if(a!==s&&a.startsWith(i)){let u=a.slice(i.length),l=u.split("/")[0];l&&!u.includes("/",l.length)&&!o.has(l)&&o.set(l,{name:l,isFile:c.type==="file",isDirectory:c.type==="directory",isSymbolicLink:c.type==="symlink"})}return Array.from(o.values()).sort((a,c)=>a.name<c.name?-1:a.name>c.name?1:0)}async rm(t,s){oe(t,"rm");let n=this.normalizePath(t),r=this.data.get(n);if(!r){if(s?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}if(r.type==="directory"){let i=await this.readdir(n);if(i.length>0){if(!s?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let o of i){let a=n==="/"?`/${o}`:`${n}/${o}`;await this.rm(a,s)}}}this.data.delete(n)}async cp(t,s,n){oe(t,"cp"),oe(s,"cp");let r=this.normalizePath(t),i=this.normalizePath(s),o=this.data.get(r);if(!o)throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(o.type==="file")this.ensureParentDirs(i),this.data.set(i,{type:"file",chunks:[...o.chunks],size:o.size,mode:o.mode,mtime:o.mtime});else if(o.type==="directory"){if(!n?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);await this.mkdir(i,{recursive:!0});let a=await this.readdir(r);for(let c of a){let u=r==="/"?`/${c}`:`${r}/${c}`,l=i==="/"?`/${c}`:`${i}/${c}`;await this.cp(u,l,n)}}}async mv(t,s){await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(t,s){if(s.startsWith("/"))return this.normalizePath(s);let n=t==="/"?`/${s}`:`${t}/${s}`;return this.normalizePath(n)}async chmod(t,s){oe(t,"chmod");let n=this.normalizePath(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);r.mode=s}async symlink(t,s){oe(s,"symlink");let n=this.normalizePath(s);if(this.data.has(n))throw new Error(`EEXIST: file already exists, symlink '${s}'`);this.ensureParentDirs(n),this.data.set(n,{type:"symlink",target:t,mode:511,mtime:new Date})}async link(t,s){oe(t,"link"),oe(s,"link");let n=this.normalizePath(t),r=this.normalizePath(s),i=this.data.get(n);if(!i)throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${t}'`);if(this.data.has(r))throw new Error(`EEXIST: file already exists, link '${s}'`);this.ensureParentDirs(r),this.data.set(r,{type:"file",chunks:[...i.chunks],size:i.size,mode:i.mode,mtime:i.mtime})}async readlink(t){oe(t,"readlink");let s=this.normalizePath(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(n.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return n.target}async realpath(t){oe(t,"realpath");let s=this.resolvePathWithSymlinks(t);if(!this.data.has(s))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return s}async utimes(t,s,n){oe(t,"utimes");let r=this.normalizePath(t),i=this.resolvePathWithSymlinks(r),o=this.data.get(i);if(!o)throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);o.mtime=n}};function $i(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function Ai(e,t){e.mkdirSync("/bin",{recursive:!0}),e.mkdirSync("/usr/bin",{recursive:!0}),t&&(e.mkdirSync("/home/user",{recursive:!0}),e.mkdirSync("/tmp",{recursive:!0}))}function _i(e){e.mkdirSync("/dev",{recursive:!0}),e.writeFileSync("/dev/null",""),e.writeFileSync("/dev/zero",new Uint8Array(0)),e.writeFileSync("/dev/stdin",""),e.writeFileSync("/dev/stdout",""),e.writeFileSync("/dev/stderr","")}function Ci(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${En}
2
+ import{A as hs,C as Tn,D as On,E as ye,F as He,G as ie,H as Pe,I as Tt,J as Dn,K as V,L as In,M as Rn,N as De,O as ps,P as Ot,Q as Ze,R as X,a as En,b as ls,c as $n,d as An,e as Nt,f as se,g as G,h as xe,i as le,j as Te,k as ze,l as cs,m as xt,n as _n,o as us,p as Cn,q as me,r as Le,s as kn,t as Pn,u as fs,v as ds,w as Oe,x as Nn,y as xn,z as ke}from"./chunks/chunk-YJFLWG5Q.js";import{a as Sn}from"./chunks/chunk-RUESYAVK.js";import{a as We,b as Ce}from"./chunks/chunk-CAXM2HMK.js";import{a as ut}from"./chunks/chunk-SE4C7FJY.js";import{a as be,b as Se,c as pe,d as $e,e as vn,f as Z,g as je,h as Ct,i as kt,j as bn,k as fe,l as Fe,m as Pt,n as Ae}from"./chunks/chunk-XILOLP4K.js";import"./chunks/chunk-OBH7XN5N.js";import{a as _e}from"./chunks/chunk-4VDEBYW7.js";import{a as lt,b as w,c as te,d as he,e as N,f as Y,g as ct,h as D,i as as,j as _t}from"./chunks/chunk-RAUBS6MJ.js";import{a as At,g as M,h as B,i as H,j as wn,k as at,l as T,m as g}from"./chunks/chunk-463VWH7H.js";import*as hi from"node:fs";import*as pi from"node:readline";var Ye=[{name:"echo",load:async()=>(await import("./chunks/echo-5EBIR54T.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-D4E4FTXJ.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-OCMANWQ5.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-SLO257WP.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-EOATYYLD.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5MNK2AUK.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-J6X4OW3P.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-BZWDOVUX.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-7TMSGOID.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-QUAFQDCT.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-PZ7JHGH2.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-OY5CP5QF.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-PQGDLYLZ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-F66ORZVY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YZQN4BHR.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-EI24LQBP.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-NNQHXBLM.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-6QXPS4BF.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-6OXCYWRV.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-LTQYHOCO.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-HN3E3YFB.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-GM5WBRLU.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-FT4OVPSS.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-C3ZUQTF4.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-LMDA7QZC.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-P6LPALWP.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-6XYPZQXQ.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-2C3Q77EZ.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-67WGH7WN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-WZC4GKMG.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-SK55D7OX.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-672ZQYZF.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-AUQHJMGI.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-7CJI5ESD.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-AXXLODUK.js")).split},{name:"column",load:async()=>(await import("./chunks/column-5CUPANJY.js")).column},{name:"join",load:async()=>(await import("./chunks/join-ZK67SMQ3.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-6TEQ3DXN.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-BXGQE44U.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-XCXGYZPS.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-3LHNBKNB.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-RLXLQJVI.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-DEYTW2KI.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-PWRJFDWL.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-DRSSCAUM.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-W57S3E3C.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-I7QRUR36.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-ZPDUMWHQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-P5EG7Z6I.js")).clearCommand},{name:"yes",load:async()=>(await import("./chunks/yes-A2LPETVU.js")).yesCommand},{name:"bash",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-U2E2FSIE.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-2BGA6KZ3.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-KLZ4B6VS.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-SGBANTKE.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-KYJ2OPHH.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-CPJ3WJE7.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-LPVVIBNB.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-GJWZLHLN.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-IDAAUGIL.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-SWYNZXDP.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-WYOOUOWI.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-Y2J25KOM.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-NFAAGL44.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-MIXTZ4NP.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-2AHE4ET2.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-R7JNUPU2.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-QKNHOQPQ.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-Q5VNKVXE.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-NPAYFT3O.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-KIB3RVBF.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-IMVAQQIR.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-AKQBQW7Y.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ye.push({name:"tar",load:async()=>(await import("./chunks/tar-M7QCUJ4B.js")).tarCommand}),Ye.push({name:"yq",load:async()=>(await import("./chunks/yq-W7OKSS7Z.js")).yqCommand}),Ye.push({name:"xan",load:async()=>(await import("./chunks/xan-BGDVQKRZ.js")).xanCommand}),Ye.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-DUARNSNG.js")).sqlite3Command}));var ms=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ms.push({name:"python3",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).python3Command}),ms.push({name:"python",load:async()=>(await import("./chunks/python3-HNLPOBYQ.js")).pythonCommand}));var wi=[{name:"curl",load:async()=>(await import("./chunks/curl-P6DHVAKR.js")).curlCommand}],Ln=new Map;function ys(e){return{name:e.name,async execute(t,s){let n=Ln.get(e.name);if(n||(n=await e.load(),Ln.set(e.name,n)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:r}=await import("./chunks/flag-coverage-O3TGZMW3.js"),{decodeArgs:i}=await import("./chunks/bytes-C34BYEMS.js");r(s.coverage,e.name,i(t))}return n.execute(t,s)}}}function Mn(e){return(e?Ye.filter(s=>e.includes(s.name)):Ye).map(ys)}function Fn(){return wi.map(ys)}function Wn(){return ms.map(ys)}function zn(e){return"load"in e&&typeof e.load=="function"}function Vn(e){let t=null;return{name:e.name,async execute(s,n){return t||(t=await e.load()),t.execute(s,n)}}}var vi=new TextEncoder;function bi(e){return typeof e=="object"&&e!==null&&typeof e.getReader=="function"}function Si(e,t){if(e instanceof Uint8Array)return e;if(t==="base64")return Uint8Array.from(atob(e),s=>s.charCodeAt(0));if(t==="hex"){let s=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)s[n/2]=parseInt(e.slice(n,n+2),16);return s}if(t==="binary"||t==="latin1"){if(e.length<=65536)return Uint8Array.from(e,r=>r.charCodeAt(0));let n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}return vi.encode(e)}function jn(e){if(e.length===0)return[];if(e.length<=lt)return[e];let t=[];for(let s=0;s<e.length;s+=lt)t.push(e.subarray(s,Math.min(s+lt,e.length)));return t}function Xe(e,t){let s=Si(e,t);return{chunks:jn(s),size:s.length}}async function Ke(e,t){if(bi(e)){let s=[],n=0;for await(let r of _t(e))if(r.length<=lt)s.push(r),n+=r.length;else for(let i of jn(r))s.push(i),n+=i.length;return{chunks:s,size:n}}return Xe(e,t)}function Dt(e,t){if(t==="base64")return btoa(Sn(Bn(e)));if(t==="hex"){let r="";for(let i of e)for(let o=0;o<i.length;o++)r+=i[o].toString(16).padStart(2,"0");return r}if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(Bn(e)).toString(t);let r=65536,i="";for(let o of e)if(o.length<=r)i+=String.fromCharCode(...o);else for(let a=0;a<o.length;a+=r){let c=o.subarray(a,a+r);i+=String.fromCharCode(...c)}return i}let s=new TextDecoder,n="";for(let r of e)r.length>0&&(n+=s.decode(r,{stream:!0}));return n+=s.decode(),n}function Bn(e){let t=0;for(let r of e)t+=r.length;if(t===0)return new Uint8Array(0);if(e.length===1)return e[0];let s=new Uint8Array(t),n=0;for(let r of e)s.set(r,n),n+=r.length;return s}function Me(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}function Ei(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&!(e instanceof ReadableStream)&&"content"in e}function oe(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var ft=class{data=new Map;constructor(t){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),t)for(let[s,n]of Object.entries(t))if(Ei(n)){if(n.content instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,n.content,void 0,{mode:n.mode,mtime:n.mtime})}else{if(n instanceof ReadableStream)throw new Error("InMemoryFs: streams not supported in InitialFiles; use writeFile() after construction");this.writeFileSync(s,n)}}normalizePath(t){if(!t||t==="/")return"/";let s=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;s.startsWith("/")||(s=`/${s}`);let n=s.split("/").filter(i=>i&&i!=="."),r=[];for(let i of n)i===".."?r.pop():r.push(i);return`/${r.join("/")}`||"/"}dirname(t){let s=this.normalizePath(t);if(s==="/")return"/";let n=s.lastIndexOf("/");return n===0?"/":s.slice(0,n)}ensureParentDirs(t){let s=this.dirname(t);s!=="/"&&(this.data.has(s)||(this.ensureParentDirs(s),this.data.set(s,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(t,s,n,r){oe(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=Me(n),{chunks:a,size:c}=Xe(s,o);this.data.set(i,{type:"file",chunks:a,size:c,mode:r?.mode??420,mtime:r?.mtime??new Date})}async readFile(t){oe(t,"open");let s=this.resolvePathWithSymlinks(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(n.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);return he(n.chunks)}async readFileText(t,s){oe(t,"open");let n=this.resolvePathWithSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);let i=Me(s);return Dt(r.chunks,i)}async writeFile(t,s,n){oe(t,"write");let r=this.normalizePath(t);this.ensureParentDirs(r);let i=Me(n),{chunks:o,size:a}=await Ke(s,i);this.data.set(r,{type:"file",chunks:o,size:a,mode:420,mtime:new Date})}async appendFile(t,s,n){oe(t,"append");let r=this.normalizePath(t),i=this.data.get(r);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${t}'`);let o=Me(n),{chunks:a,size:c}=await Ke(s,o);i?.type==="file"?this.data.set(r,{type:"file",chunks:[...i.chunks,...a],size:i.size+c,mode:i.mode,mtime:new Date}):(this.ensureParentDirs(r),this.data.set(r,{type:"file",chunks:a,size:c,mode:420,mtime:new Date}))}async exists(t){if(t.includes("\0"))return!1;try{let s=this.resolvePathWithSymlinks(t);return this.data.has(s)}catch{return!1}}async stat(t){oe(t,"stat");let s=this.resolvePathWithSymlinks(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);let r=0;return n.type==="file"&&(r=n.size),{isFile:n.type==="file",isDirectory:n.type==="directory",isSymbolicLink:!1,mode:n.mode,size:r,mtime:n.mtime||new Date}}async lstat(t){oe(t,"lstat");let s=this.resolveIntermediateSymlinks(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);if(n.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:n.mode,size:n.target.length,mtime:n.mtime||new Date};let r=0;return n.type==="file"&&(r=n.size),{isFile:n.type==="file",isDirectory:n.type==="directory",isSymbolicLink:!1,mode:n.mode,size:r,mtime:n.mtime||new Date}}resolveSymlink(t,s){if(s.startsWith("/"))return this.normalizePath(s);let n=this.dirname(t);return this.normalizePath(n==="/"?`/${s}`:`${n}/${s}`)}resolveIntermediateSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let n=s.slice(1).split("/");if(n.length<=1)return s;let r="",i=new Set;for(let o=0;o<n.length-1;o++){let a=n[o];r=`${r}/${a}`;let c=this.data.get(r),u=0,l=40;for(;c&&c.type==="symlink"&&u<l;){if(i.has(r))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(r),r=this.resolveSymlink(r,c.target),c=this.data.get(r),u++}if(u>=l)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`)}return`${r}/${n[n.length-1]}`}resolvePathWithSymlinks(t){let s=this.normalizePath(t);if(s==="/")return"/";let n=s.slice(1).split("/"),r="",i=new Set;for(let o of n){r=`${r}/${o}`;let a=this.data.get(r),c=0,u=40;for(;a&&a.type==="symlink"&&c<u;){if(i.has(r))throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`);i.add(r),r=this.resolveSymlink(r,a.target),a=this.data.get(r),c++}if(c>=u)throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`)}return r}async mkdir(t,s){this.mkdirSync(t,s)}mkdirSync(t,s){oe(t,"mkdir");let n=this.normalizePath(t);if(this.data.has(n)){if(this.data.get(n)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(!s?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${t}'`);return}let r=this.dirname(n);if(r!=="/"&&!this.data.has(r))if(s?.recursive)this.mkdirSync(r,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.data.set(n,{type:"directory",mode:493,mtime:new Date})}async readdir(t){return(await this.readdirWithFileTypes(t)).map(n=>n.name)}async readdirWithFileTypes(t){oe(t,"scandir");let s=this.normalizePath(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let r=new Set;for(;n&&n.type==="symlink";){if(r.has(s))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);r.add(s),s=this.resolveSymlink(s,n.target),n=this.data.get(s)}if(!n)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(n.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let i=s==="/"?"/":`${s}/`,o=new Map;for(let[a,c]of this.data.entries())if(a!==s&&a.startsWith(i)){let u=a.slice(i.length),l=u.split("/")[0];l&&!u.includes("/",l.length)&&!o.has(l)&&o.set(l,{name:l,isFile:c.type==="file",isDirectory:c.type==="directory",isSymbolicLink:c.type==="symlink"})}return Array.from(o.values()).sort((a,c)=>a.name<c.name?-1:a.name>c.name?1:0)}async rm(t,s){oe(t,"rm");let n=this.normalizePath(t),r=this.data.get(n);if(!r){if(s?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}if(r.type==="directory"){let i=await this.readdir(n);if(i.length>0){if(!s?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let o of i){let a=n==="/"?`/${o}`:`${n}/${o}`;await this.rm(a,s)}}}this.data.delete(n)}async cp(t,s,n){oe(t,"cp"),oe(s,"cp");let r=this.normalizePath(t),i=this.normalizePath(s),o=this.data.get(r);if(!o)throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(o.type==="file")this.ensureParentDirs(i),this.data.set(i,{type:"file",chunks:[...o.chunks],size:o.size,mode:o.mode,mtime:o.mtime});else if(o.type==="directory"){if(!n?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);await this.mkdir(i,{recursive:!0});let a=await this.readdir(r);for(let c of a){let u=r==="/"?`/${c}`:`${r}/${c}`,l=i==="/"?`/${c}`:`${i}/${c}`;await this.cp(u,l,n)}}}async mv(t,s){await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(t,s){if(s.startsWith("/"))return this.normalizePath(s);let n=t==="/"?`/${s}`:`${t}/${s}`;return this.normalizePath(n)}async chmod(t,s){oe(t,"chmod");let n=this.normalizePath(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);r.mode=s}async symlink(t,s){oe(s,"symlink");let n=this.normalizePath(s);if(this.data.has(n))throw new Error(`EEXIST: file already exists, symlink '${s}'`);this.ensureParentDirs(n),this.data.set(n,{type:"symlink",target:t,mode:511,mtime:new Date})}async link(t,s){oe(t,"link"),oe(s,"link");let n=this.normalizePath(t),r=this.normalizePath(s),i=this.data.get(n);if(!i)throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${t}'`);if(this.data.has(r))throw new Error(`EEXIST: file already exists, link '${s}'`);this.ensureParentDirs(r),this.data.set(r,{type:"file",chunks:[...i.chunks],size:i.size,mode:i.mode,mtime:i.mtime})}async readlink(t){oe(t,"readlink");let s=this.normalizePath(t),n=this.data.get(s);if(!n)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(n.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return n.target}async realpath(t){oe(t,"realpath");let s=this.resolvePathWithSymlinks(t);if(!this.data.has(s))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return s}async utimes(t,s,n){oe(t,"utimes");let r=this.normalizePath(t),i=this.resolvePathWithSymlinks(r),o=this.data.get(i);if(!o)throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);o.mtime=n}};function $i(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function Ai(e,t){e.mkdirSync("/bin",{recursive:!0}),e.mkdirSync("/usr/bin",{recursive:!0}),t&&(e.mkdirSync("/home/user",{recursive:!0}),e.mkdirSync("/tmp",{recursive:!0}))}function _i(e){e.mkdirSync("/dev",{recursive:!0}),e.writeFileSync("/dev/null",""),e.writeFileSync("/dev/zero",new Uint8Array(0)),e.writeFileSync("/dev/stdin",""),e.writeFileSync("/dev/stdout",""),e.writeFileSync("/dev/stderr","")}function Ci(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${En}
3
3
  `),e.writeFileSync("/proc/self/exe","/bin/bash"),e.writeFileSync("/proc/self/cmdline","bash\0"),e.writeFileSync("/proc/self/comm",`bash
4
4
  `),e.writeFileSync("/proc/self/status",$n()),e.writeFileSync("/proc/self/fd/0","/dev/stdin"),e.writeFileSync("/proc/self/fd/1","/dev/stdout"),e.writeFileSync("/proc/self/fd/2","/dev/stderr")}function Hn(e,t){$i(e)&&(Ai(e,t),_i(e),Ci(e))}var ki=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],Pi=["braceexpand","hashall","interactive-comments"];function gs(e){let t=[],s=[...Pi.map(n=>({name:n,enabled:!0})),...ki.map(n=>({name:n,enabled:e[n]}))].sort((n,r)=>n.name.localeCompare(r.name));for(let n of s)n.enabled&&t.push(n.name);return t.join(":")}function Qe(e){g(e.state.env,"SHELLOPTS",gs(e.state.options))}var Ni=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function ws(e){let t=[];for(let s of Ni)e[s]&&t.push(s);return t.join(":")}function vs(e){g(e.state.env,"BASHOPTS",ws(e.state.shoptOptions))}var xi="BASH_ALIAS_";function Un(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function Gn(e){if(e.parts.length!==1)return null;let t=e.parts[0];return t.type==="Literal"?t.value:null}function qn(e,t){let s=e.env.get(`${xi}${t}`);return s!==void 0?H(s):void 0}function bs(e,t,s){if(!t.name||!Un(t.name))return t;let n=Gn(t.name);if(!n)return t;let r=qn(e,n);if(!r||s.has(n))return t;try{s.add(n);let i=new G,o=r,a=r.endsWith(" ");if(!a)for(let f of t.args){let h=Yn(f);o+=` ${h}`}let c;try{c=i.parse(o)}catch(f){if(f instanceof Nt)throw f;return t}if(c.statements.length!==1||c.statements[0].pipelines.length!==1||c.statements[0].pipelines[0].commands.length!==1)return Zn(t,r);let u=c.statements[0].pipelines[0].commands[0];if(u.type!=="SimpleCommand")return Zn(t,r);let l={...u,assignments:[...t.assignments,...u.assignments],redirections:[...u.redirections,...t.redirections],line:t.line};if(a&&t.args.length>0&&(l={...l,args:[...l.args,...t.args]},l.args.length>0)){let f=l.args[0];if(Un(f)){let h=Gn(f);if(h&&qn(e,h)){let d={type:"SimpleCommand",name:f,args:l.args.slice(1),assignments:[],redirections:[]},m=bs(e,d,s);m!==d&&(l={...l,name:m.name,args:[...m.args]})}}}return l}catch(i){throw s.delete(n),i}}function Zn(e,t){let s=t;for(let o of e.args){let a=Yn(o);s+=` ${a}`}let n=new G,r=n.parseWordFromString("eval",!1,!1),i=n.parseWordFromString(`'${s.replace(/'/g,"'\\''")}'`,!1,!1);return{type:"SimpleCommand",name:r,args:[i],assignments:e.assignments,redirections:e.redirections,line:e.line}}function Yn(e){let t="";for(let s of e.parts)switch(s.type){case"Literal":t+=s.value.replace(/([\s"'$`\\*?[\]{}()<>|&;#!])/g,"\\$1");break;case"SingleQuoted":t+=`'${s.value}'`;break;case"DoubleQuoted":t+=`"${s.parts.map(n=>n.type==="Literal"?n.value:`$${n.type}`).join("")}"`;break;case"ParameterExpansion":t+=`\${${s.parameter}}`;break;case"CommandSubstitution":t+="$(...)";break;case"ArithmeticExpansion":t+=`$((${s.expression}))`;break;case"Glob":t+=s.pattern;break;default:break}return t}async function Xn(e,t){let s=t.parts.map(l=>l.type==="Literal"?l.value:"\0").join(""),n=s.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);if(!n||!s.endsWith(")"))return null;let r=n[1],i=[],o=!1,a="",c=!1;for(let l of t.parts)if(l.type==="Literal"){let f=l.value;if(!o){let h=f.indexOf("=(");h!==-1&&(o=!0,f=f.slice(h+2))}if(o){f.endsWith(")")&&(f=f.slice(0,-1));let h=f.split(/(\s+)/);for(let d of h)/^\s+$/.test(d)?(a||c)&&(i.push(a),a="",c=!1):d&&(a+=d)}}else if(o)if(l.type==="BraceExpansion")if(/^\[.+\]=/.test(a))a+=xt({type:"Word",parts:[l]});else{(a||c)&&(i.push(a),a="",c=!1);let h=await De(e,{type:"Word",parts:[l]});i.push(...h.values)}else{(l.type==="SingleQuoted"||l.type==="DoubleQuoted"||l.type==="Escaped")&&(c=!0);let f=await V(e,{type:"Word",parts:[l]});a+=f}(a||c)&&i.push(a);let u=i.map(l=>/^\[.+\]=/.test(l)?l:l===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(l)&&!l.startsWith("'")&&!l.startsWith('"')?`'${l.replace(/'/g,"'\\''")}'`:l);return`${r}=(${u.join(" ")})`}async function Kn(e,t){let s=-1,n=-1,r=!1;for(let p=0;p<t.parts.length;p++){let v=t.parts[p];if(v.type==="Literal"){let y=v.value.indexOf("+=");if(y!==-1){let _=v.value.slice(0,y);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(_)){s=p,n=y,r=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(_)){s=p,n=y,r=!0;break}}let E=v.value.indexOf("=");if(E!==-1&&(E===0||v.value[E-1]!=="+")){let _=v.value.slice(0,E);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(_)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(_)){s=p,n=E;break}}}}if(s===-1)return null;let i=t.parts.slice(0,s),o=t.parts[s];if(o.type!=="Literal")return null;let a=r?2:1,c=o.value.slice(0,n),u=o.value.slice(n+a),l=t.parts.slice(s+1),f="";for(let p of i)f+=await V(e,{type:"Word",parts:[p]});f+=c;let h={type:"Word",parts:u!==""?[{type:"Literal",value:u},...l]:l},d=h.parts.length>0?await V(e,h):"";return`${f}${r?"+=":"="}${d}`}var Ti=["tar","yq","xan","sqlite3","python3","python"];function Qn(e){return Ti.includes(e)}function j(){return{stdout:w(),stderr:w(),exitCode:0}}var Je={get stdout(){return w()},get stderr(){return w()},exitCode:0};function Ee(e=w()){return{stdout:e,stderr:w(),exitCode:0}}function q(e){return{stdout:N(e),stderr:w(),exitCode:0}}function C(e,t=1){return{stdout:w(),stderr:N(e),exitCode:t}}function R(e,t,s){return{stdout:e instanceof Uint8Array?te(e):e,stderr:t instanceof Uint8Array?te(t):t,exitCode:s}}function ee(e){return{stdout:w(),stderr:w(),exitCode:e?0:1}}function Ne(e,t,s,n){let r=s===void 0?w():s instanceof Uint8Array?te(s):s,i=n===void 0?void 0:n instanceof Uint8Array?te(n):n;throw new fe(e,t,r,i)}function Ss(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Fe;return j()}if(t.length>1)throw new Z(1,w(),N(`bash: break: too many arguments
5
5
  `));let s=1;if(t.length>0){let n=Number.parseInt(t[0],10);if(Number.isNaN(n)||n<1)throw new Z(128,w(),N(`bash: break: ${t[0]}: numeric argument required