just-bash 2.10.2 → 2.10.3

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.
@@ -39,7 +39,7 @@ ${d}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;br
39
39
  `||a===";"||a==="}"||a==="{")break;r+=this.advance()}return{type:e,value:t,label:r||void 0,line:n,column:s}}readVersion(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
40
40
  `||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:l.VERSION,value:"v",label:n||void 0,line:e,column:t}}readFileCommand(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
41
41
  `||a===";")break;r+=this.advance()}return{type:e,value:t,filename:r.trim(),line:n,column:s}}readExecute(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
42
- `||s===";")break;n+=this.advance()}return{type:l.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var H=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new w(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let s=this.parseCommand();if(s.error)return{commands:[],error:s.error};s.command&&e.push(s.command)}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(l.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(l.NEWLINE)||this.check(l.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case l.COMMAND:return this.parseSimpleCommand(n,t);case l.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case l.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case l.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case l.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case l.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case l.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case l.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case l.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case l.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case l.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case l.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case l.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case l.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case l.LBRACE:return this.parseGroup(t);case l.RBRACE:return{command:null};case l.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,r=n.match(/(\d+)/);return r&&(s=parseInt(r[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(l.RBRACE);){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let n=this.parseCommand();if(n.error)return{command:null,error:n.error};n.command&&t.push(n.command)}return this.check(l.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(l.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(l.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case l.NUMBER:return this.advance(),e.value;case l.DOLLAR:return this.advance(),"$";case l.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case l.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case l.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:l.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===l.EOF}};function Q(i,e=!1){let t=!1,n=!1,s=[];for(let o=0;o<i.length;o++){let d=i[o];if(s.length===0&&o===0){let p=d.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let E=p[1].toLowerCase();E.includes("n")&&(t=!0),E.includes("r")&&(n=!0),d=d.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
42
+ `||s===";")break;n+=this.advance()}return{type:l.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var H=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new w(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let s=this.pos,r=this.parseCommand();if(r.error)return{commands:[],error:r.error};if(r.command&&e.push(r.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(l.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(l.NEWLINE)||this.check(l.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case l.COMMAND:return this.parseSimpleCommand(n,t);case l.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case l.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case l.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case l.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case l.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case l.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case l.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case l.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case l.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case l.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case l.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case l.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case l.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case l.LBRACE:return this.parseGroup(t);case l.RBRACE:return{command:null};case l.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,r=n.match(/(\d+)/);return r&&(s=parseInt(r[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(l.RBRACE);){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let n=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&t.push(s.command),this.pos===n&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(l.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(l.COMMA))return{error:"expected context address"};let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(l.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(l.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case l.NUMBER:return this.advance(),e.value;case l.DOLLAR:return this.advance(),"$";case l.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case l.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case l.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:l.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===l.EOF}};function Q(i,e=!1){let t=!1,n=!1,s=[];for(let o=0;o<i.length;o++){let d=i[o];if(s.length===0&&o===0){let p=d.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let E=p[1].toLowerCase();E.includes("n")&&(t=!0),E.includes("r")&&(n=!0),d=d.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
43
43
  ${d}`}else s.push(d)}let r=s.join(`
44
44
  `),c=new H([r],e||n).parse();if(!c.error&&c.commands.length>0){let o=fe(c.commands);if(o)return{commands:[],error:o,silentMode:t,extendedRegexMode:n}}return{...c,silentMode:t,extendedRegexMode:n}}function fe(i){let e=new Set;J(i,e);let t=Y(i,e);if(t)return`undefined label '${t}'`}function J(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&J(t.commands,e)}function Y(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=Y(t.commands,e);if(n)return n}}}var pe={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
45
45
  s/regexp/replacement/[flags] substitute
@@ -72,15 +72,15 @@ Addresses:
72
72
  N,M range from line N to M
73
73
  first~step every step-th line starting at first`};async function z(i,e,t,n={}){let{limits:s,filename:r,fs:a,cwd:c,coverage:o}=n,d=i.endsWith(`
74
74
  `),p=i.split(`
75
- `);p.length>0&&p[p.length-1]===""&&p.pop();let E=p.length,m="",f,u=!1,h=s?.maxStringLength??0,b=k=>{if(m+=k,h>0&&m.length>h)throw new x(`sed: output size limit exceeded (${h} bytes)`,"string_length")},C="",y,ee=new Map,F=new Map,$=new Map,_=new Map,te=s?{maxIterations:s.maxSedIterations}:void 0;for(let k=0;k<p.length;k++){let g={...K(E,r,ee),patternSpace:p[k],holdSpace:C,lastPattern:y,lineNumber:k+1,totalLines:E,substitutionMade:!1,coverage:o},ne={lines:p,currentLineIndex:k},V=0,ie=1e4;g.linesConsumedInCycle=0;do{if(V++,V>ie)break;if(g.restartCycle=!1,g.pendingFileReads=[],g.pendingFileWrites=[],U(e,g,ne,te),a&&c){for(let v of g.pendingFileReads){let R=a.resolvePath(c,v.filename);try{if(v.wholeFile){let S=await a.readFile(R);g.appendBuffer.push(S.replace(/\n$/,""))}else{if(!F.has(R)){let re=await a.readFile(R);F.set(R,re.split(`
76
- `)),$.set(R,0)}let S=F.get(R),A=$.get(R);S&&A!==void 0&&A<S.length&&(g.appendBuffer.push(S[A]),$.set(R,A+1))}}catch{}}for(let v of g.pendingFileWrites){let R=a.resolvePath(c,v.filename),S=_.get(R)||"";_.set(R,S+v.content)}}}while(g.restartCycle&&!g.deleted&&!g.quit&&!g.quitSilent);if(k+=g.linesConsumedInCycle,C=g.holdSpace,y=g.lastPattern,!t)for(let v of g.nCommandOutput)b(`${v}
75
+ `);p.length>0&&p[p.length-1]===""&&p.pop();let E=p.length,m="",f,u=!1,h=s?.maxStringLength??0,b=R=>{if(m+=R,h>0&&m.length>h)throw new x(`sed: output size limit exceeded (${h} bytes)`,"string_length")},C="",y,ee=new Map,F=new Map,$=new Map,M=new Map,te=s?{maxIterations:s.maxSedIterations}:void 0;for(let R=0;R<p.length;R++){let g={...K(E,r,ee),patternSpace:p[R],holdSpace:C,lastPattern:y,lineNumber:R+1,totalLines:E,substitutionMade:!1,coverage:o},ne={lines:p,currentLineIndex:R},V=0,ie=1e4;g.linesConsumedInCycle=0;do{if(V++,V>ie)break;if(g.restartCycle=!1,g.pendingFileReads=[],g.pendingFileWrites=[],U(e,g,ne,te),a&&c){for(let v of g.pendingFileReads){let k=a.resolvePath(c,v.filename);try{if(v.wholeFile){let S=await a.readFile(k);g.appendBuffer.push(S.replace(/\n$/,""))}else{if(!F.has(k)){let re=await a.readFile(k);F.set(k,re.split(`
76
+ `)),$.set(k,0)}let S=F.get(k),A=$.get(k);S&&A!==void 0&&A<S.length&&(g.appendBuffer.push(S[A]),$.set(k,A+1))}}catch{}}for(let v of g.pendingFileWrites){let k=a.resolvePath(c,v.filename),S=M.get(k)||"";M.set(k,S+v.content)}}}while(g.restartCycle&&!g.deleted&&!g.quit&&!g.quitSilent);if(R+=g.linesConsumedInCycle,C=g.holdSpace,y=g.lastPattern,!t)for(let v of g.nCommandOutput)b(`${v}
77
77
  `);let se=g.lineNumberOutput.length>0;for(let v of g.lineNumberOutput)b(`${v}
78
- `);let X=[],M=[];for(let v of g.appendBuffer)v.startsWith("__INSERT__")?X.push(v.slice(10)):M.push(v);for(let v of X)b(`${v}
78
+ `);let X=[],_=[];for(let v of g.appendBuffer)v.startsWith("__INSERT__")?X.push(v.slice(10)):_.push(v);for(let v of X)b(`${v}
79
79
  `);let L=!1;!g.deleted&&!g.quitSilent?t?g.printed&&(b(`${g.patternSpace}
80
80
  `),L=!0):(b(`${g.patternSpace}
81
81
  `),L=!0):g.changedText!==void 0&&(b(`${g.changedText}
82
- `),L=!0);for(let v of M)b(`${v}
83
- `);if(u=(se||L)&&M.length===0,g.quit||g.quitSilent){if(g.exitCode!==void 0&&(f=g.exitCode),g.errorMessage)return{output:"",exitCode:f||1,errorMessage:g.errorMessage};break}}if(a&&c)for(let[k,g]of _)try{await a.writeFile(k,g)}catch{}return!d&&u&&m.endsWith(`
82
+ `),L=!0);for(let v of _)b(`${v}
83
+ `);if(u=(se||L)&&_.length===0,g.quit||g.quitSilent){if(g.exitCode!==void 0&&(f=g.exitCode),g.errorMessage)return{output:"",exitCode:f||1,errorMessage:g.errorMessage};break}}if(a&&c)for(let[R,g]of M)try{await a.writeFile(R,g)}catch{}return!d&&u&&m.endsWith(`
84
84
  `)&&(m=m.slice(0,-1)),{output:m,exitCode:f}}var Ne={name:"sed",async execute(i,e){if(j(i))return G(pe);let t=[],n=[],s=!1,r=!1,a=!1,c=[];for(let u=0;u<i.length;u++){let h=i[u];if(h==="-n"||h==="--quiet"||h==="--silent")s=!0;else if(h==="-i"||h==="--in-place")r=!0;else if(h.startsWith("-i"))r=!0;else if(h==="-E"||h==="-r"||h==="--regexp-extended")a=!0;else if(h==="-e")u+1<i.length&&t.push(i[++u]);else if(h==="-f")u+1<i.length&&n.push(i[++u]);else{if(h.startsWith("--"))return T("sed",h);if(h==="-")c.push(h);else if(h.startsWith("-")&&h.length>1){for(let b of h.slice(1))if(b!=="n"&&b!=="e"&&b!=="f"&&b!=="i"&&b!=="E"&&b!=="r")return T("sed",`-${b}`);h.includes("n")&&(s=!0),h.includes("i")&&(r=!0),(h.includes("E")||h.includes("r"))&&(a=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&u+1<i.length&&t.push(i[++u]),h.includes("f")&&!h.includes("e")&&u+1<i.length&&n.push(i[++u])}else!h.startsWith("-")&&t.length===0&&n.length===0?t.push(h):h.startsWith("-")||c.push(h)}}for(let u of n){let h=e.fs.resolvePath(e.cwd,u);try{let b=await e.fs.readFile(h);for(let C of b.split(`
85
85
  `)){let y=C.trim();y&&!y.startsWith("#")&&t.push(y)}}catch{return{stdout:"",stderr:`sed: couldn't open file ${u}: No such file or directory
86
86
  `,exitCode:1}}}if(t.length===0)return{stdout:"",stderr:`sed: no script specified
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{b as yr}from"./chunk-EFX3F2HZ.js";import{b as Ar}from"./chunk-CHB75QIN.js";import{b as $r}from"./chunk-MNNOATCV.js";import"./chunk-GZHFXDDO.js";import"./chunk-QSDVMMYI.js";import{b as Sr}from"./chunk-PDVXLMUU.js";import{b as wr}from"./chunk-XKPFI566.js";import{b as xr}from"./chunk-KLMOJKL4.js";import{b as vr}from"./chunk-TIDZOIPX.js";import{b as kr}from"./chunk-6VUEI2GS.js";import{b as qr}from"./chunk-BYDV4VEF.js";import{b as Cr}from"./chunk-JLX6YWGA.js";import{b as br}from"./chunk-FLPVVSN5.js";import{d as Ir,e as Mr,f as jr}from"./chunk-DAGNL3F2.js";import{b as tr}from"./chunk-P7UCWJ33.js";import{b as lr}from"./chunk-N73TVRMN.js";import{b as ur}from"./chunk-THALLNXT.js";import{b as pr}from"./chunk-2SIXTZCJ.js";import{b as er}from"./chunk-3Y32LPNT.js";import{b as dr}from"./chunk-7BORMNPQ.js";import{b as cr}from"./chunk-N43DJTSI.js";import"./chunk-OBI37ZY4.js";import{b as hr}from"./chunk-N5OTVT4F.js";import{c as or,d as ar}from"./chunk-MAVV76T4.js";import{b as sr}from"./chunk-JTF74J6E.js";import{c as ir,d as gr}from"./chunk-RDZMRK5M.js";import{b as mr}from"./chunk-QEBPVWVB.js";import"./chunk-A4442AOC.js";import"./chunk-UYBH3FNE.js";import{b as Fr}from"./chunk-BARKRZDC.js";import{b as zr}from"./chunk-P6GNZPVW.js";import{b as fr}from"./chunk-IY3BUFJK.js";import{b as nr}from"./chunk-NFZDITRV.js";import{b as R}from"./chunk-PQNTKMH3.js";import{b as U}from"./chunk-PPBQJBC2.js";import{b as V}from"./chunk-NSUMEERA.js";import{b as W}from"./chunk-4PS5JJDT.js";import{c as X,d as Y}from"./chunk-W2FKF3MM.js";import{c as Z,d as _}from"./chunk-3MBAUIBB.js";import{b as N}from"./chunk-RT7TRQVZ.js";import{b as rr}from"./chunk-JXC25GVQ.js";import{b as G}from"./chunk-RJSAGJQJ.js";import{b as H}from"./chunk-YEKSVVRC.js";import{b as J}from"./chunk-26NO42TF.js";import{b as K}from"./chunk-QXB5WI2V.js";import{b as L}from"./chunk-LMK6G2HH.js";import{b as O}from"./chunk-ZKC5HQYO.js";import{b as P}from"./chunk-ROJPSS6N.js";import{b as Q}from"./chunk-7ECKLAVW.js";import{b as y}from"./chunk-NEQEZ32M.js";import{b as A}from"./chunk-ZA4HUKJ3.js";import{b as $}from"./chunk-5U7Q4GUC.js";import{b as S}from"./chunk-JQBC3FXE.js";import{b as T}from"./chunk-BDSRLH5T.js";import{b as B}from"./chunk-5G2VOPPJ.js";import{b as D}from"./chunk-SGA7Y45Z.js";import{b as E}from"./chunk-EUXCM6C4.js";import{b as w}from"./chunk-YLE2OYY6.js";import{b as x}from"./chunk-S7OHMN3F.js";import{b as v}from"./chunk-XAL6VWGA.js";import{d as k,e as q,f as C}from"./chunk-WT2HWDDA.js";import"./chunk-GIFF636B.js";import{b}from"./chunk-Q4QFIAHB.js";import"./chunk-G43H2WGH.js";import{b as I}from"./chunk-FEBB4TFH.js";import{b as M}from"./chunk-K7XSYP4L.js";import{b as j}from"./chunk-THLAHQXV.js";import{b as t}from"./chunk-YYQ22ZRL.js";import{b as l}from"./chunk-PS4LOXE5.js";import{b as u}from"./chunk-VNER2XXL.js";import{b as p}from"./chunk-4E3LY6YK.js";import{b as e}from"./chunk-5VFN7VVJ.js";import{b as d}from"./chunk-TEFXEYX3.js";import{b as c}from"./chunk-D2GFNFUN.js";import{b as h}from"./chunk-SXRVLCZ4.js";import"./chunk-FSZWFMB4.js";import"./chunk-4PRVMER6.js";import"./chunk-SE4C7FJY.js";import{b as i}from"./chunk-LJKIWB5F.js";import{b as g}from"./chunk-K47SEEPI.js";import"./chunk-5WFYIUU2.js";import{b as m}from"./chunk-X2I3PJTX.js";import"./chunk-D5WP4CKS.js";import"./chunk-K5IXNHO5.js";import{b as F}from"./chunk-4P5OA25Z.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-KWLLB7S3.js";import{b as f}from"./chunk-EJQKHROT.js";import"./chunk-JBABAK44.js";import{b as n}from"./chunk-ITA43A73.js";import"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,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,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
2
+ import{b as yr}from"./chunk-EFX3F2HZ.js";import{b as Ar}from"./chunk-CHB75QIN.js";import{b as $r}from"./chunk-MNNOATCV.js";import"./chunk-GZHFXDDO.js";import"./chunk-QSDVMMYI.js";import{b as Sr}from"./chunk-PDVXLMUU.js";import{b as wr}from"./chunk-XKPFI566.js";import{b as xr}from"./chunk-KLMOJKL4.js";import{b as vr}from"./chunk-TIDZOIPX.js";import{b as kr}from"./chunk-6VUEI2GS.js";import{b as qr}from"./chunk-BYDV4VEF.js";import{b as Cr}from"./chunk-JLX6YWGA.js";import{b as br}from"./chunk-FLPVVSN5.js";import{d as Ir,e as Mr,f as jr}from"./chunk-DAGNL3F2.js";import{b as tr}from"./chunk-P7UCWJ33.js";import{b as lr}from"./chunk-N73TVRMN.js";import{b as ur}from"./chunk-THALLNXT.js";import{b as pr}from"./chunk-2SIXTZCJ.js";import{b as er}from"./chunk-3Y32LPNT.js";import{b as dr}from"./chunk-7BORMNPQ.js";import{b as cr}from"./chunk-N43DJTSI.js";import"./chunk-OBI37ZY4.js";import{b as hr}from"./chunk-N5OTVT4F.js";import{c as or,d as ar}from"./chunk-MAVV76T4.js";import{b as sr}from"./chunk-JTF74J6E.js";import{c as ir,d as gr}from"./chunk-RDZMRK5M.js";import{b as mr}from"./chunk-QEBPVWVB.js";import"./chunk-A4442AOC.js";import"./chunk-UYBH3FNE.js";import{b as Fr}from"./chunk-BARKRZDC.js";import{b as zr}from"./chunk-P6GNZPVW.js";import{b as fr}from"./chunk-IY3BUFJK.js";import{b as nr}from"./chunk-NFZDITRV.js";import{b as R}from"./chunk-PQNTKMH3.js";import{b as U}from"./chunk-PPBQJBC2.js";import{b as V}from"./chunk-NSUMEERA.js";import{b as W}from"./chunk-4PS5JJDT.js";import{c as X,d as Y}from"./chunk-W2FKF3MM.js";import{c as Z,d as _}from"./chunk-3MBAUIBB.js";import{b as N}from"./chunk-RT7TRQVZ.js";import{b as rr}from"./chunk-JXC25GVQ.js";import{b as G}from"./chunk-RJSAGJQJ.js";import{b as H}from"./chunk-YEKSVVRC.js";import{b as J}from"./chunk-26NO42TF.js";import{b as K}from"./chunk-QXB5WI2V.js";import{b as L}from"./chunk-LMK6G2HH.js";import{b as O}from"./chunk-ZKC5HQYO.js";import{b as P}from"./chunk-ROJPSS6N.js";import{b as Q}from"./chunk-7ECKLAVW.js";import{b as y}from"./chunk-NEQEZ32M.js";import{b as A}from"./chunk-ZA4HUKJ3.js";import{b as $}from"./chunk-5U7Q4GUC.js";import{b as S}from"./chunk-JQBC3FXE.js";import{b as T}from"./chunk-BDSRLH5T.js";import{b as B}from"./chunk-5G2VOPPJ.js";import{b as D}from"./chunk-SGA7Y45Z.js";import{b as E}from"./chunk-EUXCM6C4.js";import{b as w}from"./chunk-YLE2OYY6.js";import{b as x}from"./chunk-S7OHMN3F.js";import{b as v}from"./chunk-XAL6VWGA.js";import{d as k,e as q,f as C}from"./chunk-WT2HWDDA.js";import"./chunk-GIFF636B.js";import{b}from"./chunk-Q4QFIAHB.js";import"./chunk-G43H2WGH.js";import{b as I}from"./chunk-4U7XM2O3.js";import{b as M}from"./chunk-K7XSYP4L.js";import{b as j}from"./chunk-THLAHQXV.js";import{b as t}from"./chunk-YYQ22ZRL.js";import{b as l}from"./chunk-PS4LOXE5.js";import{b as u}from"./chunk-VNER2XXL.js";import{b as p}from"./chunk-4E3LY6YK.js";import{b as e}from"./chunk-5VFN7VVJ.js";import{b as d}from"./chunk-TEFXEYX3.js";import{b as c}from"./chunk-D2GFNFUN.js";import{b as h}from"./chunk-SXRVLCZ4.js";import"./chunk-FSZWFMB4.js";import"./chunk-4PRVMER6.js";import"./chunk-SE4C7FJY.js";import{b as i}from"./chunk-LJKIWB5F.js";import{b as g}from"./chunk-K47SEEPI.js";import"./chunk-5WFYIUU2.js";import{b as m}from"./chunk-X2I3PJTX.js";import"./chunk-D5WP4CKS.js";import"./chunk-K5IXNHO5.js";import{b as F}from"./chunk-4P5OA25Z.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-KWLLB7S3.js";import{b as f}from"./chunk-EJQKHROT.js";import"./chunk-JBABAK44.js";import{b as n}from"./chunk-ITA43A73.js";import"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,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,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)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-FEBB4TFH.js";import"./chunk-SE4C7FJY.js";import"./chunk-K5IXNHO5.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as sedCommand};
2
+ import{a,b}from"./chunk-4U7XM2O3.js";import"./chunk-SE4C7FJY.js";import"./chunk-K5IXNHO5.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as sedCommand};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{B as mr,C as yr,D as oe,E as Fe,F as X,G as ve,H as $t,I as gr,J as T,K as wr,L as vr,M as Ee,N as rs,O as Et,P as V,a as ar,b as Yt,c as lr,d as vt,e as Z,f as W,g as ge,h as Q,i as $e,j as Oe,k as Qt,l as bt,m as cr,n as Jt,o as ur,p as he,q as Ce,r as fr,s as dr,t as es,u as ts,v as De,w as hr,x as pr,y as we,z as ss}from"./chunks/chunk-LS25HZNJ.js";import{a as Ne,b as ye}from"./chunks/chunk-4PRVMER6.js";import{a as tt}from"./chunks/chunk-SE4C7FJY.js";import{a as ue,b as fe,c as ie,d as de,e as ir,f as z,g as Le,h as yt,i as gt,j as or,k as se,l as ke,m as wt,n as me}from"./chunks/chunk-K5IXNHO5.js";import"./chunks/chunk-OBH7XN5N.js";import{a as _e}from"./chunks/chunk-4VDEBYW7.js";import{a as mt}from"./chunks/chunk-KGOUQS5A.js";import{resolve as ri}from"node:path";var je=[{name:"echo",load:async()=>(await import("./chunks/echo-2MUAOGUE.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-3J7U3HHI.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-TZC5BRAY.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-ZXYOL67L.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-6OKMS3KO.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5KLM4EA6.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-DWKSZGOQ.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-5QIBTLJG.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XH2ZB7WT.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-OY7X62QC.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-5TCJXDGY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-4O2C4V42.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-6VBAPL3Y.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-YNOUXNUY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YMNRW3F3.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-V537TDFR.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-ZIV3TFVG.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-XH7E4E2C.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-3R5G2XL4.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-WNL6TIIN.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-PWEGD656.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-NZSEYCI6.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-FZWFZEN5.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-R3F3Z5DX.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-HDHQDWRG.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-3UVLMQ2K.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-GDDRKGRB.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-UHEPS2UL.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-XH3L75DR.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-XSVNTAWH.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-26XPP5KB.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-OYZ7KOYR.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-XXKZCWY5.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-NOZ7FFXW.js")).split},{name:"column",load:async()=>(await import("./chunks/column-XGV32UPN.js")).column},{name:"join",load:async()=>(await import("./chunks/join-Y4Q5WVVE.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-HK2SYCAR.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-K777TRNA.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-KBUKWB2E.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-5FAOMLBL.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-HEKABARE.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-66BNA4IN.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-UUKG55YW.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-YWPEV2QC.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-DP5UZP52.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-DP5UZP52.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-KRGKPFOI.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-WB6O736J.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-WB6O736J.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-CXQ33VMW.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-YXBFJFHG.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-LE7GMFZD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-6VDN5QZ5.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-PICQVS6Q.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-RS7REDYT.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-4C3A4THJ.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-V7KBLSQ7.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-MLHUWFYI.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-NCLXV2S3.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-BHNJ5ALF.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-HJJ3NJ5L.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-D5YKS5NV.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-WVZA3MCP.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-JF5TTAKQ.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-67WZ6OMV.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-TZBNTR4K.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WY6RKE32.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-E7PN2UWC.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-52FBC34W.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(je.push({name:"tar",load:async()=>(await import("./chunks/tar-7B5KH3QG.js")).tarCommand}),je.push({name:"yq",load:async()=>(await import("./chunks/yq-WUJ5JNDT.js")).yqCommand}),je.push({name:"xan",load:async()=>(await import("./chunks/xan-FMSZPFX4.js")).xanCommand}),je.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-4SEIR46P.js")).sqlite3Command}));var ns=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ns.push({name:"python3",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).python3Command}),ns.push({name:"python",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).pythonCommand}));var li=[{name:"curl",load:async()=>(await import("./chunks/curl-RWQO3SBN.js")).curlCommand}],br=new Map;function is(e){return{name:e.name,async execute(t,s){let r=br.get(e.name);if(r||(r=await e.load(),br.set(e.name,r)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:n}=await import("./chunks/flag-coverage-SFRIE2LL.js");n(s.coverage,e.name,t)}return r.execute(t,s)}}}function $r(e){return(e?je.filter(s=>e.includes(s.name)):je).map(is)}function Er(){return li.map(is)}function Sr(){return ns.map(is)}function Ar(e){return"load"in e&&typeof e.load=="function"}function _r(e){let t=null;return{name:e.name,async execute(s,r){return t||(t=await e.load()),t.execute(s,r)}}}var ci=new TextEncoder,ui=new TextDecoder;function He(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 ci.encode(e)}function St(e,t){if(t==="base64")return btoa(String.fromCharCode(...e));if(t==="hex")return Array.from(e).map(s=>s.toString(16).padStart(2,"0")).join("");if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(e).toString(t);let s=65536;if(e.length<=s)return String.fromCharCode(...e);let r="";for(let n=0;n<e.length;n+=s){let i=e.subarray(n,n+s);r+=String.fromCharCode(...i)}return r}return ui.decode(e)}function xe(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}var Ue=new TextEncoder;function fi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}function J(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var st=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))typeof r=="function"?this.writeFileLazy(s,r):fi(r)?this.writeFileSync(s,r.content,void 0,{mode:r.mode,mtime:r.mtime}):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){J(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=xe(r),a=He(s,o);this.data.set(i,{type:"file",content:a,mode:n?.mode??420,mtime:n?.mtime??new Date})}writeFileLazy(t,s,r){J(t,"write");let n=this.normalizePath(t);this.ensureParentDirs(n),this.data.set(n,{type:"file",lazy:s,mode:r?.mode??420,mtime:r?.mtime??new Date})}async materializeLazy(t,s){let r=await s.lazy(),i={type:"file",content:typeof r=="string"?Ue.encode(r):r,mode:s.mode,mtime:s.mtime};return this.data.set(t,i),i}async readFile(t,s){let r=await this.readFileBuffer(t),n=xe(s);return St(r,n)}async readFileBuffer(t){J(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}'`);if("lazy"in r){let n=await this.materializeLazy(s,r);return n.content instanceof Uint8Array?n.content:Ue.encode(n.content)}return r.content instanceof Uint8Array?r.content:Ue.encode(r.content)}async writeFile(t,s,r){this.writeFileSync(t,s,r)}async appendFile(t,s,r){J(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=xe(r),a=He(s,o);if(i?.type==="file"){let c=i;"lazy"in c&&(c=await this.materializeLazy(n,c));let l="content"in c&&c.content instanceof Uint8Array?c.content:Ue.encode("content"in c?c.content:""),u=new Uint8Array(l.length+a.length);u.set(l),u.set(a,l.length),this.data.set(n,{type:"file",content:u,mode:c.mode,mtime:new Date})}else this.writeFileSync(t,s,r)}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){J(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}'`);r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ue.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}async lstat(t){J(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};r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ue.encode(r.content).length),{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 c=this.data.get(n),l=0,u=40;for(;c&&c.type==="symlink"&&l<u;){if(i.has(n))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(n),n=this.resolveSymlink(n,c.target),c=this.data.get(n),l++}if(l>=u)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),c=0,l=40;for(;a&&a.type==="symlink"&&c<l;){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),c++}if(c>=l)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){J(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){J(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,c]of this.data.entries())if(a!==s&&a.startsWith(i)){let l=a.slice(i.length),u=l.split("/")[0];u&&!l.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,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){J(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){J(t,"cp"),J(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,{...o});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 c of a){let l=n==="/"?`/${c}`:`${n}/${c}`,u=i==="/"?`/${c}`:`${i}/${c}`;await this.cp(l,u,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){J(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){J(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){J(t,"link"),J(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}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(r,o)),this.ensureParentDirs(n),this.data.set(n,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(t){J(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){J(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){J(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 di(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function hi(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 pi(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 mi(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${ar}
2
+ import{B as mr,C as yr,D as oe,E as Fe,F as X,G as ve,H as $t,I as gr,J as T,K as wr,L as vr,M as Ee,N as rs,O as Et,P as V,a as ar,b as Yt,c as lr,d as vt,e as Z,f as W,g as ge,h as Q,i as $e,j as Oe,k as Qt,l as bt,m as cr,n as Jt,o as ur,p as he,q as Ce,r as fr,s as dr,t as es,u as ts,v as De,w as hr,x as pr,y as we,z as ss}from"./chunks/chunk-LS25HZNJ.js";import{a as Ne,b as ye}from"./chunks/chunk-4PRVMER6.js";import{a as tt}from"./chunks/chunk-SE4C7FJY.js";import{a as ue,b as fe,c as ie,d as de,e as ir,f as z,g as Le,h as yt,i as gt,j as or,k as se,l as ke,m as wt,n as me}from"./chunks/chunk-K5IXNHO5.js";import"./chunks/chunk-OBH7XN5N.js";import{a as _e}from"./chunks/chunk-4VDEBYW7.js";import{a as mt}from"./chunks/chunk-KGOUQS5A.js";import{resolve as ri}from"node:path";var je=[{name:"echo",load:async()=>(await import("./chunks/echo-2MUAOGUE.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-3J7U3HHI.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-TZC5BRAY.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-ZXYOL67L.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-6OKMS3KO.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5KLM4EA6.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-DWKSZGOQ.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-5QIBTLJG.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XH2ZB7WT.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-OY7X62QC.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-5TCJXDGY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-4O2C4V42.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-6VBAPL3Y.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-YNOUXNUY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YMNRW3F3.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-V537TDFR.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-ZIV3TFVG.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-XH7E4E2C.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-3R5G2XL4.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-PHQQJ4SI.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-PWEGD656.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-NZSEYCI6.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-FZWFZEN5.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-R3F3Z5DX.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-HDHQDWRG.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-3UVLMQ2K.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-GDDRKGRB.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-UHEPS2UL.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-XH3L75DR.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-XSVNTAWH.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-26XPP5KB.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-OYZ7KOYR.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-XXKZCWY5.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-NOZ7FFXW.js")).split},{name:"column",load:async()=>(await import("./chunks/column-XGV32UPN.js")).column},{name:"join",load:async()=>(await import("./chunks/join-Y4Q5WVVE.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-HK2SYCAR.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-K777TRNA.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-KBUKWB2E.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-5FAOMLBL.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-HEKABARE.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-66BNA4IN.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-UUKG55YW.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-YWPEV2QC.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-DP5UZP52.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-DP5UZP52.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-KRGKPFOI.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-WB6O736J.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-WB6O736J.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-CXQ33VMW.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-YXBFJFHG.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-LE7GMFZD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-6VDN5QZ5.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-PICQVS6Q.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-RS7REDYT.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-4C3A4THJ.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-V7KBLSQ7.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-MLHUWFYI.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-NCLXV2S3.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-BHNJ5ALF.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-HJJ3NJ5L.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-D5YKS5NV.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-WVZA3MCP.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-JF5TTAKQ.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-67WZ6OMV.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-TZBNTR4K.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WY6RKE32.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-E7PN2UWC.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-52FBC34W.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(je.push({name:"tar",load:async()=>(await import("./chunks/tar-7B5KH3QG.js")).tarCommand}),je.push({name:"yq",load:async()=>(await import("./chunks/yq-WUJ5JNDT.js")).yqCommand}),je.push({name:"xan",load:async()=>(await import("./chunks/xan-FMSZPFX4.js")).xanCommand}),je.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-4SEIR46P.js")).sqlite3Command}));var ns=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ns.push({name:"python3",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).python3Command}),ns.push({name:"python",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).pythonCommand}));var li=[{name:"curl",load:async()=>(await import("./chunks/curl-RWQO3SBN.js")).curlCommand}],br=new Map;function is(e){return{name:e.name,async execute(t,s){let r=br.get(e.name);if(r||(r=await e.load(),br.set(e.name,r)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:n}=await import("./chunks/flag-coverage-WM63KT7D.js");n(s.coverage,e.name,t)}return r.execute(t,s)}}}function $r(e){return(e?je.filter(s=>e.includes(s.name)):je).map(is)}function Er(){return li.map(is)}function Sr(){return ns.map(is)}function Ar(e){return"load"in e&&typeof e.load=="function"}function _r(e){let t=null;return{name:e.name,async execute(s,r){return t||(t=await e.load()),t.execute(s,r)}}}var ci=new TextEncoder,ui=new TextDecoder;function He(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 ci.encode(e)}function St(e,t){if(t==="base64")return btoa(String.fromCharCode(...e));if(t==="hex")return Array.from(e).map(s=>s.toString(16).padStart(2,"0")).join("");if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(e).toString(t);let s=65536;if(e.length<=s)return String.fromCharCode(...e);let r="";for(let n=0;n<e.length;n+=s){let i=e.subarray(n,n+s);r+=String.fromCharCode(...i)}return r}return ui.decode(e)}function xe(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}var Ue=new TextEncoder;function fi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}function J(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var st=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))typeof r=="function"?this.writeFileLazy(s,r):fi(r)?this.writeFileSync(s,r.content,void 0,{mode:r.mode,mtime:r.mtime}):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){J(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=xe(r),a=He(s,o);this.data.set(i,{type:"file",content:a,mode:n?.mode??420,mtime:n?.mtime??new Date})}writeFileLazy(t,s,r){J(t,"write");let n=this.normalizePath(t);this.ensureParentDirs(n),this.data.set(n,{type:"file",lazy:s,mode:r?.mode??420,mtime:r?.mtime??new Date})}async materializeLazy(t,s){let r=await s.lazy(),i={type:"file",content:typeof r=="string"?Ue.encode(r):r,mode:s.mode,mtime:s.mtime};return this.data.set(t,i),i}async readFile(t,s){let r=await this.readFileBuffer(t),n=xe(s);return St(r,n)}async readFileBuffer(t){J(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}'`);if("lazy"in r){let n=await this.materializeLazy(s,r);return n.content instanceof Uint8Array?n.content:Ue.encode(n.content)}return r.content instanceof Uint8Array?r.content:Ue.encode(r.content)}async writeFile(t,s,r){this.writeFileSync(t,s,r)}async appendFile(t,s,r){J(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=xe(r),a=He(s,o);if(i?.type==="file"){let c=i;"lazy"in c&&(c=await this.materializeLazy(n,c));let l="content"in c&&c.content instanceof Uint8Array?c.content:Ue.encode("content"in c?c.content:""),u=new Uint8Array(l.length+a.length);u.set(l),u.set(a,l.length),this.data.set(n,{type:"file",content:u,mode:c.mode,mtime:new Date})}else this.writeFileSync(t,s,r)}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){J(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}'`);r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ue.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}async lstat(t){J(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};r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ue.encode(r.content).length),{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 c=this.data.get(n),l=0,u=40;for(;c&&c.type==="symlink"&&l<u;){if(i.has(n))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(n),n=this.resolveSymlink(n,c.target),c=this.data.get(n),l++}if(l>=u)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),c=0,l=40;for(;a&&a.type==="symlink"&&c<l;){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),c++}if(c>=l)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){J(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){J(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,c]of this.data.entries())if(a!==s&&a.startsWith(i)){let l=a.slice(i.length),u=l.split("/")[0];u&&!l.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,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){J(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){J(t,"cp"),J(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,{...o});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 c of a){let l=n==="/"?`/${c}`:`${n}/${c}`,u=i==="/"?`/${c}`:`${i}/${c}`;await this.cp(l,u,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){J(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){J(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){J(t,"link"),J(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}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(r,o)),this.ensureParentDirs(n),this.data.set(n,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(t){J(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){J(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){J(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 di(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function hi(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 pi(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 mi(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${ar}
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.writeFileLazy?e.writeFileLazy("/proc/self/status",Yt):e.writeFileSync("/proc/self/status",Yt()),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 Cr(e,t){di(e)&&(hi(e,t),pi(e),mi(e))}var yi=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],gi=["braceexpand","hashall","interactive-comments"];function os(e){let t=[],s=[...gi.map(r=>({name:r,enabled:!0})),...yi.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){e.state.env.set("SHELLOPTS",os(e.state.options))}var wi=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function as(e){let t=[];for(let s of wi)e[s]&&t.push(s);return t.join(":")}function ls(e){e.state.env.set("BASHOPTS",as(e.state.shoptOptions))}var vi="BASH_ALIAS_";function Pr(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function kr(e){if(e.parts.length!==1)return null;let t=e.parts[0];return t.type==="Literal"?t.value:null}function Nr(e,t){return e.env.get(`${vi}${t}`)}function cs(e,t,s){if(!t.name||!Pr(t.name))return t;let r=kr(t.name);if(!r)return t;let n=Nr(e,r);if(!n||s.has(r))return t;try{s.add(r);let i=new W,o=n,a=n.endsWith(" ");if(!a)for(let f of t.args){let d=Dr(f);o+=` ${d}`}let c;try{c=i.parse(o)}catch(f){if(f instanceof vt)throw f;return t}if(c.statements.length!==1||c.statements[0].pipelines.length!==1||c.statements[0].pipelines[0].commands.length!==1)return Or(t,n);let l=c.statements[0].pipelines[0].commands[0];if(l.type!=="SimpleCommand")return Or(t,n);let u={...l,assignments:[...t.assignments,...l.assignments],redirections:[...l.redirections,...t.redirections],line:t.line};if(a&&t.args.length>0&&(u={...u,args:[...u.args,...t.args]},u.args.length>0)){let f=u.args[0];if(Pr(f)){let d=kr(f);if(d&&Nr(e,d)){let h={type:"SimpleCommand",name:f,args:u.args.slice(1),assignments:[],redirections:[]},m=cs(e,h,s);m!==h&&(u={...u,name:m.name,args:[...m.args]})}}}return u}catch(i){throw s.delete(r),i}}function Or(e,t){let s=t;for(let o of e.args){let a=Dr(o);s+=` ${a}`}let r=new W,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 Dr(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 xr(e,t){let s=t.parts.map(u=>u.type==="Literal"?u.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="",c=!1;for(let u of t.parts)if(u.type==="Literal"){let f=u.value;if(!o){let d=f.indexOf("=(");d!==-1&&(o=!0,f=f.slice(d+2))}if(o){f.endsWith(")")&&(f=f.slice(0,-1));let d=f.split(/(\s+)/);for(let h of d)/^\s+$/.test(h)?(a||c)&&(i.push(a),a="",c=!1):h&&(a+=h)}}else if(o)if(u.type==="BraceExpansion")if(/^\[.+\]=/.test(a))a+=bt({type:"Word",parts:[u]});else{(a||c)&&(i.push(a),a="",c=!1);let d=await Ee(e,{type:"Word",parts:[u]});i.push(...d.values)}else{(u.type==="SingleQuoted"||u.type==="DoubleQuoted"||u.type==="Escaped")&&(c=!0);let f=await T(e,{type:"Word",parts:[u]});a+=f}(a||c)&&i.push(a);let l=i.map(u=>/^\[.+\]=/.test(u)?u:u===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(u)&&!u.startsWith("'")&&!u.startsWith('"')?`'${u.replace(/'/g,"'\\''")}'`:u);return`${n}=(${l.join(" ")})`}async function Tr(e,t){let s=-1,r=-1,n=!1;for(let p=0;p<t.parts.length;p++){let g=t.parts[p];if(g.type==="Literal"){let _=g.value.indexOf("+=");if(_!==-1){let S=g.value.slice(0,_);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(S)){s=p,r=_,n=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(S)){s=p,r=_,n=!0;break}}let v=g.value.indexOf("=");if(v!==-1&&(v===0||g.value[v-1]!=="+")){let S=g.value.slice(0,v);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(S)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(S)){s=p,r=v;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,c=o.value.slice(0,r),l=o.value.slice(r+a),u=t.parts.slice(s+1),f="";for(let p of i)f+=await T(e,{type:"Word",parts:[p]});f+=c;let d={type:"Word",parts:l!==""?[{type:"Literal",value:l},...u]:u},h=d.parts.length>0?await T(e,d):"";return`${f}${n?"+=":"="}${h}`}var bi=["tar","yq","xan","sqlite3","python3","python"];function Ir(e){return bi.includes(e)}var L=Object.freeze({stdout:"",stderr:"",exitCode:0});function F(e=""){return{stdout:e,stderr:"",exitCode:0}}function A(e,t=1){return{stdout:"",stderr:e,exitCode:t}}function P(e,t,s){return{stdout:e,stderr:t,exitCode:s}}function q(e){return{stdout:"",stderr:"",exitCode:e?0:1}}function Pe(e,t,s="",r=""){throw new se(e,t,s,r)}function us(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new ke;return L}if(t.length>1)throw new z(1,"",`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,"",`bash: break: ${t[0]}: numeric argument required
@@ -39,7 +39,7 @@ ${d}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;br
39
39
  `||a===";"||a==="}"||a==="{")break;r+=this.advance()}return{type:e,value:t,label:r||void 0,line:n,column:s}}readVersion(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
40
40
  `||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:l.VERSION,value:"v",label:n||void 0,line:e,column:t}}readFileCommand(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
41
41
  `||a===";")break;r+=this.advance()}return{type:e,value:t,filename:r.trim(),line:n,column:s}}readExecute(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
42
- `||s===";")break;n+=this.advance()}return{type:l.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var H=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new w(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let s=this.parseCommand();if(s.error)return{commands:[],error:s.error};s.command&&e.push(s.command)}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(l.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(l.NEWLINE)||this.check(l.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case l.COMMAND:return this.parseSimpleCommand(n,t);case l.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case l.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case l.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case l.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case l.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case l.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case l.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case l.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case l.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case l.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case l.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case l.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case l.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case l.LBRACE:return this.parseGroup(t);case l.RBRACE:return{command:null};case l.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,r=n.match(/(\d+)/);return r&&(s=parseInt(r[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(l.RBRACE);){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let n=this.parseCommand();if(n.error)return{command:null,error:n.error};n.command&&t.push(n.command)}return this.check(l.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(l.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(l.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case l.NUMBER:return this.advance(),e.value;case l.DOLLAR:return this.advance(),"$";case l.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case l.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case l.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:l.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===l.EOF}};function Q(i,e=!1){let t=!1,n=!1,s=[];for(let o=0;o<i.length;o++){let d=i[o];if(s.length===0&&o===0){let p=d.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let E=p[1].toLowerCase();E.includes("n")&&(t=!0),E.includes("r")&&(n=!0),d=d.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
42
+ `||s===";")break;n+=this.advance()}return{type:l.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var H=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new w(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let s=this.pos,r=this.parseCommand();if(r.error)return{commands:[],error:r.error};if(r.command&&e.push(r.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(l.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(l.NEWLINE)||this.check(l.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case l.COMMAND:return this.parseSimpleCommand(n,t);case l.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case l.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case l.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case l.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case l.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case l.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case l.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case l.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case l.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case l.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case l.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case l.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case l.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case l.LBRACE:return this.parseGroup(t);case l.RBRACE:return{command:null};case l.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,r=n.match(/(\d+)/);return r&&(s=parseInt(r[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(l.RBRACE);){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let n=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&t.push(s.command),this.pos===n&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(l.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(l.COMMA))return{error:"expected context address"};let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(l.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(l.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case l.NUMBER:return this.advance(),e.value;case l.DOLLAR:return this.advance(),"$";case l.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case l.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case l.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:l.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===l.EOF}};function Q(i,e=!1){let t=!1,n=!1,s=[];for(let o=0;o<i.length;o++){let d=i[o];if(s.length===0&&o===0){let p=d.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let E=p[1].toLowerCase();E.includes("n")&&(t=!0),E.includes("r")&&(n=!0),d=d.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
43
43
  ${d}`}else s.push(d)}let r=s.join(`
44
44
  `),c=new H([r],e||n).parse();if(!c.error&&c.commands.length>0){let o=fe(c.commands);if(o)return{commands:[],error:o,silentMode:t,extendedRegexMode:n}}return{...c,silentMode:t,extendedRegexMode:n}}function fe(i){let e=new Set;J(i,e);let t=Y(i,e);if(t)return`undefined label '${t}'`}function J(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&J(t.commands,e)}function Y(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=Y(t.commands,e);if(n)return n}}}var pe={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
45
45
  s/regexp/replacement/[flags] substitute
@@ -72,15 +72,15 @@ Addresses:
72
72
  N,M range from line N to M
73
73
  first~step every step-th line starting at first`};async function z(i,e,t,n={}){let{limits:s,filename:r,fs:a,cwd:c,coverage:o}=n,d=i.endsWith(`
74
74
  `),p=i.split(`
75
- `);p.length>0&&p[p.length-1]===""&&p.pop();let E=p.length,m="",f,u=!1,h=s?.maxStringLength??0,b=k=>{if(m+=k,h>0&&m.length>h)throw new x(`sed: output size limit exceeded (${h} bytes)`,"string_length")},C="",y,ee=new Map,F=new Map,$=new Map,_=new Map,te=s?{maxIterations:s.maxSedIterations}:void 0;for(let k=0;k<p.length;k++){let g={...K(E,r,ee),patternSpace:p[k],holdSpace:C,lastPattern:y,lineNumber:k+1,totalLines:E,substitutionMade:!1,coverage:o},ne={lines:p,currentLineIndex:k},V=0,ie=1e4;g.linesConsumedInCycle=0;do{if(V++,V>ie)break;if(g.restartCycle=!1,g.pendingFileReads=[],g.pendingFileWrites=[],U(e,g,ne,te),a&&c){for(let v of g.pendingFileReads){let R=a.resolvePath(c,v.filename);try{if(v.wholeFile){let S=await a.readFile(R);g.appendBuffer.push(S.replace(/\n$/,""))}else{if(!F.has(R)){let re=await a.readFile(R);F.set(R,re.split(`
76
- `)),$.set(R,0)}let S=F.get(R),A=$.get(R);S&&A!==void 0&&A<S.length&&(g.appendBuffer.push(S[A]),$.set(R,A+1))}}catch{}}for(let v of g.pendingFileWrites){let R=a.resolvePath(c,v.filename),S=_.get(R)||"";_.set(R,S+v.content)}}}while(g.restartCycle&&!g.deleted&&!g.quit&&!g.quitSilent);if(k+=g.linesConsumedInCycle,C=g.holdSpace,y=g.lastPattern,!t)for(let v of g.nCommandOutput)b(`${v}
75
+ `);p.length>0&&p[p.length-1]===""&&p.pop();let E=p.length,m="",f,u=!1,h=s?.maxStringLength??0,b=R=>{if(m+=R,h>0&&m.length>h)throw new x(`sed: output size limit exceeded (${h} bytes)`,"string_length")},C="",y,ee=new Map,F=new Map,$=new Map,M=new Map,te=s?{maxIterations:s.maxSedIterations}:void 0;for(let R=0;R<p.length;R++){let g={...K(E,r,ee),patternSpace:p[R],holdSpace:C,lastPattern:y,lineNumber:R+1,totalLines:E,substitutionMade:!1,coverage:o},ne={lines:p,currentLineIndex:R},V=0,ie=1e4;g.linesConsumedInCycle=0;do{if(V++,V>ie)break;if(g.restartCycle=!1,g.pendingFileReads=[],g.pendingFileWrites=[],U(e,g,ne,te),a&&c){for(let v of g.pendingFileReads){let k=a.resolvePath(c,v.filename);try{if(v.wholeFile){let S=await a.readFile(k);g.appendBuffer.push(S.replace(/\n$/,""))}else{if(!F.has(k)){let re=await a.readFile(k);F.set(k,re.split(`
76
+ `)),$.set(k,0)}let S=F.get(k),A=$.get(k);S&&A!==void 0&&A<S.length&&(g.appendBuffer.push(S[A]),$.set(k,A+1))}}catch{}}for(let v of g.pendingFileWrites){let k=a.resolvePath(c,v.filename),S=M.get(k)||"";M.set(k,S+v.content)}}}while(g.restartCycle&&!g.deleted&&!g.quit&&!g.quitSilent);if(R+=g.linesConsumedInCycle,C=g.holdSpace,y=g.lastPattern,!t)for(let v of g.nCommandOutput)b(`${v}
77
77
  `);let se=g.lineNumberOutput.length>0;for(let v of g.lineNumberOutput)b(`${v}
78
- `);let X=[],M=[];for(let v of g.appendBuffer)v.startsWith("__INSERT__")?X.push(v.slice(10)):M.push(v);for(let v of X)b(`${v}
78
+ `);let X=[],_=[];for(let v of g.appendBuffer)v.startsWith("__INSERT__")?X.push(v.slice(10)):_.push(v);for(let v of X)b(`${v}
79
79
  `);let L=!1;!g.deleted&&!g.quitSilent?t?g.printed&&(b(`${g.patternSpace}
80
80
  `),L=!0):(b(`${g.patternSpace}
81
81
  `),L=!0):g.changedText!==void 0&&(b(`${g.changedText}
82
- `),L=!0);for(let v of M)b(`${v}
83
- `);if(u=(se||L)&&M.length===0,g.quit||g.quitSilent){if(g.exitCode!==void 0&&(f=g.exitCode),g.errorMessage)return{output:"",exitCode:f||1,errorMessage:g.errorMessage};break}}if(a&&c)for(let[k,g]of _)try{await a.writeFile(k,g)}catch{}return!d&&u&&m.endsWith(`
82
+ `),L=!0);for(let v of _)b(`${v}
83
+ `);if(u=(se||L)&&_.length===0,g.quit||g.quitSilent){if(g.exitCode!==void 0&&(f=g.exitCode),g.errorMessage)return{output:"",exitCode:f||1,errorMessage:g.errorMessage};break}}if(a&&c)for(let[R,g]of M)try{await a.writeFile(R,g)}catch{}return!d&&u&&m.endsWith(`
84
84
  `)&&(m=m.slice(0,-1)),{output:m,exitCode:f}}var Ne={name:"sed",async execute(i,e){if(j(i))return G(pe);let t=[],n=[],s=!1,r=!1,a=!1,c=[];for(let u=0;u<i.length;u++){let h=i[u];if(h==="-n"||h==="--quiet"||h==="--silent")s=!0;else if(h==="-i"||h==="--in-place")r=!0;else if(h.startsWith("-i"))r=!0;else if(h==="-E"||h==="-r"||h==="--regexp-extended")a=!0;else if(h==="-e")u+1<i.length&&t.push(i[++u]);else if(h==="-f")u+1<i.length&&n.push(i[++u]);else{if(h.startsWith("--"))return T("sed",h);if(h==="-")c.push(h);else if(h.startsWith("-")&&h.length>1){for(let b of h.slice(1))if(b!=="n"&&b!=="e"&&b!=="f"&&b!=="i"&&b!=="E"&&b!=="r")return T("sed",`-${b}`);h.includes("n")&&(s=!0),h.includes("i")&&(r=!0),(h.includes("E")||h.includes("r"))&&(a=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&u+1<i.length&&t.push(i[++u]),h.includes("f")&&!h.includes("e")&&u+1<i.length&&n.push(i[++u])}else!h.startsWith("-")&&t.length===0&&n.length===0?t.push(h):h.startsWith("-")||c.push(h)}}for(let u of n){let h=e.fs.resolvePath(e.cwd,u);try{let b=await e.fs.readFile(h);for(let C of b.split(`
85
85
  `)){let y=C.trim();y&&!y.startsWith("#")&&t.push(y)}}catch{return{stdout:"",stderr:`sed: couldn't open file ${u}: No such file or directory
86
86
  `,exitCode:1}}}if(t.length===0)return{stdout:"",stderr:`sed: no script specified
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{b as yr}from"./chunk-EFX3F2HZ.js";import{b as Ar}from"./chunk-CHB75QIN.js";import{b as $r}from"./chunk-MNNOATCV.js";import"./chunk-GZHFXDDO.js";import"./chunk-QSDVMMYI.js";import{b as Sr}from"./chunk-PDVXLMUU.js";import{b as wr}from"./chunk-XKPFI566.js";import{b as xr}from"./chunk-KLMOJKL4.js";import{b as vr}from"./chunk-TIDZOIPX.js";import{b as kr}from"./chunk-6VUEI2GS.js";import{b as qr}from"./chunk-BYDV4VEF.js";import{b as Cr}from"./chunk-JLX6YWGA.js";import{b as br}from"./chunk-FLPVVSN5.js";import{d as Ir,e as Mr,f as jr}from"./chunk-DAGNL3F2.js";import{b as tr}from"./chunk-P7UCWJ33.js";import{b as lr}from"./chunk-N73TVRMN.js";import{b as ur}from"./chunk-THALLNXT.js";import{b as pr}from"./chunk-2SIXTZCJ.js";import{b as er}from"./chunk-3Y32LPNT.js";import{b as dr}from"./chunk-7BORMNPQ.js";import{b as cr}from"./chunk-N43DJTSI.js";import"./chunk-OBI37ZY4.js";import{b as hr}from"./chunk-N5OTVT4F.js";import{c as or,d as ar}from"./chunk-MAVV76T4.js";import{b as sr}from"./chunk-JTF74J6E.js";import{c as ir,d as gr}from"./chunk-RDZMRK5M.js";import{b as mr}from"./chunk-QEBPVWVB.js";import"./chunk-A4442AOC.js";import"./chunk-UYBH3FNE.js";import{b as Fr}from"./chunk-BARKRZDC.js";import{b as zr}from"./chunk-P6GNZPVW.js";import{b as fr}from"./chunk-IY3BUFJK.js";import{b as nr}from"./chunk-NFZDITRV.js";import{b as R}from"./chunk-PQNTKMH3.js";import{b as U}from"./chunk-PPBQJBC2.js";import{b as V}from"./chunk-NSUMEERA.js";import{b as W}from"./chunk-4PS5JJDT.js";import{c as X,d as Y}from"./chunk-W2FKF3MM.js";import{c as Z,d as _}from"./chunk-3MBAUIBB.js";import{b as N}from"./chunk-RT7TRQVZ.js";import{b as rr}from"./chunk-JXC25GVQ.js";import{b as G}from"./chunk-RJSAGJQJ.js";import{b as H}from"./chunk-YEKSVVRC.js";import{b as J}from"./chunk-26NO42TF.js";import{b as K}from"./chunk-QXB5WI2V.js";import{b as L}from"./chunk-LMK6G2HH.js";import{b as O}from"./chunk-ZKC5HQYO.js";import{b as P}from"./chunk-ROJPSS6N.js";import{b as Q}from"./chunk-7ECKLAVW.js";import{b as y}from"./chunk-NEQEZ32M.js";import{b as A}from"./chunk-ZA4HUKJ3.js";import{b as $}from"./chunk-5U7Q4GUC.js";import{b as S}from"./chunk-JQBC3FXE.js";import{b as T}from"./chunk-BDSRLH5T.js";import{b as B}from"./chunk-5G2VOPPJ.js";import{b as D}from"./chunk-SGA7Y45Z.js";import{b as E}from"./chunk-EUXCM6C4.js";import{b as w}from"./chunk-YLE2OYY6.js";import{b as x}from"./chunk-S7OHMN3F.js";import{b as v}from"./chunk-XAL6VWGA.js";import{d as k,e as q,f as C}from"./chunk-WT2HWDDA.js";import"./chunk-GIFF636B.js";import{b}from"./chunk-Q4QFIAHB.js";import"./chunk-G43H2WGH.js";import{b as I}from"./chunk-FEBB4TFH.js";import{b as M}from"./chunk-K7XSYP4L.js";import{b as j}from"./chunk-THLAHQXV.js";import{b as t}from"./chunk-YYQ22ZRL.js";import{b as l}from"./chunk-PS4LOXE5.js";import{b as u}from"./chunk-VNER2XXL.js";import{b as p}from"./chunk-4E3LY6YK.js";import{b as e}from"./chunk-5VFN7VVJ.js";import{b as d}from"./chunk-TEFXEYX3.js";import{b as c}from"./chunk-D2GFNFUN.js";import{b as h}from"./chunk-SXRVLCZ4.js";import"./chunk-FSZWFMB4.js";import"./chunk-4PRVMER6.js";import"./chunk-SE4C7FJY.js";import{b as i}from"./chunk-LJKIWB5F.js";import{b as g}from"./chunk-K47SEEPI.js";import"./chunk-5WFYIUU2.js";import{b as m}from"./chunk-X2I3PJTX.js";import"./chunk-D5WP4CKS.js";import"./chunk-K5IXNHO5.js";import{b as F}from"./chunk-4P5OA25Z.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-KWLLB7S3.js";import{b as f}from"./chunk-EJQKHROT.js";import"./chunk-JBABAK44.js";import{b as n}from"./chunk-ITA43A73.js";import"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,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,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
2
+ import{b as yr}from"./chunk-EFX3F2HZ.js";import{b as Ar}from"./chunk-CHB75QIN.js";import{b as $r}from"./chunk-MNNOATCV.js";import"./chunk-GZHFXDDO.js";import"./chunk-QSDVMMYI.js";import{b as Sr}from"./chunk-PDVXLMUU.js";import{b as wr}from"./chunk-XKPFI566.js";import{b as xr}from"./chunk-KLMOJKL4.js";import{b as vr}from"./chunk-TIDZOIPX.js";import{b as kr}from"./chunk-6VUEI2GS.js";import{b as qr}from"./chunk-BYDV4VEF.js";import{b as Cr}from"./chunk-JLX6YWGA.js";import{b as br}from"./chunk-FLPVVSN5.js";import{d as Ir,e as Mr,f as jr}from"./chunk-DAGNL3F2.js";import{b as tr}from"./chunk-P7UCWJ33.js";import{b as lr}from"./chunk-N73TVRMN.js";import{b as ur}from"./chunk-THALLNXT.js";import{b as pr}from"./chunk-2SIXTZCJ.js";import{b as er}from"./chunk-3Y32LPNT.js";import{b as dr}from"./chunk-7BORMNPQ.js";import{b as cr}from"./chunk-N43DJTSI.js";import"./chunk-OBI37ZY4.js";import{b as hr}from"./chunk-N5OTVT4F.js";import{c as or,d as ar}from"./chunk-MAVV76T4.js";import{b as sr}from"./chunk-JTF74J6E.js";import{c as ir,d as gr}from"./chunk-RDZMRK5M.js";import{b as mr}from"./chunk-QEBPVWVB.js";import"./chunk-A4442AOC.js";import"./chunk-UYBH3FNE.js";import{b as Fr}from"./chunk-BARKRZDC.js";import{b as zr}from"./chunk-P6GNZPVW.js";import{b as fr}from"./chunk-IY3BUFJK.js";import{b as nr}from"./chunk-NFZDITRV.js";import{b as R}from"./chunk-PQNTKMH3.js";import{b as U}from"./chunk-PPBQJBC2.js";import{b as V}from"./chunk-NSUMEERA.js";import{b as W}from"./chunk-4PS5JJDT.js";import{c as X,d as Y}from"./chunk-W2FKF3MM.js";import{c as Z,d as _}from"./chunk-3MBAUIBB.js";import{b as N}from"./chunk-RT7TRQVZ.js";import{b as rr}from"./chunk-JXC25GVQ.js";import{b as G}from"./chunk-RJSAGJQJ.js";import{b as H}from"./chunk-YEKSVVRC.js";import{b as J}from"./chunk-26NO42TF.js";import{b as K}from"./chunk-QXB5WI2V.js";import{b as L}from"./chunk-LMK6G2HH.js";import{b as O}from"./chunk-ZKC5HQYO.js";import{b as P}from"./chunk-ROJPSS6N.js";import{b as Q}from"./chunk-7ECKLAVW.js";import{b as y}from"./chunk-NEQEZ32M.js";import{b as A}from"./chunk-ZA4HUKJ3.js";import{b as $}from"./chunk-5U7Q4GUC.js";import{b as S}from"./chunk-JQBC3FXE.js";import{b as T}from"./chunk-BDSRLH5T.js";import{b as B}from"./chunk-5G2VOPPJ.js";import{b as D}from"./chunk-SGA7Y45Z.js";import{b as E}from"./chunk-EUXCM6C4.js";import{b as w}from"./chunk-YLE2OYY6.js";import{b as x}from"./chunk-S7OHMN3F.js";import{b as v}from"./chunk-XAL6VWGA.js";import{d as k,e as q,f as C}from"./chunk-WT2HWDDA.js";import"./chunk-GIFF636B.js";import{b}from"./chunk-Q4QFIAHB.js";import"./chunk-G43H2WGH.js";import{b as I}from"./chunk-4U7XM2O3.js";import{b as M}from"./chunk-K7XSYP4L.js";import{b as j}from"./chunk-THLAHQXV.js";import{b as t}from"./chunk-YYQ22ZRL.js";import{b as l}from"./chunk-PS4LOXE5.js";import{b as u}from"./chunk-VNER2XXL.js";import{b as p}from"./chunk-4E3LY6YK.js";import{b as e}from"./chunk-5VFN7VVJ.js";import{b as d}from"./chunk-TEFXEYX3.js";import{b as c}from"./chunk-D2GFNFUN.js";import{b as h}from"./chunk-SXRVLCZ4.js";import"./chunk-FSZWFMB4.js";import"./chunk-4PRVMER6.js";import"./chunk-SE4C7FJY.js";import{b as i}from"./chunk-LJKIWB5F.js";import{b as g}from"./chunk-K47SEEPI.js";import"./chunk-5WFYIUU2.js";import{b as m}from"./chunk-X2I3PJTX.js";import"./chunk-D5WP4CKS.js";import"./chunk-K5IXNHO5.js";import{b as F}from"./chunk-4P5OA25Z.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-KWLLB7S3.js";import{b as f}from"./chunk-EJQKHROT.js";import"./chunk-JBABAK44.js";import{b as n}from"./chunk-ITA43A73.js";import"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,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,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)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-FEBB4TFH.js";import"./chunk-SE4C7FJY.js";import"./chunk-K5IXNHO5.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as sedCommand};
2
+ import{a,b}from"./chunk-4U7XM2O3.js";import"./chunk-SE4C7FJY.js";import"./chunk-K5IXNHO5.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as sedCommand};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{B as wn,C as vn,D as ae,E as Me,F as X,G as $e,H as $t,I as bn,J as T,K as $n,L as En,M as Ae,N as rs,O as Et,P as V,a as un,b as Qt,c as fn,d as vt,e as Z,f as W,g as ve,h as J,i as Se,j as De,k as Jt,l as bt,m as dn,n as es,o as hn,p as pe,q as Pe,r as pn,s as mn,t as ts,u as ss,v as xe,w as yn,x as gn,y as be,z as ns}from"./chunks/chunk-LS25HZNJ.js";import{a as Oe,b as we}from"./chunks/chunk-4PRVMER6.js";import{a as tt}from"./chunks/chunk-SE4C7FJY.js";import{a as fe,b as de,c as oe,d as he,e as ln,f as z,g as Fe,h as yt,i as gt,j as cn,k as ne,l as Ne,m as wt,n as ye}from"./chunks/chunk-K5IXNHO5.js";import"./chunks/chunk-OBH7XN5N.js";import{a as ge}from"./chunks/chunk-4VDEBYW7.js";import{a as mt}from"./chunks/chunk-KGOUQS5A.js";import*as ii from"node:fs";import*as oi from"node:readline";var He=[{name:"echo",load:async()=>(await import("./chunks/echo-2MUAOGUE.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-3J7U3HHI.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-TZC5BRAY.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-ZXYOL67L.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-6OKMS3KO.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5KLM4EA6.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-DWKSZGOQ.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-5QIBTLJG.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XH2ZB7WT.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-OY7X62QC.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-5TCJXDGY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-4O2C4V42.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-6VBAPL3Y.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-YNOUXNUY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YMNRW3F3.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-V537TDFR.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-ZIV3TFVG.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-XH7E4E2C.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-3R5G2XL4.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-WNL6TIIN.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-PWEGD656.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-NZSEYCI6.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-FZWFZEN5.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-R3F3Z5DX.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-HDHQDWRG.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-3UVLMQ2K.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-GDDRKGRB.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-UHEPS2UL.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-XH3L75DR.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-XSVNTAWH.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-26XPP5KB.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-OYZ7KOYR.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-XXKZCWY5.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-NOZ7FFXW.js")).split},{name:"column",load:async()=>(await import("./chunks/column-XGV32UPN.js")).column},{name:"join",load:async()=>(await import("./chunks/join-Y4Q5WVVE.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-HK2SYCAR.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-K777TRNA.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-KBUKWB2E.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-5FAOMLBL.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-HEKABARE.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-66BNA4IN.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-UUKG55YW.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-YWPEV2QC.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-DP5UZP52.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-DP5UZP52.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-KRGKPFOI.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-WB6O736J.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-WB6O736J.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-CXQ33VMW.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-YXBFJFHG.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-LE7GMFZD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-6VDN5QZ5.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-PICQVS6Q.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-RS7REDYT.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-4C3A4THJ.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-V7KBLSQ7.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-MLHUWFYI.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-NCLXV2S3.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-BHNJ5ALF.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-HJJ3NJ5L.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-D5YKS5NV.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-WVZA3MCP.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-JF5TTAKQ.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-67WZ6OMV.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-TZBNTR4K.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WY6RKE32.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-E7PN2UWC.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-52FBC34W.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(He.push({name:"tar",load:async()=>(await import("./chunks/tar-7B5KH3QG.js")).tarCommand}),He.push({name:"yq",load:async()=>(await import("./chunks/yq-WUJ5JNDT.js")).yqCommand}),He.push({name:"xan",load:async()=>(await import("./chunks/xan-FMSZPFX4.js")).xanCommand}),He.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-4SEIR46P.js")).sqlite3Command}));var is=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(is.push({name:"python3",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).python3Command}),is.push({name:"python",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).pythonCommand}));var ui=[{name:"curl",load:async()=>(await import("./chunks/curl-RWQO3SBN.js")).curlCommand}],Sn=new Map;function os(e){return{name:e.name,async execute(t,s){let n=Sn.get(e.name);if(n||(n=await e.load(),Sn.set(e.name,n)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:r}=await import("./chunks/flag-coverage-SFRIE2LL.js");r(s.coverage,e.name,t)}return n.execute(t,s)}}}function An(e){return(e?He.filter(s=>e.includes(s.name)):He).map(os)}function _n(){return ui.map(os)}function Cn(){return is.map(os)}function Pn(e){return"load"in e&&typeof e.load=="function"}function kn(e){let t=null;return{name:e.name,async execute(s,n){return t||(t=await e.load()),t.execute(s,n)}}}var fi=new TextEncoder,di=new TextDecoder;function Ue(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 fi.encode(e)}function St(e,t){if(t==="base64")return btoa(String.fromCharCode(...e));if(t==="hex")return Array.from(e).map(s=>s.toString(16).padStart(2,"0")).join("");if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(e).toString(t);let s=65536;if(e.length<=s)return String.fromCharCode(...e);let n="";for(let r=0;r<e.length;r+=s){let i=e.subarray(r,r+s);n+=String.fromCharCode(...i)}return n}return di.decode(e)}function Te(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}var qe=new TextEncoder;function hi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}function ee(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var st=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))typeof n=="function"?this.writeFileLazy(s,n):hi(n)?this.writeFileSync(s,n.content,void 0,{mode:n.mode,mtime:n.mtime}):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){ee(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=Te(n),a=Ue(s,o);this.data.set(i,{type:"file",content:a,mode:r?.mode??420,mtime:r?.mtime??new Date})}writeFileLazy(t,s,n){ee(t,"write");let r=this.normalizePath(t);this.ensureParentDirs(r),this.data.set(r,{type:"file",lazy:s,mode:n?.mode??420,mtime:n?.mtime??new Date})}async materializeLazy(t,s){let n=await s.lazy(),i={type:"file",content:typeof n=="string"?qe.encode(n):n,mode:s.mode,mtime:s.mtime};return this.data.set(t,i),i}async readFile(t,s){let n=await this.readFileBuffer(t),r=Te(s);return St(n,r)}async readFileBuffer(t){ee(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}'`);if("lazy"in n){let r=await this.materializeLazy(s,n);return r.content instanceof Uint8Array?r.content:qe.encode(r.content)}return n.content instanceof Uint8Array?n.content:qe.encode(n.content)}async writeFile(t,s,n){this.writeFileSync(t,s,n)}async appendFile(t,s,n){ee(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=Te(n),a=Ue(s,o);if(i?.type==="file"){let l=i;"lazy"in l&&(l=await this.materializeLazy(r,l));let c="content"in l&&l.content instanceof Uint8Array?l.content:qe.encode("content"in l?l.content:""),u=new Uint8Array(c.length+a.length);u.set(c),u.set(a,c.length),this.data.set(r,{type:"file",content:u,mode:l.mode,mtime:new Date})}else this.writeFileSync(t,s,n)}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){ee(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}'`);n.type==="file"&&"lazy"in n&&(n=await this.materializeLazy(s,n));let r=0;return n.type==="file"&&"content"in n&&n.content&&(n.content instanceof Uint8Array?r=n.content.length:r=qe.encode(n.content).length),{isFile:n.type==="file",isDirectory:n.type==="directory",isSymbolicLink:!1,mode:n.mode,size:r,mtime:n.mtime||new Date}}async lstat(t){ee(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};n.type==="file"&&"lazy"in n&&(n=await this.materializeLazy(s,n));let r=0;return n.type==="file"&&"content"in n&&n.content&&(n.content instanceof Uint8Array?r=n.content.length:r=qe.encode(n.content).length),{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 l=this.data.get(r),c=0,u=40;for(;l&&l.type==="symlink"&&c<u;){if(i.has(r))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(r),r=this.resolveSymlink(r,l.target),l=this.data.get(r),c++}if(c>=u)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),l=0,c=40;for(;a&&a.type==="symlink"&&l<c;){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),l++}if(l>=c)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){ee(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){ee(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,l]of this.data.entries())if(a!==s&&a.startsWith(i)){let c=a.slice(i.length),u=c.split("/")[0];u&&!c.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,s){ee(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){ee(t,"cp"),ee(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,{...o});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 l of a){let c=r==="/"?`/${l}`:`${r}/${l}`,u=i==="/"?`/${l}`:`${i}/${l}`;await this.cp(c,u,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){ee(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){ee(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){ee(t,"link"),ee(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}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(n,o)),this.ensureParentDirs(r),this.data.set(r,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(t){ee(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){ee(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){ee(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 pi(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function mi(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 yi(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 gi(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${un}
2
+ import{B as wn,C as vn,D as ae,E as Me,F as X,G as $e,H as $t,I as bn,J as T,K as $n,L as En,M as Ae,N as rs,O as Et,P as V,a as un,b as Qt,c as fn,d as vt,e as Z,f as W,g as ve,h as J,i as Se,j as De,k as Jt,l as bt,m as dn,n as es,o as hn,p as pe,q as Pe,r as pn,s as mn,t as ts,u as ss,v as xe,w as yn,x as gn,y as be,z as ns}from"./chunks/chunk-LS25HZNJ.js";import{a as Oe,b as we}from"./chunks/chunk-4PRVMER6.js";import{a as tt}from"./chunks/chunk-SE4C7FJY.js";import{a as fe,b as de,c as oe,d as he,e as ln,f as z,g as Fe,h as yt,i as gt,j as cn,k as ne,l as Ne,m as wt,n as ye}from"./chunks/chunk-K5IXNHO5.js";import"./chunks/chunk-OBH7XN5N.js";import{a as ge}from"./chunks/chunk-4VDEBYW7.js";import{a as mt}from"./chunks/chunk-KGOUQS5A.js";import*as ii from"node:fs";import*as oi from"node:readline";var He=[{name:"echo",load:async()=>(await import("./chunks/echo-2MUAOGUE.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-3J7U3HHI.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-TZC5BRAY.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-ZXYOL67L.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-6OKMS3KO.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-5KLM4EA6.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-DWKSZGOQ.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-5QIBTLJG.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XH2ZB7WT.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-OY7X62QC.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-5TCJXDGY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-4O2C4V42.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-6VBAPL3Y.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-YNOUXNUY.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-YMNRW3F3.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-V537TDFR.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-ZIV3TFVG.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-XH7E4E2C.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-FRIPZKKT.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-3R5G2XL4.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-PHQQJ4SI.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-PWEGD656.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-NZSEYCI6.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-FZWFZEN5.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-R3F3Z5DX.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-HDHQDWRG.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-3UVLMQ2K.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-GDDRKGRB.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-UHEPS2UL.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-XH3L75DR.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-XSVNTAWH.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-26XPP5KB.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-OYZ7KOYR.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-XXKZCWY5.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-NOZ7FFXW.js")).split},{name:"column",load:async()=>(await import("./chunks/column-XGV32UPN.js")).column},{name:"join",load:async()=>(await import("./chunks/join-Y4Q5WVVE.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-HK2SYCAR.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-K777TRNA.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-KBUKWB2E.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-5FAOMLBL.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-HEKABARE.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-66BNA4IN.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-EVLPSWFF.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-3GODYSFD.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-UUKG55YW.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-YWPEV2QC.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-DP5UZP52.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-DP5UZP52.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-KRGKPFOI.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-WB6O736J.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-WB6O736J.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-CXQ33VMW.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-YXBFJFHG.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-LE7GMFZD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-6VDN5QZ5.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-PICQVS6Q.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-RS7REDYT.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-4C3A4THJ.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-V7KBLSQ7.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-MLHUWFYI.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-NCLXV2S3.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-BHNJ5ALF.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-HJJ3NJ5L.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-D5YKS5NV.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-WVZA3MCP.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-JF5TTAKQ.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-67WZ6OMV.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-TZBNTR4K.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WY6RKE32.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-E7PN2UWC.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-52FBC34W.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-EENEW6WQ.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(He.push({name:"tar",load:async()=>(await import("./chunks/tar-7B5KH3QG.js")).tarCommand}),He.push({name:"yq",load:async()=>(await import("./chunks/yq-WUJ5JNDT.js")).yqCommand}),He.push({name:"xan",load:async()=>(await import("./chunks/xan-FMSZPFX4.js")).xanCommand}),He.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-4SEIR46P.js")).sqlite3Command}));var is=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(is.push({name:"python3",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).python3Command}),is.push({name:"python",load:async()=>(await import("./chunks/python3-ZWX5SFJ3.js")).pythonCommand}));var ui=[{name:"curl",load:async()=>(await import("./chunks/curl-RWQO3SBN.js")).curlCommand}],Sn=new Map;function os(e){return{name:e.name,async execute(t,s){let n=Sn.get(e.name);if(n||(n=await e.load(),Sn.set(e.name,n)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:r}=await import("./chunks/flag-coverage-WM63KT7D.js");r(s.coverage,e.name,t)}return n.execute(t,s)}}}function An(e){return(e?He.filter(s=>e.includes(s.name)):He).map(os)}function _n(){return ui.map(os)}function Cn(){return is.map(os)}function Pn(e){return"load"in e&&typeof e.load=="function"}function kn(e){let t=null;return{name:e.name,async execute(s,n){return t||(t=await e.load()),t.execute(s,n)}}}var fi=new TextEncoder,di=new TextDecoder;function Ue(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 fi.encode(e)}function St(e,t){if(t==="base64")return btoa(String.fromCharCode(...e));if(t==="hex")return Array.from(e).map(s=>s.toString(16).padStart(2,"0")).join("");if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(e).toString(t);let s=65536;if(e.length<=s)return String.fromCharCode(...e);let n="";for(let r=0;r<e.length;r+=s){let i=e.subarray(r,r+s);n+=String.fromCharCode(...i)}return n}return di.decode(e)}function Te(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}var qe=new TextEncoder;function hi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}function ee(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var st=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))typeof n=="function"?this.writeFileLazy(s,n):hi(n)?this.writeFileSync(s,n.content,void 0,{mode:n.mode,mtime:n.mtime}):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){ee(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=Te(n),a=Ue(s,o);this.data.set(i,{type:"file",content:a,mode:r?.mode??420,mtime:r?.mtime??new Date})}writeFileLazy(t,s,n){ee(t,"write");let r=this.normalizePath(t);this.ensureParentDirs(r),this.data.set(r,{type:"file",lazy:s,mode:n?.mode??420,mtime:n?.mtime??new Date})}async materializeLazy(t,s){let n=await s.lazy(),i={type:"file",content:typeof n=="string"?qe.encode(n):n,mode:s.mode,mtime:s.mtime};return this.data.set(t,i),i}async readFile(t,s){let n=await this.readFileBuffer(t),r=Te(s);return St(n,r)}async readFileBuffer(t){ee(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}'`);if("lazy"in n){let r=await this.materializeLazy(s,n);return r.content instanceof Uint8Array?r.content:qe.encode(r.content)}return n.content instanceof Uint8Array?n.content:qe.encode(n.content)}async writeFile(t,s,n){this.writeFileSync(t,s,n)}async appendFile(t,s,n){ee(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=Te(n),a=Ue(s,o);if(i?.type==="file"){let l=i;"lazy"in l&&(l=await this.materializeLazy(r,l));let c="content"in l&&l.content instanceof Uint8Array?l.content:qe.encode("content"in l?l.content:""),u=new Uint8Array(c.length+a.length);u.set(c),u.set(a,c.length),this.data.set(r,{type:"file",content:u,mode:l.mode,mtime:new Date})}else this.writeFileSync(t,s,n)}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){ee(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}'`);n.type==="file"&&"lazy"in n&&(n=await this.materializeLazy(s,n));let r=0;return n.type==="file"&&"content"in n&&n.content&&(n.content instanceof Uint8Array?r=n.content.length:r=qe.encode(n.content).length),{isFile:n.type==="file",isDirectory:n.type==="directory",isSymbolicLink:!1,mode:n.mode,size:r,mtime:n.mtime||new Date}}async lstat(t){ee(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};n.type==="file"&&"lazy"in n&&(n=await this.materializeLazy(s,n));let r=0;return n.type==="file"&&"content"in n&&n.content&&(n.content instanceof Uint8Array?r=n.content.length:r=qe.encode(n.content).length),{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 l=this.data.get(r),c=0,u=40;for(;l&&l.type==="symlink"&&c<u;){if(i.has(r))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(r),r=this.resolveSymlink(r,l.target),l=this.data.get(r),c++}if(c>=u)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),l=0,c=40;for(;a&&a.type==="symlink"&&l<c;){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),l++}if(l>=c)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){ee(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){ee(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,l]of this.data.entries())if(a!==s&&a.startsWith(i)){let c=a.slice(i.length),u=c.split("/")[0];u&&!c.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,s){ee(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){ee(t,"cp"),ee(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,{...o});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 l of a){let c=r==="/"?`/${l}`:`${r}/${l}`,u=i==="/"?`/${l}`:`${i}/${l}`;await this.cp(c,u,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){ee(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){ee(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){ee(t,"link"),ee(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}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(n,o)),this.ensureParentDirs(r),this.data.set(r,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(t){ee(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){ee(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){ee(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 pi(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function mi(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 yi(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 gi(e){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${un}
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.writeFileLazy?e.writeFileLazy("/proc/self/status",Qt):e.writeFileSync("/proc/self/status",Qt()),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 Nn(e,t){pi(e)&&(mi(e,t),yi(e),gi(e))}var wi=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],vi=["braceexpand","hashall","interactive-comments"];function as(e){let t=[],s=[...vi.map(n=>({name:n,enabled:!0})),...wi.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 Ze(e){e.state.env.set("SHELLOPTS",as(e.state.options))}var bi=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function ls(e){let t=[];for(let s of bi)e[s]&&t.push(s);return t.join(":")}function cs(e){e.state.env.set("BASHOPTS",ls(e.state.shoptOptions))}var $i="BASH_ALIAS_";function On(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function Dn(e){if(e.parts.length!==1)return null;let t=e.parts[0];return t.type==="Literal"?t.value:null}function xn(e,t){return e.env.get(`${$i}${t}`)}function us(e,t,s){if(!t.name||!On(t.name))return t;let n=Dn(t.name);if(!n)return t;let r=xn(e,n);if(!r||s.has(n))return t;try{s.add(n);let i=new W,o=r,a=r.endsWith(" ");if(!a)for(let f of t.args){let d=In(f);o+=` ${d}`}let l;try{l=i.parse(o)}catch(f){if(f instanceof vt)throw f;return t}if(l.statements.length!==1||l.statements[0].pipelines.length!==1||l.statements[0].pipelines[0].commands.length!==1)return Tn(t,r);let c=l.statements[0].pipelines[0].commands[0];if(c.type!=="SimpleCommand")return Tn(t,r);let u={...c,assignments:[...t.assignments,...c.assignments],redirections:[...c.redirections,...t.redirections],line:t.line};if(a&&t.args.length>0&&(u={...u,args:[...u.args,...t.args]},u.args.length>0)){let f=u.args[0];if(On(f)){let d=Dn(f);if(d&&xn(e,d)){let h={type:"SimpleCommand",name:f,args:u.args.slice(1),assignments:[],redirections:[]},m=us(e,h,s);m!==h&&(u={...u,name:m.name,args:[...m.args]})}}}return u}catch(i){throw s.delete(n),i}}function Tn(e,t){let s=t;for(let o of e.args){let a=In(o);s+=` ${a}`}let n=new W,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 In(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 Rn(e,t){let s=t.parts.map(u=>u.type==="Literal"?u.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="",l=!1;for(let u of t.parts)if(u.type==="Literal"){let f=u.value;if(!o){let d=f.indexOf("=(");d!==-1&&(o=!0,f=f.slice(d+2))}if(o){f.endsWith(")")&&(f=f.slice(0,-1));let d=f.split(/(\s+)/);for(let h of d)/^\s+$/.test(h)?(a||l)&&(i.push(a),a="",l=!1):h&&(a+=h)}}else if(o)if(u.type==="BraceExpansion")if(/^\[.+\]=/.test(a))a+=bt({type:"Word",parts:[u]});else{(a||l)&&(i.push(a),a="",l=!1);let d=await Ae(e,{type:"Word",parts:[u]});i.push(...d.values)}else{(u.type==="SingleQuoted"||u.type==="DoubleQuoted"||u.type==="Escaped")&&(l=!0);let f=await T(e,{type:"Word",parts:[u]});a+=f}(a||l)&&i.push(a);let c=i.map(u=>/^\[.+\]=/.test(u)?u:u===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(u)&&!u.startsWith("'")&&!u.startsWith('"')?`'${u.replace(/'/g,"'\\''")}'`:u);return`${r}=(${c.join(" ")})`}async function Ln(e,t){let s=-1,n=-1,r=!1;for(let p=0;p<t.parts.length;p++){let g=t.parts[p];if(g.type==="Literal"){let _=g.value.indexOf("+=");if(_!==-1){let S=g.value.slice(0,_);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(S)){s=p,n=_,r=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(S)){s=p,n=_,r=!0;break}}let v=g.value.indexOf("=");if(v!==-1&&(v===0||g.value[v-1]!=="+")){let S=g.value.slice(0,v);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(S)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(S)){s=p,n=v;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,l=o.value.slice(0,n),c=o.value.slice(n+a),u=t.parts.slice(s+1),f="";for(let p of i)f+=await T(e,{type:"Word",parts:[p]});f+=l;let d={type:"Word",parts:c!==""?[{type:"Literal",value:c},...u]:u},h=d.parts.length>0?await T(e,d):"";return`${f}${r?"+=":"="}${h}`}var Ei=["tar","yq","xan","sqlite3","python3","python"];function Fn(e){return Ei.includes(e)}var L=Object.freeze({stdout:"",stderr:"",exitCode:0});function F(e=""){return{stdout:e,stderr:"",exitCode:0}}function A(e,t=1){return{stdout:"",stderr:e,exitCode:t}}function P(e,t,s){return{stdout:e,stderr:t,exitCode:s}}function q(e){return{stdout:"",stderr:"",exitCode:e?0:1}}function ke(e,t,s="",n=""){throw new ne(e,t,s,n)}function fs(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Ne;return L}if(t.length>1)throw new z(1,"",`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,"",`bash: break: ${t[0]}: numeric argument required
@@ -174,11 +174,11 @@ Options:
174
174
  `),D.CODES.get(`
