create-bunext 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,60 +1,60 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as hQ}from"node:module";var wQ=Object.create;var{getPrototypeOf:OQ,defineProperty:g6,getOwnPropertyNames:EQ}=Object;var AQ=Object.prototype.hasOwnProperty;var $1=($,Z,X)=>{X=$!=null?wQ(OQ($)):{};let J=Z||!$||!$.__esModule?g6(X,"default",{value:$,enumerable:!0}):X;for(let q of EQ($))if(!AQ.call(J,q))g6(J,q,{get:()=>$[q],enumerable:!0});return J};var C0=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var V0=hQ(import.meta.url);var R7=C0((SV,_7)=>{_7.exports=L7;L7.sync=Nq;var W7=V0("fs");function hq($,Z){var X=Z.pathExt!==void 0?Z.pathExt:process.env.PATHEXT;if(!X)return!0;if(X=X.split(";"),X.indexOf("")!==-1)return!0;for(var J=0;J<X.length;J++){var q=X[J].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function V7($,Z,X){if(!$.isSymbolicLink()&&!$.isFile())return!1;return hq(Z,X)}function L7($,Z,X){W7.stat($,function(J,q){X(J,J?!1:V7(q,$,Z))})}function Nq($,Z){return V7(W7.statSync($),$,Z)}});var P7=C0((vV,C7)=>{C7.exports=F7;F7.sync=Dq;var T7=V0("fs");function F7($,Z,X){T7.stat($,function(J,q){X(J,J?!1:M7(q,Z))})}function Dq($,Z){return M7(T7.statSync($),Z)}function M7($,Z){return $.isFile()&&Sq($,Z)}function Sq($,Z){var{mode:X,uid:J,gid:q}=$,Y=Z.uid!==void 0?Z.uid:process.getuid&&process.getuid(),Q=Z.gid!==void 0?Z.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),K=parseInt("001",8),W=G|H,U=X&K||X&H&&q===Q||X&G&&J===Y||X&W&&Y===0;return U}});var j7=C0((kV,x7)=>{var fV=V0("fs"),d$;if(process.platform==="win32"||global.TESTING_WINDOWS)d$=R7();else d$=P7();x7.exports=I2;I2.sync=vq;function I2($,Z,X){if(typeof Z==="function")X=Z,Z={};if(!X){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(J,q){I2($,Z||{},function(Y,Q){if(Y)q(Y);else J(Q)})})}d$($,Z||{},function(J,q){if(J){if(J.code==="EACCES"||Z&&Z.ignoreErrors)J=null,q=!1}X(J,q)})}function vq($,Z){try{return d$.sync($,Z||{})}catch(X){if(Z&&Z.ignoreErrors||X.code==="EACCES")return!1;else throw X}}});var N7=C0((bV,h7)=>{var l1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",I7=V0("path"),fq=l1?";":":",w7=j7(),O7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),E7=($,Z)=>{let X=Z.colon||fq,J=$.match(/\//)||l1&&$.match(/\\/)?[""]:[...l1?[process.cwd()]:[],...(Z.path||process.env.PATH||"").split(X)],q=l1?Z.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=l1?q.split(X):[""];if(l1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:J,pathExt:Y,pathExtExe:q}},A7=($,Z,X)=>{if(typeof Z==="function")X=Z,Z={};if(!Z)Z={};let{pathEnv:J,pathExt:q,pathExtExe:Y}=E7($,Z),Q=[],G=(K)=>new Promise((W,U)=>{if(K===J.length)return Z.all&&Q.length?W(Q):U(O7($));let B=J[K],R=/^".*"$/.test(B)?B.slice(1,-1):B,_=I7.join(R,$),L=!R&&/^\.[\\\/]/.test($)?$.slice(0,2)+_:_;W(H(L,K,0))}),H=(K,W,U)=>new Promise((B,R)=>{if(U===q.length)return B(G(W+1));let _=q[U];w7(K+_,{pathExt:Y},(L,j)=>{if(!L&&j)if(Z.all)Q.push(K+_);else return B(K+_);return B(H(K,W,U+1))})});return X?G(0).then((K)=>X(null,K),X):G(0)},kq=($,Z)=>{Z=Z||{};let{pathEnv:X,pathExt:J,pathExtExe:q}=E7($,Z),Y=[];for(let Q=0;Q<X.length;Q++){let G=X[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=I7.join(H,$),W=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+K:K;for(let U=0;U<J.length;U++){let B=W+J[U];try{if(w7.sync(B,{pathExt:q}))if(Z.all)Y.push(B);else return B}catch(R){}}}if(Z.all&&Y.length)return Y;if(Z.nothrow)return null;throw O7($)};h7.exports=A7;A7.sync=kq});var S7=C0((yV,w2)=>{var D7=($={})=>{let Z=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(Z).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"};w2.exports=D7;w2.exports.default=D7});var b7=C0((gV,k7)=>{var v7=V0("path"),bq=N7(),yq=S7();function f7($,Z){let X=$.options.env||process.env,J=process.cwd(),q=$.options.cwd!=null,Y=q&&process.chdir!==void 0&&!process.chdir.disabled;if(Y)try{process.chdir($.options.cwd)}catch(G){}let Q;try{Q=bq.sync($.command,{path:X[yq({env:X})],pathExt:Z?v7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(J)}if(Q)Q=v7.resolve(q?$.options.cwd:"",Q);return Q}function gq($){return f7($)||f7($,!0)}k7.exports=gq});var y7=C0((cq,E2)=>{var O2=/([()\][%!^"`<>&|;, *?])/g;function uq($){return $=$.replace(O2,"^$1"),$}function mq($,Z){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(O2,"^$1"),Z)$=$.replace(O2,"^$1");return $}cq.command=uq;cq.argument=mq});var u7=C0((uV,g7)=>{g7.exports=/^#!(.*)/});var c7=C0((mV,m7)=>{var lq=u7();m7.exports=($="")=>{let Z=$.match(lq);if(!Z)return null;let[X,J]=Z[0].replace(/#! ?/,"").split(" "),q=X.split("/").pop();if(q==="env")return J;return J?`${q} ${J}`:q}});var d7=C0((cV,p7)=>{var A2=V0("fs"),nq=c7();function iq($){let X=Buffer.alloc(150),J;try{J=A2.openSync($,"r"),A2.readSync(J,X,0,150,0),A2.closeSync(J)}catch(q){}return nq(X.toString())}p7.exports=iq});var t7=C0((pV,i7)=>{var tq=V0("path"),l7=b7(),n7=y7(),oq=d7(),aq=process.platform==="win32",rq=/\.(?:com|exe)$/i,sq=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function eq($){$.file=l7($);let Z=$.file&&oq($.file);if(Z)return $.args.unshift($.file),$.command=Z,l7($);return $.file}function $9($){if(!aq)return $;let Z=eq($),X=!rq.test(Z);if($.options.forceShell||X){let J=sq.test(Z);$.command=tq.normalize($.command),$.command=n7.command($.command),$.args=$.args.map((Y)=>n7.argument(Y,J));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function Z9($,Z,X){if(Z&&!Array.isArray(Z))X=Z,Z=null;Z=Z?Z.slice(0):[],X=Object.assign({},X);let J={command:$,args:Z,options:X,file:void 0,original:{command:$,args:Z}};return X.shell?J:$9(J)}i7.exports=Z9});var r7=C0((dV,a7)=>{var h2=process.platform==="win32";function N2($,Z){return Object.assign(Error(`${Z} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${Z} ${$.command}`,path:$.command,spawnargs:$.args})}function X9($,Z){if(!h2)return;let X=$.emit;$.emit=function(J,q){if(J==="exit"){let Y=o7(q,Z);if(Y)return X.call($,"error",Y)}return X.apply($,arguments)}}function o7($,Z){if(h2&&$===1&&!Z.file)return N2(Z.original,"spawn");return null}function J9($,Z){if(h2&&$===1&&!Z.file)return N2(Z.original,"spawnSync");return null}a7.exports={hookChildProcess:X9,verifyENOENT:o7,verifyENOENTSync:J9,notFoundError:N2}});var $8=C0((lV,n1)=>{var s7=V0("child_process"),D2=t7(),S2=r7();function e7($,Z,X){let J=D2($,Z,X),q=s7.spawn(J.command,J.args,J.options);return S2.hookChildProcess(q,J),q}function Q9($,Z,X){let J=D2($,Z,X),q=s7.spawnSync(J.command,J.args,J.options);return q.error=q.error||S2.verifyENOENTSync(q.status,J),q}n1.exports=e7;n1.exports.spawn=e7;n1.exports.sync=Q9;n1.exports._parse=D2;n1.exports._enoent=S2});var d3=C0((ex,tX)=>{var p3={to($,Z){if(!Z)return`\x1B[${$+1}G`;return`\x1B[${Z+1};${$+1}H`},move($,Z){let X="";if($<0)X+=`\x1B[${-$}D`;else if($>0)X+=`\x1B[${$}C`;if(Z<0)X+=`\x1B[${-Z}A`;else if(Z>0)X+=`\x1B[${Z}B`;return X},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},qB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},YB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let Z="";for(let X=0;X<$;X++)Z+=this.line+(X<$-1?p3.up():"");if($)Z+=p3.left;return Z}};tX.exports={cursor:p3,scroll:qB,erase:YB,beep:"\x07"}});var d4=C0(($j,l3)=>{var p4=process||{},oX=p4.argv||[],c4=p4.env||{},GB=!(!!c4.NO_COLOR||oX.includes("--no-color"))&&(!!c4.FORCE_COLOR||oX.includes("--color")||p4.platform==="win32"||(p4.stdout||{}).isTTY&&c4.TERM!=="dumb"||!!c4.CI),HB=($,Z,X=$)=>(J)=>{let q=""+J,Y=q.indexOf(Z,$.length);return~Y?$+zB(q,Z,X,Y)+Z:$+q+Z},zB=($,Z,X,J)=>{let q="",Y=0;do q+=$.substring(Y,J)+X,Y=J+Z.length,J=$.indexOf(Z,Y);while(~J);return q+$.substring(Y)},aX=($=GB)=>{let Z=$?HB:()=>String;return{isColorSupported:$,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),white:Z("\x1B[37m","\x1B[39m"),gray:Z("\x1B[90m","\x1B[39m"),bgBlack:Z("\x1B[40m","\x1B[49m"),bgRed:Z("\x1B[41m","\x1B[49m"),bgGreen:Z("\x1B[42m","\x1B[49m"),bgYellow:Z("\x1B[43m","\x1B[49m"),bgBlue:Z("\x1B[44m","\x1B[49m"),bgMagenta:Z("\x1B[45m","\x1B[49m"),bgCyan:Z("\x1B[46m","\x1B[49m"),bgWhite:Z("\x1B[47m","\x1B[49m"),blackBright:Z("\x1B[90m","\x1B[39m"),redBright:Z("\x1B[91m","\x1B[39m"),greenBright:Z("\x1B[92m","\x1B[39m"),yellowBright:Z("\x1B[93m","\x1B[39m"),blueBright:Z("\x1B[94m","\x1B[39m"),magentaBright:Z("\x1B[95m","\x1B[39m"),cyanBright:Z("\x1B[96m","\x1B[39m"),whiteBright:Z("\x1B[97m","\x1B[39m"),bgBlackBright:Z("\x1B[100m","\x1B[49m"),bgRedBright:Z("\x1B[101m","\x1B[49m"),bgGreenBright:Z("\x1B[102m","\x1B[49m"),bgYellowBright:Z("\x1B[103m","\x1B[49m"),bgBlueBright:Z("\x1B[104m","\x1B[49m"),bgMagentaBright:Z("\x1B[105m","\x1B[49m"),bgCyanBright:Z("\x1B[106m","\x1B[49m"),bgWhiteBright:Z("\x1B[107m","\x1B[49m")}};l3.exports=aX();l3.exports.createColors=aX});function Y0($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as NQ}from"node:url";var c1=($,Z)=>{let X=_2(DQ($));if(typeof X!=="string")throw TypeError(`${Z} must be a string or a file URL: ${X}.`);return X},DQ=($)=>L2($)?$.toString():$,L2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,_2=($)=>$ instanceof URL?NQ($):$;var D$=($,Z=[],X={})=>{let J=c1($,"First argument"),[q,Y]=Y0(Z)?[[],Z]:[Z,X];if(!Array.isArray(q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${q}`);if(q.some((H)=>typeof H==="object"&&H!==null))throw TypeError(`Second argument must be an array of strings: ${q}`);let Q=q.map(String),G=Q.find((H)=>H.includes("\x00"));if(G!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${G}`);if(!Y0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[J,Q,Y]};import{ChildProcess as gQ}from"node:child_process";import{StringDecoder as SQ}from"node:string_decoder";var{toString:u6}=Object.prototype,m6=($)=>u6.call($)==="[object ArrayBuffer]",L0=($)=>u6.call($)==="[object Uint8Array]",Z1=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),vQ=new TextEncoder,c6=($)=>vQ.encode($),fQ=new TextDecoder,S$=($)=>fQ.decode($),p6=($,Z)=>{return kQ($,Z).join("")},kQ=($,Z)=>{if(Z==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let X=new SQ(Z),J=$.map((Y)=>typeof Y==="string"?c6(Y):Y).map((Y)=>X.write(Y)),q=X.end();return q===""?J:[...J,q]},K$=($)=>{if($.length===1&&L0($[0]))return $[0];return R2(bQ($))},bQ=($)=>$.map((Z)=>typeof Z==="string"?c6(Z):Z),R2=($)=>{let Z=new Uint8Array(yQ($)),X=0;for(let J of $)Z.set(J,X),X+=J.length;return Z},yQ=($)=>{let Z=0;for(let X of $)Z+=X.length;return Z};var i6=($)=>Array.isArray($)&&Array.isArray($.raw),t6=($,Z)=>{let X=[];for(let[Y,Q]of $.entries())X=uQ({templates:$,expressions:Z,tokens:X,index:Y,template:Q});if(X.length===0)throw TypeError("Template script must not be empty");let[J,...q]=X;return[J,q,{}]},uQ=({templates:$,expressions:Z,tokens:X,index:J,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[J]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=mQ(q,$.raw[J]),H=l6(X,Y,Q);if(J===Z.length)return H;let K=Z[J],W=Array.isArray(K)?K.map((U)=>n6(U)):[n6(K)];return l6(H,W,G)},mQ=($,Z)=>{if(Z.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let X=[],J=0,q=d6.has(Z[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=Z[G];if(d6.has(H)){if(J!==Q)X.push($.slice(J,Q));J=Q+1}else if(H==="\\"){let K=Z[G+1];if(K===`
3
- `)Q-=1,G+=1;else if(K==="u"&&Z[G+2]==="{")G=Z.indexOf("}",G+3);else G+=cQ[K]??1}}let Y=J===$.length;if(!Y)X.push($.slice(J));return{nextTokens:X,leadingWhitespaces:q,trailingWhitespaces:Y}},d6=new Set([" ","\t","\r",`
4
- `]),cQ={x:3,u:5},l6=($,Z,X)=>X||$.length===0||Z.length===0?[...$,...Z]:[...$.slice(0,-1),`${$.at(-1)}${Z[0]}`,...Z.slice(1)],n6=($)=>{let Z=typeof $;if(Z==="string")return $;if(Z==="number")return String($);if(Y0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return pQ($);if($ instanceof gQ||Object.prototype.toString.call($)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${Z}" in template expression`)},pQ=({stdout:$})=>{if(typeof $==="string")return $;if(L0($))return S$($);if($===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof $}" stdout in template expression`)};import{spawnSync as aH}from"node:child_process";import{debuglog as dQ}from"node:util";import T2 from"node:process";var y0=($)=>v$.includes($),v$=[T2.stdin,T2.stdout,T2.stderr],N0=["stdin","stdout","stderr"],f$=($)=>N0[$]??`stdio[${$}]`;var a6=($)=>{let Z={...$};for(let X of C2)Z[X]=F2($,X);return Z},F2=($,Z)=>{let X=Array.from({length:lQ($)+1}),J=nQ($[Z],X,Z);return rQ(J,Z)},lQ=({stdio:$})=>Array.isArray($)?Math.max($.length,N0.length):N0.length,nQ=($,Z,X)=>Y0($)?iQ($,Z,X):Z.fill($),iQ=($,Z,X)=>{for(let J of Object.keys($).sort(tQ))for(let q of oQ(J,X,Z))Z[q]=$[J];return Z},tQ=($,Z)=>o6($)<o6(Z)?1:-1,o6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},oQ=($,Z,X)=>{if($==="ipc")return[X.length-1];let J=M2($);if(J===void 0||J===0)throw TypeError(`"${Z}.${$}" is invalid.
2
+ import{createRequire as SQ}from"node:module";var wQ=Object.create;var{getPrototypeOf:OQ,defineProperty:g6,getOwnPropertyNames:EQ}=Object;var AQ=Object.prototype.hasOwnProperty;function hQ($){return this[$]}var NQ,DQ,m1=($,Z,X)=>{var J=$!=null&&typeof $==="object";if(J){var q=Z?NQ??=new WeakMap:DQ??=new WeakMap,Y=q.get($);if(Y)return Y}X=$!=null?wQ(OQ($)):{};let Q=Z||!$||!$.__esModule?g6(X,"default",{value:$,enumerable:!0}):X;for(let G of EQ($))if(!AQ.call(Q,G))g6(Q,G,{get:hQ.bind($,G),enumerable:!0});if(J)q.set($,Q);return Q};var C0=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var V0=SQ(import.meta.url);var R7=C0((kV,_7)=>{_7.exports=L7;L7.sync=vq;var W7=V0("fs");function Sq($,Z){var X=Z.pathExt!==void 0?Z.pathExt:process.env.PATHEXT;if(!X)return!0;if(X=X.split(";"),X.indexOf("")!==-1)return!0;for(var J=0;J<X.length;J++){var q=X[J].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function V7($,Z,X){if(!$.isSymbolicLink()&&!$.isFile())return!1;return Sq(Z,X)}function L7($,Z,X){W7.stat($,function(J,q){X(J,J?!1:V7(q,$,Z))})}function vq($,Z){return V7(W7.statSync($),$,Z)}});var P7=C0((bV,C7)=>{C7.exports=F7;F7.sync=fq;var T7=V0("fs");function F7($,Z,X){T7.stat($,function(J,q){X(J,J?!1:M7(q,Z))})}function fq($,Z){return M7(T7.statSync($),Z)}function M7($,Z){return $.isFile()&&kq($,Z)}function kq($,Z){var{mode:X,uid:J,gid:q}=$,Y=Z.uid!==void 0?Z.uid:process.getuid&&process.getuid(),Q=Z.gid!==void 0?Z.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),K=parseInt("001",8),W=G|H,U=X&K||X&H&&q===Q||X&G&&J===Y||X&W&&Y===0;return U}});var j7=C0((gV,x7)=>{var yV=V0("fs"),d$;if(process.platform==="win32"||global.TESTING_WINDOWS)d$=R7();else d$=P7();x7.exports=I2;I2.sync=bq;function I2($,Z,X){if(typeof Z==="function")X=Z,Z={};if(!X){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(J,q){I2($,Z||{},function(Y,Q){if(Y)q(Y);else J(Q)})})}d$($,Z||{},function(J,q){if(J){if(J.code==="EACCES"||Z&&Z.ignoreErrors)J=null,q=!1}X(J,q)})}function bq($,Z){try{return d$.sync($,Z||{})}catch(X){if(Z&&Z.ignoreErrors||X.code==="EACCES")return!1;else throw X}}});var N7=C0((uV,h7)=>{var l1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",I7=V0("path"),yq=l1?";":":",w7=j7(),O7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),E7=($,Z)=>{let X=Z.colon||yq,J=$.match(/\//)||l1&&$.match(/\\/)?[""]:[...l1?[process.cwd()]:[],...(Z.path||process.env.PATH||"").split(X)],q=l1?Z.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=l1?q.split(X):[""];if(l1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:J,pathExt:Y,pathExtExe:q}},A7=($,Z,X)=>{if(typeof Z==="function")X=Z,Z={};if(!Z)Z={};let{pathEnv:J,pathExt:q,pathExtExe:Y}=E7($,Z),Q=[],G=(K)=>new Promise((W,U)=>{if(K===J.length)return Z.all&&Q.length?W(Q):U(O7($));let B=J[K],R=/^".*"$/.test(B)?B.slice(1,-1):B,_=I7.join(R,$),L=!R&&/^\.[\\\/]/.test($)?$.slice(0,2)+_:_;W(H(L,K,0))}),H=(K,W,U)=>new Promise((B,R)=>{if(U===q.length)return B(G(W+1));let _=q[U];w7(K+_,{pathExt:Y},(L,j)=>{if(!L&&j)if(Z.all)Q.push(K+_);else return B(K+_);return B(H(K,W,U+1))})});return X?G(0).then((K)=>X(null,K),X):G(0)},gq=($,Z)=>{Z=Z||{};let{pathEnv:X,pathExt:J,pathExtExe:q}=E7($,Z),Y=[];for(let Q=0;Q<X.length;Q++){let G=X[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=I7.join(H,$),W=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+K:K;for(let U=0;U<J.length;U++){let B=W+J[U];try{if(w7.sync(B,{pathExt:q}))if(Z.all)Y.push(B);else return B}catch(R){}}}if(Z.all&&Y.length)return Y;if(Z.nothrow)return null;throw O7($)};h7.exports=A7;A7.sync=gq});var S7=C0((mV,w2)=>{var D7=($={})=>{let Z=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(Z).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"};w2.exports=D7;w2.exports.default=D7});var b7=C0((cV,k7)=>{var v7=V0("path"),uq=N7(),mq=S7();function f7($,Z){let X=$.options.env||process.env,J=process.cwd(),q=$.options.cwd!=null,Y=q&&process.chdir!==void 0&&!process.chdir.disabled;if(Y)try{process.chdir($.options.cwd)}catch(G){}let Q;try{Q=uq.sync($.command,{path:X[mq({env:X})],pathExt:Z?v7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(J)}if(Q)Q=v7.resolve(q?$.options.cwd:"",Q);return Q}function cq($){return f7($)||f7($,!0)}k7.exports=cq});var y7=C0((lq,E2)=>{var O2=/([()\][%!^"`<>&|;, *?])/g;function pq($){return $=$.replace(O2,"^$1"),$}function dq($,Z){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(O2,"^$1"),Z)$=$.replace(O2,"^$1");return $}lq.command=pq;lq.argument=dq});var u7=C0((pV,g7)=>{g7.exports=/^#!(.*)/});var c7=C0((dV,m7)=>{var tq=u7();m7.exports=($="")=>{let Z=$.match(tq);if(!Z)return null;let[X,J]=Z[0].replace(/#! ?/,"").split(" "),q=X.split("/").pop();if(q==="env")return J;return J?`${q} ${J}`:q}});var d7=C0((lV,p7)=>{var A2=V0("fs"),oq=c7();function aq($){let X=Buffer.alloc(150),J;try{J=A2.openSync($,"r"),A2.readSync(J,X,0,150,0),A2.closeSync(J)}catch(q){}return oq(X.toString())}p7.exports=aq});var t7=C0((nV,i7)=>{var rq=V0("path"),l7=b7(),n7=y7(),sq=d7(),eq=process.platform==="win32",$9=/\.(?:com|exe)$/i,Z9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function X9($){$.file=l7($);let Z=$.file&&sq($.file);if(Z)return $.args.unshift($.file),$.command=Z,l7($);return $.file}function J9($){if(!eq)return $;let Z=X9($),X=!$9.test(Z);if($.options.forceShell||X){let J=Z9.test(Z);$.command=rq.normalize($.command),$.command=n7.command($.command),$.args=$.args.map((Y)=>n7.argument(Y,J));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function Q9($,Z,X){if(Z&&!Array.isArray(Z))X=Z,Z=null;Z=Z?Z.slice(0):[],X=Object.assign({},X);let J={command:$,args:Z,options:X,file:void 0,original:{command:$,args:Z}};return X.shell?J:J9(J)}i7.exports=Q9});var r7=C0((iV,a7)=>{var h2=process.platform==="win32";function N2($,Z){return Object.assign(Error(`${Z} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${Z} ${$.command}`,path:$.command,spawnargs:$.args})}function q9($,Z){if(!h2)return;let X=$.emit;$.emit=function(J,q){if(J==="exit"){let Y=o7(q,Z);if(Y)return X.call($,"error",Y)}return X.apply($,arguments)}}function o7($,Z){if(h2&&$===1&&!Z.file)return N2(Z.original,"spawn");return null}function Y9($,Z){if(h2&&$===1&&!Z.file)return N2(Z.original,"spawnSync");return null}a7.exports={hookChildProcess:q9,verifyENOENT:o7,verifyENOENTSync:Y9,notFoundError:N2}});var $8=C0((tV,n1)=>{var s7=V0("child_process"),D2=t7(),S2=r7();function e7($,Z,X){let J=D2($,Z,X),q=s7.spawn(J.command,J.args,J.options);return S2.hookChildProcess(q,J),q}function G9($,Z,X){let J=D2($,Z,X),q=s7.spawnSync(J.command,J.args,J.options);return q.error=q.error||S2.verifyENOENTSync(q.status,J),q}n1.exports=e7;n1.exports.spawn=e7;n1.exports.sync=G9;n1.exports._parse=D2;n1.exports._enoent=S2});var d3=C0((Xj,tX)=>{var p3={to($,Z){if(!Z)return`\x1B[${$+1}G`;return`\x1B[${Z+1};${$+1}H`},move($,Z){let X="";if($<0)X+=`\x1B[${-$}D`;else if($>0)X+=`\x1B[${$}C`;if(Z<0)X+=`\x1B[${-Z}A`;else if(Z>0)X+=`\x1B[${Z}B`;return X},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},HB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},zB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let Z="";for(let X=0;X<$;X++)Z+=this.line+(X<$-1?p3.up():"");if($)Z+=p3.left;return Z}};tX.exports={cursor:p3,scroll:HB,erase:zB,beep:"\x07"}});var d4=C0((Jj,l3)=>{var p4=process||{},oX=p4.argv||[],c4=p4.env||{},KB=!(!!c4.NO_COLOR||oX.includes("--no-color"))&&(!!c4.FORCE_COLOR||oX.includes("--color")||p4.platform==="win32"||(p4.stdout||{}).isTTY&&c4.TERM!=="dumb"||!!c4.CI),BB=($,Z,X=$)=>(J)=>{let q=""+J,Y=q.indexOf(Z,$.length);return~Y?$+UB(q,Z,X,Y)+Z:$+q+Z},UB=($,Z,X,J)=>{let q="",Y=0;do q+=$.substring(Y,J)+X,Y=J+Z.length,J=$.indexOf(Z,Y);while(~J);return q+$.substring(Y)},aX=($=KB)=>{let Z=$?BB:()=>String;return{isColorSupported:$,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),white:Z("\x1B[37m","\x1B[39m"),gray:Z("\x1B[90m","\x1B[39m"),bgBlack:Z("\x1B[40m","\x1B[49m"),bgRed:Z("\x1B[41m","\x1B[49m"),bgGreen:Z("\x1B[42m","\x1B[49m"),bgYellow:Z("\x1B[43m","\x1B[49m"),bgBlue:Z("\x1B[44m","\x1B[49m"),bgMagenta:Z("\x1B[45m","\x1B[49m"),bgCyan:Z("\x1B[46m","\x1B[49m"),bgWhite:Z("\x1B[47m","\x1B[49m"),blackBright:Z("\x1B[90m","\x1B[39m"),redBright:Z("\x1B[91m","\x1B[39m"),greenBright:Z("\x1B[92m","\x1B[39m"),yellowBright:Z("\x1B[93m","\x1B[39m"),blueBright:Z("\x1B[94m","\x1B[39m"),magentaBright:Z("\x1B[95m","\x1B[39m"),cyanBright:Z("\x1B[96m","\x1B[39m"),whiteBright:Z("\x1B[97m","\x1B[39m"),bgBlackBright:Z("\x1B[100m","\x1B[49m"),bgRedBright:Z("\x1B[101m","\x1B[49m"),bgGreenBright:Z("\x1B[102m","\x1B[49m"),bgYellowBright:Z("\x1B[103m","\x1B[49m"),bgBlueBright:Z("\x1B[104m","\x1B[49m"),bgMagentaBright:Z("\x1B[105m","\x1B[49m"),bgCyanBright:Z("\x1B[106m","\x1B[49m"),bgWhiteBright:Z("\x1B[107m","\x1B[49m")}};l3.exports=aX();l3.exports.createColors=aX});function Y0($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as vQ}from"node:url";var c1=($,Z)=>{let X=_2(fQ($));if(typeof X!=="string")throw TypeError(`${Z} must be a string or a file URL: ${X}.`);return X},fQ=($)=>L2($)?$.toString():$,L2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,_2=($)=>$ instanceof URL?vQ($):$;var D$=($,Z=[],X={})=>{let J=c1($,"First argument"),[q,Y]=Y0(Z)?[[],Z]:[Z,X];if(!Array.isArray(q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${q}`);if(q.some((H)=>typeof H==="object"&&H!==null))throw TypeError(`Second argument must be an array of strings: ${q}`);let Q=q.map(String),G=Q.find((H)=>H.includes("\x00"));if(G!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${G}`);if(!Y0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[J,Q,Y]};import{ChildProcess as cQ}from"node:child_process";import{StringDecoder as kQ}from"node:string_decoder";var{toString:u6}=Object.prototype,m6=($)=>u6.call($)==="[object ArrayBuffer]",L0=($)=>u6.call($)==="[object Uint8Array]",$1=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),bQ=new TextEncoder,c6=($)=>bQ.encode($),yQ=new TextDecoder,S$=($)=>yQ.decode($),p6=($,Z)=>{return gQ($,Z).join("")},gQ=($,Z)=>{if(Z==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let X=new kQ(Z),J=$.map((Y)=>typeof Y==="string"?c6(Y):Y).map((Y)=>X.write(Y)),q=X.end();return q===""?J:[...J,q]},K$=($)=>{if($.length===1&&L0($[0]))return $[0];return R2(uQ($))},uQ=($)=>$.map((Z)=>typeof Z==="string"?c6(Z):Z),R2=($)=>{let Z=new Uint8Array(mQ($)),X=0;for(let J of $)Z.set(J,X),X+=J.length;return Z},mQ=($)=>{let Z=0;for(let X of $)Z+=X.length;return Z};var i6=($)=>Array.isArray($)&&Array.isArray($.raw),t6=($,Z)=>{let X=[];for(let[Y,Q]of $.entries())X=pQ({templates:$,expressions:Z,tokens:X,index:Y,template:Q});if(X.length===0)throw TypeError("Template script must not be empty");let[J,...q]=X;return[J,q,{}]},pQ=({templates:$,expressions:Z,tokens:X,index:J,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[J]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=dQ(q,$.raw[J]),H=l6(X,Y,Q);if(J===Z.length)return H;let K=Z[J],W=Array.isArray(K)?K.map((U)=>n6(U)):[n6(K)];return l6(H,W,G)},dQ=($,Z)=>{if(Z.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let X=[],J=0,q=d6.has(Z[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=Z[G];if(d6.has(H)){if(J!==Q)X.push($.slice(J,Q));J=Q+1}else if(H==="\\"){let K=Z[G+1];if(K===`
3
+ `)Q-=1,G+=1;else if(K==="u"&&Z[G+2]==="{")G=Z.indexOf("}",G+3);else G+=lQ[K]??1}}let Y=J===$.length;if(!Y)X.push($.slice(J));return{nextTokens:X,leadingWhitespaces:q,trailingWhitespaces:Y}},d6=new Set([" ","\t","\r",`
4
+ `]),lQ={x:3,u:5},l6=($,Z,X)=>X||$.length===0||Z.length===0?[...$,...Z]:[...$.slice(0,-1),`${$.at(-1)}${Z[0]}`,...Z.slice(1)],n6=($)=>{let Z=typeof $;if(Z==="string")return $;if(Z==="number")return String($);if(Y0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return nQ($);if($ instanceof cQ||Object.prototype.toString.call($)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${Z}" in template expression`)},nQ=({stdout:$})=>{if(typeof $==="string")return $;if(L0($))return S$($);if($===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof $}" stdout in template expression`)};import{spawnSync as eH}from"node:child_process";import{debuglog as iQ}from"node:util";import T2 from"node:process";var y0=($)=>v$.includes($),v$=[T2.stdin,T2.stdout,T2.stderr],N0=["stdin","stdout","stderr"],f$=($)=>N0[$]??`stdio[${$}]`;var a6=($)=>{let Z={...$};for(let X of C2)Z[X]=F2($,X);return Z},F2=($,Z)=>{let X=Array.from({length:tQ($)+1}),J=oQ($[Z],X,Z);return $q(J,Z)},tQ=({stdio:$})=>Array.isArray($)?Math.max($.length,N0.length):N0.length,oQ=($,Z,X)=>Y0($)?aQ($,Z,X):Z.fill($),aQ=($,Z,X)=>{for(let J of Object.keys($).sort(rQ))for(let q of sQ(J,X,Z))Z[q]=$[J];return Z},rQ=($,Z)=>o6($)<o6(Z)?1:-1,o6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},sQ=($,Z,X)=>{if($==="ipc")return[X.length-1];let J=M2($);if(J===void 0||J===0)throw TypeError(`"${Z}.${$}" is invalid.
5
5
  It must be "${Z}.stdout", "${Z}.stderr", "${Z}.all", "${Z}.ipc", or "${Z}.fd3", "${Z}.fd4" (and so on).`);if(J>=X.length)throw TypeError(`"${Z}.${$}" is invalid: that file descriptor does not exist.
6
- Please set the "stdio" option to ensure that file descriptor exists.`);return J==="all"?[1,2]:[J]},M2=($)=>{if($==="all")return $;if(N0.includes($))return N0.indexOf($);let Z=aQ.exec($);if(Z!==null)return Number(Z[1])},aQ=/^fd(\d+)$/,rQ=($,Z)=>$.map((X)=>X===void 0?eQ[Z]:X),sQ=dQ("execa").enabled?"full":"none",eQ={lines:!1,buffer:!0,maxBuffer:1e8,verbose:sQ,stripFinalNewline:!0},C2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],X1=($,Z)=>Z==="ipc"?$.at(-1):$[Z];var p1=({verbose:$},Z)=>P2($,Z)!=="none",d1=({verbose:$},Z)=>!["none","short"].includes(P2($,Z)),r6=({verbose:$},Z)=>{let X=P2($,Z);return k$(X)?X:void 0},P2=($,Z)=>Z===void 0?$q($):X1($,Z),$q=($)=>$.find((Z)=>k$(Z))??b$.findLast((Z)=>$.includes(Z)),k$=($)=>typeof $==="function",b$=["none","short","full"];import{inspect as Pq}from"node:util";import{platform as Zq}from"node:process";import{stripVTControlCharacters as Xq}from"node:util";var s6=($,Z)=>{let X=[$,...Z],J=X.join(" "),q=X.map((Y)=>Hq(e6(Y))).join(" ");return{command:J,escapedCommand:q}},B$=($)=>Xq($).split(`
6
+ Please set the "stdio" option to ensure that file descriptor exists.`);return J==="all"?[1,2]:[J]},M2=($)=>{if($==="all")return $;if(N0.includes($))return N0.indexOf($);let Z=eQ.exec($);if(Z!==null)return Number(Z[1])},eQ=/^fd(\d+)$/,$q=($,Z)=>$.map((X)=>X===void 0?Xq[Z]:X),Zq=iQ("execa").enabled?"full":"none",Xq={lines:!1,buffer:!0,maxBuffer:1e8,verbose:Zq,stripFinalNewline:!0},C2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Z1=($,Z)=>Z==="ipc"?$.at(-1):$[Z];var p1=({verbose:$},Z)=>P2($,Z)!=="none",d1=({verbose:$},Z)=>!["none","short"].includes(P2($,Z)),r6=({verbose:$},Z)=>{let X=P2($,Z);return k$(X)?X:void 0},P2=($,Z)=>Z===void 0?Jq($):Z1($,Z),Jq=($)=>$.find((Z)=>k$(Z))??b$.findLast((Z)=>$.includes(Z)),k$=($)=>typeof $==="function",b$=["none","short","full"];import{inspect as Iq}from"node:util";import{platform as Qq}from"node:process";import{stripVTControlCharacters as qq}from"node:util";var s6=($,Z)=>{let X=[$,...Z],J=X.join(" "),q=X.map((Y)=>Bq(e6(Y))).join(" ");return{command:J,escapedCommand:q}},B$=($)=>qq($).split(`
7
7
  `).map((Z)=>e6(Z)).join(`
8
- `),e6=($)=>$.replaceAll(qq,(Z)=>Jq(Z)),Jq=($)=>{let Z=Yq[$];if(Z!==void 0)return Z;let X=$.codePointAt(0),J=X.toString(16);return X<=Gq?`\\u${J.padStart(4,"0")}`:`\\U${J}`},Qq=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},qq=Qq(),Yq={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Gq=65535,Hq=($)=>{if(zq.test($))return $;return Zq==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},zq=/^[\w./-]+$/;import $7 from"node:process";function x2(){let{env:$}=$7,{TERM:Z,TERM_PROGRAM:X}=$;if($7.platform!=="win32")return Z!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||X==="Terminus-Sublime"||X==="vscode"||Z==="xterm-256color"||Z==="alacritty"||Z==="rxvt-unicode"||Z==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Z7={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},X7={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},Kq={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Bq={...Z7,...X7},Uq={...Z7,...Kq},Wq=x2(),Vq=Wq?Bq:Uq,y$=Vq,xW=Object.entries(X7);import Lq from"node:tty";var _q=Lq?.WriteStream?.prototype?.hasColors?.()??!1,p=($,Z)=>{if(!_q)return(q)=>q;let X=`\x1B[${$}m`,J=`\x1B[${Z}m`;return(q)=>{let Y=q+"",Q=Y.indexOf(J);if(Q===-1)return X+Y+J;let G=X,H=0,W=(Z===22?J:"")+X;while(Q!==-1)G+=Y.slice(H,Q)+W,H=Q+J.length,Q=Y.indexOf(J,H);return G+=Y.slice(H)+J,G}},wW=p(0,0),J7=p(1,22),OW=p(2,22),EW=p(3,23),AW=p(4,24),hW=p(53,55),NW=p(7,27),DW=p(8,28),SW=p(9,29),vW=p(30,39),fW=p(31,39),kW=p(32,39),bW=p(33,39),yW=p(34,39),gW=p(35,39),uW=p(36,39),mW=p(37,39),g$=p(90,39),cW=p(40,49),pW=p(41,49),dW=p(42,49),lW=p(43,49),nW=p(44,49),iW=p(45,49),tW=p(46,49),oW=p(47,49),aW=p(100,49),Q7=p(91,39),rW=p(92,39),q7=p(93,39),sW=p(94,39),eW=p(95,39),$V=p(96,39),ZV=p(97,39),XV=p(101,49),JV=p(102,49),QV=p(103,49),qV=p(104,49),YV=p(105,49),GV=p(106,49),HV=p(107,49);var H7=({type:$,message:Z,timestamp:X,piped:J,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=Rq(X),H=Tq[$]({failed:Y,reject:Q,piped:J}),K=Fq[$]({reject:Q});return`${g$(`[${G}]`)} ${g$(`[${q}]`)} ${K(H)} ${K(Z)}`},Rq=($)=>`${u$($.getHours(),2)}:${u$($.getMinutes(),2)}:${u$($.getSeconds(),2)}.${u$($.getMilliseconds(),3)}`,u$=($,Z)=>String($).padStart(Z,"0"),Y7=({failed:$,reject:Z})=>{if(!$)return y$.tick;return Z?y$.cross:y$.warning},Tq={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:Y7,duration:Y7},G7=($)=>$,Fq={command:()=>J7,output:()=>G7,ipc:()=>G7,error:({reject:$})=>$?Q7:q7,duration:()=>g$};var z7=($,Z,X)=>{let J=r6(Z,X);return $.map(({verboseLine:q,verboseObject:Y})=>Mq(q,Y,J)).filter((q)=>q!==void 0).map((q)=>Cq(q)).join("")},Mq=($,Z,X)=>{if(X===void 0)return $;let J=X($,Z);if(typeof J==="string")return J},Cq=($)=>$.endsWith(`
8
+ `),e6=($)=>$.replaceAll(Hq,(Z)=>Yq(Z)),Yq=($)=>{let Z=zq[$];if(Z!==void 0)return Z;let X=$.codePointAt(0),J=X.toString(16);return X<=Kq?`\\u${J.padStart(4,"0")}`:`\\U${J}`},Gq=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Hq=Gq(),zq={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Kq=65535,Bq=($)=>{if(Uq.test($))return $;return Qq==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},Uq=/^[\w./-]+$/;import $7 from"node:process";function x2(){let{env:$}=$7,{TERM:Z,TERM_PROGRAM:X}=$;if($7.platform!=="win32")return Z!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||X==="Terminus-Sublime"||X==="vscode"||Z==="xterm-256color"||Z==="alacritty"||Z==="rxvt-unicode"||Z==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Z7={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},X7={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},Wq={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Vq={...Z7,...X7},Lq={...Z7,...Wq},_q=x2(),Rq=_q?Vq:Lq,y$=Rq,wW=Object.entries(X7);import Tq from"node:tty";var Fq=Tq?.WriteStream?.prototype?.hasColors?.()??!1,p=($,Z)=>{if(!Fq)return(q)=>q;let X=`\x1B[${$}m`,J=`\x1B[${Z}m`;return(q)=>{let Y=q+"",Q=Y.indexOf(J);if(Q===-1)return X+Y+J;let G=X,H=0,W=(Z===22?J:"")+X;while(Q!==-1)G+=Y.slice(H,Q)+W,H=Q+J.length,Q=Y.indexOf(J,H);return G+=Y.slice(H)+J,G}},AW=p(0,0),J7=p(1,22),hW=p(2,22),NW=p(3,23),DW=p(4,24),SW=p(53,55),vW=p(7,27),fW=p(8,28),kW=p(9,29),bW=p(30,39),yW=p(31,39),gW=p(32,39),uW=p(33,39),mW=p(34,39),cW=p(35,39),pW=p(36,39),dW=p(37,39),g$=p(90,39),lW=p(40,49),nW=p(41,49),iW=p(42,49),tW=p(43,49),oW=p(44,49),aW=p(45,49),rW=p(46,49),sW=p(47,49),eW=p(100,49),Q7=p(91,39),$V=p(92,39),q7=p(93,39),ZV=p(94,39),XV=p(95,39),JV=p(96,39),QV=p(97,39),qV=p(101,49),YV=p(102,49),GV=p(103,49),HV=p(104,49),zV=p(105,49),KV=p(106,49),BV=p(107,49);var H7=({type:$,message:Z,timestamp:X,piped:J,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=Mq(X),H=Cq[$]({failed:Y,reject:Q,piped:J}),K=Pq[$]({reject:Q});return`${g$(`[${G}]`)} ${g$(`[${q}]`)} ${K(H)} ${K(Z)}`},Mq=($)=>`${u$($.getHours(),2)}:${u$($.getMinutes(),2)}:${u$($.getSeconds(),2)}.${u$($.getMilliseconds(),3)}`,u$=($,Z)=>String($).padStart(Z,"0"),Y7=({failed:$,reject:Z})=>{if(!$)return y$.tick;return Z?y$.cross:y$.warning},Cq={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:Y7,duration:Y7},G7=($)=>$,Pq={command:()=>J7,output:()=>G7,ipc:()=>G7,error:({reject:$})=>$?Q7:q7,duration:()=>g$};var z7=($,Z,X)=>{let J=r6(Z,X);return $.map(({verboseLine:q,verboseObject:Y})=>xq(q,Y,J)).filter((q)=>q!==void 0).map((q)=>jq(q)).join("")},xq=($,Z,X)=>{if(X===void 0)return $;let J=X($,Z);if(typeof J==="string")return J},jq=($)=>$.endsWith(`
9
9
  `)?$:`${$}
10
- `;var l0=({type:$,verboseMessage:Z,fdNumber:X,verboseInfo:J,result:q})=>{let Y=xq({type:$,result:q,verboseInfo:J}),Q=jq(Z,Y),G=z7(Q,J,X);if(G!=="")console.warn(G.slice(0,-1))},xq=({type:$,result:Z,verboseInfo:{escapedCommand:X,commandId:J,rawOptions:{piped:q=!1,...Y}}})=>({type:$,escapedCommand:X,commandId:`${J}`,timestamp:new Date,piped:q,result:Z,options:Y}),jq=($,Z)=>$.split(`
11
- `).map((X)=>Iq({...Z,message:X})),Iq=($)=>{return{verboseLine:H7($),verboseObject:$}},m$=($)=>{let Z=typeof $==="string"?$:Pq($);return B$(Z).replaceAll("\t"," ".repeat(wq))},wq=2;var K7=($,Z)=>{if(!p1(Z))return;l0({type:"command",verboseMessage:$,verboseInfo:Z})};var B7=($,Z,X)=>{Aq($);let J=Oq($);return{verbose:$,escapedCommand:Z,commandId:J,rawOptions:X}},Oq=($)=>p1({verbose:$})?Eq++:void 0,Eq=0n,Aq=($)=>{for(let Z of $){if(Z===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(Z===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!b$.includes(Z)&&!k$(Z)){let X=b$.map((J)=>`'${J}'`).join(", ");throw TypeError(`The "verbose" option must not be ${Z}. Allowed values are: ${X} or a function.`)}}};import{hrtime as U7}from"node:process";var c$=()=>U7.bigint(),j2=($)=>Number(U7.bigint()-$)/1e6;var p$=($,Z,X)=>{let J=c$(),{command:q,escapedCommand:Y}=s6($,Z),Q=F2(X,"verbose"),G=B7(Q,Y,{...X});return K7(Y,G),{command:q,escapedCommand:Y,startTime:J,verboseInfo:G}};var K5=$1($8(),1);import LY from"node:path";import z5 from"node:process";import i$ from"node:process";import M1 from"node:path";function l$($={}){let{env:Z=process.env,platform:X=process.platform}=$;if(X!=="win32")return"PATH";return Object.keys(Z).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"}import{promisify as q9}from"node:util";import{execFile as Y9,execFileSync as oV}from"node:child_process";import Z8 from"node:path";import{fileURLToPath as G9}from"node:url";var sV=q9(Y9);function n$($){return $ instanceof URL?G9($):$}function X8($){return{*[Symbol.iterator](){let Z=Z8.resolve(n$($)),X;while(X!==Z)yield Z,X=Z,Z=Z8.resolve(Z,"..")}}}var H9=({cwd:$=i$.cwd(),path:Z=i$.env[l$()],preferLocal:X=!0,execPath:J=i$.execPath,addExecPath:q=!0}={})=>{let Y=M1.resolve(n$($)),Q=[],G=Z.split(M1.delimiter);if(X)z9(Q,G,Y);if(q)K9(Q,G,J,Y);return Z===""||Z===M1.delimiter?`${Q.join(M1.delimiter)}${Z}`:[...Q,Z].join(M1.delimiter)},z9=($,Z,X)=>{for(let J of X8(X)){let q=M1.join(J,"node_modules/.bin");if(!Z.includes(q))$.push(q)}},K9=($,Z,X,J)=>{let q=M1.resolve(J,n$(X),"..");if(!Z.includes(q))$.push(q)},J8=({env:$=i$.env,...Z}={})=>{$={...$};let X=l$({env:$});return Z.path=$[X],$[X]=H9(Z),$};import{setTimeout as I9}from"node:timers/promises";var Q8=($,Z,X)=>{let J=X?o$:t$,q=$ instanceof n0?{}:{cause:$};return new J(Z,q)};class n0 extends Error{}var q8=($,Z)=>{Object.defineProperty($.prototype,"name",{value:Z,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,G8,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Y8=($)=>a$($)&&(G8 in $),G8=Symbol("isExecaError"),a$=($)=>Object.prototype.toString.call($)==="[object Error]";class t$ extends Error{}q8(t$,t$.name);class o$ extends Error{}q8(o$,o$.name);import{constants as U$}from"node:os";import{constants as V9}from"node:os";var H8=()=>{let $=v2-z8+1;return Array.from({length:$},B9)},B9=($,Z)=>({name:`SIGRT${Z+1}`,number:z8+Z,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),z8=34,v2=64;import{constants as U9}from"node:os";var K8=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var f2=()=>{let $=H8();return[...K8,...$].map(W9)},W9=({name:$,number:Z,description:X,action:J,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=U9,G=Q!==void 0;return{name:$,number:G?Q:Z,description:X,supported:G,action:J,forced:q,standard:Y}};var L9=()=>{let $=f2();return Object.fromEntries($.map(_9))},_9=({name:$,number:Z,description:X,supported:J,action:q,forced:Y,standard:Q})=>[$,{name:$,number:Z,description:X,supported:J,action:q,forced:Y,standard:Q}],B8=L9(),R9=()=>{let $=f2(),Z=v2+1,X=Array.from({length:Z},(J,q)=>T9(q,$));return Object.assign({},...X)},T9=($,Z)=>{let X=F9($,Z);if(X===void 0)return{};let{name:J,description:q,supported:Y,action:Q,forced:G,standard:H}=X;return{[$]:{name:J,number:$,description:q,supported:Y,action:Q,forced:G,standard:H}}},F9=($,Z)=>{let X=Z.find(({name:J})=>V9.signals[J]===$);if(X!==void 0)return X;return Z.find((J)=>J.number===$)},_L=R9();var W8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return L8($,"option `killSignal`")},V8=($)=>$===0?$:L8($,"`subprocess.kill()`'s argument"),L8=($,Z)=>{if(Number.isInteger($))return M9($,Z);if(typeof $==="string")return P9($,Z);throw TypeError(`Invalid ${Z} ${String($)}: it must be a string or an integer.
12
- ${k2()}`)},M9=($,Z)=>{if(U8.has($))return U8.get($);throw TypeError(`Invalid ${Z} ${$}: this signal integer does not exist.
13
- ${k2()}`)},C9=()=>new Map(Object.entries(U$.signals).reverse().map(([$,Z])=>[Z,$])),U8=C9(),P9=($,Z)=>{if($ in U$.signals)return $;if($.toUpperCase()in U$.signals)throw TypeError(`Invalid ${Z} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${Z} '${$}': this signal name does not exist.
14
- ${k2()}`)},k2=()=>`Available signal names: ${x9()}.
15
- Available signal numbers: ${j9()}.`,x9=()=>Object.keys(U$.signals).sort().map(($)=>`'${$}'`).join(", "),j9=()=>[...new Set(Object.values(U$.signals).sort(($,Z)=>$-Z))].join(", "),r$=($)=>B8[$].description;var _8=($)=>{if($===!1)return $;if($===!0)return w9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},w9=5000,R8=({kill:$,options:{forceKillAfterDelay:Z,killSignal:X},onInternalError:J,context:q,controller:Y},Q,G)=>{let{signal:H,error:K}=O9(Q,G,X);E9(K,J);let W=$(H);return A9({kill:$,signal:H,forceKillAfterDelay:Z,killSignal:X,killResult:W,context:q,controller:Y}),W},O9=($,Z,X)=>{let[J=X,q]=a$($)?[void 0,$]:[$,Z];if(typeof J!=="string"&&!Number.isInteger(J))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(J)}`);if(q!==void 0&&!a$(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:V8(J),error:q}},E9=($,Z)=>{if($!==void 0)Z.reject($)},A9=async({kill:$,signal:Z,forceKillAfterDelay:X,killSignal:J,killResult:q,context:Y,controller:Q})=>{if(Z===J&&q)b2({kill:$,forceKillAfterDelay:X,context:Y,controllerSignal:Q.signal})},b2=async({kill:$,forceKillAfterDelay:Z,context:X,controllerSignal:J})=>{if(Z===!1)return;try{if(await I9(Z,void 0,{signal:J}),$("SIGKILL"))X.isForcefullyTerminated??=!0}catch{}};import{once as h9}from"node:events";var s$=async($,Z)=>{if(!$.aborted)await h9($,"abort",{signal:Z})};var T8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},F8=({subprocess:$,cancelSignal:Z,gracefulCancel:X,context:J,controller:q})=>Z===void 0||X?[]:[N9($,Z,J,q)],N9=async($,Z,X,{signal:J})=>{throw await s$(Z,J),X.terminationReason??="cancel",$.kill(),Z.reason};import{scheduler as s9}from"node:timers/promises";import{promisify as o9}from"node:util";var i1=({methodName:$,isSubprocess:Z,ipc:X,isConnected:J})=>{D9($,Z,X),y2($,Z,J)},D9=($,Z,X)=>{if(!X)throw Error(`${g0($,Z)} can only be used if the \`ipc\` option is \`true\`.`)},y2=($,Z,X)=>{if(!X)throw Error(`${g0($,Z)} cannot be used: the ${H1(Z)} has already exited or disconnected.`)},M8=($)=>{throw Error(`${g0("getOneMessage",$)} could not complete: the ${H1($)} exited or disconnected.`)},C8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${H1($)} is sending a message too, instead of listening to incoming messages.
10
+ `;var l0=({type:$,verboseMessage:Z,fdNumber:X,verboseInfo:J,result:q})=>{let Y=wq({type:$,result:q,verboseInfo:J}),Q=Oq(Z,Y),G=z7(Q,J,X);if(G!=="")console.warn(G.slice(0,-1))},wq=({type:$,result:Z,verboseInfo:{escapedCommand:X,commandId:J,rawOptions:{piped:q=!1,...Y}}})=>({type:$,escapedCommand:X,commandId:`${J}`,timestamp:new Date,piped:q,result:Z,options:Y}),Oq=($,Z)=>$.split(`
11
+ `).map((X)=>Eq({...Z,message:X})),Eq=($)=>{return{verboseLine:H7($),verboseObject:$}},m$=($)=>{let Z=typeof $==="string"?$:Iq($);return B$(Z).replaceAll("\t"," ".repeat(Aq))},Aq=2;var K7=($,Z)=>{if(!p1(Z))return;l0({type:"command",verboseMessage:$,verboseInfo:Z})};var B7=($,Z,X)=>{Dq($);let J=hq($);return{verbose:$,escapedCommand:Z,commandId:J,rawOptions:X}},hq=($)=>p1({verbose:$})?Nq++:void 0,Nq=0n,Dq=($)=>{for(let Z of $){if(Z===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(Z===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!b$.includes(Z)&&!k$(Z)){let X=b$.map((J)=>`'${J}'`).join(", ");throw TypeError(`The "verbose" option must not be ${Z}. Allowed values are: ${X} or a function.`)}}};import{hrtime as U7}from"node:process";var c$=()=>U7.bigint(),j2=($)=>Number(U7.bigint()-$)/1e6;var p$=($,Z,X)=>{let J=c$(),{command:q,escapedCommand:Y}=s6($,Z),Q=F2(X,"verbose"),G=B7(Q,Y,{...X});return K7(Y,G),{command:q,escapedCommand:Y,startTime:J,verboseInfo:G}};var K5=m1($8(),1);import TY from"node:path";import z5 from"node:process";import i$ from"node:process";import F1 from"node:path";function l$($={}){let{env:Z=process.env,platform:X=process.platform}=$;if(X!=="win32")return"PATH";return Object.keys(Z).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"}import{promisify as H9}from"node:util";import{execFile as z9,execFileSync as sV}from"node:child_process";import Z8 from"node:path";import{fileURLToPath as K9}from"node:url";var ZL=H9(z9);function n$($){return $ instanceof URL?K9($):$}function X8($){return{*[Symbol.iterator](){let Z=Z8.resolve(n$($)),X;while(X!==Z)yield Z,X=Z,Z=Z8.resolve(Z,"..")}}}var B9=({cwd:$=i$.cwd(),path:Z=i$.env[l$()],preferLocal:X=!0,execPath:J=i$.execPath,addExecPath:q=!0}={})=>{let Y=F1.resolve(n$($)),Q=[],G=Z.split(F1.delimiter);if(X)U9(Q,G,Y);if(q)W9(Q,G,J,Y);return Z===""||Z===F1.delimiter?`${Q.join(F1.delimiter)}${Z}`:[...Q,Z].join(F1.delimiter)},U9=($,Z,X)=>{for(let J of X8(X)){let q=F1.join(J,"node_modules/.bin");if(!Z.includes(q))$.push(q)}},W9=($,Z,X,J)=>{let q=F1.resolve(J,n$(X),"..");if(!Z.includes(q))$.push(q)},J8=({env:$=i$.env,...Z}={})=>{$={...$};let X=l$({env:$});return Z.path=$[X],$[X]=B9(Z),$};import{setTimeout as E9}from"node:timers/promises";var Q8=($,Z,X)=>{let J=X?o$:t$,q=$ instanceof n0?{}:{cause:$};return new J(Z,q)};class n0 extends Error{}var q8=($,Z)=>{Object.defineProperty($.prototype,"name",{value:Z,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,G8,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Y8=($)=>a$($)&&(G8 in $),G8=Symbol("isExecaError"),a$=($)=>Object.prototype.toString.call($)==="[object Error]";class t$ extends Error{}q8(t$,t$.name);class o$ extends Error{}q8(o$,o$.name);import{constants as U$}from"node:os";import{constants as R9}from"node:os";var H8=()=>{let $=v2-z8+1;return Array.from({length:$},V9)},V9=($,Z)=>({name:`SIGRT${Z+1}`,number:z8+Z,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),z8=34,v2=64;import{constants as L9}from"node:os";var K8=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var f2=()=>{let $=H8();return[...K8,...$].map(_9)},_9=({name:$,number:Z,description:X,action:J,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=L9,G=Q!==void 0;return{name:$,number:G?Q:Z,description:X,supported:G,action:J,forced:q,standard:Y}};var T9=()=>{let $=f2();return Object.fromEntries($.map(F9))},F9=({name:$,number:Z,description:X,supported:J,action:q,forced:Y,standard:Q})=>[$,{name:$,number:Z,description:X,supported:J,action:q,forced:Y,standard:Q}],B8=T9(),M9=()=>{let $=f2(),Z=v2+1,X=Array.from({length:Z},(J,q)=>C9(q,$));return Object.assign({},...X)},C9=($,Z)=>{let X=P9($,Z);if(X===void 0)return{};let{name:J,description:q,supported:Y,action:Q,forced:G,standard:H}=X;return{[$]:{name:J,number:$,description:q,supported:Y,action:Q,forced:G,standard:H}}},P9=($,Z)=>{let X=Z.find(({name:J})=>R9.signals[J]===$);if(X!==void 0)return X;return Z.find((J)=>J.number===$)},FL=M9();var W8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return L8($,"option `killSignal`")},V8=($)=>$===0?$:L8($,"`subprocess.kill()`'s argument"),L8=($,Z)=>{if(Number.isInteger($))return x9($,Z);if(typeof $==="string")return I9($,Z);throw TypeError(`Invalid ${Z} ${String($)}: it must be a string or an integer.
12
+ ${k2()}`)},x9=($,Z)=>{if(U8.has($))return U8.get($);throw TypeError(`Invalid ${Z} ${$}: this signal integer does not exist.
13
+ ${k2()}`)},j9=()=>new Map(Object.entries(U$.signals).reverse().map(([$,Z])=>[Z,$])),U8=j9(),I9=($,Z)=>{if($ in U$.signals)return $;if($.toUpperCase()in U$.signals)throw TypeError(`Invalid ${Z} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${Z} '${$}': this signal name does not exist.
14
+ ${k2()}`)},k2=()=>`Available signal names: ${w9()}.
15
+ Available signal numbers: ${O9()}.`,w9=()=>Object.keys(U$.signals).sort().map(($)=>`'${$}'`).join(", "),O9=()=>[...new Set(Object.values(U$.signals).sort(($,Z)=>$-Z))].join(", "),r$=($)=>B8[$].description;var _8=($)=>{if($===!1)return $;if($===!0)return A9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},A9=5000,R8=({kill:$,options:{forceKillAfterDelay:Z,killSignal:X},onInternalError:J,context:q,controller:Y},Q,G)=>{let{signal:H,error:K}=h9(Q,G,X);N9(K,J);let W=$(H);return D9({kill:$,signal:H,forceKillAfterDelay:Z,killSignal:X,killResult:W,context:q,controller:Y}),W},h9=($,Z,X)=>{let[J=X,q]=a$($)?[void 0,$]:[$,Z];if(typeof J!=="string"&&!Number.isInteger(J))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(J)}`);if(q!==void 0&&!a$(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:V8(J),error:q}},N9=($,Z)=>{if($!==void 0)Z.reject($)},D9=async({kill:$,signal:Z,forceKillAfterDelay:X,killSignal:J,killResult:q,context:Y,controller:Q})=>{if(Z===J&&q)b2({kill:$,forceKillAfterDelay:X,context:Y,controllerSignal:Q.signal})},b2=async({kill:$,forceKillAfterDelay:Z,context:X,controllerSignal:J})=>{if(Z===!1)return;try{if(await E9(Z,void 0,{signal:J}),$("SIGKILL"))X.isForcefullyTerminated??=!0}catch{}};import{once as S9}from"node:events";var s$=async($,Z)=>{if(!$.aborted)await S9($,"abort",{signal:Z})};var T8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},F8=({subprocess:$,cancelSignal:Z,gracefulCancel:X,context:J,controller:q})=>Z===void 0||X?[]:[v9($,Z,J,q)],v9=async($,Z,X,{signal:J})=>{throw await s$(Z,J),X.terminationReason??="cancel",$.kill(),Z.reason};import{scheduler as ZY}from"node:timers/promises";import{promisify as s9}from"node:util";var i1=({methodName:$,isSubprocess:Z,ipc:X,isConnected:J})=>{f9($,Z,X),y2($,Z,J)},f9=($,Z,X)=>{if(!X)throw Error(`${g0($,Z)} can only be used if the \`ipc\` option is \`true\`.`)},y2=($,Z,X)=>{if(!X)throw Error(`${g0($,Z)} cannot be used: the ${G1(Z)} has already exited or disconnected.`)},M8=($)=>{throw Error(`${g0("getOneMessage",$)} could not complete: the ${G1($)} exited or disconnected.`)},C8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${G1($)} is sending a message too, instead of listening to incoming messages.
16
16
  This can be fixed by both sending a message and listening to incoming messages at the same time:
17
17
 
18
18
  const [receivedMessage] = await Promise.all([
19
19
  ${g0("getOneMessage",$)},
20
20
  ${g0("sendMessage",$,"message, {strict: true}")},
21
- ]);`)},e$=($,Z)=>Error(`${g0("sendMessage",Z)} failed when sending an acknowledgment response to the ${H1(Z)}.`,{cause:$}),P8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${H1($)} is not listening to incoming messages.`)},x8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${H1($)} exited without listening to incoming messages.`)},j8=()=>Error(`\`cancelSignal\` aborted: the ${H1(!0)} disconnected.`),I8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},w8=({error:$,methodName:Z,isSubprocess:X})=>{if($.code==="EPIPE")throw Error(`${g0(Z,X)} cannot be used: the ${H1(X)} is disconnecting.`,{cause:$})},O8=({error:$,methodName:Z,isSubprocess:X,message:J})=>{if(S9($))throw Error(`${g0(Z,X)}'s argument type is invalid: the message cannot be serialized: ${String(J)}.`,{cause:$})},S9=({code:$,message:Z})=>v9.has($)||f9.some((X)=>Z.includes(X)),v9=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),f9=["could not be cloned","circular structure","call stack size exceeded"],g0=($,Z,X="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${k9(Z)}${$}(${X})`,k9=($)=>$?"":"subprocess.",H1=($)=>$?"parent process":"subprocess",t1=($)=>{if($.connected)$.disconnect()};var i0=()=>{let $={},Z=new Promise((X,J)=>{Object.assign($,{resolve:X,reject:J})});return Object.assign(Z,$)};var Z4=($,Z="stdin")=>{let{options:J,fileDescriptors:q}=t0.get($),Y=E8(q,Z,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(A8(Y,Z,J,!0));return Q},o1=($,Z="stdout")=>{let{options:J,fileDescriptors:q}=t0.get($),Y=E8(q,Z,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(A8(Y,Z,J,!1));return Q},t0=new WeakMap,E8=($,Z,X)=>{let J=b9(Z,X);return y9(J,Z,X,$),J},b9=($,Z)=>{let X=M2($);if(X!==void 0)return X;let{validOptions:J,defaultValue:q}=Z?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${W$(Z)}" must not be "${$}".
21
+ ]);`)},e$=($,Z)=>Error(`${g0("sendMessage",Z)} failed when sending an acknowledgment response to the ${G1(Z)}.`,{cause:$}),P8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${G1($)} is not listening to incoming messages.`)},x8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${G1($)} exited without listening to incoming messages.`)},j8=()=>Error(`\`cancelSignal\` aborted: the ${G1(!0)} disconnected.`),I8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},w8=({error:$,methodName:Z,isSubprocess:X})=>{if($.code==="EPIPE")throw Error(`${g0(Z,X)} cannot be used: the ${G1(X)} is disconnecting.`,{cause:$})},O8=({error:$,methodName:Z,isSubprocess:X,message:J})=>{if(k9($))throw Error(`${g0(Z,X)}'s argument type is invalid: the message cannot be serialized: ${String(J)}.`,{cause:$})},k9=({code:$,message:Z})=>b9.has($)||y9.some((X)=>Z.includes(X)),b9=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),y9=["could not be cloned","circular structure","call stack size exceeded"],g0=($,Z,X="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${g9(Z)}${$}(${X})`,g9=($)=>$?"":"subprocess.",G1=($)=>$?"parent process":"subprocess",t1=($)=>{if($.connected)$.disconnect()};var i0=()=>{let $={},Z=new Promise((X,J)=>{Object.assign($,{resolve:X,reject:J})});return Object.assign(Z,$)};var Z4=($,Z="stdin")=>{let{options:J,fileDescriptors:q}=t0.get($),Y=E8(q,Z,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(A8(Y,Z,J,!0));return Q},o1=($,Z="stdout")=>{let{options:J,fileDescriptors:q}=t0.get($),Y=E8(q,Z,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(A8(Y,Z,J,!1));return Q},t0=new WeakMap,E8=($,Z,X)=>{let J=u9(Z,X);return m9(J,Z,X,$),J},u9=($,Z)=>{let X=M2($);if(X!==void 0)return X;let{validOptions:J,defaultValue:q}=Z?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${W$(Z)}" must not be "${$}".
22
22
  It must be ${J} or "fd3", "fd4" (and so on).
23
- It is optional and defaults to "${q}".`)},y9=($,Z,X,J)=>{let q=J[h8($)];if(q===void 0)throw TypeError(`"${W$(X)}" must not be ${Z}. That file descriptor does not exist.
24
- Please set the "stdio" option to ensure that file descriptor exists.`);if(q.direction==="input"&&!X)throw TypeError(`"${W$(X)}" must not be ${Z}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&X)throw TypeError(`"${W$(X)}" must not be ${Z}. It must be a writable stream, not readable.`)},A8=($,Z,X,J)=>{if($==="all"&&!X.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=g9($,X);return`The "${q}: ${$4(Y)}" option is incompatible with using "${W$(J)}: ${$4(Z)}".
25
- Please set this option with "pipe" instead.`},g9=($,{stdin:Z,stdout:X,stderr:J,stdio:q})=>{let Y=h8($);if(Y===0&&Z!==void 0)return{optionName:"stdin",optionValue:Z};if(Y===1&&X!==void 0)return{optionName:"stdout",optionValue:X};if(Y===2&&J!==void 0)return{optionName:"stderr",optionValue:J};return{optionName:`stdio[${Y}]`,optionValue:q[Y]}},h8=($)=>$==="all"?1:$,W$=($)=>$?"to":"from",$4=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as l9}from"node:events";import{addAbortListener as u9}from"node:events";var C1=($,Z,X)=>{let J=$.getMaxListeners();if(J===0||J===Number.POSITIVE_INFINITY)return;$.setMaxListeners(J+Z),u9(X,()=>{$.setMaxListeners($.getMaxListeners()-Z)})};import{EventEmitter as p9}from"node:events";import{once as m9}from"node:events";import{scheduler as c9}from"node:timers/promises";var X4=($,Z)=>{if(Z)g2($)},g2=($)=>{$.refCounted()},J4=($,Z)=>{if(Z)u2($)},u2=($)=>{$.unrefCounted()},N8=($,Z)=>{if(Z)u2($),u2($)},D8=($,Z)=>{if(Z)g2($),g2($)};var S8=async({anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J},q)=>{if(k8(q)||y8(q))return;if(!Q4.has($))Q4.set($,[]);let Y=Q4.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await b8($,J,q),await c9.yield();let Q=await f8({wrappedMessage:Y[0],anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J});Y.shift(),J.emit("message",Q),J.emit("message:done")}},v8=async({anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J,boundOnMessage:q})=>{m2();let Y=Q4.get($);while(Y?.length>0)await m9(J,"message:done");$.removeListener("message",q),D8(Z,X),J.connected=!1,J.emit("disconnect")},Q4=new WeakMap;var z1=($,Z,X)=>{if(q4.has($))return q4.get($);let J=new p9;return J.connected=!0,q4.set($,J),d9({ipcEmitter:J,anyProcess:$,channel:Z,isSubprocess:X}),J},q4=new WeakMap,d9=({ipcEmitter:$,anyProcess:Z,channel:X,isSubprocess:J})=>{let q=S8.bind(void 0,{anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:$});Z.on("message",q),Z.once("disconnect",v8.bind(void 0,{anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:$,boundOnMessage:q})),N8(X,J)},Y4=($)=>{let Z=q4.get($);return Z===void 0?$.channel!==null:Z.connected};var g8=({anyProcess:$,channel:Z,isSubprocess:X,message:J,strict:q})=>{if(!q)return J;let Y=z1($,Z,X),Q=z4($,Y);return{id:n9++,type:H4,message:J,hasListeners:Q}},n9=0n,u8=($,Z)=>{if(Z?.type!==H4||Z.hasListeners)return;for(let{id:X}of $)if(X!==void 0)G4[X].resolve({isDeadlock:!0,hasListeners:!1})},f8=async({wrappedMessage:$,anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:q})=>{if($?.type!==H4||!Z.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:c8,message:z4(Z,q)};try{await K4({anyProcess:Z,channel:X,isSubprocess:J,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},k8=($)=>{if($?.type!==c8)return!1;let{id:Z,message:X}=$;return G4[Z]?.resolve({isDeadlock:!1,hasListeners:X}),!0},m8=async($,Z,X)=>{if($?.type!==H4)return;let J=i0();G4[$.id]=J;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([J,i9(Z,X,q)]);if(Y)C8(X);if(!Q)P8(X)}finally{q.abort(),delete G4[$.id]}},G4={},i9=async($,Z,{signal:X})=>{C1($,1,X),await l9($,"disconnect",{signal:X}),x8(Z)},H4="execa:ipc:request",c8="execa:ipc:response";var p8=($,Z,X)=>{if(!V$.has($))V$.set($,new Set);let J=V$.get($),q=i0(),Y=X?Z.id:void 0,Q={onMessageSent:q,id:Y};return J.add(Q),{outgoingMessages:J,outgoingMessage:Q}},d8=({outgoingMessages:$,outgoingMessage:Z})=>{$.delete(Z),Z.onMessageSent.resolve()},b8=async($,Z,X)=>{while(!z4($,Z)&&V$.get($)?.size>0){let J=[...V$.get($)];u8(J,X),await Promise.all(J.map(({onMessageSent:q})=>q))}},V$=new WeakMap,z4=($,Z)=>Z.listenerCount("message")>t9($),t9=($)=>t0.has($)&&!X1(t0.get($).options.buffer,"ipc")?1:0;var K4=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},q,{strict:Y=!1}={})=>{return i1({methodName:"sendMessage",isSubprocess:X,ipc:J,isConnected:$.connected}),a9({anyProcess:$,channel:Z,methodName:"sendMessage",isSubprocess:X,message:q,strict:Y})},a9=async({anyProcess:$,channel:Z,methodName:X,isSubprocess:J,message:q,strict:Y})=>{let Q=g8({anyProcess:$,channel:Z,isSubprocess:J,message:q,strict:Y}),G=p8($,Q,Y);try{await p2({anyProcess:$,methodName:X,isSubprocess:J,wrappedMessage:Q,message:q})}catch(H){throw t1($),H}finally{d8(G)}},p2=async({anyProcess:$,methodName:Z,isSubprocess:X,wrappedMessage:J,message:q})=>{let Y=r9($);try{await Promise.all([m8(J,$,X),Y(J)])}catch(Q){throw w8({error:Q,methodName:Z,isSubprocess:X}),O8({error:Q,methodName:Z,isSubprocess:X,message:q}),Q}},r9=($)=>{if(c2.has($))return c2.get($);let Z=o9($.send.bind($));return c2.set($,Z),Z},c2=new WeakMap;var n8=($,Z)=>{return y2("cancelSignal",!1,$.connected),p2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:t8,message:Z},message:Z})},i8=async({anyProcess:$,channel:Z,isSubprocess:X,ipc:J})=>{return await e9({anyProcess:$,channel:Z,isSubprocess:X,ipc:J}),d2.signal},e9=async({anyProcess:$,channel:Z,isSubprocess:X,ipc:J})=>{if(l8)return;if(l8=!0,!J){I8();return}if(Z===null){m2();return}z1($,Z,X),await s9.yield()},l8=!1,y8=($)=>{if($?.type!==t8)return!1;return d2.abort($.message),!0},t8="execa:ipc:cancel",m2=()=>{d2.abort(j8())},d2=new AbortController;var o8=({gracefulCancel:$,cancelSignal:Z,ipc:X,serialization:J})=>{if(!$)return;if(Z===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!X)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(J==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},a8=({subprocess:$,cancelSignal:Z,gracefulCancel:X,forceKillAfterDelay:J,context:q,controller:Y})=>X?[$Y({subprocess:$,cancelSignal:Z,forceKillAfterDelay:J,context:q,controller:Y})]:[],$Y=async({subprocess:$,cancelSignal:Z,forceKillAfterDelay:X,context:J,controller:{signal:q}})=>{await s$(Z,q);let Y=ZY(Z);throw await n8($,Y),b2({kill:$.kill,forceKillAfterDelay:X,context:J,controllerSignal:q}),J.terminationReason??="gracefulCancel",Z.reason},ZY=({reason:$})=>{if(!($ instanceof DOMException))return $;let Z=Error($.message);return Object.defineProperty(Z,"stack",{value:$.stack,enumerable:!1,configurable:!0,writable:!0}),Z};import{setTimeout as XY}from"node:timers/promises";var r8=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},s8=($,Z,X,J)=>Z===0||Z===void 0?[]:[JY($,Z,X,J)],JY=async($,Z,X,{signal:J})=>{throw await XY(Z,void 0,{signal:J}),X.terminationReason??="timeout",$.kill(),new n0};import{execPath as QY,execArgv as qY}from"node:process";import e8 from"node:path";var $5=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},Z5=($,Z,{node:X=!1,nodePath:J=QY,nodeOptions:q=qY.filter((H)=>!H.startsWith("--inspect")),cwd:Y,execPath:Q,...G})=>{if(Q!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let H=c1(J,'The "nodePath" option'),K=e8.resolve(Y,H),W={...G,nodePath:K,node:X,cwd:Y};if(!X)return[$,Z,W];if(e8.basename($,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[K,[...q,$,...Z],{ipc:!0,...W,shell:!1}]};import{serialize as YY}from"node:v8";var X5=({ipcInput:$,ipc:Z,serialization:X})=>{if($===void 0)return;if(!Z)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");zY[X]($)},GY=($)=>{try{YY($)}catch(Z){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:Z})}},HY=($)=>{try{JSON.stringify($)}catch(Z){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:Z})}},zY={advanced:GY,json:HY},J5=async($,Z)=>{if(Z===void 0)return;await $.sendMessage(Z)};var q5=({encoding:$})=>{if(l2.has($))return;let Z=BY($);if(Z!==void 0)throw TypeError(`Invalid option \`encoding: ${B4($)}\`.
23
+ It is optional and defaults to "${q}".`)},m9=($,Z,X,J)=>{let q=J[h8($)];if(q===void 0)throw TypeError(`"${W$(X)}" must not be ${Z}. That file descriptor does not exist.
24
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(q.direction==="input"&&!X)throw TypeError(`"${W$(X)}" must not be ${Z}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&X)throw TypeError(`"${W$(X)}" must not be ${Z}. It must be a writable stream, not readable.`)},A8=($,Z,X,J)=>{if($==="all"&&!X.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=c9($,X);return`The "${q}: ${$4(Y)}" option is incompatible with using "${W$(J)}: ${$4(Z)}".
25
+ Please set this option with "pipe" instead.`},c9=($,{stdin:Z,stdout:X,stderr:J,stdio:q})=>{let Y=h8($);if(Y===0&&Z!==void 0)return{optionName:"stdin",optionValue:Z};if(Y===1&&X!==void 0)return{optionName:"stdout",optionValue:X};if(Y===2&&J!==void 0)return{optionName:"stderr",optionValue:J};return{optionName:`stdio[${Y}]`,optionValue:q[Y]}},h8=($)=>$==="all"?1:$,W$=($)=>$?"to":"from",$4=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as t9}from"node:events";import{addAbortListener as p9}from"node:events";var M1=($,Z,X)=>{let J=$.getMaxListeners();if(J===0||J===Number.POSITIVE_INFINITY)return;$.setMaxListeners(J+Z),p9(X,()=>{$.setMaxListeners($.getMaxListeners()-Z)})};import{EventEmitter as n9}from"node:events";import{once as d9}from"node:events";import{scheduler as l9}from"node:timers/promises";var X4=($,Z)=>{if(Z)g2($)},g2=($)=>{$.refCounted()},J4=($,Z)=>{if(Z)u2($)},u2=($)=>{$.unrefCounted()},N8=($,Z)=>{if(Z)u2($),u2($)},D8=($,Z)=>{if(Z)g2($),g2($)};var S8=async({anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J},q)=>{if(k8(q)||y8(q))return;if(!Q4.has($))Q4.set($,[]);let Y=Q4.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await b8($,J,q),await l9.yield();let Q=await f8({wrappedMessage:Y[0],anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J});Y.shift(),J.emit("message",Q),J.emit("message:done")}},v8=async({anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J,boundOnMessage:q})=>{m2();let Y=Q4.get($);while(Y?.length>0)await d9(J,"message:done");$.removeListener("message",q),D8(Z,X),J.connected=!1,J.emit("disconnect")},Q4=new WeakMap;var H1=($,Z,X)=>{if(q4.has($))return q4.get($);let J=new n9;return J.connected=!0,q4.set($,J),i9({ipcEmitter:J,anyProcess:$,channel:Z,isSubprocess:X}),J},q4=new WeakMap,i9=({ipcEmitter:$,anyProcess:Z,channel:X,isSubprocess:J})=>{let q=S8.bind(void 0,{anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:$});Z.on("message",q),Z.once("disconnect",v8.bind(void 0,{anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:$,boundOnMessage:q})),N8(X,J)},Y4=($)=>{let Z=q4.get($);return Z===void 0?$.channel!==null:Z.connected};var g8=({anyProcess:$,channel:Z,isSubprocess:X,message:J,strict:q})=>{if(!q)return J;let Y=H1($,Z,X),Q=z4($,Y);return{id:o9++,type:H4,message:J,hasListeners:Q}},o9=0n,u8=($,Z)=>{if(Z?.type!==H4||Z.hasListeners)return;for(let{id:X}of $)if(X!==void 0)G4[X].resolve({isDeadlock:!0,hasListeners:!1})},f8=async({wrappedMessage:$,anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:q})=>{if($?.type!==H4||!Z.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:c8,message:z4(Z,q)};try{await K4({anyProcess:Z,channel:X,isSubprocess:J,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},k8=($)=>{if($?.type!==c8)return!1;let{id:Z,message:X}=$;return G4[Z]?.resolve({isDeadlock:!1,hasListeners:X}),!0},m8=async($,Z,X)=>{if($?.type!==H4)return;let J=i0();G4[$.id]=J;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([J,a9(Z,X,q)]);if(Y)C8(X);if(!Q)P8(X)}finally{q.abort(),delete G4[$.id]}},G4={},a9=async($,Z,{signal:X})=>{M1($,1,X),await t9($,"disconnect",{signal:X}),x8(Z)},H4="execa:ipc:request",c8="execa:ipc:response";var p8=($,Z,X)=>{if(!V$.has($))V$.set($,new Set);let J=V$.get($),q=i0(),Y=X?Z.id:void 0,Q={onMessageSent:q,id:Y};return J.add(Q),{outgoingMessages:J,outgoingMessage:Q}},d8=({outgoingMessages:$,outgoingMessage:Z})=>{$.delete(Z),Z.onMessageSent.resolve()},b8=async($,Z,X)=>{while(!z4($,Z)&&V$.get($)?.size>0){let J=[...V$.get($)];u8(J,X),await Promise.all(J.map(({onMessageSent:q})=>q))}},V$=new WeakMap,z4=($,Z)=>Z.listenerCount("message")>r9($),r9=($)=>t0.has($)&&!Z1(t0.get($).options.buffer,"ipc")?1:0;var K4=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},q,{strict:Y=!1}={})=>{return i1({methodName:"sendMessage",isSubprocess:X,ipc:J,isConnected:$.connected}),e9({anyProcess:$,channel:Z,methodName:"sendMessage",isSubprocess:X,message:q,strict:Y})},e9=async({anyProcess:$,channel:Z,methodName:X,isSubprocess:J,message:q,strict:Y})=>{let Q=g8({anyProcess:$,channel:Z,isSubprocess:J,message:q,strict:Y}),G=p8($,Q,Y);try{await p2({anyProcess:$,methodName:X,isSubprocess:J,wrappedMessage:Q,message:q})}catch(H){throw t1($),H}finally{d8(G)}},p2=async({anyProcess:$,methodName:Z,isSubprocess:X,wrappedMessage:J,message:q})=>{let Y=$Y($);try{await Promise.all([m8(J,$,X),Y(J)])}catch(Q){throw w8({error:Q,methodName:Z,isSubprocess:X}),O8({error:Q,methodName:Z,isSubprocess:X,message:q}),Q}},$Y=($)=>{if(c2.has($))return c2.get($);let Z=s9($.send.bind($));return c2.set($,Z),Z},c2=new WeakMap;var n8=($,Z)=>{return y2("cancelSignal",!1,$.connected),p2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:t8,message:Z},message:Z})},i8=async({anyProcess:$,channel:Z,isSubprocess:X,ipc:J})=>{return await XY({anyProcess:$,channel:Z,isSubprocess:X,ipc:J}),d2.signal},XY=async({anyProcess:$,channel:Z,isSubprocess:X,ipc:J})=>{if(l8)return;if(l8=!0,!J){I8();return}if(Z===null){m2();return}H1($,Z,X),await ZY.yield()},l8=!1,y8=($)=>{if($?.type!==t8)return!1;return d2.abort($.message),!0},t8="execa:ipc:cancel",m2=()=>{d2.abort(j8())},d2=new AbortController;var o8=({gracefulCancel:$,cancelSignal:Z,ipc:X,serialization:J})=>{if(!$)return;if(Z===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!X)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(J==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},a8=({subprocess:$,cancelSignal:Z,gracefulCancel:X,forceKillAfterDelay:J,context:q,controller:Y})=>X?[JY({subprocess:$,cancelSignal:Z,forceKillAfterDelay:J,context:q,controller:Y})]:[],JY=async({subprocess:$,cancelSignal:Z,forceKillAfterDelay:X,context:J,controller:{signal:q}})=>{await s$(Z,q);let Y=QY(Z);throw await n8($,Y),b2({kill:$.kill,forceKillAfterDelay:X,context:J,controllerSignal:q}),J.terminationReason??="gracefulCancel",Z.reason},QY=({reason:$})=>{if(!($ instanceof DOMException))return $;let Z=Error($.message);return Object.defineProperty(Z,"stack",{value:$.stack,enumerable:!1,configurable:!0,writable:!0}),Z};import{setTimeout as qY}from"node:timers/promises";var r8=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},s8=($,Z,X,J)=>Z===0||Z===void 0?[]:[YY($,Z,X,J)],YY=async($,Z,X,{signal:J})=>{throw await qY(Z,void 0,{signal:J}),X.terminationReason??="timeout",$.kill(),new n0};import{execPath as GY,execArgv as HY}from"node:process";import e8 from"node:path";var $5=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},Z5=($,Z,{node:X=!1,nodePath:J=GY,nodeOptions:q=HY.filter((H)=>!H.startsWith("--inspect")),cwd:Y,execPath:Q,...G})=>{if(Q!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let H=c1(J,'The "nodePath" option'),K=e8.resolve(Y,H),W={...G,nodePath:K,node:X,cwd:Y};if(!X)return[$,Z,W];if(e8.basename($,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[K,[...q,$,...Z],{ipc:!0,...W,shell:!1}]};import{serialize as zY}from"node:v8";var X5=({ipcInput:$,ipc:Z,serialization:X})=>{if($===void 0)return;if(!Z)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");UY[X]($)},KY=($)=>{try{zY($)}catch(Z){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:Z})}},BY=($)=>{try{JSON.stringify($)}catch(Z){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:Z})}},UY={advanced:KY,json:BY},J5=async($,Z)=>{if(Z===void 0)return;await $.sendMessage(Z)};var q5=({encoding:$})=>{if(l2.has($))return;let Z=VY($);if(Z!==void 0)throw TypeError(`Invalid option \`encoding: ${B4($)}\`.
26
26
  Please rename it to ${B4(Z)}.`);let X=[...l2].map((J)=>B4(J)).join(", ");throw TypeError(`Invalid option \`encoding: ${B4($)}\`.
27
- Please rename it to one of: ${X}.`)},KY=new Set(["utf8","utf16le"]),j0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),l2=new Set([...KY,...j0]),BY=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let Z=$.toLowerCase();if(Z in Q5)return Q5[Z];if(l2.has(Z))return Z},Q5={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},B4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as UY}from"node:fs";import WY from"node:path";import VY from"node:process";var Y5=($=G5())=>{let Z=c1($,'The "cwd" option');return WY.resolve(Z)},G5=()=>{try{return VY.cwd()}catch($){throw $.message=`The current directory does not exist.
28
- ${$.message}`,$}},H5=($,Z)=>{if(Z===G5())return $;let X;try{X=UY(Z)}catch(J){return`The "cwd" option is invalid: ${Z}.
27
+ Please rename it to one of: ${X}.`)},WY=new Set(["utf8","utf16le"]),j0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),l2=new Set([...WY,...j0]),VY=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let Z=$.toLowerCase();if(Z in Q5)return Q5[Z];if(l2.has(Z))return Z},Q5={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},B4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as LY}from"node:fs";import _Y from"node:path";import RY from"node:process";var Y5=($=G5())=>{let Z=c1($,'The "cwd" option');return _Y.resolve(Z)},G5=()=>{try{return RY.cwd()}catch($){throw $.message=`The current directory does not exist.
28
+ ${$.message}`,$}},H5=($,Z)=>{if(Z===G5())return $;let X;try{X=LY(Z)}catch(J){return`The "cwd" option is invalid: ${Z}.
29
29
  ${J.message}
30
30
  ${$}`}if(!X.isDirectory())return`The "cwd" option is not a directory: ${Z}.
31
- ${$}`;return $};var U4=($,Z,X)=>{X.cwd=Y5(X.cwd);let[J,q,Y]=Z5($,Z,X),{command:Q,args:G,options:H}=K5.default._parse(J,q,Y),K=a6(H),W=_Y(K);if(r8(W),q5(W),X5(W),T8(W),o8(W),W.shell=_2(W.shell),W.env=RY(W),W.killSignal=W8(W.killSignal),W.forceKillAfterDelay=_8(W.forceKillAfterDelay),W.lines=W.lines.map((U,B)=>U&&!j0.has(W.encoding)&&W.buffer[B]),z5.platform==="win32"&&LY.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:W}},_Y=({extendEnv:$=!0,preferLocal:Z=!1,cwd:X,localDir:J=X,encoding:q="utf8",reject:Y=!0,cleanup:Q=!0,all:G=!1,windowsHide:H=!0,killSignal:K="SIGTERM",forceKillAfterDelay:W=!0,gracefulCancel:U=!1,ipcInput:B,ipc:R=B!==void 0||U,serialization:_="advanced",...L})=>({...L,extendEnv:$,preferLocal:Z,cwd:X,localDirectory:J,encoding:q,reject:Y,cleanup:Q,all:G,windowsHide:H,killSignal:K,forceKillAfterDelay:W,gracefulCancel:U,ipcInput:B,ipc:R,serialization:_}),RY=({env:$,extendEnv:Z,preferLocal:X,node:J,localDirectory:q,nodePath:Y})=>{let Q=Z?{...z5.env,...$}:$;if(X||J)return J8({env:Q,cwd:q,execPath:Y,preferLocal:X,addExecPath:J});return Q};var W4=($,Z,X)=>X.shell&&Z.length>0?[[$,...Z].join(" "),[],X]:[$,Z,X];import{inspect as rY}from"node:util";function a1($){if(typeof $==="string")return TY($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return FY($)}var TY=($)=>$.at(-1)===B5?$.slice(0,$.at(-2)===U5?-2:-1):$,FY=($)=>$.at(-1)===MY?$.subarray(0,$.at(-2)===CY?-2:-1):$,B5=`
32
- `,MY=B5.codePointAt(0),U5="\r",CY=U5.codePointAt(0);import{on as iY}from"node:events";import{finished as tY}from"node:stream/promises";function u0($,{checkOpen:Z=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!Z||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function n2($,{checkOpen:Z=!0}={}){return u0($,{checkOpen:Z})&&($.writable||!Z)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function P1($,{checkOpen:Z=!0}={}){return u0($,{checkOpen:Z})&&($.readable||!Z)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function i2($,Z){return n2($,Z)&&P1($,Z)}var PY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class W5{#Z;#X;#$=!1;#J=void 0;constructor($,Z){this.#Z=$,this.#X=Z}next(){let $=()=>this.#q();return this.#J=this.#J?this.#J.then($,$):$(),this.#J}return($){let Z=()=>this.#Q($);return this.#J?this.#J.then(Z,Z):Z()}async#q(){if(this.#$)return{done:!0,value:void 0};let $;try{$=await this.#Z.read()}catch(Z){throw this.#J=void 0,this.#$=!0,this.#Z.releaseLock(),Z}return $.done&&(this.#J=void 0,this.#$=!0,this.#Z.releaseLock()),$}async#Q($){if(this.#$)return{done:!0,value:$};if(this.#$=!0,!this.#X){let Z=this.#Z.cancel($);return this.#Z.releaseLock(),await Z,{done:!0,value:$}}return this.#Z.releaseLock(),{done:!0,value:$}}}var t2=Symbol();function V5(){return this[t2].next()}Object.defineProperty(V5,"name",{value:"next"});function L5($){return this[t2].return($)}Object.defineProperty(L5,"name",{value:"return"});var xY=Object.create(PY,{next:{enumerable:!0,configurable:!0,writable:!0,value:V5},return:{enumerable:!0,configurable:!0,writable:!0,value:L5}});function o2({preventCancel:$=!1}={}){let Z=this.getReader(),X=new W5(Z,$),J=Object.create(xY);return J[t2]=X,J}var _5=($)=>{if(P1($,{checkOpen:!1})&&L$.on!==void 0)return IY($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(jY.call($)==="[object ReadableStream]")return o2.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:jY}=Object.prototype,IY=async function*($){let Z=new AbortController,X={};wY($,Z,X);try{for await(let[J]of L$.on($,"data",{signal:Z.signal}))yield J}catch(J){if(X.error!==void 0)throw X.error;else if(!Z.signal.aborted)throw J}finally{$.destroy()}},wY=async($,Z,X)=>{try{await L$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(J){X.error=J}finally{Z.abort()}},L$={};var r1=async($,{init:Z,convertChunk:X,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let K=_5($),W=Z();W.length=0;try{for await(let U of K){let B=EY(U),R=X[B](U,W);F5({convertedChunk:R,state:W,getSize:J,truncateChunk:q,addChunk:Y,maxBuffer:H})}return OY({state:W,convertChunk:X,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,maxBuffer:H}),G(W)}catch(U){let B=typeof U==="object"&&U!==null?U:Error(U);throw B.bufferedData=G(W),B}},OY=({state:$,getSize:Z,truncateChunk:X,addChunk:J,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)F5({convertedChunk:Q,state:$,getSize:Z,truncateChunk:X,addChunk:J,maxBuffer:Y})},F5=({convertedChunk:$,state:Z,getSize:X,truncateChunk:J,addChunk:q,maxBuffer:Y})=>{let Q=X($),G=Z.length+Q;if(G<=Y){R5($,Z,q,G);return}let H=J($,Y-Z.length);if(H!==void 0)R5(H,Z,q,Y);throw new J1},R5=($,Z,X,J)=>{Z.contents=X($,Z,J),Z.length=J},EY=($)=>{let Z=typeof $;if(Z==="string")return"string";if(Z!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let X=T5.call($);if(X==="[object ArrayBuffer]")return"arrayBuffer";if(X==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&T5.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:T5}=Object.prototype;class J1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var Q1=($)=>$,_$=()=>{return},V4=({contents:$})=>$,L4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},_4=($)=>$.length;async function R4($,Z){return r1($,DY,Z)}var AY=()=>({contents:[]}),hY=()=>1,NY=($,{contents:Z})=>{return Z.push($),Z},DY={init:AY,convertChunk:{string:Q1,buffer:Q1,arrayBuffer:Q1,dataView:Q1,typedArray:Q1,others:Q1},getSize:hY,truncateChunk:_$,addChunk:NY,getFinalChunk:_$,finalize:V4};async function T4($,Z){return r1($,mY,Z)}var SY=()=>({contents:new ArrayBuffer(0)}),vY=($)=>fY.encode($),fY=new TextEncoder,M5=($)=>new Uint8Array($),C5=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),kY=($,Z)=>$.slice(0,Z),bY=($,{contents:Z,length:X},J)=>{let q=j5()?gY(Z,J):yY(Z,J);return new Uint8Array(q).set($,X),q},yY=($,Z)=>{if(Z<=$.byteLength)return $;let X=new ArrayBuffer(x5(Z));return new Uint8Array(X).set(new Uint8Array($),0),X},gY=($,Z)=>{if(Z<=$.maxByteLength)return $.resize(Z),$;let X=new ArrayBuffer(Z,{maxByteLength:x5(Z)});return new Uint8Array(X).set(new Uint8Array($),0),X},x5=($)=>P5**Math.ceil(Math.log($)/Math.log(P5)),P5=2,uY=({contents:$,length:Z})=>j5()?$:$.slice(0,Z),j5=()=>("resize"in ArrayBuffer.prototype),mY={init:SY,convertChunk:{string:vY,buffer:M5,arrayBuffer:M5,dataView:C5,typedArray:C5,others:L4},getSize:_4,truncateChunk:kY,addChunk:bY,getFinalChunk:_$,finalize:uY};async function M4($,Z){return r1($,nY,Z)}var cY=()=>({contents:"",textDecoder:new TextDecoder}),F4=($,{textDecoder:Z})=>Z.decode($,{stream:!0}),pY=($,{contents:Z})=>Z+$,dY=($,Z)=>$.slice(0,Z),lY=({textDecoder:$})=>{let Z=$.decode();return Z===""?void 0:Z},nY={init:cY,convertChunk:{string:Q1,buffer:F4,arrayBuffer:F4,dataView:F4,typedArray:F4,others:L4},getSize:_4,truncateChunk:dY,addChunk:pY,getFinalChunk:lY,finalize:V4};Object.assign(L$,{on:iY,finished:tY});var I5=({error:$,stream:Z,readableObjectMode:X,lines:J,encoding:q,fdNumber:Y})=>{if(!($ instanceof J1))throw $;if(Y==="all")return $;let Q=oY(X,J,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},Z.destroy(),$},oY=($,Z,X)=>{if($)return"objects";if(Z)return"lines";if(X==="buffer")return"bytes";return"characters"},w5=($,Z,X)=>{if(Z.length!==X)return;let J=new J1;throw J.maxBufferInfo={fdNumber:"ipc"},J},O5=($,Z)=>{let{streamName:X,threshold:J,unit:q}=aY($,Z);return`Command's ${X} was larger than ${J} ${q}`},aY=($,Z)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:Z[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:X,unit:J}}=$;delete $.maxBufferInfo;let q=X1(Z,X);if(X==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:f$(X),threshold:q,unit:J}},E5=($,Z,X)=>$?.code==="ENOBUFS"&&Z!==null&&Z.some((J)=>J!==null&&J.length>C4(X)),A5=($,Z,X)=>{if(!Z)return $;let J=C4(X);return $.length>J?$.slice(0,J):$},C4=([,$])=>$;var N5=({stdio:$,all:Z,ipcOutput:X,originalError:J,signal:q,signalDescription:Y,exitCode:Q,escapedCommand:G,timedOut:H,isCanceled:K,isGracefullyCanceled:W,isMaxBuffer:U,isForcefullyTerminated:B,forceKillAfterDelay:R,killSignal:_,maxBuffer:L,timeout:j,cwd:C})=>{let N=J?.code,c=sY({originalError:J,timedOut:H,timeout:j,isMaxBuffer:U,maxBuffer:L,errorCode:N,signal:q,signalDescription:Y,exitCode:Q,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:B,forceKillAfterDelay:R,killSignal:_}),I=$G(J,C),n=I===void 0?"":`
33
- ${I}`,i=`${c}: ${G}${n}`,a=Z===void 0?[$[2],$[1]]:[Z],K0=[i,...a,...$.slice(3),X.map((l)=>ZG(l)).join(`
34
- `)].map((l)=>B$(a1(XG(l)))).filter(Boolean).join(`
31
+ ${$}`;return $};var U4=($,Z,X)=>{X.cwd=Y5(X.cwd);let[J,q,Y]=Z5($,Z,X),{command:Q,args:G,options:H}=K5.default._parse(J,q,Y),K=a6(H),W=FY(K);if(r8(W),q5(W),X5(W),T8(W),o8(W),W.shell=_2(W.shell),W.env=MY(W),W.killSignal=W8(W.killSignal),W.forceKillAfterDelay=_8(W.forceKillAfterDelay),W.lines=W.lines.map((U,B)=>U&&!j0.has(W.encoding)&&W.buffer[B]),z5.platform==="win32"&&TY.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:W}},FY=({extendEnv:$=!0,preferLocal:Z=!1,cwd:X,localDir:J=X,encoding:q="utf8",reject:Y=!0,cleanup:Q=!0,all:G=!1,windowsHide:H=!0,killSignal:K="SIGTERM",forceKillAfterDelay:W=!0,gracefulCancel:U=!1,ipcInput:B,ipc:R=B!==void 0||U,serialization:_="advanced",...L})=>({...L,extendEnv:$,preferLocal:Z,cwd:X,localDirectory:J,encoding:q,reject:Y,cleanup:Q,all:G,windowsHide:H,killSignal:K,forceKillAfterDelay:W,gracefulCancel:U,ipcInput:B,ipc:R,serialization:_}),MY=({env:$,extendEnv:Z,preferLocal:X,node:J,localDirectory:q,nodePath:Y})=>{let Q=Z?{...z5.env,...$}:$;if(X||J)return J8({env:Q,cwd:q,execPath:Y,preferLocal:X,addExecPath:J});return Q};var W4=($,Z,X)=>X.shell&&Z.length>0?[[$,...Z].join(" "),[],X]:[$,Z,X];import{inspect as $G}from"node:util";function a1($){if(typeof $==="string")return CY($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return PY($)}var CY=($)=>$.at(-1)===B5?$.slice(0,$.at(-2)===U5?-2:-1):$,PY=($)=>$.at(-1)===xY?$.subarray(0,$.at(-2)===jY?-2:-1):$,B5=`
32
+ `,xY=B5.codePointAt(0),U5="\r",jY=U5.codePointAt(0);import{on as aY}from"node:events";import{finished as rY}from"node:stream/promises";function u0($,{checkOpen:Z=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!Z||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function n2($,{checkOpen:Z=!0}={}){return u0($,{checkOpen:Z})&&($.writable||!Z)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function C1($,{checkOpen:Z=!0}={}){return u0($,{checkOpen:Z})&&($.readable||!Z)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function i2($,Z){return n2($,Z)&&C1($,Z)}var IY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class W5{#Z;#X;#$=!1;#J=void 0;constructor($,Z){this.#Z=$,this.#X=Z}next(){let $=()=>this.#q();return this.#J=this.#J?this.#J.then($,$):$(),this.#J}return($){let Z=()=>this.#Q($);return this.#J?this.#J.then(Z,Z):Z()}async#q(){if(this.#$)return{done:!0,value:void 0};let $;try{$=await this.#Z.read()}catch(Z){throw this.#J=void 0,this.#$=!0,this.#Z.releaseLock(),Z}return $.done&&(this.#J=void 0,this.#$=!0,this.#Z.releaseLock()),$}async#Q($){if(this.#$)return{done:!0,value:$};if(this.#$=!0,!this.#X){let Z=this.#Z.cancel($);return this.#Z.releaseLock(),await Z,{done:!0,value:$}}return this.#Z.releaseLock(),{done:!0,value:$}}}var t2=Symbol();function V5(){return this[t2].next()}Object.defineProperty(V5,"name",{value:"next"});function L5($){return this[t2].return($)}Object.defineProperty(L5,"name",{value:"return"});var wY=Object.create(IY,{next:{enumerable:!0,configurable:!0,writable:!0,value:V5},return:{enumerable:!0,configurable:!0,writable:!0,value:L5}});function o2({preventCancel:$=!1}={}){let Z=this.getReader(),X=new W5(Z,$),J=Object.create(wY);return J[t2]=X,J}var _5=($)=>{if(C1($,{checkOpen:!1})&&L$.on!==void 0)return EY($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(OY.call($)==="[object ReadableStream]")return o2.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:OY}=Object.prototype,EY=async function*($){let Z=new AbortController,X={};AY($,Z,X);try{for await(let[J]of L$.on($,"data",{signal:Z.signal}))yield J}catch(J){if(X.error!==void 0)throw X.error;else if(!Z.signal.aborted)throw J}finally{$.destroy()}},AY=async($,Z,X)=>{try{await L$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(J){X.error=J}finally{Z.abort()}},L$={};var r1=async($,{init:Z,convertChunk:X,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let K=_5($),W=Z();W.length=0;try{for await(let U of K){let B=NY(U),R=X[B](U,W);F5({convertedChunk:R,state:W,getSize:J,truncateChunk:q,addChunk:Y,maxBuffer:H})}return hY({state:W,convertChunk:X,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,maxBuffer:H}),G(W)}catch(U){let B=typeof U==="object"&&U!==null?U:Error(U);throw B.bufferedData=G(W),B}},hY=({state:$,getSize:Z,truncateChunk:X,addChunk:J,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)F5({convertedChunk:Q,state:$,getSize:Z,truncateChunk:X,addChunk:J,maxBuffer:Y})},F5=({convertedChunk:$,state:Z,getSize:X,truncateChunk:J,addChunk:q,maxBuffer:Y})=>{let Q=X($),G=Z.length+Q;if(G<=Y){R5($,Z,q,G);return}let H=J($,Y-Z.length);if(H!==void 0)R5(H,Z,q,Y);throw new X1},R5=($,Z,X,J)=>{Z.contents=X($,Z,J),Z.length=J},NY=($)=>{let Z=typeof $;if(Z==="string")return"string";if(Z!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let X=T5.call($);if(X==="[object ArrayBuffer]")return"arrayBuffer";if(X==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&T5.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:T5}=Object.prototype;class X1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var J1=($)=>$,_$=()=>{return},V4=({contents:$})=>$,L4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},_4=($)=>$.length;async function R4($,Z){return r1($,fY,Z)}var DY=()=>({contents:[]}),SY=()=>1,vY=($,{contents:Z})=>{return Z.push($),Z},fY={init:DY,convertChunk:{string:J1,buffer:J1,arrayBuffer:J1,dataView:J1,typedArray:J1,others:J1},getSize:SY,truncateChunk:_$,addChunk:vY,getFinalChunk:_$,finalize:V4};async function T4($,Z){return r1($,dY,Z)}var kY=()=>({contents:new ArrayBuffer(0)}),bY=($)=>yY.encode($),yY=new TextEncoder,M5=($)=>new Uint8Array($),C5=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),gY=($,Z)=>$.slice(0,Z),uY=($,{contents:Z,length:X},J)=>{let q=j5()?cY(Z,J):mY(Z,J);return new Uint8Array(q).set($,X),q},mY=($,Z)=>{if(Z<=$.byteLength)return $;let X=new ArrayBuffer(x5(Z));return new Uint8Array(X).set(new Uint8Array($),0),X},cY=($,Z)=>{if(Z<=$.maxByteLength)return $.resize(Z),$;let X=new ArrayBuffer(Z,{maxByteLength:x5(Z)});return new Uint8Array(X).set(new Uint8Array($),0),X},x5=($)=>P5**Math.ceil(Math.log($)/Math.log(P5)),P5=2,pY=({contents:$,length:Z})=>j5()?$:$.slice(0,Z),j5=()=>("resize"in ArrayBuffer.prototype),dY={init:kY,convertChunk:{string:bY,buffer:M5,arrayBuffer:M5,dataView:C5,typedArray:C5,others:L4},getSize:_4,truncateChunk:gY,addChunk:uY,getFinalChunk:_$,finalize:pY};async function M4($,Z){return r1($,oY,Z)}var lY=()=>({contents:"",textDecoder:new TextDecoder}),F4=($,{textDecoder:Z})=>Z.decode($,{stream:!0}),nY=($,{contents:Z})=>Z+$,iY=($,Z)=>$.slice(0,Z),tY=({textDecoder:$})=>{let Z=$.decode();return Z===""?void 0:Z},oY={init:lY,convertChunk:{string:J1,buffer:F4,arrayBuffer:F4,dataView:F4,typedArray:F4,others:L4},getSize:_4,truncateChunk:iY,addChunk:nY,getFinalChunk:tY,finalize:V4};Object.assign(L$,{on:aY,finished:rY});var I5=({error:$,stream:Z,readableObjectMode:X,lines:J,encoding:q,fdNumber:Y})=>{if(!($ instanceof X1))throw $;if(Y==="all")return $;let Q=sY(X,J,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},Z.destroy(),$},sY=($,Z,X)=>{if($)return"objects";if(Z)return"lines";if(X==="buffer")return"bytes";return"characters"},w5=($,Z,X)=>{if(Z.length!==X)return;let J=new X1;throw J.maxBufferInfo={fdNumber:"ipc"},J},O5=($,Z)=>{let{streamName:X,threshold:J,unit:q}=eY($,Z);return`Command's ${X} was larger than ${J} ${q}`},eY=($,Z)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:Z[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:X,unit:J}}=$;delete $.maxBufferInfo;let q=Z1(Z,X);if(X==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:f$(X),threshold:q,unit:J}},E5=($,Z,X)=>$?.code==="ENOBUFS"&&Z!==null&&Z.some((J)=>J!==null&&J.length>C4(X)),A5=($,Z,X)=>{if(!Z)return $;let J=C4(X);return $.length>J?$.slice(0,J):$},C4=([,$])=>$;var N5=({stdio:$,all:Z,ipcOutput:X,originalError:J,signal:q,signalDescription:Y,exitCode:Q,escapedCommand:G,timedOut:H,isCanceled:K,isGracefullyCanceled:W,isMaxBuffer:U,isForcefullyTerminated:B,forceKillAfterDelay:R,killSignal:_,maxBuffer:L,timeout:j,cwd:C})=>{let N=J?.code,c=ZG({originalError:J,timedOut:H,timeout:j,isMaxBuffer:U,maxBuffer:L,errorCode:N,signal:q,signalDescription:Y,exitCode:Q,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:B,forceKillAfterDelay:R,killSignal:_}),I=JG(J,C),n=I===void 0?"":`
33
+ ${I}`,i=`${c}: ${G}${n}`,a=Z===void 0?[$[2],$[1]]:[Z],K0=[i,...a,...$.slice(3),X.map((l)=>QG(l)).join(`
34
+ `)].map((l)=>B$(a1(qG(l)))).filter(Boolean).join(`
35
35
 
36
- `);return{originalMessage:I,shortMessage:i,message:K0}},sY=({originalError:$,timedOut:Z,timeout:X,isMaxBuffer:J,maxBuffer:q,errorCode:Y,signal:Q,signalDescription:G,exitCode:H,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:U,forceKillAfterDelay:B,killSignal:R})=>{let _=eY(U,B);if(Z)return`Command timed out after ${X} milliseconds${_}`;if(W){if(Q===void 0)return`Command was gracefully canceled with exit code ${H}`;return U?`Command was gracefully canceled${_}`:`Command was gracefully canceled with ${Q} (${G})`}if(K)return`Command was canceled${_}`;if(J)return`${O5($,q)}${_}`;if(Y!==void 0)return`Command failed with ${Y}${_}`;if(U)return`Command was killed with ${R} (${r$(R)})${_}`;if(Q!==void 0)return`Command was killed with ${Q} (${G})`;if(H!==void 0)return`Command failed with exit code ${H}`;return"Command failed"},eY=($,Z)=>$?` and was forcefully terminated after ${Z} milliseconds`:"",$G=($,Z)=>{if($ instanceof n0)return;let X=Y8($)?$.originalMessage:String($?.message??$),J=B$(H5(X,Z));return J===""?void 0:J},ZG=($)=>typeof $==="string"?$:rY($),XG=($)=>Array.isArray($)?$.map((Z)=>a1(h5(Z))).filter(Boolean).join(`
37
- `):h5($),h5=($)=>{if(typeof $==="string")return $;if(L0($))return S$($);return""};var P4=({command:$,escapedCommand:Z,stdio:X,all:J,ipcOutput:q,options:{cwd:Y},startTime:Q})=>D5({command:$,escapedCommand:Z,cwd:Y,durationMs:j2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:X[1],stderr:X[2],all:J,stdio:X,ipcOutput:q,pipedFrom:[]}),s1=({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,isSync:Q})=>R$({error:$,command:Z,escapedCommand:X,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:J.length}),ipcOutput:[],options:q,isSync:Q}),R$=({error:$,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,stdio:U,all:B,ipcOutput:R,options:{timeoutDuration:_,timeout:L=_,forceKillAfterDelay:j,killSignal:C,cwd:N,maxBuffer:c},isSync:I})=>{let{exitCode:n,signal:i,signalDescription:a}=QG(K,W),{originalMessage:K0,shortMessage:l,message:x0}=N5({stdio:U,all:B,ipcOutput:R,originalError:$,signal:i,signalDescription:a,exitCode:n,escapedCommand:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:j,killSignal:C,maxBuffer:c,timeout:L,cwd:N}),E=Q8($,x0,I);return Object.assign(E,JG({error:E,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:n,signal:i,signalDescription:a,stdio:U,all:B,ipcOutput:R,cwd:N,originalMessage:K0,shortMessage:l})),E},JG=({error:$,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:U,stdio:B,all:R,ipcOutput:_,cwd:L,originalMessage:j,shortMessage:C})=>D5({shortMessage:C,originalMessage:j,command:Z,escapedCommand:X,cwd:L,durationMs:j2(J),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:W!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:U,code:$.cause?.code,stdout:B[1],stderr:B[2],all:R,stdio:B,ipcOutput:_,pipedFrom:[]}),D5=($)=>Object.fromEntries(Object.entries($).filter(([,Z])=>Z!==void 0)),QG=($,Z)=>{let X=$===null?void 0:$,J=Z===null?void 0:Z,q=J===void 0?void 0:r$(Z);return{exitCode:X,signal:J,signalDescription:q}};var S5=($)=>Number.isFinite($)?$:0;function qG($){return{days:Math.trunc($/86400000),hours:Math.trunc($/3600000%24),minutes:Math.trunc($/60000%60),seconds:Math.trunc($/1000%60),milliseconds:Math.trunc($%1000),microseconds:Math.trunc(S5($*1000)%1000),nanoseconds:Math.trunc(S5($*1e6)%1000)}}function YG($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function a2($){switch(typeof $){case"number":{if(Number.isFinite($))return qG($);break}case"bigint":return YG($)}throw TypeError("Expected a finite number or bigint")}var GG=($)=>$===0||$===0n,HG=($,Z)=>Z===1||Z===1n?$:`${$}s`,zG=0.0000001,KG=24n*60n*60n*1000n;function r2($,Z){let X=typeof $==="bigint";if(!X&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");Z={...Z};let J=$<0?"-":"";if($=$<0?-$:$,Z.colonNotation)Z.compact=!1,Z.formatSubMilliseconds=!1,Z.separateMilliseconds=!1,Z.verbose=!1;if(Z.compact)Z.unitCount=1,Z.secondsDecimalDigits=0,Z.millisecondsDecimalDigits=0;let q=[],Y=(W,U)=>{let B=Math.floor(W*10**U+zG);return(Math.round(B)/10**U).toFixed(U)},Q=(W,U,B,R)=>{if((q.length===0||!Z.colonNotation)&&GG(W)&&!(Z.colonNotation&&B==="m"))return;if(R??=String(W),Z.colonNotation){let _=R.includes(".")?R.split(".")[0].length:R.length,L=q.length>0?2:1;R="0".repeat(Math.max(0,L-_))+R}else R+=Z.verbose?" "+HG(U,W):B;q.push(R)},G=a2($),H=BigInt(G.days);if(Z.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(Z.hideYear)Q(H,"day","d");else Q(H/365n,"year","y"),Q(H%365n,"day","d");Q(Number(G.hours),"hour","h")}if(Q(Number(G.minutes),"minute","m"),!Z.hideSeconds)if(Z.separateMilliseconds||Z.formatSubMilliseconds||!Z.colonNotation&&$<1000&&!Z.subSecondsAsDecimals){let W=Number(G.seconds),U=Number(G.milliseconds),B=Number(G.microseconds),R=Number(G.nanoseconds);if(Q(W,"second","s"),Z.formatSubMilliseconds)Q(U,"millisecond","ms"),Q(B,"microsecond","µs"),Q(R,"nanosecond","ns");else{let _=U+B/1000+R/1e6,L=typeof Z.millisecondsDecimalDigits==="number"?Z.millisecondsDecimalDigits:0,j=_>=1?Math.round(_):Math.ceil(_),C=L?_.toFixed(L):j;Q(Number.parseFloat(C),"millisecond","ms",C)}}else{let W=(X?Number($%KG):$)/1000%60,U=typeof Z.secondsDecimalDigits==="number"?Z.secondsDecimalDigits:1,B=Y(W,U),R=Z.keepDecimalsOnWholeSeconds?B:B.replace(/\.0+$/,"");Q(Number.parseFloat(R),"second","s",R)}if(q.length===0)return J+"0"+(Z.verbose?" milliseconds":"ms");let K=Z.colonNotation?":":" ";if(typeof Z.unitCount==="number")q=q.slice(0,Math.max(Z.unitCount,1));return J+q.join(K)}var v5=($,Z)=>{if($.failed)l0({type:"error",verboseMessage:$.shortMessage,verboseInfo:Z,result:$})};var f5=($,Z)=>{if(!p1(Z))return;v5($,Z),BG($,Z)},BG=($,Z)=>{let X=`(done in ${r2($.durationMs)})`;l0({type:"duration",verboseMessage:X,verboseInfo:Z,result:$})};var e1=($,Z,{reject:X})=>{if(f5($,Z),$.failed&&X)throw $;return $};import{readFileSync as HZ}from"node:fs";var y5=($,Z)=>{if(x1($))return"asyncGenerator";if(m5($))return"generator";if(x4($))return"fileUrl";if(_G($))return"filePath";if(FG($))return"webStream";if(u0($,{checkOpen:!1}))return"native";if(L0($))return"uint8Array";if(MG($))return"asyncIterable";if(CG($))return"iterable";if($3($))return g5({transform:$},Z);if(LG($))return UG($,Z);return"native"},UG=($,Z)=>{if(i2($.transform,{checkOpen:!1}))return WG($,Z);if($3($.transform))return g5($,Z);return VG($,Z)},WG=($,Z)=>{return u5($,Z,"Duplex stream"),"duplex"},g5=($,Z)=>{return u5($,Z,"web TransformStream"),"webTransform"},u5=({final:$,binary:Z,objectMode:X},J,q)=>{k5($,`${J}.final`,q),k5(Z,`${J}.binary`,q),s2(X,`${J}.objectMode`)},k5=($,Z,X)=>{if($!==void 0)throw TypeError(`The \`${Z}\` option can only be defined when using a generator, not a ${X}.`)},VG=({transform:$,final:Z,binary:X,objectMode:J},q)=>{if($!==void 0&&!b5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(i2(Z,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if($3(Z))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(Z!==void 0&&!b5(Z))throw TypeError(`The \`${q}.final\` option must be a generator.`);return s2(X,`${q}.binary`),s2(J,`${q}.objectMode`),x1($)||x1(Z)?"asyncGenerator":"generator"},s2=($,Z)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${Z}\` option must use a boolean.`)},b5=($)=>x1($)||m5($),x1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",m5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",LG=($)=>Y0($)&&($.transform!==void 0||$.final!==void 0),x4=($)=>Object.prototype.toString.call($)==="[object URL]",c5=($)=>x4($)&&$.protocol!=="file:",_G=($)=>Y0($)&&Object.keys($).length>0&&Object.keys($).every((Z)=>RG.has(Z))&&e2($.file),RG=new Set(["file","append"]),e2=($)=>typeof $==="string",p5=($,Z)=>$==="native"&&typeof Z==="string"&&!TG.has(Z),TG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),d5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",j4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",FG=($)=>d5($)||j4($),$3=($)=>d5($?.readable)&&j4($?.writable),MG=($)=>l5($)&&typeof $[Symbol.asyncIterator]==="function",CG=($)=>l5($)&&typeof $[Symbol.iterator]==="function",l5=($)=>typeof $==="object"&&$!==null,D0=new Set(["generator","asyncGenerator","duplex","webTransform"]),I4=new Set(["fileUrl","filePath","fileNumber"]),Z3=new Set(["fileUrl","filePath"]),n5=new Set([...Z3,"webStream","nodeStream"]),i5=new Set(["webTransform","duplex"]),K1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var X3=($,Z,X,J)=>J==="output"?PG($,Z,X):xG($,Z,X),PG=($,Z,X)=>{let J=Z!==0&&X[Z-1].value.readableObjectMode;return{writableObjectMode:J,readableObjectMode:$??J}},xG=($,Z,X)=>{let J=Z===0?$===!0:X[Z-1].value.readableObjectMode,q=Z!==X.length-1&&($??J);return{writableObjectMode:J,readableObjectMode:q}},t5=($,Z)=>{let X=$.findLast(({type:J})=>D0.has(J));if(X===void 0)return!1;return Z==="input"?X.value.writableObjectMode:X.value.readableObjectMode};var o5=($,Z,X,J)=>[...$.filter(({type:q})=>!D0.has(q)),...jG($,Z,X,J)],jG=($,Z,X,{encoding:J})=>{let q=$.filter(({type:Q})=>D0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=IG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:Z,direction:X,encoding:J});return AG(Y,X)},IG=({stdioItem:$,stdioItem:{type:Z},index:X,newTransforms:J,optionName:q,direction:Y,encoding:Q})=>{if(Z==="duplex")return wG({stdioItem:$,optionName:q});if(Z==="webTransform")return OG({stdioItem:$,index:X,newTransforms:J,direction:Y});return EG({stdioItem:$,index:X,newTransforms:J,direction:Y,encoding:Q})},wG=({stdioItem:$,stdioItem:{value:{transform:Z,transform:{writableObjectMode:X,readableObjectMode:J},objectMode:q=J}},optionName:Y})=>{if(q&&!J)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&J)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:Z,writableObjectMode:X,readableObjectMode:J}}},OG=({stdioItem:$,stdioItem:{value:Z},index:X,newTransforms:J,direction:q})=>{let{transform:Y,objectMode:Q}=Y0(Z)?Z:{transform:Z},{writableObjectMode:G,readableObjectMode:H}=X3(Q,X,J,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},EG=({stdioItem:$,stdioItem:{value:Z},index:X,newTransforms:J,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:K=!1,objectMode:W}=Y0(Z)?Z:{transform:Z},U=H||j0.has(Y),{writableObjectMode:B,readableObjectMode:R}=X3(W,X,J,q);return{...$,value:{transform:Q,final:G,binary:U,preserveNewlines:K,writableObjectMode:B,readableObjectMode:R}}},AG=($,Z)=>Z==="input"?$.reverse():$;import J3 from"node:process";var a5=($,Z,X)=>{let J=$.map((q)=>hG(q,Z));if(J.includes("input")&&J.includes("output"))throw TypeError(`The \`${X}\` option must not be an array of both readable and writable values.`);return J.find(Boolean)??SG},hG=({type:$,value:Z},X)=>NG[X]??r5[$](Z),NG=["input","output","output"],$$=()=>{return},Q3=()=>"input",r5={generator:$$,asyncGenerator:$$,fileUrl:$$,filePath:$$,iterable:Q3,asyncIterable:Q3,uint8Array:Q3,webStream:($)=>j4($)?"output":"input",nodeStream($){if(!P1($,{checkOpen:!1}))return"output";return n2($,{checkOpen:!1})?void 0:"input"},webTransform:$$,duplex:$$,native($){let Z=DG($);if(Z!==void 0)return Z;if(u0($,{checkOpen:!1}))return r5.nodeStream($)}},DG=($)=>{if([0,J3.stdin].includes($))return"input";if([1,2,J3.stdout,J3.stderr].includes($))return"output"},SG="output";var s5=($,Z)=>Z&&!$.includes("ipc")?[...$,"ipc"]:$;var e5=({stdio:$,ipc:Z,buffer:X,...J},q,Y)=>{let Q=vG($,J).map((G,H)=>$Z(G,H));return Y?kG(Q,X,q):s5(Q,Z)},vG=($,Z)=>{if($===void 0)return N0.map((J)=>Z[J]);if(fG(Z))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N0.map((J)=>`\`${J}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let X=Math.max($.length,N0.length);return Array.from({length:X},(J,q)=>$[q])},fG=($)=>N0.some((Z)=>$[Z]!==void 0),$Z=($,Z)=>{if(Array.isArray($))return $.map((X)=>$Z(X,Z));if($===null||$===void 0)return Z>=N0.length?"ignore":"pipe";return $},kG=($,Z,X)=>$.map((J,q)=>!Z[q]&&q!==0&&!d1(X,q)&&bG(J)?"ignore":J),bG=($)=>$==="pipe"||Array.isArray($)&&$.every((Z)=>Z==="pipe");import{readFileSync as yG}from"node:fs";import gG from"node:tty";var XZ=({stdioItem:$,stdioItem:{type:Z},isStdioArray:X,fdNumber:J,direction:q,isSync:Y})=>{if(!X||Z!=="native")return $;return Y?uG({stdioItem:$,fdNumber:J,direction:q}):pG({stdioItem:$,fdNumber:J})},uG=({stdioItem:$,stdioItem:{value:Z,optionName:X},fdNumber:J,direction:q})=>{let Y=mG({value:Z,optionName:X,fdNumber:J,direction:q});if(Y!==void 0)return Y;if(u0(Z,{checkOpen:!1}))throw TypeError(`The \`${X}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},mG=({value:$,optionName:Z,fdNumber:X,direction:J})=>{let q=cG($,X);if(q===void 0)return;if(J==="output")return{type:"fileNumber",value:q,optionName:Z};if(gG.isatty(q))throw TypeError(`The \`${Z}: ${$4($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Z1(yG(q)),optionName:Z}},cG=($,Z)=>{if($==="inherit")return Z;if(typeof $==="number")return $;let X=v$.indexOf($);if(X!==-1)return X},pG=({stdioItem:$,stdioItem:{value:Z,optionName:X},fdNumber:J})=>{if(Z==="inherit")return{type:"nodeStream",value:ZZ(J,Z,X),optionName:X};if(typeof Z==="number")return{type:"nodeStream",value:ZZ(Z,Z,X),optionName:X};if(u0(Z,{checkOpen:!1}))return{type:"nodeStream",value:Z,optionName:X};return $},ZZ=($,Z,X)=>{let J=v$[$];if(J===void 0)throw TypeError(`The \`${X}: ${Z}\` option is invalid: no such standard stream.`);return J};var JZ=({input:$,inputFile:Z},X)=>X===0?[...dG($),...nG(Z)]:[],dG=($)=>$===void 0?[]:[{type:lG($),value:$,optionName:"input"}],lG=($)=>{if(P1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(L0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},nG=($)=>$===void 0?[]:[{...iG($),optionName:"inputFile"}],iG=($)=>{if(x4($))return{type:"fileUrl",value:$};if(e2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var QZ=($)=>$.filter((Z,X)=>$.every((J,q)=>Z.value!==J.value||X>=q||Z.type==="generator"||Z.type==="asyncGenerator")),qZ=({stdioItem:{type:$,value:Z,optionName:X},direction:J,fileDescriptors:q,isSync:Y})=>{let Q=tG(q,$);if(Q.length===0)return;if(Y){oG({otherStdioItems:Q,type:$,value:Z,optionName:X,direction:J});return}if(n5.has($))return YZ({otherStdioItems:Q,type:$,value:Z,optionName:X,direction:J});if(i5.has($))rG({otherStdioItems:Q,type:$,value:Z,optionName:X})},tG=($,Z)=>$.flatMap(({direction:X,stdioItems:J})=>J.filter((q)=>q.type===Z).map((q)=>({...q,direction:X}))),oG=({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})=>{if(Z3.has(Z))YZ({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})},YZ=({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})=>{let Y=$.filter((G)=>aG(G,X));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return GZ(Q,J,Z),q==="output"?Y[0].stream:void 0},aG=({type:$,value:Z},X)=>{if($==="filePath")return Z.file===X.file;if($==="fileUrl")return Z.href===X.href;return Z===X},rG=({otherStdioItems:$,type:Z,value:X,optionName:J})=>{let q=$.find(({value:{transform:Y}})=>Y===X.transform);GZ(q,J,Z)},GZ=($,Z,X)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${Z}\` options must not target ${K1[X]} that is the same.`)};var w4=($,Z,X,J)=>{let Y=e5(Z,X,J).map((G,H)=>sG({stdioOption:G,fdNumber:H,options:Z,isSync:J})),Q=YH({initialFileDescriptors:Y,addProperties:$,options:Z,isSync:J});return Z.stdio=Q.map(({stdioItems:G})=>zH(G)),Q},sG=({stdioOption:$,fdNumber:Z,options:X,isSync:J})=>{let q=f$(Z),{stdioItems:Y,isStdioArray:Q}=eG({stdioOption:$,fdNumber:Z,options:X,optionName:q}),G=a5(Y,Z,q),H=Y.map((U)=>XZ({stdioItem:U,isStdioArray:Q,fdNumber:Z,direction:G,isSync:J})),K=o5(H,q,G,X),W=t5(K,G);return qH(K,W),{direction:G,objectMode:W,stdioItems:K}},eG=({stdioOption:$,fdNumber:Z,options:X,optionName:J})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>$H(H,J)),...JZ(X,Z)],Q=QZ(Y),G=Q.length>1;return ZH(Q,G,J),JH(Q),{stdioItems:Q,isStdioArray:G}},$H=($,Z)=>({type:y5($,Z),value:$,optionName:Z}),ZH=($,Z,X)=>{if($.length===0)throw TypeError(`The \`${X}\` option must not be an empty array.`);if(!Z)return;for(let{value:J,optionName:q}of $)if(XH.has(J))throw Error(`The \`${q}\` option must not include \`${J}\`.`)},XH=new Set(["ignore","ipc"]),JH=($)=>{for(let Z of $)QH(Z)},QH=({type:$,value:Z,optionName:X})=>{if(c5(Z))throw TypeError(`The \`${X}: URL\` option must use the \`file:\` scheme.
38
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(p5($,Z))throw TypeError(`The \`${X}: { file: '...' }\` option must be used instead of \`${X}: '...'\`.`)},qH=($,Z)=>{if(!Z)return;let X=$.find(({type:J})=>I4.has(J));if(X!==void 0)throw TypeError(`The \`${X.optionName}\` option cannot use both files and transforms in objectMode.`)},YH=({initialFileDescriptors:$,addProperties:Z,options:X,isSync:J})=>{let q=[];try{for(let Y of $)q.push(GH({fileDescriptor:Y,fileDescriptors:q,addProperties:Z,options:X,isSync:J}));return q}catch(Y){throw q3(q),Y}},GH=({fileDescriptor:{direction:$,objectMode:Z,stdioItems:X},fileDescriptors:J,addProperties:q,options:Y,isSync:Q})=>{let G=X.map((H)=>HH({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:J,isSync:Q}));return{direction:$,objectMode:Z,stdioItems:G}},HH=({stdioItem:$,addProperties:Z,direction:X,options:J,fileDescriptors:q,isSync:Y})=>{let Q=qZ({stdioItem:$,direction:X,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...Z[X][$.type]($,J)}},q3=($)=>{for(let{stdioItems:Z}of $)for(let{stream:X}of Z)if(X!==void 0&&!y0(X))X.destroy()},zH=($)=>{if($.length>1)return $.some(({value:J})=>J==="overlapped")?"overlapped":"pipe";let[{type:Z,value:X}]=$;return Z==="native"?X:"pipe"};var KZ=($,Z)=>w4(BH,$,Z,!0),o0=({type:$,optionName:Z})=>{BZ(Z,K1[$])},KH=({optionName:$,value:Z})=>{if(Z==="ipc"||Z==="overlapped")BZ($,`"${Z}"`);return{}},BZ=($,Z)=>{throw TypeError(`The \`${$}\` option cannot be ${Z} with synchronous methods.`)},zZ={generator(){},asyncGenerator:o0,webStream:o0,nodeStream:o0,webTransform:o0,duplex:o0,asyncIterable:o0,native:KH},BH={input:{...zZ,fileUrl:({value:$})=>({contents:[Z1(HZ($))]}),filePath:({value:{file:$}})=>({contents:[Z1(HZ($))]}),fileNumber:o0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...zZ,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:Z}})=>({path:$,append:Z}),fileNumber:({value:$})=>({path:$}),iterable:o0,string:o0,uint8Array:o0}};var q1=($,{stripFinalNewline:Z},X)=>Y3(Z,X)&&$!==void 0&&!Array.isArray($)?a1($):$,Y3=($,Z)=>Z==="all"?$[1]||$[2]:$[Z];import{Transform as DH,getDefaultHighWaterMark as PZ}from"node:stream";var O4=($,Z,X,J)=>$||X?void 0:WZ(Z,J),H3=($,Z,X)=>X?$.flatMap((J)=>UZ(J,Z)):UZ($,Z),UZ=($,Z)=>{let{transform:X,final:J}=WZ(Z,{});return[...X($),...J()]},WZ=($,Z)=>{return Z.previousChunks="",{transform:UH.bind(void 0,Z,$),final:VH.bind(void 0,Z)}},UH=function*($,Z,X){if(typeof X!=="string"){yield X;return}let{previousChunks:J}=$,q=-1;for(let Y=0;Y<X.length;Y+=1)if(X[Y]===`
39
- `){let Q=WH(X,Y,Z,$),G=X.slice(q+1,Y+1-Q);if(J.length>0)G=G3(J,G),J="";yield G,q=Y}if(q!==X.length-1)J=G3(J,X.slice(q+1));$.previousChunks=J},WH=($,Z,X,J)=>{if(X)return 0;return J.isWindowsNewline=Z!==0&&$[Z-1]==="\r",J.isWindowsNewline?2:1},VH=function*({previousChunks:$}){if($.length>0)yield $},VZ=({binary:$,preserveNewlines:Z,readableObjectMode:X,state:J})=>$||Z||X?void 0:{transform:LH.bind(void 0,J)},LH=function*({isWindowsNewline:$=!1},Z){let{unixNewline:X,windowsNewline:J,LF:q,concatBytes:Y}=typeof Z==="string"?_H:TH;if(Z.at(-1)===q){yield Z;return}yield Y(Z,$?J:X)},G3=($,Z)=>`${$}${Z}`,_H={windowsNewline:`\r
36
+ `);return{originalMessage:I,shortMessage:i,message:K0}},ZG=({originalError:$,timedOut:Z,timeout:X,isMaxBuffer:J,maxBuffer:q,errorCode:Y,signal:Q,signalDescription:G,exitCode:H,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:U,forceKillAfterDelay:B,killSignal:R})=>{let _=XG(U,B);if(Z)return`Command timed out after ${X} milliseconds${_}`;if(W){if(Q===void 0)return`Command was gracefully canceled with exit code ${H}`;return U?`Command was gracefully canceled${_}`:`Command was gracefully canceled with ${Q} (${G})`}if(K)return`Command was canceled${_}`;if(J)return`${O5($,q)}${_}`;if(Y!==void 0)return`Command failed with ${Y}${_}`;if(U)return`Command was killed with ${R} (${r$(R)})${_}`;if(Q!==void 0)return`Command was killed with ${Q} (${G})`;if(H!==void 0)return`Command failed with exit code ${H}`;return"Command failed"},XG=($,Z)=>$?` and was forcefully terminated after ${Z} milliseconds`:"",JG=($,Z)=>{if($ instanceof n0)return;let X=Y8($)?$.originalMessage:String($?.message??$),J=B$(H5(X,Z));return J===""?void 0:J},QG=($)=>typeof $==="string"?$:$G($),qG=($)=>Array.isArray($)?$.map((Z)=>a1(h5(Z))).filter(Boolean).join(`
37
+ `):h5($),h5=($)=>{if(typeof $==="string")return $;if(L0($))return S$($);return""};var P4=({command:$,escapedCommand:Z,stdio:X,all:J,ipcOutput:q,options:{cwd:Y},startTime:Q})=>D5({command:$,escapedCommand:Z,cwd:Y,durationMs:j2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:X[1],stderr:X[2],all:J,stdio:X,ipcOutput:q,pipedFrom:[]}),s1=({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,isSync:Q})=>R$({error:$,command:Z,escapedCommand:X,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:J.length}),ipcOutput:[],options:q,isSync:Q}),R$=({error:$,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,stdio:U,all:B,ipcOutput:R,options:{timeoutDuration:_,timeout:L=_,forceKillAfterDelay:j,killSignal:C,cwd:N,maxBuffer:c},isSync:I})=>{let{exitCode:n,signal:i,signalDescription:a}=GG(K,W),{originalMessage:K0,shortMessage:l,message:x0}=N5({stdio:U,all:B,ipcOutput:R,originalError:$,signal:i,signalDescription:a,exitCode:n,escapedCommand:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:j,killSignal:C,maxBuffer:c,timeout:L,cwd:N}),E=Q8($,x0,I);return Object.assign(E,YG({error:E,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:n,signal:i,signalDescription:a,stdio:U,all:B,ipcOutput:R,cwd:N,originalMessage:K0,shortMessage:l})),E},YG=({error:$,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:U,stdio:B,all:R,ipcOutput:_,cwd:L,originalMessage:j,shortMessage:C})=>D5({shortMessage:C,originalMessage:j,command:Z,escapedCommand:X,cwd:L,durationMs:j2(J),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:W!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:U,code:$.cause?.code,stdout:B[1],stderr:B[2],all:R,stdio:B,ipcOutput:_,pipedFrom:[]}),D5=($)=>Object.fromEntries(Object.entries($).filter(([,Z])=>Z!==void 0)),GG=($,Z)=>{let X=$===null?void 0:$,J=Z===null?void 0:Z,q=J===void 0?void 0:r$(Z);return{exitCode:X,signal:J,signalDescription:q}};var S5=($)=>Number.isFinite($)?$:0;function HG($){return{days:Math.trunc($/86400000),hours:Math.trunc($/3600000%24),minutes:Math.trunc($/60000%60),seconds:Math.trunc($/1000%60),milliseconds:Math.trunc($%1000),microseconds:Math.trunc(S5($*1000)%1000),nanoseconds:Math.trunc(S5($*1e6)%1000)}}function zG($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function a2($){switch(typeof $){case"number":{if(Number.isFinite($))return HG($);break}case"bigint":return zG($)}throw TypeError("Expected a finite number or bigint")}var KG=($)=>$===0||$===0n,BG=($,Z)=>Z===1||Z===1n?$:`${$}s`,UG=0.0000001,WG=24n*60n*60n*1000n;function r2($,Z){let X=typeof $==="bigint";if(!X&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");Z={...Z};let J=$<0?"-":"";if($=$<0?-$:$,Z.colonNotation)Z.compact=!1,Z.formatSubMilliseconds=!1,Z.separateMilliseconds=!1,Z.verbose=!1;if(Z.compact)Z.unitCount=1,Z.secondsDecimalDigits=0,Z.millisecondsDecimalDigits=0;let q=[],Y=(W,U)=>{let B=Math.floor(W*10**U+UG);return(Math.round(B)/10**U).toFixed(U)},Q=(W,U,B,R)=>{if((q.length===0||!Z.colonNotation)&&KG(W)&&!(Z.colonNotation&&B==="m"))return;if(R??=String(W),Z.colonNotation){let _=R.includes(".")?R.split(".")[0].length:R.length,L=q.length>0?2:1;R="0".repeat(Math.max(0,L-_))+R}else R+=Z.verbose?" "+BG(U,W):B;q.push(R)},G=a2($),H=BigInt(G.days);if(Z.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(Z.hideYear)Q(H,"day","d");else Q(H/365n,"year","y"),Q(H%365n,"day","d");Q(Number(G.hours),"hour","h")}if(Q(Number(G.minutes),"minute","m"),!Z.hideSeconds)if(Z.separateMilliseconds||Z.formatSubMilliseconds||!Z.colonNotation&&$<1000&&!Z.subSecondsAsDecimals){let W=Number(G.seconds),U=Number(G.milliseconds),B=Number(G.microseconds),R=Number(G.nanoseconds);if(Q(W,"second","s"),Z.formatSubMilliseconds)Q(U,"millisecond","ms"),Q(B,"microsecond","µs"),Q(R,"nanosecond","ns");else{let _=U+B/1000+R/1e6,L=typeof Z.millisecondsDecimalDigits==="number"?Z.millisecondsDecimalDigits:0,j=_>=1?Math.round(_):Math.ceil(_),C=L?_.toFixed(L):j;Q(Number.parseFloat(C),"millisecond","ms",C)}}else{let W=(X?Number($%WG):$)/1000%60,U=typeof Z.secondsDecimalDigits==="number"?Z.secondsDecimalDigits:1,B=Y(W,U),R=Z.keepDecimalsOnWholeSeconds?B:B.replace(/\.0+$/,"");Q(Number.parseFloat(R),"second","s",R)}if(q.length===0)return J+"0"+(Z.verbose?" milliseconds":"ms");let K=Z.colonNotation?":":" ";if(typeof Z.unitCount==="number")q=q.slice(0,Math.max(Z.unitCount,1));return J+q.join(K)}var v5=($,Z)=>{if($.failed)l0({type:"error",verboseMessage:$.shortMessage,verboseInfo:Z,result:$})};var f5=($,Z)=>{if(!p1(Z))return;v5($,Z),VG($,Z)},VG=($,Z)=>{let X=`(done in ${r2($.durationMs)})`;l0({type:"duration",verboseMessage:X,verboseInfo:Z,result:$})};var e1=($,Z,{reject:X})=>{if(f5($,Z),$.failed&&X)throw $;return $};import{readFileSync as HZ}from"node:fs";var y5=($,Z)=>{if(P1($))return"asyncGenerator";if(m5($))return"generator";if(x4($))return"fileUrl";if(FG($))return"filePath";if(PG($))return"webStream";if(u0($,{checkOpen:!1}))return"native";if(L0($))return"uint8Array";if(xG($))return"asyncIterable";if(jG($))return"iterable";if($3($))return g5({transform:$},Z);if(TG($))return LG($,Z);return"native"},LG=($,Z)=>{if(i2($.transform,{checkOpen:!1}))return _G($,Z);if($3($.transform))return g5($,Z);return RG($,Z)},_G=($,Z)=>{return u5($,Z,"Duplex stream"),"duplex"},g5=($,Z)=>{return u5($,Z,"web TransformStream"),"webTransform"},u5=({final:$,binary:Z,objectMode:X},J,q)=>{k5($,`${J}.final`,q),k5(Z,`${J}.binary`,q),s2(X,`${J}.objectMode`)},k5=($,Z,X)=>{if($!==void 0)throw TypeError(`The \`${Z}\` option can only be defined when using a generator, not a ${X}.`)},RG=({transform:$,final:Z,binary:X,objectMode:J},q)=>{if($!==void 0&&!b5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(i2(Z,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if($3(Z))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(Z!==void 0&&!b5(Z))throw TypeError(`The \`${q}.final\` option must be a generator.`);return s2(X,`${q}.binary`),s2(J,`${q}.objectMode`),P1($)||P1(Z)?"asyncGenerator":"generator"},s2=($,Z)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${Z}\` option must use a boolean.`)},b5=($)=>P1($)||m5($),P1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",m5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",TG=($)=>Y0($)&&($.transform!==void 0||$.final!==void 0),x4=($)=>Object.prototype.toString.call($)==="[object URL]",c5=($)=>x4($)&&$.protocol!=="file:",FG=($)=>Y0($)&&Object.keys($).length>0&&Object.keys($).every((Z)=>MG.has(Z))&&e2($.file),MG=new Set(["file","append"]),e2=($)=>typeof $==="string",p5=($,Z)=>$==="native"&&typeof Z==="string"&&!CG.has(Z),CG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),d5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",j4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",PG=($)=>d5($)||j4($),$3=($)=>d5($?.readable)&&j4($?.writable),xG=($)=>l5($)&&typeof $[Symbol.asyncIterator]==="function",jG=($)=>l5($)&&typeof $[Symbol.iterator]==="function",l5=($)=>typeof $==="object"&&$!==null,D0=new Set(["generator","asyncGenerator","duplex","webTransform"]),I4=new Set(["fileUrl","filePath","fileNumber"]),Z3=new Set(["fileUrl","filePath"]),n5=new Set([...Z3,"webStream","nodeStream"]),i5=new Set(["webTransform","duplex"]),z1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var X3=($,Z,X,J)=>J==="output"?IG($,Z,X):wG($,Z,X),IG=($,Z,X)=>{let J=Z!==0&&X[Z-1].value.readableObjectMode;return{writableObjectMode:J,readableObjectMode:$??J}},wG=($,Z,X)=>{let J=Z===0?$===!0:X[Z-1].value.readableObjectMode,q=Z!==X.length-1&&($??J);return{writableObjectMode:J,readableObjectMode:q}},t5=($,Z)=>{let X=$.findLast(({type:J})=>D0.has(J));if(X===void 0)return!1;return Z==="input"?X.value.writableObjectMode:X.value.readableObjectMode};var o5=($,Z,X,J)=>[...$.filter(({type:q})=>!D0.has(q)),...OG($,Z,X,J)],OG=($,Z,X,{encoding:J})=>{let q=$.filter(({type:Q})=>D0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=EG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:Z,direction:X,encoding:J});return DG(Y,X)},EG=({stdioItem:$,stdioItem:{type:Z},index:X,newTransforms:J,optionName:q,direction:Y,encoding:Q})=>{if(Z==="duplex")return AG({stdioItem:$,optionName:q});if(Z==="webTransform")return hG({stdioItem:$,index:X,newTransforms:J,direction:Y});return NG({stdioItem:$,index:X,newTransforms:J,direction:Y,encoding:Q})},AG=({stdioItem:$,stdioItem:{value:{transform:Z,transform:{writableObjectMode:X,readableObjectMode:J},objectMode:q=J}},optionName:Y})=>{if(q&&!J)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&J)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:Z,writableObjectMode:X,readableObjectMode:J}}},hG=({stdioItem:$,stdioItem:{value:Z},index:X,newTransforms:J,direction:q})=>{let{transform:Y,objectMode:Q}=Y0(Z)?Z:{transform:Z},{writableObjectMode:G,readableObjectMode:H}=X3(Q,X,J,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},NG=({stdioItem:$,stdioItem:{value:Z},index:X,newTransforms:J,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:K=!1,objectMode:W}=Y0(Z)?Z:{transform:Z},U=H||j0.has(Y),{writableObjectMode:B,readableObjectMode:R}=X3(W,X,J,q);return{...$,value:{transform:Q,final:G,binary:U,preserveNewlines:K,writableObjectMode:B,readableObjectMode:R}}},DG=($,Z)=>Z==="input"?$.reverse():$;import J3 from"node:process";var a5=($,Z,X)=>{let J=$.map((q)=>SG(q,Z));if(J.includes("input")&&J.includes("output"))throw TypeError(`The \`${X}\` option must not be an array of both readable and writable values.`);return J.find(Boolean)??kG},SG=({type:$,value:Z},X)=>vG[X]??r5[$](Z),vG=["input","output","output"],$$=()=>{return},Q3=()=>"input",r5={generator:$$,asyncGenerator:$$,fileUrl:$$,filePath:$$,iterable:Q3,asyncIterable:Q3,uint8Array:Q3,webStream:($)=>j4($)?"output":"input",nodeStream($){if(!C1($,{checkOpen:!1}))return"output";return n2($,{checkOpen:!1})?void 0:"input"},webTransform:$$,duplex:$$,native($){let Z=fG($);if(Z!==void 0)return Z;if(u0($,{checkOpen:!1}))return r5.nodeStream($)}},fG=($)=>{if([0,J3.stdin].includes($))return"input";if([1,2,J3.stdout,J3.stderr].includes($))return"output"},kG="output";var s5=($,Z)=>Z&&!$.includes("ipc")?[...$,"ipc"]:$;var e5=({stdio:$,ipc:Z,buffer:X,...J},q,Y)=>{let Q=bG($,J).map((G,H)=>$Z(G,H));return Y?gG(Q,X,q):s5(Q,Z)},bG=($,Z)=>{if($===void 0)return N0.map((J)=>Z[J]);if(yG(Z))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N0.map((J)=>`\`${J}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let X=Math.max($.length,N0.length);return Array.from({length:X},(J,q)=>$[q])},yG=($)=>N0.some((Z)=>$[Z]!==void 0),$Z=($,Z)=>{if(Array.isArray($))return $.map((X)=>$Z(X,Z));if($===null||$===void 0)return Z>=N0.length?"ignore":"pipe";return $},gG=($,Z,X)=>$.map((J,q)=>!Z[q]&&q!==0&&!d1(X,q)&&uG(J)?"ignore":J),uG=($)=>$==="pipe"||Array.isArray($)&&$.every((Z)=>Z==="pipe");import{readFileSync as mG}from"node:fs";import cG from"node:tty";var XZ=({stdioItem:$,stdioItem:{type:Z},isStdioArray:X,fdNumber:J,direction:q,isSync:Y})=>{if(!X||Z!=="native")return $;return Y?pG({stdioItem:$,fdNumber:J,direction:q}):nG({stdioItem:$,fdNumber:J})},pG=({stdioItem:$,stdioItem:{value:Z,optionName:X},fdNumber:J,direction:q})=>{let Y=dG({value:Z,optionName:X,fdNumber:J,direction:q});if(Y!==void 0)return Y;if(u0(Z,{checkOpen:!1}))throw TypeError(`The \`${X}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},dG=({value:$,optionName:Z,fdNumber:X,direction:J})=>{let q=lG($,X);if(q===void 0)return;if(J==="output")return{type:"fileNumber",value:q,optionName:Z};if(cG.isatty(q))throw TypeError(`The \`${Z}: ${$4($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:$1(mG(q)),optionName:Z}},lG=($,Z)=>{if($==="inherit")return Z;if(typeof $==="number")return $;let X=v$.indexOf($);if(X!==-1)return X},nG=({stdioItem:$,stdioItem:{value:Z,optionName:X},fdNumber:J})=>{if(Z==="inherit")return{type:"nodeStream",value:ZZ(J,Z,X),optionName:X};if(typeof Z==="number")return{type:"nodeStream",value:ZZ(Z,Z,X),optionName:X};if(u0(Z,{checkOpen:!1}))return{type:"nodeStream",value:Z,optionName:X};return $},ZZ=($,Z,X)=>{let J=v$[$];if(J===void 0)throw TypeError(`The \`${X}: ${Z}\` option is invalid: no such standard stream.`);return J};var JZ=({input:$,inputFile:Z},X)=>X===0?[...iG($),...oG(Z)]:[],iG=($)=>$===void 0?[]:[{type:tG($),value:$,optionName:"input"}],tG=($)=>{if(C1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(L0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},oG=($)=>$===void 0?[]:[{...aG($),optionName:"inputFile"}],aG=($)=>{if(x4($))return{type:"fileUrl",value:$};if(e2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var QZ=($)=>$.filter((Z,X)=>$.every((J,q)=>Z.value!==J.value||X>=q||Z.type==="generator"||Z.type==="asyncGenerator")),qZ=({stdioItem:{type:$,value:Z,optionName:X},direction:J,fileDescriptors:q,isSync:Y})=>{let Q=rG(q,$);if(Q.length===0)return;if(Y){sG({otherStdioItems:Q,type:$,value:Z,optionName:X,direction:J});return}if(n5.has($))return YZ({otherStdioItems:Q,type:$,value:Z,optionName:X,direction:J});if(i5.has($))$H({otherStdioItems:Q,type:$,value:Z,optionName:X})},rG=($,Z)=>$.flatMap(({direction:X,stdioItems:J})=>J.filter((q)=>q.type===Z).map((q)=>({...q,direction:X}))),sG=({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})=>{if(Z3.has(Z))YZ({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})},YZ=({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})=>{let Y=$.filter((G)=>eG(G,X));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return GZ(Q,J,Z),q==="output"?Y[0].stream:void 0},eG=({type:$,value:Z},X)=>{if($==="filePath")return Z.file===X.file;if($==="fileUrl")return Z.href===X.href;return Z===X},$H=({otherStdioItems:$,type:Z,value:X,optionName:J})=>{let q=$.find(({value:{transform:Y}})=>Y===X.transform);GZ(q,J,Z)},GZ=($,Z,X)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${Z}\` options must not target ${z1[X]} that is the same.`)};var w4=($,Z,X,J)=>{let Y=e5(Z,X,J).map((G,H)=>ZH({stdioOption:G,fdNumber:H,options:Z,isSync:J})),Q=zH({initialFileDescriptors:Y,addProperties:$,options:Z,isSync:J});return Z.stdio=Q.map(({stdioItems:G})=>UH(G)),Q},ZH=({stdioOption:$,fdNumber:Z,options:X,isSync:J})=>{let q=f$(Z),{stdioItems:Y,isStdioArray:Q}=XH({stdioOption:$,fdNumber:Z,options:X,optionName:q}),G=a5(Y,Z,q),H=Y.map((U)=>XZ({stdioItem:U,isStdioArray:Q,fdNumber:Z,direction:G,isSync:J})),K=o5(H,q,G,X),W=t5(K,G);return HH(K,W),{direction:G,objectMode:W,stdioItems:K}},XH=({stdioOption:$,fdNumber:Z,options:X,optionName:J})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>JH(H,J)),...JZ(X,Z)],Q=QZ(Y),G=Q.length>1;return QH(Q,G,J),YH(Q),{stdioItems:Q,isStdioArray:G}},JH=($,Z)=>({type:y5($,Z),value:$,optionName:Z}),QH=($,Z,X)=>{if($.length===0)throw TypeError(`The \`${X}\` option must not be an empty array.`);if(!Z)return;for(let{value:J,optionName:q}of $)if(qH.has(J))throw Error(`The \`${q}\` option must not include \`${J}\`.`)},qH=new Set(["ignore","ipc"]),YH=($)=>{for(let Z of $)GH(Z)},GH=({type:$,value:Z,optionName:X})=>{if(c5(Z))throw TypeError(`The \`${X}: URL\` option must use the \`file:\` scheme.
38
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(p5($,Z))throw TypeError(`The \`${X}: { file: '...' }\` option must be used instead of \`${X}: '...'\`.`)},HH=($,Z)=>{if(!Z)return;let X=$.find(({type:J})=>I4.has(J));if(X!==void 0)throw TypeError(`The \`${X.optionName}\` option cannot use both files and transforms in objectMode.`)},zH=({initialFileDescriptors:$,addProperties:Z,options:X,isSync:J})=>{let q=[];try{for(let Y of $)q.push(KH({fileDescriptor:Y,fileDescriptors:q,addProperties:Z,options:X,isSync:J}));return q}catch(Y){throw q3(q),Y}},KH=({fileDescriptor:{direction:$,objectMode:Z,stdioItems:X},fileDescriptors:J,addProperties:q,options:Y,isSync:Q})=>{let G=X.map((H)=>BH({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:J,isSync:Q}));return{direction:$,objectMode:Z,stdioItems:G}},BH=({stdioItem:$,addProperties:Z,direction:X,options:J,fileDescriptors:q,isSync:Y})=>{let Q=qZ({stdioItem:$,direction:X,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...Z[X][$.type]($,J)}},q3=($)=>{for(let{stdioItems:Z}of $)for(let{stream:X}of Z)if(X!==void 0&&!y0(X))X.destroy()},UH=($)=>{if($.length>1)return $.some(({value:J})=>J==="overlapped")?"overlapped":"pipe";let[{type:Z,value:X}]=$;return Z==="native"?X:"pipe"};var KZ=($,Z)=>w4(VH,$,Z,!0),o0=({type:$,optionName:Z})=>{BZ(Z,z1[$])},WH=({optionName:$,value:Z})=>{if(Z==="ipc"||Z==="overlapped")BZ($,`"${Z}"`);return{}},BZ=($,Z)=>{throw TypeError(`The \`${$}\` option cannot be ${Z} with synchronous methods.`)},zZ={generator(){},asyncGenerator:o0,webStream:o0,nodeStream:o0,webTransform:o0,duplex:o0,asyncIterable:o0,native:WH},VH={input:{...zZ,fileUrl:({value:$})=>({contents:[$1(HZ($))]}),filePath:({value:{file:$}})=>({contents:[$1(HZ($))]}),fileNumber:o0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...zZ,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:Z}})=>({path:$,append:Z}),fileNumber:({value:$})=>({path:$}),iterable:o0,string:o0,uint8Array:o0}};var Q1=($,{stripFinalNewline:Z},X)=>Y3(Z,X)&&$!==void 0&&!Array.isArray($)?a1($):$,Y3=($,Z)=>Z==="all"?$[1]||$[2]:$[Z];import{Transform as fH,getDefaultHighWaterMark as PZ}from"node:stream";var O4=($,Z,X,J)=>$||X?void 0:WZ(Z,J),H3=($,Z,X)=>X?$.flatMap((J)=>UZ(J,Z)):UZ($,Z),UZ=($,Z)=>{let{transform:X,final:J}=WZ(Z,{});return[...X($),...J()]},WZ=($,Z)=>{return Z.previousChunks="",{transform:LH.bind(void 0,Z,$),final:RH.bind(void 0,Z)}},LH=function*($,Z,X){if(typeof X!=="string"){yield X;return}let{previousChunks:J}=$,q=-1;for(let Y=0;Y<X.length;Y+=1)if(X[Y]===`
39
+ `){let Q=_H(X,Y,Z,$),G=X.slice(q+1,Y+1-Q);if(J.length>0)G=G3(J,G),J="";yield G,q=Y}if(q!==X.length-1)J=G3(J,X.slice(q+1));$.previousChunks=J},_H=($,Z,X,J)=>{if(X)return 0;return J.isWindowsNewline=Z!==0&&$[Z-1]==="\r",J.isWindowsNewline?2:1},RH=function*({previousChunks:$}){if($.length>0)yield $},VZ=({binary:$,preserveNewlines:Z,readableObjectMode:X,state:J})=>$||Z||X?void 0:{transform:TH.bind(void 0,J)},TH=function*({isWindowsNewline:$=!1},Z){let{unixNewline:X,windowsNewline:J,LF:q,concatBytes:Y}=typeof Z==="string"?FH:CH;if(Z.at(-1)===q){yield Z;return}yield Y(Z,$?J:X)},G3=($,Z)=>`${$}${Z}`,FH={windowsNewline:`\r
40
40
  `,unixNewline:`
41
41
  `,LF:`
42
- `,concatBytes:G3},RH=($,Z)=>{let X=new Uint8Array($.length+Z.length);return X.set($,0),X.set(Z,$.length),X},TH={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:RH};import{Buffer as FH}from"node:buffer";var LZ=($,Z)=>$?void 0:MH.bind(void 0,Z),MH=function*($,Z){if(typeof Z!=="string"&&!L0(Z)&&!FH.isBuffer(Z))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof Z}.`);yield Z},_Z=($,Z)=>$?CH.bind(void 0,Z):PH.bind(void 0,Z),CH=function*($,Z){RZ($,Z),yield Z},PH=function*($,Z){if(RZ($,Z),typeof Z!=="string"&&!L0(Z))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof Z}.`);yield Z},RZ=($,Z)=>{if(Z===null||Z===void 0)throw TypeError(`The \`${$}\` option's function must not call \`yield ${Z}\`.
42
+ `,concatBytes:G3},MH=($,Z)=>{let X=new Uint8Array($.length+Z.length);return X.set($,0),X.set(Z,$.length),X},CH={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:MH};import{Buffer as PH}from"node:buffer";var LZ=($,Z)=>$?void 0:xH.bind(void 0,Z),xH=function*($,Z){if(typeof Z!=="string"&&!L0(Z)&&!PH.isBuffer(Z))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof Z}.`);yield Z},_Z=($,Z)=>$?jH.bind(void 0,Z):IH.bind(void 0,Z),jH=function*($,Z){RZ($,Z),yield Z},IH=function*($,Z){if(RZ($,Z),typeof Z!=="string"&&!L0(Z))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof Z}.`);yield Z},RZ=($,Z)=>{if(Z===null||Z===void 0)throw TypeError(`The \`${$}\` option's function must not call \`yield ${Z}\`.
43
43
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
44
- if (condition) { yield value; }`)};import{Buffer as xH}from"node:buffer";import{StringDecoder as jH}from"node:string_decoder";var E4=($,Z,X)=>{if(X)return;if($)return{transform:IH.bind(void 0,new TextEncoder)};let J=new jH(Z);return{transform:wH.bind(void 0,J),final:OH.bind(void 0,J)}},IH=function*($,Z){if(xH.isBuffer(Z))yield Z1(Z);else if(typeof Z==="string")yield $.encode(Z);else yield Z},wH=function*($,Z){yield L0(Z)?$.write(Z):Z},OH=function*($){let Z=$.end();if(Z!=="")yield Z};import{callbackify as TZ}from"node:util";var z3=TZ(async($,Z,X,J)=>{Z.currentIterable=$(...X);try{for await(let q of Z.currentIterable)J.push(q)}finally{delete Z.currentIterable}}),A4=async function*($,Z,X){if(X===Z.length){yield $;return}let{transform:J=AH}=Z[X];for await(let q of J($))yield*A4(q,Z,X+1)},FZ=async function*($){for(let[Z,{final:X}]of Object.entries($))yield*EH(X,Number(Z),$)},EH=async function*($,Z,X){if($===void 0)return;for await(let J of $())yield*A4(J,X,Z+1)},MZ=TZ(async({currentIterable:$},Z)=>{if($!==void 0){await(Z?$.throw(Z):$.return());return}if(Z)throw Z}),AH=function*($){yield $};var K3=($,Z,X,J)=>{try{for(let q of $(...Z))X.push(q);J()}catch(q){J(q)}},CZ=($,Z)=>[...Z.flatMap((X)=>[...j1(X,$,0)]),...T$($)],j1=function*($,Z,X){if(X===Z.length){yield $;return}let{transform:J=NH}=Z[X];for(let q of J($))yield*j1(q,Z,X+1)},T$=function*($){for(let[Z,{final:X}]of Object.entries($))yield*hH(X,Number(Z),$)},hH=function*($,Z,X){if($===void 0)return;for(let J of $())yield*j1(J,X,Z+1)},NH=function*($){yield $};var B3=({value:$,value:{transform:Z,final:X,writableObjectMode:J,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=xZ($,Q,Y),K=x1(Z),W=x1(X),U=K?z3.bind(void 0,A4,G):K3.bind(void 0,j1),B=K||W?z3.bind(void 0,FZ,G):K3.bind(void 0,T$),R=K||W?MZ.bind(void 0,G):void 0;return{stream:new DH({writableObjectMode:J,writableHighWaterMark:PZ(J),readableObjectMode:q,readableHighWaterMark:PZ(q),transform(L,j,C){U([L,H,0],this,C)},flush(L){B([H],this,L)},destroy:R})}},h4=($,Z,X,J)=>{let q=Z.filter(({type:Q})=>Q==="generator"),Y=J?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=xZ(Q,X,G);$=CZ(H,$)}return $},xZ=({transform:$,final:Z,binary:X,writableObjectMode:J,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:LZ(J,G)},E4(X,Q,J),O4(X,Y,J,H),{transform:$,final:Z},{transform:_Z(q,G)},VZ({binary:X,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var jZ=($,Z)=>{for(let X of SH($))vH($,X,Z)},SH=($)=>new Set(Object.entries($).filter(([,{direction:Z}])=>Z==="input").map(([Z])=>Number(Z))),vH=($,Z,X)=>{let{stdioItems:J}=$[Z],q=J.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(Z!==0){let[{type:G,optionName:H}]=q;throw TypeError(`Only the \`stdin\` option, not \`${H}\`, can be ${K1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>fH(G,J));X.input=K$(Q)},fH=($,Z)=>{let X=h4($,Z,"utf8",!0);return kH(X),K$(X)},kH=($)=>{let Z=$.find((X)=>typeof X!=="string"&&!L0(X));if(Z!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${Z}.`)};import{writeFileSync as uH,appendFileSync as mH}from"node:fs";var N4=({stdioItems:$,encoding:Z,verboseInfo:X,fdNumber:J})=>J!=="all"&&d1(X,J)&&!j0.has(Z)&&bH(J)&&($.some(({type:q,value:Y})=>q==="native"&&yH.has(Y))||$.every(({type:q})=>D0.has(q))),bH=($)=>$===1||$===2,yH=new Set(["pipe","overlapped"]),IZ=async($,Z,X,J)=>{for await(let q of $)if(!gH(Z))OZ(q,X,J)},wZ=($,Z,X)=>{for(let J of $)OZ(J,Z,X)},gH=($)=>$._readableState.pipes.length>0,OZ=($,Z,X)=>{let J=m$($);l0({type:"output",verboseMessage:J,fdNumber:Z,verboseInfo:X})};var EZ=({fileDescriptors:$,syncResult:{output:Z},options:X,isMaxBuffer:J,verboseInfo:q})=>{if(Z===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:Z.map((H,K)=>cH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:J,verboseInfo:q},X)),...Y}},cH=({result:$,fileDescriptors:Z,fdNumber:X,state:J,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:K,stripFinalNewline:W,maxBuffer:U})=>{if($===null)return;let B=A5($,Y,U),R=Z1(B),{stdioItems:_,objectMode:L}=Z[X],j=pH([R],_,H,J),{serializedResult:C,finalResult:N=C}=dH({chunks:j,objectMode:L,encoding:H,lines:K,stripFinalNewline:W,fdNumber:X});lH({serializedResult:C,fdNumber:X,state:J,verboseInfo:Q,encoding:H,stdioItems:_,objectMode:L});let c=G[X]?N:void 0;try{if(J.error===void 0)nH(C,_,q);return c}catch(I){return J.error=I,c}},pH=($,Z,X,J)=>{try{return h4($,Z,X,!1)}catch(q){return J.error=q,$}},dH=({chunks:$,objectMode:Z,encoding:X,lines:J,stripFinalNewline:q,fdNumber:Y})=>{if(Z)return{serializedResult:$};if(X==="buffer")return{serializedResult:K$($)};let Q=p6($,X);if(J[Y])return{serializedResult:Q,finalResult:H3(Q,!q[Y],Z)};return{serializedResult:Q}},lH=({serializedResult:$,fdNumber:Z,state:X,verboseInfo:J,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!N4({stdioItems:Y,encoding:q,verboseInfo:J,fdNumber:Z}))return;let G=H3($,!1,Q);try{wZ(G,Z,J)}catch(H){X.error??=H}},nH=($,Z,X)=>{for(let{path:J,append:q}of Z.filter(({type:Y})=>I4.has(Y))){let Y=typeof J==="string"?J:J.toString();if(q||X.has(Y))mH(J,$);else X.add(Y),uH(J,$)}};var AZ=([,$,Z],X)=>{if(!X.all)return;if($===void 0)return Z;if(Z===void 0)return $;if(Array.isArray($))return Array.isArray(Z)?[...$,...Z]:[...$,q1(Z,X,"all")];if(Array.isArray(Z))return[q1($,X,"all"),...Z];if(L0($)&&L0(Z))return R2([$,Z]);return`${$}${Z}`};import{once as U3}from"node:events";var hZ=async($,Z)=>{let[X,J]=await iH($);return Z.isForcefullyTerminated??=!1,[X,J]},iH=async($)=>{let[Z,X]=await Promise.allSettled([U3($,"spawn"),U3($,"exit")]);if(Z.status==="rejected")return[];return X.status==="rejected"?NZ($):X.value},NZ=async($)=>{try{return await U3($,"exit")}catch{return NZ($)}},DZ=async($)=>{let[Z,X]=await $;if(!tH(Z,X)&&W3(Z,X))throw new n0;return[Z,X]},tH=($,Z)=>$===void 0&&Z===void 0,W3=($,Z)=>$!==0||Z!==null;var SZ=({error:$,status:Z,signal:X,output:J},{maxBuffer:q})=>{let Y=oH($,Z,X),Q=Y?.code==="ETIMEDOUT",G=E5(Y,J,q);return{resultError:Y,exitCode:Z,signal:X,timedOut:Q,isMaxBuffer:G}},oH=($,Z,X)=>{if($!==void 0)return $;return W3(Z,X)?new n0:void 0};var vZ=($,Z,X)=>{let{file:J,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:W}=rH($,Z,X),U=$z({file:J,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:W,startTime:G});return e1(U,H,K)},rH=($,Z,X)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=p$($,Z,X),G=sH(X),{file:H,commandArguments:K,options:W}=U4($,Z,G);eH(W);let U=KZ(W,Q);return{file:H,commandArguments:K,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:U}},sH=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,eH=({ipc:$,ipcInput:Z,detached:X,cancelSignal:J})=>{if(Z)D4("ipcInput");if($)D4("ipc: true");if(X)D4("detached: true");if(J)D4("cancelSignal")},D4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},$z=({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=Zz({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:K,exitCode:W,signal:U,timedOut:B,isMaxBuffer:R}=SZ(H,X),{output:_,error:L=K}=EZ({fileDescriptors:Q,syncResult:H,options:X,isMaxBuffer:R,verboseInfo:Y}),j=_.map((N,c)=>q1(N,X,c)),C=q1(AZ(_,X),X,"all");return Jz({error:L,exitCode:W,signal:U,timedOut:B,isMaxBuffer:R,stdio:j,all:C,options:X,command:J,escapedCommand:q,startTime:G})},Zz=({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{jZ(Y,X);let G=Xz(X);return aH(...W4($,Z,G))}catch(G){return s1({error:G,command:J,escapedCommand:q,fileDescriptors:Y,options:X,startTime:Q,isSync:!0})}},Xz=({encoding:$,maxBuffer:Z,...X})=>({...X,encoding:"buffer",maxBuffer:C4(Z)}),Jz=({error:$,exitCode:Z,signal:X,timedOut:J,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:W})=>$===void 0?P4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:W}):R$({error:$,command:H,escapedCommand:K,timedOut:J,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:Z,signal:X,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:W,isSync:!0});import{setMaxListeners as dK}from"node:events";import{spawn as lK}from"node:child_process";import gZ from"node:process";import{once as V3,on as Qz}from"node:events";var fZ=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},{reference:q=!0,filter:Y}={})=>{return i1({methodName:"getOneMessage",isSubprocess:X,ipc:J,isConnected:Y4($)}),qz({anyProcess:$,channel:Z,isSubprocess:X,filter:Y,reference:q})},qz=async({anyProcess:$,channel:Z,isSubprocess:X,filter:J,reference:q})=>{X4(Z,q);let Y=z1($,Z,X),Q=new AbortController;try{return await Promise.race([Yz(Y,J,Q),Gz(Y,X,Q),Hz(Y,X,Q)])}catch(G){throw t1($),G}finally{Q.abort(),J4(Z,q)}},Yz=async($,Z,{signal:X})=>{if(Z===void 0){let[J]=await V3($,"message",{signal:X});return J}for await(let[J]of Qz($,"message",{signal:X}))if(Z(J))return J},Gz=async($,Z,{signal:X})=>{await V3($,"disconnect",{signal:X}),M8(Z)},Hz=async($,Z,{signal:X})=>{let[J]=await V3($,"strict:error",{signal:X});throw e$(J,Z)};import{once as bZ,on as zz}from"node:events";var yZ=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},{reference:q=!0}={})=>L3({anyProcess:$,channel:Z,isSubprocess:X,ipc:J,shouldAwait:!X,reference:q}),L3=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J,shouldAwait:q,reference:Y})=>{i1({methodName:"getEachMessage",isSubprocess:X,ipc:J,isConnected:Y4($)}),X4(Z,Y);let Q=z1($,Z,X),G=new AbortController,H={};return Kz($,Q,G),Bz({ipcEmitter:Q,isSubprocess:X,controller:G,state:H}),Uz({anyProcess:$,channel:Z,ipcEmitter:Q,isSubprocess:X,shouldAwait:q,controller:G,state:H,reference:Y})},Kz=async($,Z,X)=>{try{await bZ(Z,"disconnect",{signal:X.signal}),X.abort()}catch{}},Bz=async({ipcEmitter:$,isSubprocess:Z,controller:X,state:J})=>{try{let[q]=await bZ($,"strict:error",{signal:X.signal});J.error=e$(q,Z),X.abort()}catch{}},Uz=async function*({anyProcess:$,channel:Z,ipcEmitter:X,isSubprocess:J,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of zz(X,"message",{signal:Y.signal}))kZ(Q),yield H}catch{kZ(Q)}finally{if(Y.abort(),J4(Z,G),!J)t1($);if(q)await $}},kZ=({error:$})=>{if($)throw $};var uZ=($,{ipc:Z})=>{Object.assign($,cZ($,!1,Z))},mZ=()=>{let $=gZ,Z=!0,X=gZ.channel!==void 0;return{...cZ($,!0,X),getCancelSignal:i8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:X})}},cZ=($,Z,X)=>({sendMessage:K4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X}),getOneMessage:fZ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X}),getEachMessage:yZ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X})});import{ChildProcess as Wz}from"node:child_process";import{PassThrough as Vz,Readable as Lz,Writable as _z,Duplex as Rz}from"node:stream";var pZ=({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,verboseInfo:Q})=>{q3(J);let G=new Wz;Tz(G,J),Object.assign(G,{readable:Fz,writable:Mz,duplex:Cz});let H=s1({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,isSync:!1}),K=Pz(H,Q,q);return{subprocess:G,promise:K}},Tz=($,Z)=>{let X=F$(),J=F$(),q=F$(),Y=Array.from({length:Z.length-3},F$),Q=F$(),G=[X,J,q,...Y];Object.assign($,{stdin:X,stdout:J,stderr:q,all:Q,stdio:G})},F$=()=>{let $=new Vz;return $.end(),$},Fz=()=>new Lz({read(){}}),Mz=()=>new _z({write(){}}),Cz=()=>new Rz({read(){},write(){}}),Pz=async($,Z,X)=>e1($,Z,X);import{createReadStream as dZ,createWriteStream as lZ}from"node:fs";import{Buffer as xz}from"node:buffer";import{Readable as M$,Writable as jz,Duplex as Iz}from"node:stream";var iZ=($,Z)=>w4(wz,$,Z,!1),C$=({type:$,optionName:Z})=>{throw TypeError(`The \`${Z}\` option cannot be ${K1[$]}.`)},nZ={fileNumber:C$,generator:B3,asyncGenerator:B3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:Z,readableObjectMode:X}}){let J=Z||X;return{stream:Iz.fromWeb($,{objectMode:J})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},wz={input:{...nZ,fileUrl:({value:$})=>({stream:dZ($)}),filePath:({value:{file:$}})=>({stream:dZ($)}),webStream:({value:$})=>({stream:M$.fromWeb($)}),iterable:({value:$})=>({stream:M$.from($)}),asyncIterable:({value:$})=>({stream:M$.from($)}),string:({value:$})=>({stream:M$.from($)}),uint8Array:({value:$})=>({stream:M$.from(xz.from($))})},output:{...nZ,fileUrl:({value:$})=>({stream:lZ($)}),filePath:({value:{file:$,append:Z}})=>({stream:lZ($,Z?{flags:"a"}:{})}),webStream:({value:$})=>({stream:jz.fromWeb($)}),iterable:C$,asyncIterable:C$,string:C$,uint8Array:C$}};import{on as Oz,once as tZ}from"node:events";import{PassThrough as Ez,getDefaultHighWaterMark as Az}from"node:stream";import{finished as rZ}from"node:stream/promises";function I1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)_3(q);let Z=$.some(({readableObjectMode:q})=>q),X=hz($,Z),J=new sZ({objectMode:Z,writableHighWaterMark:X,readableHighWaterMark:X});for(let q of $)J.add(q);return J}var hz=($,Z)=>{if($.length===0)return Az(Z);let X=$.filter(({readableObjectMode:J})=>J===Z).map(({readableHighWaterMark:J})=>J);return Math.max(...X)};class sZ extends Ez{#Z=new Set([]);#X=new Set([]);#$=new Set([]);#J;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(_3($),this.#Z.has($))return;this.#Z.add($),this.#J??=Nz(this,this.#Z,this.#q);let Z=vz({passThroughStream:this,stream:$,streams:this.#Z,ended:this.#X,aborted:this.#$,onFinished:this.#J,unpipeEvent:this.#q});this.#Q.set($,Z),$.pipe(this,{end:!1})}async remove($){if(_3($),!this.#Z.has($))return!1;let Z=this.#Q.get($);if(Z===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await Z,!0}}var Nz=async($,Z,X)=>{S4($,oZ);let J=new AbortController;try{await Promise.race([Dz($,J),Sz($,Z,X,J)])}finally{J.abort(),S4($,-oZ)}},Dz=async($,{signal:Z})=>{try{await rZ($,{signal:Z,cleanup:!0})}catch(X){throw eZ($,X),X}},Sz=async($,Z,X,{signal:J})=>{for await(let[q]of Oz($,"unpipe",{signal:J}))if(Z.has(q))q.emit(X)},_3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},vz=async({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,onFinished:Y,unpipeEvent:Q})=>{S4($,aZ);let G=new AbortController;try{await Promise.race([fz(Y,Z,G),kz({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,controller:G}),bz({stream:Z,streams:X,ended:J,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),S4($,-aZ)}if(X.size>0&&X.size===J.size+q.size)if(J.size===0&&q.size>0)R3($);else yz($)},fz=async($,Z,{signal:X})=>{try{if(await $,!X.aborted)R3(Z)}catch(J){if(!X.aborted)eZ(Z,J)}},kz=async({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,controller:{signal:Y}})=>{try{if(await rZ(Z,{signal:Y,cleanup:!0,readable:!0,writable:!1}),X.has(Z))J.add(Z)}catch(Q){if(Y.aborted||!X.has(Z))return;if($X(Q))q.add(Z);else ZX($,Q)}},bz=async({stream:$,streams:Z,ended:X,aborted:J,unpipeEvent:q,controller:{signal:Y}})=>{if(await tZ($,q,{signal:Y}),!$.readable)return tZ(Y,"abort",{signal:Y});Z.delete($),X.delete($),J.delete($)},yz=($)=>{if($.writable)$.end()},eZ=($,Z)=>{if($X(Z))R3($);else ZX($,Z)},$X=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",R3=($)=>{if($.readable||$.writable)$.destroy()},ZX=($,Z)=>{if(!$.destroyed)$.once("error",gz),$.destroy(Z)},gz=()=>{},S4=($,Z)=>{let X=$.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)$.setMaxListeners(X+Z)},oZ=2,aZ=1;import{finished as XX}from"node:stream/promises";var Z$=($,Z)=>{$.pipe(Z),uz($,Z),mz($,Z)},uz=async($,Z)=>{if(y0($)||y0(Z))return;try{await XX($,{cleanup:!0,readable:!0,writable:!1})}catch{}T3(Z)},T3=($)=>{if($.writable)$.end()},mz=async($,Z)=>{if(y0($)||y0(Z))return;try{await XX(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}F3($)},F3=($)=>{if($.readable)$.destroy()};var JX=($,Z,X)=>{let J=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(Z)){for(let{stream:G}of Y.filter(({type:H})=>D0.has(H)))cz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!D0.has(H)))dz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:J,controller:X})}for(let[q,Y]of J.entries()){let Q=Y.length===1?Y[0]:I1(Y);Z$(Q,q)}},cz=($,Z,X,J)=>{if(X==="output")Z$($.stdio[J],Z);else Z$(Z,$.stdio[J]);let q=pz[J];if(q!==void 0)$[q]=Z;$.stdio[J]=Z},pz=["stdin","stdout","stderr"],dz=({subprocess:$,stream:Z,direction:X,fdNumber:J,pipeGroups:q,controller:Y})=>{if(Z===void 0)return;lz(Z,Y);let[Q,G]=X==="output"?[Z,$.stdio[J]]:[$.stdio[J],Z],H=q.get(Q)??[];q.set(Q,[...H,G])},lz=($,{signal:Z})=>{if(y0($))C1($,nz,Z)},nz=2;import{addAbortListener as oz}from"node:events";var w1=[];w1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")w1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")w1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var v4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",M3=Symbol.for("signal-exit emitter"),C3=globalThis,iz=Object.defineProperty.bind(Object);class QX{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(C3[M3])return C3[M3];iz(C3,M3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,Z){this.listeners[$].push(Z)}removeListener($,Z){let X=this.listeners[$],J=X.indexOf(Z);if(J===-1)return;if(J===0&&X.length===1)X.length=0;else X.splice(J,1)}emit($,Z,X){if(this.emitted[$])return!1;this.emitted[$]=!0;let J=!1;for(let q of this.listeners[$])J=q(Z,X)===!0||J;if($==="exit")J=this.emit("afterExit",Z,X)||J;return J}}class x3{}var tz=($)=>{return{onExit(Z,X){return $.onExit(Z,X)},load(){return $.load()},unload(){return $.unload()}}};class qX extends x3{onExit(){return()=>{}}load(){}unload(){}}class YX extends x3{#Z=P3.platform==="win32"?"SIGINT":"SIGHUP";#X=new QX;#$;#J;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let Z of w1)this.#Q[Z]=()=>{let X=this.#$.listeners(Z),{count:J}=this.#X,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")J+=q.__signal_exit_emitter__.count;if(X.length===J){this.unload();let Y=this.#X.emit("exit",null,Z),Q=Z==="SIGHUP"?this.#Z:Z;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#J=$.emit}onExit($,Z){if(!v4(this.#$))return()=>{};if(this.#Y===!1)this.load();let X=Z?.alwaysLast?"afterExit":"exit";return this.#X.on(X,$),()=>{if(this.#X.removeListener(X,$),this.#X.listeners.exit.length===0&&this.#X.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#X.count+=1;for(let $ of w1)try{let Z=this.#Q[$];if(Z)this.#$.on($,Z)}catch(Z){}this.#$.emit=($,...Z)=>{return this.#H($,...Z)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,w1.forEach(($)=>{let Z=this.#Q[$];if(!Z)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,Z)}catch(X){}}),this.#$.emit=this.#J,this.#$.reallyExit=this.#q,this.#X.count-=1}#G($){if(!v4(this.#$))return 0;return this.#$.exitCode=$||0,this.#X.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...Z){let X=this.#J;if($==="exit"&&v4(this.#$)){if(typeof Z[0]==="number")this.#$.exitCode=Z[0];let J=X.call(this.#$,$,...Z);return this.#X.emit("exit",this.#$.exitCode,null),J}else return X.call(this.#$,$,...Z)}}var P3=globalThis.process,{onExit:GX,load:eM,unload:$C}=tz(v4(P3)?new YX(P3):new qX);var HX=($,{cleanup:Z,detached:X},{signal:J})=>{if(!Z||X)return;let q=GX(()=>{$.kill()});oz(J,()=>{q()})};var KX=({source:$,sourcePromise:Z,boundOptions:X,createNested:J},...q)=>{let Y=c$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:W}=az(X,J,q),{sourceStream:U,sourceError:B}=sz($,K),{options:R,fileDescriptors:_}=t0.get($);return{sourcePromise:Z,sourceStream:U,sourceOptions:R,sourceError:B,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:W,fileDescriptors:_,startTime:Y}},az=($,Z,X)=>{try{let{destination:J,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=rz($,Z,...X),G=Z4(J,Y);return{destination:J,destinationStream:G,from:q,unpipeSignal:Q}}catch(J){return{destinationError:J}}},rz=($,Z,X,...J)=>{if(Array.isArray(X))return{destination:Z(zX,$)(X,...J),pipeOptions:$};if(typeof X==="string"||X instanceof URL||L2(X)){if(Object.keys($).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[q,Y,Q]=D$(X,...J);return{destination:Z(zX)(q,Y,Q),pipeOptions:Q}}if(t0.has(X)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:X,pipeOptions:J[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${X}`)},zX=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),sz=($,Z)=>{try{return{sourceStream:o1($,Z)}}catch(X){return{sourceError:X}}};var UX=({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=ez({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J});if(G!==void 0)throw j3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},ez=({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J})=>{if(Z!==void 0&&J!==void 0)return J;if(J!==void 0)return F3($),J;if(Z!==void 0)return T3(X),Z},j3=({error:$,fileDescriptors:Z,sourceOptions:X,startTime:J})=>s1({error:$,command:BX,escapedCommand:BX,fileDescriptors:Z,options:X,startTime:J,isSync:!1}),BX="source.pipe(destination)";var WX=async($)=>{let[{status:Z,reason:X,value:J=X},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(J))Q.pipedFrom.push(J);if(q==="rejected")throw Q;if(Z==="rejected")throw J;return Q};import{finished as $K}from"node:stream/promises";var VX=($,Z,X)=>{let J=f4.has(Z)?XK($,Z):ZK($,Z);return C1($,QK,X.signal),C1(Z,qK,X.signal),JK(Z),J},ZK=($,Z)=>{let X=I1([$]);return Z$(X,Z),f4.set(Z,X),X},XK=($,Z)=>{let X=f4.get(Z);return X.add($),X},JK=async($)=>{try{await $K($,{cleanup:!0,readable:!1,writable:!0})}catch{}f4.delete($)},f4=new WeakMap,QK=2,qK=1;import{aborted as YK}from"node:util";var LX=($,Z)=>$===void 0?[]:[GK($,Z)],GK=async($,{sourceStream:Z,mergedStream:X,fileDescriptors:J,sourceOptions:q,startTime:Y})=>{await YK($,Z),await X.remove(Z);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw j3({error:Q,fileDescriptors:J,sourceOptions:q,startTime:Y})};var k4=($,...Z)=>{if(Y0(Z[0]))return k4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...Z[0]}});let{destination:X,...J}=KX($,...Z),q=HK({...J,destination:X});return q.pipe=k4.bind(void 0,{...$,source:X,sourcePromise:q,boundOptions:{}}),q},HK=async({sourcePromise:$,sourceStream:Z,sourceOptions:X,sourceError:J,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let W=zK($,q);UX({sourceStream:Z,sourceError:J,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:X,startTime:K});let U=new AbortController;try{let B=VX(Z,Y,U);return await Promise.race([WX(W),...LX(G,{sourceStream:Z,mergedStream:B,sourceOptions:X,fileDescriptors:H,startTime:K})])}finally{U.abort()}},zK=($,Z)=>Promise.allSettled([$,Z]);import{setImmediate as _K}from"node:timers/promises";import{on as KK}from"node:events";import{getDefaultHighWaterMark as BK}from"node:stream";var b4=({subprocessStdout:$,subprocess:Z,binary:X,shouldEncode:J,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return UK(Z,Q),RX({stream:$,controller:Q,binary:X,shouldEncode:!$.readableObjectMode&&J,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},UK=async($,Z)=>{try{await $}catch{}finally{Z.abort()}},I3=({stream:$,onStreamEnd:Z,lines:X,encoding:J,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;WK(Z,Q,$);let G=$.readableObjectMode&&!Y;return RX({stream:$,controller:Q,binary:J==="buffer",shouldEncode:!G,encoding:J,shouldSplit:!G&&X,preserveNewlines:!q})},WK=async($,Z,X)=>{try{await $}catch{X.destroy()}finally{Z.abort()}},RX=({stream:$,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=KK($,"data",{signal:Z.signal,highWaterMark:_X,highWatermark:_X});return VK({onStdoutChunk:G,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})},w3=BK(!0),_X=w3,VK=async function*({onStdoutChunk:$,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=LK({binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*j1(H,G,0)}catch(H){if(!Z.signal.aborted)throw H}finally{yield*T$(G)}},LK=({binary:$,shouldEncode:Z,encoding:X,shouldSplit:J,preserveNewlines:q})=>[E4($,X,!Z),O4($,q,!J,{})].filter(Boolean);var TX=async({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:W})=>{let U=RK({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,allMixed:G,verboseInfo:K,streamInfo:W});if(!q){await Promise.all([TK($),U]);return}let B=Y3(H,X),R=I3({stream:$,onStreamEnd:Z,lines:Q,encoding:J,stripFinalNewline:B,allMixed:G}),[_]=await Promise.all([FK({stream:$,iterable:R,fdNumber:X,encoding:J,maxBuffer:Y,lines:Q}),U]);return _},RK=async({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!N4({stdioItems:Q[X]?.stdioItems,encoding:J,verboseInfo:Y,fdNumber:X}))return;let G=I3({stream:$,onStreamEnd:Z,lines:!0,encoding:J,stripFinalNewline:!0,allMixed:q});await IZ(G,$,X,Y)},TK=async($)=>{if(await _K(),$.readableFlowing===null)$.resume()},FK=async({stream:$,stream:{readableObjectMode:Z},iterable:X,fdNumber:J,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(Z||Q)return await R4(X,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await T4(X,{maxBuffer:Y}));return await M4(X,{maxBuffer:Y})}catch(G){return FX(I5({error:G,stream:$,readableObjectMode:Z,lines:Q,encoding:q,fdNumber:J}))}},O3=async($)=>{try{return await $}catch(Z){return FX(Z)}},FX=({bufferedData:$})=>m6($)?new Uint8Array($):$;import{finished as MK}from"node:stream/promises";var P$=async($,Z,X,{isSameDirection:J,stopOnExit:q=!1}={})=>{let Y=CK($,X),Q=new AbortController;try{await Promise.race([...q?[X.exitPromise]:[],MK($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)jK(G,Z,X,J)}finally{Q.abort()}},CK=($,{originalStreams:[Z],subprocess:X})=>{let J={stdinCleanedUp:!1};if($===Z)PK($,X,J);return J},PK=($,Z,X)=>{let{_destroy:J}=$;$._destroy=(...q)=>{xK(Z,X),J.call($,...q)}},xK=({exitCode:$,signalCode:Z},X)=>{if($!==null||Z!==null)X.stdinCleanedUp=!0},jK=($,Z,X,J)=>{if(!IK($,Z,X,J))throw $},IK=($,Z,X,J=!0)=>{if(X.propagating)return MX($)||y4($);return X.propagating=!0,E3(X,Z)===J?MX($):y4($)},E3=({fileDescriptors:$},Z)=>Z!=="all"&&$[Z].direction==="input",y4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",MX=($)=>$?.code==="EPIPE";var CX=({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>A3({stream:H,fdNumber:K,encoding:Z,buffer:X[K],maxBuffer:J[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),A3=async({stream:$,fdNumber:Z,encoding:X,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let W=P$($,Z,K);if(E3(K,Z)){await W;return}let[U]=await Promise.all([TX({stream:$,onStreamEnd:W,fdNumber:Z,encoding:X,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K}),W]);return U};var PX=({stdout:$,stderr:Z},{all:X})=>X&&($||Z)?I1([$,Z].filter(Boolean)):void 0,xX=({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>A3({...wK($,X),fdNumber:"all",encoding:Z,maxBuffer:J[1]+J[2],lines:q[1]||q[2],allMixed:OK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),wK=({stdout:$,stderr:Z,all:X},[,J,q])=>{let Y=J||q;if(!Y)return{stream:X,buffer:Y};if(!J)return{stream:Z,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:X,buffer:Y}},OK=({all:$,stdout:Z,stderr:X})=>$&&Z&&X&&Z.readableObjectMode!==X.readableObjectMode;import{once as EK}from"node:events";var jX=($)=>d1($,"ipc"),IX=($,Z)=>{let X=m$($);l0({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:Z})};var wX=async({subprocess:$,buffer:Z,maxBuffer:X,ipc:J,ipcOutput:q,verboseInfo:Y})=>{if(!J)return q;let Q=jX(Y),G=X1(Z,"ipc"),H=X1(X,"ipc");for await(let K of L3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:J,shouldAwait:!1,reference:!0})){if(G)w5($,q,H),q.push(K);if(Q)IX(K,Y)}return q},OX=async($,Z)=>{return await Promise.allSettled([$]),Z};var EX=async({subprocess:$,options:{encoding:Z,buffer:X,maxBuffer:J,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:K,ipc:W,ipcInput:U},context:B,verboseInfo:R,fileDescriptors:_,originalStreams:L,onInternalError:j,controller:C})=>{let N=hZ($,B),c={originalStreams:L,fileDescriptors:_,subprocess:$,exitPromise:N,propagating:!1},I=CX({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:K,verboseInfo:R,streamInfo:c}),n=xX({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:K,verboseInfo:R,streamInfo:c}),i=[],a=wX({subprocess:$,buffer:X,maxBuffer:J,ipc:W,ipcOutput:i,verboseInfo:R}),K0=AK(L,$,c),l=hK(_,c);try{return await Promise.race([Promise.all([{},DZ(N),Promise.all(I),n,a,J5($,U),...K0,...l]),j,NK($,C),...s8($,Y,B,C),...F8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:B,controller:C}),...a8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:B,controller:C})])}catch(x0){return B.terminationReason??="other",Promise.all([{error:x0},N,Promise.all(I.map((E)=>O3(E))),O3(n),OX(a,i),Promise.allSettled(K0),Promise.allSettled(l)])}},AK=($,Z,X)=>$.map((J,q)=>J===Z.stdio[q]?void 0:P$(J,q,X)),hK=($,Z)=>$.flatMap(({stdioItems:X},J)=>X.filter(({value:q,stream:Y=q})=>u0(Y,{checkOpen:!1})&&!y0(Y)).map(({type:q,value:Y,stream:Q=Y})=>P$(Q,J,Z,{isSameDirection:D0.has(q),stopOnExit:q==="native"}))),NK=async($,{signal:Z})=>{let[X]=await EK($,"error",{signal:Z});throw X};var AX=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),x$=($,Z,X)=>{let J=$[X];if(!J.has(Z))J.set(Z,[]);let q=J.get(Z),Y=i0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},X$=async({resolve:$,promises:Z},X)=>{$();let[J]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...Z])]);return!J};import{Readable as DK}from"node:stream";import{callbackify as SK}from"node:util";import{finished as hX}from"node:stream/promises";var h3=async($)=>{if($===void 0)return;try{await N3($)}catch{}},NX=async($)=>{if($===void 0)return;try{await D3($)}catch{}},N3=async($)=>{await hX($,{cleanup:!0,readable:!1,writable:!0})},D3=async($)=>{await hX($,{cleanup:!0,readable:!0,writable:!1})},g4=async($,Z)=>{if(await $,Z)throw Z},u4=($,Z,X)=>{if(X&&!y4(X))$.destroy(X);else if(Z)$.destroy()};var DX=({subprocess:$,concurrentStreams:Z,encoding:X},{from:J,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||j0.has(X),{subprocessStdout:G,waitReadableDestroy:H}=S3($,J,Z),{readableEncoding:K,readableObjectMode:W,readableHighWaterMark:U}=v3(G,Q),{read:B,onStdoutDataDone:R}=f3({subprocessStdout:G,subprocess:$,binary:Q,encoding:X,preserveNewlines:Y}),_=new DK({read:B,destroy:SK(b3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:U,objectMode:W,encoding:K});return k3({subprocessStdout:G,onStdoutDataDone:R,readable:_,subprocess:$}),_},S3=($,Z,X)=>{let J=o1($,Z),q=x$(X,J,"readableDestroy");return{subprocessStdout:J,waitReadableDestroy:q}},v3=({readableEncoding:$,readableObjectMode:Z,readableHighWaterMark:X},J)=>J?{readableEncoding:$,readableObjectMode:Z,readableHighWaterMark:X}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:w3},f3=({subprocessStdout:$,subprocess:Z,binary:X,encoding:J,preserveNewlines:q})=>{let Y=i0(),Q=b4({subprocessStdout:$,subprocess:Z,binary:X,shouldEncode:!X,encoding:J,preserveNewlines:q});return{read(){vK(this,Q,Y)},onStdoutDataDone:Y}},vK=async($,Z,X)=>{try{let{value:J,done:q}=await Z.next();if(q)X.resolve();else $.push(J)}catch{}},k3=async({subprocessStdout:$,onStdoutDataDone:Z,readable:X,subprocess:J,subprocessStdin:q})=>{try{if(await D3($),await J,await h3(q),await Z,X.readable)X.push(null)}catch(Y){await h3(q),SX(X,Y)}},b3=async({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},J)=>{if(await X$(X,Z))SX($,J),await g4(Z,J)},SX=($,Z)=>{u4($,$.readable,Z)};import{Writable as fK}from"node:stream";import{callbackify as vX}from"node:util";var fX=({subprocess:$,concurrentStreams:Z},{to:X}={})=>{let{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}=y3($,X,Z),Q=new fK({...g3(J,$,q),destroy:vX(m3.bind(void 0,{subprocessStdin:J,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:J.writableHighWaterMark,objectMode:J.writableObjectMode});return u3(J,Q),Q},y3=($,Z,X)=>{let J=Z4($,Z),q=x$(X,J,"writableFinal"),Y=x$(X,J,"writableDestroy");return{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}},g3=($,Z,X)=>({write:kK.bind(void 0,$),final:vX(bK.bind(void 0,$,Z,X))}),kK=($,Z,X,J)=>{if($.write(Z,X))J();else $.once("drain",J)},bK=async($,Z,X)=>{if(await X$(X,Z)){if($.writable)$.end();await Z}},u3=async($,Z,X)=>{try{if(await N3($),Z.writable)Z.end()}catch(J){await NX(X),kX(Z,J)}},m3=async({subprocessStdin:$,subprocess:Z,waitWritableFinal:X,waitWritableDestroy:J},q)=>{if(await X$(X,Z),await X$(J,Z))kX($,q),await g4(Z,q)},kX=($,Z)=>{u4($,$.writable,Z)};import{Duplex as yK}from"node:stream";import{callbackify as gK}from"node:util";var bX=({subprocess:$,concurrentStreams:Z,encoding:X},{from:J,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||j0.has(X),{subprocessStdout:H,waitReadableDestroy:K}=S3($,J,Z),{subprocessStdin:W,waitWritableFinal:U,waitWritableDestroy:B}=y3($,q,Z),{readableEncoding:R,readableObjectMode:_,readableHighWaterMark:L}=v3(H,G),{read:j,onStdoutDataDone:C}=f3({subprocessStdout:H,subprocess:$,binary:G,encoding:X,preserveNewlines:Q}),N=new yK({read:j,...g3(W,$,U),destroy:gK(uK.bind(void 0,{subprocessStdout:H,subprocessStdin:W,subprocess:$,waitReadableDestroy:K,waitWritableFinal:U,waitWritableDestroy:B})),readableHighWaterMark:L,writableHighWaterMark:W.writableHighWaterMark,readableObjectMode:_,writableObjectMode:W.writableObjectMode,encoding:R});return k3({subprocessStdout:H,onStdoutDataDone:C,readable:N,subprocess:$,subprocessStdin:W}),u3(W,N,H),N},uK=async({subprocessStdout:$,subprocessStdin:Z,subprocess:X,waitReadableDestroy:J,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([b3({subprocessStdout:$,subprocess:X,waitReadableDestroy:J},Q),m3({subprocessStdin:Z,subprocess:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var c3=($,Z,{from:X,binary:J=!1,preserveNewlines:q=!1}={})=>{let Y=J||j0.has(Z),Q=o1($,X),G=b4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:Z,preserveNewlines:q});return mK(G,Q,$)},mK=async function*($,Z,X){try{yield*$}finally{if(Z.readable)Z.destroy();await X}};var yX=($,{encoding:Z})=>{let X=AX();$.readable=DX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:Z}),$.writable=fX.bind(void 0,{subprocess:$,concurrentStreams:X}),$.duplex=bX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:Z}),$.iterable=c3.bind(void 0,$,Z),$[Symbol.asyncIterator]=c3.bind(void 0,$,Z,{})};var gX=($,Z)=>{for(let[X,J]of pK){let q=J.value.bind(Z);Reflect.defineProperty($,X,{...J,value:q})}},cK=(async()=>{})().constructor.prototype,pK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(cK,$)]);var uX=($,Z,X,J)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:W,fileDescriptors:U}=nK($,Z,X),{subprocess:B,promise:R}=tK({file:q,commandArguments:Y,options:W,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:U});return B.pipe=k4.bind(void 0,{source:B,sourcePromise:R,boundOptions:{},createNested:J}),gX(B,R),t0.set(B,{options:W,fileDescriptors:U}),B},nK=($,Z,X)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=p$($,Z,X),{file:G,commandArguments:H,options:K}=U4($,Z,X),W=iK(K),U=iZ(W,Q);return{file:G,commandArguments:H,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:U}},iK=({timeout:$,signal:Z,...X})=>{if(Z!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:$}},tK=({file:$,commandArguments:Z,options:X,startTime:J,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=lK(...W4($,Z,X))}catch(_){return pZ({error:_,command:Y,escapedCommand:Q,fileDescriptors:G,options:X,startTime:J,verboseInfo:q})}let K=new AbortController;dK(Number.POSITIVE_INFINITY,K.signal);let W=[...H.stdio];JX(H,G,K),HX(H,X,K);let U={},B=i0();H.kill=R8.bind(void 0,{kill:H.kill.bind(H),options:X,onInternalError:B,context:U,controller:K}),H.all=PX(H,X),yX(H,X),uZ(H,X);let R=oK({subprocess:H,options:X,startTime:J,verboseInfo:q,fileDescriptors:G,originalStreams:W,command:Y,escapedCommand:Q,context:U,onInternalError:B,controller:K});return{subprocess:H,promise:R}},oK=async({subprocess:$,options:Z,startTime:X,verboseInfo:J,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:K,controller:W})=>{let[U,[B,R],_,L,j]=await EX({subprocess:$,options:Z,context:H,verboseInfo:J,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:W});W.abort(),K.resolve();let C=_.map((I,n)=>q1(I,Z,n)),N=q1(L,Z,"all"),c=aK({errorInfo:U,exitCode:B,signal:R,stdio:C,all:N,ipcOutput:j,context:H,options:Z,command:Q,escapedCommand:G,startTime:X});return e1(c,J,Z)},aK=({errorInfo:$,exitCode:Z,signal:X,stdio:J,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:K,startTime:W})=>("error"in $)?R$({error:$.error,command:H,escapedCommand:K,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof J1,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:Z,signal:X,stdio:J,all:q,ipcOutput:Y,options:G,startTime:W,isSync:!1}):P4({command:H,escapedCommand:K,stdio:J,all:q,ipcOutput:Y,options:G,startTime:W});var m4=($,Z)=>{let X=Object.fromEntries(Object.entries(Z).map(([J,q])=>[J,rK(J,$[J],q)]));return{...$,...X}},rK=($,Z,X)=>{if(sK.has($)&&Y0(Z)&&Y0(X))return{...Z,...X};return X},sK=new Set(["env",...C2]);var B1=($,Z,X,J)=>{let q=(Q,G,H)=>B1(Q,G,X,H),Y=(...Q)=>eK({mapArguments:$,deepOptions:X,boundOptions:Z,setBoundExeca:J,createNested:q},...Q);if(J!==void 0)J(Y,q,Z);return Y},eK=({mapArguments:$,deepOptions:Z={},boundOptions:X={},setBoundExeca:J,createNested:q},Y,...Q)=>{if(Y0(Y))return q($,m4(X,Y),J);let{file:G,commandArguments:H,options:K,isSync:W}=$B({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:Z,boundOptions:X});return W?vZ(G,H,K):uX(G,H,K,q)},$B=({mapArguments:$,firstArgument:Z,nextArguments:X,deepOptions:J,boundOptions:q})=>{let Y=i6(Z)?t6(Z,X):[Z,...X],[Q,G,H]=D$(...Y),K=m4(m4(J,q),H),{file:W=Q,commandArguments:U=G,options:B=K,isSync:R=!1}=$({file:Q,commandArguments:G,options:K});return{file:W,commandArguments:U,options:B,isSync:R}};var mX=({file:$,commandArguments:Z})=>pX($,Z),cX=({file:$,commandArguments:Z})=>({...pX($,Z),isSync:!0}),pX=($,Z)=>{if(Z.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${Z}.`);let[X,...J]=ZB($);return{file:X,commandArguments:J}},ZB=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let Z=$.trim();if(Z==="")return[];let X=[];for(let J of Z.split(XB)){let q=X.at(-1);if(q&&q.endsWith("\\"))X[X.length-1]=`${q.slice(0,-1)} ${J}`;else X.push(J)}return X},XB=/ +/g;var dX=($,Z,X)=>{$.sync=Z(JB,X),$.s=$.sync},lX=({options:$})=>nX($),JB=({options:$})=>({...nX($),isSync:!0}),nX=($)=>({options:{...QB($),...$}}),QB=({input:$,inputFile:Z,stdio:X})=>$===void 0&&Z===void 0&&X===void 0?{stdin:"inherit"}:{},iX={preferLocal:!0};var m0=B1(()=>({})),px=B1(()=>({isSync:!0})),dx=B1(mX),lx=B1(cX),nx=B1($5),ix=B1(lX,{},iX,dX),{sendMessage:tx,getOneMessage:ox,getEachMessage:ax,getCancelSignal:rx}=mZ();import{stripVTControlCharacters as Z6}from"node:util";var F0=$1(d3(),1),GJ=$1(d4(),1);import{stdin as qJ,stdout as YJ}from"node:process";import*as U1 from"node:readline";import rX from"node:readline";import{Writable as KB}from"node:stream";function BB({onlyFirst:$=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,$?void 0:"g")}var UB=BB();function HJ($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(UB,"")}function zJ($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var KJ={exports:{}};(function($){var Z={};$.exports=Z,Z.eastAsianWidth=function(J){var q=J.charCodeAt(0),Y=J.length==2?J.charCodeAt(1):0,Q=q;return 55296<=q&&q<=56319&&56320<=Y&&Y<=57343&&(q&=1023,Y&=1023,Q=q<<10|Y,Q+=65536),Q==12288||65281<=Q&&Q<=65376||65504<=Q&&Q<=65510?"F":Q==8361||65377<=Q&&Q<=65470||65474<=Q&&Q<=65479||65482<=Q&&Q<=65487||65490<=Q&&Q<=65495||65498<=Q&&Q<=65500||65512<=Q&&Q<=65518?"H":4352<=Q&&Q<=4447||4515<=Q&&Q<=4519||4602<=Q&&Q<=4607||9001<=Q&&Q<=9002||11904<=Q&&Q<=11929||11931<=Q&&Q<=12019||12032<=Q&&Q<=12245||12272<=Q&&Q<=12283||12289<=Q&&Q<=12350||12353<=Q&&Q<=12438||12441<=Q&&Q<=12543||12549<=Q&&Q<=12589||12593<=Q&&Q<=12686||12688<=Q&&Q<=12730||12736<=Q&&Q<=12771||12784<=Q&&Q<=12830||12832<=Q&&Q<=12871||12880<=Q&&Q<=13054||13056<=Q&&Q<=19903||19968<=Q&&Q<=42124||42128<=Q&&Q<=42182||43360<=Q&&Q<=43388||44032<=Q&&Q<=55203||55216<=Q&&Q<=55238||55243<=Q&&Q<=55291||63744<=Q&&Q<=64255||65040<=Q&&Q<=65049||65072<=Q&&Q<=65106||65108<=Q&&Q<=65126||65128<=Q&&Q<=65131||110592<=Q&&Q<=110593||127488<=Q&&Q<=127490||127504<=Q&&Q<=127546||127552<=Q&&Q<=127560||127568<=Q&&Q<=127569||131072<=Q&&Q<=194367||177984<=Q&&Q<=196605||196608<=Q&&Q<=262141?"W":32<=Q&&Q<=126||162<=Q&&Q<=163||165<=Q&&Q<=166||Q==172||Q==175||10214<=Q&&Q<=10221||10629<=Q&&Q<=10630?"Na":Q==161||Q==164||167<=Q&&Q<=168||Q==170||173<=Q&&Q<=174||176<=Q&&Q<=180||182<=Q&&Q<=186||188<=Q&&Q<=191||Q==198||Q==208||215<=Q&&Q<=216||222<=Q&&Q<=225||Q==230||232<=Q&&Q<=234||236<=Q&&Q<=237||Q==240||242<=Q&&Q<=243||247<=Q&&Q<=250||Q==252||Q==254||Q==257||Q==273||Q==275||Q==283||294<=Q&&Q<=295||Q==299||305<=Q&&Q<=307||Q==312||319<=Q&&Q<=322||Q==324||328<=Q&&Q<=331||Q==333||338<=Q&&Q<=339||358<=Q&&Q<=359||Q==363||Q==462||Q==464||Q==466||Q==468||Q==470||Q==472||Q==474||Q==476||Q==593||Q==609||Q==708||Q==711||713<=Q&&Q<=715||Q==717||Q==720||728<=Q&&Q<=731||Q==733||Q==735||768<=Q&&Q<=879||913<=Q&&Q<=929||931<=Q&&Q<=937||945<=Q&&Q<=961||963<=Q&&Q<=969||Q==1025||1040<=Q&&Q<=1103||Q==1105||Q==8208||8211<=Q&&Q<=8214||8216<=Q&&Q<=8217||8220<=Q&&Q<=8221||8224<=Q&&Q<=8226||8228<=Q&&Q<=8231||Q==8240||8242<=Q&&Q<=8243||Q==8245||Q==8251||Q==8254||Q==8308||Q==8319||8321<=Q&&Q<=8324||Q==8364||Q==8451||Q==8453||Q==8457||Q==8467||Q==8470||8481<=Q&&Q<=8482||Q==8486||Q==8491||8531<=Q&&Q<=8532||8539<=Q&&Q<=8542||8544<=Q&&Q<=8555||8560<=Q&&Q<=8569||Q==8585||8592<=Q&&Q<=8601||8632<=Q&&Q<=8633||Q==8658||Q==8660||Q==8679||Q==8704||8706<=Q&&Q<=8707||8711<=Q&&Q<=8712||Q==8715||Q==8719||Q==8721||Q==8725||Q==8730||8733<=Q&&Q<=8736||Q==8739||Q==8741||8743<=Q&&Q<=8748||Q==8750||8756<=Q&&Q<=8759||8764<=Q&&Q<=8765||Q==8776||Q==8780||Q==8786||8800<=Q&&Q<=8801||8804<=Q&&Q<=8807||8810<=Q&&Q<=8811||8814<=Q&&Q<=8815||8834<=Q&&Q<=8835||8838<=Q&&Q<=8839||Q==8853||Q==8857||Q==8869||Q==8895||Q==8978||9312<=Q&&Q<=9449||9451<=Q&&Q<=9547||9552<=Q&&Q<=9587||9600<=Q&&Q<=9615||9618<=Q&&Q<=9621||9632<=Q&&Q<=9633||9635<=Q&&Q<=9641||9650<=Q&&Q<=9651||9654<=Q&&Q<=9655||9660<=Q&&Q<=9661||9664<=Q&&Q<=9665||9670<=Q&&Q<=9672||Q==9675||9678<=Q&&Q<=9681||9698<=Q&&Q<=9701||Q==9711||9733<=Q&&Q<=9734||Q==9737||9742<=Q&&Q<=9743||9748<=Q&&Q<=9749||Q==9756||Q==9758||Q==9792||Q==9794||9824<=Q&&Q<=9825||9827<=Q&&Q<=9829||9831<=Q&&Q<=9834||9836<=Q&&Q<=9837||Q==9839||9886<=Q&&Q<=9887||9918<=Q&&Q<=9919||9924<=Q&&Q<=9933||9935<=Q&&Q<=9953||Q==9955||9960<=Q&&Q<=9983||Q==10045||Q==10071||10102<=Q&&Q<=10111||11093<=Q&&Q<=11097||12872<=Q&&Q<=12879||57344<=Q&&Q<=63743||65024<=Q&&Q<=65039||Q==65533||127232<=Q&&Q<=127242||127248<=Q&&Q<=127277||127280<=Q&&Q<=127337||127344<=Q&&Q<=127386||917760<=Q&&Q<=917999||983040<=Q&&Q<=1048573||1048576<=Q&&Q<=1114109?"A":"N"},Z.characterLength=function(J){var q=this.eastAsianWidth(J);return q=="F"||q=="W"||q=="A"?2:1};function X(J){return J.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}Z.length=function(J){for(var q=X(J),Y=0,Q=0;Q<q.length;Q++)Y=Y+this.characterLength(q[Q]);return Y},Z.slice=function(J,q,Y){textLen=Z.length(J),q=q||0,Y=Y||1,q<0&&(q=textLen+q),Y<0&&(Y=textLen+Y);for(var Q="",G=0,H=X(J),K=0;K<H.length;K++){var W=H[K],U=Z.length(W);if(G>=q-(U==2?1:0))if(G+U<=Y)Q+=W;else break;G+=U}return Q}})(KJ);var WB=KJ.exports,VB=zJ(WB),LB=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},_B=zJ(LB);function j$($,Z={}){if(typeof $!="string"||$.length===0||(Z={ambiguousIsNarrow:!0,...Z},$=HJ($),$.length===0))return 0;$=$.replace(_B()," ");let X=Z.ambiguousIsNarrow?1:2,J=0;for(let q of $){let Y=q.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(VB.eastAsianWidth(q)){case"F":case"W":J+=2;break;case"A":J+=X;break;default:J+=1}}return J}var n3=10,sX=($=0)=>(Z)=>`\x1B[${Z+$}m`,eX=($=0)=>(Z)=>`\x1B[${38+$};5;${Z}m`,$J=($=0)=>(Z,X,J)=>`\x1B[${38+$};2;${Z};${X};${J}m`,J0={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(J0.modifier);var RB=Object.keys(J0.color),TB=Object.keys(J0.bgColor);[...RB,...TB];function FB(){let $=new Map;for(let[Z,X]of Object.entries(J0)){for(let[J,q]of Object.entries(X))J0[J]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},X[J]=J0[J],$.set(q[0],q[1]);Object.defineProperty(J0,Z,{value:X,enumerable:!1})}return Object.defineProperty(J0,"codes",{value:$,enumerable:!1}),J0.color.close="\x1B[39m",J0.bgColor.close="\x1B[49m",J0.color.ansi=sX(),J0.color.ansi256=eX(),J0.color.ansi16m=$J(),J0.bgColor.ansi=sX(n3),J0.bgColor.ansi256=eX(n3),J0.bgColor.ansi16m=$J(n3),Object.defineProperties(J0,{rgbToAnsi256:{value:(Z,X,J)=>Z===X&&X===J?Z<8?16:Z>248?231:Math.round((Z-8)/247*24)+232:16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(J/255*5),enumerable:!1},hexToRgb:{value:(Z)=>{let X=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Z.toString(16));if(!X)return[0,0,0];let[J]=X;J.length===3&&(J=[...J].map((Y)=>Y+Y).join(""));let q=Number.parseInt(J,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(Z)=>J0.rgbToAnsi256(...J0.hexToRgb(Z)),enumerable:!1},ansi256ToAnsi:{value:(Z)=>{if(Z<8)return 30+Z;if(Z<16)return 90+(Z-8);let X,J,q;if(Z>=232)X=((Z-232)*10+8)/255,J=X,q=X;else{Z-=16;let G=Z%36;X=Math.floor(Z/36)/5,J=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(X,J,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(J)<<1|Math.round(X));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(Z,X,J)=>J0.ansi256ToAnsi(J0.rgbToAnsi256(Z,X,J)),enumerable:!1},hexToAnsi:{value:(Z)=>J0.ansi256ToAnsi(J0.hexToAnsi256(Z)),enumerable:!1}}),J0}var MB=FB(),i4=new Set(["\x1B","›"]),CB=39,o3="\x07",BJ="[",PB="]",UJ="m",a3=`${PB}8;;`,ZJ=($)=>`${i4.values().next().value}${BJ}${$}${UJ}`,XJ=($)=>`${i4.values().next().value}${a3}${$}${o3}`,xB=($)=>$.split(" ").map((Z)=>j$(Z)),i3=($,Z,X)=>{let J=[...Z],q=!1,Y=!1,Q=j$(HJ($[$.length-1]));for(let[G,H]of J.entries()){let K=j$(H);if(Q+K<=X?$[$.length-1]+=H:($.push(H),Q=0),i4.has(H)&&(q=!0,Y=J.slice(G+1).join("").startsWith(a3)),q){Y?H===o3&&(q=!1,Y=!1):H===UJ&&(q=!1);continue}Q+=K,Q===X&&G<J.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},jB=($)=>{let Z=$.split(" "),X=Z.length;for(;X>0&&!(j$(Z[X-1])>0);)X--;return X===Z.length?$:Z.slice(0,X).join(" ")+Z.slice(X).join("")},IB=($,Z,X={})=>{if(X.trim!==!1&&$.trim()==="")return"";let J="",q,Y,Q=xB($),G=[""];for(let[K,W]of $.split(" ").entries()){X.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let U=j$(G[G.length-1]);if(K!==0&&(U>=Z&&(X.wordWrap===!1||X.trim===!1)&&(G.push(""),U=0),(U>0||X.trim===!1)&&(G[G.length-1]+=" ",U++)),X.hard&&Q[K]>Z){let B=Z-U,R=1+Math.floor((Q[K]-B-1)/Z);Math.floor((Q[K]-1)/Z)<R&&G.push(""),i3(G,W,Z);continue}if(U+Q[K]>Z&&U>0&&Q[K]>0){if(X.wordWrap===!1&&U<Z){i3(G,W,Z);continue}G.push("")}if(U+Q[K]>Z&&X.wordWrap===!1){i3(G,W,Z);continue}G[G.length-1]+=W}X.trim!==!1&&(G=G.map((K)=>jB(K)));let H=[...G.join(`
45
- `)];for(let[K,W]of H.entries()){if(J+=W,i4.has(W)){let{groups:B}=new RegExp(`(?:\\${BJ}(?<code>\\d+)m|\\${a3}(?<uri>.*)${o3})`).exec(H.slice(K).join(""))||{groups:{}};if(B.code!==void 0){let R=Number.parseFloat(B.code);q=R===CB?void 0:R}else B.uri!==void 0&&(Y=B.uri.length===0?void 0:B.uri)}let U=MB.codes.get(Number(q));H[K+1]===`
44
+ if (condition) { yield value; }`)};import{Buffer as wH}from"node:buffer";import{StringDecoder as OH}from"node:string_decoder";var E4=($,Z,X)=>{if(X)return;if($)return{transform:EH.bind(void 0,new TextEncoder)};let J=new OH(Z);return{transform:AH.bind(void 0,J),final:hH.bind(void 0,J)}},EH=function*($,Z){if(wH.isBuffer(Z))yield $1(Z);else if(typeof Z==="string")yield $.encode(Z);else yield Z},AH=function*($,Z){yield L0(Z)?$.write(Z):Z},hH=function*($){let Z=$.end();if(Z!=="")yield Z};import{callbackify as TZ}from"node:util";var z3=TZ(async($,Z,X,J)=>{Z.currentIterable=$(...X);try{for await(let q of Z.currentIterable)J.push(q)}finally{delete Z.currentIterable}}),A4=async function*($,Z,X){if(X===Z.length){yield $;return}let{transform:J=DH}=Z[X];for await(let q of J($))yield*A4(q,Z,X+1)},FZ=async function*($){for(let[Z,{final:X}]of Object.entries($))yield*NH(X,Number(Z),$)},NH=async function*($,Z,X){if($===void 0)return;for await(let J of $())yield*A4(J,X,Z+1)},MZ=TZ(async({currentIterable:$},Z)=>{if($!==void 0){await(Z?$.throw(Z):$.return());return}if(Z)throw Z}),DH=function*($){yield $};var K3=($,Z,X,J)=>{try{for(let q of $(...Z))X.push(q);J()}catch(q){J(q)}},CZ=($,Z)=>[...Z.flatMap((X)=>[...x1(X,$,0)]),...T$($)],x1=function*($,Z,X){if(X===Z.length){yield $;return}let{transform:J=vH}=Z[X];for(let q of J($))yield*x1(q,Z,X+1)},T$=function*($){for(let[Z,{final:X}]of Object.entries($))yield*SH(X,Number(Z),$)},SH=function*($,Z,X){if($===void 0)return;for(let J of $())yield*x1(J,X,Z+1)},vH=function*($){yield $};var B3=({value:$,value:{transform:Z,final:X,writableObjectMode:J,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=xZ($,Q,Y),K=P1(Z),W=P1(X),U=K?z3.bind(void 0,A4,G):K3.bind(void 0,x1),B=K||W?z3.bind(void 0,FZ,G):K3.bind(void 0,T$),R=K||W?MZ.bind(void 0,G):void 0;return{stream:new fH({writableObjectMode:J,writableHighWaterMark:PZ(J),readableObjectMode:q,readableHighWaterMark:PZ(q),transform(L,j,C){U([L,H,0],this,C)},flush(L){B([H],this,L)},destroy:R})}},h4=($,Z,X,J)=>{let q=Z.filter(({type:Q})=>Q==="generator"),Y=J?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=xZ(Q,X,G);$=CZ(H,$)}return $},xZ=({transform:$,final:Z,binary:X,writableObjectMode:J,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:LZ(J,G)},E4(X,Q,J),O4(X,Y,J,H),{transform:$,final:Z},{transform:_Z(q,G)},VZ({binary:X,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var jZ=($,Z)=>{for(let X of kH($))bH($,X,Z)},kH=($)=>new Set(Object.entries($).filter(([,{direction:Z}])=>Z==="input").map(([Z])=>Number(Z))),bH=($,Z,X)=>{let{stdioItems:J}=$[Z],q=J.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(Z!==0){let[{type:G,optionName:H}]=q;throw TypeError(`Only the \`stdin\` option, not \`${H}\`, can be ${z1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>yH(G,J));X.input=K$(Q)},yH=($,Z)=>{let X=h4($,Z,"utf8",!0);return gH(X),K$(X)},gH=($)=>{let Z=$.find((X)=>typeof X!=="string"&&!L0(X));if(Z!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${Z}.`)};import{writeFileSync as pH,appendFileSync as dH}from"node:fs";var N4=({stdioItems:$,encoding:Z,verboseInfo:X,fdNumber:J})=>J!=="all"&&d1(X,J)&&!j0.has(Z)&&uH(J)&&($.some(({type:q,value:Y})=>q==="native"&&mH.has(Y))||$.every(({type:q})=>D0.has(q))),uH=($)=>$===1||$===2,mH=new Set(["pipe","overlapped"]),IZ=async($,Z,X,J)=>{for await(let q of $)if(!cH(Z))OZ(q,X,J)},wZ=($,Z,X)=>{for(let J of $)OZ(J,Z,X)},cH=($)=>$._readableState.pipes.length>0,OZ=($,Z,X)=>{let J=m$($);l0({type:"output",verboseMessage:J,fdNumber:Z,verboseInfo:X})};var EZ=({fileDescriptors:$,syncResult:{output:Z},options:X,isMaxBuffer:J,verboseInfo:q})=>{if(Z===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:Z.map((H,K)=>lH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:J,verboseInfo:q},X)),...Y}},lH=({result:$,fileDescriptors:Z,fdNumber:X,state:J,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:K,stripFinalNewline:W,maxBuffer:U})=>{if($===null)return;let B=A5($,Y,U),R=$1(B),{stdioItems:_,objectMode:L}=Z[X],j=nH([R],_,H,J),{serializedResult:C,finalResult:N=C}=iH({chunks:j,objectMode:L,encoding:H,lines:K,stripFinalNewline:W,fdNumber:X});tH({serializedResult:C,fdNumber:X,state:J,verboseInfo:Q,encoding:H,stdioItems:_,objectMode:L});let c=G[X]?N:void 0;try{if(J.error===void 0)oH(C,_,q);return c}catch(I){return J.error=I,c}},nH=($,Z,X,J)=>{try{return h4($,Z,X,!1)}catch(q){return J.error=q,$}},iH=({chunks:$,objectMode:Z,encoding:X,lines:J,stripFinalNewline:q,fdNumber:Y})=>{if(Z)return{serializedResult:$};if(X==="buffer")return{serializedResult:K$($)};let Q=p6($,X);if(J[Y])return{serializedResult:Q,finalResult:H3(Q,!q[Y],Z)};return{serializedResult:Q}},tH=({serializedResult:$,fdNumber:Z,state:X,verboseInfo:J,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!N4({stdioItems:Y,encoding:q,verboseInfo:J,fdNumber:Z}))return;let G=H3($,!1,Q);try{wZ(G,Z,J)}catch(H){X.error??=H}},oH=($,Z,X)=>{for(let{path:J,append:q}of Z.filter(({type:Y})=>I4.has(Y))){let Y=typeof J==="string"?J:J.toString();if(q||X.has(Y))dH(J,$);else X.add(Y),pH(J,$)}};var AZ=([,$,Z],X)=>{if(!X.all)return;if($===void 0)return Z;if(Z===void 0)return $;if(Array.isArray($))return Array.isArray(Z)?[...$,...Z]:[...$,Q1(Z,X,"all")];if(Array.isArray(Z))return[Q1($,X,"all"),...Z];if(L0($)&&L0(Z))return R2([$,Z]);return`${$}${Z}`};import{once as U3}from"node:events";var hZ=async($,Z)=>{let[X,J]=await aH($);return Z.isForcefullyTerminated??=!1,[X,J]},aH=async($)=>{let[Z,X]=await Promise.allSettled([U3($,"spawn"),U3($,"exit")]);if(Z.status==="rejected")return[];return X.status==="rejected"?NZ($):X.value},NZ=async($)=>{try{return await U3($,"exit")}catch{return NZ($)}},DZ=async($)=>{let[Z,X]=await $;if(!rH(Z,X)&&W3(Z,X))throw new n0;return[Z,X]},rH=($,Z)=>$===void 0&&Z===void 0,W3=($,Z)=>$!==0||Z!==null;var SZ=({error:$,status:Z,signal:X,output:J},{maxBuffer:q})=>{let Y=sH($,Z,X),Q=Y?.code==="ETIMEDOUT",G=E5(Y,J,q);return{resultError:Y,exitCode:Z,signal:X,timedOut:Q,isMaxBuffer:G}},sH=($,Z,X)=>{if($!==void 0)return $;return W3(Z,X)?new n0:void 0};var vZ=($,Z,X)=>{let{file:J,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:W}=$z($,Z,X),U=Jz({file:J,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:W,startTime:G});return e1(U,H,K)},$z=($,Z,X)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=p$($,Z,X),G=Zz(X),{file:H,commandArguments:K,options:W}=U4($,Z,G);Xz(W);let U=KZ(W,Q);return{file:H,commandArguments:K,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:U}},Zz=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,Xz=({ipc:$,ipcInput:Z,detached:X,cancelSignal:J})=>{if(Z)D4("ipcInput");if($)D4("ipc: true");if(X)D4("detached: true");if(J)D4("cancelSignal")},D4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},Jz=({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=Qz({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:K,exitCode:W,signal:U,timedOut:B,isMaxBuffer:R}=SZ(H,X),{output:_,error:L=K}=EZ({fileDescriptors:Q,syncResult:H,options:X,isMaxBuffer:R,verboseInfo:Y}),j=_.map((N,c)=>Q1(N,X,c)),C=Q1(AZ(_,X),X,"all");return Yz({error:L,exitCode:W,signal:U,timedOut:B,isMaxBuffer:R,stdio:j,all:C,options:X,command:J,escapedCommand:q,startTime:G})},Qz=({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{jZ(Y,X);let G=qz(X);return eH(...W4($,Z,G))}catch(G){return s1({error:G,command:J,escapedCommand:q,fileDescriptors:Y,options:X,startTime:Q,isSync:!0})}},qz=({encoding:$,maxBuffer:Z,...X})=>({...X,encoding:"buffer",maxBuffer:C4(Z)}),Yz=({error:$,exitCode:Z,signal:X,timedOut:J,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:W})=>$===void 0?P4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:W}):R$({error:$,command:H,escapedCommand:K,timedOut:J,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:Z,signal:X,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:W,isSync:!0});import{setMaxListeners as iK}from"node:events";import{spawn as tK}from"node:child_process";import gZ from"node:process";import{once as V3,on as Gz}from"node:events";var fZ=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},{reference:q=!0,filter:Y}={})=>{return i1({methodName:"getOneMessage",isSubprocess:X,ipc:J,isConnected:Y4($)}),Hz({anyProcess:$,channel:Z,isSubprocess:X,filter:Y,reference:q})},Hz=async({anyProcess:$,channel:Z,isSubprocess:X,filter:J,reference:q})=>{X4(Z,q);let Y=H1($,Z,X),Q=new AbortController;try{return await Promise.race([zz(Y,J,Q),Kz(Y,X,Q),Bz(Y,X,Q)])}catch(G){throw t1($),G}finally{Q.abort(),J4(Z,q)}},zz=async($,Z,{signal:X})=>{if(Z===void 0){let[J]=await V3($,"message",{signal:X});return J}for await(let[J]of Gz($,"message",{signal:X}))if(Z(J))return J},Kz=async($,Z,{signal:X})=>{await V3($,"disconnect",{signal:X}),M8(Z)},Bz=async($,Z,{signal:X})=>{let[J]=await V3($,"strict:error",{signal:X});throw e$(J,Z)};import{once as bZ,on as Uz}from"node:events";var yZ=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},{reference:q=!0}={})=>L3({anyProcess:$,channel:Z,isSubprocess:X,ipc:J,shouldAwait:!X,reference:q}),L3=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J,shouldAwait:q,reference:Y})=>{i1({methodName:"getEachMessage",isSubprocess:X,ipc:J,isConnected:Y4($)}),X4(Z,Y);let Q=H1($,Z,X),G=new AbortController,H={};return Wz($,Q,G),Vz({ipcEmitter:Q,isSubprocess:X,controller:G,state:H}),Lz({anyProcess:$,channel:Z,ipcEmitter:Q,isSubprocess:X,shouldAwait:q,controller:G,state:H,reference:Y})},Wz=async($,Z,X)=>{try{await bZ(Z,"disconnect",{signal:X.signal}),X.abort()}catch{}},Vz=async({ipcEmitter:$,isSubprocess:Z,controller:X,state:J})=>{try{let[q]=await bZ($,"strict:error",{signal:X.signal});J.error=e$(q,Z),X.abort()}catch{}},Lz=async function*({anyProcess:$,channel:Z,ipcEmitter:X,isSubprocess:J,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of Uz(X,"message",{signal:Y.signal}))kZ(Q),yield H}catch{kZ(Q)}finally{if(Y.abort(),J4(Z,G),!J)t1($);if(q)await $}},kZ=({error:$})=>{if($)throw $};var uZ=($,{ipc:Z})=>{Object.assign($,cZ($,!1,Z))},mZ=()=>{let $=gZ,Z=!0,X=gZ.channel!==void 0;return{...cZ($,!0,X),getCancelSignal:i8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:X})}},cZ=($,Z,X)=>({sendMessage:K4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X}),getOneMessage:fZ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X}),getEachMessage:yZ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X})});import{ChildProcess as _z}from"node:child_process";import{PassThrough as Rz,Readable as Tz,Writable as Fz,Duplex as Mz}from"node:stream";var pZ=({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,verboseInfo:Q})=>{q3(J);let G=new _z;Cz(G,J),Object.assign(G,{readable:Pz,writable:xz,duplex:jz});let H=s1({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,isSync:!1}),K=Iz(H,Q,q);return{subprocess:G,promise:K}},Cz=($,Z)=>{let X=F$(),J=F$(),q=F$(),Y=Array.from({length:Z.length-3},F$),Q=F$(),G=[X,J,q,...Y];Object.assign($,{stdin:X,stdout:J,stderr:q,all:Q,stdio:G})},F$=()=>{let $=new Rz;return $.end(),$},Pz=()=>new Tz({read(){}}),xz=()=>new Fz({write(){}}),jz=()=>new Mz({read(){},write(){}}),Iz=async($,Z,X)=>e1($,Z,X);import{createReadStream as dZ,createWriteStream as lZ}from"node:fs";import{Buffer as wz}from"node:buffer";import{Readable as M$,Writable as Oz,Duplex as Ez}from"node:stream";var iZ=($,Z)=>w4(Az,$,Z,!1),C$=({type:$,optionName:Z})=>{throw TypeError(`The \`${Z}\` option cannot be ${z1[$]}.`)},nZ={fileNumber:C$,generator:B3,asyncGenerator:B3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:Z,readableObjectMode:X}}){let J=Z||X;return{stream:Ez.fromWeb($,{objectMode:J})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},Az={input:{...nZ,fileUrl:({value:$})=>({stream:dZ($)}),filePath:({value:{file:$}})=>({stream:dZ($)}),webStream:({value:$})=>({stream:M$.fromWeb($)}),iterable:({value:$})=>({stream:M$.from($)}),asyncIterable:({value:$})=>({stream:M$.from($)}),string:({value:$})=>({stream:M$.from($)}),uint8Array:({value:$})=>({stream:M$.from(wz.from($))})},output:{...nZ,fileUrl:({value:$})=>({stream:lZ($)}),filePath:({value:{file:$,append:Z}})=>({stream:lZ($,Z?{flags:"a"}:{})}),webStream:({value:$})=>({stream:Oz.fromWeb($)}),iterable:C$,asyncIterable:C$,string:C$,uint8Array:C$}};import{on as hz,once as tZ}from"node:events";import{PassThrough as Nz,getDefaultHighWaterMark as Dz}from"node:stream";import{finished as rZ}from"node:stream/promises";function j1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)_3(q);let Z=$.some(({readableObjectMode:q})=>q),X=Sz($,Z),J=new sZ({objectMode:Z,writableHighWaterMark:X,readableHighWaterMark:X});for(let q of $)J.add(q);return J}var Sz=($,Z)=>{if($.length===0)return Dz(Z);let X=$.filter(({readableObjectMode:J})=>J===Z).map(({readableHighWaterMark:J})=>J);return Math.max(...X)};class sZ extends Nz{#Z=new Set([]);#X=new Set([]);#$=new Set([]);#J;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(_3($),this.#Z.has($))return;this.#Z.add($),this.#J??=vz(this,this.#Z,this.#q);let Z=bz({passThroughStream:this,stream:$,streams:this.#Z,ended:this.#X,aborted:this.#$,onFinished:this.#J,unpipeEvent:this.#q});this.#Q.set($,Z),$.pipe(this,{end:!1})}async remove($){if(_3($),!this.#Z.has($))return!1;let Z=this.#Q.get($);if(Z===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await Z,!0}}var vz=async($,Z,X)=>{S4($,oZ);let J=new AbortController;try{await Promise.race([fz($,J),kz($,Z,X,J)])}finally{J.abort(),S4($,-oZ)}},fz=async($,{signal:Z})=>{try{await rZ($,{signal:Z,cleanup:!0})}catch(X){throw eZ($,X),X}},kz=async($,Z,X,{signal:J})=>{for await(let[q]of hz($,"unpipe",{signal:J}))if(Z.has(q))q.emit(X)},_3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},bz=async({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,onFinished:Y,unpipeEvent:Q})=>{S4($,aZ);let G=new AbortController;try{await Promise.race([yz(Y,Z,G),gz({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,controller:G}),uz({stream:Z,streams:X,ended:J,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),S4($,-aZ)}if(X.size>0&&X.size===J.size+q.size)if(J.size===0&&q.size>0)R3($);else mz($)},yz=async($,Z,{signal:X})=>{try{if(await $,!X.aborted)R3(Z)}catch(J){if(!X.aborted)eZ(Z,J)}},gz=async({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,controller:{signal:Y}})=>{try{if(await rZ(Z,{signal:Y,cleanup:!0,readable:!0,writable:!1}),X.has(Z))J.add(Z)}catch(Q){if(Y.aborted||!X.has(Z))return;if($X(Q))q.add(Z);else ZX($,Q)}},uz=async({stream:$,streams:Z,ended:X,aborted:J,unpipeEvent:q,controller:{signal:Y}})=>{if(await tZ($,q,{signal:Y}),!$.readable)return tZ(Y,"abort",{signal:Y});Z.delete($),X.delete($),J.delete($)},mz=($)=>{if($.writable)$.end()},eZ=($,Z)=>{if($X(Z))R3($);else ZX($,Z)},$X=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",R3=($)=>{if($.readable||$.writable)$.destroy()},ZX=($,Z)=>{if(!$.destroyed)$.once("error",cz),$.destroy(Z)},cz=()=>{},S4=($,Z)=>{let X=$.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)$.setMaxListeners(X+Z)},oZ=2,aZ=1;import{finished as XX}from"node:stream/promises";var Z$=($,Z)=>{$.pipe(Z),pz($,Z),dz($,Z)},pz=async($,Z)=>{if(y0($)||y0(Z))return;try{await XX($,{cleanup:!0,readable:!0,writable:!1})}catch{}T3(Z)},T3=($)=>{if($.writable)$.end()},dz=async($,Z)=>{if(y0($)||y0(Z))return;try{await XX(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}F3($)},F3=($)=>{if($.readable)$.destroy()};var JX=($,Z,X)=>{let J=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(Z)){for(let{stream:G}of Y.filter(({type:H})=>D0.has(H)))lz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!D0.has(H)))iz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:J,controller:X})}for(let[q,Y]of J.entries()){let Q=Y.length===1?Y[0]:j1(Y);Z$(Q,q)}},lz=($,Z,X,J)=>{if(X==="output")Z$($.stdio[J],Z);else Z$(Z,$.stdio[J]);let q=nz[J];if(q!==void 0)$[q]=Z;$.stdio[J]=Z},nz=["stdin","stdout","stderr"],iz=({subprocess:$,stream:Z,direction:X,fdNumber:J,pipeGroups:q,controller:Y})=>{if(Z===void 0)return;tz(Z,Y);let[Q,G]=X==="output"?[Z,$.stdio[J]]:[$.stdio[J],Z],H=q.get(Q)??[];q.set(Q,[...H,G])},tz=($,{signal:Z})=>{if(y0($))M1($,oz,Z)},oz=2;import{addAbortListener as sz}from"node:events";var I1=[];I1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")I1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")I1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var v4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",M3=Symbol.for("signal-exit emitter"),C3=globalThis,az=Object.defineProperty.bind(Object);class QX{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(C3[M3])return C3[M3];az(C3,M3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,Z){this.listeners[$].push(Z)}removeListener($,Z){let X=this.listeners[$],J=X.indexOf(Z);if(J===-1)return;if(J===0&&X.length===1)X.length=0;else X.splice(J,1)}emit($,Z,X){if(this.emitted[$])return!1;this.emitted[$]=!0;let J=!1;for(let q of this.listeners[$])J=q(Z,X)===!0||J;if($==="exit")J=this.emit("afterExit",Z,X)||J;return J}}class x3{}var rz=($)=>{return{onExit(Z,X){return $.onExit(Z,X)},load(){return $.load()},unload(){return $.unload()}}};class qX extends x3{onExit(){return()=>{}}load(){}unload(){}}class YX extends x3{#Z=P3.platform==="win32"?"SIGINT":"SIGHUP";#X=new QX;#$;#J;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let Z of I1)this.#Q[Z]=()=>{let X=this.#$.listeners(Z),{count:J}=this.#X,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")J+=q.__signal_exit_emitter__.count;if(X.length===J){this.unload();let Y=this.#X.emit("exit",null,Z),Q=Z==="SIGHUP"?this.#Z:Z;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#J=$.emit}onExit($,Z){if(!v4(this.#$))return()=>{};if(this.#Y===!1)this.load();let X=Z?.alwaysLast?"afterExit":"exit";return this.#X.on(X,$),()=>{if(this.#X.removeListener(X,$),this.#X.listeners.exit.length===0&&this.#X.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#X.count+=1;for(let $ of I1)try{let Z=this.#Q[$];if(Z)this.#$.on($,Z)}catch(Z){}this.#$.emit=($,...Z)=>{return this.#H($,...Z)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,I1.forEach(($)=>{let Z=this.#Q[$];if(!Z)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,Z)}catch(X){}}),this.#$.emit=this.#J,this.#$.reallyExit=this.#q,this.#X.count-=1}#G($){if(!v4(this.#$))return 0;return this.#$.exitCode=$||0,this.#X.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...Z){let X=this.#J;if($==="exit"&&v4(this.#$)){if(typeof Z[0]==="number")this.#$.exitCode=Z[0];let J=X.call(this.#$,$,...Z);return this.#X.emit("exit",this.#$.exitCode,null),J}else return X.call(this.#$,$,...Z)}}var P3=globalThis.process,{onExit:GX,load:XC,unload:JC}=rz(v4(P3)?new YX(P3):new qX);var HX=($,{cleanup:Z,detached:X},{signal:J})=>{if(!Z||X)return;let q=GX(()=>{$.kill()});sz(J,()=>{q()})};var KX=({source:$,sourcePromise:Z,boundOptions:X,createNested:J},...q)=>{let Y=c$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:W}=ez(X,J,q),{sourceStream:U,sourceError:B}=ZK($,K),{options:R,fileDescriptors:_}=t0.get($);return{sourcePromise:Z,sourceStream:U,sourceOptions:R,sourceError:B,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:W,fileDescriptors:_,startTime:Y}},ez=($,Z,X)=>{try{let{destination:J,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=$K($,Z,...X),G=Z4(J,Y);return{destination:J,destinationStream:G,from:q,unpipeSignal:Q}}catch(J){return{destinationError:J}}},$K=($,Z,X,...J)=>{if(Array.isArray(X))return{destination:Z(zX,$)(X,...J),pipeOptions:$};if(typeof X==="string"||X instanceof URL||L2(X)){if(Object.keys($).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[q,Y,Q]=D$(X,...J);return{destination:Z(zX)(q,Y,Q),pipeOptions:Q}}if(t0.has(X)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:X,pipeOptions:J[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${X}`)},zX=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),ZK=($,Z)=>{try{return{sourceStream:o1($,Z)}}catch(X){return{sourceError:X}}};var UX=({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=XK({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J});if(G!==void 0)throw j3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},XK=({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J})=>{if(Z!==void 0&&J!==void 0)return J;if(J!==void 0)return F3($),J;if(Z!==void 0)return T3(X),Z},j3=({error:$,fileDescriptors:Z,sourceOptions:X,startTime:J})=>s1({error:$,command:BX,escapedCommand:BX,fileDescriptors:Z,options:X,startTime:J,isSync:!1}),BX="source.pipe(destination)";var WX=async($)=>{let[{status:Z,reason:X,value:J=X},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(J))Q.pipedFrom.push(J);if(q==="rejected")throw Q;if(Z==="rejected")throw J;return Q};import{finished as JK}from"node:stream/promises";var VX=($,Z,X)=>{let J=f4.has(Z)?qK($,Z):QK($,Z);return M1($,GK,X.signal),M1(Z,HK,X.signal),YK(Z),J},QK=($,Z)=>{let X=j1([$]);return Z$(X,Z),f4.set(Z,X),X},qK=($,Z)=>{let X=f4.get(Z);return X.add($),X},YK=async($)=>{try{await JK($,{cleanup:!0,readable:!1,writable:!0})}catch{}f4.delete($)},f4=new WeakMap,GK=2,HK=1;import{aborted as zK}from"node:util";var LX=($,Z)=>$===void 0?[]:[KK($,Z)],KK=async($,{sourceStream:Z,mergedStream:X,fileDescriptors:J,sourceOptions:q,startTime:Y})=>{await zK($,Z),await X.remove(Z);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw j3({error:Q,fileDescriptors:J,sourceOptions:q,startTime:Y})};var k4=($,...Z)=>{if(Y0(Z[0]))return k4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...Z[0]}});let{destination:X,...J}=KX($,...Z),q=BK({...J,destination:X});return q.pipe=k4.bind(void 0,{...$,source:X,sourcePromise:q,boundOptions:{}}),q},BK=async({sourcePromise:$,sourceStream:Z,sourceOptions:X,sourceError:J,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let W=UK($,q);UX({sourceStream:Z,sourceError:J,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:X,startTime:K});let U=new AbortController;try{let B=VX(Z,Y,U);return await Promise.race([WX(W),...LX(G,{sourceStream:Z,mergedStream:B,sourceOptions:X,fileDescriptors:H,startTime:K})])}finally{U.abort()}},UK=($,Z)=>Promise.allSettled([$,Z]);import{setImmediate as FK}from"node:timers/promises";import{on as WK}from"node:events";import{getDefaultHighWaterMark as VK}from"node:stream";var b4=({subprocessStdout:$,subprocess:Z,binary:X,shouldEncode:J,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return LK(Z,Q),RX({stream:$,controller:Q,binary:X,shouldEncode:!$.readableObjectMode&&J,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},LK=async($,Z)=>{try{await $}catch{}finally{Z.abort()}},I3=({stream:$,onStreamEnd:Z,lines:X,encoding:J,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;_K(Z,Q,$);let G=$.readableObjectMode&&!Y;return RX({stream:$,controller:Q,binary:J==="buffer",shouldEncode:!G,encoding:J,shouldSplit:!G&&X,preserveNewlines:!q})},_K=async($,Z,X)=>{try{await $}catch{X.destroy()}finally{Z.abort()}},RX=({stream:$,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=WK($,"data",{signal:Z.signal,highWaterMark:_X,highWatermark:_X});return RK({onStdoutChunk:G,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})},w3=VK(!0),_X=w3,RK=async function*({onStdoutChunk:$,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=TK({binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*x1(H,G,0)}catch(H){if(!Z.signal.aborted)throw H}finally{yield*T$(G)}},TK=({binary:$,shouldEncode:Z,encoding:X,shouldSplit:J,preserveNewlines:q})=>[E4($,X,!Z),O4($,q,!J,{})].filter(Boolean);var TX=async({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:W})=>{let U=MK({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,allMixed:G,verboseInfo:K,streamInfo:W});if(!q){await Promise.all([CK($),U]);return}let B=Y3(H,X),R=I3({stream:$,onStreamEnd:Z,lines:Q,encoding:J,stripFinalNewline:B,allMixed:G}),[_]=await Promise.all([PK({stream:$,iterable:R,fdNumber:X,encoding:J,maxBuffer:Y,lines:Q}),U]);return _},MK=async({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!N4({stdioItems:Q[X]?.stdioItems,encoding:J,verboseInfo:Y,fdNumber:X}))return;let G=I3({stream:$,onStreamEnd:Z,lines:!0,encoding:J,stripFinalNewline:!0,allMixed:q});await IZ(G,$,X,Y)},CK=async($)=>{if(await FK(),$.readableFlowing===null)$.resume()},PK=async({stream:$,stream:{readableObjectMode:Z},iterable:X,fdNumber:J,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(Z||Q)return await R4(X,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await T4(X,{maxBuffer:Y}));return await M4(X,{maxBuffer:Y})}catch(G){return FX(I5({error:G,stream:$,readableObjectMode:Z,lines:Q,encoding:q,fdNumber:J}))}},O3=async($)=>{try{return await $}catch(Z){return FX(Z)}},FX=({bufferedData:$})=>m6($)?new Uint8Array($):$;import{finished as xK}from"node:stream/promises";var P$=async($,Z,X,{isSameDirection:J,stopOnExit:q=!1}={})=>{let Y=jK($,X),Q=new AbortController;try{await Promise.race([...q?[X.exitPromise]:[],xK($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)OK(G,Z,X,J)}finally{Q.abort()}},jK=($,{originalStreams:[Z],subprocess:X})=>{let J={stdinCleanedUp:!1};if($===Z)IK($,X,J);return J},IK=($,Z,X)=>{let{_destroy:J}=$;$._destroy=(...q)=>{wK(Z,X),J.call($,...q)}},wK=({exitCode:$,signalCode:Z},X)=>{if($!==null||Z!==null)X.stdinCleanedUp=!0},OK=($,Z,X,J)=>{if(!EK($,Z,X,J))throw $},EK=($,Z,X,J=!0)=>{if(X.propagating)return MX($)||y4($);return X.propagating=!0,E3(X,Z)===J?MX($):y4($)},E3=({fileDescriptors:$},Z)=>Z!=="all"&&$[Z].direction==="input",y4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",MX=($)=>$?.code==="EPIPE";var CX=({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>A3({stream:H,fdNumber:K,encoding:Z,buffer:X[K],maxBuffer:J[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),A3=async({stream:$,fdNumber:Z,encoding:X,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let W=P$($,Z,K);if(E3(K,Z)){await W;return}let[U]=await Promise.all([TX({stream:$,onStreamEnd:W,fdNumber:Z,encoding:X,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K}),W]);return U};var PX=({stdout:$,stderr:Z},{all:X})=>X&&($||Z)?j1([$,Z].filter(Boolean)):void 0,xX=({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>A3({...AK($,X),fdNumber:"all",encoding:Z,maxBuffer:J[1]+J[2],lines:q[1]||q[2],allMixed:hK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),AK=({stdout:$,stderr:Z,all:X},[,J,q])=>{let Y=J||q;if(!Y)return{stream:X,buffer:Y};if(!J)return{stream:Z,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:X,buffer:Y}},hK=({all:$,stdout:Z,stderr:X})=>$&&Z&&X&&Z.readableObjectMode!==X.readableObjectMode;import{once as NK}from"node:events";var jX=($)=>d1($,"ipc"),IX=($,Z)=>{let X=m$($);l0({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:Z})};var wX=async({subprocess:$,buffer:Z,maxBuffer:X,ipc:J,ipcOutput:q,verboseInfo:Y})=>{if(!J)return q;let Q=jX(Y),G=Z1(Z,"ipc"),H=Z1(X,"ipc");for await(let K of L3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:J,shouldAwait:!1,reference:!0})){if(G)w5($,q,H),q.push(K);if(Q)IX(K,Y)}return q},OX=async($,Z)=>{return await Promise.allSettled([$]),Z};var EX=async({subprocess:$,options:{encoding:Z,buffer:X,maxBuffer:J,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:K,ipc:W,ipcInput:U},context:B,verboseInfo:R,fileDescriptors:_,originalStreams:L,onInternalError:j,controller:C})=>{let N=hZ($,B),c={originalStreams:L,fileDescriptors:_,subprocess:$,exitPromise:N,propagating:!1},I=CX({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:K,verboseInfo:R,streamInfo:c}),n=xX({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:K,verboseInfo:R,streamInfo:c}),i=[],a=wX({subprocess:$,buffer:X,maxBuffer:J,ipc:W,ipcOutput:i,verboseInfo:R}),K0=DK(L,$,c),l=SK(_,c);try{return await Promise.race([Promise.all([{},DZ(N),Promise.all(I),n,a,J5($,U),...K0,...l]),j,vK($,C),...s8($,Y,B,C),...F8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:B,controller:C}),...a8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:B,controller:C})])}catch(x0){return B.terminationReason??="other",Promise.all([{error:x0},N,Promise.all(I.map((E)=>O3(E))),O3(n),OX(a,i),Promise.allSettled(K0),Promise.allSettled(l)])}},DK=($,Z,X)=>$.map((J,q)=>J===Z.stdio[q]?void 0:P$(J,q,X)),SK=($,Z)=>$.flatMap(({stdioItems:X},J)=>X.filter(({value:q,stream:Y=q})=>u0(Y,{checkOpen:!1})&&!y0(Y)).map(({type:q,value:Y,stream:Q=Y})=>P$(Q,J,Z,{isSameDirection:D0.has(q),stopOnExit:q==="native"}))),vK=async($,{signal:Z})=>{let[X]=await NK($,"error",{signal:Z});throw X};var AX=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),x$=($,Z,X)=>{let J=$[X];if(!J.has(Z))J.set(Z,[]);let q=J.get(Z),Y=i0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},X$=async({resolve:$,promises:Z},X)=>{$();let[J]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...Z])]);return!J};import{Readable as fK}from"node:stream";import{callbackify as kK}from"node:util";import{finished as hX}from"node:stream/promises";var h3=async($)=>{if($===void 0)return;try{await N3($)}catch{}},NX=async($)=>{if($===void 0)return;try{await D3($)}catch{}},N3=async($)=>{await hX($,{cleanup:!0,readable:!1,writable:!0})},D3=async($)=>{await hX($,{cleanup:!0,readable:!0,writable:!1})},g4=async($,Z)=>{if(await $,Z)throw Z},u4=($,Z,X)=>{if(X&&!y4(X))$.destroy(X);else if(Z)$.destroy()};var DX=({subprocess:$,concurrentStreams:Z,encoding:X},{from:J,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||j0.has(X),{subprocessStdout:G,waitReadableDestroy:H}=S3($,J,Z),{readableEncoding:K,readableObjectMode:W,readableHighWaterMark:U}=v3(G,Q),{read:B,onStdoutDataDone:R}=f3({subprocessStdout:G,subprocess:$,binary:Q,encoding:X,preserveNewlines:Y}),_=new fK({read:B,destroy:kK(b3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:U,objectMode:W,encoding:K});return k3({subprocessStdout:G,onStdoutDataDone:R,readable:_,subprocess:$}),_},S3=($,Z,X)=>{let J=o1($,Z),q=x$(X,J,"readableDestroy");return{subprocessStdout:J,waitReadableDestroy:q}},v3=({readableEncoding:$,readableObjectMode:Z,readableHighWaterMark:X},J)=>J?{readableEncoding:$,readableObjectMode:Z,readableHighWaterMark:X}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:w3},f3=({subprocessStdout:$,subprocess:Z,binary:X,encoding:J,preserveNewlines:q})=>{let Y=i0(),Q=b4({subprocessStdout:$,subprocess:Z,binary:X,shouldEncode:!X,encoding:J,preserveNewlines:q});return{read(){bK(this,Q,Y)},onStdoutDataDone:Y}},bK=async($,Z,X)=>{try{let{value:J,done:q}=await Z.next();if(q)X.resolve();else $.push(J)}catch{}},k3=async({subprocessStdout:$,onStdoutDataDone:Z,readable:X,subprocess:J,subprocessStdin:q})=>{try{if(await D3($),await J,await h3(q),await Z,X.readable)X.push(null)}catch(Y){await h3(q),SX(X,Y)}},b3=async({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},J)=>{if(await X$(X,Z))SX($,J),await g4(Z,J)},SX=($,Z)=>{u4($,$.readable,Z)};import{Writable as yK}from"node:stream";import{callbackify as vX}from"node:util";var fX=({subprocess:$,concurrentStreams:Z},{to:X}={})=>{let{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}=y3($,X,Z),Q=new yK({...g3(J,$,q),destroy:vX(m3.bind(void 0,{subprocessStdin:J,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:J.writableHighWaterMark,objectMode:J.writableObjectMode});return u3(J,Q),Q},y3=($,Z,X)=>{let J=Z4($,Z),q=x$(X,J,"writableFinal"),Y=x$(X,J,"writableDestroy");return{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}},g3=($,Z,X)=>({write:gK.bind(void 0,$),final:vX(uK.bind(void 0,$,Z,X))}),gK=($,Z,X,J)=>{if($.write(Z,X))J();else $.once("drain",J)},uK=async($,Z,X)=>{if(await X$(X,Z)){if($.writable)$.end();await Z}},u3=async($,Z,X)=>{try{if(await N3($),Z.writable)Z.end()}catch(J){await NX(X),kX(Z,J)}},m3=async({subprocessStdin:$,subprocess:Z,waitWritableFinal:X,waitWritableDestroy:J},q)=>{if(await X$(X,Z),await X$(J,Z))kX($,q),await g4(Z,q)},kX=($,Z)=>{u4($,$.writable,Z)};import{Duplex as mK}from"node:stream";import{callbackify as cK}from"node:util";var bX=({subprocess:$,concurrentStreams:Z,encoding:X},{from:J,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||j0.has(X),{subprocessStdout:H,waitReadableDestroy:K}=S3($,J,Z),{subprocessStdin:W,waitWritableFinal:U,waitWritableDestroy:B}=y3($,q,Z),{readableEncoding:R,readableObjectMode:_,readableHighWaterMark:L}=v3(H,G),{read:j,onStdoutDataDone:C}=f3({subprocessStdout:H,subprocess:$,binary:G,encoding:X,preserveNewlines:Q}),N=new mK({read:j,...g3(W,$,U),destroy:cK(pK.bind(void 0,{subprocessStdout:H,subprocessStdin:W,subprocess:$,waitReadableDestroy:K,waitWritableFinal:U,waitWritableDestroy:B})),readableHighWaterMark:L,writableHighWaterMark:W.writableHighWaterMark,readableObjectMode:_,writableObjectMode:W.writableObjectMode,encoding:R});return k3({subprocessStdout:H,onStdoutDataDone:C,readable:N,subprocess:$,subprocessStdin:W}),u3(W,N,H),N},pK=async({subprocessStdout:$,subprocessStdin:Z,subprocess:X,waitReadableDestroy:J,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([b3({subprocessStdout:$,subprocess:X,waitReadableDestroy:J},Q),m3({subprocessStdin:Z,subprocess:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var c3=($,Z,{from:X,binary:J=!1,preserveNewlines:q=!1}={})=>{let Y=J||j0.has(Z),Q=o1($,X),G=b4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:Z,preserveNewlines:q});return dK(G,Q,$)},dK=async function*($,Z,X){try{yield*$}finally{if(Z.readable)Z.destroy();await X}};var yX=($,{encoding:Z})=>{let X=AX();$.readable=DX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:Z}),$.writable=fX.bind(void 0,{subprocess:$,concurrentStreams:X}),$.duplex=bX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:Z}),$.iterable=c3.bind(void 0,$,Z),$[Symbol.asyncIterator]=c3.bind(void 0,$,Z,{})};var gX=($,Z)=>{for(let[X,J]of nK){let q=J.value.bind(Z);Reflect.defineProperty($,X,{...J,value:q})}},lK=(async()=>{})().constructor.prototype,nK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(lK,$)]);var uX=($,Z,X,J)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:W,fileDescriptors:U}=oK($,Z,X),{subprocess:B,promise:R}=rK({file:q,commandArguments:Y,options:W,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:U});return B.pipe=k4.bind(void 0,{source:B,sourcePromise:R,boundOptions:{},createNested:J}),gX(B,R),t0.set(B,{options:W,fileDescriptors:U}),B},oK=($,Z,X)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=p$($,Z,X),{file:G,commandArguments:H,options:K}=U4($,Z,X),W=aK(K),U=iZ(W,Q);return{file:G,commandArguments:H,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:U}},aK=({timeout:$,signal:Z,...X})=>{if(Z!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:$}},rK=({file:$,commandArguments:Z,options:X,startTime:J,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=tK(...W4($,Z,X))}catch(_){return pZ({error:_,command:Y,escapedCommand:Q,fileDescriptors:G,options:X,startTime:J,verboseInfo:q})}let K=new AbortController;iK(Number.POSITIVE_INFINITY,K.signal);let W=[...H.stdio];JX(H,G,K),HX(H,X,K);let U={},B=i0();H.kill=R8.bind(void 0,{kill:H.kill.bind(H),options:X,onInternalError:B,context:U,controller:K}),H.all=PX(H,X),yX(H,X),uZ(H,X);let R=sK({subprocess:H,options:X,startTime:J,verboseInfo:q,fileDescriptors:G,originalStreams:W,command:Y,escapedCommand:Q,context:U,onInternalError:B,controller:K});return{subprocess:H,promise:R}},sK=async({subprocess:$,options:Z,startTime:X,verboseInfo:J,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:K,controller:W})=>{let[U,[B,R],_,L,j]=await EX({subprocess:$,options:Z,context:H,verboseInfo:J,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:W});W.abort(),K.resolve();let C=_.map((I,n)=>Q1(I,Z,n)),N=Q1(L,Z,"all"),c=eK({errorInfo:U,exitCode:B,signal:R,stdio:C,all:N,ipcOutput:j,context:H,options:Z,command:Q,escapedCommand:G,startTime:X});return e1(c,J,Z)},eK=({errorInfo:$,exitCode:Z,signal:X,stdio:J,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:K,startTime:W})=>("error"in $)?R$({error:$.error,command:H,escapedCommand:K,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof X1,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:Z,signal:X,stdio:J,all:q,ipcOutput:Y,options:G,startTime:W,isSync:!1}):P4({command:H,escapedCommand:K,stdio:J,all:q,ipcOutput:Y,options:G,startTime:W});var m4=($,Z)=>{let X=Object.fromEntries(Object.entries(Z).map(([J,q])=>[J,$B(J,$[J],q)]));return{...$,...X}},$B=($,Z,X)=>{if(ZB.has($)&&Y0(Z)&&Y0(X))return{...Z,...X};return X},ZB=new Set(["env",...C2]);var K1=($,Z,X,J)=>{let q=(Q,G,H)=>K1(Q,G,X,H),Y=(...Q)=>XB({mapArguments:$,deepOptions:X,boundOptions:Z,setBoundExeca:J,createNested:q},...Q);if(J!==void 0)J(Y,q,Z);return Y},XB=({mapArguments:$,deepOptions:Z={},boundOptions:X={},setBoundExeca:J,createNested:q},Y,...Q)=>{if(Y0(Y))return q($,m4(X,Y),J);let{file:G,commandArguments:H,options:K,isSync:W}=JB({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:Z,boundOptions:X});return W?vZ(G,H,K):uX(G,H,K,q)},JB=({mapArguments:$,firstArgument:Z,nextArguments:X,deepOptions:J,boundOptions:q})=>{let Y=i6(Z)?t6(Z,X):[Z,...X],[Q,G,H]=D$(...Y),K=m4(m4(J,q),H),{file:W=Q,commandArguments:U=G,options:B=K,isSync:R=!1}=$({file:Q,commandArguments:G,options:K});return{file:W,commandArguments:U,options:B,isSync:R}};var mX=({file:$,commandArguments:Z})=>pX($,Z),cX=({file:$,commandArguments:Z})=>({...pX($,Z),isSync:!0}),pX=($,Z)=>{if(Z.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${Z}.`);let[X,...J]=QB($);return{file:X,commandArguments:J}},QB=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let Z=$.trim();if(Z==="")return[];let X=[];for(let J of Z.split(qB)){let q=X.at(-1);if(q&&q.endsWith("\\"))X[X.length-1]=`${q.slice(0,-1)} ${J}`;else X.push(J)}return X},qB=/ +/g;var dX=($,Z,X)=>{$.sync=Z(YB,X),$.s=$.sync},lX=({options:$})=>nX($),YB=({options:$})=>({...nX($),isSync:!0}),nX=($)=>({options:{...GB($),...$}}),GB=({input:$,inputFile:Z,stdio:X})=>$===void 0&&Z===void 0&&X===void 0?{stdin:"inherit"}:{},iX={preferLocal:!0};var m0=K1(()=>({})),nx=K1(()=>({isSync:!0})),ix=K1(mX),tx=K1(cX),ox=K1($5),ax=K1(lX,{},iX,dX),{sendMessage:rx,getOneMessage:sx,getEachMessage:ex,getCancelSignal:$j}=mZ();import{stripVTControlCharacters as Z6}from"node:util";var F0=m1(d3(),1),GJ=m1(d4(),1);import{stdin as qJ,stdout as YJ}from"node:process";import*as B1 from"node:readline";import rX from"node:readline";import{Writable as WB}from"node:stream";function VB({onlyFirst:$=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,$?void 0:"g")}var LB=VB();function HJ($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(LB,"")}function zJ($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var KJ={exports:{}};(function($){var Z={};$.exports=Z,Z.eastAsianWidth=function(J){var q=J.charCodeAt(0),Y=J.length==2?J.charCodeAt(1):0,Q=q;return 55296<=q&&q<=56319&&56320<=Y&&Y<=57343&&(q&=1023,Y&=1023,Q=q<<10|Y,Q+=65536),Q==12288||65281<=Q&&Q<=65376||65504<=Q&&Q<=65510?"F":Q==8361||65377<=Q&&Q<=65470||65474<=Q&&Q<=65479||65482<=Q&&Q<=65487||65490<=Q&&Q<=65495||65498<=Q&&Q<=65500||65512<=Q&&Q<=65518?"H":4352<=Q&&Q<=4447||4515<=Q&&Q<=4519||4602<=Q&&Q<=4607||9001<=Q&&Q<=9002||11904<=Q&&Q<=11929||11931<=Q&&Q<=12019||12032<=Q&&Q<=12245||12272<=Q&&Q<=12283||12289<=Q&&Q<=12350||12353<=Q&&Q<=12438||12441<=Q&&Q<=12543||12549<=Q&&Q<=12589||12593<=Q&&Q<=12686||12688<=Q&&Q<=12730||12736<=Q&&Q<=12771||12784<=Q&&Q<=12830||12832<=Q&&Q<=12871||12880<=Q&&Q<=13054||13056<=Q&&Q<=19903||19968<=Q&&Q<=42124||42128<=Q&&Q<=42182||43360<=Q&&Q<=43388||44032<=Q&&Q<=55203||55216<=Q&&Q<=55238||55243<=Q&&Q<=55291||63744<=Q&&Q<=64255||65040<=Q&&Q<=65049||65072<=Q&&Q<=65106||65108<=Q&&Q<=65126||65128<=Q&&Q<=65131||110592<=Q&&Q<=110593||127488<=Q&&Q<=127490||127504<=Q&&Q<=127546||127552<=Q&&Q<=127560||127568<=Q&&Q<=127569||131072<=Q&&Q<=194367||177984<=Q&&Q<=196605||196608<=Q&&Q<=262141?"W":32<=Q&&Q<=126||162<=Q&&Q<=163||165<=Q&&Q<=166||Q==172||Q==175||10214<=Q&&Q<=10221||10629<=Q&&Q<=10630?"Na":Q==161||Q==164||167<=Q&&Q<=168||Q==170||173<=Q&&Q<=174||176<=Q&&Q<=180||182<=Q&&Q<=186||188<=Q&&Q<=191||Q==198||Q==208||215<=Q&&Q<=216||222<=Q&&Q<=225||Q==230||232<=Q&&Q<=234||236<=Q&&Q<=237||Q==240||242<=Q&&Q<=243||247<=Q&&Q<=250||Q==252||Q==254||Q==257||Q==273||Q==275||Q==283||294<=Q&&Q<=295||Q==299||305<=Q&&Q<=307||Q==312||319<=Q&&Q<=322||Q==324||328<=Q&&Q<=331||Q==333||338<=Q&&Q<=339||358<=Q&&Q<=359||Q==363||Q==462||Q==464||Q==466||Q==468||Q==470||Q==472||Q==474||Q==476||Q==593||Q==609||Q==708||Q==711||713<=Q&&Q<=715||Q==717||Q==720||728<=Q&&Q<=731||Q==733||Q==735||768<=Q&&Q<=879||913<=Q&&Q<=929||931<=Q&&Q<=937||945<=Q&&Q<=961||963<=Q&&Q<=969||Q==1025||1040<=Q&&Q<=1103||Q==1105||Q==8208||8211<=Q&&Q<=8214||8216<=Q&&Q<=8217||8220<=Q&&Q<=8221||8224<=Q&&Q<=8226||8228<=Q&&Q<=8231||Q==8240||8242<=Q&&Q<=8243||Q==8245||Q==8251||Q==8254||Q==8308||Q==8319||8321<=Q&&Q<=8324||Q==8364||Q==8451||Q==8453||Q==8457||Q==8467||Q==8470||8481<=Q&&Q<=8482||Q==8486||Q==8491||8531<=Q&&Q<=8532||8539<=Q&&Q<=8542||8544<=Q&&Q<=8555||8560<=Q&&Q<=8569||Q==8585||8592<=Q&&Q<=8601||8632<=Q&&Q<=8633||Q==8658||Q==8660||Q==8679||Q==8704||8706<=Q&&Q<=8707||8711<=Q&&Q<=8712||Q==8715||Q==8719||Q==8721||Q==8725||Q==8730||8733<=Q&&Q<=8736||Q==8739||Q==8741||8743<=Q&&Q<=8748||Q==8750||8756<=Q&&Q<=8759||8764<=Q&&Q<=8765||Q==8776||Q==8780||Q==8786||8800<=Q&&Q<=8801||8804<=Q&&Q<=8807||8810<=Q&&Q<=8811||8814<=Q&&Q<=8815||8834<=Q&&Q<=8835||8838<=Q&&Q<=8839||Q==8853||Q==8857||Q==8869||Q==8895||Q==8978||9312<=Q&&Q<=9449||9451<=Q&&Q<=9547||9552<=Q&&Q<=9587||9600<=Q&&Q<=9615||9618<=Q&&Q<=9621||9632<=Q&&Q<=9633||9635<=Q&&Q<=9641||9650<=Q&&Q<=9651||9654<=Q&&Q<=9655||9660<=Q&&Q<=9661||9664<=Q&&Q<=9665||9670<=Q&&Q<=9672||Q==9675||9678<=Q&&Q<=9681||9698<=Q&&Q<=9701||Q==9711||9733<=Q&&Q<=9734||Q==9737||9742<=Q&&Q<=9743||9748<=Q&&Q<=9749||Q==9756||Q==9758||Q==9792||Q==9794||9824<=Q&&Q<=9825||9827<=Q&&Q<=9829||9831<=Q&&Q<=9834||9836<=Q&&Q<=9837||Q==9839||9886<=Q&&Q<=9887||9918<=Q&&Q<=9919||9924<=Q&&Q<=9933||9935<=Q&&Q<=9953||Q==9955||9960<=Q&&Q<=9983||Q==10045||Q==10071||10102<=Q&&Q<=10111||11093<=Q&&Q<=11097||12872<=Q&&Q<=12879||57344<=Q&&Q<=63743||65024<=Q&&Q<=65039||Q==65533||127232<=Q&&Q<=127242||127248<=Q&&Q<=127277||127280<=Q&&Q<=127337||127344<=Q&&Q<=127386||917760<=Q&&Q<=917999||983040<=Q&&Q<=1048573||1048576<=Q&&Q<=1114109?"A":"N"},Z.characterLength=function(J){var q=this.eastAsianWidth(J);return q=="F"||q=="W"||q=="A"?2:1};function X(J){return J.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}Z.length=function(J){for(var q=X(J),Y=0,Q=0;Q<q.length;Q++)Y=Y+this.characterLength(q[Q]);return Y},Z.slice=function(J,q,Y){textLen=Z.length(J),q=q||0,Y=Y||1,q<0&&(q=textLen+q),Y<0&&(Y=textLen+Y);for(var Q="",G=0,H=X(J),K=0;K<H.length;K++){var W=H[K],U=Z.length(W);if(G>=q-(U==2?1:0))if(G+U<=Y)Q+=W;else break;G+=U}return Q}})(KJ);var _B=KJ.exports,RB=zJ(_B),TB=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},FB=zJ(TB);function j$($,Z={}){if(typeof $!="string"||$.length===0||(Z={ambiguousIsNarrow:!0,...Z},$=HJ($),$.length===0))return 0;$=$.replace(FB()," ");let X=Z.ambiguousIsNarrow?1:2,J=0;for(let q of $){let Y=q.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(RB.eastAsianWidth(q)){case"F":case"W":J+=2;break;case"A":J+=X;break;default:J+=1}}return J}var n3=10,sX=($=0)=>(Z)=>`\x1B[${Z+$}m`,eX=($=0)=>(Z)=>`\x1B[${38+$};5;${Z}m`,$J=($=0)=>(Z,X,J)=>`\x1B[${38+$};2;${Z};${X};${J}m`,J0={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(J0.modifier);var MB=Object.keys(J0.color),CB=Object.keys(J0.bgColor);[...MB,...CB];function PB(){let $=new Map;for(let[Z,X]of Object.entries(J0)){for(let[J,q]of Object.entries(X))J0[J]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},X[J]=J0[J],$.set(q[0],q[1]);Object.defineProperty(J0,Z,{value:X,enumerable:!1})}return Object.defineProperty(J0,"codes",{value:$,enumerable:!1}),J0.color.close="\x1B[39m",J0.bgColor.close="\x1B[49m",J0.color.ansi=sX(),J0.color.ansi256=eX(),J0.color.ansi16m=$J(),J0.bgColor.ansi=sX(n3),J0.bgColor.ansi256=eX(n3),J0.bgColor.ansi16m=$J(n3),Object.defineProperties(J0,{rgbToAnsi256:{value:(Z,X,J)=>Z===X&&X===J?Z<8?16:Z>248?231:Math.round((Z-8)/247*24)+232:16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(J/255*5),enumerable:!1},hexToRgb:{value:(Z)=>{let X=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Z.toString(16));if(!X)return[0,0,0];let[J]=X;J.length===3&&(J=[...J].map((Y)=>Y+Y).join(""));let q=Number.parseInt(J,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(Z)=>J0.rgbToAnsi256(...J0.hexToRgb(Z)),enumerable:!1},ansi256ToAnsi:{value:(Z)=>{if(Z<8)return 30+Z;if(Z<16)return 90+(Z-8);let X,J,q;if(Z>=232)X=((Z-232)*10+8)/255,J=X,q=X;else{Z-=16;let G=Z%36;X=Math.floor(Z/36)/5,J=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(X,J,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(J)<<1|Math.round(X));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(Z,X,J)=>J0.ansi256ToAnsi(J0.rgbToAnsi256(Z,X,J)),enumerable:!1},hexToAnsi:{value:(Z)=>J0.ansi256ToAnsi(J0.hexToAnsi256(Z)),enumerable:!1}}),J0}var xB=PB(),i4=new Set(["\x1B","›"]),jB=39,o3="\x07",BJ="[",IB="]",UJ="m",a3=`${IB}8;;`,ZJ=($)=>`${i4.values().next().value}${BJ}${$}${UJ}`,XJ=($)=>`${i4.values().next().value}${a3}${$}${o3}`,wB=($)=>$.split(" ").map((Z)=>j$(Z)),i3=($,Z,X)=>{let J=[...Z],q=!1,Y=!1,Q=j$(HJ($[$.length-1]));for(let[G,H]of J.entries()){let K=j$(H);if(Q+K<=X?$[$.length-1]+=H:($.push(H),Q=0),i4.has(H)&&(q=!0,Y=J.slice(G+1).join("").startsWith(a3)),q){Y?H===o3&&(q=!1,Y=!1):H===UJ&&(q=!1);continue}Q+=K,Q===X&&G<J.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},OB=($)=>{let Z=$.split(" "),X=Z.length;for(;X>0&&!(j$(Z[X-1])>0);)X--;return X===Z.length?$:Z.slice(0,X).join(" ")+Z.slice(X).join("")},EB=($,Z,X={})=>{if(X.trim!==!1&&$.trim()==="")return"";let J="",q,Y,Q=wB($),G=[""];for(let[K,W]of $.split(" ").entries()){X.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let U=j$(G[G.length-1]);if(K!==0&&(U>=Z&&(X.wordWrap===!1||X.trim===!1)&&(G.push(""),U=0),(U>0||X.trim===!1)&&(G[G.length-1]+=" ",U++)),X.hard&&Q[K]>Z){let B=Z-U,R=1+Math.floor((Q[K]-B-1)/Z);Math.floor((Q[K]-1)/Z)<R&&G.push(""),i3(G,W,Z);continue}if(U+Q[K]>Z&&U>0&&Q[K]>0){if(X.wordWrap===!1&&U<Z){i3(G,W,Z);continue}G.push("")}if(U+Q[K]>Z&&X.wordWrap===!1){i3(G,W,Z);continue}G[G.length-1]+=W}X.trim!==!1&&(G=G.map((K)=>OB(K)));let H=[...G.join(`
45
+ `)];for(let[K,W]of H.entries()){if(J+=W,i4.has(W)){let{groups:B}=new RegExp(`(?:\\${BJ}(?<code>\\d+)m|\\${a3}(?<uri>.*)${o3})`).exec(H.slice(K).join(""))||{groups:{}};if(B.code!==void 0){let R=Number.parseFloat(B.code);q=R===jB?void 0:R}else B.uri!==void 0&&(Y=B.uri.length===0?void 0:B.uri)}let U=xB.codes.get(Number(q));H[K+1]===`
46
46
  `?(Y&&(J+=XJ("")),q&&U&&(J+=ZJ(U))):W===`
47
47
  `&&(q&&U&&(J+=ZJ(q)),Y&&(J+=XJ(Y)))}return J};function JJ($,Z,X){return String($).normalize().replace(/\r\n/g,`
48
48
  `).split(`
49
- `).map((J)=>IB(J,Z,X)).join(`
50
- `)}var wB=["up","down","left","right","space","enter","cancel"],n4={actions:new Set(wB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function r3($,Z){if(typeof $=="string")return n4.aliases.get($)===Z;for(let X of $)if(X!==void 0&&r3(X,Z))return!0;return!1}function OB($,Z){if($===Z)return;let X=$.split(`
49
+ `).map((J)=>EB(J,Z,X)).join(`
50
+ `)}var AB=["up","down","left","right","space","enter","cancel"],n4={actions:new Set(AB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function r3($,Z){if(typeof $=="string")return n4.aliases.get($)===Z;for(let X of $)if(X!==void 0&&r3(X,Z))return!0;return!1}function hB($,Z){if($===Z)return;let X=$.split(`
51
51
  `),J=Z.split(`
52
- `),q=[];for(let Y=0;Y<Math.max(X.length,J.length);Y++)X[Y]!==J[Y]&&q.push(Y);return q}var EB=globalThis.process.platform.startsWith("win"),t3=Symbol("clack:cancel");function c0($){return $===t3}function l4($,Z){let X=$;X.isTTY&&X.setRawMode(Z)}function WJ({input:$=qJ,output:Z=YJ,overwrite:X=!0,hideCursor:J=!0}={}){let q=U1.createInterface({input:$,output:Z,prompt:"",tabSize:1});U1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let K=String(Q);if(r3([K,G,H],"cancel")){J&&Z.write(F0.cursor.show),process.exit(0);return}if(!X)return;U1.moveCursor(Z,G==="return"?0:-1,G==="return"?-1:0,()=>{U1.clearLine(Z,1,()=>{$.once("keypress",Y)})})};return J&&Z.write(F0.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),J&&Z.write(F0.cursor.show),$.isTTY&&!EB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var AB=Object.defineProperty,hB=($,Z,X)=>(Z in $)?AB($,Z,{enumerable:!0,configurable:!0,writable:!0,value:X}):$[Z]=X,I0=($,Z,X)=>(hB($,typeof Z!="symbol"?Z+"":Z,X),X);class t4{constructor($,Z=!0){I0(this,"input"),I0(this,"output"),I0(this,"_abortSignal"),I0(this,"rl"),I0(this,"opts"),I0(this,"_render"),I0(this,"_track",!1),I0(this,"_prevFrame",""),I0(this,"_subscribers",new Map),I0(this,"_cursor",0),I0(this,"state","initial"),I0(this,"error",""),I0(this,"value");let{input:X=qJ,output:J=YJ,render:q,signal:Y,...Q}=$;this.opts=Q,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=q.bind(this),this._track=Z,this._abortSignal=Y,this.input=X,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber($,Z){let X=this._subscribers.get($)??[];X.push(Z),this._subscribers.set($,X)}on($,Z){this.setSubscriber($,{cb:Z})}once($,Z){this.setSubscriber($,{cb:Z,once:!0})}emit($,...Z){let X=this._subscribers.get($)??[],J=[];for(let q of X)q.cb(...Z),q.once&&J.push(()=>X.splice(X.indexOf(q),1));for(let q of J)q()}prompt(){return new Promise(($,Z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(t3);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let X=new KB;X._write=(J,q,Y)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),Y()},this.input.pipe(X),this.rl=rX.createInterface({input:this.input,output:X,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),rX.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),l4(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(F0.cursor.show),this.output.off("resize",this.render),l4(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(F0.cursor.show),this.output.off("resize",this.render),l4(this.input,!1),$(t3)})})}onKeypress($,Z){if(this.state==="error"&&(this.state="active"),Z?.name&&(!this._track&&n4.aliases.has(Z.name)&&this.emit("cursor",n4.aliases.get(Z.name)),n4.actions.has(Z.name)&&this.emit("cursor",Z.name)),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),Z?.name==="return"){if(this.opts.validate){let X=this.opts.validate(this.value);X&&(this.error=X instanceof Error?X.message:X,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}r3([$,Z?.name,Z?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
52
+ `),q=[];for(let Y=0;Y<Math.max(X.length,J.length);Y++)X[Y]!==J[Y]&&q.push(Y);return q}var NB=globalThis.process.platform.startsWith("win"),t3=Symbol("clack:cancel");function c0($){return $===t3}function l4($,Z){let X=$;X.isTTY&&X.setRawMode(Z)}function WJ({input:$=qJ,output:Z=YJ,overwrite:X=!0,hideCursor:J=!0}={}){let q=B1.createInterface({input:$,output:Z,prompt:"",tabSize:1});B1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let K=String(Q);if(r3([K,G,H],"cancel")){J&&Z.write(F0.cursor.show),process.exit(0);return}if(!X)return;B1.moveCursor(Z,G==="return"?0:-1,G==="return"?-1:0,()=>{B1.clearLine(Z,1,()=>{$.once("keypress",Y)})})};return J&&Z.write(F0.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),J&&Z.write(F0.cursor.show),$.isTTY&&!NB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var DB=Object.defineProperty,SB=($,Z,X)=>(Z in $)?DB($,Z,{enumerable:!0,configurable:!0,writable:!0,value:X}):$[Z]=X,I0=($,Z,X)=>(SB($,typeof Z!="symbol"?Z+"":Z,X),X);class t4{constructor($,Z=!0){I0(this,"input"),I0(this,"output"),I0(this,"_abortSignal"),I0(this,"rl"),I0(this,"opts"),I0(this,"_render"),I0(this,"_track",!1),I0(this,"_prevFrame",""),I0(this,"_subscribers",new Map),I0(this,"_cursor",0),I0(this,"state","initial"),I0(this,"error",""),I0(this,"value");let{input:X=qJ,output:J=YJ,render:q,signal:Y,...Q}=$;this.opts=Q,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=q.bind(this),this._track=Z,this._abortSignal=Y,this.input=X,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber($,Z){let X=this._subscribers.get($)??[];X.push(Z),this._subscribers.set($,X)}on($,Z){this.setSubscriber($,{cb:Z})}once($,Z){this.setSubscriber($,{cb:Z,once:!0})}emit($,...Z){let X=this._subscribers.get($)??[],J=[];for(let q of X)q.cb(...Z),q.once&&J.push(()=>X.splice(X.indexOf(q),1));for(let q of J)q()}prompt(){return new Promise(($,Z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(t3);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let X=new WB;X._write=(J,q,Y)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),Y()},this.input.pipe(X),this.rl=rX.createInterface({input:this.input,output:X,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),rX.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),l4(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(F0.cursor.show),this.output.off("resize",this.render),l4(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(F0.cursor.show),this.output.off("resize",this.render),l4(this.input,!1),$(t3)})})}onKeypress($,Z){if(this.state==="error"&&(this.state="active"),Z?.name&&(!this._track&&n4.aliases.has(Z.name)&&this.emit("cursor",n4.aliases.get(Z.name)),n4.actions.has(Z.name)&&this.emit("cursor",Z.name)),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),Z?.name==="return"){if(this.opts.validate){let X=this.opts.validate(this.value);X&&(this.error=X instanceof Error?X.message:X,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}r3([$,Z?.name,Z?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
53
53
  `),l4(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=JJ(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
54
- `).length-1;this.output.write(F0.cursor.move(-999,$*-1))}render(){let $=JJ(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(F0.cursor.hide);else{let Z=OB(this._prevFrame,$);if(this.restoreCursor(),Z&&Z?.length===1){let X=Z[0];this.output.write(F0.cursor.move(0,X)),this.output.write(F0.erase.lines(1));let J=$.split(`
54
+ `).length-1;this.output.write(F0.cursor.move(-999,$*-1))}render(){let $=JJ(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(F0.cursor.hide);else{let Z=hB(this._prevFrame,$);if(this.restoreCursor(),Z&&Z?.length===1){let X=Z[0];this.output.write(F0.cursor.move(0,X)),this.output.write(F0.erase.lines(1));let J=$.split(`
55
55
  `);this.output.write(J[X]),this._prevFrame=$,this.output.write(F0.cursor.move(0,J.length-X-1));return}if(Z&&Z?.length>1){let X=Z[0];this.output.write(F0.cursor.move(0,X)),this.output.write(F0.erase.down());let J=$.split(`
56
56
  `).slice(X);this.output.write(J.join(`
57
- `)),this._prevFrame=$;return}this.output.write(F0.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class s3 extends t4{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(Z)=>{this.output.write(F0.cursor.move(0,-1)),this.value=Z,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var NB;NB=new WeakMap;var DB=Object.defineProperty,SB=($,Z,X)=>(Z in $)?DB($,Z,{enumerable:!0,configurable:!0,writable:!0,value:X}):$[Z]=X,QJ=($,Z,X)=>(SB($,typeof Z!="symbol"?Z+"":Z,X),X);class e3 extends t4{constructor($){super($,!1),QJ(this,"options"),QJ(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:Z})=>Z===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(Z)=>{switch(Z){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class $6 extends t4{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let $=this.value.slice(0,this.cursor),[Z,...X]=this.value.slice(this.cursor);return`${$}${GJ.default.inverse(Z)}${X.join("")}`}get cursor(){return this._cursor}constructor($){super($),this.on("finalize",()=>{this.value||(this.value=$.defaultValue)})}}var x=$1(d4(),1),o4=$1(d3(),1);import p0 from"node:process";function vB(){return p0.platform!=="win32"?p0.env.TERM!=="linux":!!p0.env.CI||!!p0.env.WT_SESSION||!!p0.env.TERMINUS_SUBLIME||p0.env.ConEmuTask==="{cmd::Cmder}"||p0.env.TERM_PROGRAM==="Terminus-Sublime"||p0.env.TERM_PROGRAM==="vscode"||p0.env.TERM==="xterm-256color"||p0.env.TERM==="alacritty"||p0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var X6=vB(),G0=($,Z)=>X6?$:Z,fB=G0("◆","*"),LJ=G0("■","x"),_J=G0("▲","x"),a4=G0("◇","o"),kB=G0("┌","T"),$0=G0("│","|"),J$=G0("└","—"),J6=G0("●",">"),Q6=G0("○"," "),Wj=G0("◻","[•]"),Vj=G0("◼","[+]"),Lj=G0("◻","[ ]"),_j=G0("▪","•"),VJ=G0("─","-"),bB=G0("╮","+"),yB=G0("├","+"),gB=G0("╯","+"),uB=G0("●","•"),mB=G0("◆","*"),cB=G0("▲","!"),pB=G0("■","x"),q6=($)=>{switch($){case"initial":case"active":return x.default.cyan(fB);case"cancel":return x.default.red(LJ);case"error":return x.default.yellow(_J);case"submit":return x.default.green(a4)}},dB=($)=>{let{cursor:Z,options:X,style:J}=$,q=$.maxItems??Number.POSITIVE_INFINITY,Y=Math.max(process.stdout.rows-4,0),Q=Math.min(Y,Math.max(q,5)),G=0;Z>=G+Q-3?G=Math.max(Math.min(Z-Q+3,X.length-Q),0):Z<G+2&&(G=Math.max(Z-2,0));let H=Q<X.length&&G>0,K=Q<X.length&&G+Q<X.length;return X.slice(G,G+Q).map((W,U,B)=>{let R=U===0&&H,_=U===B.length-1&&K;return R||_?x.default.dim("..."):J(W,U+G===Z)})},Y6=($)=>new $6({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let Z=`${x.default.gray($0)}
57
+ `)),this._prevFrame=$;return}this.output.write(F0.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class s3 extends t4{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(Z)=>{this.output.write(F0.cursor.move(0,-1)),this.value=Z,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var vB;vB=new WeakMap;var fB=Object.defineProperty,kB=($,Z,X)=>(Z in $)?fB($,Z,{enumerable:!0,configurable:!0,writable:!0,value:X}):$[Z]=X,QJ=($,Z,X)=>(kB($,typeof Z!="symbol"?Z+"":Z,X),X);class e3 extends t4{constructor($){super($,!1),QJ(this,"options"),QJ(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:Z})=>Z===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(Z)=>{switch(Z){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class $6 extends t4{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let $=this.value.slice(0,this.cursor),[Z,...X]=this.value.slice(this.cursor);return`${$}${GJ.default.inverse(Z)}${X.join("")}`}get cursor(){return this._cursor}constructor($){super($),this.on("finalize",()=>{this.value||(this.value=$.defaultValue)})}}var x=m1(d4(),1),o4=m1(d3(),1);import p0 from"node:process";function bB(){return p0.platform!=="win32"?p0.env.TERM!=="linux":!!p0.env.CI||!!p0.env.WT_SESSION||!!p0.env.TERMINUS_SUBLIME||p0.env.ConEmuTask==="{cmd::Cmder}"||p0.env.TERM_PROGRAM==="Terminus-Sublime"||p0.env.TERM_PROGRAM==="vscode"||p0.env.TERM==="xterm-256color"||p0.env.TERM==="alacritty"||p0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var X6=bB(),G0=($,Z)=>X6?$:Z,yB=G0("◆","*"),LJ=G0("■","x"),_J=G0("▲","x"),a4=G0("◇","o"),gB=G0("┌","T"),$0=G0("│","|"),J$=G0("└","—"),J6=G0("●",">"),Q6=G0("○"," "),_j=G0("◻","[•]"),Rj=G0("◼","[+]"),Tj=G0("◻","[ ]"),Fj=G0("▪","•"),VJ=G0("─","-"),uB=G0("╮","+"),mB=G0("├","+"),cB=G0("╯","+"),pB=G0("●","•"),dB=G0("◆","*"),lB=G0("▲","!"),nB=G0("■","x"),q6=($)=>{switch($){case"initial":case"active":return x.default.cyan(yB);case"cancel":return x.default.red(LJ);case"error":return x.default.yellow(_J);case"submit":return x.default.green(a4)}},iB=($)=>{let{cursor:Z,options:X,style:J}=$,q=$.maxItems??Number.POSITIVE_INFINITY,Y=Math.max(process.stdout.rows-4,0),Q=Math.min(Y,Math.max(q,5)),G=0;Z>=G+Q-3?G=Math.max(Math.min(Z-Q+3,X.length-Q),0):Z<G+2&&(G=Math.max(Z-2,0));let H=Q<X.length&&G>0,K=Q<X.length&&G+Q<X.length;return X.slice(G,G+Q).map((W,U,B)=>{let R=U===0&&H,_=U===B.length-1&&K;return R||_?x.default.dim("..."):J(W,U+G===Z)})},Y6=($)=>new $6({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let Z=`${x.default.gray($0)}
58
58
  ${q6(this.state)} ${$.message}
59
59
  `,X=$.placeholder?x.default.inverse($.placeholder[0])+x.default.dim($.placeholder.slice(1)):x.default.inverse(x.default.hidden("_")),J=this.value?this.valueWithCursor:X;switch(this.state){case"error":return`${Z.trim()}
60
60
  ${x.default.yellow($0)} ${J}
@@ -70,7 +70,7 @@ ${x.default.cyan(J$)}
70
70
  `}}}).prompt()},G6=($)=>{let Z=(X,J)=>{let q=X.label??String(X.value);switch(J){case"selected":return`${x.default.dim(q)}`;case"active":return`${x.default.green(J6)} ${q} ${X.hint?x.default.dim(`(${X.hint})`):""}`;case"cancelled":return`${x.default.strikethrough(x.default.dim(q))}`;default:return`${x.default.dim(Q6)} ${x.default.dim(q)}`}};return new e3({options:$.options,initialValue:$.initialValue,render(){let X=`${x.default.gray($0)}
71
71
  ${q6(this.state)} ${$.message}
72
72
  `;switch(this.state){case"submit":return`${X}${x.default.gray($0)} ${Z(this.options[this.cursor],"selected")}`;case"cancel":return`${X}${x.default.gray($0)} ${Z(this.options[this.cursor],"cancelled")}
73
- ${x.default.gray($0)}`;default:return`${X}${x.default.cyan($0)} ${dB({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(J,q)=>Z(J,q?"active":"inactive")}).join(`
73
+ ${x.default.gray($0)}`;default:return`${X}${x.default.cyan($0)} ${iB({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(J,q)=>Z(J,q?"active":"inactive")}).join(`
74
74
  ${x.default.cyan($0)} `)}
75
75
  ${x.default.cyan(J$)}
76
76
  `}}}).prompt()};var H6=($="",Z="")=>{let X=`
@@ -78,33 +78,33 @@ ${$}
78
78
  `.split(`
79
79
  `),J=Z6(Z).length,q=Math.max(X.reduce((Q,G)=>{let H=Z6(G);return H.length>Q?H.length:Q},0),J)+2,Y=X.map((Q)=>`${x.default.gray($0)} ${x.default.dim(Q)}${" ".repeat(q-Z6(Q).length)}${x.default.gray($0)}`).join(`
80
80
  `);process.stdout.write(`${x.default.gray($0)}
81
- ${x.default.green(a4)} ${x.default.reset(Z)} ${x.default.gray(VJ.repeat(Math.max(q-J-1,1))+bB)}
81
+ ${x.default.green(a4)} ${x.default.reset(Z)} ${x.default.gray(VJ.repeat(Math.max(q-J-1,1))+uB)}
82
82
  ${Y}
83
- ${x.default.gray(yB+VJ.repeat(q+2)+gB)}
84
- `)},W1=($="")=>{process.stdout.write(`${x.default.gray(J$)} ${x.default.red($)}
83
+ ${x.default.gray(mB+VJ.repeat(q+2)+cB)}
84
+ `)},U1=($="")=>{process.stdout.write(`${x.default.gray(J$)} ${x.default.red($)}
85
85
 
86
- `)},r4=($="")=>{process.stdout.write(`${x.default.gray(kB)} ${$}
86
+ `)},r4=($="")=>{process.stdout.write(`${x.default.gray(gB)} ${$}
87
87
  `)},s4=($="")=>{process.stdout.write(`${x.default.gray($0)}
88
88
  ${x.default.gray(J$)} ${$}
89
89
 
90
90
  `)},S={message:($="",{symbol:Z=x.default.gray($0)}={})=>{let X=[`${x.default.gray($0)}`];if($){let[J,...q]=$.split(`
91
91
  `);X.push(`${Z} ${J}`,...q.map((Y)=>`${x.default.gray($0)} ${Y}`))}process.stdout.write(`${X.join(`
92
92
  `)}
93
- `)},info:($)=>{S.message($,{symbol:x.default.blue(uB)})},success:($)=>{S.message($,{symbol:x.default.green(mB)})},step:($)=>{S.message($,{symbol:x.default.green(a4)})},warn:($)=>{S.message($,{symbol:x.default.yellow(cB)})},warning:($)=>{S.warn($)},error:($)=>{S.message($,{symbol:x.default.red(pB)})}},Rj=`${x.default.gray($0)} `;var RJ=({indicator:$="dots"}={})=>{let Z=X6?["◒","◐","◓","◑"]:["•","o","O","0"],X=X6?80:120,J=process.env.CI==="true",q,Y,Q=!1,G="",H,K=performance.now(),W=(I)=>{let n=I>1?"Something went wrong":"Canceled";Q&&c(n,I)},U=()=>W(2),B=()=>W(1),R=()=>{process.on("uncaughtExceptionMonitor",U),process.on("unhandledRejection",U),process.on("SIGINT",B),process.on("SIGTERM",B),process.on("exit",W)},_=()=>{process.removeListener("uncaughtExceptionMonitor",U),process.removeListener("unhandledRejection",U),process.removeListener("SIGINT",B),process.removeListener("SIGTERM",B),process.removeListener("exit",W)},L=()=>{if(H===void 0)return;J&&process.stdout.write(`
93
+ `)},info:($)=>{S.message($,{symbol:x.default.blue(pB)})},success:($)=>{S.message($,{symbol:x.default.green(dB)})},step:($)=>{S.message($,{symbol:x.default.green(a4)})},warn:($)=>{S.message($,{symbol:x.default.yellow(lB)})},warning:($)=>{S.warn($)},error:($)=>{S.message($,{symbol:x.default.red(nB)})}},Mj=`${x.default.gray($0)} `;var RJ=({indicator:$="dots"}={})=>{let Z=X6?["◒","◐","◓","◑"]:["•","o","O","0"],X=X6?80:120,J=process.env.CI==="true",q,Y,Q=!1,G="",H,K=performance.now(),W=(I)=>{let n=I>1?"Something went wrong":"Canceled";Q&&c(n,I)},U=()=>W(2),B=()=>W(1),R=()=>{process.on("uncaughtExceptionMonitor",U),process.on("unhandledRejection",U),process.on("SIGINT",B),process.on("SIGTERM",B),process.on("exit",W)},_=()=>{process.removeListener("uncaughtExceptionMonitor",U),process.removeListener("unhandledRejection",U),process.removeListener("SIGINT",B),process.removeListener("SIGTERM",B),process.removeListener("exit",W)},L=()=>{if(H===void 0)return;J&&process.stdout.write(`
94
94
  `);let I=H.split(`
95
95
  `);process.stdout.write(o4.cursor.move(-999,I.length-1)),process.stdout.write(o4.erase.down(I.length))},j=(I)=>I.replace(/\.+$/,""),C=(I)=>{let n=(performance.now()-I)/1000,i=Math.floor(n/60),a=Math.floor(n%60);return i>0?`[${i}m ${a}s]`:`[${a}s]`},N=(I="")=>{Q=!0,q=WJ(),G=j(I),K=performance.now(),process.stdout.write(`${x.default.gray($0)}
96
96
  `);let n=0,i=0;R(),Y=setInterval(()=>{if(J&&G===H)return;L(),H=G;let a=x.default.magenta(Z[n]);if(J)process.stdout.write(`${a} ${G}...`);else if($==="timer")process.stdout.write(`${a} ${G} ${C(K)}`);else{let K0=".".repeat(Math.floor(i)).slice(0,3);process.stdout.write(`${a} ${G}${K0}`)}n=n+1<Z.length?n+1:0,i=i<Z.length?i+0.125:0},X)},c=(I="",n=0)=>{Q=!1,clearInterval(Y),L();let i=n===0?x.default.green(a4):n===1?x.default.red(LJ):x.default.red(_J);G=j(I??G),$==="timer"?process.stdout.write(`${i} ${G} ${C(K)}
97
97
  `):process.stdout.write(`${i} ${G}
98
- `),_(),q()};return{start:N,stop:c,message:(I="")=>{G=j(I??G)}}};var o=$1(d4(),1);import{notStrictEqual as WU,strictEqual as VU}from"assert";var nB={right:oB,center:aB};class FJ{constructor($){var Z;this.width=$.width,this.wrap=(Z=$.wrap)!==null&&Z!==void 0?Z:!0,this.rows=[]}span(...$){let Z=this.div(...$);Z.span=!0}resetOutput(){this.rows=[]}div(...$){if($.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...$)&&typeof $[0]==="string")return this.applyLayoutDSL($[0]);let Z=$.map((X)=>{if(typeof X==="string")return this.colFromString(X);return X});return this.rows.push(Z),Z}shouldApplyLayoutDSL(...$){return $.length===1&&typeof $[0]==="string"&&/[\t\n]/.test($[0])}applyLayoutDSL($){let Z=$.split(`
98
+ `),_(),q()};return{start:N,stop:c,message:(I="")=>{G=j(I??G)}}};var o=m1(d4(),1);import{notStrictEqual as _U,strictEqual as RU}from"assert";var oB={right:sB,center:eB};class FJ{constructor($){var Z;this.width=$.width,this.wrap=(Z=$.wrap)!==null&&Z!==void 0?Z:!0,this.rows=[]}span(...$){let Z=this.div(...$);Z.span=!0}resetOutput(){this.rows=[]}div(...$){if($.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...$)&&typeof $[0]==="string")return this.applyLayoutDSL($[0]);let Z=$.map((X)=>{if(typeof X==="string")return this.colFromString(X);return X});return this.rows.push(Z),Z}shouldApplyLayoutDSL(...$){return $.length===1&&typeof $[0]==="string"&&/[\t\n]/.test($[0])}applyLayoutDSL($){let Z=$.split(`
99
99
  `).map((J)=>J.split("\t")),X=0;return Z.forEach((J)=>{if(J.length>1&&w0.stringWidth(J[0])>X)X=Math.min(Math.floor(this.width*0.5),w0.stringWidth(J[0]))}),Z.forEach((J)=>{this.div(...J.map((q,Y)=>{return{text:q.trim(),padding:this.measurePadding(q),width:Y===0&&J.length>1?X:void 0}}))}),this.rows[this.rows.length-1]}colFromString($){return{text:$,padding:this.measurePadding($)}}measurePadding($){let Z=w0.stripAnsi($);return[0,Z.match(/\s*$/)[0].length,0,Z.match(/^\s*/)[0].length]}toString(){let $=[];return this.rows.forEach((Z)=>{this.rowToString(Z,$)}),$.filter((Z)=>!Z.hidden).map((Z)=>Z.text).join(`
100
- `)}rowToString($,Z){return this.rasterize($).forEach((X,J)=>{let q="";X.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),K=Y;if(H>w0.stringWidth(Y))K+=" ".repeat(H-w0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let U=nB[$[Q].align];if(K=U(K,H),w0.stringWidth(K)<H)K+=" ".repeat((G||0)-w0.stringWidth(K)-1)}let W=$[Q].padding||[0,0,0,0];if(W[3])q+=" ".repeat(W[3]);if(q+=TJ($[Q],K,"| "),q+=K,q+=TJ($[Q],K," |"),W[1])q+=" ".repeat(W[1]);if(J===0&&Z.length>0)q=this.renderInline(q,Z[Z.length-1])}),Z.push({text:q.replace(/ +$/,""),span:$.span})}),Z}renderInline($,Z){let X=$.match(/^ */),J=X?X[0].length:0,q=Z.text,Y=w0.stringWidth(q.trimRight());if(!Z.span)return $;if(!this.wrap)return Z.hidden=!0,q+$;if(J<Y)return $;return Z.hidden=!0,q.trimRight()+" ".repeat(J-Y)+$.trimLeft()}rasterize($){let Z=[],X=this.columnWidths($),J;return $.forEach((q,Y)=>{if(q.width=X[Y],this.wrap)J=w0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
100
+ `)}rowToString($,Z){return this.rasterize($).forEach((X,J)=>{let q="";X.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),K=Y;if(H>w0.stringWidth(Y))K+=" ".repeat(H-w0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let U=oB[$[Q].align];if(K=U(K,H),w0.stringWidth(K)<H)K+=" ".repeat((G||0)-w0.stringWidth(K)-1)}let W=$[Q].padding||[0,0,0,0];if(W[3])q+=" ".repeat(W[3]);if(q+=TJ($[Q],K,"| "),q+=K,q+=TJ($[Q],K," |"),W[1])q+=" ".repeat(W[1]);if(J===0&&Z.length>0)q=this.renderInline(q,Z[Z.length-1])}),Z.push({text:q.replace(/ +$/,""),span:$.span})}),Z}renderInline($,Z){let X=$.match(/^ */),J=X?X[0].length:0,q=Z.text,Y=w0.stringWidth(q.trimRight());if(!Z.span)return $;if(!this.wrap)return Z.hidden=!0,q+$;if(J<Y)return $;return Z.hidden=!0,q.trimRight()+" ".repeat(J-Y)+$.trimLeft()}rasterize($){let Z=[],X=this.columnWidths($),J;return $.forEach((q,Y)=>{if(q.width=X[Y],this.wrap)J=w0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
101
101
  `);else J=q.text.split(`
102
- `);if(q.border)J.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),J.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)J.unshift(...Array(q.padding[0]||0).fill("")),J.push(...Array(q.padding[2]||0).fill(""));J.forEach((Q,G)=>{if(!Z[G])Z.push([]);let H=Z[G];for(let K=0;K<Y;K++)if(H[K]===void 0)H.push("");H.push(Q)})}),Z}negatePadding($){let Z=$.width||0;if($.padding)Z-=($.padding[3]||0)+($.padding[1]||0);if($.border)Z-=4;return Z}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||w0.stringWidth(Y.text)});let Z=$.length,X=this.width,J=$.map((Y)=>{if(Y.width)return Z--,X-=Y.width,Y.width;return}),q=Z?Math.floor(X/Z):0;return J.map((Y,Q)=>{if(Y===void 0)return Math.max(q,iB($[Q]));return Y})}}function TJ($,Z,X){if($.border){if(/[.']-+[.']/.test(Z))return"";if(Z.trim().length!==0)return X;return" "}return""}function iB($){let Z=$.padding||[],X=1+(Z[3]||0)+(Z[1]||0);if($.border)return X+4;return X}function tB(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function oB($,Z){$=$.trim();let X=w0.stringWidth($);if(X<Z)return" ".repeat(Z-X)+$;return $}function aB($,Z){$=$.trim();let X=w0.stringWidth($);if(X>=Z)return $;return" ".repeat(Z-X>>1)+$}var w0;function MJ($,Z){return w0=Z,new FJ({width:($===null||$===void 0?void 0:$.width)||tB(),wrap:$===null||$===void 0?void 0:$.wrap})}var CJ=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function z6($){return $.replace(CJ,"")}function PJ($,Z){let[X,J]=$.match(CJ)||["",""];$=z6($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%Z===0)q+=`
103
- `;q+=$.charAt(Y)}if(X&&J)q=`${X}${q}${J}`;return q}function K6($){return MJ($,{stringWidth:(Z)=>{return[...Z].length},stripAnsi:z6,wrap:PJ})}import{dirname as xJ,resolve as jJ}from"path";import{readdirSync as rB,statSync as sB}from"fs";function B6($,Z){let X=jJ(".",$),J;if(!sB(X).isDirectory())X=xJ(X);while(!0){if(J=Z(X,rB(X)),J)return jJ(X,J);if(X=xJ(J=X),J===X)break}}import{inspect as LU}from"util";import{readFileSync as _U}from"fs";import{fileURLToPath as RU}from"url";import{format as ZU}from"util";import{normalize as XU,resolve as JU}from"path";function O1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let X="",J=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(J)J=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))J=!0;else if(Q!=="-"&&Q!=="_")X+=Q}return X}}function e4($,Z){let X=$.toLowerCase();Z=Z||"-";let J="";for(let q=0;q<$.length;q++){let Y=X.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)J+=`${Z}${X.charAt(q)}`;else J+=Q}return J}function $2($){if($===null||$===void 0)return!1;if(typeof $==="number")return!0;if(/^0x[0-9a-f]+$/i.test($))return!0;if(/^0[^.]/.test($))return!1;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test($)}function IJ($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let Z=0,X=null,J=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(X=J,J=$.charAt(Q),J===" "&&!q){if(X!==" ")Z++;continue}if(J===q)q=null;else if((J==="'"||J==='"')&&!q)q=J;if(!Y[Z])Y[Z]="";Y[Z]+=J}return Y}var S0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(S0||(S0={}));var Y1;class W6{constructor($){Y1=$}parse($,Z){let X=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},Z),J=IJ($),q=typeof $==="string",Y=eB(Object.assign(Object.create(null),X.alias)),Q=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},X.configuration),G=Object.assign(Object.create(null),X.default),H=X.configObjects||[],K=X.envPrefix,W=Q["populate--"],U=W?"--":"_",B=Object.create(null),R=Object.create(null),_=X.__||Y1.format,L={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},j=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(X.array||[]).filter(Boolean).forEach(function(V){let F=typeof V==="object"?V.key:V,P=Object.keys(V).map(function(M){return{boolean:"bools",string:"strings",number:"numbers"}[M]}).filter(Boolean).pop();if(P)L[P][F]=!0;L.arrays[F]=!0,L.keys.push(F)}),[].concat(X.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(X.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(X.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(X.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(X.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof X.narg==="object")Object.entries(X.narg).forEach(([V,F])=>{if(typeof F==="number")L.nargs[V]=F,L.keys.push(V)});if(typeof X.coerce==="object")Object.entries(X.coerce).forEach(([V,F])=>{if(typeof F==="function")L.coercions[V]=F,L.keys.push(V)});if(typeof X.config<"u"){if(Array.isArray(X.config)||typeof X.config==="string")[].concat(X.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof X.config==="object")Object.entries(X.config).forEach(([V,F])=>{if(typeof F==="boolean"||typeof F==="function")L.configs[V]=F})}z$(X.key,Y,X.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(F){G[F]=G[V]})});let N=null;V2();let c=[],I=Object.assign(Object.create(null),{_:[]}),n={};for(let V=0;V<J.length;V++){let F=J[V],P=F.replace(/^-{3,}/,"---"),M,T,D,O,k,_0;if(F!=="--"&&/^-/.test(F)&&s(F))i(F);else if(P.match(/^---+(=|$)/)){i(F);continue}else if(F.match(/^--.+=/)||!Q["short-option-groups"]&&F.match(/^-.+=/)){if(O=F.match(/^--?([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)if(b(O[1],L.arrays))V=K0(V,O[1],J,O[2]);else if(b(O[1],L.nargs)!==!1)V=a(V,O[1],J,O[2]);else l(O[1],O[2],!0)}else if(F.match(C)&&Q["boolean-negation"]){if(O=F.match(C),O!==null&&Array.isArray(O)&&O.length>=2)T=O[1],l(T,b(T,L.arrays)?[!1]:!1)}else if(F.match(/^--.+/)||!Q["short-option-groups"]&&F.match(/^-[^-]+/)){if(O=F.match(/^--?(.+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],b(T,L.arrays))V=K0(V,T,J);else if(b(T,L.nargs)!==!1)V=a(V,T,J);else if(k=J[V+1],k!==void 0&&(!k.match(/^-/)||k.match(j))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-.\..+=/)){if(O=F.match(/^-([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)l(O[1],O[2])}else if(F.match(/^-.\..+/)&&!F.match(j)){if(k=J[V+1],O=F.match(/^-(.\..+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],k!==void 0&&!k.match(/^-/)&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[^-]+/)&&!F.match(j)){D=F.slice(1,-1).split(""),M=!1;for(let M0=0;M0<D.length;M0++){if(k=F.slice(M0+2),D[M0+1]&&D[M0+1]==="="){if(_0=F.slice(M0+3),T=D[M0],b(T,L.arrays))V=K0(V,T,J,_0);else if(b(T,L.nargs)!==!1)V=a(V,T,J,_0);else l(T,_0);M=!0;break}if(k==="-"){l(D[M0],k);continue}if(/[A-Za-z]/.test(D[M0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(k)&&b(k,L.bools)===!1){l(D[M0],k),M=!0;break}if(D[M0+1]&&D[M0+1].match(/\W/)){l(D[M0],k),M=!0;break}else l(D[M0],d(D[M0]))}if(T=F.slice(-1)[0],!M&&T!=="-")if(b(T,L.arrays))V=K0(V,T,J);else if(b(T,L.nargs)!==!1)V=a(V,T,J);else if(k=J[V+1],k!==void 0&&(!/^(-|--)[^-]/.test(k)||k.match(j))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[0-9]$/)&&F.match(j)&&b(F.slice(1),L.bools))T=F.slice(1),l(T,d(T));else if(F==="--"){c=J.slice(V+1);break}else if(Q["halt-at-non-option"]){c=J.slice(V);break}else i(F)}if(z0(I,!0),z0(I,!1),v(I),r(),G1(I,L.aliases,G,!0),t(I),Q["set-placeholder-key"])B0(I);if(Object.keys(L.counts).forEach(function(V){if(!e(I,V.split(".")))l(V,0)}),W&&c.length)I[U]=[];if(c.forEach(function(V){I[U].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(I).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete I[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete I[V.split(".").map((F)=>O1(F)).join(".")];delete I[V]});function i(V){let F=w("_",V);if(typeof F==="string"||typeof F==="number")I._.push(F)}function a(V,F,P,M){let T,D=b(F,L.nargs);if(D=typeof D!=="number"||isNaN(D)?1:D,D===0){if(!W0(M))N=Error(_("Argument unexpected for: %s",F));return l(F,d(F)),V}let O=W0(M)?0:1;if(Q["nargs-eats-options"]){if(P.length-(V+1)+O<D)N=Error(_("Not enough arguments following: %s",F));O=D}else{for(T=V+1;T<P.length;T++)if(!P[T].match(/^-[^0-9]/)||P[T].match(j)||s(P[T]))O++;else break;if(O<D)N=Error(_("Not enough arguments following: %s",F))}let k=Math.min(O,D);if(!W0(M)&&k>0)l(F,M),k--;for(T=V+1;T<k+V+1;T++)l(F,P[T]);return V+k}function K0(V,F,P,M){let T=[],D=M||P[V+1],O=b(F,L.nargs);if(b(F,L.bools)&&!/^(true|false)$/.test(D))T.push(!0);else if(W0(D)||W0(M)&&/^-/.test(D)&&!j.test(D)&&!s(D)){if(G[F]!==void 0){let k=G[F];T=Array.isArray(k)?k:[k]}}else{if(!W0(M))T.push(E(F,M,!0));for(let k=V+1;k<P.length;k++){if(!Q["greedy-arrays"]&&T.length>0||O&&typeof O==="number"&&T.length>=O)break;if(D=P[k],/^-/.test(D)&&!j.test(D)&&!s(D))break;V=k,T.push(E(F,D,q))}}if(typeof O==="number"&&(O&&T.length<O||isNaN(O)&&T.length===0))N=Error(_("Not enough arguments following: %s",F));return l(F,T),V}function l(V,F,P=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let D=V.split(".").map(function(O){return O1(O)}).join(".");x0(V,D)}let M=E(V,F,P),T=V.split(".");if(e0(I,T,M),L.aliases[V])L.aliases[V].forEach(function(D){let O=D.split(".");e0(I,O,M)});if(T.length>1&&Q["dot-notation"])(L.aliases[T[0]]||[]).forEach(function(D){let O=D.split("."),k=[].concat(T);if(k.shift(),O=O.concat(k),!(L.aliases[V]||[]).includes(O.join(".")))e0(I,O,M)});if(b(V,L.normalize)&&!b(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(O){Object.defineProperty(n,O,{enumerable:!0,get(){return F},set(k){F=typeof k==="string"?Y1.normalize(k):k}})})}function x0(V,F){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[F],B[F]=!0;if(!(L.aliases[F]&&L.aliases[F].length))x0(F,V)}function E(V,F,P){if(P)F=$U(F);if(b(V,L.bools)||b(V,L.counts)){if(typeof F==="string")F=F==="true"}let M=Array.isArray(F)?F.map(function(T){return w(V,T)}):w(V,F);if(b(V,L.counts)&&(W0(M)||typeof M==="boolean"))M=U6();if(b(V,L.normalize)&&b(V,L.arrays))if(Array.isArray(F))M=F.map((T)=>{return Y1.normalize(T)});else M=Y1.normalize(F);return M}function w(V,F){if(!Q["parse-positional-numbers"]&&V==="_")return F;if(!b(V,L.strings)&&!b(V,L.bools)&&!Array.isArray(F)){if($2(F)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${F}`)))||!W0(F)&&b(V,L.numbers))F=Number(F)}return F}function v(V){let F=Object.create(null);G1(F,L.aliases,G),Object.keys(L.configs).forEach(function(P){let M=V[P]||F[P];if(M)try{let T=null,D=Y1.resolve(Y1.cwd(),M),O=L.configs[P];if(typeof O==="function"){try{T=O(D)}catch(k){T=k}if(T instanceof Error){N=T;return}}else T=Y1.require(D);u(T)}catch(T){if(T.name==="PermissionDenied")N=T;else if(V[P])N=Error(_("Invalid JSON config file: %s",M))}})}function u(V,F){Object.keys(V).forEach(function(P){let M=V[P],T=F?F+"."+P:P;if(typeof M==="object"&&M!==null&&!Array.isArray(M)&&Q["dot-notation"])u(M,T);else if(!e(I,T.split("."))||b(T,L.arrays)&&Q["combine-arrays"])l(T,M)})}function r(){if(typeof H<"u")H.forEach(function(V){u(V)})}function z0(V,F){if(typeof K>"u")return;let P=typeof K==="string"?K:"",M=Y1.env();Object.keys(M).forEach(function(T){if(P===""||T.lastIndexOf(P,0)===0){let D=T.split("__").map(function(O,k){if(k===0)O=O.substring(P.length);return O1(O)});if((F&&L.configs[D.join(".")]||!F)&&!e(V,D))l(D.join("."),M[T])}})}function t(V){let F,P=new Set;Object.keys(V).forEach(function(M){if(!P.has(M)){if(F=b(M,L.coercions),typeof F==="function")try{let T=w(M,F(V[M]));[].concat(L.aliases[M]||[],M).forEach((D)=>{P.add(D),V[D]=T})}catch(T){N=T}}})}function B0(V){return L.keys.forEach((F)=>{if(~F.indexOf("."))return;if(typeof V[F]>"u")V[F]=void 0}),V}function G1(V,F,P,M=!1){Object.keys(P).forEach(function(T){if(!e(V,T.split("."))){if(e0(V,T.split("."),P[T]),M)R[T]=!0;(F[T]||[]).forEach(function(D){if(e(V,D.split(".")))return;e0(V,D.split("."),P[T])})}})}function e(V,F){let P=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(T){P=P[T]||{}});let M=F[F.length-1];if(typeof P!=="object")return!1;else return M in P}function e0(V,F,P){let M=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(_0){if(_0=wJ(_0),typeof M==="object"&&M[_0]===void 0)M[_0]={};if(typeof M[_0]!=="object"||Array.isArray(M[_0])){if(Array.isArray(M[_0]))M[_0].push({});else M[_0]=[M[_0],{}];M=M[_0][M[_0].length-1]}else M=M[_0]});let T=wJ(F[F.length-1]),D=b(F.join("."),L.arrays),O=Array.isArray(P),k=Q["duplicate-arguments-array"];if(!k&&b(T,L.nargs)){if(k=!0,!W0(M[T])&&L.nargs[T]===1||Array.isArray(M[T])&&M[T].length===L.nargs[T])M[T]=void 0}if(P===U6())M[T]=U6(M[T]);else if(Array.isArray(M[T]))if(k&&D&&O)M[T]=Q["flatten-duplicate-arrays"]?M[T].concat(P):(Array.isArray(M[T][0])?M[T]:[M[T]]).concat([P]);else if(!k&&Boolean(D)===Boolean(O))M[T]=P;else M[T]=M[T].concat([P]);else if(M[T]===void 0&&D)M[T]=O?P:[P];else if(k&&!(M[T]===void 0||b(T,L.counts)||b(T,L.bools)))M[T]=[M[T],P];else M[T]=P}function z$(...V){V.forEach(function(F){Object.keys(F||{}).forEach(function(P){if(L.aliases[P])return;L.aliases[P]=[].concat(Y[P]||[]),L.aliases[P].concat(P).forEach(function(M){if(/-/.test(M)&&Q["camel-case-expansion"]){let T=O1(M);if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),B[T]=!0}}),L.aliases[P].concat(P).forEach(function(M){if(M.length>1&&/[A-Z]/.test(M)&&Q["camel-case-expansion"]){let T=e4(M,"-");if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),B[T]=!0}}),L.aliases[P].forEach(function(M){L.aliases[M]=[P].concat(L.aliases[P].filter(function(T){return M!==T}))})})})}function b(V,F){let P=[].concat(L.aliases[V]||[],V),M=Object.keys(F),T=P.find((D)=>M.includes(D));return T?F[T]:!1}function m1(V){let F=Object.keys(L);return[].concat(F.map((M)=>L[M])).some(function(M){return Array.isArray(M)?M.includes(V):M[V]})}function y6(V,...F){return[].concat(...F).some(function(M){let T=V.match(M);return T&&m1(T[1])})}function y(V){if(V.match(j)||!V.match(/^-[^-]+/))return!1;let F=!0,P,M=V.slice(1).split("");for(let T=0;T<M.length;T++){if(P=V.slice(T+2),!m1(M[T])){F=!1;break}if(M[T+1]&&M[T+1]==="="||P==="-"||/[A-Za-z]/.test(M[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(P)||M[T+1]&&M[T+1].match(/\W/))break}return F}function s(V){return Q["unknown-options-as-args"]&&U0(V)}function U0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(j))return!1;if(y(V))return!1;return!y6(V,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function d(V){if(!b(V,L.bools)&&!b(V,L.counts)&&`${V}`in G)return G[V];else return T0(q0(V))}function T0(V){return{[S0.BOOLEAN]:!0,[S0.STRING]:"",[S0.NUMBER]:void 0,[S0.ARRAY]:[]}[V]}function q0(V){let F=S0.BOOLEAN;if(b(V,L.strings))F=S0.STRING;else if(b(V,L.numbers))F=S0.NUMBER;else if(b(V,L.bools))F=S0.BOOLEAN;else if(b(V,L.arrays))F=S0.ARRAY;return F}function W0(V){return V===void 0}function V2(){Object.keys(L.counts).find((V)=>{if(b(V,L.arrays))return N=Error(_("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(b(V,L.nargs))return N=Error(_("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(n,I),configuration:Q,defaulted:Object.assign({},R),error:N,newAliases:Object.assign({},B)}}}function eB($){let Z=[],X=Object.create(null),J=!0;Object.keys($).forEach(function(q){Z.push([].concat($[q],q))});while(J){J=!1;for(let q=0;q<Z.length;q++)for(let Y=q+1;Y<Z.length;Y++)if(Z[q].filter(function(G){return Z[Y].indexOf(G)!==-1}).length){Z[q]=Z[q].concat(Z[Y]),Z.splice(Y,1),J=!0;break}}return Z.forEach(function(q){q=q.filter(function(Q,G,H){return H.indexOf(Q)===G});let Y=q.pop();if(Y!==void 0&&typeof Y==="string")X[Y]=q}),X}function U6($){return $!==void 0?$+1:1}function wJ($){if($==="__proto__")return"___proto___";return $}function $U($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var V6,L6,_6,OJ=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,EJ=(L6=(V6=process===null||process===void 0?void 0:process.versions)===null||V6===void 0?void 0:V6.node)!==null&&L6!==void 0?L6:(_6=process===null||process===void 0?void 0:process.version)===null||_6===void 0?void 0:_6.slice(1);if(EJ){if(Number(EJ.match(/^([^.]+)/)[1])<OJ)throw Error(`yargs parser supports a minimum Node.js version of ${OJ}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var QU=process?process.env:{},AJ=new W6({cwd:process.cwd,env:()=>{return QU},format:ZU,normalize:XU,resolve:JU,require:($)=>{return V0($)}}),w$=function(Z,X){return AJ.parse(Z.slice(),X).argv};w$.detailed=function($,Z){return AJ.parse($.slice(),Z)};w$.camelCase=O1;w$.decamelize=e4;w$.looksLikeNumber=$2;var R6=w$;import{basename as TU,dirname as FU,extname as MU,relative as CU,resolve as kJ}from"path";function hJ(){if(qU())return 0;return 1}function qU(){return YU()&&!process.defaultApp}function YU(){return!!process.versions.electron}function T6($){return $.slice(hJ()+1)}function NJ(){return process.argv[hJ()]}class Z0 extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,Z0)}}import{readFileSync as GU,statSync as HU,writeFile as zU}from"fs";import{format as KU}from"util";import{resolve as BU}from"path";var DJ={fs:{readFileSync:GU,writeFile:zU},format:KU,resolve:BU,exists:($)=>{try{return HU($).isFile()}catch(Z){return!1}}};var d0;class SJ{constructor($){$=$||{},this.directory=$.directory||"./locales",this.updateFiles=typeof $.updateFiles==="boolean"?$.updateFiles:!0,this.locale=$.locale||"en",this.fallbackToLanguage=typeof $.fallbackToLanguage==="boolean"?$.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...$){if(typeof arguments[0]!=="string")return this._taggedLiteral(arguments[0],...arguments);let Z=$.shift(),X=function(){};if(typeof $[$.length-1]==="function")X=$.pop();if(X=X||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][Z]&&this.updateFiles)this.cache[this.locale][Z]=Z,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:X});else X();return d0.format.apply(d0.format,[this.cache[this.locale][Z]||Z].concat($))}__n(){let $=Array.prototype.slice.call(arguments),Z=$.shift(),X=$.shift(),J=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=J===1?Z:X;if(this.cache[this.locale][Z])Y=this.cache[this.locale][Z][J===1?"one":"other"];if(!this.cache[this.locale][Z]&&this.updateFiles)this.cache[this.locale][Z]={one:Z,other:X},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(J);return d0.format.apply(d0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let Z in $)if(Object.prototype.hasOwnProperty.call($,Z))this.cache[this.locale][Z]=$[Z]}_taggedLiteral($,...Z){let X="";return $.forEach(function(J,q){let Y=Z[q+1];if(X+=J,typeof Y<"u")X+="%s"}),this.__.apply(this,[X].concat([].slice.call(Z,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,Z=this.writeQueue[0],X=Z.directory,J=Z.locale,q=Z.cb,Y=this._resolveLocaleFile(X,J),Q=JSON.stringify(this.cache[J],null,2);d0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},Z=this._resolveLocaleFile(this.directory,this.locale);try{if(d0.fs.readFileSync)$=JSON.parse(d0.fs.readFileSync(Z,"utf-8"))}catch(X){if(X instanceof SyntaxError)X.message="syntax error in "+Z;if(X.code==="ENOENT")$={};else throw X}this.cache[this.locale]=$}_resolveLocaleFile($,Z){let X=d0.resolve($,"./",Z+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(X)&&~Z.lastIndexOf("_")){let J=d0.resolve($,"./",Z.split("_")[0]+".json");if(this._fileExistsSync(J))X=J}return X}_fileExistsSync($){return d0.exists($)}}function vJ($,Z){d0=Z;let X=new SJ($);return{__:X.__.bind(X),__n:X.__n.bind(X),setLocale:X.setLocale.bind(X),getLocale:X.getLocale.bind(X),updateLocale:X.updateLocale.bind(X),locale:X.locale}}var UU=($)=>{return vJ($,DJ)},fJ=UU;var PU="require is not supported by ESM",bJ="loading a directory of commands is not supported yet for ESM",O$;try{O$=RU(import.meta.url)}catch($){O$=process.cwd()}var xU=O$.substring(0,O$.lastIndexOf("node_modules")),F6={assert:{notStrictEqual:WU,strictEqual:VU},cliui:K6,findUp:B6,getEnv:($)=>{return process.env[$]},inspect:LU,getCallerFile:()=>{throw new Z0(bJ)},getProcessArgvBin:NJ,mainFilename:xU||process.cwd(),Parser:R6,path:{basename:TU,dirname:FU,extname:MU,relative:CU,resolve:kJ},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,Z)=>process.emitWarning($,Z),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:_U,require:()=>{throw new Z0(PU)},requireDirectory:()=>{throw new Z0(bJ)},stringWidth:($)=>{return[...$].length},y18n:fJ({directory:kJ(O$,"../../../locales"),updateFiles:!1})};function P0($,Z,X,J){X.assert.notStrictEqual($,Z,J)}function M6($,Z){Z.assert.strictEqual(typeof $,"string")}function Q$($){return Object.keys($)}function X0($){return!!$&&!!$.then&&typeof $.then==="function"}function V1($){let X=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),J=/\.*[\][<>]/g,q=X.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(J,""),demanded:[],optional:[]};return X.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===X.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(J,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(J,"").split("|"),variadic:H})}),Y}var jU=["first","second","third","fourth","fifth","sixth"];function A($,Z,X){function J(){return typeof $==="object"?[{demanded:[],optional:[]},$,Z]:[V1(`cmd ${$}`),Z,X]}try{let q=0,[Y,Q,G]=J(),H=[].slice.call(Q);while(H.length&&H[H.length-1]===void 0)H.pop();let K=G||H.length;if(K<Y.demanded.length)throw new Z0(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let W=Y.demanded.length+Y.optional.length;if(K>W)throw new Z0(`Too many arguments provided. Expected max ${W} but received ${K}.`);Y.demanded.forEach((U)=>{let B=H.shift(),R=yJ(B);if(U.cmd.filter((L)=>L===R||L==="*").length===0)gJ(R,U.cmd,q);q+=1}),Y.optional.forEach((U)=>{if(H.length===0)return;let B=H.shift(),R=yJ(B);if(U.cmd.filter((L)=>L===R||L==="*").length===0)gJ(R,U.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function yJ($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function gJ($,Z,X){throw new Z0(`Invalid ${jU[X]||"manyith"} argument. Expected ${Z.join(" or ")} but received ${$}.`)}class C6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,Z,X=!0,J=!1){if(A("<array|function> [boolean] [boolean] [boolean]",[$,Z,X],arguments.length),Array.isArray($)){for(let q=0;q<$.length;q++){if(typeof $[q]!=="function")throw Error("middleware must be a function");let Y=$[q];Y.applyBeforeValidation=Z,Y.global=X}Array.prototype.push.apply(this.globalMiddleware,$)}else if(typeof $==="function"){let q=$;q.applyBeforeValidation=Z,q.global=X,q.mutates=J,this.globalMiddleware.push($)}return this.yargs}addCoerceMiddleware($,Z){let X=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((J)=>{let q=[...X[Z]||[],Z];if(!J.option)return!0;else return!q.includes(J.option)}),$.option=Z,this.addMiddleware($,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let $=this.frozens.pop();if($!==void 0)this.globalMiddleware=$}reset(){this.globalMiddleware=this.globalMiddleware.filter(($)=>$.global)}}function uJ($){if(!$)return[];return $.map((Z)=>{return Z.applyBeforeValidation=!1,Z})}function E1($,Z,X,J){return X.reduce((q,Y)=>{if(Y.applyBeforeValidation!==J)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(X0(q))return q.then((Q)=>Promise.all([Q,Y(Q,Z)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,Z);return X0(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function A1($,Z,X=(J)=>{throw J}){try{let J=IU($)?$():$;return X0(J)?J.then((q)=>Z(q)):Z(J)}catch(J){return X(J)}}function IU($){return typeof $==="function"}function P6($){for(let Z=0,X=Object.keys(V0.cache),J;Z<X.length;Z++)if(J=V0.cache[X[Z]],J.exports===$)return J;return null}var q$=/(^\*)|(^\$0)/;class cJ{constructor($,Z,X,J){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=J,this.usage=$,this.globalMiddleware=X,this.validation=Z}addDirectory($,Z,X,J){if(J=J||{},typeof J.recurse!=="boolean")J.recurse=!1;if(!Array.isArray(J.extensions))J.extensions=["js"];let q=typeof J.visit==="function"?J.visit:(Y)=>Y;J.visit=(Y,Q,G)=>{let H=q(Y,Q,G);if(H){if(this.requireCache.has(Q))return H;else this.requireCache.add(Q);this.addHandler(H)}return H},this.shim.requireDirectory({require:Z,filename:X},$,J)}addHandler($,Z,X,J,q,Y){let Q=[],G=uJ(q);if(J=J||(()=>{}),Array.isArray($))if(wU($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(EU($)){let H=Array.isArray($.command)||typeof $.command==="string"?$.command:this.moduleName($);if($.aliases)H=[].concat(H).concat($.aliases);this.addHandler(H,this.extractDesc($),$.builder,$.handler,$.middlewares,$.deprecated);return}else if(mJ(X)){this.addHandler([$].concat(Q),Z,X.builder,X.handler,X.middlewares,X.deprecated);return}if(typeof $==="string"){let H=V1($);Q=Q.map((U)=>V1(U).cmd);let K=!1,W=[H.cmd].concat(Q).filter((U)=>{if(q$.test(U))return K=!0,!1;return!0});if(W.length===0&&K)W.push("$0");if(K)H.cmd=W[0],Q=W.slice(1),$=$.replace(q$,H.cmd);if(Q.forEach((U)=>{this.aliasMap[U]=H.cmd}),Z!==!1)this.usage.command($,Z,K,Q,Y);if(this.handlers[H.cmd]={original:$,description:Z,handler:J,builder:X||{},middlewares:G,deprecated:Y,demanded:H.demanded,optional:H.optional},K)this.defaultCommand=this.handlers[H.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand($,Z,X,J,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=Z.getInternalMethods().getContext(),H=G.commands.slice(),K=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let W=this.applyBuilderUpdateUsageAndParse(K,Q,Z,X.aliases,H,J,q,Y);return X0(W)?W.then((U)=>this.applyMiddlewareAndGetResult(K,Q,U.innerArgv,G,q,U.aliases,Z)):this.applyMiddlewareAndGetResult(K,Q,W.innerArgv,G,q,W.aliases,Z)}applyBuilderUpdateUsageAndParse($,Z,X,J,q,Y,Q,G){let H=Z.builder,K=X;if(Z2(H)){X.getInternalMethods().getUsageInstance().freeze();let W=H(X.getInternalMethods().reset(J),G);if(X0(W))return W.then((U)=>{return K=dJ(U)?U:X,this.parseAndUpdateUsage($,Z,K,q,Y,Q)})}else if(OU(H))X.getInternalMethods().getUsageInstance().freeze(),K=X.getInternalMethods().reset(J),Object.keys(Z.builder).forEach((W)=>{K.option(W,H[W])});return this.parseAndUpdateUsage($,Z,K,q,Y,Q)}parseAndUpdateUsage($,Z,X,J,q,Y){if($)X.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(X))X.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(J,Z),Z.description);let Q=X.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return X0(Q)?Q.then((G)=>({aliases:X.parsed.aliases,innerArgv:G})):{aliases:X.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,Z){let X=q$.test(Z.original)?Z.original.replace(q$,"").trim():Z.original,J=$.filter((q)=>{return!q$.test(q)});return J.push(X),`$0 ${J.join(" ")}`}handleValidationAndGetResult($,Z,X,J,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);X=A1(X,(K)=>{return H(K),K})}if(Z.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(X,H,!1,!1),X=E1(X,Y,Q,!1),X=A1(X,(K)=>{let W=Z.handler(K);return X0(W)?W.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(X0(X)&&!Y.getInternalMethods().hasParseCallback())X.catch((K)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,K)}catch(W){}})}if(!$)J.commands.pop(),J.fullCommands.pop();return X}applyMiddlewareAndGetResult($,Z,X,J,q,Y,Q){let G={};if(q)return X;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(Z,X,J,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(Z.middlewares),K=E1(X,Q,H,!0);return X0(K)?K.then((W)=>this.handleValidationAndGetResult($,Z,W,J,Y,Q,H,G)):this.handleValidationAndGetResult($,Z,K,J,Y,Q,H,G)}populatePositionals($,Z,X,J){Z._=Z._.slice(X.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,Z._.length);while(q.length){let G=q.shift();this.populatePositional(G,Z,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,Z,Q)}return Z._=X.commands.concat(Z._.map((G)=>""+G)),this.postProcessPositionals(Z,Q,this.cmdToParseOptions($.original),J),Q}populatePositional($,Z,X){let J=$.cmd[0];if($.variadic)X[J]=Z._.splice(0).map(String);else if(Z._.length)X[J]=[String(Z._.shift())]}cmdToParseOptions($){let Z={array:[],default:{},alias:{},demand:{}},X=V1($);return X.demanded.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)Z.array.push(q),Z.default[q]=[];Z.alias[q]=Y,Z.demand[q]=!0}),X.optional.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)Z.array.push(q),Z.default[q]=[];Z.alias[q]=Y}),Z}postProcessPositionals($,Z,X,J){let q=Object.assign({},J.getOptions());q.default=Object.assign(X.default,q.default);for(let H of Object.keys(X.alias))q.alias[H]=(q.alias[H]||[]).concat(X.alias[H]);q.array=q.array.concat(X.array),q.config={};let Y=[];if(Object.keys(Z).forEach((H)=>{Z[H].map((K)=>{if(q.configuration["unknown-options-as-args"])q.key[H]=!0;Y.push(`--${H}`),Y.push(K)})}),!Y.length)return;let Q=Object.assign({},q.configuration,{"populate--":!1}),G=this.shim.Parser.detailed(Y,Object.assign({},q,{configuration:Q}));if(G.error)J.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(Z);Object.keys(Z).forEach((K)=>{H.push(...G.aliases[K])}),Object.keys(G.argv).forEach((K)=>{if(H.includes(K)){if(!Z[K])Z[K]=G.argv[K];if(!this.isInConfigs(J,K)&&!this.isDefaulted(J,K)&&Object.prototype.hasOwnProperty.call($,K)&&Object.prototype.hasOwnProperty.call(G.argv,K)&&(Array.isArray($[K])||Array.isArray(G.argv[K])))$[K]=[].concat($[K],G.argv[K]);else $[K]=G.argv[K]}})}}isDefaulted($,Z){let{default:X}=$.getOptions();return Object.prototype.hasOwnProperty.call(X,Z)||Object.prototype.hasOwnProperty.call(X,this.shim.Parser.camelCase(Z))}isInConfigs($,Z){let{configObjects:X}=$.getOptions();return X.some((J)=>Object.prototype.hasOwnProperty.call(J,Z))||X.some((J)=>Object.prototype.hasOwnProperty.call(J,this.shim.Parser.camelCase(Z)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let X=q$.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(X,this.defaultCommand.description)}let Z=this.defaultCommand.builder;if(Z2(Z))return Z($,!0);else if(!mJ(Z))Object.keys(Z).forEach((X)=>{$.option(X,Z[X])});return}moduleName($){let Z=P6($);if(!Z)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(Z.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:Z,desc:X}){for(let J of[$,Z,X]){if(typeof J==="string"||J===!1)return J;P0(J,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();P0($,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=$}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function pJ($,Z,X,J){return new cJ($,Z,X,J)}function mJ($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function wU($){return $.every((Z)=>typeof Z==="string")}function Z2($){return typeof $==="function"}function OU($){return typeof $==="object"}function EU($){return typeof $==="object"&&!Array.isArray($)}function L1($={},Z=()=>!0){let X={};return Q$($).forEach((J)=>{if(Z(J,$[J]))X[J]=$[J]}),X}function _1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((Z)=>{let X=Z;if(X._handle&&X.isTTY&&typeof X._handle.setBlocking==="function")X._handle.setBlocking($)})}function AU($){return typeof $==="boolean"}function nJ($,Z){let X=Z.y18n.__,J={},q=[];J.failFn=function(w){q.push(w)};let Y=null,Q=null,G=!0;J.showHelpOnFail=function(w=!0,v){let[u,r]=typeof w==="string"?[!0,w]:[w,v];if($.getInternalMethods().isGlobalContext())Q=r;return Y=r,G=u,J};let H=!1;J.fail=function(w,v){let u=$.getInternalMethods().getLoggerInstance();if(q.length)for(let r=q.length-1;r>=0;--r){let z0=q[r];if(AU(z0)){if(v)throw v;else if(w)throw Error(w)}else z0(w,v,J)}else{if($.getExitProcess())_1(!0);if(!H){if(H=!0,G)$.showHelp("error"),u.error();if(w||v)u.error(w||v);let r=Y||Q;if(r){if(w||v)u.error("");u.error(r)}}if(v=v||new Z0(w),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,v);else throw v}};let K=[],W=!1;J.usage=(E,w)=>{if(E===null)return W=!0,K=[],J;return W=!1,K.push([E,w||""]),J},J.getUsage=()=>{return K},J.getUsageDisabled=()=>{return W},J.getPositionalGroupName=()=>{return X("Positionals:")};let U=[];J.example=(E,w)=>{U.push([E,w||""])};let B=[];J.command=function(w,v,u,r,z0=!1){if(u)B=B.map((t)=>{return t[2]=!1,t});B.push([w,v||"",u,r,z0])},J.getCommands=()=>B;let R={};J.describe=function(w,v){if(Array.isArray(w))w.forEach((u)=>{J.describe(u,v)});else if(typeof w==="object")Object.keys(w).forEach((u)=>{J.describe(u,w[u])});else R[w]=v},J.getDescriptions=()=>R;let _=[];J.epilog=(E)=>{_.push(E)};let L=!1,j;J.wrap=(E)=>{L=!0,j=E},J.getWrap=()=>{if(Z.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)j=K0(),L=!0;return j};let C="__yargsString__:";J.deferY18nLookup=(E)=>C+E,J.help=function(){if(I)return I;c();let w=$.customScriptName?$.$0:Z.path.basename($.$0),v=$.getDemandedOptions(),u=$.getDemandedCommands(),r=$.getDeprecatedOptions(),z0=$.getGroups(),t=$.getOptions(),B0=[];B0=B0.concat(Object.keys(R)),B0=B0.concat(Object.keys(v)),B0=B0.concat(Object.keys(u)),B0=B0.concat(Object.keys(t.default)),B0=B0.filter(i),B0=Object.keys(B0.reduce((y,s)=>{if(s!=="_")y[s]=!0;return y},{}));let G1=J.getWrap(),e=Z.cliui({width:G1,wrap:!!G1});if(!W){if(K.length)K.forEach((y)=>{if(e.div({text:`${y[0].replace(/\$0/g,w)}`}),y[1])e.div({text:`${y[1]}`,padding:[1,0,0,0]})}),e.div();else if(B.length){let y=null;if(u._)y=`${w} <${X("command")}>
102
+ `);if(q.border)J.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),J.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)J.unshift(...Array(q.padding[0]||0).fill("")),J.push(...Array(q.padding[2]||0).fill(""));J.forEach((Q,G)=>{if(!Z[G])Z.push([]);let H=Z[G];for(let K=0;K<Y;K++)if(H[K]===void 0)H.push("");H.push(Q)})}),Z}negatePadding($){let Z=$.width||0;if($.padding)Z-=($.padding[3]||0)+($.padding[1]||0);if($.border)Z-=4;return Z}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||w0.stringWidth(Y.text)});let Z=$.length,X=this.width,J=$.map((Y)=>{if(Y.width)return Z--,X-=Y.width,Y.width;return}),q=Z?Math.floor(X/Z):0;return J.map((Y,Q)=>{if(Y===void 0)return Math.max(q,aB($[Q]));return Y})}}function TJ($,Z,X){if($.border){if(/[.']-+[.']/.test(Z))return"";if(Z.trim().length!==0)return X;return" "}return""}function aB($){let Z=$.padding||[],X=1+(Z[3]||0)+(Z[1]||0);if($.border)return X+4;return X}function rB(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function sB($,Z){$=$.trim();let X=w0.stringWidth($);if(X<Z)return" ".repeat(Z-X)+$;return $}function eB($,Z){$=$.trim();let X=w0.stringWidth($);if(X>=Z)return $;return" ".repeat(Z-X>>1)+$}var w0;function MJ($,Z){return w0=Z,new FJ({width:($===null||$===void 0?void 0:$.width)||rB(),wrap:$===null||$===void 0?void 0:$.wrap})}var CJ=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function z6($){return $.replace(CJ,"")}function PJ($,Z){let[X,J]=$.match(CJ)||["",""];$=z6($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%Z===0)q+=`
103
+ `;q+=$.charAt(Y)}if(X&&J)q=`${X}${q}${J}`;return q}function K6($){return MJ($,{stringWidth:(Z)=>{return[...Z].length},stripAnsi:z6,wrap:PJ})}import{dirname as xJ,resolve as jJ}from"path";import{readdirSync as $U,statSync as ZU}from"fs";function B6($,Z){let X=jJ(".",$),J;if(!ZU(X).isDirectory())X=xJ(X);while(!0){if(J=Z(X,$U(X)),J)return jJ(X,J);if(X=xJ(J=X),J===X)break}}import{inspect as TU}from"util";import{readFileSync as FU}from"fs";import{fileURLToPath as MU}from"url";import{format as QU}from"util";import{normalize as qU,resolve as YU}from"path";function w1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let X="",J=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(J)J=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))J=!0;else if(Q!=="-"&&Q!=="_")X+=Q}return X}}function e4($,Z){let X=$.toLowerCase();Z=Z||"-";let J="";for(let q=0;q<$.length;q++){let Y=X.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)J+=`${Z}${X.charAt(q)}`;else J+=Q}return J}function $2($){if($===null||$===void 0)return!1;if(typeof $==="number")return!0;if(/^0x[0-9a-f]+$/i.test($))return!0;if(/^0[^.]/.test($))return!1;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test($)}function IJ($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let Z=0,X=null,J=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(X=J,J=$.charAt(Q),J===" "&&!q){if(X!==" ")Z++;continue}if(J===q)q=null;else if((J==="'"||J==='"')&&!q)q=J;if(!Y[Z])Y[Z]="";Y[Z]+=J}return Y}var S0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(S0||(S0={}));var q1;class W6{constructor($){q1=$}parse($,Z){let X=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},Z),J=IJ($),q=typeof $==="string",Y=XU(Object.assign(Object.create(null),X.alias)),Q=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},X.configuration),G=Object.assign(Object.create(null),X.default),H=X.configObjects||[],K=X.envPrefix,W=Q["populate--"],U=W?"--":"_",B=Object.create(null),R=Object.create(null),_=X.__||q1.format,L={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},j=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(X.array||[]).filter(Boolean).forEach(function(V){let F=typeof V==="object"?V.key:V,P=Object.keys(V).map(function(M){return{boolean:"bools",string:"strings",number:"numbers"}[M]}).filter(Boolean).pop();if(P)L[P][F]=!0;L.arrays[F]=!0,L.keys.push(F)}),[].concat(X.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(X.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(X.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(X.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(X.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof X.narg==="object")Object.entries(X.narg).forEach(([V,F])=>{if(typeof F==="number")L.nargs[V]=F,L.keys.push(V)});if(typeof X.coerce==="object")Object.entries(X.coerce).forEach(([V,F])=>{if(typeof F==="function")L.coercions[V]=F,L.keys.push(V)});if(typeof X.config<"u"){if(Array.isArray(X.config)||typeof X.config==="string")[].concat(X.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof X.config==="object")Object.entries(X.config).forEach(([V,F])=>{if(typeof F==="boolean"||typeof F==="function")L.configs[V]=F})}z$(X.key,Y,X.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(F){G[F]=G[V]})});let N=null;V2();let c=[],I=Object.assign(Object.create(null),{_:[]}),n={};for(let V=0;V<J.length;V++){let F=J[V],P=F.replace(/^-{3,}/,"---"),M,T,D,O,k,_0;if(F!=="--"&&/^-/.test(F)&&s(F))i(F);else if(P.match(/^---+(=|$)/)){i(F);continue}else if(F.match(/^--.+=/)||!Q["short-option-groups"]&&F.match(/^-.+=/)){if(O=F.match(/^--?([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)if(b(O[1],L.arrays))V=K0(V,O[1],J,O[2]);else if(b(O[1],L.nargs)!==!1)V=a(V,O[1],J,O[2]);else l(O[1],O[2],!0)}else if(F.match(C)&&Q["boolean-negation"]){if(O=F.match(C),O!==null&&Array.isArray(O)&&O.length>=2)T=O[1],l(T,b(T,L.arrays)?[!1]:!1)}else if(F.match(/^--.+/)||!Q["short-option-groups"]&&F.match(/^-[^-]+/)){if(O=F.match(/^--?(.+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],b(T,L.arrays))V=K0(V,T,J);else if(b(T,L.nargs)!==!1)V=a(V,T,J);else if(k=J[V+1],k!==void 0&&(!k.match(/^-/)||k.match(j))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-.\..+=/)){if(O=F.match(/^-([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)l(O[1],O[2])}else if(F.match(/^-.\..+/)&&!F.match(j)){if(k=J[V+1],O=F.match(/^-(.\..+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],k!==void 0&&!k.match(/^-/)&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[^-]+/)&&!F.match(j)){D=F.slice(1,-1).split(""),M=!1;for(let M0=0;M0<D.length;M0++){if(k=F.slice(M0+2),D[M0+1]&&D[M0+1]==="="){if(_0=F.slice(M0+3),T=D[M0],b(T,L.arrays))V=K0(V,T,J,_0);else if(b(T,L.nargs)!==!1)V=a(V,T,J,_0);else l(T,_0);M=!0;break}if(k==="-"){l(D[M0],k);continue}if(/[A-Za-z]/.test(D[M0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(k)&&b(k,L.bools)===!1){l(D[M0],k),M=!0;break}if(D[M0+1]&&D[M0+1].match(/\W/)){l(D[M0],k),M=!0;break}else l(D[M0],d(D[M0]))}if(T=F.slice(-1)[0],!M&&T!=="-")if(b(T,L.arrays))V=K0(V,T,J);else if(b(T,L.nargs)!==!1)V=a(V,T,J);else if(k=J[V+1],k!==void 0&&(!/^(-|--)[^-]/.test(k)||k.match(j))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[0-9]$/)&&F.match(j)&&b(F.slice(1),L.bools))T=F.slice(1),l(T,d(T));else if(F==="--"){c=J.slice(V+1);break}else if(Q["halt-at-non-option"]){c=J.slice(V);break}else i(F)}if(z0(I,!0),z0(I,!1),v(I),r(),Y1(I,L.aliases,G,!0),t(I),Q["set-placeholder-key"])B0(I);if(Object.keys(L.counts).forEach(function(V){if(!e(I,V.split(".")))l(V,0)}),W&&c.length)I[U]=[];if(c.forEach(function(V){I[U].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(I).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete I[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete I[V.split(".").map((F)=>w1(F)).join(".")];delete I[V]});function i(V){let F=w("_",V);if(typeof F==="string"||typeof F==="number")I._.push(F)}function a(V,F,P,M){let T,D=b(F,L.nargs);if(D=typeof D!=="number"||isNaN(D)?1:D,D===0){if(!W0(M))N=Error(_("Argument unexpected for: %s",F));return l(F,d(F)),V}let O=W0(M)?0:1;if(Q["nargs-eats-options"]){if(P.length-(V+1)+O<D)N=Error(_("Not enough arguments following: %s",F));O=D}else{for(T=V+1;T<P.length;T++)if(!P[T].match(/^-[^0-9]/)||P[T].match(j)||s(P[T]))O++;else break;if(O<D)N=Error(_("Not enough arguments following: %s",F))}let k=Math.min(O,D);if(!W0(M)&&k>0)l(F,M),k--;for(T=V+1;T<k+V+1;T++)l(F,P[T]);return V+k}function K0(V,F,P,M){let T=[],D=M||P[V+1],O=b(F,L.nargs);if(b(F,L.bools)&&!/^(true|false)$/.test(D))T.push(!0);else if(W0(D)||W0(M)&&/^-/.test(D)&&!j.test(D)&&!s(D)){if(G[F]!==void 0){let k=G[F];T=Array.isArray(k)?k:[k]}}else{if(!W0(M))T.push(E(F,M,!0));for(let k=V+1;k<P.length;k++){if(!Q["greedy-arrays"]&&T.length>0||O&&typeof O==="number"&&T.length>=O)break;if(D=P[k],/^-/.test(D)&&!j.test(D)&&!s(D))break;V=k,T.push(E(F,D,q))}}if(typeof O==="number"&&(O&&T.length<O||isNaN(O)&&T.length===0))N=Error(_("Not enough arguments following: %s",F));return l(F,T),V}function l(V,F,P=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let D=V.split(".").map(function(O){return w1(O)}).join(".");x0(V,D)}let M=E(V,F,P),T=V.split(".");if(e0(I,T,M),L.aliases[V])L.aliases[V].forEach(function(D){let O=D.split(".");e0(I,O,M)});if(T.length>1&&Q["dot-notation"])(L.aliases[T[0]]||[]).forEach(function(D){let O=D.split("."),k=[].concat(T);if(k.shift(),O=O.concat(k),!(L.aliases[V]||[]).includes(O.join(".")))e0(I,O,M)});if(b(V,L.normalize)&&!b(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(O){Object.defineProperty(n,O,{enumerable:!0,get(){return F},set(k){F=typeof k==="string"?q1.normalize(k):k}})})}function x0(V,F){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[F],B[F]=!0;if(!(L.aliases[F]&&L.aliases[F].length))x0(F,V)}function E(V,F,P){if(P)F=JU(F);if(b(V,L.bools)||b(V,L.counts)){if(typeof F==="string")F=F==="true"}let M=Array.isArray(F)?F.map(function(T){return w(V,T)}):w(V,F);if(b(V,L.counts)&&(W0(M)||typeof M==="boolean"))M=U6();if(b(V,L.normalize)&&b(V,L.arrays))if(Array.isArray(F))M=F.map((T)=>{return q1.normalize(T)});else M=q1.normalize(F);return M}function w(V,F){if(!Q["parse-positional-numbers"]&&V==="_")return F;if(!b(V,L.strings)&&!b(V,L.bools)&&!Array.isArray(F)){if($2(F)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${F}`)))||!W0(F)&&b(V,L.numbers))F=Number(F)}return F}function v(V){let F=Object.create(null);Y1(F,L.aliases,G),Object.keys(L.configs).forEach(function(P){let M=V[P]||F[P];if(M)try{let T=null,D=q1.resolve(q1.cwd(),M),O=L.configs[P];if(typeof O==="function"){try{T=O(D)}catch(k){T=k}if(T instanceof Error){N=T;return}}else T=q1.require(D);u(T)}catch(T){if(T.name==="PermissionDenied")N=T;else if(V[P])N=Error(_("Invalid JSON config file: %s",M))}})}function u(V,F){Object.keys(V).forEach(function(P){let M=V[P],T=F?F+"."+P:P;if(typeof M==="object"&&M!==null&&!Array.isArray(M)&&Q["dot-notation"])u(M,T);else if(!e(I,T.split("."))||b(T,L.arrays)&&Q["combine-arrays"])l(T,M)})}function r(){if(typeof H<"u")H.forEach(function(V){u(V)})}function z0(V,F){if(typeof K>"u")return;let P=typeof K==="string"?K:"",M=q1.env();Object.keys(M).forEach(function(T){if(P===""||T.lastIndexOf(P,0)===0){let D=T.split("__").map(function(O,k){if(k===0)O=O.substring(P.length);return w1(O)});if((F&&L.configs[D.join(".")]||!F)&&!e(V,D))l(D.join("."),M[T])}})}function t(V){let F,P=new Set;Object.keys(V).forEach(function(M){if(!P.has(M)){if(F=b(M,L.coercions),typeof F==="function")try{let T=w(M,F(V[M]));[].concat(L.aliases[M]||[],M).forEach((D)=>{P.add(D),V[D]=T})}catch(T){N=T}}})}function B0(V){return L.keys.forEach((F)=>{if(~F.indexOf("."))return;if(typeof V[F]>"u")V[F]=void 0}),V}function Y1(V,F,P,M=!1){Object.keys(P).forEach(function(T){if(!e(V,T.split("."))){if(e0(V,T.split("."),P[T]),M)R[T]=!0;(F[T]||[]).forEach(function(D){if(e(V,D.split(".")))return;e0(V,D.split("."),P[T])})}})}function e(V,F){let P=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(T){P=P[T]||{}});let M=F[F.length-1];if(typeof P!=="object")return!1;else return M in P}function e0(V,F,P){let M=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(_0){if(_0=wJ(_0),typeof M==="object"&&M[_0]===void 0)M[_0]={};if(typeof M[_0]!=="object"||Array.isArray(M[_0])){if(Array.isArray(M[_0]))M[_0].push({});else M[_0]=[M[_0],{}];M=M[_0][M[_0].length-1]}else M=M[_0]});let T=wJ(F[F.length-1]),D=b(F.join("."),L.arrays),O=Array.isArray(P),k=Q["duplicate-arguments-array"];if(!k&&b(T,L.nargs)){if(k=!0,!W0(M[T])&&L.nargs[T]===1||Array.isArray(M[T])&&M[T].length===L.nargs[T])M[T]=void 0}if(P===U6())M[T]=U6(M[T]);else if(Array.isArray(M[T]))if(k&&D&&O)M[T]=Q["flatten-duplicate-arrays"]?M[T].concat(P):(Array.isArray(M[T][0])?M[T]:[M[T]]).concat([P]);else if(!k&&Boolean(D)===Boolean(O))M[T]=P;else M[T]=M[T].concat([P]);else if(M[T]===void 0&&D)M[T]=O?P:[P];else if(k&&!(M[T]===void 0||b(T,L.counts)||b(T,L.bools)))M[T]=[M[T],P];else M[T]=P}function z$(...V){V.forEach(function(F){Object.keys(F||{}).forEach(function(P){if(L.aliases[P])return;L.aliases[P]=[].concat(Y[P]||[]),L.aliases[P].concat(P).forEach(function(M){if(/-/.test(M)&&Q["camel-case-expansion"]){let T=w1(M);if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),B[T]=!0}}),L.aliases[P].concat(P).forEach(function(M){if(M.length>1&&/[A-Z]/.test(M)&&Q["camel-case-expansion"]){let T=e4(M,"-");if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),B[T]=!0}}),L.aliases[P].forEach(function(M){L.aliases[M]=[P].concat(L.aliases[P].filter(function(T){return M!==T}))})})})}function b(V,F){let P=[].concat(L.aliases[V]||[],V),M=Object.keys(F),T=P.find((D)=>M.includes(D));return T?F[T]:!1}function u1(V){let F=Object.keys(L);return[].concat(F.map((M)=>L[M])).some(function(M){return Array.isArray(M)?M.includes(V):M[V]})}function y6(V,...F){return[].concat(...F).some(function(M){let T=V.match(M);return T&&u1(T[1])})}function y(V){if(V.match(j)||!V.match(/^-[^-]+/))return!1;let F=!0,P,M=V.slice(1).split("");for(let T=0;T<M.length;T++){if(P=V.slice(T+2),!u1(M[T])){F=!1;break}if(M[T+1]&&M[T+1]==="="||P==="-"||/[A-Za-z]/.test(M[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(P)||M[T+1]&&M[T+1].match(/\W/))break}return F}function s(V){return Q["unknown-options-as-args"]&&U0(V)}function U0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(j))return!1;if(y(V))return!1;return!y6(V,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function d(V){if(!b(V,L.bools)&&!b(V,L.counts)&&`${V}`in G)return G[V];else return T0(q0(V))}function T0(V){return{[S0.BOOLEAN]:!0,[S0.STRING]:"",[S0.NUMBER]:void 0,[S0.ARRAY]:[]}[V]}function q0(V){let F=S0.BOOLEAN;if(b(V,L.strings))F=S0.STRING;else if(b(V,L.numbers))F=S0.NUMBER;else if(b(V,L.bools))F=S0.BOOLEAN;else if(b(V,L.arrays))F=S0.ARRAY;return F}function W0(V){return V===void 0}function V2(){Object.keys(L.counts).find((V)=>{if(b(V,L.arrays))return N=Error(_("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(b(V,L.nargs))return N=Error(_("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(n,I),configuration:Q,defaulted:Object.assign({},R),error:N,newAliases:Object.assign({},B)}}}function XU($){let Z=[],X=Object.create(null),J=!0;Object.keys($).forEach(function(q){Z.push([].concat($[q],q))});while(J){J=!1;for(let q=0;q<Z.length;q++)for(let Y=q+1;Y<Z.length;Y++)if(Z[q].filter(function(G){return Z[Y].indexOf(G)!==-1}).length){Z[q]=Z[q].concat(Z[Y]),Z.splice(Y,1),J=!0;break}}return Z.forEach(function(q){q=q.filter(function(Q,G,H){return H.indexOf(Q)===G});let Y=q.pop();if(Y!==void 0&&typeof Y==="string")X[Y]=q}),X}function U6($){return $!==void 0?$+1:1}function wJ($){if($==="__proto__")return"___proto___";return $}function JU($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var V6,L6,_6,OJ=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,EJ=(L6=(V6=process===null||process===void 0?void 0:process.versions)===null||V6===void 0?void 0:V6.node)!==null&&L6!==void 0?L6:(_6=process===null||process===void 0?void 0:process.version)===null||_6===void 0?void 0:_6.slice(1);if(EJ){if(Number(EJ.match(/^([^.]+)/)[1])<OJ)throw Error(`yargs parser supports a minimum Node.js version of ${OJ}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var GU=process?process.env:{},AJ=new W6({cwd:process.cwd,env:()=>{return GU},format:QU,normalize:qU,resolve:YU,require:($)=>{return V0($)}}),w$=function(Z,X){return AJ.parse(Z.slice(),X).argv};w$.detailed=function($,Z){return AJ.parse($.slice(),Z)};w$.camelCase=w1;w$.decamelize=e4;w$.looksLikeNumber=$2;var R6=w$;import{basename as CU,dirname as PU,extname as xU,relative as jU,resolve as kJ}from"path";function hJ(){if(HU())return 0;return 1}function HU(){return zU()&&!process.defaultApp}function zU(){return!!process.versions.electron}function T6($){return $.slice(hJ()+1)}function NJ(){return process.argv[hJ()]}class Z0 extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,Z0)}}import{readFileSync as KU,statSync as BU,writeFile as UU}from"fs";import{format as WU}from"util";import{resolve as VU}from"path";var DJ={fs:{readFileSync:KU,writeFile:UU},format:WU,resolve:VU,exists:($)=>{try{return BU($).isFile()}catch(Z){return!1}}};var d0;class SJ{constructor($){$=$||{},this.directory=$.directory||"./locales",this.updateFiles=typeof $.updateFiles==="boolean"?$.updateFiles:!0,this.locale=$.locale||"en",this.fallbackToLanguage=typeof $.fallbackToLanguage==="boolean"?$.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...$){if(typeof arguments[0]!=="string")return this._taggedLiteral(arguments[0],...arguments);let Z=$.shift(),X=function(){};if(typeof $[$.length-1]==="function")X=$.pop();if(X=X||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][Z]&&this.updateFiles)this.cache[this.locale][Z]=Z,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:X});else X();return d0.format.apply(d0.format,[this.cache[this.locale][Z]||Z].concat($))}__n(){let $=Array.prototype.slice.call(arguments),Z=$.shift(),X=$.shift(),J=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=J===1?Z:X;if(this.cache[this.locale][Z])Y=this.cache[this.locale][Z][J===1?"one":"other"];if(!this.cache[this.locale][Z]&&this.updateFiles)this.cache[this.locale][Z]={one:Z,other:X},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(J);return d0.format.apply(d0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let Z in $)if(Object.prototype.hasOwnProperty.call($,Z))this.cache[this.locale][Z]=$[Z]}_taggedLiteral($,...Z){let X="";return $.forEach(function(J,q){let Y=Z[q+1];if(X+=J,typeof Y<"u")X+="%s"}),this.__.apply(this,[X].concat([].slice.call(Z,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,Z=this.writeQueue[0],X=Z.directory,J=Z.locale,q=Z.cb,Y=this._resolveLocaleFile(X,J),Q=JSON.stringify(this.cache[J],null,2);d0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},Z=this._resolveLocaleFile(this.directory,this.locale);try{if(d0.fs.readFileSync)$=JSON.parse(d0.fs.readFileSync(Z,"utf-8"))}catch(X){if(X instanceof SyntaxError)X.message="syntax error in "+Z;if(X.code==="ENOENT")$={};else throw X}this.cache[this.locale]=$}_resolveLocaleFile($,Z){let X=d0.resolve($,"./",Z+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(X)&&~Z.lastIndexOf("_")){let J=d0.resolve($,"./",Z.split("_")[0]+".json");if(this._fileExistsSync(J))X=J}return X}_fileExistsSync($){return d0.exists($)}}function vJ($,Z){d0=Z;let X=new SJ($);return{__:X.__.bind(X),__n:X.__n.bind(X),setLocale:X.setLocale.bind(X),getLocale:X.getLocale.bind(X),updateLocale:X.updateLocale.bind(X),locale:X.locale}}var LU=($)=>{return vJ($,DJ)},fJ=LU;var IU="require is not supported by ESM",bJ="loading a directory of commands is not supported yet for ESM",O$;try{O$=MU(import.meta.url)}catch($){O$=process.cwd()}var wU=O$.substring(0,O$.lastIndexOf("node_modules")),F6={assert:{notStrictEqual:_U,strictEqual:RU},cliui:K6,findUp:B6,getEnv:($)=>{return process.env[$]},inspect:TU,getCallerFile:()=>{throw new Z0(bJ)},getProcessArgvBin:NJ,mainFilename:wU||process.cwd(),Parser:R6,path:{basename:CU,dirname:PU,extname:xU,relative:jU,resolve:kJ},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,Z)=>process.emitWarning($,Z),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:FU,require:()=>{throw new Z0(IU)},requireDirectory:()=>{throw new Z0(bJ)},stringWidth:($)=>{return[...$].length},y18n:fJ({directory:kJ(O$,"../../../locales"),updateFiles:!1})};function P0($,Z,X,J){X.assert.notStrictEqual($,Z,J)}function M6($,Z){Z.assert.strictEqual(typeof $,"string")}function Q$($){return Object.keys($)}function X0($){return!!$&&!!$.then&&typeof $.then==="function"}function W1($){let X=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),J=/\.*[\][<>]/g,q=X.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(J,""),demanded:[],optional:[]};return X.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===X.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(J,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(J,"").split("|"),variadic:H})}),Y}var OU=["first","second","third","fourth","fifth","sixth"];function A($,Z,X){function J(){return typeof $==="object"?[{demanded:[],optional:[]},$,Z]:[W1(`cmd ${$}`),Z,X]}try{let q=0,[Y,Q,G]=J(),H=[].slice.call(Q);while(H.length&&H[H.length-1]===void 0)H.pop();let K=G||H.length;if(K<Y.demanded.length)throw new Z0(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let W=Y.demanded.length+Y.optional.length;if(K>W)throw new Z0(`Too many arguments provided. Expected max ${W} but received ${K}.`);Y.demanded.forEach((U)=>{let B=H.shift(),R=yJ(B);if(U.cmd.filter((L)=>L===R||L==="*").length===0)gJ(R,U.cmd,q);q+=1}),Y.optional.forEach((U)=>{if(H.length===0)return;let B=H.shift(),R=yJ(B);if(U.cmd.filter((L)=>L===R||L==="*").length===0)gJ(R,U.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function yJ($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function gJ($,Z,X){throw new Z0(`Invalid ${OU[X]||"manyith"} argument. Expected ${Z.join(" or ")} but received ${$}.`)}class C6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,Z,X=!0,J=!1){if(A("<array|function> [boolean] [boolean] [boolean]",[$,Z,X],arguments.length),Array.isArray($)){for(let q=0;q<$.length;q++){if(typeof $[q]!=="function")throw Error("middleware must be a function");let Y=$[q];Y.applyBeforeValidation=Z,Y.global=X}Array.prototype.push.apply(this.globalMiddleware,$)}else if(typeof $==="function"){let q=$;q.applyBeforeValidation=Z,q.global=X,q.mutates=J,this.globalMiddleware.push($)}return this.yargs}addCoerceMiddleware($,Z){let X=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((J)=>{let q=[...X[Z]||[],Z];if(!J.option)return!0;else return!q.includes(J.option)}),$.option=Z,this.addMiddleware($,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let $=this.frozens.pop();if($!==void 0)this.globalMiddleware=$}reset(){this.globalMiddleware=this.globalMiddleware.filter(($)=>$.global)}}function uJ($){if(!$)return[];return $.map((Z)=>{return Z.applyBeforeValidation=!1,Z})}function O1($,Z,X,J){return X.reduce((q,Y)=>{if(Y.applyBeforeValidation!==J)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(X0(q))return q.then((Q)=>Promise.all([Q,Y(Q,Z)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,Z);return X0(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function E1($,Z,X=(J)=>{throw J}){try{let J=EU($)?$():$;return X0(J)?J.then((q)=>Z(q)):Z(J)}catch(J){return X(J)}}function EU($){return typeof $==="function"}function P6($){for(let Z=0,X=Object.keys(V0.cache),J;Z<X.length;Z++)if(J=V0.cache[X[Z]],J.exports===$)return J;return null}var q$=/(^\*)|(^\$0)/;class cJ{constructor($,Z,X,J){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=J,this.usage=$,this.globalMiddleware=X,this.validation=Z}addDirectory($,Z,X,J){if(J=J||{},typeof J.recurse!=="boolean")J.recurse=!1;if(!Array.isArray(J.extensions))J.extensions=["js"];let q=typeof J.visit==="function"?J.visit:(Y)=>Y;J.visit=(Y,Q,G)=>{let H=q(Y,Q,G);if(H){if(this.requireCache.has(Q))return H;else this.requireCache.add(Q);this.addHandler(H)}return H},this.shim.requireDirectory({require:Z,filename:X},$,J)}addHandler($,Z,X,J,q,Y){let Q=[],G=uJ(q);if(J=J||(()=>{}),Array.isArray($))if(AU($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(NU($)){let H=Array.isArray($.command)||typeof $.command==="string"?$.command:this.moduleName($);if($.aliases)H=[].concat(H).concat($.aliases);this.addHandler(H,this.extractDesc($),$.builder,$.handler,$.middlewares,$.deprecated);return}else if(mJ(X)){this.addHandler([$].concat(Q),Z,X.builder,X.handler,X.middlewares,X.deprecated);return}if(typeof $==="string"){let H=W1($);Q=Q.map((U)=>W1(U).cmd);let K=!1,W=[H.cmd].concat(Q).filter((U)=>{if(q$.test(U))return K=!0,!1;return!0});if(W.length===0&&K)W.push("$0");if(K)H.cmd=W[0],Q=W.slice(1),$=$.replace(q$,H.cmd);if(Q.forEach((U)=>{this.aliasMap[U]=H.cmd}),Z!==!1)this.usage.command($,Z,K,Q,Y);if(this.handlers[H.cmd]={original:$,description:Z,handler:J,builder:X||{},middlewares:G,deprecated:Y,demanded:H.demanded,optional:H.optional},K)this.defaultCommand=this.handlers[H.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand($,Z,X,J,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=Z.getInternalMethods().getContext(),H=G.commands.slice(),K=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let W=this.applyBuilderUpdateUsageAndParse(K,Q,Z,X.aliases,H,J,q,Y);return X0(W)?W.then((U)=>this.applyMiddlewareAndGetResult(K,Q,U.innerArgv,G,q,U.aliases,Z)):this.applyMiddlewareAndGetResult(K,Q,W.innerArgv,G,q,W.aliases,Z)}applyBuilderUpdateUsageAndParse($,Z,X,J,q,Y,Q,G){let H=Z.builder,K=X;if(Z2(H)){X.getInternalMethods().getUsageInstance().freeze();let W=H(X.getInternalMethods().reset(J),G);if(X0(W))return W.then((U)=>{return K=dJ(U)?U:X,this.parseAndUpdateUsage($,Z,K,q,Y,Q)})}else if(hU(H))X.getInternalMethods().getUsageInstance().freeze(),K=X.getInternalMethods().reset(J),Object.keys(Z.builder).forEach((W)=>{K.option(W,H[W])});return this.parseAndUpdateUsage($,Z,K,q,Y,Q)}parseAndUpdateUsage($,Z,X,J,q,Y){if($)X.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(X))X.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(J,Z),Z.description);let Q=X.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return X0(Q)?Q.then((G)=>({aliases:X.parsed.aliases,innerArgv:G})):{aliases:X.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,Z){let X=q$.test(Z.original)?Z.original.replace(q$,"").trim():Z.original,J=$.filter((q)=>{return!q$.test(q)});return J.push(X),`$0 ${J.join(" ")}`}handleValidationAndGetResult($,Z,X,J,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);X=E1(X,(K)=>{return H(K),K})}if(Z.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(X,H,!1,!1),X=O1(X,Y,Q,!1),X=E1(X,(K)=>{let W=Z.handler(K);return X0(W)?W.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(X0(X)&&!Y.getInternalMethods().hasParseCallback())X.catch((K)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,K)}catch(W){}})}if(!$)J.commands.pop(),J.fullCommands.pop();return X}applyMiddlewareAndGetResult($,Z,X,J,q,Y,Q){let G={};if(q)return X;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(Z,X,J,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(Z.middlewares),K=O1(X,Q,H,!0);return X0(K)?K.then((W)=>this.handleValidationAndGetResult($,Z,W,J,Y,Q,H,G)):this.handleValidationAndGetResult($,Z,K,J,Y,Q,H,G)}populatePositionals($,Z,X,J){Z._=Z._.slice(X.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,Z._.length);while(q.length){let G=q.shift();this.populatePositional(G,Z,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,Z,Q)}return Z._=X.commands.concat(Z._.map((G)=>""+G)),this.postProcessPositionals(Z,Q,this.cmdToParseOptions($.original),J),Q}populatePositional($,Z,X){let J=$.cmd[0];if($.variadic)X[J]=Z._.splice(0).map(String);else if(Z._.length)X[J]=[String(Z._.shift())]}cmdToParseOptions($){let Z={array:[],default:{},alias:{},demand:{}},X=W1($);return X.demanded.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)Z.array.push(q),Z.default[q]=[];Z.alias[q]=Y,Z.demand[q]=!0}),X.optional.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)Z.array.push(q),Z.default[q]=[];Z.alias[q]=Y}),Z}postProcessPositionals($,Z,X,J){let q=Object.assign({},J.getOptions());q.default=Object.assign(X.default,q.default);for(let H of Object.keys(X.alias))q.alias[H]=(q.alias[H]||[]).concat(X.alias[H]);q.array=q.array.concat(X.array),q.config={};let Y=[];if(Object.keys(Z).forEach((H)=>{Z[H].map((K)=>{if(q.configuration["unknown-options-as-args"])q.key[H]=!0;Y.push(`--${H}`),Y.push(K)})}),!Y.length)return;let Q=Object.assign({},q.configuration,{"populate--":!1}),G=this.shim.Parser.detailed(Y,Object.assign({},q,{configuration:Q}));if(G.error)J.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(Z);Object.keys(Z).forEach((K)=>{H.push(...G.aliases[K])}),Object.keys(G.argv).forEach((K)=>{if(H.includes(K)){if(!Z[K])Z[K]=G.argv[K];if(!this.isInConfigs(J,K)&&!this.isDefaulted(J,K)&&Object.prototype.hasOwnProperty.call($,K)&&Object.prototype.hasOwnProperty.call(G.argv,K)&&(Array.isArray($[K])||Array.isArray(G.argv[K])))$[K]=[].concat($[K],G.argv[K]);else $[K]=G.argv[K]}})}}isDefaulted($,Z){let{default:X}=$.getOptions();return Object.prototype.hasOwnProperty.call(X,Z)||Object.prototype.hasOwnProperty.call(X,this.shim.Parser.camelCase(Z))}isInConfigs($,Z){let{configObjects:X}=$.getOptions();return X.some((J)=>Object.prototype.hasOwnProperty.call(J,Z))||X.some((J)=>Object.prototype.hasOwnProperty.call(J,this.shim.Parser.camelCase(Z)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let X=q$.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(X,this.defaultCommand.description)}let Z=this.defaultCommand.builder;if(Z2(Z))return Z($,!0);else if(!mJ(Z))Object.keys(Z).forEach((X)=>{$.option(X,Z[X])});return}moduleName($){let Z=P6($);if(!Z)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(Z.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:Z,desc:X}){for(let J of[$,Z,X]){if(typeof J==="string"||J===!1)return J;P0(J,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();P0($,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=$}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function pJ($,Z,X,J){return new cJ($,Z,X,J)}function mJ($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function AU($){return $.every((Z)=>typeof Z==="string")}function Z2($){return typeof $==="function"}function hU($){return typeof $==="object"}function NU($){return typeof $==="object"&&!Array.isArray($)}function V1($={},Z=()=>!0){let X={};return Q$($).forEach((J)=>{if(Z(J,$[J]))X[J]=$[J]}),X}function L1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((Z)=>{let X=Z;if(X._handle&&X.isTTY&&typeof X._handle.setBlocking==="function")X._handle.setBlocking($)})}function DU($){return typeof $==="boolean"}function nJ($,Z){let X=Z.y18n.__,J={},q=[];J.failFn=function(w){q.push(w)};let Y=null,Q=null,G=!0;J.showHelpOnFail=function(w=!0,v){let[u,r]=typeof w==="string"?[!0,w]:[w,v];if($.getInternalMethods().isGlobalContext())Q=r;return Y=r,G=u,J};let H=!1;J.fail=function(w,v){let u=$.getInternalMethods().getLoggerInstance();if(q.length)for(let r=q.length-1;r>=0;--r){let z0=q[r];if(DU(z0)){if(v)throw v;else if(w)throw Error(w)}else z0(w,v,J)}else{if($.getExitProcess())L1(!0);if(!H){if(H=!0,G)$.showHelp("error"),u.error();if(w||v)u.error(w||v);let r=Y||Q;if(r){if(w||v)u.error("");u.error(r)}}if(v=v||new Z0(w),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,v);else throw v}};let K=[],W=!1;J.usage=(E,w)=>{if(E===null)return W=!0,K=[],J;return W=!1,K.push([E,w||""]),J},J.getUsage=()=>{return K},J.getUsageDisabled=()=>{return W},J.getPositionalGroupName=()=>{return X("Positionals:")};let U=[];J.example=(E,w)=>{U.push([E,w||""])};let B=[];J.command=function(w,v,u,r,z0=!1){if(u)B=B.map((t)=>{return t[2]=!1,t});B.push([w,v||"",u,r,z0])},J.getCommands=()=>B;let R={};J.describe=function(w,v){if(Array.isArray(w))w.forEach((u)=>{J.describe(u,v)});else if(typeof w==="object")Object.keys(w).forEach((u)=>{J.describe(u,w[u])});else R[w]=v},J.getDescriptions=()=>R;let _=[];J.epilog=(E)=>{_.push(E)};let L=!1,j;J.wrap=(E)=>{L=!0,j=E},J.getWrap=()=>{if(Z.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)j=K0(),L=!0;return j};let C="__yargsString__:";J.deferY18nLookup=(E)=>C+E,J.help=function(){if(I)return I;c();let w=$.customScriptName?$.$0:Z.path.basename($.$0),v=$.getDemandedOptions(),u=$.getDemandedCommands(),r=$.getDeprecatedOptions(),z0=$.getGroups(),t=$.getOptions(),B0=[];B0=B0.concat(Object.keys(R)),B0=B0.concat(Object.keys(v)),B0=B0.concat(Object.keys(u)),B0=B0.concat(Object.keys(t.default)),B0=B0.filter(i),B0=Object.keys(B0.reduce((y,s)=>{if(s!=="_")y[s]=!0;return y},{}));let Y1=J.getWrap(),e=Z.cliui({width:Y1,wrap:!!Y1});if(!W){if(K.length)K.forEach((y)=>{if(e.div({text:`${y[0].replace(/\$0/g,w)}`}),y[1])e.div({text:`${y[1]}`,padding:[1,0,0,0]})}),e.div();else if(B.length){let y=null;if(u._)y=`${w} <${X("command")}>
104
104
  `;else y=`${w} [${X("command")}]
105
- `;e.div(`${y}`)}}if(B.length>1||B.length===1&&!B[0][2]){e.div(X("Commands:"));let y=$.getInternalMethods().getContext(),s=y.commands.length?`${y.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)B=B.sort((d,T0)=>d[0].localeCompare(T0[0]));let U0=w?`${w} `:"";B.forEach((d)=>{let T0=`${U0}${s}${d[0].replace(/^\$0 ?/,"")}`;e.span({text:T0,padding:[0,2,0,2],width:N(B,G1,`${w}${s}`)+4},{text:d[1]});let q0=[];if(d[2])q0.push(`[${X("default")}]`);if(d[3]&&d[3].length)q0.push(`[${X("aliases:")} ${d[3].join(", ")}]`);if(d[4])if(typeof d[4]==="string")q0.push(`[${X("deprecated: %s",d[4])}]`);else q0.push(`[${X("deprecated")}]`);if(q0.length)e.div({text:q0.join(" "),padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}let e0=(Object.keys(t.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);B0=B0.filter((y)=>!$.parsed.newAliases[y]&&e0.every((s)=>(t.alias[s]||[]).indexOf(y)===-1));let z$=X("Options:");if(!z0[z$])z0[z$]=[];n(B0,t.alias,z0,z$);let b=(y)=>/^--/.test(X2(y)),m1=Object.keys(z0).filter((y)=>z0[y].length>0).map((y)=>{let s=z0[y].filter(i).map((U0)=>{if(e0.includes(U0))return U0;for(let d=0,T0;(T0=e0[d])!==void 0;d++)if((t.alias[T0]||[]).includes(U0))return T0;return U0});return{groupName:y,normalizedKeys:s}}).filter(({normalizedKeys:y})=>y.length>0).map(({groupName:y,normalizedKeys:s})=>{let U0=s.reduce((d,T0)=>{return d[T0]=[T0].concat(t.alias[T0]||[]).map((q0)=>{if(y===J.getPositionalGroupName())return q0;else return(/^[0-9]$/.test(q0)?t.boolean.includes(T0)?"-":"--":q0.length>1?"--":"-")+q0}).sort((q0,W0)=>b(q0)===b(W0)?0:b(q0)?1:-1).join(", "),d},{});return{groupName:y,normalizedKeys:s,switches:U0}});if(m1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).some(({normalizedKeys:y,switches:s})=>!y.every((U0)=>b(s[U0]))))m1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).forEach(({normalizedKeys:y,switches:s})=>{y.forEach((U0)=>{if(b(s[U0]))s[U0]=hU(s[U0],4)})});if(m1.forEach(({groupName:y,normalizedKeys:s,switches:U0})=>{e.div(y),s.forEach((d)=>{let T0=U0[d],q0=R[d]||"",W0=null;if(q0.includes(C))q0=X(q0.substring(C.length));if(t.boolean.includes(d))W0=`[${X("boolean")}]`;if(t.count.includes(d))W0=`[${X("count")}]`;if(t.string.includes(d))W0=`[${X("string")}]`;if(t.normalize.includes(d))W0=`[${X("string")}]`;if(t.array.includes(d))W0=`[${X("array")}]`;if(t.number.includes(d))W0=`[${X("number")}]`;let V2=(P)=>typeof P==="string"?`[${X("deprecated: %s",P)}]`:`[${X("deprecated")}]`,V=[d in r?V2(r[d]):null,W0,d in v?`[${X("required")}]`:null,t.choices&&t.choices[d]?`[${X("choices:")} ${J.stringifiedValues(t.choices[d])}]`:null,a(t.default[d],t.defaultDescription[d])].filter(Boolean).join(" ");e.span({text:X2(T0),padding:[0,2,0,2+lJ(T0)],width:N(U0,G1)+4},q0);let F=$.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;if(V&&!F)e.div({text:V,padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}),U.length)e.div(X("Examples:")),U.forEach((y)=>{y[0]=y[0].replace(/\$0/g,w)}),U.forEach((y)=>{if(y[1]==="")e.div({text:y[0],padding:[0,2,0,2]});else e.div({text:y[0],padding:[0,2,0,2],width:N(U,G1)+4},{text:y[1]})}),e.div();if(_.length>0){let y=_.map((s)=>s.replace(/\$0/g,w)).join(`
105
+ `;e.div(`${y}`)}}if(B.length>1||B.length===1&&!B[0][2]){e.div(X("Commands:"));let y=$.getInternalMethods().getContext(),s=y.commands.length?`${y.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)B=B.sort((d,T0)=>d[0].localeCompare(T0[0]));let U0=w?`${w} `:"";B.forEach((d)=>{let T0=`${U0}${s}${d[0].replace(/^\$0 ?/,"")}`;e.span({text:T0,padding:[0,2,0,2],width:N(B,Y1,`${w}${s}`)+4},{text:d[1]});let q0=[];if(d[2])q0.push(`[${X("default")}]`);if(d[3]&&d[3].length)q0.push(`[${X("aliases:")} ${d[3].join(", ")}]`);if(d[4])if(typeof d[4]==="string")q0.push(`[${X("deprecated: %s",d[4])}]`);else q0.push(`[${X("deprecated")}]`);if(q0.length)e.div({text:q0.join(" "),padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}let e0=(Object.keys(t.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);B0=B0.filter((y)=>!$.parsed.newAliases[y]&&e0.every((s)=>(t.alias[s]||[]).indexOf(y)===-1));let z$=X("Options:");if(!z0[z$])z0[z$]=[];n(B0,t.alias,z0,z$);let b=(y)=>/^--/.test(X2(y)),u1=Object.keys(z0).filter((y)=>z0[y].length>0).map((y)=>{let s=z0[y].filter(i).map((U0)=>{if(e0.includes(U0))return U0;for(let d=0,T0;(T0=e0[d])!==void 0;d++)if((t.alias[T0]||[]).includes(U0))return T0;return U0});return{groupName:y,normalizedKeys:s}}).filter(({normalizedKeys:y})=>y.length>0).map(({groupName:y,normalizedKeys:s})=>{let U0=s.reduce((d,T0)=>{return d[T0]=[T0].concat(t.alias[T0]||[]).map((q0)=>{if(y===J.getPositionalGroupName())return q0;else return(/^[0-9]$/.test(q0)?t.boolean.includes(T0)?"-":"--":q0.length>1?"--":"-")+q0}).sort((q0,W0)=>b(q0)===b(W0)?0:b(q0)?1:-1).join(", "),d},{});return{groupName:y,normalizedKeys:s,switches:U0}});if(u1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).some(({normalizedKeys:y,switches:s})=>!y.every((U0)=>b(s[U0]))))u1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).forEach(({normalizedKeys:y,switches:s})=>{y.forEach((U0)=>{if(b(s[U0]))s[U0]=SU(s[U0],4)})});if(u1.forEach(({groupName:y,normalizedKeys:s,switches:U0})=>{e.div(y),s.forEach((d)=>{let T0=U0[d],q0=R[d]||"",W0=null;if(q0.includes(C))q0=X(q0.substring(C.length));if(t.boolean.includes(d))W0=`[${X("boolean")}]`;if(t.count.includes(d))W0=`[${X("count")}]`;if(t.string.includes(d))W0=`[${X("string")}]`;if(t.normalize.includes(d))W0=`[${X("string")}]`;if(t.array.includes(d))W0=`[${X("array")}]`;if(t.number.includes(d))W0=`[${X("number")}]`;let V2=(P)=>typeof P==="string"?`[${X("deprecated: %s",P)}]`:`[${X("deprecated")}]`,V=[d in r?V2(r[d]):null,W0,d in v?`[${X("required")}]`:null,t.choices&&t.choices[d]?`[${X("choices:")} ${J.stringifiedValues(t.choices[d])}]`:null,a(t.default[d],t.defaultDescription[d])].filter(Boolean).join(" ");e.span({text:X2(T0),padding:[0,2,0,2+lJ(T0)],width:N(U0,Y1)+4},q0);let F=$.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;if(V&&!F)e.div({text:V,padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}),U.length)e.div(X("Examples:")),U.forEach((y)=>{y[0]=y[0].replace(/\$0/g,w)}),U.forEach((y)=>{if(y[1]==="")e.div({text:y[0],padding:[0,2,0,2]});else e.div({text:y[0],padding:[0,2,0,2],width:N(U,Y1)+4},{text:y[1]})}),e.div();if(_.length>0){let y=_.map((s)=>s.replace(/\$0/g,w)).join(`
106
106
  `);e.div(`${y}
107
- `)}return e.toString().replace(/\s*$/,"")};function N(E,w,v){let u=0;if(!Array.isArray(E))E=Object.values(E).map((r)=>[r]);if(E.forEach((r)=>{u=Math.max(Z.stringWidth(v?`${v} ${X2(r[0])}`:X2(r[0]))+lJ(r[0]),u)}),w)u=Math.min(u,parseInt((w*0.5).toString(),10));return u}function c(){let E=$.getDemandedOptions(),w=$.getOptions();(Object.keys(w.alias)||[]).forEach((v)=>{w.alias[v].forEach((u)=>{if(R[u])J.describe(v,R[u]);if(u in E)$.demandOption(v,E[u]);if(w.boolean.includes(u))$.boolean(v);if(w.count.includes(u))$.count(v);if(w.string.includes(u))$.string(v);if(w.normalize.includes(u))$.normalize(v);if(w.array.includes(u))$.array(v);if(w.number.includes(u))$.number(v)})})}let I;J.cacheHelpMessage=function(){I=this.help()},J.clearCachedHelpMessage=function(){I=void 0},J.hasCachedHelpMessage=function(){return!!I};function n(E,w,v,u){let r=[],z0=null;return Object.keys(v).forEach((t)=>{r=r.concat(v[t])}),E.forEach((t)=>{if(z0=[t].concat(w[t]),!z0.some((B0)=>r.indexOf(B0)!==-1))v[u].push(t)}),r}function i(E){return $.getOptions().hiddenOptions.indexOf(E)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}J.showHelp=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(J.help())},J.functionDescription=(E)=>{return["(",E.name?Z.Parser.decamelize(E.name,"-"):X("generated-value"),")"].join("")},J.stringifiedValues=function(w,v){let u="",r=v||", ",z0=[].concat(w);if(!w||!z0.length)return u;return z0.forEach((t)=>{if(u.length)u+=r;u+=JSON.stringify(t)}),u};function a(E,w){let v=`[${X("default:")} `;if(E===void 0&&!w)return null;if(w)v+=w;else switch(typeof E){case"string":v+=`"${E}"`;break;case"object":v+=JSON.stringify(E);break;default:v+=E}return`${v}]`}function K0(){if(Z.process.stdColumns)return Math.min(80,Z.process.stdColumns);else return 80}let l=null;J.version=(E)=>{l=E},J.showVersion=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(l)},J.reset=function(w){return Y=null,H=!1,K=[],W=!1,_=[],U=[],B=[],R=L1(R,(v)=>!w[v]),J};let x0=[];return J.freeze=function(){x0.push({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:_,examples:U,commands:B,descriptions:R})},J.unfreeze=function(w=!1){let v=x0.pop();if(!v)return;if(w)R={...v.descriptions,...R},B=[...v.commands,...B],K=[...v.usages,...K],U=[...v.examples,...U],_=[...v.epilogs,..._];else({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:_,examples:U,commands:B,descriptions:R}=v)},J}function x6($){return typeof $==="object"}function hU($,Z){return x6($)?{text:$.text,indentation:$.indentation+Z}:{text:$,indentation:Z}}function lJ($){return x6($)?$.indentation:0}function X2($){return x6($)?$.text:$}var iJ=`###-begin-{{app_name}}-completions-###
107
+ `)}return e.toString().replace(/\s*$/,"")};function N(E,w,v){let u=0;if(!Array.isArray(E))E=Object.values(E).map((r)=>[r]);if(E.forEach((r)=>{u=Math.max(Z.stringWidth(v?`${v} ${X2(r[0])}`:X2(r[0]))+lJ(r[0]),u)}),w)u=Math.min(u,parseInt((w*0.5).toString(),10));return u}function c(){let E=$.getDemandedOptions(),w=$.getOptions();(Object.keys(w.alias)||[]).forEach((v)=>{w.alias[v].forEach((u)=>{if(R[u])J.describe(v,R[u]);if(u in E)$.demandOption(v,E[u]);if(w.boolean.includes(u))$.boolean(v);if(w.count.includes(u))$.count(v);if(w.string.includes(u))$.string(v);if(w.normalize.includes(u))$.normalize(v);if(w.array.includes(u))$.array(v);if(w.number.includes(u))$.number(v)})})}let I;J.cacheHelpMessage=function(){I=this.help()},J.clearCachedHelpMessage=function(){I=void 0},J.hasCachedHelpMessage=function(){return!!I};function n(E,w,v,u){let r=[],z0=null;return Object.keys(v).forEach((t)=>{r=r.concat(v[t])}),E.forEach((t)=>{if(z0=[t].concat(w[t]),!z0.some((B0)=>r.indexOf(B0)!==-1))v[u].push(t)}),r}function i(E){return $.getOptions().hiddenOptions.indexOf(E)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}J.showHelp=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(J.help())},J.functionDescription=(E)=>{return["(",E.name?Z.Parser.decamelize(E.name,"-"):X("generated-value"),")"].join("")},J.stringifiedValues=function(w,v){let u="",r=v||", ",z0=[].concat(w);if(!w||!z0.length)return u;return z0.forEach((t)=>{if(u.length)u+=r;u+=JSON.stringify(t)}),u};function a(E,w){let v=`[${X("default:")} `;if(E===void 0&&!w)return null;if(w)v+=w;else switch(typeof E){case"string":v+=`"${E}"`;break;case"object":v+=JSON.stringify(E);break;default:v+=E}return`${v}]`}function K0(){if(Z.process.stdColumns)return Math.min(80,Z.process.stdColumns);else return 80}let l=null;J.version=(E)=>{l=E},J.showVersion=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(l)},J.reset=function(w){return Y=null,H=!1,K=[],W=!1,_=[],U=[],B=[],R=V1(R,(v)=>!w[v]),J};let x0=[];return J.freeze=function(){x0.push({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:_,examples:U,commands:B,descriptions:R})},J.unfreeze=function(w=!1){let v=x0.pop();if(!v)return;if(w)R={...v.descriptions,...R},B=[...v.commands,...B],K=[...v.usages,...K],U=[...v.examples,...U],_=[...v.epilogs,..._];else({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:_,examples:U,commands:B,descriptions:R}=v)},J}function x6($){return typeof $==="object"}function SU($,Z){return x6($)?{text:$.text,indentation:$.indentation+Z}:{text:$,indentation:Z}}function lJ($){return x6($)?$.indentation:0}function X2($){return x6($)?$.text:$}var iJ=`###-begin-{{app_name}}-completions-###
108
108
  #
109
109
  # yargs command completion script
110
110
  #
@@ -151,14 +151,14 @@ _{{app_name}}_yargs_completions()
151
151
  }
152
152
  compdef _{{app_name}}_yargs_completions {{app_name}}
153
153
  ###-end-{{app_name}}-completions-###
154
- `;class oJ{constructor($,Z,X,J){var q,Y,Q;this.yargs=$,this.usage=Z,this.command=X,this.shim=J,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(Q=((q=this.shim.getEnv("SHELL"))===null||q===void 0?void 0:q.includes("zsh"))||((Y=this.shim.getEnv("ZSH_NAME"))===null||Y===void 0?void 0:Y.includes("zsh")))!==null&&Q!==void 0?Q:!1}defaultCompletion($,Z,X,J){let q=this.command.getCommandHandlers();for(let Q=0,G=$.length;Q<G;++Q)if(q[$[Q]]&&q[$[Q]].builder){let H=q[$[Q]].builder;if(Z2(H)){this.indexAfterLastReset=Q+1;let K=this.yargs.getInternalMethods().reset();return H(K,!0),K.argv}}let Y=[];this.commandCompletions(Y,$,X),this.optionCompletions(Y,$,Z,X),this.choicesFromOptionsCompletions(Y,$,Z,X),this.choicesFromPositionalsCompletions(Y,$,Z,X),J(null,Y)}commandCompletions($,Z,X){let J=this.yargs.getInternalMethods().getContext().commands;if(!X.match(/^-/)&&J[J.length-1]!==X&&!this.previousArgHasChoices(Z))this.usage.getCommands().forEach((q)=>{let Y=V1(q[0]).cmd;if(Z.indexOf(Y)===-1)if(!this.zshShell)$.push(Y);else{let Q=q[1]||"";$.push(Y.replace(/:/g,"\\:")+":"+Q)}})}optionCompletions($,Z,X,J){if((J.match(/^-/)||J===""&&$.length===0)&&!this.previousArgHasChoices(Z)){let q=this.yargs.getOptions(),Y=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(q.key).forEach((Q)=>{let G=!!q.configuration["boolean-negation"]&&q.boolean.includes(Q);if(!Y.includes(Q)&&!q.hiddenOptions.includes(Q)&&!this.argsContainKey(Z,Q,G))this.completeOptionKey(Q,$,J,G&&!!q.default[Q])})}}choicesFromOptionsCompletions($,Z,X,J){if(this.previousArgHasChoices(Z)){let q=this.getPreviousArgChoices(Z);if(q&&q.length>0)$.push(...q.map((Y)=>Y.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions($,Z,X,J){if(J===""&&$.length>0&&this.previousArgHasChoices(Z))return;let q=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],Y=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),Q=q[X._.length-Y-1];if(!Q)return;let G=this.yargs.getOptions().choices[Q]||[];for(let H of G)if(H.startsWith(J))$.push(H.replace(/:/g,"\\:"))}getPreviousArgChoices($){if($.length<1)return;let Z=$[$.length-1],X="";if(!Z.startsWith("-")&&$.length>1)X=Z,Z=$[$.length-2];if(!Z.startsWith("-"))return;let J=Z.replace(/^-+/,""),q=this.yargs.getOptions(),Y=[J,...this.yargs.getAliases()[J]||[]],Q;for(let G of Y)if(Object.prototype.hasOwnProperty.call(q.key,G)&&Array.isArray(q.choices[G])){Q=q.choices[G];break}if(Q)return Q.filter((G)=>!X||G.startsWith(X))}previousArgHasChoices($){let Z=this.getPreviousArgChoices($);return Z!==void 0&&Z.length>0}argsContainKey($,Z,X){let J=(q)=>$.indexOf((/^[^0-9]$/.test(q)?"-":"--")+q)!==-1;if(J(Z))return!0;if(X&&J(`no-${Z}`))return!0;if(this.aliases){for(let q of this.aliases[Z])if(J(q))return!0}return!1}completeOptionKey($,Z,X,J){var q,Y,Q,G;let H=$;if(this.zshShell){let B=this.usage.getDescriptions(),R=(Y=(q=this===null||this===void 0?void 0:this.aliases)===null||q===void 0?void 0:q[$])===null||Y===void 0?void 0:Y.find((j)=>{let C=B[j];return typeof C==="string"&&C.length>0}),_=R?B[R]:void 0,L=(G=(Q=B[$])!==null&&Q!==void 0?Q:_)!==null&&G!==void 0?G:"";H=`${$.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let K=(B)=>/^--/.test(B),W=(B)=>/^[^0-9]$/.test(B),U=!K(X)&&W($)?"-":"--";if(Z.push(U+H),J)Z.push(U+"no-"+H)}customCompletion($,Z,X,J){if(P0(this.customCompletionFunction,null,this.shim),DU(this.customCompletionFunction)){let q=this.customCompletionFunction(X,Z);if(X0(q))return q.then((Y)=>{this.shim.process.nextTick(()=>{J(null,Y)})}).catch((Y)=>{this.shim.process.nextTick(()=>{J(Y,void 0)})});return J(null,q)}else if(SU(this.customCompletionFunction))return this.customCompletionFunction(X,Z,(q=J)=>this.defaultCompletion($,Z,X,q),(q)=>{J(null,q)});else return this.customCompletionFunction(X,Z,(q)=>{J(null,q)})}getCompletion($,Z){let X=$.length?$[$.length-1]:"",J=this.yargs.parse($,!0),q=this.customCompletionFunction?(Y)=>this.customCompletion($,Y,X,Z):(Y)=>this.defaultCompletion($,Y,X,Z);return X0(J)?J.then(q):q(J)}generateCompletionScript($,Z){let X=this.zshShell?tJ:iJ,J=this.shim.path.basename($);if($.match(/\.js$/))$=`./${$}`;return X=X.replace(/{{app_name}}/g,J),X=X.replace(/{{completion_command}}/g,Z),X.replace(/{{app_path}}/g,$)}registerFunction($){this.customCompletionFunction=$}setParsed($){this.aliases=$.aliases}}function aJ($,Z,X,J){return new oJ($,Z,X,J)}function DU($){return $.length<3}function SU($){return $.length>3}function rJ($,Z){if($.length===0)return Z.length;if(Z.length===0)return $.length;let X=[],J;for(J=0;J<=Z.length;J++)X[J]=[J];let q;for(q=0;q<=$.length;q++)X[0][q]=q;for(J=1;J<=Z.length;J++)for(q=1;q<=$.length;q++)if(Z.charAt(J-1)===$.charAt(q-1))X[J][q]=X[J-1][q-1];else if(J>1&&q>1&&Z.charAt(J-2)===$.charAt(q-1)&&Z.charAt(J-1)===$.charAt(q-2))X[J][q]=X[J-2][q-2]+1;else X[J][q]=Math.min(X[J-1][q-1]+1,Math.min(X[J][q-1]+1,X[J-1][q]+1));return X[Z.length][$.length]}var sJ=["$0","--","_"];function eJ($,Z,X){let J=X.y18n.__,q=X.y18n.__n,Y={};Y.nonOptionCount=function(U){let B=$.getDemandedCommands(),_=U._.length+(U["--"]?U["--"].length:0)-$.getInternalMethods().getContext().commands.length;if(B._&&(_<B._.min||_>B._.max)){if(_<B._.min)if(B._.minMsg!==void 0)Z.fail(B._.minMsg?B._.minMsg.replace(/\$0/g,_.toString()).replace(/\$1/,B._.min.toString()):null);else Z.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",_,_.toString(),B._.min.toString()));else if(_>B._.max)if(B._.maxMsg!==void 0)Z.fail(B._.maxMsg?B._.maxMsg.replace(/\$0/g,_.toString()).replace(/\$1/,B._.max.toString()):null);else Z.fail(q("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",_,_.toString(),B._.max.toString()))}},Y.positionalCount=function(U,B){if(B<U)Z.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",B,B+"",U+""))},Y.requiredArguments=function(U,B){let R=null;for(let _ of Object.keys(B))if(!Object.prototype.hasOwnProperty.call(U,_)||typeof U[_]>"u")R=R||{},R[_]=B[_];if(R){let _=[];for(let j of Object.keys(R)){let C=R[j];if(C&&_.indexOf(C)<0)_.push(C)}let L=_.length?`
154
+ `;class oJ{constructor($,Z,X,J){var q,Y,Q;this.yargs=$,this.usage=Z,this.command=X,this.shim=J,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(Q=((q=this.shim.getEnv("SHELL"))===null||q===void 0?void 0:q.includes("zsh"))||((Y=this.shim.getEnv("ZSH_NAME"))===null||Y===void 0?void 0:Y.includes("zsh")))!==null&&Q!==void 0?Q:!1}defaultCompletion($,Z,X,J){let q=this.command.getCommandHandlers();for(let Q=0,G=$.length;Q<G;++Q)if(q[$[Q]]&&q[$[Q]].builder){let H=q[$[Q]].builder;if(Z2(H)){this.indexAfterLastReset=Q+1;let K=this.yargs.getInternalMethods().reset();return H(K,!0),K.argv}}let Y=[];this.commandCompletions(Y,$,X),this.optionCompletions(Y,$,Z,X),this.choicesFromOptionsCompletions(Y,$,Z,X),this.choicesFromPositionalsCompletions(Y,$,Z,X),J(null,Y)}commandCompletions($,Z,X){let J=this.yargs.getInternalMethods().getContext().commands;if(!X.match(/^-/)&&J[J.length-1]!==X&&!this.previousArgHasChoices(Z))this.usage.getCommands().forEach((q)=>{let Y=W1(q[0]).cmd;if(Z.indexOf(Y)===-1)if(!this.zshShell)$.push(Y);else{let Q=q[1]||"";$.push(Y.replace(/:/g,"\\:")+":"+Q)}})}optionCompletions($,Z,X,J){if((J.match(/^-/)||J===""&&$.length===0)&&!this.previousArgHasChoices(Z)){let q=this.yargs.getOptions(),Y=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(q.key).forEach((Q)=>{let G=!!q.configuration["boolean-negation"]&&q.boolean.includes(Q);if(!Y.includes(Q)&&!q.hiddenOptions.includes(Q)&&!this.argsContainKey(Z,Q,G))this.completeOptionKey(Q,$,J,G&&!!q.default[Q])})}}choicesFromOptionsCompletions($,Z,X,J){if(this.previousArgHasChoices(Z)){let q=this.getPreviousArgChoices(Z);if(q&&q.length>0)$.push(...q.map((Y)=>Y.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions($,Z,X,J){if(J===""&&$.length>0&&this.previousArgHasChoices(Z))return;let q=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],Y=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),Q=q[X._.length-Y-1];if(!Q)return;let G=this.yargs.getOptions().choices[Q]||[];for(let H of G)if(H.startsWith(J))$.push(H.replace(/:/g,"\\:"))}getPreviousArgChoices($){if($.length<1)return;let Z=$[$.length-1],X="";if(!Z.startsWith("-")&&$.length>1)X=Z,Z=$[$.length-2];if(!Z.startsWith("-"))return;let J=Z.replace(/^-+/,""),q=this.yargs.getOptions(),Y=[J,...this.yargs.getAliases()[J]||[]],Q;for(let G of Y)if(Object.prototype.hasOwnProperty.call(q.key,G)&&Array.isArray(q.choices[G])){Q=q.choices[G];break}if(Q)return Q.filter((G)=>!X||G.startsWith(X))}previousArgHasChoices($){let Z=this.getPreviousArgChoices($);return Z!==void 0&&Z.length>0}argsContainKey($,Z,X){let J=(q)=>$.indexOf((/^[^0-9]$/.test(q)?"-":"--")+q)!==-1;if(J(Z))return!0;if(X&&J(`no-${Z}`))return!0;if(this.aliases){for(let q of this.aliases[Z])if(J(q))return!0}return!1}completeOptionKey($,Z,X,J){var q,Y,Q,G;let H=$;if(this.zshShell){let B=this.usage.getDescriptions(),R=(Y=(q=this===null||this===void 0?void 0:this.aliases)===null||q===void 0?void 0:q[$])===null||Y===void 0?void 0:Y.find((j)=>{let C=B[j];return typeof C==="string"&&C.length>0}),_=R?B[R]:void 0,L=(G=(Q=B[$])!==null&&Q!==void 0?Q:_)!==null&&G!==void 0?G:"";H=`${$.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let K=(B)=>/^--/.test(B),W=(B)=>/^[^0-9]$/.test(B),U=!K(X)&&W($)?"-":"--";if(Z.push(U+H),J)Z.push(U+"no-"+H)}customCompletion($,Z,X,J){if(P0(this.customCompletionFunction,null,this.shim),fU(this.customCompletionFunction)){let q=this.customCompletionFunction(X,Z);if(X0(q))return q.then((Y)=>{this.shim.process.nextTick(()=>{J(null,Y)})}).catch((Y)=>{this.shim.process.nextTick(()=>{J(Y,void 0)})});return J(null,q)}else if(kU(this.customCompletionFunction))return this.customCompletionFunction(X,Z,(q=J)=>this.defaultCompletion($,Z,X,q),(q)=>{J(null,q)});else return this.customCompletionFunction(X,Z,(q)=>{J(null,q)})}getCompletion($,Z){let X=$.length?$[$.length-1]:"",J=this.yargs.parse($,!0),q=this.customCompletionFunction?(Y)=>this.customCompletion($,Y,X,Z):(Y)=>this.defaultCompletion($,Y,X,Z);return X0(J)?J.then(q):q(J)}generateCompletionScript($,Z){let X=this.zshShell?tJ:iJ,J=this.shim.path.basename($);if($.match(/\.js$/))$=`./${$}`;return X=X.replace(/{{app_name}}/g,J),X=X.replace(/{{completion_command}}/g,Z),X.replace(/{{app_path}}/g,$)}registerFunction($){this.customCompletionFunction=$}setParsed($){this.aliases=$.aliases}}function aJ($,Z,X,J){return new oJ($,Z,X,J)}function fU($){return $.length<3}function kU($){return $.length>3}function rJ($,Z){if($.length===0)return Z.length;if(Z.length===0)return $.length;let X=[],J;for(J=0;J<=Z.length;J++)X[J]=[J];let q;for(q=0;q<=$.length;q++)X[0][q]=q;for(J=1;J<=Z.length;J++)for(q=1;q<=$.length;q++)if(Z.charAt(J-1)===$.charAt(q-1))X[J][q]=X[J-1][q-1];else if(J>1&&q>1&&Z.charAt(J-2)===$.charAt(q-1)&&Z.charAt(J-1)===$.charAt(q-2))X[J][q]=X[J-2][q-2]+1;else X[J][q]=Math.min(X[J-1][q-1]+1,Math.min(X[J][q-1]+1,X[J-1][q]+1));return X[Z.length][$.length]}var sJ=["$0","--","_"];function eJ($,Z,X){let J=X.y18n.__,q=X.y18n.__n,Y={};Y.nonOptionCount=function(U){let B=$.getDemandedCommands(),_=U._.length+(U["--"]?U["--"].length:0)-$.getInternalMethods().getContext().commands.length;if(B._&&(_<B._.min||_>B._.max)){if(_<B._.min)if(B._.minMsg!==void 0)Z.fail(B._.minMsg?B._.minMsg.replace(/\$0/g,_.toString()).replace(/\$1/,B._.min.toString()):null);else Z.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",_,_.toString(),B._.min.toString()));else if(_>B._.max)if(B._.maxMsg!==void 0)Z.fail(B._.maxMsg?B._.maxMsg.replace(/\$0/g,_.toString()).replace(/\$1/,B._.max.toString()):null);else Z.fail(q("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",_,_.toString(),B._.max.toString()))}},Y.positionalCount=function(U,B){if(B<U)Z.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",B,B+"",U+""))},Y.requiredArguments=function(U,B){let R=null;for(let _ of Object.keys(B))if(!Object.prototype.hasOwnProperty.call(U,_)||typeof U[_]>"u")R=R||{},R[_]=B[_];if(R){let _=[];for(let j of Object.keys(R)){let C=R[j];if(C&&_.indexOf(C)<0)_.push(C)}let L=_.length?`
155
155
  ${_.join(`
156
156
  `)}`:"";Z.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(R).length,Object.keys(R).join(", ")+L))}},Y.unknownArguments=function(U,B,R,_,L=!0){var j;let C=$.getInternalMethods().getCommandInstance().getCommands(),N=[],c=$.getInternalMethods().getContext();if(Object.keys(U).forEach((I)=>{if(!sJ.includes(I)&&!Object.prototype.hasOwnProperty.call(R,I)&&!Object.prototype.hasOwnProperty.call($.getInternalMethods().getParseContext(),I)&&!Y.isValidAndSomeAliasIsNotNew(I,B))N.push(I)}),L&&(c.commands.length>0||C.length>0||_))U._.slice(c.commands.length).forEach((I)=>{if(!C.includes(""+I))N.push(""+I)});if(L){let n=((j=$.getDemandedCommands()._)===null||j===void 0?void 0:j.max)||0,i=c.commands.length+n;if(i<U._.length)U._.slice(i).forEach((a)=>{if(a=String(a),!c.commands.includes(a)&&!N.includes(a))N.push(a)})}if(N.length)Z.fail(q("Unknown argument: %s","Unknown arguments: %s",N.length,N.map((I)=>I.trim()?I:`"${I}"`).join(", ")))},Y.unknownCommands=function(U){let B=$.getInternalMethods().getCommandInstance().getCommands(),R=[],_=$.getInternalMethods().getContext();if(_.commands.length>0||B.length>0)U._.slice(_.commands.length).forEach((L)=>{if(!B.includes(""+L))R.push(""+L)});if(R.length>0)return Z.fail(q("Unknown command: %s","Unknown commands: %s",R.length,R.join(", "))),!0;else return!1},Y.isValidAndSomeAliasIsNotNew=function(U,B){if(!Object.prototype.hasOwnProperty.call(B,U))return!1;let R=$.parsed.newAliases;return[U,...B[U]].some((_)=>!Object.prototype.hasOwnProperty.call(R,_)||!R[U])},Y.limitedChoices=function(U){let B=$.getOptions(),R={};if(!Object.keys(B.choices).length)return;Object.keys(U).forEach((j)=>{if(sJ.indexOf(j)===-1&&Object.prototype.hasOwnProperty.call(B.choices,j))[].concat(U[j]).forEach((C)=>{if(B.choices[j].indexOf(C)===-1&&C!==void 0)R[j]=(R[j]||[]).concat(C)})});let _=Object.keys(R);if(!_.length)return;let L=J("Invalid values:");_.forEach((j)=>{L+=`
157
157
  ${J("Argument: %s, Given: %s, Choices: %s",j,Z.stringifiedValues(R[j]),Z.stringifiedValues(B.choices[j]))}`}),Z.fail(L)};let Q={};Y.implies=function(U,B){if(A("<string|object> [array|number|string]",[U,B],arguments.length),typeof U==="object")Object.keys(U).forEach((R)=>{Y.implies(R,U[R])});else{if($.global(U),!Q[U])Q[U]=[];if(Array.isArray(B))B.forEach((R)=>Y.implies(U,R));else P0(B,void 0,X),Q[U].push(B)}},Y.getImplied=function(){return Q};function G(W,U){let B=Number(U);if(U=isNaN(B)?U:B,typeof U==="number")U=W._.length>=U;else if(U.match(/^--no-.+/))U=U.match(/^--no-(.+)/)[1],U=!Object.prototype.hasOwnProperty.call(W,U);else U=Object.prototype.hasOwnProperty.call(W,U);return U}Y.implications=function(U){let B=[];if(Object.keys(Q).forEach((R)=>{let _=R;(Q[R]||[]).forEach((L)=>{let j=_,C=L;if(j=G(U,j),L=G(U,L),j&&!L)B.push(` ${_} -> ${C}`)})}),B.length){let R=`${J("Implications failed:")}
158
- `;B.forEach((_)=>{R+=_}),Z.fail(R)}};let H={};Y.conflicts=function(U,B){if(A("<string|object> [array|string]",[U,B],arguments.length),typeof U==="object")Object.keys(U).forEach((R)=>{Y.conflicts(R,U[R])});else{if($.global(U),!H[U])H[U]=[];if(Array.isArray(B))B.forEach((R)=>Y.conflicts(U,R));else H[U].push(B)}},Y.getConflicting=()=>H,Y.conflicting=function(U){if(Object.keys(U).forEach((B)=>{if(H[B])H[B].forEach((R)=>{if(R&&U[B]!==void 0&&U[R]!==void 0)Z.fail(J("Arguments %s and %s are mutually exclusive",B,R))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((B)=>{H[B].forEach((R)=>{if(R&&U[X.Parser.camelCase(B)]!==void 0&&U[X.Parser.camelCase(R)]!==void 0)Z.fail(J("Arguments %s and %s are mutually exclusive",B,R))})})},Y.recommendCommands=function(U,B){B=B.sort((j,C)=>C.length-j.length);let _=null,L=1/0;for(let j=0,C;(C=B[j])!==void 0;j++){let N=rJ(U,C);if(N<=3&&N<L)L=N,_=C}if(_)Z.fail(J("Did you mean %s?",_))},Y.reset=function(U){return Q=L1(Q,(B)=>!U[B]),H=L1(H,(B)=>!U[B]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let U=K.pop();P0(U,void 0,X),{implied:Q,conflicting:H}=U},Y}var j6=[],E$;function A$($,Z,X,J){E$=J;let q={};if(Object.prototype.hasOwnProperty.call($,"extends")){if(typeof $.extends!=="string")return q;let Y=/\.json|\..*rc$/.test($.extends),Q=null;if(!Y)try{Q=V0.resolve($.extends)}catch(G){return $}else Q=fU(Z,$.extends);vU(Q),j6.push(Q),q=Y?JSON.parse(E$.readFileSync(Q,"utf8")):V0($.extends),delete $.extends,q=A$(q,E$.path.dirname(Q),X,E$)}return j6=[],X?$Q(q,$):Object.assign({},q,$)}function vU($){if(j6.indexOf($)>-1)throw new Z0(`Circular extended configurations: '${$}'.`)}function fU($,Z){return E$.path.resolve($,Z)}function $Q($,Z){let X={};function J(q){return q&&typeof q==="object"&&!Array.isArray(q)}Object.assign(X,$);for(let q of Object.keys(Z))if(J(Z[q])&&J(X[q]))X[q]=$Q($[q],Z[q]);else X[q]=Z[q];return X}var h=function($,Z,X,J,q){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!q:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?q.call($,X):q?q.value=X:Z.set($,X),X},z=function($,Z,X,J){if(X==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?J:X==="a"?J.call($):J?J.value:Z.get($)},H0,h1,h$,v0,O0,J2,R1,N1,Q2,f0,q2,k0,a0,E0,b0,Y2,Y$,R0,f,G2,H2,A0,D1,G$,S1,T1,z2,g,v1,f1,k1,m,K2,r0,Q0;function MQ($){return(Z=[],X=$.process.cwd(),J)=>{let q=new CQ(Z,X,J,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var ZQ=Symbol("copyDoubleDash"),XQ=Symbol("copyDoubleDash"),I6=Symbol("deleteFromParserHintObject"),JQ=Symbol("emitWarning"),QQ=Symbol("freeze"),qQ=Symbol("getDollarZero"),b1=Symbol("getParserConfiguration"),YQ=Symbol("getUsageConfiguration"),w6=Symbol("guessLocale"),GQ=Symbol("guessVersion"),HQ=Symbol("parsePositionalNumbers"),O6=Symbol("pkgUp"),F1=Symbol("populateParserHintArray"),H$=Symbol("populateParserHintSingleValueDictionary"),E6=Symbol("populateParserHintArrayDictionary"),A6=Symbol("populateParserHintDictionary"),h6=Symbol("sanitizeKey"),N6=Symbol("setKey"),D6=Symbol("unfreeze"),zQ=Symbol("validateAsync"),KQ=Symbol("getCommandInstance"),BQ=Symbol("getContext"),UQ=Symbol("getHasOutput"),WQ=Symbol("getLoggerInstance"),VQ=Symbol("getParseContext"),LQ=Symbol("getUsageInstance"),_Q=Symbol("getValidationInstance"),B2=Symbol("hasParseCallback"),RQ=Symbol("isGlobalContext"),y1=Symbol("postProcess"),TQ=Symbol("rebase"),S6=Symbol("reset"),N$=Symbol("runYargsParserAndExecuteCommands"),v6=Symbol("runValidation"),FQ=Symbol("setHasOutput"),g1=Symbol("kTrackManuallySetKeys");class CQ{constructor($=[],Z,X,J){this.customScriptName=!1,this.parsed=!1,H0.set(this,void 0),h1.set(this,void 0),h$.set(this,{commands:[],fullCommands:[]}),v0.set(this,null),O0.set(this,null),J2.set(this,"show-hidden"),R1.set(this,null),N1.set(this,!0),Q2.set(this,{}),f0.set(this,!0),q2.set(this,[]),k0.set(this,void 0),a0.set(this,{}),E0.set(this,!1),b0.set(this,null),Y2.set(this,!0),Y$.set(this,void 0),R0.set(this,""),f.set(this,void 0),G2.set(this,void 0),H2.set(this,{}),A0.set(this,null),D1.set(this,null),G$.set(this,{}),S1.set(this,{}),T1.set(this,void 0),z2.set(this,!1),g.set(this,void 0),v1.set(this,!1),f1.set(this,!1),k1.set(this,!1),m.set(this,void 0),K2.set(this,{}),r0.set(this,null),Q0.set(this,void 0),h(this,g,J,"f"),h(this,T1,$,"f"),h(this,h1,Z,"f"),h(this,G2,X,"f"),h(this,k0,new C6(this),"f"),this.$0=this[qQ](),this[S6](),h(this,H0,z(this,H0,"f"),"f"),h(this,m,z(this,m,"f"),"f"),h(this,Q0,z(this,Q0,"f"),"f"),h(this,f,z(this,f,"f"),"f"),z(this,f,"f").showHiddenOpt=z(this,J2,"f"),h(this,Y$,this[XQ](),"f")}addHelpOpt($,Z){if(A("[string|boolean] [string]",[$,Z],arguments.length),z(this,b0,"f"))this[I6](z(this,b0,"f")),h(this,b0,null,"f");if($===!1&&Z===void 0)return this;return h(this,b0,typeof $==="string"?$:"help","f"),this.boolean(z(this,b0,"f")),this.describe(z(this,b0,"f"),Z||z(this,m,"f").deferY18nLookup("Show help")),this}help($,Z){return this.addHelpOpt($,Z)}addShowHiddenOpt($,Z){if(A("[string|boolean] [string]",[$,Z],arguments.length),$===!1&&Z===void 0)return this;let X=typeof $==="string"?$:z(this,J2,"f");return this.boolean(X),this.describe(X,Z||z(this,m,"f").deferY18nLookup("Show hidden options")),z(this,f,"f").showHiddenOpt=X,this}showHidden($,Z){return this.addShowHiddenOpt($,Z)}alias($,Z){return A("<object|string|array> [string|array]",[$,Z],arguments.length),this[E6](this.alias.bind(this),"alias",$,Z),this}array($){return A("<array|string>",[$],arguments.length),this[F1]("array",$),this[g1]($),this}boolean($){return A("<array|string>",[$],arguments.length),this[F1]("boolean",$),this[g1]($),this}check($,Z){return A("<function> [boolean]",[$,Z],arguments.length),this.middleware((X,J)=>{return A1(()=>{return $(X,J.getOptions())},(q)=>{if(!q)z(this,m,"f").fail(z(this,g,"f").y18n.__("Argument check failed: %s",$.toString()));else if(typeof q==="string"||q instanceof Error)z(this,m,"f").fail(q.toString(),q);return X},(q)=>{return z(this,m,"f").fail(q.message?q.message:q.toString(),q),X})},!1,Z),this}choices($,Z){return A("<object|string|array> [string|array]",[$,Z],arguments.length),this[E6](this.choices.bind(this),"choices",$,Z),this}coerce($,Z){if(A("<object|string|array> [function]",[$,Z],arguments.length),Array.isArray($)){if(!Z)throw new Z0("coerce callback must be provided");for(let X of $)this.coerce(X,Z);return this}else if(typeof $==="object"){for(let X of Object.keys($))this.coerce(X,$[X]);return this}if(!Z)throw new Z0("coerce callback must be provided");return z(this,f,"f").key[$]=!0,z(this,k0,"f").addCoerceMiddleware((X,J)=>{let q;if(!Object.prototype.hasOwnProperty.call(X,$))return X;return A1(()=>{return q=J.getAliases(),Z(X[$])},(Q)=>{X[$]=Q;let G=J.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])X[H]=Q;return X},(Q)=>{throw new Z0(Q.message)})},$),this}conflicts($,Z){return A("<string|object> [string|array]",[$,Z],arguments.length),z(this,Q0,"f").conflicts($,Z),this}config($="config",Z,X){if(A("[object|string] [string|function] [function]",[$,Z,X],arguments.length),typeof $==="object"&&!Array.isArray($))return $=A$($,z(this,h1,"f"),this[b1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat($),this;if(typeof Z==="function")X=Z,Z=void 0;return this.describe($,Z||z(this,m,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((J)=>{z(this,f,"f").config[J]=X||!0}),this}completion($,Z,X){if(A("[string] [string|boolean|function] [function]",[$,Z,X],arguments.length),typeof Z==="function")X=Z,Z=void 0;if(h(this,O0,$||z(this,O0,"f")||"completion","f"),!Z&&Z!==!1)Z="generate completion script";if(this.command(z(this,O0,"f"),Z),X)z(this,v0,"f").registerFunction(X);return this}command($,Z,X,J,q,Y){return A("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,Z,X,J,q,Y],arguments.length),z(this,H0,"f").addHandler($,Z,X,J,q,Y),this}commands($,Z,X,J,q,Y){return this.command($,Z,X,J,q,Y)}commandDir($,Z){A("<string> [object]",[$,Z],arguments.length);let X=z(this,G2,"f")||z(this,g,"f").require;return z(this,H0,"f").addDirectory($,X,z(this,g,"f").getCallerFile(),Z),this}count($){return A("<array|string>",[$],arguments.length),this[F1]("count",$),this[g1]($),this}default($,Z,X){if(A("<object|string|array> [*] [string]",[$,Z,X],arguments.length),X)M6($,z(this,g,"f")),z(this,f,"f").defaultDescription[$]=X;if(typeof Z==="function"){if(M6($,z(this,g,"f")),!z(this,f,"f").defaultDescription[$])z(this,f,"f").defaultDescription[$]=z(this,m,"f").functionDescription(Z);Z=Z.call()}return this[H$](this.default.bind(this),"default",$,Z),this}defaults($,Z,X){return this.default($,Z,X)}demandCommand($=1,Z,X,J){if(A("[number] [number|string] [string|null|undefined] [string|null|undefined]",[$,Z,X,J],arguments.length),typeof Z!=="number")X=Z,Z=1/0;return this.global("_",!1),z(this,f,"f").demandedCommands._={min:$,max:Z,minMsg:X,maxMsg:J},this}demand($,Z,X){if(Array.isArray(Z))Z.forEach((J)=>{P0(X,!0,z(this,g,"f")),this.demandOption(J,X)}),Z=1/0;else if(typeof Z!=="number")X=Z,Z=1/0;if(typeof $==="number")P0(X,!0,z(this,g,"f")),this.demandCommand($,Z,X,X);else if(Array.isArray($))$.forEach((J)=>{P0(X,!0,z(this,g,"f")),this.demandOption(J,X)});else if(typeof X==="string")this.demandOption($,X);else if(X===!0||typeof X>"u")this.demandOption($);return this}demandOption($,Z){return A("<object|string|array> [string]",[$,Z],arguments.length),this[H$](this.demandOption.bind(this),"demandedOptions",$,Z),this}deprecateOption($,Z){return A("<string> [string|boolean]",[$,Z],arguments.length),z(this,f,"f").deprecatedOptions[$]=Z,this}describe($,Z){return A("<object|string|array> [string]",[$,Z],arguments.length),this[N6]($,!0),z(this,m,"f").describe($,Z),this}detectLocale($){return A("<boolean>",[$],arguments.length),h(this,N1,$,"f"),this}env($){if(A("[string|boolean]",[$],arguments.length),$===!1)delete z(this,f,"f").envPrefix;else z(this,f,"f").envPrefix=$||"";return this}epilogue($){return A("<string>",[$],arguments.length),z(this,m,"f").epilog($),this}epilog($){return this.epilogue($)}example($,Z){if(A("<string|array> [string]",[$,Z],arguments.length),Array.isArray($))$.forEach((X)=>this.example(...X));else z(this,m,"f").example($,Z);return this}exit($,Z){if(h(this,E0,!0,"f"),h(this,R1,Z,"f"),z(this,f0,"f"))z(this,g,"f").process.exit($)}exitProcess($=!0){return A("[boolean]",[$],arguments.length),h(this,f0,$,"f"),this}fail($){if(A("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new Z0("Invalid first argument. Expected function or boolean 'false'");return z(this,m,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,Z){if(A("<array> [function]",[$,Z],arguments.length),!Z)return new Promise((X,J)=>{z(this,v0,"f").getCompletion($,(q,Y)=>{if(q)J(q);else X(Y)})});else return z(this,v0,"f").getCompletion($,Z)}getDemandedOptions(){return A([],0),z(this,f,"f").demandedOptions}getDemandedCommands(){return A([],0),z(this,f,"f").demandedCommands}getDeprecatedOptions(){return A([],0),z(this,f,"f").deprecatedOptions}getDetectLocale(){return z(this,N1,"f")}getExitProcess(){return z(this,f0,"f")}getGroups(){return Object.assign({},z(this,a0,"f"),z(this,S1,"f"))}getHelp(){if(h(this,E0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let Z=this[N$](z(this,T1,"f"),void 0,void 0,0,!0);if(X0(Z))return Z.then(()=>{return z(this,m,"f").help()})}let $=z(this,H0,"f").runDefaultBuilderOn(this);if(X0($))return $.then(()=>{return z(this,m,"f").help()})}return Promise.resolve(z(this,m,"f").help())}getOptions(){return z(this,f,"f")}getStrict(){return z(this,v1,"f")}getStrictCommands(){return z(this,f1,"f")}getStrictOptions(){return z(this,k1,"f")}global($,Z){if(A("<string|array> [boolean]",[$,Z],arguments.length),$=[].concat($),Z!==!1)z(this,f,"f").local=z(this,f,"f").local.filter((X)=>$.indexOf(X)===-1);else $.forEach((X)=>{if(!z(this,f,"f").local.includes(X))z(this,f,"f").local.push(X)});return this}group($,Z){A("<string|array> <string>",[$,Z],arguments.length);let X=z(this,S1,"f")[Z]||z(this,a0,"f")[Z];if(z(this,S1,"f")[Z])delete z(this,S1,"f")[Z];let J={};return z(this,a0,"f")[Z]=(X||[]).concat($).filter((q)=>{if(J[q])return!1;return J[q]=!0}),this}hide($){return A("<string>",[$],arguments.length),z(this,f,"f").hiddenOptions.push($),this}implies($,Z){return A("<string|object> [number|string|array]",[$,Z],arguments.length),z(this,Q0,"f").implies($,Z),this}locale($){if(A("[string]",[$],arguments.length),$===void 0)return this[w6](),z(this,g,"f").y18n.getLocale();return h(this,N1,!1,"f"),z(this,g,"f").y18n.setLocale($),this}middleware($,Z,X){return z(this,k0,"f").addMiddleware($,!!Z,X)}nargs($,Z){return A("<string|object|array> [number]",[$,Z],arguments.length),this[H$](this.nargs.bind(this),"narg",$,Z),this}normalize($){return A("<array|string>",[$],arguments.length),this[F1]("normalize",$),this}number($){return A("<array|string>",[$],arguments.length),this[F1]("number",$),this[g1]($),this}option($,Z){if(A("<string|object> [object]",[$,Z],arguments.length),typeof $==="object")Object.keys($).forEach((X)=>{this.options(X,$[X])});else{if(typeof Z!=="object")Z={};if(this[g1]($),z(this,r0,"f")&&($==="version"||(Z===null||Z===void 0?void 0:Z.alias)==="version"))this[JQ](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
159
- `),void 0,"versionWarning");if(z(this,f,"f").key[$]=!0,Z.alias)this.alias($,Z.alias);let X=Z.deprecate||Z.deprecated;if(X)this.deprecateOption($,X);let J=Z.demand||Z.required||Z.require;if(J)this.demand($,J);if(Z.demandOption)this.demandOption($,typeof Z.demandOption==="string"?Z.demandOption:void 0);if(Z.conflicts)this.conflicts($,Z.conflicts);if("default"in Z)this.default($,Z.default);if(Z.implies!==void 0)this.implies($,Z.implies);if(Z.nargs!==void 0)this.nargs($,Z.nargs);if(Z.config)this.config($,Z.configParser);if(Z.normalize)this.normalize($);if(Z.choices)this.choices($,Z.choices);if(Z.coerce)this.coerce($,Z.coerce);if(Z.group)this.group($,Z.group);if(Z.boolean||Z.type==="boolean"){if(this.boolean($),Z.alias)this.boolean(Z.alias)}if(Z.array||Z.type==="array"){if(this.array($),Z.alias)this.array(Z.alias)}if(Z.number||Z.type==="number"){if(this.number($),Z.alias)this.number(Z.alias)}if(Z.string||Z.type==="string"){if(this.string($),Z.alias)this.string(Z.alias)}if(Z.count||Z.type==="count")this.count($);if(typeof Z.global==="boolean")this.global($,Z.global);if(Z.defaultDescription)z(this,f,"f").defaultDescription[$]=Z.defaultDescription;if(Z.skipValidation)this.skipValidation($);let q=Z.describe||Z.description||Z.desc,Y=z(this,m,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(Y,$)||typeof q==="string")this.describe($,q);if(Z.hidden)this.hide($);if(Z.requiresArg)this.requiresArg($)}return this}options($,Z){return this.option($,Z)}parse($,Z,X){if(A("[string|array] [function|boolean|object] [function]",[$,Z,X],arguments.length),this[QQ](),typeof $>"u")$=z(this,T1,"f");if(typeof Z==="object")h(this,D1,Z,"f"),Z=X;if(typeof Z==="function")h(this,A0,Z,"f"),Z=!1;if(!Z)h(this,T1,$,"f");if(z(this,A0,"f"))h(this,f0,!1,"f");let J=this[N$]($,!!Z),q=this.parsed;if(z(this,v0,"f").setParsed(this.parsed),X0(J))return J.then((Y)=>{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,R1,"f"),Y,z(this,R0,"f"));return Y}).catch((Y)=>{if(z(this,A0,"f"))z(this,A0,"f")(Y,this.parsed.argv,z(this,R0,"f"));throw Y}).finally(()=>{this[D6](),this.parsed=q});else{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,R1,"f"),J,z(this,R0,"f"));this[D6](),this.parsed=q}return J}parseAsync($,Z,X){let J=this.parse($,Z,X);return!X0(J)?Promise.resolve(J):J}parseSync($,Z,X){let J=this.parse($,Z,X);if(X0(J))throw new Z0(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return J}parserConfiguration($){return A("<object>",[$],arguments.length),h(this,H2,$,"f"),this}pkgConf($,Z){A("<string> [string]",[$,Z],arguments.length);let X=null,J=this[O6](Z||z(this,h1,"f"));if(J[$]&&typeof J[$]==="object")X=A$(J[$],Z||z(this,h1,"f"),this[b1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat(X);return this}positional($,Z){A("<string> <object>",[$,Z],arguments.length);let X=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];Z=L1(Z,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return X.includes(Y)});let J=z(this,h$,"f").fullCommands[z(this,h$,"f").fullCommands.length-1],q=J?z(this,H0,"f").cmdToParseOptions(J):{array:[],alias:{},default:{},demand:{}};return Q$(q).forEach((Y)=>{let Q=q[Y];if(Array.isArray(Q)){if(Q.indexOf($)!==-1)Z[Y]=!0}else if(Q[$]&&!(Y in Z))Z[Y]=Q[$]}),this.group($,z(this,m,"f").getPositionalGroupName()),this.option($,Z)}recommendCommands($=!0){return A("[boolean]",[$],arguments.length),h(this,z2,$,"f"),this}required($,Z,X){return this.demand($,Z,X)}require($,Z,X){return this.demand($,Z,X)}requiresArg($){if(A("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,f,"f").narg[$])return this;else this[H$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,Z){return A("[string] [string]",[$,Z],arguments.length),$=$||this.$0,z(this,Y$,"f").log(z(this,v0,"f").generateCompletionScript($,Z||z(this,O0,"f")||"completion")),this}showHelp($){if(A("[string|function]",[$],arguments.length),h(this,E0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let X=this[N$](z(this,T1,"f"),void 0,void 0,0,!0);if(X0(X))return X.then(()=>{z(this,m,"f").showHelp($)}),this}let Z=z(this,H0,"f").runDefaultBuilderOn(this);if(X0(Z))return Z.then(()=>{z(this,m,"f").showHelp($)}),this}return z(this,m,"f").showHelp($),this}scriptName($){return this.customScriptName=!0,this.$0=$,this}showHelpOnFail($,Z){return A("[boolean|string] [string]",[$,Z],arguments.length),z(this,m,"f").showHelpOnFail($,Z),this}showVersion($){return A("[string|function]",[$],arguments.length),z(this,m,"f").showVersion($),this}skipValidation($){return A("<array|string>",[$],arguments.length),this[F1]("skipValidation",$),this}strict($){return A("[boolean]",[$],arguments.length),h(this,v1,$!==!1,"f"),this}strictCommands($){return A("[boolean]",[$],arguments.length),h(this,f1,$!==!1,"f"),this}strictOptions($){return A("[boolean]",[$],arguments.length),h(this,k1,$!==!1,"f"),this}string($){return A("<array|string>",[$],arguments.length),this[F1]("string",$),this[g1]($),this}terminalWidth(){return A([],0),z(this,g,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return A("<object>",[$],arguments.length),h(this,N1,!1,"f"),z(this,g,"f").y18n.updateLocale($),this}usage($,Z,X,J){if(A("<string|null|undefined> [string|boolean] [function|object] [function]",[$,Z,X,J],arguments.length),Z!==void 0)if(P0($,null,z(this,g,"f")),($||"").match(/^\$0( |$)/))return this.command($,Z,X,J);else throw new Z0(".usage() description must start with $0 if being used as alias for .command()");else return z(this,m,"f").usage($),this}usageConfiguration($){return A("<object>",[$],arguments.length),h(this,K2,$,"f"),this}version($,Z,X){if(A("[boolean|string] [string] [string]",[$,Z,X],arguments.length),z(this,r0,"f"))this[I6](z(this,r0,"f")),z(this,m,"f").version(void 0),h(this,r0,null,"f");if(arguments.length===0)X=this[GQ](),$="version";else if(arguments.length===1){if($===!1)return this;X=$,$="version"}else if(arguments.length===2)X=Z,Z=void 0;return h(this,r0,typeof $==="string"?$:"version","f"),Z=Z||z(this,m,"f").deferY18nLookup("Show version number"),z(this,m,"f").version(X||void 0),this.boolean(z(this,r0,"f")),this.describe(z(this,r0,"f"),Z),this}wrap($){return A("<number|null|undefined>",[$],arguments.length),z(this,m,"f").wrap($),this}[(H0=new WeakMap,h1=new WeakMap,h$=new WeakMap,v0=new WeakMap,O0=new WeakMap,J2=new WeakMap,R1=new WeakMap,N1=new WeakMap,Q2=new WeakMap,f0=new WeakMap,q2=new WeakMap,k0=new WeakMap,a0=new WeakMap,E0=new WeakMap,b0=new WeakMap,Y2=new WeakMap,Y$=new WeakMap,R0=new WeakMap,f=new WeakMap,G2=new WeakMap,H2=new WeakMap,A0=new WeakMap,D1=new WeakMap,G$=new WeakMap,S1=new WeakMap,T1=new WeakMap,z2=new WeakMap,g=new WeakMap,v1=new WeakMap,f1=new WeakMap,k1=new WeakMap,m=new WeakMap,K2=new WeakMap,r0=new WeakMap,Q0=new WeakMap,ZQ)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(Z){}return $}[XQ](){return{log:(...$)=>{if(!this[B2]())console.log(...$);if(h(this,E0,!0,"f"),z(this,R0,"f").length)h(this,R0,z(this,R0,"f")+`
158
+ `;B.forEach((_)=>{R+=_}),Z.fail(R)}};let H={};Y.conflicts=function(U,B){if(A("<string|object> [array|string]",[U,B],arguments.length),typeof U==="object")Object.keys(U).forEach((R)=>{Y.conflicts(R,U[R])});else{if($.global(U),!H[U])H[U]=[];if(Array.isArray(B))B.forEach((R)=>Y.conflicts(U,R));else H[U].push(B)}},Y.getConflicting=()=>H,Y.conflicting=function(U){if(Object.keys(U).forEach((B)=>{if(H[B])H[B].forEach((R)=>{if(R&&U[B]!==void 0&&U[R]!==void 0)Z.fail(J("Arguments %s and %s are mutually exclusive",B,R))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((B)=>{H[B].forEach((R)=>{if(R&&U[X.Parser.camelCase(B)]!==void 0&&U[X.Parser.camelCase(R)]!==void 0)Z.fail(J("Arguments %s and %s are mutually exclusive",B,R))})})},Y.recommendCommands=function(U,B){B=B.sort((j,C)=>C.length-j.length);let _=null,L=1/0;for(let j=0,C;(C=B[j])!==void 0;j++){let N=rJ(U,C);if(N<=3&&N<L)L=N,_=C}if(_)Z.fail(J("Did you mean %s?",_))},Y.reset=function(U){return Q=V1(Q,(B)=>!U[B]),H=V1(H,(B)=>!U[B]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let U=K.pop();P0(U,void 0,X),{implied:Q,conflicting:H}=U},Y}var j6=[],E$;function A$($,Z,X,J){E$=J;let q={};if(Object.prototype.hasOwnProperty.call($,"extends")){if(typeof $.extends!=="string")return q;let Y=/\.json|\..*rc$/.test($.extends),Q=null;if(!Y)try{Q=V0.resolve($.extends)}catch(G){return $}else Q=yU(Z,$.extends);bU(Q),j6.push(Q),q=Y?JSON.parse(E$.readFileSync(Q,"utf8")):V0($.extends),delete $.extends,q=A$(q,E$.path.dirname(Q),X,E$)}return j6=[],X?$Q(q,$):Object.assign({},q,$)}function bU($){if(j6.indexOf($)>-1)throw new Z0(`Circular extended configurations: '${$}'.`)}function yU($,Z){return E$.path.resolve($,Z)}function $Q($,Z){let X={};function J(q){return q&&typeof q==="object"&&!Array.isArray(q)}Object.assign(X,$);for(let q of Object.keys(Z))if(J(Z[q])&&J(X[q]))X[q]=$Q($[q],Z[q]);else X[q]=Z[q];return X}var h=function($,Z,X,J,q){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!q:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?q.call($,X):q?q.value=X:Z.set($,X),X},z=function($,Z,X,J){if(X==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?J:X==="a"?J.call($):J?J.value:Z.get($)},H0,A1,h$,v0,O0,J2,_1,h1,Q2,f0,q2,k0,a0,E0,b0,Y2,Y$,R0,f,G2,H2,A0,N1,G$,D1,R1,z2,g,S1,v1,f1,m,K2,r0,Q0;function MQ($){return(Z=[],X=$.process.cwd(),J)=>{let q=new CQ(Z,X,J,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var ZQ=Symbol("copyDoubleDash"),XQ=Symbol("copyDoubleDash"),I6=Symbol("deleteFromParserHintObject"),JQ=Symbol("emitWarning"),QQ=Symbol("freeze"),qQ=Symbol("getDollarZero"),k1=Symbol("getParserConfiguration"),YQ=Symbol("getUsageConfiguration"),w6=Symbol("guessLocale"),GQ=Symbol("guessVersion"),HQ=Symbol("parsePositionalNumbers"),O6=Symbol("pkgUp"),T1=Symbol("populateParserHintArray"),H$=Symbol("populateParserHintSingleValueDictionary"),E6=Symbol("populateParserHintArrayDictionary"),A6=Symbol("populateParserHintDictionary"),h6=Symbol("sanitizeKey"),N6=Symbol("setKey"),D6=Symbol("unfreeze"),zQ=Symbol("validateAsync"),KQ=Symbol("getCommandInstance"),BQ=Symbol("getContext"),UQ=Symbol("getHasOutput"),WQ=Symbol("getLoggerInstance"),VQ=Symbol("getParseContext"),LQ=Symbol("getUsageInstance"),_Q=Symbol("getValidationInstance"),B2=Symbol("hasParseCallback"),RQ=Symbol("isGlobalContext"),b1=Symbol("postProcess"),TQ=Symbol("rebase"),S6=Symbol("reset"),N$=Symbol("runYargsParserAndExecuteCommands"),v6=Symbol("runValidation"),FQ=Symbol("setHasOutput"),y1=Symbol("kTrackManuallySetKeys");class CQ{constructor($=[],Z,X,J){this.customScriptName=!1,this.parsed=!1,H0.set(this,void 0),A1.set(this,void 0),h$.set(this,{commands:[],fullCommands:[]}),v0.set(this,null),O0.set(this,null),J2.set(this,"show-hidden"),_1.set(this,null),h1.set(this,!0),Q2.set(this,{}),f0.set(this,!0),q2.set(this,[]),k0.set(this,void 0),a0.set(this,{}),E0.set(this,!1),b0.set(this,null),Y2.set(this,!0),Y$.set(this,void 0),R0.set(this,""),f.set(this,void 0),G2.set(this,void 0),H2.set(this,{}),A0.set(this,null),N1.set(this,null),G$.set(this,{}),D1.set(this,{}),R1.set(this,void 0),z2.set(this,!1),g.set(this,void 0),S1.set(this,!1),v1.set(this,!1),f1.set(this,!1),m.set(this,void 0),K2.set(this,{}),r0.set(this,null),Q0.set(this,void 0),h(this,g,J,"f"),h(this,R1,$,"f"),h(this,A1,Z,"f"),h(this,G2,X,"f"),h(this,k0,new C6(this),"f"),this.$0=this[qQ](),this[S6](),h(this,H0,z(this,H0,"f"),"f"),h(this,m,z(this,m,"f"),"f"),h(this,Q0,z(this,Q0,"f"),"f"),h(this,f,z(this,f,"f"),"f"),z(this,f,"f").showHiddenOpt=z(this,J2,"f"),h(this,Y$,this[XQ](),"f")}addHelpOpt($,Z){if(A("[string|boolean] [string]",[$,Z],arguments.length),z(this,b0,"f"))this[I6](z(this,b0,"f")),h(this,b0,null,"f");if($===!1&&Z===void 0)return this;return h(this,b0,typeof $==="string"?$:"help","f"),this.boolean(z(this,b0,"f")),this.describe(z(this,b0,"f"),Z||z(this,m,"f").deferY18nLookup("Show help")),this}help($,Z){return this.addHelpOpt($,Z)}addShowHiddenOpt($,Z){if(A("[string|boolean] [string]",[$,Z],arguments.length),$===!1&&Z===void 0)return this;let X=typeof $==="string"?$:z(this,J2,"f");return this.boolean(X),this.describe(X,Z||z(this,m,"f").deferY18nLookup("Show hidden options")),z(this,f,"f").showHiddenOpt=X,this}showHidden($,Z){return this.addShowHiddenOpt($,Z)}alias($,Z){return A("<object|string|array> [string|array]",[$,Z],arguments.length),this[E6](this.alias.bind(this),"alias",$,Z),this}array($){return A("<array|string>",[$],arguments.length),this[T1]("array",$),this[y1]($),this}boolean($){return A("<array|string>",[$],arguments.length),this[T1]("boolean",$),this[y1]($),this}check($,Z){return A("<function> [boolean]",[$,Z],arguments.length),this.middleware((X,J)=>{return E1(()=>{return $(X,J.getOptions())},(q)=>{if(!q)z(this,m,"f").fail(z(this,g,"f").y18n.__("Argument check failed: %s",$.toString()));else if(typeof q==="string"||q instanceof Error)z(this,m,"f").fail(q.toString(),q);return X},(q)=>{return z(this,m,"f").fail(q.message?q.message:q.toString(),q),X})},!1,Z),this}choices($,Z){return A("<object|string|array> [string|array]",[$,Z],arguments.length),this[E6](this.choices.bind(this),"choices",$,Z),this}coerce($,Z){if(A("<object|string|array> [function]",[$,Z],arguments.length),Array.isArray($)){if(!Z)throw new Z0("coerce callback must be provided");for(let X of $)this.coerce(X,Z);return this}else if(typeof $==="object"){for(let X of Object.keys($))this.coerce(X,$[X]);return this}if(!Z)throw new Z0("coerce callback must be provided");return z(this,f,"f").key[$]=!0,z(this,k0,"f").addCoerceMiddleware((X,J)=>{let q;if(!Object.prototype.hasOwnProperty.call(X,$))return X;return E1(()=>{return q=J.getAliases(),Z(X[$])},(Q)=>{X[$]=Q;let G=J.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])X[H]=Q;return X},(Q)=>{throw new Z0(Q.message)})},$),this}conflicts($,Z){return A("<string|object> [string|array]",[$,Z],arguments.length),z(this,Q0,"f").conflicts($,Z),this}config($="config",Z,X){if(A("[object|string] [string|function] [function]",[$,Z,X],arguments.length),typeof $==="object"&&!Array.isArray($))return $=A$($,z(this,A1,"f"),this[k1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat($),this;if(typeof Z==="function")X=Z,Z=void 0;return this.describe($,Z||z(this,m,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((J)=>{z(this,f,"f").config[J]=X||!0}),this}completion($,Z,X){if(A("[string] [string|boolean|function] [function]",[$,Z,X],arguments.length),typeof Z==="function")X=Z,Z=void 0;if(h(this,O0,$||z(this,O0,"f")||"completion","f"),!Z&&Z!==!1)Z="generate completion script";if(this.command(z(this,O0,"f"),Z),X)z(this,v0,"f").registerFunction(X);return this}command($,Z,X,J,q,Y){return A("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,Z,X,J,q,Y],arguments.length),z(this,H0,"f").addHandler($,Z,X,J,q,Y),this}commands($,Z,X,J,q,Y){return this.command($,Z,X,J,q,Y)}commandDir($,Z){A("<string> [object]",[$,Z],arguments.length);let X=z(this,G2,"f")||z(this,g,"f").require;return z(this,H0,"f").addDirectory($,X,z(this,g,"f").getCallerFile(),Z),this}count($){return A("<array|string>",[$],arguments.length),this[T1]("count",$),this[y1]($),this}default($,Z,X){if(A("<object|string|array> [*] [string]",[$,Z,X],arguments.length),X)M6($,z(this,g,"f")),z(this,f,"f").defaultDescription[$]=X;if(typeof Z==="function"){if(M6($,z(this,g,"f")),!z(this,f,"f").defaultDescription[$])z(this,f,"f").defaultDescription[$]=z(this,m,"f").functionDescription(Z);Z=Z.call()}return this[H$](this.default.bind(this),"default",$,Z),this}defaults($,Z,X){return this.default($,Z,X)}demandCommand($=1,Z,X,J){if(A("[number] [number|string] [string|null|undefined] [string|null|undefined]",[$,Z,X,J],arguments.length),typeof Z!=="number")X=Z,Z=1/0;return this.global("_",!1),z(this,f,"f").demandedCommands._={min:$,max:Z,minMsg:X,maxMsg:J},this}demand($,Z,X){if(Array.isArray(Z))Z.forEach((J)=>{P0(X,!0,z(this,g,"f")),this.demandOption(J,X)}),Z=1/0;else if(typeof Z!=="number")X=Z,Z=1/0;if(typeof $==="number")P0(X,!0,z(this,g,"f")),this.demandCommand($,Z,X,X);else if(Array.isArray($))$.forEach((J)=>{P0(X,!0,z(this,g,"f")),this.demandOption(J,X)});else if(typeof X==="string")this.demandOption($,X);else if(X===!0||typeof X>"u")this.demandOption($);return this}demandOption($,Z){return A("<object|string|array> [string]",[$,Z],arguments.length),this[H$](this.demandOption.bind(this),"demandedOptions",$,Z),this}deprecateOption($,Z){return A("<string> [string|boolean]",[$,Z],arguments.length),z(this,f,"f").deprecatedOptions[$]=Z,this}describe($,Z){return A("<object|string|array> [string]",[$,Z],arguments.length),this[N6]($,!0),z(this,m,"f").describe($,Z),this}detectLocale($){return A("<boolean>",[$],arguments.length),h(this,h1,$,"f"),this}env($){if(A("[string|boolean]",[$],arguments.length),$===!1)delete z(this,f,"f").envPrefix;else z(this,f,"f").envPrefix=$||"";return this}epilogue($){return A("<string>",[$],arguments.length),z(this,m,"f").epilog($),this}epilog($){return this.epilogue($)}example($,Z){if(A("<string|array> [string]",[$,Z],arguments.length),Array.isArray($))$.forEach((X)=>this.example(...X));else z(this,m,"f").example($,Z);return this}exit($,Z){if(h(this,E0,!0,"f"),h(this,_1,Z,"f"),z(this,f0,"f"))z(this,g,"f").process.exit($)}exitProcess($=!0){return A("[boolean]",[$],arguments.length),h(this,f0,$,"f"),this}fail($){if(A("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new Z0("Invalid first argument. Expected function or boolean 'false'");return z(this,m,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,Z){if(A("<array> [function]",[$,Z],arguments.length),!Z)return new Promise((X,J)=>{z(this,v0,"f").getCompletion($,(q,Y)=>{if(q)J(q);else X(Y)})});else return z(this,v0,"f").getCompletion($,Z)}getDemandedOptions(){return A([],0),z(this,f,"f").demandedOptions}getDemandedCommands(){return A([],0),z(this,f,"f").demandedCommands}getDeprecatedOptions(){return A([],0),z(this,f,"f").deprecatedOptions}getDetectLocale(){return z(this,h1,"f")}getExitProcess(){return z(this,f0,"f")}getGroups(){return Object.assign({},z(this,a0,"f"),z(this,D1,"f"))}getHelp(){if(h(this,E0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let Z=this[N$](z(this,R1,"f"),void 0,void 0,0,!0);if(X0(Z))return Z.then(()=>{return z(this,m,"f").help()})}let $=z(this,H0,"f").runDefaultBuilderOn(this);if(X0($))return $.then(()=>{return z(this,m,"f").help()})}return Promise.resolve(z(this,m,"f").help())}getOptions(){return z(this,f,"f")}getStrict(){return z(this,S1,"f")}getStrictCommands(){return z(this,v1,"f")}getStrictOptions(){return z(this,f1,"f")}global($,Z){if(A("<string|array> [boolean]",[$,Z],arguments.length),$=[].concat($),Z!==!1)z(this,f,"f").local=z(this,f,"f").local.filter((X)=>$.indexOf(X)===-1);else $.forEach((X)=>{if(!z(this,f,"f").local.includes(X))z(this,f,"f").local.push(X)});return this}group($,Z){A("<string|array> <string>",[$,Z],arguments.length);let X=z(this,D1,"f")[Z]||z(this,a0,"f")[Z];if(z(this,D1,"f")[Z])delete z(this,D1,"f")[Z];let J={};return z(this,a0,"f")[Z]=(X||[]).concat($).filter((q)=>{if(J[q])return!1;return J[q]=!0}),this}hide($){return A("<string>",[$],arguments.length),z(this,f,"f").hiddenOptions.push($),this}implies($,Z){return A("<string|object> [number|string|array]",[$,Z],arguments.length),z(this,Q0,"f").implies($,Z),this}locale($){if(A("[string]",[$],arguments.length),$===void 0)return this[w6](),z(this,g,"f").y18n.getLocale();return h(this,h1,!1,"f"),z(this,g,"f").y18n.setLocale($),this}middleware($,Z,X){return z(this,k0,"f").addMiddleware($,!!Z,X)}nargs($,Z){return A("<string|object|array> [number]",[$,Z],arguments.length),this[H$](this.nargs.bind(this),"narg",$,Z),this}normalize($){return A("<array|string>",[$],arguments.length),this[T1]("normalize",$),this}number($){return A("<array|string>",[$],arguments.length),this[T1]("number",$),this[y1]($),this}option($,Z){if(A("<string|object> [object]",[$,Z],arguments.length),typeof $==="object")Object.keys($).forEach((X)=>{this.options(X,$[X])});else{if(typeof Z!=="object")Z={};if(this[y1]($),z(this,r0,"f")&&($==="version"||(Z===null||Z===void 0?void 0:Z.alias)==="version"))this[JQ](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
159
+ `),void 0,"versionWarning");if(z(this,f,"f").key[$]=!0,Z.alias)this.alias($,Z.alias);let X=Z.deprecate||Z.deprecated;if(X)this.deprecateOption($,X);let J=Z.demand||Z.required||Z.require;if(J)this.demand($,J);if(Z.demandOption)this.demandOption($,typeof Z.demandOption==="string"?Z.demandOption:void 0);if(Z.conflicts)this.conflicts($,Z.conflicts);if("default"in Z)this.default($,Z.default);if(Z.implies!==void 0)this.implies($,Z.implies);if(Z.nargs!==void 0)this.nargs($,Z.nargs);if(Z.config)this.config($,Z.configParser);if(Z.normalize)this.normalize($);if(Z.choices)this.choices($,Z.choices);if(Z.coerce)this.coerce($,Z.coerce);if(Z.group)this.group($,Z.group);if(Z.boolean||Z.type==="boolean"){if(this.boolean($),Z.alias)this.boolean(Z.alias)}if(Z.array||Z.type==="array"){if(this.array($),Z.alias)this.array(Z.alias)}if(Z.number||Z.type==="number"){if(this.number($),Z.alias)this.number(Z.alias)}if(Z.string||Z.type==="string"){if(this.string($),Z.alias)this.string(Z.alias)}if(Z.count||Z.type==="count")this.count($);if(typeof Z.global==="boolean")this.global($,Z.global);if(Z.defaultDescription)z(this,f,"f").defaultDescription[$]=Z.defaultDescription;if(Z.skipValidation)this.skipValidation($);let q=Z.describe||Z.description||Z.desc,Y=z(this,m,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(Y,$)||typeof q==="string")this.describe($,q);if(Z.hidden)this.hide($);if(Z.requiresArg)this.requiresArg($)}return this}options($,Z){return this.option($,Z)}parse($,Z,X){if(A("[string|array] [function|boolean|object] [function]",[$,Z,X],arguments.length),this[QQ](),typeof $>"u")$=z(this,R1,"f");if(typeof Z==="object")h(this,N1,Z,"f"),Z=X;if(typeof Z==="function")h(this,A0,Z,"f"),Z=!1;if(!Z)h(this,R1,$,"f");if(z(this,A0,"f"))h(this,f0,!1,"f");let J=this[N$]($,!!Z),q=this.parsed;if(z(this,v0,"f").setParsed(this.parsed),X0(J))return J.then((Y)=>{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,_1,"f"),Y,z(this,R0,"f"));return Y}).catch((Y)=>{if(z(this,A0,"f"))z(this,A0,"f")(Y,this.parsed.argv,z(this,R0,"f"));throw Y}).finally(()=>{this[D6](),this.parsed=q});else{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,_1,"f"),J,z(this,R0,"f"));this[D6](),this.parsed=q}return J}parseAsync($,Z,X){let J=this.parse($,Z,X);return!X0(J)?Promise.resolve(J):J}parseSync($,Z,X){let J=this.parse($,Z,X);if(X0(J))throw new Z0(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return J}parserConfiguration($){return A("<object>",[$],arguments.length),h(this,H2,$,"f"),this}pkgConf($,Z){A("<string> [string]",[$,Z],arguments.length);let X=null,J=this[O6](Z||z(this,A1,"f"));if(J[$]&&typeof J[$]==="object")X=A$(J[$],Z||z(this,A1,"f"),this[k1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat(X);return this}positional($,Z){A("<string> <object>",[$,Z],arguments.length);let X=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];Z=V1(Z,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return X.includes(Y)});let J=z(this,h$,"f").fullCommands[z(this,h$,"f").fullCommands.length-1],q=J?z(this,H0,"f").cmdToParseOptions(J):{array:[],alias:{},default:{},demand:{}};return Q$(q).forEach((Y)=>{let Q=q[Y];if(Array.isArray(Q)){if(Q.indexOf($)!==-1)Z[Y]=!0}else if(Q[$]&&!(Y in Z))Z[Y]=Q[$]}),this.group($,z(this,m,"f").getPositionalGroupName()),this.option($,Z)}recommendCommands($=!0){return A("[boolean]",[$],arguments.length),h(this,z2,$,"f"),this}required($,Z,X){return this.demand($,Z,X)}require($,Z,X){return this.demand($,Z,X)}requiresArg($){if(A("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,f,"f").narg[$])return this;else this[H$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,Z){return A("[string] [string]",[$,Z],arguments.length),$=$||this.$0,z(this,Y$,"f").log(z(this,v0,"f").generateCompletionScript($,Z||z(this,O0,"f")||"completion")),this}showHelp($){if(A("[string|function]",[$],arguments.length),h(this,E0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let X=this[N$](z(this,R1,"f"),void 0,void 0,0,!0);if(X0(X))return X.then(()=>{z(this,m,"f").showHelp($)}),this}let Z=z(this,H0,"f").runDefaultBuilderOn(this);if(X0(Z))return Z.then(()=>{z(this,m,"f").showHelp($)}),this}return z(this,m,"f").showHelp($),this}scriptName($){return this.customScriptName=!0,this.$0=$,this}showHelpOnFail($,Z){return A("[boolean|string] [string]",[$,Z],arguments.length),z(this,m,"f").showHelpOnFail($,Z),this}showVersion($){return A("[string|function]",[$],arguments.length),z(this,m,"f").showVersion($),this}skipValidation($){return A("<array|string>",[$],arguments.length),this[T1]("skipValidation",$),this}strict($){return A("[boolean]",[$],arguments.length),h(this,S1,$!==!1,"f"),this}strictCommands($){return A("[boolean]",[$],arguments.length),h(this,v1,$!==!1,"f"),this}strictOptions($){return A("[boolean]",[$],arguments.length),h(this,f1,$!==!1,"f"),this}string($){return A("<array|string>",[$],arguments.length),this[T1]("string",$),this[y1]($),this}terminalWidth(){return A([],0),z(this,g,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return A("<object>",[$],arguments.length),h(this,h1,!1,"f"),z(this,g,"f").y18n.updateLocale($),this}usage($,Z,X,J){if(A("<string|null|undefined> [string|boolean] [function|object] [function]",[$,Z,X,J],arguments.length),Z!==void 0)if(P0($,null,z(this,g,"f")),($||"").match(/^\$0( |$)/))return this.command($,Z,X,J);else throw new Z0(".usage() description must start with $0 if being used as alias for .command()");else return z(this,m,"f").usage($),this}usageConfiguration($){return A("<object>",[$],arguments.length),h(this,K2,$,"f"),this}version($,Z,X){if(A("[boolean|string] [string] [string]",[$,Z,X],arguments.length),z(this,r0,"f"))this[I6](z(this,r0,"f")),z(this,m,"f").version(void 0),h(this,r0,null,"f");if(arguments.length===0)X=this[GQ](),$="version";else if(arguments.length===1){if($===!1)return this;X=$,$="version"}else if(arguments.length===2)X=Z,Z=void 0;return h(this,r0,typeof $==="string"?$:"version","f"),Z=Z||z(this,m,"f").deferY18nLookup("Show version number"),z(this,m,"f").version(X||void 0),this.boolean(z(this,r0,"f")),this.describe(z(this,r0,"f"),Z),this}wrap($){return A("<number|null|undefined>",[$],arguments.length),z(this,m,"f").wrap($),this}[(H0=new WeakMap,A1=new WeakMap,h$=new WeakMap,v0=new WeakMap,O0=new WeakMap,J2=new WeakMap,_1=new WeakMap,h1=new WeakMap,Q2=new WeakMap,f0=new WeakMap,q2=new WeakMap,k0=new WeakMap,a0=new WeakMap,E0=new WeakMap,b0=new WeakMap,Y2=new WeakMap,Y$=new WeakMap,R0=new WeakMap,f=new WeakMap,G2=new WeakMap,H2=new WeakMap,A0=new WeakMap,N1=new WeakMap,G$=new WeakMap,D1=new WeakMap,R1=new WeakMap,z2=new WeakMap,g=new WeakMap,S1=new WeakMap,v1=new WeakMap,f1=new WeakMap,m=new WeakMap,K2=new WeakMap,r0=new WeakMap,Q0=new WeakMap,ZQ)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(Z){}return $}[XQ](){return{log:(...$)=>{if(!this[B2]())console.log(...$);if(h(this,E0,!0,"f"),z(this,R0,"f").length)h(this,R0,z(this,R0,"f")+`
160
160
  `,"f");h(this,R0,z(this,R0,"f")+$.join(" "),"f")},error:(...$)=>{if(!this[B2]())console.error(...$);if(h(this,E0,!0,"f"),z(this,R0,"f").length)h(this,R0,z(this,R0,"f")+`
161
- `,"f");h(this,R0,z(this,R0,"f")+$.join(" "),"f")}}}[I6]($){Q$(z(this,f,"f")).forEach((Z)=>{if(((J)=>J==="configObjects")(Z))return;let X=z(this,f,"f")[Z];if(Array.isArray(X)){if(X.includes($))X.splice(X.indexOf($),1)}else if(typeof X==="object")delete X[$]}),delete z(this,m,"f").getDescriptions()[$]}[JQ]($,Z,X){if(!z(this,Q2,"f")[X])z(this,g,"f").process.emitWarning($,Z),z(this,Q2,"f")[X]=!0}[QQ](){z(this,q2,"f").push({options:z(this,f,"f"),configObjects:z(this,f,"f").configObjects.slice(0),exitProcess:z(this,f0,"f"),groups:z(this,a0,"f"),strict:z(this,v1,"f"),strictCommands:z(this,f1,"f"),strictOptions:z(this,k1,"f"),completionCommand:z(this,O0,"f"),output:z(this,R0,"f"),exitError:z(this,R1,"f"),hasOutput:z(this,E0,"f"),parsed:this.parsed,parseFn:z(this,A0,"f"),parseContext:z(this,D1,"f")}),z(this,m,"f").freeze(),z(this,Q0,"f").freeze(),z(this,H0,"f").freeze(),z(this,k0,"f").freeze()}[qQ](){let $="",Z;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,g,"f").process.argv()[0]))Z=z(this,g,"f").process.argv().slice(1,2);else Z=z(this,g,"f").process.argv().slice(0,1);if($=Z.map((X)=>{let J=this[TQ](z(this,h1,"f"),X);return X.match(/^(\/|([a-zA-Z]:)?\\)/)&&J.length<X.length?J:X}).join(" ").trim(),z(this,g,"f").getEnv("_")&&z(this,g,"f").getProcessArgvBin()===z(this,g,"f").getEnv("_"))$=z(this,g,"f").getEnv("_").replace(`${z(this,g,"f").path.dirname(z(this,g,"f").process.execPath())}/`,"");return $}[b1](){return z(this,H2,"f")}[YQ](){return z(this,K2,"f")}[w6](){if(!z(this,N1,"f"))return;let $=z(this,g,"f").getEnv("LC_ALL")||z(this,g,"f").getEnv("LC_MESSAGES")||z(this,g,"f").getEnv("LANG")||z(this,g,"f").getEnv("LANGUAGE")||"en_US";this.locale($.replace(/[.:].*/,""))}[GQ](){return this[O6]().version||"unknown"}[HQ]($){let Z=$["--"]?$["--"]:$._;for(let X=0,J;(J=Z[X])!==void 0;X++)if(z(this,g,"f").Parser.looksLikeNumber(J)&&Number.isSafeInteger(Math.floor(parseFloat(`${J}`))))Z[X]=Number(J);return $}[O6]($){let Z=$||"*";if(z(this,G$,"f")[Z])return z(this,G$,"f")[Z];let X={};try{let J=$||z(this,g,"f").mainFilename;if(!$&&z(this,g,"f").path.extname(J))J=z(this,g,"f").path.dirname(J);let q=z(this,g,"f").findUp(J,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});P0(q,void 0,z(this,g,"f")),X=JSON.parse(z(this,g,"f").readFileSync(q,"utf8"))}catch(J){}return z(this,G$,"f")[Z]=X||{},z(this,G$,"f")[Z]}[F1]($,Z){Z=[].concat(Z),Z.forEach((X)=>{X=this[h6](X),z(this,f,"f")[$].push(X)})}[H$]($,Z,X,J){this[A6]($,Z,X,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=Q})}[E6]($,Z,X,J){this[A6]($,Z,X,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=(z(this,f,"f")[q][Y]||[]).concat(Q)})}[A6]($,Z,X,J,q){if(Array.isArray(X))X.forEach((Y)=>{$(Y,J)});else if(((Y)=>typeof Y==="object")(X))for(let Y of Q$(X))$(Y,X[Y]);else q(Z,this[h6](X),J)}[h6]($){if($==="__proto__")return"___proto___";return $}[N6]($,Z){return this[H$](this[N6].bind(this),"key",$,Z),this}[D6](){var $,Z,X,J,q,Y,Q,G,H,K,W,U;let B=z(this,q2,"f").pop();P0(B,void 0,z(this,g,"f"));let R;$=this,Z=this,X=this,J=this,q=this,Y=this,Q=this,G=this,H=this,K=this,W=this,U=this,{options:{set value(_){h($,f,_,"f")}}.value,configObjects:R,exitProcess:{set value(_){h(Z,f0,_,"f")}}.value,groups:{set value(_){h(X,a0,_,"f")}}.value,output:{set value(_){h(J,R0,_,"f")}}.value,exitError:{set value(_){h(q,R1,_,"f")}}.value,hasOutput:{set value(_){h(Y,E0,_,"f")}}.value,parsed:this.parsed,strict:{set value(_){h(Q,v1,_,"f")}}.value,strictCommands:{set value(_){h(G,f1,_,"f")}}.value,strictOptions:{set value(_){h(H,k1,_,"f")}}.value,completionCommand:{set value(_){h(K,O0,_,"f")}}.value,parseFn:{set value(_){h(W,A0,_,"f")}}.value,parseContext:{set value(_){h(U,D1,_,"f")}}.value}=B,z(this,f,"f").configObjects=R,z(this,m,"f").unfreeze(),z(this,Q0,"f").unfreeze(),z(this,H0,"f").unfreeze(),z(this,k0,"f").unfreeze()}[zQ]($,Z){return A1(Z,(X)=>{return $(X),X})}getInternalMethods(){return{getCommandInstance:this[KQ].bind(this),getContext:this[BQ].bind(this),getHasOutput:this[UQ].bind(this),getLoggerInstance:this[WQ].bind(this),getParseContext:this[VQ].bind(this),getParserConfiguration:this[b1].bind(this),getUsageConfiguration:this[YQ].bind(this),getUsageInstance:this[LQ].bind(this),getValidationInstance:this[_Q].bind(this),hasParseCallback:this[B2].bind(this),isGlobalContext:this[RQ].bind(this),postProcess:this[y1].bind(this),reset:this[S6].bind(this),runValidation:this[v6].bind(this),runYargsParserAndExecuteCommands:this[N$].bind(this),setHasOutput:this[FQ].bind(this)}}[KQ](){return z(this,H0,"f")}[BQ](){return z(this,h$,"f")}[UQ](){return z(this,E0,"f")}[WQ](){return z(this,Y$,"f")}[VQ](){return z(this,D1,"f")||{}}[LQ](){return z(this,m,"f")}[_Q](){return z(this,Q0,"f")}[B2](){return!!z(this,A0,"f")}[RQ](){return z(this,Y2,"f")}[y1]($,Z,X,J){if(X)return $;if(X0($))return $;if(!Z)$=this[ZQ]($);if(this[b1]()["parse-positional-numbers"]||this[b1]()["parse-positional-numbers"]===void 0)$=this[HQ]($);if(J)$=E1($,this,z(this,k0,"f").getMiddleware(),!1);return $}[S6]($={}){h(this,f,z(this,f,"f")||{},"f");let Z={};Z.local=z(this,f,"f").local||[],Z.configObjects=z(this,f,"f").configObjects||[];let X={};Z.local.forEach((Y)=>{X[Y]=!0,($[Y]||[]).forEach((Q)=>{X[Q]=!0})}),Object.assign(z(this,S1,"f"),Object.keys(z(this,a0,"f")).reduce((Y,Q)=>{let G=z(this,a0,"f")[Q].filter((H)=>!(H in X));if(G.length>0)Y[Q]=G;return Y},{})),h(this,a0,{},"f");let J=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(J.forEach((Y)=>{Z[Y]=(z(this,f,"f")[Y]||[]).filter((Q)=>!X[Q])}),q.forEach((Y)=>{Z[Y]=L1(z(this,f,"f")[Y],(Q)=>!X[Q])}),Z.envPrefix=z(this,f,"f").envPrefix,h(this,f,Z,"f"),h(this,m,z(this,m,"f")?z(this,m,"f").reset(X):nJ(this,z(this,g,"f")),"f"),h(this,Q0,z(this,Q0,"f")?z(this,Q0,"f").reset(X):eJ(this,z(this,m,"f"),z(this,g,"f")),"f"),h(this,H0,z(this,H0,"f")?z(this,H0,"f").reset():pJ(z(this,m,"f"),z(this,Q0,"f"),z(this,k0,"f"),z(this,g,"f")),"f"),!z(this,v0,"f"))h(this,v0,aJ(this,z(this,m,"f"),z(this,H0,"f"),z(this,g,"f")),"f");return z(this,k0,"f").reset(),h(this,O0,null,"f"),h(this,R0,"","f"),h(this,R1,null,"f"),h(this,E0,!1,"f"),this.parsed=!1,this}[TQ]($,Z){return z(this,g,"f").path.relative($,Z)}[N$]($,Z,X,J=0,q=!1){let Y=!!X||q;$=$||z(this,T1,"f"),z(this,f,"f").__=z(this,g,"f").y18n.__,z(this,f,"f").configuration=this[b1]();let Q=!!z(this,f,"f").configuration["populate--"],G=Object.assign({},z(this,f,"f").configuration,{"populate--":!0}),H=z(this,g,"f").Parser.detailed($,Object.assign({},z(this,f,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),K=Object.assign(H.argv,z(this,D1,"f")),W=void 0,U=H.aliases,B=!1,R=!1;if(Object.keys(K).forEach((_)=>{if(_===z(this,b0,"f")&&K[_])B=!0;else if(_===z(this,r0,"f")&&K[_])R=!0}),K.$0=this.$0,this.parsed=H,J===0)z(this,m,"f").clearCachedHelpMessage();try{if(this[w6](),Z)return this[y1](K,Q,!!X,!1);if(z(this,b0,"f")){if([z(this,b0,"f")].concat(U[z(this,b0,"f")]||[]).filter((N)=>N.length>1).includes(""+K._[K._.length-1]))K._.pop(),B=!0}h(this,Y2,!1,"f");let _=z(this,H0,"f").getCommands(),L=z(this,v0,"f").completionKey in K,j=B||L||q;if(K._.length){if(_.length){let C;for(let N=J||0,c;K._[N]!==void 0;N++)if(c=String(K._[N]),_.includes(c)&&c!==z(this,O0,"f")){let I=z(this,H0,"f").runCommand(c,this,H,N+1,q,B||R||q);return this[y1](I,Q,!!X,!1)}else if(!C&&c!==z(this,O0,"f")){C=c;break}if(!z(this,H0,"f").hasDefaultCommand()&&z(this,z2,"f")&&C&&!j)z(this,Q0,"f").recommendCommands(C,_)}if(z(this,O0,"f")&&K._.includes(z(this,O0,"f"))&&!L){if(z(this,f0,"f"))_1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,H0,"f").hasDefaultCommand()&&!j){let C=z(this,H0,"f").runCommand(null,this,H,0,q,B||R||q);return this[y1](C,Q,!!X,!1)}if(L){if(z(this,f0,"f"))_1(!0);$=[].concat($);let C=$.slice($.indexOf(`--${z(this,v0,"f").completionKey}`)+1);return z(this,v0,"f").getCompletion(C,(N,c)=>{if(N)throw new Z0(N.message);(c||[]).forEach((I)=>{z(this,Y$,"f").log(I)}),this.exit(0)}),this[y1](K,!Q,!!X,!1)}if(!z(this,E0,"f")){if(B){if(z(this,f0,"f"))_1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(R){if(z(this,f0,"f"))_1(!0);Y=!0,z(this,m,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,f,"f").skipValidation.length>0)Y=Object.keys(K).some((C)=>z(this,f,"f").skipValidation.indexOf(C)>=0&&K[C]===!0);if(!Y){if(H.error)throw new Z0(H.error.message);if(!L){let C=this[v6](U,{},H.error);if(!X)W=E1(K,this,z(this,k0,"f").getMiddleware(),!0);if(W=this[zQ](C,W!==null&&W!==void 0?W:K),X0(W)&&!X)W=W.then(()=>{return E1(K,this,z(this,k0,"f").getMiddleware(),!1)})}}}catch(_){if(_ instanceof Z0)z(this,m,"f").fail(_.message,_);else throw _}return this[y1](W!==null&&W!==void 0?W:K,Q,!!X,!0)}[v6]($,Z,X,J){let q={...this.getDemandedOptions()};return(Y)=>{if(X)throw new Z0(X.message);z(this,Q0,"f").nonOptionCount(Y),z(this,Q0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,f1,"f"))Q=z(this,Q0,"f").unknownCommands(Y);if(z(this,v1,"f")&&!Q)z(this,Q0,"f").unknownArguments(Y,$,Z,!!J);else if(z(this,k1,"f"))z(this,Q0,"f").unknownArguments(Y,$,{},!1,!1);z(this,Q0,"f").limitedChoices(Y),z(this,Q0,"f").implications(Y),z(this,Q0,"f").conflicting(Y)}}[FQ](){h(this,E0,!0,"f")}[g1]($){if(typeof $==="string")z(this,f,"f").key[$]=!0;else for(let Z of $)z(this,f,"f").key[Z]=!0}}function dJ($){return!!$&&typeof $.getInternalMethods==="function"}var kU=MQ(F6),PQ=kU;import{existsSync as u1,readFileSync as W2,rmSync as U2,writeFileSync as k6}from"fs";import{resolve as h0,dirname as bU,join as yU,basename as gU}from"path";import{fileURLToPath as uU}from"url";var xQ="https://github.com/ardzero/bunext.git",IQ="https://github.com/ardzero/",mU=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],cU=!0;function pU(){try{let $=uU(import.meta.url),Z=bU($),X=yU(Z,"../package.json");return JSON.parse(W2(X,"utf-8")).version}catch{return"0.1.0"}}function b6($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function dU($,Z){let X=b6(Z),J=`${IQ}${X}`,q=h0($,"project_readme.md"),Y=h0($,"README.md");if(!u1(q))return;let Q=W2(q,"utf-8");Q=Q.replace(/\?\{project-name\}/g,Z).replace(/\?\{repo-link\}/g,J),k6(Y,Q),U2(q,{force:!0})}function lU($,Z,X){let J=b6(Z),q=`${IQ}${J}`,Y=h0($,"README.md");if(!u1(Y))return;let Q=W2(Y,"utf-8"),G=X.replace(/^git@github\.com:(.+?)(\.git)?$/,"https://github.com/$1").replace(/^git@gitlab\.com:(.+?)(\.git)?$/,"https://gitlab.com/$1").replace(/\.git$/i,"");Q=Q.split(q).join(G),k6(Y,Q)}function f6($){if(!$)return"Project name is required";if($===".")return;if(!/^\.\/[a-zA-Z0-9-]+$/.test($)&&!/^[a-zA-Z0-9-]+$/.test($))return"Project name must contain only letters, numbers, and hyphens";let Z=$.startsWith("./")?$.slice(2):$;if(u1(h0(process.cwd(),Z)))return`Directory "${Z}" already exists`}async function jQ(){let $=await Y6({message:"Where should we create your new project?",placeholder:"./my-app",validate:f6});if(c0($))W1("Operation cancelled"),process.exit(0);return $}function nU(){console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext "))),console.log(o.default.bold(`
161
+ `,"f");h(this,R0,z(this,R0,"f")+$.join(" "),"f")}}}[I6]($){Q$(z(this,f,"f")).forEach((Z)=>{if(((J)=>J==="configObjects")(Z))return;let X=z(this,f,"f")[Z];if(Array.isArray(X)){if(X.includes($))X.splice(X.indexOf($),1)}else if(typeof X==="object")delete X[$]}),delete z(this,m,"f").getDescriptions()[$]}[JQ]($,Z,X){if(!z(this,Q2,"f")[X])z(this,g,"f").process.emitWarning($,Z),z(this,Q2,"f")[X]=!0}[QQ](){z(this,q2,"f").push({options:z(this,f,"f"),configObjects:z(this,f,"f").configObjects.slice(0),exitProcess:z(this,f0,"f"),groups:z(this,a0,"f"),strict:z(this,S1,"f"),strictCommands:z(this,v1,"f"),strictOptions:z(this,f1,"f"),completionCommand:z(this,O0,"f"),output:z(this,R0,"f"),exitError:z(this,_1,"f"),hasOutput:z(this,E0,"f"),parsed:this.parsed,parseFn:z(this,A0,"f"),parseContext:z(this,N1,"f")}),z(this,m,"f").freeze(),z(this,Q0,"f").freeze(),z(this,H0,"f").freeze(),z(this,k0,"f").freeze()}[qQ](){let $="",Z;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,g,"f").process.argv()[0]))Z=z(this,g,"f").process.argv().slice(1,2);else Z=z(this,g,"f").process.argv().slice(0,1);if($=Z.map((X)=>{let J=this[TQ](z(this,A1,"f"),X);return X.match(/^(\/|([a-zA-Z]:)?\\)/)&&J.length<X.length?J:X}).join(" ").trim(),z(this,g,"f").getEnv("_")&&z(this,g,"f").getProcessArgvBin()===z(this,g,"f").getEnv("_"))$=z(this,g,"f").getEnv("_").replace(`${z(this,g,"f").path.dirname(z(this,g,"f").process.execPath())}/`,"");return $}[k1](){return z(this,H2,"f")}[YQ](){return z(this,K2,"f")}[w6](){if(!z(this,h1,"f"))return;let $=z(this,g,"f").getEnv("LC_ALL")||z(this,g,"f").getEnv("LC_MESSAGES")||z(this,g,"f").getEnv("LANG")||z(this,g,"f").getEnv("LANGUAGE")||"en_US";this.locale($.replace(/[.:].*/,""))}[GQ](){return this[O6]().version||"unknown"}[HQ]($){let Z=$["--"]?$["--"]:$._;for(let X=0,J;(J=Z[X])!==void 0;X++)if(z(this,g,"f").Parser.looksLikeNumber(J)&&Number.isSafeInteger(Math.floor(parseFloat(`${J}`))))Z[X]=Number(J);return $}[O6]($){let Z=$||"*";if(z(this,G$,"f")[Z])return z(this,G$,"f")[Z];let X={};try{let J=$||z(this,g,"f").mainFilename;if(!$&&z(this,g,"f").path.extname(J))J=z(this,g,"f").path.dirname(J);let q=z(this,g,"f").findUp(J,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});P0(q,void 0,z(this,g,"f")),X=JSON.parse(z(this,g,"f").readFileSync(q,"utf8"))}catch(J){}return z(this,G$,"f")[Z]=X||{},z(this,G$,"f")[Z]}[T1]($,Z){Z=[].concat(Z),Z.forEach((X)=>{X=this[h6](X),z(this,f,"f")[$].push(X)})}[H$]($,Z,X,J){this[A6]($,Z,X,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=Q})}[E6]($,Z,X,J){this[A6]($,Z,X,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=(z(this,f,"f")[q][Y]||[]).concat(Q)})}[A6]($,Z,X,J,q){if(Array.isArray(X))X.forEach((Y)=>{$(Y,J)});else if(((Y)=>typeof Y==="object")(X))for(let Y of Q$(X))$(Y,X[Y]);else q(Z,this[h6](X),J)}[h6]($){if($==="__proto__")return"___proto___";return $}[N6]($,Z){return this[H$](this[N6].bind(this),"key",$,Z),this}[D6](){var $,Z,X,J,q,Y,Q,G,H,K,W,U;let B=z(this,q2,"f").pop();P0(B,void 0,z(this,g,"f"));let R;$=this,Z=this,X=this,J=this,q=this,Y=this,Q=this,G=this,H=this,K=this,W=this,U=this,{options:{set value(_){h($,f,_,"f")}}.value,configObjects:R,exitProcess:{set value(_){h(Z,f0,_,"f")}}.value,groups:{set value(_){h(X,a0,_,"f")}}.value,output:{set value(_){h(J,R0,_,"f")}}.value,exitError:{set value(_){h(q,_1,_,"f")}}.value,hasOutput:{set value(_){h(Y,E0,_,"f")}}.value,parsed:this.parsed,strict:{set value(_){h(Q,S1,_,"f")}}.value,strictCommands:{set value(_){h(G,v1,_,"f")}}.value,strictOptions:{set value(_){h(H,f1,_,"f")}}.value,completionCommand:{set value(_){h(K,O0,_,"f")}}.value,parseFn:{set value(_){h(W,A0,_,"f")}}.value,parseContext:{set value(_){h(U,N1,_,"f")}}.value}=B,z(this,f,"f").configObjects=R,z(this,m,"f").unfreeze(),z(this,Q0,"f").unfreeze(),z(this,H0,"f").unfreeze(),z(this,k0,"f").unfreeze()}[zQ]($,Z){return E1(Z,(X)=>{return $(X),X})}getInternalMethods(){return{getCommandInstance:this[KQ].bind(this),getContext:this[BQ].bind(this),getHasOutput:this[UQ].bind(this),getLoggerInstance:this[WQ].bind(this),getParseContext:this[VQ].bind(this),getParserConfiguration:this[k1].bind(this),getUsageConfiguration:this[YQ].bind(this),getUsageInstance:this[LQ].bind(this),getValidationInstance:this[_Q].bind(this),hasParseCallback:this[B2].bind(this),isGlobalContext:this[RQ].bind(this),postProcess:this[b1].bind(this),reset:this[S6].bind(this),runValidation:this[v6].bind(this),runYargsParserAndExecuteCommands:this[N$].bind(this),setHasOutput:this[FQ].bind(this)}}[KQ](){return z(this,H0,"f")}[BQ](){return z(this,h$,"f")}[UQ](){return z(this,E0,"f")}[WQ](){return z(this,Y$,"f")}[VQ](){return z(this,N1,"f")||{}}[LQ](){return z(this,m,"f")}[_Q](){return z(this,Q0,"f")}[B2](){return!!z(this,A0,"f")}[RQ](){return z(this,Y2,"f")}[b1]($,Z,X,J){if(X)return $;if(X0($))return $;if(!Z)$=this[ZQ]($);if(this[k1]()["parse-positional-numbers"]||this[k1]()["parse-positional-numbers"]===void 0)$=this[HQ]($);if(J)$=O1($,this,z(this,k0,"f").getMiddleware(),!1);return $}[S6]($={}){h(this,f,z(this,f,"f")||{},"f");let Z={};Z.local=z(this,f,"f").local||[],Z.configObjects=z(this,f,"f").configObjects||[];let X={};Z.local.forEach((Y)=>{X[Y]=!0,($[Y]||[]).forEach((Q)=>{X[Q]=!0})}),Object.assign(z(this,D1,"f"),Object.keys(z(this,a0,"f")).reduce((Y,Q)=>{let G=z(this,a0,"f")[Q].filter((H)=>!(H in X));if(G.length>0)Y[Q]=G;return Y},{})),h(this,a0,{},"f");let J=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(J.forEach((Y)=>{Z[Y]=(z(this,f,"f")[Y]||[]).filter((Q)=>!X[Q])}),q.forEach((Y)=>{Z[Y]=V1(z(this,f,"f")[Y],(Q)=>!X[Q])}),Z.envPrefix=z(this,f,"f").envPrefix,h(this,f,Z,"f"),h(this,m,z(this,m,"f")?z(this,m,"f").reset(X):nJ(this,z(this,g,"f")),"f"),h(this,Q0,z(this,Q0,"f")?z(this,Q0,"f").reset(X):eJ(this,z(this,m,"f"),z(this,g,"f")),"f"),h(this,H0,z(this,H0,"f")?z(this,H0,"f").reset():pJ(z(this,m,"f"),z(this,Q0,"f"),z(this,k0,"f"),z(this,g,"f")),"f"),!z(this,v0,"f"))h(this,v0,aJ(this,z(this,m,"f"),z(this,H0,"f"),z(this,g,"f")),"f");return z(this,k0,"f").reset(),h(this,O0,null,"f"),h(this,R0,"","f"),h(this,_1,null,"f"),h(this,E0,!1,"f"),this.parsed=!1,this}[TQ]($,Z){return z(this,g,"f").path.relative($,Z)}[N$]($,Z,X,J=0,q=!1){let Y=!!X||q;$=$||z(this,R1,"f"),z(this,f,"f").__=z(this,g,"f").y18n.__,z(this,f,"f").configuration=this[k1]();let Q=!!z(this,f,"f").configuration["populate--"],G=Object.assign({},z(this,f,"f").configuration,{"populate--":!0}),H=z(this,g,"f").Parser.detailed($,Object.assign({},z(this,f,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),K=Object.assign(H.argv,z(this,N1,"f")),W=void 0,U=H.aliases,B=!1,R=!1;if(Object.keys(K).forEach((_)=>{if(_===z(this,b0,"f")&&K[_])B=!0;else if(_===z(this,r0,"f")&&K[_])R=!0}),K.$0=this.$0,this.parsed=H,J===0)z(this,m,"f").clearCachedHelpMessage();try{if(this[w6](),Z)return this[b1](K,Q,!!X,!1);if(z(this,b0,"f")){if([z(this,b0,"f")].concat(U[z(this,b0,"f")]||[]).filter((N)=>N.length>1).includes(""+K._[K._.length-1]))K._.pop(),B=!0}h(this,Y2,!1,"f");let _=z(this,H0,"f").getCommands(),L=z(this,v0,"f").completionKey in K,j=B||L||q;if(K._.length){if(_.length){let C;for(let N=J||0,c;K._[N]!==void 0;N++)if(c=String(K._[N]),_.includes(c)&&c!==z(this,O0,"f")){let I=z(this,H0,"f").runCommand(c,this,H,N+1,q,B||R||q);return this[b1](I,Q,!!X,!1)}else if(!C&&c!==z(this,O0,"f")){C=c;break}if(!z(this,H0,"f").hasDefaultCommand()&&z(this,z2,"f")&&C&&!j)z(this,Q0,"f").recommendCommands(C,_)}if(z(this,O0,"f")&&K._.includes(z(this,O0,"f"))&&!L){if(z(this,f0,"f"))L1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,H0,"f").hasDefaultCommand()&&!j){let C=z(this,H0,"f").runCommand(null,this,H,0,q,B||R||q);return this[b1](C,Q,!!X,!1)}if(L){if(z(this,f0,"f"))L1(!0);$=[].concat($);let C=$.slice($.indexOf(`--${z(this,v0,"f").completionKey}`)+1);return z(this,v0,"f").getCompletion(C,(N,c)=>{if(N)throw new Z0(N.message);(c||[]).forEach((I)=>{z(this,Y$,"f").log(I)}),this.exit(0)}),this[b1](K,!Q,!!X,!1)}if(!z(this,E0,"f")){if(B){if(z(this,f0,"f"))L1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(R){if(z(this,f0,"f"))L1(!0);Y=!0,z(this,m,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,f,"f").skipValidation.length>0)Y=Object.keys(K).some((C)=>z(this,f,"f").skipValidation.indexOf(C)>=0&&K[C]===!0);if(!Y){if(H.error)throw new Z0(H.error.message);if(!L){let C=this[v6](U,{},H.error);if(!X)W=O1(K,this,z(this,k0,"f").getMiddleware(),!0);if(W=this[zQ](C,W!==null&&W!==void 0?W:K),X0(W)&&!X)W=W.then(()=>{return O1(K,this,z(this,k0,"f").getMiddleware(),!1)})}}}catch(_){if(_ instanceof Z0)z(this,m,"f").fail(_.message,_);else throw _}return this[b1](W!==null&&W!==void 0?W:K,Q,!!X,!0)}[v6]($,Z,X,J){let q={...this.getDemandedOptions()};return(Y)=>{if(X)throw new Z0(X.message);z(this,Q0,"f").nonOptionCount(Y),z(this,Q0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,v1,"f"))Q=z(this,Q0,"f").unknownCommands(Y);if(z(this,S1,"f")&&!Q)z(this,Q0,"f").unknownArguments(Y,$,Z,!!J);else if(z(this,f1,"f"))z(this,Q0,"f").unknownArguments(Y,$,{},!1,!1);z(this,Q0,"f").limitedChoices(Y),z(this,Q0,"f").implications(Y),z(this,Q0,"f").conflicting(Y)}}[FQ](){h(this,E0,!0,"f")}[y1]($){if(typeof $==="string")z(this,f,"f").key[$]=!0;else for(let Z of $)z(this,f,"f").key[Z]=!0}}function dJ($){return!!$&&typeof $.getInternalMethods==="function"}var gU=MQ(F6),PQ=gU;import{existsSync as g1,readFileSync as W2,rmSync as U2,writeFileSync as k6}from"fs";import{resolve as h0,dirname as uU,join as mU,basename as cU}from"path";import{fileURLToPath as pU}from"url";var xQ="https://github.com/ardzero/bunext.git",IQ="https://github.com/ardzero/",dU=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],lU=!0;function nU(){try{let $=pU(import.meta.url),Z=uU($),X=mU(Z,"../package.json");return JSON.parse(W2(X,"utf-8")).version}catch{return"0.1.0"}}function b6($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function iU($,Z){let X=b6(Z),J=`${IQ}${X}`,q=h0($,"project_readme.md"),Y=h0($,"README.md");if(!g1(q))return;let Q=W2(q,"utf-8");Q=Q.replace(/\?\{project-name\}/g,Z).replace(/\?\{repo-link\}/g,J),k6(Y,Q),U2(q,{force:!0})}function tU($,Z,X){let J=b6(Z),q=`${IQ}${J}`,Y=h0($,"README.md");if(!g1(Y))return;let Q=W2(Y,"utf-8"),G=X.replace(/^git@github\.com:(.+?)(\.git)?$/,"https://github.com/$1").replace(/^git@gitlab\.com:(.+?)(\.git)?$/,"https://gitlab.com/$1").replace(/\.git$/i,"");Q=Q.split(q).join(G),k6(Y,Q)}function f6($){if(!$)return"Project name is required";if($===".")return;if(!/^\.\/[a-zA-Z0-9-]+$/.test($)&&!/^[a-zA-Z0-9-]+$/.test($))return"Project name must contain only letters, numbers, and hyphens";let Z=$.startsWith("./")?$.slice(2):$;if(g1(h0(process.cwd(),Z)))return`Directory "${Z}" already exists`}async function jQ(){let $=await Y6({message:"Where should we create your new project?",placeholder:"./my-app",validate:f6});if(c0($))U1("Operation cancelled"),process.exit(0);return $}function oU(){console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext "))),console.log(o.default.bold(`
162
162
  Usage:`)),console.log(` ${o.default.cyan("bun create bunext")} ${o.default.dim("[project-name] [options]")}`),H6(`${o.default.cyan("bun create bunext my-app")}
163
163
  Create a new project with interactive prompts
164
164
 
@@ -170,12 +170,12 @@ ${o.default.cyan("bun create bunext my-app --cursor --git")}
170
170
 
171
171
  ${o.default.cyan("bun create bunext my-app --no-install")}
172
172
  Create without installing dependencies`,"Examples"),console.log(o.default.bold(`
173
- Options:`)),console.log(` ${o.default.cyan("-y, --yes")} Skip all prompts and use defaults`),console.log(` ${o.default.cyan("--git")} Initialize git repository`),console.log(` ${o.default.cyan("--no-git")} Skip git initialization`),console.log(` ${o.default.cyan("--install")} Install dependencies`),console.log(` ${o.default.cyan("--no-install")} Skip dependency installation`),console.log(` ${o.default.cyan("--cursor")} Open project in Cursor after creation`),console.log(` ${o.default.cyan("--vscode")} Open project in VS Code after creation`),console.log(` ${o.default.cyan("-h, --help")} Show this help message`),console.log(` ${o.default.cyan("-v, --version")} Show version number`),s4(`For more info: ${o.default.underline(o.default.cyan("https://github.com/ardzero/bunext"))}`)}var s0=PQ(T6(process.argv)).help(!1).version(!1).option("y",{type:"boolean",description:"Skip all prompts and use defaults (install deps, init git)",default:!1}).option("git",{type:"boolean",description:"Initialize git repository",default:void 0}).option("install",{type:"boolean",description:"Install dependencies",default:void 0}).option("cursor",{type:"boolean",description:"Open project in Cursor after creation"}).option("vscode",{type:"boolean",description:"Open project in VS Code after creation"}).option("h",{alias:"help",type:"boolean",description:"Show help"}).option("v",{alias:"version",type:"boolean",description:"Show version"}).parse();if(s0.h)nU(),process.exit(0);if(s0.v)console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext "))),console.log(`
174
- ${o.default.bold("Version:")} ${o.default.cyan(pU())}`),s4(o.default.dim("https://github.com/ardzero/bunext")),process.exit(0);async function iU(){console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext ")));let $=s0._[0]||"",Z=!1;if(!$)$=await jQ();else{$=$.startsWith("./")?$.slice(2):$;let B=f6($);if(B)S.error(B),$=await jQ()}if($==="."){Z=!0;let{readdirSync:B}=await import("fs");if(B(process.cwd()).filter((L)=>!L.startsWith(".")).length>0)W1("Current directory is not empty. Please use an empty directory or specify a new project name."),process.exit(1)}else{if($.startsWith("./"))$=$.slice(2);let B=f6($);if(B)W1(B),process.exit(1)}let X=RJ();X.start("Cloning template");let J=Z?".bunext-temp":$;try{await m0("git",["clone","--depth","1",xQ,J]),X.stop("Template cloned")}catch(B){if(X.stop("Failed to clone template"),B.message.includes("Could not resolve host")||B.message.includes("unable to access")||B.message.includes("Failed to connect"))S.error("Network error: Unable to reach GitHub"),S.info("Please check your internet connection and try again.");else if(B.message.includes("Repository not found"))S.error("Repository not found"),S.info(`The template repository at ${xQ} could not be found.`);else if(B.message.includes("already exists"))S.error(`Directory "${J}" already exists`),S.info("Please choose a different project name or remove the existing directory.");else S.error("Error details:"),S.info(B.message);process.exit(1)}let q=Z?process.cwd():h0(process.cwd(),$),Y=Z?gU(q):$;X.start("Cleaning up");try{let B=Z?J:$,R=h0(process.cwd(),B,".git");if(u1(R))U2(R,{recursive:!0,force:!0});for(let _ of mU){let L=h0(process.cwd(),B,_);if(u1(L))try{U2(L,{recursive:!0,force:!0})}catch{}}if(Z){let{copyFile:_,mkdir:L,readdir:j}=await import("fs/promises"),{dirname:C,join:N}=await import("path");async function c(n,i){let a=await j(n,{withFileTypes:!0});for(let K0 of a){let l=N(n,K0.name),x0=N(i,K0.name);if(K0.isDirectory())await L(x0,{recursive:!0}),await c(l,x0);else await L(C(x0),{recursive:!0}),await _(l,x0)}}await c(J,process.cwd());let I=h0(process.cwd(),J);if(u1(I))U2(I,{recursive:!0,force:!0})}if(dU(q,Y),cU){let _=h0(q,"package.json");if(u1(_))try{let L=JSON.parse(W2(_,"utf-8"));L.name=b6(Y),k6(_,JSON.stringify(L,null,2)+`
175
- `)}catch{}}X.stop("Cleaned up")}catch(B){X.stop("Failed to clean up"),S.warn("Could not remove some directories"),S.info("You can manually delete them later.")}let Q=tU();S.info(`Detected package manager: ${Q}`);let G=s0.install;if(s0.y)G=!0;else if(G===void 0){let B=await I$({message:"Install dependencies?",initialValue:!0});if(c0(B))W1("Operation cancelled"),process.exit(0);G=B}if(G){X.start("Installing dependencies");try{await m0(Q,["install"],{cwd:Z?process.cwd():h0(process.cwd(),$),stdio:"pipe"}),X.stop("Dependencies installed")}catch(B){if(X.stop("Failed to install dependencies"),B.message.includes("ENOTFOUND")||B.message.includes("network")||B.message.includes("timeout"))if(S.error("Network error during installation"),S.info("You can install dependencies later by running:"),!Z)S.info(` cd ${$} && ${Q} install`);else S.info(` ${Q} install`);else if(B.message.includes("EACCES")||B.message.includes("permission denied"))S.error("Permission error"),S.info("Try running the command with appropriate permissions.");else if(S.error("Installation error:"),S.info(B.message),S.info("You can try installing manually:"),!Z)S.info(` cd ${$} && ${Q} install`);else S.info(` ${Q} install`);let R=await I$({message:"Continue without installing dependencies?",initialValue:!0});if(c0(R)||!R)W1("Operation cancelled"),process.exit(1);G=!1}}let H=s0.git;if(s0.y)H=!0;else if(H===void 0){let B=await I$({message:"Initialize a new git repository?",initialValue:!0});if(c0(B))W1("Operation cancelled"),process.exit(0);H=B}let K=!1;if(H){X.start("Initializing git repository");try{let B=Z?process.cwd():h0(process.cwd(),$);await m0("git",["init"],{cwd:B}),await m0("git",["add","."],{cwd:B}),await m0("git",["commit","-m","Initial commit"],{cwd:B}),X.stop("Git repository initialized"),K=!0}catch(B){if(X.stop("Git initialization skipped"),B.message.includes("not found")||B.message.includes("command not found"))S.warn("Git is not installed or not in PATH.");else if(B.message.includes("user.name")||B.message.includes("user.email"))S.warn("Git user configuration is missing."),S.info('Run: git config --global user.name "Your Name"'),S.info(' git config --global user.email "you@example.com"')}}if(K){let B=await I$({message:"Connect to a remote repository?",initialValue:!1});if(c0(B))S.info("Skipping remote repository setup");else if(B){let R=await Y6({message:"Enter the remote repository URL:",placeholder:"https://github.com/username/repo.git",validate:(_)=>{if(!_)return"Remote URL is required";if(!_.startsWith("https://github.com/")&&!_.startsWith("git@github.com:")&&!_.startsWith("https://gitlab.com/")&&!_.startsWith("git@gitlab.com:"))return"Please enter a valid Github or Gitlab repository URL"}});if(c0(R))S.info("Skipping remote repository setup");else{let _=R,L=await G6({message:"What would you like to do?",options:[{value:"push",label:"Add remote and push code now"},{value:"connect",label:"Just add remote (don't push yet)"}],initialValue:"push"});if(c0(L))S.info("Skipping remote repository setup");else{let j=L==="push";X.start(j?"Connecting and pushing to remote repository":"Adding remote repository");try{let C=Z?process.cwd():h0(process.cwd(),$);if(await m0("git",["remote","add","origin",_],{cwd:C}),await m0("git",["branch","-M","main"],{cwd:C}),j)await m0("git",["push","-u","origin","main"],{cwd:C}),X.stop("Connected and pushed to remote repository"),S.success(`Successfully pushed to ${_}`);else await m0("git",["config","push.autoSetupRemote","true"],{cwd:C}),X.stop("Remote repository added"),S.success(`Remote added: ${_}`),S.info("You can push later with: git push (auto-tracking enabled)");lU(q,Y,_)}catch(C){if(X.stop(j?"Failed to connect and push":"Failed to add remote"),C.message.includes("Permission denied")||C.message.includes("authentication failed"))S.error("Authentication failed"),S.info("Make sure you have the correct permissions and authentication set up.");else if(C.message.includes("Repository not found"))S.error("Repository not found"),S.info("Make sure the repository exists and the URL is correct.");else if(C.message.includes("already exists"))S.error("Remote 'origin' already exists"),S.info("You can manually set the remote with:"),S.info(` git remote set-url origin ${_}`);else S.error("Error:"),S.info(C.message),S.info(`
173
+ Options:`)),console.log(` ${o.default.cyan("-y, --yes")} Skip all prompts and use defaults`),console.log(` ${o.default.cyan("--git")} Initialize git repository`),console.log(` ${o.default.cyan("--no-git")} Skip git initialization`),console.log(` ${o.default.cyan("--install")} Install dependencies`),console.log(` ${o.default.cyan("--no-install")} Skip dependency installation`),console.log(` ${o.default.cyan("--cursor")} Open project in Cursor after creation`),console.log(` ${o.default.cyan("--vscode")} Open project in VS Code after creation`),console.log(` ${o.default.cyan("-h, --help")} Show this help message`),console.log(` ${o.default.cyan("-v, --version")} Show version number`),s4(`For more info: ${o.default.underline(o.default.cyan("https://github.com/ardzero/bunext"))}`)}var s0=PQ(T6(process.argv)).help(!1).version(!1).option("y",{type:"boolean",description:"Skip all prompts and use defaults (install deps, init git)",default:!1}).option("git",{type:"boolean",description:"Initialize git repository",default:void 0}).option("install",{type:"boolean",description:"Install dependencies",default:void 0}).option("cursor",{type:"boolean",description:"Open project in Cursor after creation"}).option("vscode",{type:"boolean",description:"Open project in VS Code after creation"}).option("h",{alias:"help",type:"boolean",description:"Show help"}).option("v",{alias:"version",type:"boolean",description:"Show version"}).parse();if(s0.h)oU(),process.exit(0);if(s0.v)console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext "))),console.log(`
174
+ ${o.default.bold("Version:")} ${o.default.cyan(nU())}`),s4(o.default.dim("https://github.com/ardzero/bunext")),process.exit(0);async function aU(){console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext ")));let $=s0._[0]||"",Z=!1;if(!$)$=await jQ();else{$=$.startsWith("./")?$.slice(2):$;let B=f6($);if(B)S.error(B),$=await jQ()}if($==="."){Z=!0;let{readdirSync:B}=await import("fs");if(B(process.cwd()).filter((L)=>!L.startsWith(".")).length>0)U1("Current directory is not empty. Please use an empty directory or specify a new project name."),process.exit(1)}else{if($.startsWith("./"))$=$.slice(2);let B=f6($);if(B)U1(B),process.exit(1)}let X=RJ();X.start("Cloning template");let J=Z?".bunext-temp":$;try{await m0("git",["clone","--depth","1",xQ,J]),X.stop("Template cloned")}catch(B){if(X.stop("Failed to clone template"),B.message.includes("Could not resolve host")||B.message.includes("unable to access")||B.message.includes("Failed to connect"))S.error("Network error: Unable to reach GitHub"),S.info("Please check your internet connection and try again.");else if(B.message.includes("Repository not found"))S.error("Repository not found"),S.info(`The template repository at ${xQ} could not be found.`);else if(B.message.includes("already exists"))S.error(`Directory "${J}" already exists`),S.info("Please choose a different project name or remove the existing directory.");else S.error("Error details:"),S.info(B.message);process.exit(1)}let q=Z?process.cwd():h0(process.cwd(),$),Y=Z?cU(q):$;X.start("Cleaning up");try{let B=Z?J:$,R=h0(process.cwd(),B,".git");if(g1(R))U2(R,{recursive:!0,force:!0});for(let _ of dU){let L=h0(process.cwd(),B,_);if(g1(L))try{U2(L,{recursive:!0,force:!0})}catch{}}if(Z){let{copyFile:_,mkdir:L,readdir:j}=await import("fs/promises"),{dirname:C,join:N}=await import("path");async function c(n,i){let a=await j(n,{withFileTypes:!0});for(let K0 of a){let l=N(n,K0.name),x0=N(i,K0.name);if(K0.isDirectory())await L(x0,{recursive:!0}),await c(l,x0);else await L(C(x0),{recursive:!0}),await _(l,x0)}}await c(J,process.cwd());let I=h0(process.cwd(),J);if(g1(I))U2(I,{recursive:!0,force:!0})}if(iU(q,Y),lU){let _=h0(q,"package.json");if(g1(_))try{let L=JSON.parse(W2(_,"utf-8"));L.name=b6(Y),k6(_,JSON.stringify(L,null,2)+`
175
+ `)}catch{}}X.stop("Cleaned up")}catch(B){X.stop("Failed to clean up"),S.warn("Could not remove some directories"),S.info("You can manually delete them later.")}let Q=rU();S.info(`Detected package manager: ${Q}`);let G=s0.install;if(s0.y)G=!0;else if(G===void 0){let B=await I$({message:"Install dependencies?",initialValue:!0});if(c0(B))U1("Operation cancelled"),process.exit(0);G=B}if(G){X.start("Installing dependencies");try{await m0(Q,["install"],{cwd:Z?process.cwd():h0(process.cwd(),$),stdio:"pipe"}),X.stop("Dependencies installed")}catch(B){if(X.stop("Failed to install dependencies"),B.message.includes("ENOTFOUND")||B.message.includes("network")||B.message.includes("timeout"))if(S.error("Network error during installation"),S.info("You can install dependencies later by running:"),!Z)S.info(` cd ${$} && ${Q} install`);else S.info(` ${Q} install`);else if(B.message.includes("EACCES")||B.message.includes("permission denied"))S.error("Permission error"),S.info("Try running the command with appropriate permissions.");else if(S.error("Installation error:"),S.info(B.message),S.info("You can try installing manually:"),!Z)S.info(` cd ${$} && ${Q} install`);else S.info(` ${Q} install`);let R=await I$({message:"Continue without installing dependencies?",initialValue:!0});if(c0(R)||!R)U1("Operation cancelled"),process.exit(1);G=!1}}let H=s0.git;if(s0.y)H=!0;else if(H===void 0){let B=await I$({message:"Initialize a new git repository?",initialValue:!0});if(c0(B))U1("Operation cancelled"),process.exit(0);H=B}let K=!1;if(H){X.start("Initializing git repository");try{let B=Z?process.cwd():h0(process.cwd(),$);await m0("git",["init"],{cwd:B}),await m0("git",["add","."],{cwd:B}),await m0("git",["commit","-m","Initial commit"],{cwd:B}),X.stop("Git repository initialized"),K=!0}catch(B){if(X.stop("Git initialization skipped"),B.message.includes("not found")||B.message.includes("command not found"))S.warn("Git is not installed or not in PATH.");else if(B.message.includes("user.name")||B.message.includes("user.email"))S.warn("Git user configuration is missing."),S.info('Run: git config --global user.name "Your Name"'),S.info(' git config --global user.email "you@example.com"')}}if(K){let B=await I$({message:"Connect to a remote repository?",initialValue:!1});if(c0(B))S.info("Skipping remote repository setup");else if(B){let R=await Y6({message:"Enter the remote repository URL:",placeholder:"https://github.com/username/repo.git",validate:(_)=>{if(!_)return"Remote URL is required";if(!_.startsWith("https://github.com/")&&!_.startsWith("git@github.com:")&&!_.startsWith("https://gitlab.com/")&&!_.startsWith("git@gitlab.com:"))return"Please enter a valid Github or Gitlab repository URL"}});if(c0(R))S.info("Skipping remote repository setup");else{let _=R,L=await G6({message:"What would you like to do?",options:[{value:"push",label:"Add remote and push code now"},{value:"connect",label:"Just add remote (don't push yet)"}],initialValue:"push"});if(c0(L))S.info("Skipping remote repository setup");else{let j=L==="push";X.start(j?"Connecting and pushing to remote repository":"Adding remote repository");try{let C=Z?process.cwd():h0(process.cwd(),$);if(await m0("git",["remote","add","origin",_],{cwd:C}),await m0("git",["branch","-M","main"],{cwd:C}),j)await m0("git",["push","-u","origin","main"],{cwd:C}),X.stop("Connected and pushed to remote repository"),S.success(`Successfully pushed to ${_}`);else await m0("git",["config","push.autoSetupRemote","true"],{cwd:C}),X.stop("Remote repository added"),S.success(`Remote added: ${_}`),S.info("You can push later with: git push (auto-tracking enabled)");tU(q,Y,_)}catch(C){if(X.stop(j?"Failed to connect and push":"Failed to add remote"),C.message.includes("Permission denied")||C.message.includes("authentication failed"))S.error("Authentication failed"),S.info("Make sure you have the correct permissions and authentication set up.");else if(C.message.includes("Repository not found"))S.error("Repository not found"),S.info("Make sure the repository exists and the URL is correct.");else if(C.message.includes("already exists"))S.error("Remote 'origin' already exists"),S.info("You can manually set the remote with:"),S.info(` git remote set-url origin ${_}`);else S.error("Error:"),S.info(C.message),S.info(`
176
176
  You can manually connect later with:`),S.info(` git remote add origin ${_}`),S.info(" git config push.autoSetupRemote true"),S.info(" git push")}}}}}let W=null;if(s0.cursor)W="cursor";else if(s0.vscode)W="vscode";else if(!s0.y){let B=await G6({message:"Open project in editor?",options:[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"skip",label:"Skip"}],initialValue:"cursor"});if(c0(B))W="skip";else W=B}if(W&&W!=="skip"){let B=W==="vscode"?"code":"cursor",R=W==="vscode"?"VS Code":"Cursor";try{await m0(B,["."],{cwd:Z?process.cwd():h0(process.cwd(),$)}),S.success(`Opened in ${R}`)}catch(_){if(S.warn(`Could not open ${R}`),_.message.includes("not found")||_.message.includes("command not found")){if(S.info(`${R} CLI is not installed or not in PATH.`),!Z)S.info(`You can open the project manually: cd ${$}`)}}}let U="";if(!Z)U+=`cd ${$}
177
177
  `;if(!G)U+=`${Q} install
178
- `;U+=`${Q} run dev`,H6(U,"Next steps"),s4(o.default.green("All done! \uD83C\uDF89"))}function tU(){if(typeof globalThis.Bun<"u")return"bun";if(process.env.npm_execpath?.includes("bun"))return"bun";if(process.argv[1]?.includes("bunx"))return"bun";if(process.env.npm_execpath?.includes("pnpm"))return"pnpm";if(process.env.npm_execpath?.includes("yarn"))return"yarn";return"npm"}iU().catch(($)=>{if($.isCanceled)W1("Operation cancelled by user"),process.exit(0);S.error("An unexpected error occurred:"),S.info($.message||$),S.info(`
178
+ `;U+=`${Q} run dev`,H6(U,"Next steps"),s4(o.default.green("All done! \uD83C\uDF89"))}function rU(){if(typeof globalThis.Bun<"u")return"bun";if(process.env.npm_execpath?.includes("bun"))return"bun";if(process.argv[1]?.includes("bunx"))return"bun";if(process.env.npm_execpath?.includes("pnpm"))return"pnpm";if(process.env.npm_execpath?.includes("yarn"))return"yarn";return"npm"}aU().catch(($)=>{if($.isCanceled)U1("Operation cancelled by user"),process.exit(0);S.error("An unexpected error occurred:"),S.info($.message||$),S.info(`
179
179
  If this issue persists, please report it at:`),S.info("https://github.com/ardzero/bunext/issues"),process.exit(1)});
180
180
 
181
- //# debugId=661F619C05E4244A64756E2164756E21
181
+ //# debugId=675516C830B5E84764756E2164756E21