bunextupgrade 0.2.2 → 0.2.4
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 +86 -81
- package/dist/cli.js.map +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,97 +1,102 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as AQ}from"node:module";var PQ=Object.create;var{getPrototypeOf:jQ,defineProperty:h6,getOwnPropertyNames:xQ}=Object;var IQ=Object.prototype.hasOwnProperty;function wQ($){return this[$]}var OQ,EQ,y1=($,J,Z)=>{var X=$!=null&&typeof $==="object";if(X){var q=J?OQ??=new WeakMap:EQ??=new WeakMap,Y=q.get($);if(Y)return Y}Z=$!=null?PQ(jQ($)):{};let Q=J||!$||!$.__esModule?h6(Z,"default",{value:$,enumerable:!0}):Z;for(let G of xQ($))if(!IQ.call(Q,G))h6(Q,G,{get:wQ.bind($,G),enumerable:!0});if(X)q.set($,Q);return Q};var T0=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var L0=AQ(import.meta.url);var H7=T0((fV,G7)=>{G7.exports=Y7;Y7.sync=hq;var Q7=L0("fs");function Aq($,J){var Z=J.pathExt!==void 0?J.pathExt:process.env.PATHEXT;if(!Z)return!0;if(Z=Z.split(";"),Z.indexOf("")!==-1)return!0;for(var X=0;X<Z.length;X++){var q=Z[X].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function q7($,J,Z){if(!$.isSymbolicLink()&&!$.isFile())return!1;return Aq(J,Z)}function Y7($,J,Z){Q7.stat($,function(X,q){Z(X,X?!1:q7(q,$,J))})}function hq($,J){return q7(Q7.statSync($),$,J)}});var W7=T0((kV,U7)=>{U7.exports=K7;K7.sync=Nq;var z7=L0("fs");function K7($,J,Z){z7.stat($,function(X,q){Z(X,X?!1:B7(q,J))})}function Nq($,J){return B7(z7.statSync($),J)}function B7($,J){return $.isFile()&&Dq($,J)}function Dq($,J){var{mode:Z,uid:X,gid:q}=$,Y=J.uid!==void 0?J.uid:process.getuid&&process.getuid(),Q=J.gid!==void 0?J.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),K=parseInt("001",8),U=G|H,B=Z&K||Z&H&&q===Q||Z&G&&X===Y||Z&U&&Y===0;return B}});var L7=T0((yV,V7)=>{var bV=L0("fs"),p$;if(process.platform==="win32"||global.TESTING_WINDOWS)p$=H7();else p$=W7();V7.exports=F2;F2.sync=Sq;function F2($,J,Z){if(typeof J==="function")Z=J,J={};if(!Z){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(X,q){F2($,J||{},function(Y,Q){if(Y)q(Y);else X(Q)})})}p$($,J||{},function(X,q){if(X){if(X.code==="EACCES"||J&&J.ignoreErrors)X=null,q=!1}Z(X,q)})}function Sq($,J){try{return p$.sync($,J||{})}catch(Z){if(J&&J.ignoreErrors||Z.code==="EACCES")return!1;else throw Z}}});var P7=T0((gV,F7)=>{var c1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_7=L0("path"),vq=c1?";":":",R7=L7(),T7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),M7=($,J)=>{let Z=J.colon||vq,X=$.match(/\//)||c1&&$.match(/\\/)?[""]:[...c1?[process.cwd()]:[],...(J.path||process.env.PATH||"").split(Z)],q=c1?J.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=c1?q.split(Z):[""];if(c1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:X,pathExt:Y,pathExtExe:q}},C7=($,J,Z)=>{if(typeof J==="function")Z=J,J={};if(!J)J={};let{pathEnv:X,pathExt:q,pathExtExe:Y}=M7($,J),Q=[],G=(K)=>new Promise((U,B)=>{if(K===X.length)return J.all&&Q.length?U(Q):B(T7($));let W=X[K],_=/^".*"$/.test(W)?W.slice(1,-1):W,R=_7.join(_,$),L=!_&&/^\.[\\\/]/.test($)?$.slice(0,2)+R:R;U(H(L,K,0))}),H=(K,U,B)=>new Promise((W,_)=>{if(B===q.length)return W(G(U+1));let R=q[B];R7(K+R,{pathExt:Y},(L,x)=>{if(!L&&x)if(J.all)Q.push(K+R);else return W(K+R);return W(H(K,U,B+1))})});return Z?G(0).then((K)=>Z(null,K),Z):G(0)},fq=($,J)=>{J=J||{};let{pathEnv:Z,pathExt:X,pathExtExe:q}=M7($,J),Y=[];for(let Q=0;Q<Z.length;Q++){let G=Z[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=_7.join(H,$),U=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+K:K;for(let B=0;B<X.length;B++){let W=U+X[B];try{if(R7.sync(W,{pathExt:q}))if(J.all)Y.push(W);else return W}catch(_){}}}if(J.all&&Y.length)return Y;if(J.nothrow)return null;throw T7($)};F7.exports=C7;C7.sync=fq});var x7=T0((uV,P2)=>{var j7=($={})=>{let J=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(J).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"};P2.exports=j7;P2.exports.default=j7});var E7=T0((mV,O7)=>{var I7=L0("path"),kq=P7(),bq=x7();function w7($,J){let Z=$.options.env||process.env,X=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=kq.sync($.command,{path:Z[bq({env:Z})],pathExt:J?I7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(X)}if(Q)Q=I7.resolve(q?$.options.cwd:"",Q);return Q}function yq($){return w7($)||w7($,!0)}O7.exports=yq});var A7=T0((mq,x2)=>{var j2=/([()\][%!^"`<>&|;, *?])/g;function gq($){return $=$.replace(j2,"^$1"),$}function uq($,J){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(j2,"^$1"),J)$=$.replace(j2,"^$1");return $}mq.command=gq;mq.argument=uq});var N7=T0((cV,h7)=>{h7.exports=/^#!(.*)/});var S7=T0((pV,D7)=>{var dq=N7();D7.exports=($="")=>{let J=$.match(dq);if(!J)return null;let[Z,X]=J[0].replace(/#! ?/,"").split(" "),q=Z.split("/").pop();if(q==="env")return X;return X?`${q} ${X}`:q}});var f7=T0((dV,v7)=>{var I2=L0("fs"),lq=S7();function nq($){let Z=Buffer.alloc(150),X;try{X=I2.openSync($,"r"),I2.readSync(X,Z,0,150,0),I2.closeSync(X)}catch(q){}return lq(Z.toString())}v7.exports=nq});var g7=T0((lV,y7)=>{var iq=L0("path"),k7=E7(),b7=A7(),oq=f7(),tq=process.platform==="win32",aq=/\.(?:com|exe)$/i,rq=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function sq($){$.file=k7($);let J=$.file&&oq($.file);if(J)return $.args.unshift($.file),$.command=J,k7($);return $.file}function eq($){if(!tq)return $;let J=sq($),Z=!aq.test(J);if($.options.forceShell||Z){let X=rq.test(J);$.command=iq.normalize($.command),$.command=b7.command($.command),$.args=$.args.map((Y)=>b7.argument(Y,X));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function $9($,J,Z){if(J&&!Array.isArray(J))Z=J,J=null;J=J?J.slice(0):[],Z=Object.assign({},Z);let X={command:$,args:J,options:Z,file:void 0,original:{command:$,args:J}};return Z.shell?X:eq(X)}y7.exports=$9});var c7=T0((nV,m7)=>{var w2=process.platform==="win32";function O2($,J){return Object.assign(Error(`${J} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${J} ${$.command}`,path:$.command,spawnargs:$.args})}function J9($,J){if(!w2)return;let Z=$.emit;$.emit=function(X,q){if(X==="exit"){let Y=u7(q,J);if(Y)return Z.call($,"error",Y)}return Z.apply($,arguments)}}function u7($,J){if(w2&&$===1&&!J.file)return O2(J.original,"spawn");return null}function Z9($,J){if(w2&&$===1&&!J.file)return O2(J.original,"spawnSync");return null}m7.exports={hookChildProcess:J9,verifyENOENT:u7,verifyENOENTSync:Z9,notFoundError:O2}});var l7=T0((iV,p1)=>{var p7=L0("child_process"),E2=g7(),A2=c7();function d7($,J,Z){let X=E2($,J,Z),q=p7.spawn(X.command,X.args,X.options);return A2.hookChildProcess(q,X),q}function X9($,J,Z){let X=E2($,J,Z),q=p7.spawnSync(X.command,X.args,X.options);return q.error=q.error||A2.verifyENOENTSync(q.status,X),q}p1.exports=d7;p1.exports.spawn=d7;p1.exports.sync=X9;p1.exports._parse=E2;p1.exports._enoent=A2});var u3=T0((Jx,uZ)=>{var g3={to($,J){if(!J)return`\x1B[${$+1}G`;return`\x1B[${J+1};${$+1}H`},move($,J){let Z="";if($<0)Z+=`\x1B[${-$}D`;else if($>0)Z+=`\x1B[${$}C`;if(J<0)Z+=`\x1B[${-J}A`;else if(J>0)Z+=`\x1B[${J}B`;return Z},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($)},qB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let J="";for(let Z=0;Z<$;Z++)J+=this.line+(Z<$-1?g3.up():"");if($)J+=g3.left;return J}};uZ.exports={cursor:g3,scroll:QB,erase:qB,beep:"\x07"}});var p4=T0((Zx,m3)=>{var c4=process||{},mZ=c4.argv||[],m4=c4.env||{},YB=!(!!m4.NO_COLOR||mZ.includes("--no-color"))&&(!!m4.FORCE_COLOR||mZ.includes("--color")||c4.platform==="win32"||(c4.stdout||{}).isTTY&&m4.TERM!=="dumb"||!!m4.CI),GB=($,J,Z=$)=>(X)=>{let q=""+X,Y=q.indexOf(J,$.length);return~Y?$+HB(q,J,Z,Y)+J:$+q+J},HB=($,J,Z,X)=>{let q="",Y=0;do q+=$.substring(Y,X)+Z,Y=X+J.length,X=$.indexOf(J,Y);while(~X);return q+$.substring(Y)},cZ=($=YB)=>{let J=$?GB:()=>String;return{isColorSupported:$,reset:J("\x1B[0m","\x1B[0m"),bold:J("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:J("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:J("\x1B[3m","\x1B[23m"),underline:J("\x1B[4m","\x1B[24m"),inverse:J("\x1B[7m","\x1B[27m"),hidden:J("\x1B[8m","\x1B[28m"),strikethrough:J("\x1B[9m","\x1B[29m"),black:J("\x1B[30m","\x1B[39m"),red:J("\x1B[31m","\x1B[39m"),green:J("\x1B[32m","\x1B[39m"),yellow:J("\x1B[33m","\x1B[39m"),blue:J("\x1B[34m","\x1B[39m"),magenta:J("\x1B[35m","\x1B[39m"),cyan:J("\x1B[36m","\x1B[39m"),white:J("\x1B[37m","\x1B[39m"),gray:J("\x1B[90m","\x1B[39m"),bgBlack:J("\x1B[40m","\x1B[49m"),bgRed:J("\x1B[41m","\x1B[49m"),bgGreen:J("\x1B[42m","\x1B[49m"),bgYellow:J("\x1B[43m","\x1B[49m"),bgBlue:J("\x1B[44m","\x1B[49m"),bgMagenta:J("\x1B[45m","\x1B[49m"),bgCyan:J("\x1B[46m","\x1B[49m"),bgWhite:J("\x1B[47m","\x1B[49m"),blackBright:J("\x1B[90m","\x1B[39m"),redBright:J("\x1B[91m","\x1B[39m"),greenBright:J("\x1B[92m","\x1B[39m"),yellowBright:J("\x1B[93m","\x1B[39m"),blueBright:J("\x1B[94m","\x1B[39m"),magentaBright:J("\x1B[95m","\x1B[39m"),cyanBright:J("\x1B[96m","\x1B[39m"),whiteBright:J("\x1B[97m","\x1B[39m"),bgBlackBright:J("\x1B[100m","\x1B[49m"),bgRedBright:J("\x1B[101m","\x1B[49m"),bgGreenBright:J("\x1B[102m","\x1B[49m"),bgYellowBright:J("\x1B[103m","\x1B[49m"),bgBlueBright:J("\x1B[104m","\x1B[49m"),bgMagentaBright:J("\x1B[105m","\x1B[49m"),bgCyanBright:J("\x1B[106m","\x1B[49m"),bgWhiteBright:J("\x1B[107m","\x1B[49m")}};m3.exports=cZ();m3.exports.createColors=cZ});function X0($){if(typeof $!=="object"||$===null)return!1;let J=Object.getPrototypeOf($);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as hQ}from"node:url";var g1=($,J)=>{let Z=U2(NQ($));if(typeof Z!=="string")throw TypeError(`${J} must be a string or a file URL: ${Z}.`);return Z},NQ=($)=>B2($)?$.toString():$,B2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,U2=($)=>$ instanceof URL?hQ($):$;var N$=($,J=[],Z={})=>{let X=g1($,"First argument"),[q,Y]=X0(J)?[[],J]:[J,Z];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(!X0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[X,Q,Y]};import{ChildProcess as yQ}from"node:child_process";import{StringDecoder as DQ}from"node:string_decoder";var{toString:N6}=Object.prototype,D6=($)=>N6.call($)==="[object ArrayBuffer]",K0=($)=>N6.call($)==="[object Uint8Array]",s0=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),SQ=new TextEncoder,S6=($)=>SQ.encode($),vQ=new TextDecoder,D$=($)=>vQ.decode($),v6=($,J)=>{return fQ($,J).join("")},fQ=($,J)=>{if(J==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let Z=new DQ(J),X=$.map((Y)=>typeof Y==="string"?S6(Y):Y).map((Y)=>Z.write(Y)),q=Z.end();return q===""?X:[...X,q]},Y$=($)=>{if($.length===1&&K0($[0]))return $[0];return W2(kQ($))},kQ=($)=>$.map((J)=>typeof J==="string"?S6(J):J),W2=($)=>{let J=new Uint8Array(bQ($)),Z=0;for(let X of $)J.set(X,Z),Z+=X.length;return J},bQ=($)=>{let J=0;for(let Z of $)J+=Z.length;return J};var y6=($)=>Array.isArray($)&&Array.isArray($.raw),g6=($,J)=>{let Z=[];for(let[Y,Q]of $.entries())Z=gQ({templates:$,expressions:J,tokens:Z,index:Y,template:Q});if(Z.length===0)throw TypeError("Template script must not be empty");let[X,...q]=Z;return[X,q,{}]},gQ=({templates:$,expressions:J,tokens:Z,index:X,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[X]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=uQ(q,$.raw[X]),H=k6(Z,Y,Q);if(X===J.length)return H;let K=J[X],U=Array.isArray(K)?K.map((B)=>b6(B)):[b6(K)];return k6(H,U,G)},uQ=($,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let Z=[],X=0,q=f6.has(J[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=J[G];if(f6.has(H)){if(X!==Q)Z.push($.slice(X,Q));X=Q+1}else if(H==="\\"){let K=J[G+1];if(K===`
|
|
3
|
-
`)Q-=1,G+=1;else if(K==="u"&&J[G+2]==="{")G=J.indexOf("}",G+3);else G+=
|
|
4
|
-
`]),
|
|
2
|
+
import{createRequire as SQ}from"node:module";var wQ=Object.create;var{getPrototypeOf:EQ,defineProperty:k6,getOwnPropertyNames:AQ}=Object;var hQ=Object.prototype.hasOwnProperty;function NQ($){return this[$]}var DQ,vQ,g1=($,J,Z)=>{var X=$!=null&&typeof $==="object";if(X){var q=J?DQ??=new WeakMap:vQ??=new WeakMap,Y=q.get($);if(Y)return Y}Z=$!=null?wQ(EQ($)):{};let Q=J||!$||!$.__esModule?k6(Z,"default",{value:$,enumerable:!0}):Z;for(let G of AQ($))if(!hQ.call(Q,G))k6(Q,G,{get:NQ.bind($,G),enumerable:!0});if(X)q.set($,Q);return Q};var C0=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var _0=SQ(import.meta.url);var V7=C0((mV,W7)=>{W7.exports=U7;U7.sync=fq;var K7=_0("fs");function Sq($,J){var Z=J.pathExt!==void 0?J.pathExt:process.env.PATHEXT;if(!Z)return!0;if(Z=Z.split(";"),Z.indexOf("")!==-1)return!0;for(var X=0;X<Z.length;X++){var q=Z[X].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function B7($,J,Z){if(!$.isSymbolicLink()&&!$.isFile())return!1;return Sq(J,Z)}function U7($,J,Z){K7.stat($,function(X,q){Z(X,X?!1:B7(q,$,J))})}function fq($,J){return B7(K7.statSync($),$,J)}});var M7=C0((cV,T7)=>{T7.exports=_7;_7.sync=kq;var L7=_0("fs");function _7($,J,Z){L7.stat($,function(X,q){Z(X,X?!1:R7(q,J))})}function kq($,J){return R7(L7.statSync($),J)}function R7($,J){return $.isFile()&&bq($,J)}function bq($,J){var{mode:Z,uid:X,gid:q}=$,Y=J.uid!==void 0?J.uid:process.getuid&&process.getuid(),Q=J.gid!==void 0?J.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),K=parseInt("001",8),U=G|H,B=Z&K||Z&H&&q===Q||Z&G&&X===Y||Z&U&&Y===0;return B}});var F7=C0((dV,C7)=>{var pV=_0("fs"),t$;if(process.platform==="win32"||global.TESTING_WINDOWS)t$=V7();else t$=M7();C7.exports=I2;I2.sync=yq;function I2($,J,Z){if(typeof J==="function")Z=J,J={};if(!Z){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(X,q){I2($,J||{},function(Y,Q){if(Y)q(Y);else X(Q)})})}t$($,J||{},function(X,q){if(X){if(X.code==="EACCES"||J&&J.ignoreErrors)X=null,q=!1}Z(X,q)})}function yq($,J){try{return t$.sync($,J||{})}catch(Z){if(J&&J.ignoreErrors||Z.code==="EACCES")return!1;else throw Z}}});var E7=C0((lV,w7)=>{var p1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",j7=_0("path"),gq=p1?";":":",x7=F7(),P7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),I7=($,J)=>{let Z=J.colon||gq,X=$.match(/\//)||p1&&$.match(/\\/)?[""]:[...p1?[process.cwd()]:[],...(J.path||process.env.PATH||"").split(Z)],q=p1?J.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=p1?q.split(Z):[""];if(p1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:X,pathExt:Y,pathExtExe:q}},O7=($,J,Z)=>{if(typeof J==="function")Z=J,J={};if(!J)J={};let{pathEnv:X,pathExt:q,pathExtExe:Y}=I7($,J),Q=[],G=(K)=>new Promise((U,B)=>{if(K===X.length)return J.all&&Q.length?U(Q):B(P7($));let W=X[K],_=/^".*"$/.test(W)?W.slice(1,-1):W,R=j7.join(_,$),L=!_&&/^\.[\\\/]/.test($)?$.slice(0,2)+R:R;U(H(L,K,0))}),H=(K,U,B)=>new Promise((W,_)=>{if(B===q.length)return W(G(U+1));let R=q[B];x7(K+R,{pathExt:Y},(L,P)=>{if(!L&&P)if(J.all)Q.push(K+R);else return W(K+R);return W(H(K,U,B+1))})});return Z?G(0).then((K)=>Z(null,K),Z):G(0)},uq=($,J)=>{J=J||{};let{pathEnv:Z,pathExt:X,pathExtExe:q}=I7($,J),Y=[];for(let Q=0;Q<Z.length;Q++){let G=Z[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=j7.join(H,$),U=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+K:K;for(let B=0;B<X.length;B++){let W=U+X[B];try{if(x7.sync(W,{pathExt:q}))if(J.all)Y.push(W);else return W}catch(_){}}}if(J.all&&Y.length)return Y;if(J.nothrow)return null;throw P7($)};w7.exports=O7;O7.sync=uq});var h7=C0((nV,O2)=>{var A7=($={})=>{let J=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(J).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"};O2.exports=A7;O2.exports.default=A7});var S7=C0((iV,v7)=>{var N7=_0("path"),mq=E7(),cq=h7();function D7($,J){let Z=$.options.env||process.env,X=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=mq.sync($.command,{path:Z[cq({env:Z})],pathExt:J?N7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(X)}if(Q)Q=N7.resolve(q?$.options.cwd:"",Q);return Q}function pq($){return D7($)||D7($,!0)}v7.exports=pq});var f7=C0((nq,E2)=>{var w2=/([()\][%!^"`<>&|;, *?])/g;function dq($){return $=$.replace(w2,"^$1"),$}function lq($,J){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(w2,"^$1"),J)$=$.replace(w2,"^$1");return $}nq.command=dq;nq.argument=lq});var b7=C0((oV,k7)=>{k7.exports=/^#!(.*)/});var g7=C0((tV,y7)=>{var tq=b7();y7.exports=($="")=>{let J=$.match(tq);if(!J)return null;let[Z,X]=J[0].replace(/#! ?/,"").split(" "),q=Z.split("/").pop();if(q==="env")return X;return X?`${q} ${X}`:q}});var m7=C0((aV,u7)=>{var A2=_0("fs"),aq=g7();function rq($){let Z=Buffer.alloc(150),X;try{X=A2.openSync($,"r"),A2.readSync(X,Z,0,150,0),A2.closeSync(X)}catch(q){}return aq(Z.toString())}u7.exports=rq});var l7=C0((rV,d7)=>{var sq=_0("path"),c7=S7(),p7=f7(),eq=m7(),$9=process.platform==="win32",J9=/\.(?:com|exe)$/i,Z9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function X9($){$.file=c7($);let J=$.file&&eq($.file);if(J)return $.args.unshift($.file),$.command=J,c7($);return $.file}function Q9($){if(!$9)return $;let J=X9($),Z=!J9.test(J);if($.options.forceShell||Z){let X=Z9.test(J);$.command=sq.normalize($.command),$.command=p7.command($.command),$.args=$.args.map((Y)=>p7.argument(Y,X));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function q9($,J,Z){if(J&&!Array.isArray(J))Z=J,J=null;J=J?J.slice(0):[],Z=Object.assign({},Z);let X={command:$,args:J,options:Z,file:void 0,original:{command:$,args:J}};return Z.shell?X:Q9(X)}d7.exports=q9});var o7=C0((sV,i7)=>{var h2=process.platform==="win32";function N2($,J){return Object.assign(Error(`${J} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${J} ${$.command}`,path:$.command,spawnargs:$.args})}function Y9($,J){if(!h2)return;let Z=$.emit;$.emit=function(X,q){if(X==="exit"){let Y=n7(q,J);if(Y)return Z.call($,"error",Y)}return Z.apply($,arguments)}}function n7($,J){if(h2&&$===1&&!J.file)return N2(J.original,"spawn");return null}function G9($,J){if(h2&&$===1&&!J.file)return N2(J.original,"spawnSync");return null}i7.exports={hookChildProcess:Y9,verifyENOENT:n7,verifyENOENTSync:G9,notFoundError:N2}});var r7=C0((eV,d1)=>{var t7=_0("child_process"),D2=l7(),v2=o7();function a7($,J,Z){let X=D2($,J,Z),q=t7.spawn(X.command,X.args,X.options);return v2.hookChildProcess(q,X),q}function H9($,J,Z){let X=D2($,J,Z),q=t7.spawnSync(X.command,X.args,X.options);return q.error=q.error||v2.verifyENOENTSync(q.status,X),q}d1.exports=a7;d1.exports.spawn=a7;d1.exports.sync=H9;d1.exports._parse=D2;d1.exports._enoent=v2});var d3=C0((GP,nZ)=>{var p3={to($,J){if(!J)return`\x1B[${$+1}G`;return`\x1B[${J+1};${$+1}H`},move($,J){let Z="";if($<0)Z+=`\x1B[${-$}D`;else if($>0)Z+=`\x1B[${$}C`;if(J<0)Z+=`\x1B[${-J}A`;else if(J>0)Z+=`\x1B[${J}B`;return Z},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"},zB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},KB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let J="";for(let Z=0;Z<$;Z++)J+=this.line+(Z<$-1?p3.up():"");if($)J+=p3.left;return J}};nZ.exports={cursor:p3,scroll:zB,erase:KB,beep:"\x07"}});var t4=C0((HP,l3)=>{var o4=process||{},iZ=o4.argv||[],i4=o4.env||{},BB=!(!!i4.NO_COLOR||iZ.includes("--no-color"))&&(!!i4.FORCE_COLOR||iZ.includes("--color")||o4.platform==="win32"||(o4.stdout||{}).isTTY&&i4.TERM!=="dumb"||!!i4.CI),UB=($,J,Z=$)=>(X)=>{let q=""+X,Y=q.indexOf(J,$.length);return~Y?$+WB(q,J,Z,Y)+J:$+q+J},WB=($,J,Z,X)=>{let q="",Y=0;do q+=$.substring(Y,X)+Z,Y=X+J.length,X=$.indexOf(J,Y);while(~X);return q+$.substring(Y)},oZ=($=BB)=>{let J=$?UB:()=>String;return{isColorSupported:$,reset:J("\x1B[0m","\x1B[0m"),bold:J("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:J("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:J("\x1B[3m","\x1B[23m"),underline:J("\x1B[4m","\x1B[24m"),inverse:J("\x1B[7m","\x1B[27m"),hidden:J("\x1B[8m","\x1B[28m"),strikethrough:J("\x1B[9m","\x1B[29m"),black:J("\x1B[30m","\x1B[39m"),red:J("\x1B[31m","\x1B[39m"),green:J("\x1B[32m","\x1B[39m"),yellow:J("\x1B[33m","\x1B[39m"),blue:J("\x1B[34m","\x1B[39m"),magenta:J("\x1B[35m","\x1B[39m"),cyan:J("\x1B[36m","\x1B[39m"),white:J("\x1B[37m","\x1B[39m"),gray:J("\x1B[90m","\x1B[39m"),bgBlack:J("\x1B[40m","\x1B[49m"),bgRed:J("\x1B[41m","\x1B[49m"),bgGreen:J("\x1B[42m","\x1B[49m"),bgYellow:J("\x1B[43m","\x1B[49m"),bgBlue:J("\x1B[44m","\x1B[49m"),bgMagenta:J("\x1B[45m","\x1B[49m"),bgCyan:J("\x1B[46m","\x1B[49m"),bgWhite:J("\x1B[47m","\x1B[49m"),blackBright:J("\x1B[90m","\x1B[39m"),redBright:J("\x1B[91m","\x1B[39m"),greenBright:J("\x1B[92m","\x1B[39m"),yellowBright:J("\x1B[93m","\x1B[39m"),blueBright:J("\x1B[94m","\x1B[39m"),magentaBright:J("\x1B[95m","\x1B[39m"),cyanBright:J("\x1B[96m","\x1B[39m"),whiteBright:J("\x1B[97m","\x1B[39m"),bgBlackBright:J("\x1B[100m","\x1B[49m"),bgRedBright:J("\x1B[101m","\x1B[49m"),bgGreenBright:J("\x1B[102m","\x1B[49m"),bgYellowBright:J("\x1B[103m","\x1B[49m"),bgBlueBright:J("\x1B[104m","\x1B[49m"),bgMagentaBright:J("\x1B[105m","\x1B[49m"),bgCyanBright:J("\x1B[106m","\x1B[49m"),bgWhiteBright:J("\x1B[107m","\x1B[49m")}};l3.exports=oZ();l3.exports.createColors=oZ});function Q0($){if(typeof $!=="object"||$===null)return!1;let J=Object.getPrototypeOf($);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as fQ}from"node:url";var u1=($,J)=>{let Z=_2(kQ($));if(typeof Z!=="string")throw TypeError(`${J} must be a string or a file URL: ${Z}.`);return Z},kQ=($)=>L2($)?$.toString():$,L2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,_2=($)=>$ instanceof URL?fQ($):$;var b$=($,J=[],Z={})=>{let X=u1($,"First argument"),[q,Y]=Q0(J)?[[],J]:[J,Z];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(!Q0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[X,Q,Y]};import{ChildProcess as pQ}from"node:child_process";import{StringDecoder as bQ}from"node:string_decoder";var{toString:b6}=Object.prototype,y6=($)=>b6.call($)==="[object ArrayBuffer]",B0=($)=>b6.call($)==="[object Uint8Array]",e0=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),yQ=new TextEncoder,g6=($)=>yQ.encode($),gQ=new TextDecoder,y$=($)=>gQ.decode($),u6=($,J)=>{return uQ($,J).join("")},uQ=($,J)=>{if(J==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let Z=new bQ(J),X=$.map((Y)=>typeof Y==="string"?g6(Y):Y).map((Y)=>Z.write(Y)),q=Z.end();return q===""?X:[...X,q]},B$=($)=>{if($.length===1&&B0($[0]))return $[0];return R2(mQ($))},mQ=($)=>$.map((J)=>typeof J==="string"?g6(J):J),R2=($)=>{let J=new Uint8Array(cQ($)),Z=0;for(let X of $)J.set(X,Z),Z+=X.length;return J},cQ=($)=>{let J=0;for(let Z of $)J+=Z.length;return J};var d6=($)=>Array.isArray($)&&Array.isArray($.raw),l6=($,J)=>{let Z=[];for(let[Y,Q]of $.entries())Z=dQ({templates:$,expressions:J,tokens:Z,index:Y,template:Q});if(Z.length===0)throw TypeError("Template script must not be empty");let[X,...q]=Z;return[X,q,{}]},dQ=({templates:$,expressions:J,tokens:Z,index:X,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[X]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=lQ(q,$.raw[X]),H=c6(Z,Y,Q);if(X===J.length)return H;let K=J[X],U=Array.isArray(K)?K.map((B)=>p6(B)):[p6(K)];return c6(H,U,G)},lQ=($,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let Z=[],X=0,q=m6.has(J[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=J[G];if(m6.has(H)){if(X!==Q)Z.push($.slice(X,Q));X=Q+1}else if(H==="\\"){let K=J[G+1];if(K===`
|
|
3
|
+
`)Q-=1,G+=1;else if(K==="u"&&J[G+2]==="{")G=J.indexOf("}",G+3);else G+=nQ[K]??1}}let Y=X===$.length;if(!Y)Z.push($.slice(X));return{nextTokens:Z,leadingWhitespaces:q,trailingWhitespaces:Y}},m6=new Set([" ","\t","\r",`
|
|
4
|
+
`]),nQ={x:3,u:5},c6=($,J,Z)=>Z||$.length===0||J.length===0?[...$,...J]:[...$.slice(0,-1),`${$.at(-1)}${J[0]}`,...J.slice(1)],p6=($)=>{let J=typeof $;if(J==="string")return $;if(J==="number")return String($);if(Q0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return iQ($);if($ instanceof pQ||Object.prototype.toString.call($)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${J}" in template expression`)},iQ=({stdout:$})=>{if(typeof $==="string")return $;if(B0($))return y$($);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 $z}from"node:child_process";import{debuglog as oQ}from"node:util";import T2 from"node:process";var y0=($)=>g$.includes($),g$=[T2.stdin,T2.stdout,T2.stderr],h0=["stdin","stdout","stderr"],u$=($)=>h0[$]??`stdio[${$}]`;var i6=($)=>{let J={...$};for(let Z of F2)J[Z]=M2($,Z);return J},M2=($,J)=>{let Z=Array.from({length:tQ($)+1}),X=aQ($[J],Z,J);return Jq(X,J)},tQ=({stdio:$})=>Array.isArray($)?Math.max($.length,h0.length):h0.length,aQ=($,J,Z)=>Q0($)?rQ($,J,Z):J.fill($),rQ=($,J,Z)=>{for(let X of Object.keys($).sort(sQ))for(let q of eQ(X,Z,J))J[q]=$[X];return J},sQ=($,J)=>n6($)<n6(J)?1:-1,n6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},eQ=($,J,Z)=>{if($==="ipc")return[Z.length-1];let X=C2($);if(X===void 0||X===0)throw TypeError(`"${J}.${$}" is invalid.
|
|
5
5
|
It must be "${J}.stdout", "${J}.stderr", "${J}.all", "${J}.ipc", or "${J}.fd3", "${J}.fd4" (and so on).`);if(X>=Z.length)throw TypeError(`"${J}.${$}" is invalid: that file descriptor does not exist.
|
|
6
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return X==="all"?[1,2]:[X]},
|
|
7
|
-
`).map((J)=>
|
|
8
|
-
`),
|
|
6
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return X==="all"?[1,2]:[X]},C2=($)=>{if($==="all")return $;if(h0.includes($))return h0.indexOf($);let J=$q.exec($);if(J!==null)return Number(J[1])},$q=/^fd(\d+)$/,Jq=($,J)=>$.map((Z)=>Z===void 0?Xq[J]:Z),Zq=oQ("execa").enabled?"full":"none",Xq={lines:!1,buffer:!0,maxBuffer:1e8,verbose:Zq,stripFinalNewline:!0},F2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],$1=($,J)=>J==="ipc"?$.at(-1):$[J];var m1=({verbose:$},J)=>j2($,J)!=="none",c1=({verbose:$},J)=>!["none","short"].includes(j2($,J)),o6=({verbose:$},J)=>{let Z=j2($,J);return m$(Z)?Z:void 0},j2=($,J)=>J===void 0?Qq($):$1($,J),Qq=($)=>$.find((J)=>m$(J))??c$.findLast((J)=>$.includes(J)),m$=($)=>typeof $==="function",c$=["none","short","full"];import{inspect as Oq}from"node:util";import{platform as qq}from"node:process";import{stripVTControlCharacters as Yq}from"node:util";var t6=($,J)=>{let Z=[$,...J],X=Z.join(" "),q=Z.map((Y)=>Uq(a6(Y))).join(" ");return{command:X,escapedCommand:q}},U$=($)=>Yq($).split(`
|
|
7
|
+
`).map((J)=>a6(J)).join(`
|
|
8
|
+
`),a6=($)=>$.replaceAll(zq,(J)=>Gq(J)),Gq=($)=>{let J=Kq[$];if(J!==void 0)return J;let Z=$.codePointAt(0),X=Z.toString(16);return Z<=Bq?`\\u${X.padStart(4,"0")}`:`\\U${X}`},Hq=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},zq=Hq(),Kq={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Bq=65535,Uq=($)=>{if(Wq.test($))return $;return qq==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},Wq=/^[\w./-]+$/;import r6 from"node:process";function x2(){let{env:$}=r6,{TERM:J,TERM_PROGRAM:Z}=$;if(r6.platform!=="win32")return J!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||Z==="Terminus-Sublime"||Z==="vscode"||J==="xterm-256color"||J==="alacritty"||J==="rxvt-unicode"||J==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var s6={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:"╱"},e6={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:"⅒"},Vq={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"},Lq={...s6,...e6},_q={...s6,...Vq},Rq=x2(),Tq=Rq?Lq:_q,p$=Tq,NW=Object.entries(e6);import Mq from"node:tty";var Cq=Mq?.WriteStream?.prototype?.hasColors?.()??!1,p=($,J)=>{if(!Cq)return(q)=>q;let Z=`\x1B[${$}m`,X=`\x1B[${J}m`;return(q)=>{let Y=q+"",Q=Y.indexOf(X);if(Q===-1)return Z+Y+X;let G=Z,H=0,U=(J===22?X:"")+Z;while(Q!==-1)G+=Y.slice(H,Q)+U,H=Q+X.length,Q=Y.indexOf(X,H);return G+=Y.slice(H)+X,G}},SW=p(0,0),$7=p(1,22),fW=p(2,22),kW=p(3,23),bW=p(4,24),yW=p(53,55),gW=p(7,27),uW=p(8,28),mW=p(9,29),cW=p(30,39),pW=p(31,39),dW=p(32,39),lW=p(33,39),nW=p(34,39),iW=p(35,39),oW=p(36,39),tW=p(37,39),d$=p(90,39),aW=p(40,49),rW=p(41,49),sW=p(42,49),eW=p(43,49),$V=p(44,49),JV=p(45,49),ZV=p(46,49),XV=p(47,49),QV=p(100,49),J7=p(91,39),qV=p(92,39),Z7=p(93,39),YV=p(94,39),GV=p(95,39),HV=p(96,39),zV=p(97,39),KV=p(101,49),BV=p(102,49),UV=p(103,49),WV=p(104,49),VV=p(105,49),LV=p(106,49),_V=p(107,49);var q7=({type:$,message:J,timestamp:Z,piped:X,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=Fq(Z),H=jq[$]({failed:Y,reject:Q,piped:X}),K=xq[$]({reject:Q});return`${d$(`[${G}]`)} ${d$(`[${q}]`)} ${K(H)} ${K(J)}`},Fq=($)=>`${l$($.getHours(),2)}:${l$($.getMinutes(),2)}:${l$($.getSeconds(),2)}.${l$($.getMilliseconds(),3)}`,l$=($,J)=>String($).padStart(J,"0"),X7=({failed:$,reject:J})=>{if(!$)return p$.tick;return J?p$.cross:p$.warning},jq={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:X7,duration:X7},Q7=($)=>$,xq={command:()=>$7,output:()=>Q7,ipc:()=>Q7,error:({reject:$})=>$?J7:Z7,duration:()=>d$};var Y7=($,J,Z)=>{let X=o6(J,Z);return $.map(({verboseLine:q,verboseObject:Y})=>Pq(q,Y,X)).filter((q)=>q!==void 0).map((q)=>Iq(q)).join("")},Pq=($,J,Z)=>{if(Z===void 0)return $;let X=Z($,J);if(typeof X==="string")return X},Iq=($)=>$.endsWith(`
|
|
9
9
|
`)?$:`${$}
|
|
10
|
-
`;var
|
|
11
|
-
`).map((Z)=>
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
Available signal numbers: ${
|
|
10
|
+
`;var p0=({type:$,verboseMessage:J,fdNumber:Z,verboseInfo:X,result:q})=>{let Y=wq({type:$,result:q,verboseInfo:X}),Q=Eq(J,Y),G=Y7(Q,X,Z);if(G!=="")console.warn(G.slice(0,-1))},wq=({type:$,result:J,verboseInfo:{escapedCommand:Z,commandId:X,rawOptions:{piped:q=!1,...Y}}})=>({type:$,escapedCommand:Z,commandId:`${X}`,timestamp:new Date,piped:q,result:J,options:Y}),Eq=($,J)=>$.split(`
|
|
11
|
+
`).map((Z)=>Aq({...J,message:Z})),Aq=($)=>{return{verboseLine:q7($),verboseObject:$}},n$=($)=>{let J=typeof $==="string"?$:Oq($);return U$(J).replaceAll("\t"," ".repeat(hq))},hq=2;var G7=($,J)=>{if(!m1(J))return;p0({type:"command",verboseMessage:$,verboseInfo:J})};var H7=($,J,Z)=>{vq($);let X=Nq($);return{verbose:$,escapedCommand:J,commandId:X,rawOptions:Z}},Nq=($)=>m1({verbose:$})?Dq++:void 0,Dq=0n,vq=($)=>{for(let J of $){if(J===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(J===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!c$.includes(J)&&!m$(J)){let Z=c$.map((X)=>`'${X}'`).join(", ");throw TypeError(`The "verbose" option must not be ${J}. Allowed values are: ${Z} or a function.`)}}};import{hrtime as z7}from"node:process";var i$=()=>z7.bigint(),P2=($)=>Number(z7.bigint()-$)/1e6;var o$=($,J,Z)=>{let X=i$(),{command:q,escapedCommand:Y}=t6($,J),Q=M2(Z,"verbose"),G=H7(Q,Y,{...Z});return G7(Y,G),{command:q,escapedCommand:Y,startTime:X,verboseInfo:G}};var G5=g1(r7(),1);import MY from"node:path";import Y5 from"node:process";import s$ from"node:process";import T1 from"node:path";function a$($={}){let{env:J=process.env,platform:Z=process.platform}=$;if(Z!=="win32")return"PATH";return Object.keys(J).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"}import{promisify as z9}from"node:util";import{execFile as K9,execFileSync as XL}from"node:child_process";import s7 from"node:path";import{fileURLToPath as B9}from"node:url";var YL=z9(K9);function r$($){return $ instanceof URL?B9($):$}function e7($){return{*[Symbol.iterator](){let J=s7.resolve(r$($)),Z;while(Z!==J)yield J,Z=J,J=s7.resolve(J,"..")}}}var U9=({cwd:$=s$.cwd(),path:J=s$.env[a$()],preferLocal:Z=!0,execPath:X=s$.execPath,addExecPath:q=!0}={})=>{let Y=T1.resolve(r$($)),Q=[],G=J.split(T1.delimiter);if(Z)W9(Q,G,Y);if(q)V9(Q,G,X,Y);return J===""||J===T1.delimiter?`${Q.join(T1.delimiter)}${J}`:[...Q,J].join(T1.delimiter)},W9=($,J,Z)=>{for(let X of e7(Z)){let q=T1.join(X,"node_modules/.bin");if(!J.includes(q))$.push(q)}},V9=($,J,Z,X)=>{let q=T1.resolve(X,r$(Z),"..");if(!J.includes(q))$.push(q)},$8=({env:$=s$.env,...J}={})=>{$={...$};let Z=a$({env:$});return J.path=$[Z],$[Z]=U9(J),$};import{setTimeout as A9}from"node:timers/promises";var J8=($,J,Z)=>{let X=Z?$4:e$,q=$ instanceof d0?{}:{cause:$};return new X(J,q)};class d0 extends Error{}var Z8=($,J)=>{Object.defineProperty($.prototype,"name",{value:J,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,Q8,{value:!0,writable:!1,enumerable:!1,configurable:!1})},X8=($)=>J4($)&&(Q8 in $),Q8=Symbol("isExecaError"),J4=($)=>Object.prototype.toString.call($)==="[object Error]";class e$ extends Error{}Z8(e$,e$.name);class $4 extends Error{}Z8($4,$4.name);import{constants as W$}from"node:os";import{constants as T9}from"node:os";var q8=()=>{let $=S2-Y8+1;return Array.from({length:$},L9)},L9=($,J)=>({name:`SIGRT${J+1}`,number:Y8+J,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Y8=34,S2=64;import{constants as _9}from"node:os";var G8=[{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 $=q8();return[...G8,...$].map(R9)},R9=({name:$,number:J,description:Z,action:X,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=_9,G=Q!==void 0;return{name:$,number:G?Q:J,description:Z,supported:G,action:X,forced:q,standard:Y}};var M9=()=>{let $=f2();return Object.fromEntries($.map(C9))},C9=({name:$,number:J,description:Z,supported:X,action:q,forced:Y,standard:Q})=>[$,{name:$,number:J,description:Z,supported:X,action:q,forced:Y,standard:Q}],H8=M9(),F9=()=>{let $=f2(),J=S2+1,Z=Array.from({length:J},(X,q)=>j9(q,$));return Object.assign({},...Z)},j9=($,J)=>{let Z=x9($,J);if(Z===void 0)return{};let{name:X,description:q,supported:Y,action:Q,forced:G,standard:H}=Z;return{[$]:{name:X,number:$,description:q,supported:Y,action:Q,forced:G,standard:H}}},x9=($,J)=>{let Z=J.find(({name:X})=>T9.signals[X]===$);if(Z!==void 0)return Z;return J.find((X)=>X.number===$)},PL=F9();var K8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return U8($,"option `killSignal`")},B8=($)=>$===0?$:U8($,"`subprocess.kill()`'s argument"),U8=($,J)=>{if(Number.isInteger($))return P9($,J);if(typeof $==="string")return O9($,J);throw TypeError(`Invalid ${J} ${String($)}: it must be a string or an integer.
|
|
12
|
+
${k2()}`)},P9=($,J)=>{if(z8.has($))return z8.get($);throw TypeError(`Invalid ${J} ${$}: this signal integer does not exist.
|
|
13
|
+
${k2()}`)},I9=()=>new Map(Object.entries(W$.signals).reverse().map(([$,J])=>[J,$])),z8=I9(),O9=($,J)=>{if($ in W$.signals)return $;if($.toUpperCase()in W$.signals)throw TypeError(`Invalid ${J} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${J} '${$}': this signal name does not exist.
|
|
14
|
+
${k2()}`)},k2=()=>`Available signal names: ${w9()}.
|
|
15
|
+
Available signal numbers: ${E9()}.`,w9=()=>Object.keys(W$.signals).sort().map(($)=>`'${$}'`).join(", "),E9=()=>[...new Set(Object.values(W$.signals).sort(($,J)=>$-J))].join(", "),Z4=($)=>H8[$].description;var W8=($)=>{if($===!1)return $;if($===!0)return h9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},h9=5000,V8=({kill:$,options:{forceKillAfterDelay:J,killSignal:Z},onInternalError:X,context:q,controller:Y},Q,G)=>{let{signal:H,error:K}=N9(Q,G,Z);D9(K,X);let U=$(H);return v9({kill:$,signal:H,forceKillAfterDelay:J,killSignal:Z,killResult:U,context:q,controller:Y}),U},N9=($,J,Z)=>{let[X=Z,q]=J4($)?[void 0,$]:[$,J];if(typeof X!=="string"&&!Number.isInteger(X))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(X)}`);if(q!==void 0&&!J4(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:B8(X),error:q}},D9=($,J)=>{if($!==void 0)J.reject($)},v9=async({kill:$,signal:J,forceKillAfterDelay:Z,killSignal:X,killResult:q,context:Y,controller:Q})=>{if(J===X&&q)b2({kill:$,forceKillAfterDelay:Z,context:Y,controllerSignal:Q.signal})},b2=async({kill:$,forceKillAfterDelay:J,context:Z,controllerSignal:X})=>{if(J===!1)return;try{if(await A9(J,void 0,{signal:X}),$("SIGKILL"))Z.isForcefullyTerminated??=!0}catch{}};import{once as S9}from"node:events";var X4=async($,J)=>{if(!$.aborted)await S9($,"abort",{signal:J})};var L8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},_8=({subprocess:$,cancelSignal:J,gracefulCancel:Z,context:X,controller:q})=>J===void 0||Z?[]:[f9($,J,X,q)],f9=async($,J,Z,{signal:X})=>{throw await X4(J,X),Z.terminationReason??="cancel",$.kill(),J.reason};import{scheduler as ZY}from"node:timers/promises";import{promisify as e9}from"node:util";var l1=({methodName:$,isSubprocess:J,ipc:Z,isConnected:X})=>{k9($,J,Z),y2($,J,X)},k9=($,J,Z)=>{if(!Z)throw Error(`${g0($,J)} can only be used if the \`ipc\` option is \`true\`.`)},y2=($,J,Z)=>{if(!Z)throw Error(`${g0($,J)} cannot be used: the ${Y1(J)} has already exited or disconnected.`)},R8=($)=>{throw Error(`${g0("getOneMessage",$)} could not complete: the ${Y1($)} exited or disconnected.`)},T8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${Y1($)} 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
|
-
${
|
|
20
|
-
${
|
|
21
|
-
]);`)},
|
|
19
|
+
${g0("getOneMessage",$)},
|
|
20
|
+
${g0("sendMessage",$,"message, {strict: true}")},
|
|
21
|
+
]);`)},Q4=($,J)=>Error(`${g0("sendMessage",J)} failed when sending an acknowledgment response to the ${Y1(J)}.`,{cause:$}),M8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${Y1($)} is not listening to incoming messages.`)},C8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${Y1($)} exited without listening to incoming messages.`)},F8=()=>Error(`\`cancelSignal\` aborted: the ${Y1(!0)} disconnected.`),j8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},x8=({error:$,methodName:J,isSubprocess:Z})=>{if($.code==="EPIPE")throw Error(`${g0(J,Z)} cannot be used: the ${Y1(Z)} is disconnecting.`,{cause:$})},P8=({error:$,methodName:J,isSubprocess:Z,message:X})=>{if(b9($))throw Error(`${g0(J,Z)}'s argument type is invalid: the message cannot be serialized: ${String(X)}.`,{cause:$})},b9=({code:$,message:J})=>y9.has($)||g9.some((Z)=>J.includes(Z)),y9=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),g9=["could not be cloned","circular structure","call stack size exceeded"],g0=($,J,Z="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${u9(J)}${$}(${Z})`,u9=($)=>$?"":"subprocess.",Y1=($)=>$?"parent process":"subprocess",n1=($)=>{if($.connected)$.disconnect()};var l0=()=>{let $={},J=new Promise((Z,X)=>{Object.assign($,{resolve:Z,reject:X})});return Object.assign(J,$)};var Y4=($,J="stdin")=>{let{options:X,fileDescriptors:q}=n0.get($),Y=I8(q,J,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(O8(Y,J,X,!0));return Q},i1=($,J="stdout")=>{let{options:X,fileDescriptors:q}=n0.get($),Y=I8(q,J,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(O8(Y,J,X,!1));return Q},n0=new WeakMap,I8=($,J,Z)=>{let X=m9(J,Z);return c9(X,J,Z,$),X},m9=($,J)=>{let Z=C2($);if(Z!==void 0)return Z;let{validOptions:X,defaultValue:q}=J?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${V$(J)}" must not be "${$}".
|
|
22
22
|
It must be ${X} or "fd3", "fd4" (and so on).
|
|
23
|
-
It is optional and defaults to "${q}".`)},
|
|
24
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(q.direction==="input"&&!Z)throw TypeError(`"${
|
|
25
|
-
Please set this option with "pipe" instead.`},
|
|
26
|
-
Please rename it to ${
|
|
27
|
-
Please rename it to one of: ${Z}.`)},
|
|
28
|
-
${$.message}`,$}},
|
|
23
|
+
It is optional and defaults to "${q}".`)},c9=($,J,Z,X)=>{let q=X[w8($)];if(q===void 0)throw TypeError(`"${V$(Z)}" must not be ${J}. That file descriptor does not exist.
|
|
24
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(q.direction==="input"&&!Z)throw TypeError(`"${V$(Z)}" must not be ${J}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&Z)throw TypeError(`"${V$(Z)}" must not be ${J}. It must be a writable stream, not readable.`)},O8=($,J,Z,X)=>{if($==="all"&&!Z.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=p9($,Z);return`The "${q}: ${q4(Y)}" option is incompatible with using "${V$(X)}: ${q4(J)}".
|
|
25
|
+
Please set this option with "pipe" instead.`},p9=($,{stdin:J,stdout:Z,stderr:X,stdio:q})=>{let Y=w8($);if(Y===0&&J!==void 0)return{optionName:"stdin",optionValue:J};if(Y===1&&Z!==void 0)return{optionName:"stdout",optionValue:Z};if(Y===2&&X!==void 0)return{optionName:"stderr",optionValue:X};return{optionName:`stdio[${Y}]`,optionValue:q[Y]}},w8=($)=>$==="all"?1:$,V$=($)=>$?"to":"from",q4=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as t9}from"node:events";import{addAbortListener as d9}from"node:events";var M1=($,J,Z)=>{let X=$.getMaxListeners();if(X===0||X===Number.POSITIVE_INFINITY)return;$.setMaxListeners(X+J),d9(Z,()=>{$.setMaxListeners($.getMaxListeners()-J)})};import{EventEmitter as i9}from"node:events";import{once as l9}from"node:events";import{scheduler as n9}from"node:timers/promises";var G4=($,J)=>{if(J)g2($)},g2=($)=>{$.refCounted()},H4=($,J)=>{if(J)u2($)},u2=($)=>{$.unrefCounted()},E8=($,J)=>{if(J)u2($),u2($)},A8=($,J)=>{if(J)g2($),g2($)};var h8=async({anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X},q)=>{if(v8(q)||f8(q))return;if(!z4.has($))z4.set($,[]);let Y=z4.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await S8($,X,q),await n9.yield();let Q=await D8({wrappedMessage:Y[0],anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X});Y.shift(),X.emit("message",Q),X.emit("message:done")}},N8=async({anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X,boundOnMessage:q})=>{m2();let Y=z4.get($);while(Y?.length>0)await l9(X,"message:done");$.removeListener("message",q),A8(J,Z),X.connected=!1,X.emit("disconnect")},z4=new WeakMap;var G1=($,J,Z)=>{if(K4.has($))return K4.get($);let X=new i9;return X.connected=!0,K4.set($,X),o9({ipcEmitter:X,anyProcess:$,channel:J,isSubprocess:Z}),X},K4=new WeakMap,o9=({ipcEmitter:$,anyProcess:J,channel:Z,isSubprocess:X})=>{let q=h8.bind(void 0,{anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:$});J.on("message",q),J.once("disconnect",N8.bind(void 0,{anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:$,boundOnMessage:q})),E8(Z,X)},B4=($)=>{let J=K4.get($);return J===void 0?$.channel!==null:J.connected};var k8=({anyProcess:$,channel:J,isSubprocess:Z,message:X,strict:q})=>{if(!q)return X;let Y=G1($,J,Z),Q=V4($,Y);return{id:a9++,type:W4,message:X,hasListeners:Q}},a9=0n,b8=($,J)=>{if(J?.type!==W4||J.hasListeners)return;for(let{id:Z}of $)if(Z!==void 0)U4[Z].resolve({isDeadlock:!0,hasListeners:!1})},D8=async({wrappedMessage:$,anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:q})=>{if($?.type!==W4||!J.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:g8,message:V4(J,q)};try{await L4({anyProcess:J,channel:Z,isSubprocess:X,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},v8=($)=>{if($?.type!==g8)return!1;let{id:J,message:Z}=$;return U4[J]?.resolve({isDeadlock:!1,hasListeners:Z}),!0},y8=async($,J,Z)=>{if($?.type!==W4)return;let X=l0();U4[$.id]=X;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([X,r9(J,Z,q)]);if(Y)T8(Z);if(!Q)M8(Z)}finally{q.abort(),delete U4[$.id]}},U4={},r9=async($,J,{signal:Z})=>{M1($,1,Z),await t9($,"disconnect",{signal:Z}),C8(J)},W4="execa:ipc:request",g8="execa:ipc:response";var u8=($,J,Z)=>{if(!L$.has($))L$.set($,new Set);let X=L$.get($),q=l0(),Y=Z?J.id:void 0,Q={onMessageSent:q,id:Y};return X.add(Q),{outgoingMessages:X,outgoingMessage:Q}},m8=({outgoingMessages:$,outgoingMessage:J})=>{$.delete(J),J.onMessageSent.resolve()},S8=async($,J,Z)=>{while(!V4($,J)&&L$.get($)?.size>0){let X=[...L$.get($)];b8(X,Z),await Promise.all(X.map(({onMessageSent:q})=>q))}},L$=new WeakMap,V4=($,J)=>J.listenerCount("message")>s9($),s9=($)=>n0.has($)&&!$1(n0.get($).options.buffer,"ipc")?1:0;var L4=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},q,{strict:Y=!1}={})=>{return l1({methodName:"sendMessage",isSubprocess:Z,ipc:X,isConnected:$.connected}),$Y({anyProcess:$,channel:J,methodName:"sendMessage",isSubprocess:Z,message:q,strict:Y})},$Y=async({anyProcess:$,channel:J,methodName:Z,isSubprocess:X,message:q,strict:Y})=>{let Q=k8({anyProcess:$,channel:J,isSubprocess:X,message:q,strict:Y}),G=u8($,Q,Y);try{await p2({anyProcess:$,methodName:Z,isSubprocess:X,wrappedMessage:Q,message:q})}catch(H){throw n1($),H}finally{m8(G)}},p2=async({anyProcess:$,methodName:J,isSubprocess:Z,wrappedMessage:X,message:q})=>{let Y=JY($);try{await Promise.all([y8(X,$,Z),Y(X)])}catch(Q){throw x8({error:Q,methodName:J,isSubprocess:Z}),P8({error:Q,methodName:J,isSubprocess:Z,message:q}),Q}},JY=($)=>{if(c2.has($))return c2.get($);let J=e9($.send.bind($));return c2.set($,J),J},c2=new WeakMap;var p8=($,J)=>{return y2("cancelSignal",!1,$.connected),p2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:l8,message:J},message:J})},d8=async({anyProcess:$,channel:J,isSubprocess:Z,ipc:X})=>{return await XY({anyProcess:$,channel:J,isSubprocess:Z,ipc:X}),d2.signal},XY=async({anyProcess:$,channel:J,isSubprocess:Z,ipc:X})=>{if(c8)return;if(c8=!0,!X){j8();return}if(J===null){m2();return}G1($,J,Z),await ZY.yield()},c8=!1,f8=($)=>{if($?.type!==l8)return!1;return d2.abort($.message),!0},l8="execa:ipc:cancel",m2=()=>{d2.abort(F8())},d2=new AbortController;var n8=({gracefulCancel:$,cancelSignal:J,ipc:Z,serialization:X})=>{if(!$)return;if(J===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!Z)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(X==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},i8=({subprocess:$,cancelSignal:J,gracefulCancel:Z,forceKillAfterDelay:X,context:q,controller:Y})=>Z?[QY({subprocess:$,cancelSignal:J,forceKillAfterDelay:X,context:q,controller:Y})]:[],QY=async({subprocess:$,cancelSignal:J,forceKillAfterDelay:Z,context:X,controller:{signal:q}})=>{await X4(J,q);let Y=qY(J);throw await p8($,Y),b2({kill:$.kill,forceKillAfterDelay:Z,context:X,controllerSignal:q}),X.terminationReason??="gracefulCancel",J.reason},qY=({reason:$})=>{if(!($ instanceof DOMException))return $;let J=Error($.message);return Object.defineProperty(J,"stack",{value:$.stack,enumerable:!1,configurable:!0,writable:!0}),J};import{setTimeout as YY}from"node:timers/promises";var o8=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},t8=($,J,Z,X)=>J===0||J===void 0?[]:[GY($,J,Z,X)],GY=async($,J,Z,{signal:X})=>{throw await YY(J,void 0,{signal:X}),Z.terminationReason??="timeout",$.kill(),new d0};import{execPath as HY,execArgv as zY}from"node:process";import a8 from"node:path";var r8=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},s8=($,J,{node:Z=!1,nodePath:X=HY,nodeOptions:q=zY.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=u1(X,'The "nodePath" option'),K=a8.resolve(Y,H),U={...G,nodePath:K,node:Z,cwd:Y};if(!Z)return[$,J,U];if(a8.basename($,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[K,[...q,$,...J],{ipc:!0,...U,shell:!1}]};import{serialize as KY}from"node:v8";var e8=({ipcInput:$,ipc:J,serialization:Z})=>{if($===void 0)return;if(!J)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");WY[Z]($)},BY=($)=>{try{KY($)}catch(J){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:J})}},UY=($)=>{try{JSON.stringify($)}catch(J){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:J})}},WY={advanced:BY,json:UY},$5=async($,J)=>{if(J===void 0)return;await $.sendMessage(J)};var Z5=({encoding:$})=>{if(l2.has($))return;let J=LY($);if(J!==void 0)throw TypeError(`Invalid option \`encoding: ${_4($)}\`.
|
|
26
|
+
Please rename it to ${_4(J)}.`);let Z=[...l2].map((X)=>_4(X)).join(", ");throw TypeError(`Invalid option \`encoding: ${_4($)}\`.
|
|
27
|
+
Please rename it to one of: ${Z}.`)},VY=new Set(["utf8","utf16le"]),j0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),l2=new Set([...VY,...j0]),LY=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let J=$.toLowerCase();if(J in J5)return J5[J];if(l2.has(J))return J},J5={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},_4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as _Y}from"node:fs";import RY from"node:path";import TY from"node:process";var X5=($=Q5())=>{let J=u1($,'The "cwd" option');return RY.resolve(J)},Q5=()=>{try{return TY.cwd()}catch($){throw $.message=`The current directory does not exist.
|
|
28
|
+
${$.message}`,$}},q5=($,J)=>{if(J===Q5())return $;let Z;try{Z=_Y(J)}catch(X){return`The "cwd" option is invalid: ${J}.
|
|
29
29
|
${X.message}
|
|
30
30
|
${$}`}if(!Z.isDirectory())return`The "cwd" option is not a directory: ${J}.
|
|
31
|
-
${$}`;return $};var
|
|
32
|
-
`,
|
|
33
|
-
${F}`,l=`${c}: ${G}${
|
|
34
|
-
`)].map((n)=>
|
|
31
|
+
${$}`;return $};var R4=($,J,Z)=>{Z.cwd=X5(Z.cwd);let[X,q,Y]=s8($,J,Z),{command:Q,args:G,options:H}=G5.default._parse(X,q,Y),K=i6(H),U=CY(K);if(o8(U),Z5(U),e8(U),L8(U),n8(U),U.shell=_2(U.shell),U.env=FY(U),U.killSignal=K8(U.killSignal),U.forceKillAfterDelay=W8(U.forceKillAfterDelay),U.lines=U.lines.map((B,W)=>B&&!j0.has(U.encoding)&&U.buffer[W]),Y5.platform==="win32"&&MY.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:U}},CY=({extendEnv:$=!0,preferLocal:J=!1,cwd:Z,localDir:X=Z,encoding:q="utf8",reject:Y=!0,cleanup:Q=!0,all:G=!1,windowsHide:H=!0,killSignal:K="SIGTERM",forceKillAfterDelay:U=!0,gracefulCancel:B=!1,ipcInput:W,ipc:_=W!==void 0||B,serialization:R="advanced",...L})=>({...L,extendEnv:$,preferLocal:J,cwd:Z,localDirectory:X,encoding:q,reject:Y,cleanup:Q,all:G,windowsHide:H,killSignal:K,forceKillAfterDelay:U,gracefulCancel:B,ipcInput:W,ipc:_,serialization:R}),FY=({env:$,extendEnv:J,preferLocal:Z,node:X,localDirectory:q,nodePath:Y})=>{let Q=J?{...Y5.env,...$}:$;if(Z||X)return $8({env:Q,cwd:q,execPath:Y,preferLocal:Z,addExecPath:X});return Q};var T4=($,J,Z)=>Z.shell&&J.length>0?[[$,...J].join(" "),[],Z]:[$,J,Z];import{inspect as JG}from"node:util";function o1($){if(typeof $==="string")return jY($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return xY($)}var jY=($)=>$.at(-1)===H5?$.slice(0,$.at(-2)===z5?-2:-1):$,xY=($)=>$.at(-1)===PY?$.subarray(0,$.at(-2)===IY?-2:-1):$,H5=`
|
|
32
|
+
`,PY=H5.codePointAt(0),z5="\r",IY=z5.codePointAt(0);import{on as rY}from"node:events";import{finished as sY}from"node:stream/promises";function u0($,{checkOpen:J=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!J||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function n2($,{checkOpen:J=!0}={}){return u0($,{checkOpen:J})&&($.writable||!J)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function C1($,{checkOpen:J=!0}={}){return u0($,{checkOpen:J})&&($.readable||!J)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function i2($,J){return n2($,J)&&C1($,J)}var OY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class K5{#J;#Z;#$=!1;#X=void 0;constructor($,J){this.#J=$,this.#Z=J}next(){let $=()=>this.#q();return this.#X=this.#X?this.#X.then($,$):$(),this.#X}return($){let J=()=>this.#Q($);return this.#X?this.#X.then(J,J):J()}async#q(){if(this.#$)return{done:!0,value:void 0};let $;try{$=await this.#J.read()}catch(J){throw this.#X=void 0,this.#$=!0,this.#J.releaseLock(),J}return $.done&&(this.#X=void 0,this.#$=!0,this.#J.releaseLock()),$}async#Q($){if(this.#$)return{done:!0,value:$};if(this.#$=!0,!this.#Z){let J=this.#J.cancel($);return this.#J.releaseLock(),await J,{done:!0,value:$}}return this.#J.releaseLock(),{done:!0,value:$}}}var o2=Symbol();function B5(){return this[o2].next()}Object.defineProperty(B5,"name",{value:"next"});function U5($){return this[o2].return($)}Object.defineProperty(U5,"name",{value:"return"});var wY=Object.create(OY,{next:{enumerable:!0,configurable:!0,writable:!0,value:B5},return:{enumerable:!0,configurable:!0,writable:!0,value:U5}});function t2({preventCancel:$=!1}={}){let J=this.getReader(),Z=new K5(J,$),X=Object.create(wY);return X[o2]=Z,X}var W5=($)=>{if(C1($,{checkOpen:!1})&&_$.on!==void 0)return AY($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(EY.call($)==="[object ReadableStream]")return t2.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:EY}=Object.prototype,AY=async function*($){let J=new AbortController,Z={};hY($,J,Z);try{for await(let[X]of _$.on($,"data",{signal:J.signal}))yield X}catch(X){if(Z.error!==void 0)throw Z.error;else if(!J.signal.aborted)throw X}finally{$.destroy()}},hY=async($,J,Z)=>{try{await _$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(X){Z.error=X}finally{J.abort()}},_$={};var t1=async($,{init:J,convertChunk:Z,getSize:X,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let K=W5($),U=J();U.length=0;try{for await(let B of K){let W=DY(B),_=Z[W](B,U);_5({convertedChunk:_,state:U,getSize:X,truncateChunk:q,addChunk:Y,maxBuffer:H})}return NY({state:U,convertChunk:Z,getSize:X,truncateChunk:q,addChunk:Y,getFinalChunk:Q,maxBuffer:H}),G(U)}catch(B){let W=typeof B==="object"&&B!==null?B:Error(B);throw W.bufferedData=G(U),W}},NY=({state:$,getSize:J,truncateChunk:Z,addChunk:X,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)_5({convertedChunk:Q,state:$,getSize:J,truncateChunk:Z,addChunk:X,maxBuffer:Y})},_5=({convertedChunk:$,state:J,getSize:Z,truncateChunk:X,addChunk:q,maxBuffer:Y})=>{let Q=Z($),G=J.length+Q;if(G<=Y){V5($,J,q,G);return}let H=X($,Y-J.length);if(H!==void 0)V5(H,J,q,Y);throw new J1},V5=($,J,Z,X)=>{J.contents=Z($,J,X),J.length=X},DY=($)=>{let J=typeof $;if(J==="string")return"string";if(J!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let Z=L5.call($);if(Z==="[object ArrayBuffer]")return"arrayBuffer";if(Z==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&L5.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:L5}=Object.prototype;class J1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var Z1=($)=>$,R$=()=>{return},M4=({contents:$})=>$,C4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},F4=($)=>$.length;async function j4($,J){return t1($,kY,J)}var vY=()=>({contents:[]}),SY=()=>1,fY=($,{contents:J})=>{return J.push($),J},kY={init:vY,convertChunk:{string:Z1,buffer:Z1,arrayBuffer:Z1,dataView:Z1,typedArray:Z1,others:Z1},getSize:SY,truncateChunk:R$,addChunk:fY,getFinalChunk:R$,finalize:M4};async function x4($,J){return t1($,lY,J)}var bY=()=>({contents:new ArrayBuffer(0)}),yY=($)=>gY.encode($),gY=new TextEncoder,R5=($)=>new Uint8Array($),T5=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),uY=($,J)=>$.slice(0,J),mY=($,{contents:J,length:Z},X)=>{let q=F5()?pY(J,X):cY(J,X);return new Uint8Array(q).set($,Z),q},cY=($,J)=>{if(J<=$.byteLength)return $;let Z=new ArrayBuffer(C5(J));return new Uint8Array(Z).set(new Uint8Array($),0),Z},pY=($,J)=>{if(J<=$.maxByteLength)return $.resize(J),$;let Z=new ArrayBuffer(J,{maxByteLength:C5(J)});return new Uint8Array(Z).set(new Uint8Array($),0),Z},C5=($)=>M5**Math.ceil(Math.log($)/Math.log(M5)),M5=2,dY=({contents:$,length:J})=>F5()?$:$.slice(0,J),F5=()=>("resize"in ArrayBuffer.prototype),lY={init:bY,convertChunk:{string:yY,buffer:R5,arrayBuffer:R5,dataView:T5,typedArray:T5,others:C4},getSize:F4,truncateChunk:uY,addChunk:mY,getFinalChunk:R$,finalize:dY};async function I4($,J){return t1($,aY,J)}var nY=()=>({contents:"",textDecoder:new TextDecoder}),P4=($,{textDecoder:J})=>J.decode($,{stream:!0}),iY=($,{contents:J})=>J+$,oY=($,J)=>$.slice(0,J),tY=({textDecoder:$})=>{let J=$.decode();return J===""?void 0:J},aY={init:nY,convertChunk:{string:Z1,buffer:P4,arrayBuffer:P4,dataView:P4,typedArray:P4,others:C4},getSize:F4,truncateChunk:oY,addChunk:iY,getFinalChunk:tY,finalize:M4};Object.assign(_$,{on:rY,finished:sY});var j5=({error:$,stream:J,readableObjectMode:Z,lines:X,encoding:q,fdNumber:Y})=>{if(!($ instanceof J1))throw $;if(Y==="all")return $;let Q=eY(Z,X,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},J.destroy(),$},eY=($,J,Z)=>{if($)return"objects";if(J)return"lines";if(Z==="buffer")return"bytes";return"characters"},x5=($,J,Z)=>{if(J.length!==Z)return;let X=new J1;throw X.maxBufferInfo={fdNumber:"ipc"},X},P5=($,J)=>{let{streamName:Z,threshold:X,unit:q}=$G($,J);return`Command's ${Z} was larger than ${X} ${q}`},$G=($,J)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:J[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:Z,unit:X}}=$;delete $.maxBufferInfo;let q=$1(J,Z);if(Z==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:u$(Z),threshold:q,unit:X}},I5=($,J,Z)=>$?.code==="ENOBUFS"&&J!==null&&J.some((X)=>X!==null&&X.length>O4(Z)),O5=($,J,Z)=>{if(!J)return $;let X=O4(Z);return $.length>X?$.slice(0,X):$},O4=([,$])=>$;var E5=({stdio:$,all:J,ipcOutput:Z,originalError:X,signal:q,signalDescription:Y,exitCode:Q,escapedCommand:G,timedOut:H,isCanceled:K,isGracefullyCanceled:U,isMaxBuffer:B,isForcefullyTerminated:W,forceKillAfterDelay:_,killSignal:R,maxBuffer:L,timeout:P,cwd:x})=>{let N=X?.code,c=ZG({originalError:X,timedOut:H,timeout:P,isMaxBuffer:B,maxBuffer:L,errorCode:N,signal:q,signalDescription:Y,exitCode:Q,isCanceled:K,isGracefullyCanceled:U,isForcefullyTerminated:W,forceKillAfterDelay:_,killSignal:R}),F=QG(X,x),k=F===void 0?"":`
|
|
33
|
+
${F}`,l=`${c}: ${G}${k}`,t=J===void 0?[$[2],$[1]]:[J],T0=[l,...t,...$.slice(3),Z.map((n)=>qG(n)).join(`
|
|
34
|
+
`)].map((n)=>U$(o1(YG(n)))).filter(Boolean).join(`
|
|
35
35
|
|
|
36
|
-
`);return{originalMessage:F,shortMessage:l,message:
|
|
37
|
-
`):F5($),F5=($)=>{if(typeof $==="string")return $;if(K0($))return D$($);return""};var F4=({command:$,escapedCommand:J,stdio:Z,all:X,ipcOutput:q,options:{cwd:Y},startTime:Q})=>j5({command:$,escapedCommand:J,cwd:Y,durationMs:C2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:Z[1],stderr:Z[2],all:X,stdio:Z,ipcOutput:q,pipedFrom:[]}),t1=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:Q})=>W$({error:$,command:J,escapedCommand:Z,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:X.length}),ipcOutput:[],options:q,isSync:Q}),W$=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,stdio:B,all:W,ipcOutput:_,options:{timeoutDuration:R,timeout:L=R,forceKillAfterDelay:x,killSignal:j,cwd:h,maxBuffer:c},isSync:F})=>{let{exitCode:y,signal:l,signalDescription:t}=XG(K,U),{originalMessage:_0,shortMessage:n,message:a0}=P5({stdio:B,all:W,ipcOutput:_,originalError:$,signal:l,signalDescription:t,exitCode:y,escapedCommand:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:x,killSignal:j,maxBuffer:c,timeout:L,cwd:h}),O=t7($,a0,F);return Object.assign(O,ZG({error:O,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:y,signal:l,signalDescription:t,stdio:B,all:W,ipcOutput:_,cwd:h,originalMessage:_0,shortMessage:n})),O},ZG=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,signalDescription:B,stdio:W,all:_,ipcOutput:R,cwd:L,originalMessage:x,shortMessage:j})=>j5({shortMessage:j,originalMessage:x,command:J,escapedCommand:Z,cwd:L,durationMs:C2(X),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:U!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,signalDescription:B,code:$.cause?.code,stdout:W[1],stderr:W[2],all:_,stdio:W,ipcOutput:R,pipedFrom:[]}),j5=($)=>Object.fromEntries(Object.entries($).filter(([,J])=>J!==void 0)),XG=($,J)=>{let Z=$===null?void 0:$,X=J===null?void 0:J,q=X===void 0?void 0:a$(J);return{exitCode:Z,signal:X,signalDescription:q}};var x5=($)=>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(x5($*1000)%1000),nanoseconds:Math.trunc(x5($*1e6)%1000)}}function qG($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function n2($){switch(typeof $){case"number":{if(Number.isFinite($))return QG($);break}case"bigint":return qG($)}throw TypeError("Expected a finite number or bigint")}var YG=($)=>$===0||$===0n,GG=($,J)=>J===1||J===1n?$:`${$}s`,HG=0.0000001,zG=24n*60n*60n*1000n;function i2($,J){let Z=typeof $==="bigint";if(!Z&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");J={...J};let X=$<0?"-":"";if($=$<0?-$:$,J.colonNotation)J.compact=!1,J.formatSubMilliseconds=!1,J.separateMilliseconds=!1,J.verbose=!1;if(J.compact)J.unitCount=1,J.secondsDecimalDigits=0,J.millisecondsDecimalDigits=0;let q=[],Y=(U,B)=>{let W=Math.floor(U*10**B+HG);return(Math.round(W)/10**B).toFixed(B)},Q=(U,B,W,_)=>{if((q.length===0||!J.colonNotation)&&YG(U)&&!(J.colonNotation&&W==="m"))return;if(_??=String(U),J.colonNotation){let R=_.includes(".")?_.split(".")[0].length:_.length,L=q.length>0?2:1;_="0".repeat(Math.max(0,L-R))+_}else _+=J.verbose?" "+GG(B,U):W;q.push(_)},G=n2($),H=BigInt(G.days);if(J.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(J.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"),!J.hideSeconds)if(J.separateMilliseconds||J.formatSubMilliseconds||!J.colonNotation&&$<1000&&!J.subSecondsAsDecimals){let U=Number(G.seconds),B=Number(G.milliseconds),W=Number(G.microseconds),_=Number(G.nanoseconds);if(Q(U,"second","s"),J.formatSubMilliseconds)Q(B,"millisecond","ms"),Q(W,"microsecond","µs"),Q(_,"nanosecond","ns");else{let R=B+W/1000+_/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,x=R>=1?Math.round(R):Math.ceil(R),j=L?R.toFixed(L):x;Q(Number.parseFloat(j),"millisecond","ms",j)}}else{let U=(Z?Number($%zG):$)/1000%60,B=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,W=Y(U,B),_=J.keepDecimalsOnWholeSeconds?W:W.replace(/\.0+$/,"");Q(Number.parseFloat(_),"second","s",_)}if(q.length===0)return X+"0"+(J.verbose?" milliseconds":"ms");let K=J.colonNotation?":":" ";if(typeof J.unitCount==="number")q=q.slice(0,Math.max(J.unitCount,1));return X+q.join(K)}var I5=($,J)=>{if($.failed)m0({type:"error",verboseMessage:$.shortMessage,verboseInfo:J,result:$})};var w5=($,J)=>{if(!u1(J))return;I5($,J),KG($,J)},KG=($,J)=>{let Z=`(done in ${i2($.durationMs)})`;m0({type:"duration",verboseMessage:Z,verboseInfo:J,result:$})};var a1=($,J,{reject:Z})=>{if(w5($,J),$.failed&&Z)throw $;return $};import{readFileSync as e5}from"node:fs";var A5=($,J)=>{if(M1($))return"asyncGenerator";if(D5($))return"generator";if(P4($))return"fileUrl";if(LG($))return"filePath";if(TG($))return"webStream";if(b0($,{checkOpen:!1}))return"native";if(K0($))return"uint8Array";if(MG($))return"asyncIterable";if(CG($))return"iterable";if(a2($))return h5({transform:$},J);if(VG($))return BG($,J);return"native"},BG=($,J)=>{if(p2($.transform,{checkOpen:!1}))return UG($,J);if(a2($.transform))return h5($,J);return WG($,J)},UG=($,J)=>{return N5($,J,"Duplex stream"),"duplex"},h5=($,J)=>{return N5($,J,"web TransformStream"),"webTransform"},N5=({final:$,binary:J,objectMode:Z},X,q)=>{O5($,`${X}.final`,q),O5(J,`${X}.binary`,q),o2(Z,`${X}.objectMode`)},O5=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${Z}.`)},WG=({transform:$,final:J,binary:Z,objectMode:X},q)=>{if($!==void 0&&!E5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(p2(J,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if(a2(J))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!E5(J))throw TypeError(`The \`${q}.final\` option must be a generator.`);return o2(Z,`${q}.binary`),o2(X,`${q}.objectMode`),M1($)||M1(J)?"asyncGenerator":"generator"},o2=($,J)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},E5=($)=>M1($)||D5($),M1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",D5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",VG=($)=>X0($)&&($.transform!==void 0||$.final!==void 0),P4=($)=>Object.prototype.toString.call($)==="[object URL]",S5=($)=>P4($)&&$.protocol!=="file:",LG=($)=>X0($)&&Object.keys($).length>0&&Object.keys($).every((J)=>_G.has(J))&&t2($.file),_G=new Set(["file","append"]),t2=($)=>typeof $==="string",v5=($,J)=>$==="native"&&typeof J==="string"&&!RG.has(J),RG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),f5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",j4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",TG=($)=>f5($)||j4($),a2=($)=>f5($?.readable)&&j4($?.writable),MG=($)=>k5($)&&typeof $[Symbol.asyncIterator]==="function",CG=($)=>k5($)&&typeof $[Symbol.iterator]==="function",k5=($)=>typeof $==="object"&&$!==null,E0=new Set(["generator","asyncGenerator","duplex","webTransform"]),x4=new Set(["fileUrl","filePath","fileNumber"]),r2=new Set(["fileUrl","filePath"]),b5=new Set([...r2,"webStream","nodeStream"]),y5=new Set(["webTransform","duplex"]),G1={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 s2=($,J,Z,X)=>X==="output"?FG($,J,Z):PG($,J,Z),FG=($,J,Z)=>{let X=J!==0&&Z[J-1].value.readableObjectMode;return{writableObjectMode:X,readableObjectMode:$??X}},PG=($,J,Z)=>{let X=J===0?$===!0:Z[J-1].value.readableObjectMode,q=J!==Z.length-1&&($??X);return{writableObjectMode:X,readableObjectMode:q}},g5=($,J)=>{let Z=$.findLast(({type:X})=>E0.has(X));if(Z===void 0)return!1;return J==="input"?Z.value.writableObjectMode:Z.value.readableObjectMode};var u5=($,J,Z,X)=>[...$.filter(({type:q})=>!E0.has(q)),...jG($,J,Z,X)],jG=($,J,Z,{encoding:X})=>{let q=$.filter(({type:Q})=>E0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=xG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:J,direction:Z,encoding:X});return EG(Y,Z)},xG=({stdioItem:$,stdioItem:{type:J},index:Z,newTransforms:X,optionName:q,direction:Y,encoding:Q})=>{if(J==="duplex")return IG({stdioItem:$,optionName:q});if(J==="webTransform")return wG({stdioItem:$,index:Z,newTransforms:X,direction:Y});return OG({stdioItem:$,index:Z,newTransforms:X,direction:Y,encoding:Q})},IG=({stdioItem:$,stdioItem:{value:{transform:J,transform:{writableObjectMode:Z,readableObjectMode:X},objectMode:q=X}},optionName:Y})=>{if(q&&!X)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&X)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:J,writableObjectMode:Z,readableObjectMode:X}}},wG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q})=>{let{transform:Y,objectMode:Q}=X0(J)?J:{transform:J},{writableObjectMode:G,readableObjectMode:H}=s2(Q,Z,X,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},OG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:K=!1,objectMode:U}=X0(J)?J:{transform:J},B=H||F0.has(Y),{writableObjectMode:W,readableObjectMode:_}=s2(U,Z,X,q);return{...$,value:{transform:Q,final:G,binary:B,preserveNewlines:K,writableObjectMode:W,readableObjectMode:_}}},EG=($,J)=>J==="input"?$.reverse():$;import e2 from"node:process";var m5=($,J,Z)=>{let X=$.map((q)=>AG(q,J));if(X.includes("input")&&X.includes("output"))throw TypeError(`The \`${Z}\` option must not be an array of both readable and writable values.`);return X.find(Boolean)??DG},AG=({type:$,value:J},Z)=>hG[Z]??c5[$](J),hG=["input","output","output"],r1=()=>{return},$3=()=>"input",c5={generator:r1,asyncGenerator:r1,fileUrl:r1,filePath:r1,iterable:$3,asyncIterable:$3,uint8Array:$3,webStream:($)=>j4($)?"output":"input",nodeStream($){if(!T1($,{checkOpen:!1}))return"output";return c2($,{checkOpen:!1})?void 0:"input"},webTransform:r1,duplex:r1,native($){let J=NG($);if(J!==void 0)return J;if(b0($,{checkOpen:!1}))return c5.nodeStream($)}},NG=($)=>{if([0,e2.stdin].includes($))return"input";if([1,2,e2.stdout,e2.stderr].includes($))return"output"},DG="output";var p5=($,J)=>J&&!$.includes("ipc")?[...$,"ipc"]:$;var d5=({stdio:$,ipc:J,buffer:Z,...X},q,Y)=>{let Q=SG($,X).map((G,H)=>l5(G,H));return Y?fG(Q,Z,q):p5(Q,J)},SG=($,J)=>{if($===void 0)return O0.map((X)=>J[X]);if(vG(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${O0.map((X)=>`\`${X}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let Z=Math.max($.length,O0.length);return Array.from({length:Z},(X,q)=>$[q])},vG=($)=>O0.some((J)=>$[J]!==void 0),l5=($,J)=>{if(Array.isArray($))return $.map((Z)=>l5(Z,J));if($===null||$===void 0)return J>=O0.length?"ignore":"pipe";return $},fG=($,J,Z)=>$.map((X,q)=>!J[q]&&q!==0&&!m1(Z,q)&&kG(X)?"ignore":X),kG=($)=>$==="pipe"||Array.isArray($)&&$.every((J)=>J==="pipe");import{readFileSync as bG}from"node:fs";import yG from"node:tty";var i5=({stdioItem:$,stdioItem:{type:J},isStdioArray:Z,fdNumber:X,direction:q,isSync:Y})=>{if(!Z||J!=="native")return $;return Y?gG({stdioItem:$,fdNumber:X,direction:q}):cG({stdioItem:$,fdNumber:X})},gG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X,direction:q})=>{let Y=uG({value:J,optionName:Z,fdNumber:X,direction:q});if(Y!==void 0)return Y;if(b0(J,{checkOpen:!1}))throw TypeError(`The \`${Z}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},uG=({value:$,optionName:J,fdNumber:Z,direction:X})=>{let q=mG($,Z);if(q===void 0)return;if(X==="output")return{type:"fileNumber",value:q,optionName:J};if(yG.isatty(q))throw TypeError(`The \`${J}: ${e$($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:s0(bG(q)),optionName:J}},mG=($,J)=>{if($==="inherit")return J;if(typeof $==="number")return $;let Z=S$.indexOf($);if(Z!==-1)return Z},cG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X})=>{if(J==="inherit")return{type:"nodeStream",value:n5(X,J,Z),optionName:Z};if(typeof J==="number")return{type:"nodeStream",value:n5(J,J,Z),optionName:Z};if(b0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:Z};return $},n5=($,J,Z)=>{let X=S$[$];if(X===void 0)throw TypeError(`The \`${Z}: ${J}\` option is invalid: no such standard stream.`);return X};var o5=({input:$,inputFile:J},Z)=>Z===0?[...pG($),...lG(J)]:[],pG=($)=>$===void 0?[]:[{type:dG($),value:$,optionName:"input"}],dG=($)=>{if(T1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(K0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lG=($)=>$===void 0?[]:[{...nG($),optionName:"inputFile"}],nG=($)=>{if(P4($))return{type:"fileUrl",value:$};if(t2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var t5=($)=>$.filter((J,Z)=>$.every((X,q)=>J.value!==X.value||Z>=q||J.type==="generator"||J.type==="asyncGenerator")),a5=({stdioItem:{type:$,value:J,optionName:Z},direction:X,fileDescriptors:q,isSync:Y})=>{let Q=iG(q,$);if(Q.length===0)return;if(Y){oG({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});return}if(b5.has($))return r5({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});if(y5.has($))aG({otherStdioItems:Q,type:$,value:J,optionName:Z})},iG=($,J)=>$.flatMap(({direction:Z,stdioItems:X})=>X.filter((q)=>q.type===J).map((q)=>({...q,direction:Z}))),oG=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{if(r2.has(J))r5({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})},r5=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{let Y=$.filter((G)=>tG(G,Z));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return s5(Q,X,J),q==="output"?Y[0].stream:void 0},tG=({type:$,value:J},Z)=>{if($==="filePath")return J.file===Z.file;if($==="fileUrl")return J.href===Z.href;return J===Z},aG=({otherStdioItems:$,type:J,value:Z,optionName:X})=>{let q=$.find(({value:{transform:Y}})=>Y===Z.transform);s5(q,X,J)},s5=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${J}\` options must not target ${G1[Z]} that is the same.`)};var I4=($,J,Z,X)=>{let Y=d5(J,Z,X).map((G,H)=>rG({stdioOption:G,fdNumber:H,options:J,isSync:X})),Q=qH({initialFileDescriptors:Y,addProperties:$,options:J,isSync:X});return J.stdio=Q.map(({stdioItems:G})=>HH(G)),Q},rG=({stdioOption:$,fdNumber:J,options:Z,isSync:X})=>{let q=v$(J),{stdioItems:Y,isStdioArray:Q}=sG({stdioOption:$,fdNumber:J,options:Z,optionName:q}),G=m5(Y,J,q),H=Y.map((B)=>i5({stdioItem:B,isStdioArray:Q,fdNumber:J,direction:G,isSync:X})),K=u5(H,q,G,Z),U=g5(K,G);return QH(K,U),{direction:G,objectMode:U,stdioItems:K}},sG=({stdioOption:$,fdNumber:J,options:Z,optionName:X})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>eG(H,X)),...o5(Z,J)],Q=t5(Y),G=Q.length>1;return $H(Q,G,X),ZH(Q),{stdioItems:Q,isStdioArray:G}},eG=($,J)=>({type:A5($,J),value:$,optionName:J}),$H=($,J,Z)=>{if($.length===0)throw TypeError(`The \`${Z}\` option must not be an empty array.`);if(!J)return;for(let{value:X,optionName:q}of $)if(JH.has(X))throw Error(`The \`${q}\` option must not include \`${X}\`.`)},JH=new Set(["ignore","ipc"]),ZH=($)=>{for(let J of $)XH(J)},XH=({type:$,value:J,optionName:Z})=>{if(S5(J))throw TypeError(`The \`${Z}: URL\` option must use the \`file:\` scheme.
|
|
38
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(
|
|
39
|
-
`){let Q=
|
|
36
|
+
`);return{originalMessage:F,shortMessage:l,message:T0}},ZG=({originalError:$,timedOut:J,timeout:Z,isMaxBuffer:X,maxBuffer:q,errorCode:Y,signal:Q,signalDescription:G,exitCode:H,isCanceled:K,isGracefullyCanceled:U,isForcefullyTerminated:B,forceKillAfterDelay:W,killSignal:_})=>{let R=XG(B,W);if(J)return`Command timed out after ${Z} milliseconds${R}`;if(U){if(Q===void 0)return`Command was gracefully canceled with exit code ${H}`;return B?`Command was gracefully canceled${R}`:`Command was gracefully canceled with ${Q} (${G})`}if(K)return`Command was canceled${R}`;if(X)return`${P5($,q)}${R}`;if(Y!==void 0)return`Command failed with ${Y}${R}`;if(B)return`Command was killed with ${_} (${Z4(_)})${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=($,J)=>$?` and was forcefully terminated after ${J} milliseconds`:"",QG=($,J)=>{if($ instanceof d0)return;let Z=X8($)?$.originalMessage:String($?.message??$),X=U$(q5(Z,J));return X===""?void 0:X},qG=($)=>typeof $==="string"?$:JG($),YG=($)=>Array.isArray($)?$.map((J)=>o1(w5(J))).filter(Boolean).join(`
|
|
37
|
+
`):w5($),w5=($)=>{if(typeof $==="string")return $;if(B0($))return y$($);return""};var w4=({command:$,escapedCommand:J,stdio:Z,all:X,ipcOutput:q,options:{cwd:Y},startTime:Q})=>A5({command:$,escapedCommand:J,cwd:Y,durationMs:P2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:Z[1],stderr:Z[2],all:X,stdio:Z,ipcOutput:q,pipedFrom:[]}),a1=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:Q})=>T$({error:$,command:J,escapedCommand:Z,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:X.length}),ipcOutput:[],options:q,isSync:Q}),T$=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,stdio:B,all:W,ipcOutput:_,options:{timeoutDuration:R,timeout:L=R,forceKillAfterDelay:P,killSignal:x,cwd:N,maxBuffer:c},isSync:F})=>{let{exitCode:k,signal:l,signalDescription:t}=HG(K,U),{originalMessage:T0,shortMessage:n,message:r0}=E5({stdio:B,all:W,ipcOutput:_,originalError:$,signal:l,signalDescription:t,exitCode:k,escapedCommand:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:P,killSignal:x,maxBuffer:c,timeout:L,cwd:N}),E=J8($,r0,F);return Object.assign(E,GG({error:E,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:k,signal:l,signalDescription:t,stdio:B,all:W,ipcOutput:_,cwd:N,originalMessage:T0,shortMessage:n})),E},GG=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,signalDescription:B,stdio:W,all:_,ipcOutput:R,cwd:L,originalMessage:P,shortMessage:x})=>A5({shortMessage:x,originalMessage:P,command:J,escapedCommand:Z,cwd:L,durationMs:P2(X),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:U!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,signalDescription:B,code:$.cause?.code,stdout:W[1],stderr:W[2],all:_,stdio:W,ipcOutput:R,pipedFrom:[]}),A5=($)=>Object.fromEntries(Object.entries($).filter(([,J])=>J!==void 0)),HG=($,J)=>{let Z=$===null?void 0:$,X=J===null?void 0:J,q=X===void 0?void 0:Z4(J);return{exitCode:Z,signal:X,signalDescription:q}};var h5=($)=>Number.isFinite($)?$:0;function zG($){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(h5($*1000)%1000),nanoseconds:Math.trunc(h5($*1e6)%1000)}}function KG($){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 zG($);break}case"bigint":return KG($)}throw TypeError("Expected a finite number or bigint")}var BG=($)=>$===0||$===0n,UG=($,J)=>J===1||J===1n?$:`${$}s`,WG=0.0000001,VG=24n*60n*60n*1000n;function r2($,J){let Z=typeof $==="bigint";if(!Z&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");J={...J};let X=$<0?"-":"";if($=$<0?-$:$,J.colonNotation)J.compact=!1,J.formatSubMilliseconds=!1,J.separateMilliseconds=!1,J.verbose=!1;if(J.compact)J.unitCount=1,J.secondsDecimalDigits=0,J.millisecondsDecimalDigits=0;let q=[],Y=(U,B)=>{let W=Math.floor(U*10**B+WG);return(Math.round(W)/10**B).toFixed(B)},Q=(U,B,W,_)=>{if((q.length===0||!J.colonNotation)&&BG(U)&&!(J.colonNotation&&W==="m"))return;if(_??=String(U),J.colonNotation){let R=_.includes(".")?_.split(".")[0].length:_.length,L=q.length>0?2:1;_="0".repeat(Math.max(0,L-R))+_}else _+=J.verbose?" "+UG(B,U):W;q.push(_)},G=a2($),H=BigInt(G.days);if(J.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(J.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"),!J.hideSeconds)if(J.separateMilliseconds||J.formatSubMilliseconds||!J.colonNotation&&$<1000&&!J.subSecondsAsDecimals){let U=Number(G.seconds),B=Number(G.milliseconds),W=Number(G.microseconds),_=Number(G.nanoseconds);if(Q(U,"second","s"),J.formatSubMilliseconds)Q(B,"millisecond","ms"),Q(W,"microsecond","µs"),Q(_,"nanosecond","ns");else{let R=B+W/1000+_/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,P=R>=1?Math.round(R):Math.ceil(R),x=L?R.toFixed(L):P;Q(Number.parseFloat(x),"millisecond","ms",x)}}else{let U=(Z?Number($%VG):$)/1000%60,B=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,W=Y(U,B),_=J.keepDecimalsOnWholeSeconds?W:W.replace(/\.0+$/,"");Q(Number.parseFloat(_),"second","s",_)}if(q.length===0)return X+"0"+(J.verbose?" milliseconds":"ms");let K=J.colonNotation?":":" ";if(typeof J.unitCount==="number")q=q.slice(0,Math.max(J.unitCount,1));return X+q.join(K)}var N5=($,J)=>{if($.failed)p0({type:"error",verboseMessage:$.shortMessage,verboseInfo:J,result:$})};var D5=($,J)=>{if(!m1(J))return;N5($,J),LG($,J)},LG=($,J)=>{let Z=`(done in ${r2($.durationMs)})`;p0({type:"duration",verboseMessage:Z,verboseInfo:J,result:$})};var r1=($,J,{reject:Z})=>{if(D5($,J),$.failed&&Z)throw $;return $};import{readFileSync as qJ}from"node:fs";var f5=($,J)=>{if(F1($))return"asyncGenerator";if(y5($))return"generator";if(E4($))return"fileUrl";if(CG($))return"filePath";if(xG($))return"webStream";if(u0($,{checkOpen:!1}))return"native";if(B0($))return"uint8Array";if(PG($))return"asyncIterable";if(IG($))return"iterable";if($3($))return k5({transform:$},J);if(MG($))return _G($,J);return"native"},_G=($,J)=>{if(i2($.transform,{checkOpen:!1}))return RG($,J);if($3($.transform))return k5($,J);return TG($,J)},RG=($,J)=>{return b5($,J,"Duplex stream"),"duplex"},k5=($,J)=>{return b5($,J,"web TransformStream"),"webTransform"},b5=({final:$,binary:J,objectMode:Z},X,q)=>{v5($,`${X}.final`,q),v5(J,`${X}.binary`,q),s2(Z,`${X}.objectMode`)},v5=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${Z}.`)},TG=({transform:$,final:J,binary:Z,objectMode:X},q)=>{if($!==void 0&&!S5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(i2(J,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if($3(J))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!S5(J))throw TypeError(`The \`${q}.final\` option must be a generator.`);return s2(Z,`${q}.binary`),s2(X,`${q}.objectMode`),F1($)||F1(J)?"asyncGenerator":"generator"},s2=($,J)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},S5=($)=>F1($)||y5($),F1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",y5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",MG=($)=>Q0($)&&($.transform!==void 0||$.final!==void 0),E4=($)=>Object.prototype.toString.call($)==="[object URL]",g5=($)=>E4($)&&$.protocol!=="file:",CG=($)=>Q0($)&&Object.keys($).length>0&&Object.keys($).every((J)=>FG.has(J))&&e2($.file),FG=new Set(["file","append"]),e2=($)=>typeof $==="string",u5=($,J)=>$==="native"&&typeof J==="string"&&!jG.has(J),jG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),m5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",A4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",xG=($)=>m5($)||A4($),$3=($)=>m5($?.readable)&&A4($?.writable),PG=($)=>c5($)&&typeof $[Symbol.asyncIterator]==="function",IG=($)=>c5($)&&typeof $[Symbol.iterator]==="function",c5=($)=>typeof $==="object"&&$!==null,N0=new Set(["generator","asyncGenerator","duplex","webTransform"]),h4=new Set(["fileUrl","filePath","fileNumber"]),J3=new Set(["fileUrl","filePath"]),p5=new Set([...J3,"webStream","nodeStream"]),d5=new Set(["webTransform","duplex"]),H1={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 Z3=($,J,Z,X)=>X==="output"?OG($,J,Z):wG($,J,Z),OG=($,J,Z)=>{let X=J!==0&&Z[J-1].value.readableObjectMode;return{writableObjectMode:X,readableObjectMode:$??X}},wG=($,J,Z)=>{let X=J===0?$===!0:Z[J-1].value.readableObjectMode,q=J!==Z.length-1&&($??X);return{writableObjectMode:X,readableObjectMode:q}},l5=($,J)=>{let Z=$.findLast(({type:X})=>N0.has(X));if(Z===void 0)return!1;return J==="input"?Z.value.writableObjectMode:Z.value.readableObjectMode};var n5=($,J,Z,X)=>[...$.filter(({type:q})=>!N0.has(q)),...EG($,J,Z,X)],EG=($,J,Z,{encoding:X})=>{let q=$.filter(({type:Q})=>N0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=AG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:J,direction:Z,encoding:X});return vG(Y,Z)},AG=({stdioItem:$,stdioItem:{type:J},index:Z,newTransforms:X,optionName:q,direction:Y,encoding:Q})=>{if(J==="duplex")return hG({stdioItem:$,optionName:q});if(J==="webTransform")return NG({stdioItem:$,index:Z,newTransforms:X,direction:Y});return DG({stdioItem:$,index:Z,newTransforms:X,direction:Y,encoding:Q})},hG=({stdioItem:$,stdioItem:{value:{transform:J,transform:{writableObjectMode:Z,readableObjectMode:X},objectMode:q=X}},optionName:Y})=>{if(q&&!X)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&X)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:J,writableObjectMode:Z,readableObjectMode:X}}},NG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q})=>{let{transform:Y,objectMode:Q}=Q0(J)?J:{transform:J},{writableObjectMode:G,readableObjectMode:H}=Z3(Q,Z,X,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},DG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:K=!1,objectMode:U}=Q0(J)?J:{transform:J},B=H||j0.has(Y),{writableObjectMode:W,readableObjectMode:_}=Z3(U,Z,X,q);return{...$,value:{transform:Q,final:G,binary:B,preserveNewlines:K,writableObjectMode:W,readableObjectMode:_}}},vG=($,J)=>J==="input"?$.reverse():$;import X3 from"node:process";var i5=($,J,Z)=>{let X=$.map((q)=>SG(q,J));if(X.includes("input")&&X.includes("output"))throw TypeError(`The \`${Z}\` option must not be an array of both readable and writable values.`);return X.find(Boolean)??bG},SG=({type:$,value:J},Z)=>fG[Z]??o5[$](J),fG=["input","output","output"],s1=()=>{return},Q3=()=>"input",o5={generator:s1,asyncGenerator:s1,fileUrl:s1,filePath:s1,iterable:Q3,asyncIterable:Q3,uint8Array:Q3,webStream:($)=>A4($)?"output":"input",nodeStream($){if(!C1($,{checkOpen:!1}))return"output";return n2($,{checkOpen:!1})?void 0:"input"},webTransform:s1,duplex:s1,native($){let J=kG($);if(J!==void 0)return J;if(u0($,{checkOpen:!1}))return o5.nodeStream($)}},kG=($)=>{if([0,X3.stdin].includes($))return"input";if([1,2,X3.stdout,X3.stderr].includes($))return"output"},bG="output";var t5=($,J)=>J&&!$.includes("ipc")?[...$,"ipc"]:$;var a5=({stdio:$,ipc:J,buffer:Z,...X},q,Y)=>{let Q=yG($,X).map((G,H)=>r5(G,H));return Y?uG(Q,Z,q):t5(Q,J)},yG=($,J)=>{if($===void 0)return h0.map((X)=>J[X]);if(gG(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${h0.map((X)=>`\`${X}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let Z=Math.max($.length,h0.length);return Array.from({length:Z},(X,q)=>$[q])},gG=($)=>h0.some((J)=>$[J]!==void 0),r5=($,J)=>{if(Array.isArray($))return $.map((Z)=>r5(Z,J));if($===null||$===void 0)return J>=h0.length?"ignore":"pipe";return $},uG=($,J,Z)=>$.map((X,q)=>!J[q]&&q!==0&&!c1(Z,q)&&mG(X)?"ignore":X),mG=($)=>$==="pipe"||Array.isArray($)&&$.every((J)=>J==="pipe");import{readFileSync as cG}from"node:fs";import pG from"node:tty";var e5=({stdioItem:$,stdioItem:{type:J},isStdioArray:Z,fdNumber:X,direction:q,isSync:Y})=>{if(!Z||J!=="native")return $;return Y?dG({stdioItem:$,fdNumber:X,direction:q}):iG({stdioItem:$,fdNumber:X})},dG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X,direction:q})=>{let Y=lG({value:J,optionName:Z,fdNumber:X,direction:q});if(Y!==void 0)return Y;if(u0(J,{checkOpen:!1}))throw TypeError(`The \`${Z}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},lG=({value:$,optionName:J,fdNumber:Z,direction:X})=>{let q=nG($,Z);if(q===void 0)return;if(X==="output")return{type:"fileNumber",value:q,optionName:J};if(pG.isatty(q))throw TypeError(`The \`${J}: ${q4($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:e0(cG(q)),optionName:J}},nG=($,J)=>{if($==="inherit")return J;if(typeof $==="number")return $;let Z=g$.indexOf($);if(Z!==-1)return Z},iG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X})=>{if(J==="inherit")return{type:"nodeStream",value:s5(X,J,Z),optionName:Z};if(typeof J==="number")return{type:"nodeStream",value:s5(J,J,Z),optionName:Z};if(u0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:Z};return $},s5=($,J,Z)=>{let X=g$[$];if(X===void 0)throw TypeError(`The \`${Z}: ${J}\` option is invalid: no such standard stream.`);return X};var $J=({input:$,inputFile:J},Z)=>Z===0?[...oG($),...aG(J)]:[],oG=($)=>$===void 0?[]:[{type:tG($),value:$,optionName:"input"}],tG=($)=>{if(C1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(B0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},aG=($)=>$===void 0?[]:[{...rG($),optionName:"inputFile"}],rG=($)=>{if(E4($))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 JJ=($)=>$.filter((J,Z)=>$.every((X,q)=>J.value!==X.value||Z>=q||J.type==="generator"||J.type==="asyncGenerator")),ZJ=({stdioItem:{type:$,value:J,optionName:Z},direction:X,fileDescriptors:q,isSync:Y})=>{let Q=sG(q,$);if(Q.length===0)return;if(Y){eG({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});return}if(p5.has($))return XJ({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});if(d5.has($))JH({otherStdioItems:Q,type:$,value:J,optionName:Z})},sG=($,J)=>$.flatMap(({direction:Z,stdioItems:X})=>X.filter((q)=>q.type===J).map((q)=>({...q,direction:Z}))),eG=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{if(J3.has(J))XJ({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})},XJ=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{let Y=$.filter((G)=>$H(G,Z));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return QJ(Q,X,J),q==="output"?Y[0].stream:void 0},$H=({type:$,value:J},Z)=>{if($==="filePath")return J.file===Z.file;if($==="fileUrl")return J.href===Z.href;return J===Z},JH=({otherStdioItems:$,type:J,value:Z,optionName:X})=>{let q=$.find(({value:{transform:Y}})=>Y===Z.transform);QJ(q,X,J)},QJ=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${J}\` options must not target ${H1[Z]} that is the same.`)};var N4=($,J,Z,X)=>{let Y=a5(J,Z,X).map((G,H)=>ZH({stdioOption:G,fdNumber:H,options:J,isSync:X})),Q=KH({initialFileDescriptors:Y,addProperties:$,options:J,isSync:X});return J.stdio=Q.map(({stdioItems:G})=>WH(G)),Q},ZH=({stdioOption:$,fdNumber:J,options:Z,isSync:X})=>{let q=u$(J),{stdioItems:Y,isStdioArray:Q}=XH({stdioOption:$,fdNumber:J,options:Z,optionName:q}),G=i5(Y,J,q),H=Y.map((B)=>e5({stdioItem:B,isStdioArray:Q,fdNumber:J,direction:G,isSync:X})),K=n5(H,q,G,Z),U=l5(K,G);return zH(K,U),{direction:G,objectMode:U,stdioItems:K}},XH=({stdioOption:$,fdNumber:J,options:Z,optionName:X})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>QH(H,X)),...$J(Z,J)],Q=JJ(Y),G=Q.length>1;return qH(Q,G,X),GH(Q),{stdioItems:Q,isStdioArray:G}},QH=($,J)=>({type:f5($,J),value:$,optionName:J}),qH=($,J,Z)=>{if($.length===0)throw TypeError(`The \`${Z}\` option must not be an empty array.`);if(!J)return;for(let{value:X,optionName:q}of $)if(YH.has(X))throw Error(`The \`${q}\` option must not include \`${X}\`.`)},YH=new Set(["ignore","ipc"]),GH=($)=>{for(let J of $)HH(J)},HH=({type:$,value:J,optionName:Z})=>{if(g5(J))throw TypeError(`The \`${Z}: URL\` option must use the \`file:\` scheme.
|
|
38
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(u5($,J))throw TypeError(`The \`${Z}: { file: '...' }\` option must be used instead of \`${Z}: '...'\`.`)},zH=($,J)=>{if(!J)return;let Z=$.find(({type:X})=>h4.has(X));if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` option cannot use both files and transforms in objectMode.`)},KH=({initialFileDescriptors:$,addProperties:J,options:Z,isSync:X})=>{let q=[];try{for(let Y of $)q.push(BH({fileDescriptor:Y,fileDescriptors:q,addProperties:J,options:Z,isSync:X}));return q}catch(Y){throw q3(q),Y}},BH=({fileDescriptor:{direction:$,objectMode:J,stdioItems:Z},fileDescriptors:X,addProperties:q,options:Y,isSync:Q})=>{let G=Z.map((H)=>UH({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:X,isSync:Q}));return{direction:$,objectMode:J,stdioItems:G}},UH=({stdioItem:$,addProperties:J,direction:Z,options:X,fileDescriptors:q,isSync:Y})=>{let Q=ZJ({stdioItem:$,direction:Z,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...J[Z][$.type]($,X)}},q3=($)=>{for(let{stdioItems:J}of $)for(let{stream:Z}of J)if(Z!==void 0&&!y0(Z))Z.destroy()},WH=($)=>{if($.length>1)return $.some(({value:X})=>X==="overlapped")?"overlapped":"pipe";let[{type:J,value:Z}]=$;return J==="native"?Z:"pipe"};var GJ=($,J)=>N4(LH,$,J,!0),i0=({type:$,optionName:J})=>{HJ(J,H1[$])},VH=({optionName:$,value:J})=>{if(J==="ipc"||J==="overlapped")HJ($,`"${J}"`);return{}},HJ=($,J)=>{throw TypeError(`The \`${$}\` option cannot be ${J} with synchronous methods.`)},YJ={generator(){},asyncGenerator:i0,webStream:i0,nodeStream:i0,webTransform:i0,duplex:i0,asyncIterable:i0,native:VH},LH={input:{...YJ,fileUrl:({value:$})=>({contents:[e0(qJ($))]}),filePath:({value:{file:$}})=>({contents:[e0(qJ($))]}),fileNumber:i0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...YJ,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:J}})=>({path:$,append:J}),fileNumber:({value:$})=>({path:$}),iterable:i0,string:i0,uint8Array:i0}};var X1=($,{stripFinalNewline:J},Z)=>Y3(J,Z)&&$!==void 0&&!Array.isArray($)?o1($):$,Y3=($,J)=>J==="all"?$[1]||$[2]:$[J];import{Transform as kH,getDefaultHighWaterMark as MJ}from"node:stream";var D4=($,J,Z,X)=>$||Z?void 0:KJ(J,X),H3=($,J,Z)=>Z?$.flatMap((X)=>zJ(X,J)):zJ($,J),zJ=($,J)=>{let{transform:Z,final:X}=KJ(J,{});return[...Z($),...X()]},KJ=($,J)=>{return J.previousChunks="",{transform:_H.bind(void 0,J,$),final:TH.bind(void 0,J)}},_H=function*($,J,Z){if(typeof Z!=="string"){yield Z;return}let{previousChunks:X}=$,q=-1;for(let Y=0;Y<Z.length;Y+=1)if(Z[Y]===`
|
|
39
|
+
`){let Q=RH(Z,Y,J,$),G=Z.slice(q+1,Y+1-Q);if(X.length>0)G=G3(X,G),X="";yield G,q=Y}if(q!==Z.length-1)X=G3(X,Z.slice(q+1));$.previousChunks=X},RH=($,J,Z,X)=>{if(Z)return 0;return X.isWindowsNewline=J!==0&&$[J-1]==="\r",X.isWindowsNewline?2:1},TH=function*({previousChunks:$}){if($.length>0)yield $},BJ=({binary:$,preserveNewlines:J,readableObjectMode:Z,state:X})=>$||J||Z?void 0:{transform:MH.bind(void 0,X)},MH=function*({isWindowsNewline:$=!1},J){let{unixNewline:Z,windowsNewline:X,LF:q,concatBytes:Y}=typeof J==="string"?CH:jH;if(J.at(-1)===q){yield J;return}yield Y(J,$?X:Z)},G3=($,J)=>`${$}${J}`,CH={windowsNewline:`\r
|
|
40
40
|
`,unixNewline:`
|
|
41
41
|
`,LF:`
|
|
42
|
-
`,concatBytes:
|
|
42
|
+
`,concatBytes:G3},FH=($,J)=>{let Z=new Uint8Array($.length+J.length);return Z.set($,0),Z.set(J,$.length),Z},jH={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:FH};import{Buffer as xH}from"node:buffer";var UJ=($,J)=>$?void 0:PH.bind(void 0,J),PH=function*($,J){if(typeof J!=="string"&&!B0(J)&&!xH.isBuffer(J))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof J}.`);yield J},WJ=($,J)=>$?IH.bind(void 0,J):OH.bind(void 0,J),IH=function*($,J){VJ($,J),yield J},OH=function*($,J){if(VJ($,J),typeof J!=="string"&&!B0(J))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof J}.`);yield J},VJ=($,J)=>{if(J===null||J===void 0)throw TypeError(`The \`${$}\` option's function must not call \`yield ${J}\`.
|
|
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 PH}from"node:buffer";import{StringDecoder as jH}from"node:string_decoder";var O4=($,J,Z)=>{if(Z)return;if($)return{transform:xH.bind(void 0,new TextEncoder)};let X=new jH(J);return{transform:IH.bind(void 0,X),final:wH.bind(void 0,X)}},xH=function*($,J){if(PH.isBuffer(J))yield s0(J);else if(typeof J==="string")yield $.encode(J);else yield J},IH=function*($,J){yield K0(J)?$.write(J):J},wH=function*($){let J=$.end();if(J!=="")yield J};import{callbackify as zJ}from"node:util";var q3=zJ(async($,J,Z,X)=>{J.currentIterable=$(...Z);try{for await(let q of J.currentIterable)X.push(q)}finally{delete J.currentIterable}}),E4=async function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=EH}=J[Z];for await(let q of X($))yield*E4(q,J,Z+1)},KJ=async function*($){for(let[J,{final:Z}]of Object.entries($))yield*OH(Z,Number(J),$)},OH=async function*($,J,Z){if($===void 0)return;for await(let X of $())yield*E4(X,Z,J+1)},BJ=zJ(async({currentIterable:$},J)=>{if($!==void 0){await(J?$.throw(J):$.return());return}if(J)throw J}),EH=function*($){yield $};var Y3=($,J,Z,X)=>{try{for(let q of $(...J))Z.push(q);X()}catch(q){X(q)}},UJ=($,J)=>[...J.flatMap((Z)=>[...C1(Z,$,0)]),...V$($)],C1=function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=hH}=J[Z];for(let q of X($))yield*C1(q,J,Z+1)},V$=function*($){for(let[J,{final:Z}]of Object.entries($))yield*AH(Z,Number(J),$)},AH=function*($,J,Z){if($===void 0)return;for(let X of $())yield*C1(X,Z,J+1)},hH=function*($){yield $};var G3=({value:$,value:{transform:J,final:Z,writableObjectMode:X,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=VJ($,Q,Y),K=M1(J),U=M1(Z),B=K?q3.bind(void 0,E4,G):Y3.bind(void 0,C1),W=K||U?q3.bind(void 0,KJ,G):Y3.bind(void 0,V$),_=K||U?BJ.bind(void 0,G):void 0;return{stream:new NH({writableObjectMode:X,writableHighWaterMark:WJ(X),readableObjectMode:q,readableHighWaterMark:WJ(q),transform(L,x,j){B([L,H,0],this,j)},flush(L){W([H],this,L)},destroy:_})}},A4=($,J,Z,X)=>{let q=J.filter(({type:Q})=>Q==="generator"),Y=X?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=VJ(Q,Z,G);$=UJ(H,$)}return $},VJ=({transform:$,final:J,binary:Z,writableObjectMode:X,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:YJ(X,G)},O4(Z,Q,X),w4(Z,Y,X,H),{transform:$,final:J},{transform:GJ(q,G)},qJ({binary:Z,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var LJ=($,J)=>{for(let Z of DH($))SH($,Z,J)},DH=($)=>new Set(Object.entries($).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),SH=($,J,Z)=>{let{stdioItems:X}=$[J],q=X.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(J!==0){let[{type:G,optionName:H}]=q;throw TypeError(`Only the \`stdin\` option, not \`${H}\`, can be ${G1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>vH(G,X));Z.input=Y$(Q)},vH=($,J)=>{let Z=A4($,J,"utf8",!0);return fH(Z),Y$(Z)},fH=($)=>{let J=$.find((Z)=>typeof Z!=="string"&&!K0(Z));if(J!==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: ${J}.`)};import{writeFileSync as gH,appendFileSync as uH}from"node:fs";var h4=({stdioItems:$,encoding:J,verboseInfo:Z,fdNumber:X})=>X!=="all"&&m1(Z,X)&&!F0.has(J)&&kH(X)&&($.some(({type:q,value:Y})=>q==="native"&&bH.has(Y))||$.every(({type:q})=>E0.has(q))),kH=($)=>$===1||$===2,bH=new Set(["pipe","overlapped"]),_J=async($,J,Z,X)=>{for await(let q of $)if(!yH(J))TJ(q,Z,X)},RJ=($,J,Z)=>{for(let X of $)TJ(X,J,Z)},yH=($)=>$._readableState.pipes.length>0,TJ=($,J,Z)=>{let X=u$($);m0({type:"output",verboseMessage:X,fdNumber:J,verboseInfo:Z})};var MJ=({fileDescriptors:$,syncResult:{output:J},options:Z,isMaxBuffer:X,verboseInfo:q})=>{if(J===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:J.map((H,K)=>mH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:X,verboseInfo:q},Z)),...Y}},mH=({result:$,fileDescriptors:J,fdNumber:Z,state:X,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:K,stripFinalNewline:U,maxBuffer:B})=>{if($===null)return;let W=C5($,Y,B),_=s0(W),{stdioItems:R,objectMode:L}=J[Z],x=cH([_],R,H,X),{serializedResult:j,finalResult:h=j}=pH({chunks:x,objectMode:L,encoding:H,lines:K,stripFinalNewline:U,fdNumber:Z});dH({serializedResult:j,fdNumber:Z,state:X,verboseInfo:Q,encoding:H,stdioItems:R,objectMode:L});let c=G[Z]?h:void 0;try{if(X.error===void 0)lH(j,R,q);return c}catch(F){return X.error=F,c}},cH=($,J,Z,X)=>{try{return A4($,J,Z,!1)}catch(q){return X.error=q,$}},pH=({chunks:$,objectMode:J,encoding:Z,lines:X,stripFinalNewline:q,fdNumber:Y})=>{if(J)return{serializedResult:$};if(Z==="buffer")return{serializedResult:Y$($)};let Q=v6($,Z);if(X[Y])return{serializedResult:Q,finalResult:Q3(Q,!q[Y],J)};return{serializedResult:Q}},dH=({serializedResult:$,fdNumber:J,state:Z,verboseInfo:X,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!h4({stdioItems:Y,encoding:q,verboseInfo:X,fdNumber:J}))return;let G=Q3($,!1,Q);try{RJ(G,J,X)}catch(H){Z.error??=H}},lH=($,J,Z)=>{for(let{path:X,append:q}of J.filter(({type:Y})=>x4.has(Y))){let Y=typeof X==="string"?X:X.toString();if(q||Z.has(Y))uH(X,$);else Z.add(Y),gH(X,$)}};var CJ=([,$,J],Z)=>{if(!Z.all)return;if($===void 0)return J;if(J===void 0)return $;if(Array.isArray($))return Array.isArray(J)?[...$,...J]:[...$,Z1(J,Z,"all")];if(Array.isArray(J))return[Z1($,Z,"all"),...J];if(K0($)&&K0(J))return W2([$,J]);return`${$}${J}`};import{once as H3}from"node:events";var FJ=async($,J)=>{let[Z,X]=await nH($);return J.isForcefullyTerminated??=!1,[Z,X]},nH=async($)=>{let[J,Z]=await Promise.allSettled([H3($,"spawn"),H3($,"exit")]);if(J.status==="rejected")return[];return Z.status==="rejected"?PJ($):Z.value},PJ=async($)=>{try{return await H3($,"exit")}catch{return PJ($)}},jJ=async($)=>{let[J,Z]=await $;if(!iH(J,Z)&&z3(J,Z))throw new c0;return[J,Z]},iH=($,J)=>$===void 0&&J===void 0,z3=($,J)=>$!==0||J!==null;var xJ=({error:$,status:J,signal:Z,output:X},{maxBuffer:q})=>{let Y=oH($,J,Z),Q=Y?.code==="ETIMEDOUT",G=M5(Y,X,q);return{resultError:Y,exitCode:J,signal:Z,timedOut:Q,isMaxBuffer:G}},oH=($,J,Z)=>{if($!==void 0)return $;return z3(J,Z)?new c0:void 0};var IJ=($,J,Z)=>{let{file:X,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:U}=aH($,J,Z),B=eH({file:X,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:U,startTime:G});return a1(B,H,K)},aH=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=c$($,J,Z),G=rH(Z),{file:H,commandArguments:K,options:U}=B4($,J,G);sH(U);let B=JJ(U,Q);return{file:H,commandArguments:K,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},rH=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,sH=({ipc:$,ipcInput:J,detached:Z,cancelSignal:X})=>{if(J)N4("ipcInput");if($)N4("ipc: true");if(Z)N4("detached: true");if(X)N4("cancelSignal")},N4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},eH=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=$z({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:K,exitCode:U,signal:B,timedOut:W,isMaxBuffer:_}=xJ(H,Z),{output:R,error:L=K}=MJ({fileDescriptors:Q,syncResult:H,options:Z,isMaxBuffer:_,verboseInfo:Y}),x=R.map((h,c)=>Z1(h,Z,c)),j=Z1(CJ(R,Z),Z,"all");return Zz({error:L,exitCode:U,signal:B,timedOut:W,isMaxBuffer:_,stdio:x,all:j,options:Z,command:X,escapedCommand:q,startTime:G})},$z=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{LJ(Y,Z);let G=Jz(Z);return tH(...U4($,J,G))}catch(G){return t1({error:G,command:X,escapedCommand:q,fileDescriptors:Y,options:Z,startTime:Q,isSync:!0})}},Jz=({encoding:$,maxBuffer:J,...Z})=>({...Z,encoding:"buffer",maxBuffer:C4(J)}),Zz=({error:$,exitCode:J,signal:Z,timedOut:X,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:U})=>$===void 0?F4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U}):W$({error:$,command:H,escapedCommand:K,timedOut:X,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:J,signal:Z,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U,isSync:!0});import{setMaxListeners as pK}from"node:events";import{spawn as dK}from"node:child_process";import hJ from"node:process";import{once as K3,on as Xz}from"node:events";var wJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0,filter:Y}={})=>{return d1({methodName:"getOneMessage",isSubprocess:Z,ipc:X,isConnected:q4($)}),Qz({anyProcess:$,channel:J,isSubprocess:Z,filter:Y,reference:q})},Qz=async({anyProcess:$,channel:J,isSubprocess:Z,filter:X,reference:q})=>{J4(J,q);let Y=Y1($,J,Z),Q=new AbortController;try{return await Promise.race([qz(Y,X,Q),Yz(Y,Z,Q),Gz(Y,Z,Q)])}catch(G){throw l1($),G}finally{Q.abort(),Z4(J,q)}},qz=async($,J,{signal:Z})=>{if(J===void 0){let[X]=await K3($,"message",{signal:Z});return X}for await(let[X]of Xz($,"message",{signal:Z}))if(J(X))return X},Yz=async($,J,{signal:Z})=>{await K3($,"disconnect",{signal:Z}),B8(J)},Gz=async($,J,{signal:Z})=>{let[X]=await K3($,"strict:error",{signal:Z});throw s$(X,J)};import{once as EJ,on as Hz}from"node:events";var AJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0}={})=>B3({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:!Z,reference:q}),B3=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:q,reference:Y})=>{d1({methodName:"getEachMessage",isSubprocess:Z,ipc:X,isConnected:q4($)}),J4(J,Y);let Q=Y1($,J,Z),G=new AbortController,H={};return zz($,Q,G),Kz({ipcEmitter:Q,isSubprocess:Z,controller:G,state:H}),Bz({anyProcess:$,channel:J,ipcEmitter:Q,isSubprocess:Z,shouldAwait:q,controller:G,state:H,reference:Y})},zz=async($,J,Z)=>{try{await EJ(J,"disconnect",{signal:Z.signal}),Z.abort()}catch{}},Kz=async({ipcEmitter:$,isSubprocess:J,controller:Z,state:X})=>{try{let[q]=await EJ($,"strict:error",{signal:Z.signal});X.error=s$(q,J),Z.abort()}catch{}},Bz=async function*({anyProcess:$,channel:J,ipcEmitter:Z,isSubprocess:X,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of Hz(Z,"message",{signal:Y.signal}))OJ(Q),yield H}catch{OJ(Q)}finally{if(Y.abort(),Z4(J,G),!X)l1($);if(q)await $}},OJ=({error:$})=>{if($)throw $};var NJ=($,{ipc:J})=>{Object.assign($,SJ($,!1,J))},DJ=()=>{let $=hJ,J=!0,Z=hJ.channel!==void 0;return{...SJ($,!0,Z),getCancelSignal:y8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:Z})}},SJ=($,J,Z)=>({sendMessage:z4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getOneMessage:wJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getEachMessage:AJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z})});import{ChildProcess as Uz}from"node:child_process";import{PassThrough as Wz,Readable as Vz,Writable as Lz,Duplex as _z}from"node:stream";var vJ=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,verboseInfo:Q})=>{J3(X);let G=new Uz;Rz(G,X),Object.assign(G,{readable:Tz,writable:Mz,duplex:Cz});let H=t1({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:!1}),K=Fz(H,Q,q);return{subprocess:G,promise:K}},Rz=($,J)=>{let Z=L$(),X=L$(),q=L$(),Y=Array.from({length:J.length-3},L$),Q=L$(),G=[Z,X,q,...Y];Object.assign($,{stdin:Z,stdout:X,stderr:q,all:Q,stdio:G})},L$=()=>{let $=new Wz;return $.end(),$},Tz=()=>new Vz({read(){}}),Mz=()=>new Lz({write(){}}),Cz=()=>new _z({read(){},write(){}}),Fz=async($,J,Z)=>a1($,J,Z);import{createReadStream as fJ,createWriteStream as kJ}from"node:fs";import{Buffer as Pz}from"node:buffer";import{Readable as _$,Writable as jz,Duplex as xz}from"node:stream";var yJ=($,J)=>I4(Iz,$,J,!1),R$=({type:$,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${G1[$]}.`)},bJ={fileNumber:R$,generator:G3,asyncGenerator:G3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:J,readableObjectMode:Z}}){let X=J||Z;return{stream:xz.fromWeb($,{objectMode:X})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},Iz={input:{...bJ,fileUrl:({value:$})=>({stream:fJ($)}),filePath:({value:{file:$}})=>({stream:fJ($)}),webStream:({value:$})=>({stream:_$.fromWeb($)}),iterable:({value:$})=>({stream:_$.from($)}),asyncIterable:({value:$})=>({stream:_$.from($)}),string:({value:$})=>({stream:_$.from($)}),uint8Array:({value:$})=>({stream:_$.from(Pz.from($))})},output:{...bJ,fileUrl:({value:$})=>({stream:kJ($)}),filePath:({value:{file:$,append:J}})=>({stream:kJ($,J?{flags:"a"}:{})}),webStream:({value:$})=>({stream:jz.fromWeb($)}),iterable:R$,asyncIterable:R$,string:R$,uint8Array:R$}};import{on as wz,once as gJ}from"node:events";import{PassThrough as Oz,getDefaultHighWaterMark as Ez}from"node:stream";import{finished as cJ}from"node:stream/promises";function F1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)U3(q);let J=$.some(({readableObjectMode:q})=>q),Z=Az($,J),X=new pJ({objectMode:J,writableHighWaterMark:Z,readableHighWaterMark:Z});for(let q of $)X.add(q);return X}var Az=($,J)=>{if($.length===0)return Ez(J);let Z=$.filter(({readableObjectMode:X})=>X===J).map(({readableHighWaterMark:X})=>X);return Math.max(...Z)};class pJ extends Oz{#J=new Set([]);#Z=new Set([]);#$=new Set([]);#X;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(U3($),this.#J.has($))return;this.#J.add($),this.#X??=hz(this,this.#J,this.#q);let J=Sz({passThroughStream:this,stream:$,streams:this.#J,ended:this.#Z,aborted:this.#$,onFinished:this.#X,unpipeEvent:this.#q});this.#Q.set($,J),$.pipe(this,{end:!1})}async remove($){if(U3($),!this.#J.has($))return!1;let J=this.#Q.get($);if(J===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await J,!0}}var hz=async($,J,Z)=>{D4($,uJ);let X=new AbortController;try{await Promise.race([Nz($,X),Dz($,J,Z,X)])}finally{X.abort(),D4($,-uJ)}},Nz=async($,{signal:J})=>{try{await cJ($,{signal:J,cleanup:!0})}catch(Z){throw dJ($,Z),Z}},Dz=async($,J,Z,{signal:X})=>{for await(let[q]of wz($,"unpipe",{signal:X}))if(J.has(q))q.emit(Z)},U3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},Sz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,onFinished:Y,unpipeEvent:Q})=>{D4($,mJ);let G=new AbortController;try{await Promise.race([vz(Y,J,G),fz({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:G}),kz({stream:J,streams:Z,ended:X,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),D4($,-mJ)}if(Z.size>0&&Z.size===X.size+q.size)if(X.size===0&&q.size>0)W3($);else bz($)},vz=async($,J,{signal:Z})=>{try{if(await $,!Z.aborted)W3(J)}catch(X){if(!Z.aborted)dJ(J,X)}},fz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:{signal:Y}})=>{try{if(await cJ(J,{signal:Y,cleanup:!0,readable:!0,writable:!1}),Z.has(J))X.add(J)}catch(Q){if(Y.aborted||!Z.has(J))return;if(lJ(Q))q.add(J);else nJ($,Q)}},kz=async({stream:$,streams:J,ended:Z,aborted:X,unpipeEvent:q,controller:{signal:Y}})=>{if(await gJ($,q,{signal:Y}),!$.readable)return gJ(Y,"abort",{signal:Y});J.delete($),Z.delete($),X.delete($)},bz=($)=>{if($.writable)$.end()},dJ=($,J)=>{if(lJ(J))W3($);else nJ($,J)},lJ=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",W3=($)=>{if($.readable||$.writable)$.destroy()},nJ=($,J)=>{if(!$.destroyed)$.once("error",yz),$.destroy(J)},yz=()=>{},D4=($,J)=>{let Z=$.getMaxListeners();if(Z!==0&&Z!==Number.POSITIVE_INFINITY)$.setMaxListeners(Z+J)},uJ=2,mJ=1;import{finished as iJ}from"node:stream/promises";var s1=($,J)=>{$.pipe(J),gz($,J),uz($,J)},gz=async($,J)=>{if(f0($)||f0(J))return;try{await iJ($,{cleanup:!0,readable:!0,writable:!1})}catch{}V3(J)},V3=($)=>{if($.writable)$.end()},uz=async($,J)=>{if(f0($)||f0(J))return;try{await iJ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}L3($)},L3=($)=>{if($.readable)$.destroy()};var oJ=($,J,Z)=>{let X=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(J)){for(let{stream:G}of Y.filter(({type:H})=>E0.has(H)))mz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!E0.has(H)))pz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:X,controller:Z})}for(let[q,Y]of X.entries()){let Q=Y.length===1?Y[0]:F1(Y);s1(Q,q)}},mz=($,J,Z,X)=>{if(Z==="output")s1($.stdio[X],J);else s1(J,$.stdio[X]);let q=cz[X];if(q!==void 0)$[q]=J;$.stdio[X]=J},cz=["stdin","stdout","stderr"],pz=({subprocess:$,stream:J,direction:Z,fdNumber:X,pipeGroups:q,controller:Y})=>{if(J===void 0)return;dz(J,Y);let[Q,G]=Z==="output"?[J,$.stdio[X]]:[$.stdio[X],J],H=q.get(Q)??[];q.set(Q,[...H,G])},dz=($,{signal:J})=>{if(f0($))R1($,lz,J)},lz=2;import{addAbortListener as oz}from"node:events";var P1=[];P1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")P1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")P1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var S4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",_3=Symbol.for("signal-exit emitter"),R3=globalThis,nz=Object.defineProperty.bind(Object);class tJ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(R3[_3])return R3[_3];nz(R3,_3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,J){this.listeners[$].push(J)}removeListener($,J){let Z=this.listeners[$],X=Z.indexOf(J);if(X===-1)return;if(X===0&&Z.length===1)Z.length=0;else Z.splice(X,1)}emit($,J,Z){if(this.emitted[$])return!1;this.emitted[$]=!0;let X=!1;for(let q of this.listeners[$])X=q(J,Z)===!0||X;if($==="exit")X=this.emit("afterExit",J,Z)||X;return X}}class M3{}var iz=($)=>{return{onExit(J,Z){return $.onExit(J,Z)},load(){return $.load()},unload(){return $.unload()}}};class aJ extends M3{onExit(){return()=>{}}load(){}unload(){}}class rJ extends M3{#J=T3.platform==="win32"?"SIGINT":"SIGHUP";#Z=new tJ;#$;#X;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let J of P1)this.#Q[J]=()=>{let Z=this.#$.listeners(J),{count:X}=this.#Z,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")X+=q.__signal_exit_emitter__.count;if(Z.length===X){this.unload();let Y=this.#Z.emit("exit",null,J),Q=J==="SIGHUP"?this.#J:J;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#X=$.emit}onExit($,J){if(!S4(this.#$))return()=>{};if(this.#Y===!1)this.load();let Z=J?.alwaysLast?"afterExit":"exit";return this.#Z.on(Z,$),()=>{if(this.#Z.removeListener(Z,$),this.#Z.listeners.exit.length===0&&this.#Z.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#Z.count+=1;for(let $ of P1)try{let J=this.#Q[$];if(J)this.#$.on($,J)}catch(J){}this.#$.emit=($,...J)=>{return this.#H($,...J)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,P1.forEach(($)=>{let J=this.#Q[$];if(!J)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,J)}catch(Z){}}),this.#$.emit=this.#X,this.#$.reallyExit=this.#q,this.#Z.count-=1}#G($){if(!S4(this.#$))return 0;return this.#$.exitCode=$||0,this.#Z.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...J){let Z=this.#X;if($==="exit"&&S4(this.#$)){if(typeof J[0]==="number")this.#$.exitCode=J[0];let X=Z.call(this.#$,$,...J);return this.#Z.emit("exit",this.#$.exitCode,null),X}else return Z.call(this.#$,$,...J)}}var T3=globalThis.process,{onExit:sJ,load:JF,unload:ZF}=iz(S4(T3)?new rJ(T3):new aJ);var eJ=($,{cleanup:J,detached:Z},{signal:X})=>{if(!J||Z)return;let q=sJ(()=>{$.kill()});oz(X,()=>{q()})};var JZ=({source:$,sourcePromise:J,boundOptions:Z,createNested:X},...q)=>{let Y=m$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:U}=tz(Z,X,q),{sourceStream:B,sourceError:W}=rz($,K),{options:_,fileDescriptors:R}=d0.get($);return{sourcePromise:J,sourceStream:B,sourceOptions:_,sourceError:W,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:U,fileDescriptors:R,startTime:Y}},tz=($,J,Z)=>{try{let{destination:X,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=az($,J,...Z),G=$4(X,Y);return{destination:X,destinationStream:G,from:q,unpipeSignal:Q}}catch(X){return{destinationError:X}}},az=($,J,Z,...X)=>{if(Array.isArray(Z))return{destination:J($Z,$)(Z,...X),pipeOptions:$};if(typeof Z==="string"||Z instanceof URL||B2(Z)){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]=N$(Z,...X);return{destination:J($Z)(q,Y,Q),pipeOptions:Q}}if(d0.has(Z)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:Z,pipeOptions:X[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${Z}`)},$Z=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),rz=($,J)=>{try{return{sourceStream:n1($,J)}}catch(Z){return{sourceError:Z}}};var XZ=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=sz({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X});if(G!==void 0)throw C3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},sz=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X})=>{if(J!==void 0&&X!==void 0)return X;if(X!==void 0)return L3($),X;if(J!==void 0)return V3(Z),J},C3=({error:$,fileDescriptors:J,sourceOptions:Z,startTime:X})=>t1({error:$,command:ZZ,escapedCommand:ZZ,fileDescriptors:J,options:Z,startTime:X,isSync:!1}),ZZ="source.pipe(destination)";var QZ=async($)=>{let[{status:J,reason:Z,value:X=Z},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(X))Q.pipedFrom.push(X);if(q==="rejected")throw Q;if(J==="rejected")throw X;return Q};import{finished as ez}from"node:stream/promises";var qZ=($,J,Z)=>{let X=v4.has(J)?JK($,J):$K($,J);return R1($,XK,Z.signal),R1(J,QK,Z.signal),ZK(J),X},$K=($,J)=>{let Z=F1([$]);return s1(Z,J),v4.set(J,Z),Z},JK=($,J)=>{let Z=v4.get(J);return Z.add($),Z},ZK=async($)=>{try{await ez($,{cleanup:!0,readable:!1,writable:!0})}catch{}v4.delete($)},v4=new WeakMap,XK=2,QK=1;import{aborted as qK}from"node:util";var YZ=($,J)=>$===void 0?[]:[YK($,J)],YK=async($,{sourceStream:J,mergedStream:Z,fileDescriptors:X,sourceOptions:q,startTime:Y})=>{await qK($,J),await Z.remove(J);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw C3({error:Q,fileDescriptors:X,sourceOptions:q,startTime:Y})};var f4=($,...J)=>{if(X0(J[0]))return f4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...J[0]}});let{destination:Z,...X}=JZ($,...J),q=GK({...X,destination:Z});return q.pipe=f4.bind(void 0,{...$,source:Z,sourcePromise:q,boundOptions:{}}),q},GK=async({sourcePromise:$,sourceStream:J,sourceOptions:Z,sourceError:X,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let U=HK($,q);XZ({sourceStream:J,sourceError:X,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:Z,startTime:K});let B=new AbortController;try{let W=qZ(J,Y,B);return await Promise.race([QZ(U),...YZ(G,{sourceStream:J,mergedStream:W,sourceOptions:Z,fileDescriptors:H,startTime:K})])}finally{B.abort()}},HK=($,J)=>Promise.allSettled([$,J]);import{setImmediate as LK}from"node:timers/promises";import{on as zK}from"node:events";import{getDefaultHighWaterMark as KK}from"node:stream";var k4=({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:X,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return BK(J,Q),HZ({stream:$,controller:Q,binary:Z,shouldEncode:!$.readableObjectMode&&X,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},BK=async($,J)=>{try{await $}catch{}finally{J.abort()}},F3=({stream:$,onStreamEnd:J,lines:Z,encoding:X,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;UK(J,Q,$);let G=$.readableObjectMode&&!Y;return HZ({stream:$,controller:Q,binary:X==="buffer",shouldEncode:!G,encoding:X,shouldSplit:!G&&Z,preserveNewlines:!q})},UK=async($,J,Z)=>{try{await $}catch{Z.destroy()}finally{J.abort()}},HZ=({stream:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=zK($,"data",{signal:J.signal,highWaterMark:GZ,highWatermark:GZ});return WK({onStdoutChunk:G,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})},P3=KK(!0),GZ=P3,WK=async function*({onStdoutChunk:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=VK({binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*C1(H,G,0)}catch(H){if(!J.signal.aborted)throw H}finally{yield*V$(G)}},VK=({binary:$,shouldEncode:J,encoding:Z,shouldSplit:X,preserveNewlines:q})=>[O4($,Z,!J),w4($,q,!X,{})].filter(Boolean);var zZ=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:U})=>{let B=_K({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:G,verboseInfo:K,streamInfo:U});if(!q){await Promise.all([RK($),B]);return}let W=Z3(H,Z),_=F3({stream:$,onStreamEnd:J,lines:Q,encoding:X,stripFinalNewline:W,allMixed:G}),[R]=await Promise.all([TK({stream:$,iterable:_,fdNumber:Z,encoding:X,maxBuffer:Y,lines:Q}),B]);return R},_K=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!h4({stdioItems:Q[Z]?.stdioItems,encoding:X,verboseInfo:Y,fdNumber:Z}))return;let G=F3({stream:$,onStreamEnd:J,lines:!0,encoding:X,stripFinalNewline:!0,allMixed:q});await _J(G,$,Z,Y)},RK=async($)=>{if(await LK(),$.readableFlowing===null)$.resume()},TK=async({stream:$,stream:{readableObjectMode:J},iterable:Z,fdNumber:X,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(J||Q)return await _4(Z,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await R4(Z,{maxBuffer:Y}));return await M4(Z,{maxBuffer:Y})}catch(G){return KZ(_5({error:G,stream:$,readableObjectMode:J,lines:Q,encoding:q,fdNumber:X}))}},j3=async($)=>{try{return await $}catch(J){return KZ(J)}},KZ=({bufferedData:$})=>D6($)?new Uint8Array($):$;import{finished as MK}from"node:stream/promises";var T$=async($,J,Z,{isSameDirection:X,stopOnExit:q=!1}={})=>{let Y=CK($,Z),Q=new AbortController;try{await Promise.race([...q?[Z.exitPromise]:[],MK($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)jK(G,J,Z,X)}finally{Q.abort()}},CK=($,{originalStreams:[J],subprocess:Z})=>{let X={stdinCleanedUp:!1};if($===J)FK($,Z,X);return X},FK=($,J,Z)=>{let{_destroy:X}=$;$._destroy=(...q)=>{PK(J,Z),X.call($,...q)}},PK=({exitCode:$,signalCode:J},Z)=>{if($!==null||J!==null)Z.stdinCleanedUp=!0},jK=($,J,Z,X)=>{if(!xK($,J,Z,X))throw $},xK=($,J,Z,X=!0)=>{if(Z.propagating)return BZ($)||b4($);return Z.propagating=!0,x3(Z,J)===X?BZ($):b4($)},x3=({fileDescriptors:$},J)=>J!=="all"&&$[J].direction==="input",b4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",BZ=($)=>$?.code==="EPIPE";var UZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>I3({stream:H,fdNumber:K,encoding:J,buffer:Z[K],maxBuffer:X[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),I3=async({stream:$,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let U=T$($,J,K);if(x3(K,J)){await U;return}let[B]=await Promise.all([zZ({stream:$,onStreamEnd:U,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K}),U]);return B};var WZ=({stdout:$,stderr:J},{all:Z})=>Z&&($||J)?F1([$,J].filter(Boolean)):void 0,VZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>I3({...IK($,Z),fdNumber:"all",encoding:J,maxBuffer:X[1]+X[2],lines:q[1]||q[2],allMixed:wK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),IK=({stdout:$,stderr:J,all:Z},[,X,q])=>{let Y=X||q;if(!Y)return{stream:Z,buffer:Y};if(!X)return{stream:J,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:Z,buffer:Y}},wK=({all:$,stdout:J,stderr:Z})=>$&&J&&Z&&J.readableObjectMode!==Z.readableObjectMode;import{once as OK}from"node:events";var LZ=($)=>m1($,"ipc"),_Z=($,J)=>{let Z=u$($);m0({type:"ipc",verboseMessage:Z,fdNumber:"ipc",verboseInfo:J})};var RZ=async({subprocess:$,buffer:J,maxBuffer:Z,ipc:X,ipcOutput:q,verboseInfo:Y})=>{if(!X)return q;let Q=LZ(Y),G=e0(J,"ipc"),H=e0(Z,"ipc");for await(let K of B3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:X,shouldAwait:!1,reference:!0})){if(G)R5($,q,H),q.push(K);if(Q)_Z(K,Y)}return q},TZ=async($,J)=>{return await Promise.allSettled([$]),J};var MZ=async({subprocess:$,options:{encoding:J,buffer:Z,maxBuffer:X,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:K,ipc:U,ipcInput:B},context:W,verboseInfo:_,fileDescriptors:R,originalStreams:L,onInternalError:x,controller:j})=>{let h=FJ($,W),c={originalStreams:L,fileDescriptors:R,subprocess:$,exitPromise:h,propagating:!1},F=UZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:c}),y=VZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:c}),l=[],t=RZ({subprocess:$,buffer:Z,maxBuffer:X,ipc:U,ipcOutput:l,verboseInfo:_}),_0=EK(L,$,c),n=AK(R,c);try{return await Promise.race([Promise.all([{},jJ(h),Promise.all(F),y,t,o8($,B),..._0,...n]),x,hK($,j),...p8($,Y,W,j),...K8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:W,controller:j}),...m8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:W,controller:j})])}catch(a0){return W.terminationReason??="other",Promise.all([{error:a0},h,Promise.all(F.map((O)=>j3(O))),j3(y),TZ(t,l),Promise.allSettled(_0),Promise.allSettled(n)])}},EK=($,J,Z)=>$.map((X,q)=>X===J.stdio[q]?void 0:T$(X,q,Z)),AK=($,J)=>$.flatMap(({stdioItems:Z},X)=>Z.filter(({value:q,stream:Y=q})=>b0(Y,{checkOpen:!1})&&!f0(Y)).map(({type:q,value:Y,stream:Q=Y})=>T$(Q,X,J,{isSameDirection:E0.has(q),stopOnExit:q==="native"}))),hK=async($,{signal:J})=>{let[Z]=await OK($,"error",{signal:J});throw Z};var CZ=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),M$=($,J,Z)=>{let X=$[Z];if(!X.has(J))X.set(J,[]);let q=X.get(J),Y=p0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},e1=async({resolve:$,promises:J},Z)=>{$();let[X]=await Promise.race([Promise.allSettled([!0,Z]),Promise.all([!1,...J])]);return!X};import{Readable as NK}from"node:stream";import{callbackify as DK}from"node:util";import{finished as FZ}from"node:stream/promises";var w3=async($)=>{if($===void 0)return;try{await O3($)}catch{}},PZ=async($)=>{if($===void 0)return;try{await E3($)}catch{}},O3=async($)=>{await FZ($,{cleanup:!0,readable:!1,writable:!0})},E3=async($)=>{await FZ($,{cleanup:!0,readable:!0,writable:!1})},y4=async($,J)=>{if(await $,J)throw J},g4=($,J,Z)=>{if(Z&&!b4(Z))$.destroy(Z);else if(J)$.destroy()};var jZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||F0.has(Z),{subprocessStdout:G,waitReadableDestroy:H}=A3($,X,J),{readableEncoding:K,readableObjectMode:U,readableHighWaterMark:B}=h3(G,Q),{read:W,onStdoutDataDone:_}=N3({subprocessStdout:G,subprocess:$,binary:Q,encoding:Z,preserveNewlines:Y}),R=new NK({read:W,destroy:DK(S3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:B,objectMode:U,encoding:K});return D3({subprocessStdout:G,onStdoutDataDone:_,readable:R,subprocess:$}),R},A3=($,J,Z)=>{let X=n1($,J),q=M$(Z,X,"readableDestroy");return{subprocessStdout:X,waitReadableDestroy:q}},h3=({readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z},X)=>X?{readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:P3},N3=({subprocessStdout:$,subprocess:J,binary:Z,encoding:X,preserveNewlines:q})=>{let Y=p0(),Q=k4({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:!Z,encoding:X,preserveNewlines:q});return{read(){SK(this,Q,Y)},onStdoutDataDone:Y}},SK=async($,J,Z)=>{try{let{value:X,done:q}=await J.next();if(q)Z.resolve();else $.push(X)}catch{}},D3=async({subprocessStdout:$,onStdoutDataDone:J,readable:Z,subprocess:X,subprocessStdin:q})=>{try{if(await E3($),await X,await w3(q),await J,Z.readable)Z.push(null)}catch(Y){await w3(q),xZ(Z,Y)}},S3=async({subprocessStdout:$,subprocess:J,waitReadableDestroy:Z},X)=>{if(await e1(Z,J))xZ($,X),await y4(J,X)},xZ=($,J)=>{g4($,$.readable,J)};import{Writable as vK}from"node:stream";import{callbackify as IZ}from"node:util";var wZ=({subprocess:$,concurrentStreams:J},{to:Z}={})=>{let{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}=v3($,Z,J),Q=new vK({...f3(X,$,q),destroy:IZ(b3.bind(void 0,{subprocessStdin:X,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:X.writableHighWaterMark,objectMode:X.writableObjectMode});return k3(X,Q),Q},v3=($,J,Z)=>{let X=$4($,J),q=M$(Z,X,"writableFinal"),Y=M$(Z,X,"writableDestroy");return{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}},f3=($,J,Z)=>({write:fK.bind(void 0,$),final:IZ(kK.bind(void 0,$,J,Z))}),fK=($,J,Z,X)=>{if($.write(J,Z))X();else $.once("drain",X)},kK=async($,J,Z)=>{if(await e1(Z,J)){if($.writable)$.end();await J}},k3=async($,J,Z)=>{try{if(await O3($),J.writable)J.end()}catch(X){await PZ(Z),OZ(J,X)}},b3=async({subprocessStdin:$,subprocess:J,waitWritableFinal:Z,waitWritableDestroy:X},q)=>{if(await e1(Z,J),await e1(X,J))OZ($,q),await y4(J,q)},OZ=($,J)=>{g4($,$.writable,J)};import{Duplex as bK}from"node:stream";import{callbackify as yK}from"node:util";var EZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||F0.has(Z),{subprocessStdout:H,waitReadableDestroy:K}=A3($,X,J),{subprocessStdin:U,waitWritableFinal:B,waitWritableDestroy:W}=v3($,q,J),{readableEncoding:_,readableObjectMode:R,readableHighWaterMark:L}=h3(H,G),{read:x,onStdoutDataDone:j}=N3({subprocessStdout:H,subprocess:$,binary:G,encoding:Z,preserveNewlines:Q}),h=new bK({read:x,...f3(U,$,B),destroy:yK(gK.bind(void 0,{subprocessStdout:H,subprocessStdin:U,subprocess:$,waitReadableDestroy:K,waitWritableFinal:B,waitWritableDestroy:W})),readableHighWaterMark:L,writableHighWaterMark:U.writableHighWaterMark,readableObjectMode:R,writableObjectMode:U.writableObjectMode,encoding:_});return D3({subprocessStdout:H,onStdoutDataDone:j,readable:h,subprocess:$,subprocessStdin:U}),k3(U,h,H),h},gK=async({subprocessStdout:$,subprocessStdin:J,subprocess:Z,waitReadableDestroy:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([S3({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},Q),b3({subprocessStdin:J,subprocess:Z,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var y3=($,J,{from:Z,binary:X=!1,preserveNewlines:q=!1}={})=>{let Y=X||F0.has(J),Q=n1($,Z),G=k4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:J,preserveNewlines:q});return uK(G,Q,$)},uK=async function*($,J,Z){try{yield*$}finally{if(J.readable)J.destroy();await Z}};var AZ=($,{encoding:J})=>{let Z=CZ();$.readable=jZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.writable=wZ.bind(void 0,{subprocess:$,concurrentStreams:Z}),$.duplex=EZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.iterable=y3.bind(void 0,$,J),$[Symbol.asyncIterator]=y3.bind(void 0,$,J,{})};var hZ=($,J)=>{for(let[Z,X]of cK){let q=X.value.bind(J);Reflect.defineProperty($,Z,{...X,value:q})}},mK=(async()=>{})().constructor.prototype,cK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(mK,$)]);var NZ=($,J,Z,X)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:U,fileDescriptors:B}=lK($,J,Z),{subprocess:W,promise:_}=iK({file:q,commandArguments:Y,options:U,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:B});return W.pipe=f4.bind(void 0,{source:W,sourcePromise:_,boundOptions:{},createNested:X}),hZ(W,_),d0.set(W,{options:U,fileDescriptors:B}),W},lK=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=c$($,J,Z),{file:G,commandArguments:H,options:K}=B4($,J,Z),U=nK(K),B=yJ(U,Q);return{file:G,commandArguments:H,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},nK=({timeout:$,signal:J,...Z})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...Z,timeoutDuration:$}},iK=({file:$,commandArguments:J,options:Z,startTime:X,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=dK(...U4($,J,Z))}catch(R){return vJ({error:R,command:Y,escapedCommand:Q,fileDescriptors:G,options:Z,startTime:X,verboseInfo:q})}let K=new AbortController;pK(Number.POSITIVE_INFINITY,K.signal);let U=[...H.stdio];oJ(H,G,K),eJ(H,Z,K);let B={},W=p0();H.kill=H8.bind(void 0,{kill:H.kill.bind(H),options:Z,onInternalError:W,context:B,controller:K}),H.all=WZ(H,Z),AZ(H,Z),NJ(H,Z);let _=oK({subprocess:H,options:Z,startTime:X,verboseInfo:q,fileDescriptors:G,originalStreams:U,command:Y,escapedCommand:Q,context:B,onInternalError:W,controller:K});return{subprocess:H,promise:_}},oK=async({subprocess:$,options:J,startTime:Z,verboseInfo:X,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:K,controller:U})=>{let[B,[W,_],R,L,x]=await MZ({subprocess:$,options:J,context:H,verboseInfo:X,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:U});U.abort(),K.resolve();let j=R.map((F,y)=>Z1(F,J,y)),h=Z1(L,J,"all"),c=tK({errorInfo:B,exitCode:W,signal:_,stdio:j,all:h,ipcOutput:x,context:H,options:J,command:Q,escapedCommand:G,startTime:Z});return a1(c,X,J)},tK=({errorInfo:$,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:K,startTime:U})=>("error"in $)?W$({error:$.error,command:H,escapedCommand:K,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof $1,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U,isSync:!1}):F4({command:H,escapedCommand:K,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U});var u4=($,J)=>{let Z=Object.fromEntries(Object.entries(J).map(([X,q])=>[X,aK(X,$[X],q)]));return{...$,...Z}},aK=($,J,Z)=>{if(rK.has($)&&X0(J)&&X0(Z))return{...J,...Z};return Z},rK=new Set(["env",...R2]);var H1=($,J,Z,X)=>{let q=(Q,G,H)=>H1(Q,G,Z,H),Y=(...Q)=>sK({mapArguments:$,deepOptions:Z,boundOptions:J,setBoundExeca:X,createNested:q},...Q);if(X!==void 0)X(Y,q,J);return Y},sK=({mapArguments:$,deepOptions:J={},boundOptions:Z={},setBoundExeca:X,createNested:q},Y,...Q)=>{if(X0(Y))return q($,u4(Z,Y),X);let{file:G,commandArguments:H,options:K,isSync:U}=eK({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:J,boundOptions:Z});return U?IJ(G,H,K):NZ(G,H,K,q)},eK=({mapArguments:$,firstArgument:J,nextArguments:Z,deepOptions:X,boundOptions:q})=>{let Y=y6(J)?g6(J,Z):[J,...Z],[Q,G,H]=N$(...Y),K=u4(u4(X,q),H),{file:U=Q,commandArguments:B=G,options:W=K,isSync:_=!1}=$({file:Q,commandArguments:G,options:K});return{file:U,commandArguments:B,options:W,isSync:_}};var DZ=({file:$,commandArguments:J})=>vZ($,J),SZ=({file:$,commandArguments:J})=>({...vZ($,J),isSync:!0}),vZ=($,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${J}.`);let[Z,...X]=$B($);return{file:Z,commandArguments:X}},$B=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let J=$.trim();if(J==="")return[];let Z=[];for(let X of J.split(JB)){let q=Z.at(-1);if(q&&q.endsWith("\\"))Z[Z.length-1]=`${q.slice(0,-1)} ${X}`;else Z.push(X)}return Z},JB=/ +/g;var fZ=($,J,Z)=>{$.sync=J(ZB,Z),$.s=$.sync},kZ=({options:$})=>bZ($),ZB=({options:$})=>({...bZ($),isSync:!0}),bZ=($)=>({options:{...XB($),...$}}),XB=({input:$,inputFile:J,stdio:Z})=>$===void 0&&J===void 0&&Z===void 0?{stdin:"inherit"}:{},yZ={preferLocal:!0};var gZ=H1(()=>({})),lj=H1(()=>({isSync:!0})),nj=H1(DZ),ij=H1(SZ),oj=H1(l8),tj=H1(kZ,{},yZ,fZ),{sendMessage:aj,getOneMessage:rj,getEachMessage:sj,getCancelSignal:ej}=DJ();var M0=y1(u3(),1),eZ=y1(p4(),1);import{stdin as rZ,stdout as sZ}from"node:process";import*as z1 from"node:readline";import pZ from"node:readline";import{Writable as zB}from"node:stream";function KB({onlyFirst:$=!1}={}){let J=["[\\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(J,$?void 0:"g")}var BB=KB();function $X($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(BB,"")}function JX($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var ZX={exports:{}};(function($){var J={};$.exports=J,J.eastAsianWidth=function(X){var q=X.charCodeAt(0),Y=X.length==2?X.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"},J.characterLength=function(X){var q=this.eastAsianWidth(X);return q=="F"||q=="W"||q=="A"?2:1};function Z(X){return X.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}J.length=function(X){for(var q=Z(X),Y=0,Q=0;Q<q.length;Q++)Y=Y+this.characterLength(q[Q]);return Y},J.slice=function(X,q,Y){textLen=J.length(X),q=q||0,Y=Y||1,q<0&&(q=textLen+q),Y<0&&(Y=textLen+Y);for(var Q="",G=0,H=Z(X),K=0;K<H.length;K++){var U=H[K],B=J.length(U);if(G>=q-(B==2?1:0))if(G+B<=Y)Q+=U;else break;G+=B}return Q}})(ZX);var UB=ZX.exports,WB=JX(UB),VB=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},LB=JX(VB);function C$($,J={}){if(typeof $!="string"||$.length===0||(J={ambiguousIsNarrow:!0,...J},$=$X($),$.length===0))return 0;$=$.replace(LB()," ");let Z=J.ambiguousIsNarrow?1:2,X=0;for(let q of $){let Y=q.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(WB.eastAsianWidth(q)){case"F":case"W":X+=2;break;case"A":X+=Z;break;default:X+=1}}return X}var c3=10,dZ=($=0)=>(J)=>`\x1B[${J+$}m`,lZ=($=0)=>(J)=>`\x1B[${38+$};5;${J}m`,nZ=($=0)=>(J,Z,X)=>`\x1B[${38+$};2;${J};${Z};${X}m`,$0={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($0.modifier);var _B=Object.keys($0.color),RB=Object.keys($0.bgColor);[..._B,...RB];function TB(){let $=new Map;for(let[J,Z]of Object.entries($0)){for(let[X,q]of Object.entries(Z))$0[X]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},Z[X]=$0[X],$.set(q[0],q[1]);Object.defineProperty($0,J,{value:Z,enumerable:!1})}return Object.defineProperty($0,"codes",{value:$,enumerable:!1}),$0.color.close="\x1B[39m",$0.bgColor.close="\x1B[49m",$0.color.ansi=dZ(),$0.color.ansi256=lZ(),$0.color.ansi16m=nZ(),$0.bgColor.ansi=dZ(c3),$0.bgColor.ansi256=lZ(c3),$0.bgColor.ansi16m=nZ(c3),Object.defineProperties($0,{rgbToAnsi256:{value:(J,Z,X)=>J===Z&&Z===X?J<8?16:J>248?231:Math.round((J-8)/247*24)+232:16+36*Math.round(J/255*5)+6*Math.round(Z/255*5)+Math.round(X/255*5),enumerable:!1},hexToRgb:{value:(J)=>{let Z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(J.toString(16));if(!Z)return[0,0,0];let[X]=Z;X.length===3&&(X=[...X].map((Y)=>Y+Y).join(""));let q=Number.parseInt(X,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(J)=>$0.rgbToAnsi256(...$0.hexToRgb(J)),enumerable:!1},ansi256ToAnsi:{value:(J)=>{if(J<8)return 30+J;if(J<16)return 90+(J-8);let Z,X,q;if(J>=232)Z=((J-232)*10+8)/255,X=Z,q=Z;else{J-=16;let G=J%36;Z=Math.floor(J/36)/5,X=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(Z,X,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(X)<<1|Math.round(Z));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(J,Z,X)=>$0.ansi256ToAnsi($0.rgbToAnsi256(J,Z,X)),enumerable:!1},hexToAnsi:{value:(J)=>$0.ansi256ToAnsi($0.hexToAnsi256(J)),enumerable:!1}}),$0}var MB=TB(),n4=new Set(["\x1B",""]),CB=39,l3="\x07",XX="[",FB="]",QX="m",n3=`${FB}8;;`,iZ=($)=>`${n4.values().next().value}${XX}${$}${QX}`,oZ=($)=>`${n4.values().next().value}${n3}${$}${l3}`,PB=($)=>$.split(" ").map((J)=>C$(J)),p3=($,J,Z)=>{let X=[...J],q=!1,Y=!1,Q=C$($X($[$.length-1]));for(let[G,H]of X.entries()){let K=C$(H);if(Q+K<=Z?$[$.length-1]+=H:($.push(H),Q=0),n4.has(H)&&(q=!0,Y=X.slice(G+1).join("").startsWith(n3)),q){Y?H===l3&&(q=!1,Y=!1):H===QX&&(q=!1);continue}Q+=K,Q===Z&&G<X.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},jB=($)=>{let J=$.split(" "),Z=J.length;for(;Z>0&&!(C$(J[Z-1])>0);)Z--;return Z===J.length?$:J.slice(0,Z).join(" ")+J.slice(Z).join("")},xB=($,J,Z={})=>{if(Z.trim!==!1&&$.trim()==="")return"";let X="",q,Y,Q=PB($),G=[""];for(let[K,U]of $.split(" ").entries()){Z.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let B=C$(G[G.length-1]);if(K!==0&&(B>=J&&(Z.wordWrap===!1||Z.trim===!1)&&(G.push(""),B=0),(B>0||Z.trim===!1)&&(G[G.length-1]+=" ",B++)),Z.hard&&Q[K]>J){let W=J-B,_=1+Math.floor((Q[K]-W-1)/J);Math.floor((Q[K]-1)/J)<_&&G.push(""),p3(G,U,J);continue}if(B+Q[K]>J&&B>0&&Q[K]>0){if(Z.wordWrap===!1&&B<J){p3(G,U,J);continue}G.push("")}if(B+Q[K]>J&&Z.wordWrap===!1){p3(G,U,J);continue}G[G.length-1]+=U}Z.trim!==!1&&(G=G.map((K)=>jB(K)));let H=[...G.join(`
|
|
45
|
-
`)];for(let[K,U]of H.entries()){if(X+=U,
|
|
46
|
-
`?(Y&&(X
|
|
47
|
-
`&&(q&&B&&(X+=
|
|
44
|
+
if (condition) { yield value; }`)};import{Buffer as wH}from"node:buffer";import{StringDecoder as EH}from"node:string_decoder";var v4=($,J,Z)=>{if(Z)return;if($)return{transform:AH.bind(void 0,new TextEncoder)};let X=new EH(J);return{transform:hH.bind(void 0,X),final:NH.bind(void 0,X)}},AH=function*($,J){if(wH.isBuffer(J))yield e0(J);else if(typeof J==="string")yield $.encode(J);else yield J},hH=function*($,J){yield B0(J)?$.write(J):J},NH=function*($){let J=$.end();if(J!=="")yield J};import{callbackify as LJ}from"node:util";var z3=LJ(async($,J,Z,X)=>{J.currentIterable=$(...Z);try{for await(let q of J.currentIterable)X.push(q)}finally{delete J.currentIterable}}),S4=async function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=vH}=J[Z];for await(let q of X($))yield*S4(q,J,Z+1)},_J=async function*($){for(let[J,{final:Z}]of Object.entries($))yield*DH(Z,Number(J),$)},DH=async function*($,J,Z){if($===void 0)return;for await(let X of $())yield*S4(X,Z,J+1)},RJ=LJ(async({currentIterable:$},J)=>{if($!==void 0){await(J?$.throw(J):$.return());return}if(J)throw J}),vH=function*($){yield $};var K3=($,J,Z,X)=>{try{for(let q of $(...J))Z.push(q);X()}catch(q){X(q)}},TJ=($,J)=>[...J.flatMap((Z)=>[...j1(Z,$,0)]),...M$($)],j1=function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=fH}=J[Z];for(let q of X($))yield*j1(q,J,Z+1)},M$=function*($){for(let[J,{final:Z}]of Object.entries($))yield*SH(Z,Number(J),$)},SH=function*($,J,Z){if($===void 0)return;for(let X of $())yield*j1(X,Z,J+1)},fH=function*($){yield $};var B3=({value:$,value:{transform:J,final:Z,writableObjectMode:X,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=CJ($,Q,Y),K=F1(J),U=F1(Z),B=K?z3.bind(void 0,S4,G):K3.bind(void 0,j1),W=K||U?z3.bind(void 0,_J,G):K3.bind(void 0,M$),_=K||U?RJ.bind(void 0,G):void 0;return{stream:new kH({writableObjectMode:X,writableHighWaterMark:MJ(X),readableObjectMode:q,readableHighWaterMark:MJ(q),transform(L,P,x){B([L,H,0],this,x)},flush(L){W([H],this,L)},destroy:_})}},f4=($,J,Z,X)=>{let q=J.filter(({type:Q})=>Q==="generator"),Y=X?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=CJ(Q,Z,G);$=TJ(H,$)}return $},CJ=({transform:$,final:J,binary:Z,writableObjectMode:X,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:UJ(X,G)},v4(Z,Q,X),D4(Z,Y,X,H),{transform:$,final:J},{transform:WJ(q,G)},BJ({binary:Z,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var FJ=($,J)=>{for(let Z of bH($))yH($,Z,J)},bH=($)=>new Set(Object.entries($).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),yH=($,J,Z)=>{let{stdioItems:X}=$[J],q=X.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(J!==0){let[{type:G,optionName:H}]=q;throw TypeError(`Only the \`stdin\` option, not \`${H}\`, can be ${H1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>gH(G,X));Z.input=B$(Q)},gH=($,J)=>{let Z=f4($,J,"utf8",!0);return uH(Z),B$(Z)},uH=($)=>{let J=$.find((Z)=>typeof Z!=="string"&&!B0(Z));if(J!==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: ${J}.`)};import{writeFileSync as dH,appendFileSync as lH}from"node:fs";var k4=({stdioItems:$,encoding:J,verboseInfo:Z,fdNumber:X})=>X!=="all"&&c1(Z,X)&&!j0.has(J)&&mH(X)&&($.some(({type:q,value:Y})=>q==="native"&&cH.has(Y))||$.every(({type:q})=>N0.has(q))),mH=($)=>$===1||$===2,cH=new Set(["pipe","overlapped"]),jJ=async($,J,Z,X)=>{for await(let q of $)if(!pH(J))PJ(q,Z,X)},xJ=($,J,Z)=>{for(let X of $)PJ(X,J,Z)},pH=($)=>$._readableState.pipes.length>0,PJ=($,J,Z)=>{let X=n$($);p0({type:"output",verboseMessage:X,fdNumber:J,verboseInfo:Z})};var IJ=({fileDescriptors:$,syncResult:{output:J},options:Z,isMaxBuffer:X,verboseInfo:q})=>{if(J===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:J.map((H,K)=>nH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:X,verboseInfo:q},Z)),...Y}},nH=({result:$,fileDescriptors:J,fdNumber:Z,state:X,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:K,stripFinalNewline:U,maxBuffer:B})=>{if($===null)return;let W=O5($,Y,B),_=e0(W),{stdioItems:R,objectMode:L}=J[Z],P=iH([_],R,H,X),{serializedResult:x,finalResult:N=x}=oH({chunks:P,objectMode:L,encoding:H,lines:K,stripFinalNewline:U,fdNumber:Z});tH({serializedResult:x,fdNumber:Z,state:X,verboseInfo:Q,encoding:H,stdioItems:R,objectMode:L});let c=G[Z]?N:void 0;try{if(X.error===void 0)aH(x,R,q);return c}catch(F){return X.error=F,c}},iH=($,J,Z,X)=>{try{return f4($,J,Z,!1)}catch(q){return X.error=q,$}},oH=({chunks:$,objectMode:J,encoding:Z,lines:X,stripFinalNewline:q,fdNumber:Y})=>{if(J)return{serializedResult:$};if(Z==="buffer")return{serializedResult:B$($)};let Q=u6($,Z);if(X[Y])return{serializedResult:Q,finalResult:H3(Q,!q[Y],J)};return{serializedResult:Q}},tH=({serializedResult:$,fdNumber:J,state:Z,verboseInfo:X,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!k4({stdioItems:Y,encoding:q,verboseInfo:X,fdNumber:J}))return;let G=H3($,!1,Q);try{xJ(G,J,X)}catch(H){Z.error??=H}},aH=($,J,Z)=>{for(let{path:X,append:q}of J.filter(({type:Y})=>h4.has(Y))){let Y=typeof X==="string"?X:X.toString();if(q||Z.has(Y))lH(X,$);else Z.add(Y),dH(X,$)}};var OJ=([,$,J],Z)=>{if(!Z.all)return;if($===void 0)return J;if(J===void 0)return $;if(Array.isArray($))return Array.isArray(J)?[...$,...J]:[...$,X1(J,Z,"all")];if(Array.isArray(J))return[X1($,Z,"all"),...J];if(B0($)&&B0(J))return R2([$,J]);return`${$}${J}`};import{once as U3}from"node:events";var wJ=async($,J)=>{let[Z,X]=await rH($);return J.isForcefullyTerminated??=!1,[Z,X]},rH=async($)=>{let[J,Z]=await Promise.allSettled([U3($,"spawn"),U3($,"exit")]);if(J.status==="rejected")return[];return Z.status==="rejected"?EJ($):Z.value},EJ=async($)=>{try{return await U3($,"exit")}catch{return EJ($)}},AJ=async($)=>{let[J,Z]=await $;if(!sH(J,Z)&&W3(J,Z))throw new d0;return[J,Z]},sH=($,J)=>$===void 0&&J===void 0,W3=($,J)=>$!==0||J!==null;var hJ=({error:$,status:J,signal:Z,output:X},{maxBuffer:q})=>{let Y=eH($,J,Z),Q=Y?.code==="ETIMEDOUT",G=I5(Y,X,q);return{resultError:Y,exitCode:J,signal:Z,timedOut:Q,isMaxBuffer:G}},eH=($,J,Z)=>{if($!==void 0)return $;return W3(J,Z)?new d0:void 0};var NJ=($,J,Z)=>{let{file:X,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:U}=Jz($,J,Z),B=Qz({file:X,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:U,startTime:G});return r1(B,H,K)},Jz=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=o$($,J,Z),G=Zz(Z),{file:H,commandArguments:K,options:U}=R4($,J,G);Xz(U);let B=GJ(U,Q);return{file:H,commandArguments:K,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},Zz=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,Xz=({ipc:$,ipcInput:J,detached:Z,cancelSignal:X})=>{if(J)b4("ipcInput");if($)b4("ipc: true");if(Z)b4("detached: true");if(X)b4("cancelSignal")},b4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},Qz=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=qz({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:K,exitCode:U,signal:B,timedOut:W,isMaxBuffer:_}=hJ(H,Z),{output:R,error:L=K}=IJ({fileDescriptors:Q,syncResult:H,options:Z,isMaxBuffer:_,verboseInfo:Y}),P=R.map((N,c)=>X1(N,Z,c)),x=X1(OJ(R,Z),Z,"all");return Gz({error:L,exitCode:U,signal:B,timedOut:W,isMaxBuffer:_,stdio:P,all:x,options:Z,command:X,escapedCommand:q,startTime:G})},qz=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{FJ(Y,Z);let G=Yz(Z);return $z(...T4($,J,G))}catch(G){return a1({error:G,command:X,escapedCommand:q,fileDescriptors:Y,options:Z,startTime:Q,isSync:!0})}},Yz=({encoding:$,maxBuffer:J,...Z})=>({...Z,encoding:"buffer",maxBuffer:O4(J)}),Gz=({error:$,exitCode:J,signal:Z,timedOut:X,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:U})=>$===void 0?w4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U}):T$({error:$,command:H,escapedCommand:K,timedOut:X,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:J,signal:Z,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U,isSync:!0});import{setMaxListeners as oK}from"node:events";import{spawn as tK}from"node:child_process";import kJ from"node:process";import{once as V3,on as Hz}from"node:events";var DJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0,filter:Y}={})=>{return l1({methodName:"getOneMessage",isSubprocess:Z,ipc:X,isConnected:B4($)}),zz({anyProcess:$,channel:J,isSubprocess:Z,filter:Y,reference:q})},zz=async({anyProcess:$,channel:J,isSubprocess:Z,filter:X,reference:q})=>{G4(J,q);let Y=G1($,J,Z),Q=new AbortController;try{return await Promise.race([Kz(Y,X,Q),Bz(Y,Z,Q),Uz(Y,Z,Q)])}catch(G){throw n1($),G}finally{Q.abort(),H4(J,q)}},Kz=async($,J,{signal:Z})=>{if(J===void 0){let[X]=await V3($,"message",{signal:Z});return X}for await(let[X]of Hz($,"message",{signal:Z}))if(J(X))return X},Bz=async($,J,{signal:Z})=>{await V3($,"disconnect",{signal:Z}),R8(J)},Uz=async($,J,{signal:Z})=>{let[X]=await V3($,"strict:error",{signal:Z});throw Q4(X,J)};import{once as SJ,on as Wz}from"node:events";var fJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0}={})=>L3({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:!Z,reference:q}),L3=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:q,reference:Y})=>{l1({methodName:"getEachMessage",isSubprocess:Z,ipc:X,isConnected:B4($)}),G4(J,Y);let Q=G1($,J,Z),G=new AbortController,H={};return Vz($,Q,G),Lz({ipcEmitter:Q,isSubprocess:Z,controller:G,state:H}),_z({anyProcess:$,channel:J,ipcEmitter:Q,isSubprocess:Z,shouldAwait:q,controller:G,state:H,reference:Y})},Vz=async($,J,Z)=>{try{await SJ(J,"disconnect",{signal:Z.signal}),Z.abort()}catch{}},Lz=async({ipcEmitter:$,isSubprocess:J,controller:Z,state:X})=>{try{let[q]=await SJ($,"strict:error",{signal:Z.signal});X.error=Q4(q,J),Z.abort()}catch{}},_z=async function*({anyProcess:$,channel:J,ipcEmitter:Z,isSubprocess:X,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of Wz(Z,"message",{signal:Y.signal}))vJ(Q),yield H}catch{vJ(Q)}finally{if(Y.abort(),H4(J,G),!X)n1($);if(q)await $}},vJ=({error:$})=>{if($)throw $};var bJ=($,{ipc:J})=>{Object.assign($,gJ($,!1,J))},yJ=()=>{let $=kJ,J=!0,Z=kJ.channel!==void 0;return{...gJ($,!0,Z),getCancelSignal:d8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:Z})}},gJ=($,J,Z)=>({sendMessage:L4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getOneMessage:DJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getEachMessage:fJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z})});import{ChildProcess as Rz}from"node:child_process";import{PassThrough as Tz,Readable as Mz,Writable as Cz,Duplex as Fz}from"node:stream";var uJ=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,verboseInfo:Q})=>{q3(X);let G=new Rz;jz(G,X),Object.assign(G,{readable:xz,writable:Pz,duplex:Iz});let H=a1({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:!1}),K=Oz(H,Q,q);return{subprocess:G,promise:K}},jz=($,J)=>{let Z=C$(),X=C$(),q=C$(),Y=Array.from({length:J.length-3},C$),Q=C$(),G=[Z,X,q,...Y];Object.assign($,{stdin:Z,stdout:X,stderr:q,all:Q,stdio:G})},C$=()=>{let $=new Tz;return $.end(),$},xz=()=>new Mz({read(){}}),Pz=()=>new Cz({write(){}}),Iz=()=>new Fz({read(){},write(){}}),Oz=async($,J,Z)=>r1($,J,Z);import{createReadStream as mJ,createWriteStream as cJ}from"node:fs";import{Buffer as wz}from"node:buffer";import{Readable as F$,Writable as Ez,Duplex as Az}from"node:stream";var dJ=($,J)=>N4(hz,$,J,!1),j$=({type:$,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${H1[$]}.`)},pJ={fileNumber:j$,generator:B3,asyncGenerator:B3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:J,readableObjectMode:Z}}){let X=J||Z;return{stream:Az.fromWeb($,{objectMode:X})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},hz={input:{...pJ,fileUrl:({value:$})=>({stream:mJ($)}),filePath:({value:{file:$}})=>({stream:mJ($)}),webStream:({value:$})=>({stream:F$.fromWeb($)}),iterable:({value:$})=>({stream:F$.from($)}),asyncIterable:({value:$})=>({stream:F$.from($)}),string:({value:$})=>({stream:F$.from($)}),uint8Array:({value:$})=>({stream:F$.from(wz.from($))})},output:{...pJ,fileUrl:({value:$})=>({stream:cJ($)}),filePath:({value:{file:$,append:J}})=>({stream:cJ($,J?{flags:"a"}:{})}),webStream:({value:$})=>({stream:Ez.fromWeb($)}),iterable:j$,asyncIterable:j$,string:j$,uint8Array:j$}};import{on as Nz,once as lJ}from"node:events";import{PassThrough as Dz,getDefaultHighWaterMark as vz}from"node:stream";import{finished as oJ}from"node:stream/promises";function x1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)_3(q);let J=$.some(({readableObjectMode:q})=>q),Z=Sz($,J),X=new tJ({objectMode:J,writableHighWaterMark:Z,readableHighWaterMark:Z});for(let q of $)X.add(q);return X}var Sz=($,J)=>{if($.length===0)return vz(J);let Z=$.filter(({readableObjectMode:X})=>X===J).map(({readableHighWaterMark:X})=>X);return Math.max(...Z)};class tJ extends Dz{#J=new Set([]);#Z=new Set([]);#$=new Set([]);#X;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(_3($),this.#J.has($))return;this.#J.add($),this.#X??=fz(this,this.#J,this.#q);let J=yz({passThroughStream:this,stream:$,streams:this.#J,ended:this.#Z,aborted:this.#$,onFinished:this.#X,unpipeEvent:this.#q});this.#Q.set($,J),$.pipe(this,{end:!1})}async remove($){if(_3($),!this.#J.has($))return!1;let J=this.#Q.get($);if(J===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await J,!0}}var fz=async($,J,Z)=>{y4($,nJ);let X=new AbortController;try{await Promise.race([kz($,X),bz($,J,Z,X)])}finally{X.abort(),y4($,-nJ)}},kz=async($,{signal:J})=>{try{await oJ($,{signal:J,cleanup:!0})}catch(Z){throw aJ($,Z),Z}},bz=async($,J,Z,{signal:X})=>{for await(let[q]of Nz($,"unpipe",{signal:X}))if(J.has(q))q.emit(Z)},_3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},yz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,onFinished:Y,unpipeEvent:Q})=>{y4($,iJ);let G=new AbortController;try{await Promise.race([gz(Y,J,G),uz({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:G}),mz({stream:J,streams:Z,ended:X,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),y4($,-iJ)}if(Z.size>0&&Z.size===X.size+q.size)if(X.size===0&&q.size>0)R3($);else cz($)},gz=async($,J,{signal:Z})=>{try{if(await $,!Z.aborted)R3(J)}catch(X){if(!Z.aborted)aJ(J,X)}},uz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:{signal:Y}})=>{try{if(await oJ(J,{signal:Y,cleanup:!0,readable:!0,writable:!1}),Z.has(J))X.add(J)}catch(Q){if(Y.aborted||!Z.has(J))return;if(rJ(Q))q.add(J);else sJ($,Q)}},mz=async({stream:$,streams:J,ended:Z,aborted:X,unpipeEvent:q,controller:{signal:Y}})=>{if(await lJ($,q,{signal:Y}),!$.readable)return lJ(Y,"abort",{signal:Y});J.delete($),Z.delete($),X.delete($)},cz=($)=>{if($.writable)$.end()},aJ=($,J)=>{if(rJ(J))R3($);else sJ($,J)},rJ=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",R3=($)=>{if($.readable||$.writable)$.destroy()},sJ=($,J)=>{if(!$.destroyed)$.once("error",pz),$.destroy(J)},pz=()=>{},y4=($,J)=>{let Z=$.getMaxListeners();if(Z!==0&&Z!==Number.POSITIVE_INFINITY)$.setMaxListeners(Z+J)},nJ=2,iJ=1;import{finished as eJ}from"node:stream/promises";var e1=($,J)=>{$.pipe(J),dz($,J),lz($,J)},dz=async($,J)=>{if(y0($)||y0(J))return;try{await eJ($,{cleanup:!0,readable:!0,writable:!1})}catch{}T3(J)},T3=($)=>{if($.writable)$.end()},lz=async($,J)=>{if(y0($)||y0(J))return;try{await eJ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}M3($)},M3=($)=>{if($.readable)$.destroy()};var $Z=($,J,Z)=>{let X=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(J)){for(let{stream:G}of Y.filter(({type:H})=>N0.has(H)))nz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!N0.has(H)))oz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:X,controller:Z})}for(let[q,Y]of X.entries()){let Q=Y.length===1?Y[0]:x1(Y);e1(Q,q)}},nz=($,J,Z,X)=>{if(Z==="output")e1($.stdio[X],J);else e1(J,$.stdio[X]);let q=iz[X];if(q!==void 0)$[q]=J;$.stdio[X]=J},iz=["stdin","stdout","stderr"],oz=({subprocess:$,stream:J,direction:Z,fdNumber:X,pipeGroups:q,controller:Y})=>{if(J===void 0)return;tz(J,Y);let[Q,G]=Z==="output"?[J,$.stdio[X]]:[$.stdio[X],J],H=q.get(Q)??[];q.set(Q,[...H,G])},tz=($,{signal:J})=>{if(y0($))M1($,az,J)},az=2;import{addAbortListener as ez}from"node:events";var P1=[];P1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")P1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")P1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var g4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",C3=Symbol.for("signal-exit emitter"),F3=globalThis,rz=Object.defineProperty.bind(Object);class JZ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(F3[C3])return F3[C3];rz(F3,C3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,J){this.listeners[$].push(J)}removeListener($,J){let Z=this.listeners[$],X=Z.indexOf(J);if(X===-1)return;if(X===0&&Z.length===1)Z.length=0;else Z.splice(X,1)}emit($,J,Z){if(this.emitted[$])return!1;this.emitted[$]=!0;let X=!1;for(let q of this.listeners[$])X=q(J,Z)===!0||X;if($==="exit")X=this.emit("afterExit",J,Z)||X;return X}}class x3{}var sz=($)=>{return{onExit(J,Z){return $.onExit(J,Z)},load(){return $.load()},unload(){return $.unload()}}};class ZZ extends x3{onExit(){return()=>{}}load(){}unload(){}}class XZ extends x3{#J=j3.platform==="win32"?"SIGINT":"SIGHUP";#Z=new JZ;#$;#X;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let J of P1)this.#Q[J]=()=>{let Z=this.#$.listeners(J),{count:X}=this.#Z,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")X+=q.__signal_exit_emitter__.count;if(Z.length===X){this.unload();let Y=this.#Z.emit("exit",null,J),Q=J==="SIGHUP"?this.#J:J;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#X=$.emit}onExit($,J){if(!g4(this.#$))return()=>{};if(this.#Y===!1)this.load();let Z=J?.alwaysLast?"afterExit":"exit";return this.#Z.on(Z,$),()=>{if(this.#Z.removeListener(Z,$),this.#Z.listeners.exit.length===0&&this.#Z.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#Z.count+=1;for(let $ of P1)try{let J=this.#Q[$];if(J)this.#$.on($,J)}catch(J){}this.#$.emit=($,...J)=>{return this.#H($,...J)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,P1.forEach(($)=>{let J=this.#Q[$];if(!J)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,J)}catch(Z){}}),this.#$.emit=this.#X,this.#$.reallyExit=this.#q,this.#Z.count-=1}#G($){if(!g4(this.#$))return 0;return this.#$.exitCode=$||0,this.#Z.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...J){let Z=this.#X;if($==="exit"&&g4(this.#$)){if(typeof J[0]==="number")this.#$.exitCode=J[0];let X=Z.call(this.#$,$,...J);return this.#Z.emit("exit",this.#$.exitCode,null),X}else return Z.call(this.#$,$,...J)}}var j3=globalThis.process,{onExit:QZ,load:GF,unload:HF}=sz(g4(j3)?new XZ(j3):new ZZ);var qZ=($,{cleanup:J,detached:Z},{signal:X})=>{if(!J||Z)return;let q=QZ(()=>{$.kill()});ez(X,()=>{q()})};var GZ=({source:$,sourcePromise:J,boundOptions:Z,createNested:X},...q)=>{let Y=i$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:U}=$K(Z,X,q),{sourceStream:B,sourceError:W}=ZK($,K),{options:_,fileDescriptors:R}=n0.get($);return{sourcePromise:J,sourceStream:B,sourceOptions:_,sourceError:W,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:U,fileDescriptors:R,startTime:Y}},$K=($,J,Z)=>{try{let{destination:X,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=JK($,J,...Z),G=Y4(X,Y);return{destination:X,destinationStream:G,from:q,unpipeSignal:Q}}catch(X){return{destinationError:X}}},JK=($,J,Z,...X)=>{if(Array.isArray(Z))return{destination:J(YZ,$)(Z,...X),pipeOptions:$};if(typeof Z==="string"||Z instanceof URL||L2(Z)){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]=b$(Z,...X);return{destination:J(YZ)(q,Y,Q),pipeOptions:Q}}if(n0.has(Z)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:Z,pipeOptions:X[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${Z}`)},YZ=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),ZK=($,J)=>{try{return{sourceStream:i1($,J)}}catch(Z){return{sourceError:Z}}};var zZ=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=XK({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X});if(G!==void 0)throw P3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},XK=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X})=>{if(J!==void 0&&X!==void 0)return X;if(X!==void 0)return M3($),X;if(J!==void 0)return T3(Z),J},P3=({error:$,fileDescriptors:J,sourceOptions:Z,startTime:X})=>a1({error:$,command:HZ,escapedCommand:HZ,fileDescriptors:J,options:Z,startTime:X,isSync:!1}),HZ="source.pipe(destination)";var KZ=async($)=>{let[{status:J,reason:Z,value:X=Z},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(X))Q.pipedFrom.push(X);if(q==="rejected")throw Q;if(J==="rejected")throw X;return Q};import{finished as QK}from"node:stream/promises";var BZ=($,J,Z)=>{let X=u4.has(J)?YK($,J):qK($,J);return M1($,HK,Z.signal),M1(J,zK,Z.signal),GK(J),X},qK=($,J)=>{let Z=x1([$]);return e1(Z,J),u4.set(J,Z),Z},YK=($,J)=>{let Z=u4.get(J);return Z.add($),Z},GK=async($)=>{try{await QK($,{cleanup:!0,readable:!1,writable:!0})}catch{}u4.delete($)},u4=new WeakMap,HK=2,zK=1;import{aborted as KK}from"node:util";var UZ=($,J)=>$===void 0?[]:[BK($,J)],BK=async($,{sourceStream:J,mergedStream:Z,fileDescriptors:X,sourceOptions:q,startTime:Y})=>{await KK($,J),await Z.remove(J);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw P3({error:Q,fileDescriptors:X,sourceOptions:q,startTime:Y})};var m4=($,...J)=>{if(Q0(J[0]))return m4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...J[0]}});let{destination:Z,...X}=GZ($,...J),q=UK({...X,destination:Z});return q.pipe=m4.bind(void 0,{...$,source:Z,sourcePromise:q,boundOptions:{}}),q},UK=async({sourcePromise:$,sourceStream:J,sourceOptions:Z,sourceError:X,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let U=WK($,q);zZ({sourceStream:J,sourceError:X,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:Z,startTime:K});let B=new AbortController;try{let W=BZ(J,Y,B);return await Promise.race([KZ(U),...UZ(G,{sourceStream:J,mergedStream:W,sourceOptions:Z,fileDescriptors:H,startTime:K})])}finally{B.abort()}},WK=($,J)=>Promise.allSettled([$,J]);import{setImmediate as CK}from"node:timers/promises";import{on as VK}from"node:events";import{getDefaultHighWaterMark as LK}from"node:stream";var c4=({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:X,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return _K(J,Q),VZ({stream:$,controller:Q,binary:Z,shouldEncode:!$.readableObjectMode&&X,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},_K=async($,J)=>{try{await $}catch{}finally{J.abort()}},I3=({stream:$,onStreamEnd:J,lines:Z,encoding:X,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;RK(J,Q,$);let G=$.readableObjectMode&&!Y;return VZ({stream:$,controller:Q,binary:X==="buffer",shouldEncode:!G,encoding:X,shouldSplit:!G&&Z,preserveNewlines:!q})},RK=async($,J,Z)=>{try{await $}catch{Z.destroy()}finally{J.abort()}},VZ=({stream:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=VK($,"data",{signal:J.signal,highWaterMark:WZ,highWatermark:WZ});return TK({onStdoutChunk:G,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})},O3=LK(!0),WZ=O3,TK=async function*({onStdoutChunk:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=MK({binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*j1(H,G,0)}catch(H){if(!J.signal.aborted)throw H}finally{yield*M$(G)}},MK=({binary:$,shouldEncode:J,encoding:Z,shouldSplit:X,preserveNewlines:q})=>[v4($,Z,!J),D4($,q,!X,{})].filter(Boolean);var LZ=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:U})=>{let B=FK({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:G,verboseInfo:K,streamInfo:U});if(!q){await Promise.all([jK($),B]);return}let W=Y3(H,Z),_=I3({stream:$,onStreamEnd:J,lines:Q,encoding:X,stripFinalNewline:W,allMixed:G}),[R]=await Promise.all([xK({stream:$,iterable:_,fdNumber:Z,encoding:X,maxBuffer:Y,lines:Q}),B]);return R},FK=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!k4({stdioItems:Q[Z]?.stdioItems,encoding:X,verboseInfo:Y,fdNumber:Z}))return;let G=I3({stream:$,onStreamEnd:J,lines:!0,encoding:X,stripFinalNewline:!0,allMixed:q});await jJ(G,$,Z,Y)},jK=async($)=>{if(await CK(),$.readableFlowing===null)$.resume()},xK=async({stream:$,stream:{readableObjectMode:J},iterable:Z,fdNumber:X,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(J||Q)return await j4(Z,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await x4(Z,{maxBuffer:Y}));return await I4(Z,{maxBuffer:Y})}catch(G){return _Z(j5({error:G,stream:$,readableObjectMode:J,lines:Q,encoding:q,fdNumber:X}))}},w3=async($)=>{try{return await $}catch(J){return _Z(J)}},_Z=({bufferedData:$})=>y6($)?new Uint8Array($):$;import{finished as PK}from"node:stream/promises";var x$=async($,J,Z,{isSameDirection:X,stopOnExit:q=!1}={})=>{let Y=IK($,Z),Q=new AbortController;try{await Promise.race([...q?[Z.exitPromise]:[],PK($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)EK(G,J,Z,X)}finally{Q.abort()}},IK=($,{originalStreams:[J],subprocess:Z})=>{let X={stdinCleanedUp:!1};if($===J)OK($,Z,X);return X},OK=($,J,Z)=>{let{_destroy:X}=$;$._destroy=(...q)=>{wK(J,Z),X.call($,...q)}},wK=({exitCode:$,signalCode:J},Z)=>{if($!==null||J!==null)Z.stdinCleanedUp=!0},EK=($,J,Z,X)=>{if(!AK($,J,Z,X))throw $},AK=($,J,Z,X=!0)=>{if(Z.propagating)return RZ($)||p4($);return Z.propagating=!0,E3(Z,J)===X?RZ($):p4($)},E3=({fileDescriptors:$},J)=>J!=="all"&&$[J].direction==="input",p4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",RZ=($)=>$?.code==="EPIPE";var TZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>A3({stream:H,fdNumber:K,encoding:J,buffer:Z[K],maxBuffer:X[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),A3=async({stream:$,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let U=x$($,J,K);if(E3(K,J)){await U;return}let[B]=await Promise.all([LZ({stream:$,onStreamEnd:U,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K}),U]);return B};var MZ=({stdout:$,stderr:J},{all:Z})=>Z&&($||J)?x1([$,J].filter(Boolean)):void 0,CZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>A3({...hK($,Z),fdNumber:"all",encoding:J,maxBuffer:X[1]+X[2],lines:q[1]||q[2],allMixed:NK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),hK=({stdout:$,stderr:J,all:Z},[,X,q])=>{let Y=X||q;if(!Y)return{stream:Z,buffer:Y};if(!X)return{stream:J,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:Z,buffer:Y}},NK=({all:$,stdout:J,stderr:Z})=>$&&J&&Z&&J.readableObjectMode!==Z.readableObjectMode;import{once as DK}from"node:events";var FZ=($)=>c1($,"ipc"),jZ=($,J)=>{let Z=n$($);p0({type:"ipc",verboseMessage:Z,fdNumber:"ipc",verboseInfo:J})};var xZ=async({subprocess:$,buffer:J,maxBuffer:Z,ipc:X,ipcOutput:q,verboseInfo:Y})=>{if(!X)return q;let Q=FZ(Y),G=$1(J,"ipc"),H=$1(Z,"ipc");for await(let K of L3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:X,shouldAwait:!1,reference:!0})){if(G)x5($,q,H),q.push(K);if(Q)jZ(K,Y)}return q},PZ=async($,J)=>{return await Promise.allSettled([$]),J};var IZ=async({subprocess:$,options:{encoding:J,buffer:Z,maxBuffer:X,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:K,ipc:U,ipcInput:B},context:W,verboseInfo:_,fileDescriptors:R,originalStreams:L,onInternalError:P,controller:x})=>{let N=wJ($,W),c={originalStreams:L,fileDescriptors:R,subprocess:$,exitPromise:N,propagating:!1},F=TZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:c}),k=CZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:c}),l=[],t=xZ({subprocess:$,buffer:Z,maxBuffer:X,ipc:U,ipcOutput:l,verboseInfo:_}),T0=vK(L,$,c),n=SK(R,c);try{return await Promise.race([Promise.all([{},AJ(N),Promise.all(F),k,t,$5($,B),...T0,...n]),P,fK($,x),...t8($,Y,W,x),..._8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:W,controller:x}),...i8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:W,controller:x})])}catch(r0){return W.terminationReason??="other",Promise.all([{error:r0},N,Promise.all(F.map((E)=>w3(E))),w3(k),PZ(t,l),Promise.allSettled(T0),Promise.allSettled(n)])}},vK=($,J,Z)=>$.map((X,q)=>X===J.stdio[q]?void 0:x$(X,q,Z)),SK=($,J)=>$.flatMap(({stdioItems:Z},X)=>Z.filter(({value:q,stream:Y=q})=>u0(Y,{checkOpen:!1})&&!y0(Y)).map(({type:q,value:Y,stream:Q=Y})=>x$(Q,X,J,{isSameDirection:N0.has(q),stopOnExit:q==="native"}))),fK=async($,{signal:J})=>{let[Z]=await DK($,"error",{signal:J});throw Z};var OZ=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),P$=($,J,Z)=>{let X=$[Z];if(!X.has(J))X.set(J,[]);let q=X.get(J),Y=l0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},$$=async({resolve:$,promises:J},Z)=>{$();let[X]=await Promise.race([Promise.allSettled([!0,Z]),Promise.all([!1,...J])]);return!X};import{Readable as kK}from"node:stream";import{callbackify as bK}from"node:util";import{finished as wZ}from"node:stream/promises";var h3=async($)=>{if($===void 0)return;try{await N3($)}catch{}},EZ=async($)=>{if($===void 0)return;try{await D3($)}catch{}},N3=async($)=>{await wZ($,{cleanup:!0,readable:!1,writable:!0})},D3=async($)=>{await wZ($,{cleanup:!0,readable:!0,writable:!1})},d4=async($,J)=>{if(await $,J)throw J},l4=($,J,Z)=>{if(Z&&!p4(Z))$.destroy(Z);else if(J)$.destroy()};var AZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||j0.has(Z),{subprocessStdout:G,waitReadableDestroy:H}=v3($,X,J),{readableEncoding:K,readableObjectMode:U,readableHighWaterMark:B}=S3(G,Q),{read:W,onStdoutDataDone:_}=f3({subprocessStdout:G,subprocess:$,binary:Q,encoding:Z,preserveNewlines:Y}),R=new kK({read:W,destroy:bK(b3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:B,objectMode:U,encoding:K});return k3({subprocessStdout:G,onStdoutDataDone:_,readable:R,subprocess:$}),R},v3=($,J,Z)=>{let X=i1($,J),q=P$(Z,X,"readableDestroy");return{subprocessStdout:X,waitReadableDestroy:q}},S3=({readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z},X)=>X?{readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:O3},f3=({subprocessStdout:$,subprocess:J,binary:Z,encoding:X,preserveNewlines:q})=>{let Y=l0(),Q=c4({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:!Z,encoding:X,preserveNewlines:q});return{read(){yK(this,Q,Y)},onStdoutDataDone:Y}},yK=async($,J,Z)=>{try{let{value:X,done:q}=await J.next();if(q)Z.resolve();else $.push(X)}catch{}},k3=async({subprocessStdout:$,onStdoutDataDone:J,readable:Z,subprocess:X,subprocessStdin:q})=>{try{if(await D3($),await X,await h3(q),await J,Z.readable)Z.push(null)}catch(Y){await h3(q),hZ(Z,Y)}},b3=async({subprocessStdout:$,subprocess:J,waitReadableDestroy:Z},X)=>{if(await $$(Z,J))hZ($,X),await d4(J,X)},hZ=($,J)=>{l4($,$.readable,J)};import{Writable as gK}from"node:stream";import{callbackify as NZ}from"node:util";var DZ=({subprocess:$,concurrentStreams:J},{to:Z}={})=>{let{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}=y3($,Z,J),Q=new gK({...g3(X,$,q),destroy:NZ(m3.bind(void 0,{subprocessStdin:X,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:X.writableHighWaterMark,objectMode:X.writableObjectMode});return u3(X,Q),Q},y3=($,J,Z)=>{let X=Y4($,J),q=P$(Z,X,"writableFinal"),Y=P$(Z,X,"writableDestroy");return{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}},g3=($,J,Z)=>({write:uK.bind(void 0,$),final:NZ(mK.bind(void 0,$,J,Z))}),uK=($,J,Z,X)=>{if($.write(J,Z))X();else $.once("drain",X)},mK=async($,J,Z)=>{if(await $$(Z,J)){if($.writable)$.end();await J}},u3=async($,J,Z)=>{try{if(await N3($),J.writable)J.end()}catch(X){await EZ(Z),vZ(J,X)}},m3=async({subprocessStdin:$,subprocess:J,waitWritableFinal:Z,waitWritableDestroy:X},q)=>{if(await $$(Z,J),await $$(X,J))vZ($,q),await d4(J,q)},vZ=($,J)=>{l4($,$.writable,J)};import{Duplex as cK}from"node:stream";import{callbackify as pK}from"node:util";var SZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||j0.has(Z),{subprocessStdout:H,waitReadableDestroy:K}=v3($,X,J),{subprocessStdin:U,waitWritableFinal:B,waitWritableDestroy:W}=y3($,q,J),{readableEncoding:_,readableObjectMode:R,readableHighWaterMark:L}=S3(H,G),{read:P,onStdoutDataDone:x}=f3({subprocessStdout:H,subprocess:$,binary:G,encoding:Z,preserveNewlines:Q}),N=new cK({read:P,...g3(U,$,B),destroy:pK(dK.bind(void 0,{subprocessStdout:H,subprocessStdin:U,subprocess:$,waitReadableDestroy:K,waitWritableFinal:B,waitWritableDestroy:W})),readableHighWaterMark:L,writableHighWaterMark:U.writableHighWaterMark,readableObjectMode:R,writableObjectMode:U.writableObjectMode,encoding:_});return k3({subprocessStdout:H,onStdoutDataDone:x,readable:N,subprocess:$,subprocessStdin:U}),u3(U,N,H),N},dK=async({subprocessStdout:$,subprocessStdin:J,subprocess:Z,waitReadableDestroy:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([b3({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},Q),m3({subprocessStdin:J,subprocess:Z,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var c3=($,J,{from:Z,binary:X=!1,preserveNewlines:q=!1}={})=>{let Y=X||j0.has(J),Q=i1($,Z),G=c4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:J,preserveNewlines:q});return lK(G,Q,$)},lK=async function*($,J,Z){try{yield*$}finally{if(J.readable)J.destroy();await Z}};var fZ=($,{encoding:J})=>{let Z=OZ();$.readable=AZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.writable=DZ.bind(void 0,{subprocess:$,concurrentStreams:Z}),$.duplex=SZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.iterable=c3.bind(void 0,$,J),$[Symbol.asyncIterator]=c3.bind(void 0,$,J,{})};var kZ=($,J)=>{for(let[Z,X]of iK){let q=X.value.bind(J);Reflect.defineProperty($,Z,{...X,value:q})}},nK=(async()=>{})().constructor.prototype,iK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(nK,$)]);var bZ=($,J,Z,X)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:U,fileDescriptors:B}=aK($,J,Z),{subprocess:W,promise:_}=sK({file:q,commandArguments:Y,options:U,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:B});return W.pipe=m4.bind(void 0,{source:W,sourcePromise:_,boundOptions:{},createNested:X}),kZ(W,_),n0.set(W,{options:U,fileDescriptors:B}),W},aK=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=o$($,J,Z),{file:G,commandArguments:H,options:K}=R4($,J,Z),U=rK(K),B=dJ(U,Q);return{file:G,commandArguments:H,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},rK=({timeout:$,signal:J,...Z})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...Z,timeoutDuration:$}},sK=({file:$,commandArguments:J,options:Z,startTime:X,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=tK(...T4($,J,Z))}catch(R){return uJ({error:R,command:Y,escapedCommand:Q,fileDescriptors:G,options:Z,startTime:X,verboseInfo:q})}let K=new AbortController;oK(Number.POSITIVE_INFINITY,K.signal);let U=[...H.stdio];$Z(H,G,K),qZ(H,Z,K);let B={},W=l0();H.kill=V8.bind(void 0,{kill:H.kill.bind(H),options:Z,onInternalError:W,context:B,controller:K}),H.all=MZ(H,Z),fZ(H,Z),bJ(H,Z);let _=eK({subprocess:H,options:Z,startTime:X,verboseInfo:q,fileDescriptors:G,originalStreams:U,command:Y,escapedCommand:Q,context:B,onInternalError:W,controller:K});return{subprocess:H,promise:_}},eK=async({subprocess:$,options:J,startTime:Z,verboseInfo:X,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:K,controller:U})=>{let[B,[W,_],R,L,P]=await IZ({subprocess:$,options:J,context:H,verboseInfo:X,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:U});U.abort(),K.resolve();let x=R.map((F,k)=>X1(F,J,k)),N=X1(L,J,"all"),c=$B({errorInfo:B,exitCode:W,signal:_,stdio:x,all:N,ipcOutput:P,context:H,options:J,command:Q,escapedCommand:G,startTime:Z});return r1(c,X,J)},$B=({errorInfo:$,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:K,startTime:U})=>("error"in $)?T$({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:J,signal:Z,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U,isSync:!1}):w4({command:H,escapedCommand:K,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U});var n4=($,J)=>{let Z=Object.fromEntries(Object.entries(J).map(([X,q])=>[X,JB(X,$[X],q)]));return{...$,...Z}},JB=($,J,Z)=>{if(ZB.has($)&&Q0(J)&&Q0(Z))return{...J,...Z};return Z},ZB=new Set(["env",...F2]);var z1=($,J,Z,X)=>{let q=(Q,G,H)=>z1(Q,G,Z,H),Y=(...Q)=>XB({mapArguments:$,deepOptions:Z,boundOptions:J,setBoundExeca:X,createNested:q},...Q);if(X!==void 0)X(Y,q,J);return Y},XB=({mapArguments:$,deepOptions:J={},boundOptions:Z={},setBoundExeca:X,createNested:q},Y,...Q)=>{if(Q0(Y))return q($,n4(Z,Y),X);let{file:G,commandArguments:H,options:K,isSync:U}=QB({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:J,boundOptions:Z});return U?NJ(G,H,K):bZ(G,H,K,q)},QB=({mapArguments:$,firstArgument:J,nextArguments:Z,deepOptions:X,boundOptions:q})=>{let Y=d6(J)?l6(J,Z):[J,...Z],[Q,G,H]=b$(...Y),K=n4(n4(X,q),H),{file:U=Q,commandArguments:B=G,options:W=K,isSync:_=!1}=$({file:Q,commandArguments:G,options:K});return{file:U,commandArguments:B,options:W,isSync:_}};var yZ=({file:$,commandArguments:J})=>uZ($,J),gZ=({file:$,commandArguments:J})=>({...uZ($,J),isSync:!0}),uZ=($,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${J}.`);let[Z,...X]=qB($);return{file:Z,commandArguments:X}},qB=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let J=$.trim();if(J==="")return[];let Z=[];for(let X of J.split(YB)){let q=Z.at(-1);if(q&&q.endsWith("\\"))Z[Z.length-1]=`${q.slice(0,-1)} ${X}`;else Z.push(X)}return Z},YB=/ +/g;var mZ=($,J,Z)=>{$.sync=J(GB,Z),$.s=$.sync},cZ=({options:$})=>pZ($),GB=({options:$})=>({...pZ($),isSync:!0}),pZ=($)=>({options:{...HB($),...$}}),HB=({input:$,inputFile:J,stdio:Z})=>$===void 0&&J===void 0&&Z===void 0?{stdin:"inherit"}:{},dZ={preferLocal:!0};var lZ=z1(()=>({})),rx=z1(()=>({isSync:!0})),sx=z1(yZ),ex=z1(gZ),$P=z1(r8),JP=z1(cZ,{},dZ,mZ),{sendMessage:ZP,getOneMessage:XP,getEachMessage:QP,getCancelSignal:qP}=yJ();var R0=g1(d3(),1),qX=g1(t4(),1);import{stdin as XX,stdout as QX}from"node:process";import*as K1 from"node:readline";import tZ from"node:readline";import{Writable as VB}from"node:stream";function LB({onlyFirst:$=!1}={}){let J=["[\\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(J,$?void 0:"g")}var _B=LB();function YX($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(_B,"")}function GX($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var HX={exports:{}};(function($){var J={};$.exports=J,J.eastAsianWidth=function(X){var q=X.charCodeAt(0),Y=X.length==2?X.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"},J.characterLength=function(X){var q=this.eastAsianWidth(X);return q=="F"||q=="W"||q=="A"?2:1};function Z(X){return X.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}J.length=function(X){for(var q=Z(X),Y=0,Q=0;Q<q.length;Q++)Y=Y+this.characterLength(q[Q]);return Y},J.slice=function(X,q,Y){textLen=J.length(X),q=q||0,Y=Y||1,q<0&&(q=textLen+q),Y<0&&(Y=textLen+Y);for(var Q="",G=0,H=Z(X),K=0;K<H.length;K++){var U=H[K],B=J.length(U);if(G>=q-(B==2?1:0))if(G+B<=Y)Q+=U;else break;G+=B}return Q}})(HX);var RB=HX.exports,TB=GX(RB),MB=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},CB=GX(MB);function I$($,J={}){if(typeof $!="string"||$.length===0||(J={ambiguousIsNarrow:!0,...J},$=YX($),$.length===0))return 0;$=$.replace(CB()," ");let Z=J.ambiguousIsNarrow?1:2,X=0;for(let q of $){let Y=q.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(TB.eastAsianWidth(q)){case"F":case"W":X+=2;break;case"A":X+=Z;break;default:X+=1}}return X}var n3=10,aZ=($=0)=>(J)=>`\x1B[${J+$}m`,rZ=($=0)=>(J)=>`\x1B[${38+$};5;${J}m`,sZ=($=0)=>(J,Z,X)=>`\x1B[${38+$};2;${J};${Z};${X}m`,$0={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($0.modifier);var FB=Object.keys($0.color),jB=Object.keys($0.bgColor);[...FB,...jB];function xB(){let $=new Map;for(let[J,Z]of Object.entries($0)){for(let[X,q]of Object.entries(Z))$0[X]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},Z[X]=$0[X],$.set(q[0],q[1]);Object.defineProperty($0,J,{value:Z,enumerable:!1})}return Object.defineProperty($0,"codes",{value:$,enumerable:!1}),$0.color.close="\x1B[39m",$0.bgColor.close="\x1B[49m",$0.color.ansi=aZ(),$0.color.ansi256=rZ(),$0.color.ansi16m=sZ(),$0.bgColor.ansi=aZ(n3),$0.bgColor.ansi256=rZ(n3),$0.bgColor.ansi16m=sZ(n3),Object.defineProperties($0,{rgbToAnsi256:{value:(J,Z,X)=>J===Z&&Z===X?J<8?16:J>248?231:Math.round((J-8)/247*24)+232:16+36*Math.round(J/255*5)+6*Math.round(Z/255*5)+Math.round(X/255*5),enumerable:!1},hexToRgb:{value:(J)=>{let Z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(J.toString(16));if(!Z)return[0,0,0];let[X]=Z;X.length===3&&(X=[...X].map((Y)=>Y+Y).join(""));let q=Number.parseInt(X,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(J)=>$0.rgbToAnsi256(...$0.hexToRgb(J)),enumerable:!1},ansi256ToAnsi:{value:(J)=>{if(J<8)return 30+J;if(J<16)return 90+(J-8);let Z,X,q;if(J>=232)Z=((J-232)*10+8)/255,X=Z,q=Z;else{J-=16;let G=J%36;Z=Math.floor(J/36)/5,X=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(Z,X,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(X)<<1|Math.round(Z));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(J,Z,X)=>$0.ansi256ToAnsi($0.rgbToAnsi256(J,Z,X)),enumerable:!1},hexToAnsi:{value:(J)=>$0.ansi256ToAnsi($0.hexToAnsi256(J)),enumerable:!1}}),$0}var PB=xB(),s4=new Set(["\x1B",""]),IB=39,t3="\x07",zX="[",OB="]",KX="m",a3=`${OB}8;;`,eZ=($)=>`${s4.values().next().value}${zX}${$}${KX}`,$X=($)=>`${s4.values().next().value}${a3}${$}${t3}`,wB=($)=>$.split(" ").map((J)=>I$(J)),i3=($,J,Z)=>{let X=[...J],q=!1,Y=!1,Q=I$(YX($[$.length-1]));for(let[G,H]of X.entries()){let K=I$(H);if(Q+K<=Z?$[$.length-1]+=H:($.push(H),Q=0),s4.has(H)&&(q=!0,Y=X.slice(G+1).join("").startsWith(a3)),q){Y?H===t3&&(q=!1,Y=!1):H===KX&&(q=!1);continue}Q+=K,Q===Z&&G<X.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},EB=($)=>{let J=$.split(" "),Z=J.length;for(;Z>0&&!(I$(J[Z-1])>0);)Z--;return Z===J.length?$:J.slice(0,Z).join(" ")+J.slice(Z).join("")},AB=($,J,Z={})=>{if(Z.trim!==!1&&$.trim()==="")return"";let X="",q,Y,Q=wB($),G=[""];for(let[K,U]of $.split(" ").entries()){Z.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let B=I$(G[G.length-1]);if(K!==0&&(B>=J&&(Z.wordWrap===!1||Z.trim===!1)&&(G.push(""),B=0),(B>0||Z.trim===!1)&&(G[G.length-1]+=" ",B++)),Z.hard&&Q[K]>J){let W=J-B,_=1+Math.floor((Q[K]-W-1)/J);Math.floor((Q[K]-1)/J)<_&&G.push(""),i3(G,U,J);continue}if(B+Q[K]>J&&B>0&&Q[K]>0){if(Z.wordWrap===!1&&B<J){i3(G,U,J);continue}G.push("")}if(B+Q[K]>J&&Z.wordWrap===!1){i3(G,U,J);continue}G[G.length-1]+=U}Z.trim!==!1&&(G=G.map((K)=>EB(K)));let H=[...G.join(`
|
|
45
|
+
`)];for(let[K,U]of H.entries()){if(X+=U,s4.has(U)){let{groups:W}=new RegExp(`(?:\\${zX}(?<code>\\d+)m|\\${a3}(?<uri>.*)${t3})`).exec(H.slice(K).join(""))||{groups:{}};if(W.code!==void 0){let _=Number.parseFloat(W.code);q=_===IB?void 0:_}else W.uri!==void 0&&(Y=W.uri.length===0?void 0:W.uri)}let B=PB.codes.get(Number(q));H[K+1]===`
|
|
46
|
+
`?(Y&&(X+=$X("")),q&&B&&(X+=eZ(B))):U===`
|
|
47
|
+
`&&(q&&B&&(X+=eZ(q)),Y&&(X+=$X(Y)))}return X};function JX($,J,Z){return String($).normalize().replace(/\r\n/g,`
|
|
48
48
|
`).split(`
|
|
49
|
-
`).map((X)=>
|
|
50
|
-
`)}var
|
|
49
|
+
`).map((X)=>AB(X,J,Z)).join(`
|
|
50
|
+
`)}var hB=["up","down","left","right","space","enter","cancel"],r4={actions:new Set(hB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function r3($,J){if(typeof $=="string")return r4.aliases.get($)===J;for(let Z of $)if(Z!==void 0&&r3(Z,J))return!0;return!1}function NB($,J){if($===J)return;let Z=$.split(`
|
|
51
51
|
`),X=J.split(`
|
|
52
|
-
`),q=[];for(let Y=0;Y<Math.max(Z.length,X.length);Y++)Z[Y]!==X[Y]&&q.push(Y);return q}var
|
|
53
|
-
`),
|
|
54
|
-
`).length-1;this.output.write(
|
|
55
|
-
`);this.output.write(X[Z]),this._prevFrame=$,this.output.write(
|
|
52
|
+
`),q=[];for(let Y=0;Y<Math.max(Z.length,X.length);Y++)Z[Y]!==X[Y]&&q.push(Y);return q}var DB=globalThis.process.platform.startsWith("win"),o3=Symbol("clack:cancel");function J$($){return $===o3}function a4($,J){let Z=$;Z.isTTY&&Z.setRawMode(J)}function BX({input:$=XX,output:J=QX,overwrite:Z=!0,hideCursor:X=!0}={}){let q=K1.createInterface({input:$,output:J,prompt:"",tabSize:1});K1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let K=String(Q);if(r3([K,G,H],"cancel")){X&&J.write(R0.cursor.show),process.exit(0);return}if(!Z)return;K1.moveCursor(J,G==="return"?0:-1,G==="return"?-1:0,()=>{K1.clearLine(J,1,()=>{$.once("keypress",Y)})})};return X&&J.write(R0.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),X&&J.write(R0.cursor.show),$.isTTY&&!DB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var vB=Object.defineProperty,SB=($,J,Z)=>(J in $)?vB($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,x0=($,J,Z)=>(SB($,typeof J!="symbol"?J+"":J,Z),Z);class e4{constructor($,J=!0){x0(this,"input"),x0(this,"output"),x0(this,"_abortSignal"),x0(this,"rl"),x0(this,"opts"),x0(this,"_render"),x0(this,"_track",!1),x0(this,"_prevFrame",""),x0(this,"_subscribers",new Map),x0(this,"_cursor",0),x0(this,"state","initial"),x0(this,"error",""),x0(this,"value");let{input:Z=XX,output:X=QX,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=J,this._abortSignal=Y,this.input=Z,this.output=X}unsubscribe(){this._subscribers.clear()}setSubscriber($,J){let Z=this._subscribers.get($)??[];Z.push(J),this._subscribers.set($,Z)}on($,J){this.setSubscriber($,{cb:J})}once($,J){this.setSubscriber($,{cb:J,once:!0})}emit($,...J){let Z=this._subscribers.get($)??[],X=[];for(let q of Z)q.cb(...J),q.once&&X.push(()=>Z.splice(Z.indexOf(q),1));for(let q of X)q()}prompt(){return new Promise(($,J)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(o3);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let Z=new VB;Z._write=(X,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(Z),this.rl=tZ.createInterface({input:this.input,output:Z,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),tZ.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),a4(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(R0.cursor.show),this.output.off("resize",this.render),a4(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(R0.cursor.show),this.output.off("resize",this.render),a4(this.input,!1),$(o3)})})}onKeypress($,J){if(this.state==="error"&&(this.state="active"),J?.name&&(!this._track&&r4.aliases.has(J.name)&&this.emit("cursor",r4.aliases.get(J.name)),r4.actions.has(J.name)&&this.emit("cursor",J.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()),J?.name==="return"){if(this.opts.validate){let Z=this.opts.validate(this.value);Z&&(this.error=Z instanceof Error?Z.message:Z,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}r3([$,J?.name,J?.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
|
+
`),a4(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=JX(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
54
|
+
`).length-1;this.output.write(R0.cursor.move(-999,$*-1))}render(){let $=JX(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(R0.cursor.hide);else{let J=NB(this._prevFrame,$);if(this.restoreCursor(),J&&J?.length===1){let Z=J[0];this.output.write(R0.cursor.move(0,Z)),this.output.write(R0.erase.lines(1));let X=$.split(`
|
|
55
|
+
`);this.output.write(X[Z]),this._prevFrame=$,this.output.write(R0.cursor.move(0,X.length-Z-1));return}if(J&&J?.length>1){let Z=J[0];this.output.write(R0.cursor.move(0,Z)),this.output.write(R0.erase.down());let X=$.split(`
|
|
56
56
|
`).slice(Z);this.output.write(X.join(`
|
|
57
|
-
`)),this._prevFrame=$;return}this.output.write(
|
|
58
|
-
${
|
|
59
|
-
`,Z=$.placeholder?
|
|
60
|
-
${
|
|
61
|
-
${
|
|
62
|
-
`;case"submit":return`${J}${
|
|
63
|
-
${
|
|
64
|
-
${
|
|
65
|
-
`}}}).prompt();var
|
|
66
|
-
${
|
|
67
|
-
|
|
68
|
-
${
|
|
69
|
-
${
|
|
70
|
-
${
|
|
71
|
-
|
|
57
|
+
`)),this._prevFrame=$;return}this.output.write(R0.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class s3 extends e4{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",(J)=>{this.output.write(R0.cursor.move(0,-1)),this.value=J,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var fB;fB=new WeakMap;var kB=Object.defineProperty,bB=($,J,Z)=>(J in $)?kB($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,ZX=($,J,Z)=>(bB($,typeof J!="symbol"?J+"":J,Z),Z);class e3 extends e4{constructor($){super($,!1),ZX(this,"options"),ZX(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:J})=>J===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(J)=>{switch(J){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 e4{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),[J,...Z]=this.value.slice(this.cursor);return`${$}${qX.default.inverse(J)}${Z.join("")}`}get cursor(){return this._cursor}constructor($){super($),this.on("finalize",()=>{this.value||(this.value=$.defaultValue)})}}var I=g1(t4(),1),$2=g1(d3(),1);import m0 from"node:process";function yB(){return m0.platform!=="win32"?m0.env.TERM!=="linux":!!m0.env.CI||!!m0.env.WT_SESSION||!!m0.env.TERMINUS_SUBLIME||m0.env.ConEmuTask==="{cmd::Cmder}"||m0.env.TERM_PROGRAM==="Terminus-Sublime"||m0.env.TERM_PROGRAM==="vscode"||m0.env.TERM==="xterm-256color"||m0.env.TERM==="alacritty"||m0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var J6=yB(),q0=($,J)=>J6?$:J,gB=q0("◆","*"),UX=q0("■","x"),WX=q0("▲","x"),Q6=q0("◇","o"),uB=q0("┌","T"),J0=q0("│","|"),Z$=q0("└","—"),Z6=q0("●",">"),X6=q0("○"," "),CP=q0("◻","[•]"),FP=q0("◼","[+]"),jP=q0("◻","[ ]"),xP=q0("▪","•"),PP=q0("─","-"),IP=q0("╮","+"),OP=q0("├","+"),wP=q0("╯","+"),mB=q0("●","•"),cB=q0("◆","*"),pB=q0("▲","!"),dB=q0("■","x"),q6=($)=>{switch($){case"initial":case"active":return I.default.cyan(gB);case"cancel":return I.default.red(UX);case"error":return I.default.yellow(WX);case"submit":return I.default.green(Q6)}},lB=($)=>{let{cursor:J,options:Z,style:X}=$,q=$.maxItems??Number.POSITIVE_INFINITY,Y=Math.max(process.stdout.rows-4,0),Q=Math.min(Y,Math.max(q,5)),G=0;J>=G+Q-3?G=Math.max(Math.min(J-Q+3,Z.length-Q),0):J<G+2&&(G=Math.max(J-2,0));let H=Q<Z.length&&G>0,K=Q<Z.length&&G+Q<Z.length;return Z.slice(G,G+Q).map((U,B,W)=>{let _=B===0&&H,R=B===W.length-1&&K;return _||R?I.default.dim("..."):X(U,B+G===J)})},VX=($)=>new $6({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let J=`${I.default.gray(J0)}
|
|
58
|
+
${q6(this.state)} ${$.message}
|
|
59
|
+
`,Z=$.placeholder?I.default.inverse($.placeholder[0])+I.default.dim($.placeholder.slice(1)):I.default.inverse(I.default.hidden("_")),X=this.value?this.valueWithCursor:Z;switch(this.state){case"error":return`${J.trim()}
|
|
60
|
+
${I.default.yellow(J0)} ${X}
|
|
61
|
+
${I.default.yellow(Z$)} ${I.default.yellow(this.error)}
|
|
62
|
+
`;case"submit":return`${J}${I.default.gray(J0)} ${I.default.dim(this.value||$.placeholder)}`;case"cancel":return`${J}${I.default.gray(J0)} ${I.default.strikethrough(I.default.dim(this.value??""))}${this.value?.trim()?`
|
|
63
|
+
${I.default.gray(J0)}`:""}`;default:return`${J}${I.default.cyan(J0)} ${X}
|
|
64
|
+
${I.default.cyan(Z$)}
|
|
65
|
+
`}}}).prompt();var LX=($)=>{let J=$.active??"Yes",Z=$.inactive??"No";return new s3({active:J,inactive:Z,initialValue:$.initialValue??!0,render(){let X=`${I.default.gray(J0)}
|
|
66
|
+
${q6(this.state)} ${$.message}
|
|
67
|
+
`,q=this.value?J:Z;switch(this.state){case"submit":return`${X}${I.default.gray(J0)} ${I.default.dim(q)}`;case"cancel":return`${X}${I.default.gray(J0)} ${I.default.strikethrough(I.default.dim(q))}
|
|
68
|
+
${I.default.gray(J0)}`;default:return`${X}${I.default.cyan(J0)} ${this.value?`${I.default.green(Z6)} ${J}`:`${I.default.dim(X6)} ${I.default.dim(J)}`} ${I.default.dim("/")} ${this.value?`${I.default.dim(X6)} ${I.default.dim(Z)}`:`${I.default.green(Z6)} ${Z}`}
|
|
69
|
+
${I.default.cyan(Z$)}
|
|
70
|
+
`}}}).prompt()},_X=($)=>{let J=(Z,X)=>{let q=Z.label??String(Z.value);switch(X){case"selected":return`${I.default.dim(q)}`;case"active":return`${I.default.green(Z6)} ${q} ${Z.hint?I.default.dim(`(${Z.hint})`):""}`;case"cancelled":return`${I.default.strikethrough(I.default.dim(q))}`;default:return`${I.default.dim(X6)} ${I.default.dim(q)}`}};return new e3({options:$.options,initialValue:$.initialValue,render(){let Z=`${I.default.gray(J0)}
|
|
71
|
+
${q6(this.state)} ${$.message}
|
|
72
|
+
`;switch(this.state){case"submit":return`${Z}${I.default.gray(J0)} ${J(this.options[this.cursor],"selected")}`;case"cancel":return`${Z}${I.default.gray(J0)} ${J(this.options[this.cursor],"cancelled")}
|
|
73
|
+
${I.default.gray(J0)}`;default:return`${Z}${I.default.cyan(J0)} ${lB({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(X,q)=>J(X,q?"active":"inactive")}).join(`
|
|
74
|
+
${I.default.cyan(J0)} `)}
|
|
75
|
+
${I.default.cyan(Z$)}
|
|
76
|
+
`}}}).prompt()};var Y6=($="")=>{process.stdout.write(`${I.default.gray(Z$)} ${I.default.red($)}
|
|
72
77
|
|
|
73
|
-
`)},
|
|
74
|
-
`)},
|
|
75
|
-
${
|
|
78
|
+
`)},RX=($="")=>{process.stdout.write(`${I.default.gray(uB)} ${$}
|
|
79
|
+
`)},TX=($="")=>{process.stdout.write(`${I.default.gray(J0)}
|
|
80
|
+
${I.default.gray(Z$)} ${$}
|
|
76
81
|
|
|
77
|
-
`)},
|
|
78
|
-
`);Z.push(`${J} ${X}`,...q.map((Y)=>`${
|
|
82
|
+
`)},P0={message:($="",{symbol:J=I.default.gray(J0)}={})=>{let Z=[`${I.default.gray(J0)}`];if($){let[X,...q]=$.split(`
|
|
83
|
+
`);Z.push(`${J} ${X}`,...q.map((Y)=>`${I.default.gray(J0)} ${Y}`))}process.stdout.write(`${Z.join(`
|
|
79
84
|
`)}
|
|
80
|
-
`)},info:($)=>{
|
|
85
|
+
`)},info:($)=>{P0.message($,{symbol:I.default.blue(mB)})},success:($)=>{P0.message($,{symbol:I.default.green(cB)})},step:($)=>{P0.message($,{symbol:I.default.green(Q6)})},warn:($)=>{P0.message($,{symbol:I.default.yellow(pB)})},warning:($)=>{P0.warn($)},error:($)=>{P0.message($,{symbol:I.default.red(dB)})}},EP=`${I.default.gray(J0)} `;var G6=({indicator:$="dots"}={})=>{let J=J6?["◒","◐","◓","◑"]:["•","o","O","0"],Z=J6?80:120,X=process.env.CI==="true",q,Y,Q=!1,G="",H,K=performance.now(),U=(F)=>{let k=F>1?"Something went wrong":"Canceled";Q&&c(k,F)},B=()=>U(2),W=()=>U(1),_=()=>{process.on("uncaughtExceptionMonitor",B),process.on("unhandledRejection",B),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",U)},R=()=>{process.removeListener("uncaughtExceptionMonitor",B),process.removeListener("unhandledRejection",B),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",U)},L=()=>{if(H===void 0)return;X&&process.stdout.write(`
|
|
81
86
|
`);let F=H.split(`
|
|
82
|
-
`);process.stdout.write(
|
|
83
|
-
`);let
|
|
87
|
+
`);process.stdout.write($2.cursor.move(-999,F.length-1)),process.stdout.write($2.erase.down(F.length))},P=(F)=>F.replace(/\.+$/,""),x=(F)=>{let k=(performance.now()-F)/1000,l=Math.floor(k/60),t=Math.floor(k%60);return l>0?`[${l}m ${t}s]`:`[${t}s]`},N=(F="")=>{Q=!0,q=BX(),G=P(F),K=performance.now(),process.stdout.write(`${I.default.gray(J0)}
|
|
88
|
+
`);let k=0,l=0;_(),Y=setInterval(()=>{if(X&&G===H)return;L(),H=G;let t=I.default.magenta(J[k]);if(X)process.stdout.write(`${t} ${G}...`);else if($==="timer")process.stdout.write(`${t} ${G} ${x(K)}`);else{let T0=".".repeat(Math.floor(l)).slice(0,3);process.stdout.write(`${t} ${G}${T0}`)}k=k+1<J.length?k+1:0,l=l<J.length?l+0.125:0},Z)},c=(F="",k=0)=>{Q=!1,clearInterval(Y),L();let l=k===0?I.default.green(Q6):k===1?I.default.red(UX):I.default.red(WX);G=P(F??G),$==="timer"?process.stdout.write(`${l} ${G} ${x(K)}
|
|
84
89
|
`):process.stdout.write(`${l} ${G}
|
|
85
|
-
`),R(),q()};return{start:
|
|
86
|
-
`).map((X)=>X.split("\t")),Z=0;return J.forEach((X)=>{if(X.length>1&&
|
|
87
|
-
`)}rowToString($,J){return this.rasterize($).forEach((Z,X)=>{let q="";Z.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),K=Y;if(H>
|
|
90
|
+
`),R(),q()};return{start:N,stop:c,message:(F="")=>{G=P(F??G)}}};var D$=g1(t4(),1);import{notStrictEqual as VU,strictEqual as LU}from"assert";var iB={right:aB,center:rB};class CX{constructor($){var J;this.width=$.width,this.wrap=(J=$.wrap)!==null&&J!==void 0?J:!0,this.rows=[]}span(...$){let J=this.div(...$);J.span=!0}resetOutput(){this.rows=[]}div(...$){if($.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...$)&&typeof $[0]==="string")return this.applyLayoutDSL($[0]);let J=$.map((Z)=>{if(typeof Z==="string")return this.colFromString(Z);return Z});return this.rows.push(J),J}shouldApplyLayoutDSL(...$){return $.length===1&&typeof $[0]==="string"&&/[\t\n]/.test($[0])}applyLayoutDSL($){let J=$.split(`
|
|
91
|
+
`).map((X)=>X.split("\t")),Z=0;return J.forEach((X)=>{if(X.length>1&&I0.stringWidth(X[0])>Z)Z=Math.min(Math.floor(this.width*0.5),I0.stringWidth(X[0]))}),J.forEach((X)=>{this.div(...X.map((q,Y)=>{return{text:q.trim(),padding:this.measurePadding(q),width:Y===0&&X.length>1?Z:void 0}}))}),this.rows[this.rows.length-1]}colFromString($){return{text:$,padding:this.measurePadding($)}}measurePadding($){let J=I0.stripAnsi($);return[0,J.match(/\s*$/)[0].length,0,J.match(/^\s*/)[0].length]}toString(){let $=[];return this.rows.forEach((J)=>{this.rowToString(J,$)}),$.filter((J)=>!J.hidden).map((J)=>J.text).join(`
|
|
92
|
+
`)}rowToString($,J){return this.rasterize($).forEach((Z,X)=>{let q="";Z.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),K=Y;if(H>I0.stringWidth(Y))K+=" ".repeat(H-I0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let B=iB[$[Q].align];if(K=B(K,H),I0.stringWidth(K)<H)K+=" ".repeat((G||0)-I0.stringWidth(K)-1)}let U=$[Q].padding||[0,0,0,0];if(U[3])q+=" ".repeat(U[3]);if(q+=MX($[Q],K,"| "),q+=K,q+=MX($[Q],K," |"),U[1])q+=" ".repeat(U[1]);if(X===0&&J.length>0)q=this.renderInline(q,J[J.length-1])}),J.push({text:q.replace(/ +$/,""),span:$.span})}),J}renderInline($,J){let Z=$.match(/^ */),X=Z?Z[0].length:0,q=J.text,Y=I0.stringWidth(q.trimRight());if(!J.span)return $;if(!this.wrap)return J.hidden=!0,q+$;if(X<Y)return $;return J.hidden=!0,q.trimRight()+" ".repeat(X-Y)+$.trimLeft()}rasterize($){let J=[],Z=this.columnWidths($),X;return $.forEach((q,Y)=>{if(q.width=Z[Y],this.wrap)X=I0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
|
|
88
93
|
`);else X=q.text.split(`
|
|
89
|
-
`);if(q.border)X.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),X.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)X.unshift(...Array(q.padding[0]||0).fill("")),X.push(...Array(q.padding[2]||0).fill(""));X.forEach((Q,G)=>{if(!J[G])J.push([]);let H=J[G];for(let K=0;K<Y;K++)if(H[K]===void 0)H.push("");H.push(Q)})}),J}negatePadding($){let J=$.width||0;if($.padding)J-=($.padding[3]||0)+($.padding[1]||0);if($.border)J-=4;return J}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||
|
|
90
|
-
`;q+=$.charAt(Y)}if(Z&&X)q=`${Z}${q}${X}`;return q}function J6($){return _X($,{stringWidth:(J)=>{return[...J].length},stripAnsi:$6,wrap:TX})}import{dirname as MX,resolve as CX}from"path";import{readdirSync as tB,statSync as aB}from"fs";function Z6($,J){let Z=CX(".",$),X;if(!aB(Z).isDirectory())Z=MX(Z);while(!0){if(X=J(Z,tB(Z)),X)return CX(Z,X);if(Z=MX(X=Z),X===Z)break}}import{inspect as WU}from"util";import{readFileSync as VU}from"fs";import{fileURLToPath as LU}from"url";import{format as eB}from"util";import{normalize as $U,resolve as JU}from"path";function j1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let Z="",X=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(X)X=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))X=!0;else if(Q!=="-"&&Q!=="_")Z+=Q}return Z}}function o4($,J){let Z=$.toLowerCase();J=J||"-";let X="";for(let q=0;q<$.length;q++){let Y=Z.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)X+=`${J}${Z.charAt(q)}`;else X+=Q}return X}function t4($){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 FX($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let J=0,Z=null,X=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(Z=X,X=$.charAt(Q),X===" "&&!q){if(Z!==" ")J++;continue}if(X===q)q=null;else if((X==="'"||X==='"')&&!q)q=X;if(!Y[J])Y[J]="";Y[J]+=X}return Y}var A0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(A0||(A0={}));var X1;class Q6{constructor($){X1=$}parse($,J){let Z=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},J),X=FX($),q=typeof $==="string",Y=rB(Object.assign(Object.create(null),Z.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},Z.configuration),G=Object.assign(Object.create(null),Z.default),H=Z.configObjects||[],K=Z.envPrefix,U=Q["populate--"],B=U?"--":"_",W=Object.create(null),_=Object.create(null),R=Z.__||X1.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:[]},x=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,j=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(Z.array||[]).filter(Boolean).forEach(function(V){let M=typeof V==="object"?V.key:V,P=Object.keys(V).map(function(C){return{boolean:"bools",string:"strings",number:"numbers"}[C]}).filter(Boolean).pop();if(P)L[P][M]=!0;L.arrays[M]=!0,L.keys.push(M)}),[].concat(Z.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(Z.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(Z.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(Z.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(Z.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof Z.narg==="object")Object.entries(Z.narg).forEach(([V,M])=>{if(typeof M==="number")L.nargs[V]=M,L.keys.push(V)});if(typeof Z.coerce==="object")Object.entries(Z.coerce).forEach(([V,M])=>{if(typeof M==="function")L.coercions[V]=M,L.keys.push(V)});if(typeof Z.config<"u"){if(Array.isArray(Z.config)||typeof Z.config==="string")[].concat(Z.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof Z.config==="object")Object.entries(Z.config).forEach(([V,M])=>{if(typeof M==="boolean"||typeof M==="function")L.configs[V]=M})}q$(Z.key,Y,Z.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(M){G[M]=G[V]})});let h=null;K2();let c=[],F=Object.assign(Object.create(null),{_:[]}),y={};for(let V=0;V<X.length;V++){let M=X[V],P=M.replace(/^-{3,}/,"---"),C,T,N,w,v,B0;if(M!=="--"&&/^-/.test(M)&&a(M))l(M);else if(P.match(/^---+(=|$)/)){l(M);continue}else if(M.match(/^--.+=/)||!Q["short-option-groups"]&&M.match(/^-.+=/)){if(w=M.match(/^--?([^=]+)=([\s\S]*)$/),w!==null&&Array.isArray(w)&&w.length>=3)if(k(w[1],L.arrays))V=_0(V,w[1],X,w[2]);else if(k(w[1],L.nargs)!==!1)V=t(V,w[1],X,w[2]);else n(w[1],w[2],!0)}else if(M.match(j)&&Q["boolean-negation"]){if(w=M.match(j),w!==null&&Array.isArray(w)&&w.length>=2)T=w[1],n(T,k(T,L.arrays)?[!1]:!1)}else if(M.match(/^--.+/)||!Q["short-option-groups"]&&M.match(/^-[^-]+/)){if(w=M.match(/^--?(.+)/),w!==null&&Array.isArray(w)&&w.length>=2)if(T=w[1],k(T,L.arrays))V=_0(V,T,X);else if(k(T,L.nargs)!==!1)V=t(V,T,X);else if(v=X[V+1],v!==void 0&&(!v.match(/^-/)||v.match(x))&&!k(T,L.bools)&&!k(T,L.counts))n(T,v),V++;else if(/^(true|false)$/.test(v))n(T,v),V++;else n(T,d(T))}else if(M.match(/^-.\..+=/)){if(w=M.match(/^-([^=]+)=([\s\S]*)$/),w!==null&&Array.isArray(w)&&w.length>=3)n(w[1],w[2])}else if(M.match(/^-.\..+/)&&!M.match(x)){if(v=X[V+1],w=M.match(/^-(.\..+)/),w!==null&&Array.isArray(w)&&w.length>=2)if(T=w[1],v!==void 0&&!v.match(/^-/)&&!k(T,L.bools)&&!k(T,L.counts))n(T,v),V++;else n(T,d(T))}else if(M.match(/^-[^-]+/)&&!M.match(x)){N=M.slice(1,-1).split(""),C=!1;for(let R0=0;R0<N.length;R0++){if(v=M.slice(R0+2),N[R0+1]&&N[R0+1]==="="){if(B0=M.slice(R0+3),T=N[R0],k(T,L.arrays))V=_0(V,T,X,B0);else if(k(T,L.nargs)!==!1)V=t(V,T,X,B0);else n(T,B0);C=!0;break}if(v==="-"){n(N[R0],v);continue}if(/[A-Za-z]/.test(N[R0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)&&k(v,L.bools)===!1){n(N[R0],v),C=!0;break}if(N[R0+1]&&N[R0+1].match(/\W/)){n(N[R0],v),C=!0;break}else n(N[R0],d(N[R0]))}if(T=M.slice(-1)[0],!C&&T!=="-")if(k(T,L.arrays))V=_0(V,T,X);else if(k(T,L.nargs)!==!1)V=t(V,T,X);else if(v=X[V+1],v!==void 0&&(!/^(-|--)[^-]/.test(v)||v.match(x))&&!k(T,L.bools)&&!k(T,L.counts))n(T,v),V++;else if(/^(true|false)$/.test(v))n(T,v),V++;else n(T,d(T))}else if(M.match(/^-[0-9]$/)&&M.match(x)&&k(M.slice(1),L.bools))T=M.slice(1),n(T,d(T));else if(M==="--"){c=X.slice(V+1);break}else if(Q["halt-at-non-option"]){c=X.slice(V);break}else l(M)}if(Y0(F,!0),Y0(F,!1),D(F),o(),Q1(F,L.aliases,G,!0),i(F),Q["set-placeholder-key"])G0(F);if(Object.keys(L.counts).forEach(function(V){if(!r(F,V.split(".")))n(V,0)}),U&&c.length)F[B]=[];if(c.forEach(function(V){F[B].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(F).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete F[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete F[V.split(".").map((M)=>j1(M)).join(".")];delete F[V]});function l(V){let M=I("_",V);if(typeof M==="string"||typeof M==="number")F._.push(M)}function t(V,M,P,C){let T,N=k(M,L.nargs);if(N=typeof N!=="number"||isNaN(N)?1:N,N===0){if(!z0(C))h=Error(R("Argument unexpected for: %s",M));return n(M,d(M)),V}let w=z0(C)?0:1;if(Q["nargs-eats-options"]){if(P.length-(V+1)+w<N)h=Error(R("Not enough arguments following: %s",M));w=N}else{for(T=V+1;T<P.length;T++)if(!P[T].match(/^-[^0-9]/)||P[T].match(x)||a(P[T]))w++;else break;if(w<N)h=Error(R("Not enough arguments following: %s",M))}let v=Math.min(w,N);if(!z0(C)&&v>0)n(M,C),v--;for(T=V+1;T<v+V+1;T++)n(M,P[T]);return V+v}function _0(V,M,P,C){let T=[],N=C||P[V+1],w=k(M,L.nargs);if(k(M,L.bools)&&!/^(true|false)$/.test(N))T.push(!0);else if(z0(N)||z0(C)&&/^-/.test(N)&&!x.test(N)&&!a(N)){if(G[M]!==void 0){let v=G[M];T=Array.isArray(v)?v:[v]}}else{if(!z0(C))T.push(O(M,C,!0));for(let v=V+1;v<P.length;v++){if(!Q["greedy-arrays"]&&T.length>0||w&&typeof w==="number"&&T.length>=w)break;if(N=P[v],/^-/.test(N)&&!x.test(N)&&!a(N))break;V=v,T.push(O(M,N,q))}}if(typeof w==="number"&&(w&&T.length<w||isNaN(w)&&T.length===0))h=Error(R("Not enough arguments following: %s",M));return n(M,T),V}function n(V,M,P=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let N=V.split(".").map(function(w){return j1(w)}).join(".");a0(V,N)}let C=O(V,M,P),T=V.split(".");if(r0(F,T,C),L.aliases[V])L.aliases[V].forEach(function(N){let w=N.split(".");r0(F,w,C)});if(T.length>1&&Q["dot-notation"])(L.aliases[T[0]]||[]).forEach(function(N){let w=N.split("."),v=[].concat(T);if(v.shift(),w=w.concat(v),!(L.aliases[V]||[]).includes(w.join(".")))r0(F,w,C)});if(k(V,L.normalize)&&!k(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(w){Object.defineProperty(y,w,{enumerable:!0,get(){return M},set(v){M=typeof v==="string"?X1.normalize(v):v}})})}function a0(V,M){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[M],W[M]=!0;if(!(L.aliases[M]&&L.aliases[M].length))a0(M,V)}function O(V,M,P){if(P)M=sB(M);if(k(V,L.bools)||k(V,L.counts)){if(typeof M==="string")M=M==="true"}let C=Array.isArray(M)?M.map(function(T){return I(V,T)}):I(V,M);if(k(V,L.counts)&&(z0(C)||typeof C==="boolean"))C=X6();if(k(V,L.normalize)&&k(V,L.arrays))if(Array.isArray(M))C=M.map((T)=>{return X1.normalize(T)});else C=X1.normalize(M);return C}function I(V,M){if(!Q["parse-positional-numbers"]&&V==="_")return M;if(!k(V,L.strings)&&!k(V,L.bools)&&!Array.isArray(M)){if(t4(M)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${M}`)))||!z0(M)&&k(V,L.numbers))M=Number(M)}return M}function D(V){let M=Object.create(null);Q1(M,L.aliases,G),Object.keys(L.configs).forEach(function(P){let C=V[P]||M[P];if(C)try{let T=null,N=X1.resolve(X1.cwd(),C),w=L.configs[P];if(typeof w==="function"){try{T=w(N)}catch(v){T=v}if(T instanceof Error){h=T;return}}else T=X1.require(N);u(T)}catch(T){if(T.name==="PermissionDenied")h=T;else if(V[P])h=Error(R("Invalid JSON config file: %s",C))}})}function u(V,M){Object.keys(V).forEach(function(P){let C=V[P],T=M?M+"."+P:P;if(typeof C==="object"&&C!==null&&!Array.isArray(C)&&Q["dot-notation"])u(C,T);else if(!r(F,T.split("."))||k(T,L.arrays)&&Q["combine-arrays"])n(T,C)})}function o(){if(typeof H<"u")H.forEach(function(V){u(V)})}function Y0(V,M){if(typeof K>"u")return;let P=typeof K==="string"?K:"",C=X1.env();Object.keys(C).forEach(function(T){if(P===""||T.lastIndexOf(P,0)===0){let N=T.split("__").map(function(w,v){if(v===0)w=w.substring(P.length);return j1(w)});if((M&&L.configs[N.join(".")]||!M)&&!r(V,N))n(N.join("."),C[T])}})}function i(V){let M,P=new Set;Object.keys(V).forEach(function(C){if(!P.has(C)){if(M=k(C,L.coercions),typeof M==="function")try{let T=I(C,M(V[C]));[].concat(L.aliases[C]||[],C).forEach((N)=>{P.add(N),V[N]=T})}catch(T){h=T}}})}function G0(V){return L.keys.forEach((M)=>{if(~M.indexOf("."))return;if(typeof V[M]>"u")V[M]=void 0}),V}function Q1(V,M,P,C=!1){Object.keys(P).forEach(function(T){if(!r(V,T.split("."))){if(r0(V,T.split("."),P[T]),C)_[T]=!0;(M[T]||[]).forEach(function(N){if(r(V,N.split(".")))return;r0(V,N.split("."),P[T])})}})}function r(V,M){let P=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(T){P=P[T]||{}});let C=M[M.length-1];if(typeof P!=="object")return!1;else return C in P}function r0(V,M,P){let C=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(B0){if(B0=PX(B0),typeof C==="object"&&C[B0]===void 0)C[B0]={};if(typeof C[B0]!=="object"||Array.isArray(C[B0])){if(Array.isArray(C[B0]))C[B0].push({});else C[B0]=[C[B0],{}];C=C[B0][C[B0].length-1]}else C=C[B0]});let T=PX(M[M.length-1]),N=k(M.join("."),L.arrays),w=Array.isArray(P),v=Q["duplicate-arguments-array"];if(!v&&k(T,L.nargs)){if(v=!0,!z0(C[T])&&L.nargs[T]===1||Array.isArray(C[T])&&C[T].length===L.nargs[T])C[T]=void 0}if(P===X6())C[T]=X6(C[T]);else if(Array.isArray(C[T]))if(v&&N&&w)C[T]=Q["flatten-duplicate-arrays"]?C[T].concat(P):(Array.isArray(C[T][0])?C[T]:[C[T]]).concat([P]);else if(!v&&Boolean(N)===Boolean(w))C[T]=P;else C[T]=C[T].concat([P]);else if(C[T]===void 0&&N)C[T]=w?P:[P];else if(v&&!(C[T]===void 0||k(T,L.counts)||k(T,L.bools)))C[T]=[C[T],P];else C[T]=P}function q$(...V){V.forEach(function(M){Object.keys(M||{}).forEach(function(P){if(L.aliases[P])return;L.aliases[P]=[].concat(Y[P]||[]),L.aliases[P].concat(P).forEach(function(C){if(/-/.test(C)&&Q["camel-case-expansion"]){let T=j1(C);if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),W[T]=!0}}),L.aliases[P].concat(P).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&Q["camel-case-expansion"]){let T=o4(C,"-");if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),W[T]=!0}}),L.aliases[P].forEach(function(C){L.aliases[C]=[P].concat(L.aliases[P].filter(function(T){return C!==T}))})})})}function k(V,M){let P=[].concat(L.aliases[V]||[],V),C=Object.keys(M),T=P.find((N)=>C.includes(N));return T?M[T]:!1}function b1(V){let M=Object.keys(L);return[].concat(M.map((C)=>L[C])).some(function(C){return Array.isArray(C)?C.includes(V):C[V]})}function A6(V,...M){return[].concat(...M).some(function(C){let T=V.match(C);return T&&b1(T[1])})}function b(V){if(V.match(x)||!V.match(/^-[^-]+/))return!1;let M=!0,P,C=V.slice(1).split("");for(let T=0;T<C.length;T++){if(P=V.slice(T+2),!b1(C[T])){M=!1;break}if(C[T+1]&&C[T+1]==="="||P==="-"||/[A-Za-z]/.test(C[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(P)||C[T+1]&&C[T+1].match(/\W/))break}return M}function a(V){return Q["unknown-options-as-args"]&&H0(V)}function H0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(x))return!1;if(b(V))return!1;return!A6(V,/^-+([^=]+?)=[\s\S]*$/,j,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function d(V){if(!k(V,L.bools)&&!k(V,L.counts)&&`${V}`in G)return G[V];else return V0(Z0(V))}function V0(V){return{[A0.BOOLEAN]:!0,[A0.STRING]:"",[A0.NUMBER]:void 0,[A0.ARRAY]:[]}[V]}function Z0(V){let M=A0.BOOLEAN;if(k(V,L.strings))M=A0.STRING;else if(k(V,L.numbers))M=A0.NUMBER;else if(k(V,L.bools))M=A0.BOOLEAN;else if(k(V,L.arrays))M=A0.ARRAY;return M}function z0(V){return V===void 0}function K2(){Object.keys(L.counts).find((V)=>{if(k(V,L.arrays))return h=Error(R("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(k(V,L.nargs))return h=Error(R("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(y,F),configuration:Q,defaulted:Object.assign({},_),error:h,newAliases:Object.assign({},W)}}}function rB($){let J=[],Z=Object.create(null),X=!0;Object.keys($).forEach(function(q){J.push([].concat($[q],q))});while(X){X=!1;for(let q=0;q<J.length;q++)for(let Y=q+1;Y<J.length;Y++)if(J[q].filter(function(G){return J[Y].indexOf(G)!==-1}).length){J[q]=J[q].concat(J[Y]),J.splice(Y,1),X=!0;break}}return J.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")Z[Y]=q}),Z}function X6($){return $!==void 0?$+1:1}function PX($){if($==="__proto__")return"___proto___";return $}function sB($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var q6,Y6,G6,jX=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,xX=(Y6=(q6=process===null||process===void 0?void 0:process.versions)===null||q6===void 0?void 0:q6.node)!==null&&Y6!==void 0?Y6:(G6=process===null||process===void 0?void 0:process.version)===null||G6===void 0?void 0:G6.slice(1);if(xX){if(Number(xX.match(/^([^.]+)/)[1])<jX)throw Error(`yargs parser supports a minimum Node.js version of ${jX}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var ZU=process?process.env:{},IX=new Q6({cwd:process.cwd,env:()=>{return ZU},format:eB,normalize:$U,resolve:JU,require:($)=>{return L0($)}}),j$=function(J,Z){return IX.parse(J.slice(),Z).argv};j$.detailed=function($,J){return IX.parse($.slice(),J)};j$.camelCase=j1;j$.decamelize=o4;j$.looksLikeNumber=t4;var H6=j$;import{basename as _U,dirname as RU,extname as TU,relative as MU,resolve as DX}from"path";function wX(){if(XU())return 0;return 1}function XU(){return QU()&&!process.defaultApp}function QU(){return!!process.versions.electron}function z6($){return $.slice(wX()+1)}function OX(){return process.argv[wX()]}class s extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,s)}}import{readFileSync as qU,statSync as YU,writeFile as GU}from"fs";import{format as HU}from"util";import{resolve as zU}from"path";var EX={fs:{readFileSync:qU,writeFile:GU},format:HU,resolve:zU,exists:($)=>{try{return YU($).isFile()}catch(J){return!1}}};var g0;class AX{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 J=$.shift(),Z=function(){};if(typeof $[$.length-1]==="function")Z=$.pop();if(Z=Z||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]=J,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:Z});else Z();return g0.format.apply(g0.format,[this.cache[this.locale][J]||J].concat($))}__n(){let $=Array.prototype.slice.call(arguments),J=$.shift(),Z=$.shift(),X=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=X===1?J:Z;if(this.cache[this.locale][J])Y=this.cache[this.locale][J][X===1?"one":"other"];if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]={one:J,other:Z},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(X);return g0.format.apply(g0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))this.cache[this.locale][J]=$[J]}_taggedLiteral($,...J){let Z="";return $.forEach(function(X,q){let Y=J[q+1];if(Z+=X,typeof Y<"u")Z+="%s"}),this.__.apply(this,[Z].concat([].slice.call(J,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,J=this.writeQueue[0],Z=J.directory,X=J.locale,q=J.cb,Y=this._resolveLocaleFile(Z,X),Q=JSON.stringify(this.cache[X],null,2);g0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},J=this._resolveLocaleFile(this.directory,this.locale);try{if(g0.fs.readFileSync)$=JSON.parse(g0.fs.readFileSync(J,"utf-8"))}catch(Z){if(Z instanceof SyntaxError)Z.message="syntax error in "+J;if(Z.code==="ENOENT")$={};else throw Z}this.cache[this.locale]=$}_resolveLocaleFile($,J){let Z=g0.resolve($,"./",J+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(Z)&&~J.lastIndexOf("_")){let X=g0.resolve($,"./",J.split("_")[0]+".json");if(this._fileExistsSync(X))Z=X}return Z}_fileExistsSync($){return g0.exists($)}}function hX($,J){g0=J;let Z=new AX($);return{__:Z.__.bind(Z),__n:Z.__n.bind(Z),setLocale:Z.setLocale.bind(Z),getLocale:Z.getLocale.bind(Z),updateLocale:Z.updateLocale.bind(Z),locale:Z.locale}}var KU=($)=>{return hX($,EX)},NX=KU;var CU="require is not supported by ESM",SX="loading a directory of commands is not supported yet for ESM",x$;try{x$=LU(import.meta.url)}catch($){x$=process.cwd()}var FU=x$.substring(0,x$.lastIndexOf("node_modules")),K6={assert:{notStrictEqual:BU,strictEqual:UU},cliui:J6,findUp:Z6,getEnv:($)=>{return process.env[$]},inspect:WU,getCallerFile:()=>{throw new s(SX)},getProcessArgvBin:OX,mainFilename:FU||process.cwd(),Parser:H6,path:{basename:_U,dirname:RU,extname:TU,relative:MU,resolve:DX},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,J)=>process.emitWarning($,J),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:VU,require:()=>{throw new s(CU)},requireDirectory:()=>{throw new s(SX)},stringWidth:($)=>{return[...$].length},y18n:NX({directory:DX(x$,"../../../locales"),updateFiles:!1})};function C0($,J,Z,X){Z.assert.notStrictEqual($,J,X)}function B6($,J){J.assert.strictEqual(typeof $,"string")}function $$($){return Object.keys($)}function e($){return!!$&&!!$.then&&typeof $.then==="function"}function K1($){let Z=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),X=/\.*[\][<>]/g,q=Z.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(X,""),demanded:[],optional:[]};return Z.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===Z.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(X,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(X,"").split("|"),variadic:H})}),Y}var PU=["first","second","third","fourth","fifth","sixth"];function E($,J,Z){function X(){return typeof $==="object"?[{demanded:[],optional:[]},$,J]:[K1(`cmd ${$}`),J,Z]}try{let q=0,[Y,Q,G]=X(),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 s(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let U=Y.demanded.length+Y.optional.length;if(K>U)throw new s(`Too many arguments provided. Expected max ${U} but received ${K}.`);Y.demanded.forEach((B)=>{let W=H.shift(),_=vX(W);if(B.cmd.filter((L)=>L===_||L==="*").length===0)fX(_,B.cmd,q);q+=1}),Y.optional.forEach((B)=>{if(H.length===0)return;let W=H.shift(),_=vX(W);if(B.cmd.filter((L)=>L===_||L==="*").length===0)fX(_,B.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function vX($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function fX($,J,Z){throw new s(`Invalid ${PU[Z]||"manyith"} argument. Expected ${J.join(" or ")} but received ${$}.`)}class U6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,J,Z=!0,X=!1){if(E("<array|function> [boolean] [boolean] [boolean]",[$,J,Z],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=J,Y.global=Z}Array.prototype.push.apply(this.globalMiddleware,$)}else if(typeof $==="function"){let q=$;q.applyBeforeValidation=J,q.global=Z,q.mutates=X,this.globalMiddleware.push($)}return this.yargs}addCoerceMiddleware($,J){let Z=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((X)=>{let q=[...Z[J]||[],J];if(!X.option)return!0;else return!q.includes(X.option)}),$.option=J,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 kX($){if(!$)return[];return $.map((J)=>{return J.applyBeforeValidation=!1,J})}function x1($,J,Z,X){return Z.reduce((q,Y)=>{if(Y.applyBeforeValidation!==X)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(e(q))return q.then((Q)=>Promise.all([Q,Y(Q,J)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,J);return e(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function I1($,J,Z=(X)=>{throw X}){try{let X=jU($)?$():$;return e(X)?X.then((q)=>J(q)):J(X)}catch(X){return Z(X)}}function jU($){return typeof $==="function"}function W6($){for(let J=0,Z=Object.keys(L0.cache),X;J<Z.length;J++)if(X=L0.cache[Z[J]],X.exports===$)return X;return null}var J$=/(^\*)|(^\$0)/;class yX{constructor($,J,Z,X){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=X,this.usage=$,this.globalMiddleware=Z,this.validation=J}addDirectory($,J,Z,X){if(X=X||{},typeof X.recurse!=="boolean")X.recurse=!1;if(!Array.isArray(X.extensions))X.extensions=["js"];let q=typeof X.visit==="function"?X.visit:(Y)=>Y;X.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:J,filename:Z},$,X)}addHandler($,J,Z,X,q,Y){let Q=[],G=kX(q);if(X=X||(()=>{}),Array.isArray($))if(xU($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(wU($)){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(bX(Z)){this.addHandler([$].concat(Q),J,Z.builder,Z.handler,Z.middlewares,Z.deprecated);return}if(typeof $==="string"){let H=K1($);Q=Q.map((B)=>K1(B).cmd);let K=!1,U=[H.cmd].concat(Q).filter((B)=>{if(J$.test(B))return K=!0,!1;return!0});if(U.length===0&&K)U.push("$0");if(K)H.cmd=U[0],Q=U.slice(1),$=$.replace(J$,H.cmd);if(Q.forEach((B)=>{this.aliasMap[B]=H.cmd}),J!==!1)this.usage.command($,J,K,Q,Y);if(this.handlers[H.cmd]={original:$,description:J,handler:X,builder:Z||{},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($,J,Z,X,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=J.getInternalMethods().getContext(),H=G.commands.slice(),K=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let U=this.applyBuilderUpdateUsageAndParse(K,Q,J,Z.aliases,H,X,q,Y);return e(U)?U.then((B)=>this.applyMiddlewareAndGetResult(K,Q,B.innerArgv,G,q,B.aliases,J)):this.applyMiddlewareAndGetResult(K,Q,U.innerArgv,G,q,U.aliases,J)}applyBuilderUpdateUsageAndParse($,J,Z,X,q,Y,Q,G){let H=J.builder,K=Z;if(a4(H)){Z.getInternalMethods().getUsageInstance().freeze();let U=H(Z.getInternalMethods().reset(X),G);if(e(U))return U.then((B)=>{return K=uX(B)?B:Z,this.parseAndUpdateUsage($,J,K,q,Y,Q)})}else if(IU(H))Z.getInternalMethods().getUsageInstance().freeze(),K=Z.getInternalMethods().reset(X),Object.keys(J.builder).forEach((U)=>{K.option(U,H[U])});return this.parseAndUpdateUsage($,J,K,q,Y,Q)}parseAndUpdateUsage($,J,Z,X,q,Y){if($)Z.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(Z))Z.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(X,J),J.description);let Q=Z.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return e(Q)?Q.then((G)=>({aliases:Z.parsed.aliases,innerArgv:G})):{aliases:Z.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,J){let Z=J$.test(J.original)?J.original.replace(J$,"").trim():J.original,X=$.filter((q)=>{return!J$.test(q)});return X.push(Z),`$0 ${X.join(" ")}`}handleValidationAndGetResult($,J,Z,X,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);Z=I1(Z,(K)=>{return H(K),K})}if(J.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(Z,H,!1,!1),Z=x1(Z,Y,Q,!1),Z=I1(Z,(K)=>{let U=J.handler(K);return e(U)?U.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(e(Z)&&!Y.getInternalMethods().hasParseCallback())Z.catch((K)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,K)}catch(U){}})}if(!$)X.commands.pop(),X.fullCommands.pop();return Z}applyMiddlewareAndGetResult($,J,Z,X,q,Y,Q){let G={};if(q)return Z;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(J,Z,X,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(J.middlewares),K=x1(Z,Q,H,!0);return e(K)?K.then((U)=>this.handleValidationAndGetResult($,J,U,X,Y,Q,H,G)):this.handleValidationAndGetResult($,J,K,X,Y,Q,H,G)}populatePositionals($,J,Z,X){J._=J._.slice(Z.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,J._.length);while(q.length){let G=q.shift();this.populatePositional(G,J,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,J,Q)}return J._=Z.commands.concat(J._.map((G)=>""+G)),this.postProcessPositionals(J,Q,this.cmdToParseOptions($.original),X),Q}populatePositional($,J,Z){let X=$.cmd[0];if($.variadic)Z[X]=J._.splice(0).map(String);else if(J._.length)Z[X]=[String(J._.shift())]}cmdToParseOptions($){let J={array:[],default:{},alias:{},demand:{}},Z=K1($);return Z.demanded.forEach((X)=>{let[q,...Y]=X.cmd;if(X.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y,J.demand[q]=!0}),Z.optional.forEach((X)=>{let[q,...Y]=X.cmd;if(X.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y}),J}postProcessPositionals($,J,Z,X){let q=Object.assign({},X.getOptions());q.default=Object.assign(Z.default,q.default);for(let H of Object.keys(Z.alias))q.alias[H]=(q.alias[H]||[]).concat(Z.alias[H]);q.array=q.array.concat(Z.array),q.config={};let Y=[];if(Object.keys(J).forEach((H)=>{J[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)X.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(J);Object.keys(J).forEach((K)=>{H.push(...G.aliases[K])}),Object.keys(G.argv).forEach((K)=>{if(H.includes(K)){if(!J[K])J[K]=G.argv[K];if(!this.isInConfigs(X,K)&&!this.isDefaulted(X,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($,J){let{default:Z}=$.getOptions();return Object.prototype.hasOwnProperty.call(Z,J)||Object.prototype.hasOwnProperty.call(Z,this.shim.Parser.camelCase(J))}isInConfigs($,J){let{configObjects:Z}=$.getOptions();return Z.some((X)=>Object.prototype.hasOwnProperty.call(X,J))||Z.some((X)=>Object.prototype.hasOwnProperty.call(X,this.shim.Parser.camelCase(J)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let Z=J$.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(Z,this.defaultCommand.description)}let J=this.defaultCommand.builder;if(a4(J))return J($,!0);else if(!bX(J))Object.keys(J).forEach((Z)=>{$.option(Z,J[Z])});return}moduleName($){let J=W6($);if(!J)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(J.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:J,desc:Z}){for(let X of[$,J,Z]){if(typeof X==="string"||X===!1)return X;C0(X,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();C0($,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 gX($,J,Z,X){return new yX($,J,Z,X)}function bX($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function xU($){return $.every((J)=>typeof J==="string")}function a4($){return typeof $==="function"}function IU($){return typeof $==="object"}function wU($){return typeof $==="object"&&!Array.isArray($)}function B1($={},J=()=>!0){let Z={};return $$($).forEach((X)=>{if(J(X,$[X]))Z[X]=$[X]}),Z}function U1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((J)=>{let Z=J;if(Z._handle&&Z.isTTY&&typeof Z._handle.setBlocking==="function")Z._handle.setBlocking($)})}function OU($){return typeof $==="boolean"}function cX($,J){let Z=J.y18n.__,X={},q=[];X.failFn=function(I){q.push(I)};let Y=null,Q=null,G=!0;X.showHelpOnFail=function(I=!0,D){let[u,o]=typeof I==="string"?[!0,I]:[I,D];if($.getInternalMethods().isGlobalContext())Q=o;return Y=o,G=u,X};let H=!1;X.fail=function(I,D){let u=$.getInternalMethods().getLoggerInstance();if(q.length)for(let o=q.length-1;o>=0;--o){let Y0=q[o];if(OU(Y0)){if(D)throw D;else if(I)throw Error(I)}else Y0(I,D,X)}else{if($.getExitProcess())U1(!0);if(!H){if(H=!0,G)$.showHelp("error"),u.error();if(I||D)u.error(I||D);let o=Y||Q;if(o){if(I||D)u.error("");u.error(o)}}if(D=D||new s(I),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,D);else throw D}};let K=[],U=!1;X.usage=(O,I)=>{if(O===null)return U=!0,K=[],X;return U=!1,K.push([O,I||""]),X},X.getUsage=()=>{return K},X.getUsageDisabled=()=>{return U},X.getPositionalGroupName=()=>{return Z("Positionals:")};let B=[];X.example=(O,I)=>{B.push([O,I||""])};let W=[];X.command=function(I,D,u,o,Y0=!1){if(u)W=W.map((i)=>{return i[2]=!1,i});W.push([I,D||"",u,o,Y0])},X.getCommands=()=>W;let _={};X.describe=function(I,D){if(Array.isArray(I))I.forEach((u)=>{X.describe(u,D)});else if(typeof I==="object")Object.keys(I).forEach((u)=>{X.describe(u,I[u])});else _[I]=D},X.getDescriptions=()=>_;let R=[];X.epilog=(O)=>{R.push(O)};let L=!1,x;X.wrap=(O)=>{L=!0,x=O},X.getWrap=()=>{if(J.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)x=_0(),L=!0;return x};let j="__yargsString__:";X.deferY18nLookup=(O)=>j+O,X.help=function(){if(F)return F;c();let I=$.customScriptName?$.$0:J.path.basename($.$0),D=$.getDemandedOptions(),u=$.getDemandedCommands(),o=$.getDeprecatedOptions(),Y0=$.getGroups(),i=$.getOptions(),G0=[];G0=G0.concat(Object.keys(_)),G0=G0.concat(Object.keys(D)),G0=G0.concat(Object.keys(u)),G0=G0.concat(Object.keys(i.default)),G0=G0.filter(l),G0=Object.keys(G0.reduce((b,a)=>{if(a!=="_")b[a]=!0;return b},{}));let Q1=X.getWrap(),r=J.cliui({width:Q1,wrap:!!Q1});if(!U){if(K.length)K.forEach((b)=>{if(r.div({text:`${b[0].replace(/\$0/g,I)}`}),b[1])r.div({text:`${b[1]}`,padding:[1,0,0,0]})}),r.div();else if(W.length){let b=null;if(u._)b=`${I} <${Z("command")}>
|
|
91
|
-
`;else
|
|
92
|
-
`;r.div(`${
|
|
93
|
-
`);r.div(`${
|
|
94
|
-
`)}return r.toString().replace(/\s*$/,"")};function
|
|
94
|
+
`);if(q.border)X.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),X.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)X.unshift(...Array(q.padding[0]||0).fill("")),X.push(...Array(q.padding[2]||0).fill(""));X.forEach((Q,G)=>{if(!J[G])J.push([]);let H=J[G];for(let K=0;K<Y;K++)if(H[K]===void 0)H.push("");H.push(Q)})}),J}negatePadding($){let J=$.width||0;if($.padding)J-=($.padding[3]||0)+($.padding[1]||0);if($.border)J-=4;return J}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||I0.stringWidth(Y.text)});let J=$.length,Z=this.width,X=$.map((Y)=>{if(Y.width)return J--,Z-=Y.width,Y.width;return}),q=J?Math.floor(Z/J):0;return X.map((Y,Q)=>{if(Y===void 0)return Math.max(q,oB($[Q]));return Y})}}function MX($,J,Z){if($.border){if(/[.']-+[.']/.test(J))return"";if(J.trim().length!==0)return Z;return" "}return""}function oB($){let J=$.padding||[],Z=1+(J[3]||0)+(J[1]||0);if($.border)return Z+4;return Z}function tB(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function aB($,J){$=$.trim();let Z=I0.stringWidth($);if(Z<J)return" ".repeat(J-Z)+$;return $}function rB($,J){$=$.trim();let Z=I0.stringWidth($);if(Z>=J)return $;return" ".repeat(J-Z>>1)+$}var I0;function FX($,J){return I0=J,new CX({width:($===null||$===void 0?void 0:$.width)||tB(),wrap:$===null||$===void 0?void 0:$.wrap})}var jX=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function H6($){return $.replace(jX,"")}function xX($,J){let[Z,X]=$.match(jX)||["",""];$=H6($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%J===0)q+=`
|
|
95
|
+
`;q+=$.charAt(Y)}if(Z&&X)q=`${Z}${q}${X}`;return q}function z6($){return FX($,{stringWidth:(J)=>{return[...J].length},stripAnsi:H6,wrap:xX})}import{dirname as PX,resolve as IX}from"path";import{readdirSync as sB,statSync as eB}from"fs";function K6($,J){let Z=IX(".",$),X;if(!eB(Z).isDirectory())Z=PX(Z);while(!0){if(X=J(Z,sB(Z)),X)return IX(Z,X);if(Z=PX(X=Z),X===Z)break}}import{inspect as _U}from"util";import{readFileSync as RU}from"fs";import{fileURLToPath as TU}from"url";import{format as ZU}from"util";import{normalize as XU,resolve as QU}from"path";function I1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let Z="",X=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(X)X=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))X=!0;else if(Q!=="-"&&Q!=="_")Z+=Q}return Z}}function J2($,J){let Z=$.toLowerCase();J=J||"-";let X="";for(let q=0;q<$.length;q++){let Y=Z.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)X+=`${J}${Z.charAt(q)}`;else X+=Q}return X}function Z2($){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 OX($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let J=0,Z=null,X=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(Z=X,X=$.charAt(Q),X===" "&&!q){if(Z!==" ")J++;continue}if(X===q)q=null;else if((X==="'"||X==='"')&&!q)q=X;if(!Y[J])Y[J]="";Y[J]+=X}return Y}var D0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(D0||(D0={}));var Q1;class U6{constructor($){Q1=$}parse($,J){let Z=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},J),X=OX($),q=typeof $==="string",Y=$U(Object.assign(Object.create(null),Z.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},Z.configuration),G=Object.assign(Object.create(null),Z.default),H=Z.configObjects||[],K=Z.envPrefix,U=Q["populate--"],B=U?"--":"_",W=Object.create(null),_=Object.create(null),R=Z.__||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:[]},P=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,x=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(Z.array||[]).filter(Boolean).forEach(function(V){let M=typeof V==="object"?V.key:V,j=Object.keys(V).map(function(C){return{boolean:"bools",string:"strings",number:"numbers"}[C]}).filter(Boolean).pop();if(j)L[j][M]=!0;L.arrays[M]=!0,L.keys.push(M)}),[].concat(Z.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(Z.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(Z.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(Z.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(Z.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof Z.narg==="object")Object.entries(Z.narg).forEach(([V,M])=>{if(typeof M==="number")L.nargs[V]=M,L.keys.push(V)});if(typeof Z.coerce==="object")Object.entries(Z.coerce).forEach(([V,M])=>{if(typeof M==="function")L.coercions[V]=M,L.keys.push(V)});if(typeof Z.config<"u"){if(Array.isArray(Z.config)||typeof Z.config==="string")[].concat(Z.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof Z.config==="object")Object.entries(Z.config).forEach(([V,M])=>{if(typeof M==="boolean"||typeof M==="function")L.configs[V]=M})}K$(Z.key,Y,Z.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(M){G[M]=G[V]})});let N=null;V2();let c=[],F=Object.assign(Object.create(null),{_:[]}),k={};for(let V=0;V<X.length;V++){let M=X[V],j=M.replace(/^-{3,}/,"---"),C,T,D,w,f,U0;if(M!=="--"&&/^-/.test(M)&&a(M))l(M);else if(j.match(/^---+(=|$)/)){l(M);continue}else if(M.match(/^--.+=/)||!Q["short-option-groups"]&&M.match(/^-.+=/)){if(w=M.match(/^--?([^=]+)=([\s\S]*)$/),w!==null&&Array.isArray(w)&&w.length>=3)if(b(w[1],L.arrays))V=T0(V,w[1],X,w[2]);else if(b(w[1],L.nargs)!==!1)V=t(V,w[1],X,w[2]);else n(w[1],w[2],!0)}else if(M.match(x)&&Q["boolean-negation"]){if(w=M.match(x),w!==null&&Array.isArray(w)&&w.length>=2)T=w[1],n(T,b(T,L.arrays)?[!1]:!1)}else if(M.match(/^--.+/)||!Q["short-option-groups"]&&M.match(/^-[^-]+/)){if(w=M.match(/^--?(.+)/),w!==null&&Array.isArray(w)&&w.length>=2)if(T=w[1],b(T,L.arrays))V=T0(V,T,X);else if(b(T,L.nargs)!==!1)V=t(V,T,X);else if(f=X[V+1],f!==void 0&&(!f.match(/^-/)||f.match(P))&&!b(T,L.bools)&&!b(T,L.counts))n(T,f),V++;else if(/^(true|false)$/.test(f))n(T,f),V++;else n(T,d(T))}else if(M.match(/^-.\..+=/)){if(w=M.match(/^-([^=]+)=([\s\S]*)$/),w!==null&&Array.isArray(w)&&w.length>=3)n(w[1],w[2])}else if(M.match(/^-.\..+/)&&!M.match(P)){if(f=X[V+1],w=M.match(/^-(.\..+)/),w!==null&&Array.isArray(w)&&w.length>=2)if(T=w[1],f!==void 0&&!f.match(/^-/)&&!b(T,L.bools)&&!b(T,L.counts))n(T,f),V++;else n(T,d(T))}else if(M.match(/^-[^-]+/)&&!M.match(P)){D=M.slice(1,-1).split(""),C=!1;for(let M0=0;M0<D.length;M0++){if(f=M.slice(M0+2),D[M0+1]&&D[M0+1]==="="){if(U0=M.slice(M0+3),T=D[M0],b(T,L.arrays))V=T0(V,T,X,U0);else if(b(T,L.nargs)!==!1)V=t(V,T,X,U0);else n(T,U0);C=!0;break}if(f==="-"){n(D[M0],f);continue}if(/[A-Za-z]/.test(D[M0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(f)&&b(f,L.bools)===!1){n(D[M0],f),C=!0;break}if(D[M0+1]&&D[M0+1].match(/\W/)){n(D[M0],f),C=!0;break}else n(D[M0],d(D[M0]))}if(T=M.slice(-1)[0],!C&&T!=="-")if(b(T,L.arrays))V=T0(V,T,X);else if(b(T,L.nargs)!==!1)V=t(V,T,X);else if(f=X[V+1],f!==void 0&&(!/^(-|--)[^-]/.test(f)||f.match(P))&&!b(T,L.bools)&&!b(T,L.counts))n(T,f),V++;else if(/^(true|false)$/.test(f))n(T,f),V++;else n(T,d(T))}else if(M.match(/^-[0-9]$/)&&M.match(P)&&b(M.slice(1),L.bools))T=M.slice(1),n(T,d(T));else if(M==="--"){c=X.slice(V+1);break}else if(Q["halt-at-non-option"]){c=X.slice(V);break}else l(M)}if(G0(F,!0),G0(F,!1),v(F),o(),q1(F,L.aliases,G,!0),i(F),Q["set-placeholder-key"])H0(F);if(Object.keys(L.counts).forEach(function(V){if(!r(F,V.split(".")))n(V,0)}),U&&c.length)F[B]=[];if(c.forEach(function(V){F[B].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(F).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete F[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete F[V.split(".").map((M)=>I1(M)).join(".")];delete F[V]});function l(V){let M=O("_",V);if(typeof M==="string"||typeof M==="number")F._.push(M)}function t(V,M,j,C){let T,D=b(M,L.nargs);if(D=typeof D!=="number"||isNaN(D)?1:D,D===0){if(!K0(C))N=Error(R("Argument unexpected for: %s",M));return n(M,d(M)),V}let w=K0(C)?0:1;if(Q["nargs-eats-options"]){if(j.length-(V+1)+w<D)N=Error(R("Not enough arguments following: %s",M));w=D}else{for(T=V+1;T<j.length;T++)if(!j[T].match(/^-[^0-9]/)||j[T].match(P)||a(j[T]))w++;else break;if(w<D)N=Error(R("Not enough arguments following: %s",M))}let f=Math.min(w,D);if(!K0(C)&&f>0)n(M,C),f--;for(T=V+1;T<f+V+1;T++)n(M,j[T]);return V+f}function T0(V,M,j,C){let T=[],D=C||j[V+1],w=b(M,L.nargs);if(b(M,L.bools)&&!/^(true|false)$/.test(D))T.push(!0);else if(K0(D)||K0(C)&&/^-/.test(D)&&!P.test(D)&&!a(D)){if(G[M]!==void 0){let f=G[M];T=Array.isArray(f)?f:[f]}}else{if(!K0(C))T.push(E(M,C,!0));for(let f=V+1;f<j.length;f++){if(!Q["greedy-arrays"]&&T.length>0||w&&typeof w==="number"&&T.length>=w)break;if(D=j[f],/^-/.test(D)&&!P.test(D)&&!a(D))break;V=f,T.push(E(M,D,q))}}if(typeof w==="number"&&(w&&T.length<w||isNaN(w)&&T.length===0))N=Error(R("Not enough arguments following: %s",M));return n(M,T),V}function n(V,M,j=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let D=V.split(".").map(function(w){return I1(w)}).join(".");r0(V,D)}let C=E(V,M,j),T=V.split(".");if(s0(F,T,C),L.aliases[V])L.aliases[V].forEach(function(D){let w=D.split(".");s0(F,w,C)});if(T.length>1&&Q["dot-notation"])(L.aliases[T[0]]||[]).forEach(function(D){let w=D.split("."),f=[].concat(T);if(f.shift(),w=w.concat(f),!(L.aliases[V]||[]).includes(w.join(".")))s0(F,w,C)});if(b(V,L.normalize)&&!b(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(w){Object.defineProperty(k,w,{enumerable:!0,get(){return M},set(f){M=typeof f==="string"?Q1.normalize(f):f}})})}function r0(V,M){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[M],W[M]=!0;if(!(L.aliases[M]&&L.aliases[M].length))r0(M,V)}function E(V,M,j){if(j)M=JU(M);if(b(V,L.bools)||b(V,L.counts)){if(typeof M==="string")M=M==="true"}let C=Array.isArray(M)?M.map(function(T){return O(V,T)}):O(V,M);if(b(V,L.counts)&&(K0(C)||typeof C==="boolean"))C=B6();if(b(V,L.normalize)&&b(V,L.arrays))if(Array.isArray(M))C=M.map((T)=>{return Q1.normalize(T)});else C=Q1.normalize(M);return C}function O(V,M){if(!Q["parse-positional-numbers"]&&V==="_")return M;if(!b(V,L.strings)&&!b(V,L.bools)&&!Array.isArray(M)){if(Z2(M)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${M}`)))||!K0(M)&&b(V,L.numbers))M=Number(M)}return M}function v(V){let M=Object.create(null);q1(M,L.aliases,G),Object.keys(L.configs).forEach(function(j){let C=V[j]||M[j];if(C)try{let T=null,D=Q1.resolve(Q1.cwd(),C),w=L.configs[j];if(typeof w==="function"){try{T=w(D)}catch(f){T=f}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[j])N=Error(R("Invalid JSON config file: %s",C))}})}function u(V,M){Object.keys(V).forEach(function(j){let C=V[j],T=M?M+"."+j:j;if(typeof C==="object"&&C!==null&&!Array.isArray(C)&&Q["dot-notation"])u(C,T);else if(!r(F,T.split("."))||b(T,L.arrays)&&Q["combine-arrays"])n(T,C)})}function o(){if(typeof H<"u")H.forEach(function(V){u(V)})}function G0(V,M){if(typeof K>"u")return;let j=typeof K==="string"?K:"",C=Q1.env();Object.keys(C).forEach(function(T){if(j===""||T.lastIndexOf(j,0)===0){let D=T.split("__").map(function(w,f){if(f===0)w=w.substring(j.length);return I1(w)});if((M&&L.configs[D.join(".")]||!M)&&!r(V,D))n(D.join("."),C[T])}})}function i(V){let M,j=new Set;Object.keys(V).forEach(function(C){if(!j.has(C)){if(M=b(C,L.coercions),typeof M==="function")try{let T=O(C,M(V[C]));[].concat(L.aliases[C]||[],C).forEach((D)=>{j.add(D),V[D]=T})}catch(T){N=T}}})}function H0(V){return L.keys.forEach((M)=>{if(~M.indexOf("."))return;if(typeof V[M]>"u")V[M]=void 0}),V}function q1(V,M,j,C=!1){Object.keys(j).forEach(function(T){if(!r(V,T.split("."))){if(s0(V,T.split("."),j[T]),C)_[T]=!0;(M[T]||[]).forEach(function(D){if(r(V,D.split(".")))return;s0(V,D.split("."),j[T])})}})}function r(V,M){let j=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(T){j=j[T]||{}});let C=M[M.length-1];if(typeof j!=="object")return!1;else return C in j}function s0(V,M,j){let C=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(U0){if(U0=wX(U0),typeof C==="object"&&C[U0]===void 0)C[U0]={};if(typeof C[U0]!=="object"||Array.isArray(C[U0])){if(Array.isArray(C[U0]))C[U0].push({});else C[U0]=[C[U0],{}];C=C[U0][C[U0].length-1]}else C=C[U0]});let T=wX(M[M.length-1]),D=b(M.join("."),L.arrays),w=Array.isArray(j),f=Q["duplicate-arguments-array"];if(!f&&b(T,L.nargs)){if(f=!0,!K0(C[T])&&L.nargs[T]===1||Array.isArray(C[T])&&C[T].length===L.nargs[T])C[T]=void 0}if(j===B6())C[T]=B6(C[T]);else if(Array.isArray(C[T]))if(f&&D&&w)C[T]=Q["flatten-duplicate-arrays"]?C[T].concat(j):(Array.isArray(C[T][0])?C[T]:[C[T]]).concat([j]);else if(!f&&Boolean(D)===Boolean(w))C[T]=j;else C[T]=C[T].concat([j]);else if(C[T]===void 0&&D)C[T]=w?j:[j];else if(f&&!(C[T]===void 0||b(T,L.counts)||b(T,L.bools)))C[T]=[C[T],j];else C[T]=j}function K$(...V){V.forEach(function(M){Object.keys(M||{}).forEach(function(j){if(L.aliases[j])return;L.aliases[j]=[].concat(Y[j]||[]),L.aliases[j].concat(j).forEach(function(C){if(/-/.test(C)&&Q["camel-case-expansion"]){let T=I1(C);if(T!==j&&L.aliases[j].indexOf(T)===-1)L.aliases[j].push(T),W[T]=!0}}),L.aliases[j].concat(j).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&Q["camel-case-expansion"]){let T=J2(C,"-");if(T!==j&&L.aliases[j].indexOf(T)===-1)L.aliases[j].push(T),W[T]=!0}}),L.aliases[j].forEach(function(C){L.aliases[C]=[j].concat(L.aliases[j].filter(function(T){return C!==T}))})})})}function b(V,M){let j=[].concat(L.aliases[V]||[],V),C=Object.keys(M),T=j.find((D)=>C.includes(D));return T?M[T]:!1}function y1(V){let M=Object.keys(L);return[].concat(M.map((C)=>L[C])).some(function(C){return Array.isArray(C)?C.includes(V):C[V]})}function f6(V,...M){return[].concat(...M).some(function(C){let T=V.match(C);return T&&y1(T[1])})}function y(V){if(V.match(P)||!V.match(/^-[^-]+/))return!1;let M=!0,j,C=V.slice(1).split("");for(let T=0;T<C.length;T++){if(j=V.slice(T+2),!y1(C[T])){M=!1;break}if(C[T+1]&&C[T+1]==="="||j==="-"||/[A-Za-z]/.test(C[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(j)||C[T+1]&&C[T+1].match(/\W/))break}return M}function a(V){return Q["unknown-options-as-args"]&&z0(V)}function z0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(P))return!1;if(y(V))return!1;return!f6(V,/^-+([^=]+?)=[\s\S]*$/,x,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function d(V){if(!b(V,L.bools)&&!b(V,L.counts)&&`${V}`in G)return G[V];else return V0(X0(V))}function V0(V){return{[D0.BOOLEAN]:!0,[D0.STRING]:"",[D0.NUMBER]:void 0,[D0.ARRAY]:[]}[V]}function X0(V){let M=D0.BOOLEAN;if(b(V,L.strings))M=D0.STRING;else if(b(V,L.numbers))M=D0.NUMBER;else if(b(V,L.bools))M=D0.BOOLEAN;else if(b(V,L.arrays))M=D0.ARRAY;return M}function K0(V){return V===void 0}function V2(){Object.keys(L.counts).find((V)=>{if(b(V,L.arrays))return N=Error(R("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(b(V,L.nargs))return N=Error(R("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(k,F),configuration:Q,defaulted:Object.assign({},_),error:N,newAliases:Object.assign({},W)}}}function $U($){let J=[],Z=Object.create(null),X=!0;Object.keys($).forEach(function(q){J.push([].concat($[q],q))});while(X){X=!1;for(let q=0;q<J.length;q++)for(let Y=q+1;Y<J.length;Y++)if(J[q].filter(function(G){return J[Y].indexOf(G)!==-1}).length){J[q]=J[q].concat(J[Y]),J.splice(Y,1),X=!0;break}}return J.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")Z[Y]=q}),Z}function B6($){return $!==void 0?$+1:1}function wX($){if($==="__proto__")return"___proto___";return $}function JU($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var W6,V6,L6,EX=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,AX=(V6=(W6=process===null||process===void 0?void 0:process.versions)===null||W6===void 0?void 0:W6.node)!==null&&V6!==void 0?V6:(L6=process===null||process===void 0?void 0:process.version)===null||L6===void 0?void 0:L6.slice(1);if(AX){if(Number(AX.match(/^([^.]+)/)[1])<EX)throw Error(`yargs parser supports a minimum Node.js version of ${EX}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var qU=process?process.env:{},hX=new U6({cwd:process.cwd,env:()=>{return qU},format:ZU,normalize:XU,resolve:QU,require:($)=>{return _0($)}}),O$=function(J,Z){return hX.parse(J.slice(),Z).argv};O$.detailed=function($,J){return hX.parse($.slice(),J)};O$.camelCase=I1;O$.decamelize=J2;O$.looksLikeNumber=Z2;var _6=O$;import{basename as MU,dirname as CU,extname as FU,relative as jU,resolve as bX}from"path";function NX(){if(YU())return 0;return 1}function YU(){return GU()&&!process.defaultApp}function GU(){return!!process.versions.electron}function R6($){return $.slice(NX()+1)}function DX(){return process.argv[NX()]}class s extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,s)}}import{readFileSync as HU,statSync as zU,writeFile as KU}from"fs";import{format as BU}from"util";import{resolve as UU}from"path";var vX={fs:{readFileSync:HU,writeFile:KU},format:BU,resolve:UU,exists:($)=>{try{return zU($).isFile()}catch(J){return!1}}};var c0;class SX{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 J=$.shift(),Z=function(){};if(typeof $[$.length-1]==="function")Z=$.pop();if(Z=Z||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]=J,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:Z});else Z();return c0.format.apply(c0.format,[this.cache[this.locale][J]||J].concat($))}__n(){let $=Array.prototype.slice.call(arguments),J=$.shift(),Z=$.shift(),X=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=X===1?J:Z;if(this.cache[this.locale][J])Y=this.cache[this.locale][J][X===1?"one":"other"];if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]={one:J,other:Z},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(X);return c0.format.apply(c0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))this.cache[this.locale][J]=$[J]}_taggedLiteral($,...J){let Z="";return $.forEach(function(X,q){let Y=J[q+1];if(Z+=X,typeof Y<"u")Z+="%s"}),this.__.apply(this,[Z].concat([].slice.call(J,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,J=this.writeQueue[0],Z=J.directory,X=J.locale,q=J.cb,Y=this._resolveLocaleFile(Z,X),Q=JSON.stringify(this.cache[X],null,2);c0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},J=this._resolveLocaleFile(this.directory,this.locale);try{if(c0.fs.readFileSync)$=JSON.parse(c0.fs.readFileSync(J,"utf-8"))}catch(Z){if(Z instanceof SyntaxError)Z.message="syntax error in "+J;if(Z.code==="ENOENT")$={};else throw Z}this.cache[this.locale]=$}_resolveLocaleFile($,J){let Z=c0.resolve($,"./",J+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(Z)&&~J.lastIndexOf("_")){let X=c0.resolve($,"./",J.split("_")[0]+".json");if(this._fileExistsSync(X))Z=X}return Z}_fileExistsSync($){return c0.exists($)}}function fX($,J){c0=J;let Z=new SX($);return{__:Z.__.bind(Z),__n:Z.__n.bind(Z),setLocale:Z.setLocale.bind(Z),getLocale:Z.getLocale.bind(Z),updateLocale:Z.updateLocale.bind(Z),locale:Z.locale}}var WU=($)=>{return fX($,vX)},kX=WU;var xU="require is not supported by ESM",yX="loading a directory of commands is not supported yet for ESM",w$;try{w$=TU(import.meta.url)}catch($){w$=process.cwd()}var PU=w$.substring(0,w$.lastIndexOf("node_modules")),T6={assert:{notStrictEqual:VU,strictEqual:LU},cliui:z6,findUp:K6,getEnv:($)=>{return process.env[$]},inspect:_U,getCallerFile:()=>{throw new s(yX)},getProcessArgvBin:DX,mainFilename:PU||process.cwd(),Parser:_6,path:{basename:MU,dirname:CU,extname:FU,relative:jU,resolve:bX},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,J)=>process.emitWarning($,J),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:RU,require:()=>{throw new s(xU)},requireDirectory:()=>{throw new s(yX)},stringWidth:($)=>{return[...$].length},y18n:kX({directory:bX(w$,"../../../locales"),updateFiles:!1})};function F0($,J,Z,X){Z.assert.notStrictEqual($,J,X)}function M6($,J){J.assert.strictEqual(typeof $,"string")}function X$($){return Object.keys($)}function e($){return!!$&&!!$.then&&typeof $.then==="function"}function B1($){let Z=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),X=/\.*[\][<>]/g,q=Z.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(X,""),demanded:[],optional:[]};return Z.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===Z.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(X,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(X,"").split("|"),variadic:H})}),Y}var IU=["first","second","third","fourth","fifth","sixth"];function A($,J,Z){function X(){return typeof $==="object"?[{demanded:[],optional:[]},$,J]:[B1(`cmd ${$}`),J,Z]}try{let q=0,[Y,Q,G]=X(),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 s(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let U=Y.demanded.length+Y.optional.length;if(K>U)throw new s(`Too many arguments provided. Expected max ${U} but received ${K}.`);Y.demanded.forEach((B)=>{let W=H.shift(),_=gX(W);if(B.cmd.filter((L)=>L===_||L==="*").length===0)uX(_,B.cmd,q);q+=1}),Y.optional.forEach((B)=>{if(H.length===0)return;let W=H.shift(),_=gX(W);if(B.cmd.filter((L)=>L===_||L==="*").length===0)uX(_,B.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function gX($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function uX($,J,Z){throw new s(`Invalid ${IU[Z]||"manyith"} argument. Expected ${J.join(" or ")} but received ${$}.`)}class C6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,J,Z=!0,X=!1){if(A("<array|function> [boolean] [boolean] [boolean]",[$,J,Z],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=J,Y.global=Z}Array.prototype.push.apply(this.globalMiddleware,$)}else if(typeof $==="function"){let q=$;q.applyBeforeValidation=J,q.global=Z,q.mutates=X,this.globalMiddleware.push($)}return this.yargs}addCoerceMiddleware($,J){let Z=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((X)=>{let q=[...Z[J]||[],J];if(!X.option)return!0;else return!q.includes(X.option)}),$.option=J,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 mX($){if(!$)return[];return $.map((J)=>{return J.applyBeforeValidation=!1,J})}function O1($,J,Z,X){return Z.reduce((q,Y)=>{if(Y.applyBeforeValidation!==X)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(e(q))return q.then((Q)=>Promise.all([Q,Y(Q,J)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,J);return e(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function w1($,J,Z=(X)=>{throw X}){try{let X=OU($)?$():$;return e(X)?X.then((q)=>J(q)):J(X)}catch(X){return Z(X)}}function OU($){return typeof $==="function"}function F6($){for(let J=0,Z=Object.keys(_0.cache),X;J<Z.length;J++)if(X=_0.cache[Z[J]],X.exports===$)return X;return null}var Q$=/(^\*)|(^\$0)/;class pX{constructor($,J,Z,X){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=X,this.usage=$,this.globalMiddleware=Z,this.validation=J}addDirectory($,J,Z,X){if(X=X||{},typeof X.recurse!=="boolean")X.recurse=!1;if(!Array.isArray(X.extensions))X.extensions=["js"];let q=typeof X.visit==="function"?X.visit:(Y)=>Y;X.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:J,filename:Z},$,X)}addHandler($,J,Z,X,q,Y){let Q=[],G=mX(q);if(X=X||(()=>{}),Array.isArray($))if(wU($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(AU($)){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(cX(Z)){this.addHandler([$].concat(Q),J,Z.builder,Z.handler,Z.middlewares,Z.deprecated);return}if(typeof $==="string"){let H=B1($);Q=Q.map((B)=>B1(B).cmd);let K=!1,U=[H.cmd].concat(Q).filter((B)=>{if(Q$.test(B))return K=!0,!1;return!0});if(U.length===0&&K)U.push("$0");if(K)H.cmd=U[0],Q=U.slice(1),$=$.replace(Q$,H.cmd);if(Q.forEach((B)=>{this.aliasMap[B]=H.cmd}),J!==!1)this.usage.command($,J,K,Q,Y);if(this.handlers[H.cmd]={original:$,description:J,handler:X,builder:Z||{},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($,J,Z,X,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=J.getInternalMethods().getContext(),H=G.commands.slice(),K=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let U=this.applyBuilderUpdateUsageAndParse(K,Q,J,Z.aliases,H,X,q,Y);return e(U)?U.then((B)=>this.applyMiddlewareAndGetResult(K,Q,B.innerArgv,G,q,B.aliases,J)):this.applyMiddlewareAndGetResult(K,Q,U.innerArgv,G,q,U.aliases,J)}applyBuilderUpdateUsageAndParse($,J,Z,X,q,Y,Q,G){let H=J.builder,K=Z;if(X2(H)){Z.getInternalMethods().getUsageInstance().freeze();let U=H(Z.getInternalMethods().reset(X),G);if(e(U))return U.then((B)=>{return K=lX(B)?B:Z,this.parseAndUpdateUsage($,J,K,q,Y,Q)})}else if(EU(H))Z.getInternalMethods().getUsageInstance().freeze(),K=Z.getInternalMethods().reset(X),Object.keys(J.builder).forEach((U)=>{K.option(U,H[U])});return this.parseAndUpdateUsage($,J,K,q,Y,Q)}parseAndUpdateUsage($,J,Z,X,q,Y){if($)Z.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(Z))Z.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(X,J),J.description);let Q=Z.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return e(Q)?Q.then((G)=>({aliases:Z.parsed.aliases,innerArgv:G})):{aliases:Z.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,J){let Z=Q$.test(J.original)?J.original.replace(Q$,"").trim():J.original,X=$.filter((q)=>{return!Q$.test(q)});return X.push(Z),`$0 ${X.join(" ")}`}handleValidationAndGetResult($,J,Z,X,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);Z=w1(Z,(K)=>{return H(K),K})}if(J.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(Z,H,!1,!1),Z=O1(Z,Y,Q,!1),Z=w1(Z,(K)=>{let U=J.handler(K);return e(U)?U.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(e(Z)&&!Y.getInternalMethods().hasParseCallback())Z.catch((K)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,K)}catch(U){}})}if(!$)X.commands.pop(),X.fullCommands.pop();return Z}applyMiddlewareAndGetResult($,J,Z,X,q,Y,Q){let G={};if(q)return Z;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(J,Z,X,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(J.middlewares),K=O1(Z,Q,H,!0);return e(K)?K.then((U)=>this.handleValidationAndGetResult($,J,U,X,Y,Q,H,G)):this.handleValidationAndGetResult($,J,K,X,Y,Q,H,G)}populatePositionals($,J,Z,X){J._=J._.slice(Z.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,J._.length);while(q.length){let G=q.shift();this.populatePositional(G,J,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,J,Q)}return J._=Z.commands.concat(J._.map((G)=>""+G)),this.postProcessPositionals(J,Q,this.cmdToParseOptions($.original),X),Q}populatePositional($,J,Z){let X=$.cmd[0];if($.variadic)Z[X]=J._.splice(0).map(String);else if(J._.length)Z[X]=[String(J._.shift())]}cmdToParseOptions($){let J={array:[],default:{},alias:{},demand:{}},Z=B1($);return Z.demanded.forEach((X)=>{let[q,...Y]=X.cmd;if(X.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y,J.demand[q]=!0}),Z.optional.forEach((X)=>{let[q,...Y]=X.cmd;if(X.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y}),J}postProcessPositionals($,J,Z,X){let q=Object.assign({},X.getOptions());q.default=Object.assign(Z.default,q.default);for(let H of Object.keys(Z.alias))q.alias[H]=(q.alias[H]||[]).concat(Z.alias[H]);q.array=q.array.concat(Z.array),q.config={};let Y=[];if(Object.keys(J).forEach((H)=>{J[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)X.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(J);Object.keys(J).forEach((K)=>{H.push(...G.aliases[K])}),Object.keys(G.argv).forEach((K)=>{if(H.includes(K)){if(!J[K])J[K]=G.argv[K];if(!this.isInConfigs(X,K)&&!this.isDefaulted(X,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($,J){let{default:Z}=$.getOptions();return Object.prototype.hasOwnProperty.call(Z,J)||Object.prototype.hasOwnProperty.call(Z,this.shim.Parser.camelCase(J))}isInConfigs($,J){let{configObjects:Z}=$.getOptions();return Z.some((X)=>Object.prototype.hasOwnProperty.call(X,J))||Z.some((X)=>Object.prototype.hasOwnProperty.call(X,this.shim.Parser.camelCase(J)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let Z=Q$.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(Z,this.defaultCommand.description)}let J=this.defaultCommand.builder;if(X2(J))return J($,!0);else if(!cX(J))Object.keys(J).forEach((Z)=>{$.option(Z,J[Z])});return}moduleName($){let J=F6($);if(!J)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(J.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:J,desc:Z}){for(let X of[$,J,Z]){if(typeof X==="string"||X===!1)return X;F0(X,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();F0($,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 dX($,J,Z,X){return new pX($,J,Z,X)}function cX($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function wU($){return $.every((J)=>typeof J==="string")}function X2($){return typeof $==="function"}function EU($){return typeof $==="object"}function AU($){return typeof $==="object"&&!Array.isArray($)}function U1($={},J=()=>!0){let Z={};return X$($).forEach((X)=>{if(J(X,$[X]))Z[X]=$[X]}),Z}function W1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((J)=>{let Z=J;if(Z._handle&&Z.isTTY&&typeof Z._handle.setBlocking==="function")Z._handle.setBlocking($)})}function hU($){return typeof $==="boolean"}function iX($,J){let Z=J.y18n.__,X={},q=[];X.failFn=function(O){q.push(O)};let Y=null,Q=null,G=!0;X.showHelpOnFail=function(O=!0,v){let[u,o]=typeof O==="string"?[!0,O]:[O,v];if($.getInternalMethods().isGlobalContext())Q=o;return Y=o,G=u,X};let H=!1;X.fail=function(O,v){let u=$.getInternalMethods().getLoggerInstance();if(q.length)for(let o=q.length-1;o>=0;--o){let G0=q[o];if(hU(G0)){if(v)throw v;else if(O)throw Error(O)}else G0(O,v,X)}else{if($.getExitProcess())W1(!0);if(!H){if(H=!0,G)$.showHelp("error"),u.error();if(O||v)u.error(O||v);let o=Y||Q;if(o){if(O||v)u.error("");u.error(o)}}if(v=v||new s(O),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,v);else throw v}};let K=[],U=!1;X.usage=(E,O)=>{if(E===null)return U=!0,K=[],X;return U=!1,K.push([E,O||""]),X},X.getUsage=()=>{return K},X.getUsageDisabled=()=>{return U},X.getPositionalGroupName=()=>{return Z("Positionals:")};let B=[];X.example=(E,O)=>{B.push([E,O||""])};let W=[];X.command=function(O,v,u,o,G0=!1){if(u)W=W.map((i)=>{return i[2]=!1,i});W.push([O,v||"",u,o,G0])},X.getCommands=()=>W;let _={};X.describe=function(O,v){if(Array.isArray(O))O.forEach((u)=>{X.describe(u,v)});else if(typeof O==="object")Object.keys(O).forEach((u)=>{X.describe(u,O[u])});else _[O]=v},X.getDescriptions=()=>_;let R=[];X.epilog=(E)=>{R.push(E)};let L=!1,P;X.wrap=(E)=>{L=!0,P=E},X.getWrap=()=>{if(J.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)P=T0(),L=!0;return P};let x="__yargsString__:";X.deferY18nLookup=(E)=>x+E,X.help=function(){if(F)return F;c();let O=$.customScriptName?$.$0:J.path.basename($.$0),v=$.getDemandedOptions(),u=$.getDemandedCommands(),o=$.getDeprecatedOptions(),G0=$.getGroups(),i=$.getOptions(),H0=[];H0=H0.concat(Object.keys(_)),H0=H0.concat(Object.keys(v)),H0=H0.concat(Object.keys(u)),H0=H0.concat(Object.keys(i.default)),H0=H0.filter(l),H0=Object.keys(H0.reduce((y,a)=>{if(a!=="_")y[a]=!0;return y},{}));let q1=X.getWrap(),r=J.cliui({width:q1,wrap:!!q1});if(!U){if(K.length)K.forEach((y)=>{if(r.div({text:`${y[0].replace(/\$0/g,O)}`}),y[1])r.div({text:`${y[1]}`,padding:[1,0,0,0]})}),r.div();else if(W.length){let y=null;if(u._)y=`${O} <${Z("command")}>
|
|
96
|
+
`;else y=`${O} [${Z("command")}]
|
|
97
|
+
`;r.div(`${y}`)}}if(W.length>1||W.length===1&&!W[0][2]){r.div(Z("Commands:"));let y=$.getInternalMethods().getContext(),a=y.commands.length?`${y.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)W=W.sort((d,V0)=>d[0].localeCompare(V0[0]));let z0=O?`${O} `:"";W.forEach((d)=>{let V0=`${z0}${a}${d[0].replace(/^\$0 ?/,"")}`;r.span({text:V0,padding:[0,2,0,2],width:N(W,q1,`${O}${a}`)+4},{text:d[1]});let X0=[];if(d[2])X0.push(`[${Z("default")}]`);if(d[3]&&d[3].length)X0.push(`[${Z("aliases:")} ${d[3].join(", ")}]`);if(d[4])if(typeof d[4]==="string")X0.push(`[${Z("deprecated: %s",d[4])}]`);else X0.push(`[${Z("deprecated")}]`);if(X0.length)r.div({text:X0.join(" "),padding:[0,0,0,2],align:"right"});else r.div()}),r.div()}let s0=(Object.keys(i.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);H0=H0.filter((y)=>!$.parsed.newAliases[y]&&s0.every((a)=>(i.alias[a]||[]).indexOf(y)===-1));let K$=Z("Options:");if(!G0[K$])G0[K$]=[];k(H0,i.alias,G0,K$);let b=(y)=>/^--/.test(Q2(y)),y1=Object.keys(G0).filter((y)=>G0[y].length>0).map((y)=>{let a=G0[y].filter(l).map((z0)=>{if(s0.includes(z0))return z0;for(let d=0,V0;(V0=s0[d])!==void 0;d++)if((i.alias[V0]||[]).includes(z0))return V0;return z0});return{groupName:y,normalizedKeys:a}}).filter(({normalizedKeys:y})=>y.length>0).map(({groupName:y,normalizedKeys:a})=>{let z0=a.reduce((d,V0)=>{return d[V0]=[V0].concat(i.alias[V0]||[]).map((X0)=>{if(y===X.getPositionalGroupName())return X0;else return(/^[0-9]$/.test(X0)?i.boolean.includes(V0)?"-":"--":X0.length>1?"--":"-")+X0}).sort((X0,K0)=>b(X0)===b(K0)?0:b(X0)?1:-1).join(", "),d},{});return{groupName:y,normalizedKeys:a,switches:z0}});if(y1.filter(({groupName:y})=>y!==X.getPositionalGroupName()).some(({normalizedKeys:y,switches:a})=>!y.every((z0)=>b(a[z0]))))y1.filter(({groupName:y})=>y!==X.getPositionalGroupName()).forEach(({normalizedKeys:y,switches:a})=>{y.forEach((z0)=>{if(b(a[z0]))a[z0]=NU(a[z0],4)})});if(y1.forEach(({groupName:y,normalizedKeys:a,switches:z0})=>{r.div(y),a.forEach((d)=>{let V0=z0[d],X0=_[d]||"",K0=null;if(X0.includes(x))X0=Z(X0.substring(x.length));if(i.boolean.includes(d))K0=`[${Z("boolean")}]`;if(i.count.includes(d))K0=`[${Z("count")}]`;if(i.string.includes(d))K0=`[${Z("string")}]`;if(i.normalize.includes(d))K0=`[${Z("string")}]`;if(i.array.includes(d))K0=`[${Z("array")}]`;if(i.number.includes(d))K0=`[${Z("number")}]`;let V2=(j)=>typeof j==="string"?`[${Z("deprecated: %s",j)}]`:`[${Z("deprecated")}]`,V=[d in o?V2(o[d]):null,K0,d in v?`[${Z("required")}]`:null,i.choices&&i.choices[d]?`[${Z("choices:")} ${X.stringifiedValues(i.choices[d])}]`:null,t(i.default[d],i.defaultDescription[d])].filter(Boolean).join(" ");r.span({text:Q2(V0),padding:[0,2,0,2+nX(V0)],width:N(z0,q1)+4},X0);let M=$.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;if(V&&!M)r.div({text:V,padding:[0,0,0,2],align:"right"});else r.div()}),r.div()}),B.length)r.div(Z("Examples:")),B.forEach((y)=>{y[0]=y[0].replace(/\$0/g,O)}),B.forEach((y)=>{if(y[1]==="")r.div({text:y[0],padding:[0,2,0,2]});else r.div({text:y[0],padding:[0,2,0,2],width:N(B,q1)+4},{text:y[1]})}),r.div();if(R.length>0){let y=R.map((a)=>a.replace(/\$0/g,O)).join(`
|
|
98
|
+
`);r.div(`${y}
|
|
99
|
+
`)}return r.toString().replace(/\s*$/,"")};function N(E,O,v){let u=0;if(!Array.isArray(E))E=Object.values(E).map((o)=>[o]);if(E.forEach((o)=>{u=Math.max(J.stringWidth(v?`${v} ${Q2(o[0])}`:Q2(o[0]))+nX(o[0]),u)}),O)u=Math.min(u,parseInt((O*0.5).toString(),10));return u}function c(){let E=$.getDemandedOptions(),O=$.getOptions();(Object.keys(O.alias)||[]).forEach((v)=>{O.alias[v].forEach((u)=>{if(_[u])X.describe(v,_[u]);if(u in E)$.demandOption(v,E[u]);if(O.boolean.includes(u))$.boolean(v);if(O.count.includes(u))$.count(v);if(O.string.includes(u))$.string(v);if(O.normalize.includes(u))$.normalize(v);if(O.array.includes(u))$.array(v);if(O.number.includes(u))$.number(v)})})}let F;X.cacheHelpMessage=function(){F=this.help()},X.clearCachedHelpMessage=function(){F=void 0},X.hasCachedHelpMessage=function(){return!!F};function k(E,O,v,u){let o=[],G0=null;return Object.keys(v).forEach((i)=>{o=o.concat(v[i])}),E.forEach((i)=>{if(G0=[i].concat(O[i]),!G0.some((H0)=>o.indexOf(H0)!==-1))v[u].push(i)}),o}function l(E){return $.getOptions().hiddenOptions.indexOf(E)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}X.showHelp=(E)=>{let O=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:O[E])(X.help())},X.functionDescription=(E)=>{return["(",E.name?J.Parser.decamelize(E.name,"-"):Z("generated-value"),")"].join("")},X.stringifiedValues=function(O,v){let u="",o=v||", ",G0=[].concat(O);if(!O||!G0.length)return u;return G0.forEach((i)=>{if(u.length)u+=o;u+=JSON.stringify(i)}),u};function t(E,O){let v=`[${Z("default:")} `;if(E===void 0&&!O)return null;if(O)v+=O;else switch(typeof E){case"string":v+=`"${E}"`;break;case"object":v+=JSON.stringify(E);break;default:v+=E}return`${v}]`}function T0(){if(J.process.stdColumns)return Math.min(80,J.process.stdColumns);else return 80}let n=null;X.version=(E)=>{n=E},X.showVersion=(E)=>{let O=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:O[E])(n)},X.reset=function(O){return Y=null,H=!1,K=[],U=!1,R=[],B=[],W=[],_=U1(_,(v)=>!O[v]),X};let r0=[];return X.freeze=function(){r0.push({failMessage:Y,failureOutput:H,usages:K,usageDisabled:U,epilogs:R,examples:B,commands:W,descriptions:_})},X.unfreeze=function(O=!1){let v=r0.pop();if(!v)return;if(O)_={...v.descriptions,..._},W=[...v.commands,...W],K=[...v.usages,...K],B=[...v.examples,...B],R=[...v.epilogs,...R];else({failMessage:Y,failureOutput:H,usages:K,usageDisabled:U,epilogs:R,examples:B,commands:W,descriptions:_}=v)},X}function j6($){return typeof $==="object"}function NU($,J){return j6($)?{text:$.text,indentation:$.indentation+J}:{text:$,indentation:J}}function nX($){return j6($)?$.indentation:0}function Q2($){return j6($)?$.text:$}var oX=`###-begin-{{app_name}}-completions-###
|
|
95
100
|
#
|
|
96
101
|
# yargs command completion script
|
|
97
102
|
#
|
|
@@ -119,7 +124,7 @@ _{{app_name}}_yargs_completions()
|
|
|
119
124
|
}
|
|
120
125
|
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
121
126
|
###-end-{{app_name}}-completions-###
|
|
122
|
-
`,
|
|
127
|
+
`,tX=`#compdef {{app_name}}
|
|
123
128
|
###-begin-{{app_name}}-completions-###
|
|
124
129
|
#
|
|
125
130
|
# yargs command completion script
|
|
@@ -138,13 +143,13 @@ _{{app_name}}_yargs_completions()
|
|
|
138
143
|
}
|
|
139
144
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
140
145
|
###-end-{{app_name}}-completions-###
|
|
141
|
-
`;class
|
|
146
|
+
`;class aX{constructor($,J,Z,X){var q,Y,Q;this.yargs=$,this.usage=J,this.command=Z,this.shim=X,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($,J,Z,X){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(X2(H)){this.indexAfterLastReset=Q+1;let K=this.yargs.getInternalMethods().reset();return H(K,!0),K.argv}}let Y=[];this.commandCompletions(Y,$,Z),this.optionCompletions(Y,$,J,Z),this.choicesFromOptionsCompletions(Y,$,J,Z),this.choicesFromPositionalsCompletions(Y,$,J,Z),X(null,Y)}commandCompletions($,J,Z){let X=this.yargs.getInternalMethods().getContext().commands;if(!Z.match(/^-/)&&X[X.length-1]!==Z&&!this.previousArgHasChoices(J))this.usage.getCommands().forEach((q)=>{let Y=B1(q[0]).cmd;if(J.indexOf(Y)===-1)if(!this.zshShell)$.push(Y);else{let Q=q[1]||"";$.push(Y.replace(/:/g,"\\:")+":"+Q)}})}optionCompletions($,J,Z,X){if((X.match(/^-/)||X===""&&$.length===0)&&!this.previousArgHasChoices(J)){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(J,Q,G))this.completeOptionKey(Q,$,X,G&&!!q.default[Q])})}}choicesFromOptionsCompletions($,J,Z,X){if(this.previousArgHasChoices(J)){let q=this.getPreviousArgChoices(J);if(q&&q.length>0)$.push(...q.map((Y)=>Y.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions($,J,Z,X){if(X===""&&$.length>0&&this.previousArgHasChoices(J))return;let q=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],Y=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),Q=q[Z._.length-Y-1];if(!Q)return;let G=this.yargs.getOptions().choices[Q]||[];for(let H of G)if(H.startsWith(X))$.push(H.replace(/:/g,"\\:"))}getPreviousArgChoices($){if($.length<1)return;let J=$[$.length-1],Z="";if(!J.startsWith("-")&&$.length>1)Z=J,J=$[$.length-2];if(!J.startsWith("-"))return;let X=J.replace(/^-+/,""),q=this.yargs.getOptions(),Y=[X,...this.yargs.getAliases()[X]||[]],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)=>!Z||G.startsWith(Z))}previousArgHasChoices($){let J=this.getPreviousArgChoices($);return J!==void 0&&J.length>0}argsContainKey($,J,Z){let X=(q)=>$.indexOf((/^[^0-9]$/.test(q)?"-":"--")+q)!==-1;if(X(J))return!0;if(Z&&X(`no-${J}`))return!0;if(this.aliases){for(let q of this.aliases[J])if(X(q))return!0}return!1}completeOptionKey($,J,Z,X){var q,Y,Q,G;let H=$;if(this.zshShell){let W=this.usage.getDescriptions(),_=(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((P)=>{let x=W[P];return typeof x==="string"&&x.length>0}),R=_?W[_]:void 0,L=(G=(Q=W[$])!==null&&Q!==void 0?Q:R)!==null&&G!==void 0?G:"";H=`${$.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let K=(W)=>/^--/.test(W),U=(W)=>/^[^0-9]$/.test(W),B=!K(Z)&&U($)?"-":"--";if(J.push(B+H),X)J.push(B+"no-"+H)}customCompletion($,J,Z,X){if(F0(this.customCompletionFunction,null,this.shim),vU(this.customCompletionFunction)){let q=this.customCompletionFunction(Z,J);if(e(q))return q.then((Y)=>{this.shim.process.nextTick(()=>{X(null,Y)})}).catch((Y)=>{this.shim.process.nextTick(()=>{X(Y,void 0)})});return X(null,q)}else if(SU(this.customCompletionFunction))return this.customCompletionFunction(Z,J,(q=X)=>this.defaultCompletion($,J,Z,q),(q)=>{X(null,q)});else return this.customCompletionFunction(Z,J,(q)=>{X(null,q)})}getCompletion($,J){let Z=$.length?$[$.length-1]:"",X=this.yargs.parse($,!0),q=this.customCompletionFunction?(Y)=>this.customCompletion($,Y,Z,J):(Y)=>this.defaultCompletion($,Y,Z,J);return e(X)?X.then(q):q(X)}generateCompletionScript($,J){let Z=this.zshShell?tX:oX,X=this.shim.path.basename($);if($.match(/\.js$/))$=`./${$}`;return Z=Z.replace(/{{app_name}}/g,X),Z=Z.replace(/{{completion_command}}/g,J),Z.replace(/{{app_path}}/g,$)}registerFunction($){this.customCompletionFunction=$}setParsed($){this.aliases=$.aliases}}function rX($,J,Z,X){return new aX($,J,Z,X)}function vU($){return $.length<3}function SU($){return $.length>3}function sX($,J){if($.length===0)return J.length;if(J.length===0)return $.length;let Z=[],X;for(X=0;X<=J.length;X++)Z[X]=[X];let q;for(q=0;q<=$.length;q++)Z[0][q]=q;for(X=1;X<=J.length;X++)for(q=1;q<=$.length;q++)if(J.charAt(X-1)===$.charAt(q-1))Z[X][q]=Z[X-1][q-1];else if(X>1&&q>1&&J.charAt(X-2)===$.charAt(q-1)&&J.charAt(X-1)===$.charAt(q-2))Z[X][q]=Z[X-2][q-2]+1;else Z[X][q]=Math.min(Z[X-1][q-1]+1,Math.min(Z[X][q-1]+1,Z[X-1][q]+1));return Z[J.length][$.length]}var eX=["$0","--","_"];function $Q($,J,Z){let X=Z.y18n.__,q=Z.y18n.__n,Y={};Y.nonOptionCount=function(B){let W=$.getDemandedCommands(),R=B._.length+(B["--"]?B["--"].length:0)-$.getInternalMethods().getContext().commands.length;if(W._&&(R<W._.min||R>W._.max)){if(R<W._.min)if(W._.minMsg!==void 0)J.fail(W._.minMsg?W._.minMsg.replace(/\$0/g,R.toString()).replace(/\$1/,W._.min.toString()):null);else J.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",R,R.toString(),W._.min.toString()));else if(R>W._.max)if(W._.maxMsg!==void 0)J.fail(W._.maxMsg?W._.maxMsg.replace(/\$0/g,R.toString()).replace(/\$1/,W._.max.toString()):null);else J.fail(q("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",R,R.toString(),W._.max.toString()))}},Y.positionalCount=function(B,W){if(W<B)J.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",W,W+"",B+""))},Y.requiredArguments=function(B,W){let _=null;for(let R of Object.keys(W))if(!Object.prototype.hasOwnProperty.call(B,R)||typeof B[R]>"u")_=_||{},_[R]=W[R];if(_){let R=[];for(let P of Object.keys(_)){let x=_[P];if(x&&R.indexOf(x)<0)R.push(x)}let L=R.length?`
|
|
142
147
|
${R.join(`
|
|
143
|
-
`)}`:"";J.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(_).length,Object.keys(_).join(", ")+L))}},Y.unknownArguments=function(B,W,_,R,L=!0){var
|
|
144
|
-
${X("Argument: %s, Given: %s, Choices: %s",
|
|
145
|
-
`;W.forEach((R)=>{_+=R}),J.fail(_)}};let H={};Y.conflicts=function(B,W){if(E("<string|object> [array|string]",[B,W],arguments.length),typeof B==="object")Object.keys(B).forEach((_)=>{Y.conflicts(_,B[_])});else{if($.global(B),!H[B])H[B]=[];if(Array.isArray(W))W.forEach((_)=>Y.conflicts(B,_));else H[B].push(W)}},Y.getConflicting=()=>H,Y.conflicting=function(B){if(Object.keys(B).forEach((W)=>{if(H[W])H[W].forEach((_)=>{if(_&&B[W]!==void 0&&B[_]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",W,_))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((W)=>{H[W].forEach((_)=>{if(_&&B[Z.Parser.camelCase(W)]!==void 0&&B[Z.Parser.camelCase(_)]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",W,_))})})},Y.recommendCommands=function(B,W){W=W.sort((x,j)=>j.length-x.length);let R=null,L=1/0;for(let x=0,j;(j=W[x])!==void 0;x++){let h=iX(B,j);if(h<=3&&h<L)L=h,R=j}if(R)J.fail(X("Did you mean %s?",R))},Y.reset=function(B){return Q=B1(Q,(W)=>!B[W]),H=B1(H,(W)=>!B[W]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let B=K.pop();C0(B,void 0,Z),{implied:Q,conflicting:H}=B},Y}var L6=[],I$;function w$($,J,Z,X){I$=X;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=L0.resolve($.extends)}catch(G){return $}else Q=SU(J,$.extends);DU(Q),L6.push(Q),q=Y?JSON.parse(I$.readFileSync(Q,"utf8")):L0($.extends),delete $.extends,q=w$(q,I$.path.dirname(Q),Z,I$)}return L6=[],Z?aX(q,$):Object.assign({},q,$)}function DU($){if(L6.indexOf($)>-1)throw new s(`Circular extended configurations: '${$}'.`)}function SU($,J){return I$.path.resolve($,J)}function aX($,J){let Z={};function X(q){return q&&typeof q==="object"&&!Array.isArray(q)}Object.assign(Z,$);for(let q of Object.keys(J))if(X(J[q])&&X(Z[q]))Z[q]=aX($[q],J[q]);else Z[q]=J[q];return Z}var A=function($,J,Z,X,q){if(X==="m")throw TypeError("Private method is not writable");if(X==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof J==="function"?$!==J||!q:!J.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?q.call($,Z):q?q.value=Z:J.set($,Z),Z},z=function($,J,Z,X){if(Z==="a"&&!X)throw TypeError("Private accessor was defined without a getter");if(typeof J==="function"?$!==J||!X:!J.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?X:Z==="a"?X.call($):X?X.value:J.get($)},q0,w1,O$,h0,x0,s4,W1,O1,e4,N0,$2,D0,i0,I0,S0,J2,Z$,W0,S,Z2,X2,w0,E1,X$,A1,V1,Q2,g,h1,N1,D1,m,q2,o0,J0;function _Q($){return(J=[],Z=$.process.cwd(),X)=>{let q=new RQ(J,Z,X,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var rX=Symbol("copyDoubleDash"),sX=Symbol("copyDoubleDash"),_6=Symbol("deleteFromParserHintObject"),eX=Symbol("emitWarning"),$Q=Symbol("freeze"),JQ=Symbol("getDollarZero"),S1=Symbol("getParserConfiguration"),ZQ=Symbol("getUsageConfiguration"),R6=Symbol("guessLocale"),XQ=Symbol("guessVersion"),QQ=Symbol("parsePositionalNumbers"),T6=Symbol("pkgUp"),L1=Symbol("populateParserHintArray"),Q$=Symbol("populateParserHintSingleValueDictionary"),M6=Symbol("populateParserHintArrayDictionary"),C6=Symbol("populateParserHintDictionary"),F6=Symbol("sanitizeKey"),P6=Symbol("setKey"),j6=Symbol("unfreeze"),qQ=Symbol("validateAsync"),YQ=Symbol("getCommandInstance"),GQ=Symbol("getContext"),HQ=Symbol("getHasOutput"),zQ=Symbol("getLoggerInstance"),KQ=Symbol("getParseContext"),BQ=Symbol("getUsageInstance"),UQ=Symbol("getValidationInstance"),Y2=Symbol("hasParseCallback"),WQ=Symbol("isGlobalContext"),v1=Symbol("postProcess"),VQ=Symbol("rebase"),x6=Symbol("reset"),E$=Symbol("runYargsParserAndExecuteCommands"),I6=Symbol("runValidation"),LQ=Symbol("setHasOutput"),f1=Symbol("kTrackManuallySetKeys");class RQ{constructor($=[],J,Z,X){this.customScriptName=!1,this.parsed=!1,q0.set(this,void 0),w1.set(this,void 0),O$.set(this,{commands:[],fullCommands:[]}),h0.set(this,null),x0.set(this,null),s4.set(this,"show-hidden"),W1.set(this,null),O1.set(this,!0),e4.set(this,{}),N0.set(this,!0),$2.set(this,[]),D0.set(this,void 0),i0.set(this,{}),I0.set(this,!1),S0.set(this,null),J2.set(this,!0),Z$.set(this,void 0),W0.set(this,""),S.set(this,void 0),Z2.set(this,void 0),X2.set(this,{}),w0.set(this,null),E1.set(this,null),X$.set(this,{}),A1.set(this,{}),V1.set(this,void 0),Q2.set(this,!1),g.set(this,void 0),h1.set(this,!1),N1.set(this,!1),D1.set(this,!1),m.set(this,void 0),q2.set(this,{}),o0.set(this,null),J0.set(this,void 0),A(this,g,X,"f"),A(this,V1,$,"f"),A(this,w1,J,"f"),A(this,Z2,Z,"f"),A(this,D0,new U6(this),"f"),this.$0=this[JQ](),this[x6](),A(this,q0,z(this,q0,"f"),"f"),A(this,m,z(this,m,"f"),"f"),A(this,J0,z(this,J0,"f"),"f"),A(this,S,z(this,S,"f"),"f"),z(this,S,"f").showHiddenOpt=z(this,s4,"f"),A(this,Z$,this[sX](),"f")}addHelpOpt($,J){if(E("[string|boolean] [string]",[$,J],arguments.length),z(this,S0,"f"))this[_6](z(this,S0,"f")),A(this,S0,null,"f");if($===!1&&J===void 0)return this;return A(this,S0,typeof $==="string"?$:"help","f"),this.boolean(z(this,S0,"f")),this.describe(z(this,S0,"f"),J||z(this,m,"f").deferY18nLookup("Show help")),this}help($,J){return this.addHelpOpt($,J)}addShowHiddenOpt($,J){if(E("[string|boolean] [string]",[$,J],arguments.length),$===!1&&J===void 0)return this;let Z=typeof $==="string"?$:z(this,s4,"f");return this.boolean(Z),this.describe(Z,J||z(this,m,"f").deferY18nLookup("Show hidden options")),z(this,S,"f").showHiddenOpt=Z,this}showHidden($,J){return this.addShowHiddenOpt($,J)}alias($,J){return E("<object|string|array> [string|array]",[$,J],arguments.length),this[M6](this.alias.bind(this),"alias",$,J),this}array($){return E("<array|string>",[$],arguments.length),this[L1]("array",$),this[f1]($),this}boolean($){return E("<array|string>",[$],arguments.length),this[L1]("boolean",$),this[f1]($),this}check($,J){return E("<function> [boolean]",[$,J],arguments.length),this.middleware((Z,X)=>{return I1(()=>{return $(Z,X.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 Z},(q)=>{return z(this,m,"f").fail(q.message?q.message:q.toString(),q),Z})},!1,J),this}choices($,J){return E("<object|string|array> [string|array]",[$,J],arguments.length),this[M6](this.choices.bind(this),"choices",$,J),this}coerce($,J){if(E("<object|string|array> [function]",[$,J],arguments.length),Array.isArray($)){if(!J)throw new s("coerce callback must be provided");for(let Z of $)this.coerce(Z,J);return this}else if(typeof $==="object"){for(let Z of Object.keys($))this.coerce(Z,$[Z]);return this}if(!J)throw new s("coerce callback must be provided");return z(this,S,"f").key[$]=!0,z(this,D0,"f").addCoerceMiddleware((Z,X)=>{let q;if(!Object.prototype.hasOwnProperty.call(Z,$))return Z;return I1(()=>{return q=X.getAliases(),J(Z[$])},(Q)=>{Z[$]=Q;let G=X.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])Z[H]=Q;return Z},(Q)=>{throw new s(Q.message)})},$),this}conflicts($,J){return E("<string|object> [string|array]",[$,J],arguments.length),z(this,J0,"f").conflicts($,J),this}config($="config",J,Z){if(E("[object|string] [string|function] [function]",[$,J,Z],arguments.length),typeof $==="object"&&!Array.isArray($))return $=w$($,z(this,w1,"f"),this[S1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,S,"f").configObjects=(z(this,S,"f").configObjects||[]).concat($),this;if(typeof J==="function")Z=J,J=void 0;return this.describe($,J||z(this,m,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((X)=>{z(this,S,"f").config[X]=Z||!0}),this}completion($,J,Z){if(E("[string] [string|boolean|function] [function]",[$,J,Z],arguments.length),typeof J==="function")Z=J,J=void 0;if(A(this,x0,$||z(this,x0,"f")||"completion","f"),!J&&J!==!1)J="generate completion script";if(this.command(z(this,x0,"f"),J),Z)z(this,h0,"f").registerFunction(Z);return this}command($,J,Z,X,q,Y){return E("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,J,Z,X,q,Y],arguments.length),z(this,q0,"f").addHandler($,J,Z,X,q,Y),this}commands($,J,Z,X,q,Y){return this.command($,J,Z,X,q,Y)}commandDir($,J){E("<string> [object]",[$,J],arguments.length);let Z=z(this,Z2,"f")||z(this,g,"f").require;return z(this,q0,"f").addDirectory($,Z,z(this,g,"f").getCallerFile(),J),this}count($){return E("<array|string>",[$],arguments.length),this[L1]("count",$),this[f1]($),this}default($,J,Z){if(E("<object|string|array> [*] [string]",[$,J,Z],arguments.length),Z)B6($,z(this,g,"f")),z(this,S,"f").defaultDescription[$]=Z;if(typeof J==="function"){if(B6($,z(this,g,"f")),!z(this,S,"f").defaultDescription[$])z(this,S,"f").defaultDescription[$]=z(this,m,"f").functionDescription(J);J=J.call()}return this[Q$](this.default.bind(this),"default",$,J),this}defaults($,J,Z){return this.default($,J,Z)}demandCommand($=1,J,Z,X){if(E("[number] [number|string] [string|null|undefined] [string|null|undefined]",[$,J,Z,X],arguments.length),typeof J!=="number")Z=J,J=1/0;return this.global("_",!1),z(this,S,"f").demandedCommands._={min:$,max:J,minMsg:Z,maxMsg:X},this}demand($,J,Z){if(Array.isArray(J))J.forEach((X)=>{C0(Z,!0,z(this,g,"f")),this.demandOption(X,Z)}),J=1/0;else if(typeof J!=="number")Z=J,J=1/0;if(typeof $==="number")C0(Z,!0,z(this,g,"f")),this.demandCommand($,J,Z,Z);else if(Array.isArray($))$.forEach((X)=>{C0(Z,!0,z(this,g,"f")),this.demandOption(X,Z)});else if(typeof Z==="string")this.demandOption($,Z);else if(Z===!0||typeof Z>"u")this.demandOption($);return this}demandOption($,J){return E("<object|string|array> [string]",[$,J],arguments.length),this[Q$](this.demandOption.bind(this),"demandedOptions",$,J),this}deprecateOption($,J){return E("<string> [string|boolean]",[$,J],arguments.length),z(this,S,"f").deprecatedOptions[$]=J,this}describe($,J){return E("<object|string|array> [string]",[$,J],arguments.length),this[P6]($,!0),z(this,m,"f").describe($,J),this}detectLocale($){return E("<boolean>",[$],arguments.length),A(this,O1,$,"f"),this}env($){if(E("[string|boolean]",[$],arguments.length),$===!1)delete z(this,S,"f").envPrefix;else z(this,S,"f").envPrefix=$||"";return this}epilogue($){return E("<string>",[$],arguments.length),z(this,m,"f").epilog($),this}epilog($){return this.epilogue($)}example($,J){if(E("<string|array> [string]",[$,J],arguments.length),Array.isArray($))$.forEach((Z)=>this.example(...Z));else z(this,m,"f").example($,J);return this}exit($,J){if(A(this,I0,!0,"f"),A(this,W1,J,"f"),z(this,N0,"f"))z(this,g,"f").process.exit($)}exitProcess($=!0){return E("[boolean]",[$],arguments.length),A(this,N0,$,"f"),this}fail($){if(E("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new s("Invalid first argument. Expected function or boolean 'false'");return z(this,m,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,J){if(E("<array> [function]",[$,J],arguments.length),!J)return new Promise((Z,X)=>{z(this,h0,"f").getCompletion($,(q,Y)=>{if(q)X(q);else Z(Y)})});else return z(this,h0,"f").getCompletion($,J)}getDemandedOptions(){return E([],0),z(this,S,"f").demandedOptions}getDemandedCommands(){return E([],0),z(this,S,"f").demandedCommands}getDeprecatedOptions(){return E([],0),z(this,S,"f").deprecatedOptions}getDetectLocale(){return z(this,O1,"f")}getExitProcess(){return z(this,N0,"f")}getGroups(){return Object.assign({},z(this,i0,"f"),z(this,A1,"f"))}getHelp(){if(A(this,I0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let J=this[E$](z(this,V1,"f"),void 0,void 0,0,!0);if(e(J))return J.then(()=>{return z(this,m,"f").help()})}let $=z(this,q0,"f").runDefaultBuilderOn(this);if(e($))return $.then(()=>{return z(this,m,"f").help()})}return Promise.resolve(z(this,m,"f").help())}getOptions(){return z(this,S,"f")}getStrict(){return z(this,h1,"f")}getStrictCommands(){return z(this,N1,"f")}getStrictOptions(){return z(this,D1,"f")}global($,J){if(E("<string|array> [boolean]",[$,J],arguments.length),$=[].concat($),J!==!1)z(this,S,"f").local=z(this,S,"f").local.filter((Z)=>$.indexOf(Z)===-1);else $.forEach((Z)=>{if(!z(this,S,"f").local.includes(Z))z(this,S,"f").local.push(Z)});return this}group($,J){E("<string|array> <string>",[$,J],arguments.length);let Z=z(this,A1,"f")[J]||z(this,i0,"f")[J];if(z(this,A1,"f")[J])delete z(this,A1,"f")[J];let X={};return z(this,i0,"f")[J]=(Z||[]).concat($).filter((q)=>{if(X[q])return!1;return X[q]=!0}),this}hide($){return E("<string>",[$],arguments.length),z(this,S,"f").hiddenOptions.push($),this}implies($,J){return E("<string|object> [number|string|array]",[$,J],arguments.length),z(this,J0,"f").implies($,J),this}locale($){if(E("[string]",[$],arguments.length),$===void 0)return this[R6](),z(this,g,"f").y18n.getLocale();return A(this,O1,!1,"f"),z(this,g,"f").y18n.setLocale($),this}middleware($,J,Z){return z(this,D0,"f").addMiddleware($,!!J,Z)}nargs($,J){return E("<string|object|array> [number]",[$,J],arguments.length),this[Q$](this.nargs.bind(this),"narg",$,J),this}normalize($){return E("<array|string>",[$],arguments.length),this[L1]("normalize",$),this}number($){return E("<array|string>",[$],arguments.length),this[L1]("number",$),this[f1]($),this}option($,J){if(E("<string|object> [object]",[$,J],arguments.length),typeof $==="object")Object.keys($).forEach((Z)=>{this.options(Z,$[Z])});else{if(typeof J!=="object")J={};if(this[f1]($),z(this,o0,"f")&&($==="version"||(J===null||J===void 0?void 0:J.alias)==="version"))this[eX](['"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(`
|
|
146
|
-
`),void 0,"versionWarning");if(z(this,S,"f").key[$]=!0,J.alias)this.alias($,J.alias);let Z=J.deprecate||J.deprecated;if(Z)this.deprecateOption($,Z);let X=J.demand||J.required||J.require;if(X)this.demand($,X);if(J.demandOption)this.demandOption($,typeof J.demandOption==="string"?J.demandOption:void 0);if(J.conflicts)this.conflicts($,J.conflicts);if("default"in J)this.default($,J.default);if(J.implies!==void 0)this.implies($,J.implies);if(J.nargs!==void 0)this.nargs($,J.nargs);if(J.config)this.config($,J.configParser);if(J.normalize)this.normalize($);if(J.choices)this.choices($,J.choices);if(J.coerce)this.coerce($,J.coerce);if(J.group)this.group($,J.group);if(J.boolean||J.type==="boolean"){if(this.boolean($),J.alias)this.boolean(J.alias)}if(J.array||J.type==="array"){if(this.array($),J.alias)this.array(J.alias)}if(J.number||J.type==="number"){if(this.number($),J.alias)this.number(J.alias)}if(J.string||J.type==="string"){if(this.string($),J.alias)this.string(J.alias)}if(J.count||J.type==="count")this.count($);if(typeof J.global==="boolean")this.global($,J.global);if(J.defaultDescription)z(this,S,"f").defaultDescription[$]=J.defaultDescription;if(J.skipValidation)this.skipValidation($);let q=J.describe||J.description||J.desc,Y=z(this,m,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(Y,$)||typeof q==="string")this.describe($,q);if(J.hidden)this.hide($);if(J.requiresArg)this.requiresArg($)}return this}options($,J){return this.option($,J)}parse($,J,Z){if(
|
|
147
|
-
`,"f");
|
|
148
|
-
`,"f");A(this,W0,z(this,W0,"f")+$.join(" "),"f")}}}[_6]($){$$(z(this,S,"f")).forEach((J)=>{if(((X)=>X==="configObjects")(J))return;let Z=z(this,S,"f")[J];if(Array.isArray(Z)){if(Z.includes($))Z.splice(Z.indexOf($),1)}else if(typeof Z==="object")delete Z[$]}),delete z(this,m,"f").getDescriptions()[$]}[eX]($,J,Z){if(!z(this,e4,"f")[Z])z(this,g,"f").process.emitWarning($,J),z(this,e4,"f")[Z]=!0}[$Q](){z(this,$2,"f").push({options:z(this,S,"f"),configObjects:z(this,S,"f").configObjects.slice(0),exitProcess:z(this,N0,"f"),groups:z(this,i0,"f"),strict:z(this,h1,"f"),strictCommands:z(this,N1,"f"),strictOptions:z(this,D1,"f"),completionCommand:z(this,x0,"f"),output:z(this,W0,"f"),exitError:z(this,W1,"f"),hasOutput:z(this,I0,"f"),parsed:this.parsed,parseFn:z(this,w0,"f"),parseContext:z(this,E1,"f")}),z(this,m,"f").freeze(),z(this,J0,"f").freeze(),z(this,q0,"f").freeze(),z(this,D0,"f").freeze()}[JQ](){let $="",J;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,g,"f").process.argv()[0]))J=z(this,g,"f").process.argv().slice(1,2);else J=z(this,g,"f").process.argv().slice(0,1);if($=J.map((Z)=>{let X=this[VQ](z(this,w1,"f"),Z);return Z.match(/^(\/|([a-zA-Z]:)?\\)/)&&X.length<Z.length?X:Z}).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 $}[S1](){return z(this,X2,"f")}[ZQ](){return z(this,q2,"f")}[R6](){if(!z(this,O1,"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(/[.:].*/,""))}[XQ](){return this[T6]().version||"unknown"}[QQ]($){let J=$["--"]?$["--"]:$._;for(let Z=0,X;(X=J[Z])!==void 0;Z++)if(z(this,g,"f").Parser.looksLikeNumber(X)&&Number.isSafeInteger(Math.floor(parseFloat(`${X}`))))J[Z]=Number(X);return $}[T6]($){let J=$||"*";if(z(this,X$,"f")[J])return z(this,X$,"f")[J];let Z={};try{let X=$||z(this,g,"f").mainFilename;if(!$&&z(this,g,"f").path.extname(X))X=z(this,g,"f").path.dirname(X);let q=z(this,g,"f").findUp(X,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});C0(q,void 0,z(this,g,"f")),Z=JSON.parse(z(this,g,"f").readFileSync(q,"utf8"))}catch(X){}return z(this,X$,"f")[J]=Z||{},z(this,X$,"f")[J]}[L1]($,J){J=[].concat(J),J.forEach((Z)=>{Z=this[F6](Z),z(this,S,"f")[$].push(Z)})}[Q$]($,J,Z,X){this[C6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=Q})}[M6]($,J,Z,X){this[C6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=(z(this,S,"f")[q][Y]||[]).concat(Q)})}[C6]($,J,Z,X,q){if(Array.isArray(Z))Z.forEach((Y)=>{$(Y,X)});else if(((Y)=>typeof Y==="object")(Z))for(let Y of $$(Z))$(Y,Z[Y]);else q(J,this[F6](Z),X)}[F6]($){if($==="__proto__")return"___proto___";return $}[P6]($,J){return this[Q$](this[P6].bind(this),"key",$,J),this}[j6](){var $,J,Z,X,q,Y,Q,G,H,K,U,B;let W=z(this,$2,"f").pop();C0(W,void 0,z(this,g,"f"));let _;$=this,J=this,Z=this,X=this,q=this,Y=this,Q=this,G=this,H=this,K=this,U=this,B=this,{options:{set value(R){A($,S,R,"f")}}.value,configObjects:_,exitProcess:{set value(R){A(J,N0,R,"f")}}.value,groups:{set value(R){A(Z,i0,R,"f")}}.value,output:{set value(R){A(X,W0,R,"f")}}.value,exitError:{set value(R){A(q,W1,R,"f")}}.value,hasOutput:{set value(R){A(Y,I0,R,"f")}}.value,parsed:this.parsed,strict:{set value(R){A(Q,h1,R,"f")}}.value,strictCommands:{set value(R){A(G,N1,R,"f")}}.value,strictOptions:{set value(R){A(H,D1,R,"f")}}.value,completionCommand:{set value(R){A(K,x0,R,"f")}}.value,parseFn:{set value(R){A(U,w0,R,"f")}}.value,parseContext:{set value(R){A(B,E1,R,"f")}}.value}=W,z(this,S,"f").configObjects=_,z(this,m,"f").unfreeze(),z(this,J0,"f").unfreeze(),z(this,q0,"f").unfreeze(),z(this,D0,"f").unfreeze()}[qQ]($,J){return I1(J,(Z)=>{return $(Z),Z})}getInternalMethods(){return{getCommandInstance:this[YQ].bind(this),getContext:this[GQ].bind(this),getHasOutput:this[HQ].bind(this),getLoggerInstance:this[zQ].bind(this),getParseContext:this[KQ].bind(this),getParserConfiguration:this[S1].bind(this),getUsageConfiguration:this[ZQ].bind(this),getUsageInstance:this[BQ].bind(this),getValidationInstance:this[UQ].bind(this),hasParseCallback:this[Y2].bind(this),isGlobalContext:this[WQ].bind(this),postProcess:this[v1].bind(this),reset:this[x6].bind(this),runValidation:this[I6].bind(this),runYargsParserAndExecuteCommands:this[E$].bind(this),setHasOutput:this[LQ].bind(this)}}[YQ](){return z(this,q0,"f")}[GQ](){return z(this,O$,"f")}[HQ](){return z(this,I0,"f")}[zQ](){return z(this,Z$,"f")}[KQ](){return z(this,E1,"f")||{}}[BQ](){return z(this,m,"f")}[UQ](){return z(this,J0,"f")}[Y2](){return!!z(this,w0,"f")}[WQ](){return z(this,J2,"f")}[v1]($,J,Z,X){if(Z)return $;if(e($))return $;if(!J)$=this[rX]($);if(this[S1]()["parse-positional-numbers"]||this[S1]()["parse-positional-numbers"]===void 0)$=this[QQ]($);if(X)$=x1($,this,z(this,D0,"f").getMiddleware(),!1);return $}[x6]($={}){A(this,S,z(this,S,"f")||{},"f");let J={};J.local=z(this,S,"f").local||[],J.configObjects=z(this,S,"f").configObjects||[];let Z={};J.local.forEach((Y)=>{Z[Y]=!0,($[Y]||[]).forEach((Q)=>{Z[Q]=!0})}),Object.assign(z(this,A1,"f"),Object.keys(z(this,i0,"f")).reduce((Y,Q)=>{let G=z(this,i0,"f")[Q].filter((H)=>!(H in Z));if(G.length>0)Y[Q]=G;return Y},{})),A(this,i0,{},"f");let X=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(X.forEach((Y)=>{J[Y]=(z(this,S,"f")[Y]||[]).filter((Q)=>!Z[Q])}),q.forEach((Y)=>{J[Y]=B1(z(this,S,"f")[Y],(Q)=>!Z[Q])}),J.envPrefix=z(this,S,"f").envPrefix,A(this,S,J,"f"),A(this,m,z(this,m,"f")?z(this,m,"f").reset(Z):cX(this,z(this,g,"f")),"f"),A(this,J0,z(this,J0,"f")?z(this,J0,"f").reset(Z):tX(this,z(this,m,"f"),z(this,g,"f")),"f"),A(this,q0,z(this,q0,"f")?z(this,q0,"f").reset():gX(z(this,m,"f"),z(this,J0,"f"),z(this,D0,"f"),z(this,g,"f")),"f"),!z(this,h0,"f"))A(this,h0,nX(this,z(this,m,"f"),z(this,q0,"f"),z(this,g,"f")),"f");return z(this,D0,"f").reset(),A(this,x0,null,"f"),A(this,W0,"","f"),A(this,W1,null,"f"),A(this,I0,!1,"f"),this.parsed=!1,this}[VQ]($,J){return z(this,g,"f").path.relative($,J)}[E$]($,J,Z,X=0,q=!1){let Y=!!Z||q;$=$||z(this,V1,"f"),z(this,S,"f").__=z(this,g,"f").y18n.__,z(this,S,"f").configuration=this[S1]();let Q=!!z(this,S,"f").configuration["populate--"],G=Object.assign({},z(this,S,"f").configuration,{"populate--":!0}),H=z(this,g,"f").Parser.detailed($,Object.assign({},z(this,S,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),K=Object.assign(H.argv,z(this,E1,"f")),U=void 0,B=H.aliases,W=!1,_=!1;if(Object.keys(K).forEach((R)=>{if(R===z(this,S0,"f")&&K[R])W=!0;else if(R===z(this,o0,"f")&&K[R])_=!0}),K.$0=this.$0,this.parsed=H,X===0)z(this,m,"f").clearCachedHelpMessage();try{if(this[R6](),J)return this[v1](K,Q,!!Z,!1);if(z(this,S0,"f")){if([z(this,S0,"f")].concat(B[z(this,S0,"f")]||[]).filter((h)=>h.length>1).includes(""+K._[K._.length-1]))K._.pop(),W=!0}A(this,J2,!1,"f");let R=z(this,q0,"f").getCommands(),L=z(this,h0,"f").completionKey in K,x=W||L||q;if(K._.length){if(R.length){let j;for(let h=X||0,c;K._[h]!==void 0;h++)if(c=String(K._[h]),R.includes(c)&&c!==z(this,x0,"f")){let F=z(this,q0,"f").runCommand(c,this,H,h+1,q,W||_||q);return this[v1](F,Q,!!Z,!1)}else if(!j&&c!==z(this,x0,"f")){j=c;break}if(!z(this,q0,"f").hasDefaultCommand()&&z(this,Q2,"f")&&j&&!x)z(this,J0,"f").recommendCommands(j,R)}if(z(this,x0,"f")&&K._.includes(z(this,x0,"f"))&&!L){if(z(this,N0,"f"))U1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,q0,"f").hasDefaultCommand()&&!x){let j=z(this,q0,"f").runCommand(null,this,H,0,q,W||_||q);return this[v1](j,Q,!!Z,!1)}if(L){if(z(this,N0,"f"))U1(!0);$=[].concat($);let j=$.slice($.indexOf(`--${z(this,h0,"f").completionKey}`)+1);return z(this,h0,"f").getCompletion(j,(h,c)=>{if(h)throw new s(h.message);(c||[]).forEach((F)=>{z(this,Z$,"f").log(F)}),this.exit(0)}),this[v1](K,!Q,!!Z,!1)}if(!z(this,I0,"f")){if(W){if(z(this,N0,"f"))U1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(_){if(z(this,N0,"f"))U1(!0);Y=!0,z(this,m,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,S,"f").skipValidation.length>0)Y=Object.keys(K).some((j)=>z(this,S,"f").skipValidation.indexOf(j)>=0&&K[j]===!0);if(!Y){if(H.error)throw new s(H.error.message);if(!L){let j=this[I6](B,{},H.error);if(!Z)U=x1(K,this,z(this,D0,"f").getMiddleware(),!0);if(U=this[qQ](j,U!==null&&U!==void 0?U:K),e(U)&&!Z)U=U.then(()=>{return x1(K,this,z(this,D0,"f").getMiddleware(),!1)})}}}catch(R){if(R instanceof s)z(this,m,"f").fail(R.message,R);else throw R}return this[v1](U!==null&&U!==void 0?U:K,Q,!!Z,!0)}[I6]($,J,Z,X){let q={...this.getDemandedOptions()};return(Y)=>{if(Z)throw new s(Z.message);z(this,J0,"f").nonOptionCount(Y),z(this,J0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,N1,"f"))Q=z(this,J0,"f").unknownCommands(Y);if(z(this,h1,"f")&&!Q)z(this,J0,"f").unknownArguments(Y,$,J,!!X);else if(z(this,D1,"f"))z(this,J0,"f").unknownArguments(Y,$,{},!1,!1);z(this,J0,"f").limitedChoices(Y),z(this,J0,"f").implications(Y),z(this,J0,"f").conflicting(Y)}}[LQ](){A(this,I0,!0,"f")}[f1]($){if(typeof $==="string")z(this,S,"f").key[$]=!0;else for(let J of $)z(this,S,"f").key[J]=!0}}function uX($){return!!$&&typeof $.getInternalMethods==="function"}var vU=_Q(K6),TQ=vU;import{existsSync as t0,readFileSync as A$,rmSync as k1,writeFileSync as FQ,readdirSync as w6,copyFileSync as z2,mkdirSync as h$}from"fs";import{resolve as u0,dirname as E6,join as v0,basename as fU}from"path";import{fileURLToPath as kU}from"url";var MQ=TQ(z6(process.argv)).option("h",{alias:"help",type:"boolean"}).option("v",{alias:"version",type:"boolean"}).parseSync(),bU="https://github.com/ardzero/bunext.git",yU="https://github.com/ardzero/",G2=".bunext-upgrade-temp",gU=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],uU=[".git","public","src/lib/data/siteData.ts"];var mU="loading-dots",cU="favicon.svg",pU="ogImage.jpg";function dU(){try{let $=kU(import.meta.url),J=E6($),Z=v0(J,"../package.json");return JSON.parse(A$(Z,"utf-8")).version}catch{return"0.1.0"}}function lU($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function nU($,J){let Z=lU(J),X=`${yU}${Z}`,q=u0($,"project_readme.md"),Y=u0($,"README.md");if(!t0(q))return;let Q=A$(q,"utf-8");Q=Q.replace(/\?\{project-name\}/g,J).replace(/\?\{repo-link\}/g,X),FQ(Y,Q),k1(q,{force:!0})}function iU($){for(let J of uU){let Z=u0($,J);if(!t0(Z))return{ok:!1,missing:J}}return{ok:!0}}function CQ($){let J=$.indexOf("export const siteData");if(J===-1)return null;let Z=$.indexOf("{",J);if(Z===-1)return null;let X=1,q=Z+1;while(q<$.length&&X>0){let G=$[q];if(G==="{")X++;else if(G==="}")X--;q++}if(X!==0)return null;let Y=$.indexOf(";",q),Q=Y===-1?q:Y+1;return{block:$.slice(J,Q),start:J,end:Q}}function oU($){let J=$.match(/favicon:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function tU($){let J=$.match(/ogImage:\s*\{\s*src:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function O6($,J,Z=!1){let X=w6($,{withFileTypes:!0});for(let q of X){if(Z&&q.name===".git")continue;let Y=v0($,q.name),Q=v0(J,q.name);if(q.isDirectory())h$(Q,{recursive:!0}),O6(Y,Q,!1);else h$(E6(Q),{recursive:!0}),z2(Y,Q)}}async function aU(){if(MQ.v)console.log(dU()),process.exit(0);if(MQ.h)console.log("Usage: bunextupgrade"),console.log(" Upgrade an existing Bunext project to the latest template."),console.log(" Run from the project root. Preserves .git, public assets, and siteData."),process.exit(0);let $=process.cwd(),J=iU($);if(!J.ok)n0.error(`This isn't a valid Bunext project (missing: ${J.missing}).`),process.exit(1);console.clear(),BX(H2.default.bgCyan(H2.default.black(" bunextupgrade ")));let Z=WX();Z.start("Cloning latest Bunext template");try{await gZ("git",["clone","--depth","1",bU,G2],{cwd:$}),Z.stop("Template cloned")}catch(F){Z.stop("Failed to clone");let y=F instanceof Error?F.message:String(F);n0.error(y.includes("already exists")?`Directory "${G2}" already exists. Remove it and try again.`:y),process.exit(1)}let X=u0($,G2);Z.start("Cleaning template");let q=u0(X,".git");if(t0(q))k1(q,{recursive:!0,force:!0});for(let F of gU){let y=u0(X,F);if(t0(y))k1(y,{recursive:!0,force:!0})}let Y="my-app";try{let F=u0($,"package.json");if(t0(F)){let y=JSON.parse(A$(F,"utf-8"));if(typeof y.name==="string")Y=y.name}}catch{}let Q=fU($),G=await KX({message:"Project name for README / repo link",options:[{value:"current",label:`Use current directory name (${Q})`},{value:"custom",label:"Enter a custom name"}],initialValue:"current"});if(F$(G))e3("Operation cancelled"),process.exit(0);if(G==="current")Y=Q;else{let F=await zX({message:"Package / project name",initialValue:Y,validate:(y)=>{if(!y?.trim())return"Name is required";return}});if(F$(F))e3("Operation cancelled"),process.exit(0);Y=F.trim()}nU(X,Y),Z.stop("Template cleaned");let H=u0($,"public"),K=u0(X,"public"),U=u0($,"src/lib/data/siteData.ts"),B=u0(X,"src/lib/data/siteData.ts"),W=A$(U,"utf-8"),_=oU(W),R=tU(W);Z.start("Preserving your public assets and site data"),h$(K,{recursive:!0});let L=w6(H,{withFileTypes:!0});for(let F of L){if(F.name.startsWith(mU))continue;let y=v0(H,F.name),l=v0(K,F.name);if(F.isDirectory())h$(l,{recursive:!0}),O6(y,l,!1);else h$(E6(l),{recursive:!0}),z2(y,l)}let x=_?v0(H,_.replace(/^\//,"")):null;if(x&&t0(x)){if(z2(x,v0(K,_.replace(/^\//,""))),_!=="/favicon.svg"){let F=v0(K,cU);if(t0(F))k1(F,{force:!0})}}let j=R?v0(H,R.replace(/^\//,"")):null;if(j&&t0(j)){if(z2(j,v0(K,R.replace(/^\//,""))),R!=="/ogImage.jpg"){let F=v0(K,pU);if(t0(F))k1(F,{force:!0})}}let h=CQ(W);if(h&&t0(B)){let F=A$(B,"utf-8"),y=CQ(F);if(y){let l=F.slice(0,y.start)+h.block+F.slice(y.end);FQ(B,l)}}Z.stop("Preserved public assets and site data"),Z.start("Replacing project with upgraded files");let c=w6($,{withFileTypes:!0});for(let F of c){if(F.name===".git"||F.name===G2)continue;let y=v0($,F.name);k1(y,{recursive:!0,force:!0})}O6(X,$,!1),k1(X,{recursive:!0,force:!0}),Z.stop("Upgrade complete"),UX(H2.default.green("Project upgraded successfully."))}aU().catch(($)=>{n0.error($ instanceof Error?$.message:String($)),process.exit(1)});
|
|
148
|
+
`)}`:"";J.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(_).length,Object.keys(_).join(", ")+L))}},Y.unknownArguments=function(B,W,_,R,L=!0){var P;let x=$.getInternalMethods().getCommandInstance().getCommands(),N=[],c=$.getInternalMethods().getContext();if(Object.keys(B).forEach((F)=>{if(!eX.includes(F)&&!Object.prototype.hasOwnProperty.call(_,F)&&!Object.prototype.hasOwnProperty.call($.getInternalMethods().getParseContext(),F)&&!Y.isValidAndSomeAliasIsNotNew(F,W))N.push(F)}),L&&(c.commands.length>0||x.length>0||R))B._.slice(c.commands.length).forEach((F)=>{if(!x.includes(""+F))N.push(""+F)});if(L){let k=((P=$.getDemandedCommands()._)===null||P===void 0?void 0:P.max)||0,l=c.commands.length+k;if(l<B._.length)B._.slice(l).forEach((t)=>{if(t=String(t),!c.commands.includes(t)&&!N.includes(t))N.push(t)})}if(N.length)J.fail(q("Unknown argument: %s","Unknown arguments: %s",N.length,N.map((F)=>F.trim()?F:`"${F}"`).join(", ")))},Y.unknownCommands=function(B){let W=$.getInternalMethods().getCommandInstance().getCommands(),_=[],R=$.getInternalMethods().getContext();if(R.commands.length>0||W.length>0)B._.slice(R.commands.length).forEach((L)=>{if(!W.includes(""+L))_.push(""+L)});if(_.length>0)return J.fail(q("Unknown command: %s","Unknown commands: %s",_.length,_.join(", "))),!0;else return!1},Y.isValidAndSomeAliasIsNotNew=function(B,W){if(!Object.prototype.hasOwnProperty.call(W,B))return!1;let _=$.parsed.newAliases;return[B,...W[B]].some((R)=>!Object.prototype.hasOwnProperty.call(_,R)||!_[B])},Y.limitedChoices=function(B){let W=$.getOptions(),_={};if(!Object.keys(W.choices).length)return;Object.keys(B).forEach((P)=>{if(eX.indexOf(P)===-1&&Object.prototype.hasOwnProperty.call(W.choices,P))[].concat(B[P]).forEach((x)=>{if(W.choices[P].indexOf(x)===-1&&x!==void 0)_[P]=(_[P]||[]).concat(x)})});let R=Object.keys(_);if(!R.length)return;let L=X("Invalid values:");R.forEach((P)=>{L+=`
|
|
149
|
+
${X("Argument: %s, Given: %s, Choices: %s",P,J.stringifiedValues(_[P]),J.stringifiedValues(W.choices[P]))}`}),J.fail(L)};let Q={};Y.implies=function(B,W){if(A("<string|object> [array|number|string]",[B,W],arguments.length),typeof B==="object")Object.keys(B).forEach((_)=>{Y.implies(_,B[_])});else{if($.global(B),!Q[B])Q[B]=[];if(Array.isArray(W))W.forEach((_)=>Y.implies(B,_));else F0(W,void 0,Z),Q[B].push(W)}},Y.getImplied=function(){return Q};function G(U,B){let W=Number(B);if(B=isNaN(W)?B:W,typeof B==="number")B=U._.length>=B;else if(B.match(/^--no-.+/))B=B.match(/^--no-(.+)/)[1],B=!Object.prototype.hasOwnProperty.call(U,B);else B=Object.prototype.hasOwnProperty.call(U,B);return B}Y.implications=function(B){let W=[];if(Object.keys(Q).forEach((_)=>{let R=_;(Q[_]||[]).forEach((L)=>{let P=R,x=L;if(P=G(B,P),L=G(B,L),P&&!L)W.push(` ${R} -> ${x}`)})}),W.length){let _=`${X("Implications failed:")}
|
|
150
|
+
`;W.forEach((R)=>{_+=R}),J.fail(_)}};let H={};Y.conflicts=function(B,W){if(A("<string|object> [array|string]",[B,W],arguments.length),typeof B==="object")Object.keys(B).forEach((_)=>{Y.conflicts(_,B[_])});else{if($.global(B),!H[B])H[B]=[];if(Array.isArray(W))W.forEach((_)=>Y.conflicts(B,_));else H[B].push(W)}},Y.getConflicting=()=>H,Y.conflicting=function(B){if(Object.keys(B).forEach((W)=>{if(H[W])H[W].forEach((_)=>{if(_&&B[W]!==void 0&&B[_]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",W,_))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((W)=>{H[W].forEach((_)=>{if(_&&B[Z.Parser.camelCase(W)]!==void 0&&B[Z.Parser.camelCase(_)]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",W,_))})})},Y.recommendCommands=function(B,W){W=W.sort((P,x)=>x.length-P.length);let R=null,L=1/0;for(let P=0,x;(x=W[P])!==void 0;P++){let N=sX(B,x);if(N<=3&&N<L)L=N,R=x}if(R)J.fail(X("Did you mean %s?",R))},Y.reset=function(B){return Q=U1(Q,(W)=>!B[W]),H=U1(H,(W)=>!B[W]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let B=K.pop();F0(B,void 0,Z),{implied:Q,conflicting:H}=B},Y}var x6=[],E$;function A$($,J,Z,X){E$=X;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=_0.resolve($.extends)}catch(G){return $}else Q=kU(J,$.extends);fU(Q),x6.push(Q),q=Y?JSON.parse(E$.readFileSync(Q,"utf8")):_0($.extends),delete $.extends,q=A$(q,E$.path.dirname(Q),Z,E$)}return x6=[],Z?JQ(q,$):Object.assign({},q,$)}function fU($){if(x6.indexOf($)>-1)throw new s(`Circular extended configurations: '${$}'.`)}function kU($,J){return E$.path.resolve($,J)}function JQ($,J){let Z={};function X(q){return q&&typeof q==="object"&&!Array.isArray(q)}Object.assign(Z,$);for(let q of Object.keys(J))if(X(J[q])&&X(Z[q]))Z[q]=JQ($[q],J[q]);else Z[q]=J[q];return Z}var h=function($,J,Z,X,q){if(X==="m")throw TypeError("Private method is not writable");if(X==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof J==="function"?$!==J||!q:!J.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?q.call($,Z):q?q.value=Z:J.set($,Z),Z},z=function($,J,Z,X){if(Z==="a"&&!X)throw TypeError("Private accessor was defined without a getter");if(typeof J==="function"?$!==J||!X:!J.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?X:Z==="a"?X.call($):X?X.value:J.get($)},Y0,E1,h$,v0,O0,q2,V1,A1,Y2,S0,G2,f0,o0,w0,k0,H2,q$,W0,S,z2,K2,E0,h1,Y$,N1,L1,B2,g,D1,v1,S1,m,U2,t0,Z0;function FQ($){return(J=[],Z=$.process.cwd(),X)=>{let q=new jQ(J,Z,X,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var ZQ=Symbol("copyDoubleDash"),XQ=Symbol("copyDoubleDash"),P6=Symbol("deleteFromParserHintObject"),QQ=Symbol("emitWarning"),qQ=Symbol("freeze"),YQ=Symbol("getDollarZero"),f1=Symbol("getParserConfiguration"),GQ=Symbol("getUsageConfiguration"),I6=Symbol("guessLocale"),HQ=Symbol("guessVersion"),zQ=Symbol("parsePositionalNumbers"),O6=Symbol("pkgUp"),_1=Symbol("populateParserHintArray"),G$=Symbol("populateParserHintSingleValueDictionary"),w6=Symbol("populateParserHintArrayDictionary"),E6=Symbol("populateParserHintDictionary"),A6=Symbol("sanitizeKey"),h6=Symbol("setKey"),N6=Symbol("unfreeze"),KQ=Symbol("validateAsync"),BQ=Symbol("getCommandInstance"),UQ=Symbol("getContext"),WQ=Symbol("getHasOutput"),VQ=Symbol("getLoggerInstance"),LQ=Symbol("getParseContext"),_Q=Symbol("getUsageInstance"),RQ=Symbol("getValidationInstance"),W2=Symbol("hasParseCallback"),TQ=Symbol("isGlobalContext"),k1=Symbol("postProcess"),MQ=Symbol("rebase"),D6=Symbol("reset"),N$=Symbol("runYargsParserAndExecuteCommands"),v6=Symbol("runValidation"),CQ=Symbol("setHasOutput"),b1=Symbol("kTrackManuallySetKeys");class jQ{constructor($=[],J,Z,X){this.customScriptName=!1,this.parsed=!1,Y0.set(this,void 0),E1.set(this,void 0),h$.set(this,{commands:[],fullCommands:[]}),v0.set(this,null),O0.set(this,null),q2.set(this,"show-hidden"),V1.set(this,null),A1.set(this,!0),Y2.set(this,{}),S0.set(this,!0),G2.set(this,[]),f0.set(this,void 0),o0.set(this,{}),w0.set(this,!1),k0.set(this,null),H2.set(this,!0),q$.set(this,void 0),W0.set(this,""),S.set(this,void 0),z2.set(this,void 0),K2.set(this,{}),E0.set(this,null),h1.set(this,null),Y$.set(this,{}),N1.set(this,{}),L1.set(this,void 0),B2.set(this,!1),g.set(this,void 0),D1.set(this,!1),v1.set(this,!1),S1.set(this,!1),m.set(this,void 0),U2.set(this,{}),t0.set(this,null),Z0.set(this,void 0),h(this,g,X,"f"),h(this,L1,$,"f"),h(this,E1,J,"f"),h(this,z2,Z,"f"),h(this,f0,new C6(this),"f"),this.$0=this[YQ](),this[D6](),h(this,Y0,z(this,Y0,"f"),"f"),h(this,m,z(this,m,"f"),"f"),h(this,Z0,z(this,Z0,"f"),"f"),h(this,S,z(this,S,"f"),"f"),z(this,S,"f").showHiddenOpt=z(this,q2,"f"),h(this,q$,this[XQ](),"f")}addHelpOpt($,J){if(A("[string|boolean] [string]",[$,J],arguments.length),z(this,k0,"f"))this[P6](z(this,k0,"f")),h(this,k0,null,"f");if($===!1&&J===void 0)return this;return h(this,k0,typeof $==="string"?$:"help","f"),this.boolean(z(this,k0,"f")),this.describe(z(this,k0,"f"),J||z(this,m,"f").deferY18nLookup("Show help")),this}help($,J){return this.addHelpOpt($,J)}addShowHiddenOpt($,J){if(A("[string|boolean] [string]",[$,J],arguments.length),$===!1&&J===void 0)return this;let Z=typeof $==="string"?$:z(this,q2,"f");return this.boolean(Z),this.describe(Z,J||z(this,m,"f").deferY18nLookup("Show hidden options")),z(this,S,"f").showHiddenOpt=Z,this}showHidden($,J){return this.addShowHiddenOpt($,J)}alias($,J){return A("<object|string|array> [string|array]",[$,J],arguments.length),this[w6](this.alias.bind(this),"alias",$,J),this}array($){return A("<array|string>",[$],arguments.length),this[_1]("array",$),this[b1]($),this}boolean($){return A("<array|string>",[$],arguments.length),this[_1]("boolean",$),this[b1]($),this}check($,J){return A("<function> [boolean]",[$,J],arguments.length),this.middleware((Z,X)=>{return w1(()=>{return $(Z,X.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 Z},(q)=>{return z(this,m,"f").fail(q.message?q.message:q.toString(),q),Z})},!1,J),this}choices($,J){return A("<object|string|array> [string|array]",[$,J],arguments.length),this[w6](this.choices.bind(this),"choices",$,J),this}coerce($,J){if(A("<object|string|array> [function]",[$,J],arguments.length),Array.isArray($)){if(!J)throw new s("coerce callback must be provided");for(let Z of $)this.coerce(Z,J);return this}else if(typeof $==="object"){for(let Z of Object.keys($))this.coerce(Z,$[Z]);return this}if(!J)throw new s("coerce callback must be provided");return z(this,S,"f").key[$]=!0,z(this,f0,"f").addCoerceMiddleware((Z,X)=>{let q;if(!Object.prototype.hasOwnProperty.call(Z,$))return Z;return w1(()=>{return q=X.getAliases(),J(Z[$])},(Q)=>{Z[$]=Q;let G=X.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])Z[H]=Q;return Z},(Q)=>{throw new s(Q.message)})},$),this}conflicts($,J){return A("<string|object> [string|array]",[$,J],arguments.length),z(this,Z0,"f").conflicts($,J),this}config($="config",J,Z){if(A("[object|string] [string|function] [function]",[$,J,Z],arguments.length),typeof $==="object"&&!Array.isArray($))return $=A$($,z(this,E1,"f"),this[f1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,S,"f").configObjects=(z(this,S,"f").configObjects||[]).concat($),this;if(typeof J==="function")Z=J,J=void 0;return this.describe($,J||z(this,m,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((X)=>{z(this,S,"f").config[X]=Z||!0}),this}completion($,J,Z){if(A("[string] [string|boolean|function] [function]",[$,J,Z],arguments.length),typeof J==="function")Z=J,J=void 0;if(h(this,O0,$||z(this,O0,"f")||"completion","f"),!J&&J!==!1)J="generate completion script";if(this.command(z(this,O0,"f"),J),Z)z(this,v0,"f").registerFunction(Z);return this}command($,J,Z,X,q,Y){return A("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,J,Z,X,q,Y],arguments.length),z(this,Y0,"f").addHandler($,J,Z,X,q,Y),this}commands($,J,Z,X,q,Y){return this.command($,J,Z,X,q,Y)}commandDir($,J){A("<string> [object]",[$,J],arguments.length);let Z=z(this,z2,"f")||z(this,g,"f").require;return z(this,Y0,"f").addDirectory($,Z,z(this,g,"f").getCallerFile(),J),this}count($){return A("<array|string>",[$],arguments.length),this[_1]("count",$),this[b1]($),this}default($,J,Z){if(A("<object|string|array> [*] [string]",[$,J,Z],arguments.length),Z)M6($,z(this,g,"f")),z(this,S,"f").defaultDescription[$]=Z;if(typeof J==="function"){if(M6($,z(this,g,"f")),!z(this,S,"f").defaultDescription[$])z(this,S,"f").defaultDescription[$]=z(this,m,"f").functionDescription(J);J=J.call()}return this[G$](this.default.bind(this),"default",$,J),this}defaults($,J,Z){return this.default($,J,Z)}demandCommand($=1,J,Z,X){if(A("[number] [number|string] [string|null|undefined] [string|null|undefined]",[$,J,Z,X],arguments.length),typeof J!=="number")Z=J,J=1/0;return this.global("_",!1),z(this,S,"f").demandedCommands._={min:$,max:J,minMsg:Z,maxMsg:X},this}demand($,J,Z){if(Array.isArray(J))J.forEach((X)=>{F0(Z,!0,z(this,g,"f")),this.demandOption(X,Z)}),J=1/0;else if(typeof J!=="number")Z=J,J=1/0;if(typeof $==="number")F0(Z,!0,z(this,g,"f")),this.demandCommand($,J,Z,Z);else if(Array.isArray($))$.forEach((X)=>{F0(Z,!0,z(this,g,"f")),this.demandOption(X,Z)});else if(typeof Z==="string")this.demandOption($,Z);else if(Z===!0||typeof Z>"u")this.demandOption($);return this}demandOption($,J){return A("<object|string|array> [string]",[$,J],arguments.length),this[G$](this.demandOption.bind(this),"demandedOptions",$,J),this}deprecateOption($,J){return A("<string> [string|boolean]",[$,J],arguments.length),z(this,S,"f").deprecatedOptions[$]=J,this}describe($,J){return A("<object|string|array> [string]",[$,J],arguments.length),this[h6]($,!0),z(this,m,"f").describe($,J),this}detectLocale($){return A("<boolean>",[$],arguments.length),h(this,A1,$,"f"),this}env($){if(A("[string|boolean]",[$],arguments.length),$===!1)delete z(this,S,"f").envPrefix;else z(this,S,"f").envPrefix=$||"";return this}epilogue($){return A("<string>",[$],arguments.length),z(this,m,"f").epilog($),this}epilog($){return this.epilogue($)}example($,J){if(A("<string|array> [string]",[$,J],arguments.length),Array.isArray($))$.forEach((Z)=>this.example(...Z));else z(this,m,"f").example($,J);return this}exit($,J){if(h(this,w0,!0,"f"),h(this,V1,J,"f"),z(this,S0,"f"))z(this,g,"f").process.exit($)}exitProcess($=!0){return A("[boolean]",[$],arguments.length),h(this,S0,$,"f"),this}fail($){if(A("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new s("Invalid first argument. Expected function or boolean 'false'");return z(this,m,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,J){if(A("<array> [function]",[$,J],arguments.length),!J)return new Promise((Z,X)=>{z(this,v0,"f").getCompletion($,(q,Y)=>{if(q)X(q);else Z(Y)})});else return z(this,v0,"f").getCompletion($,J)}getDemandedOptions(){return A([],0),z(this,S,"f").demandedOptions}getDemandedCommands(){return A([],0),z(this,S,"f").demandedCommands}getDeprecatedOptions(){return A([],0),z(this,S,"f").deprecatedOptions}getDetectLocale(){return z(this,A1,"f")}getExitProcess(){return z(this,S0,"f")}getGroups(){return Object.assign({},z(this,o0,"f"),z(this,N1,"f"))}getHelp(){if(h(this,w0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let J=this[N$](z(this,L1,"f"),void 0,void 0,0,!0);if(e(J))return J.then(()=>{return z(this,m,"f").help()})}let $=z(this,Y0,"f").runDefaultBuilderOn(this);if(e($))return $.then(()=>{return z(this,m,"f").help()})}return Promise.resolve(z(this,m,"f").help())}getOptions(){return z(this,S,"f")}getStrict(){return z(this,D1,"f")}getStrictCommands(){return z(this,v1,"f")}getStrictOptions(){return z(this,S1,"f")}global($,J){if(A("<string|array> [boolean]",[$,J],arguments.length),$=[].concat($),J!==!1)z(this,S,"f").local=z(this,S,"f").local.filter((Z)=>$.indexOf(Z)===-1);else $.forEach((Z)=>{if(!z(this,S,"f").local.includes(Z))z(this,S,"f").local.push(Z)});return this}group($,J){A("<string|array> <string>",[$,J],arguments.length);let Z=z(this,N1,"f")[J]||z(this,o0,"f")[J];if(z(this,N1,"f")[J])delete z(this,N1,"f")[J];let X={};return z(this,o0,"f")[J]=(Z||[]).concat($).filter((q)=>{if(X[q])return!1;return X[q]=!0}),this}hide($){return A("<string>",[$],arguments.length),z(this,S,"f").hiddenOptions.push($),this}implies($,J){return A("<string|object> [number|string|array]",[$,J],arguments.length),z(this,Z0,"f").implies($,J),this}locale($){if(A("[string]",[$],arguments.length),$===void 0)return this[I6](),z(this,g,"f").y18n.getLocale();return h(this,A1,!1,"f"),z(this,g,"f").y18n.setLocale($),this}middleware($,J,Z){return z(this,f0,"f").addMiddleware($,!!J,Z)}nargs($,J){return A("<string|object|array> [number]",[$,J],arguments.length),this[G$](this.nargs.bind(this),"narg",$,J),this}normalize($){return A("<array|string>",[$],arguments.length),this[_1]("normalize",$),this}number($){return A("<array|string>",[$],arguments.length),this[_1]("number",$),this[b1]($),this}option($,J){if(A("<string|object> [object]",[$,J],arguments.length),typeof $==="object")Object.keys($).forEach((Z)=>{this.options(Z,$[Z])});else{if(typeof J!=="object")J={};if(this[b1]($),z(this,t0,"f")&&($==="version"||(J===null||J===void 0?void 0:J.alias)==="version"))this[QQ](['"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(`
|
|
151
|
+
`),void 0,"versionWarning");if(z(this,S,"f").key[$]=!0,J.alias)this.alias($,J.alias);let Z=J.deprecate||J.deprecated;if(Z)this.deprecateOption($,Z);let X=J.demand||J.required||J.require;if(X)this.demand($,X);if(J.demandOption)this.demandOption($,typeof J.demandOption==="string"?J.demandOption:void 0);if(J.conflicts)this.conflicts($,J.conflicts);if("default"in J)this.default($,J.default);if(J.implies!==void 0)this.implies($,J.implies);if(J.nargs!==void 0)this.nargs($,J.nargs);if(J.config)this.config($,J.configParser);if(J.normalize)this.normalize($);if(J.choices)this.choices($,J.choices);if(J.coerce)this.coerce($,J.coerce);if(J.group)this.group($,J.group);if(J.boolean||J.type==="boolean"){if(this.boolean($),J.alias)this.boolean(J.alias)}if(J.array||J.type==="array"){if(this.array($),J.alias)this.array(J.alias)}if(J.number||J.type==="number"){if(this.number($),J.alias)this.number(J.alias)}if(J.string||J.type==="string"){if(this.string($),J.alias)this.string(J.alias)}if(J.count||J.type==="count")this.count($);if(typeof J.global==="boolean")this.global($,J.global);if(J.defaultDescription)z(this,S,"f").defaultDescription[$]=J.defaultDescription;if(J.skipValidation)this.skipValidation($);let q=J.describe||J.description||J.desc,Y=z(this,m,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(Y,$)||typeof q==="string")this.describe($,q);if(J.hidden)this.hide($);if(J.requiresArg)this.requiresArg($)}return this}options($,J){return this.option($,J)}parse($,J,Z){if(A("[string|array] [function|boolean|object] [function]",[$,J,Z],arguments.length),this[qQ](),typeof $>"u")$=z(this,L1,"f");if(typeof J==="object")h(this,h1,J,"f"),J=Z;if(typeof J==="function")h(this,E0,J,"f"),J=!1;if(!J)h(this,L1,$,"f");if(z(this,E0,"f"))h(this,S0,!1,"f");let X=this[N$]($,!!J),q=this.parsed;if(z(this,v0,"f").setParsed(this.parsed),e(X))return X.then((Y)=>{if(z(this,E0,"f"))z(this,E0,"f").call(this,z(this,V1,"f"),Y,z(this,W0,"f"));return Y}).catch((Y)=>{if(z(this,E0,"f"))z(this,E0,"f")(Y,this.parsed.argv,z(this,W0,"f"));throw Y}).finally(()=>{this[N6](),this.parsed=q});else{if(z(this,E0,"f"))z(this,E0,"f").call(this,z(this,V1,"f"),X,z(this,W0,"f"));this[N6](),this.parsed=q}return X}parseAsync($,J,Z){let X=this.parse($,J,Z);return!e(X)?Promise.resolve(X):X}parseSync($,J,Z){let X=this.parse($,J,Z);if(e(X))throw new s(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return X}parserConfiguration($){return A("<object>",[$],arguments.length),h(this,K2,$,"f"),this}pkgConf($,J){A("<string> [string]",[$,J],arguments.length);let Z=null,X=this[O6](J||z(this,E1,"f"));if(X[$]&&typeof X[$]==="object")Z=A$(X[$],J||z(this,E1,"f"),this[f1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,S,"f").configObjects=(z(this,S,"f").configObjects||[]).concat(Z);return this}positional($,J){A("<string> <object>",[$,J],arguments.length);let Z=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];J=U1(J,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return Z.includes(Y)});let X=z(this,h$,"f").fullCommands[z(this,h$,"f").fullCommands.length-1],q=X?z(this,Y0,"f").cmdToParseOptions(X):{array:[],alias:{},default:{},demand:{}};return X$(q).forEach((Y)=>{let Q=q[Y];if(Array.isArray(Q)){if(Q.indexOf($)!==-1)J[Y]=!0}else if(Q[$]&&!(Y in J))J[Y]=Q[$]}),this.group($,z(this,m,"f").getPositionalGroupName()),this.option($,J)}recommendCommands($=!0){return A("[boolean]",[$],arguments.length),h(this,B2,$,"f"),this}required($,J,Z){return this.demand($,J,Z)}require($,J,Z){return this.demand($,J,Z)}requiresArg($){if(A("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,S,"f").narg[$])return this;else this[G$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,J){return A("[string] [string]",[$,J],arguments.length),$=$||this.$0,z(this,q$,"f").log(z(this,v0,"f").generateCompletionScript($,J||z(this,O0,"f")||"completion")),this}showHelp($){if(A("[string|function]",[$],arguments.length),h(this,w0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let Z=this[N$](z(this,L1,"f"),void 0,void 0,0,!0);if(e(Z))return Z.then(()=>{z(this,m,"f").showHelp($)}),this}let J=z(this,Y0,"f").runDefaultBuilderOn(this);if(e(J))return J.then(()=>{z(this,m,"f").showHelp($)}),this}return z(this,m,"f").showHelp($),this}scriptName($){return this.customScriptName=!0,this.$0=$,this}showHelpOnFail($,J){return A("[boolean|string] [string]",[$,J],arguments.length),z(this,m,"f").showHelpOnFail($,J),this}showVersion($){return A("[string|function]",[$],arguments.length),z(this,m,"f").showVersion($),this}skipValidation($){return A("<array|string>",[$],arguments.length),this[_1]("skipValidation",$),this}strict($){return A("[boolean]",[$],arguments.length),h(this,D1,$!==!1,"f"),this}strictCommands($){return A("[boolean]",[$],arguments.length),h(this,v1,$!==!1,"f"),this}strictOptions($){return A("[boolean]",[$],arguments.length),h(this,S1,$!==!1,"f"),this}string($){return A("<array|string>",[$],arguments.length),this[_1]("string",$),this[b1]($),this}terminalWidth(){return A([],0),z(this,g,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return A("<object>",[$],arguments.length),h(this,A1,!1,"f"),z(this,g,"f").y18n.updateLocale($),this}usage($,J,Z,X){if(A("<string|null|undefined> [string|boolean] [function|object] [function]",[$,J,Z,X],arguments.length),J!==void 0)if(F0($,null,z(this,g,"f")),($||"").match(/^\$0( |$)/))return this.command($,J,Z,X);else throw new s(".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,U2,$,"f"),this}version($,J,Z){if(A("[boolean|string] [string] [string]",[$,J,Z],arguments.length),z(this,t0,"f"))this[P6](z(this,t0,"f")),z(this,m,"f").version(void 0),h(this,t0,null,"f");if(arguments.length===0)Z=this[HQ](),$="version";else if(arguments.length===1){if($===!1)return this;Z=$,$="version"}else if(arguments.length===2)Z=J,J=void 0;return h(this,t0,typeof $==="string"?$:"version","f"),J=J||z(this,m,"f").deferY18nLookup("Show version number"),z(this,m,"f").version(Z||void 0),this.boolean(z(this,t0,"f")),this.describe(z(this,t0,"f"),J),this}wrap($){return A("<number|null|undefined>",[$],arguments.length),z(this,m,"f").wrap($),this}[(Y0=new WeakMap,E1=new WeakMap,h$=new WeakMap,v0=new WeakMap,O0=new WeakMap,q2=new WeakMap,V1=new WeakMap,A1=new WeakMap,Y2=new WeakMap,S0=new WeakMap,G2=new WeakMap,f0=new WeakMap,o0=new WeakMap,w0=new WeakMap,k0=new WeakMap,H2=new WeakMap,q$=new WeakMap,W0=new WeakMap,S=new WeakMap,z2=new WeakMap,K2=new WeakMap,E0=new WeakMap,h1=new WeakMap,Y$=new WeakMap,N1=new WeakMap,L1=new WeakMap,B2=new WeakMap,g=new WeakMap,D1=new WeakMap,v1=new WeakMap,S1=new WeakMap,m=new WeakMap,U2=new WeakMap,t0=new WeakMap,Z0=new WeakMap,ZQ)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(J){}return $}[XQ](){return{log:(...$)=>{if(!this[W2]())console.log(...$);if(h(this,w0,!0,"f"),z(this,W0,"f").length)h(this,W0,z(this,W0,"f")+`
|
|
152
|
+
`,"f");h(this,W0,z(this,W0,"f")+$.join(" "),"f")},error:(...$)=>{if(!this[W2]())console.error(...$);if(h(this,w0,!0,"f"),z(this,W0,"f").length)h(this,W0,z(this,W0,"f")+`
|
|
153
|
+
`,"f");h(this,W0,z(this,W0,"f")+$.join(" "),"f")}}}[P6]($){X$(z(this,S,"f")).forEach((J)=>{if(((X)=>X==="configObjects")(J))return;let Z=z(this,S,"f")[J];if(Array.isArray(Z)){if(Z.includes($))Z.splice(Z.indexOf($),1)}else if(typeof Z==="object")delete Z[$]}),delete z(this,m,"f").getDescriptions()[$]}[QQ]($,J,Z){if(!z(this,Y2,"f")[Z])z(this,g,"f").process.emitWarning($,J),z(this,Y2,"f")[Z]=!0}[qQ](){z(this,G2,"f").push({options:z(this,S,"f"),configObjects:z(this,S,"f").configObjects.slice(0),exitProcess:z(this,S0,"f"),groups:z(this,o0,"f"),strict:z(this,D1,"f"),strictCommands:z(this,v1,"f"),strictOptions:z(this,S1,"f"),completionCommand:z(this,O0,"f"),output:z(this,W0,"f"),exitError:z(this,V1,"f"),hasOutput:z(this,w0,"f"),parsed:this.parsed,parseFn:z(this,E0,"f"),parseContext:z(this,h1,"f")}),z(this,m,"f").freeze(),z(this,Z0,"f").freeze(),z(this,Y0,"f").freeze(),z(this,f0,"f").freeze()}[YQ](){let $="",J;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,g,"f").process.argv()[0]))J=z(this,g,"f").process.argv().slice(1,2);else J=z(this,g,"f").process.argv().slice(0,1);if($=J.map((Z)=>{let X=this[MQ](z(this,E1,"f"),Z);return Z.match(/^(\/|([a-zA-Z]:)?\\)/)&&X.length<Z.length?X:Z}).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 $}[f1](){return z(this,K2,"f")}[GQ](){return z(this,U2,"f")}[I6](){if(!z(this,A1,"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(/[.:].*/,""))}[HQ](){return this[O6]().version||"unknown"}[zQ]($){let J=$["--"]?$["--"]:$._;for(let Z=0,X;(X=J[Z])!==void 0;Z++)if(z(this,g,"f").Parser.looksLikeNumber(X)&&Number.isSafeInteger(Math.floor(parseFloat(`${X}`))))J[Z]=Number(X);return $}[O6]($){let J=$||"*";if(z(this,Y$,"f")[J])return z(this,Y$,"f")[J];let Z={};try{let X=$||z(this,g,"f").mainFilename;if(!$&&z(this,g,"f").path.extname(X))X=z(this,g,"f").path.dirname(X);let q=z(this,g,"f").findUp(X,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});F0(q,void 0,z(this,g,"f")),Z=JSON.parse(z(this,g,"f").readFileSync(q,"utf8"))}catch(X){}return z(this,Y$,"f")[J]=Z||{},z(this,Y$,"f")[J]}[_1]($,J){J=[].concat(J),J.forEach((Z)=>{Z=this[A6](Z),z(this,S,"f")[$].push(Z)})}[G$]($,J,Z,X){this[E6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=Q})}[w6]($,J,Z,X){this[E6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=(z(this,S,"f")[q][Y]||[]).concat(Q)})}[E6]($,J,Z,X,q){if(Array.isArray(Z))Z.forEach((Y)=>{$(Y,X)});else if(((Y)=>typeof Y==="object")(Z))for(let Y of X$(Z))$(Y,Z[Y]);else q(J,this[A6](Z),X)}[A6]($){if($==="__proto__")return"___proto___";return $}[h6]($,J){return this[G$](this[h6].bind(this),"key",$,J),this}[N6](){var $,J,Z,X,q,Y,Q,G,H,K,U,B;let W=z(this,G2,"f").pop();F0(W,void 0,z(this,g,"f"));let _;$=this,J=this,Z=this,X=this,q=this,Y=this,Q=this,G=this,H=this,K=this,U=this,B=this,{options:{set value(R){h($,S,R,"f")}}.value,configObjects:_,exitProcess:{set value(R){h(J,S0,R,"f")}}.value,groups:{set value(R){h(Z,o0,R,"f")}}.value,output:{set value(R){h(X,W0,R,"f")}}.value,exitError:{set value(R){h(q,V1,R,"f")}}.value,hasOutput:{set value(R){h(Y,w0,R,"f")}}.value,parsed:this.parsed,strict:{set value(R){h(Q,D1,R,"f")}}.value,strictCommands:{set value(R){h(G,v1,R,"f")}}.value,strictOptions:{set value(R){h(H,S1,R,"f")}}.value,completionCommand:{set value(R){h(K,O0,R,"f")}}.value,parseFn:{set value(R){h(U,E0,R,"f")}}.value,parseContext:{set value(R){h(B,h1,R,"f")}}.value}=W,z(this,S,"f").configObjects=_,z(this,m,"f").unfreeze(),z(this,Z0,"f").unfreeze(),z(this,Y0,"f").unfreeze(),z(this,f0,"f").unfreeze()}[KQ]($,J){return w1(J,(Z)=>{return $(Z),Z})}getInternalMethods(){return{getCommandInstance:this[BQ].bind(this),getContext:this[UQ].bind(this),getHasOutput:this[WQ].bind(this),getLoggerInstance:this[VQ].bind(this),getParseContext:this[LQ].bind(this),getParserConfiguration:this[f1].bind(this),getUsageConfiguration:this[GQ].bind(this),getUsageInstance:this[_Q].bind(this),getValidationInstance:this[RQ].bind(this),hasParseCallback:this[W2].bind(this),isGlobalContext:this[TQ].bind(this),postProcess:this[k1].bind(this),reset:this[D6].bind(this),runValidation:this[v6].bind(this),runYargsParserAndExecuteCommands:this[N$].bind(this),setHasOutput:this[CQ].bind(this)}}[BQ](){return z(this,Y0,"f")}[UQ](){return z(this,h$,"f")}[WQ](){return z(this,w0,"f")}[VQ](){return z(this,q$,"f")}[LQ](){return z(this,h1,"f")||{}}[_Q](){return z(this,m,"f")}[RQ](){return z(this,Z0,"f")}[W2](){return!!z(this,E0,"f")}[TQ](){return z(this,H2,"f")}[k1]($,J,Z,X){if(Z)return $;if(e($))return $;if(!J)$=this[ZQ]($);if(this[f1]()["parse-positional-numbers"]||this[f1]()["parse-positional-numbers"]===void 0)$=this[zQ]($);if(X)$=O1($,this,z(this,f0,"f").getMiddleware(),!1);return $}[D6]($={}){h(this,S,z(this,S,"f")||{},"f");let J={};J.local=z(this,S,"f").local||[],J.configObjects=z(this,S,"f").configObjects||[];let Z={};J.local.forEach((Y)=>{Z[Y]=!0,($[Y]||[]).forEach((Q)=>{Z[Q]=!0})}),Object.assign(z(this,N1,"f"),Object.keys(z(this,o0,"f")).reduce((Y,Q)=>{let G=z(this,o0,"f")[Q].filter((H)=>!(H in Z));if(G.length>0)Y[Q]=G;return Y},{})),h(this,o0,{},"f");let X=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(X.forEach((Y)=>{J[Y]=(z(this,S,"f")[Y]||[]).filter((Q)=>!Z[Q])}),q.forEach((Y)=>{J[Y]=U1(z(this,S,"f")[Y],(Q)=>!Z[Q])}),J.envPrefix=z(this,S,"f").envPrefix,h(this,S,J,"f"),h(this,m,z(this,m,"f")?z(this,m,"f").reset(Z):iX(this,z(this,g,"f")),"f"),h(this,Z0,z(this,Z0,"f")?z(this,Z0,"f").reset(Z):$Q(this,z(this,m,"f"),z(this,g,"f")),"f"),h(this,Y0,z(this,Y0,"f")?z(this,Y0,"f").reset():dX(z(this,m,"f"),z(this,Z0,"f"),z(this,f0,"f"),z(this,g,"f")),"f"),!z(this,v0,"f"))h(this,v0,rX(this,z(this,m,"f"),z(this,Y0,"f"),z(this,g,"f")),"f");return z(this,f0,"f").reset(),h(this,O0,null,"f"),h(this,W0,"","f"),h(this,V1,null,"f"),h(this,w0,!1,"f"),this.parsed=!1,this}[MQ]($,J){return z(this,g,"f").path.relative($,J)}[N$]($,J,Z,X=0,q=!1){let Y=!!Z||q;$=$||z(this,L1,"f"),z(this,S,"f").__=z(this,g,"f").y18n.__,z(this,S,"f").configuration=this[f1]();let Q=!!z(this,S,"f").configuration["populate--"],G=Object.assign({},z(this,S,"f").configuration,{"populate--":!0}),H=z(this,g,"f").Parser.detailed($,Object.assign({},z(this,S,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),K=Object.assign(H.argv,z(this,h1,"f")),U=void 0,B=H.aliases,W=!1,_=!1;if(Object.keys(K).forEach((R)=>{if(R===z(this,k0,"f")&&K[R])W=!0;else if(R===z(this,t0,"f")&&K[R])_=!0}),K.$0=this.$0,this.parsed=H,X===0)z(this,m,"f").clearCachedHelpMessage();try{if(this[I6](),J)return this[k1](K,Q,!!Z,!1);if(z(this,k0,"f")){if([z(this,k0,"f")].concat(B[z(this,k0,"f")]||[]).filter((N)=>N.length>1).includes(""+K._[K._.length-1]))K._.pop(),W=!0}h(this,H2,!1,"f");let R=z(this,Y0,"f").getCommands(),L=z(this,v0,"f").completionKey in K,P=W||L||q;if(K._.length){if(R.length){let x;for(let N=X||0,c;K._[N]!==void 0;N++)if(c=String(K._[N]),R.includes(c)&&c!==z(this,O0,"f")){let F=z(this,Y0,"f").runCommand(c,this,H,N+1,q,W||_||q);return this[k1](F,Q,!!Z,!1)}else if(!x&&c!==z(this,O0,"f")){x=c;break}if(!z(this,Y0,"f").hasDefaultCommand()&&z(this,B2,"f")&&x&&!P)z(this,Z0,"f").recommendCommands(x,R)}if(z(this,O0,"f")&&K._.includes(z(this,O0,"f"))&&!L){if(z(this,S0,"f"))W1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,Y0,"f").hasDefaultCommand()&&!P){let x=z(this,Y0,"f").runCommand(null,this,H,0,q,W||_||q);return this[k1](x,Q,!!Z,!1)}if(L){if(z(this,S0,"f"))W1(!0);$=[].concat($);let x=$.slice($.indexOf(`--${z(this,v0,"f").completionKey}`)+1);return z(this,v0,"f").getCompletion(x,(N,c)=>{if(N)throw new s(N.message);(c||[]).forEach((F)=>{z(this,q$,"f").log(F)}),this.exit(0)}),this[k1](K,!Q,!!Z,!1)}if(!z(this,w0,"f")){if(W){if(z(this,S0,"f"))W1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(_){if(z(this,S0,"f"))W1(!0);Y=!0,z(this,m,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,S,"f").skipValidation.length>0)Y=Object.keys(K).some((x)=>z(this,S,"f").skipValidation.indexOf(x)>=0&&K[x]===!0);if(!Y){if(H.error)throw new s(H.error.message);if(!L){let x=this[v6](B,{},H.error);if(!Z)U=O1(K,this,z(this,f0,"f").getMiddleware(),!0);if(U=this[KQ](x,U!==null&&U!==void 0?U:K),e(U)&&!Z)U=U.then(()=>{return O1(K,this,z(this,f0,"f").getMiddleware(),!1)})}}}catch(R){if(R instanceof s)z(this,m,"f").fail(R.message,R);else throw R}return this[k1](U!==null&&U!==void 0?U:K,Q,!!Z,!0)}[v6]($,J,Z,X){let q={...this.getDemandedOptions()};return(Y)=>{if(Z)throw new s(Z.message);z(this,Z0,"f").nonOptionCount(Y),z(this,Z0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,v1,"f"))Q=z(this,Z0,"f").unknownCommands(Y);if(z(this,D1,"f")&&!Q)z(this,Z0,"f").unknownArguments(Y,$,J,!!X);else if(z(this,S1,"f"))z(this,Z0,"f").unknownArguments(Y,$,{},!1,!1);z(this,Z0,"f").limitedChoices(Y),z(this,Z0,"f").implications(Y),z(this,Z0,"f").conflicting(Y)}}[CQ](){h(this,w0,!0,"f")}[b1]($){if(typeof $==="string")z(this,S,"f").key[$]=!0;else for(let J of $)z(this,S,"f").key[J]=!0}}function lX($){return!!$&&typeof $.getInternalMethods==="function"}var bU=FQ(T6),xQ=bU;import{existsSync as b0,readFileSync as S$,rmSync as a0,writeFileSync as OQ,readdirSync as z$,copyFileSync as H$,mkdirSync as R1}from"fs";import{resolve as A0,dirname as S6,join as L0,basename as yU}from"path";import{fileURLToPath as gU}from"url";var uU=xQ(R6(process.argv)).option("h",{alias:"help",type:"boolean"}).version("version","Show version number",oU()).parseSync(),mU="https://github.com/ardzero/bunext.git",cU="https://github.com/ardzero/",v$=".bunext-upgrade-temp",f$=".bunext-upgrade-backup",pU=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],dU=[".git","public","src/lib/data/siteData.ts"];var lU="loading-dots",nU="favicon.svg",iU="ogImage.jpg";function oU(){try{let $=gU(import.meta.url),J=S6($),Z=L0(J,"../package.json");return JSON.parse(S$(Z,"utf-8")).version}catch{return"0.1.0"}}function tU($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function aU($,J){let Z=tU(J),X=`${cU}${Z}`,q=A0($,"project_readme.md"),Y=A0($,"README.md");if(!b0(q))return;let Q=S$(q,"utf-8");Q=Q.replace(/\?\{project-name\}/g,J).replace(/\?\{repo-link\}/g,X),OQ(Y,Q),a0(q,{force:!0})}function rU($){for(let J of dU){let Z=A0($,J);if(!b0(Z))return{ok:!1,missing:J}}return{ok:!0}}function PQ($){let J=$.indexOf("export const siteData");if(J===-1)return null;let Z=$.indexOf("{",J);if(Z===-1)return null;let X=1,q=Z+1;while(q<$.length&&X>0){let G=$[q];if(G==="{")X++;else if(G==="}")X--;q++}if(X!==0)return null;let Y=$.indexOf(";",q),Q=Y===-1?q:Y+1;return{block:$.slice(J,Q),start:J,end:Q}}function sU($){let J=$.match(/favicon:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function eU($){let J=$.match(/ogImage:\s*\{\s*src:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function k$($,J,Z=!1){let X=z$($,{withFileTypes:!0});for(let q of X){if(Z&&q.name===".git")continue;let Y=L0($,q.name),Q=L0(J,q.name);if(q.isDirectory())R1(Q,{recursive:!0}),k$(Y,Q,!1);else R1(S6(Q),{recursive:!0}),H$(Y,Q)}}function $W($){let J=A0($,f$);if(b0(J))a0(J,{recursive:!0,force:!0});R1(J,{recursive:!0});let Z=z$($,{withFileTypes:!0});for(let X of Z){if(X.name===".git"||X.name===v$||X.name===f$)continue;let q=L0($,X.name),Y=L0(J,X.name);if(X.isDirectory())R1(Y,{recursive:!0}),k$(q,Y,!1);else H$(q,Y)}}function JW($){let J=A0($,f$);if(!b0(J)){P0.error("No backup found. Cannot undo.");return}let Z=z$($,{withFileTypes:!0});for(let q of Z){if(q.name===".git"||q.name===f$)continue;let Y=L0($,q.name);a0(Y,{recursive:!0,force:!0})}let X=z$(J,{withFileTypes:!0});for(let q of X){let Y=L0(J,q.name),Q=L0($,q.name);if(q.isDirectory())R1(Q,{recursive:!0}),k$(Y,Q,!1);else H$(Y,Q)}a0(J,{recursive:!0,force:!0}),P0.success("Reverted to pre-upgrade state.")}async function IQ($,J){let X=await LX({message:J==="error"?"Do you want to undo all changes and restore your project?":"Do you want to undo the upgrade and restore your previous project?",initialValue:!1});if(J$(X))process.exit(0);if(X){let q=G6();return q.start("Reverting…"),JW($),q.stop("Reverted."),!0}return!1}async function ZW(){if(uU.h)console.log("Usage: bunextupgrade"),console.log(" Upgrade an existing Bunext project to the latest template."),console.log(" Run from the project root. Preserves .git, public assets, and siteData."),process.exit(0);let $=process.cwd(),J=rU($);if(!J.ok)P0.error(`This isn't a valid Bunext project (missing: ${J.missing}).`),process.exit(1);console.clear(),RX(D$.default.bgCyan(D$.default.black(" bunextupgrade ")));let Z=G6();Z.start("Cloning latest Bunext template");try{await lZ("git",["clone","--depth","1",mU,v$],{cwd:$}),Z.stop("Template cloned")}catch(F){Z.stop("Failed to clone");let k=F instanceof Error?F.message:String(F);P0.error(k.includes("already exists")?`Directory "${v$}" already exists. Remove it and try again.`:k),process.exit(1)}let X=A0($,v$);Z.start("Cleaning template");let q=A0(X,".git");if(b0(q))a0(q,{recursive:!0,force:!0});for(let F of pU){let k=A0(X,F);if(b0(k))a0(k,{recursive:!0,force:!0})}let Y="my-app";try{let F=A0($,"package.json");if(b0(F)){let k=JSON.parse(S$(F,"utf-8"));if(typeof k.name==="string")Y=k.name}}catch{}let Q=yU($),G=await _X({message:"Project name for README / repo link",options:[{value:"current",label:`Use current directory name (${Q})`},{value:"custom",label:"Enter a custom name"}],initialValue:"current"});if(J$(G))Y6("Operation cancelled"),process.exit(0);if(G==="current")Y=Q;else{let F=await VX({message:"Package / project name",initialValue:Y,validate:(k)=>{if(!k?.trim())return"Name is required";return}});if(J$(F))Y6("Operation cancelled"),process.exit(0);Y=F.trim()}aU(X,Y),Z.stop("Template cleaned");let H=A0($,"public"),K=A0(X,"public"),U=A0($,"src/lib/data/siteData.ts"),B=A0(X,"src/lib/data/siteData.ts"),W=S$(U,"utf-8"),_=sU(W),R=eU(W);Z.start("Preserving your public assets and site data"),R1(K,{recursive:!0});let L=z$(H,{withFileTypes:!0});for(let F of L){if(F.name.startsWith(lU))continue;let k=L0(H,F.name),l=L0(K,F.name);if(F.isDirectory())R1(l,{recursive:!0}),k$(k,l,!1);else R1(S6(l),{recursive:!0}),H$(k,l)}let P=_?L0(H,_.replace(/^\//,"")):null;if(P&&b0(P)){if(H$(P,L0(K,_.replace(/^\//,""))),_!=="/favicon.svg"){let F=L0(K,nU);if(b0(F))a0(F,{force:!0})}}let x=R?L0(H,R.replace(/^\//,"")):null;if(x&&b0(x)){if(H$(x,L0(K,R.replace(/^\//,""))),R!=="/ogImage.jpg"){let F=L0(K,iU);if(b0(F))a0(F,{force:!0})}}let N=PQ(W);if(N&&b0(B)){let F=S$(B,"utf-8"),k=PQ(F);if(k){let l=F.slice(0,k.start)+N.block+F.slice(k.end);OQ(B,l)}}Z.stop("Preserved public assets and site data"),Z.start("Creating backup"),$W($),Z.stop("Backup created"),Z.start("Replacing project with upgraded files");try{let F=z$($,{withFileTypes:!0});for(let k of F){if(k.name===".git"||k.name===v$||k.name===f$)continue;let l=L0($,k.name);a0(l,{recursive:!0,force:!0})}k$(X,$,!1),a0(X,{recursive:!0,force:!0})}catch(F){Z.stop("Replace failed");let k=F instanceof Error?F.message:String(F);P0.error(k),await IQ($,"error"),process.exit(1)}Z.stop("Upgrade complete");let c=await IQ($,"success");TX(c?D$.default.yellow("Upgrade reverted. Your project is back to its previous state."):D$.default.green("Project upgraded successfully."))}ZW().catch(($)=>{P0.error($ instanceof Error?$.message:String($)),process.exit(1)});
|
|
149
154
|
|
|
150
|
-
//# debugId=
|
|
155
|
+
//# debugId=93A083CD8684996C64756E2164756E21
|