bunextupgrade 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +87 -58
- package/dist/cli.js.map +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,68 +1,97 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as sX}from"node:module";var lX=Object.create;var{getPrototypeOf:nX,defineProperty:W6,getOwnPropertyNames:iX}=Object;var oX=Object.prototype.hasOwnProperty;function tX($){return this[$]}var aX,rX,X$=($,J,Z)=>{var X=$!=null&&typeof $==="object";if(X){var q=J?aX??=new WeakMap:rX??=new WeakMap,Y=q.get($);if(Y)return Y}Z=$!=null?lX(nX($)):{};let Q=J||!$||!$.__esModule?W6(Z,"default",{value:$,enumerable:!0}):Z;for(let G of iX($))if(!oX.call(Q,G))W6(Q,G,{get:tX.bind($,G),enumerable:!0});if(X)q.set($,Q);return Q};var R0=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var V0=sX(import.meta.url);var l6=R0((nW,d6)=>{d6.exports=p6;p6.sync=eQ;var m6=V0("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 c6($,J,Z){if(!$.isSymbolicLink()&&!$.isFile())return!1;return sQ(J,Z)}function p6($,J,Z){m6.stat($,function(X,q){Z(X,X?!1:c6(q,$,J))})}function eQ($,J){return c6(m6.statSync($),$,J)}});var a6=R0((iW,t6)=>{t6.exports=i6;i6.sync=$q;var n6=V0("fs");function i6($,J,Z){n6.stat($,function(X,q){Z(X,X?!1:o6(q,J))})}function $q($,J){return o6(n6.statSync($),J)}function o6($,J){return $.isFile()&&Jq($,J)}function Jq($,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 s6=R0((tW,r6)=>{var oW=V0("fs"),g$;if(process.platform==="win32"||global.TESTING_WINDOWS)g$=l6();else g$=a6();r6.exports=W2;W2.sync=Zq;function W2($,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){W2($,J||{},function(Y,Q){if(Y)q(Y);else X(Q)})})}g$($,J||{},function(X,q){if(X){if(X.code==="EACCES"||J&&J.ignoreErrors)X=null,q=!1}Z(X,q)})}function Zq($,J){try{return g$.sync($,J||{})}catch(Z){if(J&&J.ignoreErrors||Z.code==="EACCES")return!1;else throw Z}}});var q7=R0((aW,Q7)=>{var y1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e6=V0("path"),Xq=y1?";":":",$7=s6(),J7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),Z7=($,J)=>{let Z=J.colon||Xq,X=$.match(/\//)||y1&&$.match(/\\/)?[""]:[...y1?[process.cwd()]:[],...(J.path||process.env.PATH||"").split(Z)],q=y1?J.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=y1?q.split(Z):[""];if(y1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:X,pathExt:Y,pathExtExe:q}},X7=($,J,Z)=>{if(typeof J==="function")Z=J,J={};if(!J)J={};let{pathEnv:X,pathExt:q,pathExtExe:Y}=Z7($,J),Q=[],G=(K)=>new Promise((U,B)=>{if(K===X.length)return J.all&&Q.length?U(Q):B(J7($));let W=X[K],M=/^".*"$/.test(W)?W.slice(1,-1):W,R=e6.join(M,$),L=!M&&/^\.[\\\/]/.test($)?$.slice(0,2)+R:R;U(H(L,K,0))}),H=(K,U,B)=>new Promise((W,M)=>{if(B===q.length)return W(G(U+1));let R=q[B];$7(K+R,{pathExt:Y},(L,I)=>{if(!L&&I)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)},Qq=($,J)=>{J=J||{};let{pathEnv:Z,pathExt:X,pathExtExe:q}=Z7($,J),Y=[];for(let Q=0;Q<Z.length;Q++){let G=Z[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=e6.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($7.sync(W,{pathExt:q}))if(J.all)Y.push(W);else return W}catch(M){}}}if(J.all&&Y.length)return Y;if(J.nothrow)return null;throw J7($)};Q7.exports=X7;X7.sync=Qq});var G7=R0((rW,V2)=>{var Y7=($={})=>{let J=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(J).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"};V2.exports=Y7;V2.exports.default=Y7});var B7=R0((sW,K7)=>{var H7=V0("path"),qq=q7(),Yq=G7();function z7($,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=qq.sync($.command,{path:Z[Yq({env:Z})],pathExt:J?H7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(X)}if(Q)Q=H7.resolve(q?$.options.cwd:"",Q);return Q}function Gq($){return z7($)||z7($,!0)}K7.exports=Gq});var U7=R0((Kq,_2)=>{var L2=/([()\][%!^"`<>&|;, *?])/g;function Hq($){return $=$.replace(L2,"^$1"),$}function zq($,J){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(L2,"^$1"),J)$=$.replace(L2,"^$1");return $}Kq.command=Hq;Kq.argument=zq});var V7=R0((eW,W7)=>{W7.exports=/^#!(.*)/});var _7=R0(($V,L7)=>{var Wq=V7();L7.exports=($="")=>{let J=$.match(Wq);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 T7=R0((JV,R7)=>{var R2=V0("fs"),Vq=_7();function Lq($){let Z=Buffer.alloc(150),X;try{X=R2.openSync($,"r"),R2.readSync(X,Z,0,150,0),R2.closeSync(X)}catch(q){}return Vq(Z.toString())}R7.exports=Lq});var P7=R0((ZV,F7)=>{var _q=V0("path"),M7=B7(),C7=U7(),Rq=T7(),Tq=process.platform==="win32",Mq=/\.(?:com|exe)$/i,Cq=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Fq($){$.file=M7($);let J=$.file&&Rq($.file);if(J)return $.args.unshift($.file),$.command=J,M7($);return $.file}function Pq($){if(!Tq)return $;let J=Fq($),Z=!Mq.test(J);if($.options.forceShell||Z){let X=Cq.test(J);$.command=_q.normalize($.command),$.command=C7.command($.command),$.args=$.args.map((Y)=>C7.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 jq($,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:Pq(X)}F7.exports=jq});var I7=R0((XV,x7)=>{var T2=process.platform==="win32";function M2($,J){return Object.assign(Error(`${J} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${J} ${$.command}`,path:$.command,spawnargs:$.args})}function xq($,J){if(!T2)return;let Z=$.emit;$.emit=function(X,q){if(X==="exit"){let Y=j7(q,J);if(Y)return Z.call($,"error",Y)}return Z.apply($,arguments)}}function j7($,J){if(T2&&$===1&&!J.file)return M2(J.original,"spawn");return null}function Iq($,J){if(T2&&$===1&&!J.file)return M2(J.original,"spawnSync");return null}x7.exports={hookChildProcess:xq,verifyENOENT:j7,verifyENOENTSync:Iq,notFoundError:M2}});var E7=R0((QV,g1)=>{var w7=V0("child_process"),C2=P7(),F2=I7();function O7($,J,Z){let X=C2($,J,Z),q=w7.spawn(X.command,X.args,X.options);return F2.hookChildProcess(q,X),q}function wq($,J,Z){let X=C2($,J,Z),q=w7.spawnSync(X.command,X.args,X.options);return q.error=q.error||F2.verifyENOENTSync(q.status,X),q}g1.exports=O7;g1.exports.spawn=O7;g1.exports.sync=wq;g1.exports._parse=C2;g1.exports._enoent=F2});var D3=R0((Uj,jZ)=>{var N3={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"},OK={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},EK={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?N3.up():"");if($)J+=N3.left;return J}};jZ.exports={cursor:N3,scroll:OK,erase:EK,beep:"\x07"}});var v3=R0((Wj,S3)=>{var y4=process||{},xZ=y4.argv||[],b4=y4.env||{},AK=!(!!b4.NO_COLOR||xZ.includes("--no-color"))&&(!!b4.FORCE_COLOR||xZ.includes("--color")||y4.platform==="win32"||(y4.stdout||{}).isTTY&&b4.TERM!=="dumb"||!!b4.CI),hK=($,J,Z=$)=>(X)=>{let q=""+X,Y=q.indexOf(J,$.length);return~Y?$+NK(q,J,Z,Y)+J:$+q+J},NK=($,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)},IZ=($=AK)=>{let J=$?hK:()=>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")}};S3.exports=IZ();S3.exports.createColors=IZ});function Z0($){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 eX}from"node:url";var f1=($,J)=>{let Z=Q2($Q($));if(typeof Z!=="string")throw TypeError(`${J} must be a string or a file URL: ${Z}.`);return Z},$Q=($)=>X2($)?$.toString():$,X2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,Q2=($)=>$ instanceof URL?eX($):$;var O$=($,J=[],Z={})=>{let X=f1($,"First argument"),[q,Y]=Z0(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(!Z0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[X,Q,Y]};import{ChildProcess as GQ}from"node:child_process";import{StringDecoder as JQ}from"node:string_decoder";var{toString:V6}=Object.prototype,L6=($)=>V6.call($)==="[object ArrayBuffer]",z0=($)=>V6.call($)==="[object Uint8Array]",t0=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),ZQ=new TextEncoder,_6=($)=>ZQ.encode($),XQ=new TextDecoder,E$=($)=>XQ.decode($),R6=($,J)=>{return QQ($,J).join("")},QQ=($,J)=>{if(J==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let Z=new JQ(J),X=$.map((Y)=>typeof Y==="string"?_6(Y):Y).map((Y)=>Z.write(Y)),q=Z.end();return q===""?X:[...X,q]},Q$=($)=>{if($.length===1&&z0($[0]))return $[0];return q2(qQ($))},qQ=($)=>$.map((J)=>typeof J==="string"?_6(J):J),q2=($)=>{let J=new Uint8Array(YQ($)),Z=0;for(let X of $)J.set(X,Z),Z+=X.length;return J},YQ=($)=>{let J=0;for(let Z of $)J+=Z.length;return J};var F6=($)=>Array.isArray($)&&Array.isArray($.raw),P6=($,J)=>{let Z=[];for(let[Y,Q]of $.entries())Z=HQ({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,{}]},HQ=({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}=zQ(q,$.raw[X]),H=M6(Z,Y,Q);if(X===J.length)return H;let K=J[X],U=Array.isArray(K)?K.map((B)=>C6(B)):[C6(K)];return M6(H,U,G)},zQ=($,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let Z=[],X=0,q=T6.has(J[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=J[G];if(T6.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 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+=mQ[K]??1}}let Y=X===$.length;if(!Y)Z.push($.slice(X));return{nextTokens:Z,leadingWhitespaces:q,trailingWhitespaces:Y}},f6=new Set([" ","\t","\r",`
|
|
4
|
+
`]),mQ={x:3,u:5},k6=($,J,Z)=>Z||$.length===0||J.length===0?[...$,...J]:[...$.slice(0,-1),`${$.at(-1)}${J[0]}`,...J.slice(1)],b6=($)=>{let J=typeof $;if(J==="string")return $;if(J==="number")return String($);if(X0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return cQ($);if($ instanceof yQ||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`)},cQ=({stdout:$})=>{if(typeof $==="string")return $;if(K0($))return D$($);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 tH}from"node:child_process";import{debuglog as pQ}from"node:util";import V2 from"node:process";var f0=($)=>S$.includes($),S$=[V2.stdin,V2.stdout,V2.stderr],O0=["stdin","stdout","stderr"],v$=($)=>O0[$]??`stdio[${$}]`;var m6=($)=>{let J={...$};for(let Z of R2)J[Z]=L2($,Z);return J},L2=($,J)=>{let Z=Array.from({length:dQ($)+1}),X=lQ($[J],Z,J);return aQ(X,J)},dQ=({stdio:$})=>Array.isArray($)?Math.max($.length,O0.length):O0.length,lQ=($,J,Z)=>X0($)?nQ($,J,Z):J.fill($),nQ=($,J,Z)=>{for(let X of Object.keys($).sort(iQ))for(let q of oQ(X,Z,J))J[q]=$[X];return J},iQ=($,J)=>u6($)<u6(J)?1:-1,u6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},oQ=($,J,Z)=>{if($==="ipc")return[Z.length-1];let X=_2($);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]},_2=($)=>{if($==="all")return $;if(O0.includes($))return O0.indexOf($);let J=tQ.exec($);if(J!==null)return Number(J[1])},tQ=/^fd(\d+)$/,aQ=($,J)=>$.map((Z)=>Z===void 0?sQ[J]:Z),rQ=pQ("execa").enabled?"full":"none",sQ={lines:!1,buffer:!0,maxBuffer:1e8,verbose:rQ,stripFinalNewline:!0},R2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],e0=($,J)=>J==="ipc"?$.at(-1):$[J];var u1=({verbose:$},J)=>T2($,J)!=="none",m1=({verbose:$},J)=>!["none","short"].includes(T2($,J)),c6=({verbose:$},J)=>{let Z=T2($,J);return f$(Z)?Z:void 0},T2=($,J)=>J===void 0?eQ($):e0($,J),eQ=($)=>$.find((J)=>f$(J))??k$.findLast((J)=>$.includes(J)),f$=($)=>typeof $==="function",k$=["none","short","full"];import{inspect as Fq}from"node:util";import{platform as $q}from"node:process";import{stripVTControlCharacters as Jq}from"node:util";var p6=($,J)=>{let Z=[$,...J],X=Z.join(" "),q=Z.map((Y)=>Gq(d6(Y))).join(" ");return{command:X,escapedCommand:q}},G$=($)=>Jq($).split(`
|
|
7
|
+
`).map((J)=>d6(J)).join(`
|
|
8
|
+
`),d6=($)=>$.replaceAll(Qq,(J)=>Zq(J)),Zq=($)=>{let J=qq[$];if(J!==void 0)return J;let Z=$.codePointAt(0),X=Z.toString(16);return Z<=Yq?`\\u${X.padStart(4,"0")}`:`\\U${X}`},Xq=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Qq=Xq(),qq={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Yq=65535,Gq=($)=>{if(Hq.test($))return $;return $q==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},Hq=/^[\w./-]+$/;import l6 from"node:process";function M2(){let{env:$}=l6,{TERM:J,TERM_PROGRAM:Z}=$;if(l6.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 n6={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:"╱"},i6={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:"⅒"},zq={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"},Kq={...n6,...i6},Bq={...n6,...zq},Uq=M2(),Wq=Uq?Kq:Bq,b$=Wq,IW=Object.entries(i6);import Vq from"node:tty";var Lq=Vq?.WriteStream?.prototype?.hasColors?.()??!1,p=($,J)=>{if(!Lq)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}},EW=p(0,0),o6=p(1,22),AW=p(2,22),hW=p(3,23),NW=p(4,24),DW=p(53,55),SW=p(7,27),vW=p(8,28),fW=p(9,29),kW=p(30,39),bW=p(31,39),yW=p(32,39),gW=p(33,39),uW=p(34,39),mW=p(35,39),cW=p(36,39),pW=p(37,39),y$=p(90,39),dW=p(40,49),lW=p(41,49),nW=p(42,49),iW=p(43,49),oW=p(44,49),tW=p(45,49),aW=p(46,49),rW=p(47,49),sW=p(100,49),t6=p(91,39),eW=p(92,39),a6=p(93,39),$V=p(94,39),JV=p(95,39),ZV=p(96,39),XV=p(97,39),QV=p(101,49),qV=p(102,49),YV=p(103,49),GV=p(104,49),HV=p(105,49),zV=p(106,49),KV=p(107,49);var e6=({type:$,message:J,timestamp:Z,piped:X,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=_q(Z),H=Rq[$]({failed:Y,reject:Q,piped:X}),K=Tq[$]({reject:Q});return`${y$(`[${G}]`)} ${y$(`[${q}]`)} ${K(H)} ${K(J)}`},_q=($)=>`${g$($.getHours(),2)}:${g$($.getMinutes(),2)}:${g$($.getSeconds(),2)}.${g$($.getMilliseconds(),3)}`,g$=($,J)=>String($).padStart(J,"0"),r6=({failed:$,reject:J})=>{if(!$)return b$.tick;return J?b$.cross:b$.warning},Rq={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:r6,duration:r6},s6=($)=>$,Tq={command:()=>o6,output:()=>s6,ipc:()=>s6,error:({reject:$})=>$?t6:a6,duration:()=>y$};var $7=($,J,Z)=>{let X=c6(J,Z);return $.map(({verboseLine:q,verboseObject:Y})=>Mq(q,Y,X)).filter((q)=>q!==void 0).map((q)=>Cq(q)).join("")},Mq=($,J,Z)=>{if(Z===void 0)return $;let X=Z($,J);if(typeof X==="string")return X},Cq=($)=>$.endsWith(`
|
|
9
9
|
`)?$:`${$}
|
|
10
|
-
`;var
|
|
11
|
-
`).map((Z)=>
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
Available signal numbers: ${
|
|
10
|
+
`;var m0=({type:$,verboseMessage:J,fdNumber:Z,verboseInfo:X,result:q})=>{let Y=Pq({type:$,result:q,verboseInfo:X}),Q=jq(J,Y),G=$7(Q,X,Z);if(G!=="")console.warn(G.slice(0,-1))},Pq=({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}),jq=($,J)=>$.split(`
|
|
11
|
+
`).map((Z)=>xq({...J,message:Z})),xq=($)=>{return{verboseLine:e6($),verboseObject:$}},u$=($)=>{let J=typeof $==="string"?$:Fq($);return G$(J).replaceAll("\t"," ".repeat(Iq))},Iq=2;var J7=($,J)=>{if(!u1(J))return;m0({type:"command",verboseMessage:$,verboseInfo:J})};var Z7=($,J,Z)=>{Eq($);let X=wq($);return{verbose:$,escapedCommand:J,commandId:X,rawOptions:Z}},wq=($)=>u1({verbose:$})?Oq++:void 0,Oq=0n,Eq=($)=>{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(!k$.includes(J)&&!f$(J)){let Z=k$.map((X)=>`'${X}'`).join(", ");throw TypeError(`The "verbose" option must not be ${J}. Allowed values are: ${Z} or a function.`)}}};import{hrtime as X7}from"node:process";var m$=()=>X7.bigint(),C2=($)=>Number(X7.bigint()-$)/1e6;var c$=($,J,Z)=>{let X=m$(),{command:q,escapedCommand:Y}=p6($,J),Q=L2(Z,"verbose"),G=Z7(Q,Y,{...Z});return J7(Y,G),{command:q,escapedCommand:Y,startTime:X,verboseInfo:G}};var J5=y1(l7(),1);import VY from"node:path";import $5 from"node:process";import n$ from"node:process";import _1 from"node:path";function d$($={}){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 Q9}from"node:util";import{execFile as q9,execFileSync as rV}from"node:child_process";import n7 from"node:path";import{fileURLToPath as Y9}from"node:url";var $L=Q9(q9);function l$($){return $ instanceof URL?Y9($):$}function i7($){return{*[Symbol.iterator](){let J=n7.resolve(l$($)),Z;while(Z!==J)yield J,Z=J,J=n7.resolve(J,"..")}}}var G9=({cwd:$=n$.cwd(),path:J=n$.env[d$()],preferLocal:Z=!0,execPath:X=n$.execPath,addExecPath:q=!0}={})=>{let Y=_1.resolve(l$($)),Q=[],G=J.split(_1.delimiter);if(Z)H9(Q,G,Y);if(q)z9(Q,G,X,Y);return J===""||J===_1.delimiter?`${Q.join(_1.delimiter)}${J}`:[...Q,J].join(_1.delimiter)},H9=($,J,Z)=>{for(let X of i7(Z)){let q=_1.join(X,"node_modules/.bin");if(!J.includes(q))$.push(q)}},z9=($,J,Z,X)=>{let q=_1.resolve(X,l$(Z),"..");if(!J.includes(q))$.push(q)},o7=({env:$=n$.env,...J}={})=>{$={...$};let Z=d$({env:$});return J.path=$[Z],$[Z]=G9(J),$};import{setTimeout as x9}from"node:timers/promises";var t7=($,J,Z)=>{let X=Z?o$:i$,q=$ instanceof c0?{}:{cause:$};return new X(J,q)};class c0 extends Error{}var a7=($,J)=>{Object.defineProperty($.prototype,"name",{value:J,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,s7,{value:!0,writable:!1,enumerable:!1,configurable:!1})},r7=($)=>t$($)&&(s7 in $),s7=Symbol("isExecaError"),t$=($)=>Object.prototype.toString.call($)==="[object Error]";class i$ extends Error{}a7(i$,i$.name);class o$ extends Error{}a7(o$,o$.name);import{constants as H$}from"node:os";import{constants as W9}from"node:os";var e7=()=>{let $=h2-$8+1;return Array.from({length:$},K9)},K9=($,J)=>({name:`SIGRT${J+1}`,number:$8+J,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),$8=34,h2=64;import{constants as B9}from"node:os";var J8=[{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 N2=()=>{let $=e7();return[...J8,...$].map(U9)},U9=({name:$,number:J,description:Z,action:X,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=B9,G=Q!==void 0;return{name:$,number:G?Q:J,description:Z,supported:G,action:X,forced:q,standard:Y}};var V9=()=>{let $=N2();return Object.fromEntries($.map(L9))},L9=({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}],Z8=V9(),_9=()=>{let $=N2(),J=h2+1,Z=Array.from({length:J},(X,q)=>R9(q,$));return Object.assign({},...Z)},R9=($,J)=>{let Z=T9($,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}}},T9=($,J)=>{let Z=J.find(({name:X})=>W9.signals[X]===$);if(Z!==void 0)return Z;return J.find((X)=>X.number===$)},TL=_9();var Q8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return Y8($,"option `killSignal`")},q8=($)=>$===0?$:Y8($,"`subprocess.kill()`'s argument"),Y8=($,J)=>{if(Number.isInteger($))return M9($,J);if(typeof $==="string")return F9($,J);throw TypeError(`Invalid ${J} ${String($)}: it must be a string or an integer.
|
|
12
|
+
${D2()}`)},M9=($,J)=>{if(X8.has($))return X8.get($);throw TypeError(`Invalid ${J} ${$}: this signal integer does not exist.
|
|
13
|
+
${D2()}`)},C9=()=>new Map(Object.entries(H$.signals).reverse().map(([$,J])=>[J,$])),X8=C9(),F9=($,J)=>{if($ in H$.signals)return $;if($.toUpperCase()in H$.signals)throw TypeError(`Invalid ${J} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${J} '${$}': this signal name does not exist.
|
|
14
|
+
${D2()}`)},D2=()=>`Available signal names: ${P9()}.
|
|
15
|
+
Available signal numbers: ${j9()}.`,P9=()=>Object.keys(H$.signals).sort().map(($)=>`'${$}'`).join(", "),j9=()=>[...new Set(Object.values(H$.signals).sort(($,J)=>$-J))].join(", "),a$=($)=>Z8[$].description;var G8=($)=>{if($===!1)return $;if($===!0)return I9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},I9=5000,H8=({kill:$,options:{forceKillAfterDelay:J,killSignal:Z},onInternalError:X,context:q,controller:Y},Q,G)=>{let{signal:H,error:K}=w9(Q,G,Z);O9(K,X);let U=$(H);return E9({kill:$,signal:H,forceKillAfterDelay:J,killSignal:Z,killResult:U,context:q,controller:Y}),U},w9=($,J,Z)=>{let[X=Z,q]=t$($)?[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&&!t$(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:q8(X),error:q}},O9=($,J)=>{if($!==void 0)J.reject($)},E9=async({kill:$,signal:J,forceKillAfterDelay:Z,killSignal:X,killResult:q,context:Y,controller:Q})=>{if(J===X&&q)S2({kill:$,forceKillAfterDelay:Z,context:Y,controllerSignal:Q.signal})},S2=async({kill:$,forceKillAfterDelay:J,context:Z,controllerSignal:X})=>{if(J===!1)return;try{if(await x9(J,void 0,{signal:X}),$("SIGKILL"))Z.isForcefullyTerminated??=!0}catch{}};import{once as A9}from"node:events";var r$=async($,J)=>{if(!$.aborted)await A9($,"abort",{signal:J})};var z8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},K8=({subprocess:$,cancelSignal:J,gracefulCancel:Z,context:X,controller:q})=>J===void 0||Z?[]:[h9($,J,X,q)],h9=async($,J,Z,{signal:X})=>{throw await r$(J,X),Z.terminationReason??="cancel",$.kill(),J.reason};import{scheduler as r9}from"node:timers/promises";import{promisify as o9}from"node:util";var d1=({methodName:$,isSubprocess:J,ipc:Z,isConnected:X})=>{N9($,J,Z),v2($,J,X)},N9=($,J,Z)=>{if(!Z)throw Error(`${k0($,J)} can only be used if the \`ipc\` option is \`true\`.`)},v2=($,J,Z)=>{if(!Z)throw Error(`${k0($,J)} cannot be used: the ${q1(J)} has already exited or disconnected.`)},B8=($)=>{throw Error(`${k0("getOneMessage",$)} could not complete: the ${q1($)} exited or disconnected.`)},U8=($)=>{throw Error(`${k0("sendMessage",$)} failed: the ${q1($)} 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
|
+
${k0("getOneMessage",$)},
|
|
20
|
+
${k0("sendMessage",$,"message, {strict: true}")},
|
|
21
|
+
]);`)},s$=($,J)=>Error(`${k0("sendMessage",J)} failed when sending an acknowledgment response to the ${q1(J)}.`,{cause:$}),W8=($)=>{throw Error(`${k0("sendMessage",$)} failed: the ${q1($)} is not listening to incoming messages.`)},V8=($)=>{throw Error(`${k0("sendMessage",$)} failed: the ${q1($)} exited without listening to incoming messages.`)},L8=()=>Error(`\`cancelSignal\` aborted: the ${q1(!0)} disconnected.`),_8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},R8=({error:$,methodName:J,isSubprocess:Z})=>{if($.code==="EPIPE")throw Error(`${k0(J,Z)} cannot be used: the ${q1(Z)} is disconnecting.`,{cause:$})},T8=({error:$,methodName:J,isSubprocess:Z,message:X})=>{if(D9($))throw Error(`${k0(J,Z)}'s argument type is invalid: the message cannot be serialized: ${String(X)}.`,{cause:$})},D9=({code:$,message:J})=>S9.has($)||v9.some((Z)=>J.includes(Z)),S9=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),v9=["could not be cloned","circular structure","call stack size exceeded"],k0=($,J,Z="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${f9(J)}${$}(${Z})`,f9=($)=>$?"":"subprocess.",q1=($)=>$?"parent process":"subprocess",l1=($)=>{if($.connected)$.disconnect()};var p0=()=>{let $={},J=new Promise((Z,X)=>{Object.assign($,{resolve:Z,reject:X})});return Object.assign(J,$)};var $4=($,J="stdin")=>{let{options:X,fileDescriptors:q}=d0.get($),Y=M8(q,J,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(C8(Y,J,X,!0));return Q},n1=($,J="stdout")=>{let{options:X,fileDescriptors:q}=d0.get($),Y=M8(q,J,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(C8(Y,J,X,!1));return Q},d0=new WeakMap,M8=($,J,Z)=>{let X=k9(J,Z);return b9(X,J,Z,$),X},k9=($,J)=>{let Z=_2($);if(Z!==void 0)return Z;let{validOptions:X,defaultValue:q}=J?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${z$(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}".`)},b9=($,J,Z,X)=>{let q=X[F8($)];if(q===void 0)throw TypeError(`"${z$(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(`"${z$(Z)}" must not be ${J}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&Z)throw TypeError(`"${z$(Z)}" must not be ${J}. It must be a writable stream, not readable.`)},C8=($,J,Z,X)=>{if($==="all"&&!Z.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=y9($,Z);return`The "${q}: ${e$(Y)}" option is incompatible with using "${z$(X)}: ${e$(J)}".
|
|
25
|
+
Please set this option with "pipe" instead.`},y9=($,{stdin:J,stdout:Z,stderr:X,stdio:q})=>{let Y=F8($);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]}},F8=($)=>$==="all"?1:$,z$=($)=>$?"to":"from",e$=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as d9}from"node:events";import{addAbortListener as g9}from"node:events";var R1=($,J,Z)=>{let X=$.getMaxListeners();if(X===0||X===Number.POSITIVE_INFINITY)return;$.setMaxListeners(X+J),g9(Z,()=>{$.setMaxListeners($.getMaxListeners()-J)})};import{EventEmitter as c9}from"node:events";import{once as u9}from"node:events";import{scheduler as m9}from"node:timers/promises";var J4=($,J)=>{if(J)f2($)},f2=($)=>{$.refCounted()},Z4=($,J)=>{if(J)k2($)},k2=($)=>{$.unrefCounted()},P8=($,J)=>{if(J)k2($),k2($)},j8=($,J)=>{if(J)f2($),f2($)};var x8=async({anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X},q)=>{if(O8(q)||A8(q))return;if(!X4.has($))X4.set($,[]);let Y=X4.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await E8($,X,q),await m9.yield();let Q=await w8({wrappedMessage:Y[0],anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X});Y.shift(),X.emit("message",Q),X.emit("message:done")}},I8=async({anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X,boundOnMessage:q})=>{b2();let Y=X4.get($);while(Y?.length>0)await u9(X,"message:done");$.removeListener("message",q),j8(J,Z),X.connected=!1,X.emit("disconnect")},X4=new WeakMap;var Y1=($,J,Z)=>{if(Q4.has($))return Q4.get($);let X=new c9;return X.connected=!0,Q4.set($,X),p9({ipcEmitter:X,anyProcess:$,channel:J,isSubprocess:Z}),X},Q4=new WeakMap,p9=({ipcEmitter:$,anyProcess:J,channel:Z,isSubprocess:X})=>{let q=x8.bind(void 0,{anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:$});J.on("message",q),J.once("disconnect",I8.bind(void 0,{anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:$,boundOnMessage:q})),P8(Z,X)},q4=($)=>{let J=Q4.get($);return J===void 0?$.channel!==null:J.connected};var h8=({anyProcess:$,channel:J,isSubprocess:Z,message:X,strict:q})=>{if(!q)return X;let Y=Y1($,J,Z),Q=H4($,Y);return{id:l9++,type:G4,message:X,hasListeners:Q}},l9=0n,N8=($,J)=>{if(J?.type!==G4||J.hasListeners)return;for(let{id:Z}of $)if(Z!==void 0)Y4[Z].resolve({isDeadlock:!0,hasListeners:!1})},w8=async({wrappedMessage:$,anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:q})=>{if($?.type!==G4||!J.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:S8,message:H4(J,q)};try{await z4({anyProcess:J,channel:Z,isSubprocess:X,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},O8=($)=>{if($?.type!==S8)return!1;let{id:J,message:Z}=$;return Y4[J]?.resolve({isDeadlock:!1,hasListeners:Z}),!0},D8=async($,J,Z)=>{if($?.type!==G4)return;let X=p0();Y4[$.id]=X;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([X,n9(J,Z,q)]);if(Y)U8(Z);if(!Q)W8(Z)}finally{q.abort(),delete Y4[$.id]}},Y4={},n9=async($,J,{signal:Z})=>{R1($,1,Z),await d9($,"disconnect",{signal:Z}),V8(J)},G4="execa:ipc:request",S8="execa:ipc:response";var v8=($,J,Z)=>{if(!K$.has($))K$.set($,new Set);let X=K$.get($),q=p0(),Y=Z?J.id:void 0,Q={onMessageSent:q,id:Y};return X.add(Q),{outgoingMessages:X,outgoingMessage:Q}},f8=({outgoingMessages:$,outgoingMessage:J})=>{$.delete(J),J.onMessageSent.resolve()},E8=async($,J,Z)=>{while(!H4($,J)&&K$.get($)?.size>0){let X=[...K$.get($)];N8(X,Z),await Promise.all(X.map(({onMessageSent:q})=>q))}},K$=new WeakMap,H4=($,J)=>J.listenerCount("message")>i9($),i9=($)=>d0.has($)&&!e0(d0.get($).options.buffer,"ipc")?1:0;var z4=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},q,{strict:Y=!1}={})=>{return d1({methodName:"sendMessage",isSubprocess:Z,ipc:X,isConnected:$.connected}),t9({anyProcess:$,channel:J,methodName:"sendMessage",isSubprocess:Z,message:q,strict:Y})},t9=async({anyProcess:$,channel:J,methodName:Z,isSubprocess:X,message:q,strict:Y})=>{let Q=h8({anyProcess:$,channel:J,isSubprocess:X,message:q,strict:Y}),G=v8($,Q,Y);try{await g2({anyProcess:$,methodName:Z,isSubprocess:X,wrappedMessage:Q,message:q})}catch(H){throw l1($),H}finally{f8(G)}},g2=async({anyProcess:$,methodName:J,isSubprocess:Z,wrappedMessage:X,message:q})=>{let Y=a9($);try{await Promise.all([D8(X,$,Z),Y(X)])}catch(Q){throw R8({error:Q,methodName:J,isSubprocess:Z}),T8({error:Q,methodName:J,isSubprocess:Z,message:q}),Q}},a9=($)=>{if(y2.has($))return y2.get($);let J=o9($.send.bind($));return y2.set($,J),J},y2=new WeakMap;var b8=($,J)=>{return v2("cancelSignal",!1,$.connected),g2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:g8,message:J},message:J})},y8=async({anyProcess:$,channel:J,isSubprocess:Z,ipc:X})=>{return await s9({anyProcess:$,channel:J,isSubprocess:Z,ipc:X}),u2.signal},s9=async({anyProcess:$,channel:J,isSubprocess:Z,ipc:X})=>{if(k8)return;if(k8=!0,!X){_8();return}if(J===null){b2();return}Y1($,J,Z),await r9.yield()},k8=!1,A8=($)=>{if($?.type!==g8)return!1;return u2.abort($.message),!0},g8="execa:ipc:cancel",b2=()=>{u2.abort(L8())},u2=new AbortController;var u8=({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.")},m8=({subprocess:$,cancelSignal:J,gracefulCancel:Z,forceKillAfterDelay:X,context:q,controller:Y})=>Z?[e9({subprocess:$,cancelSignal:J,forceKillAfterDelay:X,context:q,controller:Y})]:[],e9=async({subprocess:$,cancelSignal:J,forceKillAfterDelay:Z,context:X,controller:{signal:q}})=>{await r$(J,q);let Y=$Y(J);throw await b8($,Y),S2({kill:$.kill,forceKillAfterDelay:Z,context:X,controllerSignal:q}),X.terminationReason??="gracefulCancel",J.reason},$Y=({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 JY}from"node:timers/promises";var c8=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},p8=($,J,Z,X)=>J===0||J===void 0?[]:[ZY($,J,Z,X)],ZY=async($,J,Z,{signal:X})=>{throw await JY(J,void 0,{signal:X}),Z.terminationReason??="timeout",$.kill(),new c0};import{execPath as XY,execArgv as QY}from"node:process";import d8 from"node:path";var l8=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},n8=($,J,{node:Z=!1,nodePath:X=XY,nodeOptions:q=QY.filter((H)=>!H.startsWith("--inspect")),cwd:Y,execPath:Q,...G})=>{if(Q!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let H=g1(X,'The "nodePath" option'),K=d8.resolve(Y,H),U={...G,nodePath:K,node:Z,cwd:Y};if(!Z)return[$,J,U];if(d8.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 qY}from"node:v8";var i8=({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`.");HY[Z]($)},YY=($)=>{try{qY($)}catch(J){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:J})}},GY=($)=>{try{JSON.stringify($)}catch(J){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:J})}},HY={advanced:YY,json:GY},o8=async($,J)=>{if(J===void 0)return;await $.sendMessage(J)};var a8=({encoding:$})=>{if(m2.has($))return;let J=KY($);if(J!==void 0)throw TypeError(`Invalid option \`encoding: ${K4($)}\`.
|
|
26
|
+
Please rename it to ${K4(J)}.`);let Z=[...m2].map((X)=>K4(X)).join(", ");throw TypeError(`Invalid option \`encoding: ${K4($)}\`.
|
|
27
|
+
Please rename it to one of: ${Z}.`)},zY=new Set(["utf8","utf16le"]),F0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),m2=new Set([...zY,...F0]),KY=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let J=$.toLowerCase();if(J in t8)return t8[J];if(m2.has(J))return J},t8={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},K4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as BY}from"node:fs";import UY from"node:path";import WY from"node:process";var r8=($=s8())=>{let J=g1($,'The "cwd" option');return UY.resolve(J)},s8=()=>{try{return WY.cwd()}catch($){throw $.message=`The current directory does not exist.
|
|
28
|
+
${$.message}`,$}},e8=($,J)=>{if(J===s8())return $;let Z;try{Z=BY(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
|
-
${
|
|
34
|
-
`)].map((
|
|
31
|
+
${$}`;return $};var B4=($,J,Z)=>{Z.cwd=r8(Z.cwd);let[X,q,Y]=n8($,J,Z),{command:Q,args:G,options:H}=J5.default._parse(X,q,Y),K=m6(H),U=LY(K);if(c8(U),a8(U),i8(U),z8(U),u8(U),U.shell=U2(U.shell),U.env=_Y(U),U.killSignal=Q8(U.killSignal),U.forceKillAfterDelay=G8(U.forceKillAfterDelay),U.lines=U.lines.map((B,W)=>B&&!F0.has(U.encoding)&&U.buffer[W]),$5.platform==="win32"&&VY.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:U}},LY=({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}),_Y=({env:$,extendEnv:J,preferLocal:Z,node:X,localDirectory:q,nodePath:Y})=>{let Q=J?{...$5.env,...$}:$;if(Z||X)return o7({env:Q,cwd:q,execPath:Y,preferLocal:Z,addExecPath:X});return Q};var U4=($,J,Z)=>Z.shell&&J.length>0?[[$,...J].join(" "),[],Z]:[$,J,Z];import{inspect as aY}from"node:util";function i1($){if(typeof $==="string")return RY($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return TY($)}var RY=($)=>$.at(-1)===Z5?$.slice(0,$.at(-2)===X5?-2:-1):$,TY=($)=>$.at(-1)===MY?$.subarray(0,$.at(-2)===CY?-2:-1):$,Z5=`
|
|
32
|
+
`,MY=Z5.codePointAt(0),X5="\r",CY=X5.codePointAt(0);import{on as nY}from"node:events";import{finished as iY}from"node:stream/promises";function b0($,{checkOpen:J=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!J||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function c2($,{checkOpen:J=!0}={}){return b0($,{checkOpen:J})&&($.writable||!J)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function T1($,{checkOpen:J=!0}={}){return b0($,{checkOpen:J})&&($.readable||!J)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function p2($,J){return c2($,J)&&T1($,J)}var FY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Q5{#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 d2=Symbol();function q5(){return this[d2].next()}Object.defineProperty(q5,"name",{value:"next"});function Y5($){return this[d2].return($)}Object.defineProperty(Y5,"name",{value:"return"});var PY=Object.create(FY,{next:{enumerable:!0,configurable:!0,writable:!0,value:q5},return:{enumerable:!0,configurable:!0,writable:!0,value:Y5}});function l2({preventCancel:$=!1}={}){let J=this.getReader(),Z=new Q5(J,$),X=Object.create(PY);return X[d2]=Z,X}var G5=($)=>{if(T1($,{checkOpen:!1})&&B$.on!==void 0)return xY($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(jY.call($)==="[object ReadableStream]")return l2.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:jY}=Object.prototype,xY=async function*($){let J=new AbortController,Z={};IY($,J,Z);try{for await(let[X]of B$.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()}},IY=async($,J,Z)=>{try{await B$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(X){Z.error=X}finally{J.abort()}},B$={};var o1=async($,{init:J,convertChunk:Z,getSize:X,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let K=G5($),U=J();U.length=0;try{for await(let B of K){let W=OY(B),_=Z[W](B,U);K5({convertedChunk:_,state:U,getSize:X,truncateChunk:q,addChunk:Y,maxBuffer:H})}return wY({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}},wY=({state:$,getSize:J,truncateChunk:Z,addChunk:X,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)K5({convertedChunk:Q,state:$,getSize:J,truncateChunk:Z,addChunk:X,maxBuffer:Y})},K5=({convertedChunk:$,state:J,getSize:Z,truncateChunk:X,addChunk:q,maxBuffer:Y})=>{let Q=Z($),G=J.length+Q;if(G<=Y){H5($,J,q,G);return}let H=X($,Y-J.length);if(H!==void 0)H5(H,J,q,Y);throw new $1},H5=($,J,Z,X)=>{J.contents=Z($,J,X),J.length=X},OY=($)=>{let J=typeof $;if(J==="string")return"string";if(J!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let Z=z5.call($);if(Z==="[object ArrayBuffer]")return"arrayBuffer";if(Z==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&z5.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:z5}=Object.prototype;class $1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var J1=($)=>$,U$=()=>{return},W4=({contents:$})=>$,V4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},L4=($)=>$.length;async function _4($,J){return o1($,NY,J)}var EY=()=>({contents:[]}),AY=()=>1,hY=($,{contents:J})=>{return J.push($),J},NY={init:EY,convertChunk:{string:J1,buffer:J1,arrayBuffer:J1,dataView:J1,typedArray:J1,others:J1},getSize:AY,truncateChunk:U$,addChunk:hY,getFinalChunk:U$,finalize:W4};async function R4($,J){return o1($,uY,J)}var DY=()=>({contents:new ArrayBuffer(0)}),SY=($)=>vY.encode($),vY=new TextEncoder,B5=($)=>new Uint8Array($),U5=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),fY=($,J)=>$.slice(0,J),kY=($,{contents:J,length:Z},X)=>{let q=L5()?yY(J,X):bY(J,X);return new Uint8Array(q).set($,Z),q},bY=($,J)=>{if(J<=$.byteLength)return $;let Z=new ArrayBuffer(V5(J));return new Uint8Array(Z).set(new Uint8Array($),0),Z},yY=($,J)=>{if(J<=$.maxByteLength)return $.resize(J),$;let Z=new ArrayBuffer(J,{maxByteLength:V5(J)});return new Uint8Array(Z).set(new Uint8Array($),0),Z},V5=($)=>W5**Math.ceil(Math.log($)/Math.log(W5)),W5=2,gY=({contents:$,length:J})=>L5()?$:$.slice(0,J),L5=()=>("resize"in ArrayBuffer.prototype),uY={init:DY,convertChunk:{string:SY,buffer:B5,arrayBuffer:B5,dataView:U5,typedArray:U5,others:V4},getSize:L4,truncateChunk:fY,addChunk:kY,getFinalChunk:U$,finalize:gY};async function M4($,J){return o1($,lY,J)}var mY=()=>({contents:"",textDecoder:new TextDecoder}),T4=($,{textDecoder:J})=>J.decode($,{stream:!0}),cY=($,{contents:J})=>J+$,pY=($,J)=>$.slice(0,J),dY=({textDecoder:$})=>{let J=$.decode();return J===""?void 0:J},lY={init:mY,convertChunk:{string:J1,buffer:T4,arrayBuffer:T4,dataView:T4,typedArray:T4,others:V4},getSize:L4,truncateChunk:pY,addChunk:cY,getFinalChunk:dY,finalize:W4};Object.assign(B$,{on:nY,finished:iY});var _5=({error:$,stream:J,readableObjectMode:Z,lines:X,encoding:q,fdNumber:Y})=>{if(!($ instanceof $1))throw $;if(Y==="all")return $;let Q=oY(Z,X,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},J.destroy(),$},oY=($,J,Z)=>{if($)return"objects";if(J)return"lines";if(Z==="buffer")return"bytes";return"characters"},R5=($,J,Z)=>{if(J.length!==Z)return;let X=new $1;throw X.maxBufferInfo={fdNumber:"ipc"},X},T5=($,J)=>{let{streamName:Z,threshold:X,unit:q}=tY($,J);return`Command's ${Z} was larger than ${X} ${q}`},tY=($,J)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:J[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:Z,unit:X}}=$;delete $.maxBufferInfo;let q=e0(J,Z);if(Z==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:v$(Z),threshold:q,unit:X}},M5=($,J,Z)=>$?.code==="ENOBUFS"&&J!==null&&J.some((X)=>X!==null&&X.length>C4(Z)),C5=($,J,Z)=>{if(!J)return $;let X=C4(Z);return $.length>X?$.slice(0,X):$},C4=([,$])=>$;var P5=({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:x,cwd:j})=>{let h=X?.code,c=rY({originalError:X,timedOut:H,timeout:x,isMaxBuffer:B,maxBuffer:L,errorCode:h,signal:q,signalDescription:Y,exitCode:Q,isCanceled:K,isGracefullyCanceled:U,isForcefullyTerminated:W,forceKillAfterDelay:_,killSignal:R}),F=eY(X,j),y=F===void 0?"":`
|
|
33
|
+
${F}`,l=`${c}: ${G}${y}`,t=J===void 0?[$[2],$[1]]:[J],_0=[l,...t,...$.slice(3),Z.map((n)=>$G(n)).join(`
|
|
34
|
+
`)].map((n)=>G$(i1(JG(n)))).filter(Boolean).join(`
|
|
35
35
|
|
|
36
|
-
`);return{originalMessage:
|
|
37
|
-
`):Q5($),Q5=($)=>{if(typeof $==="string")return $;if(z0($))return E$($);return""};var R4=({command:$,escapedCommand:J,stdio:Z,all:X,ipcOutput:q,options:{cwd:Y},startTime:Q})=>Y5({command:$,escapedCommand:J,cwd:Y,durationMs:U2(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:[]}),l1=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:Q})=>B$({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}),B$=({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:M,options:{timeoutDuration:R,timeout:L=R,forceKillAfterDelay:I,killSignal:x,cwd:F,maxBuffer:v},isSync:j})=>{let{exitCode:l,signal:n,signalDescription:o}=wY(K,U),{originalMessage:L0,shortMessage:p,message:i0}=q5({stdio:B,all:W,ipcOutput:M,originalError:$,signal:n,signalDescription:o,exitCode:l,escapedCommand:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:I,killSignal:x,maxBuffer:v,timeout:L,cwd:F}),E=D7($,i0,j);return Object.assign(E,IY({error:E,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:l,signal:n,signalDescription:o,stdio:B,all:W,ipcOutput:M,cwd:F,originalMessage:L0,shortMessage:p})),E},IY=({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:M,ipcOutput:R,cwd:L,originalMessage:I,shortMessage:x})=>Y5({shortMessage:x,originalMessage:I,command:J,escapedCommand:Z,cwd:L,durationMs:U2(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:M,stdio:W,ipcOutput:R,pipedFrom:[]}),Y5=($)=>Object.fromEntries(Object.entries($).filter(([,J])=>J!==void 0)),wY=($,J)=>{let Z=$===null?void 0:$,X=J===null?void 0:J,q=X===void 0?void 0:n$(J);return{exitCode:Z,signal:X,signalDescription:q}};var G5=($)=>Number.isFinite($)?$:0;function OY($){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(G5($*1000)%1000),nanoseconds:Math.trunc(G5($*1e6)%1000)}}function EY($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function y2($){switch(typeof $){case"number":{if(Number.isFinite($))return OY($);break}case"bigint":return EY($)}throw TypeError("Expected a finite number or bigint")}var AY=($)=>$===0||$===0n,hY=($,J)=>J===1||J===1n?$:`${$}s`,NY=0.0000001,DY=24n*60n*60n*1000n;function g2($,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+NY);return(Math.round(W)/10**B).toFixed(B)},Q=(U,B,W,M)=>{if((q.length===0||!J.colonNotation)&&AY(U)&&!(J.colonNotation&&W==="m"))return;if(M??=String(U),J.colonNotation){let R=M.includes(".")?M.split(".")[0].length:M.length,L=q.length>0?2:1;M="0".repeat(Math.max(0,L-R))+M}else M+=J.verbose?" "+hY(B,U):W;q.push(M)},G=y2($),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),M=Number(G.nanoseconds);if(Q(U,"second","s"),J.formatSubMilliseconds)Q(B,"millisecond","ms"),Q(W,"microsecond","µs"),Q(M,"nanosecond","ns");else{let R=B+W/1000+M/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,I=R>=1?Math.round(R):Math.ceil(R),x=L?R.toFixed(L):I;Q(Number.parseFloat(x),"millisecond","ms",x)}}else{let U=(Z?Number($%DY):$)/1000%60,B=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,W=Y(U,B),M=J.keepDecimalsOnWholeSeconds?W:W.replace(/\.0+$/,"");Q(Number.parseFloat(M),"second","s",M)}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 H5=($,J)=>{if($.failed)y0({type:"error",verboseMessage:$.shortMessage,verboseInfo:J,result:$})};var z5=($,J)=>{if(!k1(J))return;H5($,J),SY($,J)},SY=($,J)=>{let Z=`(done in ${g2($.durationMs)})`;y0({type:"duration",verboseMessage:Z,verboseInfo:J,result:$})};var n1=($,J,{reject:Z})=>{if(z5($,J),$.failed&&Z)throw $;return $};import{readFileSync as k5}from"node:fs";var U5=($,J)=>{if(_1($))return"asyncGenerator";if(L5($))return"generator";if(T4($))return"fileUrl";if(yY($))return"filePath";if(mY($))return"webStream";if(v0($,{checkOpen:!1}))return"native";if(z0($))return"uint8Array";if(cY($))return"asyncIterable";if(pY($))return"iterable";if(c2($))return W5({transform:$},J);if(bY($))return vY($,J);return"native"},vY=($,J)=>{if(f2($.transform,{checkOpen:!1}))return fY($,J);if(c2($.transform))return W5($,J);return kY($,J)},fY=($,J)=>{return V5($,J,"Duplex stream"),"duplex"},W5=($,J)=>{return V5($,J,"web TransformStream"),"webTransform"},V5=({final:$,binary:J,objectMode:Z},X,q)=>{K5($,`${X}.final`,q),K5(J,`${X}.binary`,q),u2(Z,`${X}.objectMode`)},K5=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${Z}.`)},kY=({transform:$,final:J,binary:Z,objectMode:X},q)=>{if($!==void 0&&!B5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(f2(J,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if(c2(J))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!B5(J))throw TypeError(`The \`${q}.final\` option must be a generator.`);return u2(Z,`${q}.binary`),u2(X,`${q}.objectMode`),_1($)||_1(J)?"asyncGenerator":"generator"},u2=($,J)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},B5=($)=>_1($)||L5($),_1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",L5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",bY=($)=>Z0($)&&($.transform!==void 0||$.final!==void 0),T4=($)=>Object.prototype.toString.call($)==="[object URL]",_5=($)=>T4($)&&$.protocol!=="file:",yY=($)=>Z0($)&&Object.keys($).length>0&&Object.keys($).every((J)=>gY.has(J))&&m2($.file),gY=new Set(["file","append"]),m2=($)=>typeof $==="string",R5=($,J)=>$==="native"&&typeof J==="string"&&!uY.has(J),uY=new Set(["ipc","ignore","inherit","overlapped","pipe"]),T5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",M4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",mY=($)=>T5($)||M4($),c2=($)=>T5($?.readable)&&M4($?.writable),cY=($)=>M5($)&&typeof $[Symbol.asyncIterator]==="function",pY=($)=>M5($)&&typeof $[Symbol.iterator]==="function",M5=($)=>typeof $==="object"&&$!==null,I0=new Set(["generator","asyncGenerator","duplex","webTransform"]),C4=new Set(["fileUrl","filePath","fileNumber"]),p2=new Set(["fileUrl","filePath"]),C5=new Set([...p2,"webStream","nodeStream"]),F5=new Set(["webTransform","duplex"]),Q1={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 d2=($,J,Z,X)=>X==="output"?dY($,J,Z):lY($,J,Z),dY=($,J,Z)=>{let X=J!==0&&Z[J-1].value.readableObjectMode;return{writableObjectMode:X,readableObjectMode:$??X}},lY=($,J,Z)=>{let X=J===0?$===!0:Z[J-1].value.readableObjectMode,q=J!==Z.length-1&&($??X);return{writableObjectMode:X,readableObjectMode:q}},P5=($,J)=>{let Z=$.findLast(({type:X})=>I0.has(X));if(Z===void 0)return!1;return J==="input"?Z.value.writableObjectMode:Z.value.readableObjectMode};var j5=($,J,Z,X)=>[...$.filter(({type:q})=>!I0.has(q)),...nY($,J,Z,X)],nY=($,J,Z,{encoding:X})=>{let q=$.filter(({type:Q})=>I0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=iY({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:J,direction:Z,encoding:X});return rY(Y,Z)},iY=({stdioItem:$,stdioItem:{type:J},index:Z,newTransforms:X,optionName:q,direction:Y,encoding:Q})=>{if(J==="duplex")return oY({stdioItem:$,optionName:q});if(J==="webTransform")return tY({stdioItem:$,index:Z,newTransforms:X,direction:Y});return aY({stdioItem:$,index:Z,newTransforms:X,direction:Y,encoding:Q})},oY=({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}}},tY=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q})=>{let{transform:Y,objectMode:Q}=Z0(J)?J:{transform:J},{writableObjectMode:G,readableObjectMode:H}=d2(Q,Z,X,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},aY=({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}=Z0(J)?J:{transform:J},B=H||M0.has(Y),{writableObjectMode:W,readableObjectMode:M}=d2(U,Z,X,q);return{...$,value:{transform:Q,final:G,binary:B,preserveNewlines:K,writableObjectMode:W,readableObjectMode:M}}},rY=($,J)=>J==="input"?$.reverse():$;import l2 from"node:process";var x5=($,J,Z)=>{let X=$.map((q)=>sY(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)??JG},sY=({type:$,value:J},Z)=>eY[Z]??I5[$](J),eY=["input","output","output"],i1=()=>{return},n2=()=>"input",I5={generator:i1,asyncGenerator:i1,fileUrl:i1,filePath:i1,iterable:n2,asyncIterable:n2,uint8Array:n2,webStream:($)=>M4($)?"output":"input",nodeStream($){if(!L1($,{checkOpen:!1}))return"output";return v2($,{checkOpen:!1})?void 0:"input"},webTransform:i1,duplex:i1,native($){let J=$G($);if(J!==void 0)return J;if(v0($,{checkOpen:!1}))return I5.nodeStream($)}},$G=($)=>{if([0,l2.stdin].includes($))return"input";if([1,2,l2.stdout,l2.stderr].includes($))return"output"},JG="output";var w5=($,J)=>J&&!$.includes("ipc")?[...$,"ipc"]:$;var O5=({stdio:$,ipc:J,buffer:Z,...X},q,Y)=>{let Q=ZG($,X).map((G,H)=>E5(G,H));return Y?QG(Q,Z,q):w5(Q,J)},ZG=($,J)=>{if($===void 0)return x0.map((X)=>J[X]);if(XG(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${x0.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,x0.length);return Array.from({length:Z},(X,q)=>$[q])},XG=($)=>x0.some((J)=>$[J]!==void 0),E5=($,J)=>{if(Array.isArray($))return $.map((Z)=>E5(Z,J));if($===null||$===void 0)return J>=x0.length?"ignore":"pipe";return $},QG=($,J,Z)=>$.map((X,q)=>!J[q]&&q!==0&&!b1(Z,q)&&qG(X)?"ignore":X),qG=($)=>$==="pipe"||Array.isArray($)&&$.every((J)=>J==="pipe");import{readFileSync as YG}from"node:fs";import GG from"node:tty";var h5=({stdioItem:$,stdioItem:{type:J},isStdioArray:Z,fdNumber:X,direction:q,isSync:Y})=>{if(!Z||J!=="native")return $;return Y?HG({stdioItem:$,fdNumber:X,direction:q}):BG({stdioItem:$,fdNumber:X})},HG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X,direction:q})=>{let Y=zG({value:J,optionName:Z,fdNumber:X,direction:q});if(Y!==void 0)return Y;if(v0(J,{checkOpen:!1}))throw TypeError(`The \`${Z}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},zG=({value:$,optionName:J,fdNumber:Z,direction:X})=>{let q=KG($,Z);if(q===void 0)return;if(X==="output")return{type:"fileNumber",value:q,optionName:J};if(GG.isatty(q))throw TypeError(`The \`${J}: ${t$($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:t0(YG(q)),optionName:J}},KG=($,J)=>{if($==="inherit")return J;if(typeof $==="number")return $;let Z=A$.indexOf($);if(Z!==-1)return Z},BG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X})=>{if(J==="inherit")return{type:"nodeStream",value:A5(X,J,Z),optionName:Z};if(typeof J==="number")return{type:"nodeStream",value:A5(J,J,Z),optionName:Z};if(v0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:Z};return $},A5=($,J,Z)=>{let X=A$[$];if(X===void 0)throw TypeError(`The \`${Z}: ${J}\` option is invalid: no such standard stream.`);return X};var N5=({input:$,inputFile:J},Z)=>Z===0?[...UG($),...VG(J)]:[],UG=($)=>$===void 0?[]:[{type:WG($),value:$,optionName:"input"}],WG=($)=>{if(L1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(z0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},VG=($)=>$===void 0?[]:[{...LG($),optionName:"inputFile"}],LG=($)=>{if(T4($))return{type:"fileUrl",value:$};if(m2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var D5=($)=>$.filter((J,Z)=>$.every((X,q)=>J.value!==X.value||Z>=q||J.type==="generator"||J.type==="asyncGenerator")),S5=({stdioItem:{type:$,value:J,optionName:Z},direction:X,fileDescriptors:q,isSync:Y})=>{let Q=_G(q,$);if(Q.length===0)return;if(Y){RG({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});return}if(C5.has($))return v5({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});if(F5.has($))MG({otherStdioItems:Q,type:$,value:J,optionName:Z})},_G=($,J)=>$.flatMap(({direction:Z,stdioItems:X})=>X.filter((q)=>q.type===J).map((q)=>({...q,direction:Z}))),RG=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{if(p2.has(J))v5({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})},v5=({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 f5(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},MG=({otherStdioItems:$,type:J,value:Z,optionName:X})=>{let q=$.find(({value:{transform:Y}})=>Y===Z.transform);f5(q,X,J)},f5=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${J}\` options must not target ${Q1[Z]} that is the same.`)};var F4=($,J,Z,X)=>{let Y=O5(J,Z,X).map((G,H)=>CG({stdioOption:G,fdNumber:H,options:J,isSync:X})),Q=EG({initialFileDescriptors:Y,addProperties:$,options:J,isSync:X});return J.stdio=Q.map(({stdioItems:G})=>NG(G)),Q},CG=({stdioOption:$,fdNumber:J,options:Z,isSync:X})=>{let q=h$(J),{stdioItems:Y,isStdioArray:Q}=FG({stdioOption:$,fdNumber:J,options:Z,optionName:q}),G=x5(Y,J,q),H=Y.map((B)=>h5({stdioItem:B,isStdioArray:Q,fdNumber:J,direction:G,isSync:X})),K=j5(H,q,G,Z),U=P5(K,G);return OG(K,U),{direction:G,objectMode:U,stdioItems:K}},FG=({stdioOption:$,fdNumber:J,options:Z,optionName:X})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>PG(H,X)),...N5(Z,J)],Q=D5(Y),G=Q.length>1;return jG(Q,G,X),IG(Q),{stdioItems:Q,isStdioArray:G}},PG=($,J)=>({type:U5($,J),value:$,optionName:J}),jG=($,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(xG.has(X))throw Error(`The \`${q}\` option must not include \`${X}\`.`)},xG=new Set(["ignore","ipc"]),IG=($)=>{for(let J of $)wG(J)},wG=({type:$,value:J,optionName:Z})=>{if(_5(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:_0}},rY=({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=sY(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`${T5($,q)}${R}`;if(Y!==void 0)return`Command failed with ${Y}${R}`;if(B)return`Command was killed with ${_} (${a$(_)})${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"},sY=($,J)=>$?` and was forcefully terminated after ${J} milliseconds`:"",eY=($,J)=>{if($ instanceof c0)return;let Z=r7($)?$.originalMessage:String($?.message??$),X=G$(e8(Z,J));return X===""?void 0:X},$G=($)=>typeof $==="string"?$:aY($),JG=($)=>Array.isArray($)?$.map((J)=>i1(F5(J))).filter(Boolean).join(`
|
|
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(v5($,J))throw TypeError(`The \`${Z}: { file: '...' }\` option must be used instead of \`${Z}: '...'\`.`)},QH=($,J)=>{if(!J)return;let Z=$.find(({type:X})=>x4.has(X));if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` option cannot use both files and transforms in objectMode.`)},qH=({initialFileDescriptors:$,addProperties:J,options:Z,isSync:X})=>{let q=[];try{for(let Y of $)q.push(YH({fileDescriptor:Y,fileDescriptors:q,addProperties:J,options:Z,isSync:X}));return q}catch(Y){throw J3(q),Y}},YH=({fileDescriptor:{direction:$,objectMode:J,stdioItems:Z},fileDescriptors:X,addProperties:q,options:Y,isSync:Q})=>{let G=Z.map((H)=>GH({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:X,isSync:Q}));return{direction:$,objectMode:J,stdioItems:G}},GH=({stdioItem:$,addProperties:J,direction:Z,options:X,fileDescriptors:q,isSync:Y})=>{let Q=a5({stdioItem:$,direction:Z,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...J[Z][$.type]($,X)}},J3=($)=>{for(let{stdioItems:J}of $)for(let{stream:Z}of J)if(Z!==void 0&&!f0(Z))Z.destroy()},HH=($)=>{if($.length>1)return $.some(({value:X})=>X==="overlapped")?"overlapped":"pipe";let[{type:J,value:Z}]=$;return J==="native"?Z:"pipe"};var JJ=($,J)=>I4(KH,$,J,!0),l0=({type:$,optionName:J})=>{ZJ(J,G1[$])},zH=({optionName:$,value:J})=>{if(J==="ipc"||J==="overlapped")ZJ($,`"${J}"`);return{}},ZJ=($,J)=>{throw TypeError(`The \`${$}\` option cannot be ${J} with synchronous methods.`)},$J={generator(){},asyncGenerator:l0,webStream:l0,nodeStream:l0,webTransform:l0,duplex:l0,asyncIterable:l0,native:zH},KH={input:{...$J,fileUrl:({value:$})=>({contents:[s0(e5($))]}),filePath:({value:{file:$}})=>({contents:[s0(e5($))]}),fileNumber:l0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...$J,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:J}})=>({path:$,append:J}),fileNumber:({value:$})=>({path:$}),iterable:l0,string:l0,uint8Array:l0}};var Z1=($,{stripFinalNewline:J},Z)=>Z3(J,Z)&&$!==void 0&&!Array.isArray($)?i1($):$,Z3=($,J)=>J==="all"?$[1]||$[2]:$[J];import{Transform as NH,getDefaultHighWaterMark as WJ}from"node:stream";var w4=($,J,Z,X)=>$||Z?void 0:QJ(J,X),Q3=($,J,Z)=>Z?$.flatMap((X)=>XJ(X,J)):XJ($,J),XJ=($,J)=>{let{transform:Z,final:X}=QJ(J,{});return[...Z($),...X()]},QJ=($,J)=>{return J.previousChunks="",{transform:BH.bind(void 0,J,$),final:WH.bind(void 0,J)}},BH=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=UH(Z,Y,J,$),G=Z.slice(q+1,Y+1-Q);if(X.length>0)G=X3(X,G),X="";yield G,q=Y}if(q!==Z.length-1)X=X3(X,Z.slice(q+1));$.previousChunks=X},UH=($,J,Z,X)=>{if(Z)return 0;return X.isWindowsNewline=J!==0&&$[J-1]==="\r",X.isWindowsNewline?2:1},WH=function*({previousChunks:$}){if($.length>0)yield $},qJ=({binary:$,preserveNewlines:J,readableObjectMode:Z,state:X})=>$||J||Z?void 0:{transform:VH.bind(void 0,X)},VH=function*({isWindowsNewline:$=!1},J){let{unixNewline:Z,windowsNewline:X,LF:q,concatBytes:Y}=typeof J==="string"?LH:RH;if(J.at(-1)===q){yield J;return}yield Y(J,$?X:Z)},X3=($,J)=>`${$}${J}`,LH={windowsNewline:`\r
|
|
40
40
|
`,unixNewline:`
|
|
41
41
|
`,LF:`
|
|
42
|
-
`,concatBytes:
|
|
42
|
+
`,concatBytes:X3},_H=($,J)=>{let Z=new Uint8Array($.length+J.length);return Z.set($,0),Z.set(J,$.length),Z},RH={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:_H};import{Buffer as TH}from"node:buffer";var YJ=($,J)=>$?void 0:MH.bind(void 0,J),MH=function*($,J){if(typeof J!=="string"&&!K0(J)&&!TH.isBuffer(J))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof J}.`);yield J},GJ=($,J)=>$?CH.bind(void 0,J):FH.bind(void 0,J),CH=function*($,J){HJ($,J),yield J},FH=function*($,J){if(HJ($,J),typeof J!=="string"&&!K0(J))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof J}.`);yield J},HJ=($,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 lG}from"node:buffer";import{StringDecoder as nG}from"node:string_decoder";var j4=($,J,Z)=>{if(Z)return;if($)return{transform:iG.bind(void 0,new TextEncoder)};let X=new nG(J);return{transform:oG.bind(void 0,X),final:tG.bind(void 0,X)}},iG=function*($,J){if(lG.isBuffer(J))yield t0(J);else if(typeof J==="string")yield $.encode(J);else yield J},oG=function*($,J){yield z0(J)?$.write(J):J},tG=function*($){let J=$.end();if(J!=="")yield J};import{callbackify as n5}from"node:util";var r2=n5(async($,J,Z,X)=>{J.currentIterable=$(...Z);try{for await(let q of J.currentIterable)X.push(q)}finally{delete J.currentIterable}}),x4=async function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=rG}=J[Z];for await(let q of X($))yield*x4(q,J,Z+1)},i5=async function*($){for(let[J,{final:Z}]of Object.entries($))yield*aG(Z,Number(J),$)},aG=async function*($,J,Z){if($===void 0)return;for await(let X of $())yield*x4(X,Z,J+1)},o5=n5(async({currentIterable:$},J)=>{if($!==void 0){await(J?$.throw(J):$.return());return}if(J)throw J}),rG=function*($){yield $};var s2=($,J,Z,X)=>{try{for(let q of $(...J))Z.push(q);X()}catch(q){X(q)}},t5=($,J)=>[...J.flatMap((Z)=>[...R1(Z,$,0)]),...U$($)],R1=function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=eG}=J[Z];for(let q of X($))yield*R1(q,J,Z+1)},U$=function*($){for(let[J,{final:Z}]of Object.entries($))yield*sG(Z,Number(J),$)},sG=function*($,J,Z){if($===void 0)return;for(let X of $())yield*R1(X,Z,J+1)},eG=function*($){yield $};var e2=({value:$,value:{transform:J,final:Z,writableObjectMode:X,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=r5($,Q,Y),K=_1(J),U=_1(Z),B=K?r2.bind(void 0,x4,G):s2.bind(void 0,R1),W=K||U?r2.bind(void 0,i5,G):s2.bind(void 0,U$),M=K||U?o5.bind(void 0,G):void 0;return{stream:new $H({writableObjectMode:X,writableHighWaterMark:a5(X),readableObjectMode:q,readableHighWaterMark:a5(q),transform(L,I,x){B([L,H,0],this,x)},flush(L){W([H],this,L)},destroy:M})}},I4=($,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=r5(Q,Z,G);$=t5(H,$)}return $},r5=({transform:$,final:J,binary:Z,writableObjectMode:X,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:p5(X,G)},j4(Z,Q,X),P4(Z,Y,X,H),{transform:$,final:J},{transform:d5(q,G)},c5({binary:Z,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var s5=($,J)=>{for(let Z of JH($))ZH($,Z,J)},JH=($)=>new Set(Object.entries($).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),ZH=($,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 ${Q1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>XH(G,X));Z.input=Q$(Q)},XH=($,J)=>{let Z=I4($,J,"utf8",!0);return QH(Z),Q$(Z)},QH=($)=>{let J=$.find((Z)=>typeof Z!=="string"&&!z0(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 HH,appendFileSync as zH}from"node:fs";var w4=({stdioItems:$,encoding:J,verboseInfo:Z,fdNumber:X})=>X!=="all"&&b1(Z,X)&&!M0.has(J)&&qH(X)&&($.some(({type:q,value:Y})=>q==="native"&&YH.has(Y))||$.every(({type:q})=>I0.has(q))),qH=($)=>$===1||$===2,YH=new Set(["pipe","overlapped"]),e5=async($,J,Z,X)=>{for await(let q of $)if(!GH(J))JJ(q,Z,X)},$J=($,J,Z)=>{for(let X of $)JJ(X,J,Z)},GH=($)=>$._readableState.pipes.length>0,JJ=($,J,Z)=>{let X=k$($);y0({type:"output",verboseMessage:X,fdNumber:J,verboseInfo:Z})};var ZJ=({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)=>KH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:X,verboseInfo:q},Z)),...Y}},KH=({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=X5($,Y,B),M=t0(W),{stdioItems:R,objectMode:L}=J[Z],I=BH([M],R,H,X),{serializedResult:x,finalResult:F=x}=UH({chunks:I,objectMode:L,encoding:H,lines:K,stripFinalNewline:U,fdNumber:Z});WH({serializedResult:x,fdNumber:Z,state:X,verboseInfo:Q,encoding:H,stdioItems:R,objectMode:L});let v=G[Z]?F:void 0;try{if(X.error===void 0)VH(x,R,q);return v}catch(j){return X.error=j,v}},BH=($,J,Z,X)=>{try{return I4($,J,Z,!1)}catch(q){return X.error=q,$}},UH=({chunks:$,objectMode:J,encoding:Z,lines:X,stripFinalNewline:q,fdNumber:Y})=>{if(J)return{serializedResult:$};if(Z==="buffer")return{serializedResult:Q$($)};let Q=R6($,Z);if(X[Y])return{serializedResult:Q,finalResult:a2(Q,!q[Y],J)};return{serializedResult:Q}},WH=({serializedResult:$,fdNumber:J,state:Z,verboseInfo:X,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!w4({stdioItems:Y,encoding:q,verboseInfo:X,fdNumber:J}))return;let G=a2($,!1,Q);try{$J(G,J,X)}catch(H){Z.error??=H}},VH=($,J,Z)=>{for(let{path:X,append:q}of J.filter(({type:Y})=>C4.has(Y))){let Y=typeof X==="string"?X:X.toString();if(q||Z.has(Y))zH(X,$);else Z.add(Y),HH(X,$)}};var XJ=([,$,J],Z)=>{if(!Z.all)return;if($===void 0)return J;if(J===void 0)return $;if(Array.isArray($))return Array.isArray(J)?[...$,...J]:[...$,e0(J,Z,"all")];if(Array.isArray(J))return[e0($,Z,"all"),...J];if(z0($)&&z0(J))return q2([$,J]);return`${$}${J}`};import{once as $3}from"node:events";var QJ=async($,J)=>{let[Z,X]=await LH($);return J.isForcefullyTerminated??=!1,[Z,X]},LH=async($)=>{let[J,Z]=await Promise.allSettled([$3($,"spawn"),$3($,"exit")]);if(J.status==="rejected")return[];return Z.status==="rejected"?qJ($):Z.value},qJ=async($)=>{try{return await $3($,"exit")}catch{return qJ($)}},YJ=async($)=>{let[J,Z]=await $;if(!_H(J,Z)&&J3(J,Z))throw new g0;return[J,Z]},_H=($,J)=>$===void 0&&J===void 0,J3=($,J)=>$!==0||J!==null;var GJ=({error:$,status:J,signal:Z,output:X},{maxBuffer:q})=>{let Y=RH($,J,Z),Q=Y?.code==="ETIMEDOUT",G=Z5(Y,X,q);return{resultError:Y,exitCode:J,signal:Z,timedOut:Q,isMaxBuffer:G}},RH=($,J,Z)=>{if($!==void 0)return $;return J3(J,Z)?new g0:void 0};var HJ=($,J,Z)=>{let{file:X,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:U}=MH($,J,Z),B=PH({file:X,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:U,startTime:G});return n1(B,H,K)},MH=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=y$($,J,Z),G=CH(Z),{file:H,commandArguments:K,options:U}=G4($,J,G);FH(U);let B=y5(U,Q);return{file:H,commandArguments:K,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},CH=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,FH=({ipc:$,ipcInput:J,detached:Z,cancelSignal:X})=>{if(J)O4("ipcInput");if($)O4("ipc: true");if(Z)O4("detached: true");if(X)O4("cancelSignal")},O4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},PH=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=jH({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:M}=GJ(H,Z),{output:R,error:L=K}=ZJ({fileDescriptors:Q,syncResult:H,options:Z,isMaxBuffer:M,verboseInfo:Y}),I=R.map((F,v)=>e0(F,Z,v)),x=e0(XJ(R,Z),Z,"all");return IH({error:L,exitCode:U,signal:B,timedOut:W,isMaxBuffer:M,stdio:I,all:x,options:Z,command:X,escapedCommand:q,startTime:G})},jH=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{s5(Y,Z);let G=xH(Z);return TH(...H4($,J,G))}catch(G){return l1({error:G,command:X,escapedCommand:q,fileDescriptors:Y,options:Z,startTime:Q,isSync:!0})}},xH=({encoding:$,maxBuffer:J,...Z})=>({...Z,encoding:"buffer",maxBuffer:_4(J)}),IH=({error:$,exitCode:J,signal:Z,timedOut:X,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:U})=>$===void 0?R4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U}):B$({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 UK}from"node:events";import{spawn as WK}from"node:child_process";import WJ from"node:process";import{once as Z3,on as wH}from"node:events";var zJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0,filter:Y}={})=>{return u1({methodName:"getOneMessage",isSubprocess:Z,ipc:X,isConnected:J4($)}),OH({anyProcess:$,channel:J,isSubprocess:Z,filter:Y,reference:q})},OH=async({anyProcess:$,channel:J,isSubprocess:Z,filter:X,reference:q})=>{r$(J,q);let Y=X1($,J,Z),Q=new AbortController;try{return await Promise.race([EH(Y,X,Q),AH(Y,Z,Q),hH(Y,Z,Q)])}catch(G){throw m1($),G}finally{Q.abort(),s$(J,q)}},EH=async($,J,{signal:Z})=>{if(J===void 0){let[X]=await Z3($,"message",{signal:Z});return X}for await(let[X]of wH($,"message",{signal:Z}))if(J(X))return X},AH=async($,J,{signal:Z})=>{await Z3($,"disconnect",{signal:Z}),o7(J)},hH=async($,J,{signal:Z})=>{let[X]=await Z3($,"strict:error",{signal:Z});throw o$(X,J)};import{once as BJ,on as NH}from"node:events";var UJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0}={})=>X3({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:!Z,reference:q}),X3=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:q,reference:Y})=>{u1({methodName:"getEachMessage",isSubprocess:Z,ipc:X,isConnected:J4($)}),r$(J,Y);let Q=X1($,J,Z),G=new AbortController,H={};return DH($,Q,G),SH({ipcEmitter:Q,isSubprocess:Z,controller:G,state:H}),vH({anyProcess:$,channel:J,ipcEmitter:Q,isSubprocess:Z,shouldAwait:q,controller:G,state:H,reference:Y})},DH=async($,J,Z)=>{try{await BJ(J,"disconnect",{signal:Z.signal}),Z.abort()}catch{}},SH=async({ipcEmitter:$,isSubprocess:J,controller:Z,state:X})=>{try{let[q]=await BJ($,"strict:error",{signal:Z.signal});X.error=o$(q,J),Z.abort()}catch{}},vH=async function*({anyProcess:$,channel:J,ipcEmitter:Z,isSubprocess:X,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of NH(Z,"message",{signal:Y.signal}))KJ(Q),yield H}catch{KJ(Q)}finally{if(Y.abort(),s$(J,G),!X)m1($);if(q)await $}},KJ=({error:$})=>{if($)throw $};var VJ=($,{ipc:J})=>{Object.assign($,_J($,!1,J))},LJ=()=>{let $=WJ,J=!0,Z=WJ.channel!==void 0;return{..._J($,!0,Z),getCancelSignal:F8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:Z})}},_J=($,J,Z)=>({sendMessage:q4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getOneMessage:zJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getEachMessage:UJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z})});import{ChildProcess as fH}from"node:child_process";import{PassThrough as kH,Readable as bH,Writable as yH,Duplex as gH}from"node:stream";var RJ=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,verboseInfo:Q})=>{i2(X);let G=new fH;uH(G,X),Object.assign(G,{readable:mH,writable:cH,duplex:pH});let H=l1({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:!1}),K=dH(H,Q,q);return{subprocess:G,promise:K}},uH=($,J)=>{let Z=W$(),X=W$(),q=W$(),Y=Array.from({length:J.length-3},W$),Q=W$(),G=[Z,X,q,...Y];Object.assign($,{stdin:Z,stdout:X,stderr:q,all:Q,stdio:G})},W$=()=>{let $=new kH;return $.end(),$},mH=()=>new bH({read(){}}),cH=()=>new yH({write(){}}),pH=()=>new gH({read(){},write(){}}),dH=async($,J,Z)=>n1($,J,Z);import{createReadStream as TJ,createWriteStream as MJ}from"node:fs";import{Buffer as lH}from"node:buffer";import{Readable as V$,Writable as nH,Duplex as iH}from"node:stream";var FJ=($,J)=>F4(oH,$,J,!1),L$=({type:$,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${Q1[$]}.`)},CJ={fileNumber:L$,generator:e2,asyncGenerator:e2,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:J,readableObjectMode:Z}}){let X=J||Z;return{stream:iH.fromWeb($,{objectMode:X})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},oH={input:{...CJ,fileUrl:({value:$})=>({stream:TJ($)}),filePath:({value:{file:$}})=>({stream:TJ($)}),webStream:({value:$})=>({stream:V$.fromWeb($)}),iterable:({value:$})=>({stream:V$.from($)}),asyncIterable:({value:$})=>({stream:V$.from($)}),string:({value:$})=>({stream:V$.from($)}),uint8Array:({value:$})=>({stream:V$.from(lH.from($))})},output:{...CJ,fileUrl:({value:$})=>({stream:MJ($)}),filePath:({value:{file:$,append:J}})=>({stream:MJ($,J?{flags:"a"}:{})}),webStream:({value:$})=>({stream:nH.fromWeb($)}),iterable:L$,asyncIterable:L$,string:L$,uint8Array:L$}};import{on as tH,once as PJ}from"node:events";import{PassThrough as aH,getDefaultHighWaterMark as rH}from"node:stream";import{finished as IJ}from"node:stream/promises";function T1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)Q3(q);let J=$.some(({readableObjectMode:q})=>q),Z=sH($,J),X=new wJ({objectMode:J,writableHighWaterMark:Z,readableHighWaterMark:Z});for(let q of $)X.add(q);return X}var sH=($,J)=>{if($.length===0)return rH(J);let Z=$.filter(({readableObjectMode:X})=>X===J).map(({readableHighWaterMark:X})=>X);return Math.max(...Z)};class wJ extends aH{#J=new Set([]);#Z=new Set([]);#$=new Set([]);#X;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(Q3($),this.#J.has($))return;this.#J.add($),this.#X??=eH(this,this.#J,this.#q);let J=Zz({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(Q3($),!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 eH=async($,J,Z)=>{E4($,jJ);let X=new AbortController;try{await Promise.race([$z($,X),Jz($,J,Z,X)])}finally{X.abort(),E4($,-jJ)}},$z=async($,{signal:J})=>{try{await IJ($,{signal:J,cleanup:!0})}catch(Z){throw OJ($,Z),Z}},Jz=async($,J,Z,{signal:X})=>{for await(let[q]of tH($,"unpipe",{signal:X}))if(J.has(q))q.emit(Z)},Q3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},Zz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,onFinished:Y,unpipeEvent:Q})=>{E4($,xJ);let G=new AbortController;try{await Promise.race([Xz(Y,J,G),Qz({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:G}),qz({stream:J,streams:Z,ended:X,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),E4($,-xJ)}if(Z.size>0&&Z.size===X.size+q.size)if(X.size===0&&q.size>0)q3($);else Yz($)},Xz=async($,J,{signal:Z})=>{try{if(await $,!Z.aborted)q3(J)}catch(X){if(!Z.aborted)OJ(J,X)}},Qz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:{signal:Y}})=>{try{if(await IJ(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(EJ(Q))q.add(J);else AJ($,Q)}},qz=async({stream:$,streams:J,ended:Z,aborted:X,unpipeEvent:q,controller:{signal:Y}})=>{if(await PJ($,q,{signal:Y}),!$.readable)return PJ(Y,"abort",{signal:Y});J.delete($),Z.delete($),X.delete($)},Yz=($)=>{if($.writable)$.end()},OJ=($,J)=>{if(EJ(J))q3($);else AJ($,J)},EJ=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",q3=($)=>{if($.readable||$.writable)$.destroy()},AJ=($,J)=>{if(!$.destroyed)$.once("error",Gz),$.destroy(J)},Gz=()=>{},E4=($,J)=>{let Z=$.getMaxListeners();if(Z!==0&&Z!==Number.POSITIVE_INFINITY)$.setMaxListeners(Z+J)},jJ=2,xJ=1;import{finished as hJ}from"node:stream/promises";var o1=($,J)=>{$.pipe(J),Hz($,J),zz($,J)},Hz=async($,J)=>{if(D0($)||D0(J))return;try{await hJ($,{cleanup:!0,readable:!0,writable:!1})}catch{}Y3(J)},Y3=($)=>{if($.writable)$.end()},zz=async($,J)=>{if(D0($)||D0(J))return;try{await hJ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}G3($)},G3=($)=>{if($.readable)$.destroy()};var NJ=($,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})=>I0.has(H)))Kz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!I0.has(H)))Uz({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]:T1(Y);o1(Q,q)}},Kz=($,J,Z,X)=>{if(Z==="output")o1($.stdio[X],J);else o1(J,$.stdio[X]);let q=Bz[X];if(q!==void 0)$[q]=J;$.stdio[X]=J},Bz=["stdin","stdout","stderr"],Uz=({subprocess:$,stream:J,direction:Z,fdNumber:X,pipeGroups:q,controller:Y})=>{if(J===void 0)return;Wz(J,Y);let[Q,G]=Z==="output"?[J,$.stdio[X]]:[$.stdio[X],J],H=q.get(Q)??[];q.set(Q,[...H,G])},Wz=($,{signal:J})=>{if(D0($))V1($,Vz,J)},Vz=2;import{addAbortListener as Rz}from"node:events";var M1=[];M1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")M1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")M1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var A4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",H3=Symbol.for("signal-exit emitter"),z3=globalThis,Lz=Object.defineProperty.bind(Object);class DJ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(z3[H3])return z3[H3];Lz(z3,H3,{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 B3{}var _z=($)=>{return{onExit(J,Z){return $.onExit(J,Z)},load(){return $.load()},unload(){return $.unload()}}};class SJ extends B3{onExit(){return()=>{}}load(){}unload(){}}class vJ extends B3{#J=K3.platform==="win32"?"SIGINT":"SIGHUP";#Z=new DJ;#$;#X;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let J of M1)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(!A4(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 M1)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,M1.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(!A4(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"&&A4(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 K3=globalThis.process,{onExit:fJ,load:UC,unload:WC}=_z(A4(K3)?new vJ(K3):new SJ);var kJ=($,{cleanup:J,detached:Z},{signal:X})=>{if(!J||Z)return;let q=fJ(()=>{$.kill()});Rz(X,()=>{q()})};var yJ=({source:$,sourcePromise:J,boundOptions:Z,createNested:X},...q)=>{let Y=b$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:U}=Tz(Z,X,q),{sourceStream:B,sourceError:W}=Cz($,K),{options:M,fileDescriptors:R}=m0.get($);return{sourcePromise:J,sourceStream:B,sourceOptions:M,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}={}}=Mz($,J,...Z),G=a$(X,Y);return{destination:X,destinationStream:G,from:q,unpipeSignal:Q}}catch(X){return{destinationError:X}}},Mz=($,J,Z,...X)=>{if(Array.isArray(Z))return{destination:J(bJ,$)(Z,...X),pipeOptions:$};if(typeof Z==="string"||Z instanceof URL||X2(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]=O$(Z,...X);return{destination:J(bJ)(q,Y,Q),pipeOptions:Q}}if(m0.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}`)},bJ=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),Cz=($,J)=>{try{return{sourceStream:c1($,J)}}catch(Z){return{sourceError:Z}}};var uJ=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=Fz({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X});if(G!==void 0)throw U3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},Fz=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X})=>{if(J!==void 0&&X!==void 0)return X;if(X!==void 0)return G3($),X;if(J!==void 0)return Y3(Z),J},U3=({error:$,fileDescriptors:J,sourceOptions:Z,startTime:X})=>l1({error:$,command:gJ,escapedCommand:gJ,fileDescriptors:J,options:Z,startTime:X,isSync:!1}),gJ="source.pipe(destination)";var mJ=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 Pz}from"node:stream/promises";var cJ=($,J,Z)=>{let X=h4.has(J)?xz($,J):jz($,J);return V1($,wz,Z.signal),V1(J,Oz,Z.signal),Iz(J),X},jz=($,J)=>{let Z=T1([$]);return o1(Z,J),h4.set(J,Z),Z},xz=($,J)=>{let Z=h4.get(J);return Z.add($),Z},Iz=async($)=>{try{await Pz($,{cleanup:!0,readable:!1,writable:!0})}catch{}h4.delete($)},h4=new WeakMap,wz=2,Oz=1;import{aborted as Ez}from"node:util";var pJ=($,J)=>$===void 0?[]:[Az($,J)],Az=async($,{sourceStream:J,mergedStream:Z,fileDescriptors:X,sourceOptions:q,startTime:Y})=>{await Ez($,J),await Z.remove(J);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw U3({error:Q,fileDescriptors:X,sourceOptions:q,startTime:Y})};var N4=($,...J)=>{if(Z0(J[0]))return N4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...J[0]}});let{destination:Z,...X}=yJ($,...J),q=hz({...X,destination:Z});return q.pipe=N4.bind(void 0,{...$,source:Z,sourcePromise:q,boundOptions:{}}),q},hz=async({sourcePromise:$,sourceStream:J,sourceOptions:Z,sourceError:X,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let U=Nz($,q);uJ({sourceStream:J,sourceError:X,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:Z,startTime:K});let B=new AbortController;try{let W=cJ(J,Y,B);return await Promise.race([mJ(U),...pJ(G,{sourceStream:J,mergedStream:W,sourceOptions:Z,fileDescriptors:H,startTime:K})])}finally{B.abort()}},Nz=($,J)=>Promise.allSettled([$,J]);import{setImmediate as yz}from"node:timers/promises";import{on as Dz}from"node:events";import{getDefaultHighWaterMark as Sz}from"node:stream";var D4=({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:X,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return vz(J,Q),lJ({stream:$,controller:Q,binary:Z,shouldEncode:!$.readableObjectMode&&X,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},vz=async($,J)=>{try{await $}catch{}finally{J.abort()}},W3=({stream:$,onStreamEnd:J,lines:Z,encoding:X,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;fz(J,Q,$);let G=$.readableObjectMode&&!Y;return lJ({stream:$,controller:Q,binary:X==="buffer",shouldEncode:!G,encoding:X,shouldSplit:!G&&Z,preserveNewlines:!q})},fz=async($,J,Z)=>{try{await $}catch{Z.destroy()}finally{J.abort()}},lJ=({stream:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=Dz($,"data",{signal:J.signal,highWaterMark:dJ,highWatermark:dJ});return kz({onStdoutChunk:G,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})},V3=Sz(!0),dJ=V3,kz=async function*({onStdoutChunk:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=bz({binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*R1(H,G,0)}catch(H){if(!J.signal.aborted)throw H}finally{yield*U$(G)}},bz=({binary:$,shouldEncode:J,encoding:Z,shouldSplit:X,preserveNewlines:q})=>[j4($,Z,!J),P4($,q,!X,{})].filter(Boolean);var nJ=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:U})=>{let B=gz({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:G,verboseInfo:K,streamInfo:U});if(!q){await Promise.all([uz($),B]);return}let W=o2(H,Z),M=W3({stream:$,onStreamEnd:J,lines:Q,encoding:X,stripFinalNewline:W,allMixed:G}),[R]=await Promise.all([mz({stream:$,iterable:M,fdNumber:Z,encoding:X,maxBuffer:Y,lines:Q}),B]);return R},gz=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!w4({stdioItems:Q[Z]?.stdioItems,encoding:X,verboseInfo:Y,fdNumber:Z}))return;let G=W3({stream:$,onStreamEnd:J,lines:!0,encoding:X,stripFinalNewline:!0,allMixed:q});await e5(G,$,Z,Y)},uz=async($)=>{if(await yz(),$.readableFlowing===null)$.resume()},mz=async({stream:$,stream:{readableObjectMode:J},iterable:Z,fdNumber:X,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(J||Q)return await U4(Z,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await W4(Z,{maxBuffer:Y}));return await L4(Z,{maxBuffer:Y})}catch(G){return iJ(e8({error:G,stream:$,readableObjectMode:J,lines:Q,encoding:q,fdNumber:X}))}},L3=async($)=>{try{return await $}catch(J){return iJ(J)}},iJ=({bufferedData:$})=>L6($)?new Uint8Array($):$;import{finished as cz}from"node:stream/promises";var _$=async($,J,Z,{isSameDirection:X,stopOnExit:q=!1}={})=>{let Y=pz($,Z),Q=new AbortController;try{await Promise.race([...q?[Z.exitPromise]:[],cz($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)nz(G,J,Z,X)}finally{Q.abort()}},pz=($,{originalStreams:[J],subprocess:Z})=>{let X={stdinCleanedUp:!1};if($===J)dz($,Z,X);return X},dz=($,J,Z)=>{let{_destroy:X}=$;$._destroy=(...q)=>{lz(J,Z),X.call($,...q)}},lz=({exitCode:$,signalCode:J},Z)=>{if($!==null||J!==null)Z.stdinCleanedUp=!0},nz=($,J,Z,X)=>{if(!iz($,J,Z,X))throw $},iz=($,J,Z,X=!0)=>{if(Z.propagating)return oJ($)||S4($);return Z.propagating=!0,_3(Z,J)===X?oJ($):S4($)},_3=({fileDescriptors:$},J)=>J!=="all"&&$[J].direction==="input",S4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",oJ=($)=>$?.code==="EPIPE";var tJ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>R3({stream:H,fdNumber:K,encoding:J,buffer:Z[K],maxBuffer:X[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),R3=async({stream:$,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let U=_$($,J,K);if(_3(K,J)){await U;return}let[B]=await Promise.all([nJ({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 aJ=({stdout:$,stderr:J},{all:Z})=>Z&&($||J)?T1([$,J].filter(Boolean)):void 0,rJ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>R3({...oz($,Z),fdNumber:"all",encoding:J,maxBuffer:X[1]+X[2],lines:q[1]||q[2],allMixed:tz($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),oz=({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}},tz=({all:$,stdout:J,stderr:Z})=>$&&J&&Z&&J.readableObjectMode!==Z.readableObjectMode;import{once as az}from"node:events";var sJ=($)=>b1($,"ipc"),eJ=($,J)=>{let Z=k$($);y0({type:"ipc",verboseMessage:Z,fdNumber:"ipc",verboseInfo:J})};var $Z=async({subprocess:$,buffer:J,maxBuffer:Z,ipc:X,ipcOutput:q,verboseInfo:Y})=>{if(!X)return q;let Q=sJ(Y),G=a0(J,"ipc"),H=a0(Z,"ipc");for await(let K of X3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:X,shouldAwait:!1,reference:!0})){if(G)$5($,q,H),q.push(K);if(Q)eJ(K,Y)}return q},JZ=async($,J)=>{return await Promise.allSettled([$]),J};var ZZ=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:M,fileDescriptors:R,originalStreams:L,onInternalError:I,controller:x})=>{let F=QJ($,W),v={originalStreams:L,fileDescriptors:R,subprocess:$,exitPromise:F,propagating:!1},j=tJ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:M,streamInfo:v}),l=rJ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:M,streamInfo:v}),n=[],o=$Z({subprocess:$,buffer:Z,maxBuffer:X,ipc:U,ipcOutput:n,verboseInfo:M}),L0=rz(L,$,v),p=sz(R,v);try{return await Promise.race([Promise.all([{},YJ(F),Promise.all(j),l,o,N8($,B),...L0,...p]),I,ez($,x),...w8($,Y,W,x),...i7({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:W,controller:x}),...x8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:W,controller:x})])}catch(i0){return W.terminationReason??="other",Promise.all([{error:i0},F,Promise.all(j.map((E)=>L3(E))),L3(l),JZ(o,n),Promise.allSettled(L0),Promise.allSettled(p)])}},rz=($,J,Z)=>$.map((X,q)=>X===J.stdio[q]?void 0:_$(X,q,Z)),sz=($,J)=>$.flatMap(({stdioItems:Z},X)=>Z.filter(({value:q,stream:Y=q})=>v0(Y,{checkOpen:!1})&&!D0(Y)).map(({type:q,value:Y,stream:Q=Y})=>_$(Q,X,J,{isSameDirection:I0.has(q),stopOnExit:q==="native"}))),ez=async($,{signal:J})=>{let[Z]=await az($,"error",{signal:J});throw Z};var XZ=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),R$=($,J,Z)=>{let X=$[Z];if(!X.has(J))X.set(J,[]);let q=X.get(J),Y=u0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},t1=async({resolve:$,promises:J},Z)=>{$();let[X]=await Promise.race([Promise.allSettled([!0,Z]),Promise.all([!1,...J])]);return!X};import{Readable as $K}from"node:stream";import{callbackify as JK}from"node:util";import{finished as QZ}from"node:stream/promises";var T3=async($)=>{if($===void 0)return;try{await M3($)}catch{}},qZ=async($)=>{if($===void 0)return;try{await C3($)}catch{}},M3=async($)=>{await QZ($,{cleanup:!0,readable:!1,writable:!0})},C3=async($)=>{await QZ($,{cleanup:!0,readable:!0,writable:!1})},v4=async($,J)=>{if(await $,J)throw J},f4=($,J,Z)=>{if(Z&&!S4(Z))$.destroy(Z);else if(J)$.destroy()};var YZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||M0.has(Z),{subprocessStdout:G,waitReadableDestroy:H}=F3($,X,J),{readableEncoding:K,readableObjectMode:U,readableHighWaterMark:B}=P3(G,Q),{read:W,onStdoutDataDone:M}=j3({subprocessStdout:G,subprocess:$,binary:Q,encoding:Z,preserveNewlines:Y}),R=new $K({read:W,destroy:JK(I3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:B,objectMode:U,encoding:K});return x3({subprocessStdout:G,onStdoutDataDone:M,readable:R,subprocess:$}),R},F3=($,J,Z)=>{let X=c1($,J),q=R$(Z,X,"readableDestroy");return{subprocessStdout:X,waitReadableDestroy:q}},P3=({readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z},X)=>X?{readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:V3},j3=({subprocessStdout:$,subprocess:J,binary:Z,encoding:X,preserveNewlines:q})=>{let Y=u0(),Q=D4({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:!Z,encoding:X,preserveNewlines:q});return{read(){ZK(this,Q,Y)},onStdoutDataDone:Y}},ZK=async($,J,Z)=>{try{let{value:X,done:q}=await J.next();if(q)Z.resolve();else $.push(X)}catch{}},x3=async({subprocessStdout:$,onStdoutDataDone:J,readable:Z,subprocess:X,subprocessStdin:q})=>{try{if(await C3($),await X,await T3(q),await J,Z.readable)Z.push(null)}catch(Y){await T3(q),GZ(Z,Y)}},I3=async({subprocessStdout:$,subprocess:J,waitReadableDestroy:Z},X)=>{if(await t1(Z,J))GZ($,X),await v4(J,X)},GZ=($,J)=>{f4($,$.readable,J)};import{Writable as XK}from"node:stream";import{callbackify as HZ}from"node:util";var zZ=({subprocess:$,concurrentStreams:J},{to:Z}={})=>{let{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}=w3($,Z,J),Q=new XK({...O3(X,$,q),destroy:HZ(A3.bind(void 0,{subprocessStdin:X,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:X.writableHighWaterMark,objectMode:X.writableObjectMode});return E3(X,Q),Q},w3=($,J,Z)=>{let X=a$($,J),q=R$(Z,X,"writableFinal"),Y=R$(Z,X,"writableDestroy");return{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}},O3=($,J,Z)=>({write:QK.bind(void 0,$),final:HZ(qK.bind(void 0,$,J,Z))}),QK=($,J,Z,X)=>{if($.write(J,Z))X();else $.once("drain",X)},qK=async($,J,Z)=>{if(await t1(Z,J)){if($.writable)$.end();await J}},E3=async($,J,Z)=>{try{if(await M3($),J.writable)J.end()}catch(X){await qZ(Z),KZ(J,X)}},A3=async({subprocessStdin:$,subprocess:J,waitWritableFinal:Z,waitWritableDestroy:X},q)=>{if(await t1(Z,J),await t1(X,J))KZ($,q),await v4(J,q)},KZ=($,J)=>{f4($,$.writable,J)};import{Duplex as YK}from"node:stream";import{callbackify as GK}from"node:util";var BZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||M0.has(Z),{subprocessStdout:H,waitReadableDestroy:K}=F3($,X,J),{subprocessStdin:U,waitWritableFinal:B,waitWritableDestroy:W}=w3($,q,J),{readableEncoding:M,readableObjectMode:R,readableHighWaterMark:L}=P3(H,G),{read:I,onStdoutDataDone:x}=j3({subprocessStdout:H,subprocess:$,binary:G,encoding:Z,preserveNewlines:Q}),F=new YK({read:I,...O3(U,$,B),destroy:GK(HK.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:M});return x3({subprocessStdout:H,onStdoutDataDone:x,readable:F,subprocess:$,subprocessStdin:U}),E3(U,F,H),F},HK=async({subprocessStdout:$,subprocessStdin:J,subprocess:Z,waitReadableDestroy:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([I3({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},Q),A3({subprocessStdin:J,subprocess:Z,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var h3=($,J,{from:Z,binary:X=!1,preserveNewlines:q=!1}={})=>{let Y=X||M0.has(J),Q=c1($,Z),G=D4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:J,preserveNewlines:q});return zK(G,Q,$)},zK=async function*($,J,Z){try{yield*$}finally{if(J.readable)J.destroy();await Z}};var UZ=($,{encoding:J})=>{let Z=XZ();$.readable=YZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.writable=zZ.bind(void 0,{subprocess:$,concurrentStreams:Z}),$.duplex=BZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.iterable=h3.bind(void 0,$,J),$[Symbol.asyncIterator]=h3.bind(void 0,$,J,{})};var WZ=($,J)=>{for(let[Z,X]of BK){let q=X.value.bind(J);Reflect.defineProperty($,Z,{...X,value:q})}},KK=(async()=>{})().constructor.prototype,BK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(KK,$)]);var VZ=($,J,Z,X)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:U,fileDescriptors:B}=VK($,J,Z),{subprocess:W,promise:M}=_K({file:q,commandArguments:Y,options:U,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:B});return W.pipe=N4.bind(void 0,{source:W,sourcePromise:M,boundOptions:{},createNested:X}),WZ(W,M),m0.set(W,{options:U,fileDescriptors:B}),W},VK=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=y$($,J,Z),{file:G,commandArguments:H,options:K}=G4($,J,Z),U=LK(K),B=FJ(U,Q);return{file:G,commandArguments:H,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},LK=({timeout:$,signal:J,...Z})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...Z,timeoutDuration:$}},_K=({file:$,commandArguments:J,options:Z,startTime:X,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=WK(...H4($,J,Z))}catch(R){return RJ({error:R,command:Y,escapedCommand:Q,fileDescriptors:G,options:Z,startTime:X,verboseInfo:q})}let K=new AbortController;UK(Number.POSITIVE_INFINITY,K.signal);let U=[...H.stdio];NJ(H,G,K),kJ(H,Z,K);let B={},W=u0();H.kill=l7.bind(void 0,{kill:H.kill.bind(H),options:Z,onInternalError:W,context:B,controller:K}),H.all=aJ(H,Z),UZ(H,Z),VJ(H,Z);let M=RK({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:M}},RK=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,M],R,L,I]=await ZZ({subprocess:$,options:J,context:H,verboseInfo:X,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:U});U.abort(),K.resolve();let x=R.map((j,l)=>e0(j,J,l)),F=e0(L,J,"all"),v=TK({errorInfo:B,exitCode:W,signal:M,stdio:x,all:F,ipcOutput:I,context:H,options:J,command:Q,escapedCommand:G,startTime:Z});return n1(v,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 $)?B$({error:$.error,command:H,escapedCommand:K,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof r0,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U,isSync:!1}):R4({command:H,escapedCommand:K,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U});var k4=($,J)=>{let Z=Object.fromEntries(Object.entries(J).map(([X,q])=>[X,MK(X,$[X],q)]));return{...$,...Z}},MK=($,J,Z)=>{if(CK.has($)&&Z0(J)&&Z0(Z))return{...J,...Z};return Z},CK=new Set(["env",...z2]);var q1=($,J,Z,X)=>{let q=(Q,G,H)=>q1(Q,G,Z,H),Y=(...Q)=>FK({mapArguments:$,deepOptions:Z,boundOptions:J,setBoundExeca:X,createNested:q},...Q);if(X!==void 0)X(Y,q,J);return Y},FK=({mapArguments:$,deepOptions:J={},boundOptions:Z={},setBoundExeca:X,createNested:q},Y,...Q)=>{if(Z0(Y))return q($,k4(Z,Y),X);let{file:G,commandArguments:H,options:K,isSync:U}=PK({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:J,boundOptions:Z});return U?HJ(G,H,K):VZ(G,H,K,q)},PK=({mapArguments:$,firstArgument:J,nextArguments:Z,deepOptions:X,boundOptions:q})=>{let Y=F6(J)?P6(J,Z):[J,...Z],[Q,G,H]=O$(...Y),K=k4(k4(X,q),H),{file:U=Q,commandArguments:B=G,options:W=K,isSync:M=!1}=$({file:Q,commandArguments:G,options:K});return{file:U,commandArguments:B,options:W,isSync:M}};var LZ=({file:$,commandArguments:J})=>RZ($,J),_Z=({file:$,commandArguments:J})=>({...RZ($,J),isSync:!0}),RZ=($,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${J}.`);let[Z,...X]=jK($);return{file:Z,commandArguments:X}},jK=($)=>{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(xK)){let q=Z.at(-1);if(q&&q.endsWith("\\"))Z[Z.length-1]=`${q.slice(0,-1)} ${X}`;else Z.push(X)}return Z},xK=/ +/g;var TZ=($,J,Z)=>{$.sync=J(IK,Z),$.s=$.sync},MZ=({options:$})=>CZ($),IK=({options:$})=>({...CZ($),isSync:!0}),CZ=($)=>({options:{...wK($),...$}}),wK=({input:$,inputFile:J,stdio:Z})=>$===void 0&&J===void 0&&Z===void 0?{stdin:"inherit"}:{},FZ={preferLocal:!0};var PZ=q1(()=>({})),Zj=q1(()=>({isSync:!0})),Xj=q1(LZ),Qj=q1(_Z),qj=q1(E8),Yj=q1(MZ,{},FZ,TZ),{sendMessage:Gj,getOneMessage:Hj,getEachMessage:zj,getCancelSignal:Kj}=LJ();var T$=X$(D3(),1);import{stdin as DK,stdout as SK}from"node:process";import*as Y1 from"node:readline";function vK({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 Lj=vK();function AZ($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var hZ={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}})(hZ);var fK=hZ.exports,_j=AZ(fK),kK=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},Rj=AZ(kK);var f3=10,wZ=($=0)=>(J)=>`\x1B[${J+$}m`,OZ=($=0)=>(J)=>`\x1B[${38+$};5;${J}m`,EZ=($=0)=>(J,Z,X)=>`\x1B[${38+$};2;${J};${Z};${X}m`,e={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(e.modifier);var bK=Object.keys(e.color),yK=Object.keys(e.bgColor);[...bK,...yK];function gK(){let $=new Map;for(let[J,Z]of Object.entries(e)){for(let[X,q]of Object.entries(Z))e[X]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},Z[X]=e[X],$.set(q[0],q[1]);Object.defineProperty(e,J,{value:Z,enumerable:!1})}return Object.defineProperty(e,"codes",{value:$,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=wZ(),e.color.ansi256=OZ(),e.color.ansi16m=EZ(),e.bgColor.ansi=wZ(f3),e.bgColor.ansi256=OZ(f3),e.bgColor.ansi16m=EZ(f3),Object.defineProperties(e,{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)=>e.rgbToAnsi256(...e.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)=>e.ansi256ToAnsi(e.rgbToAnsi256(J,Z,X)),enumerable:!1},hexToAnsi:{value:(J)=>e.ansi256ToAnsi(e.hexToAnsi256(J)),enumerable:!1}}),e}var Tj=gK();var uK="]";var Mj=`${uK}8;;`;var mK=["up","down","left","right","space","enter","cancel"],cK={actions:new Set(mK),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function NZ($,J){if(typeof $=="string")return cK.aliases.get($)===J;for(let Z of $)if(Z!==void 0&&NZ(Z,J))return!0;return!1}var pK=globalThis.process.platform.startsWith("win"),Cj=Symbol("clack:cancel");function DZ({input:$=DK,output:J=SK,overwrite:Z=!0,hideCursor:X=!0}={}){let q=Y1.createInterface({input:$,output:J,prompt:"",tabSize:1});Y1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let K=String(Q);if(NZ([K,G,H],"cancel")){X&&J.write(T$.cursor.show),process.exit(0);return}if(!Z)return;Y1.moveCursor(J,G==="return"?0:-1,G==="return"?-1:0,()=>{Y1.clearLine(J,1,()=>{$.once("keypress",Y)})})};return X&&J.write(T$.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),X&&J.write(T$.cursor.show),$.isTTY&&!pK&&$.setRawMode(!1),q.terminal=!1,q.close()}}var dK;dK=new WeakMap;var B0=X$(v3(),1),g4=X$(D3(),1);import f0 from"node:process";function nK(){return f0.platform!=="win32"?f0.env.TERM!=="linux":!!f0.env.CI||!!f0.env.WT_SESSION||!!f0.env.TERMINUS_SUBLIME||f0.env.ConEmuTask==="{cmd::Cmder}"||f0.env.TERM_PROGRAM==="Terminus-Sublime"||f0.env.TERM_PROGRAM==="vscode"||f0.env.TERM==="xterm-256color"||f0.env.TERM==="alacritty"||f0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var k3=nK(),X0=($,J)=>k3?$:J,Dj=X0("◆","*"),iK=X0("■","x"),oK=X0("▲","x"),SZ=X0("◇","o"),tK=X0("┌","T"),a1=X0("│","|"),aK=X0("└","—"),Sj=X0("●",">"),vj=X0("○"," "),fj=X0("◻","[•]"),kj=X0("◼","[+]"),bj=X0("◻","[ ]"),yj=X0("▪","•"),gj=X0("─","-"),uj=X0("╮","+"),mj=X0("├","+"),cj=X0("╯","+"),rK=X0("●","•"),sK=X0("◆","*"),eK=X0("▲","!"),$B=X0("■","x");var vZ=($="")=>{process.stdout.write(`${B0.default.gray(tK)} ${$}
|
|
45
|
-
`)}
|
|
46
|
-
|
|
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,n4.has(U)){let{groups:W}=new RegExp(`(?:\\${XX}(?<code>\\d+)m|\\${n3}(?<uri>.*)${l3})`).exec(H.slice(K).join(""))||{groups:{}};if(W.code!==void 0){let _=Number.parseFloat(W.code);q=_===CB?void 0:_}else W.uri!==void 0&&(Y=W.uri.length===0?void 0:W.uri)}let B=MB.codes.get(Number(q));H[K+1]===`
|
|
46
|
+
`?(Y&&(X+=oZ("")),q&&B&&(X+=iZ(B))):U===`
|
|
47
|
+
`&&(q&&B&&(X+=iZ(q)),Y&&(X+=oZ(Y)))}return X};function tZ($,J,Z){return String($).normalize().replace(/\r\n/g,`
|
|
48
|
+
`).split(`
|
|
49
|
+
`).map((X)=>xB(X,J,Z)).join(`
|
|
50
|
+
`)}var IB=["up","down","left","right","space","enter","cancel"],l4={actions:new Set(IB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function i3($,J){if(typeof $=="string")return l4.aliases.get($)===J;for(let Z of $)if(Z!==void 0&&i3(Z,J))return!0;return!1}function wB($,J){if($===J)return;let Z=$.split(`
|
|
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 OB=globalThis.process.platform.startsWith("win"),d3=Symbol("clack:cancel");function F$($){return $===d3}function d4($,J){let Z=$;Z.isTTY&&Z.setRawMode(J)}function qX({input:$=rZ,output:J=sZ,overwrite:Z=!0,hideCursor:X=!0}={}){let q=z1.createInterface({input:$,output:J,prompt:"",tabSize:1});z1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let K=String(Q);if(i3([K,G,H],"cancel")){X&&J.write(M0.cursor.show),process.exit(0);return}if(!Z)return;z1.moveCursor(J,G==="return"?0:-1,G==="return"?-1:0,()=>{z1.clearLine(J,1,()=>{$.once("keypress",Y)})})};return X&&J.write(M0.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),X&&J.write(M0.cursor.show),$.isTTY&&!OB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var EB=Object.defineProperty,AB=($,J,Z)=>(J in $)?EB($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,P0=($,J,Z)=>(AB($,typeof J!="symbol"?J+"":J,Z),Z);class o3{constructor($,J=!0){P0(this,"input"),P0(this,"output"),P0(this,"_abortSignal"),P0(this,"rl"),P0(this,"opts"),P0(this,"_render"),P0(this,"_track",!1),P0(this,"_prevFrame",""),P0(this,"_subscribers",new Map),P0(this,"_cursor",0),P0(this,"state","initial"),P0(this,"error",""),P0(this,"value");let{input:Z=rZ,output:X=sZ,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(),$(d3);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let Z=new zB;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=pZ.createInterface({input:this.input,output:Z,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),pZ.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),d4(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(M0.cursor.show),this.output.off("resize",this.render),d4(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(M0.cursor.show),this.output.off("resize",this.render),d4(this.input,!1),$(d3)})})}onKeypress($,J){if(this.state==="error"&&(this.state="active"),J?.name&&(!this._track&&l4.aliases.has(J.name)&&this.emit("cursor",l4.aliases.get(J.name)),l4.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")}i3([$,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
|
+
`),d4(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=tZ(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
54
|
+
`).length-1;this.output.write(M0.cursor.move(-999,$*-1))}render(){let $=tZ(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(M0.cursor.hide);else{let J=wB(this._prevFrame,$);if(this.restoreCursor(),J&&J?.length===1){let Z=J[0];this.output.write(M0.cursor.move(0,Z)),this.output.write(M0.erase.lines(1));let X=$.split(`
|
|
55
|
+
`);this.output.write(X[Z]),this._prevFrame=$,this.output.write(M0.cursor.move(0,X.length-Z-1));return}if(J&&J?.length>1){let Z=J[0];this.output.write(M0.cursor.move(0,Z)),this.output.write(M0.erase.down());let X=$.split(`
|
|
56
|
+
`).slice(Z);this.output.write(X.join(`
|
|
57
|
+
`)),this._prevFrame=$;return}this.output.write(M0.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}var hB;hB=new WeakMap;var NB=Object.defineProperty,DB=($,J,Z)=>(J in $)?NB($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,aZ=($,J,Z)=>(DB($,typeof J!="symbol"?J+"":J,Z),Z);class t3 extends o3{constructor($){super($,!1),aZ(this,"options"),aZ(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 a3 extends o3{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`${$}${eZ.default.inverse(J)}${Z.join("")}`}get cursor(){return this._cursor}constructor($){super($),this.on("finalize",()=>{this.value||(this.value=$.defaultValue)})}}var f=y1(p4(),1),i4=y1(u3(),1);import y0 from"node:process";function SB(){return y0.platform!=="win32"?y0.env.TERM!=="linux":!!y0.env.CI||!!y0.env.WT_SESSION||!!y0.env.TERMINUS_SUBLIME||y0.env.ConEmuTask==="{cmd::Cmder}"||y0.env.TERM_PROGRAM==="Terminus-Sublime"||y0.env.TERM_PROGRAM==="vscode"||y0.env.TERM==="xterm-256color"||y0.env.TERM==="alacritty"||y0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var r3=SB(),Q0=($,J)=>r3?$:J,vB=Q0("◆","*"),YX=Q0("■","x"),GX=Q0("▲","x"),s3=Q0("◇","o"),fB=Q0("┌","T"),U0=Q0("│","|"),P$=Q0("└","—"),kB=Q0("●",">"),bB=Q0("○"," "),Lx=Q0("◻","[•]"),_x=Q0("◼","[+]"),Rx=Q0("◻","[ ]"),Tx=Q0("▪","•"),Mx=Q0("─","-"),Cx=Q0("╮","+"),Fx=Q0("├","+"),Px=Q0("╯","+"),yB=Q0("●","•"),gB=Q0("◆","*"),uB=Q0("▲","!"),mB=Q0("■","x"),HX=($)=>{switch($){case"initial":case"active":return f.default.cyan(vB);case"cancel":return f.default.red(YX);case"error":return f.default.yellow(GX);case"submit":return f.default.green(s3)}},cB=($)=>{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?f.default.dim("..."):X(U,B+G===J)})},zX=($)=>new a3({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let J=`${f.default.gray(U0)}
|
|
58
|
+
${HX(this.state)} ${$.message}
|
|
59
|
+
`,Z=$.placeholder?f.default.inverse($.placeholder[0])+f.default.dim($.placeholder.slice(1)):f.default.inverse(f.default.hidden("_")),X=this.value?this.valueWithCursor:Z;switch(this.state){case"error":return`${J.trim()}
|
|
60
|
+
${f.default.yellow(U0)} ${X}
|
|
61
|
+
${f.default.yellow(P$)} ${f.default.yellow(this.error)}
|
|
62
|
+
`;case"submit":return`${J}${f.default.gray(U0)} ${f.default.dim(this.value||$.placeholder)}`;case"cancel":return`${J}${f.default.gray(U0)} ${f.default.strikethrough(f.default.dim(this.value??""))}${this.value?.trim()?`
|
|
63
|
+
${f.default.gray(U0)}`:""}`;default:return`${J}${f.default.cyan(U0)} ${X}
|
|
64
|
+
${f.default.cyan(P$)}
|
|
65
|
+
`}}}).prompt();var KX=($)=>{let J=(Z,X)=>{let q=Z.label??String(Z.value);switch(X){case"selected":return`${f.default.dim(q)}`;case"active":return`${f.default.green(kB)} ${q} ${Z.hint?f.default.dim(`(${Z.hint})`):""}`;case"cancelled":return`${f.default.strikethrough(f.default.dim(q))}`;default:return`${f.default.dim(bB)} ${f.default.dim(q)}`}};return new t3({options:$.options,initialValue:$.initialValue,render(){let Z=`${f.default.gray(U0)}
|
|
66
|
+
${HX(this.state)} ${$.message}
|
|
67
|
+
`;switch(this.state){case"submit":return`${Z}${f.default.gray(U0)} ${J(this.options[this.cursor],"selected")}`;case"cancel":return`${Z}${f.default.gray(U0)} ${J(this.options[this.cursor],"cancelled")}
|
|
68
|
+
${f.default.gray(U0)}`;default:return`${Z}${f.default.cyan(U0)} ${cB({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(X,q)=>J(X,q?"active":"inactive")}).join(`
|
|
69
|
+
${f.default.cyan(U0)} `)}
|
|
70
|
+
${f.default.cyan(P$)}
|
|
71
|
+
`}}}).prompt()};var e3=($="")=>{process.stdout.write(`${f.default.gray(P$)} ${f.default.red($)}
|
|
47
72
|
|
|
48
|
-
`)},
|
|
49
|
-
`)
|
|
73
|
+
`)},BX=($="")=>{process.stdout.write(`${f.default.gray(fB)} ${$}
|
|
74
|
+
`)},UX=($="")=>{process.stdout.write(`${f.default.gray(U0)}
|
|
75
|
+
${f.default.gray(P$)} ${$}
|
|
76
|
+
|
|
77
|
+
`)},n0={message:($="",{symbol:J=f.default.gray(U0)}={})=>{let Z=[`${f.default.gray(U0)}`];if($){let[X,...q]=$.split(`
|
|
78
|
+
`);Z.push(`${J} ${X}`,...q.map((Y)=>`${f.default.gray(U0)} ${Y}`))}process.stdout.write(`${Z.join(`
|
|
50
79
|
`)}
|
|
51
|
-
`)},info:($)=>{
|
|
52
|
-
`);let
|
|
53
|
-
`);process.stdout.write(
|
|
54
|
-
`);let
|
|
55
|
-
`):process.stdout.write(`${
|
|
56
|
-
`),R(),q()};return{start:
|
|
57
|
-
`).map((X)=>X.split("\t")),Z=0;return J.forEach((X)=>{if(X.length>1&&
|
|
58
|
-
`)}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>
|
|
80
|
+
`)},info:($)=>{n0.message($,{symbol:f.default.blue(yB)})},success:($)=>{n0.message($,{symbol:f.default.green(gB)})},step:($)=>{n0.message($,{symbol:f.default.green(s3)})},warn:($)=>{n0.message($,{symbol:f.default.yellow(uB)})},warning:($)=>{n0.warn($)},error:($)=>{n0.message($,{symbol:f.default.red(mB)})}},jx=`${f.default.gray(U0)} `;var WX=({indicator:$="dots"}={})=>{let J=r3?["◒","◐","◓","◑"]:["•","o","O","0"],Z=r3?80:120,X=process.env.CI==="true",q,Y,Q=!1,G="",H,K=performance.now(),U=(F)=>{let y=F>1?"Something went wrong":"Canceled";Q&&c(y,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
|
+
`);let F=H.split(`
|
|
82
|
+
`);process.stdout.write(i4.cursor.move(-999,F.length-1)),process.stdout.write(i4.erase.down(F.length))},x=(F)=>F.replace(/\.+$/,""),j=(F)=>{let y=(performance.now()-F)/1000,l=Math.floor(y/60),t=Math.floor(y%60);return l>0?`[${l}m ${t}s]`:`[${t}s]`},h=(F="")=>{Q=!0,q=qX(),G=x(F),K=performance.now(),process.stdout.write(`${f.default.gray(U0)}
|
|
83
|
+
`);let y=0,l=0;_(),Y=setInterval(()=>{if(X&&G===H)return;L(),H=G;let t=f.default.magenta(J[y]);if(X)process.stdout.write(`${t} ${G}...`);else if($==="timer")process.stdout.write(`${t} ${G} ${j(K)}`);else{let _0=".".repeat(Math.floor(l)).slice(0,3);process.stdout.write(`${t} ${G}${_0}`)}y=y+1<J.length?y+1:0,l=l<J.length?l+0.125:0},Z)},c=(F="",y=0)=>{Q=!1,clearInterval(Y),L();let l=y===0?f.default.green(s3):y===1?f.default.red(YX):f.default.red(GX);G=x(F??G),$==="timer"?process.stdout.write(`${l} ${G} ${j(K)}
|
|
84
|
+
`):process.stdout.write(`${l} ${G}
|
|
85
|
+
`),R(),q()};return{start:h,stop:c,message:(F="")=>{G=x(F??G)}}};var H2=y1(p4(),1);import{notStrictEqual as BU,strictEqual as UU}from"assert";var dB={right:iB,center:oB};class LX{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(`
|
|
86
|
+
`).map((X)=>X.split("\t")),Z=0;return J.forEach((X)=>{if(X.length>1&&j0.stringWidth(X[0])>Z)Z=Math.min(Math.floor(this.width*0.5),j0.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=j0.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(`
|
|
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>j0.stringWidth(Y))K+=" ".repeat(H-j0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let B=dB[$[Q].align];if(K=B(K,H),j0.stringWidth(K)<H)K+=" ".repeat((G||0)-j0.stringWidth(K)-1)}let U=$[Q].padding||[0,0,0,0];if(U[3])q+=" ".repeat(U[3]);if(q+=VX($[Q],K,"| "),q+=K,q+=VX($[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=j0.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=j0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
|
|
59
88
|
`);else X=q.text.split(`
|
|
60
|
-
`);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||
|
|
61
|
-
`;q+=$.charAt(Y)}if(Z&&X)q=`${Z}${q}${X}`;return q}function y3($){return gZ($,{stringWidth:(J)=>{return[...J].length},stripAnsi:b3,wrap:mZ})}import{dirname as cZ,resolve as pZ}from"path";import{readdirSync as GB,statSync as HB}from"fs";function g3($,J){let Z=pZ(".",$),X;if(!HB(Z).isDirectory())Z=cZ(Z);while(!0){if(X=J(Z,GB(Z)),X)return pZ(Z,X);if(Z=cZ(X=Z),X===Z)break}}import{inspect as IB}from"util";import{readFileSync as wB}from"fs";import{fileURLToPath as OB}from"url";import{format as BB}from"util";import{normalize as UB,resolve as WB}from"path";function C1($){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 u4($,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 m4($){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 dZ($){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 w0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(w0||(w0={}));var $1;class m3{constructor($){$1=$}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=dZ($),q=typeof $==="string",Y=zB(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),M=Object.create(null),R=Z.__||$1.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:[]},I=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,x=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(Z.array||[]).filter(Boolean).forEach(function(V){let T=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][T]=!0;L.arrays[T]=!0,L.keys.push(T)}),[].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,T])=>{if(typeof T==="number")L.nargs[V]=T,L.keys.push(V)});if(typeof Z.coerce==="object")Object.entries(Z.coerce).forEach(([V,T])=>{if(typeof T==="function")L.coercions[V]=T,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,T])=>{if(typeof T==="boolean"||typeof T==="function")L.configs[V]=T})}Z$(Z.key,Y,Z.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(T){G[T]=G[V]})});let F=null;Z2();let v=[],j=Object.assign(Object.create(null),{_:[]}),l={};for(let V=0;V<X.length;V++){let T=X[V],P=T.replace(/^-{3,}/,"---"),C,_,N,O,f,K0;if(T!=="--"&&/^-/.test(T)&&t(T))n(T);else if(P.match(/^---+(=|$)/)){n(T);continue}else if(T.match(/^--.+=/)||!Q["short-option-groups"]&&T.match(/^-.+=/)){if(O=T.match(/^--?([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)if(k(O[1],L.arrays))V=L0(V,O[1],X,O[2]);else if(k(O[1],L.nargs)!==!1)V=o(V,O[1],X,O[2]);else p(O[1],O[2],!0)}else if(T.match(x)&&Q["boolean-negation"]){if(O=T.match(x),O!==null&&Array.isArray(O)&&O.length>=2)_=O[1],p(_,k(_,L.arrays)?[!1]:!1)}else if(T.match(/^--.+/)||!Q["short-option-groups"]&&T.match(/^-[^-]+/)){if(O=T.match(/^--?(.+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(_=O[1],k(_,L.arrays))V=L0(V,_,X);else if(k(_,L.nargs)!==!1)V=o(V,_,X);else if(f=X[V+1],f!==void 0&&(!f.match(/^-/)||f.match(I))&&!k(_,L.bools)&&!k(_,L.counts))p(_,f),V++;else if(/^(true|false)$/.test(f))p(_,f),V++;else p(_,c(_))}else if(T.match(/^-.\..+=/)){if(O=T.match(/^-([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)p(O[1],O[2])}else if(T.match(/^-.\..+/)&&!T.match(I)){if(f=X[V+1],O=T.match(/^-(.\..+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(_=O[1],f!==void 0&&!f.match(/^-/)&&!k(_,L.bools)&&!k(_,L.counts))p(_,f),V++;else p(_,c(_))}else if(T.match(/^-[^-]+/)&&!T.match(I)){N=T.slice(1,-1).split(""),C=!1;for(let _0=0;_0<N.length;_0++){if(f=T.slice(_0+2),N[_0+1]&&N[_0+1]==="="){if(K0=T.slice(_0+3),_=N[_0],k(_,L.arrays))V=L0(V,_,X,K0);else if(k(_,L.nargs)!==!1)V=o(V,_,X,K0);else p(_,K0);C=!0;break}if(f==="-"){p(N[_0],f);continue}if(/[A-Za-z]/.test(N[_0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(f)&&k(f,L.bools)===!1){p(N[_0],f),C=!0;break}if(N[_0+1]&&N[_0+1].match(/\W/)){p(N[_0],f),C=!0;break}else p(N[_0],c(N[_0]))}if(_=T.slice(-1)[0],!C&&_!=="-")if(k(_,L.arrays))V=L0(V,_,X);else if(k(_,L.nargs)!==!1)V=o(V,_,X);else if(f=X[V+1],f!==void 0&&(!/^(-|--)[^-]/.test(f)||f.match(I))&&!k(_,L.bools)&&!k(_,L.counts))p(_,f),V++;else if(/^(true|false)$/.test(f))p(_,f),V++;else p(_,c(_))}else if(T.match(/^-[0-9]$/)&&T.match(I)&&k(T.slice(1),L.bools))_=T.slice(1),p(_,c(_));else if(T==="--"){v=X.slice(V+1);break}else if(Q["halt-at-non-option"]){v=X.slice(V);break}else n(T)}if(q0(j,!0),q0(j,!1),D(j),i(),J1(j,L.aliases,G,!0),d(j),Q["set-placeholder-key"])Y0(j);if(Object.keys(L.counts).forEach(function(V){if(!a(j,V.split(".")))p(V,0)}),U&&v.length)j[B]=[];if(v.forEach(function(V){j[B].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(j).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete j[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete j[V.split(".").map((T)=>C1(T)).join(".")];delete j[V]});function n(V){let T=w("_",V);if(typeof T==="string"||typeof T==="number")j._.push(T)}function o(V,T,P,C){let _,N=k(T,L.nargs);if(N=typeof N!=="number"||isNaN(N)?1:N,N===0){if(!H0(C))F=Error(R("Argument unexpected for: %s",T));return p(T,c(T)),V}let O=H0(C)?0:1;if(Q["nargs-eats-options"]){if(P.length-(V+1)+O<N)F=Error(R("Not enough arguments following: %s",T));O=N}else{for(_=V+1;_<P.length;_++)if(!P[_].match(/^-[^0-9]/)||P[_].match(I)||t(P[_]))O++;else break;if(O<N)F=Error(R("Not enough arguments following: %s",T))}let f=Math.min(O,N);if(!H0(C)&&f>0)p(T,C),f--;for(_=V+1;_<f+V+1;_++)p(T,P[_]);return V+f}function L0(V,T,P,C){let _=[],N=C||P[V+1],O=k(T,L.nargs);if(k(T,L.bools)&&!/^(true|false)$/.test(N))_.push(!0);else if(H0(N)||H0(C)&&/^-/.test(N)&&!I.test(N)&&!t(N)){if(G[T]!==void 0){let f=G[T];_=Array.isArray(f)?f:[f]}}else{if(!H0(C))_.push(E(T,C,!0));for(let f=V+1;f<P.length;f++){if(!Q["greedy-arrays"]&&_.length>0||O&&typeof O==="number"&&_.length>=O)break;if(N=P[f],/^-/.test(N)&&!I.test(N)&&!t(N))break;V=f,_.push(E(T,N,q))}}if(typeof O==="number"&&(O&&_.length<O||isNaN(O)&&_.length===0))F=Error(R("Not enough arguments following: %s",T));return p(T,_),V}function p(V,T,P=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let N=V.split(".").map(function(O){return C1(O)}).join(".");i0(V,N)}let C=E(V,T,P),_=V.split(".");if(o0(j,_,C),L.aliases[V])L.aliases[V].forEach(function(N){let O=N.split(".");o0(j,O,C)});if(_.length>1&&Q["dot-notation"])(L.aliases[_[0]]||[]).forEach(function(N){let O=N.split("."),f=[].concat(_);if(f.shift(),O=O.concat(f),!(L.aliases[V]||[]).includes(O.join(".")))o0(j,O,C)});if(k(V,L.normalize)&&!k(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(O){Object.defineProperty(l,O,{enumerable:!0,get(){return T},set(f){T=typeof f==="string"?$1.normalize(f):f}})})}function i0(V,T){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[T],W[T]=!0;if(!(L.aliases[T]&&L.aliases[T].length))i0(T,V)}function E(V,T,P){if(P)T=KB(T);if(k(V,L.bools)||k(V,L.counts)){if(typeof T==="string")T=T==="true"}let C=Array.isArray(T)?T.map(function(_){return w(V,_)}):w(V,T);if(k(V,L.counts)&&(H0(C)||typeof C==="boolean"))C=u3();if(k(V,L.normalize)&&k(V,L.arrays))if(Array.isArray(T))C=T.map((_)=>{return $1.normalize(_)});else C=$1.normalize(T);return C}function w(V,T){if(!Q["parse-positional-numbers"]&&V==="_")return T;if(!k(V,L.strings)&&!k(V,L.bools)&&!Array.isArray(T)){if(m4(T)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${T}`)))||!H0(T)&&k(V,L.numbers))T=Number(T)}return T}function D(V){let T=Object.create(null);J1(T,L.aliases,G),Object.keys(L.configs).forEach(function(P){let C=V[P]||T[P];if(C)try{let _=null,N=$1.resolve($1.cwd(),C),O=L.configs[P];if(typeof O==="function"){try{_=O(N)}catch(f){_=f}if(_ instanceof Error){F=_;return}}else _=$1.require(N);g(_)}catch(_){if(_.name==="PermissionDenied")F=_;else if(V[P])F=Error(R("Invalid JSON config file: %s",C))}})}function g(V,T){Object.keys(V).forEach(function(P){let C=V[P],_=T?T+"."+P:P;if(typeof C==="object"&&C!==null&&!Array.isArray(C)&&Q["dot-notation"])g(C,_);else if(!a(j,_.split("."))||k(_,L.arrays)&&Q["combine-arrays"])p(_,C)})}function i(){if(typeof H<"u")H.forEach(function(V){g(V)})}function q0(V,T){if(typeof K>"u")return;let P=typeof K==="string"?K:"",C=$1.env();Object.keys(C).forEach(function(_){if(P===""||_.lastIndexOf(P,0)===0){let N=_.split("__").map(function(O,f){if(f===0)O=O.substring(P.length);return C1(O)});if((T&&L.configs[N.join(".")]||!T)&&!a(V,N))p(N.join("."),C[_])}})}function d(V){let T,P=new Set;Object.keys(V).forEach(function(C){if(!P.has(C)){if(T=k(C,L.coercions),typeof T==="function")try{let _=w(C,T(V[C]));[].concat(L.aliases[C]||[],C).forEach((N)=>{P.add(N),V[N]=_})}catch(_){F=_}}})}function Y0(V){return L.keys.forEach((T)=>{if(~T.indexOf("."))return;if(typeof V[T]>"u")V[T]=void 0}),V}function J1(V,T,P,C=!1){Object.keys(P).forEach(function(_){if(!a(V,_.split("."))){if(o0(V,_.split("."),P[_]),C)M[_]=!0;(T[_]||[]).forEach(function(N){if(a(V,N.split(".")))return;o0(V,N.split("."),P[_])})}})}function a(V,T){let P=V;if(!Q["dot-notation"])T=[T.join(".")];T.slice(0,-1).forEach(function(_){P=P[_]||{}});let C=T[T.length-1];if(typeof P!=="object")return!1;else return C in P}function o0(V,T,P){let C=V;if(!Q["dot-notation"])T=[T.join(".")];T.slice(0,-1).forEach(function(K0){if(K0=lZ(K0),typeof C==="object"&&C[K0]===void 0)C[K0]={};if(typeof C[K0]!=="object"||Array.isArray(C[K0])){if(Array.isArray(C[K0]))C[K0].push({});else C[K0]=[C[K0],{}];C=C[K0][C[K0].length-1]}else C=C[K0]});let _=lZ(T[T.length-1]),N=k(T.join("."),L.arrays),O=Array.isArray(P),f=Q["duplicate-arguments-array"];if(!f&&k(_,L.nargs)){if(f=!0,!H0(C[_])&&L.nargs[_]===1||Array.isArray(C[_])&&C[_].length===L.nargs[_])C[_]=void 0}if(P===u3())C[_]=u3(C[_]);else if(Array.isArray(C[_]))if(f&&N&&O)C[_]=Q["flatten-duplicate-arrays"]?C[_].concat(P):(Array.isArray(C[_][0])?C[_]:[C[_]]).concat([P]);else if(!f&&Boolean(N)===Boolean(O))C[_]=P;else C[_]=C[_].concat([P]);else if(C[_]===void 0&&N)C[_]=O?P:[P];else if(f&&!(C[_]===void 0||k(_,L.counts)||k(_,L.bools)))C[_]=[C[_],P];else C[_]=P}function Z$(...V){V.forEach(function(T){Object.keys(T||{}).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 _=C1(C);if(_!==P&&L.aliases[P].indexOf(_)===-1)L.aliases[P].push(_),W[_]=!0}}),L.aliases[P].concat(P).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&Q["camel-case-expansion"]){let _=u4(C,"-");if(_!==P&&L.aliases[P].indexOf(_)===-1)L.aliases[P].push(_),W[_]=!0}}),L.aliases[P].forEach(function(C){L.aliases[C]=[P].concat(L.aliases[P].filter(function(_){return C!==_}))})})})}function k(V,T){let P=[].concat(L.aliases[V]||[],V),C=Object.keys(T),_=P.find((N)=>C.includes(N));return _?T[_]:!1}function v1(V){let T=Object.keys(L);return[].concat(T.map((C)=>L[C])).some(function(C){return Array.isArray(C)?C.includes(V):C[V]})}function U6(V,...T){return[].concat(...T).some(function(C){let _=V.match(C);return _&&v1(_[1])})}function b(V){if(V.match(I)||!V.match(/^-[^-]+/))return!1;let T=!0,P,C=V.slice(1).split("");for(let _=0;_<C.length;_++){if(P=V.slice(_+2),!v1(C[_])){T=!1;break}if(C[_+1]&&C[_+1]==="="||P==="-"||/[A-Za-z]/.test(C[_])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(P)||C[_+1]&&C[_+1].match(/\W/))break}return T}function t(V){return Q["unknown-options-as-args"]&&G0(V)}function G0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(I))return!1;if(b(V))return!1;return!U6(V,/^-+([^=]+?)=[\s\S]*$/,x,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function c(V){if(!k(V,L.bools)&&!k(V,L.counts)&&`${V}`in G)return G[V];else return W0(J0(V))}function W0(V){return{[w0.BOOLEAN]:!0,[w0.STRING]:"",[w0.NUMBER]:void 0,[w0.ARRAY]:[]}[V]}function J0(V){let T=w0.BOOLEAN;if(k(V,L.strings))T=w0.STRING;else if(k(V,L.numbers))T=w0.NUMBER;else if(k(V,L.bools))T=w0.BOOLEAN;else if(k(V,L.arrays))T=w0.ARRAY;return T}function H0(V){return V===void 0}function Z2(){Object.keys(L.counts).find((V)=>{if(k(V,L.arrays))return F=Error(R("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(k(V,L.nargs))return F=Error(R("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(l,j),configuration:Q,defaulted:Object.assign({},M),error:F,newAliases:Object.assign({},W)}}}function zB($){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 u3($){return $!==void 0?$+1:1}function lZ($){if($==="__proto__")return"___proto___";return $}function KB($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var c3,p3,d3,nZ=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,iZ=(p3=(c3=process===null||process===void 0?void 0:process.versions)===null||c3===void 0?void 0:c3.node)!==null&&p3!==void 0?p3:(d3=process===null||process===void 0?void 0:process.version)===null||d3===void 0?void 0:d3.slice(1);if(iZ){if(Number(iZ.match(/^([^.]+)/)[1])<nZ)throw Error(`yargs parser supports a minimum Node.js version of ${nZ}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var VB=process?process.env:{},oZ=new m3({cwd:process.cwd,env:()=>{return VB},format:BB,normalize:UB,resolve:WB,require:($)=>{return V0($)}}),M$=function(J,Z){return oZ.parse(J.slice(),Z).argv};M$.detailed=function($,J){return oZ.parse($.slice(),J)};M$.camelCase=C1;M$.decamelize=u4;M$.looksLikeNumber=m4;var l3=M$;import{basename as EB,dirname as AB,extname as hB,relative as NB,resolve as JX}from"path";function tZ(){if(LB())return 0;return 1}function LB(){return _B()&&!process.defaultApp}function _B(){return!!process.versions.electron}function n3($){return $.slice(tZ()+1)}function aZ(){return process.argv[tZ()]}class r extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,r)}}import{readFileSync as RB,statSync as TB,writeFile as MB}from"fs";import{format as CB}from"util";import{resolve as FB}from"path";var rZ={fs:{readFileSync:RB,writeFile:MB},format:CB,resolve:FB,exists:($)=>{try{return TB($).isFile()}catch(J){return!1}}};var k0;class sZ{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 k0.format.apply(k0.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 k0.format.apply(k0.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);k0.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(k0.fs.readFileSync)$=JSON.parse(k0.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=k0.resolve($,"./",J+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(Z)&&~J.lastIndexOf("_")){let X=k0.resolve($,"./",J.split("_")[0]+".json");if(this._fileExistsSync(X))Z=X}return Z}_fileExistsSync($){return k0.exists($)}}function eZ($,J){k0=J;let Z=new sZ($);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 PB=($)=>{return eZ($,rZ)},$X=PB;var DB="require is not supported by ESM",ZX="loading a directory of commands is not supported yet for ESM",C$;try{C$=OB(import.meta.url)}catch($){C$=process.cwd()}var SB=C$.substring(0,C$.lastIndexOf("node_modules")),i3={assert:{notStrictEqual:jB,strictEqual:xB},cliui:y3,findUp:g3,getEnv:($)=>{return process.env[$]},inspect:IB,getCallerFile:()=>{throw new r(ZX)},getProcessArgvBin:aZ,mainFilename:SB||process.cwd(),Parser:l3,path:{basename:EB,dirname:AB,extname:hB,relative:NB,resolve:JX},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:wB,require:()=>{throw new r(DB)},requireDirectory:()=>{throw new r(ZX)},stringWidth:($)=>{return[...$].length},y18n:$X({directory:JX(C$,"../../../locales"),updateFiles:!1})};function T0($,J,Z,X){Z.assert.notStrictEqual($,J,X)}function o3($,J){J.assert.strictEqual(typeof $,"string")}function r1($){return Object.keys($)}function s($){return!!$&&!!$.then&&typeof $.then==="function"}function G1($){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 vB=["first","second","third","fourth","fifth","sixth"];function A($,J,Z){function X(){return typeof $==="object"?[{demanded:[],optional:[]},$,J]:[G1(`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 r(`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 r(`Too many arguments provided. Expected max ${U} but received ${K}.`);Y.demanded.forEach((B)=>{let W=H.shift(),M=XX(W);if(B.cmd.filter((L)=>L===M||L==="*").length===0)QX(M,B.cmd,q);q+=1}),Y.optional.forEach((B)=>{if(H.length===0)return;let W=H.shift(),M=XX(W);if(B.cmd.filter((L)=>L===M||L==="*").length===0)QX(M,B.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function XX($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function QX($,J,Z){throw new r(`Invalid ${vB[Z]||"manyith"} argument. Expected ${J.join(" or ")} but received ${$}.`)}class t3{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 qX($){if(!$)return[];return $.map((J)=>{return J.applyBeforeValidation=!1,J})}function F1($,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(s(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 s(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function P1($,J,Z=(X)=>{throw X}){try{let X=fB($)?$():$;return s(X)?X.then((q)=>J(q)):J(X)}catch(X){return Z(X)}}function fB($){return typeof $==="function"}function a3($){for(let J=0,Z=Object.keys(V0.cache),X;J<Z.length;J++)if(X=V0.cache[Z[J]],X.exports===$)return X;return null}var s1=/(^\*)|(^\$0)/;class GX{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=qX(q);if(X=X||(()=>{}),Array.isArray($))if(kB($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(yB($)){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(YX(Z)){this.addHandler([$].concat(Q),J,Z.builder,Z.handler,Z.middlewares,Z.deprecated);return}if(typeof $==="string"){let H=G1($);Q=Q.map((B)=>G1(B).cmd);let K=!1,U=[H.cmd].concat(Q).filter((B)=>{if(s1.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(s1,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 s(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(c4(H)){Z.getInternalMethods().getUsageInstance().freeze();let U=H(Z.getInternalMethods().reset(X),G);if(s(U))return U.then((B)=>{return K=zX(B)?B:Z,this.parseAndUpdateUsage($,J,K,q,Y,Q)})}else if(bB(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 s(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=s1.test(J.original)?J.original.replace(s1,"").trim():J.original,X=$.filter((q)=>{return!s1.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=P1(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=F1(Z,Y,Q,!1),Z=P1(Z,(K)=>{let U=J.handler(K);return s(U)?U.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(s(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=F1(Z,Q,H,!0);return s(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=G1($);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=s1.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(c4(J))return J($,!0);else if(!YX(J))Object.keys(J).forEach((Z)=>{$.option(Z,J[Z])});return}moduleName($){let J=a3($);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;T0(X,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();T0($,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 HX($,J,Z,X){return new GX($,J,Z,X)}function YX($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function kB($){return $.every((J)=>typeof J==="string")}function c4($){return typeof $==="function"}function bB($){return typeof $==="object"}function yB($){return typeof $==="object"&&!Array.isArray($)}function H1($={},J=()=>!0){let Z={};return r1($).forEach((X)=>{if(J(X,$[X]))Z[X]=$[X]}),Z}function z1($){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 gB($){return typeof $==="boolean"}function BX($,J){let Z=J.y18n.__,X={},q=[];X.failFn=function(w){q.push(w)};let Y=null,Q=null,G=!0;X.showHelpOnFail=function(w=!0,D){let[g,i]=typeof w==="string"?[!0,w]:[w,D];if($.getInternalMethods().isGlobalContext())Q=i;return Y=i,G=g,X};let H=!1;X.fail=function(w,D){let g=$.getInternalMethods().getLoggerInstance();if(q.length)for(let i=q.length-1;i>=0;--i){let q0=q[i];if(gB(q0)){if(D)throw D;else if(w)throw Error(w)}else q0(w,D,X)}else{if($.getExitProcess())z1(!0);if(!H){if(H=!0,G)$.showHelp("error"),g.error();if(w||D)g.error(w||D);let i=Y||Q;if(i){if(w||D)g.error("");g.error(i)}}if(D=D||new r(w),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,D);else throw D}};let K=[],U=!1;X.usage=(E,w)=>{if(E===null)return U=!0,K=[],X;return U=!1,K.push([E,w||""]),X},X.getUsage=()=>{return K},X.getUsageDisabled=()=>{return U},X.getPositionalGroupName=()=>{return Z("Positionals:")};let B=[];X.example=(E,w)=>{B.push([E,w||""])};let W=[];X.command=function(w,D,g,i,q0=!1){if(g)W=W.map((d)=>{return d[2]=!1,d});W.push([w,D||"",g,i,q0])},X.getCommands=()=>W;let M={};X.describe=function(w,D){if(Array.isArray(w))w.forEach((g)=>{X.describe(g,D)});else if(typeof w==="object")Object.keys(w).forEach((g)=>{X.describe(g,w[g])});else M[w]=D},X.getDescriptions=()=>M;let R=[];X.epilog=(E)=>{R.push(E)};let L=!1,I;X.wrap=(E)=>{L=!0,I=E},X.getWrap=()=>{if(J.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)I=L0(),L=!0;return I};let x="__yargsString__:";X.deferY18nLookup=(E)=>x+E,X.help=function(){if(j)return j;v();let w=$.customScriptName?$.$0:J.path.basename($.$0),D=$.getDemandedOptions(),g=$.getDemandedCommands(),i=$.getDeprecatedOptions(),q0=$.getGroups(),d=$.getOptions(),Y0=[];Y0=Y0.concat(Object.keys(M)),Y0=Y0.concat(Object.keys(D)),Y0=Y0.concat(Object.keys(g)),Y0=Y0.concat(Object.keys(d.default)),Y0=Y0.filter(n),Y0=Object.keys(Y0.reduce((b,t)=>{if(t!=="_")b[t]=!0;return b},{}));let J1=X.getWrap(),a=J.cliui({width:J1,wrap:!!J1});if(!U){if(K.length)K.forEach((b)=>{if(a.div({text:`${b[0].replace(/\$0/g,w)}`}),b[1])a.div({text:`${b[1]}`,padding:[1,0,0,0]})}),a.div();else if(W.length){let b=null;if(g._)b=`${w} <${Z("command")}>
|
|
62
|
-
`;else b=`${
|
|
63
|
-
`;
|
|
64
|
-
`);
|
|
65
|
-
`)}return
|
|
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||j0.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,lB($[Q]));return Y})}}function VX($,J,Z){if($.border){if(/[.']-+[.']/.test(J))return"";if(J.trim().length!==0)return Z;return" "}return""}function lB($){let J=$.padding||[],Z=1+(J[3]||0)+(J[1]||0);if($.border)return Z+4;return Z}function nB(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function iB($,J){$=$.trim();let Z=j0.stringWidth($);if(Z<J)return" ".repeat(J-Z)+$;return $}function oB($,J){$=$.trim();let Z=j0.stringWidth($);if(Z>=J)return $;return" ".repeat(J-Z>>1)+$}var j0;function _X($,J){return j0=J,new LX({width:($===null||$===void 0?void 0:$.width)||nB(),wrap:$===null||$===void 0?void 0:$.wrap})}var RX=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function $6($){return $.replace(RX,"")}function TX($,J){let[Z,X]=$.match(RX)||["",""];$=$6($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%J===0)q+=`
|
|
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 b=`${I} [${Z("command")}]
|
|
92
|
+
`;r.div(`${b}`)}}if(W.length>1||W.length===1&&!W[0][2]){r.div(Z("Commands:"));let b=$.getInternalMethods().getContext(),a=b.commands.length?`${b.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)W=W.sort((d,V0)=>d[0].localeCompare(V0[0]));let H0=I?`${I} `:"";W.forEach((d)=>{let V0=`${H0}${a}${d[0].replace(/^\$0 ?/,"")}`;r.span({text:V0,padding:[0,2,0,2],width:h(W,Q1,`${I}${a}`)+4},{text:d[1]});let Z0=[];if(d[2])Z0.push(`[${Z("default")}]`);if(d[3]&&d[3].length)Z0.push(`[${Z("aliases:")} ${d[3].join(", ")}]`);if(d[4])if(typeof d[4]==="string")Z0.push(`[${Z("deprecated: %s",d[4])}]`);else Z0.push(`[${Z("deprecated")}]`);if(Z0.length)r.div({text:Z0.join(" "),padding:[0,0,0,2],align:"right"});else r.div()}),r.div()}let r0=(Object.keys(i.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);G0=G0.filter((b)=>!$.parsed.newAliases[b]&&r0.every((a)=>(i.alias[a]||[]).indexOf(b)===-1));let q$=Z("Options:");if(!Y0[q$])Y0[q$]=[];y(G0,i.alias,Y0,q$);let k=(b)=>/^--/.test(r4(b)),b1=Object.keys(Y0).filter((b)=>Y0[b].length>0).map((b)=>{let a=Y0[b].filter(l).map((H0)=>{if(r0.includes(H0))return H0;for(let d=0,V0;(V0=r0[d])!==void 0;d++)if((i.alias[V0]||[]).includes(H0))return V0;return H0});return{groupName:b,normalizedKeys:a}}).filter(({normalizedKeys:b})=>b.length>0).map(({groupName:b,normalizedKeys:a})=>{let H0=a.reduce((d,V0)=>{return d[V0]=[V0].concat(i.alias[V0]||[]).map((Z0)=>{if(b===X.getPositionalGroupName())return Z0;else return(/^[0-9]$/.test(Z0)?i.boolean.includes(V0)?"-":"--":Z0.length>1?"--":"-")+Z0}).sort((Z0,z0)=>k(Z0)===k(z0)?0:k(Z0)?1:-1).join(", "),d},{});return{groupName:b,normalizedKeys:a,switches:H0}});if(b1.filter(({groupName:b})=>b!==X.getPositionalGroupName()).some(({normalizedKeys:b,switches:a})=>!b.every((H0)=>k(a[H0]))))b1.filter(({groupName:b})=>b!==X.getPositionalGroupName()).forEach(({normalizedKeys:b,switches:a})=>{b.forEach((H0)=>{if(k(a[H0]))a[H0]=EU(a[H0],4)})});if(b1.forEach(({groupName:b,normalizedKeys:a,switches:H0})=>{r.div(b),a.forEach((d)=>{let V0=H0[d],Z0=_[d]||"",z0=null;if(Z0.includes(j))Z0=Z(Z0.substring(j.length));if(i.boolean.includes(d))z0=`[${Z("boolean")}]`;if(i.count.includes(d))z0=`[${Z("count")}]`;if(i.string.includes(d))z0=`[${Z("string")}]`;if(i.normalize.includes(d))z0=`[${Z("string")}]`;if(i.array.includes(d))z0=`[${Z("array")}]`;if(i.number.includes(d))z0=`[${Z("number")}]`;let K2=(P)=>typeof P==="string"?`[${Z("deprecated: %s",P)}]`:`[${Z("deprecated")}]`,V=[d in o?K2(o[d]):null,z0,d in D?`[${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:r4(V0),padding:[0,2,0,2+mX(V0)],width:h(H0,Q1)+4},Z0);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((b)=>{b[0]=b[0].replace(/\$0/g,I)}),B.forEach((b)=>{if(b[1]==="")r.div({text:b[0],padding:[0,2,0,2]});else r.div({text:b[0],padding:[0,2,0,2],width:h(B,Q1)+4},{text:b[1]})}),r.div();if(R.length>0){let b=R.map((a)=>a.replace(/\$0/g,I)).join(`
|
|
93
|
+
`);r.div(`${b}
|
|
94
|
+
`)}return r.toString().replace(/\s*$/,"")};function h(O,I,D){let u=0;if(!Array.isArray(O))O=Object.values(O).map((o)=>[o]);if(O.forEach((o)=>{u=Math.max(J.stringWidth(D?`${D} ${r4(o[0])}`:r4(o[0]))+mX(o[0]),u)}),I)u=Math.min(u,parseInt((I*0.5).toString(),10));return u}function c(){let O=$.getDemandedOptions(),I=$.getOptions();(Object.keys(I.alias)||[]).forEach((D)=>{I.alias[D].forEach((u)=>{if(_[u])X.describe(D,_[u]);if(u in O)$.demandOption(D,O[u]);if(I.boolean.includes(u))$.boolean(D);if(I.count.includes(u))$.count(D);if(I.string.includes(u))$.string(D);if(I.normalize.includes(u))$.normalize(D);if(I.array.includes(u))$.array(D);if(I.number.includes(u))$.number(D)})})}let F;X.cacheHelpMessage=function(){F=this.help()},X.clearCachedHelpMessage=function(){F=void 0},X.hasCachedHelpMessage=function(){return!!F};function y(O,I,D,u){let o=[],Y0=null;return Object.keys(D).forEach((i)=>{o=o.concat(D[i])}),O.forEach((i)=>{if(Y0=[i].concat(I[i]),!Y0.some((G0)=>o.indexOf(G0)!==-1))D[u].push(i)}),o}function l(O){return $.getOptions().hiddenOptions.indexOf(O)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}X.showHelp=(O)=>{let I=$.getInternalMethods().getLoggerInstance();if(!O)O="error";(typeof O==="function"?O:I[O])(X.help())},X.functionDescription=(O)=>{return["(",O.name?J.Parser.decamelize(O.name,"-"):Z("generated-value"),")"].join("")},X.stringifiedValues=function(I,D){let u="",o=D||", ",Y0=[].concat(I);if(!I||!Y0.length)return u;return Y0.forEach((i)=>{if(u.length)u+=o;u+=JSON.stringify(i)}),u};function t(O,I){let D=`[${Z("default:")} `;if(O===void 0&&!I)return null;if(I)D+=I;else switch(typeof O){case"string":D+=`"${O}"`;break;case"object":D+=JSON.stringify(O);break;default:D+=O}return`${D}]`}function _0(){if(J.process.stdColumns)return Math.min(80,J.process.stdColumns);else return 80}let n=null;X.version=(O)=>{n=O},X.showVersion=(O)=>{let I=$.getInternalMethods().getLoggerInstance();if(!O)O="error";(typeof O==="function"?O:I[O])(n)},X.reset=function(I){return Y=null,H=!1,K=[],U=!1,R=[],B=[],W=[],_=B1(_,(D)=>!I[D]),X};let a0=[];return X.freeze=function(){a0.push({failMessage:Y,failureOutput:H,usages:K,usageDisabled:U,epilogs:R,examples:B,commands:W,descriptions:_})},X.unfreeze=function(I=!1){let D=a0.pop();if(!D)return;if(I)_={...D.descriptions,..._},W=[...D.commands,...W],K=[...D.usages,...K],B=[...D.examples,...B],R=[...D.epilogs,...R];else({failMessage:Y,failureOutput:H,usages:K,usageDisabled:U,epilogs:R,examples:B,commands:W,descriptions:_}=D)},X}function V6($){return typeof $==="object"}function EU($,J){return V6($)?{text:$.text,indentation:$.indentation+J}:{text:$,indentation:J}}function mX($){return V6($)?$.indentation:0}function r4($){return V6($)?$.text:$}var pX=`###-begin-{{app_name}}-completions-###
|
|
66
95
|
#
|
|
67
96
|
# yargs command completion script
|
|
68
97
|
#
|
|
@@ -90,7 +119,7 @@ _{{app_name}}_yargs_completions()
|
|
|
90
119
|
}
|
|
91
120
|
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
92
121
|
###-end-{{app_name}}-completions-###
|
|
93
|
-
`,
|
|
122
|
+
`,dX=`#compdef {{app_name}}
|
|
94
123
|
###-begin-{{app_name}}-completions-###
|
|
95
124
|
#
|
|
96
125
|
# yargs command completion script
|
|
@@ -109,13 +138,13 @@ _{{app_name}}_yargs_completions()
|
|
|
109
138
|
}
|
|
110
139
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
111
140
|
###-end-{{app_name}}-completions-###
|
|
112
|
-
`;class
|
|
141
|
+
`;class lX{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(a4(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=K1(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((x)=>{let j=W[x];return typeof j==="string"&&j.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(C0(this.customCompletionFunction,null,this.shim),hU(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(NU(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?dX:pX,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 nX($,J,Z,X){return new lX($,J,Z,X)}function hU($){return $.length<3}function NU($){return $.length>3}function iX($,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 oX=["$0","--","_"];function tX($,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 x of Object.keys(_)){let j=_[x];if(j&&R.indexOf(j)<0)R.push(j)}let L=R.length?`
|
|
113
142
|
${R.join(`
|
|
114
|
-
`)}`:"";J.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(
|
|
115
|
-
${X("Argument: %s, Given: %s, Choices: %s",
|
|
116
|
-
`;W.forEach((R)=>{M+=R}),J.fail(M)}};let H={};Y.conflicts=function(B,W){if(A("<string|object> [array|string]",[B,W],arguments.length),typeof B==="object")Object.keys(B).forEach((M)=>{Y.conflicts(M,B[M])});else{if($.global(B),!H[B])H[B]=[];if(Array.isArray(W))W.forEach((M)=>Y.conflicts(B,M));else H[B].push(W)}},Y.getConflicting=()=>H,Y.conflicting=function(B){if(Object.keys(B).forEach((W)=>{if(H[W])H[W].forEach((M)=>{if(M&&B[W]!==void 0&&B[M]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",W,M))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((W)=>{H[W].forEach((M)=>{if(M&&B[Z.Parser.camelCase(W)]!==void 0&&B[Z.Parser.camelCase(M)]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",W,M))})})},Y.recommendCommands=function(B,W){W=W.sort((I,x)=>x.length-I.length);let R=null,L=1/0;for(let I=0,x;(x=W[I])!==void 0;I++){let F=_X(B,x);if(F<=3&&F<L)L=F,R=x}if(R)J.fail(X("Did you mean %s?",R))},Y.reset=function(B){return Q=H1(Q,(W)=>!B[W]),H=H1(H,(W)=>!B[W]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let B=K.pop();T0(B,void 0,Z),{implied:Q,conflicting:H}=B},Y}var s3=[],F$;function P$($,J,Z,X){F$=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=V0.resolve($.extends)}catch(G){return $}else Q=lB(J,$.extends);dB(Q),s3.push(Q),q=Y?JSON.parse(F$.readFileSync(Q,"utf8")):V0($.extends),delete $.extends,q=P$(q,F$.path.dirname(Q),Z,F$)}return s3=[],Z?MX(q,$):Object.assign({},q,$)}function dB($){if(s3.indexOf($)>-1)throw new r(`Circular extended configurations: '${$}'.`)}function lB($,J){return F$.path.resolve($,J)}function MX($,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]=MX($[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($)},Q0,j1,j$,O0,F0,d4,K1,x1,l4,E0,n4,A0,d0,P0,h0,i4,e1,U0,S,o4,t4,j0,I1,$$,w1,B1,a4,y,O1,E1,A1,u,r4,l0,$0;function gX($){return(J=[],Z=$.process.cwd(),X)=>{let q=new uX(J,Z,X,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var CX=Symbol("copyDoubleDash"),FX=Symbol("copyDoubleDash"),e3=Symbol("deleteFromParserHintObject"),PX=Symbol("emitWarning"),jX=Symbol("freeze"),xX=Symbol("getDollarZero"),h1=Symbol("getParserConfiguration"),IX=Symbol("getUsageConfiguration"),$6=Symbol("guessLocale"),wX=Symbol("guessVersion"),OX=Symbol("parsePositionalNumbers"),J6=Symbol("pkgUp"),U1=Symbol("populateParserHintArray"),J$=Symbol("populateParserHintSingleValueDictionary"),Z6=Symbol("populateParserHintArrayDictionary"),X6=Symbol("populateParserHintDictionary"),Q6=Symbol("sanitizeKey"),q6=Symbol("setKey"),Y6=Symbol("unfreeze"),EX=Symbol("validateAsync"),AX=Symbol("getCommandInstance"),hX=Symbol("getContext"),NX=Symbol("getHasOutput"),DX=Symbol("getLoggerInstance"),SX=Symbol("getParseContext"),vX=Symbol("getUsageInstance"),fX=Symbol("getValidationInstance"),s4=Symbol("hasParseCallback"),kX=Symbol("isGlobalContext"),N1=Symbol("postProcess"),bX=Symbol("rebase"),G6=Symbol("reset"),x$=Symbol("runYargsParserAndExecuteCommands"),H6=Symbol("runValidation"),yX=Symbol("setHasOutput"),D1=Symbol("kTrackManuallySetKeys");class uX{constructor($=[],J,Z,X){this.customScriptName=!1,this.parsed=!1,Q0.set(this,void 0),j1.set(this,void 0),j$.set(this,{commands:[],fullCommands:[]}),O0.set(this,null),F0.set(this,null),d4.set(this,"show-hidden"),K1.set(this,null),x1.set(this,!0),l4.set(this,{}),E0.set(this,!0),n4.set(this,[]),A0.set(this,void 0),d0.set(this,{}),P0.set(this,!1),h0.set(this,null),i4.set(this,!0),e1.set(this,void 0),U0.set(this,""),S.set(this,void 0),o4.set(this,void 0),t4.set(this,{}),j0.set(this,null),I1.set(this,null),$$.set(this,{}),w1.set(this,{}),B1.set(this,void 0),a4.set(this,!1),y.set(this,void 0),O1.set(this,!1),E1.set(this,!1),A1.set(this,!1),u.set(this,void 0),r4.set(this,{}),l0.set(this,null),$0.set(this,void 0),h(this,y,X,"f"),h(this,B1,$,"f"),h(this,j1,J,"f"),h(this,o4,Z,"f"),h(this,A0,new t3(this),"f"),this.$0=this[xX](),this[G6](),h(this,Q0,z(this,Q0,"f"),"f"),h(this,u,z(this,u,"f"),"f"),h(this,$0,z(this,$0,"f"),"f"),h(this,S,z(this,S,"f"),"f"),z(this,S,"f").showHiddenOpt=z(this,d4,"f"),h(this,e1,this[FX](),"f")}addHelpOpt($,J){if(A("[string|boolean] [string]",[$,J],arguments.length),z(this,h0,"f"))this[e3](z(this,h0,"f")),h(this,h0,null,"f");if($===!1&&J===void 0)return this;return h(this,h0,typeof $==="string"?$:"help","f"),this.boolean(z(this,h0,"f")),this.describe(z(this,h0,"f"),J||z(this,u,"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,d4,"f");return this.boolean(Z),this.describe(Z,J||z(this,u,"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[Z6](this.alias.bind(this),"alias",$,J),this}array($){return A("<array|string>",[$],arguments.length),this[U1]("array",$),this[D1]($),this}boolean($){return A("<array|string>",[$],arguments.length),this[U1]("boolean",$),this[D1]($),this}check($,J){return A("<function> [boolean]",[$,J],arguments.length),this.middleware((Z,X)=>{return P1(()=>{return $(Z,X.getOptions())},(q)=>{if(!q)z(this,u,"f").fail(z(this,y,"f").y18n.__("Argument check failed: %s",$.toString()));else if(typeof q==="string"||q instanceof Error)z(this,u,"f").fail(q.toString(),q);return Z},(q)=>{return z(this,u,"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[Z6](this.choices.bind(this),"choices",$,J),this}coerce($,J){if(A("<object|string|array> [function]",[$,J],arguments.length),Array.isArray($)){if(!J)throw new r("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 r("coerce callback must be provided");return z(this,S,"f").key[$]=!0,z(this,A0,"f").addCoerceMiddleware((Z,X)=>{let q;if(!Object.prototype.hasOwnProperty.call(Z,$))return Z;return P1(()=>{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 r(Q.message)})},$),this}conflicts($,J){return A("<string|object> [string|array]",[$,J],arguments.length),z(this,$0,"f").conflicts($,J),this}config($="config",J,Z){if(A("[object|string] [string|function] [function]",[$,J,Z],arguments.length),typeof $==="object"&&!Array.isArray($))return $=P$($,z(this,j1,"f"),this[h1]()["deep-merge-config"]||!1,z(this,y,"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,u,"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,F0,$||z(this,F0,"f")||"completion","f"),!J&&J!==!1)J="generate completion script";if(this.command(z(this,F0,"f"),J),Z)z(this,O0,"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,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){A("<string> [object]",[$,J],arguments.length);let Z=z(this,o4,"f")||z(this,y,"f").require;return z(this,Q0,"f").addDirectory($,Z,z(this,y,"f").getCallerFile(),J),this}count($){return A("<array|string>",[$],arguments.length),this[U1]("count",$),this[D1]($),this}default($,J,Z){if(A("<object|string|array> [*] [string]",[$,J,Z],arguments.length),Z)o3($,z(this,y,"f")),z(this,S,"f").defaultDescription[$]=Z;if(typeof J==="function"){if(o3($,z(this,y,"f")),!z(this,S,"f").defaultDescription[$])z(this,S,"f").defaultDescription[$]=z(this,u,"f").functionDescription(J);J=J.call()}return this[J$](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)=>{T0(Z,!0,z(this,y,"f")),this.demandOption(X,Z)}),J=1/0;else if(typeof J!=="number")Z=J,J=1/0;if(typeof $==="number")T0(Z,!0,z(this,y,"f")),this.demandCommand($,J,Z,Z);else if(Array.isArray($))$.forEach((X)=>{T0(Z,!0,z(this,y,"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[J$](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[q6]($,!0),z(this,u,"f").describe($,J),this}detectLocale($){return A("<boolean>",[$],arguments.length),h(this,x1,$,"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,u,"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,u,"f").example($,J);return this}exit($,J){if(h(this,P0,!0,"f"),h(this,K1,J,"f"),z(this,E0,"f"))z(this,y,"f").process.exit($)}exitProcess($=!0){return A("[boolean]",[$],arguments.length),h(this,E0,$,"f"),this}fail($){if(A("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new r("Invalid first argument. Expected function or boolean 'false'");return z(this,u,"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,O0,"f").getCompletion($,(q,Y)=>{if(q)X(q);else Z(Y)})});else return z(this,O0,"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,x1,"f")}getExitProcess(){return z(this,E0,"f")}getGroups(){return Object.assign({},z(this,d0,"f"),z(this,w1,"f"))}getHelp(){if(h(this,P0,!0,"f"),!z(this,u,"f").hasCachedHelpMessage()){if(!this.parsed){let J=this[x$](z(this,B1,"f"),void 0,void 0,0,!0);if(s(J))return J.then(()=>{return z(this,u,"f").help()})}let $=z(this,Q0,"f").runDefaultBuilderOn(this);if(s($))return $.then(()=>{return z(this,u,"f").help()})}return Promise.resolve(z(this,u,"f").help())}getOptions(){return z(this,S,"f")}getStrict(){return z(this,O1,"f")}getStrictCommands(){return z(this,E1,"f")}getStrictOptions(){return z(this,A1,"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,w1,"f")[J]||z(this,d0,"f")[J];if(z(this,w1,"f")[J])delete z(this,w1,"f")[J];let X={};return z(this,d0,"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,$0,"f").implies($,J),this}locale($){if(A("[string]",[$],arguments.length),$===void 0)return this[$6](),z(this,y,"f").y18n.getLocale();return h(this,x1,!1,"f"),z(this,y,"f").y18n.setLocale($),this}middleware($,J,Z){return z(this,A0,"f").addMiddleware($,!!J,Z)}nargs($,J){return A("<string|object|array> [number]",[$,J],arguments.length),this[J$](this.nargs.bind(this),"narg",$,J),this}normalize($){return A("<array|string>",[$],arguments.length),this[U1]("normalize",$),this}number($){return A("<array|string>",[$],arguments.length),this[U1]("number",$),this[D1]($),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[D1]($),z(this,l0,"f")&&($==="version"||(J===null||J===void 0?void 0:J.alias)==="version"))this[PX](['"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(`
|
|
117
|
-
`),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,
|
|
118
|
-
`,"f");
|
|
119
|
-
`,"f");h(this,U0,z(this,U0,"f")+$.join(" "),"f")}}}[e3]($){r1(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,u,"f").getDescriptions()[$]}[PX]($,J,Z){if(!z(this,l4,"f")[Z])z(this,y,"f").process.emitWarning($,J),z(this,l4,"f")[Z]=!0}[jX](){z(this,n4,"f").push({options:z(this,S,"f"),configObjects:z(this,S,"f").configObjects.slice(0),exitProcess:z(this,E0,"f"),groups:z(this,d0,"f"),strict:z(this,O1,"f"),strictCommands:z(this,E1,"f"),strictOptions:z(this,A1,"f"),completionCommand:z(this,F0,"f"),output:z(this,U0,"f"),exitError:z(this,K1,"f"),hasOutput:z(this,P0,"f"),parsed:this.parsed,parseFn:z(this,j0,"f"),parseContext:z(this,I1,"f")}),z(this,u,"f").freeze(),z(this,$0,"f").freeze(),z(this,Q0,"f").freeze(),z(this,A0,"f").freeze()}[xX](){let $="",J;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,y,"f").process.argv()[0]))J=z(this,y,"f").process.argv().slice(1,2);else J=z(this,y,"f").process.argv().slice(0,1);if($=J.map((Z)=>{let X=this[bX](z(this,j1,"f"),Z);return Z.match(/^(\/|([a-zA-Z]:)?\\)/)&&X.length<Z.length?X:Z}).join(" ").trim(),z(this,y,"f").getEnv("_")&&z(this,y,"f").getProcessArgvBin()===z(this,y,"f").getEnv("_"))$=z(this,y,"f").getEnv("_").replace(`${z(this,y,"f").path.dirname(z(this,y,"f").process.execPath())}/`,"");return $}[h1](){return z(this,t4,"f")}[IX](){return z(this,r4,"f")}[$6](){if(!z(this,x1,"f"))return;let $=z(this,y,"f").getEnv("LC_ALL")||z(this,y,"f").getEnv("LC_MESSAGES")||z(this,y,"f").getEnv("LANG")||z(this,y,"f").getEnv("LANGUAGE")||"en_US";this.locale($.replace(/[.:].*/,""))}[wX](){return this[J6]().version||"unknown"}[OX]($){let J=$["--"]?$["--"]:$._;for(let Z=0,X;(X=J[Z])!==void 0;Z++)if(z(this,y,"f").Parser.looksLikeNumber(X)&&Number.isSafeInteger(Math.floor(parseFloat(`${X}`))))J[Z]=Number(X);return $}[J6]($){let J=$||"*";if(z(this,$$,"f")[J])return z(this,$$,"f")[J];let Z={};try{let X=$||z(this,y,"f").mainFilename;if(!$&&z(this,y,"f").path.extname(X))X=z(this,y,"f").path.dirname(X);let q=z(this,y,"f").findUp(X,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});T0(q,void 0,z(this,y,"f")),Z=JSON.parse(z(this,y,"f").readFileSync(q,"utf8"))}catch(X){}return z(this,$$,"f")[J]=Z||{},z(this,$$,"f")[J]}[U1]($,J){J=[].concat(J),J.forEach((Z)=>{Z=this[Q6](Z),z(this,S,"f")[$].push(Z)})}[J$]($,J,Z,X){this[X6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=Q})}[Z6]($,J,Z,X){this[X6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=(z(this,S,"f")[q][Y]||[]).concat(Q)})}[X6]($,J,Z,X,q){if(Array.isArray(Z))Z.forEach((Y)=>{$(Y,X)});else if(((Y)=>typeof Y==="object")(Z))for(let Y of r1(Z))$(Y,Z[Y]);else q(J,this[Q6](Z),X)}[Q6]($){if($==="__proto__")return"___proto___";return $}[q6]($,J){return this[J$](this[q6].bind(this),"key",$,J),this}[Y6](){var $,J,Z,X,q,Y,Q,G,H,K,U,B;let W=z(this,n4,"f").pop();T0(W,void 0,z(this,y,"f"));let M;$=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:M,exitProcess:{set value(R){h(J,E0,R,"f")}}.value,groups:{set value(R){h(Z,d0,R,"f")}}.value,output:{set value(R){h(X,U0,R,"f")}}.value,exitError:{set value(R){h(q,K1,R,"f")}}.value,hasOutput:{set value(R){h(Y,P0,R,"f")}}.value,parsed:this.parsed,strict:{set value(R){h(Q,O1,R,"f")}}.value,strictCommands:{set value(R){h(G,E1,R,"f")}}.value,strictOptions:{set value(R){h(H,A1,R,"f")}}.value,completionCommand:{set value(R){h(K,F0,R,"f")}}.value,parseFn:{set value(R){h(U,j0,R,"f")}}.value,parseContext:{set value(R){h(B,I1,R,"f")}}.value}=W,z(this,S,"f").configObjects=M,z(this,u,"f").unfreeze(),z(this,$0,"f").unfreeze(),z(this,Q0,"f").unfreeze(),z(this,A0,"f").unfreeze()}[EX]($,J){return P1(J,(Z)=>{return $(Z),Z})}getInternalMethods(){return{getCommandInstance:this[AX].bind(this),getContext:this[hX].bind(this),getHasOutput:this[NX].bind(this),getLoggerInstance:this[DX].bind(this),getParseContext:this[SX].bind(this),getParserConfiguration:this[h1].bind(this),getUsageConfiguration:this[IX].bind(this),getUsageInstance:this[vX].bind(this),getValidationInstance:this[fX].bind(this),hasParseCallback:this[s4].bind(this),isGlobalContext:this[kX].bind(this),postProcess:this[N1].bind(this),reset:this[G6].bind(this),runValidation:this[H6].bind(this),runYargsParserAndExecuteCommands:this[x$].bind(this),setHasOutput:this[yX].bind(this)}}[AX](){return z(this,Q0,"f")}[hX](){return z(this,j$,"f")}[NX](){return z(this,P0,"f")}[DX](){return z(this,e1,"f")}[SX](){return z(this,I1,"f")||{}}[vX](){return z(this,u,"f")}[fX](){return z(this,$0,"f")}[s4](){return!!z(this,j0,"f")}[kX](){return z(this,i4,"f")}[N1]($,J,Z,X){if(Z)return $;if(s($))return $;if(!J)$=this[CX]($);if(this[h1]()["parse-positional-numbers"]||this[h1]()["parse-positional-numbers"]===void 0)$=this[OX]($);if(X)$=F1($,this,z(this,A0,"f").getMiddleware(),!1);return $}[G6]($={}){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,w1,"f"),Object.keys(z(this,d0,"f")).reduce((Y,Q)=>{let G=z(this,d0,"f")[Q].filter((H)=>!(H in Z));if(G.length>0)Y[Q]=G;return Y},{})),h(this,d0,{},"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]=H1(z(this,S,"f")[Y],(Q)=>!Z[Q])}),J.envPrefix=z(this,S,"f").envPrefix,h(this,S,J,"f"),h(this,u,z(this,u,"f")?z(this,u,"f").reset(Z):BX(this,z(this,y,"f")),"f"),h(this,$0,z(this,$0,"f")?z(this,$0,"f").reset(Z):TX(this,z(this,u,"f"),z(this,y,"f")),"f"),h(this,Q0,z(this,Q0,"f")?z(this,Q0,"f").reset():HX(z(this,u,"f"),z(this,$0,"f"),z(this,A0,"f"),z(this,y,"f")),"f"),!z(this,O0,"f"))h(this,O0,LX(this,z(this,u,"f"),z(this,Q0,"f"),z(this,y,"f")),"f");return z(this,A0,"f").reset(),h(this,F0,null,"f"),h(this,U0,"","f"),h(this,K1,null,"f"),h(this,P0,!1,"f"),this.parsed=!1,this}[bX]($,J){return z(this,y,"f").path.relative($,J)}[x$]($,J,Z,X=0,q=!1){let Y=!!Z||q;$=$||z(this,B1,"f"),z(this,S,"f").__=z(this,y,"f").y18n.__,z(this,S,"f").configuration=this[h1]();let Q=!!z(this,S,"f").configuration["populate--"],G=Object.assign({},z(this,S,"f").configuration,{"populate--":!0}),H=z(this,y,"f").Parser.detailed($,Object.assign({},z(this,S,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),K=Object.assign(H.argv,z(this,I1,"f")),U=void 0,B=H.aliases,W=!1,M=!1;if(Object.keys(K).forEach((R)=>{if(R===z(this,h0,"f")&&K[R])W=!0;else if(R===z(this,l0,"f")&&K[R])M=!0}),K.$0=this.$0,this.parsed=H,X===0)z(this,u,"f").clearCachedHelpMessage();try{if(this[$6](),J)return this[N1](K,Q,!!Z,!1);if(z(this,h0,"f")){if([z(this,h0,"f")].concat(B[z(this,h0,"f")]||[]).filter((F)=>F.length>1).includes(""+K._[K._.length-1]))K._.pop(),W=!0}h(this,i4,!1,"f");let R=z(this,Q0,"f").getCommands(),L=z(this,O0,"f").completionKey in K,I=W||L||q;if(K._.length){if(R.length){let x;for(let F=X||0,v;K._[F]!==void 0;F++)if(v=String(K._[F]),R.includes(v)&&v!==z(this,F0,"f")){let j=z(this,Q0,"f").runCommand(v,this,H,F+1,q,W||M||q);return this[N1](j,Q,!!Z,!1)}else if(!x&&v!==z(this,F0,"f")){x=v;break}if(!z(this,Q0,"f").hasDefaultCommand()&&z(this,a4,"f")&&x&&!I)z(this,$0,"f").recommendCommands(x,R)}if(z(this,F0,"f")&&K._.includes(z(this,F0,"f"))&&!L){if(z(this,E0,"f"))z1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,Q0,"f").hasDefaultCommand()&&!I){let x=z(this,Q0,"f").runCommand(null,this,H,0,q,W||M||q);return this[N1](x,Q,!!Z,!1)}if(L){if(z(this,E0,"f"))z1(!0);$=[].concat($);let x=$.slice($.indexOf(`--${z(this,O0,"f").completionKey}`)+1);return z(this,O0,"f").getCompletion(x,(F,v)=>{if(F)throw new r(F.message);(v||[]).forEach((j)=>{z(this,e1,"f").log(j)}),this.exit(0)}),this[N1](K,!Q,!!Z,!1)}if(!z(this,P0,"f")){if(W){if(z(this,E0,"f"))z1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(M){if(z(this,E0,"f"))z1(!0);Y=!0,z(this,u,"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 r(H.error.message);if(!L){let x=this[H6](B,{},H.error);if(!Z)U=F1(K,this,z(this,A0,"f").getMiddleware(),!0);if(U=this[EX](x,U!==null&&U!==void 0?U:K),s(U)&&!Z)U=U.then(()=>{return F1(K,this,z(this,A0,"f").getMiddleware(),!1)})}}}catch(R){if(R instanceof r)z(this,u,"f").fail(R.message,R);else throw R}return this[N1](U!==null&&U!==void 0?U:K,Q,!!Z,!0)}[H6]($,J,Z,X){let q={...this.getDemandedOptions()};return(Y)=>{if(Z)throw new r(Z.message);z(this,$0,"f").nonOptionCount(Y),z(this,$0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,E1,"f"))Q=z(this,$0,"f").unknownCommands(Y);if(z(this,O1,"f")&&!Q)z(this,$0,"f").unknownArguments(Y,$,J,!!X);else if(z(this,A1,"f"))z(this,$0,"f").unknownArguments(Y,$,{},!1,!1);z(this,$0,"f").limitedChoices(Y),z(this,$0,"f").implications(Y),z(this,$0,"f").conflicting(Y)}}[yX](){h(this,P0,!0,"f")}[D1]($){if(typeof $==="string")z(this,S,"f").key[$]=!0;else for(let J of $)z(this,S,"f").key[J]=!0}}function zX($){return!!$&&typeof $.getInternalMethods==="function"}var nB=gX(i3),mX=nB;import{existsSync as n0,readFileSync as I$,rmSync as S1,writeFileSync as dX,readdirSync as z6,copyFileSync as J2,mkdirSync as w$}from"fs";import{resolve as b0,dirname as B6,join as N0}from"path";import{fileURLToPath as iB}from"url";var cX=mX(n3(process.argv)).option("h",{alias:"help",type:"boolean"}).option("v",{alias:"version",type:"boolean"}).parseSync(),oB="https://github.com/ardzero/bunext.git",tB="https://github.com/ardzero/",e4=".bunext-upgrade-temp",aB=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],rB=[".git","public","src/lib/data/siteData.ts"];var sB="loading-dots",eB="favicon.svg",$U="ogImage.jpg";function JU(){try{let $=iB(import.meta.url),J=B6($),Z=N0(J,"../package.json");return JSON.parse(I$(Z,"utf-8")).version}catch{return"0.1.0"}}function ZU($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function XU($,J){let Z=ZU(J),X=`${tB}${Z}`,q=b0($,"project_readme.md"),Y=b0($,"README.md");if(!n0(q))return;let Q=I$(q,"utf-8");Q=Q.replace(/\?\{project-name\}/g,J).replace(/\?\{repo-link\}/g,X),dX(Y,Q),S1(q,{force:!0})}function QU($){for(let J of rB){let Z=b0($,J);if(!n0(Z))return{ok:!1,missing:J}}return{ok:!0}}function pX($){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 qU($){let J=$.match(/favicon:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function YU($){let J=$.match(/ogImage:\s*\{\s*src:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function K6($,J,Z=!1){let X=z6($,{withFileTypes:!0});for(let q of X){if(Z&&q.name===".git")continue;let Y=N0($,q.name),Q=N0(J,q.name);if(q.isDirectory())w$(Q,{recursive:!0}),K6(Y,Q,!1);else w$(B6(Q),{recursive:!0}),J2(Y,Q)}}async function GU(){if(cX.v)console.log(JU()),process.exit(0);if(cX.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=QU($);if(!J.ok)p0.error(`This isn't a valid Bunext project (missing: ${J.missing}).`),process.exit(1);console.clear(),vZ($2.default.bgCyan($2.default.black(" bunextupgrade ")));let Z=kZ();Z.start("Cloning latest Bunext template");try{await PZ("git",["clone","--depth","1",oB,e4],{cwd:$}),Z.stop("Template cloned")}catch(F){Z.stop("Failed to clone");let v=F instanceof Error?F.message:String(F);p0.error(v.includes("already exists")?`Directory "${e4}" already exists. Remove it and try again.`:v),process.exit(1)}let X=b0($,e4);Z.start("Cleaning template");let q=b0(X,".git");if(n0(q))S1(q,{recursive:!0,force:!0});for(let F of aB){let v=b0(X,F);if(n0(v))S1(v,{recursive:!0,force:!0})}let Y="my-app";try{let F=b0($,"package.json");if(n0(F)){let v=JSON.parse(I$(F,"utf-8"));if(typeof v.name==="string")Y=v.name}}catch{}XU(X,Y),Z.stop("Template cleaned");let Q=b0($,"public"),G=b0(X,"public"),H=b0($,"src/lib/data/siteData.ts"),K=b0(X,"src/lib/data/siteData.ts"),U=I$(H,"utf-8"),B=qU(U),W=YU(U);Z.start("Preserving your public assets and site data"),w$(G,{recursive:!0});let M=z6(Q,{withFileTypes:!0});for(let F of M){if(F.name.startsWith(sB))continue;let v=N0(Q,F.name),j=N0(G,F.name);if(F.isDirectory())w$(j,{recursive:!0}),K6(v,j,!1);else w$(B6(j),{recursive:!0}),J2(v,j)}let R=B?N0(Q,B.replace(/^\//,"")):null;if(R&&n0(R)){if(J2(R,N0(G,B.replace(/^\//,""))),B!=="/favicon.svg"){let F=N0(G,eB);if(n0(F))S1(F,{force:!0})}}let L=W?N0(Q,W.replace(/^\//,"")):null;if(L&&n0(L)){if(J2(L,N0(G,W.replace(/^\//,""))),W!=="/ogImage.jpg"){let F=N0(G,$U);if(n0(F))S1(F,{force:!0})}}let I=pX(U);if(I&&n0(K)){let F=I$(K,"utf-8"),v=pX(F);if(v){let j=F.slice(0,v.start)+I.block+F.slice(v.end);dX(K,j)}}Z.stop("Preserved public assets and site data"),Z.start("Replacing project with upgraded files");let x=z6($,{withFileTypes:!0});for(let F of x){if(F.name===".git"||F.name===e4)continue;let v=N0($,F.name);S1(v,{recursive:!0,force:!0})}K6(X,$,!1),S1(X,{recursive:!0,force:!0}),Z.stop("Upgrade complete"),fZ($2.default.green("Project upgraded successfully."))}GU().catch(($)=>{p0.error($ instanceof Error?$.message:String($)),process.exit(1)});
|
|
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 x;let j=$.getInternalMethods().getCommandInstance().getCommands(),h=[],c=$.getInternalMethods().getContext();if(Object.keys(B).forEach((F)=>{if(!oX.includes(F)&&!Object.prototype.hasOwnProperty.call(_,F)&&!Object.prototype.hasOwnProperty.call($.getInternalMethods().getParseContext(),F)&&!Y.isValidAndSomeAliasIsNotNew(F,W))h.push(F)}),L&&(c.commands.length>0||j.length>0||R))B._.slice(c.commands.length).forEach((F)=>{if(!j.includes(""+F))h.push(""+F)});if(L){let y=((x=$.getDemandedCommands()._)===null||x===void 0?void 0:x.max)||0,l=c.commands.length+y;if(l<B._.length)B._.slice(l).forEach((t)=>{if(t=String(t),!c.commands.includes(t)&&!h.includes(t))h.push(t)})}if(h.length)J.fail(q("Unknown argument: %s","Unknown arguments: %s",h.length,h.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((x)=>{if(oX.indexOf(x)===-1&&Object.prototype.hasOwnProperty.call(W.choices,x))[].concat(B[x]).forEach((j)=>{if(W.choices[x].indexOf(j)===-1&&j!==void 0)_[x]=(_[x]||[]).concat(j)})});let R=Object.keys(_);if(!R.length)return;let L=X("Invalid values:");R.forEach((x)=>{L+=`
|
|
144
|
+
${X("Argument: %s, Given: %s, Choices: %s",x,J.stringifiedValues(_[x]),J.stringifiedValues(W.choices[x]))}`}),J.fail(L)};let Q={};Y.implies=function(B,W){if(E("<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 C0(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 x=R,j=L;if(x=G(B,x),L=G(B,L),x&&!L)W.push(` ${R} -> ${j}`)})}),W.length){let _=`${X("Implications failed:")}
|
|
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(E("[string|array] [function|boolean|object] [function]",[$,J,Z],arguments.length),this[$Q](),typeof $>"u")$=z(this,V1,"f");if(typeof J==="object")A(this,E1,J,"f"),J=Z;if(typeof J==="function")A(this,w0,J,"f"),J=!1;if(!J)A(this,V1,$,"f");if(z(this,w0,"f"))A(this,N0,!1,"f");let X=this[E$]($,!!J),q=this.parsed;if(z(this,h0,"f").setParsed(this.parsed),e(X))return X.then((Y)=>{if(z(this,w0,"f"))z(this,w0,"f").call(this,z(this,W1,"f"),Y,z(this,W0,"f"));return Y}).catch((Y)=>{if(z(this,w0,"f"))z(this,w0,"f")(Y,this.parsed.argv,z(this,W0,"f"));throw Y}).finally(()=>{this[j6](),this.parsed=q});else{if(z(this,w0,"f"))z(this,w0,"f").call(this,z(this,W1,"f"),X,z(this,W0,"f"));this[j6](),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 E("<object>",[$],arguments.length),A(this,X2,$,"f"),this}pkgConf($,J){E("<string> [string]",[$,J],arguments.length);let Z=null,X=this[T6](J||z(this,w1,"f"));if(X[$]&&typeof X[$]==="object")Z=w$(X[$],J||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(Z);return this}positional($,J){E("<string> <object>",[$,J],arguments.length);let Z=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];J=B1(J,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return Z.includes(Y)});let X=z(this,O$,"f").fullCommands[z(this,O$,"f").fullCommands.length-1],q=X?z(this,q0,"f").cmdToParseOptions(X):{array:[],alias:{},default:{},demand:{}};return $$(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 E("[boolean]",[$],arguments.length),A(this,Q2,$,"f"),this}required($,J,Z){return this.demand($,J,Z)}require($,J,Z){return this.demand($,J,Z)}requiresArg($){if(E("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,S,"f").narg[$])return this;else this[Q$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,J){return E("[string] [string]",[$,J],arguments.length),$=$||this.$0,z(this,Z$,"f").log(z(this,h0,"f").generateCompletionScript($,J||z(this,x0,"f")||"completion")),this}showHelp($){if(E("[string|function]",[$],arguments.length),A(this,I0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let Z=this[E$](z(this,V1,"f"),void 0,void 0,0,!0);if(e(Z))return Z.then(()=>{z(this,m,"f").showHelp($)}),this}let J=z(this,q0,"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 E("[boolean|string] [string]",[$,J],arguments.length),z(this,m,"f").showHelpOnFail($,J),this}showVersion($){return E("[string|function]",[$],arguments.length),z(this,m,"f").showVersion($),this}skipValidation($){return E("<array|string>",[$],arguments.length),this[L1]("skipValidation",$),this}strict($){return E("[boolean]",[$],arguments.length),A(this,h1,$!==!1,"f"),this}strictCommands($){return E("[boolean]",[$],arguments.length),A(this,N1,$!==!1,"f"),this}strictOptions($){return E("[boolean]",[$],arguments.length),A(this,D1,$!==!1,"f"),this}string($){return E("<array|string>",[$],arguments.length),this[L1]("string",$),this[f1]($),this}terminalWidth(){return E([],0),z(this,g,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return E("<object>",[$],arguments.length),A(this,O1,!1,"f"),z(this,g,"f").y18n.updateLocale($),this}usage($,J,Z,X){if(E("<string|null|undefined> [string|boolean] [function|object] [function]",[$,J,Z,X],arguments.length),J!==void 0)if(C0($,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 E("<object>",[$],arguments.length),A(this,q2,$,"f"),this}version($,J,Z){if(E("[boolean|string] [string] [string]",[$,J,Z],arguments.length),z(this,o0,"f"))this[_6](z(this,o0,"f")),z(this,m,"f").version(void 0),A(this,o0,null,"f");if(arguments.length===0)Z=this[XQ](),$="version";else if(arguments.length===1){if($===!1)return this;Z=$,$="version"}else if(arguments.length===2)Z=J,J=void 0;return A(this,o0,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,o0,"f")),this.describe(z(this,o0,"f"),J),this}wrap($){return E("<number|null|undefined>",[$],arguments.length),z(this,m,"f").wrap($),this}[(q0=new WeakMap,w1=new WeakMap,O$=new WeakMap,h0=new WeakMap,x0=new WeakMap,s4=new WeakMap,W1=new WeakMap,O1=new WeakMap,e4=new WeakMap,N0=new WeakMap,$2=new WeakMap,D0=new WeakMap,i0=new WeakMap,I0=new WeakMap,S0=new WeakMap,J2=new WeakMap,Z$=new WeakMap,W0=new WeakMap,S=new WeakMap,Z2=new WeakMap,X2=new WeakMap,w0=new WeakMap,E1=new WeakMap,X$=new WeakMap,A1=new WeakMap,V1=new WeakMap,Q2=new WeakMap,g=new WeakMap,h1=new WeakMap,N1=new WeakMap,D1=new WeakMap,m=new WeakMap,q2=new WeakMap,o0=new WeakMap,J0=new WeakMap,rX)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(J){}return $}[sX](){return{log:(...$)=>{if(!this[Y2]())console.log(...$);if(A(this,I0,!0,"f"),z(this,W0,"f").length)A(this,W0,z(this,W0,"f")+`
|
|
147
|
+
`,"f");A(this,W0,z(this,W0,"f")+$.join(" "),"f")},error:(...$)=>{if(!this[Y2]())console.error(...$);if(A(this,I0,!0,"f"),z(this,W0,"f").length)A(this,W0,z(this,W0,"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)});
|
|
120
149
|
|
|
121
|
-
//# debugId=
|
|
150
|
+
//# debugId=322EE590B344A83564756E2164756E21
|