175
175
  `)));let a=!0;for(;!t.more()||t.peek()!==D.CODES.get("]")||a;){if(t.more()&&t.lookingAt("-")&&(this.flags&Q.PERL_X)===0&&!a){let u=t.rest();if(u==="-"||!u.startsWith("-]"))throw t.rewindTo(n),new De(e.ERR_INVALID_CHAR_RANGE,t.rest())}a=!1;let o=t.pos();if(t.lookingAt("[:")){if(this.parseNamedClass(t,s))continue;t.rewindTo(o)}if(this.parseUnicodeClass(t,s)||this.parsePerlClassEscape(t,s))continue;t.rewindTo(o);let l=e.parseClassChar(t,n),c=l;if(t.more()&&t.lookingAt("-")){if(t.skip(1),t.more()&&t.lookingAt("]"))t.skip(-1);else if(c=e.parseClassChar(t,n),c<l)throw new De(e.ERR_INVALID_CHAR_RANGE,t.from(o))}(this.flags&Q.FOLD_CASE)===0?s.appendRange(l,c):s.appendFoldedRange(l,c)}t.skip(1),s.cleanClass(),i<0&&s.negateClass(),r.runes=s.toArray(),this.push(r)}},to=class{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}compareAndSet(t,n){return this.value===t?(this.value=n,!0):!1}},no=class e{static initTest(t){let n=e.compile(t),r=new e(n.expr,n.prog,n.numSubexp,n.longest);return r.cond=n.cond,r.prefix=n.prefix,r.prefixUTF8=n.prefixUTF8,r.prefixComplete=n.prefixComplete,r.prefixRune=n.prefixRune,r}static compile(t){return e.compileImpl(t,Q.PERL,!1)}static compilePOSIX(t){return e.compileImpl(t,Q.POSIX,!0)}static compileImpl(t,n,r){let s=eo.parse(t,n),i=s.maxCap();s=Ya.simplify(s);let a=Xa.compileRegexp(s),o=new e(t,a,i,r),[l,c]=a.prefix();return o.prefixComplete=l,o.prefix=c,o.prefixUTF8=Ne.stringToUtf8ByteArray(o.prefix),o.prefix.length>0&&(o.prefixRune=o.prefix.codePointAt(0)),o.namedGroups=s.namedGroups,o}static match(t,n){return e.compile(t).match(n)}constructor(t,n,r=0,s=0){this.expr=t,this.prog=n,this.numSubexp=r,this.longest=s,this.cond=n.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new to}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){let t;do t=this.pooled.get();while(t&&!this.pooled.compareAndSet(t,t.next));return t}reset(){this.pooled.set(null)}put(t,n){let r=this.pooled.get();do r=this.pooled.get(),!n&&r&&(t=rs.fromMachine(t),n=!0),t.next!==r&&(t.next=r);while(!this.pooled.compareAndSet(r,t))}toString(){return this.expr}doExecute(t,n,r,s){let i=this.get(),a=!1;i?i.next!==null&&(i=rs.fromMachine(i),a=!0):(i=rs.fromRE2(this),a=!0),i.init(s);let o=i.match(t,n,r)?i.submatches():null;return this.put(i,a),o}match(t){return this.doExecute(Ve.fromUTF16(t),0,Q.UNANCHORED,0)!==null}matchWithGroup(t,n,r,s,i){return t instanceof Rn||(t=xr.utf16(t)),this.matchMachineInput(t,n,r,s,i)}matchMachineInput(t,n,r,s,i){if(n>r)return[!1,null];let a=t.isUTF16Encoding()?Ve.fromUTF16(t.asCharSequence(),0,r):Ve.fromUTF8(t.asBytes(),0,r),o=this.doExecute(a,n,s,2*i);return o===null?[!1,null]:[!0,o]}matchUTF8(t){return this.doExecute(Ve.fromUTF8(t),0,Q.UNANCHORED,0)!==null}replaceAll(t,n){return this.replaceAllFunc(t,()=>n,2*t.length+1)}replaceFirst(t,n){return this.replaceAllFunc(t,()=>n,1)}replaceAllFunc(t,n,r){let s=0,i=0,a="",o=Ve.fromUTF16(t),l=0;for(;i<=t.length;){let c=this.doExecute(o,i,Q.UNANCHORED,2);if(c===null||c.length===0)break;a+=t.substring(s,c[0]),(c[1]>s||c[0]===0)&&(a+=n(t.substring(c[0],c[1])),l++),s=c[1];let u=o.step(i)&7;if(i+u>c[1]?i+=u:i+1>c[1]?i++:i=c[1],l>=r)break}return a+=t.substring(s),a}pad(t){if(t===null)return null;let n=(1+this.numSubexp)*2;if(t.length<n){let r=new Array(n).fill(-1);for(let s=0;s<t.length;s++)r[s]=t[s];t=r}return t}allMatches(t,n,r=s=>s){let s=[],i=t.endPos();n<0&&(n=i+1);let a=0,o=0,l=-1;for(;o<n&&a<=i;){let c=this.doExecute(t,a,Q.UNANCHORED,this.prog.numCap);if(c===null||c.length===0)break;let u=!0;if(c[1]===a){c[0]===l&&(u=!1);let f=t.step(a);f<0?a=i+1:a+=f&7}else a=c[1];l=c[1],u&&(s.push(r(this.pad(c))),o++)}return s}findUTF8(t){let n=this.doExecute(Ve.fromUTF8(t),0,Q.UNANCHORED,2);return n===null?null:t.slice(n[0],n[1])}findUTF8Index(t){let n=this.doExecute(Ve.fromUTF8(t),0,Q.UNANCHORED,2);return n===null?null:n.slice(0,2)}find(t){let n=this.doExecute(Ve.fromUTF16(t),0,Q.UNANCHORED,2);return n===null?"":t.substring(n[0],n[1])}findIndex(t){return this.doExecute(Ve.fromUTF16(t),0,Q.UNANCHORED,2)}findUTF8Submatch(t){let n=this.doExecute(Ve.fromUTF8(t),0,Q.UNANCHORED,this.prog.numCap);if(n===null)return null;let r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<n.length&&n[2*s]>=0&&(r[s]=t.slice(n[2*s],n[2*s+1]));return r}findUTF8SubmatchIndex(t){return this.pad(this.doExecute(Ve.fromUTF8(t),0,Q.UNANCHORED,this.prog.numCap))}findSubmatch(t){let n=this.doExecute(Ve.fromUTF16(t),0,Q.UNANCHORED,this.prog.numCap);if(n===null)return null;let r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<n.length&&n[2*s]>=0&&(r[s]=t.substring(n[2*s],n[2*s+1]));return r}findSubmatchIndex(t){return this.pad(this.doExecute(Ve.fromUTF16(t),0,Q.UNANCHORED,this.prog.numCap))}findAllUTF8(t,n){let r=this.allMatches(Ve.fromUTF8(t),n,s=>t.slice(s[0],s[1]));return r.length===0?null:r}findAllUTF8Index(t,n){let r=this.allMatches(Ve.fromUTF8(t),n,s=>s.slice(0,2));return r.length===0?null:r}findAll(t,n){let r=this.allMatches(Ve.fromUTF16(t),n,s=>t.substring(s[0],s[1]));return r.length===0?null:r}findAllIndex(t,n){let r=this.allMatches(Ve.fromUTF16(t),n,s=>s.slice(0,2));return r.length===0?null:r}findAllUTF8Submatch(t,n){let r=this.allMatches(Ve.fromUTF8(t),n,s=>{let i=new Array(s.length/2|0).fill(null);for(let a=0;a<i.length;a++)s[2*a]>=0&&(i[a]=t.slice(s[2*a],s[2*a+1]));return i});return r.length===0?null:r}findAllUTF8SubmatchIndex(t,n){let r=this.allMatches(Ve.fromUTF8(t),n);return r.length===0?null:r}findAllSubmatch(t,n){let r=this.allMatches(Ve.fromUTF16(t),n,s=>{let i=new Array(s.length/2|0).fill(null);for(let a=0;a<i.length;a++)s[2*a]>=0&&(i[a]=t.substring(s[2*a],s[2*a+1]));return i});return r.length===0?null:r}findAllSubmatchIndex(t,n){let r=this.allMatches(Ve.fromUTF16(t),n);return r.length===0?null:r}},ro=class e{static isUpperCaseAlpha(t){return"A"<=t&&t<="Z"}static isHexadecimal(t){return"0"<=t&&t<="9"||"A"<=t&&t<="F"||"a"<=t&&t<="f"}static getUtf8CharSize(t){let n=t.charCodeAt(0);return n<128?1:n<2048?2:n<65536?3:4}static translate(t){if(typeof t!="string")return t;let n="",r=!1,s=t.length;s===0&&(n="(?:)",r=!0);let i=0;for(;i<s;){let a=t[i];if(a==="\\"){if(i+1<s)switch(a=t[i+1],a){case"\\":{n+="\\\\",i+=2;continue}case"c":{if(i+2<s){let l=t[i+2];if(e.isUpperCaseAlpha(l)){n+="\\x",n+=(l.charCodeAt(0)-64>>4).toString(16).toUpperCase(),n+=(l.charCodeAt(0)-64&15).toString(16).toUpperCase(),i+=3,r=!0;continue}}n+="\\c",i+=2;continue}case"u":{if(i+2<s){let l=t[i+2];if(e.isHexadecimal(l)){n+="\\x{"+l,i+=3;for(let c=0;c<3&&i<s&&(l=t[i],!!e.isHexadecimal(l));++i,++c)n+=l;n+="}",r=!0;continue}else if(l==="{"){n+="\\x",i+=2,r=!0;continue}}n+="\\u",i+=2;continue}default:{n+="\\";let l=e.getUtf8CharSize(a);n+=t.substring(i+1,i+1+l),i+=l+1;continue}}}else if(a==="/"){n+="\\/",i+=1,r=!0;continue}else if(a==="("&&i+2<s&&t[i+1]==="?"&&t[i+2]==="<"&&(i+3>=s||t[i+3]!=="="&&t[i+3]!=="!")){n+="(?P<",i+=3,r=!0;continue}let o=e.getUtf8CharSize(a);n+=t.substring(i,i+o),i+=o}return r?n:t}},Tn=class e{static CASE_INSENSITIVE=1;static DOTALL=2;static MULTILINE=4;static DISABLE_UNICODE_GROUPS=8;static LONGEST_MATCH=16;static quote(t){return Ne.quoteMeta(t)}static translateRegExp(t){return ro.translate(t)}static compile(t,n=0){let r=t;if((n&e.CASE_INSENSITIVE)!==0&&(r=`(?i)${r}`),(n&e.DOTALL)!==0&&(r=`(?s)${r}`),(n&e.MULTILINE)!==0&&(r=`(?m)${r}`),(n&~(e.MULTILINE|e.DOTALL|e.CASE_INSENSITIVE|e.DISABLE_UNICODE_GROUPS|e.LONGEST_MATCH))!==0)throw new Va("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");let s=Q.PERL;(n&e.DISABLE_UNICODE_GROUPS)!==0&&(s&=-129);let i=new e(t,n);return i.re2Input=no.compileImpl(r,s,(n&e.LONGEST_MATCH)!==0),i}static matches(t,n){return e.compile(t).matcher(n).matches()}static initTest(t,n,r){if(t==null)throw new Error("pattern is null");if(r==null)throw new Error("re2 is null");let s=new e(t,n);return s.re2Input=r,s}constructor(t,n){this.patternInput=t,this.flagsInput=n}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(t){return this.matcher(t).matches()}matcher(t){return Array.isArray(t)&&(t=xr.utf8(t)),new Ga(this,t)}split(t,n=0){let r=this.matcher(t),s=[],i=0,a=0;for(;r.find();){if(a===0&&r.end()===0){a=r.end();continue}if(n>0&&s.length===n-1)break;if(a===r.start()){if(n===0){i+=1,a=r.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(r.substring(a,r.start())),a=r.end()}if(n===0&&a!==r.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(r.substring(a,r.inputLength()))}return(n!==0||s.length===0)&&s.push(r.substring(a,r.inputLength())),s}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(t){return this===t?!0:t===null||this.constructor!==t.constructor?!1:this.flagsInput===t.flagsInput&&this.patternInput===t.patternInput}}});function xy(e){let t=0;return e.includes("i")&&(t|=Tn.CASE_INSENSITIVE),e.includes("m")&&(t|=Tn.MULTILINE),e.includes("s")&&(t|=Tn.DOTALL),t}function Ey(e){return Tn.translateRegExp(e)}function G(e,t=""){return new ti(e,t)}var ti,Cn,Mf=I(()=>{"use strict";Ff();ti=class{_re2;_pattern;_flags;_global;_ignoreCase;_multiline;_lastIndex=0;_nativeRegex=null;constructor(t,n=""){this._pattern=t,this._flags=n,this._global=n.includes("g"),this._ignoreCase=n.includes("i"),this._multiline=n.includes("m");try{let r=Ey(t),s=xy(n);this._re2=Tn.compile(r,s)}catch(r){if(r instanceof De){let s=r.message||"",i="";throw s.includes("(?=")||s.includes("(?!")||s.includes("(?<")||s.includes("(?<!")||t.includes("(?=")||t.includes("(?!")||t.includes("(?<=")||t.includes("(?<!")?i=" Lookahead (?=, ?!) and lookbehind (?<=, ?<!) assertions are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support these features.":(s.includes("backreference")||/\\[1-9]/.test(t))&&(i=" Backreferences (\\1, \\2, etc.) are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support backreferences."),new SyntaxError(`Invalid regular expression: /${t}/: ${s}${i}`)}throw r}}test(t){return this._global&&(this._lastIndex=0),this._re2.matcher(t).find()}exec(t){let n=this._re2.matcher(t),r=this._global?this._lastIndex:0;if(!n.find(r))return this._global&&(this._lastIndex=0),null;let s=this._re2.groupCount(),i=[];i.push(n.group(0)??"");for(let l=1;l<=s;l++){let c=n.group(l);i.push(c)}let a=i;a.index=n.start(0),a.input=t;let o=this._re2.namedGroups();if(o&&Object.keys(o).length>0){let l=Object.create(null);for(let[c,u]of Object.entries(o)){let f=n.group(u);f!==null&&(l[c]=f)}a.groups=l}return this._global&&(this._lastIndex=n.end(0),n.start(0)===n.end(0)&&this._lastIndex++),a}match(t){if(this._global&&(this._lastIndex=0),!this._global)return this.exec(t);let n=[],r=this._re2.matcher(t),s=0;for(;r.find(s);){let i=r.group(0)??"";if(n.push(i),s=r.end(0),r.start(0)===r.end(0)&&s++,s>t.length)break}return n.length>0?n:null}replace(t,n){if(this._global&&(this._lastIndex=0),typeof n=="string"){let c=this._re2.matcher(t);return this._global?c.replaceAll(n,!0):c.replaceFirst(n,!0)}let r=[],s=this._re2.matcher(t),i=0,a=0,o=this._re2.groupCount(),l=this._re2.namedGroups();for(;s.find(a);){r.push(t.slice(i,s.start(0)));let c=[],u=s.group(0)??"";for(let f=1;f<=o;f++)c.push(s.group(f));if(c.push(s.start(0)),c.push(t),l&&Object.keys(l).length>0){let f=Object.create(null);for(let[p,h]of Object.entries(l))f[p]=s.group(h)??"";c.push(f)}if(r.push(n(u,...c)),i=s.end(0),a=i,s.start(0)===s.end(0)&&a++,!this._global||a>t.length)break}return r.push(t.slice(i)),r.join("")}split(t,n){return n===void 0||n<0?this._re2.split(t,-1):n===0?[]:this._re2.split(t,-1).slice(0,n)}search(t){let n=this._re2.matcher(t);return n.find()?n.start(0):-1}*matchAll(t){if(!this._global)throw new Error("matchAll requires global flag");this._lastIndex=0;let n=this._re2.matcher(t),r=this._re2.groupCount(),s=this._re2.namedGroups(),i=0;for(;n.find(i);){let a=[];a.push(n.group(0)??"");for(let l=1;l<=r;l++)a.push(n.group(l));let o=a;if(o.index=n.start(0),o.input=t,s&&Object.keys(s).length>0){let l=Object.create(null);for(let[c,u]of Object.entries(s)){let f=n.group(u);f!==null&&(l[c]=f)}o.groups=l}if(yield o,i=n.end(0),n.start(0)===n.end(0)&&i++,i>t.length)break}}get native(){if(!this._nativeRegex)try{this._nativeRegex=new RegExp(this._pattern,this._flags)}catch{this._nativeRegex=new RegExp("",this._flags),Object.defineProperty(this._nativeRegex,"source",{value:this._pattern,writable:!1})}return this._nativeRegex}get source(){return this._pattern}get flags(){return this._flags}get global(){return this._global}get ignoreCase(){return this._ignoreCase}get multiline(){return this._multiline}get lastIndex(){return this._lastIndex}set lastIndex(t){this._lastIndex=t}};Cn=class{_regex;constructor(t){this._regex=t}test(t){return this._regex.global&&(this._regex.lastIndex=0),this._regex.test(t)}exec(t){return this._regex.exec(t)}match(t){return this._regex.global&&(this._regex.lastIndex=0),t.match(this._regex)}replace(t,n){return this._regex.global&&(this._regex.lastIndex=0),t.replace(this._regex,n)}split(t,n){return t.split(this._regex,n)}search(t){return t.search(this._regex)}*matchAll(t){if(!this._regex.global)throw new Error("matchAll requires global flag");this._regex.lastIndex=0;let n=this._regex.exec(t);for(;n!==null;)yield n,n[0].length===0&&this._regex.lastIndex++,n=this._regex.exec(t)}get native(){return this._regex}get source(){return this._regex.source}get flags(){return this._regex.flags}get global(){return this._regex.global}get ignoreCase(){return this._regex.ignoreCase}get multiline(){return this._regex.multiline}get lastIndex(){return this._regex.lastIndex}set lastIndex(t){this._regex.lastIndex=t}}});var Me=I(()=>{"use strict";Mf()});function xt(e,t,n){let r=typeof n=="boolean"?{ignoreCase:n}:n??{},s=t;r.stripQuotes&&(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))&&(s=s.slice(1,-1));let i=r.ignoreCase?`i:${s}`:s,a=Uf.get(i);return a||(a=Ay(s,r.ignoreCase),Uf.set(i,a)),a.test(e)}function Ay(e,t){let n="^";for(let r=0;r<e.length;r++){let s=e[r];if(s==="*")n+=".*";else if(s==="?")n+=".";else if(s==="["){let i=r+1;for(;i<e.length&&e[i]!=="]";)i++;n+=e.slice(r,i+1),r=i}else s==="."||s==="+"||s==="^"||s==="$"||s==="{"||s==="}"||s==="("||s===")"||s==="|"||s==="\\"?n+=`\\${s}`:n+=s}return n+="$",G(n,t?"i":"")}var Uf,so=I(()=>{"use strict";Me();Uf=new Map});function Wf(e,t){return e.replace(/\$(&|\d+|<([^>]+)>)/g,(n,r,s)=>{if(r==="&")return t[0];if(s!==void 0)return t.groups?.[s]??"";let i=parseInt(r,10);return t[i]??""})}function Ar(e,t,n={}){let{invertMatch:r=!1,showLineNumbers:s=!1,countOnly:i=!1,countMatches:a=!1,filename:o="",onlyMatching:l=!1,beforeContext:c=0,afterContext:u=0,maxCount:f=0,contextSeparator:p="--",showColumn:h=!1,vimgrep:m=!1,showByteOffset:d=!1,replace:g=null,passthru:w=!1,multiline:y=!1,kResetGroup:b}=n;if(y)return Sy(e,t,{invertMatch:r,showLineNumbers:s,countOnly:i,countMatches:a,filename:o,onlyMatching:l,beforeContext:c,afterContext:u,maxCount:f,contextSeparator:p,showColumn:h,showByteOffset:d,replace:g,kResetGroup:b});let x=e.split(`
