bunextupgrade 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +89 -86
- package/dist/cli.js.map +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as SQ}from"node:module";var wQ=Object.create;var{getPrototypeOf:EQ,defineProperty:y6,getOwnPropertyNames:AQ}=Object;var hQ=Object.prototype.hasOwnProperty;function NQ($){return this[$]}var DQ,vQ,g1=($,J,Z)=>{var X=$!=null&&typeof $==="object";if(X){var q=J?DQ??=new WeakMap:vQ??=new WeakMap,Y=q.get($);if(Y)return Y}Z=$!=null?wQ(EQ($)):{};let Q=J||!$||!$.__esModule?y6(Z,"default",{value:$,enumerable:!0}):Z;for(let G of AQ($))if(!hQ.call(Q,G))y6(Q,G,{get:NQ.bind($,G),enumerable:!0});if(X)q.set($,Q);return Q};var C0=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var _0=SQ(import.meta.url);var _7=C0((cV,L7)=>{L7.exports=V7;V7.sync=fq;var U7=_0("fs");function Sq($,J){var Z=J.pathExt!==void 0?J.pathExt:process.env.PATHEXT;if(!Z)return!0;if(Z=Z.split(";"),Z.indexOf("")!==-1)return!0;for(var X=0;X<Z.length;X++){var q=Z[X].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function W7($,J,Z){if(!$.isSymbolicLink()&&!$.isFile())return!1;return Sq(J,Z)}function V7($,J,Z){U7.stat($,function(X,q){Z(X,X?!1:W7(q,$,J))})}function fq($,J){return W7(U7.statSync($),$,J)}});var F7=C0((pV,C7)=>{C7.exports=T7;T7.sync=kq;var R7=_0("fs");function T7($,J,Z){R7.stat($,function(X,q){Z(X,X?!1:M7(q,J))})}function kq($,J){return M7(R7.statSync($),J)}function M7($,J){return $.isFile()&&bq($,J)}function bq($,J){var{mode:Z,uid:X,gid:q}=$,Y=J.uid!==void 0?J.uid:process.getuid&&process.getuid(),Q=J.gid!==void 0?J.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),K=parseInt("001",8),U=G|H,B=Z&K||Z&H&&q===Q||Z&G&&X===Y||Z&U&&Y===0;return B}});var x7=C0((lV,j7)=>{var dV=_0("fs"),t$;if(process.platform==="win32"||global.TESTING_WINDOWS)t$=_7();else t$=F7();j7.exports=I2;I2.sync=yq;function I2($,J,Z){if(typeof J==="function")Z=J,J={};if(!Z){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(X,q){I2($,J||{},function(Y,Q){if(Y)q(Y);else X(Q)})})}t$($,J||{},function(X,q){if(X){if(X.code==="EACCES"||J&&J.ignoreErrors)X=null,q=!1}Z(X,q)})}function yq($,J){try{return t$.sync($,J||{})}catch(Z){if(J&&J.ignoreErrors||Z.code==="EACCES")return!1;else throw Z}}});var h7=C0((nV,A7)=>{var p1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",P7=_0("path"),gq=p1?";":":",I7=x7(),O7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),w7=($,J)=>{let Z=J.colon||gq,X=$.match(/\//)||p1&&$.match(/\\/)?[""]:[...p1?[process.cwd()]:[],...(J.path||process.env.PATH||"").split(Z)],q=p1?J.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=p1?q.split(Z):[""];if(p1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:X,pathExt:Y,pathExtExe:q}},E7=($,J,Z)=>{if(typeof J==="function")Z=J,J={};if(!J)J={};let{pathEnv:X,pathExt:q,pathExtExe:Y}=w7($,J),Q=[],G=(K)=>new Promise((U,B)=>{if(K===X.length)return J.all&&Q.length?U(Q):B(O7($));let W=X[K],_=/^".*"$/.test(W)?W.slice(1,-1):W,R=P7.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];I7(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)},uq=($,J)=>{J=J||{};let{pathEnv:Z,pathExt:X,pathExtExe:q}=w7($,J),Y=[];for(let Q=0;Q<Z.length;Q++){let G=Z[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=P7.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(I7.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 O7($)};A7.exports=E7;E7.sync=uq});var D7=C0((iV,O2)=>{var N7=($={})=>{let J=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(J).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"};O2.exports=N7;O2.exports.default=N7});var k7=C0((oV,f7)=>{var v7=_0("path"),mq=h7(),cq=D7();function S7($,J){let Z=$.options.env||process.env,X=process.cwd(),q=$.options.cwd!=null,Y=q&&process.chdir!==void 0&&!process.chdir.disabled;if(Y)try{process.chdir($.options.cwd)}catch(G){}let Q;try{Q=mq.sync($.command,{path:Z[cq({env:Z})],pathExt:J?v7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(X)}if(Q)Q=v7.resolve(q?$.options.cwd:"",Q);return Q}function pq($){return S7($)||S7($,!0)}f7.exports=pq});var b7=C0((nq,E2)=>{var w2=/([()\][%!^"`<>&|;, *?])/g;function dq($){return $=$.replace(w2,"^$1"),$}function lq($,J){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(w2,"^$1"),J)$=$.replace(w2,"^$1");return $}nq.command=dq;nq.argument=lq});var g7=C0((tV,y7)=>{y7.exports=/^#!(.*)/});var m7=C0((aV,u7)=>{var tq=g7();u7.exports=($="")=>{let J=$.match(tq);if(!J)return null;let[Z,X]=J[0].replace(/#! ?/,"").split(" "),q=Z.split("/").pop();if(q==="env")return X;return X?`${q} ${X}`:q}});var p7=C0((rV,c7)=>{var A2=_0("fs"),aq=m7();function rq($){let Z=Buffer.alloc(150),X;try{X=A2.openSync($,"r"),A2.readSync(X,Z,0,150,0),A2.closeSync(X)}catch(q){}return aq(Z.toString())}c7.exports=rq});var i7=C0((sV,n7)=>{var sq=_0("path"),d7=k7(),l7=b7(),eq=p7(),$9=process.platform==="win32",J9=/\.(?:com|exe)$/i,Z9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function X9($){$.file=d7($);let J=$.file&&eq($.file);if(J)return $.args.unshift($.file),$.command=J,d7($);return $.file}function Q9($){if(!$9)return $;let J=X9($),Z=!J9.test(J);if($.options.forceShell||Z){let X=Z9.test(J);$.command=sq.normalize($.command),$.command=l7.command($.command),$.args=$.args.map((Y)=>l7.argument(Y,X));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function q9($,J,Z){if(J&&!Array.isArray(J))Z=J,J=null;J=J?J.slice(0):[],Z=Object.assign({},Z);let X={command:$,args:J,options:Z,file:void 0,original:{command:$,args:J}};return Z.shell?X:Q9(X)}n7.exports=q9});var a7=C0((eV,t7)=>{var h2=process.platform==="win32";function N2($,J){return Object.assign(Error(`${J} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${J} ${$.command}`,path:$.command,spawnargs:$.args})}function Y9($,J){if(!h2)return;let Z=$.emit;$.emit=function(X,q){if(X==="exit"){let Y=o7(q,J);if(Y)return Z.call($,"error",Y)}return Z.apply($,arguments)}}function o7($,J){if(h2&&$===1&&!J.file)return N2(J.original,"spawn");return null}function G9($,J){if(h2&&$===1&&!J.file)return N2(J.original,"spawnSync");return null}t7.exports={hookChildProcess:Y9,verifyENOENT:o7,verifyENOENTSync:G9,notFoundError:N2}});var e7=C0(($L,d1)=>{var r7=_0("child_process"),D2=i7(),v2=a7();function s7($,J,Z){let X=D2($,J,Z),q=r7.spawn(X.command,X.args,X.options);return v2.hookChildProcess(q,X),q}function H9($,J,Z){let X=D2($,J,Z),q=r7.spawnSync(X.command,X.args,X.options);return q.error=q.error||v2.verifyENOENTSync(q.status,X),q}d1.exports=s7;d1.exports.spawn=s7;d1.exports.sync=H9;d1.exports._parse=D2;d1.exports._enoent=v2});var l3=C0((HP,iZ)=>{var d3={to($,J){if(!J)return`\x1B[${$+1}G`;return`\x1B[${J+1};${$+1}H`},move($,J){let Z="";if($<0)Z+=`\x1B[${-$}D`;else if($>0)Z+=`\x1B[${$}C`;if(J<0)Z+=`\x1B[${-J}A`;else if(J>0)Z+=`\x1B[${J}B`;return Z},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},zB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},KB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let J="";for(let Z=0;Z<$;Z++)J+=this.line+(Z<$-1?d3.up():"");if($)J+=d3.left;return J}};iZ.exports={cursor:d3,scroll:zB,erase:KB,beep:"\x07"}});var t4=C0((zP,n3)=>{var o4=process||{},oZ=o4.argv||[],i4=o4.env||{},BB=!(!!i4.NO_COLOR||oZ.includes("--no-color"))&&(!!i4.FORCE_COLOR||oZ.includes("--color")||o4.platform==="win32"||(o4.stdout||{}).isTTY&&i4.TERM!=="dumb"||!!i4.CI),UB=($,J,Z=$)=>(X)=>{let q=""+X,Y=q.indexOf(J,$.length);return~Y?$+WB(q,J,Z,Y)+J:$+q+J},WB=($,J,Z,X)=>{let q="",Y=0;do q+=$.substring(Y,X)+Z,Y=X+J.length,X=$.indexOf(J,Y);while(~X);return q+$.substring(Y)},tZ=($=BB)=>{let J=$?UB:()=>String;return{isColorSupported:$,reset:J("\x1B[0m","\x1B[0m"),bold:J("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:J("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:J("\x1B[3m","\x1B[23m"),underline:J("\x1B[4m","\x1B[24m"),inverse:J("\x1B[7m","\x1B[27m"),hidden:J("\x1B[8m","\x1B[28m"),strikethrough:J("\x1B[9m","\x1B[29m"),black:J("\x1B[30m","\x1B[39m"),red:J("\x1B[31m","\x1B[39m"),green:J("\x1B[32m","\x1B[39m"),yellow:J("\x1B[33m","\x1B[39m"),blue:J("\x1B[34m","\x1B[39m"),magenta:J("\x1B[35m","\x1B[39m"),cyan:J("\x1B[36m","\x1B[39m"),white:J("\x1B[37m","\x1B[39m"),gray:J("\x1B[90m","\x1B[39m"),bgBlack:J("\x1B[40m","\x1B[49m"),bgRed:J("\x1B[41m","\x1B[49m"),bgGreen:J("\x1B[42m","\x1B[49m"),bgYellow:J("\x1B[43m","\x1B[49m"),bgBlue:J("\x1B[44m","\x1B[49m"),bgMagenta:J("\x1B[45m","\x1B[49m"),bgCyan:J("\x1B[46m","\x1B[49m"),bgWhite:J("\x1B[47m","\x1B[49m"),blackBright:J("\x1B[90m","\x1B[39m"),redBright:J("\x1B[91m","\x1B[39m"),greenBright:J("\x1B[92m","\x1B[39m"),yellowBright:J("\x1B[93m","\x1B[39m"),blueBright:J("\x1B[94m","\x1B[39m"),magentaBright:J("\x1B[95m","\x1B[39m"),cyanBright:J("\x1B[96m","\x1B[39m"),whiteBright:J("\x1B[97m","\x1B[39m"),bgBlackBright:J("\x1B[100m","\x1B[49m"),bgRedBright:J("\x1B[101m","\x1B[49m"),bgGreenBright:J("\x1B[102m","\x1B[49m"),bgYellowBright:J("\x1B[103m","\x1B[49m"),bgBlueBright:J("\x1B[104m","\x1B[49m"),bgMagentaBright:J("\x1B[105m","\x1B[49m"),bgCyanBright:J("\x1B[106m","\x1B[49m"),bgWhiteBright:J("\x1B[107m","\x1B[49m")}};n3.exports=tZ();n3.exports.createColors=tZ});function Q0($){if(typeof $!=="object"||$===null)return!1;let J=Object.getPrototypeOf($);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as fQ}from"node:url";var u1=($,J)=>{let Z=_2(kQ($));if(typeof Z!=="string")throw TypeError(`${J} must be a string or a file URL: ${Z}.`);return Z},kQ=($)=>L2($)?$.toString():$,L2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,_2=($)=>$ instanceof URL?fQ($):$;var b$=($,J=[],Z={})=>{let X=u1($,"First argument"),[q,Y]=Q0(J)?[[],J]:[J,Z];if(!Array.isArray(q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${q}`);if(q.some((H)=>typeof H==="object"&&H!==null))throw TypeError(`Second argument must be an array of strings: ${q}`);let Q=q.map(String),G=Q.find((H)=>H.includes("\x00"));if(G!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${G}`);if(!Q0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[X,Q,Y]};import{ChildProcess as pQ}from"node:child_process";import{StringDecoder as bQ}from"node:string_decoder";var{toString:g6}=Object.prototype,u6=($)=>g6.call($)==="[object ArrayBuffer]",B0=($)=>g6.call($)==="[object Uint8Array]",e0=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),yQ=new TextEncoder,m6=($)=>yQ.encode($),gQ=new TextDecoder,y$=($)=>gQ.decode($),c6=($,J)=>{return uQ($,J).join("")},uQ=($,J)=>{if(J==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let Z=new bQ(J),X=$.map((Y)=>typeof Y==="string"?m6(Y):Y).map((Y)=>Z.write(Y)),q=Z.end();return q===""?X:[...X,q]},B$=($)=>{if($.length===1&&B0($[0]))return $[0];return R2(mQ($))},mQ=($)=>$.map((J)=>typeof J==="string"?m6(J):J),R2=($)=>{let J=new Uint8Array(cQ($)),Z=0;for(let X of $)J.set(X,Z),Z+=X.length;return J},cQ=($)=>{let J=0;for(let Z of $)J+=Z.length;return J};var n6=($)=>Array.isArray($)&&Array.isArray($.raw),i6=($,J)=>{let Z=[];for(let[Y,Q]of $.entries())Z=dQ({templates:$,expressions:J,tokens:Z,index:Y,template:Q});if(Z.length===0)throw TypeError("Template script must not be empty");let[X,...q]=Z;return[X,q,{}]},dQ=({templates:$,expressions:J,tokens:Z,index:X,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[X]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=lQ(q,$.raw[X]),H=d6(Z,Y,Q);if(X===J.length)return H;let K=J[X],U=Array.isArray(K)?K.map((B)=>l6(B)):[l6(K)];return d6(H,U,G)},lQ=($,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let Z=[],X=0,q=p6.has(J[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=J[G];if(p6.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 yQ}from"node:module";var hQ=Object.create;var{getPrototypeOf:DQ,defineProperty:m6,getOwnPropertyNames:vQ}=Object;var SQ=Object.prototype.hasOwnProperty;function fQ($){return this[$]}var kQ,bQ,p1=($,J,Z)=>{var X=$!=null&&typeof $==="object";if(X){var q=J?kQ??=new WeakMap:bQ??=new WeakMap,Y=q.get($);if(Y)return Y}Z=$!=null?hQ(DQ($)):{};let Q=J||!$||!$.__esModule?m6(Z,"default",{value:$,enumerable:!0}):Z;for(let G of vQ($))if(!SQ.call(Q,G))m6(Q,G,{get:fQ.bind($,G),enumerable:!0});if(X)q.set($,Q);return Q};var j0=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var M0=yQ(import.meta.url);var M7=j0((nV,T7)=>{T7.exports=R7;R7.sync=gq;var L7=M0("fs");function yq($,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 _7($,J,Z){if(!$.isSymbolicLink()&&!$.isFile())return!1;return yq(J,Z)}function R7($,J,Z){L7.stat($,function(X,q){Z(X,X?!1:_7(q,$,J))})}function gq($,J){return _7(L7.statSync($),$,J)}});var P7=j0((iV,x7)=>{x7.exports=F7;F7.sync=uq;var C7=M0("fs");function F7($,J,Z){C7.stat($,function(X,q){Z(X,X?!1:j7(q,J))})}function uq($,J){return j7(C7.statSync($),J)}function j7($,J){return $.isFile()&&mq($,J)}function mq($,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),W=G|H,B=Z&K||Z&H&&q===Q||Z&G&&X===Y||Z&W&&Y===0;return B}});var O7=j0((tV,I7)=>{var oV=M0("fs"),a$;if(process.platform==="win32"||global.TESTING_WINDOWS)a$=M7();else a$=P7();I7.exports=N2;N2.sync=cq;function N2($,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){N2($,J||{},function(Y,Q){if(Y)q(Y);else X(Q)})})}a$($,J||{},function(X,q){if(X){if(X.code==="EACCES"||J&&J.ignoreErrors)X=null,q=!1}Z(X,q)})}function cq($,J){try{return a$.sync($,J||{})}catch(Z){if(J&&J.ignoreErrors||Z.code==="EACCES")return!1;else throw Z}}});var v7=j0((aV,D7)=>{var i1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",w7=M0("path"),pq=i1?";":":",E7=O7(),A7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),N7=($,J)=>{let Z=J.colon||pq,X=$.match(/\//)||i1&&$.match(/\\/)?[""]:[...i1?[process.cwd()]:[],...(J.path||process.env.PATH||"").split(Z)],q=i1?J.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=i1?q.split(Z):[""];if(i1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:X,pathExt:Y,pathExtExe:q}},h7=($,J,Z)=>{if(typeof J==="function")Z=J,J={};if(!J)J={};let{pathEnv:X,pathExt:q,pathExtExe:Y}=N7($,J),Q=[],G=(K)=>new Promise((W,B)=>{if(K===X.length)return J.all&&Q.length?W(Q):B(A7($));let U=X[K],_=/^".*"$/.test(U)?U.slice(1,-1):U,T=w7.join(_,$),L=!_&&/^\.[\\\/]/.test($)?$.slice(0,2)+T:T;W(H(L,K,0))}),H=(K,W,B)=>new Promise((U,_)=>{if(B===q.length)return U(G(W+1));let T=q[B];E7(K+T,{pathExt:Y},(L,P)=>{if(!L&&P)if(J.all)Q.push(K+T);else return U(K+T);return U(H(K,W,B+1))})});return Z?G(0).then((K)=>Z(null,K),Z):G(0)},dq=($,J)=>{J=J||{};let{pathEnv:Z,pathExt:X,pathExtExe:q}=N7($,J),Y=[];for(let Q=0;Q<Z.length;Q++){let G=Z[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=w7.join(H,$),W=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+K:K;for(let B=0;B<X.length;B++){let U=W+X[B];try{if(E7.sync(U,{pathExt:q}))if(J.all)Y.push(U);else return U}catch(_){}}}if(J.all&&Y.length)return Y;if(J.nothrow)return null;throw A7($)};D7.exports=h7;h7.sync=dq});var f7=j0((rV,h2)=>{var S7=($={})=>{let J=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(J).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"};h2.exports=S7;h2.exports.default=S7});var g7=j0((sV,y7)=>{var k7=M0("path"),lq=v7(),nq=f7();function b7($,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=lq.sync($.command,{path:Z[nq({env:Z})],pathExt:J?k7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(X)}if(Q)Q=k7.resolve(q?$.options.cwd:"",Q);return Q}function iq($){return b7($)||b7($,!0)}y7.exports=iq});var u7=j0((aq,v2)=>{var D2=/([()\][%!^"`<>&|;, *?])/g;function oq($){return $=$.replace(D2,"^$1"),$}function tq($,J){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(D2,"^$1"),J)$=$.replace(D2,"^$1");return $}aq.command=oq;aq.argument=tq});var c7=j0((eV,m7)=>{m7.exports=/^#!(.*)/});var d7=j0(($L,p7)=>{var eq=c7();p7.exports=($="")=>{let J=$.match(eq);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 n7=j0((JL,l7)=>{var S2=M0("fs"),$9=d7();function J9($){let Z=Buffer.alloc(150),X;try{X=S2.openSync($,"r"),S2.readSync(X,Z,0,150,0),S2.closeSync(X)}catch(q){}return $9(Z.toString())}l7.exports=J9});var a7=j0((ZL,t7)=>{var Z9=M0("path"),i7=g7(),o7=u7(),X9=n7(),Q9=process.platform==="win32",q9=/\.(?:com|exe)$/i,Y9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function G9($){$.file=i7($);let J=$.file&&X9($.file);if(J)return $.args.unshift($.file),$.command=J,i7($);return $.file}function H9($){if(!Q9)return $;let J=G9($),Z=!q9.test(J);if($.options.forceShell||Z){let X=Y9.test(J);$.command=Z9.normalize($.command),$.command=o7.command($.command),$.args=$.args.map((Y)=>o7.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 z9($,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:H9(X)}t7.exports=z9});var e7=j0((XL,s7)=>{var f2=process.platform==="win32";function k2($,J){return Object.assign(Error(`${J} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${J} ${$.command}`,path:$.command,spawnargs:$.args})}function K9($,J){if(!f2)return;let Z=$.emit;$.emit=function(X,q){if(X==="exit"){let Y=r7(q,J);if(Y)return Z.call($,"error",Y)}return Z.apply($,arguments)}}function r7($,J){if(f2&&$===1&&!J.file)return k2(J.original,"spawn");return null}function B9($,J){if(f2&&$===1&&!J.file)return k2(J.original,"spawnSync");return null}s7.exports={hookChildProcess:K9,verifyENOENT:r7,verifyENOENTSync:B9,notFoundError:k2}});var Z8=j0((QL,o1)=>{var $8=M0("child_process"),b2=a7(),y2=e7();function J8($,J,Z){let X=b2($,J,Z),q=$8.spawn(X.command,X.args,X.options);return y2.hookChildProcess(q,X),q}function W9($,J,Z){let X=b2($,J,Z),q=$8.spawnSync(X.command,X.args,X.options);return q.error=q.error||y2.verifyENOENTSync(q.status,X),q}o1.exports=J8;o1.exports.spawn=J8;o1.exports.sync=W9;o1.exports._parse=b2;o1.exports._enoent=y2});var t3=j0((WP,aZ)=>{var o3={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"},UB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},VB={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?o3.up():"");if($)J+=o3.left;return J}};aZ.exports={cursor:o3,scroll:UB,erase:VB,beep:"\x07"}});var a4=j0((UP,a3)=>{var t4=process||{},rZ=t4.argv||[],o4=t4.env||{},LB=!(!!o4.NO_COLOR||rZ.includes("--no-color"))&&(!!o4.FORCE_COLOR||rZ.includes("--color")||t4.platform==="win32"||(t4.stdout||{}).isTTY&&o4.TERM!=="dumb"||!!o4.CI),_B=($,J,Z=$)=>(X)=>{let q=""+X,Y=q.indexOf(J,$.length);return~Y?$+RB(q,J,Z,Y)+J:$+q+J},RB=($,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)},sZ=($=LB)=>{let J=$?_B:()=>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")}};a3.exports=sZ();a3.exports.createColors=sZ});function Q0($){if(typeof $!=="object"||$===null)return!1;let J=Object.getPrototypeOf($);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as gQ}from"node:url";var d1=($,J)=>{let Z=F2(uQ($));if(typeof Z!=="string")throw TypeError(`${J} must be a string or a file URL: ${Z}.`);return Z},uQ=($)=>C2($)?$.toString():$,C2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,F2=($)=>$ instanceof URL?gQ($):$;var y$=($,J=[],Z={})=>{let X=d1($,"First argument"),[q,Y]=Q0(J)?[[],J]:[J,Z];if(!Array.isArray(q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${q}`);if(q.some((H)=>typeof H==="object"&&H!==null))throw TypeError(`Second argument must be an array of strings: ${q}`);let Q=q.map(String),G=Q.find((H)=>H.includes("\x00"));if(G!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${G}`);if(!Q0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[X,Q,Y]};import{ChildProcess as iQ}from"node:child_process";import{StringDecoder as mQ}from"node:string_decoder";var{toString:c6}=Object.prototype,p6=($)=>c6.call($)==="[object ArrayBuffer]",B0=($)=>c6.call($)==="[object Uint8Array]",e0=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),cQ=new TextEncoder,d6=($)=>cQ.encode($),pQ=new TextDecoder,g$=($)=>pQ.decode($),l6=($,J)=>{return dQ($,J).join("")},dQ=($,J)=>{if(J==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let Z=new mQ(J),X=$.map((Y)=>typeof Y==="string"?d6(Y):Y).map((Y)=>Z.write(Y)),q=Z.end();return q===""?X:[...X,q]},L$=($)=>{if($.length===1&&B0($[0]))return $[0];return j2(lQ($))},lQ=($)=>$.map((J)=>typeof J==="string"?d6(J):J),j2=($)=>{let J=new Uint8Array(nQ($)),Z=0;for(let X of $)J.set(X,Z),Z+=X.length;return J},nQ=($)=>{let J=0;for(let Z of $)J+=Z.length;return J};var t6=($)=>Array.isArray($)&&Array.isArray($.raw),a6=($,J)=>{let Z=[];for(let[Y,Q]of $.entries())Z=oQ({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,{}]},oQ=({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}=tQ(q,$.raw[X]),H=i6(Z,Y,Q);if(X===J.length)return H;let K=J[X],W=Array.isArray(K)?K.map((B)=>o6(B)):[o6(K)];return i6(H,W,G)},tQ=($,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let Z=[],X=0,q=n6.has(J[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=J[G];if(n6.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+=aQ[K]??1}}let Y=X===$.length;if(!Y)Z.push($.slice(X));return{nextTokens:Z,leadingWhitespaces:q,trailingWhitespaces:Y}},n6=new Set([" ","\t","\r",`
|
|
4
|
+
`]),aQ={x:3,u:5},i6=($,J,Z)=>Z||$.length===0||J.length===0?[...$,...J]:[...$.slice(0,-1),`${$.at(-1)}${J[0]}`,...J.slice(1)],o6=($)=>{let J=typeof $;if(J==="string")return $;if(J==="number")return String($);if(Q0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return rQ($);if($ instanceof iQ||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`)},rQ=({stdout:$})=>{if(typeof $==="string")return $;if(B0($))return g$($);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 Qz}from"node:child_process";import{debuglog as sQ}from"node:util";import x2 from"node:process";var y0=($)=>u$.includes($),u$=[x2.stdin,x2.stdout,x2.stderr],h0=["stdin","stdout","stderr"],m$=($)=>h0[$]??`stdio[${$}]`;var s6=($)=>{let J={...$};for(let Z of O2)J[Z]=P2($,Z);return J},P2=($,J)=>{let Z=Array.from({length:eQ($)+1}),X=$q($[J],Z,J);return qq(X,J)},eQ=({stdio:$})=>Array.isArray($)?Math.max($.length,h0.length):h0.length,$q=($,J,Z)=>Q0($)?Jq($,J,Z):J.fill($),Jq=($,J,Z)=>{for(let X of Object.keys($).sort(Zq))for(let q of Xq(X,Z,J))J[q]=$[X];return J},Zq=($,J)=>r6($)<r6(J)?1:-1,r6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},Xq=($,J,Z)=>{if($==="ipc")return[Z.length-1];let X=I2($);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]},I2=($)=>{if($==="all")return $;if(h0.includes($))return h0.indexOf($);let J=Qq.exec($);if(J!==null)return Number(J[1])},Qq=/^fd(\d+)$/,qq=($,J)=>$.map((Z)=>Z===void 0?Gq[J]:Z),Yq=sQ("execa").enabled?"full":"none",Gq={lines:!1,buffer:!0,maxBuffer:1e8,verbose:Yq,stripFinalNewline:!0},O2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],$1=($,J)=>J==="ipc"?$.at(-1):$[J];var l1=({verbose:$},J)=>w2($,J)!=="none",n1=({verbose:$},J)=>!["none","short"].includes(w2($,J)),e6=({verbose:$},J)=>{let Z=w2($,J);return c$(Z)?Z:void 0},w2=($,J)=>J===void 0?Hq($):$1($,J),Hq=($)=>$.find((J)=>c$(J))??p$.findLast((J)=>$.includes(J)),c$=($)=>typeof $==="function",p$=["none","short","full"];import{inspect as Nq}from"node:util";import{platform as zq}from"node:process";import{stripVTControlCharacters as Kq}from"node:util";var $7=($,J)=>{let Z=[$,...J],X=Z.join(" "),q=Z.map((Y)=>_q(J7(Y))).join(" ");return{command:X,escapedCommand:q}},_$=($)=>Kq($).split(`
|
|
7
|
+
`).map((J)=>J7(J)).join(`
|
|
8
|
+
`),J7=($)=>$.replaceAll(Uq,(J)=>Bq(J)),Bq=($)=>{let J=Vq[$];if(J!==void 0)return J;let Z=$.codePointAt(0),X=Z.toString(16);return Z<=Lq?`\\u${X.padStart(4,"0")}`:`\\U${X}`},Wq=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Uq=Wq(),Vq={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Lq=65535,_q=($)=>{if(Rq.test($))return $;return zq==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},Rq=/^[\w./-]+$/;import Z7 from"node:process";function E2(){let{env:$}=Z7,{TERM:J,TERM_PROGRAM:Z}=$;if(Z7.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 X7={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:"╱"},Q7={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:"⅒"},Tq={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"},Mq={...X7,...Q7},Cq={...X7,...Tq},Fq=E2(),jq=Fq?Mq:Cq,d$=jq,kU=Object.entries(Q7);import xq from"node:tty";var Pq=xq?.WriteStream?.prototype?.hasColors?.()??!1,c=($,J)=>{if(!Pq)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,W=(J===22?X:"")+Z;while(Q!==-1)G+=Y.slice(H,Q)+W,H=Q+X.length,Q=Y.indexOf(X,H);return G+=Y.slice(H)+X,G}},gU=c(0,0),q7=c(1,22),uU=c(2,22),mU=c(3,23),cU=c(4,24),pU=c(53,55),dU=c(7,27),lU=c(8,28),nU=c(9,29),iU=c(30,39),oU=c(31,39),tU=c(32,39),aU=c(33,39),rU=c(34,39),sU=c(35,39),eU=c(36,39),$V=c(37,39),l$=c(90,39),JV=c(40,49),ZV=c(41,49),XV=c(42,49),QV=c(43,49),qV=c(44,49),YV=c(45,49),GV=c(46,49),HV=c(47,49),zV=c(100,49),Y7=c(91,39),KV=c(92,39),G7=c(93,39),BV=c(94,39),WV=c(95,39),UV=c(96,39),VV=c(97,39),LV=c(101,49),_V=c(102,49),RV=c(103,49),TV=c(104,49),MV=c(105,49),CV=c(106,49),FV=c(107,49);var K7=({type:$,message:J,timestamp:Z,piped:X,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=Iq(Z),H=Oq[$]({failed:Y,reject:Q,piped:X}),K=wq[$]({reject:Q});return`${l$(`[${G}]`)} ${l$(`[${q}]`)} ${K(H)} ${K(J)}`},Iq=($)=>`${n$($.getHours(),2)}:${n$($.getMinutes(),2)}:${n$($.getSeconds(),2)}.${n$($.getMilliseconds(),3)}`,n$=($,J)=>String($).padStart(J,"0"),H7=({failed:$,reject:J})=>{if(!$)return d$.tick;return J?d$.cross:d$.warning},Oq={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:H7,duration:H7},z7=($)=>$,wq={command:()=>q7,output:()=>z7,ipc:()=>z7,error:({reject:$})=>$?Y7:G7,duration:()=>l$};var B7=($,J,Z)=>{let X=e6(J,Z);return $.map(({verboseLine:q,verboseObject:Y})=>Eq(q,Y,X)).filter((q)=>q!==void 0).map((q)=>Aq(q)).join("")},Eq=($,J,Z)=>{if(Z===void 0)return $;let X=Z($,J);if(typeof X==="string")return X},Aq=($)=>$.endsWith(`
|
|
9
9
|
`)?$:`${$}
|
|
10
|
-
`;var
|
|
11
|
-
`).map((Z)=>
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
Available signal numbers: ${
|
|
10
|
+
`;var l0=({type:$,verboseMessage:J,fdNumber:Z,verboseInfo:X,result:q})=>{let Y=hq({type:$,result:q,verboseInfo:X}),Q=Dq(J,Y),G=B7(Q,X,Z);if(G!=="")console.warn(G.slice(0,-1))},hq=({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}),Dq=($,J)=>$.split(`
|
|
11
|
+
`).map((Z)=>vq({...J,message:Z})),vq=($)=>{return{verboseLine:K7($),verboseObject:$}},i$=($)=>{let J=typeof $==="string"?$:Nq($);return _$(J).replaceAll("\t"," ".repeat(Sq))},Sq=2;var W7=($,J)=>{if(!l1(J))return;l0({type:"command",verboseMessage:$,verboseInfo:J})};var U7=($,J,Z)=>{bq($);let X=fq($);return{verbose:$,escapedCommand:J,commandId:X,rawOptions:Z}},fq=($)=>l1({verbose:$})?kq++:void 0,kq=0n,bq=($)=>{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(!p$.includes(J)&&!c$(J)){let Z=p$.map((X)=>`'${X}'`).join(", ");throw TypeError(`The "verbose" option must not be ${J}. Allowed values are: ${Z} or a function.`)}}};import{hrtime as V7}from"node:process";var o$=()=>V7.bigint(),A2=($)=>Number(V7.bigint()-$)/1e6;var t$=($,J,Z)=>{let X=o$(),{command:q,escapedCommand:Y}=$7($,J),Q=P2(Z,"verbose"),G=U7(Q,Y,{...Z});return W7(Y,G),{command:q,escapedCommand:Y,startTime:X,verboseInfo:G}};var W5=p1(Z8(),1);import xY from"node:path";import B5 from"node:process";import e$ from"node:process";import F1 from"node:path";function r$($={}){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 U9}from"node:util";import{execFile as V9,execFileSync as HL}from"node:child_process";import X8 from"node:path";import{fileURLToPath as L9}from"node:url";var BL=U9(V9);function s$($){return $ instanceof URL?L9($):$}function Q8($){return{*[Symbol.iterator](){let J=X8.resolve(s$($)),Z;while(Z!==J)yield J,Z=J,J=X8.resolve(J,"..")}}}var _9=({cwd:$=e$.cwd(),path:J=e$.env[r$()],preferLocal:Z=!0,execPath:X=e$.execPath,addExecPath:q=!0}={})=>{let Y=F1.resolve(s$($)),Q=[],G=J.split(F1.delimiter);if(Z)R9(Q,G,Y);if(q)T9(Q,G,X,Y);return J===""||J===F1.delimiter?`${Q.join(F1.delimiter)}${J}`:[...Q,J].join(F1.delimiter)},R9=($,J,Z)=>{for(let X of Q8(Z)){let q=F1.join(X,"node_modules/.bin");if(!J.includes(q))$.push(q)}},T9=($,J,Z,X)=>{let q=F1.resolve(X,s$(Z),"..");if(!J.includes(q))$.push(q)},q8=({env:$=e$.env,...J}={})=>{$={...$};let Z=r$({env:$});return J.path=$[Z],$[Z]=_9(J),$};import{setTimeout as v9}from"node:timers/promises";var Y8=($,J,Z)=>{let X=Z?J4:$4,q=$ instanceof n0?{}:{cause:$};return new X(J,q)};class n0 extends Error{}var G8=($,J)=>{Object.defineProperty($.prototype,"name",{value:J,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,z8,{value:!0,writable:!1,enumerable:!1,configurable:!1})},H8=($)=>Z4($)&&(z8 in $),z8=Symbol("isExecaError"),Z4=($)=>Object.prototype.toString.call($)==="[object Error]";class $4 extends Error{}G8($4,$4.name);class J4 extends Error{}G8(J4,J4.name);import{constants as R$}from"node:os";import{constants as j9}from"node:os";var K8=()=>{let $=g2-B8+1;return Array.from({length:$},M9)},M9=($,J)=>({name:`SIGRT${J+1}`,number:B8+J,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),B8=34,g2=64;import{constants as C9}from"node:os";var W8=[{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 u2=()=>{let $=K8();return[...W8,...$].map(F9)},F9=({name:$,number:J,description:Z,action:X,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=C9,G=Q!==void 0;return{name:$,number:G?Q:J,description:Z,supported:G,action:X,forced:q,standard:Y}};var x9=()=>{let $=u2();return Object.fromEntries($.map(P9))},P9=({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}],U8=x9(),I9=()=>{let $=u2(),J=g2+1,Z=Array.from({length:J},(X,q)=>O9(q,$));return Object.assign({},...Z)},O9=($,J)=>{let Z=w9($,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}}},w9=($,J)=>{let Z=J.find(({name:X})=>j9.signals[X]===$);if(Z!==void 0)return Z;return J.find((X)=>X.number===$)},AL=I9();var L8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return R8($,"option `killSignal`")},_8=($)=>$===0?$:R8($,"`subprocess.kill()`'s argument"),R8=($,J)=>{if(Number.isInteger($))return E9($,J);if(typeof $==="string")return N9($,J);throw TypeError(`Invalid ${J} ${String($)}: it must be a string or an integer.
|
|
12
|
+
${m2()}`)},E9=($,J)=>{if(V8.has($))return V8.get($);throw TypeError(`Invalid ${J} ${$}: this signal integer does not exist.
|
|
13
|
+
${m2()}`)},A9=()=>new Map(Object.entries(R$.signals).reverse().map(([$,J])=>[J,$])),V8=A9(),N9=($,J)=>{if($ in R$.signals)return $;if($.toUpperCase()in R$.signals)throw TypeError(`Invalid ${J} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${J} '${$}': this signal name does not exist.
|
|
14
|
+
${m2()}`)},m2=()=>`Available signal names: ${h9()}.
|
|
15
|
+
Available signal numbers: ${D9()}.`,h9=()=>Object.keys(R$.signals).sort().map(($)=>`'${$}'`).join(", "),D9=()=>[...new Set(Object.values(R$.signals).sort(($,J)=>$-J))].join(", "),X4=($)=>U8[$].description;var T8=($)=>{if($===!1)return $;if($===!0)return S9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},S9=5000,M8=({kill:$,options:{forceKillAfterDelay:J,killSignal:Z},onInternalError:X,context:q,controller:Y},Q,G)=>{let{signal:H,error:K}=f9(Q,G,Z);k9(K,X);let W=$(H);return b9({kill:$,signal:H,forceKillAfterDelay:J,killSignal:Z,killResult:W,context:q,controller:Y}),W},f9=($,J,Z)=>{let[X=Z,q]=Z4($)?[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&&!Z4(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:_8(X),error:q}},k9=($,J)=>{if($!==void 0)J.reject($)},b9=async({kill:$,signal:J,forceKillAfterDelay:Z,killSignal:X,killResult:q,context:Y,controller:Q})=>{if(J===X&&q)c2({kill:$,forceKillAfterDelay:Z,context:Y,controllerSignal:Q.signal})},c2=async({kill:$,forceKillAfterDelay:J,context:Z,controllerSignal:X})=>{if(J===!1)return;try{if(await v9(J,void 0,{signal:X}),$("SIGKILL"))Z.isForcefullyTerminated??=!0}catch{}};import{once as y9}from"node:events";var Q4=async($,J)=>{if(!$.aborted)await y9($,"abort",{signal:J})};var C8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},F8=({subprocess:$,cancelSignal:J,gracefulCancel:Z,context:X,controller:q})=>J===void 0||Z?[]:[g9($,J,X,q)],g9=async($,J,Z,{signal:X})=>{throw await Q4(J,X),Z.terminationReason??="cancel",$.kill(),J.reason};import{scheduler as YY}from"node:timers/promises";import{promisify as XY}from"node:util";var t1=({methodName:$,isSubprocess:J,ipc:Z,isConnected:X})=>{u9($,J,Z),p2($,J,X)},u9=($,J,Z)=>{if(!Z)throw Error(`${g0($,J)} can only be used if the \`ipc\` option is \`true\`.`)},p2=($,J,Z)=>{if(!Z)throw Error(`${g0($,J)} cannot be used: the ${z1(J)} has already exited or disconnected.`)},j8=($)=>{throw Error(`${g0("getOneMessage",$)} could not complete: the ${z1($)} exited or disconnected.`)},x8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${z1($)} is sending a message too, instead of listening to incoming messages.
|
|
16
16
|
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
17
17
|
|
|
18
18
|
const [receivedMessage] = await Promise.all([
|
|
19
19
|
${g0("getOneMessage",$)},
|
|
20
20
|
${g0("sendMessage",$,"message, {strict: true}")},
|
|
21
|
-
]);`)},
|
|
21
|
+
]);`)},q4=($,J)=>Error(`${g0("sendMessage",J)} failed when sending an acknowledgment response to the ${z1(J)}.`,{cause:$}),P8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${z1($)} is not listening to incoming messages.`)},I8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${z1($)} exited without listening to incoming messages.`)},O8=()=>Error(`\`cancelSignal\` aborted: the ${z1(!0)} disconnected.`),w8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},E8=({error:$,methodName:J,isSubprocess:Z})=>{if($.code==="EPIPE")throw Error(`${g0(J,Z)} cannot be used: the ${z1(Z)} is disconnecting.`,{cause:$})},A8=({error:$,methodName:J,isSubprocess:Z,message:X})=>{if(m9($))throw Error(`${g0(J,Z)}'s argument type is invalid: the message cannot be serialized: ${String(X)}.`,{cause:$})},m9=({code:$,message:J})=>c9.has($)||p9.some((Z)=>J.includes(Z)),c9=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),p9=["could not be cloned","circular structure","call stack size exceeded"],g0=($,J,Z="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${d9(J)}${$}(${Z})`,d9=($)=>$?"":"subprocess.",z1=($)=>$?"parent process":"subprocess",a1=($)=>{if($.connected)$.disconnect()};var i0=()=>{let $={},J=new Promise((Z,X)=>{Object.assign($,{resolve:Z,reject:X})});return Object.assign(J,$)};var G4=($,J="stdin")=>{let{options:X,fileDescriptors:q}=o0.get($),Y=N8(q,J,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(h8(Y,J,X,!0));return Q},r1=($,J="stdout")=>{let{options:X,fileDescriptors:q}=o0.get($),Y=N8(q,J,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(h8(Y,J,X,!1));return Q},o0=new WeakMap,N8=($,J,Z)=>{let X=l9(J,Z);return n9(X,J,Z,$),X},l9=($,J)=>{let Z=I2($);if(Z!==void 0)return Z;let{validOptions:X,defaultValue:q}=J?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${T$(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}".`)},n9=($,J,Z,X)=>{let q=X[D8($)];if(q===void 0)throw TypeError(`"${T$(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(`"${T$(Z)}" must not be ${J}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&Z)throw TypeError(`"${T$(Z)}" must not be ${J}. It must be a writable stream, not readable.`)},h8=($,J,Z,X)=>{if($==="all"&&!Z.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=i9($,Z);return`The "${q}: ${Y4(Y)}" option is incompatible with using "${T$(X)}: ${Y4(J)}".
|
|
25
|
+
Please set this option with "pipe" instead.`},i9=($,{stdin:J,stdout:Z,stderr:X,stdio:q})=>{let Y=D8($);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]}},D8=($)=>$==="all"?1:$,T$=($)=>$?"to":"from",Y4=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as e9}from"node:events";import{addAbortListener as o9}from"node:events";var j1=($,J,Z)=>{let X=$.getMaxListeners();if(X===0||X===Number.POSITIVE_INFINITY)return;$.setMaxListeners(X+J),o9(Z,()=>{$.setMaxListeners($.getMaxListeners()-J)})};import{EventEmitter as r9}from"node:events";import{once as t9}from"node:events";import{scheduler as a9}from"node:timers/promises";var H4=($,J)=>{if(J)d2($)},d2=($)=>{$.refCounted()},z4=($,J)=>{if(J)l2($)},l2=($)=>{$.unrefCounted()},v8=($,J)=>{if(J)l2($),l2($)},S8=($,J)=>{if(J)d2($),d2($)};var f8=async({anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X},q)=>{if(y8(q)||u8(q))return;if(!K4.has($))K4.set($,[]);let Y=K4.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await g8($,X,q),await a9.yield();let Q=await b8({wrappedMessage:Y[0],anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X});Y.shift(),X.emit("message",Q),X.emit("message:done")}},k8=async({anyProcess:$,channel:J,isSubprocess:Z,ipcEmitter:X,boundOnMessage:q})=>{n2();let Y=K4.get($);while(Y?.length>0)await t9(X,"message:done");$.removeListener("message",q),S8(J,Z),X.connected=!1,X.emit("disconnect")},K4=new WeakMap;var K1=($,J,Z)=>{if(B4.has($))return B4.get($);let X=new r9;return X.connected=!0,B4.set($,X),s9({ipcEmitter:X,anyProcess:$,channel:J,isSubprocess:Z}),X},B4=new WeakMap,s9=({ipcEmitter:$,anyProcess:J,channel:Z,isSubprocess:X})=>{let q=f8.bind(void 0,{anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:$});J.on("message",q),J.once("disconnect",k8.bind(void 0,{anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:$,boundOnMessage:q})),v8(Z,X)},W4=($)=>{let J=B4.get($);return J===void 0?$.channel!==null:J.connected};var m8=({anyProcess:$,channel:J,isSubprocess:Z,message:X,strict:q})=>{if(!q)return X;let Y=K1($,J,Z),Q=L4($,Y);return{id:$Y++,type:V4,message:X,hasListeners:Q}},$Y=0n,c8=($,J)=>{if(J?.type!==V4||J.hasListeners)return;for(let{id:Z}of $)if(Z!==void 0)U4[Z].resolve({isDeadlock:!0,hasListeners:!1})},b8=async({wrappedMessage:$,anyProcess:J,channel:Z,isSubprocess:X,ipcEmitter:q})=>{if($?.type!==V4||!J.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:d8,message:L4(J,q)};try{await _4({anyProcess:J,channel:Z,isSubprocess:X,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},y8=($)=>{if($?.type!==d8)return!1;let{id:J,message:Z}=$;return U4[J]?.resolve({isDeadlock:!1,hasListeners:Z}),!0},p8=async($,J,Z)=>{if($?.type!==V4)return;let X=i0();U4[$.id]=X;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([X,JY(J,Z,q)]);if(Y)x8(Z);if(!Q)P8(Z)}finally{q.abort(),delete U4[$.id]}},U4={},JY=async($,J,{signal:Z})=>{j1($,1,Z),await e9($,"disconnect",{signal:Z}),I8(J)},V4="execa:ipc:request",d8="execa:ipc:response";var l8=($,J,Z)=>{if(!M$.has($))M$.set($,new Set);let X=M$.get($),q=i0(),Y=Z?J.id:void 0,Q={onMessageSent:q,id:Y};return X.add(Q),{outgoingMessages:X,outgoingMessage:Q}},n8=({outgoingMessages:$,outgoingMessage:J})=>{$.delete(J),J.onMessageSent.resolve()},g8=async($,J,Z)=>{while(!L4($,J)&&M$.get($)?.size>0){let X=[...M$.get($)];c8(X,Z),await Promise.all(X.map(({onMessageSent:q})=>q))}},M$=new WeakMap,L4=($,J)=>J.listenerCount("message")>ZY($),ZY=($)=>o0.has($)&&!$1(o0.get($).options.buffer,"ipc")?1:0;var _4=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},q,{strict:Y=!1}={})=>{return t1({methodName:"sendMessage",isSubprocess:Z,ipc:X,isConnected:$.connected}),QY({anyProcess:$,channel:J,methodName:"sendMessage",isSubprocess:Z,message:q,strict:Y})},QY=async({anyProcess:$,channel:J,methodName:Z,isSubprocess:X,message:q,strict:Y})=>{let Q=m8({anyProcess:$,channel:J,isSubprocess:X,message:q,strict:Y}),G=l8($,Q,Y);try{await o2({anyProcess:$,methodName:Z,isSubprocess:X,wrappedMessage:Q,message:q})}catch(H){throw a1($),H}finally{n8(G)}},o2=async({anyProcess:$,methodName:J,isSubprocess:Z,wrappedMessage:X,message:q})=>{let Y=qY($);try{await Promise.all([p8(X,$,Z),Y(X)])}catch(Q){throw E8({error:Q,methodName:J,isSubprocess:Z}),A8({error:Q,methodName:J,isSubprocess:Z,message:q}),Q}},qY=($)=>{if(i2.has($))return i2.get($);let J=XY($.send.bind($));return i2.set($,J),J},i2=new WeakMap;var o8=($,J)=>{return p2("cancelSignal",!1,$.connected),o2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:a8,message:J},message:J})},t8=async({anyProcess:$,channel:J,isSubprocess:Z,ipc:X})=>{return await GY({anyProcess:$,channel:J,isSubprocess:Z,ipc:X}),t2.signal},GY=async({anyProcess:$,channel:J,isSubprocess:Z,ipc:X})=>{if(i8)return;if(i8=!0,!X){w8();return}if(J===null){n2();return}K1($,J,Z),await YY.yield()},i8=!1,u8=($)=>{if($?.type!==a8)return!1;return t2.abort($.message),!0},a8="execa:ipc:cancel",n2=()=>{t2.abort(O8())},t2=new AbortController;var r8=({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.")},s8=({subprocess:$,cancelSignal:J,gracefulCancel:Z,forceKillAfterDelay:X,context:q,controller:Y})=>Z?[HY({subprocess:$,cancelSignal:J,forceKillAfterDelay:X,context:q,controller:Y})]:[],HY=async({subprocess:$,cancelSignal:J,forceKillAfterDelay:Z,context:X,controller:{signal:q}})=>{await Q4(J,q);let Y=zY(J);throw await o8($,Y),c2({kill:$.kill,forceKillAfterDelay:Z,context:X,controllerSignal:q}),X.terminationReason??="gracefulCancel",J.reason},zY=({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 KY}from"node:timers/promises";var e8=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},$5=($,J,Z,X)=>J===0||J===void 0?[]:[BY($,J,Z,X)],BY=async($,J,Z,{signal:X})=>{throw await KY(J,void 0,{signal:X}),Z.terminationReason??="timeout",$.kill(),new n0};import{execPath as WY,execArgv as UY}from"node:process";import J5 from"node:path";var Z5=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},X5=($,J,{node:Z=!1,nodePath:X=WY,nodeOptions:q=UY.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=d1(X,'The "nodePath" option'),K=J5.resolve(Y,H),W={...G,nodePath:K,node:Z,cwd:Y};if(!Z)return[$,J,W];if(J5.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,...W,shell:!1}]};import{serialize as VY}from"node:v8";var Q5=({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`.");RY[Z]($)},LY=($)=>{try{VY($)}catch(J){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:J})}},_Y=($)=>{try{JSON.stringify($)}catch(J){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:J})}},RY={advanced:LY,json:_Y},q5=async($,J)=>{if(J===void 0)return;await $.sendMessage(J)};var G5=({encoding:$})=>{if(a2.has($))return;let J=MY($);if(J!==void 0)throw TypeError(`Invalid option \`encoding: ${R4($)}\`.
|
|
26
|
+
Please rename it to ${R4(J)}.`);let Z=[...a2].map((X)=>R4(X)).join(", ");throw TypeError(`Invalid option \`encoding: ${R4($)}\`.
|
|
27
|
+
Please rename it to one of: ${Z}.`)},TY=new Set(["utf8","utf16le"]),I0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),a2=new Set([...TY,...I0]),MY=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let J=$.toLowerCase();if(J in Y5)return Y5[J];if(a2.has(J))return J},Y5={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},R4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as CY}from"node:fs";import FY from"node:path";import jY from"node:process";var H5=($=z5())=>{let J=d1($,'The "cwd" option');return FY.resolve(J)},z5=()=>{try{return jY.cwd()}catch($){throw $.message=`The current directory does not exist.
|
|
28
|
+
${$.message}`,$}},K5=($,J)=>{if(J===z5())return $;let Z;try{Z=CY(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 T4=($,J,Z)=>{Z.cwd=H5(Z.cwd);let[X,q,Y]=X5($,J,Z),{command:Q,args:G,options:H}=W5.default._parse(X,q,Y),K=s6(H),W=PY(K);if(e8(W),G5(W),Q5(W),C8(W),r8(W),W.shell=F2(W.shell),W.env=IY(W),W.killSignal=L8(W.killSignal),W.forceKillAfterDelay=T8(W.forceKillAfterDelay),W.lines=W.lines.map((B,U)=>B&&!I0.has(W.encoding)&&W.buffer[U]),B5.platform==="win32"&&xY.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:W}},PY=({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:W=!0,gracefulCancel:B=!1,ipcInput:U,ipc:_=U!==void 0||B,serialization:T="advanced",...L})=>({...L,extendEnv:$,preferLocal:J,cwd:Z,localDirectory:X,encoding:q,reject:Y,cleanup:Q,all:G,windowsHide:H,killSignal:K,forceKillAfterDelay:W,gracefulCancel:B,ipcInput:U,ipc:_,serialization:T}),IY=({env:$,extendEnv:J,preferLocal:Z,node:X,localDirectory:q,nodePath:Y})=>{let Q=J?{...B5.env,...$}:$;if(Z||X)return q8({env:Q,cwd:q,execPath:Y,preferLocal:Z,addExecPath:X});return Q};var M4=($,J,Z)=>Z.shell&&J.length>0?[[$,...J].join(" "),[],Z]:[$,J,Z];import{inspect as qG}from"node:util";function s1($){if(typeof $==="string")return OY($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return wY($)}var OY=($)=>$.at(-1)===U5?$.slice(0,$.at(-2)===V5?-2:-1):$,wY=($)=>$.at(-1)===EY?$.subarray(0,$.at(-2)===AY?-2:-1):$,U5=`
|
|
32
|
+
`,EY=U5.codePointAt(0),V5="\r",AY=V5.codePointAt(0);import{on as JG}from"node:events";import{finished as ZG}from"node:stream/promises";function u0($,{checkOpen:J=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!J||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function r2($,{checkOpen:J=!0}={}){return u0($,{checkOpen:J})&&($.writable||!J)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function x1($,{checkOpen:J=!0}={}){return u0($,{checkOpen:J})&&($.readable||!J)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function s2($,J){return r2($,J)&&x1($,J)}var NY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class L5{#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 e2=Symbol();function _5(){return this[e2].next()}Object.defineProperty(_5,"name",{value:"next"});function R5($){return this[e2].return($)}Object.defineProperty(R5,"name",{value:"return"});var hY=Object.create(NY,{next:{enumerable:!0,configurable:!0,writable:!0,value:_5},return:{enumerable:!0,configurable:!0,writable:!0,value:R5}});function $3({preventCancel:$=!1}={}){let J=this.getReader(),Z=new L5(J,$),X=Object.create(hY);return X[e2]=Z,X}var T5=($)=>{if(x1($,{checkOpen:!1})&&C$.on!==void 0)return vY($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(DY.call($)==="[object ReadableStream]")return $3.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:DY}=Object.prototype,vY=async function*($){let J=new AbortController,Z={};SY($,J,Z);try{for await(let[X]of C$.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()}},SY=async($,J,Z)=>{try{await C$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(X){Z.error=X}finally{J.abort()}},C$={};var e1=async($,{init:J,convertChunk:Z,getSize:X,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let K=T5($),W=J();W.length=0;try{for await(let B of K){let U=kY(B),_=Z[U](B,W);F5({convertedChunk:_,state:W,getSize:X,truncateChunk:q,addChunk:Y,maxBuffer:H})}return fY({state:W,convertChunk:Z,getSize:X,truncateChunk:q,addChunk:Y,getFinalChunk:Q,maxBuffer:H}),G(W)}catch(B){let U=typeof B==="object"&&B!==null?B:Error(B);throw U.bufferedData=G(W),U}},fY=({state:$,getSize:J,truncateChunk:Z,addChunk:X,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)F5({convertedChunk:Q,state:$,getSize:J,truncateChunk:Z,addChunk:X,maxBuffer:Y})},F5=({convertedChunk:$,state:J,getSize:Z,truncateChunk:X,addChunk:q,maxBuffer:Y})=>{let Q=Z($),G=J.length+Q;if(G<=Y){M5($,J,q,G);return}let H=X($,Y-J.length);if(H!==void 0)M5(H,J,q,Y);throw new J1},M5=($,J,Z,X)=>{J.contents=Z($,J,X),J.length=X},kY=($)=>{let J=typeof $;if(J==="string")return"string";if(J!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let Z=C5.call($);if(Z==="[object ArrayBuffer]")return"arrayBuffer";if(Z==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&C5.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:C5}=Object.prototype;class J1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var Z1=($)=>$,F$=()=>{return},C4=({contents:$})=>$,F4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},j4=($)=>$.length;async function x4($,J){return e1($,uY,J)}var bY=()=>({contents:[]}),yY=()=>1,gY=($,{contents:J})=>{return J.push($),J},uY={init:bY,convertChunk:{string:Z1,buffer:Z1,arrayBuffer:Z1,dataView:Z1,typedArray:Z1,others:Z1},getSize:yY,truncateChunk:F$,addChunk:gY,getFinalChunk:F$,finalize:C4};async function P4($,J){return e1($,tY,J)}var mY=()=>({contents:new ArrayBuffer(0)}),cY=($)=>pY.encode($),pY=new TextEncoder,j5=($)=>new Uint8Array($),x5=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),dY=($,J)=>$.slice(0,J),lY=($,{contents:J,length:Z},X)=>{let q=O5()?iY(J,X):nY(J,X);return new Uint8Array(q).set($,Z),q},nY=($,J)=>{if(J<=$.byteLength)return $;let Z=new ArrayBuffer(I5(J));return new Uint8Array(Z).set(new Uint8Array($),0),Z},iY=($,J)=>{if(J<=$.maxByteLength)return $.resize(J),$;let Z=new ArrayBuffer(J,{maxByteLength:I5(J)});return new Uint8Array(Z).set(new Uint8Array($),0),Z},I5=($)=>P5**Math.ceil(Math.log($)/Math.log(P5)),P5=2,oY=({contents:$,length:J})=>O5()?$:$.slice(0,J),O5=()=>("resize"in ArrayBuffer.prototype),tY={init:mY,convertChunk:{string:cY,buffer:j5,arrayBuffer:j5,dataView:x5,typedArray:x5,others:F4},getSize:j4,truncateChunk:dY,addChunk:lY,getFinalChunk:F$,finalize:oY};async function O4($,J){return e1($,$G,J)}var aY=()=>({contents:"",textDecoder:new TextDecoder}),I4=($,{textDecoder:J})=>J.decode($,{stream:!0}),rY=($,{contents:J})=>J+$,sY=($,J)=>$.slice(0,J),eY=({textDecoder:$})=>{let J=$.decode();return J===""?void 0:J},$G={init:aY,convertChunk:{string:Z1,buffer:I4,arrayBuffer:I4,dataView:I4,typedArray:I4,others:F4},getSize:j4,truncateChunk:sY,addChunk:rY,getFinalChunk:eY,finalize:C4};Object.assign(C$,{on:JG,finished:ZG});var w5=({error:$,stream:J,readableObjectMode:Z,lines:X,encoding:q,fdNumber:Y})=>{if(!($ instanceof J1))throw $;if(Y==="all")return $;let Q=XG(Z,X,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},J.destroy(),$},XG=($,J,Z)=>{if($)return"objects";if(J)return"lines";if(Z==="buffer")return"bytes";return"characters"},E5=($,J,Z)=>{if(J.length!==Z)return;let X=new J1;throw X.maxBufferInfo={fdNumber:"ipc"},X},A5=($,J)=>{let{streamName:Z,threshold:X,unit:q}=QG($,J);return`Command's ${Z} was larger than ${X} ${q}`},QG=($,J)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:J[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:Z,unit:X}}=$;delete $.maxBufferInfo;let q=$1(J,Z);if(Z==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:m$(Z),threshold:q,unit:X}},N5=($,J,Z)=>$?.code==="ENOBUFS"&&J!==null&&J.some((X)=>X!==null&&X.length>w4(Z)),h5=($,J,Z)=>{if(!J)return $;let X=w4(Z);return $.length>X?$.slice(0,X):$},w4=([,$])=>$;var v5=({stdio:$,all:J,ipcOutput:Z,originalError:X,signal:q,signalDescription:Y,exitCode:Q,escapedCommand:G,timedOut:H,isCanceled:K,isGracefullyCanceled:W,isMaxBuffer:B,isForcefullyTerminated:U,forceKillAfterDelay:_,killSignal:T,maxBuffer:L,timeout:P,cwd:I})=>{let D=X?.code,m=YG({originalError:X,timedOut:H,timeout:P,isMaxBuffer:B,maxBuffer:L,errorCode:D,signal:q,signalDescription:Y,exitCode:Q,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:U,forceKillAfterDelay:_,killSignal:T}),O=HG(X,I),l=O===void 0?"":`
|
|
33
|
+
${O}`,n=`${m}: ${G}${l}`,o=J===void 0?[$[2],$[1]]:[J],W0=[n,...o,...$.slice(3),Z.map((d)=>zG(d)).join(`
|
|
34
|
+
`)].map((d)=>_$(s1(KG(d)))).filter(Boolean).join(`
|
|
35
35
|
|
|
36
|
-
`);return{originalMessage:
|
|
37
|
-
`):A5($),A5=($)=>{if(typeof $==="string")return $;if(B0($))return y$($);return""};var w4=({command:$,escapedCommand:J,stdio:Z,all:X,ipcOutput:q,options:{cwd:Y},startTime:Q})=>N5({command:$,escapedCommand:J,cwd:Y,durationMs:P2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:Z[1],stderr:Z[2],all:X,stdio:Z,ipcOutput:q,pipedFrom:[]}),a1=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:Q})=>T$({error:$,command:J,escapedCommand:Z,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:X.length}),ipcOutput:[],options:q,isSync:Q}),T$=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,stdio:B,all:W,ipcOutput:_,options:{timeoutDuration:R,timeout:L=R,forceKillAfterDelay:x,killSignal:j,cwd:D,maxBuffer:p},isSync:P})=>{let{exitCode:E,signal:k,signalDescription:n}=HG(K,U),{originalMessage:T0,shortMessage:i,message:r0}=h5({stdio:B,all:W,ipcOutput:_,originalError:$,signal:k,signalDescription:n,exitCode:E,escapedCommand:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:x,killSignal:j,maxBuffer:p,timeout:L,cwd:D}),A=X8($,r0,P);return Object.assign(A,GG({error:A,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:E,signal:k,signalDescription:n,stdio:B,all:W,ipcOutput:_,cwd:D,originalMessage:T0,shortMessage:i})),A},GG=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,signalDescription:B,stdio:W,all:_,ipcOutput:R,cwd:L,originalMessage:x,shortMessage:j})=>N5({shortMessage:j,originalMessage:x,command:J,escapedCommand:Z,cwd:L,durationMs:P2(X),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:U!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:U,signalDescription:B,code:$.cause?.code,stdout:W[1],stderr:W[2],all:_,stdio:W,ipcOutput:R,pipedFrom:[]}),N5=($)=>Object.fromEntries(Object.entries($).filter(([,J])=>J!==void 0)),HG=($,J)=>{let Z=$===null?void 0:$,X=J===null?void 0:J,q=X===void 0?void 0:Z4(J);return{exitCode:Z,signal:X,signalDescription:q}};var D5=($)=>Number.isFinite($)?$:0;function zG($){return{days:Math.trunc($/86400000),hours:Math.trunc($/3600000%24),minutes:Math.trunc($/60000%60),seconds:Math.trunc($/1000%60),milliseconds:Math.trunc($%1000),microseconds:Math.trunc(D5($*1000)%1000),nanoseconds:Math.trunc(D5($*1e6)%1000)}}function KG($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function a2($){switch(typeof $){case"number":{if(Number.isFinite($))return zG($);break}case"bigint":return KG($)}throw TypeError("Expected a finite number or bigint")}var BG=($)=>$===0||$===0n,UG=($,J)=>J===1||J===1n?$:`${$}s`,WG=0.0000001,VG=24n*60n*60n*1000n;function r2($,J){let Z=typeof $==="bigint";if(!Z&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");J={...J};let X=$<0?"-":"";if($=$<0?-$:$,J.colonNotation)J.compact=!1,J.formatSubMilliseconds=!1,J.separateMilliseconds=!1,J.verbose=!1;if(J.compact)J.unitCount=1,J.secondsDecimalDigits=0,J.millisecondsDecimalDigits=0;let q=[],Y=(U,B)=>{let W=Math.floor(U*10**B+WG);return(Math.round(W)/10**B).toFixed(B)},Q=(U,B,W,_)=>{if((q.length===0||!J.colonNotation)&&BG(U)&&!(J.colonNotation&&W==="m"))return;if(_??=String(U),J.colonNotation){let R=_.includes(".")?_.split(".")[0].length:_.length,L=q.length>0?2:1;_="0".repeat(Math.max(0,L-R))+_}else _+=J.verbose?" "+UG(B,U):W;q.push(_)},G=a2($),H=BigInt(G.days);if(J.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(J.hideYear)Q(H,"day","d");else Q(H/365n,"year","y"),Q(H%365n,"day","d");Q(Number(G.hours),"hour","h")}if(Q(Number(G.minutes),"minute","m"),!J.hideSeconds)if(J.separateMilliseconds||J.formatSubMilliseconds||!J.colonNotation&&$<1000&&!J.subSecondsAsDecimals){let U=Number(G.seconds),B=Number(G.milliseconds),W=Number(G.microseconds),_=Number(G.nanoseconds);if(Q(U,"second","s"),J.formatSubMilliseconds)Q(B,"millisecond","ms"),Q(W,"microsecond","µs"),Q(_,"nanosecond","ns");else{let R=B+W/1000+_/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,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($%VG):$)/1000%60,B=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,W=Y(U,B),_=J.keepDecimalsOnWholeSeconds?W:W.replace(/\.0+$/,"");Q(Number.parseFloat(_),"second","s",_)}if(q.length===0)return X+"0"+(J.verbose?" milliseconds":"ms");let K=J.colonNotation?":":" ";if(typeof J.unitCount==="number")q=q.slice(0,Math.max(J.unitCount,1));return X+q.join(K)}var v5=($,J)=>{if($.failed)p0({type:"error",verboseMessage:$.shortMessage,verboseInfo:J,result:$})};var S5=($,J)=>{if(!m1(J))return;v5($,J),LG($,J)},LG=($,J)=>{let Z=`(done in ${r2($.durationMs)})`;p0({type:"duration",verboseMessage:Z,verboseInfo:J,result:$})};var r1=($,J,{reject:Z})=>{if(S5($,J),$.failed&&Z)throw $;return $};import{readFileSync as GJ}from"node:fs";var b5=($,J)=>{if(F1($))return"asyncGenerator";if(u5($))return"generator";if(E4($))return"fileUrl";if(CG($))return"filePath";if(xG($))return"webStream";if(u0($,{checkOpen:!1}))return"native";if(B0($))return"uint8Array";if(PG($))return"asyncIterable";if(IG($))return"iterable";if($3($))return y5({transform:$},J);if(MG($))return _G($,J);return"native"},_G=($,J)=>{if(i2($.transform,{checkOpen:!1}))return RG($,J);if($3($.transform))return y5($,J);return TG($,J)},RG=($,J)=>{return g5($,J,"Duplex stream"),"duplex"},y5=($,J)=>{return g5($,J,"web TransformStream"),"webTransform"},g5=({final:$,binary:J,objectMode:Z},X,q)=>{f5($,`${X}.final`,q),f5(J,`${X}.binary`,q),s2(Z,`${X}.objectMode`)},f5=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${Z}.`)},TG=({transform:$,final:J,binary:Z,objectMode:X},q)=>{if($!==void 0&&!k5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(i2(J,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if($3(J))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!k5(J))throw TypeError(`The \`${q}.final\` option must be a generator.`);return s2(Z,`${q}.binary`),s2(X,`${q}.objectMode`),F1($)||F1(J)?"asyncGenerator":"generator"},s2=($,J)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},k5=($)=>F1($)||u5($),F1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",u5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",MG=($)=>Q0($)&&($.transform!==void 0||$.final!==void 0),E4=($)=>Object.prototype.toString.call($)==="[object URL]",m5=($)=>E4($)&&$.protocol!=="file:",CG=($)=>Q0($)&&Object.keys($).length>0&&Object.keys($).every((J)=>FG.has(J))&&e2($.file),FG=new Set(["file","append"]),e2=($)=>typeof $==="string",c5=($,J)=>$==="native"&&typeof J==="string"&&!jG.has(J),jG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),p5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",A4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",xG=($)=>p5($)||A4($),$3=($)=>p5($?.readable)&&A4($?.writable),PG=($)=>d5($)&&typeof $[Symbol.asyncIterator]==="function",IG=($)=>d5($)&&typeof $[Symbol.iterator]==="function",d5=($)=>typeof $==="object"&&$!==null,N0=new Set(["generator","asyncGenerator","duplex","webTransform"]),h4=new Set(["fileUrl","filePath","fileNumber"]),J3=new Set(["fileUrl","filePath"]),l5=new Set([...J3,"webStream","nodeStream"]),n5=new Set(["webTransform","duplex"]),H1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var Z3=($,J,Z,X)=>X==="output"?OG($,J,Z):wG($,J,Z),OG=($,J,Z)=>{let X=J!==0&&Z[J-1].value.readableObjectMode;return{writableObjectMode:X,readableObjectMode:$??X}},wG=($,J,Z)=>{let X=J===0?$===!0:Z[J-1].value.readableObjectMode,q=J!==Z.length-1&&($??X);return{writableObjectMode:X,readableObjectMode:q}},i5=($,J)=>{let Z=$.findLast(({type:X})=>N0.has(X));if(Z===void 0)return!1;return J==="input"?Z.value.writableObjectMode:Z.value.readableObjectMode};var o5=($,J,Z,X)=>[...$.filter(({type:q})=>!N0.has(q)),...EG($,J,Z,X)],EG=($,J,Z,{encoding:X})=>{let q=$.filter(({type:Q})=>N0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=AG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:J,direction:Z,encoding:X});return vG(Y,Z)},AG=({stdioItem:$,stdioItem:{type:J},index:Z,newTransforms:X,optionName:q,direction:Y,encoding:Q})=>{if(J==="duplex")return hG({stdioItem:$,optionName:q});if(J==="webTransform")return NG({stdioItem:$,index:Z,newTransforms:X,direction:Y});return DG({stdioItem:$,index:Z,newTransforms:X,direction:Y,encoding:Q})},hG=({stdioItem:$,stdioItem:{value:{transform:J,transform:{writableObjectMode:Z,readableObjectMode:X},objectMode:q=X}},optionName:Y})=>{if(q&&!X)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&X)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:J,writableObjectMode:Z,readableObjectMode:X}}},NG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q})=>{let{transform:Y,objectMode:Q}=Q0(J)?J:{transform:J},{writableObjectMode:G,readableObjectMode:H}=Z3(Q,Z,X,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},DG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:K=!1,objectMode:U}=Q0(J)?J:{transform:J},B=H||x0.has(Y),{writableObjectMode:W,readableObjectMode:_}=Z3(U,Z,X,q);return{...$,value:{transform:Q,final:G,binary:B,preserveNewlines:K,writableObjectMode:W,readableObjectMode:_}}},vG=($,J)=>J==="input"?$.reverse():$;import X3 from"node:process";var t5=($,J,Z)=>{let X=$.map((q)=>SG(q,J));if(X.includes("input")&&X.includes("output"))throw TypeError(`The \`${Z}\` option must not be an array of both readable and writable values.`);return X.find(Boolean)??bG},SG=({type:$,value:J},Z)=>fG[Z]??a5[$](J),fG=["input","output","output"],s1=()=>{return},Q3=()=>"input",a5={generator:s1,asyncGenerator:s1,fileUrl:s1,filePath:s1,iterable:Q3,asyncIterable:Q3,uint8Array:Q3,webStream:($)=>A4($)?"output":"input",nodeStream($){if(!C1($,{checkOpen:!1}))return"output";return n2($,{checkOpen:!1})?void 0:"input"},webTransform:s1,duplex:s1,native($){let J=kG($);if(J!==void 0)return J;if(u0($,{checkOpen:!1}))return a5.nodeStream($)}},kG=($)=>{if([0,X3.stdin].includes($))return"input";if([1,2,X3.stdout,X3.stderr].includes($))return"output"},bG="output";var r5=($,J)=>J&&!$.includes("ipc")?[...$,"ipc"]:$;var s5=({stdio:$,ipc:J,buffer:Z,...X},q,Y)=>{let Q=yG($,X).map((G,H)=>e5(G,H));return Y?uG(Q,Z,q):r5(Q,J)},yG=($,J)=>{if($===void 0)return h0.map((X)=>J[X]);if(gG(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${h0.map((X)=>`\`${X}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let Z=Math.max($.length,h0.length);return Array.from({length:Z},(X,q)=>$[q])},gG=($)=>h0.some((J)=>$[J]!==void 0),e5=($,J)=>{if(Array.isArray($))return $.map((Z)=>e5(Z,J));if($===null||$===void 0)return J>=h0.length?"ignore":"pipe";return $},uG=($,J,Z)=>$.map((X,q)=>!J[q]&&q!==0&&!c1(Z,q)&&mG(X)?"ignore":X),mG=($)=>$==="pipe"||Array.isArray($)&&$.every((J)=>J==="pipe");import{readFileSync as cG}from"node:fs";import pG from"node:tty";var JJ=({stdioItem:$,stdioItem:{type:J},isStdioArray:Z,fdNumber:X,direction:q,isSync:Y})=>{if(!Z||J!=="native")return $;return Y?dG({stdioItem:$,fdNumber:X,direction:q}):iG({stdioItem:$,fdNumber:X})},dG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X,direction:q})=>{let Y=lG({value:J,optionName:Z,fdNumber:X,direction:q});if(Y!==void 0)return Y;if(u0(J,{checkOpen:!1}))throw TypeError(`The \`${Z}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},lG=({value:$,optionName:J,fdNumber:Z,direction:X})=>{let q=nG($,Z);if(q===void 0)return;if(X==="output")return{type:"fileNumber",value:q,optionName:J};if(pG.isatty(q))throw TypeError(`The \`${J}: ${q4($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:e0(cG(q)),optionName:J}},nG=($,J)=>{if($==="inherit")return J;if(typeof $==="number")return $;let Z=g$.indexOf($);if(Z!==-1)return Z},iG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X})=>{if(J==="inherit")return{type:"nodeStream",value:$J(X,J,Z),optionName:Z};if(typeof J==="number")return{type:"nodeStream",value:$J(J,J,Z),optionName:Z};if(u0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:Z};return $},$J=($,J,Z)=>{let X=g$[$];if(X===void 0)throw TypeError(`The \`${Z}: ${J}\` option is invalid: no such standard stream.`);return X};var ZJ=({input:$,inputFile:J},Z)=>Z===0?[...oG($),...aG(J)]:[],oG=($)=>$===void 0?[]:[{type:tG($),value:$,optionName:"input"}],tG=($)=>{if(C1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(B0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},aG=($)=>$===void 0?[]:[{...rG($),optionName:"inputFile"}],rG=($)=>{if(E4($))return{type:"fileUrl",value:$};if(e2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var XJ=($)=>$.filter((J,Z)=>$.every((X,q)=>J.value!==X.value||Z>=q||J.type==="generator"||J.type==="asyncGenerator")),QJ=({stdioItem:{type:$,value:J,optionName:Z},direction:X,fileDescriptors:q,isSync:Y})=>{let Q=sG(q,$);if(Q.length===0)return;if(Y){eG({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});return}if(l5.has($))return qJ({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});if(n5.has($))JH({otherStdioItems:Q,type:$,value:J,optionName:Z})},sG=($,J)=>$.flatMap(({direction:Z,stdioItems:X})=>X.filter((q)=>q.type===J).map((q)=>({...q,direction:Z}))),eG=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{if(J3.has(J))qJ({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})},qJ=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{let Y=$.filter((G)=>$H(G,Z));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return YJ(Q,X,J),q==="output"?Y[0].stream:void 0},$H=({type:$,value:J},Z)=>{if($==="filePath")return J.file===Z.file;if($==="fileUrl")return J.href===Z.href;return J===Z},JH=({otherStdioItems:$,type:J,value:Z,optionName:X})=>{let q=$.find(({value:{transform:Y}})=>Y===Z.transform);YJ(q,X,J)},YJ=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${J}\` options must not target ${H1[Z]} that is the same.`)};var N4=($,J,Z,X)=>{let Y=s5(J,Z,X).map((G,H)=>ZH({stdioOption:G,fdNumber:H,options:J,isSync:X})),Q=KH({initialFileDescriptors:Y,addProperties:$,options:J,isSync:X});return J.stdio=Q.map(({stdioItems:G})=>WH(G)),Q},ZH=({stdioOption:$,fdNumber:J,options:Z,isSync:X})=>{let q=u$(J),{stdioItems:Y,isStdioArray:Q}=XH({stdioOption:$,fdNumber:J,options:Z,optionName:q}),G=t5(Y,J,q),H=Y.map((B)=>JJ({stdioItem:B,isStdioArray:Q,fdNumber:J,direction:G,isSync:X})),K=o5(H,q,G,Z),U=i5(K,G);return zH(K,U),{direction:G,objectMode:U,stdioItems:K}},XH=({stdioOption:$,fdNumber:J,options:Z,optionName:X})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>QH(H,X)),...ZJ(Z,J)],Q=XJ(Y),G=Q.length>1;return qH(Q,G,X),GH(Q),{stdioItems:Q,isStdioArray:G}},QH=($,J)=>({type:b5($,J),value:$,optionName:J}),qH=($,J,Z)=>{if($.length===0)throw TypeError(`The \`${Z}\` option must not be an empty array.`);if(!J)return;for(let{value:X,optionName:q}of $)if(YH.has(X))throw Error(`The \`${q}\` option must not include \`${X}\`.`)},YH=new Set(["ignore","ipc"]),GH=($)=>{for(let J of $)HH(J)},HH=({type:$,value:J,optionName:Z})=>{if(m5(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:O,shortMessage:n,message:W0}},YG=({originalError:$,timedOut:J,timeout:Z,isMaxBuffer:X,maxBuffer:q,errorCode:Y,signal:Q,signalDescription:G,exitCode:H,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:B,forceKillAfterDelay:U,killSignal:_})=>{let T=GG(B,U);if(J)return`Command timed out after ${Z} milliseconds${T}`;if(W){if(Q===void 0)return`Command was gracefully canceled with exit code ${H}`;return B?`Command was gracefully canceled${T}`:`Command was gracefully canceled with ${Q} (${G})`}if(K)return`Command was canceled${T}`;if(X)return`${A5($,q)}${T}`;if(Y!==void 0)return`Command failed with ${Y}${T}`;if(B)return`Command was killed with ${_} (${X4(_)})${T}`;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"},GG=($,J)=>$?` and was forcefully terminated after ${J} milliseconds`:"",HG=($,J)=>{if($ instanceof n0)return;let Z=H8($)?$.originalMessage:String($?.message??$),X=_$(K5(Z,J));return X===""?void 0:X},zG=($)=>typeof $==="string"?$:qG($),KG=($)=>Array.isArray($)?$.map((J)=>s1(D5(J))).filter(Boolean).join(`
|
|
37
|
+
`):D5($),D5=($)=>{if(typeof $==="string")return $;if(B0($))return g$($);return""};var E4=({command:$,escapedCommand:J,stdio:Z,all:X,ipcOutput:q,options:{cwd:Y},startTime:Q})=>S5({command:$,escapedCommand:J,cwd:Y,durationMs:A2(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:[]}),$$=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:Q})=>j$({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}),j$=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,stdio:B,all:U,ipcOutput:_,options:{timeoutDuration:T,timeout:L=T,forceKillAfterDelay:P,killSignal:I,cwd:D,maxBuffer:m},isSync:O})=>{let{exitCode:l,signal:n,signalDescription:o}=WG(K,W),{originalMessage:W0,shortMessage:d,message:d0}=v5({stdio:B,all:U,ipcOutput:_,originalError:$,signal:n,signalDescription:o,exitCode:l,escapedCommand:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:P,killSignal:I,maxBuffer:m,timeout:L,cwd:D}),C=Y8($,d0,O);return Object.assign(C,BG({error:C,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:U,ipcOutput:_,cwd:D,originalMessage:W0,shortMessage:d})),C},BG=({error:$,command:J,escapedCommand:Z,startTime:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:B,stdio:U,all:_,ipcOutput:T,cwd:L,originalMessage:P,shortMessage:I})=>S5({shortMessage:I,originalMessage:P,command:J,escapedCommand:Z,cwd:L,durationMs:A2(X),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:W!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:B,code:$.cause?.code,stdout:U[1],stderr:U[2],all:_,stdio:U,ipcOutput:T,pipedFrom:[]}),S5=($)=>Object.fromEntries(Object.entries($).filter(([,J])=>J!==void 0)),WG=($,J)=>{let Z=$===null?void 0:$,X=J===null?void 0:J,q=X===void 0?void 0:X4(J);return{exitCode:Z,signal:X,signalDescription:q}};var f5=($)=>Number.isFinite($)?$:0;function UG($){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(f5($*1000)%1000),nanoseconds:Math.trunc(f5($*1e6)%1000)}}function VG($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function J3($){switch(typeof $){case"number":{if(Number.isFinite($))return UG($);break}case"bigint":return VG($)}throw TypeError("Expected a finite number or bigint")}var LG=($)=>$===0||$===0n,_G=($,J)=>J===1||J===1n?$:`${$}s`,RG=0.0000001,TG=24n*60n*60n*1000n;function Z3($,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=(W,B)=>{let U=Math.floor(W*10**B+RG);return(Math.round(U)/10**B).toFixed(B)},Q=(W,B,U,_)=>{if((q.length===0||!J.colonNotation)&&LG(W)&&!(J.colonNotation&&U==="m"))return;if(_??=String(W),J.colonNotation){let T=_.includes(".")?_.split(".")[0].length:_.length,L=q.length>0?2:1;_="0".repeat(Math.max(0,L-T))+_}else _+=J.verbose?" "+_G(B,W):U;q.push(_)},G=J3($),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 W=Number(G.seconds),B=Number(G.milliseconds),U=Number(G.microseconds),_=Number(G.nanoseconds);if(Q(W,"second","s"),J.formatSubMilliseconds)Q(B,"millisecond","ms"),Q(U,"microsecond","µs"),Q(_,"nanosecond","ns");else{let T=B+U/1000+_/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,P=T>=1?Math.round(T):Math.ceil(T),I=L?T.toFixed(L):P;Q(Number.parseFloat(I),"millisecond","ms",I)}}else{let W=(Z?Number($%TG):$)/1000%60,B=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,U=Y(W,B),_=J.keepDecimalsOnWholeSeconds?U:U.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 k5=($,J)=>{if($.failed)l0({type:"error",verboseMessage:$.shortMessage,verboseInfo:J,result:$})};var b5=($,J)=>{if(!l1(J))return;k5($,J),MG($,J)},MG=($,J)=>{let Z=`(done in ${Z3($.durationMs)})`;l0({type:"duration",verboseMessage:Z,verboseInfo:J,result:$})};var J$=($,J,{reject:Z})=>{if(b5($,J),$.failed&&Z)throw $;return $};import{readFileSync as KJ}from"node:fs";var u5=($,J)=>{if(P1($))return"asyncGenerator";if(p5($))return"generator";if(A4($))return"fileUrl";if(PG($))return"filePath";if(wG($))return"webStream";if(u0($,{checkOpen:!1}))return"native";if(B0($))return"uint8Array";if(EG($))return"asyncIterable";if(AG($))return"iterable";if(q3($))return m5({transform:$},J);if(xG($))return CG($,J);return"native"},CG=($,J)=>{if(s2($.transform,{checkOpen:!1}))return FG($,J);if(q3($.transform))return m5($,J);return jG($,J)},FG=($,J)=>{return c5($,J,"Duplex stream"),"duplex"},m5=($,J)=>{return c5($,J,"web TransformStream"),"webTransform"},c5=({final:$,binary:J,objectMode:Z},X,q)=>{y5($,`${X}.final`,q),y5(J,`${X}.binary`,q),X3(Z,`${X}.objectMode`)},y5=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${Z}.`)},jG=({transform:$,final:J,binary:Z,objectMode:X},q)=>{if($!==void 0&&!g5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(s2(J,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if(q3(J))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!g5(J))throw TypeError(`The \`${q}.final\` option must be a generator.`);return X3(Z,`${q}.binary`),X3(X,`${q}.objectMode`),P1($)||P1(J)?"asyncGenerator":"generator"},X3=($,J)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},g5=($)=>P1($)||p5($),P1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",p5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",xG=($)=>Q0($)&&($.transform!==void 0||$.final!==void 0),A4=($)=>Object.prototype.toString.call($)==="[object URL]",d5=($)=>A4($)&&$.protocol!=="file:",PG=($)=>Q0($)&&Object.keys($).length>0&&Object.keys($).every((J)=>IG.has(J))&&Q3($.file),IG=new Set(["file","append"]),Q3=($)=>typeof $==="string",l5=($,J)=>$==="native"&&typeof J==="string"&&!OG.has(J),OG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),n5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",N4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",wG=($)=>n5($)||N4($),q3=($)=>n5($?.readable)&&N4($?.writable),EG=($)=>i5($)&&typeof $[Symbol.asyncIterator]==="function",AG=($)=>i5($)&&typeof $[Symbol.iterator]==="function",i5=($)=>typeof $==="object"&&$!==null,D0=new Set(["generator","asyncGenerator","duplex","webTransform"]),h4=new Set(["fileUrl","filePath","fileNumber"]),Y3=new Set(["fileUrl","filePath"]),o5=new Set([...Y3,"webStream","nodeStream"]),t5=new Set(["webTransform","duplex"]),B1={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 G3=($,J,Z,X)=>X==="output"?NG($,J,Z):hG($,J,Z),NG=($,J,Z)=>{let X=J!==0&&Z[J-1].value.readableObjectMode;return{writableObjectMode:X,readableObjectMode:$??X}},hG=($,J,Z)=>{let X=J===0?$===!0:Z[J-1].value.readableObjectMode,q=J!==Z.length-1&&($??X);return{writableObjectMode:X,readableObjectMode:q}},a5=($,J)=>{let Z=$.findLast(({type:X})=>D0.has(X));if(Z===void 0)return!1;return J==="input"?Z.value.writableObjectMode:Z.value.readableObjectMode};var r5=($,J,Z,X)=>[...$.filter(({type:q})=>!D0.has(q)),...DG($,J,Z,X)],DG=($,J,Z,{encoding:X})=>{let q=$.filter(({type:Q})=>D0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=vG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:J,direction:Z,encoding:X});return bG(Y,Z)},vG=({stdioItem:$,stdioItem:{type:J},index:Z,newTransforms:X,optionName:q,direction:Y,encoding:Q})=>{if(J==="duplex")return SG({stdioItem:$,optionName:q});if(J==="webTransform")return fG({stdioItem:$,index:Z,newTransforms:X,direction:Y});return kG({stdioItem:$,index:Z,newTransforms:X,direction:Y,encoding:Q})},SG=({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}}},fG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q})=>{let{transform:Y,objectMode:Q}=Q0(J)?J:{transform:J},{writableObjectMode:G,readableObjectMode:H}=G3(Q,Z,X,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},kG=({stdioItem:$,stdioItem:{value:J},index:Z,newTransforms:X,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:K=!1,objectMode:W}=Q0(J)?J:{transform:J},B=H||I0.has(Y),{writableObjectMode:U,readableObjectMode:_}=G3(W,Z,X,q);return{...$,value:{transform:Q,final:G,binary:B,preserveNewlines:K,writableObjectMode:U,readableObjectMode:_}}},bG=($,J)=>J==="input"?$.reverse():$;import H3 from"node:process";var s5=($,J,Z)=>{let X=$.map((q)=>yG(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)??mG},yG=({type:$,value:J},Z)=>gG[Z]??e5[$](J),gG=["input","output","output"],Z$=()=>{return},z3=()=>"input",e5={generator:Z$,asyncGenerator:Z$,fileUrl:Z$,filePath:Z$,iterable:z3,asyncIterable:z3,uint8Array:z3,webStream:($)=>N4($)?"output":"input",nodeStream($){if(!x1($,{checkOpen:!1}))return"output";return r2($,{checkOpen:!1})?void 0:"input"},webTransform:Z$,duplex:Z$,native($){let J=uG($);if(J!==void 0)return J;if(u0($,{checkOpen:!1}))return e5.nodeStream($)}},uG=($)=>{if([0,H3.stdin].includes($))return"input";if([1,2,H3.stdout,H3.stderr].includes($))return"output"},mG="output";var $J=($,J)=>J&&!$.includes("ipc")?[...$,"ipc"]:$;var JJ=({stdio:$,ipc:J,buffer:Z,...X},q,Y)=>{let Q=cG($,X).map((G,H)=>ZJ(G,H));return Y?dG(Q,Z,q):$J(Q,J)},cG=($,J)=>{if($===void 0)return h0.map((X)=>J[X]);if(pG(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${h0.map((X)=>`\`${X}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let Z=Math.max($.length,h0.length);return Array.from({length:Z},(X,q)=>$[q])},pG=($)=>h0.some((J)=>$[J]!==void 0),ZJ=($,J)=>{if(Array.isArray($))return $.map((Z)=>ZJ(Z,J));if($===null||$===void 0)return J>=h0.length?"ignore":"pipe";return $},dG=($,J,Z)=>$.map((X,q)=>!J[q]&&q!==0&&!n1(Z,q)&&lG(X)?"ignore":X),lG=($)=>$==="pipe"||Array.isArray($)&&$.every((J)=>J==="pipe");import{readFileSync as nG}from"node:fs";import iG from"node:tty";var QJ=({stdioItem:$,stdioItem:{type:J},isStdioArray:Z,fdNumber:X,direction:q,isSync:Y})=>{if(!Z||J!=="native")return $;return Y?oG({stdioItem:$,fdNumber:X,direction:q}):rG({stdioItem:$,fdNumber:X})},oG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X,direction:q})=>{let Y=tG({value:J,optionName:Z,fdNumber:X,direction:q});if(Y!==void 0)return Y;if(u0(J,{checkOpen:!1}))throw TypeError(`The \`${Z}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},tG=({value:$,optionName:J,fdNumber:Z,direction:X})=>{let q=aG($,Z);if(q===void 0)return;if(X==="output")return{type:"fileNumber",value:q,optionName:J};if(iG.isatty(q))throw TypeError(`The \`${J}: ${Y4($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:e0(nG(q)),optionName:J}},aG=($,J)=>{if($==="inherit")return J;if(typeof $==="number")return $;let Z=u$.indexOf($);if(Z!==-1)return Z},rG=({stdioItem:$,stdioItem:{value:J,optionName:Z},fdNumber:X})=>{if(J==="inherit")return{type:"nodeStream",value:XJ(X,J,Z),optionName:Z};if(typeof J==="number")return{type:"nodeStream",value:XJ(J,J,Z),optionName:Z};if(u0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:Z};return $},XJ=($,J,Z)=>{let X=u$[$];if(X===void 0)throw TypeError(`The \`${Z}: ${J}\` option is invalid: no such standard stream.`);return X};var qJ=({input:$,inputFile:J},Z)=>Z===0?[...sG($),...$H(J)]:[],sG=($)=>$===void 0?[]:[{type:eG($),value:$,optionName:"input"}],eG=($)=>{if(x1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(B0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},$H=($)=>$===void 0?[]:[{...JH($),optionName:"inputFile"}],JH=($)=>{if(A4($))return{type:"fileUrl",value:$};if(Q3($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var YJ=($)=>$.filter((J,Z)=>$.every((X,q)=>J.value!==X.value||Z>=q||J.type==="generator"||J.type==="asyncGenerator")),GJ=({stdioItem:{type:$,value:J,optionName:Z},direction:X,fileDescriptors:q,isSync:Y})=>{let Q=ZH(q,$);if(Q.length===0)return;if(Y){XH({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});return}if(o5.has($))return HJ({otherStdioItems:Q,type:$,value:J,optionName:Z,direction:X});if(t5.has($))qH({otherStdioItems:Q,type:$,value:J,optionName:Z})},ZH=($,J)=>$.flatMap(({direction:Z,stdioItems:X})=>X.filter((q)=>q.type===J).map((q)=>({...q,direction:Z}))),XH=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{if(Y3.has(J))HJ({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})},HJ=({otherStdioItems:$,type:J,value:Z,optionName:X,direction:q})=>{let Y=$.filter((G)=>QH(G,Z));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return zJ(Q,X,J),q==="output"?Y[0].stream:void 0},QH=({type:$,value:J},Z)=>{if($==="filePath")return J.file===Z.file;if($==="fileUrl")return J.href===Z.href;return J===Z},qH=({otherStdioItems:$,type:J,value:Z,optionName:X})=>{let q=$.find(({value:{transform:Y}})=>Y===Z.transform);zJ(q,X,J)},zJ=($,J,Z)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${J}\` options must not target ${B1[Z]} that is the same.`)};var D4=($,J,Z,X)=>{let Y=JJ(J,Z,X).map((G,H)=>YH({stdioOption:G,fdNumber:H,options:J,isSync:X})),Q=VH({initialFileDescriptors:Y,addProperties:$,options:J,isSync:X});return J.stdio=Q.map(({stdioItems:G})=>RH(G)),Q},YH=({stdioOption:$,fdNumber:J,options:Z,isSync:X})=>{let q=m$(J),{stdioItems:Y,isStdioArray:Q}=GH({stdioOption:$,fdNumber:J,options:Z,optionName:q}),G=s5(Y,J,q),H=Y.map((B)=>QJ({stdioItem:B,isStdioArray:Q,fdNumber:J,direction:G,isSync:X})),K=r5(H,q,G,Z),W=a5(K,G);return UH(K,W),{direction:G,objectMode:W,stdioItems:K}},GH=({stdioOption:$,fdNumber:J,options:Z,optionName:X})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>HH(H,X)),...qJ(Z,J)],Q=YJ(Y),G=Q.length>1;return zH(Q,G,X),BH(Q),{stdioItems:Q,isStdioArray:G}},HH=($,J)=>({type:u5($,J),value:$,optionName:J}),zH=($,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(KH.has(X))throw Error(`The \`${q}\` option must not include \`${X}\`.`)},KH=new Set(["ignore","ipc"]),BH=($)=>{for(let J of $)WH(J)},WH=({type:$,value:J,optionName:Z})=>{if(d5(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(l5($,J))throw TypeError(`The \`${Z}: { file: '...' }\` option must be used instead of \`${Z}: '...'\`.`)},UH=($,J)=>{if(!J)return;let Z=$.find(({type:X})=>h4.has(X));if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` option cannot use both files and transforms in objectMode.`)},VH=({initialFileDescriptors:$,addProperties:J,options:Z,isSync:X})=>{let q=[];try{for(let Y of $)q.push(LH({fileDescriptor:Y,fileDescriptors:q,addProperties:J,options:Z,isSync:X}));return q}catch(Y){throw K3(q),Y}},LH=({fileDescriptor:{direction:$,objectMode:J,stdioItems:Z},fileDescriptors:X,addProperties:q,options:Y,isSync:Q})=>{let G=Z.map((H)=>_H({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:X,isSync:Q}));return{direction:$,objectMode:J,stdioItems:G}},_H=({stdioItem:$,addProperties:J,direction:Z,options:X,fileDescriptors:q,isSync:Y})=>{let Q=GJ({stdioItem:$,direction:Z,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...J[Z][$.type]($,X)}},K3=($)=>{for(let{stdioItems:J}of $)for(let{stream:Z}of J)if(Z!==void 0&&!y0(Z))Z.destroy()},RH=($)=>{if($.length>1)return $.some(({value:X})=>X==="overlapped")?"overlapped":"pipe";let[{type:J,value:Z}]=$;return J==="native"?Z:"pipe"};var WJ=($,J)=>D4(MH,$,J,!0),t0=({type:$,optionName:J})=>{UJ(J,B1[$])},TH=({optionName:$,value:J})=>{if(J==="ipc"||J==="overlapped")UJ($,`"${J}"`);return{}},UJ=($,J)=>{throw TypeError(`The \`${$}\` option cannot be ${J} with synchronous methods.`)},BJ={generator(){},asyncGenerator:t0,webStream:t0,nodeStream:t0,webTransform:t0,duplex:t0,asyncIterable:t0,native:TH},MH={input:{...BJ,fileUrl:({value:$})=>({contents:[e0(KJ($))]}),filePath:({value:{file:$}})=>({contents:[e0(KJ($))]}),fileNumber:t0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...BJ,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:J}})=>({path:$,append:J}),fileNumber:({value:$})=>({path:$}),iterable:t0,string:t0,uint8Array:t0}};var X1=($,{stripFinalNewline:J},Z)=>B3(J,Z)&&$!==void 0&&!Array.isArray($)?s1($):$,B3=($,J)=>J==="all"?$[1]||$[2]:$[J];import{Transform as uH,getDefaultHighWaterMark as PJ}from"node:stream";var v4=($,J,Z,X)=>$||Z?void 0:LJ(J,X),U3=($,J,Z)=>Z?$.flatMap((X)=>VJ(X,J)):VJ($,J),VJ=($,J)=>{let{transform:Z,final:X}=LJ(J,{});return[...Z($),...X()]},LJ=($,J)=>{return J.previousChunks="",{transform:CH.bind(void 0,J,$),final:jH.bind(void 0,J)}},CH=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=FH(Z,Y,J,$),G=Z.slice(q+1,Y+1-Q);if(X.length>0)G=W3(X,G),X="";yield G,q=Y}if(q!==Z.length-1)X=W3(X,Z.slice(q+1));$.previousChunks=X},FH=($,J,Z,X)=>{if(Z)return 0;return X.isWindowsNewline=J!==0&&$[J-1]==="\r",X.isWindowsNewline?2:1},jH=function*({previousChunks:$}){if($.length>0)yield $},_J=({binary:$,preserveNewlines:J,readableObjectMode:Z,state:X})=>$||J||Z?void 0:{transform:xH.bind(void 0,X)},xH=function*({isWindowsNewline:$=!1},J){let{unixNewline:Z,windowsNewline:X,LF:q,concatBytes:Y}=typeof J==="string"?PH:OH;if(J.at(-1)===q){yield J;return}yield Y(J,$?X:Z)},W3=($,J)=>`${$}${J}`,PH={windowsNewline:`\r
|
|
40
40
|
`,unixNewline:`
|
|
41
41
|
`,LF:`
|
|
42
|
-
`,concatBytes:
|
|
42
|
+
`,concatBytes:W3},IH=($,J)=>{let Z=new Uint8Array($.length+J.length);return Z.set($,0),Z.set(J,$.length),Z},OH={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:IH};import{Buffer as wH}from"node:buffer";var RJ=($,J)=>$?void 0:EH.bind(void 0,J),EH=function*($,J){if(typeof J!=="string"&&!B0(J)&&!wH.isBuffer(J))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof J}.`);yield J},TJ=($,J)=>$?AH.bind(void 0,J):NH.bind(void 0,J),AH=function*($,J){MJ($,J),yield J},NH=function*($,J){if(MJ($,J),typeof J!=="string"&&!B0(J))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof J}.`);yield J},MJ=($,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 wH}from"node:buffer";import{StringDecoder as EH}from"node:string_decoder";var v4=($,J,Z)=>{if(Z)return;if($)return{transform:AH.bind(void 0,new TextEncoder)};let X=new EH(J);return{transform:hH.bind(void 0,X),final:NH.bind(void 0,X)}},AH=function*($,J){if(wH.isBuffer(J))yield e0(J);else if(typeof J==="string")yield $.encode(J);else yield J},hH=function*($,J){yield B0(J)?$.write(J):J},NH=function*($){let J=$.end();if(J!=="")yield J};import{callbackify as RJ}from"node:util";var z3=RJ(async($,J,Z,X)=>{J.currentIterable=$(...Z);try{for await(let q of J.currentIterable)X.push(q)}finally{delete J.currentIterable}}),S4=async function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=vH}=J[Z];for await(let q of X($))yield*S4(q,J,Z+1)},TJ=async function*($){for(let[J,{final:Z}]of Object.entries($))yield*DH(Z,Number(J),$)},DH=async function*($,J,Z){if($===void 0)return;for await(let X of $())yield*S4(X,Z,J+1)},MJ=RJ(async({currentIterable:$},J)=>{if($!==void 0){await(J?$.throw(J):$.return());return}if(J)throw J}),vH=function*($){yield $};var K3=($,J,Z,X)=>{try{for(let q of $(...J))Z.push(q);X()}catch(q){X(q)}},CJ=($,J)=>[...J.flatMap((Z)=>[...j1(Z,$,0)]),...M$($)],j1=function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=fH}=J[Z];for(let q of X($))yield*j1(q,J,Z+1)},M$=function*($){for(let[J,{final:Z}]of Object.entries($))yield*SH(Z,Number(J),$)},SH=function*($,J,Z){if($===void 0)return;for(let X of $())yield*j1(X,Z,J+1)},fH=function*($){yield $};var B3=({value:$,value:{transform:J,final:Z,writableObjectMode:X,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=jJ($,Q,Y),K=F1(J),U=F1(Z),B=K?z3.bind(void 0,S4,G):K3.bind(void 0,j1),W=K||U?z3.bind(void 0,TJ,G):K3.bind(void 0,M$),_=K||U?MJ.bind(void 0,G):void 0;return{stream:new kH({writableObjectMode:X,writableHighWaterMark:FJ(X),readableObjectMode:q,readableHighWaterMark:FJ(q),transform(L,x,j){B([L,H,0],this,j)},flush(L){W([H],this,L)},destroy:_})}},f4=($,J,Z,X)=>{let q=J.filter(({type:Q})=>Q==="generator"),Y=X?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=jJ(Q,Z,G);$=CJ(H,$)}return $},jJ=({transform:$,final:J,binary:Z,writableObjectMode:X,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:VJ(X,G)},v4(Z,Q,X),D4(Z,Y,X,H),{transform:$,final:J},{transform:LJ(q,G)},WJ({binary:Z,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var xJ=($,J)=>{for(let Z of bH($))yH($,Z,J)},bH=($)=>new Set(Object.entries($).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),yH=($,J,Z)=>{let{stdioItems:X}=$[J],q=X.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(J!==0){let[{type:G,optionName:H}]=q;throw TypeError(`Only the \`stdin\` option, not \`${H}\`, can be ${H1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>gH(G,X));Z.input=B$(Q)},gH=($,J)=>{let Z=f4($,J,"utf8",!0);return uH(Z),B$(Z)},uH=($)=>{let J=$.find((Z)=>typeof Z!=="string"&&!B0(Z));if(J!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${J}.`)};import{writeFileSync as dH,appendFileSync as lH}from"node:fs";var k4=({stdioItems:$,encoding:J,verboseInfo:Z,fdNumber:X})=>X!=="all"&&c1(Z,X)&&!x0.has(J)&&mH(X)&&($.some(({type:q,value:Y})=>q==="native"&&cH.has(Y))||$.every(({type:q})=>N0.has(q))),mH=($)=>$===1||$===2,cH=new Set(["pipe","overlapped"]),PJ=async($,J,Z,X)=>{for await(let q of $)if(!pH(J))OJ(q,Z,X)},IJ=($,J,Z)=>{for(let X of $)OJ(X,J,Z)},pH=($)=>$._readableState.pipes.length>0,OJ=($,J,Z)=>{let X=n$($);p0({type:"output",verboseMessage:X,fdNumber:J,verboseInfo:Z})};var wJ=({fileDescriptors:$,syncResult:{output:J},options:Z,isMaxBuffer:X,verboseInfo:q})=>{if(J===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:J.map((H,K)=>nH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:X,verboseInfo:q},Z)),...Y}},nH=({result:$,fileDescriptors:J,fdNumber:Z,state:X,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:K,stripFinalNewline:U,maxBuffer:B})=>{if($===null)return;let W=E5($,Y,B),_=e0(W),{stdioItems:R,objectMode:L}=J[Z],x=iH([_],R,H,X),{serializedResult:j,finalResult:D=j}=oH({chunks:x,objectMode:L,encoding:H,lines:K,stripFinalNewline:U,fdNumber:Z});tH({serializedResult:j,fdNumber:Z,state:X,verboseInfo:Q,encoding:H,stdioItems:R,objectMode:L});let p=G[Z]?D:void 0;try{if(X.error===void 0)aH(j,R,q);return p}catch(P){return X.error=P,p}},iH=($,J,Z,X)=>{try{return f4($,J,Z,!1)}catch(q){return X.error=q,$}},oH=({chunks:$,objectMode:J,encoding:Z,lines:X,stripFinalNewline:q,fdNumber:Y})=>{if(J)return{serializedResult:$};if(Z==="buffer")return{serializedResult:B$($)};let Q=c6($,Z);if(X[Y])return{serializedResult:Q,finalResult:H3(Q,!q[Y],J)};return{serializedResult:Q}},tH=({serializedResult:$,fdNumber:J,state:Z,verboseInfo:X,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!k4({stdioItems:Y,encoding:q,verboseInfo:X,fdNumber:J}))return;let G=H3($,!1,Q);try{IJ(G,J,X)}catch(H){Z.error??=H}},aH=($,J,Z)=>{for(let{path:X,append:q}of J.filter(({type:Y})=>h4.has(Y))){let Y=typeof X==="string"?X:X.toString();if(q||Z.has(Y))lH(X,$);else Z.add(Y),dH(X,$)}};var EJ=([,$,J],Z)=>{if(!Z.all)return;if($===void 0)return J;if(J===void 0)return $;if(Array.isArray($))return Array.isArray(J)?[...$,...J]:[...$,X1(J,Z,"all")];if(Array.isArray(J))return[X1($,Z,"all"),...J];if(B0($)&&B0(J))return R2([$,J]);return`${$}${J}`};import{once as U3}from"node:events";var AJ=async($,J)=>{let[Z,X]=await rH($);return J.isForcefullyTerminated??=!1,[Z,X]},rH=async($)=>{let[J,Z]=await Promise.allSettled([U3($,"spawn"),U3($,"exit")]);if(J.status==="rejected")return[];return Z.status==="rejected"?hJ($):Z.value},hJ=async($)=>{try{return await U3($,"exit")}catch{return hJ($)}},NJ=async($)=>{let[J,Z]=await $;if(!sH(J,Z)&&W3(J,Z))throw new d0;return[J,Z]},sH=($,J)=>$===void 0&&J===void 0,W3=($,J)=>$!==0||J!==null;var DJ=({error:$,status:J,signal:Z,output:X},{maxBuffer:q})=>{let Y=eH($,J,Z),Q=Y?.code==="ETIMEDOUT",G=w5(Y,X,q);return{resultError:Y,exitCode:J,signal:Z,timedOut:Q,isMaxBuffer:G}},eH=($,J,Z)=>{if($!==void 0)return $;return W3(J,Z)?new d0:void 0};var vJ=($,J,Z)=>{let{file:X,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:U}=Jz($,J,Z),B=Qz({file:X,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:U,startTime:G});return r1(B,H,K)},Jz=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=o$($,J,Z),G=Zz(Z),{file:H,commandArguments:K,options:U}=R4($,J,G);Xz(U);let B=zJ(U,Q);return{file:H,commandArguments:K,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},Zz=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,Xz=({ipc:$,ipcInput:J,detached:Z,cancelSignal:X})=>{if(J)b4("ipcInput");if($)b4("ipc: true");if(Z)b4("detached: true");if(X)b4("cancelSignal")},b4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},Qz=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=qz({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:K,exitCode:U,signal:B,timedOut:W,isMaxBuffer:_}=DJ(H,Z),{output:R,error:L=K}=wJ({fileDescriptors:Q,syncResult:H,options:Z,isMaxBuffer:_,verboseInfo:Y}),x=R.map((D,p)=>X1(D,Z,p)),j=X1(EJ(R,Z),Z,"all");return Gz({error:L,exitCode:U,signal:B,timedOut:W,isMaxBuffer:_,stdio:x,all:j,options:Z,command:X,escapedCommand:q,startTime:G})},qz=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{xJ(Y,Z);let G=Yz(Z);return $z(...T4($,J,G))}catch(G){return a1({error:G,command:X,escapedCommand:q,fileDescriptors:Y,options:Z,startTime:Q,isSync:!0})}},Yz=({encoding:$,maxBuffer:J,...Z})=>({...Z,encoding:"buffer",maxBuffer:O4(J)}),Gz=({error:$,exitCode:J,signal:Z,timedOut:X,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:U})=>$===void 0?w4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U}):T$({error:$,command:H,escapedCommand:K,timedOut:X,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:J,signal:Z,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U,isSync:!0});import{setMaxListeners as oK}from"node:events";import{spawn as tK}from"node:child_process";import yJ from"node:process";import{once as V3,on as Hz}from"node:events";var SJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0,filter:Y}={})=>{return l1({methodName:"getOneMessage",isSubprocess:Z,ipc:X,isConnected:B4($)}),zz({anyProcess:$,channel:J,isSubprocess:Z,filter:Y,reference:q})},zz=async({anyProcess:$,channel:J,isSubprocess:Z,filter:X,reference:q})=>{G4(J,q);let Y=G1($,J,Z),Q=new AbortController;try{return await Promise.race([Kz(Y,X,Q),Bz(Y,Z,Q),Uz(Y,Z,Q)])}catch(G){throw n1($),G}finally{Q.abort(),H4(J,q)}},Kz=async($,J,{signal:Z})=>{if(J===void 0){let[X]=await V3($,"message",{signal:Z});return X}for await(let[X]of Hz($,"message",{signal:Z}))if(J(X))return X},Bz=async($,J,{signal:Z})=>{await V3($,"disconnect",{signal:Z}),M8(J)},Uz=async($,J,{signal:Z})=>{let[X]=await V3($,"strict:error",{signal:Z});throw Q4(X,J)};import{once as kJ,on as Wz}from"node:events";var bJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0}={})=>L3({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:!Z,reference:q}),L3=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:q,reference:Y})=>{l1({methodName:"getEachMessage",isSubprocess:Z,ipc:X,isConnected:B4($)}),G4(J,Y);let Q=G1($,J,Z),G=new AbortController,H={};return Vz($,Q,G),Lz({ipcEmitter:Q,isSubprocess:Z,controller:G,state:H}),_z({anyProcess:$,channel:J,ipcEmitter:Q,isSubprocess:Z,shouldAwait:q,controller:G,state:H,reference:Y})},Vz=async($,J,Z)=>{try{await kJ(J,"disconnect",{signal:Z.signal}),Z.abort()}catch{}},Lz=async({ipcEmitter:$,isSubprocess:J,controller:Z,state:X})=>{try{let[q]=await kJ($,"strict:error",{signal:Z.signal});X.error=Q4(q,J),Z.abort()}catch{}},_z=async function*({anyProcess:$,channel:J,ipcEmitter:Z,isSubprocess:X,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of Wz(Z,"message",{signal:Y.signal}))fJ(Q),yield H}catch{fJ(Q)}finally{if(Y.abort(),H4(J,G),!X)n1($);if(q)await $}},fJ=({error:$})=>{if($)throw $};var gJ=($,{ipc:J})=>{Object.assign($,mJ($,!1,J))},uJ=()=>{let $=yJ,J=!0,Z=yJ.channel!==void 0;return{...mJ($,!0,Z),getCancelSignal:n8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:Z})}},mJ=($,J,Z)=>({sendMessage:L4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getOneMessage:SJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getEachMessage:bJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z})});import{ChildProcess as Rz}from"node:child_process";import{PassThrough as Tz,Readable as Mz,Writable as Cz,Duplex as Fz}from"node:stream";var cJ=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,verboseInfo:Q})=>{q3(X);let G=new Rz;jz(G,X),Object.assign(G,{readable:xz,writable:Pz,duplex:Iz});let H=a1({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:!1}),K=Oz(H,Q,q);return{subprocess:G,promise:K}},jz=($,J)=>{let Z=C$(),X=C$(),q=C$(),Y=Array.from({length:J.length-3},C$),Q=C$(),G=[Z,X,q,...Y];Object.assign($,{stdin:Z,stdout:X,stderr:q,all:Q,stdio:G})},C$=()=>{let $=new Tz;return $.end(),$},xz=()=>new Mz({read(){}}),Pz=()=>new Cz({write(){}}),Iz=()=>new Fz({read(){},write(){}}),Oz=async($,J,Z)=>r1($,J,Z);import{createReadStream as pJ,createWriteStream as dJ}from"node:fs";import{Buffer as wz}from"node:buffer";import{Readable as F$,Writable as Ez,Duplex as Az}from"node:stream";var nJ=($,J)=>N4(hz,$,J,!1),j$=({type:$,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${H1[$]}.`)},lJ={fileNumber:j$,generator:B3,asyncGenerator:B3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:J,readableObjectMode:Z}}){let X=J||Z;return{stream:Az.fromWeb($,{objectMode:X})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},hz={input:{...lJ,fileUrl:({value:$})=>({stream:pJ($)}),filePath:({value:{file:$}})=>({stream:pJ($)}),webStream:({value:$})=>({stream:F$.fromWeb($)}),iterable:({value:$})=>({stream:F$.from($)}),asyncIterable:({value:$})=>({stream:F$.from($)}),string:({value:$})=>({stream:F$.from($)}),uint8Array:({value:$})=>({stream:F$.from(wz.from($))})},output:{...lJ,fileUrl:({value:$})=>({stream:dJ($)}),filePath:({value:{file:$,append:J}})=>({stream:dJ($,J?{flags:"a"}:{})}),webStream:({value:$})=>({stream:Ez.fromWeb($)}),iterable:j$,asyncIterable:j$,string:j$,uint8Array:j$}};import{on as Nz,once as iJ}from"node:events";import{PassThrough as Dz,getDefaultHighWaterMark as vz}from"node:stream";import{finished as aJ}from"node:stream/promises";function x1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)_3(q);let J=$.some(({readableObjectMode:q})=>q),Z=Sz($,J),X=new rJ({objectMode:J,writableHighWaterMark:Z,readableHighWaterMark:Z});for(let q of $)X.add(q);return X}var Sz=($,J)=>{if($.length===0)return vz(J);let Z=$.filter(({readableObjectMode:X})=>X===J).map(({readableHighWaterMark:X})=>X);return Math.max(...Z)};class rJ extends Dz{#J=new Set([]);#Z=new Set([]);#$=new Set([]);#X;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(_3($),this.#J.has($))return;this.#J.add($),this.#X??=fz(this,this.#J,this.#q);let J=yz({passThroughStream:this,stream:$,streams:this.#J,ended:this.#Z,aborted:this.#$,onFinished:this.#X,unpipeEvent:this.#q});this.#Q.set($,J),$.pipe(this,{end:!1})}async remove($){if(_3($),!this.#J.has($))return!1;let J=this.#Q.get($);if(J===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await J,!0}}var fz=async($,J,Z)=>{y4($,oJ);let X=new AbortController;try{await Promise.race([kz($,X),bz($,J,Z,X)])}finally{X.abort(),y4($,-oJ)}},kz=async($,{signal:J})=>{try{await aJ($,{signal:J,cleanup:!0})}catch(Z){throw sJ($,Z),Z}},bz=async($,J,Z,{signal:X})=>{for await(let[q]of Nz($,"unpipe",{signal:X}))if(J.has(q))q.emit(Z)},_3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},yz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,onFinished:Y,unpipeEvent:Q})=>{y4($,tJ);let G=new AbortController;try{await Promise.race([gz(Y,J,G),uz({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:G}),mz({stream:J,streams:Z,ended:X,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),y4($,-tJ)}if(Z.size>0&&Z.size===X.size+q.size)if(X.size===0&&q.size>0)R3($);else cz($)},gz=async($,J,{signal:Z})=>{try{if(await $,!Z.aborted)R3(J)}catch(X){if(!Z.aborted)sJ(J,X)}},uz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:{signal:Y}})=>{try{if(await aJ(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 $Z($,Q)}},mz=async({stream:$,streams:J,ended:Z,aborted:X,unpipeEvent:q,controller:{signal:Y}})=>{if(await iJ($,q,{signal:Y}),!$.readable)return iJ(Y,"abort",{signal:Y});J.delete($),Z.delete($),X.delete($)},cz=($)=>{if($.writable)$.end()},sJ=($,J)=>{if(eJ(J))R3($);else $Z($,J)},eJ=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",R3=($)=>{if($.readable||$.writable)$.destroy()},$Z=($,J)=>{if(!$.destroyed)$.once("error",pz),$.destroy(J)},pz=()=>{},y4=($,J)=>{let Z=$.getMaxListeners();if(Z!==0&&Z!==Number.POSITIVE_INFINITY)$.setMaxListeners(Z+J)},oJ=2,tJ=1;import{finished as JZ}from"node:stream/promises";var e1=($,J)=>{$.pipe(J),dz($,J),lz($,J)},dz=async($,J)=>{if(y0($)||y0(J))return;try{await JZ($,{cleanup:!0,readable:!0,writable:!1})}catch{}T3(J)},T3=($)=>{if($.writable)$.end()},lz=async($,J)=>{if(y0($)||y0(J))return;try{await JZ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}M3($)},M3=($)=>{if($.readable)$.destroy()};var ZZ=($,J,Z)=>{let X=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(J)){for(let{stream:G}of Y.filter(({type:H})=>N0.has(H)))nz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!N0.has(H)))oz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:X,controller:Z})}for(let[q,Y]of X.entries()){let Q=Y.length===1?Y[0]:x1(Y);e1(Q,q)}},nz=($,J,Z,X)=>{if(Z==="output")e1($.stdio[X],J);else e1(J,$.stdio[X]);let q=iz[X];if(q!==void 0)$[q]=J;$.stdio[X]=J},iz=["stdin","stdout","stderr"],oz=({subprocess:$,stream:J,direction:Z,fdNumber:X,pipeGroups:q,controller:Y})=>{if(J===void 0)return;tz(J,Y);let[Q,G]=Z==="output"?[J,$.stdio[X]]:[$.stdio[X],J],H=q.get(Q)??[];q.set(Q,[...H,G])},tz=($,{signal:J})=>{if(y0($))M1($,az,J)},az=2;import{addAbortListener as ez}from"node:events";var P1=[];P1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")P1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")P1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var g4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",C3=Symbol.for("signal-exit emitter"),F3=globalThis,rz=Object.defineProperty.bind(Object);class XZ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(F3[C3])return F3[C3];rz(F3,C3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,J){this.listeners[$].push(J)}removeListener($,J){let Z=this.listeners[$],X=Z.indexOf(J);if(X===-1)return;if(X===0&&Z.length===1)Z.length=0;else Z.splice(X,1)}emit($,J,Z){if(this.emitted[$])return!1;this.emitted[$]=!0;let X=!1;for(let q of this.listeners[$])X=q(J,Z)===!0||X;if($==="exit")X=this.emit("afterExit",J,Z)||X;return X}}class x3{}var sz=($)=>{return{onExit(J,Z){return $.onExit(J,Z)},load(){return $.load()},unload(){return $.unload()}}};class QZ extends x3{onExit(){return()=>{}}load(){}unload(){}}class qZ extends x3{#J=j3.platform==="win32"?"SIGINT":"SIGHUP";#Z=new XZ;#$;#X;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let J of P1)this.#Q[J]=()=>{let Z=this.#$.listeners(J),{count:X}=this.#Z,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")X+=q.__signal_exit_emitter__.count;if(Z.length===X){this.unload();let Y=this.#Z.emit("exit",null,J),Q=J==="SIGHUP"?this.#J:J;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#X=$.emit}onExit($,J){if(!g4(this.#$))return()=>{};if(this.#Y===!1)this.load();let Z=J?.alwaysLast?"afterExit":"exit";return this.#Z.on(Z,$),()=>{if(this.#Z.removeListener(Z,$),this.#Z.listeners.exit.length===0&&this.#Z.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#Z.count+=1;for(let $ of P1)try{let J=this.#Q[$];if(J)this.#$.on($,J)}catch(J){}this.#$.emit=($,...J)=>{return this.#H($,...J)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,P1.forEach(($)=>{let J=this.#Q[$];if(!J)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,J)}catch(Z){}}),this.#$.emit=this.#X,this.#$.reallyExit=this.#q,this.#Z.count-=1}#G($){if(!g4(this.#$))return 0;return this.#$.exitCode=$||0,this.#Z.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...J){let Z=this.#X;if($==="exit"&&g4(this.#$)){if(typeof J[0]==="number")this.#$.exitCode=J[0];let X=Z.call(this.#$,$,...J);return this.#Z.emit("exit",this.#$.exitCode,null),X}else return Z.call(this.#$,$,...J)}}var j3=globalThis.process,{onExit:YZ,load:HF,unload:zF}=sz(g4(j3)?new qZ(j3):new QZ);var GZ=($,{cleanup:J,detached:Z},{signal:X})=>{if(!J||Z)return;let q=YZ(()=>{$.kill()});ez(X,()=>{q()})};var zZ=({source:$,sourcePromise:J,boundOptions:Z,createNested:X},...q)=>{let Y=i$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:U}=$K(Z,X,q),{sourceStream:B,sourceError:W}=ZK($,K),{options:_,fileDescriptors:R}=n0.get($);return{sourcePromise:J,sourceStream:B,sourceOptions:_,sourceError:W,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:U,fileDescriptors:R,startTime:Y}},$K=($,J,Z)=>{try{let{destination:X,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=JK($,J,...Z),G=Y4(X,Y);return{destination:X,destinationStream:G,from:q,unpipeSignal:Q}}catch(X){return{destinationError:X}}},JK=($,J,Z,...X)=>{if(Array.isArray(Z))return{destination:J(HZ,$)(Z,...X),pipeOptions:$};if(typeof Z==="string"||Z instanceof URL||L2(Z)){if(Object.keys($).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[q,Y,Q]=b$(Z,...X);return{destination:J(HZ)(q,Y,Q),pipeOptions:Q}}if(n0.has(Z)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:Z,pipeOptions:X[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${Z}`)},HZ=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),ZK=($,J)=>{try{return{sourceStream:i1($,J)}}catch(Z){return{sourceError:Z}}};var BZ=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=XK({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X});if(G!==void 0)throw P3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},XK=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X})=>{if(J!==void 0&&X!==void 0)return X;if(X!==void 0)return M3($),X;if(J!==void 0)return T3(Z),J},P3=({error:$,fileDescriptors:J,sourceOptions:Z,startTime:X})=>a1({error:$,command:KZ,escapedCommand:KZ,fileDescriptors:J,options:Z,startTime:X,isSync:!1}),KZ="source.pipe(destination)";var UZ=async($)=>{let[{status:J,reason:Z,value:X=Z},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(X))Q.pipedFrom.push(X);if(q==="rejected")throw Q;if(J==="rejected")throw X;return Q};import{finished as QK}from"node:stream/promises";var WZ=($,J,Z)=>{let X=u4.has(J)?YK($,J):qK($,J);return M1($,HK,Z.signal),M1(J,zK,Z.signal),GK(J),X},qK=($,J)=>{let Z=x1([$]);return e1(Z,J),u4.set(J,Z),Z},YK=($,J)=>{let Z=u4.get(J);return Z.add($),Z},GK=async($)=>{try{await QK($,{cleanup:!0,readable:!1,writable:!0})}catch{}u4.delete($)},u4=new WeakMap,HK=2,zK=1;import{aborted as KK}from"node:util";var VZ=($,J)=>$===void 0?[]:[BK($,J)],BK=async($,{sourceStream:J,mergedStream:Z,fileDescriptors:X,sourceOptions:q,startTime:Y})=>{await KK($,J),await Z.remove(J);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw P3({error:Q,fileDescriptors:X,sourceOptions:q,startTime:Y})};var m4=($,...J)=>{if(Q0(J[0]))return m4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...J[0]}});let{destination:Z,...X}=zZ($,...J),q=UK({...X,destination:Z});return q.pipe=m4.bind(void 0,{...$,source:Z,sourcePromise:q,boundOptions:{}}),q},UK=async({sourcePromise:$,sourceStream:J,sourceOptions:Z,sourceError:X,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let U=WK($,q);BZ({sourceStream:J,sourceError:X,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:Z,startTime:K});let B=new AbortController;try{let W=WZ(J,Y,B);return await Promise.race([UZ(U),...VZ(G,{sourceStream:J,mergedStream:W,sourceOptions:Z,fileDescriptors:H,startTime:K})])}finally{B.abort()}},WK=($,J)=>Promise.allSettled([$,J]);import{setImmediate as CK}from"node:timers/promises";import{on as VK}from"node:events";import{getDefaultHighWaterMark as LK}from"node:stream";var c4=({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:X,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return _K(J,Q),_Z({stream:$,controller:Q,binary:Z,shouldEncode:!$.readableObjectMode&&X,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},_K=async($,J)=>{try{await $}catch{}finally{J.abort()}},I3=({stream:$,onStreamEnd:J,lines:Z,encoding:X,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;RK(J,Q,$);let G=$.readableObjectMode&&!Y;return _Z({stream:$,controller:Q,binary:X==="buffer",shouldEncode:!G,encoding:X,shouldSplit:!G&&Z,preserveNewlines:!q})},RK=async($,J,Z)=>{try{await $}catch{Z.destroy()}finally{J.abort()}},_Z=({stream:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=VK($,"data",{signal:J.signal,highWaterMark:LZ,highWatermark:LZ});return TK({onStdoutChunk:G,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})},O3=LK(!0),LZ=O3,TK=async function*({onStdoutChunk:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=MK({binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*j1(H,G,0)}catch(H){if(!J.signal.aborted)throw H}finally{yield*M$(G)}},MK=({binary:$,shouldEncode:J,encoding:Z,shouldSplit:X,preserveNewlines:q})=>[v4($,Z,!J),D4($,q,!X,{})].filter(Boolean);var RZ=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:U})=>{let B=FK({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:G,verboseInfo:K,streamInfo:U});if(!q){await Promise.all([jK($),B]);return}let W=Y3(H,Z),_=I3({stream:$,onStreamEnd:J,lines:Q,encoding:X,stripFinalNewline:W,allMixed:G}),[R]=await Promise.all([xK({stream:$,iterable:_,fdNumber:Z,encoding:X,maxBuffer:Y,lines:Q}),B]);return R},FK=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!k4({stdioItems:Q[Z]?.stdioItems,encoding:X,verboseInfo:Y,fdNumber:Z}))return;let G=I3({stream:$,onStreamEnd:J,lines:!0,encoding:X,stripFinalNewline:!0,allMixed:q});await PJ(G,$,Z,Y)},jK=async($)=>{if(await CK(),$.readableFlowing===null)$.resume()},xK=async({stream:$,stream:{readableObjectMode:J},iterable:Z,fdNumber:X,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(J||Q)return await j4(Z,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await x4(Z,{maxBuffer:Y}));return await I4(Z,{maxBuffer:Y})}catch(G){return TZ(P5({error:G,stream:$,readableObjectMode:J,lines:Q,encoding:q,fdNumber:X}))}},w3=async($)=>{try{return await $}catch(J){return TZ(J)}},TZ=({bufferedData:$})=>u6($)?new Uint8Array($):$;import{finished as PK}from"node:stream/promises";var x$=async($,J,Z,{isSameDirection:X,stopOnExit:q=!1}={})=>{let Y=IK($,Z),Q=new AbortController;try{await Promise.race([...q?[Z.exitPromise]:[],PK($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)EK(G,J,Z,X)}finally{Q.abort()}},IK=($,{originalStreams:[J],subprocess:Z})=>{let X={stdinCleanedUp:!1};if($===J)OK($,Z,X);return X},OK=($,J,Z)=>{let{_destroy:X}=$;$._destroy=(...q)=>{wK(J,Z),X.call($,...q)}},wK=({exitCode:$,signalCode:J},Z)=>{if($!==null||J!==null)Z.stdinCleanedUp=!0},EK=($,J,Z,X)=>{if(!AK($,J,Z,X))throw $},AK=($,J,Z,X=!0)=>{if(Z.propagating)return MZ($)||p4($);return Z.propagating=!0,E3(Z,J)===X?MZ($):p4($)},E3=({fileDescriptors:$},J)=>J!=="all"&&$[J].direction==="input",p4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",MZ=($)=>$?.code==="EPIPE";var CZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>A3({stream:H,fdNumber:K,encoding:J,buffer:Z[K],maxBuffer:X[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),A3=async({stream:$,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let U=x$($,J,K);if(E3(K,J)){await U;return}let[B]=await Promise.all([RZ({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 FZ=({stdout:$,stderr:J},{all:Z})=>Z&&($||J)?x1([$,J].filter(Boolean)):void 0,jZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>A3({...hK($,Z),fdNumber:"all",encoding:J,maxBuffer:X[1]+X[2],lines:q[1]||q[2],allMixed:NK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),hK=({stdout:$,stderr:J,all:Z},[,X,q])=>{let Y=X||q;if(!Y)return{stream:Z,buffer:Y};if(!X)return{stream:J,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:Z,buffer:Y}},NK=({all:$,stdout:J,stderr:Z})=>$&&J&&Z&&J.readableObjectMode!==Z.readableObjectMode;import{once as DK}from"node:events";var xZ=($)=>c1($,"ipc"),PZ=($,J)=>{let Z=n$($);p0({type:"ipc",verboseMessage:Z,fdNumber:"ipc",verboseInfo:J})};var IZ=async({subprocess:$,buffer:J,maxBuffer:Z,ipc:X,ipcOutput:q,verboseInfo:Y})=>{if(!X)return q;let Q=xZ(Y),G=$1(J,"ipc"),H=$1(Z,"ipc");for await(let K of L3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:X,shouldAwait:!1,reference:!0})){if(G)I5($,q,H),q.push(K);if(Q)PZ(K,Y)}return q},OZ=async($,J)=>{return await Promise.allSettled([$]),J};var wZ=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 D=AJ($,W),p={originalStreams:L,fileDescriptors:R,subprocess:$,exitPromise:D,propagating:!1},P=CZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:p}),E=jZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:p}),k=[],n=IZ({subprocess:$,buffer:Z,maxBuffer:X,ipc:U,ipcOutput:k,verboseInfo:_}),T0=vK(L,$,p),i=SK(R,p);try{return await Promise.race([Promise.all([{},NJ(D),Promise.all(P),E,n,Z5($,B),...T0,...i]),x,fK($,j),...r8($,Y,W,j),...T8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:W,controller:j}),...t8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:W,controller:j})])}catch(r0){return W.terminationReason??="other",Promise.all([{error:r0},D,Promise.all(P.map((A)=>w3(A))),w3(E),OZ(n,k),Promise.allSettled(T0),Promise.allSettled(i)])}},vK=($,J,Z)=>$.map((X,q)=>X===J.stdio[q]?void 0:x$(X,q,Z)),SK=($,J)=>$.flatMap(({stdioItems:Z},X)=>Z.filter(({value:q,stream:Y=q})=>u0(Y,{checkOpen:!1})&&!y0(Y)).map(({type:q,value:Y,stream:Q=Y})=>x$(Q,X,J,{isSameDirection:N0.has(q),stopOnExit:q==="native"}))),fK=async($,{signal:J})=>{let[Z]=await DK($,"error",{signal:J});throw Z};var EZ=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),P$=($,J,Z)=>{let X=$[Z];if(!X.has(J))X.set(J,[]);let q=X.get(J),Y=l0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},$$=async({resolve:$,promises:J},Z)=>{$();let[X]=await Promise.race([Promise.allSettled([!0,Z]),Promise.all([!1,...J])]);return!X};import{Readable as kK}from"node:stream";import{callbackify as bK}from"node:util";import{finished as AZ}from"node:stream/promises";var h3=async($)=>{if($===void 0)return;try{await N3($)}catch{}},hZ=async($)=>{if($===void 0)return;try{await D3($)}catch{}},N3=async($)=>{await AZ($,{cleanup:!0,readable:!1,writable:!0})},D3=async($)=>{await AZ($,{cleanup:!0,readable:!0,writable:!1})},d4=async($,J)=>{if(await $,J)throw J},l4=($,J,Z)=>{if(Z&&!p4(Z))$.destroy(Z);else if(J)$.destroy()};var NZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||x0.has(Z),{subprocessStdout:G,waitReadableDestroy:H}=v3($,X,J),{readableEncoding:K,readableObjectMode:U,readableHighWaterMark:B}=S3(G,Q),{read:W,onStdoutDataDone:_}=f3({subprocessStdout:G,subprocess:$,binary:Q,encoding:Z,preserveNewlines:Y}),R=new kK({read:W,destroy:bK(b3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:B,objectMode:U,encoding:K});return k3({subprocessStdout:G,onStdoutDataDone:_,readable:R,subprocess:$}),R},v3=($,J,Z)=>{let X=i1($,J),q=P$(Z,X,"readableDestroy");return{subprocessStdout:X,waitReadableDestroy:q}},S3=({readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z},X)=>X?{readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:O3},f3=({subprocessStdout:$,subprocess:J,binary:Z,encoding:X,preserveNewlines:q})=>{let Y=l0(),Q=c4({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:!Z,encoding:X,preserveNewlines:q});return{read(){yK(this,Q,Y)},onStdoutDataDone:Y}},yK=async($,J,Z)=>{try{let{value:X,done:q}=await J.next();if(q)Z.resolve();else $.push(X)}catch{}},k3=async({subprocessStdout:$,onStdoutDataDone:J,readable:Z,subprocess:X,subprocessStdin:q})=>{try{if(await D3($),await X,await h3(q),await J,Z.readable)Z.push(null)}catch(Y){await h3(q),DZ(Z,Y)}},b3=async({subprocessStdout:$,subprocess:J,waitReadableDestroy:Z},X)=>{if(await $$(Z,J))DZ($,X),await d4(J,X)},DZ=($,J)=>{l4($,$.readable,J)};import{Writable as gK}from"node:stream";import{callbackify as vZ}from"node:util";var SZ=({subprocess:$,concurrentStreams:J},{to:Z}={})=>{let{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}=y3($,Z,J),Q=new gK({...g3(X,$,q),destroy:vZ(m3.bind(void 0,{subprocessStdin:X,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:X.writableHighWaterMark,objectMode:X.writableObjectMode});return u3(X,Q),Q},y3=($,J,Z)=>{let X=Y4($,J),q=P$(Z,X,"writableFinal"),Y=P$(Z,X,"writableDestroy");return{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}},g3=($,J,Z)=>({write:uK.bind(void 0,$),final:vZ(mK.bind(void 0,$,J,Z))}),uK=($,J,Z,X)=>{if($.write(J,Z))X();else $.once("drain",X)},mK=async($,J,Z)=>{if(await $$(Z,J)){if($.writable)$.end();await J}},u3=async($,J,Z)=>{try{if(await N3($),J.writable)J.end()}catch(X){await hZ(Z),fZ(J,X)}},m3=async({subprocessStdin:$,subprocess:J,waitWritableFinal:Z,waitWritableDestroy:X},q)=>{if(await $$(Z,J),await $$(X,J))fZ($,q),await d4(J,q)},fZ=($,J)=>{l4($,$.writable,J)};import{Duplex as cK}from"node:stream";import{callbackify as pK}from"node:util";var kZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||x0.has(Z),{subprocessStdout:H,waitReadableDestroy:K}=v3($,X,J),{subprocessStdin:U,waitWritableFinal:B,waitWritableDestroy:W}=y3($,q,J),{readableEncoding:_,readableObjectMode:R,readableHighWaterMark:L}=S3(H,G),{read:x,onStdoutDataDone:j}=f3({subprocessStdout:H,subprocess:$,binary:G,encoding:Z,preserveNewlines:Q}),D=new cK({read:x,...g3(U,$,B),destroy:pK(dK.bind(void 0,{subprocessStdout:H,subprocessStdin:U,subprocess:$,waitReadableDestroy:K,waitWritableFinal:B,waitWritableDestroy:W})),readableHighWaterMark:L,writableHighWaterMark:U.writableHighWaterMark,readableObjectMode:R,writableObjectMode:U.writableObjectMode,encoding:_});return k3({subprocessStdout:H,onStdoutDataDone:j,readable:D,subprocess:$,subprocessStdin:U}),u3(U,D,H),D},dK=async({subprocessStdout:$,subprocessStdin:J,subprocess:Z,waitReadableDestroy:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([b3({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},Q),m3({subprocessStdin:J,subprocess:Z,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var c3=($,J,{from:Z,binary:X=!1,preserveNewlines:q=!1}={})=>{let Y=X||x0.has(J),Q=i1($,Z),G=c4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:J,preserveNewlines:q});return lK(G,Q,$)},lK=async function*($,J,Z){try{yield*$}finally{if(J.readable)J.destroy();await Z}};var bZ=($,{encoding:J})=>{let Z=EZ();$.readable=NZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.writable=SZ.bind(void 0,{subprocess:$,concurrentStreams:Z}),$.duplex=kZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.iterable=c3.bind(void 0,$,J),$[Symbol.asyncIterator]=c3.bind(void 0,$,J,{})};var yZ=($,J)=>{for(let[Z,X]of iK){let q=X.value.bind(J);Reflect.defineProperty($,Z,{...X,value:q})}},nK=(async()=>{})().constructor.prototype,iK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(nK,$)]);var gZ=($,J,Z,X)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:U,fileDescriptors:B}=aK($,J,Z),{subprocess:W,promise:_}=sK({file:q,commandArguments:Y,options:U,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:B});return W.pipe=m4.bind(void 0,{source:W,sourcePromise:_,boundOptions:{},createNested:X}),yZ(W,_),n0.set(W,{options:U,fileDescriptors:B}),W},aK=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=o$($,J,Z),{file:G,commandArguments:H,options:K}=R4($,J,Z),U=rK(K),B=nJ(U,Q);return{file:G,commandArguments:H,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:B}},rK=({timeout:$,signal:J,...Z})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...Z,timeoutDuration:$}},sK=({file:$,commandArguments:J,options:Z,startTime:X,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=tK(...T4($,J,Z))}catch(R){return cJ({error:R,command:Y,escapedCommand:Q,fileDescriptors:G,options:Z,startTime:X,verboseInfo:q})}let K=new AbortController;oK(Number.POSITIVE_INFINITY,K.signal);let U=[...H.stdio];ZZ(H,G,K),GZ(H,Z,K);let B={},W=l0();H.kill=_8.bind(void 0,{kill:H.kill.bind(H),options:Z,onInternalError:W,context:B,controller:K}),H.all=FZ(H,Z),bZ(H,Z),gJ(H,Z);let _=eK({subprocess:H,options:Z,startTime:X,verboseInfo:q,fileDescriptors:G,originalStreams:U,command:Y,escapedCommand:Q,context:B,onInternalError:W,controller:K});return{subprocess:H,promise:_}},eK=async({subprocess:$,options:J,startTime:Z,verboseInfo:X,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:K,controller:U})=>{let[B,[W,_],R,L,x]=await wZ({subprocess:$,options:J,context:H,verboseInfo:X,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:U});U.abort(),K.resolve();let j=R.map((P,E)=>X1(P,J,E)),D=X1(L,J,"all"),p=$B({errorInfo:B,exitCode:W,signal:_,stdio:j,all:D,ipcOutput:x,context:H,options:J,command:Q,escapedCommand:G,startTime:Z});return r1(p,X,J)},$B=({errorInfo:$,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:K,startTime:U})=>("error"in $)?T$({error:$.error,command:H,escapedCommand:K,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof J1,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U,isSync:!1}):w4({command:H,escapedCommand:K,stdio:X,all:q,ipcOutput:Y,options:G,startTime:U});var n4=($,J)=>{let Z=Object.fromEntries(Object.entries(J).map(([X,q])=>[X,JB(X,$[X],q)]));return{...$,...Z}},JB=($,J,Z)=>{if(ZB.has($)&&Q0(J)&&Q0(Z))return{...J,...Z};return Z},ZB=new Set(["env",...F2]);var z1=($,J,Z,X)=>{let q=(Q,G,H)=>z1(Q,G,Z,H),Y=(...Q)=>XB({mapArguments:$,deepOptions:Z,boundOptions:J,setBoundExeca:X,createNested:q},...Q);if(X!==void 0)X(Y,q,J);return Y},XB=({mapArguments:$,deepOptions:J={},boundOptions:Z={},setBoundExeca:X,createNested:q},Y,...Q)=>{if(Q0(Y))return q($,n4(Z,Y),X);let{file:G,commandArguments:H,options:K,isSync:U}=QB({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:J,boundOptions:Z});return U?vJ(G,H,K):gZ(G,H,K,q)},QB=({mapArguments:$,firstArgument:J,nextArguments:Z,deepOptions:X,boundOptions:q})=>{let Y=n6(J)?i6(J,Z):[J,...Z],[Q,G,H]=b$(...Y),K=n4(n4(X,q),H),{file:U=Q,commandArguments:B=G,options:W=K,isSync:_=!1}=$({file:Q,commandArguments:G,options:K});return{file:U,commandArguments:B,options:W,isSync:_}};var uZ=({file:$,commandArguments:J})=>cZ($,J),mZ=({file:$,commandArguments:J})=>({...cZ($,J),isSync:!0}),cZ=($,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${J}.`);let[Z,...X]=qB($);return{file:Z,commandArguments:X}},qB=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let J=$.trim();if(J==="")return[];let Z=[];for(let X of J.split(YB)){let q=Z.at(-1);if(q&&q.endsWith("\\"))Z[Z.length-1]=`${q.slice(0,-1)} ${X}`;else Z.push(X)}return Z},YB=/ +/g;var pZ=($,J,Z)=>{$.sync=J(GB,Z),$.s=$.sync},dZ=({options:$})=>lZ($),GB=({options:$})=>({...lZ($),isSync:!0}),lZ=($)=>({options:{...HB($),...$}}),HB=({input:$,inputFile:J,stdio:Z})=>$===void 0&&J===void 0&&Z===void 0?{stdin:"inherit"}:{},nZ={preferLocal:!0};var p3=z1(()=>({})),sx=z1(()=>({isSync:!0})),ex=z1(uZ),$P=z1(mZ),JP=z1(e8),ZP=z1(dZ,{},nZ,pZ),{sendMessage:XP,getOneMessage:QP,getEachMessage:qP,getCancelSignal:YP}=uJ();var R0=g1(l3(),1),YX=g1(t4(),1);import{stdin as QX,stdout as qX}from"node:process";import*as K1 from"node:readline";import aZ from"node:readline";import{Writable as VB}from"node:stream";function LB({onlyFirst:$=!1}={}){let J=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(J,$?void 0:"g")}var _B=LB();function GX($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(_B,"")}function HX($){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 RB=zX.exports,TB=HX(RB),MB=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},CB=HX(MB);function I$($,J={}){if(typeof $!="string"||$.length===0||(J={ambiguousIsNarrow:!0,...J},$=GX($),$.length===0))return 0;$=$.replace(CB()," ");let Z=J.ambiguousIsNarrow?1:2,X=0;for(let q of $){let Y=q.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(TB.eastAsianWidth(q)){case"F":case"W":X+=2;break;case"A":X+=Z;break;default:X+=1}}return X}var i3=10,rZ=($=0)=>(J)=>`\x1B[${J+$}m`,sZ=($=0)=>(J)=>`\x1B[${38+$};5;${J}m`,eZ=($=0)=>(J,Z,X)=>`\x1B[${38+$};2;${J};${Z};${X}m`,$0={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys($0.modifier);var FB=Object.keys($0.color),jB=Object.keys($0.bgColor);[...FB,...jB];function xB(){let $=new Map;for(let[J,Z]of Object.entries($0)){for(let[X,q]of Object.entries(Z))$0[X]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},Z[X]=$0[X],$.set(q[0],q[1]);Object.defineProperty($0,J,{value:Z,enumerable:!1})}return Object.defineProperty($0,"codes",{value:$,enumerable:!1}),$0.color.close="\x1B[39m",$0.bgColor.close="\x1B[49m",$0.color.ansi=rZ(),$0.color.ansi256=sZ(),$0.color.ansi16m=eZ(),$0.bgColor.ansi=rZ(i3),$0.bgColor.ansi256=sZ(i3),$0.bgColor.ansi16m=eZ(i3),Object.defineProperties($0,{rgbToAnsi256:{value:(J,Z,X)=>J===Z&&Z===X?J<8?16:J>248?231:Math.round((J-8)/247*24)+232:16+36*Math.round(J/255*5)+6*Math.round(Z/255*5)+Math.round(X/255*5),enumerable:!1},hexToRgb:{value:(J)=>{let Z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(J.toString(16));if(!Z)return[0,0,0];let[X]=Z;X.length===3&&(X=[...X].map((Y)=>Y+Y).join(""));let q=Number.parseInt(X,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(J)=>$0.rgbToAnsi256(...$0.hexToRgb(J)),enumerable:!1},ansi256ToAnsi:{value:(J)=>{if(J<8)return 30+J;if(J<16)return 90+(J-8);let Z,X,q;if(J>=232)Z=((J-232)*10+8)/255,X=Z,q=Z;else{J-=16;let G=J%36;Z=Math.floor(J/36)/5,X=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(Z,X,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(X)<<1|Math.round(Z));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(J,Z,X)=>$0.ansi256ToAnsi($0.rgbToAnsi256(J,Z,X)),enumerable:!1},hexToAnsi:{value:(J)=>$0.ansi256ToAnsi($0.hexToAnsi256(J)),enumerable:!1}}),$0}var PB=xB(),s4=new Set(["\x1B",""]),IB=39,a3="\x07",KX="[",OB="]",BX="m",r3=`${OB}8;;`,$X=($)=>`${s4.values().next().value}${KX}${$}${BX}`,JX=($)=>`${s4.values().next().value}${r3}${$}${a3}`,wB=($)=>$.split(" ").map((J)=>I$(J)),o3=($,J,Z)=>{let X=[...J],q=!1,Y=!1,Q=I$(GX($[$.length-1]));for(let[G,H]of X.entries()){let K=I$(H);if(Q+K<=Z?$[$.length-1]+=H:($.push(H),Q=0),s4.has(H)&&(q=!0,Y=X.slice(G+1).join("").startsWith(r3)),q){Y?H===a3&&(q=!1,Y=!1):H===BX&&(q=!1);continue}Q+=K,Q===Z&&G<X.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},EB=($)=>{let J=$.split(" "),Z=J.length;for(;Z>0&&!(I$(J[Z-1])>0);)Z--;return Z===J.length?$:J.slice(0,Z).join(" ")+J.slice(Z).join("")},AB=($,J,Z={})=>{if(Z.trim!==!1&&$.trim()==="")return"";let X="",q,Y,Q=wB($),G=[""];for(let[K,U]of $.split(" ").entries()){Z.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let B=I$(G[G.length-1]);if(K!==0&&(B>=J&&(Z.wordWrap===!1||Z.trim===!1)&&(G.push(""),B=0),(B>0||Z.trim===!1)&&(G[G.length-1]+=" ",B++)),Z.hard&&Q[K]>J){let W=J-B,_=1+Math.floor((Q[K]-W-1)/J);Math.floor((Q[K]-1)/J)<_&&G.push(""),o3(G,U,J);continue}if(B+Q[K]>J&&B>0&&Q[K]>0){if(Z.wordWrap===!1&&B<J){o3(G,U,J);continue}G.push("")}if(B+Q[K]>J&&Z.wordWrap===!1){o3(G,U,J);continue}G[G.length-1]+=U}Z.trim!==!1&&(G=G.map((K)=>EB(K)));let H=[...G.join(`
|
|
45
|
-
`)];for(let[K,
|
|
46
|
-
`?(Y&&(X+=
|
|
47
|
-
`&&(q&&B&&(X
|
|
44
|
+
if (condition) { yield value; }`)};import{Buffer as hH}from"node:buffer";import{StringDecoder as DH}from"node:string_decoder";var S4=($,J,Z)=>{if(Z)return;if($)return{transform:vH.bind(void 0,new TextEncoder)};let X=new DH(J);return{transform:SH.bind(void 0,X),final:fH.bind(void 0,X)}},vH=function*($,J){if(hH.isBuffer(J))yield e0(J);else if(typeof J==="string")yield $.encode(J);else yield J},SH=function*($,J){yield B0(J)?$.write(J):J},fH=function*($){let J=$.end();if(J!=="")yield J};import{callbackify as CJ}from"node:util";var V3=CJ(async($,J,Z,X)=>{J.currentIterable=$(...Z);try{for await(let q of J.currentIterable)X.push(q)}finally{delete J.currentIterable}}),f4=async function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=bH}=J[Z];for await(let q of X($))yield*f4(q,J,Z+1)},FJ=async function*($){for(let[J,{final:Z}]of Object.entries($))yield*kH(Z,Number(J),$)},kH=async function*($,J,Z){if($===void 0)return;for await(let X of $())yield*f4(X,Z,J+1)},jJ=CJ(async({currentIterable:$},J)=>{if($!==void 0){await(J?$.throw(J):$.return());return}if(J)throw J}),bH=function*($){yield $};var L3=($,J,Z,X)=>{try{for(let q of $(...J))Z.push(q);X()}catch(q){X(q)}},xJ=($,J)=>[...J.flatMap((Z)=>[...I1(Z,$,0)]),...x$($)],I1=function*($,J,Z){if(Z===J.length){yield $;return}let{transform:X=gH}=J[Z];for(let q of X($))yield*I1(q,J,Z+1)},x$=function*($){for(let[J,{final:Z}]of Object.entries($))yield*yH(Z,Number(J),$)},yH=function*($,J,Z){if($===void 0)return;for(let X of $())yield*I1(X,Z,J+1)},gH=function*($){yield $};var _3=({value:$,value:{transform:J,final:Z,writableObjectMode:X,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=IJ($,Q,Y),K=P1(J),W=P1(Z),B=K?V3.bind(void 0,f4,G):L3.bind(void 0,I1),U=K||W?V3.bind(void 0,FJ,G):L3.bind(void 0,x$),_=K||W?jJ.bind(void 0,G):void 0;return{stream:new uH({writableObjectMode:X,writableHighWaterMark:PJ(X),readableObjectMode:q,readableHighWaterMark:PJ(q),transform(L,P,I){B([L,H,0],this,I)},flush(L){U([H],this,L)},destroy:_})}},k4=($,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=IJ(Q,Z,G);$=xJ(H,$)}return $},IJ=({transform:$,final:J,binary:Z,writableObjectMode:X,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:RJ(X,G)},S4(Z,Q,X),v4(Z,Y,X,H),{transform:$,final:J},{transform:TJ(q,G)},_J({binary:Z,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var OJ=($,J)=>{for(let Z of mH($))cH($,Z,J)},mH=($)=>new Set(Object.entries($).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),cH=($,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 ${B1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>pH(G,X));Z.input=L$(Q)},pH=($,J)=>{let Z=k4($,J,"utf8",!0);return dH(Z),L$(Z)},dH=($)=>{let J=$.find((Z)=>typeof Z!=="string"&&!B0(Z));if(J!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${J}.`)};import{writeFileSync as oH,appendFileSync as tH}from"node:fs";var b4=({stdioItems:$,encoding:J,verboseInfo:Z,fdNumber:X})=>X!=="all"&&n1(Z,X)&&!I0.has(J)&&lH(X)&&($.some(({type:q,value:Y})=>q==="native"&&nH.has(Y))||$.every(({type:q})=>D0.has(q))),lH=($)=>$===1||$===2,nH=new Set(["pipe","overlapped"]),wJ=async($,J,Z,X)=>{for await(let q of $)if(!iH(J))AJ(q,Z,X)},EJ=($,J,Z)=>{for(let X of $)AJ(X,J,Z)},iH=($)=>$._readableState.pipes.length>0,AJ=($,J,Z)=>{let X=i$($);l0({type:"output",verboseMessage:X,fdNumber:J,verboseInfo:Z})};var NJ=({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)=>aH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:X,verboseInfo:q},Z)),...Y}},aH=({result:$,fileDescriptors:J,fdNumber:Z,state:X,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:K,stripFinalNewline:W,maxBuffer:B})=>{if($===null)return;let U=h5($,Y,B),_=e0(U),{stdioItems:T,objectMode:L}=J[Z],P=rH([_],T,H,X),{serializedResult:I,finalResult:D=I}=sH({chunks:P,objectMode:L,encoding:H,lines:K,stripFinalNewline:W,fdNumber:Z});eH({serializedResult:I,fdNumber:Z,state:X,verboseInfo:Q,encoding:H,stdioItems:T,objectMode:L});let m=G[Z]?D:void 0;try{if(X.error===void 0)$z(I,T,q);return m}catch(O){return X.error=O,m}},rH=($,J,Z,X)=>{try{return k4($,J,Z,!1)}catch(q){return X.error=q,$}},sH=({chunks:$,objectMode:J,encoding:Z,lines:X,stripFinalNewline:q,fdNumber:Y})=>{if(J)return{serializedResult:$};if(Z==="buffer")return{serializedResult:L$($)};let Q=l6($,Z);if(X[Y])return{serializedResult:Q,finalResult:U3(Q,!q[Y],J)};return{serializedResult:Q}},eH=({serializedResult:$,fdNumber:J,state:Z,verboseInfo:X,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!b4({stdioItems:Y,encoding:q,verboseInfo:X,fdNumber:J}))return;let G=U3($,!1,Q);try{EJ(G,J,X)}catch(H){Z.error??=H}},$z=($,J,Z)=>{for(let{path:X,append:q}of J.filter(({type:Y})=>h4.has(Y))){let Y=typeof X==="string"?X:X.toString();if(q||Z.has(Y))tH(X,$);else Z.add(Y),oH(X,$)}};var hJ=([,$,J],Z)=>{if(!Z.all)return;if($===void 0)return J;if(J===void 0)return $;if(Array.isArray($))return Array.isArray(J)?[...$,...J]:[...$,X1(J,Z,"all")];if(Array.isArray(J))return[X1($,Z,"all"),...J];if(B0($)&&B0(J))return j2([$,J]);return`${$}${J}`};import{once as R3}from"node:events";var DJ=async($,J)=>{let[Z,X]=await Jz($);return J.isForcefullyTerminated??=!1,[Z,X]},Jz=async($)=>{let[J,Z]=await Promise.allSettled([R3($,"spawn"),R3($,"exit")]);if(J.status==="rejected")return[];return Z.status==="rejected"?vJ($):Z.value},vJ=async($)=>{try{return await R3($,"exit")}catch{return vJ($)}},SJ=async($)=>{let[J,Z]=await $;if(!Zz(J,Z)&&T3(J,Z))throw new n0;return[J,Z]},Zz=($,J)=>$===void 0&&J===void 0,T3=($,J)=>$!==0||J!==null;var fJ=({error:$,status:J,signal:Z,output:X},{maxBuffer:q})=>{let Y=Xz($,J,Z),Q=Y?.code==="ETIMEDOUT",G=N5(Y,X,q);return{resultError:Y,exitCode:J,signal:Z,timedOut:Q,isMaxBuffer:G}},Xz=($,J,Z)=>{if($!==void 0)return $;return T3(J,Z)?new n0:void 0};var kJ=($,J,Z)=>{let{file:X,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:W}=qz($,J,Z),B=Hz({file:X,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:W,startTime:G});return J$(B,H,K)},qz=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=t$($,J,Z),G=Yz(Z),{file:H,commandArguments:K,options:W}=T4($,J,G);Gz(W);let B=WJ(W,Q);return{file:H,commandArguments:K,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:B}},Yz=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,Gz=({ipc:$,ipcInput:J,detached:Z,cancelSignal:X})=>{if(J)y4("ipcInput");if($)y4("ipc: true");if(Z)y4("detached: true");if(X)y4("cancelSignal")},y4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},Hz=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=zz({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:K,exitCode:W,signal:B,timedOut:U,isMaxBuffer:_}=fJ(H,Z),{output:T,error:L=K}=NJ({fileDescriptors:Q,syncResult:H,options:Z,isMaxBuffer:_,verboseInfo:Y}),P=T.map((D,m)=>X1(D,Z,m)),I=X1(hJ(T,Z),Z,"all");return Bz({error:L,exitCode:W,signal:B,timedOut:U,isMaxBuffer:_,stdio:P,all:I,options:Z,command:X,escapedCommand:q,startTime:G})},zz=({file:$,commandArguments:J,options:Z,command:X,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{OJ(Y,Z);let G=Kz(Z);return Qz(...M4($,J,G))}catch(G){return $$({error:G,command:X,escapedCommand:q,fileDescriptors:Y,options:Z,startTime:Q,isSync:!0})}},Kz=({encoding:$,maxBuffer:J,...Z})=>({...Z,encoding:"buffer",maxBuffer:w4(J)}),Bz=({error:$,exitCode:J,signal:Z,timedOut:X,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:W})=>$===void 0?E4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:W}):j$({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:W,isSync:!0});import{setMaxListeners as sK}from"node:events";import{spawn as eK}from"node:child_process";import mJ from"node:process";import{once as M3,on as Wz}from"node:events";var bJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0,filter:Y}={})=>{return t1({methodName:"getOneMessage",isSubprocess:Z,ipc:X,isConnected:W4($)}),Uz({anyProcess:$,channel:J,isSubprocess:Z,filter:Y,reference:q})},Uz=async({anyProcess:$,channel:J,isSubprocess:Z,filter:X,reference:q})=>{H4(J,q);let Y=K1($,J,Z),Q=new AbortController;try{return await Promise.race([Vz(Y,X,Q),Lz(Y,Z,Q),_z(Y,Z,Q)])}catch(G){throw a1($),G}finally{Q.abort(),z4(J,q)}},Vz=async($,J,{signal:Z})=>{if(J===void 0){let[X]=await M3($,"message",{signal:Z});return X}for await(let[X]of Wz($,"message",{signal:Z}))if(J(X))return X},Lz=async($,J,{signal:Z})=>{await M3($,"disconnect",{signal:Z}),j8(J)},_z=async($,J,{signal:Z})=>{let[X]=await M3($,"strict:error",{signal:Z});throw q4(X,J)};import{once as gJ,on as Rz}from"node:events";var uJ=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X},{reference:q=!0}={})=>C3({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:!Z,reference:q}),C3=({anyProcess:$,channel:J,isSubprocess:Z,ipc:X,shouldAwait:q,reference:Y})=>{t1({methodName:"getEachMessage",isSubprocess:Z,ipc:X,isConnected:W4($)}),H4(J,Y);let Q=K1($,J,Z),G=new AbortController,H={};return Tz($,Q,G),Mz({ipcEmitter:Q,isSubprocess:Z,controller:G,state:H}),Cz({anyProcess:$,channel:J,ipcEmitter:Q,isSubprocess:Z,shouldAwait:q,controller:G,state:H,reference:Y})},Tz=async($,J,Z)=>{try{await gJ(J,"disconnect",{signal:Z.signal}),Z.abort()}catch{}},Mz=async({ipcEmitter:$,isSubprocess:J,controller:Z,state:X})=>{try{let[q]=await gJ($,"strict:error",{signal:Z.signal});X.error=q4(q,J),Z.abort()}catch{}},Cz=async function*({anyProcess:$,channel:J,ipcEmitter:Z,isSubprocess:X,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of Rz(Z,"message",{signal:Y.signal}))yJ(Q),yield H}catch{yJ(Q)}finally{if(Y.abort(),z4(J,G),!X)a1($);if(q)await $}},yJ=({error:$})=>{if($)throw $};var cJ=($,{ipc:J})=>{Object.assign($,dJ($,!1,J))},pJ=()=>{let $=mJ,J=!0,Z=mJ.channel!==void 0;return{...dJ($,!0,Z),getCancelSignal:t8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:Z})}},dJ=($,J,Z)=>({sendMessage:_4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:Z}),getOneMessage:bJ.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 Fz}from"node:child_process";import{PassThrough as jz,Readable as xz,Writable as Pz,Duplex as Iz}from"node:stream";var lJ=({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,verboseInfo:Q})=>{K3(X);let G=new Fz;Oz(G,X),Object.assign(G,{readable:wz,writable:Ez,duplex:Az});let H=$$({error:$,command:J,escapedCommand:Z,fileDescriptors:X,options:q,startTime:Y,isSync:!1}),K=Nz(H,Q,q);return{subprocess:G,promise:K}},Oz=($,J)=>{let Z=P$(),X=P$(),q=P$(),Y=Array.from({length:J.length-3},P$),Q=P$(),G=[Z,X,q,...Y];Object.assign($,{stdin:Z,stdout:X,stderr:q,all:Q,stdio:G})},P$=()=>{let $=new jz;return $.end(),$},wz=()=>new xz({read(){}}),Ez=()=>new Pz({write(){}}),Az=()=>new Iz({read(){},write(){}}),Nz=async($,J,Z)=>J$($,J,Z);import{createReadStream as nJ,createWriteStream as iJ}from"node:fs";import{Buffer as hz}from"node:buffer";import{Readable as I$,Writable as Dz,Duplex as vz}from"node:stream";var tJ=($,J)=>D4(Sz,$,J,!1),O$=({type:$,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${B1[$]}.`)},oJ={fileNumber:O$,generator:_3,asyncGenerator:_3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:J,readableObjectMode:Z}}){let X=J||Z;return{stream:vz.fromWeb($,{objectMode:X})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},Sz={input:{...oJ,fileUrl:({value:$})=>({stream:nJ($)}),filePath:({value:{file:$}})=>({stream:nJ($)}),webStream:({value:$})=>({stream:I$.fromWeb($)}),iterable:({value:$})=>({stream:I$.from($)}),asyncIterable:({value:$})=>({stream:I$.from($)}),string:({value:$})=>({stream:I$.from($)}),uint8Array:({value:$})=>({stream:I$.from(hz.from($))})},output:{...oJ,fileUrl:({value:$})=>({stream:iJ($)}),filePath:({value:{file:$,append:J}})=>({stream:iJ($,J?{flags:"a"}:{})}),webStream:({value:$})=>({stream:Dz.fromWeb($)}),iterable:O$,asyncIterable:O$,string:O$,uint8Array:O$}};import{on as fz,once as aJ}from"node:events";import{PassThrough as kz,getDefaultHighWaterMark as bz}from"node:stream";import{finished as eJ}from"node:stream/promises";function O1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)F3(q);let J=$.some(({readableObjectMode:q})=>q),Z=yz($,J),X=new $Z({objectMode:J,writableHighWaterMark:Z,readableHighWaterMark:Z});for(let q of $)X.add(q);return X}var yz=($,J)=>{if($.length===0)return bz(J);let Z=$.filter(({readableObjectMode:X})=>X===J).map(({readableHighWaterMark:X})=>X);return Math.max(...Z)};class $Z extends kz{#J=new Set([]);#Z=new Set([]);#$=new Set([]);#X;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(F3($),this.#J.has($))return;this.#J.add($),this.#X??=gz(this,this.#J,this.#q);let J=cz({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(F3($),!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 gz=async($,J,Z)=>{g4($,rJ);let X=new AbortController;try{await Promise.race([uz($,X),mz($,J,Z,X)])}finally{X.abort(),g4($,-rJ)}},uz=async($,{signal:J})=>{try{await eJ($,{signal:J,cleanup:!0})}catch(Z){throw JZ($,Z),Z}},mz=async($,J,Z,{signal:X})=>{for await(let[q]of fz($,"unpipe",{signal:X}))if(J.has(q))q.emit(Z)},F3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},cz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,onFinished:Y,unpipeEvent:Q})=>{g4($,sJ);let G=new AbortController;try{await Promise.race([pz(Y,J,G),dz({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:G}),lz({stream:J,streams:Z,ended:X,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),g4($,-sJ)}if(Z.size>0&&Z.size===X.size+q.size)if(X.size===0&&q.size>0)j3($);else nz($)},pz=async($,J,{signal:Z})=>{try{if(await $,!Z.aborted)j3(J)}catch(X){if(!Z.aborted)JZ(J,X)}},dz=async({passThroughStream:$,stream:J,streams:Z,ended:X,aborted:q,controller:{signal:Y}})=>{try{if(await eJ(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(ZZ(Q))q.add(J);else XZ($,Q)}},lz=async({stream:$,streams:J,ended:Z,aborted:X,unpipeEvent:q,controller:{signal:Y}})=>{if(await aJ($,q,{signal:Y}),!$.readable)return aJ(Y,"abort",{signal:Y});J.delete($),Z.delete($),X.delete($)},nz=($)=>{if($.writable)$.end()},JZ=($,J)=>{if(ZZ(J))j3($);else XZ($,J)},ZZ=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",j3=($)=>{if($.readable||$.writable)$.destroy()},XZ=($,J)=>{if(!$.destroyed)$.once("error",iz),$.destroy(J)},iz=()=>{},g4=($,J)=>{let Z=$.getMaxListeners();if(Z!==0&&Z!==Number.POSITIVE_INFINITY)$.setMaxListeners(Z+J)},rJ=2,sJ=1;import{finished as QZ}from"node:stream/promises";var X$=($,J)=>{$.pipe(J),oz($,J),tz($,J)},oz=async($,J)=>{if(y0($)||y0(J))return;try{await QZ($,{cleanup:!0,readable:!0,writable:!1})}catch{}x3(J)},x3=($)=>{if($.writable)$.end()},tz=async($,J)=>{if(y0($)||y0(J))return;try{await QZ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}P3($)},P3=($)=>{if($.readable)$.destroy()};var qZ=($,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})=>D0.has(H)))az($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!D0.has(H)))sz({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]:O1(Y);X$(Q,q)}},az=($,J,Z,X)=>{if(Z==="output")X$($.stdio[X],J);else X$(J,$.stdio[X]);let q=rz[X];if(q!==void 0)$[q]=J;$.stdio[X]=J},rz=["stdin","stdout","stderr"],sz=({subprocess:$,stream:J,direction:Z,fdNumber:X,pipeGroups:q,controller:Y})=>{if(J===void 0)return;ez(J,Y);let[Q,G]=Z==="output"?[J,$.stdio[X]]:[$.stdio[X],J],H=q.get(Q)??[];q.set(Q,[...H,G])},ez=($,{signal:J})=>{if(y0($))j1($,$K,J)},$K=2;import{addAbortListener as XK}from"node:events";var w1=[];w1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")w1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")w1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var u4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",I3=Symbol.for("signal-exit emitter"),O3=globalThis,JK=Object.defineProperty.bind(Object);class YZ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(O3[I3])return O3[I3];JK(O3,I3,{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 E3{}var ZK=($)=>{return{onExit(J,Z){return $.onExit(J,Z)},load(){return $.load()},unload(){return $.unload()}}};class GZ extends E3{onExit(){return()=>{}}load(){}unload(){}}class HZ extends E3{#J=w3.platform==="win32"?"SIGINT":"SIGHUP";#Z=new YZ;#$;#X;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let J of w1)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(!u4(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 w1)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,w1.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(!u4(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"&&u4(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 w3=globalThis.process,{onExit:zZ,load:WF,unload:UF}=ZK(u4(w3)?new HZ(w3):new GZ);var KZ=($,{cleanup:J,detached:Z},{signal:X})=>{if(!J||Z)return;let q=zZ(()=>{$.kill()});XK(X,()=>{q()})};var WZ=({source:$,sourcePromise:J,boundOptions:Z,createNested:X},...q)=>{let Y=o$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:W}=QK(Z,X,q),{sourceStream:B,sourceError:U}=YK($,K),{options:_,fileDescriptors:T}=o0.get($);return{sourcePromise:J,sourceStream:B,sourceOptions:_,sourceError:U,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:W,fileDescriptors:T,startTime:Y}},QK=($,J,Z)=>{try{let{destination:X,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=qK($,J,...Z),G=G4(X,Y);return{destination:X,destinationStream:G,from:q,unpipeSignal:Q}}catch(X){return{destinationError:X}}},qK=($,J,Z,...X)=>{if(Array.isArray(Z))return{destination:J(BZ,$)(Z,...X),pipeOptions:$};if(typeof Z==="string"||Z instanceof URL||C2(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]=y$(Z,...X);return{destination:J(BZ)(q,Y,Q),pipeOptions:Q}}if(o0.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}`)},BZ=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),YK=($,J)=>{try{return{sourceStream:r1($,J)}}catch(Z){return{sourceError:Z}}};var VZ=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=GK({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X});if(G!==void 0)throw A3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},GK=({sourceStream:$,sourceError:J,destinationStream:Z,destinationError:X})=>{if(J!==void 0&&X!==void 0)return X;if(X!==void 0)return P3($),X;if(J!==void 0)return x3(Z),J},A3=({error:$,fileDescriptors:J,sourceOptions:Z,startTime:X})=>$$({error:$,command:UZ,escapedCommand:UZ,fileDescriptors:J,options:Z,startTime:X,isSync:!1}),UZ="source.pipe(destination)";var LZ=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 HK}from"node:stream/promises";var _Z=($,J,Z)=>{let X=m4.has(J)?KK($,J):zK($,J);return j1($,WK,Z.signal),j1(J,UK,Z.signal),BK(J),X},zK=($,J)=>{let Z=O1([$]);return X$(Z,J),m4.set(J,Z),Z},KK=($,J)=>{let Z=m4.get(J);return Z.add($),Z},BK=async($)=>{try{await HK($,{cleanup:!0,readable:!1,writable:!0})}catch{}m4.delete($)},m4=new WeakMap,WK=2,UK=1;import{aborted as VK}from"node:util";var RZ=($,J)=>$===void 0?[]:[LK($,J)],LK=async($,{sourceStream:J,mergedStream:Z,fileDescriptors:X,sourceOptions:q,startTime:Y})=>{await VK($,J),await Z.remove(J);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw A3({error:Q,fileDescriptors:X,sourceOptions:q,startTime:Y})};var c4=($,...J)=>{if(Q0(J[0]))return c4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...J[0]}});let{destination:Z,...X}=WZ($,...J),q=_K({...X,destination:Z});return q.pipe=c4.bind(void 0,{...$,source:Z,sourcePromise:q,boundOptions:{}}),q},_K=async({sourcePromise:$,sourceStream:J,sourceOptions:Z,sourceError:X,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let W=RK($,q);VZ({sourceStream:J,sourceError:X,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:Z,startTime:K});let B=new AbortController;try{let U=_Z(J,Y,B);return await Promise.race([LZ(W),...RZ(G,{sourceStream:J,mergedStream:U,sourceOptions:Z,fileDescriptors:H,startTime:K})])}finally{B.abort()}},RK=($,J)=>Promise.allSettled([$,J]);import{setImmediate as PK}from"node:timers/promises";import{on as TK}from"node:events";import{getDefaultHighWaterMark as MK}from"node:stream";var p4=({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:X,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return CK(J,Q),MZ({stream:$,controller:Q,binary:Z,shouldEncode:!$.readableObjectMode&&X,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},CK=async($,J)=>{try{await $}catch{}finally{J.abort()}},N3=({stream:$,onStreamEnd:J,lines:Z,encoding:X,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;FK(J,Q,$);let G=$.readableObjectMode&&!Y;return MZ({stream:$,controller:Q,binary:X==="buffer",shouldEncode:!G,encoding:X,shouldSplit:!G&&Z,preserveNewlines:!q})},FK=async($,J,Z)=>{try{await $}catch{Z.destroy()}finally{J.abort()}},MZ=({stream:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=TK($,"data",{signal:J.signal,highWaterMark:TZ,highWatermark:TZ});return jK({onStdoutChunk:G,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q})},h3=MK(!0),TZ=h3,jK=async function*({onStdoutChunk:$,controller:J,binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=xK({binary:Z,shouldEncode:X,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*I1(H,G,0)}catch(H){if(!J.signal.aborted)throw H}finally{yield*x$(G)}},xK=({binary:$,shouldEncode:J,encoding:Z,shouldSplit:X,preserveNewlines:q})=>[S4($,Z,!J),v4($,q,!X,{})].filter(Boolean);var CZ=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:W})=>{let B=IK({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:G,verboseInfo:K,streamInfo:W});if(!q){await Promise.all([OK($),B]);return}let U=B3(H,Z),_=N3({stream:$,onStreamEnd:J,lines:Q,encoding:X,stripFinalNewline:U,allMixed:G}),[T]=await Promise.all([wK({stream:$,iterable:_,fdNumber:Z,encoding:X,maxBuffer:Y,lines:Q}),B]);return T},IK=async({stream:$,onStreamEnd:J,fdNumber:Z,encoding:X,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!b4({stdioItems:Q[Z]?.stdioItems,encoding:X,verboseInfo:Y,fdNumber:Z}))return;let G=N3({stream:$,onStreamEnd:J,lines:!0,encoding:X,stripFinalNewline:!0,allMixed:q});await wJ(G,$,Z,Y)},OK=async($)=>{if(await PK(),$.readableFlowing===null)$.resume()},wK=async({stream:$,stream:{readableObjectMode:J},iterable:Z,fdNumber:X,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(J||Q)return await x4(Z,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await P4(Z,{maxBuffer:Y}));return await O4(Z,{maxBuffer:Y})}catch(G){return FZ(w5({error:G,stream:$,readableObjectMode:J,lines:Q,encoding:q,fdNumber:X}))}},D3=async($)=>{try{return await $}catch(J){return FZ(J)}},FZ=({bufferedData:$})=>p6($)?new Uint8Array($):$;import{finished as EK}from"node:stream/promises";var w$=async($,J,Z,{isSameDirection:X,stopOnExit:q=!1}={})=>{let Y=AK($,Z),Q=new AbortController;try{await Promise.race([...q?[Z.exitPromise]:[],EK($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)DK(G,J,Z,X)}finally{Q.abort()}},AK=($,{originalStreams:[J],subprocess:Z})=>{let X={stdinCleanedUp:!1};if($===J)NK($,Z,X);return X},NK=($,J,Z)=>{let{_destroy:X}=$;$._destroy=(...q)=>{hK(J,Z),X.call($,...q)}},hK=({exitCode:$,signalCode:J},Z)=>{if($!==null||J!==null)Z.stdinCleanedUp=!0},DK=($,J,Z,X)=>{if(!vK($,J,Z,X))throw $},vK=($,J,Z,X=!0)=>{if(Z.propagating)return jZ($)||d4($);return Z.propagating=!0,v3(Z,J)===X?jZ($):d4($)},v3=({fileDescriptors:$},J)=>J!=="all"&&$[J].direction==="input",d4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",jZ=($)=>$?.code==="EPIPE";var xZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>S3({stream:H,fdNumber:K,encoding:J,buffer:Z[K],maxBuffer:X[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),S3=async({stream:$,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let W=w$($,J,K);if(v3(K,J)){await W;return}let[B]=await Promise.all([CZ({stream:$,onStreamEnd:W,fdNumber:J,encoding:Z,buffer:X,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K}),W]);return B};var PZ=({stdout:$,stderr:J},{all:Z})=>Z&&($||J)?O1([$,J].filter(Boolean)):void 0,IZ=({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>S3({...SK($,Z),fdNumber:"all",encoding:J,maxBuffer:X[1]+X[2],lines:q[1]||q[2],allMixed:fK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),SK=({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}},fK=({all:$,stdout:J,stderr:Z})=>$&&J&&Z&&J.readableObjectMode!==Z.readableObjectMode;import{once as kK}from"node:events";var OZ=($)=>n1($,"ipc"),wZ=($,J)=>{let Z=i$($);l0({type:"ipc",verboseMessage:Z,fdNumber:"ipc",verboseInfo:J})};var EZ=async({subprocess:$,buffer:J,maxBuffer:Z,ipc:X,ipcOutput:q,verboseInfo:Y})=>{if(!X)return q;let Q=OZ(Y),G=$1(J,"ipc"),H=$1(Z,"ipc");for await(let K of C3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:X,shouldAwait:!1,reference:!0})){if(G)E5($,q,H),q.push(K);if(Q)wZ(K,Y)}return q},AZ=async($,J)=>{return await Promise.allSettled([$]),J};var NZ=async({subprocess:$,options:{encoding:J,buffer:Z,maxBuffer:X,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:K,ipc:W,ipcInput:B},context:U,verboseInfo:_,fileDescriptors:T,originalStreams:L,onInternalError:P,controller:I})=>{let D=DJ($,U),m={originalStreams:L,fileDescriptors:T,subprocess:$,exitPromise:D,propagating:!1},O=xZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:m}),l=IZ({subprocess:$,encoding:J,buffer:Z,maxBuffer:X,lines:q,stripFinalNewline:K,verboseInfo:_,streamInfo:m}),n=[],o=EZ({subprocess:$,buffer:Z,maxBuffer:X,ipc:W,ipcOutput:n,verboseInfo:_}),W0=bK(L,$,m),d=yK(T,m);try{return await Promise.race([Promise.all([{},SJ(D),Promise.all(O),l,o,q5($,B),...W0,...d]),P,gK($,I),...$5($,Y,U,I),...F8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:U,controller:I}),...s8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:U,controller:I})])}catch(d0){return U.terminationReason??="other",Promise.all([{error:d0},D,Promise.all(O.map((C)=>D3(C))),D3(l),AZ(o,n),Promise.allSettled(W0),Promise.allSettled(d)])}},bK=($,J,Z)=>$.map((X,q)=>X===J.stdio[q]?void 0:w$(X,q,Z)),yK=($,J)=>$.flatMap(({stdioItems:Z},X)=>Z.filter(({value:q,stream:Y=q})=>u0(Y,{checkOpen:!1})&&!y0(Y)).map(({type:q,value:Y,stream:Q=Y})=>w$(Q,X,J,{isSameDirection:D0.has(q),stopOnExit:q==="native"}))),gK=async($,{signal:J})=>{let[Z]=await kK($,"error",{signal:J});throw Z};var hZ=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),E$=($,J,Z)=>{let X=$[Z];if(!X.has(J))X.set(J,[]);let q=X.get(J),Y=i0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},Q$=async({resolve:$,promises:J},Z)=>{$();let[X]=await Promise.race([Promise.allSettled([!0,Z]),Promise.all([!1,...J])]);return!X};import{Readable as uK}from"node:stream";import{callbackify as mK}from"node:util";import{finished as DZ}from"node:stream/promises";var f3=async($)=>{if($===void 0)return;try{await k3($)}catch{}},vZ=async($)=>{if($===void 0)return;try{await b3($)}catch{}},k3=async($)=>{await DZ($,{cleanup:!0,readable:!1,writable:!0})},b3=async($)=>{await DZ($,{cleanup:!0,readable:!0,writable:!1})},l4=async($,J)=>{if(await $,J)throw J},n4=($,J,Z)=>{if(Z&&!d4(Z))$.destroy(Z);else if(J)$.destroy()};var SZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||I0.has(Z),{subprocessStdout:G,waitReadableDestroy:H}=y3($,X,J),{readableEncoding:K,readableObjectMode:W,readableHighWaterMark:B}=g3(G,Q),{read:U,onStdoutDataDone:_}=u3({subprocessStdout:G,subprocess:$,binary:Q,encoding:Z,preserveNewlines:Y}),T=new uK({read:U,destroy:mK(c3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:B,objectMode:W,encoding:K});return m3({subprocessStdout:G,onStdoutDataDone:_,readable:T,subprocess:$}),T},y3=($,J,Z)=>{let X=r1($,J),q=E$(Z,X,"readableDestroy");return{subprocessStdout:X,waitReadableDestroy:q}},g3=({readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z},X)=>X?{readableEncoding:$,readableObjectMode:J,readableHighWaterMark:Z}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:h3},u3=({subprocessStdout:$,subprocess:J,binary:Z,encoding:X,preserveNewlines:q})=>{let Y=i0(),Q=p4({subprocessStdout:$,subprocess:J,binary:Z,shouldEncode:!Z,encoding:X,preserveNewlines:q});return{read(){cK(this,Q,Y)},onStdoutDataDone:Y}},cK=async($,J,Z)=>{try{let{value:X,done:q}=await J.next();if(q)Z.resolve();else $.push(X)}catch{}},m3=async({subprocessStdout:$,onStdoutDataDone:J,readable:Z,subprocess:X,subprocessStdin:q})=>{try{if(await b3($),await X,await f3(q),await J,Z.readable)Z.push(null)}catch(Y){await f3(q),fZ(Z,Y)}},c3=async({subprocessStdout:$,subprocess:J,waitReadableDestroy:Z},X)=>{if(await Q$(Z,J))fZ($,X),await l4(J,X)},fZ=($,J)=>{n4($,$.readable,J)};import{Writable as pK}from"node:stream";import{callbackify as kZ}from"node:util";var bZ=({subprocess:$,concurrentStreams:J},{to:Z}={})=>{let{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}=p3($,Z,J),Q=new pK({...d3(X,$,q),destroy:kZ(n3.bind(void 0,{subprocessStdin:X,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:X.writableHighWaterMark,objectMode:X.writableObjectMode});return l3(X,Q),Q},p3=($,J,Z)=>{let X=G4($,J),q=E$(Z,X,"writableFinal"),Y=E$(Z,X,"writableDestroy");return{subprocessStdin:X,waitWritableFinal:q,waitWritableDestroy:Y}},d3=($,J,Z)=>({write:dK.bind(void 0,$),final:kZ(lK.bind(void 0,$,J,Z))}),dK=($,J,Z,X)=>{if($.write(J,Z))X();else $.once("drain",X)},lK=async($,J,Z)=>{if(await Q$(Z,J)){if($.writable)$.end();await J}},l3=async($,J,Z)=>{try{if(await k3($),J.writable)J.end()}catch(X){await vZ(Z),yZ(J,X)}},n3=async({subprocessStdin:$,subprocess:J,waitWritableFinal:Z,waitWritableDestroy:X},q)=>{if(await Q$(Z,J),await Q$(X,J))yZ($,q),await l4(J,q)},yZ=($,J)=>{n4($,$.writable,J)};import{Duplex as nK}from"node:stream";import{callbackify as iK}from"node:util";var gZ=({subprocess:$,concurrentStreams:J,encoding:Z},{from:X,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||I0.has(Z),{subprocessStdout:H,waitReadableDestroy:K}=y3($,X,J),{subprocessStdin:W,waitWritableFinal:B,waitWritableDestroy:U}=p3($,q,J),{readableEncoding:_,readableObjectMode:T,readableHighWaterMark:L}=g3(H,G),{read:P,onStdoutDataDone:I}=u3({subprocessStdout:H,subprocess:$,binary:G,encoding:Z,preserveNewlines:Q}),D=new nK({read:P,...d3(W,$,B),destroy:iK(oK.bind(void 0,{subprocessStdout:H,subprocessStdin:W,subprocess:$,waitReadableDestroy:K,waitWritableFinal:B,waitWritableDestroy:U})),readableHighWaterMark:L,writableHighWaterMark:W.writableHighWaterMark,readableObjectMode:T,writableObjectMode:W.writableObjectMode,encoding:_});return m3({subprocessStdout:H,onStdoutDataDone:I,readable:D,subprocess:$,subprocessStdin:W}),l3(W,D,H),D},oK=async({subprocessStdout:$,subprocessStdin:J,subprocess:Z,waitReadableDestroy:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([c3({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},Q),n3({subprocessStdin:J,subprocess:Z,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var i3=($,J,{from:Z,binary:X=!1,preserveNewlines:q=!1}={})=>{let Y=X||I0.has(J),Q=r1($,Z),G=p4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:J,preserveNewlines:q});return tK(G,Q,$)},tK=async function*($,J,Z){try{yield*$}finally{if(J.readable)J.destroy();await Z}};var uZ=($,{encoding:J})=>{let Z=hZ();$.readable=SZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.writable=bZ.bind(void 0,{subprocess:$,concurrentStreams:Z}),$.duplex=gZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:J}),$.iterable=i3.bind(void 0,$,J),$[Symbol.asyncIterator]=i3.bind(void 0,$,J,{})};var mZ=($,J)=>{for(let[Z,X]of rK){let q=X.value.bind(J);Reflect.defineProperty($,Z,{...X,value:q})}},aK=(async()=>{})().constructor.prototype,rK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(aK,$)]);var cZ=($,J,Z,X)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:W,fileDescriptors:B}=$B($,J,Z),{subprocess:U,promise:_}=ZB({file:q,commandArguments:Y,options:W,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:B});return U.pipe=c4.bind(void 0,{source:U,sourcePromise:_,boundOptions:{},createNested:X}),mZ(U,_),o0.set(U,{options:W,fileDescriptors:B}),U},$B=($,J,Z)=>{let{command:X,escapedCommand:q,startTime:Y,verboseInfo:Q}=t$($,J,Z),{file:G,commandArguments:H,options:K}=T4($,J,Z),W=JB(K),B=tJ(W,Q);return{file:G,commandArguments:H,command:X,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:B}},JB=({timeout:$,signal:J,...Z})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...Z,timeoutDuration:$}},ZB=({file:$,commandArguments:J,options:Z,startTime:X,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=eK(...M4($,J,Z))}catch(T){return lJ({error:T,command:Y,escapedCommand:Q,fileDescriptors:G,options:Z,startTime:X,verboseInfo:q})}let K=new AbortController;sK(Number.POSITIVE_INFINITY,K.signal);let W=[...H.stdio];qZ(H,G,K),KZ(H,Z,K);let B={},U=i0();H.kill=M8.bind(void 0,{kill:H.kill.bind(H),options:Z,onInternalError:U,context:B,controller:K}),H.all=PZ(H,Z),uZ(H,Z),cJ(H,Z);let _=XB({subprocess:H,options:Z,startTime:X,verboseInfo:q,fileDescriptors:G,originalStreams:W,command:Y,escapedCommand:Q,context:B,onInternalError:U,controller:K});return{subprocess:H,promise:_}},XB=async({subprocess:$,options:J,startTime:Z,verboseInfo:X,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:K,controller:W})=>{let[B,[U,_],T,L,P]=await NZ({subprocess:$,options:J,context:H,verboseInfo:X,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:W});W.abort(),K.resolve();let I=T.map((O,l)=>X1(O,J,l)),D=X1(L,J,"all"),m=QB({errorInfo:B,exitCode:U,signal:_,stdio:I,all:D,ipcOutput:P,context:H,options:J,command:Q,escapedCommand:G,startTime:Z});return J$(m,X,J)},QB=({errorInfo:$,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:K,startTime:W})=>("error"in $)?j$({error:$.error,command:H,escapedCommand:K,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof J1,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:J,signal:Z,stdio:X,all:q,ipcOutput:Y,options:G,startTime:W,isSync:!1}):E4({command:H,escapedCommand:K,stdio:X,all:q,ipcOutput:Y,options:G,startTime:W});var i4=($,J)=>{let Z=Object.fromEntries(Object.entries(J).map(([X,q])=>[X,qB(X,$[X],q)]));return{...$,...Z}},qB=($,J,Z)=>{if(YB.has($)&&Q0(J)&&Q0(Z))return{...J,...Z};return Z},YB=new Set(["env",...O2]);var W1=($,J,Z,X)=>{let q=(Q,G,H)=>W1(Q,G,Z,H),Y=(...Q)=>GB({mapArguments:$,deepOptions:Z,boundOptions:J,setBoundExeca:X,createNested:q},...Q);if(X!==void 0)X(Y,q,J);return Y},GB=({mapArguments:$,deepOptions:J={},boundOptions:Z={},setBoundExeca:X,createNested:q},Y,...Q)=>{if(Q0(Y))return q($,i4(Z,Y),X);let{file:G,commandArguments:H,options:K,isSync:W}=HB({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:J,boundOptions:Z});return W?kJ(G,H,K):cZ(G,H,K,q)},HB=({mapArguments:$,firstArgument:J,nextArguments:Z,deepOptions:X,boundOptions:q})=>{let Y=t6(J)?a6(J,Z):[J,...Z],[Q,G,H]=y$(...Y),K=i4(i4(X,q),H),{file:W=Q,commandArguments:B=G,options:U=K,isSync:_=!1}=$({file:Q,commandArguments:G,options:K});return{file:W,commandArguments:B,options:U,isSync:_}};var pZ=({file:$,commandArguments:J})=>lZ($,J),dZ=({file:$,commandArguments:J})=>({...lZ($,J),isSync:!0}),lZ=($,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${J}.`);let[Z,...X]=zB($);return{file:Z,commandArguments:X}},zB=($)=>{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(KB)){let q=Z.at(-1);if(q&&q.endsWith("\\"))Z[Z.length-1]=`${q.slice(0,-1)} ${X}`;else Z.push(X)}return Z},KB=/ +/g;var nZ=($,J,Z)=>{$.sync=J(BB,Z),$.s=$.sync},iZ=({options:$})=>oZ($),BB=({options:$})=>({...oZ($),isSync:!0}),oZ=($)=>({options:{...WB($),...$}}),WB=({input:$,inputFile:J,stdio:Z})=>$===void 0&&J===void 0&&Z===void 0?{stdin:"inherit"}:{},tZ={preferLocal:!0};var E1=W1(()=>({})),ZP=W1(()=>({isSync:!0})),XP=W1(pZ),QP=W1(dZ),qP=W1(Z5),YP=W1(iZ,{},tZ,nZ),{sendMessage:GP,getOneMessage:HP,getEachMessage:zP,getCancelSignal:KP}=pJ();var C0=p1(t3(),1),zX=p1(a4(),1);import{stdin as GX,stdout as HX}from"node:process";import*as U1 from"node:readline";import eZ from"node:readline";import{Writable as TB}from"node:stream";function MB({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 CB=MB();function KX($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(CB,"")}function BX($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var WX={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 W=H[K],B=J.length(W);if(G>=q-(B==2?1:0))if(G+B<=Y)Q+=W;else break;G+=B}return Q}})(WX);var FB=WX.exports,jB=BX(FB),xB=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},PB=BX(xB);function A$($,J={}){if(typeof $!="string"||$.length===0||(J={ambiguousIsNarrow:!0,...J},$=KX($),$.length===0))return 0;$=$.replace(PB()," ");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(jB.eastAsianWidth(q)){case"F":case"W":X+=2;break;case"A":X+=Z;break;default:X+=1}}return X}var r3=10,$X=($=0)=>(J)=>`\x1B[${J+$}m`,JX=($=0)=>(J)=>`\x1B[${38+$};5;${J}m`,ZX=($=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 IB=Object.keys($0.color),OB=Object.keys($0.bgColor);[...IB,...OB];function wB(){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=$X(),$0.color.ansi256=JX(),$0.color.ansi16m=ZX(),$0.bgColor.ansi=$X(r3),$0.bgColor.ansi256=JX(r3),$0.bgColor.ansi16m=ZX(r3),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 EB=wB(),e4=new Set(["\x1B",""]),AB=39,$6="\x07",UX="[",NB="]",VX="m",J6=`${NB}8;;`,XX=($)=>`${e4.values().next().value}${UX}${$}${VX}`,QX=($)=>`${e4.values().next().value}${J6}${$}${$6}`,hB=($)=>$.split(" ").map((J)=>A$(J)),s3=($,J,Z)=>{let X=[...J],q=!1,Y=!1,Q=A$(KX($[$.length-1]));for(let[G,H]of X.entries()){let K=A$(H);if(Q+K<=Z?$[$.length-1]+=H:($.push(H),Q=0),e4.has(H)&&(q=!0,Y=X.slice(G+1).join("").startsWith(J6)),q){Y?H===$6&&(q=!1,Y=!1):H===VX&&(q=!1);continue}Q+=K,Q===Z&&G<X.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},DB=($)=>{let J=$.split(" "),Z=J.length;for(;Z>0&&!(A$(J[Z-1])>0);)Z--;return Z===J.length?$:J.slice(0,Z).join(" ")+J.slice(Z).join("")},vB=($,J,Z={})=>{if(Z.trim!==!1&&$.trim()==="")return"";let X="",q,Y,Q=hB($),G=[""];for(let[K,W]of $.split(" ").entries()){Z.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let B=A$(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 U=J-B,_=1+Math.floor((Q[K]-U-1)/J);Math.floor((Q[K]-1)/J)<_&&G.push(""),s3(G,W,J);continue}if(B+Q[K]>J&&B>0&&Q[K]>0){if(Z.wordWrap===!1&&B<J){s3(G,W,J);continue}G.push("")}if(B+Q[K]>J&&Z.wordWrap===!1){s3(G,W,J);continue}G[G.length-1]+=W}Z.trim!==!1&&(G=G.map((K)=>DB(K)));let H=[...G.join(`
|
|
45
|
+
`)];for(let[K,W]of H.entries()){if(X+=W,e4.has(W)){let{groups:U}=new RegExp(`(?:\\${UX}(?<code>\\d+)m|\\${J6}(?<uri>.*)${$6})`).exec(H.slice(K).join(""))||{groups:{}};if(U.code!==void 0){let _=Number.parseFloat(U.code);q=_===AB?void 0:_}else U.uri!==void 0&&(Y=U.uri.length===0?void 0:U.uri)}let B=EB.codes.get(Number(q));H[K+1]===`
|
|
46
|
+
`?(Y&&(X+=QX("")),q&&B&&(X+=XX(B))):W===`
|
|
47
|
+
`&&(q&&B&&(X+=XX(q)),Y&&(X+=QX(Y)))}return X};function qX($,J,Z){return String($).normalize().replace(/\r\n/g,`
|
|
48
48
|
`).split(`
|
|
49
|
-
`).map((X)=>
|
|
50
|
-
`)}var
|
|
49
|
+
`).map((X)=>vB(X,J,Z)).join(`
|
|
50
|
+
`)}var SB=["up","down","left","right","space","enter","cancel"],s4={actions:new Set(SB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function Z6($,J){if(typeof $=="string")return s4.aliases.get($)===J;for(let Z of $)if(Z!==void 0&&Z6(Z,J))return!0;return!1}function fB($,J){if($===J)return;let Z=$.split(`
|
|
51
51
|
`),X=J.split(`
|
|
52
|
-
`),q=[];for(let Y=0;Y<Math.max(Z.length,X.length);Y++)Z[Y]!==X[Y]&&q.push(Y);return q}var
|
|
53
|
-
`),
|
|
54
|
-
`).length-1;this.output.write(
|
|
55
|
-
`);this.output.write(X[Z]),this._prevFrame=$,this.output.write(
|
|
52
|
+
`),q=[];for(let Y=0;Y<Math.max(Z.length,X.length);Y++)Z[Y]!==X[Y]&&q.push(Y);return q}var kB=globalThis.process.platform.startsWith("win"),e3=Symbol("clack:cancel");function Q1($){return $===e3}function r4($,J){let Z=$;Z.isTTY&&Z.setRawMode(J)}function LX({input:$=GX,output:J=HX,overwrite:Z=!0,hideCursor:X=!0}={}){let q=U1.createInterface({input:$,output:J,prompt:"",tabSize:1});U1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let K=String(Q);if(Z6([K,G,H],"cancel")){X&&J.write(C0.cursor.show),process.exit(0);return}if(!Z)return;U1.moveCursor(J,G==="return"?0:-1,G==="return"?-1:0,()=>{U1.clearLine(J,1,()=>{$.once("keypress",Y)})})};return X&&J.write(C0.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),X&&J.write(C0.cursor.show),$.isTTY&&!kB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var bB=Object.defineProperty,yB=($,J,Z)=>(J in $)?bB($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,O0=($,J,Z)=>(yB($,typeof J!="symbol"?J+"":J,Z),Z);class $2{constructor($,J=!0){O0(this,"input"),O0(this,"output"),O0(this,"_abortSignal"),O0(this,"rl"),O0(this,"opts"),O0(this,"_render"),O0(this,"_track",!1),O0(this,"_prevFrame",""),O0(this,"_subscribers",new Map),O0(this,"_cursor",0),O0(this,"state","initial"),O0(this,"error",""),O0(this,"value");let{input:Z=GX,output:X=HX,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(),$(e3);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let Z=new TB;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=eZ.createInterface({input:this.input,output:Z,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),eZ.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),r4(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(C0.cursor.show),this.output.off("resize",this.render),r4(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(C0.cursor.show),this.output.off("resize",this.render),r4(this.input,!1),$(e3)})})}onKeypress($,J){if(this.state==="error"&&(this.state="active"),J?.name&&(!this._track&&s4.aliases.has(J.name)&&this.emit("cursor",s4.aliases.get(J.name)),s4.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")}Z6([$,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
|
+
`),r4(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=qX(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
54
|
+
`).length-1;this.output.write(C0.cursor.move(-999,$*-1))}render(){let $=qX(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(C0.cursor.hide);else{let J=fB(this._prevFrame,$);if(this.restoreCursor(),J&&J?.length===1){let Z=J[0];this.output.write(C0.cursor.move(0,Z)),this.output.write(C0.erase.lines(1));let X=$.split(`
|
|
55
|
+
`);this.output.write(X[Z]),this._prevFrame=$,this.output.write(C0.cursor.move(0,X.length-Z-1));return}if(J&&J?.length>1){let Z=J[0];this.output.write(C0.cursor.move(0,Z)),this.output.write(C0.erase.down());let X=$.split(`
|
|
56
56
|
`).slice(Z);this.output.write(X.join(`
|
|
57
|
-
`)),this._prevFrame=$;return}this.output.write(
|
|
58
|
-
${
|
|
59
|
-
`,Z=$.placeholder?
|
|
60
|
-
${
|
|
61
|
-
${
|
|
62
|
-
`;case"submit":return`${J}${
|
|
63
|
-
${
|
|
64
|
-
${
|
|
65
|
-
`}}}).prompt();var
|
|
66
|
-
${
|
|
67
|
-
`,q=this.value?J:Z;switch(this.state){case"submit":return`${X}${
|
|
68
|
-
${
|
|
69
|
-
${
|
|
70
|
-
`}}}).prompt()},
|
|
71
|
-
${
|
|
72
|
-
`;switch(this.state){case"submit":return`${Z}${
|
|
73
|
-
${
|
|
74
|
-
${
|
|
75
|
-
${
|
|
76
|
-
`}}}).prompt()};var
|
|
57
|
+
`)),this._prevFrame=$;return}this.output.write(C0.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class X6 extends $2{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(J)=>{this.output.write(C0.cursor.move(0,-1)),this.value=J,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var gB;gB=new WeakMap;var uB=Object.defineProperty,mB=($,J,Z)=>(J in $)?uB($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,YX=($,J,Z)=>(mB($,typeof J!="symbol"?J+"":J,Z),Z);class Q6 extends $2{constructor($){super($,!1),YX(this,"options"),YX(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 q6 extends $2{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`${$}${zX.default.inverse(J)}${Z.join("")}`}get cursor(){return this._cursor}constructor($){super($),this.on("finalize",()=>{this.value||(this.value=$.defaultValue)})}}var w=p1(a4(),1),J2=p1(t3(),1);import m0 from"node:process";function cB(){return m0.platform!=="win32"?m0.env.TERM!=="linux":!!m0.env.CI||!!m0.env.WT_SESSION||!!m0.env.TERMINUS_SUBLIME||m0.env.ConEmuTask==="{cmd::Cmder}"||m0.env.TERM_PROGRAM==="Terminus-Sublime"||m0.env.TERM_PROGRAM==="vscode"||m0.env.TERM==="xterm-256color"||m0.env.TERM==="alacritty"||m0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Y6=cB(),q0=($,J)=>Y6?$:J,pB=q0("◆","*"),_X=q0("■","x"),RX=q0("▲","x"),z6=q0("◇","o"),dB=q0("┌","T"),J0=q0("│","|"),q$=q0("└","—"),G6=q0("●",">"),H6=q0("○"," "),IP=q0("◻","[•]"),OP=q0("◼","[+]"),wP=q0("◻","[ ]"),EP=q0("▪","•"),AP=q0("─","-"),NP=q0("╮","+"),hP=q0("├","+"),DP=q0("╯","+"),lB=q0("●","•"),nB=q0("◆","*"),iB=q0("▲","!"),oB=q0("■","x"),K6=($)=>{switch($){case"initial":case"active":return w.default.cyan(pB);case"cancel":return w.default.red(_X);case"error":return w.default.yellow(RX);case"submit":return w.default.green(z6)}},tB=($)=>{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((W,B,U)=>{let _=B===0&&H,T=B===U.length-1&&K;return _||T?w.default.dim("..."):X(W,B+G===J)})},TX=($)=>new q6({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let J=`${w.default.gray(J0)}
|
|
58
|
+
${K6(this.state)} ${$.message}
|
|
59
|
+
`,Z=$.placeholder?w.default.inverse($.placeholder[0])+w.default.dim($.placeholder.slice(1)):w.default.inverse(w.default.hidden("_")),X=this.value?this.valueWithCursor:Z;switch(this.state){case"error":return`${J.trim()}
|
|
60
|
+
${w.default.yellow(J0)} ${X}
|
|
61
|
+
${w.default.yellow(q$)} ${w.default.yellow(this.error)}
|
|
62
|
+
`;case"submit":return`${J}${w.default.gray(J0)} ${w.default.dim(this.value||$.placeholder)}`;case"cancel":return`${J}${w.default.gray(J0)} ${w.default.strikethrough(w.default.dim(this.value??""))}${this.value?.trim()?`
|
|
63
|
+
${w.default.gray(J0)}`:""}`;default:return`${J}${w.default.cyan(J0)} ${X}
|
|
64
|
+
${w.default.cyan(q$)}
|
|
65
|
+
`}}}).prompt();var Z2=($)=>{let J=$.active??"Yes",Z=$.inactive??"No";return new X6({active:J,inactive:Z,initialValue:$.initialValue??!0,render(){let X=`${w.default.gray(J0)}
|
|
66
|
+
${K6(this.state)} ${$.message}
|
|
67
|
+
`,q=this.value?J:Z;switch(this.state){case"submit":return`${X}${w.default.gray(J0)} ${w.default.dim(q)}`;case"cancel":return`${X}${w.default.gray(J0)} ${w.default.strikethrough(w.default.dim(q))}
|
|
68
|
+
${w.default.gray(J0)}`;default:return`${X}${w.default.cyan(J0)} ${this.value?`${w.default.green(G6)} ${J}`:`${w.default.dim(H6)} ${w.default.dim(J)}`} ${w.default.dim("/")} ${this.value?`${w.default.dim(H6)} ${w.default.dim(Z)}`:`${w.default.green(G6)} ${Z}`}
|
|
69
|
+
${w.default.cyan(q$)}
|
|
70
|
+
`}}}).prompt()},B6=($)=>{let J=(Z,X)=>{let q=Z.label??String(Z.value);switch(X){case"selected":return`${w.default.dim(q)}`;case"active":return`${w.default.green(G6)} ${q} ${Z.hint?w.default.dim(`(${Z.hint})`):""}`;case"cancelled":return`${w.default.strikethrough(w.default.dim(q))}`;default:return`${w.default.dim(H6)} ${w.default.dim(q)}`}};return new Q6({options:$.options,initialValue:$.initialValue,render(){let Z=`${w.default.gray(J0)}
|
|
71
|
+
${K6(this.state)} ${$.message}
|
|
72
|
+
`;switch(this.state){case"submit":return`${Z}${w.default.gray(J0)} ${J(this.options[this.cursor],"selected")}`;case"cancel":return`${Z}${w.default.gray(J0)} ${J(this.options[this.cursor],"cancelled")}
|
|
73
|
+
${w.default.gray(J0)}`;default:return`${Z}${w.default.cyan(J0)} ${tB({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(X,q)=>J(X,q?"active":"inactive")}).join(`
|
|
74
|
+
${w.default.cyan(J0)} `)}
|
|
75
|
+
${w.default.cyan(q$)}
|
|
76
|
+
`}}}).prompt()};var W6=($="")=>{process.stdout.write(`${w.default.gray(q$)} ${w.default.red($)}
|
|
77
77
|
|
|
78
|
-
`)},
|
|
79
|
-
`)},
|
|
80
|
-
${
|
|
78
|
+
`)},MX=($="")=>{process.stdout.write(`${w.default.gray(dB)} ${$}
|
|
79
|
+
`)},X2=($="")=>{process.stdout.write(`${w.default.gray(J0)}
|
|
80
|
+
${w.default.gray(q$)} ${$}
|
|
81
81
|
|
|
82
|
-
`)},
|
|
83
|
-
`);Z.push(`${J} ${X}`,...q.map((Y)=>`${
|
|
82
|
+
`)},x0={message:($="",{symbol:J=w.default.gray(J0)}={})=>{let Z=[`${w.default.gray(J0)}`];if($){let[X,...q]=$.split(`
|
|
83
|
+
`);Z.push(`${J} ${X}`,...q.map((Y)=>`${w.default.gray(J0)} ${Y}`))}process.stdout.write(`${Z.join(`
|
|
84
84
|
`)}
|
|
85
|
-
`)},info:($)=>{
|
|
86
|
-
`);let
|
|
87
|
-
`);process.stdout.write(
|
|
88
|
-
`);let
|
|
89
|
-
`):process.stdout.write(`${
|
|
90
|
-
`),
|
|
91
|
-
`).map((X)=>X.split("\t")),Z=0;return J.forEach((X)=>{if(X.length>1&&
|
|
92
|
-
`)}rowToString($,J){return this.rasterize($).forEach((Z,X)=>{let q="";Z.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),K=Y;if(H>
|
|
85
|
+
`)},info:($)=>{x0.message($,{symbol:w.default.blue(lB)})},success:($)=>{x0.message($,{symbol:w.default.green(nB)})},step:($)=>{x0.message($,{symbol:w.default.green(z6)})},warn:($)=>{x0.message($,{symbol:w.default.yellow(iB)})},warning:($)=>{x0.warn($)},error:($)=>{x0.message($,{symbol:w.default.red(oB)})}},vP=`${w.default.gray(J0)} `;var Q2=({indicator:$="dots"}={})=>{let J=Y6?["◒","◐","◓","◑"]:["•","o","O","0"],Z=Y6?80:120,X=process.env.CI==="true",q,Y,Q=!1,G="",H,K=performance.now(),W=(O)=>{let l=O>1?"Something went wrong":"Canceled";Q&&m(l,O)},B=()=>W(2),U=()=>W(1),_=()=>{process.on("uncaughtExceptionMonitor",B),process.on("unhandledRejection",B),process.on("SIGINT",U),process.on("SIGTERM",U),process.on("exit",W)},T=()=>{process.removeListener("uncaughtExceptionMonitor",B),process.removeListener("unhandledRejection",B),process.removeListener("SIGINT",U),process.removeListener("SIGTERM",U),process.removeListener("exit",W)},L=()=>{if(H===void 0)return;X&&process.stdout.write(`
|
|
86
|
+
`);let O=H.split(`
|
|
87
|
+
`);process.stdout.write(J2.cursor.move(-999,O.length-1)),process.stdout.write(J2.erase.down(O.length))},P=(O)=>O.replace(/\.+$/,""),I=(O)=>{let l=(performance.now()-O)/1000,n=Math.floor(l/60),o=Math.floor(l%60);return n>0?`[${n}m ${o}s]`:`[${o}s]`},D=(O="")=>{Q=!0,q=LX(),G=P(O),K=performance.now(),process.stdout.write(`${w.default.gray(J0)}
|
|
88
|
+
`);let l=0,n=0;_(),Y=setInterval(()=>{if(X&&G===H)return;L(),H=G;let o=w.default.magenta(J[l]);if(X)process.stdout.write(`${o} ${G}...`);else if($==="timer")process.stdout.write(`${o} ${G} ${I(K)}`);else{let W0=".".repeat(Math.floor(n)).slice(0,3);process.stdout.write(`${o} ${G}${W0}`)}l=l+1<J.length?l+1:0,n=n<J.length?n+0.125:0},Z)},m=(O="",l=0)=>{Q=!1,clearInterval(Y),L();let n=l===0?w.default.green(z6):l===1?w.default.red(_X):w.default.red(RX);G=P(O??G),$==="timer"?process.stdout.write(`${n} ${G} ${I(K)}
|
|
89
|
+
`):process.stdout.write(`${n} ${G}
|
|
90
|
+
`),T(),q()};return{start:D,stop:m,message:(O="")=>{G=P(O??G)}}};var B$=p1(a4(),1);import{notStrictEqual as TW,strictEqual as MW}from"assert";var rB={right:$W,center:JW};class FX{constructor($){var J;this.width=$.width,this.wrap=(J=$.wrap)!==null&&J!==void 0?J:!0,this.rows=[]}span(...$){let J=this.div(...$);J.span=!0}resetOutput(){this.rows=[]}div(...$){if($.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...$)&&typeof $[0]==="string")return this.applyLayoutDSL($[0]);let J=$.map((Z)=>{if(typeof Z==="string")return this.colFromString(Z);return Z});return this.rows.push(J),J}shouldApplyLayoutDSL(...$){return $.length===1&&typeof $[0]==="string"&&/[\t\n]/.test($[0])}applyLayoutDSL($){let J=$.split(`
|
|
91
|
+
`).map((X)=>X.split("\t")),Z=0;return J.forEach((X)=>{if(X.length>1&&w0.stringWidth(X[0])>Z)Z=Math.min(Math.floor(this.width*0.5),w0.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=w0.stripAnsi($);return[0,J.match(/\s*$/)[0].length,0,J.match(/^\s*/)[0].length]}toString(){let $=[];return this.rows.forEach((J)=>{this.rowToString(J,$)}),$.filter((J)=>!J.hidden).map((J)=>J.text).join(`
|
|
92
|
+
`)}rowToString($,J){return this.rasterize($).forEach((Z,X)=>{let q="";Z.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),K=Y;if(H>w0.stringWidth(Y))K+=" ".repeat(H-w0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let B=rB[$[Q].align];if(K=B(K,H),w0.stringWidth(K)<H)K+=" ".repeat((G||0)-w0.stringWidth(K)-1)}let W=$[Q].padding||[0,0,0,0];if(W[3])q+=" ".repeat(W[3]);if(q+=CX($[Q],K,"| "),q+=K,q+=CX($[Q],K," |"),W[1])q+=" ".repeat(W[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=w0.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=w0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
|
|
93
93
|
`);else X=q.text.split(`
|
|
94
|
-
`);if(q.border)X.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),X.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)X.unshift(...Array(q.padding[0]||0).fill("")),X.push(...Array(q.padding[2]||0).fill(""));X.forEach((Q,G)=>{if(!J[G])J.push([]);let H=J[G];for(let K=0;K<Y;K++)if(H[K]===void 0)H.push("");H.push(Q)})}),J}negatePadding($){let J=$.width||0;if($.padding)J-=($.padding[3]||0)+($.padding[1]||0);if($.border)J-=4;return J}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||
|
|
95
|
-
`;q+=$.charAt(Y)}if(Z&&X)q=`${Z}${q}${X}`;return q}function K6($){return jX($,{stringWidth:(J)=>{return[...J].length},stripAnsi:z6,wrap:PX})}import{dirname as IX,resolve as OX}from"path";import{readdirSync as sB,statSync as eB}from"fs";function B6($,J){let Z=OX(".",$),X;if(!eB(Z).isDirectory())Z=IX(Z);while(!0){if(X=J(Z,sB(Z)),X)return OX(Z,X);if(Z=IX(X=Z),X===Z)break}}import{inspect as _U}from"util";import{readFileSync as RU}from"fs";import{fileURLToPath as TU}from"url";import{format as ZU}from"util";import{normalize as XU,resolve as QU}from"path";function I1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let Z="",X=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(X)X=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))X=!0;else if(Q!=="-"&&Q!=="_")Z+=Q}return Z}}function J2($,J){let Z=$.toLowerCase();J=J||"-";let X="";for(let q=0;q<$.length;q++){let Y=Z.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)X+=`${J}${Z.charAt(q)}`;else X+=Q}return X}function Z2($){if($===null||$===void 0)return!1;if(typeof $==="number")return!0;if(/^0x[0-9a-f]+$/i.test($))return!0;if(/^0[^.]/.test($))return!1;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test($)}function wX($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let J=0,Z=null,X=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(Z=X,X=$.charAt(Q),X===" "&&!q){if(Z!==" ")J++;continue}if(X===q)q=null;else if((X==="'"||X==='"')&&!q)q=X;if(!Y[J])Y[J]="";Y[J]+=X}return Y}var D0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(D0||(D0={}));var Q1;class W6{constructor($){Q1=$}parse($,J){let Z=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},J),X=wX($),q=typeof $==="string",Y=$U(Object.assign(Object.create(null),Z.alias)),Q=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},Z.configuration),G=Object.assign(Object.create(null),Z.default),H=Z.configObjects||[],K=Z.envPrefix,U=Q["populate--"],B=U?"--":"_",W=Object.create(null),_=Object.create(null),R=Z.__||Q1.format,L={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},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,F=Object.keys(V).map(function(C){return{boolean:"bools",string:"strings",number:"numbers"}[C]}).filter(Boolean).pop();if(F)L[F][M]=!0;L.arrays[M]=!0,L.keys.push(M)}),[].concat(Z.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(Z.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(Z.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(Z.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(Z.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof Z.narg==="object")Object.entries(Z.narg).forEach(([V,M])=>{if(typeof M==="number")L.nargs[V]=M,L.keys.push(V)});if(typeof Z.coerce==="object")Object.entries(Z.coerce).forEach(([V,M])=>{if(typeof M==="function")L.coercions[V]=M,L.keys.push(V)});if(typeof Z.config<"u"){if(Array.isArray(Z.config)||typeof Z.config==="string")[].concat(Z.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof Z.config==="object")Object.entries(Z.config).forEach(([V,M])=>{if(typeof M==="boolean"||typeof M==="function")L.configs[V]=M})}K$(Z.key,Y,Z.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(M){G[M]=G[V]})});let D=null;V2();let p=[],P=Object.assign(Object.create(null),{_:[]}),E={};for(let V=0;V<X.length;V++){let M=X[V],F=M.replace(/^-{3,}/,"---"),C,T,v,w,b,U0;if(M!=="--"&&/^-/.test(M)&&a(M))k(M);else if(F.match(/^---+(=|$)/)){k(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(y(w[1],L.arrays))V=T0(V,w[1],X,w[2]);else if(y(w[1],L.nargs)!==!1)V=n(V,w[1],X,w[2]);else i(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],i(T,y(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],y(T,L.arrays))V=T0(V,T,X);else if(y(T,L.nargs)!==!1)V=n(V,T,X);else if(b=X[V+1],b!==void 0&&(!b.match(/^-/)||b.match(x))&&!y(T,L.bools)&&!y(T,L.counts))i(T,b),V++;else if(/^(true|false)$/.test(b))i(T,b),V++;else i(T,l(T))}else if(M.match(/^-.\..+=/)){if(w=M.match(/^-([^=]+)=([\s\S]*)$/),w!==null&&Array.isArray(w)&&w.length>=3)i(w[1],w[2])}else if(M.match(/^-.\..+/)&&!M.match(x)){if(b=X[V+1],w=M.match(/^-(.\..+)/),w!==null&&Array.isArray(w)&&w.length>=2)if(T=w[1],b!==void 0&&!b.match(/^-/)&&!y(T,L.bools)&&!y(T,L.counts))i(T,b),V++;else i(T,l(T))}else if(M.match(/^-[^-]+/)&&!M.match(x)){v=M.slice(1,-1).split(""),C=!1;for(let M0=0;M0<v.length;M0++){if(b=M.slice(M0+2),v[M0+1]&&v[M0+1]==="="){if(U0=M.slice(M0+3),T=v[M0],y(T,L.arrays))V=T0(V,T,X,U0);else if(y(T,L.nargs)!==!1)V=n(V,T,X,U0);else i(T,U0);C=!0;break}if(b==="-"){i(v[M0],b);continue}if(/[A-Za-z]/.test(v[M0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(b)&&y(b,L.bools)===!1){i(v[M0],b),C=!0;break}if(v[M0+1]&&v[M0+1].match(/\W/)){i(v[M0],b),C=!0;break}else i(v[M0],l(v[M0]))}if(T=M.slice(-1)[0],!C&&T!=="-")if(y(T,L.arrays))V=T0(V,T,X);else if(y(T,L.nargs)!==!1)V=n(V,T,X);else if(b=X[V+1],b!==void 0&&(!/^(-|--)[^-]/.test(b)||b.match(x))&&!y(T,L.bools)&&!y(T,L.counts))i(T,b),V++;else if(/^(true|false)$/.test(b))i(T,b),V++;else i(T,l(T))}else if(M.match(/^-[0-9]$/)&&M.match(x)&&y(M.slice(1),L.bools))T=M.slice(1),i(T,l(T));else if(M==="--"){p=X.slice(V+1);break}else if(Q["halt-at-non-option"]){p=X.slice(V);break}else k(M)}if(G0(P,!0),G0(P,!1),S(P),t(),q1(P,L.aliases,G,!0),o(P),Q["set-placeholder-key"])H0(P);if(Object.keys(L.counts).forEach(function(V){if(!r(P,V.split(".")))i(V,0)}),U&&p.length)P[B]=[];if(p.forEach(function(V){P[B].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(P).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete P[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete P[V.split(".").map((M)=>I1(M)).join(".")];delete P[V]});function k(V){let M=O("_",V);if(typeof M==="string"||typeof M==="number")P._.push(M)}function n(V,M,F,C){let T,v=y(M,L.nargs);if(v=typeof v!=="number"||isNaN(v)?1:v,v===0){if(!K0(C))D=Error(R("Argument unexpected for: %s",M));return i(M,l(M)),V}let w=K0(C)?0:1;if(Q["nargs-eats-options"]){if(F.length-(V+1)+w<v)D=Error(R("Not enough arguments following: %s",M));w=v}else{for(T=V+1;T<F.length;T++)if(!F[T].match(/^-[^0-9]/)||F[T].match(x)||a(F[T]))w++;else break;if(w<v)D=Error(R("Not enough arguments following: %s",M))}let b=Math.min(w,v);if(!K0(C)&&b>0)i(M,C),b--;for(T=V+1;T<b+V+1;T++)i(M,F[T]);return V+b}function T0(V,M,F,C){let T=[],v=C||F[V+1],w=y(M,L.nargs);if(y(M,L.bools)&&!/^(true|false)$/.test(v))T.push(!0);else if(K0(v)||K0(C)&&/^-/.test(v)&&!x.test(v)&&!a(v)){if(G[M]!==void 0){let b=G[M];T=Array.isArray(b)?b:[b]}}else{if(!K0(C))T.push(A(M,C,!0));for(let b=V+1;b<F.length;b++){if(!Q["greedy-arrays"]&&T.length>0||w&&typeof w==="number"&&T.length>=w)break;if(v=F[b],/^-/.test(v)&&!x.test(v)&&!a(v))break;V=b,T.push(A(M,v,q))}}if(typeof w==="number"&&(w&&T.length<w||isNaN(w)&&T.length===0))D=Error(R("Not enough arguments following: %s",M));return i(M,T),V}function i(V,M,F=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let v=V.split(".").map(function(w){return I1(w)}).join(".");r0(V,v)}let C=A(V,M,F),T=V.split(".");if(s0(P,T,C),L.aliases[V])L.aliases[V].forEach(function(v){let w=v.split(".");s0(P,w,C)});if(T.length>1&&Q["dot-notation"])(L.aliases[T[0]]||[]).forEach(function(v){let w=v.split("."),b=[].concat(T);if(b.shift(),w=w.concat(b),!(L.aliases[V]||[]).includes(w.join(".")))s0(P,w,C)});if(y(V,L.normalize)&&!y(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(w){Object.defineProperty(E,w,{enumerable:!0,get(){return M},set(b){M=typeof b==="string"?Q1.normalize(b):b}})})}function r0(V,M){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[M],W[M]=!0;if(!(L.aliases[M]&&L.aliases[M].length))r0(M,V)}function A(V,M,F){if(F)M=JU(M);if(y(V,L.bools)||y(V,L.counts)){if(typeof M==="string")M=M==="true"}let C=Array.isArray(M)?M.map(function(T){return O(V,T)}):O(V,M);if(y(V,L.counts)&&(K0(C)||typeof C==="boolean"))C=U6();if(y(V,L.normalize)&&y(V,L.arrays))if(Array.isArray(M))C=M.map((T)=>{return Q1.normalize(T)});else C=Q1.normalize(M);return C}function O(V,M){if(!Q["parse-positional-numbers"]&&V==="_")return M;if(!y(V,L.strings)&&!y(V,L.bools)&&!Array.isArray(M)){if(Z2(M)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${M}`)))||!K0(M)&&y(V,L.numbers))M=Number(M)}return M}function S(V){let M=Object.create(null);q1(M,L.aliases,G),Object.keys(L.configs).forEach(function(F){let C=V[F]||M[F];if(C)try{let T=null,v=Q1.resolve(Q1.cwd(),C),w=L.configs[F];if(typeof w==="function"){try{T=w(v)}catch(b){T=b}if(T instanceof Error){D=T;return}}else T=Q1.require(v);m(T)}catch(T){if(T.name==="PermissionDenied")D=T;else if(V[F])D=Error(R("Invalid JSON config file: %s",C))}})}function m(V,M){Object.keys(V).forEach(function(F){let C=V[F],T=M?M+"."+F:F;if(typeof C==="object"&&C!==null&&!Array.isArray(C)&&Q["dot-notation"])m(C,T);else if(!r(P,T.split("."))||y(T,L.arrays)&&Q["combine-arrays"])i(T,C)})}function t(){if(typeof H<"u")H.forEach(function(V){m(V)})}function G0(V,M){if(typeof K>"u")return;let F=typeof K==="string"?K:"",C=Q1.env();Object.keys(C).forEach(function(T){if(F===""||T.lastIndexOf(F,0)===0){let v=T.split("__").map(function(w,b){if(b===0)w=w.substring(F.length);return I1(w)});if((M&&L.configs[v.join(".")]||!M)&&!r(V,v))i(v.join("."),C[T])}})}function o(V){let M,F=new Set;Object.keys(V).forEach(function(C){if(!F.has(C)){if(M=y(C,L.coercions),typeof M==="function")try{let T=O(C,M(V[C]));[].concat(L.aliases[C]||[],C).forEach((v)=>{F.add(v),V[v]=T})}catch(T){D=T}}})}function H0(V){return L.keys.forEach((M)=>{if(~M.indexOf("."))return;if(typeof V[M]>"u")V[M]=void 0}),V}function q1(V,M,F,C=!1){Object.keys(F).forEach(function(T){if(!r(V,T.split("."))){if(s0(V,T.split("."),F[T]),C)_[T]=!0;(M[T]||[]).forEach(function(v){if(r(V,v.split(".")))return;s0(V,v.split("."),F[T])})}})}function r(V,M){let F=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(T){F=F[T]||{}});let C=M[M.length-1];if(typeof F!=="object")return!1;else return C in F}function s0(V,M,F){let C=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(U0){if(U0=EX(U0),typeof C==="object"&&C[U0]===void 0)C[U0]={};if(typeof C[U0]!=="object"||Array.isArray(C[U0])){if(Array.isArray(C[U0]))C[U0].push({});else C[U0]=[C[U0],{}];C=C[U0][C[U0].length-1]}else C=C[U0]});let T=EX(M[M.length-1]),v=y(M.join("."),L.arrays),w=Array.isArray(F),b=Q["duplicate-arguments-array"];if(!b&&y(T,L.nargs)){if(b=!0,!K0(C[T])&&L.nargs[T]===1||Array.isArray(C[T])&&C[T].length===L.nargs[T])C[T]=void 0}if(F===U6())C[T]=U6(C[T]);else if(Array.isArray(C[T]))if(b&&v&&w)C[T]=Q["flatten-duplicate-arrays"]?C[T].concat(F):(Array.isArray(C[T][0])?C[T]:[C[T]]).concat([F]);else if(!b&&Boolean(v)===Boolean(w))C[T]=F;else C[T]=C[T].concat([F]);else if(C[T]===void 0&&v)C[T]=w?F:[F];else if(b&&!(C[T]===void 0||y(T,L.counts)||y(T,L.bools)))C[T]=[C[T],F];else C[T]=F}function K$(...V){V.forEach(function(M){Object.keys(M||{}).forEach(function(F){if(L.aliases[F])return;L.aliases[F]=[].concat(Y[F]||[]),L.aliases[F].concat(F).forEach(function(C){if(/-/.test(C)&&Q["camel-case-expansion"]){let T=I1(C);if(T!==F&&L.aliases[F].indexOf(T)===-1)L.aliases[F].push(T),W[T]=!0}}),L.aliases[F].concat(F).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&Q["camel-case-expansion"]){let T=J2(C,"-");if(T!==F&&L.aliases[F].indexOf(T)===-1)L.aliases[F].push(T),W[T]=!0}}),L.aliases[F].forEach(function(C){L.aliases[C]=[F].concat(L.aliases[F].filter(function(T){return C!==T}))})})})}function y(V,M){let F=[].concat(L.aliases[V]||[],V),C=Object.keys(M),T=F.find((v)=>C.includes(v));return T?M[T]:!1}function y1(V){let M=Object.keys(L);return[].concat(M.map((C)=>L[C])).some(function(C){return Array.isArray(C)?C.includes(V):C[V]})}function b6(V,...M){return[].concat(...M).some(function(C){let T=V.match(C);return T&&y1(T[1])})}function g(V){if(V.match(x)||!V.match(/^-[^-]+/))return!1;let M=!0,F,C=V.slice(1).split("");for(let T=0;T<C.length;T++){if(F=V.slice(T+2),!y1(C[T])){M=!1;break}if(C[T+1]&&C[T+1]==="="||F==="-"||/[A-Za-z]/.test(C[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(F)||C[T+1]&&C[T+1].match(/\W/))break}return M}function a(V){return Q["unknown-options-as-args"]&&z0(V)}function z0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(x))return!1;if(g(V))return!1;return!b6(V,/^-+([^=]+?)=[\s\S]*$/,j,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function l(V){if(!y(V,L.bools)&&!y(V,L.counts)&&`${V}`in G)return G[V];else return V0(X0(V))}function V0(V){return{[D0.BOOLEAN]:!0,[D0.STRING]:"",[D0.NUMBER]:void 0,[D0.ARRAY]:[]}[V]}function X0(V){let M=D0.BOOLEAN;if(y(V,L.strings))M=D0.STRING;else if(y(V,L.numbers))M=D0.NUMBER;else if(y(V,L.bools))M=D0.BOOLEAN;else if(y(V,L.arrays))M=D0.ARRAY;return M}function K0(V){return V===void 0}function V2(){Object.keys(L.counts).find((V)=>{if(y(V,L.arrays))return D=Error(R("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(y(V,L.nargs))return D=Error(R("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(E,P),configuration:Q,defaulted:Object.assign({},_),error:D,newAliases:Object.assign({},W)}}}function $U($){let J=[],Z=Object.create(null),X=!0;Object.keys($).forEach(function(q){J.push([].concat($[q],q))});while(X){X=!1;for(let q=0;q<J.length;q++)for(let Y=q+1;Y<J.length;Y++)if(J[q].filter(function(G){return J[Y].indexOf(G)!==-1}).length){J[q]=J[q].concat(J[Y]),J.splice(Y,1),X=!0;break}}return J.forEach(function(q){q=q.filter(function(Q,G,H){return H.indexOf(Q)===G});let Y=q.pop();if(Y!==void 0&&typeof Y==="string")Z[Y]=q}),Z}function U6($){return $!==void 0?$+1:1}function EX($){if($==="__proto__")return"___proto___";return $}function JU($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var V6,L6,_6,AX=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,hX=(L6=(V6=process===null||process===void 0?void 0:process.versions)===null||V6===void 0?void 0:V6.node)!==null&&L6!==void 0?L6:(_6=process===null||process===void 0?void 0:process.version)===null||_6===void 0?void 0:_6.slice(1);if(hX){if(Number(hX.match(/^([^.]+)/)[1])<AX)throw Error(`yargs parser supports a minimum Node.js version of ${AX}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var qU=process?process.env:{},NX=new W6({cwd:process.cwd,env:()=>{return qU},format:ZU,normalize:XU,resolve:QU,require:($)=>{return _0($)}}),O$=function(J,Z){return NX.parse(J.slice(),Z).argv};O$.detailed=function($,J){return NX.parse($.slice(),J)};O$.camelCase=I1;O$.decamelize=J2;O$.looksLikeNumber=Z2;var R6=O$;import{basename as MU,dirname as CU,extname as FU,relative as jU,resolve as yX}from"path";function DX(){if(YU())return 0;return 1}function YU(){return GU()&&!process.defaultApp}function GU(){return!!process.versions.electron}function T6($){return $.slice(DX()+1)}function vX(){return process.argv[DX()]}class s extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,s)}}import{readFileSync as HU,statSync as zU,writeFile as KU}from"fs";import{format as BU}from"util";import{resolve as UU}from"path";var SX={fs:{readFileSync:HU,writeFile:KU},format:BU,resolve:UU,exists:($)=>{try{return zU($).isFile()}catch(J){return!1}}};var c0;class fX{constructor($){$=$||{},this.directory=$.directory||"./locales",this.updateFiles=typeof $.updateFiles==="boolean"?$.updateFiles:!0,this.locale=$.locale||"en",this.fallbackToLanguage=typeof $.fallbackToLanguage==="boolean"?$.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...$){if(typeof arguments[0]!=="string")return this._taggedLiteral(arguments[0],...arguments);let J=$.shift(),Z=function(){};if(typeof $[$.length-1]==="function")Z=$.pop();if(Z=Z||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]=J,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:Z});else Z();return c0.format.apply(c0.format,[this.cache[this.locale][J]||J].concat($))}__n(){let $=Array.prototype.slice.call(arguments),J=$.shift(),Z=$.shift(),X=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=X===1?J:Z;if(this.cache[this.locale][J])Y=this.cache[this.locale][J][X===1?"one":"other"];if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]={one:J,other:Z},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(X);return c0.format.apply(c0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))this.cache[this.locale][J]=$[J]}_taggedLiteral($,...J){let Z="";return $.forEach(function(X,q){let Y=J[q+1];if(Z+=X,typeof Y<"u")Z+="%s"}),this.__.apply(this,[Z].concat([].slice.call(J,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,J=this.writeQueue[0],Z=J.directory,X=J.locale,q=J.cb,Y=this._resolveLocaleFile(Z,X),Q=JSON.stringify(this.cache[X],null,2);c0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},J=this._resolveLocaleFile(this.directory,this.locale);try{if(c0.fs.readFileSync)$=JSON.parse(c0.fs.readFileSync(J,"utf-8"))}catch(Z){if(Z instanceof SyntaxError)Z.message="syntax error in "+J;if(Z.code==="ENOENT")$={};else throw Z}this.cache[this.locale]=$}_resolveLocaleFile($,J){let Z=c0.resolve($,"./",J+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(Z)&&~J.lastIndexOf("_")){let X=c0.resolve($,"./",J.split("_")[0]+".json");if(this._fileExistsSync(X))Z=X}return Z}_fileExistsSync($){return c0.exists($)}}function kX($,J){c0=J;let Z=new fX($);return{__:Z.__.bind(Z),__n:Z.__n.bind(Z),setLocale:Z.setLocale.bind(Z),getLocale:Z.getLocale.bind(Z),updateLocale:Z.updateLocale.bind(Z),locale:Z.locale}}var WU=($)=>{return kX($,SX)},bX=WU;var xU="require is not supported by ESM",gX="loading a directory of commands is not supported yet for ESM",w$;try{w$=TU(import.meta.url)}catch($){w$=process.cwd()}var PU=w$.substring(0,w$.lastIndexOf("node_modules")),M6={assert:{notStrictEqual:VU,strictEqual:LU},cliui:K6,findUp:B6,getEnv:($)=>{return process.env[$]},inspect:_U,getCallerFile:()=>{throw new s(gX)},getProcessArgvBin:vX,mainFilename:PU||process.cwd(),Parser:R6,path:{basename:MU,dirname:CU,extname:FU,relative:jU,resolve:yX},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,J)=>process.emitWarning($,J),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:RU,require:()=>{throw new s(xU)},requireDirectory:()=>{throw new s(gX)},stringWidth:($)=>{return[...$].length},y18n:bX({directory:yX(w$,"../../../locales"),updateFiles:!1})};function F0($,J,Z,X){Z.assert.notStrictEqual($,J,X)}function C6($,J){J.assert.strictEqual(typeof $,"string")}function X$($){return Object.keys($)}function e($){return!!$&&!!$.then&&typeof $.then==="function"}function B1($){let Z=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),X=/\.*[\][<>]/g,q=Z.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(X,""),demanded:[],optional:[]};return Z.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===Z.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(X,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(X,"").split("|"),variadic:H})}),Y}var IU=["first","second","third","fourth","fifth","sixth"];function h($,J,Z){function X(){return typeof $==="object"?[{demanded:[],optional:[]},$,J]:[B1(`cmd ${$}`),J,Z]}try{let q=0,[Y,Q,G]=X(),H=[].slice.call(Q);while(H.length&&H[H.length-1]===void 0)H.pop();let K=G||H.length;if(K<Y.demanded.length)throw new s(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let U=Y.demanded.length+Y.optional.length;if(K>U)throw new s(`Too many arguments provided. Expected max ${U} but received ${K}.`);Y.demanded.forEach((B)=>{let W=H.shift(),_=uX(W);if(B.cmd.filter((L)=>L===_||L==="*").length===0)mX(_,B.cmd,q);q+=1}),Y.optional.forEach((B)=>{if(H.length===0)return;let W=H.shift(),_=uX(W);if(B.cmd.filter((L)=>L===_||L==="*").length===0)mX(_,B.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function uX($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function mX($,J,Z){throw new s(`Invalid ${IU[Z]||"manyith"} argument. Expected ${J.join(" or ")} but received ${$}.`)}class F6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,J,Z=!0,X=!1){if(h("<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 cX($){if(!$)return[];return $.map((J)=>{return J.applyBeforeValidation=!1,J})}function O1($,J,Z,X){return Z.reduce((q,Y)=>{if(Y.applyBeforeValidation!==X)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(e(q))return q.then((Q)=>Promise.all([Q,Y(Q,J)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,J);return e(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function w1($,J,Z=(X)=>{throw X}){try{let X=OU($)?$():$;return e(X)?X.then((q)=>J(q)):J(X)}catch(X){return Z(X)}}function OU($){return typeof $==="function"}function j6($){for(let J=0,Z=Object.keys(_0.cache),X;J<Z.length;J++)if(X=_0.cache[Z[J]],X.exports===$)return X;return null}var Q$=/(^\*)|(^\$0)/;class dX{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=cX(q);if(X=X||(()=>{}),Array.isArray($))if(wU($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(AU($)){let H=Array.isArray($.command)||typeof $.command==="string"?$.command:this.moduleName($);if($.aliases)H=[].concat(H).concat($.aliases);this.addHandler(H,this.extractDesc($),$.builder,$.handler,$.middlewares,$.deprecated);return}else if(pX(Z)){this.addHandler([$].concat(Q),J,Z.builder,Z.handler,Z.middlewares,Z.deprecated);return}if(typeof $==="string"){let H=B1($);Q=Q.map((B)=>B1(B).cmd);let K=!1,U=[H.cmd].concat(Q).filter((B)=>{if(Q$.test(B))return K=!0,!1;return!0});if(U.length===0&&K)U.push("$0");if(K)H.cmd=U[0],Q=U.slice(1),$=$.replace(Q$,H.cmd);if(Q.forEach((B)=>{this.aliasMap[B]=H.cmd}),J!==!1)this.usage.command($,J,K,Q,Y);if(this.handlers[H.cmd]={original:$,description:J,handler:X,builder:Z||{},middlewares:G,deprecated:Y,demanded:H.demanded,optional:H.optional},K)this.defaultCommand=this.handlers[H.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand($,J,Z,X,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=J.getInternalMethods().getContext(),H=G.commands.slice(),K=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let U=this.applyBuilderUpdateUsageAndParse(K,Q,J,Z.aliases,H,X,q,Y);return e(U)?U.then((B)=>this.applyMiddlewareAndGetResult(K,Q,B.innerArgv,G,q,B.aliases,J)):this.applyMiddlewareAndGetResult(K,Q,U.innerArgv,G,q,U.aliases,J)}applyBuilderUpdateUsageAndParse($,J,Z,X,q,Y,Q,G){let H=J.builder,K=Z;if(X2(H)){Z.getInternalMethods().getUsageInstance().freeze();let U=H(Z.getInternalMethods().reset(X),G);if(e(U))return U.then((B)=>{return K=nX(B)?B:Z,this.parseAndUpdateUsage($,J,K,q,Y,Q)})}else if(EU(H))Z.getInternalMethods().getUsageInstance().freeze(),K=Z.getInternalMethods().reset(X),Object.keys(J.builder).forEach((U)=>{K.option(U,H[U])});return this.parseAndUpdateUsage($,J,K,q,Y,Q)}parseAndUpdateUsage($,J,Z,X,q,Y){if($)Z.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(Z))Z.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(X,J),J.description);let Q=Z.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return e(Q)?Q.then((G)=>({aliases:Z.parsed.aliases,innerArgv:G})):{aliases:Z.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,J){let Z=Q$.test(J.original)?J.original.replace(Q$,"").trim():J.original,X=$.filter((q)=>{return!Q$.test(q)});return X.push(Z),`$0 ${X.join(" ")}`}handleValidationAndGetResult($,J,Z,X,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);Z=w1(Z,(K)=>{return H(K),K})}if(J.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(Z,H,!1,!1),Z=O1(Z,Y,Q,!1),Z=w1(Z,(K)=>{let U=J.handler(K);return e(U)?U.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(e(Z)&&!Y.getInternalMethods().hasParseCallback())Z.catch((K)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,K)}catch(U){}})}if(!$)X.commands.pop(),X.fullCommands.pop();return Z}applyMiddlewareAndGetResult($,J,Z,X,q,Y,Q){let G={};if(q)return Z;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(J,Z,X,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(J.middlewares),K=O1(Z,Q,H,!0);return e(K)?K.then((U)=>this.handleValidationAndGetResult($,J,U,X,Y,Q,H,G)):this.handleValidationAndGetResult($,J,K,X,Y,Q,H,G)}populatePositionals($,J,Z,X){J._=J._.slice(Z.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,J._.length);while(q.length){let G=q.shift();this.populatePositional(G,J,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,J,Q)}return J._=Z.commands.concat(J._.map((G)=>""+G)),this.postProcessPositionals(J,Q,this.cmdToParseOptions($.original),X),Q}populatePositional($,J,Z){let X=$.cmd[0];if($.variadic)Z[X]=J._.splice(0).map(String);else if(J._.length)Z[X]=[String(J._.shift())]}cmdToParseOptions($){let J={array:[],default:{},alias:{},demand:{}},Z=B1($);return Z.demanded.forEach((X)=>{let[q,...Y]=X.cmd;if(X.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y,J.demand[q]=!0}),Z.optional.forEach((X)=>{let[q,...Y]=X.cmd;if(X.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y}),J}postProcessPositionals($,J,Z,X){let q=Object.assign({},X.getOptions());q.default=Object.assign(Z.default,q.default);for(let H of Object.keys(Z.alias))q.alias[H]=(q.alias[H]||[]).concat(Z.alias[H]);q.array=q.array.concat(Z.array),q.config={};let Y=[];if(Object.keys(J).forEach((H)=>{J[H].map((K)=>{if(q.configuration["unknown-options-as-args"])q.key[H]=!0;Y.push(`--${H}`),Y.push(K)})}),!Y.length)return;let Q=Object.assign({},q.configuration,{"populate--":!1}),G=this.shim.Parser.detailed(Y,Object.assign({},q,{configuration:Q}));if(G.error)X.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(J);Object.keys(J).forEach((K)=>{H.push(...G.aliases[K])}),Object.keys(G.argv).forEach((K)=>{if(H.includes(K)){if(!J[K])J[K]=G.argv[K];if(!this.isInConfigs(X,K)&&!this.isDefaulted(X,K)&&Object.prototype.hasOwnProperty.call($,K)&&Object.prototype.hasOwnProperty.call(G.argv,K)&&(Array.isArray($[K])||Array.isArray(G.argv[K])))$[K]=[].concat($[K],G.argv[K]);else $[K]=G.argv[K]}})}}isDefaulted($,J){let{default:Z}=$.getOptions();return Object.prototype.hasOwnProperty.call(Z,J)||Object.prototype.hasOwnProperty.call(Z,this.shim.Parser.camelCase(J))}isInConfigs($,J){let{configObjects:Z}=$.getOptions();return Z.some((X)=>Object.prototype.hasOwnProperty.call(X,J))||Z.some((X)=>Object.prototype.hasOwnProperty.call(X,this.shim.Parser.camelCase(J)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let Z=Q$.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(Z,this.defaultCommand.description)}let J=this.defaultCommand.builder;if(X2(J))return J($,!0);else if(!pX(J))Object.keys(J).forEach((Z)=>{$.option(Z,J[Z])});return}moduleName($){let J=j6($);if(!J)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(J.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:J,desc:Z}){for(let X of[$,J,Z]){if(typeof X==="string"||X===!1)return X;F0(X,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();F0($,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=$}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function lX($,J,Z,X){return new dX($,J,Z,X)}function pX($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function wU($){return $.every((J)=>typeof J==="string")}function X2($){return typeof $==="function"}function EU($){return typeof $==="object"}function AU($){return typeof $==="object"&&!Array.isArray($)}function U1($={},J=()=>!0){let Z={};return X$($).forEach((X)=>{if(J(X,$[X]))Z[X]=$[X]}),Z}function W1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((J)=>{let Z=J;if(Z._handle&&Z.isTTY&&typeof Z._handle.setBlocking==="function")Z._handle.setBlocking($)})}function hU($){return typeof $==="boolean"}function oX($,J){let Z=J.y18n.__,X={},q=[];X.failFn=function(O){q.push(O)};let Y=null,Q=null,G=!0;X.showHelpOnFail=function(O=!0,S){let[m,t]=typeof O==="string"?[!0,O]:[O,S];if($.getInternalMethods().isGlobalContext())Q=t;return Y=t,G=m,X};let H=!1;X.fail=function(O,S){let m=$.getInternalMethods().getLoggerInstance();if(q.length)for(let t=q.length-1;t>=0;--t){let G0=q[t];if(hU(G0)){if(S)throw S;else if(O)throw Error(O)}else G0(O,S,X)}else{if($.getExitProcess())W1(!0);if(!H){if(H=!0,G)$.showHelp("error"),m.error();if(O||S)m.error(O||S);let t=Y||Q;if(t){if(O||S)m.error("");m.error(t)}}if(S=S||new s(O),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,S);else throw S}};let K=[],U=!1;X.usage=(A,O)=>{if(A===null)return U=!0,K=[],X;return U=!1,K.push([A,O||""]),X},X.getUsage=()=>{return K},X.getUsageDisabled=()=>{return U},X.getPositionalGroupName=()=>{return Z("Positionals:")};let B=[];X.example=(A,O)=>{B.push([A,O||""])};let W=[];X.command=function(O,S,m,t,G0=!1){if(m)W=W.map((o)=>{return o[2]=!1,o});W.push([O,S||"",m,t,G0])},X.getCommands=()=>W;let _={};X.describe=function(O,S){if(Array.isArray(O))O.forEach((m)=>{X.describe(m,S)});else if(typeof O==="object")Object.keys(O).forEach((m)=>{X.describe(m,O[m])});else _[O]=S},X.getDescriptions=()=>_;let R=[];X.epilog=(A)=>{R.push(A)};let L=!1,x;X.wrap=(A)=>{L=!0,x=A},X.getWrap=()=>{if(J.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)x=T0(),L=!0;return x};let j="__yargsString__:";X.deferY18nLookup=(A)=>j+A,X.help=function(){if(P)return P;p();let O=$.customScriptName?$.$0:J.path.basename($.$0),S=$.getDemandedOptions(),m=$.getDemandedCommands(),t=$.getDeprecatedOptions(),G0=$.getGroups(),o=$.getOptions(),H0=[];H0=H0.concat(Object.keys(_)),H0=H0.concat(Object.keys(S)),H0=H0.concat(Object.keys(m)),H0=H0.concat(Object.keys(o.default)),H0=H0.filter(k),H0=Object.keys(H0.reduce((g,a)=>{if(a!=="_")g[a]=!0;return g},{}));let q1=X.getWrap(),r=J.cliui({width:q1,wrap:!!q1});if(!U){if(K.length)K.forEach((g)=>{if(r.div({text:`${g[0].replace(/\$0/g,O)}`}),g[1])r.div({text:`${g[1]}`,padding:[1,0,0,0]})}),r.div();else if(W.length){let g=null;if(m._)g=`${O} <${Z("command")}>
|
|
96
|
-
`;else
|
|
97
|
-
`;r.div(`${
|
|
98
|
-
`);r.div(`${
|
|
99
|
-
`)}return r.toString().replace(/\s*$/,"")};function D(
|
|
94
|
+
`);if(q.border)X.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),X.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)X.unshift(...Array(q.padding[0]||0).fill("")),X.push(...Array(q.padding[2]||0).fill(""));X.forEach((Q,G)=>{if(!J[G])J.push([]);let H=J[G];for(let K=0;K<Y;K++)if(H[K]===void 0)H.push("");H.push(Q)})}),J}negatePadding($){let J=$.width||0;if($.padding)J-=($.padding[3]||0)+($.padding[1]||0);if($.border)J-=4;return J}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||w0.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,sB($[Q]));return Y})}}function CX($,J,Z){if($.border){if(/[.']-+[.']/.test(J))return"";if(J.trim().length!==0)return Z;return" "}return""}function sB($){let J=$.padding||[],Z=1+(J[3]||0)+(J[1]||0);if($.border)return Z+4;return Z}function eB(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function $W($,J){$=$.trim();let Z=w0.stringWidth($);if(Z<J)return" ".repeat(J-Z)+$;return $}function JW($,J){$=$.trim();let Z=w0.stringWidth($);if(Z>=J)return $;return" ".repeat(J-Z>>1)+$}var w0;function jX($,J){return w0=J,new FX({width:($===null||$===void 0?void 0:$.width)||eB(),wrap:$===null||$===void 0?void 0:$.wrap})}var xX=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function U6($){return $.replace(xX,"")}function PX($,J){let[Z,X]=$.match(xX)||["",""];$=U6($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%J===0)q+=`
|
|
95
|
+
`;q+=$.charAt(Y)}if(Z&&X)q=`${Z}${q}${X}`;return q}function V6($){return jX($,{stringWidth:(J)=>{return[...J].length},stripAnsi:U6,wrap:PX})}import{dirname as IX,resolve as OX}from"path";import{readdirSync as ZW,statSync as XW}from"fs";function L6($,J){let Z=OX(".",$),X;if(!XW(Z).isDirectory())Z=IX(Z);while(!0){if(X=J(Z,ZW(Z)),X)return OX(Z,X);if(Z=IX(X=Z),X===Z)break}}import{inspect as CW}from"util";import{readFileSync as FW}from"fs";import{fileURLToPath as jW}from"url";import{format as YW}from"util";import{normalize as GW,resolve as HW}from"path";function A1($){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 q2($,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 Y2($){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 wX($){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 v0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(v0||(v0={}));var q1;class R6{constructor($){q1=$}parse($,J){let Z=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},J),X=wX($),q=typeof $==="string",Y=QW(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,W=Q["populate--"],B=W?"--":"_",U=Object.create(null),_=Object.create(null),T=Z.__||q1.format,L={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},P=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,I=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(Z.array||[]).filter(Boolean).forEach(function(V){let M=typeof V==="object"?V.key:V,x=Object.keys(V).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();if(x)L[x][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})}V$(Z.key,Y,Z.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(M){G[M]=G[V]})});let D=null;M2();let m=[],O=Object.assign(Object.create(null),{_:[]}),l={};for(let V=0;V<X.length;V++){let M=X[V],x=M.replace(/^-{3,}/,"---"),F,R,v,E,f,U0;if(M!=="--"&&/^-/.test(M)&&a(M))n(M);else if(x.match(/^---+(=|$)/)){n(M);continue}else if(M.match(/^--.+=/)||!Q["short-option-groups"]&&M.match(/^-.+=/)){if(E=M.match(/^--?([^=]+)=([\s\S]*)$/),E!==null&&Array.isArray(E)&&E.length>=3)if(k(E[1],L.arrays))V=W0(V,E[1],X,E[2]);else if(k(E[1],L.nargs)!==!1)V=o(V,E[1],X,E[2]);else d(E[1],E[2],!0)}else if(M.match(I)&&Q["boolean-negation"]){if(E=M.match(I),E!==null&&Array.isArray(E)&&E.length>=2)R=E[1],d(R,k(R,L.arrays)?[!1]:!1)}else if(M.match(/^--.+/)||!Q["short-option-groups"]&&M.match(/^-[^-]+/)){if(E=M.match(/^--?(.+)/),E!==null&&Array.isArray(E)&&E.length>=2)if(R=E[1],k(R,L.arrays))V=W0(V,R,X);else if(k(R,L.nargs)!==!1)V=o(V,R,X);else if(f=X[V+1],f!==void 0&&(!f.match(/^-/)||f.match(P))&&!k(R,L.bools)&&!k(R,L.counts))d(R,f),V++;else if(/^(true|false)$/.test(f))d(R,f),V++;else d(R,p(R))}else if(M.match(/^-.\..+=/)){if(E=M.match(/^-([^=]+)=([\s\S]*)$/),E!==null&&Array.isArray(E)&&E.length>=3)d(E[1],E[2])}else if(M.match(/^-.\..+/)&&!M.match(P)){if(f=X[V+1],E=M.match(/^-(.\..+)/),E!==null&&Array.isArray(E)&&E.length>=2)if(R=E[1],f!==void 0&&!f.match(/^-/)&&!k(R,L.bools)&&!k(R,L.counts))d(R,f),V++;else d(R,p(R))}else if(M.match(/^-[^-]+/)&&!M.match(P)){v=M.slice(1,-1).split(""),F=!1;for(let F0=0;F0<v.length;F0++){if(f=M.slice(F0+2),v[F0+1]&&v[F0+1]==="="){if(U0=M.slice(F0+3),R=v[F0],k(R,L.arrays))V=W0(V,R,X,U0);else if(k(R,L.nargs)!==!1)V=o(V,R,X,U0);else d(R,U0);F=!0;break}if(f==="-"){d(v[F0],f);continue}if(/[A-Za-z]/.test(v[F0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(f)&&k(f,L.bools)===!1){d(v[F0],f),F=!0;break}if(v[F0+1]&&v[F0+1].match(/\W/)){d(v[F0],f),F=!0;break}else d(v[F0],p(v[F0]))}if(R=M.slice(-1)[0],!F&&R!=="-")if(k(R,L.arrays))V=W0(V,R,X);else if(k(R,L.nargs)!==!1)V=o(V,R,X);else if(f=X[V+1],f!==void 0&&(!/^(-|--)[^-]/.test(f)||f.match(P))&&!k(R,L.bools)&&!k(R,L.counts))d(R,f),V++;else if(/^(true|false)$/.test(f))d(R,f),V++;else d(R,p(R))}else if(M.match(/^-[0-9]$/)&&M.match(P)&&k(M.slice(1),L.bools))R=M.slice(1),d(R,p(R));else if(M==="--"){m=X.slice(V+1);break}else if(Q["halt-at-non-option"]){m=X.slice(V);break}else n(M)}if(G0(O,!0),G0(O,!1),A(O),t(),H1(O,L.aliases,G,!0),i(O),Q["set-placeholder-key"])H0(O);if(Object.keys(L.counts).forEach(function(V){if(!r(O,V.split(".")))d(V,0)}),W&&m.length)O[B]=[];if(m.forEach(function(V){O[B].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(O).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete O[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete O[V.split(".").map((M)=>A1(M)).join(".")];delete O[V]});function n(V){let M=j("_",V);if(typeof M==="string"||typeof M==="number")O._.push(M)}function o(V,M,x,F){let R,v=k(M,L.nargs);if(v=typeof v!=="number"||isNaN(v)?1:v,v===0){if(!K0(F))D=Error(T("Argument unexpected for: %s",M));return d(M,p(M)),V}let E=K0(F)?0:1;if(Q["nargs-eats-options"]){if(x.length-(V+1)+E<v)D=Error(T("Not enough arguments following: %s",M));E=v}else{for(R=V+1;R<x.length;R++)if(!x[R].match(/^-[^0-9]/)||x[R].match(P)||a(x[R]))E++;else break;if(E<v)D=Error(T("Not enough arguments following: %s",M))}let f=Math.min(E,v);if(!K0(F)&&f>0)d(M,F),f--;for(R=V+1;R<f+V+1;R++)d(M,x[R]);return V+f}function W0(V,M,x,F){let R=[],v=F||x[V+1],E=k(M,L.nargs);if(k(M,L.bools)&&!/^(true|false)$/.test(v))R.push(!0);else if(K0(v)||K0(F)&&/^-/.test(v)&&!P.test(v)&&!a(v)){if(G[M]!==void 0){let f=G[M];R=Array.isArray(f)?f:[f]}}else{if(!K0(F))R.push(C(M,F,!0));for(let f=V+1;f<x.length;f++){if(!Q["greedy-arrays"]&&R.length>0||E&&typeof E==="number"&&R.length>=E)break;if(v=x[f],/^-/.test(v)&&!P.test(v)&&!a(v))break;V=f,R.push(C(M,v,q))}}if(typeof E==="number"&&(E&&R.length<E||isNaN(E)&&R.length===0))D=Error(T("Not enough arguments following: %s",M));return d(M,R),V}function d(V,M,x=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let v=V.split(".").map(function(E){return A1(E)}).join(".");d0(V,v)}let F=C(V,M,x),R=V.split(".");if(s0(O,R,F),L.aliases[V])L.aliases[V].forEach(function(v){let E=v.split(".");s0(O,E,F)});if(R.length>1&&Q["dot-notation"])(L.aliases[R[0]]||[]).forEach(function(v){let E=v.split("."),f=[].concat(R);if(f.shift(),E=E.concat(f),!(L.aliases[V]||[]).includes(E.join(".")))s0(O,E,F)});if(k(V,L.normalize)&&!k(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(E){Object.defineProperty(l,E,{enumerable:!0,get(){return M},set(f){M=typeof f==="string"?q1.normalize(f):f}})})}function d0(V,M){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[M],U[M]=!0;if(!(L.aliases[M]&&L.aliases[M].length))d0(M,V)}function C(V,M,x){if(x)M=qW(M);if(k(V,L.bools)||k(V,L.counts)){if(typeof M==="string")M=M==="true"}let F=Array.isArray(M)?M.map(function(R){return j(V,R)}):j(V,M);if(k(V,L.counts)&&(K0(F)||typeof F==="boolean"))F=_6();if(k(V,L.normalize)&&k(V,L.arrays))if(Array.isArray(M))F=M.map((R)=>{return q1.normalize(R)});else F=q1.normalize(M);return F}function j(V,M){if(!Q["parse-positional-numbers"]&&V==="_")return M;if(!k(V,L.strings)&&!k(V,L.bools)&&!Array.isArray(M)){if(Y2(M)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${M}`)))||!K0(M)&&k(V,L.numbers))M=Number(M)}return M}function A(V){let M=Object.create(null);H1(M,L.aliases,G),Object.keys(L.configs).forEach(function(x){let F=V[x]||M[x];if(F)try{let R=null,v=q1.resolve(q1.cwd(),F),E=L.configs[x];if(typeof E==="function"){try{R=E(v)}catch(f){R=f}if(R instanceof Error){D=R;return}}else R=q1.require(v);g(R)}catch(R){if(R.name==="PermissionDenied")D=R;else if(V[x])D=Error(T("Invalid JSON config file: %s",F))}})}function g(V,M){Object.keys(V).forEach(function(x){let F=V[x],R=M?M+"."+x:x;if(typeof F==="object"&&F!==null&&!Array.isArray(F)&&Q["dot-notation"])g(F,R);else if(!r(O,R.split("."))||k(R,L.arrays)&&Q["combine-arrays"])d(R,F)})}function t(){if(typeof H<"u")H.forEach(function(V){g(V)})}function G0(V,M){if(typeof K>"u")return;let x=typeof K==="string"?K:"",F=q1.env();Object.keys(F).forEach(function(R){if(x===""||R.lastIndexOf(x,0)===0){let v=R.split("__").map(function(E,f){if(f===0)E=E.substring(x.length);return A1(E)});if((M&&L.configs[v.join(".")]||!M)&&!r(V,v))d(v.join("."),F[R])}})}function i(V){let M,x=new Set;Object.keys(V).forEach(function(F){if(!x.has(F)){if(M=k(F,L.coercions),typeof M==="function")try{let R=j(F,M(V[F]));[].concat(L.aliases[F]||[],F).forEach((v)=>{x.add(v),V[v]=R})}catch(R){D=R}}})}function H0(V){return L.keys.forEach((M)=>{if(~M.indexOf("."))return;if(typeof V[M]>"u")V[M]=void 0}),V}function H1(V,M,x,F=!1){Object.keys(x).forEach(function(R){if(!r(V,R.split("."))){if(s0(V,R.split("."),x[R]),F)_[R]=!0;(M[R]||[]).forEach(function(v){if(r(V,v.split(".")))return;s0(V,v.split("."),x[R])})}})}function r(V,M){let x=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(R){x=x[R]||{}});let F=M[M.length-1];if(typeof x!=="object")return!1;else return F in x}function s0(V,M,x){let F=V;if(!Q["dot-notation"])M=[M.join(".")];M.slice(0,-1).forEach(function(U0){if(U0=EX(U0),typeof F==="object"&&F[U0]===void 0)F[U0]={};if(typeof F[U0]!=="object"||Array.isArray(F[U0])){if(Array.isArray(F[U0]))F[U0].push({});else F[U0]=[F[U0],{}];F=F[U0][F[U0].length-1]}else F=F[U0]});let R=EX(M[M.length-1]),v=k(M.join("."),L.arrays),E=Array.isArray(x),f=Q["duplicate-arguments-array"];if(!f&&k(R,L.nargs)){if(f=!0,!K0(F[R])&&L.nargs[R]===1||Array.isArray(F[R])&&F[R].length===L.nargs[R])F[R]=void 0}if(x===_6())F[R]=_6(F[R]);else if(Array.isArray(F[R]))if(f&&v&&E)F[R]=Q["flatten-duplicate-arrays"]?F[R].concat(x):(Array.isArray(F[R][0])?F[R]:[F[R]]).concat([x]);else if(!f&&Boolean(v)===Boolean(E))F[R]=x;else F[R]=F[R].concat([x]);else if(F[R]===void 0&&v)F[R]=E?x:[x];else if(f&&!(F[R]===void 0||k(R,L.counts)||k(R,L.bools)))F[R]=[F[R],x];else F[R]=x}function V$(...V){V.forEach(function(M){Object.keys(M||{}).forEach(function(x){if(L.aliases[x])return;L.aliases[x]=[].concat(Y[x]||[]),L.aliases[x].concat(x).forEach(function(F){if(/-/.test(F)&&Q["camel-case-expansion"]){let R=A1(F);if(R!==x&&L.aliases[x].indexOf(R)===-1)L.aliases[x].push(R),U[R]=!0}}),L.aliases[x].concat(x).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&Q["camel-case-expansion"]){let R=q2(F,"-");if(R!==x&&L.aliases[x].indexOf(R)===-1)L.aliases[x].push(R),U[R]=!0}}),L.aliases[x].forEach(function(F){L.aliases[F]=[x].concat(L.aliases[x].filter(function(R){return F!==R}))})})})}function k(V,M){let x=[].concat(L.aliases[V]||[],V),F=Object.keys(M),R=x.find((v)=>F.includes(v));return R?M[R]:!1}function c1(V){let M=Object.keys(L);return[].concat(M.map((F)=>L[F])).some(function(F){return Array.isArray(F)?F.includes(V):F[V]})}function u6(V,...M){return[].concat(...M).some(function(F){let R=V.match(F);return R&&c1(R[1])})}function b(V){if(V.match(P)||!V.match(/^-[^-]+/))return!1;let M=!0,x,F=V.slice(1).split("");for(let R=0;R<F.length;R++){if(x=V.slice(R+2),!c1(F[R])){M=!1;break}if(F[R+1]&&F[R+1]==="="||x==="-"||/[A-Za-z]/.test(F[R])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(x)||F[R+1]&&F[R+1].match(/\W/))break}return M}function a(V){return Q["unknown-options-as-args"]&&z0(V)}function z0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(P))return!1;if(b(V))return!1;return!u6(V,/^-+([^=]+?)=[\s\S]*$/,I,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function p(V){if(!k(V,L.bools)&&!k(V,L.counts)&&`${V}`in G)return G[V];else return L0(X0(V))}function L0(V){return{[v0.BOOLEAN]:!0,[v0.STRING]:"",[v0.NUMBER]:void 0,[v0.ARRAY]:[]}[V]}function X0(V){let M=v0.BOOLEAN;if(k(V,L.strings))M=v0.STRING;else if(k(V,L.numbers))M=v0.NUMBER;else if(k(V,L.bools))M=v0.BOOLEAN;else if(k(V,L.arrays))M=v0.ARRAY;return M}function K0(V){return V===void 0}function M2(){Object.keys(L.counts).find((V)=>{if(k(V,L.arrays))return D=Error(T("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(k(V,L.nargs))return D=Error(T("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(l,O),configuration:Q,defaulted:Object.assign({},_),error:D,newAliases:Object.assign({},U)}}}function QW($){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 _6($){return $!==void 0?$+1:1}function EX($){if($==="__proto__")return"___proto___";return $}function qW($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var T6,M6,C6,AX=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,NX=(M6=(T6=process===null||process===void 0?void 0:process.versions)===null||T6===void 0?void 0:T6.node)!==null&&M6!==void 0?M6:(C6=process===null||process===void 0?void 0:process.version)===null||C6===void 0?void 0:C6.slice(1);if(NX){if(Number(NX.match(/^([^.]+)/)[1])<AX)throw Error(`yargs parser supports a minimum Node.js version of ${AX}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var zW=process?process.env:{},hX=new R6({cwd:process.cwd,env:()=>{return zW},format:YW,normalize:GW,resolve:HW,require:($)=>{return M0($)}}),N$=function(J,Z){return hX.parse(J.slice(),Z).argv};N$.detailed=function($,J){return hX.parse($.slice(),J)};N$.camelCase=A1;N$.decamelize=q2;N$.looksLikeNumber=Y2;var F6=N$;import{basename as xW,dirname as PW,extname as IW,relative as OW,resolve as yX}from"path";function DX(){if(KW())return 0;return 1}function KW(){return BW()&&!process.defaultApp}function BW(){return!!process.versions.electron}function j6($){return $.slice(DX()+1)}function vX(){return process.argv[DX()]}class s extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,s)}}import{readFileSync as WW,statSync as UW,writeFile as VW}from"fs";import{format as LW}from"util";import{resolve as _W}from"path";var SX={fs:{readFileSync:WW,writeFile:VW},format:LW,resolve:_W,exists:($)=>{try{return UW($).isFile()}catch(J){return!1}}};var c0;class fX{constructor($){$=$||{},this.directory=$.directory||"./locales",this.updateFiles=typeof $.updateFiles==="boolean"?$.updateFiles:!0,this.locale=$.locale||"en",this.fallbackToLanguage=typeof $.fallbackToLanguage==="boolean"?$.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...$){if(typeof arguments[0]!=="string")return this._taggedLiteral(arguments[0],...arguments);let J=$.shift(),Z=function(){};if(typeof $[$.length-1]==="function")Z=$.pop();if(Z=Z||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]=J,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:Z});else Z();return c0.format.apply(c0.format,[this.cache[this.locale][J]||J].concat($))}__n(){let $=Array.prototype.slice.call(arguments),J=$.shift(),Z=$.shift(),X=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=X===1?J:Z;if(this.cache[this.locale][J])Y=this.cache[this.locale][J][X===1?"one":"other"];if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]={one:J,other:Z},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(X);return c0.format.apply(c0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))this.cache[this.locale][J]=$[J]}_taggedLiteral($,...J){let Z="";return $.forEach(function(X,q){let Y=J[q+1];if(Z+=X,typeof Y<"u")Z+="%s"}),this.__.apply(this,[Z].concat([].slice.call(J,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,J=this.writeQueue[0],Z=J.directory,X=J.locale,q=J.cb,Y=this._resolveLocaleFile(Z,X),Q=JSON.stringify(this.cache[X],null,2);c0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},J=this._resolveLocaleFile(this.directory,this.locale);try{if(c0.fs.readFileSync)$=JSON.parse(c0.fs.readFileSync(J,"utf-8"))}catch(Z){if(Z instanceof SyntaxError)Z.message="syntax error in "+J;if(Z.code==="ENOENT")$={};else throw Z}this.cache[this.locale]=$}_resolveLocaleFile($,J){let Z=c0.resolve($,"./",J+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(Z)&&~J.lastIndexOf("_")){let X=c0.resolve($,"./",J.split("_")[0]+".json");if(this._fileExistsSync(X))Z=X}return Z}_fileExistsSync($){return c0.exists($)}}function kX($,J){c0=J;let Z=new fX($);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 RW=($)=>{return kX($,SX)},bX=RW;var wW="require is not supported by ESM",gX="loading a directory of commands is not supported yet for ESM",h$;try{h$=jW(import.meta.url)}catch($){h$=process.cwd()}var EW=h$.substring(0,h$.lastIndexOf("node_modules")),x6={assert:{notStrictEqual:TW,strictEqual:MW},cliui:V6,findUp:L6,getEnv:($)=>{return process.env[$]},inspect:CW,getCallerFile:()=>{throw new s(gX)},getProcessArgvBin:vX,mainFilename:EW||process.cwd(),Parser:F6,path:{basename:xW,dirname:PW,extname:IW,relative:OW,resolve:yX},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:FW,require:()=>{throw new s(wW)},requireDirectory:()=>{throw new s(gX)},stringWidth:($)=>{return[...$].length},y18n:bX({directory:yX(h$,"../../../locales"),updateFiles:!1})};function P0($,J,Z,X){Z.assert.notStrictEqual($,J,X)}function P6($,J){J.assert.strictEqual(typeof $,"string")}function Y$($){return Object.keys($)}function e($){return!!$&&!!$.then&&typeof $.then==="function"}function V1($){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 AW=["first","second","third","fourth","fifth","sixth"];function N($,J,Z){function X(){return typeof $==="object"?[{demanded:[],optional:[]},$,J]:[V1(`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 W=Y.demanded.length+Y.optional.length;if(K>W)throw new s(`Too many arguments provided. Expected max ${W} but received ${K}.`);Y.demanded.forEach((B)=>{let U=H.shift(),_=uX(U);if(B.cmd.filter((L)=>L===_||L==="*").length===0)mX(_,B.cmd,q);q+=1}),Y.optional.forEach((B)=>{if(H.length===0)return;let U=H.shift(),_=uX(U);if(B.cmd.filter((L)=>L===_||L==="*").length===0)mX(_,B.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function uX($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function mX($,J,Z){throw new s(`Invalid ${AW[Z]||"manyith"} argument. Expected ${J.join(" or ")} but received ${$}.`)}class I6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,J,Z=!0,X=!1){if(N("<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 cX($){if(!$)return[];return $.map((J)=>{return J.applyBeforeValidation=!1,J})}function N1($,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 h1($,J,Z=(X)=>{throw X}){try{let X=NW($)?$():$;return e(X)?X.then((q)=>J(q)):J(X)}catch(X){return Z(X)}}function NW($){return typeof $==="function"}function O6($){for(let J=0,Z=Object.keys(M0.cache),X;J<Z.length;J++)if(X=M0.cache[Z[J]],X.exports===$)return X;return null}var G$=/(^\*)|(^\$0)/;class dX{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=cX(q);if(X=X||(()=>{}),Array.isArray($))if(hW($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(vW($)){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(pX(Z)){this.addHandler([$].concat(Q),J,Z.builder,Z.handler,Z.middlewares,Z.deprecated);return}if(typeof $==="string"){let H=V1($);Q=Q.map((B)=>V1(B).cmd);let K=!1,W=[H.cmd].concat(Q).filter((B)=>{if(G$.test(B))return K=!0,!1;return!0});if(W.length===0&&K)W.push("$0");if(K)H.cmd=W[0],Q=W.slice(1),$=$.replace(G$,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 W=this.applyBuilderUpdateUsageAndParse(K,Q,J,Z.aliases,H,X,q,Y);return e(W)?W.then((B)=>this.applyMiddlewareAndGetResult(K,Q,B.innerArgv,G,q,B.aliases,J)):this.applyMiddlewareAndGetResult(K,Q,W.innerArgv,G,q,W.aliases,J)}applyBuilderUpdateUsageAndParse($,J,Z,X,q,Y,Q,G){let H=J.builder,K=Z;if(G2(H)){Z.getInternalMethods().getUsageInstance().freeze();let W=H(Z.getInternalMethods().reset(X),G);if(e(W))return W.then((B)=>{return K=nX(B)?B:Z,this.parseAndUpdateUsage($,J,K,q,Y,Q)})}else if(DW(H))Z.getInternalMethods().getUsageInstance().freeze(),K=Z.getInternalMethods().reset(X),Object.keys(J.builder).forEach((W)=>{K.option(W,H[W])});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=G$.test(J.original)?J.original.replace(G$,"").trim():J.original,X=$.filter((q)=>{return!G$.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=h1(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=N1(Z,Y,Q,!1),Z=h1(Z,(K)=>{let W=J.handler(K);return e(W)?W.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(e(Z)&&!Y.getInternalMethods().hasParseCallback())Z.catch((K)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,K)}catch(W){}})}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=N1(Z,Q,H,!0);return e(K)?K.then((W)=>this.handleValidationAndGetResult($,J,W,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=V1($);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=G$.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(G2(J))return J($,!0);else if(!pX(J))Object.keys(J).forEach((Z)=>{$.option(Z,J[Z])});return}moduleName($){let J=O6($);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;P0(X,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();P0($,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=$}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function lX($,J,Z,X){return new dX($,J,Z,X)}function pX($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function hW($){return $.every((J)=>typeof J==="string")}function G2($){return typeof $==="function"}function DW($){return typeof $==="object"}function vW($){return typeof $==="object"&&!Array.isArray($)}function L1($={},J=()=>!0){let Z={};return Y$($).forEach((X)=>{if(J(X,$[X]))Z[X]=$[X]}),Z}function _1($){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 SW($){return typeof $==="boolean"}function oX($,J){let Z=J.y18n.__,X={},q=[];X.failFn=function(j){q.push(j)};let Y=null,Q=null,G=!0;X.showHelpOnFail=function(j=!0,A){let[g,t]=typeof j==="string"?[!0,j]:[j,A];if($.getInternalMethods().isGlobalContext())Q=t;return Y=t,G=g,X};let H=!1;X.fail=function(j,A){let g=$.getInternalMethods().getLoggerInstance();if(q.length)for(let t=q.length-1;t>=0;--t){let G0=q[t];if(SW(G0)){if(A)throw A;else if(j)throw Error(j)}else G0(j,A,X)}else{if($.getExitProcess())_1(!0);if(!H){if(H=!0,G)$.showHelp("error"),g.error();if(j||A)g.error(j||A);let t=Y||Q;if(t){if(j||A)g.error("");g.error(t)}}if(A=A||new s(j),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,A);else throw A}};let K=[],W=!1;X.usage=(C,j)=>{if(C===null)return W=!0,K=[],X;return W=!1,K.push([C,j||""]),X},X.getUsage=()=>{return K},X.getUsageDisabled=()=>{return W},X.getPositionalGroupName=()=>{return Z("Positionals:")};let B=[];X.example=(C,j)=>{B.push([C,j||""])};let U=[];X.command=function(j,A,g,t,G0=!1){if(g)U=U.map((i)=>{return i[2]=!1,i});U.push([j,A||"",g,t,G0])},X.getCommands=()=>U;let _={};X.describe=function(j,A){if(Array.isArray(j))j.forEach((g)=>{X.describe(g,A)});else if(typeof j==="object")Object.keys(j).forEach((g)=>{X.describe(g,j[g])});else _[j]=A},X.getDescriptions=()=>_;let T=[];X.epilog=(C)=>{T.push(C)};let L=!1,P;X.wrap=(C)=>{L=!0,P=C},X.getWrap=()=>{if(J.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)P=W0(),L=!0;return P};let I="__yargsString__:";X.deferY18nLookup=(C)=>I+C,X.help=function(){if(O)return O;m();let j=$.customScriptName?$.$0:J.path.basename($.$0),A=$.getDemandedOptions(),g=$.getDemandedCommands(),t=$.getDeprecatedOptions(),G0=$.getGroups(),i=$.getOptions(),H0=[];H0=H0.concat(Object.keys(_)),H0=H0.concat(Object.keys(A)),H0=H0.concat(Object.keys(g)),H0=H0.concat(Object.keys(i.default)),H0=H0.filter(n),H0=Object.keys(H0.reduce((b,a)=>{if(a!=="_")b[a]=!0;return b},{}));let H1=X.getWrap(),r=J.cliui({width:H1,wrap:!!H1});if(!W){if(K.length)K.forEach((b)=>{if(r.div({text:`${b[0].replace(/\$0/g,j)}`}),b[1])r.div({text:`${b[1]}`,padding:[1,0,0,0]})}),r.div();else if(U.length){let b=null;if(g._)b=`${j} <${Z("command")}>
|
|
96
|
+
`;else b=`${j} [${Z("command")}]
|
|
97
|
+
`;r.div(`${b}`)}}if(U.length>1||U.length===1&&!U[0][2]){r.div(Z("Commands:"));let b=$.getInternalMethods().getContext(),a=b.commands.length?`${b.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)U=U.sort((p,L0)=>p[0].localeCompare(L0[0]));let z0=j?`${j} `:"";U.forEach((p)=>{let L0=`${z0}${a}${p[0].replace(/^\$0 ?/,"")}`;r.span({text:L0,padding:[0,2,0,2],width:D(U,H1,`${j}${a}`)+4},{text:p[1]});let X0=[];if(p[2])X0.push(`[${Z("default")}]`);if(p[3]&&p[3].length)X0.push(`[${Z("aliases:")} ${p[3].join(", ")}]`);if(p[4])if(typeof p[4]==="string")X0.push(`[${Z("deprecated: %s",p[4])}]`);else X0.push(`[${Z("deprecated")}]`);if(X0.length)r.div({text:X0.join(" "),padding:[0,0,0,2],align:"right"});else r.div()}),r.div()}let s0=(Object.keys(i.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);H0=H0.filter((b)=>!$.parsed.newAliases[b]&&s0.every((a)=>(i.alias[a]||[]).indexOf(b)===-1));let V$=Z("Options:");if(!G0[V$])G0[V$]=[];l(H0,i.alias,G0,V$);let k=(b)=>/^--/.test(H2(b)),c1=Object.keys(G0).filter((b)=>G0[b].length>0).map((b)=>{let a=G0[b].filter(n).map((z0)=>{if(s0.includes(z0))return z0;for(let p=0,L0;(L0=s0[p])!==void 0;p++)if((i.alias[L0]||[]).includes(z0))return L0;return z0});return{groupName:b,normalizedKeys:a}}).filter(({normalizedKeys:b})=>b.length>0).map(({groupName:b,normalizedKeys:a})=>{let z0=a.reduce((p,L0)=>{return p[L0]=[L0].concat(i.alias[L0]||[]).map((X0)=>{if(b===X.getPositionalGroupName())return X0;else return(/^[0-9]$/.test(X0)?i.boolean.includes(L0)?"-":"--":X0.length>1?"--":"-")+X0}).sort((X0,K0)=>k(X0)===k(K0)?0:k(X0)?1:-1).join(", "),p},{});return{groupName:b,normalizedKeys:a,switches:z0}});if(c1.filter(({groupName:b})=>b!==X.getPositionalGroupName()).some(({normalizedKeys:b,switches:a})=>!b.every((z0)=>k(a[z0]))))c1.filter(({groupName:b})=>b!==X.getPositionalGroupName()).forEach(({normalizedKeys:b,switches:a})=>{b.forEach((z0)=>{if(k(a[z0]))a[z0]=fW(a[z0],4)})});if(c1.forEach(({groupName:b,normalizedKeys:a,switches:z0})=>{r.div(b),a.forEach((p)=>{let L0=z0[p],X0=_[p]||"",K0=null;if(X0.includes(I))X0=Z(X0.substring(I.length));if(i.boolean.includes(p))K0=`[${Z("boolean")}]`;if(i.count.includes(p))K0=`[${Z("count")}]`;if(i.string.includes(p))K0=`[${Z("string")}]`;if(i.normalize.includes(p))K0=`[${Z("string")}]`;if(i.array.includes(p))K0=`[${Z("array")}]`;if(i.number.includes(p))K0=`[${Z("number")}]`;let M2=(x)=>typeof x==="string"?`[${Z("deprecated: %s",x)}]`:`[${Z("deprecated")}]`,V=[p in t?M2(t[p]):null,K0,p in A?`[${Z("required")}]`:null,i.choices&&i.choices[p]?`[${Z("choices:")} ${X.stringifiedValues(i.choices[p])}]`:null,o(i.default[p],i.defaultDescription[p])].filter(Boolean).join(" ");r.span({text:H2(L0),padding:[0,2,0,2+iX(L0)],width:D(z0,H1)+4},X0);let M=$.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;if(V&&!M)r.div({text:V,padding:[0,0,0,2],align:"right"});else r.div()}),r.div()}),B.length)r.div(Z("Examples:")),B.forEach((b)=>{b[0]=b[0].replace(/\$0/g,j)}),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:D(B,H1)+4},{text:b[1]})}),r.div();if(T.length>0){let b=T.map((a)=>a.replace(/\$0/g,j)).join(`
|
|
98
|
+
`);r.div(`${b}
|
|
99
|
+
`)}return r.toString().replace(/\s*$/,"")};function D(C,j,A){let g=0;if(!Array.isArray(C))C=Object.values(C).map((t)=>[t]);if(C.forEach((t)=>{g=Math.max(J.stringWidth(A?`${A} ${H2(t[0])}`:H2(t[0]))+iX(t[0]),g)}),j)g=Math.min(g,parseInt((j*0.5).toString(),10));return g}function m(){let C=$.getDemandedOptions(),j=$.getOptions();(Object.keys(j.alias)||[]).forEach((A)=>{j.alias[A].forEach((g)=>{if(_[g])X.describe(A,_[g]);if(g in C)$.demandOption(A,C[g]);if(j.boolean.includes(g))$.boolean(A);if(j.count.includes(g))$.count(A);if(j.string.includes(g))$.string(A);if(j.normalize.includes(g))$.normalize(A);if(j.array.includes(g))$.array(A);if(j.number.includes(g))$.number(A)})})}let O;X.cacheHelpMessage=function(){O=this.help()},X.clearCachedHelpMessage=function(){O=void 0},X.hasCachedHelpMessage=function(){return!!O};function l(C,j,A,g){let t=[],G0=null;return Object.keys(A).forEach((i)=>{t=t.concat(A[i])}),C.forEach((i)=>{if(G0=[i].concat(j[i]),!G0.some((H0)=>t.indexOf(H0)!==-1))A[g].push(i)}),t}function n(C){return $.getOptions().hiddenOptions.indexOf(C)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}X.showHelp=(C)=>{let j=$.getInternalMethods().getLoggerInstance();if(!C)C="error";(typeof C==="function"?C:j[C])(X.help())},X.functionDescription=(C)=>{return["(",C.name?J.Parser.decamelize(C.name,"-"):Z("generated-value"),")"].join("")},X.stringifiedValues=function(j,A){let g="",t=A||", ",G0=[].concat(j);if(!j||!G0.length)return g;return G0.forEach((i)=>{if(g.length)g+=t;g+=JSON.stringify(i)}),g};function o(C,j){let A=`[${Z("default:")} `;if(C===void 0&&!j)return null;if(j)A+=j;else switch(typeof C){case"string":A+=`"${C}"`;break;case"object":A+=JSON.stringify(C);break;default:A+=C}return`${A}]`}function W0(){if(J.process.stdColumns)return Math.min(80,J.process.stdColumns);else return 80}let d=null;X.version=(C)=>{d=C},X.showVersion=(C)=>{let j=$.getInternalMethods().getLoggerInstance();if(!C)C="error";(typeof C==="function"?C:j[C])(d)},X.reset=function(j){return Y=null,H=!1,K=[],W=!1,T=[],B=[],U=[],_=L1(_,(A)=>!j[A]),X};let d0=[];return X.freeze=function(){d0.push({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:T,examples:B,commands:U,descriptions:_})},X.unfreeze=function(j=!1){let A=d0.pop();if(!A)return;if(j)_={...A.descriptions,..._},U=[...A.commands,...U],K=[...A.usages,...K],B=[...A.examples,...B],T=[...A.epilogs,...T];else({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:T,examples:B,commands:U,descriptions:_}=A)},X}function w6($){return typeof $==="object"}function fW($,J){return w6($)?{text:$.text,indentation:$.indentation+J}:{text:$,indentation:J}}function iX($){return w6($)?$.indentation:0}function H2($){return w6($)?$.text:$}var tX=`###-begin-{{app_name}}-completions-###
|
|
100
100
|
#
|
|
101
101
|
# yargs command completion script
|
|
102
102
|
#
|
|
@@ -143,13 +143,16 @@ _{{app_name}}_yargs_completions()
|
|
|
143
143
|
}
|
|
144
144
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
145
145
|
###-end-{{app_name}}-completions-###
|
|
146
|
-
`;class rX{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(
|
|
147
|
-
${
|
|
148
|
-
`)}`:"";J.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(_).length,Object.keys(_).join(", ")+L))}},Y.unknownArguments=function(B,
|
|
149
|
-
${X("Argument: %s, Given: %s, Choices: %s",
|
|
150
|
-
`;W.forEach((R)=>{_+=R}),J.fail(_)}};let H={};Y.conflicts=function(B,W){if(h("<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 D=eX(B,j);if(D<=3&&D<L)L=D,R=j}if(R)J.fail(X("Did you mean %s?",R))},Y.reset=function(B){return Q=U1(Q,(W)=>!B[W]),H=U1(H,(W)=>!B[W]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let B=K.pop();F0(B,void 0,Z),{implied:Q,conflicting:H}=B},Y}var P6=[],E$;function A$($,J,Z,X){E$=X;let q={};if(Object.prototype.hasOwnProperty.call($,"extends")){if(typeof $.extends!=="string")return q;let Y=/\.json|\..*rc$/.test($.extends),Q=null;if(!Y)try{Q=_0.resolve($.extends)}catch(G){return $}else Q=kU(J,$.extends);fU(Q),P6.push(Q),q=Y?JSON.parse(E$.readFileSync(Q,"utf8")):_0($.extends),delete $.extends,q=A$(q,E$.path.dirname(Q),Z,E$)}return P6=[],Z?ZQ(q,$):Object.assign({},q,$)}function fU($){if(P6.indexOf($)>-1)throw new s(`Circular extended configurations: '${$}'.`)}function kU($,J){return E$.path.resolve($,J)}function ZQ($,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]=ZQ($[q],J[q]);else Z[q]=J[q];return Z}var N=function($,J,Z,X,q){if(X==="m")throw TypeError("Private method is not writable");if(X==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof J==="function"?$!==J||!q:!J.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?q.call($,Z):q?q.value=Z:J.set($,Z),Z},z=function($,J,Z,X){if(Z==="a"&&!X)throw TypeError("Private accessor was defined without a getter");if(typeof J==="function"?$!==J||!X:!J.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?X:Z==="a"?X.call($):X?X.value:J.get($)},Y0,E1,h$,v0,O0,q2,V1,A1,Y2,S0,G2,f0,o0,w0,k0,H2,q$,W0,f,z2,K2,E0,h1,Y$,N1,L1,B2,u,D1,v1,S1,c,U2,t0,Z0;function jQ($){return(J=[],Z=$.process.cwd(),X)=>{let q=new xQ(J,Z,X,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var XQ=Symbol("copyDoubleDash"),QQ=Symbol("copyDoubleDash"),I6=Symbol("deleteFromParserHintObject"),qQ=Symbol("emitWarning"),YQ=Symbol("freeze"),GQ=Symbol("getDollarZero"),f1=Symbol("getParserConfiguration"),HQ=Symbol("getUsageConfiguration"),O6=Symbol("guessLocale"),zQ=Symbol("guessVersion"),KQ=Symbol("parsePositionalNumbers"),w6=Symbol("pkgUp"),_1=Symbol("populateParserHintArray"),G$=Symbol("populateParserHintSingleValueDictionary"),E6=Symbol("populateParserHintArrayDictionary"),A6=Symbol("populateParserHintDictionary"),h6=Symbol("sanitizeKey"),N6=Symbol("setKey"),D6=Symbol("unfreeze"),BQ=Symbol("validateAsync"),UQ=Symbol("getCommandInstance"),WQ=Symbol("getContext"),VQ=Symbol("getHasOutput"),LQ=Symbol("getLoggerInstance"),_Q=Symbol("getParseContext"),RQ=Symbol("getUsageInstance"),TQ=Symbol("getValidationInstance"),W2=Symbol("hasParseCallback"),MQ=Symbol("isGlobalContext"),k1=Symbol("postProcess"),CQ=Symbol("rebase"),v6=Symbol("reset"),N$=Symbol("runYargsParserAndExecuteCommands"),S6=Symbol("runValidation"),FQ=Symbol("setHasOutput"),b1=Symbol("kTrackManuallySetKeys");class xQ{constructor($=[],J,Z,X){this.customScriptName=!1,this.parsed=!1,Y0.set(this,void 0),E1.set(this,void 0),h$.set(this,{commands:[],fullCommands:[]}),v0.set(this,null),O0.set(this,null),q2.set(this,"show-hidden"),V1.set(this,null),A1.set(this,!0),Y2.set(this,{}),S0.set(this,!0),G2.set(this,[]),f0.set(this,void 0),o0.set(this,{}),w0.set(this,!1),k0.set(this,null),H2.set(this,!0),q$.set(this,void 0),W0.set(this,""),f.set(this,void 0),z2.set(this,void 0),K2.set(this,{}),E0.set(this,null),h1.set(this,null),Y$.set(this,{}),N1.set(this,{}),L1.set(this,void 0),B2.set(this,!1),u.set(this,void 0),D1.set(this,!1),v1.set(this,!1),S1.set(this,!1),c.set(this,void 0),U2.set(this,{}),t0.set(this,null),Z0.set(this,void 0),N(this,u,X,"f"),N(this,L1,$,"f"),N(this,E1,J,"f"),N(this,z2,Z,"f"),N(this,f0,new F6(this),"f"),this.$0=this[GQ](),this[v6](),N(this,Y0,z(this,Y0,"f"),"f"),N(this,c,z(this,c,"f"),"f"),N(this,Z0,z(this,Z0,"f"),"f"),N(this,f,z(this,f,"f"),"f"),z(this,f,"f").showHiddenOpt=z(this,q2,"f"),N(this,q$,this[QQ](),"f")}addHelpOpt($,J){if(h("[string|boolean] [string]",[$,J],arguments.length),z(this,k0,"f"))this[I6](z(this,k0,"f")),N(this,k0,null,"f");if($===!1&&J===void 0)return this;return N(this,k0,typeof $==="string"?$:"help","f"),this.boolean(z(this,k0,"f")),this.describe(z(this,k0,"f"),J||z(this,c,"f").deferY18nLookup("Show help")),this}help($,J){return this.addHelpOpt($,J)}addShowHiddenOpt($,J){if(h("[string|boolean] [string]",[$,J],arguments.length),$===!1&&J===void 0)return this;let Z=typeof $==="string"?$:z(this,q2,"f");return this.boolean(Z),this.describe(Z,J||z(this,c,"f").deferY18nLookup("Show hidden options")),z(this,f,"f").showHiddenOpt=Z,this}showHidden($,J){return this.addShowHiddenOpt($,J)}alias($,J){return h("<object|string|array> [string|array]",[$,J],arguments.length),this[E6](this.alias.bind(this),"alias",$,J),this}array($){return h("<array|string>",[$],arguments.length),this[_1]("array",$),this[b1]($),this}boolean($){return h("<array|string>",[$],arguments.length),this[_1]("boolean",$),this[b1]($),this}check($,J){return h("<function> [boolean]",[$,J],arguments.length),this.middleware((Z,X)=>{return w1(()=>{return $(Z,X.getOptions())},(q)=>{if(!q)z(this,c,"f").fail(z(this,u,"f").y18n.__("Argument check failed: %s",$.toString()));else if(typeof q==="string"||q instanceof Error)z(this,c,"f").fail(q.toString(),q);return Z},(q)=>{return z(this,c,"f").fail(q.message?q.message:q.toString(),q),Z})},!1,J),this}choices($,J){return h("<object|string|array> [string|array]",[$,J],arguments.length),this[E6](this.choices.bind(this),"choices",$,J),this}coerce($,J){if(h("<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,f,"f").key[$]=!0,z(this,f0,"f").addCoerceMiddleware((Z,X)=>{let q;if(!Object.prototype.hasOwnProperty.call(Z,$))return Z;return w1(()=>{return q=X.getAliases(),J(Z[$])},(Q)=>{Z[$]=Q;let G=X.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])Z[H]=Q;return Z},(Q)=>{throw new s(Q.message)})},$),this}conflicts($,J){return h("<string|object> [string|array]",[$,J],arguments.length),z(this,Z0,"f").conflicts($,J),this}config($="config",J,Z){if(h("[object|string] [string|function] [function]",[$,J,Z],arguments.length),typeof $==="object"&&!Array.isArray($))return $=A$($,z(this,E1,"f"),this[f1]()["deep-merge-config"]||!1,z(this,u,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat($),this;if(typeof J==="function")Z=J,J=void 0;return this.describe($,J||z(this,c,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((X)=>{z(this,f,"f").config[X]=Z||!0}),this}completion($,J,Z){if(h("[string] [string|boolean|function] [function]",[$,J,Z],arguments.length),typeof J==="function")Z=J,J=void 0;if(N(this,O0,$||z(this,O0,"f")||"completion","f"),!J&&J!==!1)J="generate completion script";if(this.command(z(this,O0,"f"),J),Z)z(this,v0,"f").registerFunction(Z);return this}command($,J,Z,X,q,Y){return h("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,J,Z,X,q,Y],arguments.length),z(this,Y0,"f").addHandler($,J,Z,X,q,Y),this}commands($,J,Z,X,q,Y){return this.command($,J,Z,X,q,Y)}commandDir($,J){h("<string> [object]",[$,J],arguments.length);let Z=z(this,z2,"f")||z(this,u,"f").require;return z(this,Y0,"f").addDirectory($,Z,z(this,u,"f").getCallerFile(),J),this}count($){return h("<array|string>",[$],arguments.length),this[_1]("count",$),this[b1]($),this}default($,J,Z){if(h("<object|string|array> [*] [string]",[$,J,Z],arguments.length),Z)C6($,z(this,u,"f")),z(this,f,"f").defaultDescription[$]=Z;if(typeof J==="function"){if(C6($,z(this,u,"f")),!z(this,f,"f").defaultDescription[$])z(this,f,"f").defaultDescription[$]=z(this,c,"f").functionDescription(J);J=J.call()}return this[G$](this.default.bind(this),"default",$,J),this}defaults($,J,Z){return this.default($,J,Z)}demandCommand($=1,J,Z,X){if(h("[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,f,"f").demandedCommands._={min:$,max:J,minMsg:Z,maxMsg:X},this}demand($,J,Z){if(Array.isArray(J))J.forEach((X)=>{F0(Z,!0,z(this,u,"f")),this.demandOption(X,Z)}),J=1/0;else if(typeof J!=="number")Z=J,J=1/0;if(typeof $==="number")F0(Z,!0,z(this,u,"f")),this.demandCommand($,J,Z,Z);else if(Array.isArray($))$.forEach((X)=>{F0(Z,!0,z(this,u,"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 h("<object|string|array> [string]",[$,J],arguments.length),this[G$](this.demandOption.bind(this),"demandedOptions",$,J),this}deprecateOption($,J){return h("<string> [string|boolean]",[$,J],arguments.length),z(this,f,"f").deprecatedOptions[$]=J,this}describe($,J){return h("<object|string|array> [string]",[$,J],arguments.length),this[N6]($,!0),z(this,c,"f").describe($,J),this}detectLocale($){return h("<boolean>",[$],arguments.length),N(this,A1,$,"f"),this}env($){if(h("[string|boolean]",[$],arguments.length),$===!1)delete z(this,f,"f").envPrefix;else z(this,f,"f").envPrefix=$||"";return this}epilogue($){return h("<string>",[$],arguments.length),z(this,c,"f").epilog($),this}epilog($){return this.epilogue($)}example($,J){if(h("<string|array> [string]",[$,J],arguments.length),Array.isArray($))$.forEach((Z)=>this.example(...Z));else z(this,c,"f").example($,J);return this}exit($,J){if(N(this,w0,!0,"f"),N(this,V1,J,"f"),z(this,S0,"f"))z(this,u,"f").process.exit($)}exitProcess($=!0){return h("[boolean]",[$],arguments.length),N(this,S0,$,"f"),this}fail($){if(h("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new s("Invalid first argument. Expected function or boolean 'false'");return z(this,c,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,J){if(h("<array> [function]",[$,J],arguments.length),!J)return new Promise((Z,X)=>{z(this,v0,"f").getCompletion($,(q,Y)=>{if(q)X(q);else Z(Y)})});else return z(this,v0,"f").getCompletion($,J)}getDemandedOptions(){return h([],0),z(this,f,"f").demandedOptions}getDemandedCommands(){return h([],0),z(this,f,"f").demandedCommands}getDeprecatedOptions(){return h([],0),z(this,f,"f").deprecatedOptions}getDetectLocale(){return z(this,A1,"f")}getExitProcess(){return z(this,S0,"f")}getGroups(){return Object.assign({},z(this,o0,"f"),z(this,N1,"f"))}getHelp(){if(N(this,w0,!0,"f"),!z(this,c,"f").hasCachedHelpMessage()){if(!this.parsed){let J=this[N$](z(this,L1,"f"),void 0,void 0,0,!0);if(e(J))return J.then(()=>{return z(this,c,"f").help()})}let $=z(this,Y0,"f").runDefaultBuilderOn(this);if(e($))return $.then(()=>{return z(this,c,"f").help()})}return Promise.resolve(z(this,c,"f").help())}getOptions(){return z(this,f,"f")}getStrict(){return z(this,D1,"f")}getStrictCommands(){return z(this,v1,"f")}getStrictOptions(){return z(this,S1,"f")}global($,J){if(h("<string|array> [boolean]",[$,J],arguments.length),$=[].concat($),J!==!1)z(this,f,"f").local=z(this,f,"f").local.filter((Z)=>$.indexOf(Z)===-1);else $.forEach((Z)=>{if(!z(this,f,"f").local.includes(Z))z(this,f,"f").local.push(Z)});return this}group($,J){h("<string|array> <string>",[$,J],arguments.length);let Z=z(this,N1,"f")[J]||z(this,o0,"f")[J];if(z(this,N1,"f")[J])delete z(this,N1,"f")[J];let X={};return z(this,o0,"f")[J]=(Z||[]).concat($).filter((q)=>{if(X[q])return!1;return X[q]=!0}),this}hide($){return h("<string>",[$],arguments.length),z(this,f,"f").hiddenOptions.push($),this}implies($,J){return h("<string|object> [number|string|array]",[$,J],arguments.length),z(this,Z0,"f").implies($,J),this}locale($){if(h("[string]",[$],arguments.length),$===void 0)return this[O6](),z(this,u,"f").y18n.getLocale();return N(this,A1,!1,"f"),z(this,u,"f").y18n.setLocale($),this}middleware($,J,Z){return z(this,f0,"f").addMiddleware($,!!J,Z)}nargs($,J){return h("<string|object|array> [number]",[$,J],arguments.length),this[G$](this.nargs.bind(this),"narg",$,J),this}normalize($){return h("<array|string>",[$],arguments.length),this[_1]("normalize",$),this}number($){return h("<array|string>",[$],arguments.length),this[_1]("number",$),this[b1]($),this}option($,J){if(h("<string|object> [object]",[$,J],arguments.length),typeof $==="object")Object.keys($).forEach((Z)=>{this.options(Z,$[Z])});else{if(typeof J!=="object")J={};if(this[b1]($),z(this,t0,"f")&&($==="version"||(J===null||J===void 0?void 0:J.alias)==="version"))this[qQ](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
151
|
-
`),void 0,"versionWarning");if(z(this,
|
|
152
|
-
`,"f");
|
|
153
|
-
`,"f");N(this,W0,z(this,W0,"f")+$.join(" "),"f")}}}[I6]($){X$(z(this,f,"f")).forEach((J)=>{if(((X)=>X==="configObjects")(J))return;let Z=z(this,f,"f")[J];if(Array.isArray(Z)){if(Z.includes($))Z.splice(Z.indexOf($),1)}else if(typeof Z==="object")delete Z[$]}),delete z(this,c,"f").getDescriptions()[$]}[qQ]($,J,Z){if(!z(this,Y2,"f")[Z])z(this,u,"f").process.emitWarning($,J),z(this,Y2,"f")[Z]=!0}[YQ](){z(this,G2,"f").push({options:z(this,f,"f"),configObjects:z(this,f,"f").configObjects.slice(0),exitProcess:z(this,S0,"f"),groups:z(this,o0,"f"),strict:z(this,D1,"f"),strictCommands:z(this,v1,"f"),strictOptions:z(this,S1,"f"),completionCommand:z(this,O0,"f"),output:z(this,W0,"f"),exitError:z(this,V1,"f"),hasOutput:z(this,w0,"f"),parsed:this.parsed,parseFn:z(this,E0,"f"),parseContext:z(this,h1,"f")}),z(this,c,"f").freeze(),z(this,Z0,"f").freeze(),z(this,Y0,"f").freeze(),z(this,f0,"f").freeze()}[GQ](){let $="",J;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,u,"f").process.argv()[0]))J=z(this,u,"f").process.argv().slice(1,2);else J=z(this,u,"f").process.argv().slice(0,1);if($=J.map((Z)=>{let X=this[CQ](z(this,E1,"f"),Z);return Z.match(/^(\/|([a-zA-Z]:)?\\)/)&&X.length<Z.length?X:Z}).join(" ").trim(),z(this,u,"f").getEnv("_")&&z(this,u,"f").getProcessArgvBin()===z(this,u,"f").getEnv("_"))$=z(this,u,"f").getEnv("_").replace(`${z(this,u,"f").path.dirname(z(this,u,"f").process.execPath())}/`,"");return $}[f1](){return z(this,K2,"f")}[HQ](){return z(this,U2,"f")}[O6](){if(!z(this,A1,"f"))return;let $=z(this,u,"f").getEnv("LC_ALL")||z(this,u,"f").getEnv("LC_MESSAGES")||z(this,u,"f").getEnv("LANG")||z(this,u,"f").getEnv("LANGUAGE")||"en_US";this.locale($.replace(/[.:].*/,""))}[zQ](){return this[w6]().version||"unknown"}[KQ]($){let J=$["--"]?$["--"]:$._;for(let Z=0,X;(X=J[Z])!==void 0;Z++)if(z(this,u,"f").Parser.looksLikeNumber(X)&&Number.isSafeInteger(Math.floor(parseFloat(`${X}`))))J[Z]=Number(X);return $}[w6]($){let J=$||"*";if(z(this,Y$,"f")[J])return z(this,Y$,"f")[J];let Z={};try{let X=$||z(this,u,"f").mainFilename;if(!$&&z(this,u,"f").path.extname(X))X=z(this,u,"f").path.dirname(X);let q=z(this,u,"f").findUp(X,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});F0(q,void 0,z(this,u,"f")),Z=JSON.parse(z(this,u,"f").readFileSync(q,"utf8"))}catch(X){}return z(this,Y$,"f")[J]=Z||{},z(this,Y$,"f")[J]}[_1]($,J){J=[].concat(J),J.forEach((Z)=>{Z=this[h6](Z),z(this,f,"f")[$].push(Z)})}[G$]($,J,Z,X){this[A6]($,J,Z,X,(q,Y,Q)=>{z(this,f,"f")[q][Y]=Q})}[E6]($,J,Z,X){this[A6]($,J,Z,X,(q,Y,Q)=>{z(this,f,"f")[q][Y]=(z(this,f,"f")[q][Y]||[]).concat(Q)})}[A6]($,J,Z,X,q){if(Array.isArray(Z))Z.forEach((Y)=>{$(Y,X)});else if(((Y)=>typeof Y==="object")(Z))for(let Y of X$(Z))$(Y,Z[Y]);else q(J,this[h6](Z),X)}[h6]($){if($==="__proto__")return"___proto___";return $}[N6]($,J){return this[G$](this[N6].bind(this),"key",$,J),this}[D6](){var $,J,Z,X,q,Y,Q,G,H,K,U,B;let W=z(this,G2,"f").pop();F0(W,void 0,z(this,u,"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){N($,f,R,"f")}}.value,configObjects:_,exitProcess:{set value(R){N(J,S0,R,"f")}}.value,groups:{set value(R){N(Z,o0,R,"f")}}.value,output:{set value(R){N(X,W0,R,"f")}}.value,exitError:{set value(R){N(q,V1,R,"f")}}.value,hasOutput:{set value(R){N(Y,w0,R,"f")}}.value,parsed:this.parsed,strict:{set value(R){N(Q,D1,R,"f")}}.value,strictCommands:{set value(R){N(G,v1,R,"f")}}.value,strictOptions:{set value(R){N(H,S1,R,"f")}}.value,completionCommand:{set value(R){N(K,O0,R,"f")}}.value,parseFn:{set value(R){N(U,E0,R,"f")}}.value,parseContext:{set value(R){N(B,h1,R,"f")}}.value}=W,z(this,f,"f").configObjects=_,z(this,c,"f").unfreeze(),z(this,Z0,"f").unfreeze(),z(this,Y0,"f").unfreeze(),z(this,f0,"f").unfreeze()}[BQ]($,J){return w1(J,(Z)=>{return $(Z),Z})}getInternalMethods(){return{getCommandInstance:this[UQ].bind(this),getContext:this[WQ].bind(this),getHasOutput:this[VQ].bind(this),getLoggerInstance:this[LQ].bind(this),getParseContext:this[_Q].bind(this),getParserConfiguration:this[f1].bind(this),getUsageConfiguration:this[HQ].bind(this),getUsageInstance:this[RQ].bind(this),getValidationInstance:this[TQ].bind(this),hasParseCallback:this[W2].bind(this),isGlobalContext:this[MQ].bind(this),postProcess:this[k1].bind(this),reset:this[v6].bind(this),runValidation:this[S6].bind(this),runYargsParserAndExecuteCommands:this[N$].bind(this),setHasOutput:this[FQ].bind(this)}}[UQ](){return z(this,Y0,"f")}[WQ](){return z(this,h$,"f")}[VQ](){return z(this,w0,"f")}[LQ](){return z(this,q$,"f")}[_Q](){return z(this,h1,"f")||{}}[RQ](){return z(this,c,"f")}[TQ](){return z(this,Z0,"f")}[W2](){return!!z(this,E0,"f")}[MQ](){return z(this,H2,"f")}[k1]($,J,Z,X){if(Z)return $;if(e($))return $;if(!J)$=this[XQ]($);if(this[f1]()["parse-positional-numbers"]||this[f1]()["parse-positional-numbers"]===void 0)$=this[KQ]($);if(X)$=O1($,this,z(this,f0,"f").getMiddleware(),!1);return $}[v6]($={}){N(this,f,z(this,f,"f")||{},"f");let J={};J.local=z(this,f,"f").local||[],J.configObjects=z(this,f,"f").configObjects||[];let Z={};J.local.forEach((Y)=>{Z[Y]=!0,($[Y]||[]).forEach((Q)=>{Z[Q]=!0})}),Object.assign(z(this,N1,"f"),Object.keys(z(this,o0,"f")).reduce((Y,Q)=>{let G=z(this,o0,"f")[Q].filter((H)=>!(H in Z));if(G.length>0)Y[Q]=G;return Y},{})),N(this,o0,{},"f");let X=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(X.forEach((Y)=>{J[Y]=(z(this,f,"f")[Y]||[]).filter((Q)=>!Z[Q])}),q.forEach((Y)=>{J[Y]=U1(z(this,f,"f")[Y],(Q)=>!Z[Q])}),J.envPrefix=z(this,f,"f").envPrefix,N(this,f,J,"f"),N(this,c,z(this,c,"f")?z(this,c,"f").reset(Z):oX(this,z(this,u,"f")),"f"),N(this,Z0,z(this,Z0,"f")?z(this,Z0,"f").reset(Z):JQ(this,z(this,c,"f"),z(this,u,"f")),"f"),N(this,Y0,z(this,Y0,"f")?z(this,Y0,"f").reset():lX(z(this,c,"f"),z(this,Z0,"f"),z(this,f0,"f"),z(this,u,"f")),"f"),!z(this,v0,"f"))N(this,v0,sX(this,z(this,c,"f"),z(this,Y0,"f"),z(this,u,"f")),"f");return z(this,f0,"f").reset(),N(this,O0,null,"f"),N(this,W0,"","f"),N(this,V1,null,"f"),N(this,w0,!1,"f"),this.parsed=!1,this}[CQ]($,J){return z(this,u,"f").path.relative($,J)}[N$]($,J,Z,X=0,q=!1){let Y=!!Z||q;$=$||z(this,L1,"f"),z(this,f,"f").__=z(this,u,"f").y18n.__,z(this,f,"f").configuration=this[f1]();let Q=!!z(this,f,"f").configuration["populate--"],G=Object.assign({},z(this,f,"f").configuration,{"populate--":!0}),H=z(this,u,"f").Parser.detailed($,Object.assign({},z(this,f,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),K=Object.assign(H.argv,z(this,h1,"f")),U=void 0,B=H.aliases,W=!1,_=!1;if(Object.keys(K).forEach((R)=>{if(R===z(this,k0,"f")&&K[R])W=!0;else if(R===z(this,t0,"f")&&K[R])_=!0}),K.$0=this.$0,this.parsed=H,X===0)z(this,c,"f").clearCachedHelpMessage();try{if(this[O6](),J)return this[k1](K,Q,!!Z,!1);if(z(this,k0,"f")){if([z(this,k0,"f")].concat(B[z(this,k0,"f")]||[]).filter((D)=>D.length>1).includes(""+K._[K._.length-1]))K._.pop(),W=!0}N(this,H2,!1,"f");let R=z(this,Y0,"f").getCommands(),L=z(this,v0,"f").completionKey in K,x=W||L||q;if(K._.length){if(R.length){let j;for(let D=X||0,p;K._[D]!==void 0;D++)if(p=String(K._[D]),R.includes(p)&&p!==z(this,O0,"f")){let P=z(this,Y0,"f").runCommand(p,this,H,D+1,q,W||_||q);return this[k1](P,Q,!!Z,!1)}else if(!j&&p!==z(this,O0,"f")){j=p;break}if(!z(this,Y0,"f").hasDefaultCommand()&&z(this,B2,"f")&&j&&!x)z(this,Z0,"f").recommendCommands(j,R)}if(z(this,O0,"f")&&K._.includes(z(this,O0,"f"))&&!L){if(z(this,S0,"f"))W1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,Y0,"f").hasDefaultCommand()&&!x){let j=z(this,Y0,"f").runCommand(null,this,H,0,q,W||_||q);return this[k1](j,Q,!!Z,!1)}if(L){if(z(this,S0,"f"))W1(!0);$=[].concat($);let j=$.slice($.indexOf(`--${z(this,v0,"f").completionKey}`)+1);return z(this,v0,"f").getCompletion(j,(D,p)=>{if(D)throw new s(D.message);(p||[]).forEach((P)=>{z(this,q$,"f").log(P)}),this.exit(0)}),this[k1](K,!Q,!!Z,!1)}if(!z(this,w0,"f")){if(W){if(z(this,S0,"f"))W1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(_){if(z(this,S0,"f"))W1(!0);Y=!0,z(this,c,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,f,"f").skipValidation.length>0)Y=Object.keys(K).some((j)=>z(this,f,"f").skipValidation.indexOf(j)>=0&&K[j]===!0);if(!Y){if(H.error)throw new s(H.error.message);if(!L){let j=this[S6](B,{},H.error);if(!Z)U=O1(K,this,z(this,f0,"f").getMiddleware(),!0);if(U=this[BQ](j,U!==null&&U!==void 0?U:K),e(U)&&!Z)U=U.then(()=>{return O1(K,this,z(this,f0,"f").getMiddleware(),!1)})}}}catch(R){if(R instanceof s)z(this,c,"f").fail(R.message,R);else throw R}return this[k1](U!==null&&U!==void 0?U:K,Q,!!Z,!0)}[S6]($,J,Z,X){let q={...this.getDemandedOptions()};return(Y)=>{if(Z)throw new s(Z.message);z(this,Z0,"f").nonOptionCount(Y),z(this,Z0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,v1,"f"))Q=z(this,Z0,"f").unknownCommands(Y);if(z(this,D1,"f")&&!Q)z(this,Z0,"f").unknownArguments(Y,$,J,!!X);else if(z(this,S1,"f"))z(this,Z0,"f").unknownArguments(Y,$,{},!1,!1);z(this,Z0,"f").limitedChoices(Y),z(this,Z0,"f").implications(Y),z(this,Z0,"f").conflicting(Y)}}[FQ](){N(this,w0,!0,"f")}[b1]($){if(typeof $==="string")z(this,f,"f").key[$]=!0;else for(let J of $)z(this,f,"f").key[J]=!0}}function nX($){return!!$&&typeof $.getInternalMethods==="function"}var bU=jQ(M6),PQ=bU;import{existsSync as b0,readFileSync as S$,rmSync as a0,writeFileSync as OQ,readdirSync as z$,copyFileSync as H$,mkdirSync as R1}from"fs";import{resolve as A0,dirname as k6,join as L0,basename as yU}from"path";import{fileURLToPath as gU}from"url";var uU=PQ(T6(process.argv)).option("h",{alias:"help",type:"boolean"}).version("version","Show version number",tU()).parseSync(),mU="https://github.com/ardzero/bunext.git",cU="https://github.com/ardzero/",v$=".bunext-upgrade-temp",f$=".bunext-upgrade-backup",pU=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],dU=[".git","public","src/lib/data/siteData.ts"];var lU="loading-dots",nU="favicon.svg",iU="ogImage.jpg";function oU(){if(typeof globalThis.Bun<"u")return"bun";if(process.env.npm_execpath?.includes("bun"))return"bun";if(process.argv[1]?.includes("bunx"))return"bun";if(process.env.npm_execpath?.includes("pnpm"))return"pnpm";if(process.env.npm_execpath?.includes("yarn"))return"yarn";return"npm"}function tU(){try{let $=gU(import.meta.url),J=k6($),Z=L0(J,"../package.json");return JSON.parse(S$(Z,"utf-8")).version}catch{return"0.1.0"}}function aU($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function rU($,J){let Z=aU(J),X=`${cU}${Z}`,q=A0($,"project_readme.md"),Y=A0($,"README.md");if(!b0(q))return;let Q=S$(q,"utf-8");Q=Q.replace(/\?\{project-name\}/g,J).replace(/\?\{repo-link\}/g,X),OQ(Y,Q),a0(q,{force:!0})}function sU($){for(let J of dU){let Z=A0($,J);if(!b0(Z))return{ok:!1,missing:J}}return{ok:!0}}function IQ($){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 eU($){let J=$.match(/favicon:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function $W($){let J=$.match(/ogImage:\s*\{\s*src:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function k$($,J,Z=!1){let X=z$($,{withFileTypes:!0});for(let q of X){if(Z&&q.name===".git")continue;let Y=L0($,q.name),Q=L0(J,q.name);if(q.isDirectory())R1(Q,{recursive:!0}),k$(Y,Q,!1);else R1(k6(Q),{recursive:!0}),H$(Y,Q)}}function JW($){let J=A0($,f$);if(b0(J))a0(J,{recursive:!0,force:!0});R1(J,{recursive:!0});let Z=z$($,{withFileTypes:!0});for(let X of Z){if(X.name===".git"||X.name===v$||X.name===f$)continue;let q=L0($,X.name),Y=L0(J,X.name);if(X.isDirectory())R1(Y,{recursive:!0}),k$(q,Y,!1);else H$(q,Y)}}function ZW($){let J=A0($,f$);if(!b0(J)){j0.error("No backup found. Cannot undo.");return}let Z=z$($,{withFileTypes:!0});for(let q of Z){if(q.name===".git"||q.name===f$)continue;let Y=L0($,q.name);a0(Y,{recursive:!0,force:!0})}let X=z$(J,{withFileTypes:!0});for(let q of X){let Y=L0(J,q.name),Q=L0($,q.name);if(q.isDirectory())R1(Q,{recursive:!0}),k$(Y,Q,!1);else H$(Y,Q)}a0(J,{recursive:!0,force:!0}),j0.success("Reverted to pre-upgrade state.")}async function f6($,J){let X=await _X({message:J==="error"?"Do you want to undo all changes and restore your project?":"Do you want to undo the upgrade and restore your previous project?",initialValue:!1});if(J$(X))process.exit(0);if(X){let q=H6();return q.start("Reverting…"),ZW($),q.stop("Reverted."),!0}return!1}async function XW(){if(uU.h)console.log("Usage: bunextupgrade"),console.log(" Upgrade an existing Bunext project to the latest template."),console.log(" Run from the project root. Preserves .git, public assets, and siteData."),process.exit(0);let $=process.cwd(),J=sU($);if(!J.ok)j0.error(`This isn't a valid Bunext project (missing: ${J.missing}).`),process.exit(1);console.clear(),TX(D$.default.bgCyan(D$.default.black(" bunextupgrade ")));let Z=H6();Z.start("Cloning latest Bunext template");try{await p3("git",["clone","--depth","1",mU,v$],{cwd:$}),Z.stop("Template cloned")}catch(E){Z.stop("Failed to clone");let k=E instanceof Error?E.message:String(E);j0.error(k.includes("already exists")?`Directory "${v$}" already exists. Remove it and try again.`:k),process.exit(1)}let X=A0($,v$);Z.start("Cleaning template");let q=A0(X,".git");if(b0(q))a0(q,{recursive:!0,force:!0});for(let E of pU){let k=A0(X,E);if(b0(k))a0(k,{recursive:!0,force:!0})}let Y="my-app";try{let E=A0($,"package.json");if(b0(E)){let k=JSON.parse(S$(E,"utf-8"));if(typeof k.name==="string")Y=k.name}}catch{}let Q=yU($),G=await RX({message:"Project name for README / repo link",options:[{value:"current",label:`Use current directory name (${Q})`},{value:"custom",label:"Enter a custom name"}],initialValue:"current"});if(J$(G))G6("Operation cancelled"),process.exit(0);if(G==="current")Y=Q;else{let E=await LX({message:"Package / project name",initialValue:Y,validate:(k)=>{if(!k?.trim())return"Name is required";return}});if(J$(E))G6("Operation cancelled"),process.exit(0);Y=E.trim()}rU(X,Y),Z.stop("Template cleaned");let H=A0($,"public"),K=A0(X,"public"),U=A0($,"src/lib/data/siteData.ts"),B=A0(X,"src/lib/data/siteData.ts"),W=S$(U,"utf-8"),_=eU(W),R=$W(W);Z.start("Preserving your public assets and site data"),R1(K,{recursive:!0});let L=z$(H,{withFileTypes:!0});for(let E of L){if(E.name.startsWith(lU))continue;let k=L0(H,E.name),n=L0(K,E.name);if(E.isDirectory())R1(n,{recursive:!0}),k$(k,n,!1);else R1(k6(n),{recursive:!0}),H$(k,n)}let x=_?L0(H,_.replace(/^\//,"")):null;if(x&&b0(x)){if(H$(x,L0(K,_.replace(/^\//,""))),_!=="/favicon.svg"){let E=L0(K,nU);if(b0(E))a0(E,{force:!0})}}let j=R?L0(H,R.replace(/^\//,"")):null;if(j&&b0(j)){if(H$(j,L0(K,R.replace(/^\//,""))),R!=="/ogImage.jpg"){let E=L0(K,iU);if(b0(E))a0(E,{force:!0})}}let D=IQ(W);if(D&&b0(B)){let E=S$(B,"utf-8"),k=IQ(E);if(k){let n=E.slice(0,k.start)+D.block+E.slice(k.end);OQ(B,n)}}Z.stop("Preserved public assets and site data"),Z.start("Creating backup"),JW($),Z.stop("Backup created"),Z.start("Replacing project with upgraded files");try{let E=z$($,{withFileTypes:!0});for(let k of E){if(k.name===".git"||k.name===v$||k.name===f$)continue;let n=L0($,k.name);a0(n,{recursive:!0,force:!0})}k$(X,$,!1),a0(X,{recursive:!0,force:!0})}catch(E){Z.stop("Replace failed");let k=E instanceof Error?E.message:String(E);j0.error(k),await f6($,"error"),process.exit(1)}Z.stop("Upgrade complete");let p=oU();Z.start(`Installing dependencies (${p})`);try{await p3(p,["install"],{cwd:$}),Z.stop("Dependencies installed")}catch(E){Z.stop("Install failed");let k=E instanceof Error?E.message:String(E);j0.error(k),await f6($,"error"),process.exit(1)}let P=await f6($,"success");MX(P?D$.default.yellow("Upgrade reverted. Your project is back to its previous state."):D$.default.green("Project upgraded successfully."))}XW().catch(($)=>{j0.error($ instanceof Error?$.message:String($)),process.exit(1)});
|
|
146
|
+
`;class rX{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(G2(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=V1(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 U=this.usage.getDescriptions(),_=(Y=(q=this===null||this===void 0?void 0:this.aliases)===null||q===void 0?void 0:q[$])===null||Y===void 0?void 0:Y.find((P)=>{let I=U[P];return typeof I==="string"&&I.length>0}),T=_?U[_]:void 0,L=(G=(Q=U[$])!==null&&Q!==void 0?Q:T)!==null&&G!==void 0?G:"";H=`${$.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let K=(U)=>/^--/.test(U),W=(U)=>/^[^0-9]$/.test(U),B=!K(Z)&&W($)?"-":"--";if(J.push(B+H),X)J.push(B+"no-"+H)}customCompletion($,J,Z,X){if(P0(this.customCompletionFunction,null,this.shim),bW(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(yW(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?aX:tX,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 sX($,J,Z,X){return new rX($,J,Z,X)}function bW($){return $.length<3}function yW($){return $.length>3}function eX($,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 $Q=["$0","--","_"];function JQ($,J,Z){let X=Z.y18n.__,q=Z.y18n.__n,Y={};Y.nonOptionCount=function(B){let U=$.getDemandedCommands(),T=B._.length+(B["--"]?B["--"].length:0)-$.getInternalMethods().getContext().commands.length;if(U._&&(T<U._.min||T>U._.max)){if(T<U._.min)if(U._.minMsg!==void 0)J.fail(U._.minMsg?U._.minMsg.replace(/\$0/g,T.toString()).replace(/\$1/,U._.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",T,T.toString(),U._.min.toString()));else if(T>U._.max)if(U._.maxMsg!==void 0)J.fail(U._.maxMsg?U._.maxMsg.replace(/\$0/g,T.toString()).replace(/\$1/,U._.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",T,T.toString(),U._.max.toString()))}},Y.positionalCount=function(B,U){if(U<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",U,U+"",B+""))},Y.requiredArguments=function(B,U){let _=null;for(let T of Object.keys(U))if(!Object.prototype.hasOwnProperty.call(B,T)||typeof B[T]>"u")_=_||{},_[T]=U[T];if(_){let T=[];for(let P of Object.keys(_)){let I=_[P];if(I&&T.indexOf(I)<0)T.push(I)}let L=T.length?`
|
|
147
|
+
${T.join(`
|
|
148
|
+
`)}`:"";J.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(_).length,Object.keys(_).join(", ")+L))}},Y.unknownArguments=function(B,U,_,T,L=!0){var P;let I=$.getInternalMethods().getCommandInstance().getCommands(),D=[],m=$.getInternalMethods().getContext();if(Object.keys(B).forEach((O)=>{if(!$Q.includes(O)&&!Object.prototype.hasOwnProperty.call(_,O)&&!Object.prototype.hasOwnProperty.call($.getInternalMethods().getParseContext(),O)&&!Y.isValidAndSomeAliasIsNotNew(O,U))D.push(O)}),L&&(m.commands.length>0||I.length>0||T))B._.slice(m.commands.length).forEach((O)=>{if(!I.includes(""+O))D.push(""+O)});if(L){let l=((P=$.getDemandedCommands()._)===null||P===void 0?void 0:P.max)||0,n=m.commands.length+l;if(n<B._.length)B._.slice(n).forEach((o)=>{if(o=String(o),!m.commands.includes(o)&&!D.includes(o))D.push(o)})}if(D.length)J.fail(q("Unknown argument: %s","Unknown arguments: %s",D.length,D.map((O)=>O.trim()?O:`"${O}"`).join(", ")))},Y.unknownCommands=function(B){let U=$.getInternalMethods().getCommandInstance().getCommands(),_=[],T=$.getInternalMethods().getContext();if(T.commands.length>0||U.length>0)B._.slice(T.commands.length).forEach((L)=>{if(!U.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,U){if(!Object.prototype.hasOwnProperty.call(U,B))return!1;let _=$.parsed.newAliases;return[B,...U[B]].some((T)=>!Object.prototype.hasOwnProperty.call(_,T)||!_[B])},Y.limitedChoices=function(B){let U=$.getOptions(),_={};if(!Object.keys(U.choices).length)return;Object.keys(B).forEach((P)=>{if($Q.indexOf(P)===-1&&Object.prototype.hasOwnProperty.call(U.choices,P))[].concat(B[P]).forEach((I)=>{if(U.choices[P].indexOf(I)===-1&&I!==void 0)_[P]=(_[P]||[]).concat(I)})});let T=Object.keys(_);if(!T.length)return;let L=X("Invalid values:");T.forEach((P)=>{L+=`
|
|
149
|
+
${X("Argument: %s, Given: %s, Choices: %s",P,J.stringifiedValues(_[P]),J.stringifiedValues(U.choices[P]))}`}),J.fail(L)};let Q={};Y.implies=function(B,U){if(N("<string|object> [array|number|string]",[B,U],arguments.length),typeof B==="object")Object.keys(B).forEach((_)=>{Y.implies(_,B[_])});else{if($.global(B),!Q[B])Q[B]=[];if(Array.isArray(U))U.forEach((_)=>Y.implies(B,_));else P0(U,void 0,Z),Q[B].push(U)}},Y.getImplied=function(){return Q};function G(W,B){let U=Number(B);if(B=isNaN(U)?B:U,typeof B==="number")B=W._.length>=B;else if(B.match(/^--no-.+/))B=B.match(/^--no-(.+)/)[1],B=!Object.prototype.hasOwnProperty.call(W,B);else B=Object.prototype.hasOwnProperty.call(W,B);return B}Y.implications=function(B){let U=[];if(Object.keys(Q).forEach((_)=>{let T=_;(Q[_]||[]).forEach((L)=>{let P=T,I=L;if(P=G(B,P),L=G(B,L),P&&!L)U.push(` ${T} -> ${I}`)})}),U.length){let _=`${X("Implications failed:")}
|
|
150
|
+
`;U.forEach((T)=>{_+=T}),J.fail(_)}};let H={};Y.conflicts=function(B,U){if(N("<string|object> [array|string]",[B,U],arguments.length),typeof B==="object")Object.keys(B).forEach((_)=>{Y.conflicts(_,B[_])});else{if($.global(B),!H[B])H[B]=[];if(Array.isArray(U))U.forEach((_)=>Y.conflicts(B,_));else H[B].push(U)}},Y.getConflicting=()=>H,Y.conflicting=function(B){if(Object.keys(B).forEach((U)=>{if(H[U])H[U].forEach((_)=>{if(_&&B[U]!==void 0&&B[_]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",U,_))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((U)=>{H[U].forEach((_)=>{if(_&&B[Z.Parser.camelCase(U)]!==void 0&&B[Z.Parser.camelCase(_)]!==void 0)J.fail(X("Arguments %s and %s are mutually exclusive",U,_))})})},Y.recommendCommands=function(B,U){U=U.sort((P,I)=>I.length-P.length);let T=null,L=1/0;for(let P=0,I;(I=U[P])!==void 0;P++){let D=eX(B,I);if(D<=3&&D<L)L=D,T=I}if(T)J.fail(X("Did you mean %s?",T))},Y.reset=function(B){return Q=L1(Q,(U)=>!B[U]),H=L1(H,(U)=>!B[U]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let B=K.pop();P0(B,void 0,Z),{implied:Q,conflicting:H}=B},Y}var E6=[],D$;function v$($,J,Z,X){D$=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=M0.resolve($.extends)}catch(G){return $}else Q=uW(J,$.extends);gW(Q),E6.push(Q),q=Y?JSON.parse(D$.readFileSync(Q,"utf8")):M0($.extends),delete $.extends,q=v$(q,D$.path.dirname(Q),Z,D$)}return E6=[],Z?ZQ(q,$):Object.assign({},q,$)}function gW($){if(E6.indexOf($)>-1)throw new s(`Circular extended configurations: '${$}'.`)}function uW($,J){return D$.path.resolve($,J)}function ZQ($,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]=ZQ($[q],J[q]);else Z[q]=J[q];return Z}var h=function($,J,Z,X,q){if(X==="m")throw TypeError("Private method is not writable");if(X==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof J==="function"?$!==J||!q:!J.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?q.call($,Z):q?q.value=Z:J.set($,Z),Z},z=function($,J,Z,X){if(Z==="a"&&!X)throw TypeError("Private accessor was defined without a getter");if(typeof J==="function"?$!==J||!X:!J.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?X:Z==="a"?X.call($):X?X.value:J.get($)},Y0,D1,S$,S0,E0,z2,R1,v1,K2,f0,B2,k0,a0,A0,b0,W2,H$,V0,S,U2,V2,N0,S1,z$,f1,T1,L2,y,k1,b1,y1,u,_2,r0,Z0;function jQ($){return(J=[],Z=$.process.cwd(),X)=>{let q=new xQ(J,Z,X,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var XQ=Symbol("copyDoubleDash"),QQ=Symbol("copyDoubleDash"),A6=Symbol("deleteFromParserHintObject"),qQ=Symbol("emitWarning"),YQ=Symbol("freeze"),GQ=Symbol("getDollarZero"),g1=Symbol("getParserConfiguration"),HQ=Symbol("getUsageConfiguration"),N6=Symbol("guessLocale"),zQ=Symbol("guessVersion"),KQ=Symbol("parsePositionalNumbers"),h6=Symbol("pkgUp"),M1=Symbol("populateParserHintArray"),K$=Symbol("populateParserHintSingleValueDictionary"),D6=Symbol("populateParserHintArrayDictionary"),v6=Symbol("populateParserHintDictionary"),S6=Symbol("sanitizeKey"),f6=Symbol("setKey"),k6=Symbol("unfreeze"),BQ=Symbol("validateAsync"),WQ=Symbol("getCommandInstance"),UQ=Symbol("getContext"),VQ=Symbol("getHasOutput"),LQ=Symbol("getLoggerInstance"),_Q=Symbol("getParseContext"),RQ=Symbol("getUsageInstance"),TQ=Symbol("getValidationInstance"),R2=Symbol("hasParseCallback"),MQ=Symbol("isGlobalContext"),u1=Symbol("postProcess"),CQ=Symbol("rebase"),b6=Symbol("reset"),f$=Symbol("runYargsParserAndExecuteCommands"),y6=Symbol("runValidation"),FQ=Symbol("setHasOutput"),m1=Symbol("kTrackManuallySetKeys");class xQ{constructor($=[],J,Z,X){this.customScriptName=!1,this.parsed=!1,Y0.set(this,void 0),D1.set(this,void 0),S$.set(this,{commands:[],fullCommands:[]}),S0.set(this,null),E0.set(this,null),z2.set(this,"show-hidden"),R1.set(this,null),v1.set(this,!0),K2.set(this,{}),f0.set(this,!0),B2.set(this,[]),k0.set(this,void 0),a0.set(this,{}),A0.set(this,!1),b0.set(this,null),W2.set(this,!0),H$.set(this,void 0),V0.set(this,""),S.set(this,void 0),U2.set(this,void 0),V2.set(this,{}),N0.set(this,null),S1.set(this,null),z$.set(this,{}),f1.set(this,{}),T1.set(this,void 0),L2.set(this,!1),y.set(this,void 0),k1.set(this,!1),b1.set(this,!1),y1.set(this,!1),u.set(this,void 0),_2.set(this,{}),r0.set(this,null),Z0.set(this,void 0),h(this,y,X,"f"),h(this,T1,$,"f"),h(this,D1,J,"f"),h(this,U2,Z,"f"),h(this,k0,new I6(this),"f"),this.$0=this[GQ](),this[b6](),h(this,Y0,z(this,Y0,"f"),"f"),h(this,u,z(this,u,"f"),"f"),h(this,Z0,z(this,Z0,"f"),"f"),h(this,S,z(this,S,"f"),"f"),z(this,S,"f").showHiddenOpt=z(this,z2,"f"),h(this,H$,this[QQ](),"f")}addHelpOpt($,J){if(N("[string|boolean] [string]",[$,J],arguments.length),z(this,b0,"f"))this[A6](z(this,b0,"f")),h(this,b0,null,"f");if($===!1&&J===void 0)return this;return h(this,b0,typeof $==="string"?$:"help","f"),this.boolean(z(this,b0,"f")),this.describe(z(this,b0,"f"),J||z(this,u,"f").deferY18nLookup("Show help")),this}help($,J){return this.addHelpOpt($,J)}addShowHiddenOpt($,J){if(N("[string|boolean] [string]",[$,J],arguments.length),$===!1&&J===void 0)return this;let Z=typeof $==="string"?$:z(this,z2,"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 N("<object|string|array> [string|array]",[$,J],arguments.length),this[D6](this.alias.bind(this),"alias",$,J),this}array($){return N("<array|string>",[$],arguments.length),this[M1]("array",$),this[m1]($),this}boolean($){return N("<array|string>",[$],arguments.length),this[M1]("boolean",$),this[m1]($),this}check($,J){return N("<function> [boolean]",[$,J],arguments.length),this.middleware((Z,X)=>{return h1(()=>{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 N("<object|string|array> [string|array]",[$,J],arguments.length),this[D6](this.choices.bind(this),"choices",$,J),this}coerce($,J){if(N("<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,k0,"f").addCoerceMiddleware((Z,X)=>{let q;if(!Object.prototype.hasOwnProperty.call(Z,$))return Z;return h1(()=>{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 N("<string|object> [string|array]",[$,J],arguments.length),z(this,Z0,"f").conflicts($,J),this}config($="config",J,Z){if(N("[object|string] [string|function] [function]",[$,J,Z],arguments.length),typeof $==="object"&&!Array.isArray($))return $=v$($,z(this,D1,"f"),this[g1]()["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(N("[string] [string|boolean|function] [function]",[$,J,Z],arguments.length),typeof J==="function")Z=J,J=void 0;if(h(this,E0,$||z(this,E0,"f")||"completion","f"),!J&&J!==!1)J="generate completion script";if(this.command(z(this,E0,"f"),J),Z)z(this,S0,"f").registerFunction(Z);return this}command($,J,Z,X,q,Y){return N("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,J,Z,X,q,Y],arguments.length),z(this,Y0,"f").addHandler($,J,Z,X,q,Y),this}commands($,J,Z,X,q,Y){return this.command($,J,Z,X,q,Y)}commandDir($,J){N("<string> [object]",[$,J],arguments.length);let Z=z(this,U2,"f")||z(this,y,"f").require;return z(this,Y0,"f").addDirectory($,Z,z(this,y,"f").getCallerFile(),J),this}count($){return N("<array|string>",[$],arguments.length),this[M1]("count",$),this[m1]($),this}default($,J,Z){if(N("<object|string|array> [*] [string]",[$,J,Z],arguments.length),Z)P6($,z(this,y,"f")),z(this,S,"f").defaultDescription[$]=Z;if(typeof J==="function"){if(P6($,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[K$](this.default.bind(this),"default",$,J),this}defaults($,J,Z){return this.default($,J,Z)}demandCommand($=1,J,Z,X){if(N("[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)=>{P0(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")P0(Z,!0,z(this,y,"f")),this.demandCommand($,J,Z,Z);else if(Array.isArray($))$.forEach((X)=>{P0(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 N("<object|string|array> [string]",[$,J],arguments.length),this[K$](this.demandOption.bind(this),"demandedOptions",$,J),this}deprecateOption($,J){return N("<string> [string|boolean]",[$,J],arguments.length),z(this,S,"f").deprecatedOptions[$]=J,this}describe($,J){return N("<object|string|array> [string]",[$,J],arguments.length),this[f6]($,!0),z(this,u,"f").describe($,J),this}detectLocale($){return N("<boolean>",[$],arguments.length),h(this,v1,$,"f"),this}env($){if(N("[string|boolean]",[$],arguments.length),$===!1)delete z(this,S,"f").envPrefix;else z(this,S,"f").envPrefix=$||"";return this}epilogue($){return N("<string>",[$],arguments.length),z(this,u,"f").epilog($),this}epilog($){return this.epilogue($)}example($,J){if(N("<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,A0,!0,"f"),h(this,R1,J,"f"),z(this,f0,"f"))z(this,y,"f").process.exit($)}exitProcess($=!0){return N("[boolean]",[$],arguments.length),h(this,f0,$,"f"),this}fail($){if(N("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new s("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(N("<array> [function]",[$,J],arguments.length),!J)return new Promise((Z,X)=>{z(this,S0,"f").getCompletion($,(q,Y)=>{if(q)X(q);else Z(Y)})});else return z(this,S0,"f").getCompletion($,J)}getDemandedOptions(){return N([],0),z(this,S,"f").demandedOptions}getDemandedCommands(){return N([],0),z(this,S,"f").demandedCommands}getDeprecatedOptions(){return N([],0),z(this,S,"f").deprecatedOptions}getDetectLocale(){return z(this,v1,"f")}getExitProcess(){return z(this,f0,"f")}getGroups(){return Object.assign({},z(this,a0,"f"),z(this,f1,"f"))}getHelp(){if(h(this,A0,!0,"f"),!z(this,u,"f").hasCachedHelpMessage()){if(!this.parsed){let J=this[f$](z(this,T1,"f"),void 0,void 0,0,!0);if(e(J))return J.then(()=>{return z(this,u,"f").help()})}let $=z(this,Y0,"f").runDefaultBuilderOn(this);if(e($))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,k1,"f")}getStrictCommands(){return z(this,b1,"f")}getStrictOptions(){return z(this,y1,"f")}global($,J){if(N("<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){N("<string|array> <string>",[$,J],arguments.length);let Z=z(this,f1,"f")[J]||z(this,a0,"f")[J];if(z(this,f1,"f")[J])delete z(this,f1,"f")[J];let X={};return z(this,a0,"f")[J]=(Z||[]).concat($).filter((q)=>{if(X[q])return!1;return X[q]=!0}),this}hide($){return N("<string>",[$],arguments.length),z(this,S,"f").hiddenOptions.push($),this}implies($,J){return N("<string|object> [number|string|array]",[$,J],arguments.length),z(this,Z0,"f").implies($,J),this}locale($){if(N("[string]",[$],arguments.length),$===void 0)return this[N6](),z(this,y,"f").y18n.getLocale();return h(this,v1,!1,"f"),z(this,y,"f").y18n.setLocale($),this}middleware($,J,Z){return z(this,k0,"f").addMiddleware($,!!J,Z)}nargs($,J){return N("<string|object|array> [number]",[$,J],arguments.length),this[K$](this.nargs.bind(this),"narg",$,J),this}normalize($){return N("<array|string>",[$],arguments.length),this[M1]("normalize",$),this}number($){return N("<array|string>",[$],arguments.length),this[M1]("number",$),this[m1]($),this}option($,J){if(N("<string|object> [object]",[$,J],arguments.length),typeof $==="object")Object.keys($).forEach((Z)=>{this.options(Z,$[Z])});else{if(typeof J!=="object")J={};if(this[m1]($),z(this,r0,"f")&&($==="version"||(J===null||J===void 0?void 0:J.alias)==="version"))this[qQ](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
151
|
+
`),void 0,"versionWarning");if(z(this,S,"f").key[$]=!0,J.alias)this.alias($,J.alias);let Z=J.deprecate||J.deprecated;if(Z)this.deprecateOption($,Z);let X=J.demand||J.required||J.require;if(X)this.demand($,X);if(J.demandOption)this.demandOption($,typeof J.demandOption==="string"?J.demandOption:void 0);if(J.conflicts)this.conflicts($,J.conflicts);if("default"in J)this.default($,J.default);if(J.implies!==void 0)this.implies($,J.implies);if(J.nargs!==void 0)this.nargs($,J.nargs);if(J.config)this.config($,J.configParser);if(J.normalize)this.normalize($);if(J.choices)this.choices($,J.choices);if(J.coerce)this.coerce($,J.coerce);if(J.group)this.group($,J.group);if(J.boolean||J.type==="boolean"){if(this.boolean($),J.alias)this.boolean(J.alias)}if(J.array||J.type==="array"){if(this.array($),J.alias)this.array(J.alias)}if(J.number||J.type==="number"){if(this.number($),J.alias)this.number(J.alias)}if(J.string||J.type==="string"){if(this.string($),J.alias)this.string(J.alias)}if(J.count||J.type==="count")this.count($);if(typeof J.global==="boolean")this.global($,J.global);if(J.defaultDescription)z(this,S,"f").defaultDescription[$]=J.defaultDescription;if(J.skipValidation)this.skipValidation($);let q=J.describe||J.description||J.desc,Y=z(this,u,"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(N("[string|array] [function|boolean|object] [function]",[$,J,Z],arguments.length),this[YQ](),typeof $>"u")$=z(this,T1,"f");if(typeof J==="object")h(this,S1,J,"f"),J=Z;if(typeof J==="function")h(this,N0,J,"f"),J=!1;if(!J)h(this,T1,$,"f");if(z(this,N0,"f"))h(this,f0,!1,"f");let X=this[f$]($,!!J),q=this.parsed;if(z(this,S0,"f").setParsed(this.parsed),e(X))return X.then((Y)=>{if(z(this,N0,"f"))z(this,N0,"f").call(this,z(this,R1,"f"),Y,z(this,V0,"f"));return Y}).catch((Y)=>{if(z(this,N0,"f"))z(this,N0,"f")(Y,this.parsed.argv,z(this,V0,"f"));throw Y}).finally(()=>{this[k6](),this.parsed=q});else{if(z(this,N0,"f"))z(this,N0,"f").call(this,z(this,R1,"f"),X,z(this,V0,"f"));this[k6](),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 N("<object>",[$],arguments.length),h(this,V2,$,"f"),this}pkgConf($,J){N("<string> [string]",[$,J],arguments.length);let Z=null,X=this[h6](J||z(this,D1,"f"));if(X[$]&&typeof X[$]==="object")Z=v$(X[$],J||z(this,D1,"f"),this[g1]()["deep-merge-config"]||!1,z(this,y,"f")),z(this,S,"f").configObjects=(z(this,S,"f").configObjects||[]).concat(Z);return this}positional($,J){N("<string> <object>",[$,J],arguments.length);let Z=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];J=L1(J,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return Z.includes(Y)});let X=z(this,S$,"f").fullCommands[z(this,S$,"f").fullCommands.length-1],q=X?z(this,Y0,"f").cmdToParseOptions(X):{array:[],alias:{},default:{},demand:{}};return Y$(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,u,"f").getPositionalGroupName()),this.option($,J)}recommendCommands($=!0){return N("[boolean]",[$],arguments.length),h(this,L2,$,"f"),this}required($,J,Z){return this.demand($,J,Z)}require($,J,Z){return this.demand($,J,Z)}requiresArg($){if(N("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,S,"f").narg[$])return this;else this[K$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,J){return N("[string] [string]",[$,J],arguments.length),$=$||this.$0,z(this,H$,"f").log(z(this,S0,"f").generateCompletionScript($,J||z(this,E0,"f")||"completion")),this}showHelp($){if(N("[string|function]",[$],arguments.length),h(this,A0,!0,"f"),!z(this,u,"f").hasCachedHelpMessage()){if(!this.parsed){let Z=this[f$](z(this,T1,"f"),void 0,void 0,0,!0);if(e(Z))return Z.then(()=>{z(this,u,"f").showHelp($)}),this}let J=z(this,Y0,"f").runDefaultBuilderOn(this);if(e(J))return J.then(()=>{z(this,u,"f").showHelp($)}),this}return z(this,u,"f").showHelp($),this}scriptName($){return this.customScriptName=!0,this.$0=$,this}showHelpOnFail($,J){return N("[boolean|string] [string]",[$,J],arguments.length),z(this,u,"f").showHelpOnFail($,J),this}showVersion($){return N("[string|function]",[$],arguments.length),z(this,u,"f").showVersion($),this}skipValidation($){return N("<array|string>",[$],arguments.length),this[M1]("skipValidation",$),this}strict($){return N("[boolean]",[$],arguments.length),h(this,k1,$!==!1,"f"),this}strictCommands($){return N("[boolean]",[$],arguments.length),h(this,b1,$!==!1,"f"),this}strictOptions($){return N("[boolean]",[$],arguments.length),h(this,y1,$!==!1,"f"),this}string($){return N("<array|string>",[$],arguments.length),this[M1]("string",$),this[m1]($),this}terminalWidth(){return N([],0),z(this,y,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return N("<object>",[$],arguments.length),h(this,v1,!1,"f"),z(this,y,"f").y18n.updateLocale($),this}usage($,J,Z,X){if(N("<string|null|undefined> [string|boolean] [function|object] [function]",[$,J,Z,X],arguments.length),J!==void 0)if(P0($,null,z(this,y,"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,u,"f").usage($),this}usageConfiguration($){return N("<object>",[$],arguments.length),h(this,_2,$,"f"),this}version($,J,Z){if(N("[boolean|string] [string] [string]",[$,J,Z],arguments.length),z(this,r0,"f"))this[A6](z(this,r0,"f")),z(this,u,"f").version(void 0),h(this,r0,null,"f");if(arguments.length===0)Z=this[zQ](),$="version";else if(arguments.length===1){if($===!1)return this;Z=$,$="version"}else if(arguments.length===2)Z=J,J=void 0;return h(this,r0,typeof $==="string"?$:"version","f"),J=J||z(this,u,"f").deferY18nLookup("Show version number"),z(this,u,"f").version(Z||void 0),this.boolean(z(this,r0,"f")),this.describe(z(this,r0,"f"),J),this}wrap($){return N("<number|null|undefined>",[$],arguments.length),z(this,u,"f").wrap($),this}[(Y0=new WeakMap,D1=new WeakMap,S$=new WeakMap,S0=new WeakMap,E0=new WeakMap,z2=new WeakMap,R1=new WeakMap,v1=new WeakMap,K2=new WeakMap,f0=new WeakMap,B2=new WeakMap,k0=new WeakMap,a0=new WeakMap,A0=new WeakMap,b0=new WeakMap,W2=new WeakMap,H$=new WeakMap,V0=new WeakMap,S=new WeakMap,U2=new WeakMap,V2=new WeakMap,N0=new WeakMap,S1=new WeakMap,z$=new WeakMap,f1=new WeakMap,T1=new WeakMap,L2=new WeakMap,y=new WeakMap,k1=new WeakMap,b1=new WeakMap,y1=new WeakMap,u=new WeakMap,_2=new WeakMap,r0=new WeakMap,Z0=new WeakMap,XQ)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(J){}return $}[QQ](){return{log:(...$)=>{if(!this[R2]())console.log(...$);if(h(this,A0,!0,"f"),z(this,V0,"f").length)h(this,V0,z(this,V0,"f")+`
|
|
152
|
+
`,"f");h(this,V0,z(this,V0,"f")+$.join(" "),"f")},error:(...$)=>{if(!this[R2]())console.error(...$);if(h(this,A0,!0,"f"),z(this,V0,"f").length)h(this,V0,z(this,V0,"f")+`
|
|
153
|
+
`,"f");h(this,V0,z(this,V0,"f")+$.join(" "),"f")}}}[A6]($){Y$(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()[$]}[qQ]($,J,Z){if(!z(this,K2,"f")[Z])z(this,y,"f").process.emitWarning($,J),z(this,K2,"f")[Z]=!0}[YQ](){z(this,B2,"f").push({options:z(this,S,"f"),configObjects:z(this,S,"f").configObjects.slice(0),exitProcess:z(this,f0,"f"),groups:z(this,a0,"f"),strict:z(this,k1,"f"),strictCommands:z(this,b1,"f"),strictOptions:z(this,y1,"f"),completionCommand:z(this,E0,"f"),output:z(this,V0,"f"),exitError:z(this,R1,"f"),hasOutput:z(this,A0,"f"),parsed:this.parsed,parseFn:z(this,N0,"f"),parseContext:z(this,S1,"f")}),z(this,u,"f").freeze(),z(this,Z0,"f").freeze(),z(this,Y0,"f").freeze(),z(this,k0,"f").freeze()}[GQ](){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[CQ](z(this,D1,"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 $}[g1](){return z(this,V2,"f")}[HQ](){return z(this,_2,"f")}[N6](){if(!z(this,v1,"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(/[.:].*/,""))}[zQ](){return this[h6]().version||"unknown"}[KQ]($){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 $}[h6]($){let J=$||"*";if(z(this,z$,"f")[J])return z(this,z$,"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});P0(q,void 0,z(this,y,"f")),Z=JSON.parse(z(this,y,"f").readFileSync(q,"utf8"))}catch(X){}return z(this,z$,"f")[J]=Z||{},z(this,z$,"f")[J]}[M1]($,J){J=[].concat(J),J.forEach((Z)=>{Z=this[S6](Z),z(this,S,"f")[$].push(Z)})}[K$]($,J,Z,X){this[v6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=Q})}[D6]($,J,Z,X){this[v6]($,J,Z,X,(q,Y,Q)=>{z(this,S,"f")[q][Y]=(z(this,S,"f")[q][Y]||[]).concat(Q)})}[v6]($,J,Z,X,q){if(Array.isArray(Z))Z.forEach((Y)=>{$(Y,X)});else if(((Y)=>typeof Y==="object")(Z))for(let Y of Y$(Z))$(Y,Z[Y]);else q(J,this[S6](Z),X)}[S6]($){if($==="__proto__")return"___proto___";return $}[f6]($,J){return this[K$](this[f6].bind(this),"key",$,J),this}[k6](){var $,J,Z,X,q,Y,Q,G,H,K,W,B;let U=z(this,B2,"f").pop();P0(U,void 0,z(this,y,"f"));let _;$=this,J=this,Z=this,X=this,q=this,Y=this,Q=this,G=this,H=this,K=this,W=this,B=this,{options:{set value(T){h($,S,T,"f")}}.value,configObjects:_,exitProcess:{set value(T){h(J,f0,T,"f")}}.value,groups:{set value(T){h(Z,a0,T,"f")}}.value,output:{set value(T){h(X,V0,T,"f")}}.value,exitError:{set value(T){h(q,R1,T,"f")}}.value,hasOutput:{set value(T){h(Y,A0,T,"f")}}.value,parsed:this.parsed,strict:{set value(T){h(Q,k1,T,"f")}}.value,strictCommands:{set value(T){h(G,b1,T,"f")}}.value,strictOptions:{set value(T){h(H,y1,T,"f")}}.value,completionCommand:{set value(T){h(K,E0,T,"f")}}.value,parseFn:{set value(T){h(W,N0,T,"f")}}.value,parseContext:{set value(T){h(B,S1,T,"f")}}.value}=U,z(this,S,"f").configObjects=_,z(this,u,"f").unfreeze(),z(this,Z0,"f").unfreeze(),z(this,Y0,"f").unfreeze(),z(this,k0,"f").unfreeze()}[BQ]($,J){return h1(J,(Z)=>{return $(Z),Z})}getInternalMethods(){return{getCommandInstance:this[WQ].bind(this),getContext:this[UQ].bind(this),getHasOutput:this[VQ].bind(this),getLoggerInstance:this[LQ].bind(this),getParseContext:this[_Q].bind(this),getParserConfiguration:this[g1].bind(this),getUsageConfiguration:this[HQ].bind(this),getUsageInstance:this[RQ].bind(this),getValidationInstance:this[TQ].bind(this),hasParseCallback:this[R2].bind(this),isGlobalContext:this[MQ].bind(this),postProcess:this[u1].bind(this),reset:this[b6].bind(this),runValidation:this[y6].bind(this),runYargsParserAndExecuteCommands:this[f$].bind(this),setHasOutput:this[FQ].bind(this)}}[WQ](){return z(this,Y0,"f")}[UQ](){return z(this,S$,"f")}[VQ](){return z(this,A0,"f")}[LQ](){return z(this,H$,"f")}[_Q](){return z(this,S1,"f")||{}}[RQ](){return z(this,u,"f")}[TQ](){return z(this,Z0,"f")}[R2](){return!!z(this,N0,"f")}[MQ](){return z(this,W2,"f")}[u1]($,J,Z,X){if(Z)return $;if(e($))return $;if(!J)$=this[XQ]($);if(this[g1]()["parse-positional-numbers"]||this[g1]()["parse-positional-numbers"]===void 0)$=this[KQ]($);if(X)$=N1($,this,z(this,k0,"f").getMiddleware(),!1);return $}[b6]($={}){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,f1,"f"),Object.keys(z(this,a0,"f")).reduce((Y,Q)=>{let G=z(this,a0,"f")[Q].filter((H)=>!(H in Z));if(G.length>0)Y[Q]=G;return Y},{})),h(this,a0,{},"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]=L1(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):oX(this,z(this,y,"f")),"f"),h(this,Z0,z(this,Z0,"f")?z(this,Z0,"f").reset(Z):JQ(this,z(this,u,"f"),z(this,y,"f")),"f"),h(this,Y0,z(this,Y0,"f")?z(this,Y0,"f").reset():lX(z(this,u,"f"),z(this,Z0,"f"),z(this,k0,"f"),z(this,y,"f")),"f"),!z(this,S0,"f"))h(this,S0,sX(this,z(this,u,"f"),z(this,Y0,"f"),z(this,y,"f")),"f");return z(this,k0,"f").reset(),h(this,E0,null,"f"),h(this,V0,"","f"),h(this,R1,null,"f"),h(this,A0,!1,"f"),this.parsed=!1,this}[CQ]($,J){return z(this,y,"f").path.relative($,J)}[f$]($,J,Z,X=0,q=!1){let Y=!!Z||q;$=$||z(this,T1,"f"),z(this,S,"f").__=z(this,y,"f").y18n.__,z(this,S,"f").configuration=this[g1]();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,S1,"f")),W=void 0,B=H.aliases,U=!1,_=!1;if(Object.keys(K).forEach((T)=>{if(T===z(this,b0,"f")&&K[T])U=!0;else if(T===z(this,r0,"f")&&K[T])_=!0}),K.$0=this.$0,this.parsed=H,X===0)z(this,u,"f").clearCachedHelpMessage();try{if(this[N6](),J)return this[u1](K,Q,!!Z,!1);if(z(this,b0,"f")){if([z(this,b0,"f")].concat(B[z(this,b0,"f")]||[]).filter((D)=>D.length>1).includes(""+K._[K._.length-1]))K._.pop(),U=!0}h(this,W2,!1,"f");let T=z(this,Y0,"f").getCommands(),L=z(this,S0,"f").completionKey in K,P=U||L||q;if(K._.length){if(T.length){let I;for(let D=X||0,m;K._[D]!==void 0;D++)if(m=String(K._[D]),T.includes(m)&&m!==z(this,E0,"f")){let O=z(this,Y0,"f").runCommand(m,this,H,D+1,q,U||_||q);return this[u1](O,Q,!!Z,!1)}else if(!I&&m!==z(this,E0,"f")){I=m;break}if(!z(this,Y0,"f").hasDefaultCommand()&&z(this,L2,"f")&&I&&!P)z(this,Z0,"f").recommendCommands(I,T)}if(z(this,E0,"f")&&K._.includes(z(this,E0,"f"))&&!L){if(z(this,f0,"f"))_1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,Y0,"f").hasDefaultCommand()&&!P){let I=z(this,Y0,"f").runCommand(null,this,H,0,q,U||_||q);return this[u1](I,Q,!!Z,!1)}if(L){if(z(this,f0,"f"))_1(!0);$=[].concat($);let I=$.slice($.indexOf(`--${z(this,S0,"f").completionKey}`)+1);return z(this,S0,"f").getCompletion(I,(D,m)=>{if(D)throw new s(D.message);(m||[]).forEach((O)=>{z(this,H$,"f").log(O)}),this.exit(0)}),this[u1](K,!Q,!!Z,!1)}if(!z(this,A0,"f")){if(U){if(z(this,f0,"f"))_1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(_){if(z(this,f0,"f"))_1(!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((I)=>z(this,S,"f").skipValidation.indexOf(I)>=0&&K[I]===!0);if(!Y){if(H.error)throw new s(H.error.message);if(!L){let I=this[y6](B,{},H.error);if(!Z)W=N1(K,this,z(this,k0,"f").getMiddleware(),!0);if(W=this[BQ](I,W!==null&&W!==void 0?W:K),e(W)&&!Z)W=W.then(()=>{return N1(K,this,z(this,k0,"f").getMiddleware(),!1)})}}}catch(T){if(T instanceof s)z(this,u,"f").fail(T.message,T);else throw T}return this[u1](W!==null&&W!==void 0?W:K,Q,!!Z,!0)}[y6]($,J,Z,X){let q={...this.getDemandedOptions()};return(Y)=>{if(Z)throw new s(Z.message);z(this,Z0,"f").nonOptionCount(Y),z(this,Z0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,b1,"f"))Q=z(this,Z0,"f").unknownCommands(Y);if(z(this,k1,"f")&&!Q)z(this,Z0,"f").unknownArguments(Y,$,J,!!X);else if(z(this,y1,"f"))z(this,Z0,"f").unknownArguments(Y,$,{},!1,!1);z(this,Z0,"f").limitedChoices(Y),z(this,Z0,"f").implications(Y),z(this,Z0,"f").conflicting(Y)}}[FQ](){h(this,A0,!0,"f")}[m1]($){if(typeof $==="string")z(this,S,"f").key[$]=!0;else for(let J of $)z(this,S,"f").key[J]=!0}}function nX($){return!!$&&typeof $.getInternalMethods==="function"}var mW=jQ(x6),PQ=mW;import{existsSync as _0,readFileSync as Y1,rmSync as p0,writeFileSync as T2,readdirSync as U$,copyFileSync as W$,mkdirSync as C1}from"fs";import{resolve as R0,dirname as g6,join as T0}from"path";import{fileURLToPath as cW}from"url";var pW=PQ(j6(process.argv)).option("h",{alias:"help",type:"boolean"}).version("version","Show version number",AQ()).parseSync(),dW="https://github.com/ardzero/bunext.git",lW="https://github.com/ardzero/",k$=".bunext-upgrade-temp",G1=".bunext-upgrade-backup",nW=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],iW=[".git","public","src/lib/data/siteData.ts"],oW="loading-dots",tW="favicon.svg",EQ="ogImage.jpg";function aW(){if(typeof globalThis.Bun<"u")return"bun";if(process.env.npm_execpath?.includes("bun"))return"bun";if(process.argv[1]?.includes("bunx"))return"bun";if(process.env.npm_execpath?.includes("pnpm"))return"pnpm";if(process.env.npm_execpath?.includes("yarn"))return"yarn";return"npm"}async function rW($){try{let{stdout:J}=await E1("git",["remote","get-url","origin"],{cwd:$});return J?.trim()||null}catch{return null}}function sW($){let Z=$.trim().replace(/\.git$/i,"").split("/").filter(Boolean);return Z[Z.length-1]||"my-app"}function eW($){let J=$.trim().replace(/\.git$/i,"");if(J.startsWith("git@")){let Z=J.match(/^git@([^:]+):(.+)$/);if(Z)return`https://${Z[1]}/${Z[2]}`}return J}function AQ(){try{let $=cW(import.meta.url),J=g6($),Z=T0(J,"../package.json");return JSON.parse(Y1(Z,"utf-8")).version}catch{return"0.1.0"}}function $U($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function JU($,J,Z,X){let q=Z?eW(Z):`${lW}${$U(J)}`,Y=X?X.replace(/^\//,""):EQ,Q=R0($,"project_readme.md"),G=R0($,"README.md");if(!_0(Q))return;let H=Y1(Q,"utf-8");H=H.replace(/\?\{project-name\}/g,J).replace(/\?\{repo-link\}/g,q).replace(/\?\{og-image-path\}/g,Y),T2(G,H),p0(Q,{force:!0})}function ZU($){for(let J of iW){let Z=R0($,J);if(!_0(Z))return{ok:!1,missing:J}}return{ok:!0}}function IQ($){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 XU($){let J=$.match(/favicon:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function OQ($){let J=$.match(/ogImage:\s*\{\s*src:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function b$($,J,Z=!1){let X=U$($,{withFileTypes:!0});for(let q of X){if(Z&&q.name===".git")continue;let Y=T0($,q.name),Q=T0(J,q.name);if(q.isDirectory())C1(Q,{recursive:!0}),b$(Y,Q,!1);else C1(g6(Q),{recursive:!0}),W$(Y,Q)}}function QU($){let J=R0($,G1);if(_0(J))p0(J,{recursive:!0,force:!0});C1(J,{recursive:!0});let Z=U$($,{withFileTypes:!0});for(let X of Z){if(X.name===".git"||X.name===k$||X.name===G1)continue;let q=T0($,X.name),Y=T0(J,X.name);if(X.isDirectory())C1(Y,{recursive:!0}),b$(q,Y,!1);else W$(q,Y)}}function NQ($){let J=R0($,G1);if(!_0(J)){x0.error("No backup found. Cannot undo.");return}let Z=U$($,{withFileTypes:!0});for(let q of Z){if(q.name===".git"||q.name===G1)continue;let Y=T0($,q.name);p0(Y,{recursive:!0,force:!0})}let X=U$(J,{withFileTypes:!0});for(let q of X){let Y=T0(J,q.name),Q=T0($,q.name);if(q.isDirectory())C1(Q,{recursive:!0}),b$(Y,Q,!1);else W$(Y,Q)}p0(J,{recursive:!0,force:!0}),x0.success("Reverted to pre-upgrade state.")}function qU($,J){let Z=R0($,".gitignore"),X=_0(Z)?Y1(Z,"utf-8"):"",q=J.startsWith("/")?J:`/${J}`;if(X.includes(J)||X.includes(q))return;let Y=X.endsWith(`
|
|
154
|
+
`)?"":`
|
|
155
|
+
`;T2(Z,X+Y+J+`
|
|
156
|
+
`)}function YU($,J){let Z=R0($,"tsconfig.json");if(!_0(Z))return;let X=Y1(Z,"utf-8"),q=JSON.parse(X),Y=q.exclude??[];if(Y.includes(J))return;q.exclude=[...Y,J],T2(Z,JSON.stringify(q,null,"\t"))}async function wQ($,J){let X=await Z2({message:J==="error"?"Do you want to undo all changes and restore your project?":"Do you want to undo the upgrade and restore your previous project?",initialValue:!1});if(Q1(X))process.exit(0);if(X){let q=Q2();return q.start("Reverting…"),NQ($),q.stop("Reverted."),!0}return!1}async function GU(){if(pW.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=ZU($);if(!J.ok)x0.error(`This isn't a valid Bunext project (missing: ${J.missing}).`),process.exit(1);console.clear(),MX(B$.default.bgCyan(B$.default.black(" bunextupgrade ")));let Z=Q2();Z.start("Cloning latest Bunext template");try{await E1("git",["clone","--depth","1",dW,k$],{cwd:$}),Z.stop("Template cloned")}catch(C){Z.stop("Failed to clone");let j=C instanceof Error?C.message:String(C);x0.error(j.includes("already exists")?`Directory "${k$}" already exists. Remove it and try again.`:j),process.exit(1)}let X=R0($,k$);Z.start("Cleaning template");let q=R0(X,".git");if(_0(q))p0(q,{recursive:!0,force:!0});for(let C of nW){let j=R0(X,C);if(_0(j))p0(j,{recursive:!0,force:!0})}let Y="my-app";try{let C=R0($,"package.json");if(_0(C)){let j=JSON.parse(Y1(C,"utf-8"));if(typeof j.name==="string")Y=j.name}}catch{}let Q=R0($,"src/lib/data/siteData.ts"),G=null;if(_0(Q)){let C=Y1(Q,"utf-8");G=OQ(C)}let H=await rW($),K=H?sW(H):null,W=await B6({message:"Project name for README / repo link",options:[{value:"remote",label:K?`Use remote repo name (${K})`:"Use remote repo name (no remote configured)"},{value:"custom",label:"Enter a custom name"}],initialValue:K?"remote":"custom"});if(Q1(W))W6("Operation cancelled"),process.exit(0);if(W==="remote"&&K)Y=K;else{let C=await TX({message:"Package / project name",initialValue:Y,validate:(j)=>{if(!j?.trim())return"Name is required";return}});if(Q1(C))W6("Operation cancelled"),process.exit(0);Y=C.trim()}JU(X,Y,H,G),Z.stop("Template cleaned");let B=R0($,"public"),U=R0(X,"public"),_=R0(X,"src/lib/data/siteData.ts"),T=Y1(Q,"utf-8"),L=XU(T),P=OQ(T);Z.start("Preserving your public assets and site data"),C1(U,{recursive:!0});let I=U$(B,{withFileTypes:!0});for(let C of I){if(C.name.startsWith(oW))continue;let j=T0(B,C.name),A=T0(U,C.name);if(C.isDirectory())C1(A,{recursive:!0}),b$(j,A,!1);else C1(g6(A),{recursive:!0}),W$(j,A)}let D=L?T0(B,L.replace(/^\//,"")):null;if(D&&_0(D)){if(W$(D,T0(U,L.replace(/^\//,""))),L!=="/favicon.svg"){let C=T0(U,tW);if(_0(C))p0(C,{force:!0})}}let m=P?T0(B,P.replace(/^\//,"")):null;if(m&&_0(m)){if(W$(m,T0(U,P.replace(/^\//,""))),P!=="/ogImage.jpg"){let C=T0(U,EQ);if(_0(C))p0(C,{force:!0})}}let O=IQ(T);if(O&&_0(_)){let C=Y1(_,"utf-8"),j=IQ(C);if(j){let A=C.slice(0,j.start)+O.block+C.slice(j.end);T2(_,A)}}Z.stop("Preserved public assets and site data");let l=AQ();try{let C=R0(X,"package.json");if(_0(C)){let j=JSON.parse(Y1(C,"utf-8"));if(typeof j.version==="string")l=j.version}}catch{}Z.start("Creating backup"),QU($),Z.stop("Backup created"),Z.start("Replacing project with upgraded files");try{let C=U$($,{withFileTypes:!0});for(let j of C){if(j.name===".git"||j.name===k$||j.name===G1)continue;let A=T0($,j.name);p0(A,{recursive:!0,force:!0})}b$(X,$,!1),p0(X,{recursive:!0,force:!0})}catch(C){Z.stop("Replace failed");let j=C instanceof Error?C.message:String(C);x0.error(j),await wQ($,"error"),process.exit(1)}Z.stop("Upgrade complete");let n=aW();Z.start(`Installing dependencies (${n})`);try{await E1(n,["install"],{cwd:$}),Z.stop("Dependencies installed")}catch(C){Z.stop("Install failed");let j=C instanceof Error?C.message:String(C);x0.error(j),await wQ($,"error"),process.exit(1)}let o=`upgraded and refresh to the bunext template version ${l}`,W0=await B6({message:"What would you like to do next?",options:[{value:"undo",label:"Undo upgrade and restore previous state"},{value:"commit",label:`Commit and push (${o})`}],initialValue:"commit"});if(Q1(W0))process.exit(0);if(W0==="undo"){let C=Q2();C.start("Reverting…"),NQ($),C.stop("Reverted."),X2(B$.default.yellow("Upgrade reverted. Your project is back to its previous state."));return}let d=R0($,G1);if(_0(d)){let C=await Z2({message:`Keep the backup folder (${G1})?`,initialValue:!1});if(Q1(C))process.exit(0);if(!C)p0(d,{recursive:!0,force:!0});else{let j=await Z2({message:"Ignore backup when committing? (add to .gitignore, keep locally)",initialValue:!0});if(Q1(j))process.exit(0);if(j)qU($,G1);else YU($,G1)}}Z.start("Committing and pushing");try{await E1("git",["add","-A"],{cwd:$}),await E1("git",["commit","-m",o],{cwd:$}),await E1("git",["push"],{cwd:$}),Z.stop("Committed and pushed")}catch(C){Z.stop("Commit or push failed");let j=C instanceof Error?C.message:String(C);x0.error(j),X2(B$.default.yellow("Upgrade completed locally. Fix git state and push manually if needed."));return}X2(B$.default.green("Project upgraded successfully and pushed to remote."))}GU().catch(($)=>{x0.error($ instanceof Error?$.message:String($)),process.exit(1)});
|
|
154
157
|
|
|
155
|
-
//# debugId=
|
|
158
|
+
//# debugId=B8C12DC809C90F7664756E2164756E21
|