176
176
  `),S=x.length,$=S>0&&x[S-1]===""?S-1:S;if(i||a){let N=0,P=(a||l)&&!r;for(let T=0;T<$;T++)if(t.lastIndex=0,P)for(let L=t.exec(x[T]);L!==null;L=t.exec(x[T]))N++,L[0].length===0&&t.lastIndex++;else t.test(x[T])!==r&&N++;return{output:`${o?`${o}:${N}`:String(N)}
177
- `,matched:N>0,matchCount:N}}if(c===0&&u===0&&!w){let N=[],P=!1,v=0,T=0;for(let L=0;L<$&&!(f>0&&v>=f);L++){let ue=x[L];if(t.lastIndex=0,t.test(ue)!==r)if(P=!0,v++,l){t.lastIndex=0;for(let J=t.exec(ue);J!==null;J=t.exec(ue)){let H=b!==void 0?J[b]??"":J[0],X=g!==null?Wf(g,J):H,Ee=o?`${o}:`:"";d&&(Ee+=`${T+J.index}:`),s&&(Ee+=`${L+1}:`),h&&(Ee+=`${J.index+1}:`),N.push(Ee+X),J[0].length===0&&t.lastIndex++}}else if(m){t.lastIndex=0;for(let J=t.exec(ue);J!==null;J=t.exec(ue)){let H=o?`${o}:`:"";d&&(H+=`${T+J.index}:`),s&&(H+=`${L+1}:`),h&&(H+=`${J.index+1}:`),N.push(H+ue),J[0].length===0&&t.lastIndex++}}else{t.lastIndex=0;let J=t.exec(ue),H=J?J.index+1:1,X=ue;g!==null&&(t.lastIndex=0,X=t.replace(ue,(...ae)=>{if(ae[0].length===0)return"";let j=ae,ve=ae[ae.length-1];return typeof ve=="object"&&ve!==null?(j.groups=ve,j.input=ae[ae.length-2],j.index=ae[ae.length-3]):(j.input=ae[ae.length-1],j.index=ae[ae.length-2]),Wf(g,j)}));let Ee=o?`${o}:`:"";d&&(Ee+=`${T+(J?J.index:0)}:`),s&&(Ee+=`${L+1}:`),h&&(Ee+=`${H}:`),N.push(Ee+X)}T+=ue.length+1}return{output:N.length>0?`${N.join(`
177
+ `,matched:N>0,matchCount:N}}if(c===0&&u===0&&!w){let N=[],P=!1,v=0,T=0;for(let L=0;L<$&&!(f>0&&v>=f);L++){let ue=x[L];if(t.lastIndex=0,t.test(ue)!==r)if(P=!0,v++,l){t.lastIndex=0;for(let ee=t.exec(ue);ee!==null;ee=t.exec(ue)){let H=b!==void 0?ee[b]??"":ee[0],X=g!==null?Wf(g,ee):H,Ee=o?`${o}:`:"";d&&(Ee+=`${T+ee.index}:`),s&&(Ee+=`${L+1}:`),h&&(Ee+=`${ee.index+1}:`),N.push(Ee+X),ee[0].length===0&&t.lastIndex++}}else if(m){t.lastIndex=0;for(let ee=t.exec(ue);ee!==null;ee=t.exec(ue)){let H=o?`${o}:`:"";d&&(H+=`${T+ee.index}:`),s&&(H+=`${L+1}:`),h&&(H+=`${ee.index+1}:`),N.push(H+ue),ee[0].length===0&&t.lastIndex++}}else{t.lastIndex=0;let ee=t.exec(ue),H=ee?ee.index+1:1,X=ue;g!==null&&(t.lastIndex=0,X=t.replace(ue,(...ae)=>{if(ae[0].length===0)return"";let j=ae,ve=ae[ae.length-1];return typeof ve=="object"&&ve!==null?(j.groups=ve,j.input=ae[ae.length-2],j.index=ae[ae.length-3]):(j.input=ae[ae.length-1],j.index=ae[ae.length-2]),Wf(g,j)}));let Ee=o?`${o}:`:"";d&&(Ee+=`${T+(ee?ee.index:0)}:`),s&&(Ee+=`${L+1}:`),h&&(Ee+=`${H}:`),N.push(Ee+X)}T+=ue.length+1}return{output:N.length>0?`${N.join(`
178
178
  `)}
179
- `:"",matched:P,matchCount:v}}if(w){let N=[],P=!1,v=0;for(let T=0;T<$;T++){let L=x[T];t.lastIndex=0;let re=t.test(L)!==r;re&&(P=!0,v++);let J=re?":":"-",H=o?`${o}${J}`:"";s&&(H+=`${T+1}${J}`),N.push(H+L)}return{output:N.length>0?`${N.join(`
179
+ `:"",matched:P,matchCount:v}}if(w){let N=[],P=!1,v=0;for(let T=0;T<$;T++){let L=x[T];t.lastIndex=0;let re=t.test(L)!==r;re&&(P=!0,v++);let ee=re?":":"-",H=o?`${o}${ee}`:"";s&&(H+=`${T+1}${ee}`),N.push(H+L)}return{output:N.length>0?`${N.join(`
180
180
  `)}
181
- `:"",matched:P,matchCount:v}}let O=[],F=0,R=new Set,z=-1,k=[];for(let N=0;N<$&&!(f>0&&F>=f);N++)t.lastIndex=0,t.test(x[N])!==r&&(k.push(N),F++);for(let N of k){let P=Math.max(0,N-c);z>=0&&P>z+1&&O.push(p);for(let T=P;T<N;T++)if(!R.has(T)){R.add(T),z=T;let L=x[T];s&&(L=`${T+1}-${L}`),o&&(L=`${o}-${L}`),O.push(L)}if(!R.has(N)){R.add(N),z=N;let T=x[N];if(l){t.lastIndex=0;for(let L=t.exec(T);L!==null;L=t.exec(T)){let ue=b!==void 0?L[b]??"":L[0],re=g!==null?g:ue,J=o?`${o}:`:"";s&&(J+=`${N+1}:`),h&&(J+=`${L.index+1}:`),O.push(J+re),L[0].length===0&&t.lastIndex++}}else{let L=T;s&&(L=`${N+1}:${L}`),o&&(L=`${o}:${L}`),O.push(L)}}let v=Math.min($-1,N+u);for(let T=N+1;T<=v;T++)if(!R.has(T)){R.add(T),z=T;let L=x[T];s&&(L=`${T+1}-${L}`),o&&(L=`${o}-${L}`),O.push(L)}}return{output:O.length>0?`${O.join(`
181
+ `:"",matched:P,matchCount:v}}let O=[],F=0,R=new Set,z=-1,k=[];for(let N=0;N<$&&!(f>0&&F>=f);N++)t.lastIndex=0,t.test(x[N])!==r&&(k.push(N),F++);for(let N of k){let P=Math.max(0,N-c);z>=0&&P>z+1&&O.push(p);for(let T=P;T<N;T++)if(!R.has(T)){R.add(T),z=T;let L=x[T];s&&(L=`${T+1}-${L}`),o&&(L=`${o}-${L}`),O.push(L)}if(!R.has(N)){R.add(N),z=N;let T=x[N];if(l){t.lastIndex=0;for(let L=t.exec(T);L!==null;L=t.exec(T)){let ue=b!==void 0?L[b]??"":L[0],re=g!==null?g:ue,ee=o?`${o}:`:"";s&&(ee+=`${N+1}:`),h&&(ee+=`${L.index+1}:`),O.push(ee+re),L[0].length===0&&t.lastIndex++}}else{let L=T;s&&(L=`${N+1}:${L}`),o&&(L=`${o}:${L}`),O.push(L)}}let v=Math.min($-1,N+u);for(let T=N+1;T<=v;T++)if(!R.has(T)){R.add(T),z=T;let L=x[T];s&&(L=`${T+1}-${L}`),o&&(L=`${o}-${L}`),O.push(L)}}return{output:O.length>0?`${O.join(`
182
182
  `)}
183
183
  `:"",matched:F>0,matchCount:F}}function Sy(e,t,n){let{invertMatch:r,showLineNumbers:s,countOnly:i,countMatches:a,filename:o,onlyMatching:l,beforeContext:c,afterContext:u,maxCount:f,contextSeparator:p,showColumn:h,showByteOffset:m,replace:d,kResetGroup:g}=n,w=e.split(`
184
184
  `),y=w.length,b=y>0&&w[y-1]===""?y-1:y,x=[0];for(let k=0;k<e.length;k++)e[k]===`
@@ -194,7 +194,7 @@ Options:
194
194
  `};let je=await t.fs.readFile(ve),et=Ar(je,z,{invertMatch:s,showLineNumbers:r,countOnly:i,filename:ue?ke:"",onlyMatching:m,beforeContext:y,afterContext:b,maxCount:w,kResetGroup:k});return{file:ke,result:et}}catch{return{error:`grep: ${ke}: No such file or directory
195
195
  `}}}));for(let ae of Ee){if(ae===null)continue;if("error"in ae&&ae.error){P+=ae.error,ae.error.includes("Is a directory")||(T=!0);continue}if(!("file"in ae)||!ae.result)continue;let{file:ke,result:j}=ae;if(j.matched){if(v=!0,g)return{stdout:"",stderr:"",exitCode:0};a?N+=`${ke}
196
196
  `:o||(N+=j.output)}else o?N+=`${ke}
197
- `:i&&!a&&(N+=j.output)}}let J;return T?J=2:o?J=N.length>0?0:1:J=v?0:1,g?{stdout:"",stderr:"",exitCode:J}:{stdout:N,stderr:P,exitCode:J}}};Fy={name:"fgrep",async execute(e,t){return oo.execute(["-F",...e],t)}},My={name:"egrep",async execute(e,t){return oo.execute(["-E",...e],t)}},Uy={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},Wy={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},By={name:"egrep",flags:[],stdinType:"text",needsArgs:!0}});function Gf(){let e=[];for(let[t,n]of Object.entries(Vf).sort()){let r=[];for(let s of n.extensions)r.push(`*${s}`);for(let s of n.globs)r.push(s);e.push(`${t}: ${r.join(", ")}`)}return`${e.join(`
197
+ `:i&&!a&&(N+=j.output)}}let ee;return T?ee=2:o?ee=N.length>0?0:1:ee=v?0:1,g?{stdout:"",stderr:"",exitCode:ee}:{stdout:N,stderr:P,exitCode:ee}}};Fy={name:"fgrep",async execute(e,t){return oo.execute(["-F",...e],t)}},My={name:"egrep",async execute(e,t){return oo.execute(["-E",...e],t)}},Uy={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},Wy={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},By={name:"egrep",flags:[],stdinType:"text",needsArgs:!0}});function Gf(){let e=[];for(let[t,n]of Object.entries(Vf).sort()){let r=[];for(let s of n.extensions)r.push(`*${s}`);for(let s of n.globs)r.push(s);e.push(`${t}: ${r.join(", ")}`)}return`${e.join(`
198
198
  `)}
199
199
  `}var Vf,as,lo=I(()=>{"use strict";Me();Vf={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},as=class{types;constructor(){this.types=new Map(Object.entries(Vf).map(([t,n])=>[t,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(t){let n=t.indexOf(":");if(n===-1)return;let r=t.slice(0,n),s=t.slice(n+1);if(s.startsWith("include:")){let i=s.slice(8),a=this.types.get(i);if(a){let o=this.types.get(r)||{extensions:[],globs:[]};o.extensions.push(...a.extensions),o.globs.push(...a.globs),this.types.set(r,o)}}else{let i=this.types.get(r)||{extensions:[],globs:[]};if(s.startsWith("*.")&&!s.slice(2).includes("*")){let a=s.slice(1);i.extensions.includes(a)||i.extensions.push(a)}else i.globs.includes(s)||i.globs.push(s);this.types.set(r,i)}}clearType(t){let n=this.types.get(t);n&&(n.extensions=[],n.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,n){let r=t.toLowerCase();for(let s of n){if(s==="all"){if(this.matchesAnyType(t))return!0;continue}let i=this.types.get(s);if(i){for(let a of i.extensions)if(r.endsWith(a))return!0;for(let a of i.globs)if(a.includes("*")){let o=a.replace(/\./g,"\\.").replace(/\*/g,".*");if(G(`^${o}$`,"i").test(t))return!0}else if(r===a.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let r of this.types.values()){for(let s of r.extensions)if(n.endsWith(s))return!0;for(let s of r.globs)if(s.includes("*")){let i=s.replace(/\./g,"\\.").replace(/\*/g,".*");if(G(`^${i}$`,"i").test(t))return!0}else if(n===s.toLowerCase())return!0}return!1}}});function qf(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:1/0,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}var Zf=I(()=>{"use strict"});function zy(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return n*1024;case"M":return n*1024*1024;case"G":return n*1024*1024*1024;default:return n}}function Hy(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
200
200
  `,exitCode:1}}function Kf(e){return null}function Gy(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function qy(e,t,n){let r=e[t];for(let s of Qf){if(r.startsWith(`--${s.long}=`)){let i=r.slice(`--${s.long}=`.length),a=ii(n,s,i);return a?{newIndex:t,error:a}:{newIndex:t}}if(s.short&&r.startsWith(`-${s.short}`)&&r.length>2){let i=r.slice(2),a=ii(n,s,i);return a?{newIndex:t,error:a}:{newIndex:t}}if(s.short&&r===`-${s.short}`||r===`--${s.long}`){if(t+1>=e.length)return null;let i=e[t+1],a=ii(n,s,i);return a?{newIndex:t+1,error:a}:{newIndex:t+1}}}return null}function Zy(e){return Qf.find(t=>t.short===e)}function ii(e,t,n){if(t.validate){let s=t.validate(n);if(s)return s}let r=t.parse?t.parse(n):n;t.multi?e[t.target].push(r):e[t.target]=r}function Ky(e,t){let n=e[t];if(n==="--sort"&&t+1<e.length){let r=e[t+1];if(r==="path"||r==="none")return{value:r,newIndex:t+1}}if(n.startsWith("--sort=")){let r=n.slice(7);if(r==="path"||r==="none")return{value:r,newIndex:t}}return null}function Qy(e,t){let n=e[t],r=n.match(/^-([ABC])(\d+)$/);return r?{flag:r[1],value:parseInt(r[2],10),newIndex:t}:(n==="-A"||n==="-B"||n==="-C")&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function Xy(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function Xf(e){let t=qf(),n=null,r=[],s=-1,i=-1,a=-1,o=!1;for(let l=0;l<e.length;l++){let c=e[l];if(c.startsWith("-")&&c!=="-"){let u=Qy(e,l);if(u){let{flag:g,value:w,newIndex:y}=u;g==="A"?s=Math.max(s,w):g==="B"?i=Math.max(i,w):a=w,l=y;continue}let f=Xy(c);if(f!==null){t.maxCount=f;continue}let p=qy(e,l,t);if(p){if(p.error)return{success:!1,error:p.error};l=p.newIndex;continue}let h=Ky(e,l);if(h){t.sort=h.value,l=h.newIndex;continue}let m=c.startsWith("--")?[c]:c.slice(1).split(""),d=!1;for(let g of m){if(Vy.has(g)){t.lineNumber=!0,o=!0;continue}if(g==="u"||g==="--unrestricted"){Gy(t);continue}if(g==="P"||g==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
@@ -237,40 +237,40 @@ ${t.holdSpace}`;break;case"exchange":{let i=t.patternSpace;t.patternSpace=t.hold
237
237
  `});break;case"writeFirstLine":{let i=t.patternSpace.indexOf(`
238
238
  `),a=i!==-1?t.patternSpace.slice(0,i):t.patternSpace;t.pendingFileWrites.push({filename:e.filename,content:`${a}
239
239
  `});break}case"execute":e.command?t.pendingExecute={command:e.command,replacePattern:!1}:t.pendingExecute={command:t.patternSpace,replacePattern:!0};break;case"transliterate":t.patternSpace=g4(t.patternSpace,e);break;case"lineNumber":t.lineNumberOutput.push(String(t.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function g4(e,t){let n="";for(let r of e){let s=t.source.indexOf(r);s!==-1?n+=t.dest[s]:n+=r}return n}function go(e,t,n,r){let s=new Map;for(let l=0;l<e.length;l++){let c=e[l];c.type==="label"&&s.set(c.name,l)}let i=r?.maxIterations??u4,a=0,o=0;for(;o<e.length;){if(a++,a>i)throw new te(`sed: command execution exceeded maximum iterations (${i})`,"iterations");if(t.deleted||t.quit||t.quitSilent||t.restartCycle)break;let l=e[o];if(l.type==="next"){if(Kn(l.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t))if(t.coverage?.hit("sed:cmd:next"),t.nCommandOutput.push(t.patternSpace),n&&n.currentLineIndex+t.linesConsumedInCycle+1<n.lines.length){t.linesConsumedInCycle++;let c=n.lines[n.currentLineIndex+t.linesConsumedInCycle];t.patternSpace=c,t.lineNumber=n.currentLineIndex+t.linesConsumedInCycle+1,t.substitutionMade=!1}else{t.quit=!0,t.deleted=!0;break}o++;continue}if(l.type==="nextAppend"){if(Kn(l.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t))if(t.coverage?.hit("sed:cmd:nextAppend"),n&&n.currentLineIndex+t.linesConsumedInCycle+1<n.lines.length){t.linesConsumedInCycle++;let c=n.lines[n.currentLineIndex+t.linesConsumedInCycle];t.patternSpace+=`
240
- ${c}`,t.lineNumber=n.currentLineIndex+t.linesConsumedInCycle+1}else{t.quit=!0;break}o++;continue}if(l.type==="branch"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)){if(t.coverage?.hit("sed:cmd:branch"),c.label){let u=s.get(c.label);if(u!==void 0){o=u;continue}t.branchRequest=c.label;break}break}o++;continue}if(l.type==="branchOnSubst"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:branchOnSubst"),t.substitutionMade)){if(t.substitutionMade=!1,c.label){let u=s.get(c.label);if(u!==void 0){o=u;continue}t.branchRequest=c.label;break}break}o++;continue}if(l.type==="branchOnNoSubst"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:branchOnNoSubst"),!t.substitutionMade)){if(c.label){let u=s.get(c.label);if(u!==void 0){o=u;continue}t.branchRequest=c.label;break}break}o++;continue}if(l.type==="group"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:group"),go(c.commands,t,n,r),t.branchRequest)){let u=s.get(t.branchRequest);if(u!==void 0){t.branchRequest=void 0,o=u;continue}break}o++;continue}m4(l,t),o++}return t.linesConsumedInCycle}var u4,u1=I(()=>{"use strict";ye();Me();l1();u4=1e4});var ee,ai,f1=I(()=>{"use strict";(function(e){e.NUMBER="NUMBER",e.DOLLAR="DOLLAR",e.PATTERN="PATTERN",e.STEP="STEP",e.RELATIVE_OFFSET="RELATIVE_OFFSET",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.COMMA="COMMA",e.NEGATION="NEGATION",e.COMMAND="COMMAND",e.SUBSTITUTE="SUBSTITUTE",e.TRANSLITERATE="TRANSLITERATE",e.LABEL_DEF="LABEL_DEF",e.BRANCH="BRANCH",e.BRANCH_ON_SUBST="BRANCH_ON_SUBST",e.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",e.TEXT_CMD="TEXT_CMD",e.FILE_READ="FILE_READ",e.FILE_READ_LINE="FILE_READ_LINE",e.FILE_WRITE="FILE_WRITE",e.FILE_WRITE_LINE="FILE_WRITE_LINE",e.EXECUTE="EXECUTE",e.VERSION="VERSION",e.EOF="EOF",e.ERROR="ERROR"})(ee||(ee={}));ai=class{input;pos=0;line=1;column=1;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&t.push(n)}return t.push(this.makeToken(ee.EOF,"")),t}makeToken(t,n,r){return{type:t,value:n,line:this.line,column:this.column,...r}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
240
+ ${c}`,t.lineNumber=n.currentLineIndex+t.linesConsumedInCycle+1}else{t.quit=!0;break}o++;continue}if(l.type==="branch"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)){if(t.coverage?.hit("sed:cmd:branch"),c.label){let u=s.get(c.label);if(u!==void 0){o=u;continue}t.branchRequest=c.label;break}break}o++;continue}if(l.type==="branchOnSubst"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:branchOnSubst"),t.substitutionMade)){if(t.substitutionMade=!1,c.label){let u=s.get(c.label);if(u!==void 0){o=u;continue}t.branchRequest=c.label;break}break}o++;continue}if(l.type==="branchOnNoSubst"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:branchOnNoSubst"),!t.substitutionMade)){if(c.label){let u=s.get(c.label);if(u!==void 0){o=u;continue}t.branchRequest=c.label;break}break}o++;continue}if(l.type==="group"){let c=l;if(Kn(c.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&(t.coverage?.hit("sed:cmd:group"),go(c.commands,t,n,r),t.branchRequest)){let u=s.get(t.branchRequest);if(u!==void 0){t.branchRequest=void 0,o=u;continue}break}o++;continue}m4(l,t),o++}return t.linesConsumedInCycle}var u4,u1=I(()=>{"use strict";ye();Me();l1();u4=1e4});var J,ai,f1=I(()=>{"use strict";(function(e){e.NUMBER="NUMBER",e.DOLLAR="DOLLAR",e.PATTERN="PATTERN",e.STEP="STEP",e.RELATIVE_OFFSET="RELATIVE_OFFSET",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.COMMA="COMMA",e.NEGATION="NEGATION",e.COMMAND="COMMAND",e.SUBSTITUTE="SUBSTITUTE",e.TRANSLITERATE="TRANSLITERATE",e.LABEL_DEF="LABEL_DEF",e.BRANCH="BRANCH",e.BRANCH_ON_SUBST="BRANCH_ON_SUBST",e.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",e.TEXT_CMD="TEXT_CMD",e.FILE_READ="FILE_READ",e.FILE_READ_LINE="FILE_READ_LINE",e.FILE_WRITE="FILE_WRITE",e.FILE_WRITE_LINE="FILE_WRITE_LINE",e.EXECUTE="EXECUTE",e.VERSION="VERSION",e.EOF="EOF",e.ERROR="ERROR"})(J||(J={}));ai=class{input;pos=0;line=1;column=1;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&t.push(n)}return t.push(this.makeToken(J.EOF,"")),t}makeToken(t,n,r){return{type:t,value:n,line:this.line,column:this.column,...r}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
241
241
  `?(this.line++,this.column=1):this.column++,t}readEscapedString(t){let n="";for(;this.pos<this.input.length&&this.peek()!==t;)if(this.peek()==="\\"){this.advance();let r=this.advance();r==="n"?n+=`
242
242
  `:r==="t"?n+=" ":n+=r}else{if(this.peek()===`
243
243
  `)return null;n+=this.advance()}return n}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.peek();if(t===" "||t===" "||t==="\r")this.advance();else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
244
244
  `;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let t=this.line,n=this.column,r=this.peek();return r===`
245
- `?(this.advance(),{type:ee.NEWLINE,value:`
246
- `,line:t,column:n}):r===";"?(this.advance(),{type:ee.SEMICOLON,value:";",line:t,column:n}):r==="{"?(this.advance(),{type:ee.LBRACE,value:"{",line:t,column:n}):r==="}"?(this.advance(),{type:ee.RBRACE,value:"}",line:t,column:n}):r===","?(this.advance(),{type:ee.COMMA,value:",",line:t,column:n}):r==="!"?(this.advance(),{type:ee.NEGATION,value:"!",line:t,column:n}):r==="$"?(this.advance(),{type:ee.DOLLAR,value:"$",line:t,column:n}):this.isDigit(r)?this.readNumber():r==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():r==="/"?this.readPattern():r===":"?this.readLabelDef():this.readCommand()}readNumber(){let t=this.line,n=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="~"){this.advance();let s="";for(;this.isDigit(this.peek());)s+=this.advance();let i=parseInt(r,10),a=parseInt(s,10)||0;return{type:ee.STEP,value:`${i}~${a}`,first:i,step:a,line:t,column:n}}return{type:ee.NUMBER,value:parseInt(r,10),line:t,column:n}}readRelativeOffset(){let t=this.line,n=this.column;this.advance();let r="";for(;this.isDigit(this.peek());)r+=this.advance();let s=parseInt(r,10)||0;return{type:ee.RELATIVE_OFFSET,value:`+${s}`,offset:s,line:t,column:n}}readPattern(){let t=this.line,n=this.column;this.advance();let r="",s=!1;for(;this.pos<this.input.length;){let i=this.peek();if(i==="/"&&!s)break;if(i==="\\")r+=this.advance(),this.pos<this.input.length&&this.peek()!==`
245
+ `?(this.advance(),{type:J.NEWLINE,value:`
246
+ `,line:t,column:n}):r===";"?(this.advance(),{type:J.SEMICOLON,value:";",line:t,column:n}):r==="{"?(this.advance(),{type:J.LBRACE,value:"{",line:t,column:n}):r==="}"?(this.advance(),{type:J.RBRACE,value:"}",line:t,column:n}):r===","?(this.advance(),{type:J.COMMA,value:",",line:t,column:n}):r==="!"?(this.advance(),{type:J.NEGATION,value:"!",line:t,column:n}):r==="$"?(this.advance(),{type:J.DOLLAR,value:"$",line:t,column:n}):this.isDigit(r)?this.readNumber():r==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():r==="/"?this.readPattern():r===":"?this.readLabelDef():this.readCommand()}readNumber(){let t=this.line,n=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="~"){this.advance();let s="";for(;this.isDigit(this.peek());)s+=this.advance();let i=parseInt(r,10),a=parseInt(s,10)||0;return{type:J.STEP,value:`${i}~${a}`,first:i,step:a,line:t,column:n}}return{type:J.NUMBER,value:parseInt(r,10),line:t,column:n}}readRelativeOffset(){let t=this.line,n=this.column;this.advance();let r="";for(;this.isDigit(this.peek());)r+=this.advance();let s=parseInt(r,10)||0;return{type:J.RELATIVE_OFFSET,value:`+${s}`,offset:s,line:t,column:n}}readPattern(){let t=this.line,n=this.column;this.advance();let r="",s=!1;for(;this.pos<this.input.length;){let i=this.peek();if(i==="/"&&!s)break;if(i==="\\")r+=this.advance(),this.pos<this.input.length&&this.peek()!==`
247
247
  `&&(r+=this.advance());else{if(i===`
248
- `)break;i==="["&&!s?(s=!0,r+=this.advance(),this.peek()==="^"&&(r+=this.advance()),this.peek()==="]"&&(r+=this.advance())):i==="]"&&s?(s=!1,r+=this.advance()):r+=this.advance()}}return this.peek()==="/"&&this.advance(),{type:ee.PATTERN,value:r,pattern:r,line:t,column:n}}readLabelDef(){let t=this.line,n=this.column;for(this.advance();this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
249
- `||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:ee.LABEL_DEF,value:r,label:r,line:t,column:n}}readCommand(){let t=this.line,n=this.column,r=this.advance();switch(r){case"s":return this.readSubstitute(t,n);case"y":return this.readTransliterate(t,n);case"a":case"i":case"c":return this.readTextCommand(r,t,n);case"b":return this.readBranch(ee.BRANCH,"b",t,n);case"t":return this.readBranch(ee.BRANCH_ON_SUBST,"t",t,n);case"T":return this.readBranch(ee.BRANCH_ON_NO_SUBST,"T",t,n);case"r":return this.readFileCommand(ee.FILE_READ,"r",t,n);case"R":return this.readFileCommand(ee.FILE_READ_LINE,"R",t,n);case"w":return this.readFileCommand(ee.FILE_WRITE,"w",t,n);case"W":return this.readFileCommand(ee.FILE_WRITE_LINE,"W",t,n);case"e":return this.readExecute(t,n);case"p":case"P":case"d":case"D":case"h":case"H":case"g":case"G":case"x":case"n":case"N":case"q":case"Q":case"z":case"=":case"l":case"F":return{type:ee.COMMAND,value:r,line:t,column:n};case"v":return this.readVersion(t,n);default:return{type:ee.ERROR,value:r,line:t,column:n}}}readSubstitute(t,n){let r=this.advance();if(!r||r===`
250
- `)return{type:ee.ERROR,value:"s",line:t,column:n};let s="",i=!1;for(;this.pos<this.input.length;){let l=this.peek();if(l===r&&!i)break;if(l==="\\")this.advance(),this.pos<this.input.length&&this.peek()!==`
248
+ `)break;i==="["&&!s?(s=!0,r+=this.advance(),this.peek()==="^"&&(r+=this.advance()),this.peek()==="]"&&(r+=this.advance())):i==="]"&&s?(s=!1,r+=this.advance()):r+=this.advance()}}return this.peek()==="/"&&this.advance(),{type:J.PATTERN,value:r,pattern:r,line:t,column:n}}readLabelDef(){let t=this.line,n=this.column;for(this.advance();this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
249
+ `||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:J.LABEL_DEF,value:r,label:r,line:t,column:n}}readCommand(){let t=this.line,n=this.column,r=this.advance();switch(r){case"s":return this.readSubstitute(t,n);case"y":return this.readTransliterate(t,n);case"a":case"i":case"c":return this.readTextCommand(r,t,n);case"b":return this.readBranch(J.BRANCH,"b",t,n);case"t":return this.readBranch(J.BRANCH_ON_SUBST,"t",t,n);case"T":return this.readBranch(J.BRANCH_ON_NO_SUBST,"T",t,n);case"r":return this.readFileCommand(J.FILE_READ,"r",t,n);case"R":return this.readFileCommand(J.FILE_READ_LINE,"R",t,n);case"w":return this.readFileCommand(J.FILE_WRITE,"w",t,n);case"W":return this.readFileCommand(J.FILE_WRITE_LINE,"W",t,n);case"e":return this.readExecute(t,n);case"p":case"P":case"d":case"D":case"h":case"H":case"g":case"G":case"x":case"n":case"N":case"q":case"Q":case"z":case"=":case"l":case"F":return{type:J.COMMAND,value:r,line:t,column:n};case"v":return this.readVersion(t,n);default:return{type:J.ERROR,value:r,line:t,column:n}}}readSubstitute(t,n){let r=this.advance();if(!r||r===`
250
+ `)return{type:J.ERROR,value:"s",line:t,column:n};let s="",i=!1;for(;this.pos<this.input.length;){let l=this.peek();if(l===r&&!i)break;if(l==="\\")this.advance(),this.pos<this.input.length&&this.peek()!==`
251
251
  `?this.peek()===r&&!i?s+=this.advance():(s+="\\",s+=this.advance()):s+="\\";else{if(l===`
252
- `)break;l==="["&&!i?(i=!0,s+=this.advance(),this.peek()==="^"&&(s+=this.advance()),this.peek()==="]"&&(s+=this.advance())):l==="]"&&i?(i=!1,s+=this.advance()):s+=this.advance()}}if(this.peek()!==r)return{type:ee.ERROR,value:"unterminated substitution pattern",line:t,column:n};this.advance();let a="";for(;this.pos<this.input.length&&this.peek()!==r;)if(this.peek()==="\\")if(this.advance(),this.pos<this.input.length){let l=this.peek();l==="\\"?(this.advance(),this.pos<this.input.length&&this.peek()===`
252
+ `)break;l==="["&&!i?(i=!0,s+=this.advance(),this.peek()==="^"&&(s+=this.advance()),this.peek()==="]"&&(s+=this.advance())):l==="]"&&i?(i=!1,s+=this.advance()):s+=this.advance()}}if(this.peek()!==r)return{type:J.ERROR,value:"unterminated substitution pattern",line:t,column:n};this.advance();let a="";for(;this.pos<this.input.length&&this.peek()!==r;)if(this.peek()==="\\")if(this.advance(),this.pos<this.input.length){let l=this.peek();l==="\\"?(this.advance(),this.pos<this.input.length&&this.peek()===`
253
253
  `?(a+=`
254
254
  `,this.advance()):a+="\\"):l===`
255
255
  `?(a+=`
256
256
  `,this.advance()):a+=`\\${this.advance()}`}else a+="\\";else{if(this.peek()===`
257
- `)break;a+=this.advance()}this.peek()===r&&this.advance();let o="";for(;this.pos<this.input.length;){let l=this.peek();if(l==="g"||l==="i"||l==="p"||l==="I"||this.isDigit(l))o+=this.advance();else break}return{type:ee.SUBSTITUTE,value:`s${r}${s}${r}${a}${r}${o}`,pattern:s,replacement:a,flags:o,line:t,column:n}}readTransliterate(t,n){let r=this.advance();if(!r||r===`
258
- `)return{type:ee.ERROR,value:"y",line:t,column:n};let s=this.readEscapedString(r);if(s===null||this.peek()!==r)return{type:ee.ERROR,value:"unterminated transliteration source",line:t,column:n};this.advance();let i=this.readEscapedString(r);if(i===null||this.peek()!==r)return{type:ee.ERROR,value:"unterminated transliteration dest",line:t,column:n};this.advance();let a=this.peek();for(;a===" "||a===" ";)this.advance(),a=this.peek();return a!==""&&a!==";"&&a!==`
259
- `&&a!=="}"?{type:ee.ERROR,value:"extra text at the end of a transform command",line:t,column:n}:{type:ee.TRANSLITERATE,value:`y${r}${s}${r}${i}${r}`,source:s,dest:i,line:t,column:n}}readTextCommand(t,n,r){let s=!1;this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===`
257
+ `)break;a+=this.advance()}this.peek()===r&&this.advance();let o="";for(;this.pos<this.input.length;){let l=this.peek();if(l==="g"||l==="i"||l==="p"||l==="I"||this.isDigit(l))o+=this.advance();else break}return{type:J.SUBSTITUTE,value:`s${r}${s}${r}${a}${r}${o}`,pattern:s,replacement:a,flags:o,line:t,column:n}}readTransliterate(t,n){let r=this.advance();if(!r||r===`
258
+ `)return{type:J.ERROR,value:"y",line:t,column:n};let s=this.readEscapedString(r);if(s===null||this.peek()!==r)return{type:J.ERROR,value:"unterminated transliteration source",line:t,column:n};this.advance();let i=this.readEscapedString(r);if(i===null||this.peek()!==r)return{type:J.ERROR,value:"unterminated transliteration dest",line:t,column:n};this.advance();let a=this.peek();for(;a===" "||a===" ";)this.advance(),a=this.peek();return a!==""&&a!==";"&&a!==`
259
+ `&&a!=="}"?{type:J.ERROR,value:"extra text at the end of a transform command",line:t,column:n}:{type:J.TRANSLITERATE,value:`y${r}${s}${r}${i}${r}`,source:s,dest:i,line:t,column:n}}readTextCommand(t,n,r){let s=!1;this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===`
260
260
  `||this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&(s=!0,this.advance()),(this.peek()===" "||this.peek()===" ")&&this.advance(),this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&this.advance(),s&&this.peek()===`
261
261
  `&&this.advance();let i="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
262
262
  `){if(i.endsWith("\\")){i=`${i.slice(0,-1)}
263
263
  `,this.advance();continue}break}if(a==="\\"&&this.pos+1<this.input.length){let o=this.input[this.pos+1];if(o==="n"){i+=`
264
- `,this.advance(),this.advance();continue}if(o==="t"){i+=" ",this.advance(),this.advance();continue}if(o==="r"){i+="\r",this.advance(),this.advance();continue}}i+=this.advance()}return{type:ee.TEXT_CMD,value:t,text:i,line:n,column:r}}readBranch(t,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let a=this.peek();if(a===" "||a===" "||a===`
264
+ `,this.advance(),this.advance();continue}if(o==="t"){i+=" ",this.advance(),this.advance();continue}if(o==="r"){i+="\r",this.advance(),this.advance();continue}}i+=this.advance()}return{type:J.TEXT_CMD,value:t,text:i,line:n,column:r}}readBranch(t,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let a=this.peek();if(a===" "||a===" "||a===`
265
265
  `||a===";"||a==="}"||a==="{")break;i+=this.advance()}return{type:t,value:n,label:i||void 0,line:r,column:s}}readVersion(t,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
266
- `||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:ee.VERSION,value:"v",label:r||void 0,line:t,column:n}}readFileCommand(t,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
266
+ `||s===";"||s==="}"||s==="{")break;r+=this.advance()}return{type:J.VERSION,value:"v",label:r||void 0,line:t,column:n}}readFileCommand(t,n,r,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let i="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
267
267
  `||a===";")break;i+=this.advance()}return{type:t,value:n,filename:i.trim(),line:r,column:s}}readExecute(t,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
268
- `||s===";")break;r+=this.advance()}return{type:ee.EXECUTE,value:"e",command:r.trim()||void 0,line:t,column:n}}isDigit(t){return t>="0"&&t<="9"}}});function p1(e,t=!1){let n=!1,r=!1,s=[];for(let l=0;l<e.length;l++){let c=e[l];if(s.length===0&&l===0){let u=c.match(/^#([nr]+)\s*(?:\n|$)/i);if(u){let f=u[1].toLowerCase();f.includes("n")&&(n=!0),f.includes("r")&&(r=!0),c=c.slice(u[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let u=s[s.length-1];s[s.length-1]=`${u}
268
+ `||s===";")break;r+=this.advance()}return{type:J.EXECUTE,value:"e",command:r.trim()||void 0,line:t,column:n}}isDigit(t){return t>="0"&&t<="9"}}});function p1(e,t=!1){let n=!1,r=!1,s=[];for(let l=0;l<e.length;l++){let c=e[l];if(s.length===0&&l===0){let u=c.match(/^#([nr]+)\s*(?:\n|$)/i);if(u){let f=u[1].toLowerCase();f.includes("n")&&(n=!0),f.includes("r")&&(r=!0),c=c.slice(u[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let u=s[s.length-1];s[s.length-1]=`${u}
269
269
  ${c}`}else s.push(c)}let i=s.join(`
270
- `),o=new yo([i],t||r).parse();if(!o.error&&o.commands.length>0){let l=y4(o.commands);if(l)return{commands:[],error:l,silentMode:n,extendedRegexMode:r}}return{...o,silentMode:n,extendedRegexMode:r}}function y4(e){let t=new Set;h1(e,t);let n=d1(e,t);if(n)return`undefined label '${n}'`}function h1(e,t){for(let n of e)n.type==="label"?t.add(n.name):n.type==="group"&&h1(n.commands,t)}function d1(e,t){for(let n of e){if((n.type==="branch"||n.type==="branchOnSubst"||n.type==="branchOnNoSubst")&&n.label&&!t.has(n.label))return n.label;if(n.type==="group"){let r=d1(n.commands,t);if(r)return r}}}var yo,m1=I(()=>{"use strict";f1();yo=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(t,n=!1){this.scripts=t,this.extendedRegex=n}parse(){let t=[];for(let n of this.scripts){let r=new ai(n);for(this.tokens=r.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(ee.NEWLINE)||this.check(ee.SEMICOLON)){this.advance();continue}let s=this.parseCommand();if(s.error)return{commands:[],error:s.error};s.command&&t.push(s.command)}}return{commands:t}}parseCommand(){let t=this.parseAddressRange();if(t?.error)return{command:null,error:t.error};let n=t?.address;for(this.check(ee.NEGATION)&&(this.advance(),n&&(n.negated=!0));this.check(ee.NEWLINE)||this.check(ee.SEMICOLON);)this.advance();if(this.isAtEnd())return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null};let r=this.peek();switch(r.type){case ee.COMMAND:return this.parseSimpleCommand(r,n);case ee.SUBSTITUTE:return this.parseSubstituteFromToken(r,n);case ee.TRANSLITERATE:return this.parseTransliterateFromToken(r,n);case ee.LABEL_DEF:return this.advance(),{command:{type:"label",name:r.label||""}};case ee.BRANCH:return this.advance(),{command:{type:"branch",address:n,label:r.label}};case ee.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:n,label:r.label}};case ee.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:n,label:r.label}};case ee.TEXT_CMD:return this.advance(),this.parseTextCommand(r,n);case ee.FILE_READ:return this.advance(),{command:{type:"readFile",address:n,filename:r.filename||""}};case ee.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:n,filename:r.filename||""}};case ee.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:n,filename:r.filename||""}};case ee.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:n,filename:r.filename||""}};case ee.EXECUTE:return this.advance(),{command:{type:"execute",address:n,command:r.command}};case ee.VERSION:return this.advance(),{command:{type:"version",address:n,minVersion:r.label}};case ee.LBRACE:return this.parseGroup(n);case ee.RBRACE:return{command:null};case ee.ERROR:return{command:null,error:`invalid command: ${r.value}`};default:return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(t,n){this.advance();let r=t.value;switch(r){case"p":return{command:{type:"print",address:n}};case"P":return{command:{type:"printFirstLine",address:n}};case"d":return{command:{type:"delete",address:n}};case"D":return{command:{type:"deleteFirstLine",address:n}};case"h":return{command:{type:"hold",address:n}};case"H":return{command:{type:"holdAppend",address:n}};case"g":return{command:{type:"get",address:n}};case"G":return{command:{type:"getAppend",address:n}};case"x":return{command:{type:"exchange",address:n}};case"n":return{command:{type:"next",address:n}};case"N":return{command:{type:"nextAppend",address:n}};case"q":return{command:{type:"quit",address:n}};case"Q":return{command:{type:"quitSilent",address:n}};case"z":return{command:{type:"zap",address:n}};case"=":return{command:{type:"lineNumber",address:n}};case"l":return{command:{type:"list",address:n}};case"F":return{command:{type:"printFilename",address:n}};default:return{command:null,error:`unknown command: ${r}`}}}parseSubstituteFromToken(t,n){this.advance();let r=t.flags||"",s,i=r.match(/(\d+)/);return i&&(s=parseInt(i[1],10)),{command:{type:"substitute",address:n,pattern:t.pattern||"",replacement:t.replacement||"",global:r.includes("g"),ignoreCase:r.includes("i")||r.includes("I"),printOnMatch:r.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(t,n){this.advance();let r=t.source||"",s=t.dest||"";return r.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:n,source:r,dest:s}}}parseTextCommand(t,n){let r=t.value,s=t.text||"";switch(r){case"a":return{command:{type:"append",address:n,text:s}};case"i":return{command:{type:"insert",address:n,text:s}};case"c":return{command:{type:"change",address:n,text:s}};default:return{command:null,error:`unknown text command: ${r}`}}}parseGroup(t){this.advance();let n=[];for(;!this.isAtEnd()&&!this.check(ee.RBRACE);){if(this.check(ee.NEWLINE)||this.check(ee.SEMICOLON)){this.advance();continue}let r=this.parseCommand();if(r.error)return{command:null,error:r.error};r.command&&n.push(r.command)}return this.check(ee.RBRACE)?(this.advance(),{command:{type:"group",address:t,commands:n}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){let t=this.parseAddress();if(t===void 0)return;let n;if(this.check(ee.RELATIVE_OFFSET))n={offset:this.advance().offset||0};else if(this.check(ee.COMMA)&&(this.advance(),n=this.parseAddress(),n===void 0))return{error:"expected context address"};return{address:{start:t,end:n}}}parseAddress(){let t=this.peek();switch(t.type){case ee.NUMBER:return this.advance(),t.value;case ee.DOLLAR:return this.advance(),"$";case ee.PATTERN:return this.advance(),{pattern:t.pattern||t.value};case ee.STEP:return this.advance(),{first:t.first||0,step:t.step||0};case ee.RELATIVE_OFFSET:return this.advance(),{offset:t.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:ee.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(t){return this.peek().type===t}isAtEnd(){return this.peek().type===ee.EOF}}});var g1={};K(g1,{flagsForFuzzing:()=>x4,sedCommand:()=>b4});async function wo(e,t,n,r={}){let{limits:s,filename:i,fs:a,cwd:o,coverage:l}=r,c=e.endsWith(`
270
+ `),o=new yo([i],t||r).parse();if(!o.error&&o.commands.length>0){let l=y4(o.commands);if(l)return{commands:[],error:l,silentMode:n,extendedRegexMode:r}}return{...o,silentMode:n,extendedRegexMode:r}}function y4(e){let t=new Set;h1(e,t);let n=d1(e,t);if(n)return`undefined label '${n}'`}function h1(e,t){for(let n of e)n.type==="label"?t.add(n.name):n.type==="group"&&h1(n.commands,t)}function d1(e,t){for(let n of e){if((n.type==="branch"||n.type==="branchOnSubst"||n.type==="branchOnNoSubst")&&n.label&&!t.has(n.label))return n.label;if(n.type==="group"){let r=d1(n.commands,t);if(r)return r}}}var yo,m1=I(()=>{"use strict";f1();yo=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(t,n=!1){this.scripts=t,this.extendedRegex=n}parse(){let t=[];for(let n of this.scripts){let r=new ai(n);for(this.tokens=r.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(J.NEWLINE)||this.check(J.SEMICOLON)){this.advance();continue}let s=this.pos,i=this.parseCommand();if(i.error)return{commands:[],error:i.error};if(i.command&&t.push(i.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:t}}parseCommand(){let t=this.parseAddressRange();if(t?.error)return{command:null,error:t.error};let n=t?.address;for(this.check(J.NEGATION)&&(this.advance(),n&&(n.negated=!0));this.check(J.NEWLINE)||this.check(J.SEMICOLON);)this.advance();if(this.isAtEnd())return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null};let r=this.peek();switch(r.type){case J.COMMAND:return this.parseSimpleCommand(r,n);case J.SUBSTITUTE:return this.parseSubstituteFromToken(r,n);case J.TRANSLITERATE:return this.parseTransliterateFromToken(r,n);case J.LABEL_DEF:return this.advance(),{command:{type:"label",name:r.label||""}};case J.BRANCH:return this.advance(),{command:{type:"branch",address:n,label:r.label}};case J.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:n,label:r.label}};case J.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:n,label:r.label}};case J.TEXT_CMD:return this.advance(),this.parseTextCommand(r,n);case J.FILE_READ:return this.advance(),{command:{type:"readFile",address:n,filename:r.filename||""}};case J.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:n,filename:r.filename||""}};case J.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:n,filename:r.filename||""}};case J.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:n,filename:r.filename||""}};case J.EXECUTE:return this.advance(),{command:{type:"execute",address:n,command:r.command}};case J.VERSION:return this.advance(),{command:{type:"version",address:n,minVersion:r.label}};case J.LBRACE:return this.parseGroup(n);case J.RBRACE:return{command:null};case J.ERROR:return{command:null,error:`invalid command: ${r.value}`};default:return n&&(n.start!==void 0||n.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(t,n){this.advance();let r=t.value;switch(r){case"p":return{command:{type:"print",address:n}};case"P":return{command:{type:"printFirstLine",address:n}};case"d":return{command:{type:"delete",address:n}};case"D":return{command:{type:"deleteFirstLine",address:n}};case"h":return{command:{type:"hold",address:n}};case"H":return{command:{type:"holdAppend",address:n}};case"g":return{command:{type:"get",address:n}};case"G":return{command:{type:"getAppend",address:n}};case"x":return{command:{type:"exchange",address:n}};case"n":return{command:{type:"next",address:n}};case"N":return{command:{type:"nextAppend",address:n}};case"q":return{command:{type:"quit",address:n}};case"Q":return{command:{type:"quitSilent",address:n}};case"z":return{command:{type:"zap",address:n}};case"=":return{command:{type:"lineNumber",address:n}};case"l":return{command:{type:"list",address:n}};case"F":return{command:{type:"printFilename",address:n}};default:return{command:null,error:`unknown command: ${r}`}}}parseSubstituteFromToken(t,n){this.advance();let r=t.flags||"",s,i=r.match(/(\d+)/);return i&&(s=parseInt(i[1],10)),{command:{type:"substitute",address:n,pattern:t.pattern||"",replacement:t.replacement||"",global:r.includes("g"),ignoreCase:r.includes("i")||r.includes("I"),printOnMatch:r.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(t,n){this.advance();let r=t.source||"",s=t.dest||"";return r.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:n,source:r,dest:s}}}parseTextCommand(t,n){let r=t.value,s=t.text||"";switch(r){case"a":return{command:{type:"append",address:n,text:s}};case"i":return{command:{type:"insert",address:n,text:s}};case"c":return{command:{type:"change",address:n,text:s}};default:return{command:null,error:`unknown text command: ${r}`}}}parseGroup(t){this.advance();let n=[];for(;!this.isAtEnd()&&!this.check(J.RBRACE);){if(this.check(J.NEWLINE)||this.check(J.SEMICOLON)){this.advance();continue}let r=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&n.push(s.command),this.pos===r&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(J.RBRACE)?(this.advance(),{command:{type:"group",address:t,commands:n}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(J.COMMA))return{error:"expected context address"};let t=this.parseAddress();if(t===void 0)return;let n;if(this.check(J.RELATIVE_OFFSET))n={offset:this.advance().offset||0};else if(this.check(J.COMMA)&&(this.advance(),n=this.parseAddress(),n===void 0))return{error:"expected context address"};return{address:{start:t,end:n}}}parseAddress(){let t=this.peek();switch(t.type){case J.NUMBER:return this.advance(),t.value;case J.DOLLAR:return this.advance(),"$";case J.PATTERN:return this.advance(),{pattern:t.pattern||t.value};case J.STEP:return this.advance(),{first:t.first||0,step:t.step||0};case J.RELATIVE_OFFSET:return this.advance(),{offset:t.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:J.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(t){return this.peek().type===t}isAtEnd(){return this.peek().type===J.EOF}}});var g1={};K(g1,{flagsForFuzzing:()=>x4,sedCommand:()=>b4});async function wo(e,t,n,r={}){let{limits:s,filename:i,fs:a,cwd:o,coverage:l}=r,c=e.endsWith(`
271
271
  `),u=e.split(`
272
- `);u.length>0&&u[u.length-1]===""&&u.pop();let f=u.length,p="",h,m=!1,d=s?.maxStringLength??0,g=F=>{if(p+=F,d>0&&p.length>d)throw new te(`sed: output size limit exceeded (${d} bytes)`,"string_length")},w="",y,b=new Map,x=new Map,S=new Map,$=new Map,O=s?{maxIterations:s.maxSedIterations}:void 0;for(let F=0;F<u.length;F++){let R={...c1(f,i,b),patternSpace:u[F],holdSpace:w,lastPattern:y,lineNumber:F+1,totalLines:f,substitutionMade:!1,coverage:l},z={lines:u,currentLineIndex:F},k=0,N=1e4;R.linesConsumedInCycle=0;do{if(k++,k>N)break;if(R.restartCycle=!1,R.pendingFileReads=[],R.pendingFileWrites=[],go(t,R,z,O),a&&o){for(let re of R.pendingFileReads){let J=a.resolvePath(o,re.filename);try{if(re.wholeFile){let H=await a.readFile(J);R.appendBuffer.push(H.replace(/\n$/,""))}else{if(!x.has(J)){let Ee=await a.readFile(J);x.set(J,Ee.split(`
273
- `)),S.set(J,0)}let H=x.get(J),X=S.get(J);H&&X!==void 0&&X<H.length&&(R.appendBuffer.push(H[X]),S.set(J,X+1))}}catch{}}for(let re of R.pendingFileWrites){let J=a.resolvePath(o,re.filename),H=$.get(J)||"";$.set(J,H+re.content)}}}while(R.restartCycle&&!R.deleted&&!R.quit&&!R.quitSilent);if(F+=R.linesConsumedInCycle,w=R.holdSpace,y=R.lastPattern,!n)for(let re of R.nCommandOutput)g(`${re}
272
+ `);u.length>0&&u[u.length-1]===""&&u.pop();let f=u.length,p="",h,m=!1,d=s?.maxStringLength??0,g=F=>{if(p+=F,d>0&&p.length>d)throw new te(`sed: output size limit exceeded (${d} bytes)`,"string_length")},w="",y,b=new Map,x=new Map,S=new Map,$=new Map,O=s?{maxIterations:s.maxSedIterations}:void 0;for(let F=0;F<u.length;F++){let R={...c1(f,i,b),patternSpace:u[F],holdSpace:w,lastPattern:y,lineNumber:F+1,totalLines:f,substitutionMade:!1,coverage:l},z={lines:u,currentLineIndex:F},k=0,N=1e4;R.linesConsumedInCycle=0;do{if(k++,k>N)break;if(R.restartCycle=!1,R.pendingFileReads=[],R.pendingFileWrites=[],go(t,R,z,O),a&&o){for(let re of R.pendingFileReads){let ee=a.resolvePath(o,re.filename);try{if(re.wholeFile){let H=await a.readFile(ee);R.appendBuffer.push(H.replace(/\n$/,""))}else{if(!x.has(ee)){let Ee=await a.readFile(ee);x.set(ee,Ee.split(`
273
+ `)),S.set(ee,0)}let H=x.get(ee),X=S.get(ee);H&&X!==void 0&&X<H.length&&(R.appendBuffer.push(H[X]),S.set(ee,X+1))}}catch{}}for(let re of R.pendingFileWrites){let ee=a.resolvePath(o,re.filename),H=$.get(ee)||"";$.set(ee,H+re.content)}}}while(R.restartCycle&&!R.deleted&&!R.quit&&!R.quitSilent);if(F+=R.linesConsumedInCycle,w=R.holdSpace,y=R.lastPattern,!n)for(let re of R.nCommandOutput)g(`${re}
274
274
  `);let P=R.lineNumberOutput.length>0;for(let re of R.lineNumberOutput)g(`${re}
275
275
  `);let v=[],T=[];for(let re of R.appendBuffer)re.startsWith("__INSERT__")?v.push(re.slice(10)):T.push(re);for(let re of v)g(`${re}
276
276
  `);let L=!1;!R.deleted&&!R.quitSilent?n?R.printed&&(g(`${R.patternSpace}
@@ -494,7 +494,7 @@ Try 'comm --help' for more information.
494
494
  `,o=1}return{stdout:i,stderr:a,exitCode:o}}},X8={name:"tee",flags:[{flag:"-a",type:"boolean"}],stdinType:"text",needsArgs:!0}});function Kt(e,t){switch(e.type){case"name":{let n=e.pattern,r=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let s=r[1],i=t.name;if(e.ignoreCase){if(!i.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!i.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:xt(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,r=t.relativePath,s=n.split("/");for(let a=0;a<s.length-1;a++){let o=s[a];if(o&&o!=="."&&o!==".."&&!o.includes("*")&&!o.includes("?")&&!o.includes("[")){let l=`/${o}/`;if(e.ignoreCase){if(!r.toLowerCase().includes(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(l))return{matches:!1,pruned:!1,printed:!1}}}let i=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(i){let a=i[1];if(e.ignoreCase){if(!r.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(a))return{matches:!1,pruned:!1,printed:!1}}return{matches:xt(r,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:G(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let r=(Date.now()-t.mtime)/(1e3*60*60*24),s;return e.comparison==="more"?s=r>e.days:e.comparison==="less"?s=r<e.days:s=Math.floor(r)===e.days,{matches:s,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let r;return e.comparison==="more"?r=t.size>n:e.comparison==="less"?r=t.size<n:e.unit==="b"?r=Math.ceil(t.size/512)===e.value:r=t.size===n,{matches:r,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,r=e.mode&511,s;return e.matchType==="exact"?s=n===r:e.matchType==="all"?s=(n&r)===r:s=(n&r)!==0,{matches:s,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=Kt(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=Kt(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let r=Kt(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:n.printed||r.printed}}case"or":{let n=Kt(e.left,t);if(n.matches)return n;let r=Kt(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:r.printed}}}}function ps(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return ps(e.expr);case"and":case"or":return ps(e.left)||ps(e.right)}}function hs(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return hs(e.expr);case"and":case"or":return hs(e.left)||hs(e.right);default:return!1}}function qp(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=Y8(e);if(J8(e)&&n.length===1){let i=n[0].split("/").filter(a=>a.length>0);if(i.length>=2)for(let a=i.length-2;a>=0;a--){let o=i[a];if(!o.includes("*")&&!o.includes("?")&&!o.includes("[")&&o!=="."&&o!==".."){let l=i[a+1];if(l&&(l.includes("*")||l.includes("?"))){t.terminalDirName=o;let c=l.match(/^\*(\.[a-zA-Z0-9]+)$/);c&&(t.requiredExtension=c[1])}break}}}return t}function Y8(e){let t=[],n=r=>{r.type==="path"?t.push(r.pattern):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right))};return n(e),t}function J8(e){let t=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?t(n.expr):n.type==="and"||n.type==="or"?t(n.left)||t(n.right):!1;return t(e)}function Zp(e){let t=[],n=r=>{r&&(r.type==="newer"?t.push(r.refPath):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right)))};return n(e),t}function ds(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return ds(e.expr);case"and":case"or":return ds(e.left)&&ds(e.right)}}function Yn(e,t,n,r,s){switch(e.type){case"name":{let i=e.pattern,a=i.match(/^\*(\.[a-zA-Z0-9]+)$/);if(a){let o=a[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(o.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(o))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:xt(t,i,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let i=e.pattern,a=i.split("/");for(let l=0;l<a.length-1;l++){let c=a[l];if(c&&c!=="."&&c!==".."&&!c.includes("*")&&!c.includes("?")&&!c.includes("[")){let u=`/${c}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(u))return{matches:!1,pruned:!1,printed:!1}}}let o=i.match(/\*(\.[a-zA-Z0-9]+)$/);if(o){let l=o[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(l))return{matches:!1,pruned:!1,printed:!1}}return{matches:xt(n,i,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let i=e.ignoreCase?"i":"";return{matches:G(e.pattern,i).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:r,pruned:!1,printed:!1}:e.fileType==="d"?{matches:s,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let i=Yn(e.expr,t,n,r,s);return{matches:!i.matches,pruned:i.pruned,printed:!1}}case"and":{let i=Yn(e.left,t,n,r,s);if(!i.matches)return{matches:!1,pruned:i.pruned,printed:!1};let a=Yn(e.right,t,n,r,s);return{matches:a.matches,pruned:i.pruned||a.pruned,printed:i.printed||a.printed}}case"or":{let i=Yn(e.left,t,n,r,s);if(i.matches)return i;let a=Yn(e.right,t,n,r,s);return{matches:a.matches,pruned:i.pruned||a.pruned,printed:a.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function ms(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return ms(e.expr);case"and":case"or":return ms(e.left)||ms(e.right);default:return!1}}function Dn(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return Dn(e.expr);case"and":case"or":return Dn(e.left)&&Dn(e.right)}}function Kp(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!Dn(e))return Po(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:Kt(e,n).pruned}}function Po(e,t){switch(e.type){case"or":{if(Dn(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(Kt(e.left,n).pruned)return{shouldPrune:!0}}return Po(e.right,t)}case"and":{if(Dn(e.left)&&Dn(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:Kt(e,n).pruned}}if(Dn(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return Kt(e.left,n).matches?Po(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}var Qp=I(()=>{"use strict";Me();so()});function Xp(e,t){let n=[],r=[],s=t;for(;s<e.length;){let a=e[s];if(a==="("||a==="\\("){n.push({type:"lparen"}),s++;continue}if(a===")"||a==="\\)"){n.push({type:"rparen"}),s++;continue}if(a==="-name"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s]}});else if(a==="-iname"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}});else if(a==="-path"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s]}});else if(a==="-ipath"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}});else if(a==="-regex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}});else if(a==="-iregex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}});else if(a==="-type"&&s+1<e.length){let o=e[++s];if(o==="f"||o==="d")n.push({type:"expr",expr:{type:"type",fileType:o}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${o}
495
495
  `,actions:[]}}else if(a==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(a==="-mtime"&&s+1<e.length){let o=e[++s],l="exact",c=o;o.startsWith("+")?(l="more",c=o.slice(1)):o.startsWith("-")&&(l="less",c=o.slice(1));let u=parseInt(c,10);Number.isNaN(u)||n.push({type:"expr",expr:{type:"mtime",days:u,comparison:l}})}else if(a==="-newer"&&s+1<e.length){let o=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:o}})}else if(a==="-size"&&s+1<e.length){let o=e[++s],l="exact",c=o;o.startsWith("+")?(l="more",c=o.slice(1)):o.startsWith("-")&&(l="less",c=o.slice(1));let u=c.match(/^(\d+)([ckMGb])?$/);if(u){let f=parseInt(u[1],10),p=u[2]||"b";n.push({type:"expr",expr:{type:"size",value:f,unit:p,comparison:l}})}}else if(a==="-perm"&&s+1<e.length){let o=e[++s],l="exact",c=o;o.startsWith("-")?(l="all",c=o.slice(1)):o.startsWith("/")&&(l="any",c=o.slice(1));let u=parseInt(c,8);Number.isNaN(u)||n.push({type:"expr",expr:{type:"perm",mode:u,matchType:l}})}else if(a==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(a==="-not"||a==="!")n.push({type:"not"});else if(a==="-o"||a==="-or")n.push({type:"op",op:"or"});else if(a==="-a"||a==="-and")n.push({type:"op",op:"and"});else if(a==="-maxdepth"||a==="-mindepth")s++;else if(a!=="-depth")if(a==="-exec"){let o=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)o.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let l=e[s]==="+";r.push({type:"exec",command:o,batchMode:l})}else if(a==="-print")n.push({type:"expr",expr:{type:"print"}}),r.push({type:"print"});else if(a==="-print0")r.push({type:"print0"});else if(a==="-printf"&&s+1<e.length){let o=e[++s];r.push({type:"printf",format:o})}else if(a==="-delete")r.push({type:"delete"});else{if(a.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${a}'
496
496
  `,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:r};let i=e9(n);return i.error?{expr:null,pathIndex:s,error:i.error,actions:r}:{expr:i.expr,pathIndex:s,actions:r}}function e9(e){let t=0;function n(){let o=r();if(!o)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="or"){t++;let c=r();if(!c)return o;o={type:"or",left:o,right:c}}else break}return o}function r(){let o=s();if(!o)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="and"){t++;let c=s();if(!c)return o;o={type:"and",left:o,right:c}}else if(l.type==="expr"||l.type==="not"||l.type==="lparen"){let c=s();if(!c)return o;o={type:"and",left:o,right:c}}else break}return o}function s(){if(t<e.length&&e[t].type==="not"){t++;let o=s();return o?{type:"not",expr:o}:null}return i()}function i(){if(t>=e.length)return null;let o=e[t];if(o.type==="lparen"){t++;let l=n();return t<e.length&&e[t].type==="rparen"&&t++,l}return o.type==="expr"?(t++,o.expr):(o.type==="rparen",null)}return{expr:n()}}var Yp=I(()=>{"use strict"});var eh={};K(eh,{findCommand:()=>i9,flagsForFuzzing:()=>u9});function t9(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function n9(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}function a9(e,t){let n=qs(e),r="",s=0;for(;s<n.length;)if(n[s]==="%"&&s+1<n.length){if(s++,n[s]==="%"){r+="%",s++;continue}let[i,a,o]=Au(n,s);if(s+=o,s>=n.length){r+="%";break}let l=n[s],c;switch(l){case"f":c=t.name,s++;break;case"h":{let u=t.path.lastIndexOf("/");c=u>0?t.path.slice(0,u):".",s++;break}case"p":c=t.path,s++;break;case"P":{let u=t.startingPoint;t.path===u?c="":t.path.startsWith(`${u}/`)?c=t.path.slice(u.length+1):u==="."&&t.path.startsWith("./")?c=t.path.slice(2):c=t.path,s++;break}case"s":c=String(t.size),s++;break;case"d":c=String(t.depth),s++;break;case"m":c=(t.mode&511).toString(8),s++;break;case"M":c=o9(t.mode,t.isDirectory),s++;break;case"t":{let u=new Date(t.mtime);c=l9(u),s++;break}case"T":{if(s+1<n.length){let u=n[s+1],f=new Date(t.mtime);c=c9(f,u),s+=2}else c="%T",s++;break}default:r+=`%${i!==0||a!==-1?`${i}.${a}`:""}${l}`,s++;continue}r+=Gs(c,i,a)}else r+=n[s],s++;return r}function o9(e,t){let n=e&511,r=t?"d":"-";return r+=n&256?"r":"-",r+=n&128?"w":"-",r+=n&64?"x":"-",r+=n&32?"r":"-",r+=n&16?"w":"-",r+=n&8?"x":"-",r+=n&4?"r":"-",r+=n&2?"w":"-",r+=n&1?"x":"-",r}function l9(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=t[e.getDay()],s=n[e.getMonth()],i=String(e.getDate()).padStart(2," "),a=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0"),c=e.getFullYear();return`${r} ${s} ${i} ${a}:${o}:${l} ${c}`}function c9(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var Jp,r9,s9,i9,u9,th=I(()=>{"use strict";se();Ua();Qp();Yp();Jp=500;r9={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},s9=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),i9={name:"find",async execute(e,t){if(U(e))return M(r9);let n=[],r=null,s=null,i=!1,a=!1;for(let N=0;N<e.length;N++){let P=e[N];if(P==="-maxdepth"&&N+1<e.length)a=!0,r=parseInt(e[++N],10);else if(P==="-mindepth"&&N+1<e.length)a=!0,s=parseInt(e[++N],10);else if(P==="-depth")a=!0,i=!0;else if(P==="-exec")for(a=!0,N++;N<e.length&&e[N]!==";"&&e[N]!=="+";)N++;else!P.startsWith("-")&&P!==";"&&P!=="+"&&P!=="("&&P!==")"&&P!=="\\("&&P!=="\\)"&&P!=="!"?a||n.push(P):s9.has(P)?(a=!0,N++):(P.startsWith("-")||P==="("||P==="\\("||P==="!")&&(a=!0)}n.length===0&&n.push(".");let{expr:o,error:l,actions:c}=Xp(e,0);if(l)return{stdout:"",stderr:l,exitCode:1};let u=c.some(N=>N.type==="print"),f=c.length===0,p=[],h=c.some(N=>N.type==="printf"),m=[],d="",g=0,w=Zp(o),y=new Map;for(let N of w){let P=t.fs.resolvePath(t.cwd,N);try{let v=await t.fs.stat(P);y.set(N,v.mtime?.getTime()??Date.now())}catch{}}let b=c.some(N=>{if(N.type!=="printf")return!1;let P=N.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(P)}),x=ps(o)||b,S=hs(o),$=qp(o),O=ms(o),F=ds(o),R=typeof t.fs.readdirWithFileTypes=="function";for(let N of n){let ue=function(H){let Ee=s===null||H.depth>=s,ae=!1;if(Ee&&o!==null){let j=Date.now(),ve;if(F)ve=Yn(o,H.name,H.relativePath,H.isFile,H.isDirectory);else{let Fe={name:H.name,relativePath:H.relativePath,isFile:H.isFile,isDirectory:H.isDirectory,isEmpty:H.isEmpty,mtime:H.stat?.mtime?.getTime()??Date.now(),size:H.stat?.size??0,mode:H.stat?.mode??420,newerRefTimes:y};ve=Kt(o,Fe)}Ee=ve.matches,ae=u?ve.printed:Ee,v.evalCalls++,v.evalTime+=Date.now()-j}else Ee&&(ae=!0);return ae?{print:!0,printfData:h?{path:H.relativePath,name:H.name,size:H.stat?.size??0,mtime:H.stat?.mtime?.getTime()??Date.now(),mode:H.stat?.mode??420,isDirectory:H.isDirectory,depth:H.depth,startingPoint:N}:null}:{print:!1,printfData:null}};var k=ue;N.length>1&&N.endsWith("/")&&(N=N.slice(0,-1));let P=t.fs.resolvePath(t.cwd,N);try{await t.fs.stat(P)}catch{d+=`find: ${N}: No such file or directory
497
- `,g=1;continue}let v=t9(),T=Date.now();async function L(H){let{path:X,depth:Ee,typeInfo:ae}=H;if(v.nodeCount++,r!==null&&Ee>r)return null;let ke,j,ve;if(ae&&!x)ke=ae.isFile,j=ae.isDirectory;else{try{let Gn=Date.now();ve=await t.fs.stat(X),v.statCalls++,v.statTime+=Date.now()-Gn}catch{return null}if(!ve)return null;ke=ve.isFile,j=ve.isDirectory}let Fe;X===P?Fe=N.split("/").pop()||N:Fe=X.split("/").pop()||"";let je=X===P?N:N==="."?`./${X.slice(P==="/"?P.length:P.length+1)}`:N+X.slice(P.length),et=[],st=null,tt=null,nt=!1;j&&O&&!i&&(nt=Kp(o,{name:Fe,relativePath:je,isFile:ke,isDirectory:j}).shouldPrune,nt&&v.earlyPrunes++);let Ut=r!==null&&Ee>=r,Wt=$.terminalDirName!==null&&Fe===$.terminalDirName,ns=!Ut&&!Wt&&!nt;if(j&&((ns||S||Wt)&&!nt)){let Gn=Date.now();if(R&&t.fs.readdirWithFileTypes){if(st=await t.fs.readdirWithFileTypes(X),tt=st.map(vt=>vt.name),v.readdirCalls++,v.readdirTime+=Date.now()-Gn,ns)et=st.map((vt,Gt)=>({path:X==="/"?`/${vt.name}`:`${X}/${vt.name}`,depth:Ee+1,typeInfo:{isFile:vt.isFile,isDirectory:vt.isDirectory},resultIndex:Gt}));else if(Wt){let vt=$.requiredExtension;et=st.filter(Gt=>Gt.isFile&&(!vt||Gt.name.endsWith(vt))).map((Gt,H6)=>({path:X==="/"?`/${Gt.name}`:`${X}/${Gt.name}`,depth:Ee+1,typeInfo:{isFile:Gt.isFile,isDirectory:Gt.isDirectory},resultIndex:H6}))}}else tt=await t.fs.readdir(X),v.readdirCalls++,v.readdirTime+=Date.now()-Gn,ns&&(et=tt.map((vt,Gt)=>({path:X==="/"?`/${vt}`:`${X}/${vt}`,depth:Ee+1,resultIndex:Gt})))}let zs=ke?(ve?.size??0)===0:tt!==null&&tt.length===0,dr=nt;if(!i&&o!==null&&!nt&&O){let Gn=Date.now(),vt={name:Fe,relativePath:je,isFile:ke,isDirectory:j,isEmpty:zs,mtime:ve?.mtime?.getTime()??Date.now(),size:ve?.size??0,mode:ve?.mode??420,newerRefTimes:y};dr=Kt(o,vt).pruned,v.evalCalls++,v.evalTime+=Date.now()-Gn}return{relativePath:je,name:Fe,isFile:ke,isDirectory:j,isEmpty:zs,stat:ve,depth:Ee,children:dr?[]:et,pruned:dr}}async function re(){let H={paths:[],printfData:[]};if(i){let ve=function(Fe){let je={paths:[],printfData:[]},et=ae[Fe];if(!et)return je;for(let nt of et.childIndices){let Ut=ve(nt);je.paths.push(...Ut.paths),je.printfData.push(...Ut.printfData)}let{print:st,printfData:tt}=ue(et.node);return st&&(je.paths.push(et.node.relativePath),tt&&je.printfData.push(tt)),je};var X=ve;let ae=[],ke=[{item:{path:P,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],j=new Map;for(;ke.length>0;){let Fe=Date.now(),je=ke.splice(0,Jp),et=await Promise.all(je.map(st=>L(st.item)));v.batchCount++,v.batchTime+=Date.now()-Fe;for(let st=0;st<je.length;st++){let tt=et[st],nt=je[st];if(!tt)continue;let Ut=ae.length;if(nt.parentIndex>=0){let Wt=j.get(nt.parentIndex)||[];Wt.push(Ut),j.set(nt.parentIndex,Wt)}ae.push({node:tt,parentIndex:nt.parentIndex,childIndices:[]});for(let Wt=0;Wt<tt.children.length;Wt++)ke.push({item:tt.children[Wt],parentIndex:Ut,childOrderInParent:Wt})}}for(let[Fe,je]of j)Fe>=0&&Fe<ae.length&&(ae[Fe].childIndices=je);if(ae.length>0){let Fe=ve(0);H.paths.push(...Fe.paths),H.printfData.push(...Fe.printfData)}}else{let Fe=function(je){let et=ae.get(je);et&&(H.paths.push(et.path),et.printfData&&H.printfData.push(et.printfData));let st=ve.get(je);if(st)for(let tt of st)Fe(tt)};var Ee=Fe;let ae=new Map,ke=0,j=[{item:{path:P,depth:0,resultIndex:0},orderIndex:ke++}],ve=new Map;for(;j.length>0;){let je=Date.now(),et=j.splice(0,Jp),st=await Promise.all(et.map(async({item:tt,orderIndex:nt})=>{let Ut=await L(tt);return Ut?{node:Ut,orderIndex:nt}:null}));v.batchCount++,v.batchTime+=Date.now()-je;for(let tt of st){if(!tt)continue;let{node:nt,orderIndex:Ut}=tt,{print:Wt,printfData:ns}=ue(nt);if(Wt&&ae.set(Ut,{path:nt.relativePath,printfData:ns}),nt.children.length>0){let Fa=[];for(let zs of nt.children){let dr=ke++;Fa.push(dr),j.push({item:zs,orderIndex:dr})}ve.set(Ut,Fa)}}}Fe(0)}return H}let J=await re();if(p.push(...J.paths),m.push(...J.printfData),t.trace){let H=Date.now()-T;n9(t.trace,v,H),t.trace({category:"find",name:"searchPath",durationMs:H,details:{path:N,resultsFound:J.paths.length}})}}let z="";if(c.length>0)for(let N of c)switch(N.type){case"print":z+=p.length>0?`${p.join(`
497
+ `,g=1;continue}let v=t9(),T=Date.now();async function L(H){let{path:X,depth:Ee,typeInfo:ae}=H;if(v.nodeCount++,r!==null&&Ee>r)return null;let ke,j,ve;if(ae&&!x)ke=ae.isFile,j=ae.isDirectory;else{try{let Gn=Date.now();ve=await t.fs.stat(X),v.statCalls++,v.statTime+=Date.now()-Gn}catch{return null}if(!ve)return null;ke=ve.isFile,j=ve.isDirectory}let Fe;X===P?Fe=N.split("/").pop()||N:Fe=X.split("/").pop()||"";let je=X===P?N:N==="."?`./${X.slice(P==="/"?P.length:P.length+1)}`:N+X.slice(P.length),et=[],st=null,tt=null,nt=!1;j&&O&&!i&&(nt=Kp(o,{name:Fe,relativePath:je,isFile:ke,isDirectory:j}).shouldPrune,nt&&v.earlyPrunes++);let Ut=r!==null&&Ee>=r,Wt=$.terminalDirName!==null&&Fe===$.terminalDirName,ns=!Ut&&!Wt&&!nt;if(j&&((ns||S||Wt)&&!nt)){let Gn=Date.now();if(R&&t.fs.readdirWithFileTypes){if(st=await t.fs.readdirWithFileTypes(X),tt=st.map(vt=>vt.name),v.readdirCalls++,v.readdirTime+=Date.now()-Gn,ns)et=st.map((vt,Gt)=>({path:X==="/"?`/${vt.name}`:`${X}/${vt.name}`,depth:Ee+1,typeInfo:{isFile:vt.isFile,isDirectory:vt.isDirectory},resultIndex:Gt}));else if(Wt){let vt=$.requiredExtension;et=st.filter(Gt=>Gt.isFile&&(!vt||Gt.name.endsWith(vt))).map((Gt,H6)=>({path:X==="/"?`/${Gt.name}`:`${X}/${Gt.name}`,depth:Ee+1,typeInfo:{isFile:Gt.isFile,isDirectory:Gt.isDirectory},resultIndex:H6}))}}else tt=await t.fs.readdir(X),v.readdirCalls++,v.readdirTime+=Date.now()-Gn,ns&&(et=tt.map((vt,Gt)=>({path:X==="/"?`/${vt}`:`${X}/${vt}`,depth:Ee+1,resultIndex:Gt})))}let zs=ke?(ve?.size??0)===0:tt!==null&&tt.length===0,dr=nt;if(!i&&o!==null&&!nt&&O){let Gn=Date.now(),vt={name:Fe,relativePath:je,isFile:ke,isDirectory:j,isEmpty:zs,mtime:ve?.mtime?.getTime()??Date.now(),size:ve?.size??0,mode:ve?.mode??420,newerRefTimes:y};dr=Kt(o,vt).pruned,v.evalCalls++,v.evalTime+=Date.now()-Gn}return{relativePath:je,name:Fe,isFile:ke,isDirectory:j,isEmpty:zs,stat:ve,depth:Ee,children:dr?[]:et,pruned:dr}}async function re(){let H={paths:[],printfData:[]};if(i){let ve=function(Fe){let je={paths:[],printfData:[]},et=ae[Fe];if(!et)return je;for(let nt of et.childIndices){let Ut=ve(nt);je.paths.push(...Ut.paths),je.printfData.push(...Ut.printfData)}let{print:st,printfData:tt}=ue(et.node);return st&&(je.paths.push(et.node.relativePath),tt&&je.printfData.push(tt)),je};var X=ve;let ae=[],ke=[{item:{path:P,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],j=new Map;for(;ke.length>0;){let Fe=Date.now(),je=ke.splice(0,Jp),et=await Promise.all(je.map(st=>L(st.item)));v.batchCount++,v.batchTime+=Date.now()-Fe;for(let st=0;st<je.length;st++){let tt=et[st],nt=je[st];if(!tt)continue;let Ut=ae.length;if(nt.parentIndex>=0){let Wt=j.get(nt.parentIndex)||[];Wt.push(Ut),j.set(nt.parentIndex,Wt)}ae.push({node:tt,parentIndex:nt.parentIndex,childIndices:[]});for(let Wt=0;Wt<tt.children.length;Wt++)ke.push({item:tt.children[Wt],parentIndex:Ut,childOrderInParent:Wt})}}for(let[Fe,je]of j)Fe>=0&&Fe<ae.length&&(ae[Fe].childIndices=je);if(ae.length>0){let Fe=ve(0);H.paths.push(...Fe.paths),H.printfData.push(...Fe.printfData)}}else{let Fe=function(je){let et=ae.get(je);et&&(H.paths.push(et.path),et.printfData&&H.printfData.push(et.printfData));let st=ve.get(je);if(st)for(let tt of st)Fe(tt)};var Ee=Fe;let ae=new Map,ke=0,j=[{item:{path:P,depth:0,resultIndex:0},orderIndex:ke++}],ve=new Map;for(;j.length>0;){let je=Date.now(),et=j.splice(0,Jp),st=await Promise.all(et.map(async({item:tt,orderIndex:nt})=>{let Ut=await L(tt);return Ut?{node:Ut,orderIndex:nt}:null}));v.batchCount++,v.batchTime+=Date.now()-je;for(let tt of st){if(!tt)continue;let{node:nt,orderIndex:Ut}=tt,{print:Wt,printfData:ns}=ue(nt);if(Wt&&ae.set(Ut,{path:nt.relativePath,printfData:ns}),nt.children.length>0){let Fa=[];for(let zs of nt.children){let dr=ke++;Fa.push(dr),j.push({item:zs,orderIndex:dr})}ve.set(Ut,Fa)}}}Fe(0)}return H}let ee=await re();if(p.push(...ee.paths),m.push(...ee.printfData),t.trace){let H=Date.now()-T;n9(t.trace,v,H),t.trace({category:"find",name:"searchPath",durationMs:H,details:{path:N,resultsFound:ee.paths.length}})}}let z="";if(c.length>0)for(let N of c)switch(N.type){case"print":z+=p.length>0?`${p.join(`
498
498
  `)}
499
499
  `:"";break;case"print0":z+=p.length>0?`${p.join("\0")}\0`:"";break;case"delete":{let P=[...p].sort((v,T)=>T.length-v.length);for(let v of P){let T=t.fs.resolvePath(t.cwd,v);try{await t.fs.rm(T,{recursive:!1})}catch(L){let ue=L instanceof Error?L.message:String(L);d+=`find: cannot delete '${v}': ${ue}
500
500
  `,g=1}}break}case"printf":for(let P of m)z+=a9(N.format,P);break;case"exec":if(!t.exec)return{stdout:"",stderr:`find: -exec not supported in this context
@@ -887,7 +887,7 @@ Gid: ${r} ${r} ${r} ${r}
887
887
  }
888
888
  `;return ge(z)}let R=!0;for(let z of w)e.state.functions.has(z)||(R=!1);return B("","",R?0:1)}if(a&&w.length>0)return Bg(e,w);if(a&&w.length===0)return zg(e,{filterExport:i,filterReadonly:s,filterNameref:o,filterIndexedArray:n,filterAssocArray:r});if(w.length===0&&r&&!a)return Hg(e);if(w.length===0&&n&&!a)return jg(e);if(w.length===0&&!a)return Vg(e);let O="",F=0;for(let R of w){let z=R.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(z&&!c){let v=z[1],T=z[2];if(r&&Ye(e,v).length>0){O+=`bash: declare: ${v}: cannot convert indexed to associative array
889
889
  `,F=1;continue}if((n||!r&&!n)&&e.state.associativeArrays?.has(v)){O+=`bash: declare: ${v}: cannot convert associative to indexed array
890
- `,F=1;continue}if(S(v),r&&(e.state.associativeArrays??=new Set,e.state.associativeArrays.add(v)),wn(e,v),e.state.env.delete(v),e.state.env.delete(`${v}__length`),r&&T.includes("[")){let L=Aa(T);for(let[ue,re]of L){let J=qe(e,re);e.state.env.set(`${v}_${ue}`,J)}}else if(r){let L=An(T);for(let ue=0;ue<L.length;ue+=2){let re=L[ue],J=ue+1<L.length?qe(e,L[ue+1]):"";e.state.env.set(`${v}_${re}`,J)}}else{let L=An(T);if(L.some(re=>/^\[[^\]]+\]=/.test(re))){let re=0;for(let J of L){let H=J.match(/^\[([^\]]+)\]=(.*)$/);if(H){let X=H[1],Ee=H[2],ae=qe(e,Ee),ke;if(/^-?\d+$/.test(X))ke=Number.parseInt(X,10);else try{let j=new ce,ve=Ae(j,X);ke=await ne(e,ve.expression)}catch{ke=0}e.state.env.set(`${v}_${ke}`,ae),re=ke+1}else{let X=qe(e,J);e.state.env.set(`${v}_${re}`,X),re++}}}else{for(let re=0;re<L.length;re++)e.state.env.set(`${v}_${re}`,L[re]);e.state.env.set(`${v}__length`,String(L.length))}}$(v),s&&Lt(e,v),i&&on(e,v);continue}if(l){let v=R.includes("=")?R.slice(0,R.indexOf("=")):R;if(Km(e,v),!R.includes("="))continue}if(u){let v=R.includes("=")?R.slice(0,R.indexOf("=")):R;if(ra(e,v),!R.includes("="))continue}let k=TE(R);if(k){let{name:v,indexExpr:T,value:L}=k,ue=it(e,v);if(ue)return ue;S(v);let re;try{let H=new ce,X=Ae(H,T);re=await ne(e,X.expression)}catch{let H=parseInt(T,10);re=Number.isNaN(H)?0:H}e.state.env.set(`${v}_${re}`,L);let J=parseInt(e.state.env.get(`${v}__length`)??"0",10);re>=J&&e.state.env.set(`${v}__length`,String(re+1)),$(v),s&&Lt(e,v),i&&on(e,v);continue}let N=R.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(N&&!c){let v=N[1],T=N[2],L=it(e,v);if(L)return L;S(v);let ue=An(T);if(e.state.associativeArrays?.has(v)){let re=Aa(T);for(let[J,H]of re){let X=qe(e,H);e.state.env.set(`${v}_${J}`,X)}}else{let re=Ye(e,v),J=0,H=e.state.env.get(v);re.length===0&&H!==void 0?(e.state.env.set(`${v}_0`,H),e.state.env.delete(v),J=1):re.length>0&&(J=Math.max(...re)+1);for(let Ee=0;Ee<ue.length;Ee++)e.state.env.set(`${v}_${J+Ee}`,qe(e,ue[Ee]));let X=J+ue.length;e.state.env.set(`${v}__length`,String(X))}$(v),s&&Lt(e,v),i&&on(e,v);continue}let P=R.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(P){let v=P[1],T=qe(e,P[2]),L=it(e,v);if(L)return L;x(v),f&&Uc(e,v),p&&Wc(e,v),h&&Bc(e,v);let re=Ye(e,v).length>0||e.state.associativeArrays?.has(v);if(_s(e,v)){let J=e.state.env.get(v)??"0",H=parseInt(J,10)||0,X=parseInt(await Gg(e,T),10)||0;T=String(H+X),e.state.env.set(v,T)}else if(re){T=Yr(e,v,T);let J=`${v}_0`,H=e.state.env.get(J)??"";e.state.env.set(J,H+T)}else{T=Yr(e,v,T);let J=e.state.env.get(v)??"";e.state.env.set(v,J+T)}$(v),s&&Lt(e,v),i&&on(e,v),e.state.options.allexport&&!u&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(v));continue}if(R.includes("=")){let v=R.indexOf("="),T=R.slice(0,v),L=R.slice(v+1);if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(T)){O+=`bash: typeset: \`${T}': not a valid identifier
890
+ `,F=1;continue}if(S(v),r&&(e.state.associativeArrays??=new Set,e.state.associativeArrays.add(v)),wn(e,v),e.state.env.delete(v),e.state.env.delete(`${v}__length`),r&&T.includes("[")){let L=Aa(T);for(let[ue,re]of L){let ee=qe(e,re);e.state.env.set(`${v}_${ue}`,ee)}}else if(r){let L=An(T);for(let ue=0;ue<L.length;ue+=2){let re=L[ue],ee=ue+1<L.length?qe(e,L[ue+1]):"";e.state.env.set(`${v}_${re}`,ee)}}else{let L=An(T);if(L.some(re=>/^\[[^\]]+\]=/.test(re))){let re=0;for(let ee of L){let H=ee.match(/^\[([^\]]+)\]=(.*)$/);if(H){let X=H[1],Ee=H[2],ae=qe(e,Ee),ke;if(/^-?\d+$/.test(X))ke=Number.parseInt(X,10);else try{let j=new ce,ve=Ae(j,X);ke=await ne(e,ve.expression)}catch{ke=0}e.state.env.set(`${v}_${ke}`,ae),re=ke+1}else{let X=qe(e,ee);e.state.env.set(`${v}_${re}`,X),re++}}}else{for(let re=0;re<L.length;re++)e.state.env.set(`${v}_${re}`,L[re]);e.state.env.set(`${v}__length`,String(L.length))}}$(v),s&&Lt(e,v),i&&on(e,v);continue}if(l){let v=R.includes("=")?R.slice(0,R.indexOf("=")):R;if(Km(e,v),!R.includes("="))continue}if(u){let v=R.includes("=")?R.slice(0,R.indexOf("=")):R;if(ra(e,v),!R.includes("="))continue}let k=TE(R);if(k){let{name:v,indexExpr:T,value:L}=k,ue=it(e,v);if(ue)return ue;S(v);let re;try{let H=new ce,X=Ae(H,T);re=await ne(e,X.expression)}catch{let H=parseInt(T,10);re=Number.isNaN(H)?0:H}e.state.env.set(`${v}_${re}`,L);let ee=parseInt(e.state.env.get(`${v}__length`)??"0",10);re>=ee&&e.state.env.set(`${v}__length`,String(re+1)),$(v),s&&Lt(e,v),i&&on(e,v);continue}let N=R.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(N&&!c){let v=N[1],T=N[2],L=it(e,v);if(L)return L;S(v);let ue=An(T);if(e.state.associativeArrays?.has(v)){let re=Aa(T);for(let[ee,H]of re){let X=qe(e,H);e.state.env.set(`${v}_${ee}`,X)}}else{let re=Ye(e,v),ee=0,H=e.state.env.get(v);re.length===0&&H!==void 0?(e.state.env.set(`${v}_0`,H),e.state.env.delete(v),ee=1):re.length>0&&(ee=Math.max(...re)+1);for(let Ee=0;Ee<ue.length;Ee++)e.state.env.set(`${v}_${ee+Ee}`,qe(e,ue[Ee]));let X=ee+ue.length;e.state.env.set(`${v}__length`,String(X))}$(v),s&&Lt(e,v),i&&on(e,v);continue}let P=R.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(P){let v=P[1],T=qe(e,P[2]),L=it(e,v);if(L)return L;x(v),f&&Uc(e,v),p&&Wc(e,v),h&&Bc(e,v);let re=Ye(e,v).length>0||e.state.associativeArrays?.has(v);if(_s(e,v)){let ee=e.state.env.get(v)??"0",H=parseInt(ee,10)||0,X=parseInt(await Gg(e,T),10)||0;T=String(H+X),e.state.env.set(v,T)}else if(re){T=Yr(e,v,T);let ee=`${v}_0`,H=e.state.env.get(ee)??"";e.state.env.set(ee,H+T)}else{T=Yr(e,v,T);let ee=e.state.env.get(v)??"";e.state.env.set(v,ee+T)}$(v),s&&Lt(e,v),i&&on(e,v),e.state.options.allexport&&!u&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(v));continue}if(R.includes("=")){let v=R.indexOf("="),T=R.slice(0,v),L=R.slice(v+1);if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(T)){O+=`bash: typeset: \`${T}': not a valid identifier
891
891
  `,F=1;continue}let ue=it(e,T);if(ue)return ue;if(x(T),o){if(L!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(L)){O+=`bash: declare: \`${L}': invalid variable name for name reference
892
892
  `,F=1;continue}e.state.env.set(T,L),vn(e,T),L!==""&&ta(e,L)&&ac(e,T),$(T),s&&Lt(e,T),i&&on(e,T);continue}if(f&&Uc(e,T),p&&Wc(e,T),h&&Bc(e,T),_s(e,T)&&(L=await Gg(e,L)),L=Yr(e,T,L),Te(e,T)){let re=St(e,T);re&&re!==T?e.state.env.set(re,L):e.state.env.set(T,L)}else e.state.env.set(T,L);$(T),s&&Lt(e,T),i&&on(e,T),e.state.options.allexport&&!u&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(T))}else{let v=R;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(v)){O+=`bash: typeset: \`${v}': not a valid identifier
893
893
  `,F=1;continue}if(n||r?S(v):x(v),o){vn(e,v);let L=e.state.env.get(v);L!==void 0&&L!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(L)?Qm(e,v):L&&ta(e,L)&&ac(e,v),$(v),s&&Lt(e,v),i&&on(e,v);continue}if(f&&Uc(e,v),p&&Wc(e,v),h&&Bc(e,v),r){if(Ye(e,v).length>0){O+=`bash: declare: ${v}: cannot convert indexed to associative array
@@ -38,7 +38,7 @@ ${d}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;br
38
38
  `||a===";"||a==="}"||a==="{")break;r+=this.advance()}return{type:e,value:t,label:r||void 0,line:n,column:s}}readVersion(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
39
39
  `||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:l.VERSION,value:"v",label:n||void 0,line:e,column:t}}readFileCommand(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
40
40
  `||a===";")break;r+=this.advance()}return{type:e,value:t,filename:r.trim(),line:n,column:s}}readExecute(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
41
- `||s===";")break;n+=this.advance()}return{type:l.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var H=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new w(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let s=this.parseCommand();if(s.error)return{commands:[],error:s.error};s.command&&e.push(s.command)}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(l.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(l.NEWLINE)||this.check(l.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case l.COMMAND:return this.parseSimpleCommand(n,t);case l.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case l.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case l.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case l.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case l.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case l.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case l.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case l.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case l.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case l.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case l.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case l.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case l.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case l.LBRACE:return this.parseGroup(t);case l.RBRACE:return{command:null};case l.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,r=n.match(/(\d+)/);return r&&(s=parseInt(r[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(l.RBRACE);){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let n=this.parseCommand();if(n.error)return{command:null,error:n.error};n.command&&t.push(n.command)}return this.check(l.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(l.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(l.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case l.NUMBER:return this.advance(),e.value;case l.DOLLAR:return this.advance(),"$";case l.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case l.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case l.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:l.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===l.EOF}};function Q(i,e=!1){let t=!1,n=!1,s=[];for(let o=0;o<i.length;o++){let d=i[o];if(s.length===0&&o===0){let p=d.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let E=p[1].toLowerCase();E.includes("n")&&(t=!0),E.includes("r")&&(n=!0),d=d.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
41
+ `||s===";")break;n+=this.advance()}return{type:l.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var H=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new w(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let s=this.pos,r=this.parseCommand();if(r.error)return{commands:[],error:r.error};if(r.command&&e.push(r.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(l.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(l.NEWLINE)||this.check(l.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case l.COMMAND:return this.parseSimpleCommand(n,t);case l.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case l.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case l.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case l.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case l.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case l.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case l.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case l.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case l.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case l.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case l.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case l.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case l.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case l.LBRACE:return this.parseGroup(t);case l.RBRACE:return{command:null};case l.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,r=n.match(/(\d+)/);return r&&(s=parseInt(r[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(l.RBRACE);){if(this.check(l.NEWLINE)||this.check(l.SEMICOLON)){this.advance();continue}let n=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&t.push(s.command),this.pos===n&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(l.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(l.COMMA))return{error:"expected context address"};let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(l.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(l.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case l.NUMBER:return this.advance(),e.value;case l.DOLLAR:return this.advance(),"$";case l.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case l.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case l.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:l.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===l.EOF}};function Q(i,e=!1){let t=!1,n=!1,s=[];for(let o=0;o<i.length;o++){let d=i[o];if(s.length===0&&o===0){let p=d.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let E=p[1].toLowerCase();E.includes("n")&&(t=!0),E.includes("r")&&(n=!0),d=d.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
42
42
  ${d}`}else s.push(d)}let r=s.join(`
43
43
  `),c=new H([r],e||n).parse();if(!c.error&&c.commands.length>0){let o=fe(c.commands);if(o)return{commands:[],error:o,silentMode:t,extendedRegexMode:n}}return{...c,silentMode:t,extendedRegexMode:n}}function fe(i){let e=new Set;J(i,e);let t=Y(i,e);if(t)return`undefined label '${t}'`}function J(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&J(t.commands,e)}function Y(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=Y(t.commands,e);if(n)return n}}}var pe={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
44
44
  s/regexp/replacement/[flags] substitute
@@ -71,15 +71,15 @@ Addresses:
71
71
  N,M range from line N to M
72
72
  first~step every step-th line starting at first`};async function z(i,e,t,n={}){let{limits:s,filename:r,fs:a,cwd:c,coverage:o}=n,d=i.endsWith(`
73
73
  `),p=i.split(`
74
- `);p.length>0&&p[p.length-1]===""&&p.pop();let E=p.length,m="",f,u=!1,h=s?.maxStringLength??0,b=k=>{if(m+=k,h>0&&m.length>h)throw new x(`sed: output size limit exceeded (${h} bytes)`,"string_length")},C="",y,ee=new Map,F=new Map,$=new Map,_=new Map,te=s?{maxIterations:s.maxSedIterations}:void 0;for(let k=0;k<p.length;k++){let g={...K(E,r,ee),patternSpace:p[k],holdSpace:C,lastPattern:y,lineNumber:k+1,totalLines:E,substitutionMade:!1,coverage:o},ne={lines:p,currentLineIndex:k},V=0,ie=1e4;g.linesConsumedInCycle=0;do{if(V++,V>ie)break;if(g.restartCycle=!1,g.pendingFileReads=[],g.pendingFileWrites=[],U(e,g,ne,te),a&&c){for(let v of g.pendingFileReads){let R=a.resolvePath(c,v.filename);try{if(v.wholeFile){let S=await a.readFile(R);g.appendBuffer.push(S.replace(/\n$/,""))}else{if(!F.has(R)){let re=await a.readFile(R);F.set(R,re.split(`
75
- `)),$.set(R,0)}let S=F.get(R),A=$.get(R);S&&A!==void 0&&A<S.length&&(g.appendBuffer.push(S[A]),$.set(R,A+1))}}catch{}}for(let v of g.pendingFileWrites){let R=a.resolvePath(c,v.filename),S=_.get(R)||"";_.set(R,S+v.content)}}}while(g.restartCycle&&!g.deleted&&!g.quit&&!g.quitSilent);if(k+=g.linesConsumedInCycle,C=g.holdSpace,y=g.lastPattern,!t)for(let v of g.nCommandOutput)b(`${v}
74
+ `);p.length>0&&p[p.length-1]===""&&p.pop();let E=p.length,m="",f,u=!1,h=s?.maxStringLength??0,b=R=>{if(m+=R,h>0&&m.length>h)throw new x(`sed: output size limit exceeded (${h} bytes)`,"string_length")},C="",y,ee=new Map,F=new Map,$=new Map,M=new Map,te=s?{maxIterations:s.maxSedIterations}:void 0;for(let R=0;R<p.length;R++){let g={...K(E,r,ee),patternSpace:p[R],holdSpace:C,lastPattern:y,lineNumber:R+1,totalLines:E,substitutionMade:!1,coverage:o},ne={lines:p,currentLineIndex:R},V=0,ie=1e4;g.linesConsumedInCycle=0;do{if(V++,V>ie)break;if(g.restartCycle=!1,g.pendingFileReads=[],g.pendingFileWrites=[],U(e,g,ne,te),a&&c){for(let v of g.pendingFileReads){let k=a.resolvePath(c,v.filename);try{if(v.wholeFile){let S=await a.readFile(k);g.appendBuffer.push(S.replace(/\n$/,""))}else{if(!F.has(k)){let re=await a.readFile(k);F.set(k,re.split(`
75
+ `)),$.set(k,0)}let S=F.get(k),A=$.get(k);S&&A!==void 0&&A<S.length&&(g.appendBuffer.push(S[A]),$.set(k,A+1))}}catch{}}for(let v of g.pendingFileWrites){let k=a.resolvePath(c,v.filename),S=M.get(k)||"";M.set(k,S+v.content)}}}while(g.restartCycle&&!g.deleted&&!g.quit&&!g.quitSilent);if(R+=g.linesConsumedInCycle,C=g.holdSpace,y=g.lastPattern,!t)for(let v of g.nCommandOutput)b(`${v}
76
76
  `);let se=g.lineNumberOutput.length>0;for(let v of g.lineNumberOutput)b(`${v}
77
- `);let X=[],M=[];for(let v of g.appendBuffer)v.startsWith("__INSERT__")?X.push(v.slice(10)):M.push(v);for(let v of X)b(`${v}
77
+ `);let X=[],_=[];for(let v of g.appendBuffer)v.startsWith("__INSERT__")?X.push(v.slice(10)):_.push(v);for(let v of X)b(`${v}
78
78
  `);let L=!1;!g.deleted&&!g.quitSilent?t?g.printed&&(b(`${g.patternSpace}
79
79
  `),L=!0):(b(`${g.patternSpace}
80
80
  `),L=!0):g.changedText!==void 0&&(b(`${g.changedText}
81
- `),L=!0);for(let v of M)b(`${v}
82
- `);if(u=(se||L)&&M.length===0,g.quit||g.quitSilent){if(g.exitCode!==void 0&&(f=g.exitCode),g.errorMessage)return{output:"",exitCode:f||1,errorMessage:g.errorMessage};break}}if(a&&c)for(let[k,g]of _)try{await a.writeFile(k,g)}catch{}return!d&&u&&m.endsWith(`
81
+ `),L=!0);for(let v of _)b(`${v}
82
+ `);if(u=(se||L)&&_.length===0,g.quit||g.quitSilent){if(g.exitCode!==void 0&&(f=g.exitCode),g.errorMessage)return{output:"",exitCode:f||1,errorMessage:g.errorMessage};break}}if(a&&c)for(let[R,g]of M)try{await a.writeFile(R,g)}catch{}return!d&&u&&m.endsWith(`
83
83
  `)&&(m=m.slice(0,-1)),{output:m,exitCode:f}}var Ne={name:"sed",async execute(i,e){if(j(i))return G(pe);let t=[],n=[],s=!1,r=!1,a=!1,c=[];for(let u=0;u<i.length;u++){let h=i[u];if(h==="-n"||h==="--quiet"||h==="--silent")s=!0;else if(h==="-i"||h==="--in-place")r=!0;else if(h.startsWith("-i"))r=!0;else if(h==="-E"||h==="-r"||h==="--regexp-extended")a=!0;else if(h==="-e")u+1<i.length&&t.push(i[++u]);else if(h==="-f")u+1<i.length&&n.push(i[++u]);else{if(h.startsWith("--"))return T("sed",h);if(h==="-")c.push(h);else if(h.startsWith("-")&&h.length>1){for(let b of h.slice(1))if(b!=="n"&&b!=="e"&&b!=="f"&&b!=="i"&&b!=="E"&&b!=="r")return T("sed",`-${b}`);h.includes("n")&&(s=!0),h.includes("i")&&(r=!0),(h.includes("E")||h.includes("r"))&&(a=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&u+1<i.length&&t.push(i[++u]),h.includes("f")&&!h.includes("e")&&u+1<i.length&&n.push(i[++u])}else!h.startsWith("-")&&t.length===0&&n.length===0?t.push(h):h.startsWith("-")||c.push(h)}}for(let u of n){let h=e.fs.resolvePath(e.cwd,u);try{let b=await e.fs.readFile(h);for(let C of b.split(`
84
84
  `)){let y=C.trim();y&&!y.startsWith("#")&&t.push(y)}}catch{return{stdout:"",stderr:`sed: couldn't open file ${u}: No such file or directory
85
85
  `,exitCode:1}}}if(t.length===0)return{stdout:"",stderr:`sed: no script specified
@@ -1 +1 @@
1
- import{b as yr}from"./chunk-VZWXH2PZ.js";import{b as Ar}from"./chunk-XMDVFEVC.js";import{b as $r}from"./chunk-JI3KJ32H.js";import"./chunk-F55TLFGB.js";import"./chunk-SYMJJMQ4.js";import{b as Sr}from"./chunk-HDZ4QEVJ.js";import{b as wr}from"./chunk-MDLLFABN.js";import{b as xr}from"./chunk-ZKLK6C7H.js";import{b as vr}from"./chunk-UYGR3CFC.js";import{b as kr}from"./chunk-NQOQ2Q77.js";import{b as qr}from"./chunk-4HHKTUW3.js";import{b as Cr}from"./chunk-HJQJAYMS.js";import{b as br}from"./chunk-PP6PSHAB.js";import{d as Ir,e as Mr,f as jr}from"./chunk-DZ33S2U7.js";import{b as tr}from"./chunk-XNL7YAHW.js";import{b as lr}from"./chunk-CSBFBYLD.js";import{b as ur}from"./chunk-A7A2DBEE.js";import{b as pr}from"./chunk-U7QI5ZS5.js";import{b as er}from"./chunk-APT7OOP2.js";import{b as dr}from"./chunk-XKQRETAK.js";import{b as cr}from"./chunk-5V6VZH6T.js";import"./chunk-EIZGF4BS.js";import{b as hr}from"./chunk-CR5AFCPT.js";import{c as or,d as ar}from"./chunk-R6QSAL5T.js";import{b as sr}from"./chunk-LL3S3NLB.js";import{c as ir,d as gr}from"./chunk-JP44OYZS.js";import{b as mr}from"./chunk-2OCD45J4.js";import"./chunk-FRDGR5VK.js";import"./chunk-7MKBHGLS.js";import{b as Fr}from"./chunk-IBFD7QQD.js";import{b as zr}from"./chunk-TLSUDHID.js";import{b as fr}from"./chunk-OCK72LWW.js";import{b as nr}from"./chunk-WMLBQOWO.js";import{b as R}from"./chunk-ALLTKNUZ.js";import{b as U}from"./chunk-4Q4SM6WR.js";import{b as V}from"./chunk-XVDPCNWR.js";import{b as W}from"./chunk-K3PAWJ7V.js";import{c as X,d as Y}from"./chunk-OGDTSM2Q.js";import{c as Z,d as _}from"./chunk-VOBGTVA6.js";import{b as N}from"./chunk-NCNPKYJZ.js";import{b as rr}from"./chunk-SXR3EI72.js";import{b as G}from"./chunk-VJFXDYWH.js";import{b as H}from"./chunk-PYSFUGCK.js";import{b as J}from"./chunk-VYOJP4TV.js";import{b as K}from"./chunk-KTGH7NTP.js";import{b as L}from"./chunk-LWEGUNWT.js";import{b as O}from"./chunk-A7ICOL4V.js";import{b as P}from"./chunk-55VFSPNA.js";import{b as Q}from"./chunk-YYB54I7F.js";import{b as y}from"./chunk-7C6RBHP3.js";import{b as A}from"./chunk-Z7JVV2SM.js";import{b as $}from"./chunk-6NY2AP72.js";import{b as S}from"./chunk-JVPRLUMK.js";import{b as T}from"./chunk-X6JMGGW2.js";import{b as B}from"./chunk-QCDB2VPH.js";import{b as D}from"./chunk-F23WWYKW.js";import{b as E}from"./chunk-D4J545R4.js";import{b as w}from"./chunk-DCAAORBQ.js";import{b as x}from"./chunk-GXVXFKBA.js";import{b as v}from"./chunk-OFJTSXN6.js";import{d as k,e as q,f as C}from"./chunk-S6BBC45K.js";import"./chunk-IJXFPKNC.js";import{b}from"./chunk-QOENL5UZ.js";import"./chunk-VLGZJRPG.js";import{b as I}from"./chunk-WACZHM4L.js";import{b as M}from"./chunk-3KWUDRIP.js";import{b as j}from"./chunk-KAEMRWOH.js";import{b as t}from"./chunk-27LMNKBP.js";import{b as l}from"./chunk-NUYSJFDK.js";import{b as u}from"./chunk-A4JSPFCI.js";import{b as p}from"./chunk-SL4FN3A5.js";import{b as e}from"./chunk-GZ2N3SXD.js";import{b as d}from"./chunk-A4HU7SVR.js";import{b as c}from"./chunk-IKZ5LEGB.js";import{b as h}from"./chunk-64BAICW3.js";import"./chunk-HDQ56CKY.js";import"./chunk-OJDRYQWQ.js";import"./chunk-YNYSPYQ5.js";import{b as i}from"./chunk-GCTKCWKD.js";import{b as g}from"./chunk-7DBA735O.js";import"./chunk-7L36YK2X.js";import{b as m}from"./chunk-L4KW73FJ.js";import"./chunk-EEXR5ZDP.js";import"./chunk-PSW6BMXW.js";import{b as F}from"./chunk-KY5VPZXG.js";import"./chunk-NUFRM6SI.js";import{b as z}from"./chunk-XZ3MZS57.js";import{b as f}from"./chunk-OCS6LSEM.js";import"./chunk-HWKDQ44K.js";import{b as n}from"./chunk-OCLXQMOG.js";import"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,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,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
1
+ import{b as yr}from"./chunk-VZWXH2PZ.js";import{b as Ar}from"./chunk-XMDVFEVC.js";import{b as $r}from"./chunk-JI3KJ32H.js";import"./chunk-F55TLFGB.js";import"./chunk-SYMJJMQ4.js";import{b as Sr}from"./chunk-HDZ4QEVJ.js";import{b as wr}from"./chunk-MDLLFABN.js";import{b as xr}from"./chunk-ZKLK6C7H.js";import{b as vr}from"./chunk-UYGR3CFC.js";import{b as kr}from"./chunk-NQOQ2Q77.js";import{b as qr}from"./chunk-4HHKTUW3.js";import{b as Cr}from"./chunk-HJQJAYMS.js";import{b as br}from"./chunk-PP6PSHAB.js";import{d as Ir,e as Mr,f as jr}from"./chunk-DZ33S2U7.js";import{b as tr}from"./chunk-XNL7YAHW.js";import{b as lr}from"./chunk-CSBFBYLD.js";import{b as ur}from"./chunk-A7A2DBEE.js";import{b as pr}from"./chunk-U7QI5ZS5.js";import{b as er}from"./chunk-APT7OOP2.js";import{b as dr}from"./chunk-XKQRETAK.js";import{b as cr}from"./chunk-5V6VZH6T.js";import"./chunk-EIZGF4BS.js";import{b as hr}from"./chunk-CR5AFCPT.js";import{c as or,d as ar}from"./chunk-R6QSAL5T.js";import{b as sr}from"./chunk-LL3S3NLB.js";import{c as ir,d as gr}from"./chunk-JP44OYZS.js";import{b as mr}from"./chunk-2OCD45J4.js";import"./chunk-FRDGR5VK.js";import"./chunk-7MKBHGLS.js";import{b as Fr}from"./chunk-IBFD7QQD.js";import{b as zr}from"./chunk-TLSUDHID.js";import{b as fr}from"./chunk-OCK72LWW.js";import{b as nr}from"./chunk-WMLBQOWO.js";import{b as R}from"./chunk-ALLTKNUZ.js";import{b as U}from"./chunk-4Q4SM6WR.js";import{b as V}from"./chunk-XVDPCNWR.js";import{b as W}from"./chunk-K3PAWJ7V.js";import{c as X,d as Y}from"./chunk-OGDTSM2Q.js";import{c as Z,d as _}from"./chunk-VOBGTVA6.js";import{b as N}from"./chunk-NCNPKYJZ.js";import{b as rr}from"./chunk-SXR3EI72.js";import{b as G}from"./chunk-VJFXDYWH.js";import{b as H}from"./chunk-PYSFUGCK.js";import{b as J}from"./chunk-VYOJP4TV.js";import{b as K}from"./chunk-KTGH7NTP.js";import{b as L}from"./chunk-LWEGUNWT.js";import{b as O}from"./chunk-A7ICOL4V.js";import{b as P}from"./chunk-55VFSPNA.js";import{b as Q}from"./chunk-YYB54I7F.js";import{b as y}from"./chunk-7C6RBHP3.js";import{b as A}from"./chunk-Z7JVV2SM.js";import{b as $}from"./chunk-6NY2AP72.js";import{b as S}from"./chunk-JVPRLUMK.js";import{b as T}from"./chunk-X6JMGGW2.js";import{b as B}from"./chunk-QCDB2VPH.js";import{b as D}from"./chunk-F23WWYKW.js";import{b as E}from"./chunk-D4J545R4.js";import{b as w}from"./chunk-DCAAORBQ.js";import{b as x}from"./chunk-GXVXFKBA.js";import{b as v}from"./chunk-OFJTSXN6.js";import{d as k,e as q,f as C}from"./chunk-S6BBC45K.js";import"./chunk-IJXFPKNC.js";import{b}from"./chunk-QOENL5UZ.js";import"./chunk-VLGZJRPG.js";import{b as I}from"./chunk-MZLOTDD7.js";import{b as M}from"./chunk-3KWUDRIP.js";import{b as j}from"./chunk-KAEMRWOH.js";import{b as t}from"./chunk-27LMNKBP.js";import{b as l}from"./chunk-NUYSJFDK.js";import{b as u}from"./chunk-A4JSPFCI.js";import{b as p}from"./chunk-SL4FN3A5.js";import{b as e}from"./chunk-GZ2N3SXD.js";import{b as d}from"./chunk-A4HU7SVR.js";import{b as c}from"./chunk-IKZ5LEGB.js";import{b as h}from"./chunk-64BAICW3.js";import"./chunk-HDQ56CKY.js";import"./chunk-OJDRYQWQ.js";import"./chunk-YNYSPYQ5.js";import{b as i}from"./chunk-GCTKCWKD.js";import{b as g}from"./chunk-7DBA735O.js";import"./chunk-7L36YK2X.js";import{b as m}from"./chunk-L4KW73FJ.js";import"./chunk-EEXR5ZDP.js";import"./chunk-PSW6BMXW.js";import{b as F}from"./chunk-KY5VPZXG.js";import"./chunk-NUFRM6SI.js";import{b as z}from"./chunk-XZ3MZS57.js";import{b as f}from"./chunk-OCS6LSEM.js";import"./chunk-HWKDQ44K.js";import{b as n}from"./chunk-OCLXQMOG.js";import"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,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,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-WACZHM4L.js";import"./chunk-YNYSPYQ5.js";import"./chunk-PSW6BMXW.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as sedCommand};
1
+ import{a,b}from"./chunk-MZLOTDD7.js";import"./chunk-YNYSPYQ5.js";import"./chunk-PSW6BMXW.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as sedCommand};
@@ -1,4 +1,4 @@
1
- import{B as _r,C as Cr,D as ce,E as Ve,F as Y,G as Ee,H as Ct,I as Nr,J as T,K as xr,L as Or,M as Ae,N as ds,O as Nt,P as B,a as vr,b as os,c as br,d as kt,e as Z,f as z,g as le,h as J,i as Pe,j as Re,k as as,l as _t,m as $r,n as ls,o as Er,p as ye,q as Ne,r as Sr,s as Pr,t as cs,u as us,v as Le,w as Ar,x as kr,y as $e,z as fs}from"./chunks/chunk-UJXASUXJ.js";import{a as Ie,b as be}from"./chunks/chunk-OJDRYQWQ.js";import{a as ft}from"./chunks/chunk-YNYSPYQ5.js";import{a as he,b as pe,c as ae,d as me,e as gr,f as W,g as We,h as St,i as Pt,j as wr,k as ie,l as Te,m as At,n as ve}from"./chunks/chunk-PSW6BMXW.js";import"./chunks/chunk-NUFRM6SI.js";import{a as Ce}from"./chunks/chunk-44UOCSGV.js";import{a as ut}from"./chunks/chunk-DXB73IDG.js";var Be=[{name:"echo",load:async()=>(await import("./chunks/echo-O45JWWI2.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-C2OBLGHA.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-KGN6BDCY.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-OTONBH2E.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-QWGXDWUS.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-XTQXT7RK.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-DX2IJOQ4.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-KPTLPKPH.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XOYR4ABJ.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-Z6MORUFL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-YAIFIHCT.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-MIKE3OIT.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-D4OZ7N27.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-IEQO24KU.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-HT2B6D2J.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-S5ULNTJU.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-TQB3VNOX.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-74KBZFAX.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-BPEMMINR.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-BPEMMINR.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-BPEMMINR.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-ORQK4GVH.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-RXIECPPB.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-BDPR2JPZ.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-T7TNLWXL.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-ZXE4O5XB.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-5SLSESQG.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-LO6YYY5P.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-7N6AFSDS.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-RYO2EDCA.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-XOSYPP45.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-U5YJDM32.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-LDSORVYE.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-DTNXU4LQ.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-RGTMIGZM.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-7PLOGTPD.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-EZOC5IIZ.js")).split},{name:"column",load:async()=>(await import("./chunks/column-WLPMMSTS.js")).column},{name:"join",load:async()=>(await import("./chunks/join-GG2LDHE5.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-O7VXZDCO.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-74OP3M7S.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-AA2KJYZQ.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-LEMTZZFS.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-LYXBS7DC.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-DM4QX4XA.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-S547XMN7.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-S547XMN7.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-JE7RI5QX.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-JE7RI5QX.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-J4QRNGRO.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-OGI2NN6J.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-WHJNXCHG.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-WHJNXCHG.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-5CZ5X4YR.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-DYXMG247.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-DYXMG247.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-OJYNICKX.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-A3SGWC34.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-HJF2MPDN.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-FT2P5UCQ.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-JHK4I472.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-5UJUQXOE.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-BPT76IHZ.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-RN5ZUASB.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-3572LAOT.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-INMIK4DX.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-VJPNLNU6.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-PI32XWXY.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-ZIGAJ4YS.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-TFCECAGV.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-T2NGLTSG.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-NCIYTMAT.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-T7YAU2Y6.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-BK6HG2DE.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-DGKU3D2X.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-VJEF2UR5.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-UTSGNF5Z.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-UTSGNF5Z.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-UTSGNF5Z.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Be.push({name:"tar",load:async()=>(await import("./chunks/tar-K7K7BL55.js")).tarCommand}),Be.push({name:"yq",load:async()=>(await import("./chunks/yq-FD5F3WOJ.js")).yqCommand}),Be.push({name:"xan",load:async()=>(await import("./chunks/xan-Z6KVJKEE.js")).xanCommand}),Be.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-Z2IGWYCE.js")).sqlite3Command}));var xt=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(xt.push({name:"python3",load:async()=>(await import("./chunks/python3-SKZGHYDO.js")).python3Command}),xt.push({name:"python",load:async()=>(await import("./chunks/python3-SKZGHYDO.js")).pythonCommand}));var Tr=[{name:"curl",load:async()=>(await import("./chunks/curl-6L7YZUIH.js")).curlCommand}],Dr=new Map;function hs(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-MX32DFGQ.js");n(s.coverage,e.name,t)}return r.execute(t,s)}}}function wi(){return Be.map(e=>e.name)}function vi(){return Tr.map(e=>e.name)}function Ir(e){return(e?Be.filter(s=>e.includes(s.name)):Be).map(hs)}function Rr(){return Tr.map(hs)}function bi(){return xt.map(e=>e.name)}function Lr(){return xt.map(hs)}function Fr(e){return"load"in e&&typeof e.load=="function"}function $i(e,t){return{name:e,execute:t}}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 Ei=new TextEncoder,Si=new TextDecoder;function xe(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 Ei.encode(e)}function Ze(e,t){if(t==="base64")return btoa(String.fromCharCode(...e));if(t==="hex")return Array.from(e).map(s=>s.toString(16).padStart(2,"0")).join("");if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(e).toString(t);let s=65536;if(e.length<=s)return String.fromCharCode(...e);let r="";for(let n=0;n<e.length;n+=s){let i=e.subarray(n,n+s);r+=String.fromCharCode(...i)}return r}return Si.decode(e)}function ge(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}var Ke=new TextEncoder;function Pi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}function ee(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var Oe=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))typeof r=="function"?this.writeFileLazy(s,r):Pi(r)?this.writeFileSync(s,r.content,void 0,{mode:r.mode,mtime:r.mtime}):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){ee(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=ge(r),a=xe(s,o);this.data.set(i,{type:"file",content:a,mode:n?.mode??420,mtime:n?.mtime??new Date})}writeFileLazy(t,s,r){ee(t,"write");let n=this.normalizePath(t);this.ensureParentDirs(n),this.data.set(n,{type:"file",lazy:s,mode:r?.mode??420,mtime:r?.mtime??new Date})}async materializeLazy(t,s){let r=await s.lazy(),i={type:"file",content:typeof r=="string"?Ke.encode(r):r,mode:s.mode,mtime:s.mtime};return this.data.set(t,i),i}async readFile(t,s){let r=await this.readFileBuffer(t),n=ge(s);return Ze(r,n)}async readFileBuffer(t){ee(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}'`);if("lazy"in r){let n=await this.materializeLazy(s,r);return n.content instanceof Uint8Array?n.content:Ke.encode(n.content)}return r.content instanceof Uint8Array?r.content:Ke.encode(r.content)}async writeFile(t,s,r){this.writeFileSync(t,s,r)}async appendFile(t,s,r){ee(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=ge(r),a=xe(s,o);if(i?.type==="file"){let l=i;"lazy"in l&&(l=await this.materializeLazy(n,l));let c="content"in l&&l.content instanceof Uint8Array?l.content:Ke.encode("content"in l?l.content:""),u=new Uint8Array(c.length+a.length);u.set(c),u.set(a,c.length),this.data.set(n,{type:"file",content:u,mode:l.mode,mtime:new Date})}else this.writeFileSync(t,s,r)}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){ee(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}'`);r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ke.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}async lstat(t){ee(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};r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ke.encode(r.content).length),{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),c=0,u=40;for(;l&&l.type==="symlink"&&c<u;){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),c++}if(c>=u)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,c=40;for(;a&&a.type==="symlink"&&l<c;){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>=c)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){ee(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){ee(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 c=a.slice(i.length),u=c.split("/")[0];u&&!c.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,s){ee(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){ee(t,"cp"),ee(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,{...o});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 c=n==="/"?`/${l}`:`${n}/${l}`,u=i==="/"?`/${l}`:`${i}/${l}`;await this.cp(c,u,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){ee(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){ee(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){ee(t,"link"),ee(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}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(r,o)),this.ensureParentDirs(n),this.data.set(n,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(t){ee(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){ee(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){ee(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 Ai(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function ki(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",`${vr}
1
+ import{B as _r,C as Cr,D as ce,E as Ve,F as Y,G as Ee,H as Ct,I as Nr,J as T,K as xr,L as Or,M as Ae,N as ds,O as Nt,P as B,a as vr,b as os,c as br,d as kt,e as Z,f as z,g as le,h as J,i as Pe,j as Re,k as as,l as _t,m as $r,n as ls,o as Er,p as ye,q as Ne,r as Sr,s as Pr,t as cs,u as us,v as Le,w as Ar,x as kr,y as $e,z as fs}from"./chunks/chunk-UJXASUXJ.js";import{a as Ie,b as be}from"./chunks/chunk-OJDRYQWQ.js";import{a as ft}from"./chunks/chunk-YNYSPYQ5.js";import{a as he,b as pe,c as ae,d as me,e as gr,f as W,g as We,h as St,i as Pt,j as wr,k as ie,l as Te,m as At,n as ve}from"./chunks/chunk-PSW6BMXW.js";import"./chunks/chunk-NUFRM6SI.js";import{a as Ce}from"./chunks/chunk-44UOCSGV.js";import{a as ut}from"./chunks/chunk-DXB73IDG.js";var Be=[{name:"echo",load:async()=>(await import("./chunks/echo-O45JWWI2.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-C2OBLGHA.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-KGN6BDCY.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-OTONBH2E.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-QWGXDWUS.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-XTQXT7RK.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-DX2IJOQ4.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-KPTLPKPH.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XOYR4ABJ.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-Z6MORUFL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-YAIFIHCT.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-MIKE3OIT.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-D4OZ7N27.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-IEQO24KU.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-HT2B6D2J.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-S5ULNTJU.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-TQB3VNOX.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-74KBZFAX.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-BPEMMINR.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-BPEMMINR.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-BPEMMINR.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-ORQK4GVH.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-7HX4RAZG.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-BDPR2JPZ.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-T7TNLWXL.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-ZXE4O5XB.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-5SLSESQG.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-LO6YYY5P.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-7N6AFSDS.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-RYO2EDCA.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-XOSYPP45.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-U5YJDM32.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-LDSORVYE.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-DTNXU4LQ.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-RGTMIGZM.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-7PLOGTPD.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-EZOC5IIZ.js")).split},{name:"column",load:async()=>(await import("./chunks/column-WLPMMSTS.js")).column},{name:"join",load:async()=>(await import("./chunks/join-GG2LDHE5.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-O7VXZDCO.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-74OP3M7S.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-AA2KJYZQ.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-LEMTZZFS.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-LYXBS7DC.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-DM4QX4XA.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-S547XMN7.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-S547XMN7.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-JE7RI5QX.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-JE7RI5QX.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-J4QRNGRO.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-OGI2NN6J.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-WHJNXCHG.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-WHJNXCHG.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-5CZ5X4YR.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-DYXMG247.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-DYXMG247.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-OJYNICKX.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-A3SGWC34.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-HJF2MPDN.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-FT2P5UCQ.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-JHK4I472.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-5UJUQXOE.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-BPT76IHZ.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-RN5ZUASB.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-3572LAOT.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-INMIK4DX.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-VJPNLNU6.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-PI32XWXY.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-ZIGAJ4YS.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-TFCECAGV.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-T2NGLTSG.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-NCIYTMAT.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-T7YAU2Y6.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-BK6HG2DE.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-DGKU3D2X.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-VJEF2UR5.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-UTSGNF5Z.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-UTSGNF5Z.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-UTSGNF5Z.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Be.push({name:"tar",load:async()=>(await import("./chunks/tar-K7K7BL55.js")).tarCommand}),Be.push({name:"yq",load:async()=>(await import("./chunks/yq-FD5F3WOJ.js")).yqCommand}),Be.push({name:"xan",load:async()=>(await import("./chunks/xan-Z6KVJKEE.js")).xanCommand}),Be.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-Z2IGWYCE.js")).sqlite3Command}));var xt=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(xt.push({name:"python3",load:async()=>(await import("./chunks/python3-SKZGHYDO.js")).python3Command}),xt.push({name:"python",load:async()=>(await import("./chunks/python3-SKZGHYDO.js")).pythonCommand}));var Tr=[{name:"curl",load:async()=>(await import("./chunks/curl-6L7YZUIH.js")).curlCommand}],Dr=new Map;function hs(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-H2IQM6DS.js");n(s.coverage,e.name,t)}return r.execute(t,s)}}}function wi(){return Be.map(e=>e.name)}function vi(){return Tr.map(e=>e.name)}function Ir(e){return(e?Be.filter(s=>e.includes(s.name)):Be).map(hs)}function Rr(){return Tr.map(hs)}function bi(){return xt.map(e=>e.name)}function Lr(){return xt.map(hs)}function Fr(e){return"load"in e&&typeof e.load=="function"}function $i(e,t){return{name:e,execute:t}}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 Ei=new TextEncoder,Si=new TextDecoder;function xe(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 Ei.encode(e)}function Ze(e,t){if(t==="base64")return btoa(String.fromCharCode(...e));if(t==="hex")return Array.from(e).map(s=>s.toString(16).padStart(2,"0")).join("");if(t==="binary"||t==="latin1"){if(typeof Buffer<"u")return Buffer.from(e).toString(t);let s=65536;if(e.length<=s)return String.fromCharCode(...e);let r="";for(let n=0;n<e.length;n+=s){let i=e.subarray(n,n+s);r+=String.fromCharCode(...i)}return r}return Si.decode(e)}function ge(e){if(e!=null)return typeof e=="string"?e:e.encoding??void 0}var Ke=new TextEncoder;function Pi(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}function ee(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}var Oe=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))typeof r=="function"?this.writeFileLazy(s,r):Pi(r)?this.writeFileSync(s,r.content,void 0,{mode:r.mode,mtime:r.mtime}):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){ee(t,"write");let i=this.normalizePath(t);this.ensureParentDirs(i);let o=ge(r),a=xe(s,o);this.data.set(i,{type:"file",content:a,mode:n?.mode??420,mtime:n?.mtime??new Date})}writeFileLazy(t,s,r){ee(t,"write");let n=this.normalizePath(t);this.ensureParentDirs(n),this.data.set(n,{type:"file",lazy:s,mode:r?.mode??420,mtime:r?.mtime??new Date})}async materializeLazy(t,s){let r=await s.lazy(),i={type:"file",content:typeof r=="string"?Ke.encode(r):r,mode:s.mode,mtime:s.mtime};return this.data.set(t,i),i}async readFile(t,s){let r=await this.readFileBuffer(t),n=ge(s);return Ze(r,n)}async readFileBuffer(t){ee(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}'`);if("lazy"in r){let n=await this.materializeLazy(s,r);return n.content instanceof Uint8Array?n.content:Ke.encode(n.content)}return r.content instanceof Uint8Array?r.content:Ke.encode(r.content)}async writeFile(t,s,r){this.writeFileSync(t,s,r)}async appendFile(t,s,r){ee(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=ge(r),a=xe(s,o);if(i?.type==="file"){let l=i;"lazy"in l&&(l=await this.materializeLazy(n,l));let c="content"in l&&l.content instanceof Uint8Array?l.content:Ke.encode("content"in l?l.content:""),u=new Uint8Array(c.length+a.length);u.set(c),u.set(a,c.length),this.data.set(n,{type:"file",content:u,mode:l.mode,mtime:new Date})}else this.writeFileSync(t,s,r)}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){ee(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}'`);r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ke.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}async lstat(t){ee(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};r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Ke.encode(r.content).length),{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),c=0,u=40;for(;l&&l.type==="symlink"&&c<u;){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),c++}if(c>=u)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,c=40;for(;a&&a.type==="symlink"&&l<c;){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>=c)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){ee(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){ee(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 c=a.slice(i.length),u=c.split("/")[0];u&&!c.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,s){ee(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){ee(t,"cp"),ee(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,{...o});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 c=n==="/"?`/${l}`:`${n}/${l}`,u=i==="/"?`/${l}`:`${i}/${l}`;await this.cp(c,u,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){ee(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){ee(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){ee(t,"link"),ee(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}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(r,o)),this.ensureParentDirs(n),this.data.set(n,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(t){ee(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){ee(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){ee(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 Ai(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function ki(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",`${vr}
2
2
  `),e.writeFileSync("/proc/self/exe","/bin/bash"),e.writeFileSync("/proc/self/cmdline","bash\0"),e.writeFileSync("/proc/self/comm",`bash
3
3
  `),e.writeFileLazy?e.writeFileLazy("/proc/self/status",os):e.writeFileSync("/proc/self/status",os()),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 zr(e,t){Ai(e)&&(ki(e,t),_i(e),Ci(e))}var Ni=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],xi=["braceexpand","hashall","interactive-comments"];function ps(e){let t=[],s=[...xi.map(r=>({name:r,enabled:!0})),...Ni.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 Xe(e){e.state.env.set("SHELLOPTS",ps(e.state.options))}var Oi=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function ms(e){let t=[];for(let s of Oi)e[s]&&t.push(s);return t.join(":")}function ys(e){e.state.env.set("BASHOPTS",ms(e.state.shoptOptions))}var Di="BASH_ALIAS_";function Wr(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function Vr(e){if(e.parts.length!==1)return null;let t=e.parts[0];return t.type==="Literal"?t.value:null}function Br(e,t){return e.env.get(`${Di}${t}`)}function gs(e,t,s){if(!t.name||!Wr(t.name))return t;let r=Vr(t.name);if(!r)return t;let n=Br(e,r);if(!n||s.has(r))return t;try{s.add(r);let i=new z,o=n,a=n.endsWith(" ");if(!a)for(let f of t.args){let d=Ur(f);o+=` ${d}`}let l;try{l=i.parse(o)}catch(f){if(f instanceof kt)throw f;return t}if(l.statements.length!==1||l.statements[0].pipelines.length!==1||l.statements[0].pipelines[0].commands.length!==1)return jr(t,n);let c=l.statements[0].pipelines[0].commands[0];if(c.type!=="SimpleCommand")return jr(t,n);let u={...c,assignments:[...t.assignments,...c.assignments],redirections:[...c.redirections,...t.redirections],line:t.line};if(a&&t.args.length>0&&(u={...u,args:[...u.args,...t.args]},u.args.length>0)){let f=u.args[0];if(Wr(f)){let d=Vr(f);if(d&&Br(e,d)){let h={type:"SimpleCommand",name:f,args:u.args.slice(1),assignments:[],redirections:[]},m=gs(e,h,s);m!==h&&(u={...u,name:m.name,args:[...m.args]})}}}return u}catch(i){throw s.delete(r),i}}function jr(e,t){let s=t;for(let o of e.args){let a=Ur(o);s+=` ${a}`}let r=new z,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 Ur(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 Hr(e,t){let s=t.parts.map(u=>u.type==="Literal"?u.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 u of t.parts)if(u.type==="Literal"){let f=u.value;if(!o){let d=f.indexOf("=(");d!==-1&&(o=!0,f=f.slice(d+2))}if(o){f.endsWith(")")&&(f=f.slice(0,-1));let d=f.split(/(\s+)/);for(let h of d)/^\s+$/.test(h)?(a||l)&&(i.push(a),a="",l=!1):h&&(a+=h)}}else if(o)if(u.type==="BraceExpansion")if(/^\[.+\]=/.test(a))a+=_t({type:"Word",parts:[u]});else{(a||l)&&(i.push(a),a="",l=!1);let d=await Ae(e,{type:"Word",parts:[u]});i.push(...d.values)}else{(u.type==="SingleQuoted"||u.type==="DoubleQuoted"||u.type==="Escaped")&&(l=!0);let f=await T(e,{type:"Word",parts:[u]});a+=f}(a||l)&&i.push(a);let c=i.map(u=>/^\[.+\]=/.test(u)?u:u===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(u)&&!u.startsWith("'")&&!u.startsWith('"')?`'${u.replace(/'/g,"'\\''")}'`:u);return`${n}=(${c.join(" ")})`}async function qr(e,t){let s=-1,r=-1,n=!1;for(let p=0;p<t.parts.length;p++){let g=t.parts[p];if(g.type==="Literal"){let A=g.value.indexOf("+=");if(A!==-1){let S=g.value.slice(0,A);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(S)){s=p,r=A,n=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(S)){s=p,r=A,n=!0;break}}let v=g.value.indexOf("=");if(v!==-1&&(v===0||g.value[v-1]!=="+")){let S=g.value.slice(0,v);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(S)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(S)){s=p,r=v;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),c=o.value.slice(r+a),u=t.parts.slice(s+1),f="";for(let p of i)f+=await T(e,{type:"Word",parts:[p]});f+=l;let d={type:"Word",parts:c!==""?[{type:"Literal",value:c},...u]:u},h=d.parts.length>0?await T(e,d):"";return`${f}${n?"+=":"="}${h}`}var Ti=["tar","yq","xan","sqlite3","python3","python"];function Gr(e){return Ti.includes(e)}var L=Object.freeze({stdout:"",stderr:"",exitCode:0});function F(e=""){return{stdout:e,stderr:"",exitCode:0}}function P(e,t=1){return{stdout:"",stderr:e,exitCode:t}}function _(e,t,s){return{stdout:e,stderr:t,exitCode:s}}function G(e){return{stdout:"",stderr:"",exitCode:e?0:1}}function De(e,t,s="",r=""){throw new ie(e,t,s,r)}function ws(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Te;return L}if(t.length>1)throw new W(1,"",`bash: break: too many arguments
4
4
  `);let s=1;if(t.length>0){let r=Number.parseInt(t[0],10);if(Number.isNaN(r)||r<1)throw new W(128,"",`bash: break: ${t[0]}: numeric argument required
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-bash",
3
- "version": "2.10.2",
3
+ "version": "2.10.3",
4
4
  "description": "A simulated bash environment with virtual filesystem",
5
5
  "repository": {
6
6
  "type": "git",