create-sv-router 0.2.0 → 0.2.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/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as s}from"module";var a={297:(s,a,l)=>{const D=l(317);const d=l(558);const g=l(508);function spawn(s,a,l){const y=d(s,a,l);const F=D.spawn(y.command,y.args,y.options);g.hookChildProcess(F,y);return F}function spawnSync(s,a,l){const y=d(s,a,l);const F=D.spawnSync(y.command,y.args,y.options);F.error=F.error||g.verifyENOENTSync(F.status,y);return F}s.exports=spawn;s.exports.spawn=spawn;s.exports.sync=spawnSync;s.exports._parse=d;s.exports._enoent=g},508:s=>{const a=process.platform==="win32";function notFoundError(s,a){return Object.assign(new Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}function hookChildProcess(s,l){if(!a){return}const D=s.emit;s.emit=function(a,d){if(a==="exit"){const a=verifyENOENT(d,l);if(a){return D.call(s,"error",a)}}return D.apply(s,arguments)}}function verifyENOENT(s,l){if(a&&s===1&&!l.file){return notFoundError(l.original,"spawn")}return null}function verifyENOENTSync(s,l){if(a&&s===1&&!l.file){return notFoundError(l.original,"spawnSync")}return null}s.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},558:(s,a,l)=>{const D=l(928);const d=l(669);const g=l(107);const y=l(438);const F=process.platform==="win32";const w=/\.(?:com|exe)$/i;const C=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(s){s.file=d(s);const a=s.file&&y(s.file);if(a){s.args.unshift(s.file);s.command=a;return d(s)}return s.file}function parseNonShell(s){if(!F){return s}const a=detectShebang(s);const l=!w.test(a);if(s.options.forceShell||l){const l=C.test(a);s.command=D.normalize(s.command);s.command=g.command(s.command);s.args=s.args.map((s=>g.argument(s,l)));const d=[s.command].concat(s.args).join(" ");s.args=["/d","/s","/c",`"${d}"`];s.command=process.env.comspec||"cmd.exe";s.options.windowsVerbatimArguments=true}return s}function parse(s,a,l){if(a&&!Array.isArray(a)){l=a;a=null}a=a?a.slice(0):[];l=Object.assign({},l);const D={command:s,args:a,options:l,file:undefined,original:{command:s,args:a}};return l.shell?D:parseNonShell(D)}s.exports=parse},107:s=>{const a=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(s){s=s.replace(a,"^$1");return s}function escapeArgument(s,l){s=`${s}`;s=s.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');s=s.replace(/(?=(\\+?)?)\1$/,"$1$1");s=`"${s}"`;s=s.replace(a,"^$1");if(l){s=s.replace(a,"^$1")}return s}s.exports.command=escapeCommand;s.exports.argument=escapeArgument},438:(s,a,l)=>{const D=l(896);const d=l(746);function readShebang(s){const a=150;const l=Buffer.alloc(a);let g;try{g=D.openSync(s,"r");D.readSync(g,l,0,a,0);D.closeSync(g)}catch(s){}return d(l.toString())}s.exports=readShebang},669:(s,a,l)=>{const D=l(928);const d=l(659);const g=l(353);function resolveCommandAttempt(s,a){const l=s.options.env||process.env;const y=process.cwd();const F=s.options.cwd!=null;const w=F&&process.chdir!==undefined&&!process.chdir.disabled;if(w){try{process.chdir(s.options.cwd)}catch(s){}}let C;try{C=d.sync(s.command,{path:l[g({env:l})],pathExt:a?D.delimiter:undefined})}catch(s){}finally{if(w){process.chdir(y)}}if(C){C=D.resolve(F?s.options.cwd:"",C)}return C}function resolveCommand(s){return resolveCommandAttempt(s)||resolveCommandAttempt(s,true)}s.exports=resolveCommand},834:(s,a,l)=>{var D=l(896);var d;if(process.platform==="win32"||global.TESTING_WINDOWS){d=l(503)}else{d=l(899)}s.exports=isexe;isexe.sync=sync;function isexe(s,a,l){if(typeof a==="function"){l=a;a={}}if(!l){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(l,D){isexe(s,a||{},(function(s,a){if(s){D(s)}else{l(a)}}))}))}d(s,a||{},(function(s,D){if(s){if(s.code==="EACCES"||a&&a.ignoreErrors){s=null;D=false}}l(s,D)}))}function sync(s,a){try{return d.sync(s,a||{})}catch(s){if(a&&a.ignoreErrors||s.code==="EACCES"){return false}else{throw s}}}},899:(s,a,l)=>{s.exports=isexe;isexe.sync=sync;var D=l(896);function isexe(s,a,l){D.stat(s,(function(s,D){l(s,s?false:checkStat(D,a))}))}function sync(s,a){return checkStat(D.statSync(s),a)}function checkStat(s,a){return s.isFile()&&checkMode(s,a)}function checkMode(s,a){var l=s.mode;var D=s.uid;var d=s.gid;var g=a.uid!==undefined?a.uid:process.getuid&&process.getuid();var y=a.gid!==undefined?a.gid:process.getgid&&process.getgid();var F=parseInt("100",8);var w=parseInt("010",8);var C=parseInt("001",8);var S=F|w;var A=l&C||l&w&&d===y||l&F&&D===g||l&S&&g===0;return A}},503:(s,a,l)=>{s.exports=isexe;isexe.sync=sync;var D=l(896);function checkPathExt(s,a){var l=a.pathExt!==undefined?a.pathExt:process.env.PATHEXT;if(!l){return true}l=l.split(";");if(l.indexOf("")!==-1){return true}for(var D=0;D<l.length;D++){var d=l[D].toLowerCase();if(d&&s.substr(-d.length).toLowerCase()===d){return true}}return false}function checkStat(s,a,l){if(!s.isSymbolicLink()&&!s.isFile()){return false}return checkPathExt(a,l)}function isexe(s,a,l){D.stat(s,(function(D,d){l(D,D?false:checkStat(d,s,a))}))}function sync(s,a){return checkStat(D.statSync(s),s,a)}},353:s=>{const pathKey=(s={})=>{const a=s.env||process.env;const l=s.platform||process.platform;if(l!=="win32"){return"PATH"}return Object.keys(a).reverse().find((s=>s.toUpperCase()==="PATH"))||"Path"};s.exports=pathKey;s.exports["default"]=pathKey},130:s=>{let a=process||{},l=a.argv||[],D=a.env||{};let d=!(!!D.NO_COLOR||l.includes("--no-color"))&&(!!D.FORCE_COLOR||l.includes("--color")||a.platform==="win32"||(a.stdout||{}).isTTY&&D.TERM!=="dumb"||!!D.CI);let formatter=(s,a,l=s)=>D=>{let d=""+D,g=d.indexOf(a,s.length);return~g?s+replaceClose(d,a,l,g)+a:s+d+a};let replaceClose=(s,a,l,D)=>{let d="",g=0;do{d+=s.substring(g,D)+l;g=D+a.length;D=s.indexOf(a,g)}while(~D);return d+s.substring(g)};let createColors=(s=d)=>{let a=s?formatter:()=>String;return{isColorSupported:s,reset:a("[0m","[0m"),bold:a("[1m","[22m","[22m[1m"),dim:a("[2m","[22m","[22m[2m"),italic:a("[3m","[23m"),underline:a("[4m","[24m"),inverse:a("[7m","[27m"),hidden:a("[8m","[28m"),strikethrough:a("[9m","[29m"),black:a("[30m","[39m"),red:a("[31m","[39m"),green:a("[32m","[39m"),yellow:a("[33m","[39m"),blue:a("[34m","[39m"),magenta:a("[35m","[39m"),cyan:a("[36m","[39m"),white:a("[37m","[39m"),gray:a("[90m","[39m"),bgBlack:a("[40m","[49m"),bgRed:a("[41m","[49m"),bgGreen:a("[42m","[49m"),bgYellow:a("[43m","[49m"),bgBlue:a("[44m","[49m"),bgMagenta:a("[45m","[49m"),bgCyan:a("[46m","[49m"),bgWhite:a("[47m","[49m"),blackBright:a("[90m","[39m"),redBright:a("[91m","[39m"),greenBright:a("[92m","[39m"),yellowBright:a("[93m","[39m"),blueBright:a("[94m","[39m"),magentaBright:a("[95m","[39m"),cyanBright:a("[96m","[39m"),whiteBright:a("[97m","[39m"),bgBlackBright:a("[100m","[49m"),bgRedBright:a("[101m","[49m"),bgGreenBright:a("[102m","[49m"),bgYellowBright:a("[103m","[49m"),bgBlueBright:a("[104m","[49m"),bgMagentaBright:a("[105m","[49m"),bgCyanBright:a("[106m","[49m"),bgWhiteBright:a("[107m","[49m")}};s.exports=createColors();s.exports.createColors=createColors},746:(s,a,l)=>{const D=l(219);s.exports=(s="")=>{const a=s.match(D);if(!a){return null}const[l,d]=a[0].replace(/#! ?/,"").split(" ");const g=l.split("/").pop();if(g==="env"){return d}return d?`${g} ${d}`:g}},219:s=>{s.exports=/^#!(.*)/},537:s=>{const a="";const l=`${a}[`;const D="";const d={to(s,a){if(!a)return`${l}${s+1}G`;return`${l}${a+1};${s+1}H`},move(s,a){let D="";if(s<0)D+=`${l}${-s}D`;else if(s>0)D+=`${l}${s}C`;if(a<0)D+=`${l}${-a}A`;else if(a>0)D+=`${l}${a}B`;return D},up:(s=1)=>`${l}${s}A`,down:(s=1)=>`${l}${s}B`,forward:(s=1)=>`${l}${s}C`,backward:(s=1)=>`${l}${s}D`,nextLine:(s=1)=>`${l}E`.repeat(s),prevLine:(s=1)=>`${l}F`.repeat(s),left:`${l}G`,hide:`${l}?25l`,show:`${l}?25h`,save:`${a}7`,restore:`${a}8`};const g={up:(s=1)=>`${l}S`.repeat(s),down:(s=1)=>`${l}T`.repeat(s)};const y={screen:`${l}2J`,up:(s=1)=>`${l}1J`.repeat(s),down:(s=1)=>`${l}J`.repeat(s),line:`${l}2K`,lineEnd:`${l}K`,lineStart:`${l}1K`,lines(s){let a="";for(let l=0;l<s;l++)a+=this.line+(l<s-1?d.up():"");if(s)a+=d.left;return a}};s.exports={cursor:d,scroll:g,erase:y,beep:D}},659:(s,a,l)=>{const D=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const d=l(928);const g=D?";":":";const y=l(834);const getNotFoundError=s=>Object.assign(new Error(`not found: ${s}`),{code:"ENOENT"});const getPathInfo=(s,a)=>{const l=a.colon||g;const d=s.match(/\//)||D&&s.match(/\\/)?[""]:[...D?[process.cwd()]:[],...(a.path||process.env.PATH||"").split(l)];const y=D?a.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const F=D?y.split(l):[""];if(D){if(s.indexOf(".")!==-1&&F[0]!=="")F.unshift("")}return{pathEnv:d,pathExt:F,pathExtExe:y}};const which=(s,a,l)=>{if(typeof a==="function"){l=a;a={}}if(!a)a={};const{pathEnv:D,pathExt:g,pathExtExe:F}=getPathInfo(s,a);const w=[];const step=l=>new Promise(((g,y)=>{if(l===D.length)return a.all&&w.length?g(w):y(getNotFoundError(s));const F=D[l];const C=/^".*"$/.test(F)?F.slice(1,-1):F;const S=d.join(C,s);const A=!C&&/^\.[\\\/]/.test(s)?s.slice(0,2)+S:S;g(subStep(A,l,0))}));const subStep=(s,l,D)=>new Promise(((d,C)=>{if(D===g.length)return d(step(l+1));const S=g[D];y(s+S,{pathExt:F},((g,y)=>{if(!g&&y){if(a.all)w.push(s+S);else return d(s+S)}return d(subStep(s,l,D+1))}))}));return l?step(0).then((s=>l(null,s)),l):step(0)};const whichSync=(s,a)=>{a=a||{};const{pathEnv:l,pathExt:D,pathExtExe:g}=getPathInfo(s,a);const F=[];for(let w=0;w<l.length;w++){const C=l[w];const S=/^".*"$/.test(C)?C.slice(1,-1):C;const A=d.join(S,s);const M=!S&&/^\.[\\\/]/.test(s)?s.slice(0,2)+A:A;for(let s=0;s<D.length;s++){const l=M+D[s];try{const s=y.sync(l,{pathExt:g});if(s){if(a.all)F.push(l);else return l}}catch(s){}}}if(a.all&&F.length)return F;if(a.nothrow)return null;throw getNotFoundError(s)};s.exports=which;which.sync=whichSync},317:a=>{a.exports=s(import.meta.url)("child_process")},896:a=>{a.exports=s(import.meta.url)("fs")},24:a=>{a.exports=s(import.meta.url)("node:fs")},760:a=>{a.exports=s(import.meta.url)("node:path")},708:a=>{a.exports=s(import.meta.url)("node:process")},75:a=>{a.exports=s(import.meta.url)("node:stream")},136:a=>{a.exports=s(import.meta.url)("node:url")},975:a=>{a.exports=s(import.meta.url)("node:util")},928:a=>{a.exports=s(import.meta.url)("path")},670:(s,a,l)=>{l.a(s,(async(s,a)=>{try{var D=l(24);var d=l(760);var g=l(136);var y=l(785);var F=l(137);const w=(0,g.fileURLToPath)(import.meta.url);const C=d.dirname(w);function checkCancel(s){if(y.FZ(s)){y.ZT("Operation cancelled.");process.exit(0)}}y.Lv(`create-sv-router`);const S="Leave blank to use `./`";let A=await y.Qq({message:"Where do you want to create your project?",placeholder:S});checkCancel(A);if(A===S)A="";const M=await y.Lt({message:"Choose your language.",options:[{value:"ts",label:"TypeScript"},{value:"js",label:"JavaScript (JSDoc)"}]});checkCancel(M);let _=await y.Lt({message:"Choose your template.",options:[{value:"file-based",label:"File-based routing"},{value:"code-based",label:"Code-based routing"}]});checkCancel(_);const G=d.join(process.cwd(),A);if(A){D.mkdirSync(G,{recursive:true})}_+="-"+M;D.cpSync(d.join(C,"../templates",_),G,{recursive:true});D.renameSync(d.join(G,"gitignore"),d.join(G,".gitignore"));const W=await y.Lt({message:"Which package manager do you want to install dependencies with?",options:[{value:"",label:"None"},{value:"npm",label:"npm"},{value:"yarn",label:"yarn"},{value:"pnpm",label:"pnpm"},{value:"bun",label:"bun"},{value:"deno",label:"deno"}]});checkCancel(W);if(W){const ee=y.u1();ee.start("Installing dependencies with "+W);try{await(0,F.Ho)(W,["install"],{cwd:G});ee.stop("Dependencies installed with "+W)}catch(te){ee.stop("Failed to install dependencies with "+W);console.error(te);process.exit(1)}}const V=await y.lJ({message:"Initialize a git repository?"});checkCancel(V);if(V){try{await(0,F.Ho)("git",["init"],{cwd:G});y.Rm.step("Git repository initialized")}catch(ne){y.Rm.error("Failed to initialize git repository");console.error(ne);process.exit(1)}}y.Md("You're all set! You can now run:");const X=[...A?[`cd ${A}`]:[],...W?[]:["npm install"],(W||"npm")+" run dev"].map(((s,a)=>{const l=`[94m${a+1}.[0m`;const D=`[37m${s}[0m`;return`${l} ${D}`}));console.log([...X,""].join("\n"));a()}catch(re){a(re)}}),1)},785:(a,l,D)=>{D.d(l,{ZT:()=>xe,lJ:()=>ye,Lv:()=>Ie,FZ:()=>pD,Rm:()=>lt,Md:()=>Se,Lt:()=>ve,u1:()=>dist_Y,Qq:()=>he});var d=D(975);var g=D(537);var y=D(708);const F=s(import.meta.url)("node:readline");var w=D(75);var C=D(130);function DD({onlyFirst:s=!1}={}){const a=["[\\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(a,s?void 0:"g")}const A=DD();function P(s){if(typeof s!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof s}\``);return s.replace(A,"")}function L(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var M={exports:{}};(function(s){var a={};s.exports=a,a.eastAsianWidth=function(s){var a=s.charCodeAt(0),l=s.length==2?s.charCodeAt(1):0,D=a;return 55296<=a&&a<=56319&&56320<=l&&l<=57343&&(a&=1023,l&=1023,D=a<<10|l,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},a.characterLength=function(s){var a=this.eastAsianWidth(s);return a=="F"||a=="W"||a=="A"?2:1};function t(s){return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}a.length=function(s){for(var a=t(s),l=0,D=0;D<a.length;D++)l=l+this.characterLength(a[D]);return l},a.slice=function(s,l,D){textLen=a.length(s),l=l||0,D=D||1,l<0&&(l=textLen+l),D<0&&(D=textLen+D);for(var d="",g=0,y=t(s),F=0;F<y.length;F++){var w=y[F],C=a.length(w);if(g>=l-(C==2?1:0))if(g+C<=D)d+=w;else break;g+=C}return d}})(M);var _=M.exports;const G=L(_);var FD=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};const W=L(FD);function p(s,a={}){if(typeof s!="string"||s.length===0||(a={ambiguousIsNarrow:!0,...a},s=P(s),s.length===0))return 0;s=s.replace(W()," ");const l=a.ambiguousIsNarrow?1:2;let D=0;for(const a of s){const s=a.codePointAt(0);if(s<=31||s>=127&&s<=159||s>=768&&s<=879)continue;switch(G.eastAsianWidth(a)){case"F":case"W":D+=2;break;case"A":D+=l;break;default:D+=1}}return D}const V=10,N=(s=0)=>a=>`[${a+s}m`,I=(s=0)=>a=>`[${38+s};5;${a}m`,R=(s=0)=>(a,l,D)=>`[${38+s};2;${a};${l};${D}m`,ee={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(ee.modifier);const ne=Object.keys(ee.color),oe=Object.keys(ee.bgColor);[...ne,...oe];function rD(){const s=new Map;for(const[a,l]of Object.entries(ee)){for(const[a,D]of Object.entries(l))ee[a]={open:`[${D[0]}m`,close:`[${D[1]}m`},l[a]=ee[a],s.set(D[0],D[1]);Object.defineProperty(ee,a,{value:l,enumerable:!1})}return Object.defineProperty(ee,"codes",{value:s,enumerable:!1}),ee.color.close="[39m",ee.bgColor.close="[49m",ee.color.ansi=N(),ee.color.ansi256=I(),ee.color.ansi16m=R(),ee.bgColor.ansi=N(V),ee.bgColor.ansi256=I(V),ee.bgColor.ansi16m=R(V),Object.defineProperties(ee,{rgbToAnsi256:{value:(s,a,l)=>s===a&&a===l?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(a/255*5)+Math.round(l/255*5),enumerable:!1},hexToRgb:{value:s=>{const a=/[a-f\d]{6}|[a-f\d]{3}/i.exec(s.toString(16));if(!a)return[0,0,0];let[l]=a;l.length===3&&(l=[...l].map((s=>s+s)).join(""));const D=Number.parseInt(l,16);return[D>>16&255,D>>8&255,D&255]},enumerable:!1},hexToAnsi256:{value:s=>ee.rgbToAnsi256(...ee.hexToRgb(s)),enumerable:!1},ansi256ToAnsi:{value:s=>{if(s<8)return 30+s;if(s<16)return 90+(s-8);let a,l,D;if(s>=232)a=((s-232)*10+8)/255,l=a,D=a;else{s-=16;const d=s%36;a=Math.floor(s/36)/5,l=Math.floor(d/6)/5,D=d%6/5}const d=Math.max(a,l,D)*2;if(d===0)return 30;let g=30+(Math.round(D)<<2|Math.round(l)<<1|Math.round(a));return d===2&&(g+=60),g},enumerable:!1},rgbToAnsi:{value:(s,a,l)=>ee.ansi256ToAnsi(ee.rgbToAnsi256(s,a,l)),enumerable:!1},hexToAnsi:{value:s=>ee.ansi256ToAnsi(ee.hexToAnsi256(s)),enumerable:!1}}),ee}const ue=rD(),ae=new Set(["",""]),le=39,De="",de="[",pe="]",me="m",Fe=`${pe}8;;`,z=s=>`${ae.values().next().value}${de}${s}${me}`,K=s=>`${ae.values().next().value}${Fe}${s}${De}`,aD=s=>s.split(" ").map((s=>p(s))),k=(s,a,l)=>{const D=[...a];let d=!1,g=!1,y=p(P(s[s.length-1]));for(const[a,F]of D.entries()){const w=p(F);if(y+w<=l?s[s.length-1]+=F:(s.push(F),y=0),ae.has(F)&&(d=!0,g=D.slice(a+1).join("").startsWith(Fe)),d){g?F===De&&(d=!1,g=!1):F===me&&(d=!1);continue}y+=w,y===l&&a<D.length-1&&(s.push(""),y=0)}!y&&s[s.length-1].length>0&&s.length>1&&(s[s.length-2]+=s.pop())},hD=s=>{const a=s.split(" ");let l=a.length;for(;l>0&&!(p(a[l-1])>0);)l--;return l===a.length?s:a.slice(0,l).join(" ")+a.slice(l).join("")},lD=(s,a,l={})=>{if(l.trim!==!1&&s.trim()==="")return"";let D="",d,g;const y=aD(s);let F=[""];for(const[D,d]of s.split(" ").entries()){l.trim!==!1&&(F[F.length-1]=F[F.length-1].trimStart());let s=p(F[F.length-1]);if(D!==0&&(s>=a&&(l.wordWrap===!1||l.trim===!1)&&(F.push(""),s=0),(s>0||l.trim===!1)&&(F[F.length-1]+=" ",s++)),l.hard&&y[D]>a){const l=a-s,g=1+Math.floor((y[D]-l-1)/a);Math.floor((y[D]-1)/a)<g&&F.push(""),k(F,d,a);continue}if(s+y[D]>a&&s>0&&y[D]>0){if(l.wordWrap===!1&&s<a){k(F,d,a);continue}F.push("")}if(s+y[D]>a&&l.wordWrap===!1){k(F,d,a);continue}F[F.length-1]+=d}l.trim!==!1&&(F=F.map((s=>hD(s))));const w=[...F.join(`\n`)];for(const[s,a]of w.entries()){if(D+=a,ae.has(a)){const{groups:a}=new RegExp(`(?:\\${de}(?<code>\\d+)m|\\${Fe}(?<uri>.*)${De})`).exec(w.slice(s).join(""))||{groups:{}};if(a.code!==void 0){const s=Number.parseFloat(a.code);d=s===le?void 0:s}else a.uri!==void 0&&(g=a.uri.length===0?void 0:a.uri)}const l=ue.codes.get(Number(d));w[s+1]===`\n`?(g&&(D+=K("")),d&&l&&(D+=z(l))):a===`\n`&&(d&&l&&(D+=z(d)),g&&(D+=K(g)))}return D};function Y(s,a,l){return String(s).normalize().replace(/\r\n/g,`\n`).split(`\n`).map((s=>lD(s,a,l))).join(`\n`)}const Ee=["up","down","left","right","space","enter","cancel"],Be={actions:new Set(Ee),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function cD(s){for(const a in s){const l=a;if(!Object.hasOwn(s,l))continue;const D=s[l];switch(l){case"aliases":{for(const s in D)Object.hasOwn(D,s)&&(Be.aliases.has(s)||Be.aliases.set(s,D[s]));break}}}}function $(s,a){if(typeof s=="string")return Be.aliases.get(s)===a;for(const l of s)if(l!==void 0&&$(l,a))return!0;return!1}function BD(s,a){if(s===a)return;const l=s.split(`\n`),D=a.split(`\n`),d=[];for(let s=0;s<Math.max(l.length,D.length);s++)l[s]!==D[s]&&d.push(s);return d}const $e=globalThis.process.platform.startsWith("win"),Ae=Symbol("clack:cancel");function pD(s){return s===Ae}function m(s,a){const l=s;l.isTTY&&l.setRawMode(a)}function fD({input:s=y.stdin,output:a=y.stdout,overwrite:l=!0,hideCursor:D=!0}={}){const d=F.createInterface({input:s,output:a,prompt:"",tabSize:1});F.emitKeypressEvents(s,d),s.isTTY&&s.setRawMode(!0);const i=(d,{name:y,sequence:w})=>{const C=String(d);if($([C,y,w],"cancel")){D&&a.write(g.cursor.show),process.exit(0);return}if(!l)return;const S=y==="return"?0:-1,A=y==="return"?-1:0;F.moveCursor(a,S,A,(()=>{F.clearLine(a,1,(()=>{s.once("keypress",i)}))}))};return D&&a.write(g.cursor.hide),s.once("keypress",i),()=>{s.off("keypress",i),D&&a.write(g.cursor.show),s.isTTY&&!$e&&s.setRawMode(!1),d.terminal=!1,d.close()}}var Oe=Object.defineProperty,vD=(s,a,l)=>a in s?Oe(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,h=(s,a,l)=>(vD(s,typeof a!="symbol"?a+"":a,l),l);class x{constructor(s,a=!0){h(this,"input"),h(this,"output"),h(this,"_abortSignal"),h(this,"rl"),h(this,"opts"),h(this,"_render"),h(this,"_track",!1),h(this,"_prevFrame",""),h(this,"_subscribers",new Map),h(this,"_cursor",0),h(this,"state","initial"),h(this,"error",""),h(this,"value");const{input:l=y.stdin,output:D=y.stdout,render:d,signal:g,...F}=s;this.opts=F,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=d.bind(this),this._track=a,this._abortSignal=g,this.input=l,this.output=D}unsubscribe(){this._subscribers.clear()}setSubscriber(s,a){const l=this._subscribers.get(s)??[];l.push(a),this._subscribers.set(s,l)}on(s,a){this.setSubscriber(s,{cb:a})}once(s,a){this.setSubscriber(s,{cb:a,once:!0})}emit(s,...a){const l=this._subscribers.get(s)??[],D=[];for(const s of l)s.cb(...a),s.once&&D.push((()=>l.splice(l.indexOf(s),1)));for(const s of D)s()}prompt(){return new Promise(((s,a)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),s(Ae);this._abortSignal.addEventListener("abort",(()=>{this.state="cancel",this.close()}),{once:!0})}const l=new w.Writable;l._write=(s,a,l)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),l()},this.input.pipe(l),this.rl=F.createInterface({input:this.input,output:l,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),F.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),m(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",(()=>{this.output.write(g.cursor.show),this.output.off("resize",this.render),m(this.input,!1),s(this.value)})),this.once("cancel",(()=>{this.output.write(g.cursor.show),this.output.off("resize",this.render),m(this.input,!1),s(Ae)}))}))}onKeypress(s,a){if(this.state==="error"&&(this.state="active"),a?.name&&(!this._track&&Be.aliases.has(a.name)&&this.emit("cursor",Be.aliases.get(a.name)),Be.actions.has(a.name)&&this.emit("cursor",a.name)),s&&(s.toLowerCase()==="y"||s.toLowerCase()==="n")&&this.emit("confirm",s.toLowerCase()==="y"),s==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),s&&this.emit("key",s.toLowerCase()),a?.name==="return"){if(this.opts.validate){const s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}$([s,a?.name,a?.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(`\n`),m(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const s=Y(this._prevFrame,process.stdout.columns,{hard:!0}).split(`\n`).length-1;this.output.write(g.cursor.move(-999,s*-1))}render(){const s=Y(this._render(this)??"",process.stdout.columns,{hard:!0});if(s!==this._prevFrame){if(this.state==="initial")this.output.write(g.cursor.hide);else{const a=BD(this._prevFrame,s);if(this.restoreCursor(),a&&a?.length===1){const l=a[0];this.output.write(g.cursor.move(0,l)),this.output.write(g.erase.lines(1));const D=s.split(`\n`);this.output.write(D[l]),this._prevFrame=s,this.output.write(g.cursor.move(0,D.length-l-1));return}if(a&&a?.length>1){const l=a[0];this.output.write(g.cursor.move(0,l)),this.output.write(g.erase.down());const D=s.split(`\n`).slice(l);this.output.write(D.join(`\n`)),this._prevFrame=s;return}this.output.write(g.erase.down())}this.output.write(s),this.state==="initial"&&(this.state="active"),this._prevFrame=s}}}class dD extends x{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(s){super(s,!1),this.value=!!s.initialValue,this.on("value",(()=>{this.value=this._value})),this.on("confirm",(s=>{this.output.write(g.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()})),this.on("cursor",(()=>{this.value=!this.value}))}}var ke=Object.defineProperty,bD=(s,a,l)=>a in s?ke(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,Z=(s,a,l)=>(bD(s,typeof a!="symbol"?a+"":a,l),l),q=(s,a,l)=>{if(!a.has(s))throw TypeError("Cannot "+l)},T=(s,a,l)=>(q(s,a,"read from private field"),l?l.call(s):a.get(s)),wD=(s,a,l)=>{if(a.has(s))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(s):a.set(s,l)},yD=(s,a,l,D)=>(q(s,a,"write to private field"),D?D.call(s,l):a.set(s,l),l),Ne;let je=class extends x{constructor(s){super(s,!1),Z(this,"options"),Z(this,"cursor",0),wD(this,Ne,void 0);const{options:a}=s;yD(this,Ne,s.selectableGroups!==!1),this.options=Object.entries(a).flatMap((([s,a])=>[{value:s,group:!0,label:s},...a.map((a=>({...a,group:s})))])),this.value=[...s.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:a})=>a===s.cursorAt)),T(this,Ne)?0:1),this.on("cursor",(s=>{switch(s){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;const s=this.options[this.cursor]?.group===!0;!T(this,Ne)&&s&&(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;const s=this.options[this.cursor]?.group===!0;!T(this,Ne)&&s&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}}))}getGroupItems(s){return this.options.filter((a=>a.group===s))}isGroupSelected(s){return this.getGroupItems(s).every((s=>this.value.includes(s.value)))}toggleValue(){const s=this.options[this.cursor];if(s.group===!0){const a=s.value,l=this.getGroupItems(a);this.isGroupSelected(a)?this.value=this.value.filter((s=>l.findIndex((a=>a.value===s))===-1)):this.value=[...this.value,...l.map((s=>s.value))],this.value=Array.from(new Set(this.value))}else{const a=this.value.includes(s.value);this.value=a?this.value.filter((a=>a!==s.value)):[...this.value,s.value]}}};Ne=new WeakMap;var Pe=Object.defineProperty,$D=(s,a,l)=>a in s?Pe(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,H=(s,a,l)=>($D(s,typeof a!="symbol"?a+"":a,l),l);let Re=class extends x{constructor(s){super(s,!1),H(this,"options"),H(this,"cursor",0),this.options=s.options,this.value=[...s.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:a})=>a===s.cursorAt)),0),this.on("key",(s=>{s==="a"&&this.toggleAll()})),this.on("cursor",(s=>{switch(s){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;case"space":this.toggleValue();break}}))}get _value(){return this.options[this.cursor].value}toggleAll(){const s=this.value.length===this.options.length;this.value=s?[]:this.options.map((s=>s.value))}toggleValue(){const s=this.value.includes(this._value);this.value=s?this.value.filter((s=>s!==this._value)):[...this.value,this._value]}};var Le=Object.defineProperty,jD=(s,a,l)=>a in s?Le(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,U=(s,a,l)=>(jD(s,typeof a!="symbol"?a+"":a,l),l);class MD extends x{constructor({mask:s,...a}){super(a),U(this,"valueWithCursor",""),U(this,"_mask","•"),this._mask=s??"•",this.on("finalize",(()=>{this.valueWithCursor=this.masked})),this.on("value",(()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${C.inverse(C.hidden("_"))}`;else{const s=this.masked.slice(0,this.cursor),a=this.masked.slice(this.cursor);this.valueWithCursor=`${s}${C.inverse(a[0])}${a.slice(1)}`}}))}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}}var _e=Object.defineProperty,PD=(s,a,l)=>a in s?_e(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,J=(s,a,l)=>(PD(s,typeof a!="symbol"?a+"":a,l),l);class LD extends x{constructor(s){super(s,!1),J(this,"options"),J(this,"cursor",0),this.options=s.options,this.cursor=this.options.findIndex((({value:a})=>a===s.initialValue)),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(s=>{switch(s){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}}var Ue=Object.defineProperty,ND=(s,a,l)=>a in s?Ue(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,Q=(s,a,l)=>(ND(s,typeof a!="symbol"?a+"":a,l),l);class ID extends x{constructor(s){super(s,!1),Q(this,"options"),Q(this,"cursor",0),this.options=s.options;const a=this.options.map((({value:[s]})=>s?.toLowerCase()));this.cursor=Math.max(a.indexOf(s.initialValue),0),this.on("key",(s=>{if(!a.includes(s))return;const l=this.options.find((({value:[a]})=>a?.toLowerCase()===s));l&&(this.value=l.value,this.state="submit",this.emit("submit"))}))}}class RD extends x{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;const s=this.value.slice(0,this.cursor),[a,...l]=this.value.slice(this.cursor);return`${s}${C.inverse(a)}${l.join("")}`}get cursor(){return this._cursor}constructor(s){super(s),this.on("finalize",(()=>{this.value||(this.value=s.defaultValue)}))}}function ce(){return y.platform!=="win32"?y.env.TERM!=="linux":!!y.env.CI||!!y.env.WT_SESSION||!!y.env.TERMINUS_SUBLIME||y.env.ConEmuTask==="{cmd::Cmder}"||y.env.TERM_PROGRAM==="Terminus-Sublime"||y.env.TERM_PROGRAM==="vscode"||y.env.TERM==="xterm-256color"||y.env.TERM==="alacritty"||y.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Ge=ce(),u=(s,a)=>Ge?s:a,We=u("◆","*"),Ve=u("■","x"),ze=u("▲","x"),qe=u("◇","o"),He=u("┌","T"),Ke=u("│","|"),Ye=u("└","—"),Je=u("●",">"),Ze=u("○"," "),Xe=u("◻","[•]"),Qe=u("◼","[+]"),et=u("◻","[ ]"),tt=u("▪","•"),nt=u("─","-"),rt=u("╮","+"),st=u("├","+"),ot=u("╯","+"),it=u("●","•"),ut=u("◆","*"),at=u("▲","!"),ct=u("■","x"),b=s=>{switch(s){case"initial":case"active":return C.cyan(We);case"cancel":return C.red(Ve);case"error":return C.yellow(ze);case"submit":return C.green(qe)}},dist_G=s=>{const{cursor:a,options:l,style:D}=s,d=s.maxItems??Number.POSITIVE_INFINITY,g=Math.max(process.stdout.rows-4,0),y=Math.min(g,Math.max(d,5));let F=0;a>=F+y-3?F=Math.max(Math.min(a-y+3,l.length-y),0):a<F+2&&(F=Math.max(a-2,0));const w=y<l.length&&F>0,S=y<l.length&&F+y<l.length;return l.slice(F,F+y).map(((s,l,d)=>{const g=l===0&&w,y=l===d.length-1&&S;return g||y?C.dim("..."):D(s,l+F===a)}))},he=s=>new RD({validate:s.validate,placeholder:s.placeholder,defaultValue:s.defaultValue,initialValue:s.initialValue,render(){const a=`${C.gray(Ke)}\n${b(this.state)} ${s.message}\n`,l=s.placeholder?C.inverse(s.placeholder[0])+C.dim(s.placeholder.slice(1)):C.inverse(C.hidden("_")),D=this.value?this.valueWithCursor:l;switch(this.state){case"error":return`${a.trim()}\n${C.yellow(Ke)} ${D}\n${C.yellow(Ye)} ${C.yellow(this.error)}\n`;case"submit":return`${a}${C.gray(Ke)} ${C.dim(this.value||s.placeholder)}`;case"cancel":return`${a}${C.gray(Ke)} ${C.strikethrough(C.dim(this.value??""))}${this.value?.trim()?`\n${C.gray(Ke)}`:""}`;default:return`${a}${C.cyan(Ke)} ${D}\n${C.cyan(Ye)}\n`}}}).prompt(),ge=s=>new X({validate:s.validate,mask:s.mask??tt,render(){const a=`${e.gray(Ke)}\n${b(this.state)} ${s.message}\n`,l=this.valueWithCursor,D=this.masked;switch(this.state){case"error":return`${a.trim()}\n${e.yellow(Ke)} ${D}\n${e.yellow(Ye)} ${e.yellow(this.error)}\n`;case"submit":return`${a}${e.gray(Ke)} ${e.dim(D)}`;case"cancel":return`${a}${e.gray(Ke)} ${e.strikethrough(e.dim(D??""))}${D?`\n${e.gray(Ke)}`:""}`;default:return`${a}${e.cyan(Ke)} ${l}\n${e.cyan(Ye)}\n`}}}).prompt(),ye=s=>{const a=s.active??"Yes",l=s.inactive??"No";return new dD({active:a,inactive:l,initialValue:s.initialValue??!0,render(){const D=`${C.gray(Ke)}\n${b(this.state)} ${s.message}\n`,d=this.value?a:l;switch(this.state){case"submit":return`${D}${C.gray(Ke)} ${C.dim(d)}`;case"cancel":return`${D}${C.gray(Ke)} ${C.strikethrough(C.dim(d))}\n${C.gray(Ke)}`;default:return`${D}${C.cyan(Ke)} ${this.value?`${C.green(Je)} ${a}`:`${C.dim(Ze)} ${C.dim(a)}`} ${C.dim("/")} ${this.value?`${C.dim(Ze)} ${C.dim(l)}`:`${C.green(Je)} ${l}`}\n${C.cyan(Ye)}\n`}}}).prompt()},ve=s=>{const n=(s,a)=>{const l=s.label??String(s.value);switch(a){case"selected":return`${C.dim(l)}`;case"active":return`${C.green(Je)} ${l} ${s.hint?C.dim(`(${s.hint})`):""}`;case"cancelled":return`${C.strikethrough(C.dim(l))}`;default:return`${C.dim(Ze)} ${C.dim(l)}`}};return new LD({options:s.options,initialValue:s.initialValue,render(){const a=`${C.gray(Ke)}\n${b(this.state)} ${s.message}\n`;switch(this.state){case"submit":return`${a}${C.gray(Ke)} ${n(this.options[this.cursor],"selected")}`;case"cancel":return`${a}${C.gray(Ke)} ${n(this.options[this.cursor],"cancelled")}\n${C.gray(Ke)}`;default:return`${a}${C.cyan(Ke)} ${dist_G({cursor:this.cursor,options:this.options,maxItems:s.maxItems,style:(s,a)=>n(s,a?"active":"inactive")}).join(`\n${C.cyan(Ke)} `)}\n${C.cyan(Ye)}\n`}}}).prompt()},we=s=>{const n=(s,a="inactive")=>{const l=s.label??String(s.value);return a==="selected"?`${e.dim(l)}`:a==="cancelled"?`${e.strikethrough(e.dim(l))}`:a==="active"?`${e.bgCyan(e.gray(` ${s.value} `))} ${l} ${s.hint?e.dim(`(${s.hint})`):""}`:`${e.gray(e.bgWhite(e.inverse(` ${s.value} `)))} ${l} ${s.hint?e.dim(`(${s.hint})`):""}`};return new te({options:s.options,initialValue:s.initialValue,render(){const a=`${e.gray(Ke)}\n${b(this.state)} ${s.message}\n`;switch(this.state){case"submit":return`${a}${e.gray(Ke)} ${n(this.options.find((s=>s.value===this.value))??s.options[0],"selected")}`;case"cancel":return`${a}${e.gray(Ke)} ${n(this.options[0],"cancelled")}\n${e.gray(Ke)}`;default:return`${a}${e.cyan(Ke)} ${this.options.map(((s,a)=>n(s,a===this.cursor?"active":"inactive"))).join(`\n${e.cyan(Ke)} `)}\n${e.cyan(Ye)}\n`}}}).prompt()},fe=s=>{const n=(s,a)=>{const l=s.label??String(s.value);return a==="active"?`${e.cyan(Xe)} ${l} ${s.hint?e.dim(`(${s.hint})`):""}`:a==="selected"?`${e.green(Qe)} ${e.dim(l)} ${s.hint?e.dim(`(${s.hint})`):""}`:a==="cancelled"?`${e.strikethrough(e.dim(l))}`:a==="active-selected"?`${e.green(Qe)} ${l} ${s.hint?e.dim(`(${s.hint})`):""}`:a==="submitted"?`${e.dim(l)}`:`${e.dim(et)} ${e.dim(l)}`};return new re({options:s.options,initialValues:s.initialValues,required:s.required??!0,cursorAt:s.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option.\n${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const a=`${e.gray(Ke)}\n${b(this.state)} ${s.message}\n`,i=(s,a)=>{const l=this.value.includes(s.value);return a&&l?n(s,"active-selected"):l?n(s,"selected"):n(s,a?"active":"inactive")};switch(this.state){case"submit":return`${a}${e.gray(Ke)} ${this.options.filter((({value:s})=>this.value.includes(s))).map((s=>n(s,"submitted"))).join(e.dim(", "))||e.dim("none")}`;case"cancel":{const s=this.options.filter((({value:s})=>this.value.includes(s))).map((s=>n(s,"cancelled"))).join(e.dim(", "));return`${a}${e.gray(Ke)} ${s.trim()?`${s}\n${e.gray(Ke)}`:""}`}case"error":{const l=this.error.split(`\n`).map(((s,a)=>a===0?`${e.yellow(Ye)} ${e.yellow(s)}`:` ${s}`)).join(`\n`);return`${a+e.yellow(Ke)} ${dist_G({options:this.options,cursor:this.cursor,maxItems:s.maxItems,style:i}).join(`\n${e.yellow(Ke)} `)}\n${l}\n`}default:return`${a}${e.cyan(Ke)} ${dist_G({options:this.options,cursor:this.cursor,maxItems:s.maxItems,style:i}).join(`\n${e.cyan(Ke)} `)}\n${e.cyan(Ye)}\n`}}}).prompt()},be=s=>{const{selectableGroups:a=!0}=s,r=(s,l,D=[])=>{const d=s.label??String(s.value),g=typeof s.group=="string",y=g&&(D[D.indexOf(s)+1]??{group:!0}),F=g&&y.group===!0,w=g?a?`${F?Ye:Ke} `:" ":"";if(l==="active")return`${e.dim(w)}${e.cyan(Xe)} ${d} ${s.hint?e.dim(`(${s.hint})`):""}`;if(l==="group-active")return`${w}${e.cyan(Xe)} ${e.dim(d)}`;if(l==="group-active-selected")return`${w}${e.green(Qe)} ${e.dim(d)}`;if(l==="selected"){const l=g||a?e.green(Qe):"";return`${e.dim(w)}${l} ${e.dim(d)} ${s.hint?e.dim(`(${s.hint})`):""}`}if(l==="cancelled")return`${e.strikethrough(e.dim(d))}`;if(l==="active-selected")return`${e.dim(w)}${e.green(Qe)} ${d} ${s.hint?e.dim(`(${s.hint})`):""}`;if(l==="submitted")return`${e.dim(d)}`;const C=g||a?e.dim(et):"";return`${e.dim(w)}${C} ${e.dim(d)}`};return new se({options:s.options,initialValues:s.initialValues,required:s.required??!0,cursorAt:s.cursorAt,selectableGroups:a,validate(s){if(this.required&&s.length===0)return`Please select at least one option.\n${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const a=`${e.gray(Ke)}\n${b(this.state)} ${s.message}\n`;switch(this.state){case"submit":return`${a}${e.gray(Ke)} ${this.options.filter((({value:s})=>this.value.includes(s))).map((s=>r(s,"submitted"))).join(e.dim(", "))}`;case"cancel":{const s=this.options.filter((({value:s})=>this.value.includes(s))).map((s=>r(s,"cancelled"))).join(e.dim(", "));return`${a}${e.gray(Ke)} ${s.trim()?`${s}\n${e.gray(Ke)}`:""}`}case"error":{const s=this.error.split(`\n`).map(((s,a)=>a===0?`${e.yellow(Ye)} ${e.yellow(s)}`:` ${s}`)).join(`\n`);return`${a}${e.yellow(Ke)} ${this.options.map(((s,a,l)=>{const D=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),d=a===this.cursor;return!d&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?r(s,D?"group-active-selected":"group-active",l):d&&D?r(s,"active-selected",l):D?r(s,"selected",l):r(s,d?"active":"inactive",l)})).join(`\n${e.yellow(Ke)} `)}\n${s}\n`}default:return`${a}${e.cyan(Ke)} ${this.options.map(((s,a,l)=>{const D=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),d=a===this.cursor;return!d&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?r(s,D?"group-active-selected":"group-active",l):d&&D?r(s,"active-selected",l):D?r(s,"selected",l):r(s,d?"active":"inactive",l)})).join(`\n${e.cyan(Ke)} `)}\n${e.cyan(Ye)}\n`}}}).prompt()},Me=(s="",a="")=>{const l=`\n${s}\n`.split(`\n`),D=S(a).length,d=Math.max(l.reduce(((s,a)=>{const l=S(a);return l.length>s?l.length:s}),0),D)+2,g=l.map((s=>`${e.gray(Ke)} ${e.dim(s)}${" ".repeat(d-S(s).length)}${e.gray(Ke)}`)).join(`\n`);process.stdout.write(`${e.gray(Ke)}\n${e.green(qe)} ${e.reset(a)} ${e.gray(nt.repeat(Math.max(d-D-1,1))+rt)}\n${g}\n${e.gray(st+nt.repeat(d+2)+ot)}\n`)},xe=(s="")=>{process.stdout.write(`${C.gray(Ye)} ${C.red(s)}\n\n`)},Ie=(s="")=>{process.stdout.write(`${C.gray(He)} ${s}\n`)},Se=(s="")=>{process.stdout.write(`${C.gray(Ke)}\n${C.gray(Ye)} ${s}\n\n`)},lt={message:(s="",{symbol:a=C.gray(Ke)}={})=>{const l=[`${C.gray(Ke)}`];if(s){const[D,...d]=s.split(`\n`);l.push(`${a} ${D}`,...d.map((s=>`${C.gray(Ke)} ${s}`)))}process.stdout.write(`${l.join(`\n`)}\n`)},info:s=>{lt.message(s,{symbol:C.blue(it)})},success:s=>{lt.message(s,{symbol:C.green(ut)})},step:s=>{lt.message(s,{symbol:C.green(qe)})},warn:s=>{lt.message(s,{symbol:C.yellow(at)})},warning:s=>{lt.warn(s)},error:s=>{lt.message(s,{symbol:C.red(ct)})}},Dt=`${C.gray(Ke)} `,dt={message:async(s,{symbol:a=C.gray(Ke)}={})=>{process.stdout.write(`${C.gray(Ke)}\n${a} `);let l=3;for await(let a of s){a=a.replace(/\n/g,`\n${Dt}`),a.includes(`\n`)&&(l=3+(0,d.stripVTControlCharacters)(a.slice(a.lastIndexOf(`\n`))).length);const s=(0,d.stripVTControlCharacters)(a).length;l+s<process.stdout.columns?(l+=s,process.stdout.write(a)):(process.stdout.write(`\n${Dt}${a.trimStart()}`),l=3+(0,d.stripVTControlCharacters)(a.trimStart()).length)}process.stdout.write(`\n`)},info:s=>dt.message(s,{symbol:C.blue(it)}),success:s=>dt.message(s,{symbol:C.green(ut)}),step:s=>dt.message(s,{symbol:C.green(qe)}),warn:s=>dt.message(s,{symbol:C.yellow(at)}),warning:s=>dt.warn(s),error:s=>dt.message(s,{symbol:C.red(ct)})},dist_Y=({indicator:s="dots"}={})=>{const a=Ge?["◒","◐","◓","◑"]:["•","o","O","0"],l=Ge?80:120,D=process.env.CI==="true";let d,y,F=!1,w="",S,A=performance.now();const p=s=>{const a=s>1?"Something went wrong":"Canceled";F&&N(a,s)},v=()=>p(2),f=()=>p(1),j=()=>{process.on("uncaughtExceptionMonitor",v),process.on("unhandledRejection",v),process.on("SIGINT",f),process.on("SIGTERM",f),process.on("exit",p)},E=()=>{process.removeListener("uncaughtExceptionMonitor",v),process.removeListener("unhandledRejection",v),process.removeListener("SIGINT",f),process.removeListener("SIGTERM",f),process.removeListener("exit",p)},B=()=>{if(S===void 0)return;D&&process.stdout.write(`\n`);const s=S.split(`\n`);process.stdout.write(g.cursor.move(-999,s.length-1)),process.stdout.write(g.erase.down(s.length))},R=s=>s.replace(/\.+$/,""),O=s=>{const a=(performance.now()-s)/1e3,l=Math.floor(a/60),D=Math.floor(a%60);return l>0?`[${l}m ${D}s]`:`[${D}s]`},H=(g="")=>{F=!0,d=fD(),w=R(g),A=performance.now(),process.stdout.write(`${C.gray(Ke)}\n`);let M=0,_=0;j(),y=setInterval((()=>{if(D&&w===S)return;B(),S=w;const l=C.magenta(a[M]);if(D)process.stdout.write(`${l} ${w}...`);else if(s==="timer")process.stdout.write(`${l} ${w} ${O(A)}`);else{const s=".".repeat(Math.floor(_)).slice(0,3);process.stdout.write(`${l} ${w}${s}`)}M=M+1<a.length?M+1:0,_=_<a.length?_+.125:0}),l)},N=(a="",l=0)=>{F=!1,clearInterval(y),B();const D=l===0?C.green(qe):l===1?C.red(Ve):C.red(ze);w=R(a??w),s==="timer"?process.stdout.write(`${D} ${w} ${O(A)}\n`):process.stdout.write(`${D} ${w}\n`),E(),d()};return{start:H,stop:N,message:(s="")=>{w=R(s??w)}}},Ce=async(s,a)=>{const l={},D=Object.keys(s);for(const d of D){const D=s[d],g=await(D({results:l})?.catch((s=>{throw s})));if(typeof a?.onCancel=="function"&&ie(g)){l[d]="canceled",a.onCancel({results:l});continue}l[d]=g}return l},Te=async s=>{for(const a of s){if(a.enabled===!1)continue;const s=dist_Y();s.start(a.title);const l=await a.task(s.message);s.stop(l||a.title)}}},137:(a,l,D)=>{D.d(l,{Ho:()=>hr});function isPlainObject(s){if(typeof s!=="object"||s===null){return false}const a=Object.getPrototypeOf(s);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)}var d=D(136);const safeNormalizeFileUrl=(s,a)=>{const l=normalizeFileUrl(normalizeDenoExecPath(s));if(typeof l!=="string"){throw new TypeError(`${a} must be a string or a file URL: ${l}.`)}return l};const normalizeDenoExecPath=s=>isDenoExecPath(s)?s.toString():s;const isDenoExecPath=s=>typeof s!=="string"&&s&&Object.getPrototypeOf(s)===String.prototype;const normalizeFileUrl=s=>s instanceof URL?(0,d.fileURLToPath)(s):s;const normalizeParameters=(s,a=[],l={})=>{const D=safeNormalizeFileUrl(s,"First argument");const[d,g]=isPlainObject(a)?[[],a]:[a,l];if(!Array.isArray(d)){throw new TypeError(`Second argument must be either an array of arguments or an options object: ${d}`)}if(d.some((s=>typeof s==="object"&&s!==null))){throw new TypeError(`Second argument must be an array of strings: ${d}`)}const y=d.map(String);const F=y.find((s=>s.includes("\0")));if(F!==undefined){throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${F}`)}if(!isPlainObject(g)){throw new TypeError(`Last argument must be an options object: ${g}`)}return[D,y,g]};const g=s(import.meta.url)("node:child_process");const y=s(import.meta.url)("node:string_decoder");const{toString:F}=Object.prototype;const isArrayBuffer=s=>F.call(s)==="[object ArrayBuffer]";const isUint8Array=s=>F.call(s)==="[object Uint8Array]";const bufferToUint8Array=s=>new Uint8Array(s.buffer,s.byteOffset,s.byteLength);const w=new TextEncoder;const stringToUint8Array=s=>w.encode(s);const C=new TextDecoder;const uint8ArrayToString=s=>C.decode(s);const joinToString=(s,a)=>{const l=uint8ArraysToStrings(s,a);return l.join("")};const uint8ArraysToStrings=(s,a)=>{if(a==="utf8"&&s.every((s=>typeof s==="string"))){return s}const l=new y.StringDecoder(a);const D=s.map((s=>typeof s==="string"?stringToUint8Array(s):s)).map((s=>l.write(s)));const d=l.end();return d===""?D:[...D,d]};const joinToUint8Array=s=>{if(s.length===1&&isUint8Array(s[0])){return s[0]}return concatUint8Arrays(stringsToUint8Arrays(s))};const stringsToUint8Arrays=s=>s.map((s=>typeof s==="string"?stringToUint8Array(s):s));const concatUint8Arrays=s=>{const a=new Uint8Array(getJoinLength(s));let l=0;for(const D of s){a.set(D,l);l+=D.length}return a};const getJoinLength=s=>{let a=0;for(const l of s){a+=l.length}return a};const isTemplateString=s=>Array.isArray(s)&&Array.isArray(s.raw);const parseTemplates=(s,a)=>{let l=[];for(const[D,d]of s.entries()){l=parseTemplate({templates:s,expressions:a,tokens:l,index:D,template:d})}if(l.length===0){throw new TypeError("Template script must not be empty")}const[D,...d]=l;return[D,d,{}]};const parseTemplate=({templates:s,expressions:a,tokens:l,index:D,template:d})=>{if(d===undefined){throw new TypeError(`Invalid backslash sequence: ${s.raw[D]}`)}const{nextTokens:g,leadingWhitespaces:y,trailingWhitespaces:F}=splitByWhitespaces(d,s.raw[D]);const w=concatTokens(l,g,y);if(D===a.length){return w}const C=a[D];const S=Array.isArray(C)?C.map((s=>parseExpression(s))):[parseExpression(C)];return concatTokens(w,S,F)};const splitByWhitespaces=(s,a)=>{if(a.length===0){return{nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false}}const l=[];let D=0;const d=S.has(a[0]);for(let d=0,g=0;d<s.length;d+=1,g+=1){const y=a[g];if(S.has(y)){if(D!==d){l.push(s.slice(D,d))}D=d+1}else if(y==="\\"){const s=a[g+1];if(s==="\n"){d-=1;g+=1}else if(s==="u"&&a[g+2]==="{"){g=a.indexOf("}",g+3)}else{g+=A[s]??1}}}const g=D===s.length;if(!g){l.push(s.slice(D))}return{nextTokens:l,leadingWhitespaces:d,trailingWhitespaces:g}};const S=new Set([" ","\t","\r","\n"]);const A={x:3,u:5};const concatTokens=(s,a,l)=>l||s.length===0||a.length===0?[...s,...a]:[...s.slice(0,-1),`${s.at(-1)}${a[0]}`,...a.slice(1)];const parseExpression=s=>{const a=typeof s;if(a==="string"){return s}if(a==="number"){return String(s)}if(isPlainObject(s)&&("stdout"in s||"isMaxBuffer"in s)){return getSubprocessResult(s)}if(s instanceof g.ChildProcess||Object.prototype.toString.call(s)==="[object Promise]"){throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.")}throw new TypeError(`Unexpected "${a}" in template expression`)};const getSubprocessResult=({stdout:s})=>{if(typeof s==="string"){return s}if(isUint8Array(s)){return uint8ArrayToString(s)}if(s===undefined){throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.')}throw new TypeError(`Unexpected "${typeof s}" stdout in template expression`)};var M=D(975);var _=D(708);const isStandardStream=s=>G.includes(s);const G=[_.stdin,_.stdout,_.stderr];const W=["stdin","stdout","stderr"];const getStreamName=s=>W[s]??`stdio[${s}]`;const normalizeFdSpecificOptions=s=>{const a={...s};for(const l of te){a[l]=normalizeFdSpecificOption(s,l)}return a};const normalizeFdSpecificOption=(s,a)=>{const l=Array.from({length:getStdioLength(s)+1});const D=normalizeFdSpecificValue(s[a],l,a);return addDefaultValue(D,a)};const getStdioLength=({stdio:s})=>Array.isArray(s)?Math.max(s.length,W.length):W.length;const normalizeFdSpecificValue=(s,a,l)=>isPlainObject(s)?normalizeOptionObject(s,a,l):a.fill(s);const normalizeOptionObject=(s,a,l)=>{for(const D of Object.keys(s).sort(compareFdName)){for(const d of parseFdName(D,l,a)){a[d]=s[D]}}return a};const compareFdName=(s,a)=>getFdNameOrder(s)<getFdNameOrder(a)?1:-1;const getFdNameOrder=s=>{if(s==="stdout"||s==="stderr"){return 0}return s==="all"?2:1};const parseFdName=(s,a,l)=>{if(s==="ipc"){return[l.length-1]}const D=parseFd(s);if(D===undefined||D===0){throw new TypeError(`"${a}.${s}" is invalid.\nIt must be "${a}.stdout", "${a}.stderr", "${a}.all", "${a}.ipc", or "${a}.fd3", "${a}.fd4" (and so on).`)}if(D>=l.length){throw new TypeError(`"${a}.${s}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}return D==="all"?[1,2]:[D]};const parseFd=s=>{if(s==="all"){return s}if(W.includes(s)){return W.indexOf(s)}const a=V.exec(s);if(a!==null){return Number(a[1])}};const V=/^fd(\d+)$/;const addDefaultValue=(s,a)=>s.map((s=>s===undefined?ee[a]:s));const X=(0,M.debuglog)("execa").enabled?"full":"none";const ee={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:X,stripFinalNewline:true};const te=["lines","buffer","maxBuffer","verbose","stripFinalNewline"];const getFdSpecificValue=(s,a)=>a==="ipc"?s.at(-1):s[a];const isVerbose=({verbose:s},a)=>getFdVerbose(s,a)!=="none";const isFullVerbose=({verbose:s},a)=>!["none","short"].includes(getFdVerbose(s,a));const getVerboseFunction=({verbose:s},a)=>{const l=getFdVerbose(s,a);return isVerboseFunction(l)?l:undefined};const getFdVerbose=(s,a)=>a===undefined?getFdGenericVerbose(s):getFdSpecificValue(s,a);const getFdGenericVerbose=s=>s.find((s=>isVerboseFunction(s)))??ne.findLast((a=>s.includes(a)));const isVerboseFunction=s=>typeof s==="function";const ne=["none","short","full"];const joinCommand=(s,a)=>{const l=[s,...a];const D=l.join(" ");const d=l.map((s=>quoteString(escapeControlCharacters(s)))).join(" ");return{command:D,escapedCommand:d}};const escapeLines=s=>(0,M.stripVTControlCharacters)(s).split("\n").map((s=>escapeControlCharacters(s))).join("\n");const escapeControlCharacters=s=>s.replaceAll(re,(s=>escapeControlCharacter(s)));const escapeControlCharacter=s=>{const a=se[s];if(a!==undefined){return a}const l=s.codePointAt(0);const D=l.toString(16);return l<=oe?`\\u${D.padStart(4,"0")}`:`\\U${D}`};const getSpecialCharRegExp=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}};const re=getSpecialCharRegExp();const se={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};const oe=65535;const quoteString=s=>{if(ie.test(s)){return s}return _.platform==="win32"?`"${s.replaceAll('"','""')}"`:`'${s.replaceAll("'","'\\''")}'`};const ie=/^[\w./-]+$/;function isUnicodeSupported(){const{env:s}=_;const{TERM:a,TERM_PROGRAM:l}=s;if(_.platform!=="win32"){return a!=="linux"}return Boolean(s.WT_SESSION)||Boolean(s.TERMINUS_SUBLIME)||s.ConEmuTask==="{cmd::Cmder}"||l==="Terminus-Sublime"||l==="vscode"||a==="xterm-256color"||a==="alacritty"||a==="rxvt-unicode"||a==="rxvt-unicode-256color"||s.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const ue={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:"╱"};const ae={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:"⅒"};const le={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"};const De={...ue,...ae};const de={...ue,...le};const pe=isUnicodeSupported();const me=pe?De:de;const Fe=me;const Ee=Object.entries(ae);const replaceSymbols=(s,{useFallback:a=!pe}={})=>{if(a){for(const[a,l]of Ee){s=s.replaceAll(l,de[a])}}return s};const Be=s(import.meta.url)("node:tty");const $e=Be?.WriteStream?.prototype?.hasColors?.()??false;const format=(s,a)=>{if(!$e){return s=>s}const l=`[${s}m`;const D=`[${a}m`;return s=>{const a=s+"";let d=a.indexOf(D);if(d===-1){return l+a+D}let g=l;let y=0;while(d!==-1){g+=a.slice(y,d)+l;y=d+D.length;d=a.indexOf(D,y)}g+=a.slice(y)+D;return g}};const Ae=format(0,0);const Oe=format(1,22);const ke=format(2,22);const Ne=format(3,23);const je=format(4,24);const Pe=format(53,55);const Re=format(7,27);const Le=format(8,28);const _e=format(9,29);const Ue=format(30,39);const Ge=format(31,39);const We=format(32,39);const Ve=format(33,39);const ze=format(34,39);const qe=format(35,39);const He=format(36,39);const Ke=format(37,39);const Ye=format(90,39);const Je=format(40,49);const Ze=format(41,49);const Xe=format(42,49);const Qe=format(43,49);const et=format(44,49);const tt=format(45,49);const nt=format(46,49);const rt=format(47,49);const st=format(100,49);const ot=format(91,39);const it=format(92,39);const ut=format(93,39);const at=format(94,39);const ct=format(95,39);const lt=format(96,39);const Dt=format(97,39);const dt=format(101,49);const ft=format(102,49);const pt=format(103,49);const mt=format(104,49);const ht=format(105,49);const bt=format(106,49);const gt=format(107,49);const defaultVerboseFunction=({type:s,message:a,timestamp:l,piped:D,commandId:d,result:{failed:g=false}={},options:{reject:y=true}})=>{const F=serializeTimestamp(l);const w=yt[s]({failed:g,reject:y,piped:D});const C=Ft[s]({reject:y});return`${Ye(`[${F}]`)} ${Ye(`[${d}]`)} ${C(w)} ${C(a)}`};const serializeTimestamp=s=>`${padField(s.getHours(),2)}:${padField(s.getMinutes(),2)}:${padField(s.getSeconds(),2)}.${padField(s.getMilliseconds(),3)}`;const padField=(s,a)=>String(s).padStart(a,"0");const getFinalIcon=({failed:s,reject:a})=>{if(!s){return Fe.tick}return a?Fe.cross:Fe.warning};const yt={command:({piped:s})=>s?"|":"$",output:()=>" ",ipc:()=>"*",error:getFinalIcon,duration:getFinalIcon};const identity=s=>s;const Ft={command:()=>Oe,output:()=>identity,ipc:()=>identity,error:({reject:s})=>s?ot:ut,duration:()=>Ye};const applyVerboseOnLines=(s,a,l)=>{const D=getVerboseFunction(a,l);return s.map((({verboseLine:s,verboseObject:a})=>applyVerboseFunction(s,a,D))).filter((s=>s!==undefined)).map((s=>appendNewline(s))).join("")};const applyVerboseFunction=(s,a,l)=>{if(l===undefined){return s}const D=l(s,a);if(typeof D==="string"){return D}};const appendNewline=s=>s.endsWith("\n")?s:`${s}\n`;const verboseLog=({type:s,verboseMessage:a,fdNumber:l,verboseInfo:D,result:d})=>{const g=getVerboseObject({type:s,result:d,verboseInfo:D});const y=getPrintedLines(a,g);const F=applyVerboseOnLines(y,D,l);if(F!==""){console.warn(F.slice(0,-1))}};const getVerboseObject=({type:s,result:a,verboseInfo:{escapedCommand:l,commandId:D,rawOptions:{piped:d=false,...g}}})=>({type:s,escapedCommand:l,commandId:`${D}`,timestamp:new Date,piped:d,result:a,options:g});const getPrintedLines=(s,a)=>s.split("\n").map((s=>getPrintedLine({...a,message:s})));const getPrintedLine=s=>{const a=defaultVerboseFunction(s);return{verboseLine:a,verboseObject:s}};const serializeVerboseMessage=s=>{const a=typeof s==="string"?s:(0,M.inspect)(s);const l=escapeLines(a);return l.replaceAll("\t"," ".repeat(wt))};const wt=2;const logCommand=(s,a)=>{if(!isVerbose(a)){return}verboseLog({type:"command",verboseMessage:s,verboseInfo:a})};const getVerboseInfo=(s,a,l)=>{validateVerbose(s);const D=getCommandId(s);return{verbose:s,escapedCommand:a,commandId:D,rawOptions:l}};const getCommandId=s=>isVerbose({verbose:s})?Ct++:undefined;let Ct=0n;const validateVerbose=s=>{for(const a of s){if(a===false){throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".')}if(a===true){throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".')}if(!ne.includes(a)&&!isVerboseFunction(a)){const s=ne.map((s=>`'${s}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${a}. Allowed values are: ${s} or a function.`)}}};const getStartTime=()=>_.hrtime.bigint();const getDurationMs=s=>Number(_.hrtime.bigint()-s)/1e6;const handleCommand=(s,a,l)=>{const D=getStartTime();const{command:d,escapedCommand:g}=joinCommand(s,a);const y=normalizeFdSpecificOption(l,"verbose");const F=getVerboseInfo(y,g,{...l});logCommand(g,F);return{command:d,escapedCommand:g,startTime:D,verboseInfo:F}};var Et=D(760);var vt=D(297);function pathKey(s={}){const{env:a=process.env,platform:l=process.platform}=s;if(l!=="win32"){return"PATH"}return Object.keys(a).reverse().find((s=>s.toUpperCase()==="PATH"))||"Path"}const St=(0,M.promisify)(g.execFile);function toPath(s){return s instanceof URL?(0,d.fileURLToPath)(s):s}function rootDirectory(s){return path.parse(toPath(s)).root}function traversePathUp(s){return{*[Symbol.iterator](){let a=Et.resolve(toPath(s));let l;while(l!==a){yield a;l=a;a=Et.resolve(a,"..")}}}}const Bt=null&&10*1024*1024;async function execFile(s,a,l={}){return St(s,a,{maxBuffer:Bt,...l})}function execFileSync(s,a=[],l={}){return execFileSyncOriginal(s,a,{maxBuffer:Bt,encoding:"utf8",stdio:"pipe",...l})}const npmRunPath=({cwd:s=_.cwd(),path:a=_.env[pathKey()],preferLocal:l=true,execPath:D=_.execPath,addExecPath:d=true}={})=>{const g=Et.resolve(toPath(s));const y=[];const F=a.split(Et.delimiter);if(l){applyPreferLocal(y,F,g)}if(d){applyExecPath(y,F,D,g)}return a===""||a===Et.delimiter?`${y.join(Et.delimiter)}${a}`:[...y,a].join(Et.delimiter)};const applyPreferLocal=(s,a,l)=>{for(const D of traversePathUp(l)){const l=Et.join(D,"node_modules/.bin");if(!a.includes(l)){s.push(l)}}};const applyExecPath=(s,a,l,D)=>{const d=Et.resolve(D,toPath(l),"..");if(!a.includes(d)){s.push(d)}};const npmRunPathEnv=({env:s=_.env,...a}={})=>{s={...s};const l=pathKey({env:s});a.path=s[l];s[l]=npmRunPath(a);return s};const $t=s(import.meta.url)("node:timers/promises");const getFinalError=(s,a,l)=>{const D=l?ExecaSyncError:ExecaError;const d=s instanceof DiscardedError?{}:{cause:s};return new D(a,d)};class DiscardedError extends Error{}const setErrorName=(s,a)=>{Object.defineProperty(s.prototype,"name",{value:a,writable:true,enumerable:false,configurable:true});Object.defineProperty(s.prototype,xt,{value:true,writable:false,enumerable:false,configurable:false})};const isExecaError=s=>isErrorInstance(s)&&xt in s;const xt=Symbol("isExecaError");const isErrorInstance=s=>Object.prototype.toString.call(s)==="[object Error]";class ExecaError extends Error{}setErrorName(ExecaError,ExecaError.name);class ExecaSyncError extends Error{}setErrorName(ExecaSyncError,ExecaSyncError.name);const At=s(import.meta.url)("node:os");const getRealtimeSignals=()=>{const s=Ot-Tt+1;return Array.from({length:s},getRealtimeSignal)};const getRealtimeSignal=(s,a)=>({name:`SIGRT${a+1}`,number:Tt+a,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"});const Tt=34;const Ot=64;const It=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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"}];const getSignals=()=>{const s=getRealtimeSignals();const a=[...It,...s].map(normalizeSignal);return a};const normalizeSignal=({name:s,number:a,description:l,action:D,forced:d=false,standard:g})=>{const{signals:{[s]:y}}=At.constants;const F=y!==undefined;const w=F?y:a;return{name:s,number:w,description:l,supported:F,action:D,forced:d,standard:g}};const getSignalsByName=()=>{const s=getSignals();return Object.fromEntries(s.map(getSignalByName))};const getSignalByName=({name:s,number:a,description:l,supported:D,action:d,forced:g,standard:y})=>[s,{name:s,number:a,description:l,supported:D,action:d,forced:g,standard:y}];const Mt=getSignalsByName();const getSignalsByNumber=()=>{const s=getSignals();const a=Ot+1;const l=Array.from({length:a},((a,l)=>getSignalByNumber(l,s)));return Object.assign({},...l)};const getSignalByNumber=(s,a)=>{const l=findSignalByNumber(s,a);if(l===undefined){return{}}const{name:D,description:d,supported:g,action:y,forced:F,standard:w}=l;return{[s]:{name:D,number:s,description:d,supported:g,action:y,forced:F,standard:w}}};const findSignalByNumber=(s,a)=>{const l=a.find((({name:a})=>At.constants.signals[a]===s));if(l!==undefined){return l}return a.find((a=>a.number===s))};const kt=getSignalsByNumber();const normalizeKillSignal=s=>{const a="option `killSignal`";if(s===0){throw new TypeError(`Invalid ${a}: 0 cannot be used.`)}return signal_normalizeSignal(s,a)};const normalizeSignalArgument=s=>s===0?s:signal_normalizeSignal(s,"`subprocess.kill()`'s argument");const signal_normalizeSignal=(s,a)=>{if(Number.isInteger(s)){return normalizeSignalInteger(s,a)}if(typeof s==="string"){return normalizeSignalName(s,a)}throw new TypeError(`Invalid ${a} ${String(s)}: it must be a string or an integer.\n${getAvailableSignals()}`)};const normalizeSignalInteger=(s,a)=>{if(Nt.has(s)){return Nt.get(s)}throw new TypeError(`Invalid ${a} ${s}: this signal integer does not exist.\n${getAvailableSignals()}`)};const getSignalsIntegerToName=()=>new Map(Object.entries(At.constants.signals).reverse().map((([s,a])=>[a,s])));const Nt=getSignalsIntegerToName();const normalizeSignalName=(s,a)=>{if(s in At.constants.signals){return s}if(s.toUpperCase()in At.constants.signals){throw new TypeError(`Invalid ${a} '${s}': please rename it to '${s.toUpperCase()}'.`)}throw new TypeError(`Invalid ${a} '${s}': this signal name does not exist.\n${getAvailableSignals()}`)};const getAvailableSignals=()=>`Available signal names: ${getAvailableSignalNames()}.\nAvailable signal numbers: ${getAvailableSignalIntegers()}.`;const getAvailableSignalNames=()=>Object.keys(At.constants.signals).sort().map((s=>`'${s}'`)).join(", ");const getAvailableSignalIntegers=()=>[...new Set(Object.values(At.constants.signals).sort(((s,a)=>s-a)))].join(", ");const getSignalDescription=s=>Mt[s].description;const normalizeForceKillAfterDelay=s=>{if(s===false){return s}if(s===true){return jt}if(!Number.isFinite(s)||s<0){throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${s}\` (${typeof s})`)}return s};const jt=1e3*5;const subprocessKill=({kill:s,options:{forceKillAfterDelay:a,killSignal:l},onInternalError:D,context:d,controller:g},y,F)=>{const{signal:w,error:C}=parseKillArguments(y,F,l);emitKillError(C,D);const S=s(w);setKillTimeout({kill:s,signal:w,forceKillAfterDelay:a,killSignal:l,killResult:S,context:d,controller:g});return S};const parseKillArguments=(s,a,l)=>{const[D=l,d]=isErrorInstance(s)?[undefined,s]:[s,a];if(typeof D!=="string"&&!Number.isInteger(D)){throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(D)}`)}if(d!==undefined&&!isErrorInstance(d)){throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${d}`)}return{signal:normalizeSignalArgument(D),error:d}};const emitKillError=(s,a)=>{if(s!==undefined){a.reject(s)}};const setKillTimeout=async({kill:s,signal:a,forceKillAfterDelay:l,killSignal:D,killResult:d,context:g,controller:y})=>{if(a===D&&d){killOnTimeout({kill:s,forceKillAfterDelay:l,context:g,controllerSignal:y.signal})}};const killOnTimeout=async({kill:s,forceKillAfterDelay:a,context:l,controllerSignal:D})=>{if(a===false){return}try{await(0,$t.setTimeout)(a,undefined,{signal:D});if(s("SIGKILL")){l.isForcefullyTerminated??=true}}catch{}};const Pt=s(import.meta.url)("node:events");const onAbortedSignal=async(s,a)=>{if(!s.aborted){await(0,Pt.once)(s,"abort",{signal:a})}};const validateCancelSignal=({cancelSignal:s})=>{if(s!==undefined&&Object.prototype.toString.call(s)!=="[object AbortSignal]"){throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(s)}`)}};const throwOnCancel=({subprocess:s,cancelSignal:a,gracefulCancel:l,context:D,controller:d})=>a===undefined||l?[]:[terminateOnCancel(s,a,D,d)];const terminateOnCancel=async(s,a,l,{signal:D})=>{await onAbortedSignal(a,D);l.terminationReason??="cancel";s.kill();throw a.reason};const validateIpcMethod=({methodName:s,isSubprocess:a,ipc:l,isConnected:D})=>{validateIpcOption(s,a,l);validateConnection(s,a,D)};const validateIpcOption=(s,a,l)=>{if(!l){throw new Error(`${getMethodName(s,a)} can only be used if the \`ipc\` option is \`true\`.`)}};const validateConnection=(s,a,l)=>{if(!l){throw new Error(`${getMethodName(s,a)} cannot be used: the ${getOtherProcessName(a)} has already exited or disconnected.`)}};const throwOnEarlyDisconnect=s=>{throw new Error(`${getMethodName("getOneMessage",s)} could not complete: the ${getOtherProcessName(s)} exited or disconnected.`)};const throwOnStrictDeadlockError=s=>{throw new Error(`${getMethodName("sendMessage",s)} failed: the ${getOtherProcessName(s)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${getMethodName("getOneMessage",s)},\n\t${getMethodName("sendMessage",s,"message, {strict: true}")},\n]);`)};const getStrictResponseError=(s,a)=>new Error(`${getMethodName("sendMessage",a)} failed when sending an acknowledgment response to the ${getOtherProcessName(a)}.`,{cause:s});const throwOnMissingStrict=s=>{throw new Error(`${getMethodName("sendMessage",s)} failed: the ${getOtherProcessName(s)} is not listening to incoming messages.`)};const throwOnStrictDisconnect=s=>{throw new Error(`${getMethodName("sendMessage",s)} failed: the ${getOtherProcessName(s)} exited without listening to incoming messages.`)};const getAbortDisconnectError=()=>new Error(`\`cancelSignal\` aborted: the ${getOtherProcessName(true)} disconnected.`);const throwOnMissingParent=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")};const handleEpipeError=({error:s,methodName:a,isSubprocess:l})=>{if(s.code==="EPIPE"){throw new Error(`${getMethodName(a,l)} cannot be used: the ${getOtherProcessName(l)} is disconnecting.`,{cause:s})}};const handleSerializationError=({error:s,methodName:a,isSubprocess:l,message:D})=>{if(isSerializationError(s)){throw new Error(`${getMethodName(a,l)}'s argument type is invalid: the message cannot be serialized: ${String(D)}.`,{cause:s})}};const isSerializationError=({code:s,message:a})=>Rt.has(s)||Lt.some((s=>a.includes(s)));const Rt=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]);const Lt=["could not be cloned","circular structure","call stack size exceeded"];const getMethodName=(s,a,l="")=>s==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${getNamespaceName(a)}${s}(${l})`;const getNamespaceName=s=>s?"":"subprocess.";const getOtherProcessName=s=>s?"parent process":"subprocess";const disconnect=s=>{if(s.connected){s.disconnect()}};const createDeferred=()=>{const s={};const a=new Promise(((a,l)=>{Object.assign(s,{resolve:a,reject:l})}));return Object.assign(a,s)};const getToStream=(s,a="stdin")=>{const l=true;const{options:D,fileDescriptors:d}=_t.get(s);const g=getFdNumber(d,a,l);const y=s.stdio[g];if(y===null){throw new TypeError(getInvalidStdioOptionMessage(g,a,D,l))}return y};const getFromStream=(s,a="stdout")=>{const l=false;const{options:D,fileDescriptors:d}=_t.get(s);const g=getFdNumber(d,a,l);const y=g==="all"?s.all:s.stdio[g];if(y===null||y===undefined){throw new TypeError(getInvalidStdioOptionMessage(g,a,D,l))}return y};const _t=new WeakMap;const getFdNumber=(s,a,l)=>{const D=parseFdNumber(a,l);validateFdNumber(D,a,l,s);return D};const parseFdNumber=(s,a)=>{const l=parseFd(s);if(l!==undefined){return l}const{validOptions:D,defaultValue:d}=a?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${getOptionName(a)}" must not be "${s}".\nIt must be ${D} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${d}".`)};const validateFdNumber=(s,a,l,D)=>{const d=D[getUsedDescriptor(s)];if(d===undefined){throw new TypeError(`"${getOptionName(l)}" must not be ${a}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}if(d.direction==="input"&&!l){throw new TypeError(`"${getOptionName(l)}" must not be ${a}. It must be a readable stream, not writable.`)}if(d.direction!=="input"&&l){throw new TypeError(`"${getOptionName(l)}" must not be ${a}. It must be a writable stream, not readable.`)}};const getInvalidStdioOptionMessage=(s,a,l,D)=>{if(s==="all"&&!l.all){return'The "all" option must be true to use "from: \'all\'".'}const{optionName:d,optionValue:g}=getInvalidStdioOption(s,l);return`The "${d}: ${serializeOptionValue(g)}" option is incompatible with using "${getOptionName(D)}: ${serializeOptionValue(a)}".\nPlease set this option with "pipe" instead.`};const getInvalidStdioOption=(s,{stdin:a,stdout:l,stderr:D,stdio:d})=>{const g=getUsedDescriptor(s);if(g===0&&a!==undefined){return{optionName:"stdin",optionValue:a}}if(g===1&&l!==undefined){return{optionName:"stdout",optionValue:l}}if(g===2&&D!==undefined){return{optionName:"stderr",optionValue:D}}return{optionName:`stdio[${g}]`,optionValue:d[g]}};const getUsedDescriptor=s=>s==="all"?1:s;const getOptionName=s=>s?"to":"from";const serializeOptionValue=s=>{if(typeof s==="string"){return`'${s}'`}return typeof s==="number"?`${s}`:"Stream"};const incrementMaxListeners=(s,a,l)=>{const D=s.getMaxListeners();if(D===0||D===Number.POSITIVE_INFINITY){return}s.setMaxListeners(D+a);(0,Pt.addAbortListener)(l,(()=>{s.setMaxListeners(s.getMaxListeners()-a)}))};const addReference=(s,a)=>{if(a){addReferenceCount(s)}};const addReferenceCount=s=>{s.refCounted()};const removeReference=(s,a)=>{if(a){removeReferenceCount(s)}};const removeReferenceCount=s=>{s.unrefCounted()};const undoAddedReferences=(s,a)=>{if(a){removeReferenceCount(s);removeReferenceCount(s)}};const redoAddedReferences=(s,a)=>{if(a){addReferenceCount(s);addReferenceCount(s)}};const onMessage=async({anyProcess:s,channel:a,isSubprocess:l,ipcEmitter:D},d)=>{if(handleStrictResponse(d)||handleAbort(d)){return}if(!Ut.has(s)){Ut.set(s,[])}const g=Ut.get(s);g.push(d);if(g.length>1){return}while(g.length>0){await waitForOutgoingMessages(s,D,d);await $t.scheduler.yield();const y=await handleStrictRequest({wrappedMessage:g[0],anyProcess:s,channel:a,isSubprocess:l,ipcEmitter:D});g.shift();D.emit("message",y);D.emit("message:done")}};const onDisconnect=async({anyProcess:s,channel:a,isSubprocess:l,ipcEmitter:D,boundOnMessage:d})=>{abortOnDisconnect();const g=Ut.get(s);while(g?.length>0){await(0,Pt.once)(D,"message:done")}s.removeListener("message",d);redoAddedReferences(a,l);D.connected=false;D.emit("disconnect")};const Ut=new WeakMap;const getIpcEmitter=(s,a,l)=>{if(Gt.has(s)){return Gt.get(s)}const D=new Pt.EventEmitter;D.connected=true;Gt.set(s,D);forwardEvents({ipcEmitter:D,anyProcess:s,channel:a,isSubprocess:l});return D};const Gt=new WeakMap;const forwardEvents=({ipcEmitter:s,anyProcess:a,channel:l,isSubprocess:D})=>{const d=onMessage.bind(undefined,{anyProcess:a,channel:l,isSubprocess:D,ipcEmitter:s});a.on("message",d);a.once("disconnect",onDisconnect.bind(undefined,{anyProcess:a,channel:l,isSubprocess:D,ipcEmitter:s,boundOnMessage:d}));undoAddedReferences(l,D)};const isConnected=s=>{const a=Gt.get(s);return a===undefined?s.channel!==null:a.connected};const handleSendStrict=({anyProcess:s,channel:a,isSubprocess:l,message:D,strict:d})=>{if(!d){return D}const g=getIpcEmitter(s,a,l);const y=hasMessageListeners(s,g);return{id:Wt++,type:zt,message:D,hasListeners:y}};let Wt=0n;const validateStrictDeadlock=(s,a)=>{if(a?.type!==zt||a.hasListeners){return}for(const{id:a}of s){if(a!==undefined){Vt[a].resolve({isDeadlock:true,hasListeners:false})}}};const handleStrictRequest=async({wrappedMessage:s,anyProcess:a,channel:l,isSubprocess:D,ipcEmitter:d})=>{if(s?.type!==zt||!a.connected){return s}const{id:g,message:y}=s;const F={id:g,type:qt,message:hasMessageListeners(a,d)};try{await sendMessage({anyProcess:a,channel:l,isSubprocess:D,ipc:true},F)}catch(s){d.emit("strict:error",s)}return y};const handleStrictResponse=s=>{if(s?.type!==qt){return false}const{id:a,message:l}=s;Vt[a]?.resolve({isDeadlock:false,hasListeners:l});return true};const waitForStrictResponse=async(s,a,l)=>{if(s?.type!==zt){return}const D=createDeferred();Vt[s.id]=D;const d=new AbortController;try{const{isDeadlock:s,hasListeners:g}=await Promise.race([D,throwOnDisconnect(a,l,d)]);if(s){throwOnStrictDeadlockError(l)}if(!g){throwOnMissingStrict(l)}}finally{d.abort();delete Vt[s.id]}};const Vt={};const throwOnDisconnect=async(s,a,{signal:l})=>{incrementMaxListeners(s,1,l);await(0,Pt.once)(s,"disconnect",{signal:l});throwOnStrictDisconnect(a)};const zt="execa:ipc:request";const qt="execa:ipc:response";const startSendMessage=(s,a,l)=>{if(!Ht.has(s)){Ht.set(s,new Set)}const D=Ht.get(s);const d=createDeferred();const g=l?a.id:undefined;const y={onMessageSent:d,id:g};D.add(y);return{outgoingMessages:D,outgoingMessage:y}};const endSendMessage=({outgoingMessages:s,outgoingMessage:a})=>{s.delete(a);a.onMessageSent.resolve()};const waitForOutgoingMessages=async(s,a,l)=>{while(!hasMessageListeners(s,a)&&Ht.get(s)?.size>0){const a=[...Ht.get(s)];validateStrictDeadlock(a,l);await Promise.all(a.map((({onMessageSent:s})=>s)))}};const Ht=new WeakMap;const hasMessageListeners=(s,a)=>a.listenerCount("message")>getMinListenerCount(s);const getMinListenerCount=s=>_t.has(s)&&!getFdSpecificValue(_t.get(s).options.buffer,"ipc")?1:0;const sendMessage=({anyProcess:s,channel:a,isSubprocess:l,ipc:D},d,{strict:g=false}={})=>{const y="sendMessage";validateIpcMethod({methodName:y,isSubprocess:l,ipc:D,isConnected:s.connected});return sendMessageAsync({anyProcess:s,channel:a,methodName:y,isSubprocess:l,message:d,strict:g})};const sendMessageAsync=async({anyProcess:s,channel:a,methodName:l,isSubprocess:D,message:d,strict:g})=>{const y=handleSendStrict({anyProcess:s,channel:a,isSubprocess:D,message:d,strict:g});const F=startSendMessage(s,y,g);try{await sendOneMessage({anyProcess:s,methodName:l,isSubprocess:D,wrappedMessage:y,message:d})}catch(a){disconnect(s);throw a}finally{endSendMessage(F)}};const sendOneMessage=async({anyProcess:s,methodName:a,isSubprocess:l,wrappedMessage:D,message:d})=>{const g=getSendMethod(s);try{await Promise.all([waitForStrictResponse(D,s,l),g(D)])}catch(s){handleEpipeError({error:s,methodName:a,isSubprocess:l});handleSerializationError({error:s,methodName:a,isSubprocess:l,message:d});throw s}};const getSendMethod=s=>{if(Kt.has(s)){return Kt.get(s)}const a=(0,M.promisify)(s.send.bind(s));Kt.set(s,a);return a};const Kt=new WeakMap;const sendAbort=(s,a)=>{const l="cancelSignal";validateConnection(l,false,s.connected);return sendOneMessage({anyProcess:s,methodName:l,isSubprocess:false,wrappedMessage:{type:Jt,message:a},message:a})};const getCancelSignal=async({anyProcess:s,channel:a,isSubprocess:l,ipc:D})=>{await startIpc({anyProcess:s,channel:a,isSubprocess:l,ipc:D});return Zt.signal};const startIpc=async({anyProcess:s,channel:a,isSubprocess:l,ipc:D})=>{if(Yt){return}Yt=true;if(!D){throwOnMissingParent();return}if(a===null){abortOnDisconnect();return}getIpcEmitter(s,a,l);await $t.scheduler.yield()};let Yt=false;const handleAbort=s=>{if(s?.type!==Jt){return false}Zt.abort(s.message);return true};const Jt="execa:ipc:cancel";const abortOnDisconnect=()=>{Zt.abort(getAbortDisconnectError())};const Zt=new AbortController;const validateGracefulCancel=({gracefulCancel:s,cancelSignal:a,ipc:l,serialization:D})=>{if(!s){return}if(a===undefined){throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.")}if(!l){throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.")}if(D==="json"){throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}};const throwOnGracefulCancel=({subprocess:s,cancelSignal:a,gracefulCancel:l,forceKillAfterDelay:D,context:d,controller:g})=>l?[sendOnAbort({subprocess:s,cancelSignal:a,forceKillAfterDelay:D,context:d,controller:g})]:[];const sendOnAbort=async({subprocess:s,cancelSignal:a,forceKillAfterDelay:l,context:D,controller:{signal:d}})=>{await onAbortedSignal(a,d);const g=getReason(a);await sendAbort(s,g);killOnTimeout({kill:s.kill,forceKillAfterDelay:l,context:D,controllerSignal:d});D.terminationReason??="gracefulCancel";throw a.reason};const getReason=({reason:s})=>{if(!(s instanceof DOMException)){return s}const a=new Error(s.message);Object.defineProperty(a,"stack",{value:s.stack,enumerable:false,configurable:true,writable:true});return a};const validateTimeout=({timeout:s})=>{if(s!==undefined&&(!Number.isFinite(s)||s<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${s}\` (${typeof s})`)}};const throwOnTimeout=(s,a,l,D)=>a===0||a===undefined?[]:[killAfterTimeout(s,a,l,D)];const killAfterTimeout=async(s,a,l,{signal:D})=>{await(0,$t.setTimeout)(a,undefined,{signal:D});l.terminationReason??="timeout";s.kill();throw new DiscardedError};const mapNode=({options:s})=>{if(s.node===false){throw new TypeError('The "node" option cannot be false with `execaNode()`.')}return{options:{...s,node:true}}};const handleNodeOption=(s,a,{node:l=false,nodePath:D=_.execPath,nodeOptions:d=_.execArgv.filter((s=>!s.startsWith("--inspect"))),cwd:g,execPath:y,...F})=>{if(y!==undefined){throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.')}const w=safeNormalizeFileUrl(D,'The "nodePath" option');const C=Et.resolve(g,w);const S={...F,nodePath:C,node:l,cwd:g};if(!l){return[s,a,S]}if(Et.basename(s,".exe")==="node"){throw new TypeError('When the "node" option is true, the first argument does not need to be "node".')}return[C,[...d,s,...a],{ipc:true,...S,shell:false}]};const Xt=s(import.meta.url)("node:v8");const validateIpcInputOption=({ipcInput:s,ipc:a,serialization:l})=>{if(s===undefined){return}if(!a){throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.")}Qt[l](s)};const validateAdvancedInput=s=>{try{(0,Xt.serialize)(s)}catch(s){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:s})}};const validateJsonInput=s=>{try{JSON.stringify(s)}catch(s){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:s})}};const Qt={advanced:validateAdvancedInput,json:validateJsonInput};const sendIpcInput=async(s,a)=>{if(a===undefined){return}await s.sendMessage(a)};const validateEncoding=({encoding:s})=>{if(nn.has(s)){return}const a=getCorrectEncoding(s);if(a!==undefined){throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(s)}\`.\nPlease rename it to ${serializeEncoding(a)}.`)}const l=[...nn].map((s=>serializeEncoding(s))).join(", ");throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(s)}\`.\nPlease rename it to one of: ${l}.`)};const en=new Set(["utf8","utf16le"]);const tn=new Set(["buffer","hex","base64","base64url","latin1","ascii"]);const nn=new Set([...en,...tn]);const getCorrectEncoding=s=>{if(s===null){return"buffer"}if(typeof s!=="string"){return}const a=s.toLowerCase();if(a in rn){return rn[a]}if(nn.has(a)){return a}};const rn={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"};const serializeEncoding=s=>typeof s==="string"?`"${s}"`:String(s);var sn=D(24);const normalizeCwd=(s=getDefaultCwd())=>{const a=safeNormalizeFileUrl(s,'The "cwd" option');return Et.resolve(a)};const getDefaultCwd=()=>{try{return _.cwd()}catch(s){s.message=`The current directory does not exist.\n${s.message}`;throw s}};const fixCwdError=(s,a)=>{if(a===getDefaultCwd()){return s}let l;try{l=(0,sn.statSync)(a)}catch(l){return`The "cwd" option is invalid: ${a}.\n${l.message}\n${s}`}if(!l.isDirectory()){return`The "cwd" option is not a directory: ${a}.\n${s}`}return s};const normalizeOptions=(s,a,l)=>{l.cwd=normalizeCwd(l.cwd);const[D,d,g]=handleNodeOption(s,a,l);const{command:y,args:F,options:w}=vt._parse(D,d,g);const C=normalizeFdSpecificOptions(w);const S=addDefaultOptions(C);validateTimeout(S);validateEncoding(S);validateIpcInputOption(S);validateCancelSignal(S);validateGracefulCancel(S);S.shell=normalizeFileUrl(S.shell);S.env=getEnv(S);S.killSignal=normalizeKillSignal(S.killSignal);S.forceKillAfterDelay=normalizeForceKillAfterDelay(S.forceKillAfterDelay);S.lines=S.lines.map(((s,a)=>s&&!tn.has(S.encoding)&&S.buffer[a]));if(_.platform==="win32"&&Et.basename(y,".exe")==="cmd"){F.unshift("/q")}return{file:y,commandArguments:F,options:S}};const addDefaultOptions=({extendEnv:s=true,preferLocal:a=false,cwd:l,localDir:D=l,encoding:d="utf8",reject:g=true,cleanup:y=true,all:F=false,windowsHide:w=true,killSignal:C="SIGTERM",forceKillAfterDelay:S=true,gracefulCancel:A=false,ipcInput:M,ipc:_=M!==undefined||A,serialization:G="advanced",...W})=>({...W,extendEnv:s,preferLocal:a,cwd:l,localDirectory:D,encoding:d,reject:g,cleanup:y,all:F,windowsHide:w,killSignal:C,forceKillAfterDelay:S,gracefulCancel:A,ipcInput:M,ipc:_,serialization:G});const getEnv=({env:s,extendEnv:a,preferLocal:l,node:D,localDirectory:d,nodePath:g})=>{const y=a?{..._.env,...s}:s;if(l||D){return npmRunPathEnv({env:y,cwd:d,execPath:g,preferLocal:l,addExecPath:D})}return y};const concatenateShell=(s,a,l)=>l.shell&&a.length>0?[[s,...a].join(" "),[],l]:[s,a,l];function strip_final_newline_stripFinalNewline(s){if(typeof s==="string"){return stripFinalNewlineString(s)}if(!(ArrayBuffer.isView(s)&&s.BYTES_PER_ELEMENT===1)){throw new Error("Input must be a string or a Uint8Array")}return stripFinalNewlineBinary(s)}const stripFinalNewlineString=s=>s.at(-1)===on?s.slice(0,s.at(-2)===an?-2:-1):s;const stripFinalNewlineBinary=s=>s.at(-1)===un?s.subarray(0,s.at(-2)===cn?-2:-1):s;const on="\n";const un=on.codePointAt(0);const an="\r";const cn=an.codePointAt(0);function isStream(s,{checkOpen:a=true}={}){return s!==null&&typeof s==="object"&&(s.writable||s.readable||!a||s.writable===undefined&&s.readable===undefined)&&typeof s.pipe==="function"}function isWritableStream(s,{checkOpen:a=true}={}){return isStream(s,{checkOpen:a})&&(s.writable||!a)&&typeof s.write==="function"&&typeof s.end==="function"&&typeof s.writable==="boolean"&&typeof s.writableObjectMode==="boolean"&&typeof s.destroy==="function"&&typeof s.destroyed==="boolean"}function isReadableStream(s,{checkOpen:a=true}={}){return isStream(s,{checkOpen:a})&&(s.readable||!a)&&typeof s.read==="function"&&typeof s.readable==="boolean"&&typeof s.readableObjectMode==="boolean"&&typeof s.destroy==="function"&&typeof s.destroyed==="boolean"}function isDuplexStream(s,a){return isWritableStream(s,a)&&isReadableStream(s,a)}function isTransformStream(s,a){return isDuplexStream(s,a)&&typeof s._transform==="function"}const ln=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class c{#e;#t;#n=!1;#r=void 0;constructor(s,a){this.#e=s,this.#t=a}next(){const e=()=>this.#s();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(s){const t=()=>this.#o(s);return this.#r?this.#r.then(t,t):t()}async#s(){if(this.#n)return{done:!0,value:void 0};let s;try{s=await this.#e.read()}catch(s){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),s}return s.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),s}async#o(s){if(this.#n)return{done:!0,value:s};if(this.#n=!0,!this.#t){const a=this.#e.cancel(s);return this.#e.releaseLock(),await a,{done:!0,value:s}}return this.#e.releaseLock(),{done:!0,value:s}}}const Dn=Symbol();function i(){return this[Dn].next()}Object.defineProperty(i,"name",{value:"next"});function o(s){return this[Dn].return(s)}Object.defineProperty(o,"name",{value:"return"});const dn=Object.create(ln,{next:{enumerable:!0,configurable:!0,writable:!0,value:i},return:{enumerable:!0,configurable:!0,writable:!0,value:o}});function h({preventCancel:s=!1}={}){const a=this.getReader(),l=new c(a,s),D=Object.create(dn);return D[Dn]=l,D}const getAsyncIterable=s=>{if(isReadableStream(s,{checkOpen:false})&&pn.on!==undefined){return getStreamIterable(s)}if(typeof s?.[Symbol.asyncIterator]==="function"){return s}if(fn.call(s)==="[object ReadableStream]"){return h.call(s)}throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")};const{toString:fn}=Object.prototype;const getStreamIterable=async function*(s){const a=new AbortController;const l={};handleStreamEnd(s,a,l);try{for await(const[l]of pn.on(s,"data",{signal:a.signal})){yield l}}catch(s){if(l.error!==undefined){throw l.error}else if(!a.signal.aborted){throw s}}finally{s.destroy()}};const handleStreamEnd=async(s,a,l)=>{try{await pn.finished(s,{cleanup:true,readable:true,writable:false,error:false})}catch(s){l.error=s}finally{a.abort()}};const pn={};const getStreamContents=async(s,{init:a,convertChunk:l,getSize:D,truncateChunk:d,addChunk:g,getFinalChunk:y,finalize:F},{maxBuffer:w=Number.POSITIVE_INFINITY}={})=>{const C=getAsyncIterable(s);const S=a();S.length=0;try{for await(const s of C){const a=getChunkType(s);const y=l[a](s,S);appendChunk({convertedChunk:y,state:S,getSize:D,truncateChunk:d,addChunk:g,maxBuffer:w})}appendFinalChunk({state:S,convertChunk:l,getSize:D,truncateChunk:d,addChunk:g,getFinalChunk:y,maxBuffer:w});return F(S)}catch(s){const a=typeof s==="object"&&s!==null?s:new Error(s);a.bufferedData=F(S);throw a}};const appendFinalChunk=({state:s,getSize:a,truncateChunk:l,addChunk:D,getFinalChunk:d,maxBuffer:g})=>{const y=d(s);if(y!==undefined){appendChunk({convertedChunk:y,state:s,getSize:a,truncateChunk:l,addChunk:D,maxBuffer:g})}};const appendChunk=({convertedChunk:s,state:a,getSize:l,truncateChunk:D,addChunk:d,maxBuffer:g})=>{const y=l(s);const F=a.length+y;if(F<=g){addNewChunk(s,a,d,F);return}const w=D(s,g-a.length);if(w!==undefined){addNewChunk(w,a,d,g)}throw new MaxBufferError};const addNewChunk=(s,a,l,D)=>{a.contents=l(s,a,D);a.length=D};const getChunkType=s=>{const a=typeof s;if(a==="string"){return"string"}if(a!=="object"||s===null){return"others"}if(globalThis.Buffer?.isBuffer(s)){return"buffer"}const l=mn.call(s);if(l==="[object ArrayBuffer]"){return"arrayBuffer"}if(l==="[object DataView]"){return"dataView"}if(Number.isInteger(s.byteLength)&&Number.isInteger(s.byteOffset)&&mn.call(s.buffer)==="[object ArrayBuffer]"){return"typedArray"}return"others"};const{toString:mn}=Object.prototype;class MaxBufferError extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const handleMaxBuffer=({error:s,stream:a,readableObjectMode:l,lines:D,encoding:d,fdNumber:g})=>{if(!(s instanceof MaxBufferError)){throw s}if(g==="all"){return s}const y=getMaxBufferUnit(l,D,d);s.maxBufferInfo={fdNumber:g,unit:y};a.destroy();throw s};const getMaxBufferUnit=(s,a,l)=>{if(s){return"objects"}if(a){return"lines"}if(l==="buffer"){return"bytes"}return"characters"};const checkIpcMaxBuffer=(s,a,l)=>{if(a.length!==l){return}const D=new MaxBufferError;D.maxBufferInfo={fdNumber:"ipc"};throw D};const getMaxBufferMessage=(s,a)=>{const{streamName:l,threshold:D,unit:d}=getMaxBufferInfo(s,a);return`Command's ${l} was larger than ${D} ${d}`};const getMaxBufferInfo=(s,a)=>{if(s?.maxBufferInfo===undefined){return{streamName:"output",threshold:a[1],unit:"bytes"}}const{maxBufferInfo:{fdNumber:l,unit:D}}=s;delete s.maxBufferInfo;const d=getFdSpecificValue(a,l);if(l==="ipc"){return{streamName:"IPC output",threshold:d,unit:"messages"}}return{streamName:getStreamName(l),threshold:d,unit:D}};const isMaxBufferSync=(s,a,l)=>s?.code==="ENOBUFS"&&a!==null&&a.some((s=>s!==null&&s.length>getMaxBufferSync(l)));const truncateMaxBufferSync=(s,a,l)=>{if(!a){return s}const D=getMaxBufferSync(l);return s.length>D?s.slice(0,D):s};const getMaxBufferSync=([,s])=>s;const createMessages=({stdio:s,all:a,ipcOutput:l,originalError:D,signal:d,signalDescription:g,exitCode:y,escapedCommand:F,timedOut:w,isCanceled:C,isGracefullyCanceled:S,isMaxBuffer:A,isForcefullyTerminated:M,forceKillAfterDelay:_,killSignal:G,maxBuffer:W,timeout:V,cwd:X})=>{const ee=D?.code;const te=getErrorPrefix({originalError:D,timedOut:w,timeout:V,isMaxBuffer:A,maxBuffer:W,errorCode:ee,signal:d,signalDescription:g,exitCode:y,isCanceled:C,isGracefullyCanceled:S,isForcefullyTerminated:M,forceKillAfterDelay:_,killSignal:G});const ne=getOriginalMessage(D,X);const re=ne===undefined?"":`\n${ne}`;const se=`${te}: ${F}${re}`;const oe=a===undefined?[s[2],s[1]]:[a];const ie=[se,...oe,...s.slice(3),l.map((s=>serializeIpcMessage(s))).join("\n")].map((s=>escapeLines(strip_final_newline_stripFinalNewline(serializeMessagePart(s))))).filter(Boolean).join("\n\n");return{originalMessage:ne,shortMessage:se,message:ie}};const getErrorPrefix=({originalError:s,timedOut:a,timeout:l,isMaxBuffer:D,maxBuffer:d,errorCode:g,signal:y,signalDescription:F,exitCode:w,isCanceled:C,isGracefullyCanceled:S,isForcefullyTerminated:A,forceKillAfterDelay:M,killSignal:_})=>{const G=getForcefulSuffix(A,M);if(a){return`Command timed out after ${l} milliseconds${G}`}if(S){if(y===undefined){return`Command was gracefully canceled with exit code ${w}`}return A?`Command was gracefully canceled${G}`:`Command was gracefully canceled with ${y} (${F})`}if(C){return`Command was canceled${G}`}if(D){return`${getMaxBufferMessage(s,d)}${G}`}if(g!==undefined){return`Command failed with ${g}${G}`}if(A){return`Command was killed with ${_} (${getSignalDescription(_)})${G}`}if(y!==undefined){return`Command was killed with ${y} (${F})`}if(w!==undefined){return`Command failed with exit code ${w}`}return"Command failed"};const getForcefulSuffix=(s,a)=>s?` and was forcefully terminated after ${a} milliseconds`:"";const getOriginalMessage=(s,a)=>{if(s instanceof DiscardedError){return}const l=isExecaError(s)?s.originalMessage:String(s?.message??s);const D=escapeLines(fixCwdError(l,a));return D===""?undefined:D};const serializeIpcMessage=s=>typeof s==="string"?s:(0,M.inspect)(s);const serializeMessagePart=s=>Array.isArray(s)?s.map((s=>strip_final_newline_stripFinalNewline(serializeMessageItem(s)))).filter(Boolean).join("\n"):serializeMessageItem(s);const serializeMessageItem=s=>{if(typeof s==="string"){return s}if(isUint8Array(s)){return uint8ArrayToString(s)}return""};const makeSuccessResult=({command:s,escapedCommand:a,stdio:l,all:D,ipcOutput:d,options:{cwd:g},startTime:y})=>omitUndefinedProperties({command:s,escapedCommand:a,cwd:g,durationMs:getDurationMs(y),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:l[1],stderr:l[2],all:D,stdio:l,ipcOutput:d,pipedFrom:[]});const makeEarlyError=({error:s,command:a,escapedCommand:l,fileDescriptors:D,options:d,startTime:g,isSync:y})=>makeError({error:s,command:a,escapedCommand:l,startTime:g,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:D.length}),ipcOutput:[],options:d,isSync:y});const makeError=({error:s,command:a,escapedCommand:l,startTime:D,timedOut:d,isCanceled:g,isGracefullyCanceled:y,isMaxBuffer:F,isForcefullyTerminated:w,exitCode:C,signal:S,stdio:A,all:M,ipcOutput:_,options:{timeoutDuration:G,timeout:W=G,forceKillAfterDelay:V,killSignal:X,cwd:ee,maxBuffer:te},isSync:ne})=>{const{exitCode:re,signal:se,signalDescription:oe}=normalizeExitPayload(C,S);const{originalMessage:ie,shortMessage:ue,message:ae}=createMessages({stdio:A,all:M,ipcOutput:_,originalError:s,signal:se,signalDescription:oe,exitCode:re,escapedCommand:l,timedOut:d,isCanceled:g,isGracefullyCanceled:y,isMaxBuffer:F,isForcefullyTerminated:w,forceKillAfterDelay:V,killSignal:X,maxBuffer:te,timeout:W,cwd:ee});const le=getFinalError(s,ae,ne);Object.assign(le,getErrorProperties({error:le,command:a,escapedCommand:l,startTime:D,timedOut:d,isCanceled:g,isGracefullyCanceled:y,isMaxBuffer:F,isForcefullyTerminated:w,exitCode:re,signal:se,signalDescription:oe,stdio:A,all:M,ipcOutput:_,cwd:ee,originalMessage:ie,shortMessage:ue}));return le};const getErrorProperties=({error:s,command:a,escapedCommand:l,startTime:D,timedOut:d,isCanceled:g,isGracefullyCanceled:y,isMaxBuffer:F,isForcefullyTerminated:w,exitCode:C,signal:S,signalDescription:A,stdio:M,all:_,ipcOutput:G,cwd:W,originalMessage:V,shortMessage:X})=>omitUndefinedProperties({shortMessage:X,originalMessage:V,command:a,escapedCommand:l,cwd:W,durationMs:getDurationMs(D),failed:true,timedOut:d,isCanceled:g,isGracefullyCanceled:y,isTerminated:S!==undefined,isMaxBuffer:F,isForcefullyTerminated:w,exitCode:C,signal:S,signalDescription:A,code:s.cause?.code,stdout:M[1],stderr:M[2],all:_,stdio:M,ipcOutput:G,pipedFrom:[]});const omitUndefinedProperties=s=>Object.fromEntries(Object.entries(s).filter((([,s])=>s!==undefined)));const normalizeExitPayload=(s,a)=>{const l=s===null?undefined:s;const D=a===null?undefined:a;const d=D===undefined?undefined:getSignalDescription(a);return{exitCode:l,signal:D,signalDescription:d}};const toZeroIfInfinity=s=>Number.isFinite(s)?s:0;function parseNumber(s){return{days:Math.trunc(s/864e5),hours:Math.trunc(s/36e5%24),minutes:Math.trunc(s/6e4%60),seconds:Math.trunc(s/1e3%60),milliseconds:Math.trunc(s%1e3),microseconds:Math.trunc(toZeroIfInfinity(s*1e3)%1e3),nanoseconds:Math.trunc(toZeroIfInfinity(s*1e6)%1e3)}}function parseBigint(s){return{days:s/86400000n,hours:s/3600000n%24n,minutes:s/60000n%60n,seconds:s/1000n%60n,milliseconds:s%1000n,microseconds:0n,nanoseconds:0n}}function parseMilliseconds(s){switch(typeof s){case"number":{if(Number.isFinite(s)){return parseNumber(s)}break}case"bigint":{return parseBigint(s)}}throw new TypeError("Expected a finite number or bigint")}const isZero=s=>s===0||s===0n;const pluralize=(s,a)=>a===1||a===1n?s:`${s}s`;const hn=1e-7;const bn=24n*60n*60n*1000n;function prettyMilliseconds(s,a){const l=typeof s==="bigint";if(!l&&!Number.isFinite(s)){throw new TypeError("Expected a finite number or bigint")}a={...a};const D=s<0?"-":"";s=s<0?-s:s;if(a.colonNotation){a.compact=false;a.formatSubMilliseconds=false;a.separateMilliseconds=false;a.verbose=false}if(a.compact){a.unitCount=1;a.secondsDecimalDigits=0;a.millisecondsDecimalDigits=0}let d=[];const floorDecimals=(s,a)=>{const l=Math.floor(s*10**a+hn);const D=Math.round(l)/10**a;return D.toFixed(a)};const add=(s,l,D,g)=>{if((d.length===0||!a.colonNotation)&&isZero(s)&&!(a.colonNotation&&D==="m")){return}g??=String(s);if(a.colonNotation){const s=g.includes(".")?g.split(".")[0].length:g.length;const a=d.length>0?2:1;g="0".repeat(Math.max(0,a-s))+g}else{g+=a.verbose?" "+pluralize(l,s):D}d.push(g)};const g=parseMilliseconds(s);const y=BigInt(g.days);if(a.hideYearAndDays){add(BigInt(y)*24n+BigInt(g.hours),"hour","h")}else{if(a.hideYear){add(y,"day","d")}else{add(y/365n,"year","y");add(y%365n,"day","d")}add(Number(g.hours),"hour","h")}add(Number(g.minutes),"minute","m");if(!a.hideSeconds){if(a.separateMilliseconds||a.formatSubMilliseconds||!a.colonNotation&&s<1e3){const s=Number(g.seconds);const l=Number(g.milliseconds);const D=Number(g.microseconds);const d=Number(g.nanoseconds);add(s,"second","s");if(a.formatSubMilliseconds){add(l,"millisecond","ms");add(D,"microsecond","µs");add(d,"nanosecond","ns")}else{const s=l+D/1e3+d/1e6;const g=typeof a.millisecondsDecimalDigits==="number"?a.millisecondsDecimalDigits:0;const y=s>=1?Math.round(s):Math.ceil(s);const F=g?s.toFixed(g):y;add(Number.parseFloat(F),"millisecond","ms",F)}}else{const D=(l?Number(s%bn):s)/1e3%60;const d=typeof a.secondsDecimalDigits==="number"?a.secondsDecimalDigits:1;const g=floorDecimals(D,d);const y=a.keepDecimalsOnWholeSeconds?g:g.replace(/\.0+$/,"");add(Number.parseFloat(y),"second","s",y)}}if(d.length===0){return D+"0"+(a.verbose?" milliseconds":"ms")}const F=a.colonNotation?":":" ";if(typeof a.unitCount==="number"){d=d.slice(0,Math.max(a.unitCount,1))}return D+d.join(F)}const logError=(s,a)=>{if(s.failed){verboseLog({type:"error",verboseMessage:s.shortMessage,verboseInfo:a,result:s})}};const logResult=(s,a)=>{if(!isVerbose(a)){return}logError(s,a);logDuration(s,a)};const logDuration=(s,a)=>{const l=`(done in ${prettyMilliseconds(s.durationMs)})`;verboseLog({type:"duration",verboseMessage:l,verboseInfo:a,result:s})};const handleResult=(s,a,{reject:l})=>{logResult(s,a);if(s.failed&&l){throw s}return s};const getStdioItemType=(s,a)=>{if(isAsyncGenerator(s)){return"asyncGenerator"}if(isSyncGenerator(s)){return"generator"}if(isUrl(s)){return"fileUrl"}if(isFilePathObject(s)){return"filePath"}if(isWebStream(s)){return"webStream"}if(isStream(s,{checkOpen:false})){return"native"}if(isUint8Array(s)){return"uint8Array"}if(isAsyncIterableObject(s)){return"asyncIterable"}if(isIterableObject(s)){return"iterable"}if(type_isTransformStream(s)){return getTransformStreamType({transform:s},a)}if(isTransformOptions(s)){return getTransformObjectType(s,a)}return"native"};const getTransformObjectType=(s,a)=>{if(isDuplexStream(s.transform,{checkOpen:false})){return getDuplexType(s,a)}if(type_isTransformStream(s.transform)){return getTransformStreamType(s,a)}return getGeneratorObjectType(s,a)};const getDuplexType=(s,a)=>{validateNonGeneratorType(s,a,"Duplex stream");return"duplex"};const getTransformStreamType=(s,a)=>{validateNonGeneratorType(s,a,"web TransformStream");return"webTransform"};const validateNonGeneratorType=({final:s,binary:a,objectMode:l},D,d)=>{checkUndefinedOption(s,`${D}.final`,d);checkUndefinedOption(a,`${D}.binary`,d);checkBooleanOption(l,`${D}.objectMode`)};const checkUndefinedOption=(s,a,l)=>{if(s!==undefined){throw new TypeError(`The \`${a}\` option can only be defined when using a generator, not a ${l}.`)}};const getGeneratorObjectType=({transform:s,final:a,binary:l,objectMode:D},d)=>{if(s!==undefined&&!isGenerator(s)){throw new TypeError(`The \`${d}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`)}if(isDuplexStream(a,{checkOpen:false})){throw new TypeError(`The \`${d}.final\` option must not be a Duplex stream.`)}if(type_isTransformStream(a)){throw new TypeError(`The \`${d}.final\` option must not be a web TransformStream.`)}if(a!==undefined&&!isGenerator(a)){throw new TypeError(`The \`${d}.final\` option must be a generator.`)}checkBooleanOption(l,`${d}.binary`);checkBooleanOption(D,`${d}.objectMode`);return isAsyncGenerator(s)||isAsyncGenerator(a)?"asyncGenerator":"generator"};const checkBooleanOption=(s,a)=>{if(s!==undefined&&typeof s!=="boolean"){throw new TypeError(`The \`${a}\` option must use a boolean.`)}};const isGenerator=s=>isAsyncGenerator(s)||isSyncGenerator(s);const isAsyncGenerator=s=>Object.prototype.toString.call(s)==="[object AsyncGeneratorFunction]";const isSyncGenerator=s=>Object.prototype.toString.call(s)==="[object GeneratorFunction]";const isTransformOptions=s=>isPlainObject(s)&&(s.transform!==undefined||s.final!==undefined);const isUrl=s=>Object.prototype.toString.call(s)==="[object URL]";const isRegularUrl=s=>isUrl(s)&&s.protocol!=="file:";const isFilePathObject=s=>isPlainObject(s)&&Object.keys(s).length>0&&Object.keys(s).every((s=>gn.has(s)))&&isFilePathString(s.file);const gn=new Set(["file","append"]);const isFilePathString=s=>typeof s==="string";const isUnknownStdioString=(s,a)=>s==="native"&&typeof a==="string"&&!yn.has(a);const yn=new Set(["ipc","ignore","inherit","overlapped","pipe"]);const type_isReadableStream=s=>Object.prototype.toString.call(s)==="[object ReadableStream]";const type_isWritableStream=s=>Object.prototype.toString.call(s)==="[object WritableStream]";const isWebStream=s=>type_isReadableStream(s)||type_isWritableStream(s);const type_isTransformStream=s=>type_isReadableStream(s?.readable)&&type_isWritableStream(s?.writable);const isAsyncIterableObject=s=>isObject(s)&&typeof s[Symbol.asyncIterator]==="function";const isIterableObject=s=>isObject(s)&&typeof s[Symbol.iterator]==="function";const isObject=s=>typeof s==="object"&&s!==null;const Fn=new Set(["generator","asyncGenerator","duplex","webTransform"]);const wn=new Set(["fileUrl","filePath","fileNumber"]);const Cn=new Set(["fileUrl","filePath"]);const En=new Set([...Cn,"webStream","nodeStream"]);const vn=new Set(["webTransform","duplex"]);const Sn={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"};const getTransformObjectModes=(s,a,l,D)=>D==="output"?getOutputObjectModes(s,a,l):getInputObjectModes(s,a,l);const getOutputObjectModes=(s,a,l)=>{const D=a!==0&&l[a-1].value.readableObjectMode;const d=s??D;return{writableObjectMode:D,readableObjectMode:d}};const getInputObjectModes=(s,a,l)=>{const D=a===0?s===true:l[a-1].value.readableObjectMode;const d=a!==l.length-1&&(s??D);return{writableObjectMode:D,readableObjectMode:d}};const getFdObjectMode=(s,a)=>{const l=s.findLast((({type:s})=>Fn.has(s)));if(l===undefined){return false}return a==="input"?l.value.writableObjectMode:l.value.readableObjectMode};const normalizeTransforms=(s,a,l,D)=>[...s.filter((({type:s})=>!Fn.has(s))),...getTransforms(s,a,l,D)];const getTransforms=(s,a,l,{encoding:D})=>{const d=s.filter((({type:s})=>Fn.has(s)));const g=Array.from({length:d.length});for(const[s,y]of Object.entries(d)){g[s]=normalizeTransform({stdioItem:y,index:Number(s),newTransforms:g,optionName:a,direction:l,encoding:D})}return sortTransforms(g,l)};const normalizeTransform=({stdioItem:s,stdioItem:{type:a},index:l,newTransforms:D,optionName:d,direction:g,encoding:y})=>{if(a==="duplex"){return normalizeDuplex({stdioItem:s,optionName:d})}if(a==="webTransform"){return normalizeTransformStream({stdioItem:s,index:l,newTransforms:D,direction:g})}return normalizeGenerator({stdioItem:s,index:l,newTransforms:D,direction:g,encoding:y})};const normalizeDuplex=({stdioItem:s,stdioItem:{value:{transform:a,transform:{writableObjectMode:l,readableObjectMode:D},objectMode:d=D}},optionName:g})=>{if(d&&!D){throw new TypeError(`The \`${g}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`)}if(!d&&D){throw new TypeError(`The \`${g}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`)}return{...s,value:{transform:a,writableObjectMode:l,readableObjectMode:D}}};const normalizeTransformStream=({stdioItem:s,stdioItem:{value:a},index:l,newTransforms:D,direction:d})=>{const{transform:g,objectMode:y}=isPlainObject(a)?a:{transform:a};const{writableObjectMode:F,readableObjectMode:w}=getTransformObjectModes(y,l,D,d);return{...s,value:{transform:g,writableObjectMode:F,readableObjectMode:w}}};const normalizeGenerator=({stdioItem:s,stdioItem:{value:a},index:l,newTransforms:D,direction:d,encoding:g})=>{const{transform:y,final:F,binary:w=false,preserveNewlines:C=false,objectMode:S}=isPlainObject(a)?a:{transform:a};const A=w||tn.has(g);const{writableObjectMode:M,readableObjectMode:_}=getTransformObjectModes(S,l,D,d);return{...s,value:{transform:y,final:F,binary:A,preserveNewlines:C,writableObjectMode:M,readableObjectMode:_}}};const sortTransforms=(s,a)=>a==="input"?s.reverse():s;const getStreamDirection=(s,a,l)=>{const D=s.map((s=>getStdioItemDirection(s,a)));if(D.includes("input")&&D.includes("output")){throw new TypeError(`The \`${l}\` option must not be an array of both readable and writable values.`)}return D.find(Boolean)??xn};const getStdioItemDirection=({type:s,value:a},l)=>Bn[l]??$n[s](a);const Bn=["input","output","output"];const anyDirection=()=>undefined;const alwaysInput=()=>"input";const $n={generator:anyDirection,asyncGenerator:anyDirection,fileUrl:anyDirection,filePath:anyDirection,iterable:alwaysInput,asyncIterable:alwaysInput,uint8Array:alwaysInput,webStream:s=>type_isWritableStream(s)?"output":"input",nodeStream(s){if(!isReadableStream(s,{checkOpen:false})){return"output"}return isWritableStream(s,{checkOpen:false})?undefined:"input"},webTransform:anyDirection,duplex:anyDirection,native(s){const a=getStandardStreamDirection(s);if(a!==undefined){return a}if(isStream(s,{checkOpen:false})){return $n.nodeStream(s)}}};const getStandardStreamDirection=s=>{if([0,_.stdin].includes(s)){return"input"}if([1,2,_.stdout,_.stderr].includes(s)){return"output"}};const xn="output";const normalizeIpcStdioArray=(s,a)=>a&&!s.includes("ipc")?[...s,"ipc"]:s;const normalizeStdioOption=({stdio:s,ipc:a,buffer:l,...D},d,g)=>{const y=getStdioArray(s,D).map(((s,a)=>stdio_option_addDefaultValue(s,a)));return g?normalizeStdioSync(y,l,d):normalizeIpcStdioArray(y,a)};const getStdioArray=(s,a)=>{if(s===undefined){return W.map((s=>a[s]))}if(hasAlias(a)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${W.map((s=>`\`${s}\``)).join(", ")}`)}if(typeof s==="string"){return[s,s,s]}if(!Array.isArray(s)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``)}const l=Math.max(s.length,W.length);return Array.from({length:l},((a,l)=>s[l]))};const hasAlias=s=>W.some((a=>s[a]!==undefined));const stdio_option_addDefaultValue=(s,a)=>{if(Array.isArray(s)){return s.map((s=>stdio_option_addDefaultValue(s,a)))}if(s===null||s===undefined){return a>=W.length?"ignore":"pipe"}return s};const normalizeStdioSync=(s,a,l)=>s.map(((s,D)=>!a[D]&&D!==0&&!isFullVerbose(l,D)&&isOutputPipeOnly(s)?"ignore":s));const isOutputPipeOnly=s=>s==="pipe"||Array.isArray(s)&&s.every((s=>s==="pipe"));const handleNativeStream=({stdioItem:s,stdioItem:{type:a},isStdioArray:l,fdNumber:D,direction:d,isSync:g})=>{if(!l||a!=="native"){return s}return g?handleNativeStreamSync({stdioItem:s,fdNumber:D,direction:d}):handleNativeStreamAsync({stdioItem:s,fdNumber:D})};const handleNativeStreamSync=({stdioItem:s,stdioItem:{value:a,optionName:l},fdNumber:D,direction:d})=>{const g=getTargetFd({value:a,optionName:l,fdNumber:D,direction:d});if(g!==undefined){return g}if(isStream(a,{checkOpen:false})){throw new TypeError(`The \`${l}: Stream\` option cannot both be an array and include a stream with synchronous methods.`)}return s};const getTargetFd=({value:s,optionName:a,fdNumber:l,direction:D})=>{const d=getTargetFdNumber(s,l);if(d===undefined){return}if(D==="output"){return{type:"fileNumber",value:d,optionName:a}}if(Be.isatty(d)){throw new TypeError(`The \`${a}: ${serializeOptionValue(s)}\` option is invalid: it cannot be a TTY with synchronous methods.`)}return{type:"uint8Array",value:bufferToUint8Array((0,sn.readFileSync)(d)),optionName:a}};const getTargetFdNumber=(s,a)=>{if(s==="inherit"){return a}if(typeof s==="number"){return s}const l=G.indexOf(s);if(l!==-1){return l}};const handleNativeStreamAsync=({stdioItem:s,stdioItem:{value:a,optionName:l},fdNumber:D})=>{if(a==="inherit"){return{type:"nodeStream",value:getStandardStream(D,a,l),optionName:l}}if(typeof a==="number"){return{type:"nodeStream",value:getStandardStream(a,a,l),optionName:l}}if(isStream(a,{checkOpen:false})){return{type:"nodeStream",value:a,optionName:l}}return s};const getStandardStream=(s,a,l)=>{const D=G[s];if(D===undefined){throw new TypeError(`The \`${l}: ${a}\` option is invalid: no such standard stream.`)}return D};const handleInputOptions=({input:s,inputFile:a},l)=>l===0?[...handleInputOption(s),...handleInputFileOption(a)]:[];const handleInputOption=s=>s===undefined?[]:[{type:getInputType(s),value:s,optionName:"input"}];const getInputType=s=>{if(isReadableStream(s,{checkOpen:false})){return"nodeStream"}if(typeof s==="string"){return"string"}if(isUint8Array(s)){return"uint8Array"}throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")};const handleInputFileOption=s=>s===undefined?[]:[{...getInputFileType(s),optionName:"inputFile"}];const getInputFileType=s=>{if(isUrl(s)){return{type:"fileUrl",value:s}}if(isFilePathString(s)){return{type:"filePath",value:{file:s}}}throw new Error("The `inputFile` option must be a file path string or a file URL.")};const filterDuplicates=s=>s.filter(((a,l)=>s.every(((s,D)=>a.value!==s.value||l>=D||a.type==="generator"||a.type==="asyncGenerator"))));const getDuplicateStream=({stdioItem:{type:s,value:a,optionName:l},direction:D,fileDescriptors:d,isSync:g})=>{const y=getOtherStdioItems(d,s);if(y.length===0){return}if(g){validateDuplicateStreamSync({otherStdioItems:y,type:s,value:a,optionName:l,direction:D});return}if(En.has(s)){return getDuplicateStreamInstance({otherStdioItems:y,type:s,value:a,optionName:l,direction:D})}if(vn.has(s)){validateDuplicateTransform({otherStdioItems:y,type:s,value:a,optionName:l})}};const getOtherStdioItems=(s,a)=>s.flatMap((({direction:s,stdioItems:l})=>l.filter((s=>s.type===a)).map((a=>({...a,direction:s})))));const validateDuplicateStreamSync=({otherStdioItems:s,type:a,value:l,optionName:D,direction:d})=>{if(Cn.has(a)){getDuplicateStreamInstance({otherStdioItems:s,type:a,value:l,optionName:D,direction:d})}};const getDuplicateStreamInstance=({otherStdioItems:s,type:a,value:l,optionName:D,direction:d})=>{const g=s.filter((s=>hasSameValue(s,l)));if(g.length===0){return}const y=g.find((s=>s.direction!==d));throwOnDuplicateStream(y,D,a);return d==="output"?g[0].stream:undefined};const hasSameValue=({type:s,value:a},l)=>{if(s==="filePath"){return a.file===l.file}if(s==="fileUrl"){return a.href===l.href}return a===l};const validateDuplicateTransform=({otherStdioItems:s,type:a,value:l,optionName:D})=>{const d=s.find((({value:{transform:s}})=>s===l.transform));throwOnDuplicateStream(d,D,a)};const throwOnDuplicateStream=(s,a,l)=>{if(s!==undefined){throw new TypeError(`The \`${s.optionName}\` and \`${a}\` options must not target ${Sn[l]} that is the same.`)}};const handleStdio=(s,a,l,D)=>{const d=normalizeStdioOption(a,l,D);const g=d.map(((s,l)=>getFileDescriptor({stdioOption:s,fdNumber:l,options:a,isSync:D})));const y=getFinalFileDescriptors({initialFileDescriptors:g,addProperties:s,options:a,isSync:D});a.stdio=y.map((({stdioItems:s})=>forwardStdio(s)));return y};const getFileDescriptor=({stdioOption:s,fdNumber:a,options:l,isSync:D})=>{const d=getStreamName(a);const{stdioItems:g,isStdioArray:y}=initializeStdioItems({stdioOption:s,fdNumber:a,options:l,optionName:d});const F=getStreamDirection(g,a,d);const w=g.map((s=>handleNativeStream({stdioItem:s,isStdioArray:y,fdNumber:a,direction:F,isSync:D})));const C=normalizeTransforms(w,d,F,l);const S=getFdObjectMode(C,F);validateFileObjectMode(C,S);return{direction:F,objectMode:S,stdioItems:C}};const initializeStdioItems=({stdioOption:s,fdNumber:a,options:l,optionName:D})=>{const d=Array.isArray(s)?s:[s];const g=[...d.map((s=>initializeStdioItem(s,D))),...handleInputOptions(l,a)];const y=filterDuplicates(g);const F=y.length>1;validateStdioArray(y,F,D);validateStreams(y);return{stdioItems:y,isStdioArray:F}};const initializeStdioItem=(s,a)=>({type:getStdioItemType(s,a),value:s,optionName:a});const validateStdioArray=(s,a,l)=>{if(s.length===0){throw new TypeError(`The \`${l}\` option must not be an empty array.`)}if(!a){return}for(const{value:a,optionName:l}of s){if(An.has(a)){throw new Error(`The \`${l}\` option must not include \`${a}\`.`)}}};const An=new Set(["ignore","ipc"]);const validateStreams=s=>{for(const a of s){validateFileStdio(a)}};const validateFileStdio=({type:s,value:a,optionName:l})=>{if(isRegularUrl(a)){throw new TypeError(`The \`${l}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`)}if(isUnknownStdioString(s,a)){throw new TypeError(`The \`${l}: { file: '...' }\` option must be used instead of \`${l}: '...'\`.`)}};const validateFileObjectMode=(s,a)=>{if(!a){return}const l=s.find((({type:s})=>wn.has(s)));if(l!==undefined){throw new TypeError(`The \`${l.optionName}\` option cannot use both files and transforms in objectMode.`)}};const getFinalFileDescriptors=({initialFileDescriptors:s,addProperties:a,options:l,isSync:D})=>{const d=[];try{for(const g of s){d.push(getFinalFileDescriptor({fileDescriptor:g,fileDescriptors:d,addProperties:a,options:l,isSync:D}))}return d}catch(s){cleanupCustomStreams(d);throw s}};const getFinalFileDescriptor=({fileDescriptor:{direction:s,objectMode:a,stdioItems:l},fileDescriptors:D,addProperties:d,options:g,isSync:y})=>{const F=l.map((a=>addStreamProperties({stdioItem:a,addProperties:d,direction:s,options:g,fileDescriptors:D,isSync:y})));return{direction:s,objectMode:a,stdioItems:F}};const addStreamProperties=({stdioItem:s,addProperties:a,direction:l,options:D,fileDescriptors:d,isSync:g})=>{const y=getDuplicateStream({stdioItem:s,direction:l,fileDescriptors:d,isSync:g});if(y!==undefined){return{...s,stream:y}}return{...s,...a[l][s.type](s,D)}};const cleanupCustomStreams=s=>{for(const{stdioItems:a}of s){for(const{stream:s}of a){if(s!==undefined&&!isStandardStream(s)){s.destroy()}}}};const forwardStdio=s=>{if(s.length>1){return s.some((({value:s})=>s==="overlapped"))?"overlapped":"pipe"}const[{type:a,value:l}]=s;return a==="native"?l:"pipe"};const handleStdioSync=(s,a)=>handleStdio(On,s,a,true);const forbiddenIfSync=({type:s,optionName:a})=>{throwInvalidSyncValue(a,Sn[s])};const forbiddenNativeIfSync=({optionName:s,value:a})=>{if(a==="ipc"||a==="overlapped"){throwInvalidSyncValue(s,`"${a}"`)}return{}};const throwInvalidSyncValue=(s,a)=>{throw new TypeError(`The \`${s}\` option cannot be ${a} with synchronous methods.`)};const Tn={generator(){},asyncGenerator:forbiddenIfSync,webStream:forbiddenIfSync,nodeStream:forbiddenIfSync,webTransform:forbiddenIfSync,duplex:forbiddenIfSync,asyncIterable:forbiddenIfSync,native:forbiddenNativeIfSync};const On={input:{...Tn,fileUrl:({value:s})=>({contents:[bufferToUint8Array((0,sn.readFileSync)(s))]}),filePath:({value:{file:s}})=>({contents:[bufferToUint8Array((0,sn.readFileSync)(s))]}),fileNumber:forbiddenIfSync,iterable:({value:s})=>({contents:[...s]}),string:({value:s})=>({contents:[s]}),uint8Array:({value:s})=>({contents:[s]})},output:{...Tn,fileUrl:({value:s})=>({path:s}),filePath:({value:{file:s,append:a}})=>({path:s,append:a}),fileNumber:({value:s})=>({path:s}),iterable:forbiddenIfSync,string:forbiddenIfSync,uint8Array:forbiddenIfSync}};const stripNewline=(s,{stripFinalNewline:a},l)=>getStripFinalNewline(a,l)&&s!==undefined&&!Array.isArray(s)?strip_final_newline_stripFinalNewline(s):s;const getStripFinalNewline=(s,a)=>a==="all"?s[1]||s[2]:s[a];var In=D(75);const getSplitLinesGenerator=(s,a,l,D)=>s||l?undefined:initializeSplitLines(a,D);const splitLinesSync=(s,a,l)=>l?s.flatMap((s=>splitLinesItemSync(s,a))):splitLinesItemSync(s,a);const splitLinesItemSync=(s,a)=>{const{transform:l,final:D}=initializeSplitLines(a,{});return[...l(s),...D()]};const initializeSplitLines=(s,a)=>{a.previousChunks="";return{transform:splitGenerator.bind(undefined,a,s),final:linesFinal.bind(undefined,a)}};const splitGenerator=function*(s,a,l){if(typeof l!=="string"){yield l;return}let{previousChunks:D}=s;let d=-1;for(let g=0;g<l.length;g+=1){if(l[g]==="\n"){const y=getNewlineLength(l,g,a,s);let F=l.slice(d+1,g+1-y);if(D.length>0){F=concatString(D,F);D=""}yield F;d=g}}if(d!==l.length-1){D=concatString(D,l.slice(d+1))}s.previousChunks=D};const getNewlineLength=(s,a,l,D)=>{if(l){return 0}D.isWindowsNewline=a!==0&&s[a-1]==="\r";return D.isWindowsNewline?2:1};const linesFinal=function*({previousChunks:s}){if(s.length>0){yield s}};const getAppendNewlineGenerator=({binary:s,preserveNewlines:a,readableObjectMode:l,state:D})=>s||a||l?undefined:{transform:appendNewlineGenerator.bind(undefined,D)};const appendNewlineGenerator=function*({isWindowsNewline:s=false},a){const{unixNewline:l,windowsNewline:D,LF:d,concatBytes:g}=typeof a==="string"?Mn:kn;if(a.at(-1)===d){yield a;return}const y=s?D:l;yield g(a,y)};const concatString=(s,a)=>`${s}${a}`;const Mn={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:concatString};const concatUint8Array=(s,a)=>{const l=new Uint8Array(s.length+a.length);l.set(s,0);l.set(a,s.length);return l};const kn={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:concatUint8Array};const Nn=s(import.meta.url)("node:buffer");const getValidateTransformInput=(s,a)=>s?undefined:validateStringTransformInput.bind(undefined,a);const validateStringTransformInput=function*(s,a){if(typeof a!=="string"&&!isUint8Array(a)&&!Nn.Buffer.isBuffer(a)){throw new TypeError(`The \`${s}\` option's transform must use "objectMode: true" to receive as input: ${typeof a}.`)}yield a};const getValidateTransformReturn=(s,a)=>s?validateObjectTransformReturn.bind(undefined,a):validateStringTransformReturn.bind(undefined,a);const validateObjectTransformReturn=function*(s,a){validateEmptyReturn(s,a);yield a};const validateStringTransformReturn=function*(s,a){validateEmptyReturn(s,a);if(typeof a!=="string"&&!isUint8Array(a)){throw new TypeError(`The \`${s}\` option's function must yield a string or an Uint8Array, not ${typeof a}.`)}yield a};const validateEmptyReturn=(s,a)=>{if(a===null||a===undefined){throw new TypeError(`The \`${s}\` option's function must not call \`yield ${a}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)}};const getEncodingTransformGenerator=(s,a,l)=>{if(l){return}if(s){return{transform:encodingUint8ArrayGenerator.bind(undefined,new TextEncoder)}}const D=new y.StringDecoder(a);return{transform:encodingStringGenerator.bind(undefined,D),final:encodingStringFinal.bind(undefined,D)}};const encodingUint8ArrayGenerator=function*(s,a){if(Nn.Buffer.isBuffer(a)){yield bufferToUint8Array(a)}else if(typeof a==="string"){yield s.encode(a)}else{yield a}};const encodingStringGenerator=function*(s,a){yield isUint8Array(a)?s.write(a):a};const encodingStringFinal=function*(s){const a=s.end();if(a!==""){yield a}};const jn=(0,M.callbackify)((async(s,a,l,D)=>{a.currentIterable=s(...l);try{for await(const s of a.currentIterable){D.push(s)}}finally{delete a.currentIterable}}));const transformChunk=async function*(s,a,l){if(l===a.length){yield s;return}const{transform:D=identityGenerator}=a[l];for await(const d of D(s)){yield*transformChunk(d,a,l+1)}};const finalChunks=async function*(s){for(const[a,{final:l}]of Object.entries(s)){yield*generatorFinalChunks(l,Number(a),s)}};const generatorFinalChunks=async function*(s,a,l){if(s===undefined){return}for await(const D of s()){yield*transformChunk(D,l,a+1)}};const Pn=(0,M.callbackify)((async({currentIterable:s},a)=>{if(s!==undefined){await(a?s.throw(a):s.return());return}if(a){throw a}}));const identityGenerator=function*(s){yield s};const pushChunksSync=(s,a,l,D)=>{try{for(const D of s(...a)){l.push(D)}D()}catch(s){D(s)}};const runTransformSync=(s,a)=>[...a.flatMap((a=>[...transformChunkSync(a,s,0)])),...finalChunksSync(s)];const transformChunkSync=function*(s,a,l){if(l===a.length){yield s;return}const{transform:D=run_sync_identityGenerator}=a[l];for(const d of D(s)){yield*transformChunkSync(d,a,l+1)}};const finalChunksSync=function*(s){for(const[a,{final:l}]of Object.entries(s)){yield*generatorFinalChunksSync(l,Number(a),s)}};const generatorFinalChunksSync=function*(s,a,l){if(s===undefined){return}for(const D of s()){yield*transformChunkSync(D,l,a+1)}};const run_sync_identityGenerator=function*(s){yield s};const generatorToStream=({value:s,value:{transform:a,final:l,writableObjectMode:D,readableObjectMode:d},optionName:g},{encoding:y})=>{const F={};const w=addInternalGenerators(s,y,g);const C=isAsyncGenerator(a);const S=isAsyncGenerator(l);const A=C?jn.bind(undefined,transformChunk,F):pushChunksSync.bind(undefined,transformChunkSync);const M=C||S?jn.bind(undefined,finalChunks,F):pushChunksSync.bind(undefined,finalChunksSync);const _=C||S?Pn.bind(undefined,F):undefined;const G=new In.Transform({writableObjectMode:D,writableHighWaterMark:(0,In.getDefaultHighWaterMark)(D),readableObjectMode:d,readableHighWaterMark:(0,In.getDefaultHighWaterMark)(d),transform(s,a,l){A([s,w,0],this,l)},flush(s){M([w],this,s)},destroy:_});return{stream:G}};const runGeneratorsSync=(s,a,l,D)=>{const d=a.filter((({type:s})=>s==="generator"));const g=D?d.reverse():d;for(const{value:a,optionName:D}of g){const d=addInternalGenerators(a,l,D);s=runTransformSync(d,s)}return s};const addInternalGenerators=({transform:s,final:a,binary:l,writableObjectMode:D,readableObjectMode:d,preserveNewlines:g},y,F)=>{const w={};return[{transform:getValidateTransformInput(D,F)},getEncodingTransformGenerator(l,y,D),getSplitLinesGenerator(l,g,D,w),{transform:s,final:a},{transform:getValidateTransformReturn(d,F)},getAppendNewlineGenerator({binary:l,preserveNewlines:g,readableObjectMode:d,state:w})].filter(Boolean)};const addInputOptionsSync=(s,a)=>{for(const l of getInputFdNumbers(s)){addInputOptionSync(s,l,a)}};const getInputFdNumbers=s=>new Set(Object.entries(s).filter((([,{direction:s}])=>s==="input")).map((([s])=>Number(s))));const addInputOptionSync=(s,a,l)=>{const{stdioItems:D}=s[a];const d=D.filter((({contents:s})=>s!==undefined));if(d.length===0){return}if(a!==0){const[{type:s,optionName:a}]=d;throw new TypeError(`Only the \`stdin\` option, not \`${a}\`, can be ${Sn[s]} with synchronous methods.`)}const g=d.map((({contents:s})=>s));const y=g.map((s=>applySingleInputGeneratorsSync(s,D)));l.input=joinToUint8Array(y)};const applySingleInputGeneratorsSync=(s,a)=>{const l=runGeneratorsSync(s,a,"utf8",true);validateSerializable(l);return joinToUint8Array(l)};const validateSerializable=s=>{const a=s.find((s=>typeof s!=="string"&&!isUint8Array(s)));if(a!==undefined){throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${a}.`)}};const shouldLogOutput=({stdioItems:s,encoding:a,verboseInfo:l,fdNumber:D})=>D!=="all"&&isFullVerbose(l,D)&&!tn.has(a)&&fdUsesVerbose(D)&&(s.some((({type:s,value:a})=>s==="native"&&Rn.has(a)))||s.every((({type:s})=>Fn.has(s))));const fdUsesVerbose=s=>s===1||s===2;const Rn=new Set(["pipe","overlapped"]);const logLines=async(s,a,l,D)=>{for await(const d of s){if(!isPipingStream(a)){logLine(d,l,D)}}};const logLinesSync=(s,a,l)=>{for(const D of s){logLine(D,a,l)}};const isPipingStream=s=>s._readableState.pipes.length>0;const logLine=(s,a,l)=>{const D=serializeVerboseMessage(s);verboseLog({type:"output",verboseMessage:D,fdNumber:a,verboseInfo:l})};const transformOutputSync=({fileDescriptors:s,syncResult:{output:a},options:l,isMaxBuffer:D,verboseInfo:d})=>{if(a===null){return{output:Array.from({length:3})}}const g={};const y=new Set([]);const F=a.map(((a,F)=>transformOutputResultSync({result:a,fileDescriptors:s,fdNumber:F,state:g,outputFiles:y,isMaxBuffer:D,verboseInfo:d},l)));return{output:F,...g}};const transformOutputResultSync=({result:s,fileDescriptors:a,fdNumber:l,state:D,outputFiles:d,isMaxBuffer:g,verboseInfo:y},{buffer:F,encoding:w,lines:C,stripFinalNewline:S,maxBuffer:A})=>{if(s===null){return}const M=truncateMaxBufferSync(s,g,A);const _=bufferToUint8Array(M);const{stdioItems:G,objectMode:W}=a[l];const V=runOutputGeneratorsSync([_],G,w,D);const{serializedResult:X,finalResult:ee=X}=serializeChunks({chunks:V,objectMode:W,encoding:w,lines:C,stripFinalNewline:S,fdNumber:l});logOutputSync({serializedResult:X,fdNumber:l,state:D,verboseInfo:y,encoding:w,stdioItems:G,objectMode:W});const te=F[l]?ee:undefined;try{if(D.error===undefined){writeToFiles(X,G,d)}return te}catch(s){D.error=s;return te}};const runOutputGeneratorsSync=(s,a,l,D)=>{try{return runGeneratorsSync(s,a,l,false)}catch(a){D.error=a;return s}};const serializeChunks=({chunks:s,objectMode:a,encoding:l,lines:D,stripFinalNewline:d,fdNumber:g})=>{if(a){return{serializedResult:s}}if(l==="buffer"){return{serializedResult:joinToUint8Array(s)}}const y=joinToString(s,l);if(D[g]){return{serializedResult:y,finalResult:splitLinesSync(y,!d[g],a)}}return{serializedResult:y}};const logOutputSync=({serializedResult:s,fdNumber:a,state:l,verboseInfo:D,encoding:d,stdioItems:g,objectMode:y})=>{if(!shouldLogOutput({stdioItems:g,encoding:d,verboseInfo:D,fdNumber:a})){return}const F=splitLinesSync(s,false,y);try{logLinesSync(F,a,D)}catch(s){l.error??=s}};const writeToFiles=(s,a,l)=>{for(const{path:D,append:d}of a.filter((({type:s})=>wn.has(s)))){const a=typeof D==="string"?D:D.toString();if(d||l.has(a)){(0,sn.appendFileSync)(D,s)}else{l.add(a);(0,sn.writeFileSync)(D,s)}}};const getAllSync=([,s,a],l)=>{if(!l.all){return}if(s===undefined){return a}if(a===undefined){return s}if(Array.isArray(s)){return Array.isArray(a)?[...s,...a]:[...s,stripNewline(a,l,"all")]}if(Array.isArray(a)){return[stripNewline(s,l,"all"),...a]}if(isUint8Array(s)&&isUint8Array(a)){return concatUint8Arrays([s,a])}return`${s}${a}`};const waitForExit=async(s,a)=>{const[l,D]=await waitForExitOrError(s);a.isForcefullyTerminated??=false;return[l,D]};const waitForExitOrError=async s=>{const[a,l]=await Promise.allSettled([(0,Pt.once)(s,"spawn"),(0,Pt.once)(s,"exit")]);if(a.status==="rejected"){return[]}return l.status==="rejected"?waitForSubprocessExit(s):l.value};const waitForSubprocessExit=async s=>{try{return await(0,Pt.once)(s,"exit")}catch{return waitForSubprocessExit(s)}};const waitForSuccessfulExit=async s=>{const[a,l]=await s;if(!isSubprocessErrorExit(a,l)&&isFailedExit(a,l)){throw new DiscardedError}return[a,l]};const isSubprocessErrorExit=(s,a)=>s===undefined&&a===undefined;const isFailedExit=(s,a)=>s!==0||a!==null;const getExitResultSync=({error:s,status:a,signal:l,output:D},{maxBuffer:d})=>{const g=getResultError(s,a,l);const y=g?.code==="ETIMEDOUT";const F=isMaxBufferSync(g,D,d);return{resultError:g,exitCode:a,signal:l,timedOut:y,isMaxBuffer:F}};const getResultError=(s,a,l)=>{if(s!==undefined){return s}return isFailedExit(a,l)?new DiscardedError:undefined};const execaCoreSync=(s,a,l)=>{const{file:D,commandArguments:d,command:g,escapedCommand:y,startTime:F,verboseInfo:w,options:C,fileDescriptors:S}=handleSyncArguments(s,a,l);const A=spawnSubprocessSync({file:D,commandArguments:d,options:C,command:g,escapedCommand:y,verboseInfo:w,fileDescriptors:S,startTime:F});return handleResult(A,w,C)};const handleSyncArguments=(s,a,l)=>{const{command:D,escapedCommand:d,startTime:g,verboseInfo:y}=handleCommand(s,a,l);const F=normalizeSyncOptions(l);const{file:w,commandArguments:C,options:S}=normalizeOptions(s,a,F);validateSyncOptions(S);const A=handleStdioSync(S,y);return{file:w,commandArguments:C,command:D,escapedCommand:d,startTime:g,verboseInfo:y,options:S,fileDescriptors:A}};const normalizeSyncOptions=s=>s.node&&!s.ipc?{...s,ipc:false}:s;const validateSyncOptions=({ipc:s,ipcInput:a,detached:l,cancelSignal:D})=>{if(a){throwInvalidSyncOption("ipcInput")}if(s){throwInvalidSyncOption("ipc: true")}if(l){throwInvalidSyncOption("detached: true")}if(D){throwInvalidSyncOption("cancelSignal")}};const throwInvalidSyncOption=s=>{throw new TypeError(`The "${s}" option cannot be used with synchronous methods.`)};const spawnSubprocessSync=({file:s,commandArguments:a,options:l,command:D,escapedCommand:d,verboseInfo:g,fileDescriptors:y,startTime:F})=>{const w=runSubprocessSync({file:s,commandArguments:a,options:l,command:D,escapedCommand:d,fileDescriptors:y,startTime:F});if(w.failed){return w}const{resultError:C,exitCode:S,signal:A,timedOut:M,isMaxBuffer:_}=getExitResultSync(w,l);const{output:G,error:W=C}=transformOutputSync({fileDescriptors:y,syncResult:w,options:l,isMaxBuffer:_,verboseInfo:g});const V=G.map(((s,a)=>stripNewline(s,l,a)));const X=stripNewline(getAllSync(G,l),l,"all");return getSyncResult({error:W,exitCode:S,signal:A,timedOut:M,isMaxBuffer:_,stdio:V,all:X,options:l,command:D,escapedCommand:d,startTime:F})};const runSubprocessSync=({file:s,commandArguments:a,options:l,command:D,escapedCommand:d,fileDescriptors:y,startTime:F})=>{try{addInputOptionsSync(y,l);const D=normalizeSpawnSyncOptions(l);return(0,g.spawnSync)(...concatenateShell(s,a,D))}catch(s){return makeEarlyError({error:s,command:D,escapedCommand:d,fileDescriptors:y,options:l,startTime:F,isSync:true})}};const normalizeSpawnSyncOptions=({encoding:s,maxBuffer:a,...l})=>({...l,encoding:"buffer",maxBuffer:getMaxBufferSync(a)});const getSyncResult=({error:s,exitCode:a,signal:l,timedOut:D,isMaxBuffer:d,stdio:g,all:y,options:F,command:w,escapedCommand:C,startTime:S})=>s===undefined?makeSuccessResult({command:w,escapedCommand:C,stdio:g,all:y,ipcOutput:[],options:F,startTime:S}):makeError({error:s,command:w,escapedCommand:C,timedOut:D,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:d,isForcefullyTerminated:false,exitCode:a,signal:l,stdio:g,all:y,ipcOutput:[],options:F,startTime:S,isSync:true});const getOneMessage=({anyProcess:s,channel:a,isSubprocess:l,ipc:D},{reference:d=true,filter:g}={})=>{validateIpcMethod({methodName:"getOneMessage",isSubprocess:l,ipc:D,isConnected:isConnected(s)});return getOneMessageAsync({anyProcess:s,channel:a,isSubprocess:l,filter:g,reference:d})};const getOneMessageAsync=async({anyProcess:s,channel:a,isSubprocess:l,filter:D,reference:d})=>{addReference(a,d);const g=getIpcEmitter(s,a,l);const y=new AbortController;try{return await Promise.race([getMessage(g,D,y),get_one_throwOnDisconnect(g,l,y),throwOnStrictError(g,l,y)])}catch(a){disconnect(s);throw a}finally{y.abort();removeReference(a,d)}};const getMessage=async(s,a,{signal:l})=>{if(a===undefined){const[a]=await(0,Pt.once)(s,"message",{signal:l});return a}for await(const[D]of(0,Pt.on)(s,"message",{signal:l})){if(a(D)){return D}}};const get_one_throwOnDisconnect=async(s,a,{signal:l})=>{await(0,Pt.once)(s,"disconnect",{signal:l});throwOnEarlyDisconnect(a)};const throwOnStrictError=async(s,a,{signal:l})=>{const[D]=await(0,Pt.once)(s,"strict:error",{signal:l});throw getStrictResponseError(D,a)};const getEachMessage=({anyProcess:s,channel:a,isSubprocess:l,ipc:D},{reference:d=true}={})=>loopOnMessages({anyProcess:s,channel:a,isSubprocess:l,ipc:D,shouldAwait:!l,reference:d});const loopOnMessages=({anyProcess:s,channel:a,isSubprocess:l,ipc:D,shouldAwait:d,reference:g})=>{validateIpcMethod({methodName:"getEachMessage",isSubprocess:l,ipc:D,isConnected:isConnected(s)});addReference(a,g);const y=getIpcEmitter(s,a,l);const F=new AbortController;const w={};stopOnDisconnect(s,y,F);abortOnStrictError({ipcEmitter:y,isSubprocess:l,controller:F,state:w});return iterateOnMessages({anyProcess:s,channel:a,ipcEmitter:y,isSubprocess:l,shouldAwait:d,controller:F,state:w,reference:g})};const stopOnDisconnect=async(s,a,l)=>{try{await(0,Pt.once)(a,"disconnect",{signal:l.signal});l.abort()}catch{}};const abortOnStrictError=async({ipcEmitter:s,isSubprocess:a,controller:l,state:D})=>{try{const[d]=await(0,Pt.once)(s,"strict:error",{signal:l.signal});D.error=getStrictResponseError(d,a);l.abort()}catch{}};const iterateOnMessages=async function*({anyProcess:s,channel:a,ipcEmitter:l,isSubprocess:D,shouldAwait:d,controller:g,state:y,reference:F}){try{for await(const[s]of(0,Pt.on)(l,"message",{signal:g.signal})){throwIfStrictError(y);yield s}}catch{throwIfStrictError(y)}finally{g.abort();removeReference(a,F);if(!D){disconnect(s)}if(d){await s}}};const throwIfStrictError=({error:s})=>{if(s){throw s}};const addIpcMethods=(s,{ipc:a})=>{Object.assign(s,getIpcMethods(s,false,a))};const getIpcExport=()=>{const s=_;const a=true;const l=_.channel!==undefined;return{...getIpcMethods(s,a,l),getCancelSignal:getCancelSignal.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:l})}};const getIpcMethods=(s,a,l)=>({sendMessage:sendMessage.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:l}),getOneMessage:getOneMessage.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:l}),getEachMessage:getEachMessage.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:l})});const handleEarlyError=({error:s,command:a,escapedCommand:l,fileDescriptors:D,options:d,startTime:y,verboseInfo:F})=>{cleanupCustomStreams(D);const w=new g.ChildProcess;createDummyStreams(w,D);Object.assign(w,{readable:readable,writable:writable,duplex:duplex});const C=makeEarlyError({error:s,command:a,escapedCommand:l,fileDescriptors:D,options:d,startTime:y,isSync:false});const S=handleDummyPromise(C,F,d);return{subprocess:w,promise:S}};const createDummyStreams=(s,a)=>{const l=createDummyStream();const D=createDummyStream();const d=createDummyStream();const g=Array.from({length:a.length-3},createDummyStream);const y=createDummyStream();const F=[l,D,d,...g];Object.assign(s,{stdin:l,stdout:D,stderr:d,all:y,stdio:F})};const createDummyStream=()=>{const s=new In.PassThrough;s.end();return s};const readable=()=>new In.Readable({read(){}});const writable=()=>new In.Writable({write(){}});const duplex=()=>new In.Duplex({read(){},write(){}});const handleDummyPromise=async(s,a,l)=>handleResult(s,a,l);const handleStdioAsync=(s,a)=>handleStdio(_n,s,a,false);const forbiddenIfAsync=({type:s,optionName:a})=>{throw new TypeError(`The \`${a}\` option cannot be ${Sn[s]}.`)};const Ln={fileNumber:forbiddenIfAsync,generator:generatorToStream,asyncGenerator:generatorToStream,nodeStream:({value:s})=>({stream:s}),webTransform({value:{transform:s,writableObjectMode:a,readableObjectMode:l}}){const D=a||l;const d=In.Duplex.fromWeb(s,{objectMode:D});return{stream:d}},duplex:({value:{transform:s}})=>({stream:s}),native(){}};const _n={input:{...Ln,fileUrl:({value:s})=>({stream:(0,sn.createReadStream)(s)}),filePath:({value:{file:s}})=>({stream:(0,sn.createReadStream)(s)}),webStream:({value:s})=>({stream:In.Readable.fromWeb(s)}),iterable:({value:s})=>({stream:In.Readable.from(s)}),asyncIterable:({value:s})=>({stream:In.Readable.from(s)}),string:({value:s})=>({stream:In.Readable.from(s)}),uint8Array:({value:s})=>({stream:In.Readable.from(Nn.Buffer.from(s))})},output:{...Ln,fileUrl:({value:s})=>({stream:(0,sn.createWriteStream)(s)}),filePath:({value:{file:s,append:a}})=>({stream:(0,sn.createWriteStream)(s,a?{flags:"a"}:{})}),webStream:({value:s})=>({stream:In.Writable.fromWeb(s)}),iterable:forbiddenIfAsync,asyncIterable:forbiddenIfAsync,string:forbiddenIfAsync,uint8Array:forbiddenIfAsync}};const Un=s(import.meta.url)("node:stream/promises");function mergeStreams(s){if(!Array.isArray(s)){throw new TypeError(`Expected an array, got \`${typeof s}\`.`)}for(const a of s){validateStream(a)}const a=s.some((({readableObjectMode:s})=>s));const l=getHighWaterMark(s,a);const D=new MergedStream({objectMode:a,writableHighWaterMark:l,readableHighWaterMark:l});for(const a of s){D.add(a)}return D}const getHighWaterMark=(s,a)=>{if(s.length===0){return(0,In.getDefaultHighWaterMark)(a)}const l=s.filter((({readableObjectMode:s})=>s===a)).map((({readableHighWaterMark:s})=>s));return Math.max(...l)};class MergedStream extends In.PassThrough{#i=new Set([]);#u=new Set([]);#a=new Set([]);#c;#l=Symbol("unpipe");#D=new WeakMap;add(s){validateStream(s);if(this.#i.has(s)){return}this.#i.add(s);this.#c??=onMergedStreamFinished(this,this.#i,this.#l);const a=endWhenStreamsDone({passThroughStream:this,stream:s,streams:this.#i,ended:this.#u,aborted:this.#a,onFinished:this.#c,unpipeEvent:this.#l});this.#D.set(s,a);s.pipe(this,{end:false})}async remove(s){validateStream(s);if(!this.#i.has(s)){return false}const a=this.#D.get(s);if(a===undefined){return false}this.#D.delete(s);s.unpipe(this);await a;return true}}const onMergedStreamFinished=async(s,a,l)=>{updateMaxListeners(s,Gn);const D=new AbortController;try{await Promise.race([onMergedStreamEnd(s,D),onInputStreamsUnpipe(s,a,l,D)])}finally{D.abort();updateMaxListeners(s,-Gn)}};const onMergedStreamEnd=async(s,{signal:a})=>{try{await(0,Un.finished)(s,{signal:a,cleanup:true})}catch(a){errorOrAbortStream(s,a);throw a}};const onInputStreamsUnpipe=async(s,a,l,{signal:D})=>{for await(const[d]of(0,Pt.on)(s,"unpipe",{signal:D})){if(a.has(d)){d.emit(l)}}};const validateStream=s=>{if(typeof s?.pipe!=="function"){throw new TypeError(`Expected a readable stream, got: \`${typeof s}\`.`)}};const endWhenStreamsDone=async({passThroughStream:s,stream:a,streams:l,ended:D,aborted:d,onFinished:g,unpipeEvent:y})=>{updateMaxListeners(s,Wn);const F=new AbortController;try{await Promise.race([afterMergedStreamFinished(g,a,F),onInputStreamEnd({passThroughStream:s,stream:a,streams:l,ended:D,aborted:d,controller:F}),onInputStreamUnpipe({stream:a,streams:l,ended:D,aborted:d,unpipeEvent:y,controller:F})])}finally{F.abort();updateMaxListeners(s,-Wn)}if(l.size>0&&l.size===D.size+d.size){if(D.size===0&&d.size>0){abortStream(s)}else{endStream(s)}}};const afterMergedStreamFinished=async(s,a,{signal:l})=>{try{await s;if(!l.aborted){abortStream(a)}}catch(s){if(!l.aborted){errorOrAbortStream(a,s)}}};const onInputStreamEnd=async({passThroughStream:s,stream:a,streams:l,ended:D,aborted:d,controller:{signal:g}})=>{try{await(0,Un.finished)(a,{signal:g,cleanup:true,readable:true,writable:false});if(l.has(a)){D.add(a)}}catch(D){if(g.aborted||!l.has(a)){return}if(isAbortError(D)){d.add(a)}else{errorStream(s,D)}}};const onInputStreamUnpipe=async({stream:s,streams:a,ended:l,aborted:D,unpipeEvent:d,controller:{signal:g}})=>{await(0,Pt.once)(s,d,{signal:g});if(!s.readable){return(0,Pt.once)(g,"abort",{signal:g})}a.delete(s);l.delete(s);D.delete(s)};const endStream=s=>{if(s.writable){s.end()}};const errorOrAbortStream=(s,a)=>{if(isAbortError(a)){abortStream(s)}else{errorStream(s,a)}};const isAbortError=s=>s?.code==="ERR_STREAM_PREMATURE_CLOSE";const abortStream=s=>{if(s.readable||s.writable){s.destroy()}};const errorStream=(s,a)=>{if(!s.destroyed){s.once("error",noop);s.destroy(a)}};const noop=()=>{};const updateMaxListeners=(s,a)=>{const l=s.getMaxListeners();if(l!==0&&l!==Number.POSITIVE_INFINITY){s.setMaxListeners(l+a)}};const Gn=2;const Wn=1;const pipeStreams=(s,a)=>{s.pipe(a);onSourceFinish(s,a);onDestinationFinish(s,a)};const onSourceFinish=async(s,a)=>{if(isStandardStream(s)||isStandardStream(a)){return}try{await(0,Un.finished)(s,{cleanup:true,readable:true,writable:false})}catch{}endDestinationStream(a)};const endDestinationStream=s=>{if(s.writable){s.end()}};const onDestinationFinish=async(s,a)=>{if(isStandardStream(s)||isStandardStream(a)){return}try{await(0,Un.finished)(a,{cleanup:true,readable:false,writable:true})}catch{}abortSourceStream(s)};const abortSourceStream=s=>{if(s.readable){s.destroy()}};const pipeOutputAsync=(s,a,l)=>{const D=new Map;for(const[d,{stdioItems:g,direction:y}]of Object.entries(a)){for(const{stream:a}of g.filter((({type:s})=>Fn.has(s)))){pipeTransform(s,a,y,d)}for(const{stream:a}of g.filter((({type:s})=>!Fn.has(s)))){pipeStdioItem({subprocess:s,stream:a,direction:y,fdNumber:d,pipeGroups:D,controller:l})}}for(const[s,a]of D.entries()){const l=a.length===1?a[0]:mergeStreams(a);pipeStreams(l,s)}};const pipeTransform=(s,a,l,D)=>{if(l==="output"){pipeStreams(s.stdio[D],a)}else{pipeStreams(a,s.stdio[D])}const d=Vn[D];if(d!==undefined){s[d]=a}s.stdio[D]=a};const Vn=["stdin","stdout","stderr"];const pipeStdioItem=({subprocess:s,stream:a,direction:l,fdNumber:D,pipeGroups:d,controller:g})=>{if(a===undefined){return}setStandardStreamMaxListeners(a,g);const[y,F]=l==="output"?[a,s.stdio[D]]:[s.stdio[D],a];const w=d.get(y)??[];d.set(y,[...w,F])};const setStandardStreamMaxListeners=(s,{signal:a})=>{if(isStandardStream(s)){incrementMaxListeners(s,zn,a)}};const zn=2;const qn=[];qn.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32"){qn.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){qn.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")}const processOk=s=>!!s&&typeof s==="object"&&typeof s.removeListener==="function"&&typeof s.emit==="function"&&typeof s.reallyExit==="function"&&typeof s.listeners==="function"&&typeof s.kill==="function"&&typeof s.pid==="number"&&typeof s.on==="function";const Hn=Symbol.for("signal-exit emitter");const Kn=globalThis;const Yn=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Kn[Hn]){return Kn[Hn]}Yn(Kn,Hn,{value:this,writable:false,enumerable:false,configurable:false})}on(s,a){this.listeners[s].push(a)}removeListener(s,a){const l=this.listeners[s];const D=l.indexOf(a);if(D===-1){return}if(D===0&&l.length===1){l.length=0}else{l.splice(D,1)}}emit(s,a,l){if(this.emitted[s]){return false}this.emitted[s]=true;let D=false;for(const d of this.listeners[s]){D=d(a,l)===true||D}if(s==="exit"){D=this.emit("afterExit",a,l)||D}return D}}class SignalExitBase{}const signalExitWrap=s=>({onExit(a,l){return s.onExit(a,l)},load(){return s.load()},unload(){return s.unload()}});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#d=Jn.platform==="win32"?"SIGINT":"SIGHUP";#f=new Emitter;#p;#m;#h;#b={};#g=false;constructor(s){super();this.#p=s;this.#b={};for(const a of qn){this.#b[a]=()=>{const l=this.#p.listeners(a);let{count:D}=this.#f;const d=s;if(typeof d.__signal_exit_emitter__==="object"&&typeof d.__signal_exit_emitter__.count==="number"){D+=d.__signal_exit_emitter__.count}if(l.length===D){this.unload();const l=this.#f.emit("exit",null,a);const D=a==="SIGHUP"?this.#d:a;if(!l)s.kill(s.pid,D)}}}this.#h=s.reallyExit;this.#m=s.emit}onExit(s,a){if(!processOk(this.#p)){return()=>{}}if(this.#g===false){this.load()}const l=a?.alwaysLast?"afterExit":"exit";this.#f.on(l,s);return()=>{this.#f.removeListener(l,s);if(this.#f.listeners["exit"].length===0&&this.#f.listeners["afterExit"].length===0){this.unload()}}}load(){if(this.#g){return}this.#g=true;this.#f.count+=1;for(const s of qn){try{const a=this.#b[s];if(a)this.#p.on(s,a)}catch(s){}}this.#p.emit=(s,...a)=>this.#y(s,...a);this.#p.reallyExit=s=>this.#F(s)}unload(){if(!this.#g){return}this.#g=false;qn.forEach((s=>{const a=this.#b[s];if(!a){throw new Error("Listener not defined for signal: "+s)}try{this.#p.removeListener(s,a)}catch(s){}}));this.#p.emit=this.#m;this.#p.reallyExit=this.#h;this.#f.count-=1}#F(s){if(!processOk(this.#p)){return 0}this.#p.exitCode=s||0;this.#f.emit("exit",this.#p.exitCode,null);return this.#h.call(this.#p,this.#p.exitCode)}#y(s,...a){const l=this.#m;if(s==="exit"&&processOk(this.#p)){if(typeof a[0]==="number"){this.#p.exitCode=a[0]}const D=l.call(this.#p,s,...a);this.#f.emit("exit",this.#p.exitCode,null);return D}else{return l.call(this.#p,s,...a)}}}const Jn=globalThis.process;const{onExit:Zn,load:Xn,unload:Qn}=signalExitWrap(processOk(Jn)?new SignalExit(Jn):new SignalExitFallback);const cleanupOnExit=(s,{cleanup:a,detached:l},{signal:D})=>{if(!a||l){return}const d=Zn((()=>{s.kill()}));(0,Pt.addAbortListener)(D,(()=>{d()}))};const normalizePipeArguments=({source:s,sourcePromise:a,boundOptions:l,createNested:D},...d)=>{const g=getStartTime();const{destination:y,destinationStream:F,destinationError:w,from:C,unpipeSignal:S}=getDestinationStream(l,D,d);const{sourceStream:A,sourceError:M}=getSourceStream(s,C);const{options:_,fileDescriptors:G}=_t.get(s);return{sourcePromise:a,sourceStream:A,sourceOptions:_,sourceError:M,destination:y,destinationStream:F,destinationError:w,unpipeSignal:S,fileDescriptors:G,startTime:g}};const getDestinationStream=(s,a,l)=>{try{const{destination:D,pipeOptions:{from:d,to:g,unpipeSignal:y}={}}=getDestination(s,a,...l);const F=getToStream(D,g);return{destination:D,destinationStream:F,from:d,unpipeSignal:y}}catch(s){return{destinationError:s}}};const getDestination=(s,a,l,...D)=>{if(Array.isArray(l)){const d=a(mapDestinationArguments,s)(l,...D);return{destination:d,pipeOptions:s}}if(typeof l==="string"||l instanceof URL||isDenoExecPath(l)){if(Object.keys(s).length>0){throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).')}const[d,g,y]=normalizeParameters(l,...D);const F=a(mapDestinationArguments)(d,g,y);return{destination:F,pipeOptions:y}}if(_t.has(l)){if(Object.keys(s).length>0){throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).")}return{destination:l,pipeOptions:D[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${l}`)};const mapDestinationArguments=({options:s})=>({options:{...s,stdin:"pipe",piped:true}});const getSourceStream=(s,a)=>{try{const l=getFromStream(s,a);return{sourceStream:l}}catch(s){return{sourceError:s}}};const handlePipeArgumentsError=({sourceStream:s,sourceError:a,destinationStream:l,destinationError:D,fileDescriptors:d,sourceOptions:g,startTime:y})=>{const F=getPipeArgumentsError({sourceStream:s,sourceError:a,destinationStream:l,destinationError:D});if(F!==undefined){throw createNonCommandError({error:F,fileDescriptors:d,sourceOptions:g,startTime:y})}};const getPipeArgumentsError=({sourceStream:s,sourceError:a,destinationStream:l,destinationError:D})=>{if(a!==undefined&&D!==undefined){return D}if(D!==undefined){abortSourceStream(s);return D}if(a!==undefined){endDestinationStream(l);return a}};const createNonCommandError=({error:s,fileDescriptors:a,sourceOptions:l,startTime:D})=>makeEarlyError({error:s,command:er,escapedCommand:er,fileDescriptors:a,options:l,startTime:D,isSync:false});const er="source.pipe(destination)";const waitForBothSubprocesses=async s=>{const[{status:a,reason:l,value:D=l},{status:d,reason:g,value:y=g}]=await s;if(!y.pipedFrom.includes(D)){y.pipedFrom.push(D)}if(d==="rejected"){throw y}if(a==="rejected"){throw D}return y};const pipeSubprocessStream=(s,a,l)=>{const D=tr.has(a)?pipeMoreSubprocessStream(s,a):pipeFirstSubprocessStream(s,a);incrementMaxListeners(s,nr,l.signal);incrementMaxListeners(a,rr,l.signal);cleanupMergedStreamsMap(a);return D};const pipeFirstSubprocessStream=(s,a)=>{const l=mergeStreams([s]);pipeStreams(l,a);tr.set(a,l);return l};const pipeMoreSubprocessStream=(s,a)=>{const l=tr.get(a);l.add(s);return l};const cleanupMergedStreamsMap=async s=>{try{await(0,Un.finished)(s,{cleanup:true,readable:false,writable:true})}catch{}tr.delete(s)};const tr=new WeakMap;const nr=2;const rr=1;const unpipeOnAbort=(s,a)=>s===undefined?[]:[unpipeOnSignalAbort(s,a)];const unpipeOnSignalAbort=async(s,{sourceStream:a,mergedStream:l,fileDescriptors:D,sourceOptions:d,startTime:g})=>{await(0,M.aborted)(s,a);await l.remove(a);const y=new Error("Pipe canceled by `unpipeSignal` option.");throw createNonCommandError({error:y,fileDescriptors:D,sourceOptions:d,startTime:g})};const pipeToSubprocess=(s,...a)=>{if(isPlainObject(a[0])){return pipeToSubprocess.bind(undefined,{...s,boundOptions:{...s.boundOptions,...a[0]}})}const{destination:l,...D}=normalizePipeArguments(s,...a);const d=handlePipePromise({...D,destination:l});d.pipe=pipeToSubprocess.bind(undefined,{...s,source:l,sourcePromise:d,boundOptions:{}});return d};const handlePipePromise=async({sourcePromise:s,sourceStream:a,sourceOptions:l,sourceError:D,destination:d,destinationStream:g,destinationError:y,unpipeSignal:F,fileDescriptors:w,startTime:C})=>{const S=getSubprocessPromises(s,d);handlePipeArgumentsError({sourceStream:a,sourceError:D,destinationStream:g,destinationError:y,fileDescriptors:w,sourceOptions:l,startTime:C});const A=new AbortController;try{const s=pipeSubprocessStream(a,g,A);return await Promise.race([waitForBothSubprocesses(S),...unpipeOnAbort(F,{sourceStream:a,mergedStream:s,sourceOptions:l,fileDescriptors:w,startTime:C})])}finally{A.abort()}};const getSubprocessPromises=(s,a)=>Promise.allSettled([s,a]);const utils_identity=s=>s;const utils_noop=()=>undefined;const getContentsProperty=({contents:s})=>s;const throwObjectStream=s=>{throw new Error(`Streams in object mode are not supported: ${String(s)}`)};const getLengthProperty=s=>s.length;async function getStreamAsArray(s,a){return getStreamContents(s,sr,a)}const initArray=()=>({contents:[]});const increment=()=>1;const addArrayChunk=(s,{contents:a})=>{a.push(s);return a};const sr={init:initArray,convertChunk:{string:utils_identity,buffer:utils_identity,arrayBuffer:utils_identity,dataView:utils_identity,typedArray:utils_identity,others:utils_identity},getSize:increment,truncateChunk:utils_noop,addChunk:addArrayChunk,getFinalChunk:utils_noop,finalize:getContentsProperty};async function getStreamAsArrayBuffer(s,a){return getStreamContents(s,ur,a)}const initArrayBuffer=()=>({contents:new ArrayBuffer(0)});const useTextEncoder=s=>or.encode(s);const or=new TextEncoder;const useUint8Array=s=>new Uint8Array(s);const useUint8ArrayWithOffset=s=>new Uint8Array(s.buffer,s.byteOffset,s.byteLength);const truncateArrayBufferChunk=(s,a)=>s.slice(0,a);const addArrayBufferChunk=(s,{contents:a,length:l},D)=>{const d=hasArrayBufferResize()?resizeArrayBuffer(a,D):resizeArrayBufferSlow(a,D);new Uint8Array(d).set(s,l);return d};const resizeArrayBufferSlow=(s,a)=>{if(a<=s.byteLength){return s}const l=new ArrayBuffer(getNewContentsLength(a));new Uint8Array(l).set(new Uint8Array(s),0);return l};const resizeArrayBuffer=(s,a)=>{if(a<=s.maxByteLength){s.resize(a);return s}const l=new ArrayBuffer(a,{maxByteLength:getNewContentsLength(a)});new Uint8Array(l).set(new Uint8Array(s),0);return l};const getNewContentsLength=s=>ir**Math.ceil(Math.log(s)/Math.log(ir));const ir=2;const finalizeArrayBuffer=({contents:s,length:a})=>hasArrayBufferResize()?s:s.slice(0,a);const hasArrayBufferResize=()=>"resize"in ArrayBuffer.prototype;const ur={init:initArrayBuffer,convertChunk:{string:useTextEncoder,buffer:useUint8Array,arrayBuffer:useUint8Array,dataView:useUint8ArrayWithOffset,typedArray:useUint8ArrayWithOffset,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateArrayBufferChunk,addChunk:addArrayBufferChunk,getFinalChunk:utils_noop,finalize:finalizeArrayBuffer};async function getStreamAsString(s,a){return getStreamContents(s,ar,a)}const initString=()=>({contents:"",textDecoder:new TextDecoder});const useTextDecoder=(s,{textDecoder:a})=>a.decode(s,{stream:true});const addStringChunk=(s,{contents:a})=>a+s;const truncateStringChunk=(s,a)=>s.slice(0,a);const getFinalStringChunk=({textDecoder:s})=>{const a=s.decode();return a===""?undefined:a};const ar={init:initString,convertChunk:{string:utils_identity,buffer:useTextDecoder,arrayBuffer:useTextDecoder,dataView:useTextDecoder,typedArray:useTextDecoder,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateStringChunk,addChunk:addStringChunk,getFinalChunk:getFinalStringChunk,finalize:getContentsProperty};const iterateOnSubprocessStream=({subprocessStdout:s,subprocess:a,binary:l,shouldEncode:D,encoding:d,preserveNewlines:g})=>{const y=new AbortController;stopReadingOnExit(a,y);return iterateOnStream({stream:s,controller:y,binary:l,shouldEncode:!s.readableObjectMode&&D,encoding:d,shouldSplit:!s.readableObjectMode,preserveNewlines:g})};const stopReadingOnExit=async(s,a)=>{try{await s}catch{}finally{a.abort()}};const iterateForResult=({stream:s,onStreamEnd:a,lines:l,encoding:D,stripFinalNewline:d,allMixed:g})=>{const y=new AbortController;stopReadingOnStreamEnd(a,y,s);const F=s.readableObjectMode&&!g;return iterateOnStream({stream:s,controller:y,binary:D==="buffer",shouldEncode:!F,encoding:D,shouldSplit:!F&&l,preserveNewlines:!d})};const stopReadingOnStreamEnd=async(s,a,l)=>{try{await s}catch{l.destroy()}finally{a.abort()}};const iterateOnStream=({stream:s,controller:a,binary:l,shouldEncode:D,encoding:d,shouldSplit:g,preserveNewlines:y})=>{const F=(0,Pt.on)(s,"data",{signal:a.signal,highWaterMark:lr,highWatermark:lr});return iterateOnData({onStdoutChunk:F,controller:a,binary:l,shouldEncode:D,encoding:d,shouldSplit:g,preserveNewlines:y})};const cr=(0,In.getDefaultHighWaterMark)(true);const lr=cr;const iterateOnData=async function*({onStdoutChunk:s,controller:a,binary:l,shouldEncode:D,encoding:d,shouldSplit:g,preserveNewlines:y}){const F=getGenerators({binary:l,shouldEncode:D,encoding:d,shouldSplit:g,preserveNewlines:y});try{for await(const[a]of s){yield*transformChunkSync(a,F,0)}}catch(s){if(!a.signal.aborted){throw s}}finally{yield*finalChunksSync(F)}};const getGenerators=({binary:s,shouldEncode:a,encoding:l,shouldSplit:D,preserveNewlines:d})=>[getEncodingTransformGenerator(s,l,!a),getSplitLinesGenerator(s,d,!D,{})].filter(Boolean);const getStreamOutput=async({stream:s,onStreamEnd:a,fdNumber:l,encoding:D,buffer:d,maxBuffer:g,lines:y,allMixed:F,stripFinalNewline:w,verboseInfo:C,streamInfo:S})=>{const A=logOutputAsync({stream:s,onStreamEnd:a,fdNumber:l,encoding:D,allMixed:F,verboseInfo:C,streamInfo:S});if(!d){await Promise.all([resumeStream(s),A]);return}const M=getStripFinalNewline(w,l);const _=iterateForResult({stream:s,onStreamEnd:a,lines:y,encoding:D,stripFinalNewline:M,allMixed:F});const[G]=await Promise.all([contents_getStreamContents({stream:s,iterable:_,fdNumber:l,encoding:D,maxBuffer:g,lines:y}),A]);return G};const logOutputAsync=async({stream:s,onStreamEnd:a,fdNumber:l,encoding:D,allMixed:d,verboseInfo:g,streamInfo:{fileDescriptors:y}})=>{if(!shouldLogOutput({stdioItems:y[l]?.stdioItems,encoding:D,verboseInfo:g,fdNumber:l})){return}const F=iterateForResult({stream:s,onStreamEnd:a,lines:true,encoding:D,stripFinalNewline:true,allMixed:d});await logLines(F,s,l,g)};const resumeStream=async s=>{await(0,$t.setImmediate)();if(s.readableFlowing===null){s.resume()}};const contents_getStreamContents=async({stream:s,stream:{readableObjectMode:a},iterable:l,fdNumber:D,encoding:d,maxBuffer:g,lines:y})=>{try{if(a||y){return await getStreamAsArray(l,{maxBuffer:g})}if(d==="buffer"){return new Uint8Array(await getStreamAsArrayBuffer(l,{maxBuffer:g}))}return await getStreamAsString(l,{maxBuffer:g})}catch(l){return handleBufferedData(handleMaxBuffer({error:l,stream:s,readableObjectMode:a,lines:y,encoding:d,fdNumber:D}))}};const getBufferedData=async s=>{try{return await s}catch(s){return handleBufferedData(s)}};const handleBufferedData=({bufferedData:s})=>isArrayBuffer(s)?new Uint8Array(s):s;const waitForStream=async(s,a,l,{isSameDirection:D,stopOnExit:d=false}={})=>{const g=handleStdinDestroy(s,l);const y=new AbortController;try{await Promise.race([...d?[l.exitPromise]:[],(0,Un.finished)(s,{cleanup:true,signal:y.signal})])}catch(s){if(!g.stdinCleanedUp){handleStreamError(s,a,l,D)}}finally{y.abort()}};const handleStdinDestroy=(s,{originalStreams:[a],subprocess:l})=>{const D={stdinCleanedUp:false};if(s===a){spyOnStdinDestroy(s,l,D)}return D};const spyOnStdinDestroy=(s,a,l)=>{const{_destroy:D}=s;s._destroy=(...d)=>{setStdinCleanedUp(a,l);D.call(s,...d)}};const setStdinCleanedUp=({exitCode:s,signalCode:a},l)=>{if(s!==null||a!==null){l.stdinCleanedUp=true}};const handleStreamError=(s,a,l,D)=>{if(!shouldIgnoreStreamError(s,a,l,D)){throw s}};const shouldIgnoreStreamError=(s,a,l,D=true)=>{if(l.propagating){return isStreamEpipe(s)||isStreamAbort(s)}l.propagating=true;return isInputFileDescriptor(l,a)===D?isStreamEpipe(s):isStreamAbort(s)};const isInputFileDescriptor=({fileDescriptors:s},a)=>a!=="all"&&s[a].direction==="input";const isStreamAbort=s=>s?.code==="ERR_STREAM_PREMATURE_CLOSE";const isStreamEpipe=s=>s?.code==="EPIPE";const waitForStdioStreams=({subprocess:s,encoding:a,buffer:l,maxBuffer:D,lines:d,stripFinalNewline:g,verboseInfo:y,streamInfo:F})=>s.stdio.map(((s,w)=>waitForSubprocessStream({stream:s,fdNumber:w,encoding:a,buffer:l[w],maxBuffer:D[w],lines:d[w],allMixed:false,stripFinalNewline:g,verboseInfo:y,streamInfo:F})));const waitForSubprocessStream=async({stream:s,fdNumber:a,encoding:l,buffer:D,maxBuffer:d,lines:g,allMixed:y,stripFinalNewline:F,verboseInfo:w,streamInfo:C})=>{if(!s){return}const S=waitForStream(s,a,C);if(isInputFileDescriptor(C,a)){await S;return}const[A]=await Promise.all([getStreamOutput({stream:s,onStreamEnd:S,fdNumber:a,encoding:l,buffer:D,maxBuffer:d,lines:g,allMixed:y,stripFinalNewline:F,verboseInfo:w,streamInfo:C}),S]);return A};const makeAllStream=({stdout:s,stderr:a},{all:l})=>l&&(s||a)?mergeStreams([s,a].filter(Boolean)):undefined;const waitForAllStream=({subprocess:s,encoding:a,buffer:l,maxBuffer:D,lines:d,stripFinalNewline:g,verboseInfo:y,streamInfo:F})=>waitForSubprocessStream({...getAllStream(s,l),fdNumber:"all",encoding:a,maxBuffer:D[1]+D[2],lines:d[1]||d[2],allMixed:getAllMixed(s),stripFinalNewline:g,verboseInfo:y,streamInfo:F});const getAllStream=({stdout:s,stderr:a,all:l},[,D,d])=>{const g=D||d;if(!g){return{stream:l,buffer:g}}if(!D){return{stream:a,buffer:g}}if(!d){return{stream:s,buffer:g}}return{stream:l,buffer:g}};const getAllMixed=({all:s,stdout:a,stderr:l})=>s&&a&&l&&a.readableObjectMode!==l.readableObjectMode;const shouldLogIpc=s=>isFullVerbose(s,"ipc");const logIpcOutput=(s,a)=>{const l=serializeVerboseMessage(s);verboseLog({type:"ipc",verboseMessage:l,fdNumber:"ipc",verboseInfo:a})};const waitForIpcOutput=async({subprocess:s,buffer:a,maxBuffer:l,ipc:D,ipcOutput:d,verboseInfo:g})=>{if(!D){return d}const y=shouldLogIpc(g);const F=getFdSpecificValue(a,"ipc");const w=getFdSpecificValue(l,"ipc");for await(const a of loopOnMessages({anyProcess:s,channel:s.channel,isSubprocess:false,ipc:D,shouldAwait:false,reference:true})){if(F){checkIpcMaxBuffer(s,d,w);d.push(a)}if(y){logIpcOutput(a,g)}}return d};const getBufferedIpcOutput=async(s,a)=>{await Promise.allSettled([s]);return a};const waitForSubprocessResult=async({subprocess:s,options:{encoding:a,buffer:l,maxBuffer:D,lines:d,timeoutDuration:g,cancelSignal:y,gracefulCancel:F,forceKillAfterDelay:w,stripFinalNewline:C,ipc:S,ipcInput:A},context:M,verboseInfo:_,fileDescriptors:G,originalStreams:W,onInternalError:V,controller:X})=>{const ee=waitForExit(s,M);const te={originalStreams:W,fileDescriptors:G,subprocess:s,exitPromise:ee,propagating:false};const ne=waitForStdioStreams({subprocess:s,encoding:a,buffer:l,maxBuffer:D,lines:d,stripFinalNewline:C,verboseInfo:_,streamInfo:te});const re=waitForAllStream({subprocess:s,encoding:a,buffer:l,maxBuffer:D,lines:d,stripFinalNewline:C,verboseInfo:_,streamInfo:te});const se=[];const oe=waitForIpcOutput({subprocess:s,buffer:l,maxBuffer:D,ipc:S,ipcOutput:se,verboseInfo:_});const ie=waitForOriginalStreams(W,s,te);const ue=waitForCustomStreamsEnd(G,te);try{return await Promise.race([Promise.all([{},waitForSuccessfulExit(ee),Promise.all(ne),re,oe,sendIpcInput(s,A),...ie,...ue]),V,throwOnSubprocessError(s,X),...throwOnTimeout(s,g,M,X),...throwOnCancel({subprocess:s,cancelSignal:y,gracefulCancel:F,context:M,controller:X}),...throwOnGracefulCancel({subprocess:s,cancelSignal:y,gracefulCancel:F,forceKillAfterDelay:w,context:M,controller:X})])}catch(s){M.terminationReason??="other";return Promise.all([{error:s},ee,Promise.all(ne.map((s=>getBufferedData(s)))),getBufferedData(re),getBufferedIpcOutput(oe,se),Promise.allSettled(ie),Promise.allSettled(ue)])}};const waitForOriginalStreams=(s,a,l)=>s.map(((s,D)=>s===a.stdio[D]?undefined:waitForStream(s,D,l)));const waitForCustomStreamsEnd=(s,a)=>s.flatMap((({stdioItems:s},l)=>s.filter((({value:s,stream:a=s})=>isStream(a,{checkOpen:false})&&!isStandardStream(a))).map((({type:s,value:D,stream:d=D})=>waitForStream(d,l,a,{isSameDirection:Fn.has(s),stopOnExit:s==="native"})))));const throwOnSubprocessError=async(s,{signal:a})=>{const[l]=await(0,Pt.once)(s,"error",{signal:a});throw l};const initializeConcurrentStreams=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap});const addConcurrentStream=(s,a,l)=>{const D=s[l];if(!D.has(a)){D.set(a,[])}const d=D.get(a);const g=createDeferred();d.push(g);const y=g.resolve.bind(g);return{resolve:y,promises:d}};const waitForConcurrentStreams=async({resolve:s,promises:a},l)=>{s();const[D]=await Promise.race([Promise.allSettled([true,l]),Promise.all([false,...a])]);return!D};const safeWaitForSubprocessStdin=async s=>{if(s===undefined){return}try{await waitForSubprocessStdin(s)}catch{}};const safeWaitForSubprocessStdout=async s=>{if(s===undefined){return}try{await waitForSubprocessStdout(s)}catch{}};const waitForSubprocessStdin=async s=>{await(0,Un.finished)(s,{cleanup:true,readable:false,writable:true})};const waitForSubprocessStdout=async s=>{await(0,Un.finished)(s,{cleanup:true,readable:true,writable:false})};const waitForSubprocess=async(s,a)=>{await s;if(a){throw a}};const destroyOtherStream=(s,a,l)=>{if(l&&!isStreamAbort(l)){s.destroy(l)}else if(a){s.destroy()}};const createReadable=({subprocess:s,concurrentStreams:a,encoding:l},{from:D,binary:d=true,preserveNewlines:g=true}={})=>{const y=d||tn.has(l);const{subprocessStdout:F,waitReadableDestroy:w}=getSubprocessStdout(s,D,a);const{readableEncoding:C,readableObjectMode:S,readableHighWaterMark:A}=getReadableOptions(F,y);const{read:_,onStdoutDataDone:G}=getReadableMethods({subprocessStdout:F,subprocess:s,binary:y,encoding:l,preserveNewlines:g});const W=new In.Readable({read:_,destroy:(0,M.callbackify)(onReadableDestroy.bind(undefined,{subprocessStdout:F,subprocess:s,waitReadableDestroy:w})),highWaterMark:A,objectMode:S,encoding:C});onStdoutFinished({subprocessStdout:F,onStdoutDataDone:G,readable:W,subprocess:s});return W};const getSubprocessStdout=(s,a,l)=>{const D=getFromStream(s,a);const d=addConcurrentStream(l,D,"readableDestroy");return{subprocessStdout:D,waitReadableDestroy:d}};const getReadableOptions=({readableEncoding:s,readableObjectMode:a,readableHighWaterMark:l},D)=>D?{readableEncoding:s,readableObjectMode:a,readableHighWaterMark:l}:{readableEncoding:s,readableObjectMode:true,readableHighWaterMark:cr};const getReadableMethods=({subprocessStdout:s,subprocess:a,binary:l,encoding:D,preserveNewlines:d})=>{const g=createDeferred();const y=iterateOnSubprocessStream({subprocessStdout:s,subprocess:a,binary:l,shouldEncode:!l,encoding:D,preserveNewlines:d});return{read(){onRead(this,y,g)},onStdoutDataDone:g}};const onRead=async(s,a,l)=>{try{const{value:D,done:d}=await a.next();if(d){l.resolve()}else{s.push(D)}}catch{}};const onStdoutFinished=async({subprocessStdout:s,onStdoutDataDone:a,readable:l,subprocess:D,subprocessStdin:d})=>{try{await waitForSubprocessStdout(s);await D;await safeWaitForSubprocessStdin(d);await a;if(l.readable){l.push(null)}}catch(s){await safeWaitForSubprocessStdin(d);destroyOtherReadable(l,s)}};const onReadableDestroy=async({subprocessStdout:s,subprocess:a,waitReadableDestroy:l},D)=>{if(await waitForConcurrentStreams(l,a)){destroyOtherReadable(s,D);await waitForSubprocess(a,D)}};const destroyOtherReadable=(s,a)=>{destroyOtherStream(s,s.readable,a)};const createWritable=({subprocess:s,concurrentStreams:a},{to:l}={})=>{const{subprocessStdin:D,waitWritableFinal:d,waitWritableDestroy:g}=getSubprocessStdin(s,l,a);const y=new In.Writable({...getWritableMethods(D,s,d),destroy:(0,M.callbackify)(onWritableDestroy.bind(undefined,{subprocessStdin:D,subprocess:s,waitWritableFinal:d,waitWritableDestroy:g})),highWaterMark:D.writableHighWaterMark,objectMode:D.writableObjectMode});onStdinFinished(D,y);return y};const getSubprocessStdin=(s,a,l)=>{const D=getToStream(s,a);const d=addConcurrentStream(l,D,"writableFinal");const g=addConcurrentStream(l,D,"writableDestroy");return{subprocessStdin:D,waitWritableFinal:d,waitWritableDestroy:g}};const getWritableMethods=(s,a,l)=>({write:onWrite.bind(undefined,s),final:(0,M.callbackify)(onWritableFinal.bind(undefined,s,a,l))});const onWrite=(s,a,l,D)=>{if(s.write(a,l)){D()}else{s.once("drain",D)}};const onWritableFinal=async(s,a,l)=>{if(await waitForConcurrentStreams(l,a)){if(s.writable){s.end()}await a}};const onStdinFinished=async(s,a,l)=>{try{await waitForSubprocessStdin(s);if(a.writable){a.end()}}catch(s){await safeWaitForSubprocessStdout(l);destroyOtherWritable(a,s)}};const onWritableDestroy=async({subprocessStdin:s,subprocess:a,waitWritableFinal:l,waitWritableDestroy:D},d)=>{await waitForConcurrentStreams(l,a);if(await waitForConcurrentStreams(D,a)){destroyOtherWritable(s,d);await waitForSubprocess(a,d)}};const destroyOtherWritable=(s,a)=>{destroyOtherStream(s,s.writable,a)};const createDuplex=({subprocess:s,concurrentStreams:a,encoding:l},{from:D,to:d,binary:g=true,preserveNewlines:y=true}={})=>{const F=g||tn.has(l);const{subprocessStdout:w,waitReadableDestroy:C}=getSubprocessStdout(s,D,a);const{subprocessStdin:S,waitWritableFinal:A,waitWritableDestroy:_}=getSubprocessStdin(s,d,a);const{readableEncoding:G,readableObjectMode:W,readableHighWaterMark:V}=getReadableOptions(w,F);const{read:X,onStdoutDataDone:ee}=getReadableMethods({subprocessStdout:w,subprocess:s,binary:F,encoding:l,preserveNewlines:y});const te=new In.Duplex({read:X,...getWritableMethods(S,s,A),destroy:(0,M.callbackify)(onDuplexDestroy.bind(undefined,{subprocessStdout:w,subprocessStdin:S,subprocess:s,waitReadableDestroy:C,waitWritableFinal:A,waitWritableDestroy:_})),readableHighWaterMark:V,writableHighWaterMark:S.writableHighWaterMark,readableObjectMode:W,writableObjectMode:S.writableObjectMode,encoding:G});onStdoutFinished({subprocessStdout:w,onStdoutDataDone:ee,readable:te,subprocess:s,subprocessStdin:S});onStdinFinished(S,te,w);return te};const onDuplexDestroy=async({subprocessStdout:s,subprocessStdin:a,subprocess:l,waitReadableDestroy:D,waitWritableFinal:d,waitWritableDestroy:g},y)=>{await Promise.all([onReadableDestroy({subprocessStdout:s,subprocess:l,waitReadableDestroy:D},y),onWritableDestroy({subprocessStdin:a,subprocess:l,waitWritableFinal:d,waitWritableDestroy:g},y)])};const createIterable=(s,a,{from:l,binary:D=false,preserveNewlines:d=false}={})=>{const g=D||tn.has(a);const y=getFromStream(s,l);const F=iterateOnSubprocessStream({subprocessStdout:y,subprocess:s,binary:g,shouldEncode:true,encoding:a,preserveNewlines:d});return iterateOnStdoutData(F,y,s)};const iterateOnStdoutData=async function*(s,a,l){try{yield*s}finally{if(a.readable){a.destroy()}await l}};const addConvertedStreams=(s,{encoding:a})=>{const l=initializeConcurrentStreams();s.readable=createReadable.bind(undefined,{subprocess:s,concurrentStreams:l,encoding:a});s.writable=createWritable.bind(undefined,{subprocess:s,concurrentStreams:l});s.duplex=createDuplex.bind(undefined,{subprocess:s,concurrentStreams:l,encoding:a});s.iterable=createIterable.bind(undefined,s,a);s[Symbol.asyncIterator]=createIterable.bind(undefined,s,a,{})};const mergePromise=(s,a)=>{for(const[l,D]of dr){const d=D.value.bind(a);Reflect.defineProperty(s,l,{...D,value:d})}};const Dr=(async()=>{})().constructor.prototype;const dr=["then","catch","finally"].map((s=>[s,Reflect.getOwnPropertyDescriptor(Dr,s)]));const execaCoreAsync=(s,a,l,D)=>{const{file:d,commandArguments:g,command:y,escapedCommand:F,startTime:w,verboseInfo:C,options:S,fileDescriptors:A}=handleAsyncArguments(s,a,l);const{subprocess:M,promise:_}=spawnSubprocessAsync({file:d,commandArguments:g,options:S,startTime:w,verboseInfo:C,command:y,escapedCommand:F,fileDescriptors:A});M.pipe=pipeToSubprocess.bind(undefined,{source:M,sourcePromise:_,boundOptions:{},createNested:D});mergePromise(M,_);_t.set(M,{options:S,fileDescriptors:A});return M};const handleAsyncArguments=(s,a,l)=>{const{command:D,escapedCommand:d,startTime:g,verboseInfo:y}=handleCommand(s,a,l);const{file:F,commandArguments:w,options:C}=normalizeOptions(s,a,l);const S=handleAsyncOptions(C);const A=handleStdioAsync(S,y);return{file:F,commandArguments:w,command:D,escapedCommand:d,startTime:g,verboseInfo:y,options:S,fileDescriptors:A}};const handleAsyncOptions=({timeout:s,signal:a,...l})=>{if(a!==undefined){throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.')}return{...l,timeoutDuration:s}};const spawnSubprocessAsync=({file:s,commandArguments:a,options:l,startTime:D,verboseInfo:d,command:y,escapedCommand:F,fileDescriptors:w})=>{let C;try{C=(0,g.spawn)(...concatenateShell(s,a,l))}catch(s){return handleEarlyError({error:s,command:y,escapedCommand:F,fileDescriptors:w,options:l,startTime:D,verboseInfo:d})}const S=new AbortController;(0,Pt.setMaxListeners)(Number.POSITIVE_INFINITY,S.signal);const A=[...C.stdio];pipeOutputAsync(C,w,S);cleanupOnExit(C,l,S);const M={};const _=createDeferred();C.kill=subprocessKill.bind(undefined,{kill:C.kill.bind(C),options:l,onInternalError:_,context:M,controller:S});C.all=makeAllStream(C,l);addConvertedStreams(C,l);addIpcMethods(C,l);const G=handlePromise({subprocess:C,options:l,startTime:D,verboseInfo:d,fileDescriptors:w,originalStreams:A,command:y,escapedCommand:F,context:M,onInternalError:_,controller:S});return{subprocess:C,promise:G}};const handlePromise=async({subprocess:s,options:a,startTime:l,verboseInfo:D,fileDescriptors:d,originalStreams:g,command:y,escapedCommand:F,context:w,onInternalError:C,controller:S})=>{const[A,[M,_],G,W,V]=await waitForSubprocessResult({subprocess:s,options:a,context:w,verboseInfo:D,fileDescriptors:d,originalStreams:g,onInternalError:C,controller:S});S.abort();C.resolve();const X=G.map(((s,l)=>stripNewline(s,a,l)));const ee=stripNewline(W,a,"all");const te=getAsyncResult({errorInfo:A,exitCode:M,signal:_,stdio:X,all:ee,ipcOutput:V,context:w,options:a,command:y,escapedCommand:F,startTime:l});return handleResult(te,D,a)};const getAsyncResult=({errorInfo:s,exitCode:a,signal:l,stdio:D,all:d,ipcOutput:g,context:y,options:F,command:w,escapedCommand:C,startTime:S})=>"error"in s?makeError({error:s.error,command:w,escapedCommand:C,timedOut:y.terminationReason==="timeout",isCanceled:y.terminationReason==="cancel"||y.terminationReason==="gracefulCancel",isGracefullyCanceled:y.terminationReason==="gracefulCancel",isMaxBuffer:s.error instanceof MaxBufferError,isForcefullyTerminated:y.isForcefullyTerminated,exitCode:a,signal:l,stdio:D,all:d,ipcOutput:g,options:F,startTime:S,isSync:false}):makeSuccessResult({command:w,escapedCommand:C,stdio:D,all:d,ipcOutput:g,options:F,startTime:S});const mergeOptions=(s,a)=>{const l=Object.fromEntries(Object.entries(a).map((([a,l])=>[a,mergeOption(a,s[a],l)])));return{...s,...l}};const mergeOption=(s,a,l)=>{if(fr.has(s)&&isPlainObject(a)&&isPlainObject(l)){return{...a,...l}}return l};const fr=new Set(["env",...te]);const createExeca=(s,a,l,D)=>{const createNested=(s,a,D)=>createExeca(s,a,l,D);const boundExeca=(...d)=>callBoundExeca({mapArguments:s,deepOptions:l,boundOptions:a,setBoundExeca:D,createNested:createNested},...d);if(D!==undefined){D(boundExeca,createNested,a)}return boundExeca};const callBoundExeca=({mapArguments:s,deepOptions:a={},boundOptions:l={},setBoundExeca:D,createNested:d},g,...y)=>{if(isPlainObject(g)){return d(s,mergeOptions(l,g),D)}const{file:F,commandArguments:w,options:C,isSync:S}=parseArguments({mapArguments:s,firstArgument:g,nextArguments:y,deepOptions:a,boundOptions:l});return S?execaCoreSync(F,w,C):execaCoreAsync(F,w,C,d)};const parseArguments=({mapArguments:s,firstArgument:a,nextArguments:l,deepOptions:D,boundOptions:d})=>{const g=isTemplateString(a)?parseTemplates(a,l):[a,...l];const[y,F,w]=normalizeParameters(...g);const C=mergeOptions(mergeOptions(D,d),w);const{file:S=y,commandArguments:A=F,options:M=C,isSync:_=false}=s({file:y,commandArguments:F,options:C});return{file:S,commandArguments:A,options:M,isSync:_}};const mapCommandAsync=({file:s,commandArguments:a})=>parseCommand(s,a);const mapCommandSync=({file:s,commandArguments:a})=>({...parseCommand(s,a),isSync:true});const parseCommand=(s,a)=>{if(a.length>0){throw new TypeError(`The command and its arguments must be passed as a single string: ${s} ${a}.`)}const[l,...D]=parseCommandString(s);return{file:l,commandArguments:D}};const parseCommandString=s=>{if(typeof s!=="string"){throw new TypeError(`The command must be a string: ${String(s)}.`)}const a=s.trim();if(a===""){return[]}const l=[];for(const s of a.split(pr)){const a=l.at(-1);if(a&&a.endsWith("\\")){l[l.length-1]=`${a.slice(0,-1)} ${s}`}else{l.push(s)}}return l};const pr=/ +/g;const setScriptSync=(s,a,l)=>{s.sync=a(mapScriptSync,l);s.s=s.sync};const mapScriptAsync=({options:s})=>getScriptOptions(s);const mapScriptSync=({options:s})=>({...getScriptOptions(s),isSync:true});const getScriptOptions=s=>({options:{...getScriptStdinOption(s),...s}});const getScriptStdinOption=({input:s,inputFile:a,stdio:l})=>s===undefined&&a===undefined&&l===undefined?{stdin:"inherit"}:{};const mr={preferLocal:true};const hr=createExeca((()=>({})));const br=createExeca((()=>({isSync:true})));const gr=createExeca(mapCommandAsync);const yr=createExeca(mapCommandSync);const Fr=createExeca(mapNode);const wr=createExeca(mapScriptAsync,{},mr,setScriptSync);const{sendMessage:Cr,getOneMessage:Er,getEachMessage:vr,getCancelSignal:Sr}=getIpcExport()}};var l={};function __nccwpck_require__(s){var D=l[s];if(D!==undefined){return D.exports}var d=l[s]={exports:{}};var g=true;try{a[s](d,d.exports,__nccwpck_require__);g=false}finally{if(g)delete l[s]}return d.exports}(()=>{var s=typeof Symbol==="function"?Symbol("webpack queues"):"__webpack_queues__";var a=typeof Symbol==="function"?Symbol("webpack exports"):"__webpack_exports__";var l=typeof Symbol==="function"?Symbol("webpack error"):"__webpack_error__";var resolveQueue=s=>{if(s&&s.d<1){s.d=1;s.forEach((s=>s.r--));s.forEach((s=>s.r--?s.r++:s()))}};var wrapDeps=D=>D.map((D=>{if(D!==null&&typeof D==="object"){if(D[s])return D;if(D.then){var d=[];d.d=0;D.then((s=>{g[a]=s;resolveQueue(d)}),(s=>{g[l]=s;resolveQueue(d)}));var g={};g[s]=s=>s(d);return g}}var y={};y[s]=s=>{};y[a]=D;return y}));__nccwpck_require__.a=(D,d,g)=>{var y;g&&((y=[]).d=-1);var F=new Set;var w=D.exports;var C;var S;var A;var M=new Promise(((s,a)=>{A=a;S=s}));M[a]=w;M[s]=s=>(y&&s(y),F.forEach(s),M["catch"]((s=>{})));D.exports=M;d((D=>{C=wrapDeps(D);var d;var getResult=()=>C.map((s=>{if(s[l])throw s[l];return s[a]}));var g=new Promise((a=>{d=()=>a(getResult);d.r=0;var fnQueue=s=>s!==y&&!F.has(s)&&(F.add(s),s&&!s.d&&(d.r++,s.push(d)));C.map((a=>a[s](fnQueue)))}));return d.r?g:getResult()}),(s=>(s?A(M[l]=s):S(w),resolveQueue(y))));y&&y.d<0&&(y.d=0)}})();(()=>{__nccwpck_require__.d=(s,a)=>{for(var l in a){if(__nccwpck_require__.o(a,l)&&!__nccwpck_require__.o(s,l)){Object.defineProperty(s,l,{enumerable:true,get:a[l]})}}}})();(()=>{__nccwpck_require__.o=(s,a)=>Object.prototype.hasOwnProperty.call(s,a)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var D=__nccwpck_require__(670);D=await D;
|
|
2
|
+
import{createRequire as s}from"module";var a={348:(s,a,u)=>{const f=u(317);const v=u(251);const E=u(451);function spawn(s,a,u){const I=v(s,a,u);const D=f.spawn(I.command,I.args,I.options);E.hookChildProcess(D,I);return D}function spawnSync(s,a,u){const I=v(s,a,u);const D=f.spawnSync(I.command,I.args,I.options);D.error=D.error||E.verifyENOENTSync(D.status,I);return D}s.exports=spawn;s.exports.spawn=spawn;s.exports.sync=spawnSync;s.exports._parse=v;s.exports._enoent=E},451:s=>{const a=process.platform==="win32";function notFoundError(s,a){return Object.assign(new Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}function hookChildProcess(s,u){if(!a){return}const f=s.emit;s.emit=function(a,v){if(a==="exit"){const a=verifyENOENT(v,u);if(a){return f.call(s,"error",a)}}return f.apply(s,arguments)}}function verifyENOENT(s,u){if(a&&s===1&&!u.file){return notFoundError(u.original,"spawn")}return null}function verifyENOENTSync(s,u){if(a&&s===1&&!u.file){return notFoundError(u.original,"spawnSync")}return null}s.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},251:(s,a,u)=>{const f=u(928);const v=u(512);const E=u(502);const I=u(785);const D=process.platform==="win32";const N=/\.(?:com|exe)$/i;const P=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(s){s.file=v(s);const a=s.file&&I(s.file);if(a){s.args.unshift(s.file);s.command=a;return v(s)}return s.file}function parseNonShell(s){if(!D){return s}const a=detectShebang(s);const u=!N.test(a);if(s.options.forceShell||u){const u=P.test(a);s.command=f.normalize(s.command);s.command=E.command(s.command);s.args=s.args.map((s=>E.argument(s,u)));const v=[s.command].concat(s.args).join(" ");s.args=["/d","/s","/c",`"${v}"`];s.command=process.env.comspec||"cmd.exe";s.options.windowsVerbatimArguments=true}return s}function parse(s,a,u){if(a&&!Array.isArray(a)){u=a;a=null}a=a?a.slice(0):[];u=Object.assign({},u);const f={command:s,args:a,options:u,file:undefined,original:{command:s,args:a}};return u.shell?f:parseNonShell(f)}s.exports=parse},502:s=>{const a=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(s){s=s.replace(a,"^$1");return s}function escapeArgument(s,u){s=`${s}`;s=s.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');s=s.replace(/(?=(\\+?)?)\1$/,"$1$1");s=`"${s}"`;s=s.replace(a,"^$1");if(u){s=s.replace(a,"^$1")}return s}s.exports.command=escapeCommand;s.exports.argument=escapeArgument},785:(s,a,u)=>{const f=u(896);const v=u(891);function readShebang(s){const a=150;const u=Buffer.alloc(a);let E;try{E=f.openSync(s,"r");f.readSync(E,u,0,a,0);f.closeSync(E)}catch(s){}return v(u.toString())}s.exports=readShebang},512:(s,a,u)=>{const f=u(928);const v=u(458);const E=u(104);function resolveCommandAttempt(s,a){const u=s.options.env||process.env;const I=process.cwd();const D=s.options.cwd!=null;const N=D&&process.chdir!==undefined&&!process.chdir.disabled;if(N){try{process.chdir(s.options.cwd)}catch(s){}}let P;try{P=v.sync(s.command,{path:u[E({env:u})],pathExt:a?f.delimiter:undefined})}catch(s){}finally{if(N){process.chdir(I)}}if(P){P=f.resolve(D?s.options.cwd:"",P)}return P}function resolveCommand(s){return resolveCommandAttempt(s)||resolveCommandAttempt(s,true)}s.exports=resolveCommand},51:(s,a,u)=>{var f=u(896);var v;if(process.platform==="win32"||global.TESTING_WINDOWS){v=u(78)}else{v=u(208)}s.exports=isexe;isexe.sync=sync;function isexe(s,a,u){if(typeof a==="function"){u=a;a={}}if(!u){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(u,f){isexe(s,a||{},(function(s,a){if(s){f(s)}else{u(a)}}))}))}v(s,a||{},(function(s,f){if(s){if(s.code==="EACCES"||a&&a.ignoreErrors){s=null;f=false}}u(s,f)}))}function sync(s,a){try{return v.sync(s,a||{})}catch(s){if(a&&a.ignoreErrors||s.code==="EACCES"){return false}else{throw s}}}},208:(s,a,u)=>{s.exports=isexe;isexe.sync=sync;var f=u(896);function isexe(s,a,u){f.stat(s,(function(s,f){u(s,s?false:checkStat(f,a))}))}function sync(s,a){return checkStat(f.statSync(s),a)}function checkStat(s,a){return s.isFile()&&checkMode(s,a)}function checkMode(s,a){var u=s.mode;var f=s.uid;var v=s.gid;var E=a.uid!==undefined?a.uid:process.getuid&&process.getuid();var I=a.gid!==undefined?a.gid:process.getgid&&process.getgid();var D=parseInt("100",8);var N=parseInt("010",8);var P=parseInt("001",8);var B=D|N;var _=u&P||u&N&&v===I||u&D&&f===E||u&B&&E===0;return _}},78:(s,a,u)=>{s.exports=isexe;isexe.sync=sync;var f=u(896);function checkPathExt(s,a){var u=a.pathExt!==undefined?a.pathExt:process.env.PATHEXT;if(!u){return true}u=u.split(";");if(u.indexOf("")!==-1){return true}for(var f=0;f<u.length;f++){var v=u[f].toLowerCase();if(v&&s.substr(-v.length).toLowerCase()===v){return true}}return false}function checkStat(s,a,u){if(!s.isSymbolicLink()&&!s.isFile()){return false}return checkPathExt(a,u)}function isexe(s,a,u){f.stat(s,(function(f,v){u(f,f?false:checkStat(v,s,a))}))}function sync(s,a){return checkStat(f.statSync(s),s,a)}},104:s=>{const pathKey=(s={})=>{const a=s.env||process.env;const u=s.platform||process.platform;if(u!=="win32"){return"PATH"}return Object.keys(a).reverse().find((s=>s.toUpperCase()==="PATH"))||"Path"};s.exports=pathKey;s.exports["default"]=pathKey},891:(s,a,u)=>{const f=u(966);s.exports=(s="")=>{const a=s.match(f);if(!a){return null}const[u,v]=a[0].replace(/#! ?/,"").split(" ");const E=u.split("/").pop();if(E==="env"){return v}return v?`${E} ${v}`:E}},966:s=>{s.exports=/^#!(.*)/},640:s=>{const a="";const u=`${a}[`;const f="";const v={to(s,a){if(!a)return`${u}${s+1}G`;return`${u}${a+1};${s+1}H`},move(s,a){let f="";if(s<0)f+=`${u}${-s}D`;else if(s>0)f+=`${u}${s}C`;if(a<0)f+=`${u}${-a}A`;else if(a>0)f+=`${u}${a}B`;return f},up:(s=1)=>`${u}${s}A`,down:(s=1)=>`${u}${s}B`,forward:(s=1)=>`${u}${s}C`,backward:(s=1)=>`${u}${s}D`,nextLine:(s=1)=>`${u}E`.repeat(s),prevLine:(s=1)=>`${u}F`.repeat(s),left:`${u}G`,hide:`${u}?25l`,show:`${u}?25h`,save:`${a}7`,restore:`${a}8`};const E={up:(s=1)=>`${u}S`.repeat(s),down:(s=1)=>`${u}T`.repeat(s)};const I={screen:`${u}2J`,up:(s=1)=>`${u}1J`.repeat(s),down:(s=1)=>`${u}J`.repeat(s),line:`${u}2K`,lineEnd:`${u}K`,lineStart:`${u}1K`,lines(s){let a="";for(let u=0;u<s;u++)a+=this.line+(u<s-1?v.up():"");if(s)a+=v.left;return a}};s.exports={cursor:v,scroll:E,erase:I,beep:f}},458:(s,a,u)=>{const f=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const v=u(928);const E=f?";":":";const I=u(51);const getNotFoundError=s=>Object.assign(new Error(`not found: ${s}`),{code:"ENOENT"});const getPathInfo=(s,a)=>{const u=a.colon||E;const v=s.match(/\//)||f&&s.match(/\\/)?[""]:[...f?[process.cwd()]:[],...(a.path||process.env.PATH||"").split(u)];const I=f?a.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const D=f?I.split(u):[""];if(f){if(s.indexOf(".")!==-1&&D[0]!=="")D.unshift("")}return{pathEnv:v,pathExt:D,pathExtExe:I}};const which=(s,a,u)=>{if(typeof a==="function"){u=a;a={}}if(!a)a={};const{pathEnv:f,pathExt:E,pathExtExe:D}=getPathInfo(s,a);const N=[];const step=u=>new Promise(((E,I)=>{if(u===f.length)return a.all&&N.length?E(N):I(getNotFoundError(s));const D=f[u];const P=/^".*"$/.test(D)?D.slice(1,-1):D;const B=v.join(P,s);const _=!P&&/^\.[\\\/]/.test(s)?s.slice(0,2)+B:B;E(subStep(_,u,0))}));const subStep=(s,u,f)=>new Promise(((v,P)=>{if(f===E.length)return v(step(u+1));const B=E[f];I(s+B,{pathExt:D},((E,I)=>{if(!E&&I){if(a.all)N.push(s+B);else return v(s+B)}return v(subStep(s,u,f+1))}))}));return u?step(0).then((s=>u(null,s)),u):step(0)};const whichSync=(s,a)=>{a=a||{};const{pathEnv:u,pathExt:f,pathExtExe:E}=getPathInfo(s,a);const D=[];for(let N=0;N<u.length;N++){const P=u[N];const B=/^".*"$/.test(P)?P.slice(1,-1):P;const _=v.join(B,s);const U=!B&&/^\.[\\\/]/.test(s)?s.slice(0,2)+_:_;for(let s=0;s<f.length;s++){const u=U+f[s];try{const s=I.sync(u,{pathExt:E});if(s){if(a.all)D.push(u);else return u}}catch(s){}}}if(a.all&&D.length)return D;if(a.nothrow)return null;throw getNotFoundError(s)};s.exports=which;which.sync=whichSync},317:a=>{a.exports=s(import.meta.url)("child_process")},896:a=>{a.exports=s(import.meta.url)("fs")},24:a=>{a.exports=s(import.meta.url)("node:fs")},760:a=>{a.exports=s(import.meta.url)("node:path")},708:a=>{a.exports=s(import.meta.url)("node:process")},66:a=>{a.exports=s(import.meta.url)("node:tty")},136:a=>{a.exports=s(import.meta.url)("node:url")},975:a=>{a.exports=s(import.meta.url)("node:util")},928:a=>{a.exports=s(import.meta.url)("path")},657:(s,a,u)=>{u.a(s,(async(s,a)=>{try{var f=u(24);var v=u(760);var E=u(136);var I=u(155);var D=u(880);const N=(0,E.fileURLToPath)(import.meta.url);const P=v.dirname(N);function checkCancel(s){if(I.FZ(s)){I.ZT("Operation cancelled.");process.exit(0)}}I.Lv(`create-sv-router`);const B="Leave blank to use `./`";let _=await I.Qq({message:"Where do you want to create your project?",placeholder:B});checkCancel(_);if(_===B)_="";const U=await I.Lt({message:"Choose your language.",options:[{value:"ts",label:"TypeScript"},{value:"js",label:"JavaScript (JSDoc)"}]});checkCancel(U);let q=await I.Lt({message:"Choose your template.",options:[{value:"file-based",label:"File-based routing"},{value:"code-based",label:"Code-based routing"}]});checkCancel(q);const H=v.join(process.cwd(),_);if(_){f.mkdirSync(H,{recursive:true})}q+="-"+U;f.cpSync(v.join(P,"../templates",q),H,{recursive:true});f.renameSync(v.join(H,"gitignore"),v.join(H,".gitignore"));const Y=await I.Lt({message:"Which package manager do you want to install dependencies with?",options:[{value:"",label:"None"},{value:"npm",label:"npm"},{value:"yarn",label:"yarn"},{value:"pnpm",label:"pnpm"},{value:"bun",label:"bun"},{value:"deno",label:"deno"}]});checkCancel(Y);if(Y){const te=I.u1();te.start("Installing dependencies with "+Y);try{await(0,D.Ho)(Y,["install"],{cwd:H});te.stop("Dependencies installed with "+Y)}catch(ne){te.stop("Failed to install dependencies with "+Y);console.error(ne);process.exit(1)}}const X=await I.lJ({message:"Initialize a git repository?"});checkCancel(X);if(X){try{await(0,D.Ho)("git",["init"],{cwd:H});I.Rm.step("Git repository initialized")}catch(se){I.Rm.error("Failed to initialize git repository");console.error(se);process.exit(1)}}I.Md("You're all set! You can now run:");const ee=[..._?[`cd ${_}`]:[],...Y?[]:["npm install"],(Y||"npm")+" run dev"].map(((s,a)=>{const u=`[94m${a+1}.[0m`;const f=`[37m${s}[0m`;return`${u} ${f}`}));console.log([...ee,""].join("\n"));a()}catch(oe){a(oe)}}),1)},155:(a,u,f)=>{f.d(u,{ZT:()=>pt,lJ:()=>dist_ot,Lv:()=>mt,FZ:()=>dist_q,Rm:()=>sn,Md:()=>gt,Lt:()=>_t,u1:()=>fe,Qq:()=>Ot});var v=f(975);var E=f(708);const D=s(import.meta.url)("node:readline");const isAmbiguous=s=>s===161||s===164||s===167||s===168||s===170||s===173||s===174||s>=176&&s<=180||s>=182&&s<=186||s>=188&&s<=191||s===198||s===208||s===215||s===216||s>=222&&s<=225||s===230||s>=232&&s<=234||s===236||s===237||s===240||s===242||s===243||s>=247&&s<=250||s===252||s===254||s===257||s===273||s===275||s===283||s===294||s===295||s===299||s>=305&&s<=307||s===312||s>=319&&s<=322||s===324||s>=328&&s<=331||s===333||s===338||s===339||s===358||s===359||s===363||s===462||s===464||s===466||s===468||s===470||s===472||s===474||s===476||s===593||s===609||s===708||s===711||s>=713&&s<=715||s===717||s===720||s>=728&&s<=731||s===733||s===735||s>=768&&s<=879||s>=913&&s<=929||s>=931&&s<=937||s>=945&&s<=961||s>=963&&s<=969||s===1025||s>=1040&&s<=1103||s===1105||s===8208||s>=8211&&s<=8214||s===8216||s===8217||s===8220||s===8221||s>=8224&&s<=8226||s>=8228&&s<=8231||s===8240||s===8242||s===8243||s===8245||s===8251||s===8254||s===8308||s===8319||s>=8321&&s<=8324||s===8364||s===8451||s===8453||s===8457||s===8467||s===8470||s===8481||s===8482||s===8486||s===8491||s===8531||s===8532||s>=8539&&s<=8542||s>=8544&&s<=8555||s>=8560&&s<=8569||s===8585||s>=8592&&s<=8601||s===8632||s===8633||s===8658||s===8660||s===8679||s===8704||s===8706||s===8707||s===8711||s===8712||s===8715||s===8719||s===8721||s===8725||s===8730||s>=8733&&s<=8736||s===8739||s===8741||s>=8743&&s<=8748||s===8750||s>=8756&&s<=8759||s===8764||s===8765||s===8776||s===8780||s===8786||s===8800||s===8801||s>=8804&&s<=8807||s===8810||s===8811||s===8814||s===8815||s===8834||s===8835||s===8838||s===8839||s===8853||s===8857||s===8869||s===8895||s===8978||s>=9312&&s<=9449||s>=9451&&s<=9547||s>=9552&&s<=9587||s>=9600&&s<=9615||s>=9618&&s<=9621||s===9632||s===9633||s>=9635&&s<=9641||s===9650||s===9651||s===9654||s===9655||s===9660||s===9661||s===9664||s===9665||s>=9670&&s<=9672||s===9675||s>=9678&&s<=9681||s>=9698&&s<=9701||s===9711||s===9733||s===9734||s===9737||s===9742||s===9743||s===9756||s===9758||s===9792||s===9794||s===9824||s===9825||s>=9827&&s<=9829||s>=9831&&s<=9834||s===9836||s===9837||s===9839||s===9886||s===9887||s===9919||s>=9926&&s<=9933||s>=9935&&s<=9939||s>=9941&&s<=9953||s===9955||s===9960||s===9961||s>=9963&&s<=9969||s===9972||s>=9974&&s<=9977||s===9979||s===9980||s===9982||s===9983||s===10045||s>=10102&&s<=10111||s>=11094&&s<=11097||s>=12872&&s<=12879||s>=57344&&s<=63743||s>=65024&&s<=65039||s===65533||s>=127232&&s<=127242||s>=127248&&s<=127277||s>=127280&&s<=127337||s>=127344&&s<=127373||s===127375||s===127376||s>=127387&&s<=127404||s>=917760&&s<=917999||s>=983040&&s<=1048573||s>=1048576&&s<=1114109;const isFullWidth=s=>s===12288||s>=65281&&s<=65376||s>=65504&&s<=65510;const isWide=s=>s>=4352&&s<=4447||s===8986||s===8987||s===9001||s===9002||s>=9193&&s<=9196||s===9200||s===9203||s===9725||s===9726||s===9748||s===9749||s>=9800&&s<=9811||s===9855||s===9875||s===9889||s===9898||s===9899||s===9917||s===9918||s===9924||s===9925||s===9934||s===9940||s===9962||s===9970||s===9971||s===9973||s===9978||s===9981||s===9989||s===9994||s===9995||s===10024||s===10060||s===10062||s>=10067&&s<=10069||s===10071||s>=10133&&s<=10135||s===10160||s===10175||s===11035||s===11036||s===11088||s===11093||s>=11904&&s<=11929||s>=11931&&s<=12019||s>=12032&&s<=12245||s>=12272&&s<=12287||s>=12289&&s<=12350||s>=12353&&s<=12438||s>=12441&&s<=12543||s>=12549&&s<=12591||s>=12593&&s<=12686||s>=12688&&s<=12771||s>=12783&&s<=12830||s>=12832&&s<=12871||s>=12880&&s<=19903||s>=19968&&s<=42124||s>=42128&&s<=42182||s>=43360&&s<=43388||s>=44032&&s<=55203||s>=63744&&s<=64255||s>=65040&&s<=65049||s>=65072&&s<=65106||s>=65108&&s<=65126||s>=65128&&s<=65131||s>=94176&&s<=94180||s===94192||s===94193||s>=94208&&s<=100343||s>=100352&&s<=101589||s>=101632&&s<=101640||s>=110576&&s<=110579||s>=110581&&s<=110587||s===110589||s===110590||s>=110592&&s<=110882||s===110898||s>=110928&&s<=110930||s===110933||s>=110948&&s<=110951||s>=110960&&s<=111355||s===126980||s===127183||s===127374||s>=127377&&s<=127386||s>=127488&&s<=127490||s>=127504&&s<=127547||s>=127552&&s<=127560||s===127568||s===127569||s>=127584&&s<=127589||s>=127744&&s<=127776||s>=127789&&s<=127797||s>=127799&&s<=127868||s>=127870&&s<=127891||s>=127904&&s<=127946||s>=127951&&s<=127955||s>=127968&&s<=127984||s===127988||s>=127992&&s<=128062||s===128064||s>=128066&&s<=128252||s>=128255&&s<=128317||s>=128331&&s<=128334||s>=128336&&s<=128359||s===128378||s===128405||s===128406||s===128420||s>=128507&&s<=128591||s>=128640&&s<=128709||s===128716||s>=128720&&s<=128722||s>=128725&&s<=128727||s>=128732&&s<=128735||s===128747||s===128748||s>=128756&&s<=128764||s>=128992&&s<=129003||s===129008||s>=129292&&s<=129338||s>=129340&&s<=129349||s>=129351&&s<=129535||s>=129648&&s<=129660||s>=129664&&s<=129672||s>=129680&&s<=129725||s>=129727&&s<=129733||s>=129742&&s<=129755||s>=129760&&s<=129768||s>=129776&&s<=129784||s>=131072&&s<=196605||s>=196608&&s<=262141;const _=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;const U=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;const H=/\t{1,1000}/y;const Y=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy;const ee=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;const te=/\p{M}+/gu;const ne={limit:Infinity,ellipsis:""};const getStringTruncatedWidth=(s,a={},u={})=>{const f=a.limit??Infinity;const v=a.ellipsis??"";const E=a?.ellipsisWidth??(v?getStringTruncatedWidth(v,ne,u).width:0);const I=u.ansiWidth??0;const D=u.controlWidth??0;const N=u.tabWidth??8;const P=u.ambiguousWidth??1;const B=u.emojiWidth??2;const q=u.fullWidthWidth??2;const X=u.regularWidth??1;const se=u.wideWidth??2;let oe=0;let ce=0;let le=s.length;let ue=0;let de=false;let pe=le;let me=Math.max(0,f-E);let he=0;let ge=0;let be=0;let we=0;e:while(true){if(ge>he||ce>=le&&ce>oe){const a=s.slice(he,ge)||s.slice(oe,ce);ue=0;for(const s of a.replaceAll(te,"")){const a=s.codePointAt(0)||0;if(isFullWidth(a)){we=q}else if(isWide(a)){we=se}else if(P!==X&&isAmbiguous(a)){we=P}else{we=X}if(be+we>me){pe=Math.min(pe,Math.max(he,oe)+ue)}if(be+we>f){de=true;break e}ue+=s.length;be+=we}he=ge=0}if(ce>=le)break;ee.lastIndex=ce;if(ee.test(s)){ue=ee.lastIndex-ce;we=ue*X;if(be+we>me){pe=Math.min(pe,ce+Math.floor((me-be)/X))}if(be+we>f){de=true;break}be+=we;he=oe;ge=ce;ce=oe=ee.lastIndex;continue}_.lastIndex=ce;if(_.test(s)){if(be+I>me){pe=Math.min(pe,ce)}if(be+I>f){de=true;break}be+=I;he=oe;ge=ce;ce=oe=_.lastIndex;continue}U.lastIndex=ce;if(U.test(s)){ue=U.lastIndex-ce;we=ue*D;if(be+we>me){pe=Math.min(pe,ce+Math.floor((me-be)/D))}if(be+we>f){de=true;break}be+=we;he=oe;ge=ce;ce=oe=U.lastIndex;continue}H.lastIndex=ce;if(H.test(s)){ue=H.lastIndex-ce;we=ue*N;if(be+we>me){pe=Math.min(pe,ce+Math.floor((me-be)/N))}if(be+we>f){de=true;break}be+=we;he=oe;ge=ce;ce=oe=H.lastIndex;continue}Y.lastIndex=ce;if(Y.test(s)){if(be+B>me){pe=Math.min(pe,ce)}if(be+B>f){de=true;break}be+=B;he=oe;ge=ce;ce=oe=Y.lastIndex;continue}ce+=1}return{width:de?me:be,index:de?pe:le,truncated:de,ellipsed:de&&f>=E}};const se=getStringTruncatedWidth;const oe={limit:Infinity,ellipsis:"",ellipsisWidth:0};const fastStringWidth=(s,a={})=>se(s,oe,a).width;const ce=fastStringWidth;const le="";const ue="";const de=39;const pe="";const me="[";const he="]";const ge="m";const $e=`${he}8;;`;const Se=new RegExp(`(?:\\${me}(?<code>\\d+)m|\\${$e}(?<uri>.*)${pe})`,"y");const getClosingCode=s=>{if(s>=30&&s<=37)return 39;if(s>=90&&s<=97)return 39;if(s>=40&&s<=47)return 49;if(s>=100&&s<=107)return 49;if(s===1||s===2)return 22;if(s===3)return 23;if(s===4)return 24;if(s===7)return 27;if(s===8)return 28;if(s===9)return 29;if(s===0)return 0;return undefined};const wrapAnsiCode=s=>`${le}${me}${s}${ge}`;const wrapAnsiHyperlink=s=>`${le}${$e}${s}${pe}`;const wrapWord=(s,a,u)=>{const f=a[Symbol.iterator]();let v=false;let E=false;let I=s.at(-1);let D=I===undefined?0:ce(I);let N=f.next();let P=f.next();let B=0;while(!N.done){const I=N.value;const _=ce(I);if(D+_<=u){s[s.length-1]+=I}else{s.push(I);D=0}if(I===le||I===ue){v=true;E=a.startsWith($e,B+1)}if(v){if(E){if(I===pe){v=false;E=false}}else if(I===ge){v=false}}else{D+=_;if(D===u&&!P.done){s.push("");D=0}}N=P;P=f.next();B+=I.length}I=s.at(-1);if(!D&&I!==undefined&&I.length&&s.length>1){s[s.length-2]+=s.pop()}};const stringVisibleTrimSpacesRight=s=>{const a=s.split(" ");let u=a.length;while(u){if(ce(a[u-1])){break}u--}if(u===a.length){return s}return a.slice(0,u).join(" ")+a.slice(u).join("")};const exec=(s,a,u={})=>{if(u.trim!==false&&s.trim()===""){return""}let f="";let v;let E;const I=s.split(" ");let D=[""];let N=0;for(let s=0;s<I.length;s++){const f=I[s];if(u.trim!==false){const s=D.at(-1)??"";const a=s.trimStart();if(s.length!==a.length){D[D.length-1]=a;N=ce(a)}}if(s!==0){if(N>=a&&(u.wordWrap===false||u.trim===false)){D.push("");N=0}if(N||u.trim===false){D[D.length-1]+=" ";N++}}const v=ce(f);if(u.hard&&v>a){const s=a-N;const u=1+Math.floor((v-s-1)/a);const E=Math.floor((v-1)/a);if(E<u){D.push("")}wrapWord(D,f,a);N=ce(D.at(-1)??"");continue}if(N+v>a&&N&&v){if(u.wordWrap===false&&N<a){wrapWord(D,f,a);N=ce(D.at(-1)??"");continue}D.push("");N=0}if(N+v>a&&u.wordWrap===false){wrapWord(D,f,a);N=ce(D.at(-1)??"");continue}D[D.length-1]+=f;N+=v}if(u.trim!==false){D=D.map((s=>stringVisibleTrimSpacesRight(s)))}const P=D.join("\n");let B=false;for(let s=0;s<P.length;s++){const a=P[s];f+=a;if(!B){B=a>="\ud800"&&a<="\udbff"}else{continue}if(a===le||a===ue){Se.lastIndex=s+1;const a=Se.exec(P);const u=a?.groups;if(u?.code!==undefined){const s=Number.parseFloat(u.code);v=s===de?undefined:s}else if(u?.uri!==undefined){E=u.uri.length===0?undefined:u.uri}}if(P[s+1]==="\n"){if(E){f+=wrapAnsiHyperlink("")}const s=v?getClosingCode(v):undefined;if(v&&s){f+=wrapAnsiCode(s)}}else if(a==="\n"){if(v&&getClosingCode(v)){f+=wrapAnsiCode(v)}if(E){f+=wrapAnsiHyperlink(E)}}}return f};const xe=/\r?\n/;function wrapAnsi(s,a,u){return String(s).normalize().split(xe).map((s=>exec(s,a,u))).join("\n")}var Ee=f(640);var Ie=f(66);function d(s,a,u){if(!u.some((s=>!s.disabled)))return s;const f=s+a,v=Math.max(u.length-1,0),E=f<0?v:f>v?0:f;return u[E].disabled?d(E,a<0?-1:1,u):E}const Oe=["up","down","left","right","space","enter","cancel"],Ne=["January","February","March","April","May","June","July","August","September","October","November","December"],ke={actions:new Set(Oe),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Ne],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(s,a)=>`There are only ${s} days in ${a}`,afterMin:s=>`Date must be on or after ${s.toISOString().slice(0,10)}`,beforeMax:s=>`Date must be on or before ${s.toISOString().slice(0,10)}`}}};function K(s){if(s.aliases!==void 0){const a=s.aliases;for(const s in a){if(!Object.hasOwn(a,s))continue;const u=a[s];ke.actions.has(u)&&(ke.aliases.has(s)||ke.aliases.set(s,u))}}if(s.messages!==void 0){const a=s.messages;a.cancel!==void 0&&(ke.messages.cancel=a.cancel),a.error!==void 0&&(ke.messages.error=a.error)}if(s.withGuide!==void 0&&(ke.withGuide=s.withGuide!==!1),s.date!==void 0){const a=s.date;a.monthNames!==void 0&&(ke.date.monthNames=[...a.monthNames]),a.messages!==void 0&&(a.messages.required!==void 0&&(ke.date.messages.required=a.messages.required),a.messages.invalidMonth!==void 0&&(ke.date.messages.invalidMonth=a.messages.invalidMonth),a.messages.invalidDay!==void 0&&(ke.date.messages.invalidDay=a.messages.invalidDay),a.messages.afterMin!==void 0&&(ke.date.messages.afterMin=a.messages.afterMin),a.messages.beforeMax!==void 0&&(ke.date.messages.beforeMax=a.messages.beforeMax))}}function V(s,a){if(typeof s=="string")return ke.aliases.get(s)===a;for(const u of s)if(u!==void 0&&V(u,a))return!0;return!1}function j(s,a){if(s===a)return;const u=s.split(`\n`),f=a.split(`\n`),v=Math.max(u.length,f.length),E=[];for(let s=0;s<v;s++)u[s]!==f[s]&&E.push(s);return{lines:E,numLinesBefore:u.length,numLinesAfter:f.length,numLines:v}}const je=globalThis.process.platform.startsWith("win"),Be=Symbol("clack:cancel");function dist_q(s){return s===Be}function w(s,a){const u=s;u.isTTY&&u.setRawMode(a)}function z({input:s=E.stdin,output:a=E.stdout,overwrite:u=!0,hideCursor:f=!0}={}){const v=D.createInterface({input:s,output:a,prompt:"",tabSize:1});D.emitKeypressEvents(s,v),s instanceof Ie.ReadStream&&s.isTTY&&s.setRawMode(!0);const n=(v,{name:E,sequence:I})=>{const N=String(v);if(V([N,E,I],"cancel")){f&&a.write(Ee.cursor.show),process.exit(0);return}if(!u)return;const P=E==="return"?0:-1,B=E==="return"?-1:0;D.moveCursor(a,P,B,(()=>{D.clearLine(a,1,(()=>{s.once("keypress",n)}))}))};return f&&a.write(Ee.cursor.hide),s.once("keypress",n),()=>{s.off("keypress",n),f&&a.write(Ee.cursor.show),s instanceof Ie.ReadStream&&s.isTTY&&!je&&s.setRawMode(!1),v.terminal=!1,v.close()}}const O=s=>"columns"in s&&typeof s.columns=="number"?s.columns:80,A=s=>"rows"in s&&typeof s.rows=="number"?s.rows:20;function R(s,a,u,f=u){const v=O(s??E.stdout);return wrapAnsi(a,v-u.length,{hard:!0,trim:!1}).split(`\n`).map(((s,a)=>`${a===0?f:u}${s}`)).join(`\n`)}let _e=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(s,a=!0){const{input:u=E.stdin,output:f=E.stdout,render:v,signal:I,...D}=s;this.opts=D,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=v.bind(this),this._track=a,this._abortSignal=I,this.input=u,this.output=f}unsubscribe(){this._subscribers.clear()}setSubscriber(s,a){const u=this._subscribers.get(s)??[];u.push(a),this._subscribers.set(s,u)}on(s,a){this.setSubscriber(s,{cb:a})}once(s,a){this.setSubscriber(s,{cb:a,once:!0})}emit(s,...a){const u=this._subscribers.get(s)??[],f=[];for(const s of u)s.cb(...a),s.once&&f.push((()=>u.splice(u.indexOf(s),1)));for(const s of f)s()}prompt(){return new Promise((s=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),s(Be);this._abortSignal.addEventListener("abort",(()=>{this.state="cancel",this.close()}),{once:!0})}this.rl=D.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),w(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",(()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),w(this.input,!1),s(this.value)})),this.once("cancel",(()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),w(this.input,!1),s(Be)}))}))}_isActionKey(s,a){return s==="\t"}_setValue(s){this.value=s,this.emit("value",this.value)}_setUserInput(s,a){this.userInput=s??"",this.emit("userInput",this.userInput),a&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(s,a){if(this._track&&a.name!=="return"&&(a.name&&this._isActionKey(s,a)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),a?.name&&(!this._track&&ke.aliases.has(a.name)&&this.emit("cursor",ke.aliases.get(a.name)),ke.actions.has(a.name)&&this.emit("cursor",a.name)),s&&(s.toLowerCase()==="y"||s.toLowerCase()==="n")&&this.emit("confirm",s.toLowerCase()==="y"),this.emit("key",s?.toLowerCase(),a),a?.name==="return"){if(this.opts.validate){const s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}V([s,a?.name,a?.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(`\n`),w(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const s=wrapAnsi(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`\n`).length-1;this.output.write(Ee.cursor.move(-999,s*-1))}render(){const s=wrapAnsi(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(s!==this._prevFrame){if(this.state==="initial")this.output.write(Ee.cursor.hide);else{const a=j(this._prevFrame,s),u=A(this.output);if(this.restoreCursor(),a){const f=Math.max(0,a.numLinesAfter-u),v=Math.max(0,a.numLinesBefore-u);let E=a.lines.find((s=>s>=f));if(E===void 0){this._prevFrame=s;return}if(a.lines.length===1){this.output.write(Ee.cursor.move(0,E-v)),this.output.write(Ee.erase.lines(1));const a=s.split(`\n`);this.output.write(a[E]),this._prevFrame=s,this.output.write(Ee.cursor.move(0,a.length-E-1));return}else if(a.lines.length>1){if(f<v)E=f;else{const s=E-v;s>0&&this.output.write(Ee.cursor.move(0,s))}this.output.write(Ee.erase.down());const a=s.split(`\n`).slice(E);this.output.write(a.join(`\n`)),this._prevFrame=s;return}}this.output.write(Ee.erase.down())}this.output.write(s),this.state==="initial"&&(this.state="active"),this._prevFrame=s}}};function W(s,a){if(s===void 0||a.length===0)return 0;const u=a.findIndex((a=>a.value===s));return u!==-1?u:0}function dist_B(s,a){return(a.label??String(a.value)).toLowerCase().includes(s.toLowerCase())}function J(s,a){if(a)return s?a:a[0]}let Le=class extends _e{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#e=0;#t="";#n;#s;#r;get cursor(){return this.#e}get userInputWithCursor(){if(!this.userInput)return(0,v.styleText)(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}█`;const s=this.userInput.slice(0,this._cursor),[a,...u]=this.userInput.slice(this._cursor);return`${s}${(0,v.styleText)("inverse",a)}${u.join("")}`}get options(){return typeof this.#s=="function"?this.#s():this.#s}constructor(s){super(s),this.#s=s.options,this.#r=s.placeholder;const a=this.options;this.filteredOptions=[...a],this.multiple=s.multiple===!0,this.#n=typeof s.options=="function"?s.filter:s.filter??dist_B;let u;if(s.initialValue&&Array.isArray(s.initialValue)?this.multiple?u=s.initialValue:u=s.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(u=[this.options[0].value]),u)for(const s of u){const u=a.findIndex((a=>a.value===s));u!==-1&&(this.toggleSelected(s),this.#e=u)}this.focusedValue=this.options[this.#e]?.value,this.on("key",((s,a)=>this.#o(s,a))),this.on("userInput",(s=>this.#i(s)))}_isActionKey(s,a){return s==="\t"||this.multiple&&this.isNavigating&&a.name==="space"&&s!==void 0&&s!==""}#o(s,a){const u=a.name==="up",f=a.name==="down",v=a.name==="return",E=this.userInput===""||this.userInput==="\t",I=this.#r,D=this.options,N=I!==void 0&&I!==""&&D.some((s=>!s.disabled&&(this.#n?this.#n(I,s):!0)));if(a.name==="tab"&&E&&N){this.userInput==="\t"&&this._clearUserInput(),this._setUserInput(I,!0),this.isNavigating=!1;return}u||f?(this.#e=d(this.#e,u?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#e]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):v?this.value=J(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(a.name==="tab"||this.isNavigating&&a.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(s){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(s)?this.selectedValues=this.selectedValues.filter((a=>a!==s)):this.selectedValues=[...this.selectedValues,s]:this.selectedValues=[s])}#i(s){if(s!==this.#t){this.#t=s;const a=this.options;s&&this.#n?this.filteredOptions=a.filter((a=>this.#n?.(s,a))):this.filteredOptions=[...a];const u=W(this.focusedValue,this.filteredOptions);this.#e=d(u,0,this.filteredOptions);const f=this.filteredOptions[this.#e];f&&!f.disabled?this.focusedValue=f.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}};class Q extends _e{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(s){super(s,!1),this.value=!!s.initialValue,this.on("userInput",(()=>{this.value=this._value})),this.on("confirm",(s=>{this.output.write(Ee.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()})),this.on("cursor",(()=>{this.value=!this.value}))}}const Ge={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};function L(s){return[...s].map((s=>Ge[s]))}function Z(s){const a=new Intl.DateTimeFormat(s,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2e3,0,15)),u=[];let f="/";for(const s of a)s.type==="literal"?f=s.value.trim()||s.value:(s.type==="year"||s.type==="month"||s.type==="day")&&u.push({type:s.type,len:s.type==="year"?4:2});return{segments:u,separator:f}}function k(s){return Number.parseInt((s||"0").replace(/_/g,"0"),10)||0}function dist_I(s){return{year:k(s.year),month:k(s.month),day:k(s.day)}}function T(s,a){return new Date(s||2001,a||1,0).getDate()}function F(s){const{year:a,month:u,day:f}=dist_I(s);if(!a||a<0||a>9999||!u||u<1||u>12||!f||f<1)return;const v=new Date(Date.UTC(a,u-1,f));if(!(v.getUTCFullYear()!==a||v.getUTCMonth()!==u-1||v.getUTCDate()!==f))return{year:a,month:u,day:f}}function dist_N(s){const a=F(s);return a?new Date(Date.UTC(a.year,a.month-1,a.day)):void 0}function tt(s,a,u,f){const v=u?{year:u.getUTCFullYear(),month:u.getUTCMonth()+1,day:u.getUTCDate()}:null,E=f?{year:f.getUTCFullYear(),month:f.getUTCMonth()+1,day:f.getUTCDate()}:null;return s==="year"?{min:v?.year??1,max:E?.year??9999}:s==="month"?{min:v&&a.year===v.year?v.month:1,max:E&&a.year===E.year?E.month:12}:{min:v&&a.year===v.year&&a.month===v.month?v.day:1,max:E&&a.year===E.year&&a.month===E.month?E.day:T(a.year,a.month)}}class et extends _e{#e;#t;#n;#s;#r;#o={segmentIndex:0,positionInSegment:0};#i=!0;#a=null;inlineError="";get segmentCursor(){return{...this.#o}}get segmentValues(){return{...this.#n}}get segments(){return this.#e}get separator(){return this.#t}get formattedValue(){return this.#c(this.#n)}#c(s){return this.#e.map((a=>s[a.type])).join(this.#t)}#l(){this._setUserInput(this.#c(this.#n)),this._setValue(dist_N(this.#n)??void 0)}constructor(s){const a=s.format?{segments:L(s.format),separator:s.separator??"/"}:Z(s.locale),u=s.separator??a.separator,f=s.format?L(s.format):a.segments,v=s.initialValue??s.defaultValue,E=v?{year:String(v.getUTCFullYear()).padStart(4,"0"),month:String(v.getUTCMonth()+1).padStart(2,"0"),day:String(v.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},I=f.map((s=>E[s.type])).join(u);super({...s,initialUserInput:I},!1),this.#e=f,this.#t=u,this.#n=E,this.#s=s.minDate,this.#r=s.maxDate,this.#l(),this.on("cursor",(s=>this.#u(s))),this.on("key",((s,a)=>this.#d(s,a))),this.on("finalize",(()=>this.#p(s)))}#f(){const s=Math.max(0,Math.min(this.#o.segmentIndex,this.#e.length-1)),a=this.#e[s];if(a)return this.#o.positionInSegment=Math.max(0,Math.min(this.#o.positionInSegment,a.len-1)),{segment:a,index:s}}#m(s){this.inlineError="",this.#a=null;const a=this.#f();a&&(this.#o.segmentIndex=Math.max(0,Math.min(this.#e.length-1,a.index+s)),this.#o.positionInSegment=0,this.#i=!0)}#h(s){const a=this.#f();if(!a)return;const{segment:u}=a,f=this.#n[u.type],v=!f||f.replace(/_/g,"")==="",E=Number.parseInt((f||"0").replace(/_/g,"0"),10)||0,I=tt(u.type,dist_I(this.#n),this.#s,this.#r);let D;v?D=s===1?I.min:I.max:D=Math.max(Math.min(I.max,E+s),I.min),this.#n={...this.#n,[u.type]:D.toString().padStart(u.len,"0")},this.#i=!0,this.#a=null,this.#l()}#u(s){if(s)switch(s){case"right":return this.#m(1);case"left":return this.#m(-1);case"up":return this.#h(1);case"down":return this.#h(-1)}}#d(s,a){if(a?.name==="backspace"||a?.sequence===""||a?.sequence==="\b"||s===""||s==="\b"){this.inlineError="";const s=this.#f();if(!s)return;if(!this.#n[s.segment.type].replace(/_/g,"")){this.#m(-1);return}this.#n[s.segment.type]="_".repeat(s.segment.len),this.#i=!0,this.#o.positionInSegment=0,this.#l();return}if(a?.name==="tab"){this.inlineError="";const s=this.#f();if(!s)return;const u=a.shift?-1:1,f=s.index+u;f>=0&&f<this.#e.length&&(this.#o.segmentIndex=f,this.#o.positionInSegment=0,this.#i=!0);return}if(s&&/^[0-9]$/.test(s)){const a=this.#f();if(!a)return;const{segment:u}=a,f=!this.#n[u.type].replace(/_/g,"");if(this.#i&&this.#a!==null&&!f){const f=this.#a+s,v={...this.#n,[u.type]:f},E=this.#g(v,u);if(E){this.inlineError=E,this.#a=null,this.#i=!1;return}this.inlineError="",this.#n[u.type]=f,this.#a=null,this.#i=!1,this.#l(),a.index<this.#e.length-1&&(this.#o.segmentIndex=a.index+1,this.#o.positionInSegment=0,this.#i=!0);return}this.#i&&!f&&(this.#n[u.type]="_".repeat(u.len),this.#o.positionInSegment=0),this.#i=!1,this.#a=null;const v=this.#n[u.type],E=v.indexOf("_"),I=E>=0?E:Math.min(this.#o.positionInSegment,u.len-1);if(I<0||I>=u.len)return;let D=v.slice(0,I)+s+v.slice(I+1),N=!1;if(I===0&&v==="__"&&(u.type==="month"||u.type==="day")){const a=Number.parseInt(s,10);D=`0${s}`,N=a<=(u.type==="month"?1:2)}if(u.type==="year"&&(D=(v.replace(/_/g,"")+s).padStart(u.len,"_")),!D.includes("_")){const s={...this.#n,[u.type]:D},a=this.#g(s,u);if(a){this.inlineError=a;return}}this.inlineError="",this.#n[u.type]=D;const P=D.includes("_")?void 0:F(this.#n);if(P){const{year:s,month:a}=P,u=T(s,a);this.#n={year:String(Math.max(0,Math.min(9999,s))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,a))).padStart(2,"0"),day:String(Math.max(1,Math.min(u,P.day))).padStart(2,"0")}}this.#l();const B=D.indexOf("_");N?(this.#i=!0,this.#a=s):B>=0?this.#o.positionInSegment=B:E>=0&&a.index<this.#e.length-1?(this.#o.segmentIndex=a.index+1,this.#o.positionInSegment=0,this.#i=!0):this.#o.positionInSegment=Math.min(I+1,u.len-1)}}#g(s,a){const{month:u,day:f}=dist_I(s);if(a.type==="month"&&(u<0||u>12))return ke.date.messages.invalidMonth;if(a.type==="day"&&(f<0||f>31))return ke.date.messages.invalidDay(31,"any month")}#p(s){const{year:a,month:u,day:f}=dist_I(this.#n);if(a&&u&&f){const s=T(a,u);this.#n={...this.#n,day:String(Math.min(f,s)).padStart(2,"0")}}this.value=dist_N(this.#n)??s.defaultValue??void 0}}class st extends _e{options;cursor=0;#e;getGroupItems(s){return this.options.filter((a=>a.group===s))}isGroupSelected(s){const a=this.getGroupItems(s),u=this.value;return u===void 0?!1:a.every((s=>u.includes(s.value)))}toggleValue(){const s=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),s.group===!0){const a=s.value,u=this.getGroupItems(a);this.isGroupSelected(a)?this.value=this.value.filter((s=>u.findIndex((a=>a.value===s))===-1)):this.value=[...this.value,...u.map((s=>s.value))],this.value=Array.from(new Set(this.value))}else{const a=this.value.includes(s.value);this.value=a?this.value.filter((a=>a!==s.value)):[...this.value,s.value]}}constructor(s){super(s,!1);const{options:a}=s;this.#e=s.selectableGroups!==!1,this.options=Object.entries(a).flatMap((([s,a])=>[{value:s,group:!0,label:s},...a.map((a=>({...a,group:s})))])),this.value=[...s.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:a})=>a===s.cursorAt)),this.#e?0:1),this.on("cursor",(s=>{switch(s){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;const s=this.options[this.cursor]?.group===!0;!this.#e&&s&&(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;const s=this.options[this.cursor]?.group===!0;!this.#e&&s&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}}))}}let Ve=class extends _e{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter((s=>s.disabled!==!0))}toggleAll(){const s=this._enabledOptions,a=this.value!==void 0&&this.value.length===s.length;this.value=a?[]:s.map((s=>s.value))}toggleInvert(){const s=this.value;if(!s)return;const a=this._enabledOptions.filter((a=>!s.includes(a.value)));this.value=a.map((s=>s.value))}toggleValue(){this.value===void 0&&(this.value=[]);const s=this.value.includes(this._value);this.value=s?this.value.filter((s=>s!==this._value)):[...this.value,this._value]}constructor(s){super(s,!1),this.options=s.options,this.value=[...s.initialValues??[]];const a=Math.max(this.options.findIndex((({value:a})=>a===s.cursorAt)),0);this.cursor=this.options[a].disabled?d(a,1,this.options):a,this.on("key",(s=>{s==="a"&&this.toggleAll(),s==="i"&&this.toggleInvert()})),this.on("cursor",(s=>{switch(s){case"left":case"up":this.cursor=d(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=d(this.cursor,1,this.options);break;case"space":this.toggleValue();break}}))}};class rt extends _e{_mask="•";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;const s=this.userInput;if(this.cursor>=s.length)return`${this.masked}${(0,v.styleText)(["inverse","hidden"],"_")}`;const a=this.masked,u=a.slice(0,this.cursor),f=a.slice(this.cursor);return`${u}${(0,v.styleText)("inverse",f[0])}${f.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:s,...a}){super(a),this._mask=s??"•",this.on("userInput",(s=>{this._setValue(s)}))}}class nt extends _e{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(s){super(s,!1),this.options=s.options;const a=this.options.findIndex((({value:a})=>a===s.initialValue)),u=a===-1?0:a;this.cursor=this.options[u].disabled?d(u,1,this.options):u,this.changeValue(),this.on("cursor",(s=>{switch(s){case"left":case"up":this.cursor=d(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=d(this.cursor,1,this.options);break}this.changeValue()}))}}class ot extends _e{options;cursor=0;constructor(s){super(s,!1),this.options=s.options;const a=s.caseSensitive===!0,u=this.options.map((({value:[s]})=>a?s:s?.toLowerCase()));this.cursor=Math.max(u.indexOf(s.initialValue),0),this.on("key",((s,f)=>{if(!s)return;const v=a&&f.shift?s.toUpperCase():s;if(!u.includes(v))return;const E=this.options.find((({value:[u]})=>a?u===v:u?.toLowerCase()===s));E&&(this.value=E.value,this.state="submit",this.emit("submit"))}))}}class at extends _e{get userInputWithCursor(){if(this.state==="submit")return this.userInput;const s=this.userInput;if(this.cursor>=s.length)return`${this.userInput}█`;const a=s.slice(0,this.cursor),[u,...f]=s.slice(this.cursor);return`${a}${(0,v.styleText)("inverse",u)}${f.join("")}`}get cursor(){return this._cursor}constructor(s){super({...s,initialUserInput:s.initialUserInput??s.initialValue}),this.on("userInput",(s=>{this._setValue(s)})),this.on("finalize",(()=>{this.value||(this.value=s.defaultValue),this.value===void 0&&(this.value="")}))}}var qe=f(24);var Ke=f(760);function Ze(){return E.platform!=="win32"?E.env.TERM!=="linux":!!E.env.CI||!!E.env.WT_SESSION||!!E.env.TERMINUS_SUBLIME||E.env.ConEmuTask==="{cmd::Cmder}"||E.env.TERM_PROGRAM==="Terminus-Sublime"||E.env.TERM_PROGRAM==="vscode"||E.env.TERM==="xterm-256color"||E.env.TERM==="alacritty"||E.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Ye=Ze(),ae=()=>process.env.CI==="true",Te=s=>s.isTTY===!0,dist_w=(s,a)=>Ye?s:a,it=dist_w("◆","*"),$t=dist_w("■","x"),Mt=dist_w("▲","x"),Dt=dist_w("◇","o"),Nt=dist_w("┌","T"),kt=dist_w("│","|"),jt=dist_w("└","—"),At=dist_w("┐","T"),Pt=dist_w("┘","—"),Bt=dist_w("●",">"),Rt=dist_w("○"," "),Lt=dist_w("◻","[•]"),Ut=dist_w("◼","[+]"),Ft=dist_w("◻","[ ]"),Vt=dist_w("▪","•"),Wt=dist_w("─","-"),zt=dist_w("╮","+"),qt=dist_w("├","+"),Kt=dist_w("╯","+"),Ht=dist_w("╰","+"),Yt=dist_w("╭","+"),Jt=dist_w("●","•"),Zt=dist_w("◆","*"),Xt=dist_w("▲","!"),Qt=dist_w("■","x"),dist_V=s=>{switch(s){case"initial":case"active":return(0,v.styleText)("cyan",it);case"cancel":return(0,v.styleText)("red",$t);case"error":return(0,v.styleText)("yellow",Mt);case"submit":return(0,v.styleText)("green",Dt)}},ye=s=>{switch(s){case"initial":case"active":return(0,v.styleText)("cyan",kt);case"cancel":return(0,v.styleText)("red",kt);case"error":return(0,v.styleText)("yellow",kt);case"submit":return(0,v.styleText)("green",kt)}},dist_et=(s,a,u,f,v)=>{let E=a,I=0;for(let a=u;a<f;a++){const u=s[a];if(E=E-u.length,I++,E<=v)break}return{lineCount:E,removals:I}},dist_Y=({cursor:s,options:a,style:u,output:f=process.stdout,maxItems:E=Number.POSITIVE_INFINITY,columnPadding:I=0,rowPadding:D=4})=>{const N=O(f)-I,P=A(f),B=(0,v.styleText)("dim","..."),_=Math.max(P-D,0),U=Math.max(Math.min(E,_),5);let q=0;s>=U-3&&(q=Math.max(Math.min(s-U+3,a.length-U),0));let H=U<a.length&&q>0,Y=U<a.length&&q+U<a.length;const X=Math.min(q+U,a.length),ee=[];let te=0;H&&te++,Y&&te++;const ne=q+(H?1:0),se=X-(Y?1:0);for(let f=ne;f<se;f++){const v=wrapAnsi(u(a[f],f===s),N,{hard:!0,trim:!1}).split(`\n`);ee.push(v),te+=v.length}if(te>_){let a=0,u=0,f=te;const v=s-ne,R=(s,a)=>dist_et(ee,f,s,a,_);H?(({lineCount:f,removals:a}=R(0,v)),f>_&&({lineCount:f,removals:u}=R(v+1,ee.length))):(({lineCount:f,removals:u}=R(v+1,ee.length)),f>_&&({lineCount:f,removals:a}=R(0,v))),a>0&&(H=!0,ee.splice(0,a)),u>0&&(Y=!0,ee.splice(ee.length-u,u))}const oe=[];H&&oe.push(B);for(const s of ee)for(const a of s)oe.push(a);return Y&&oe.push(B),oe};function Me(s){return s.label??String(s.value??"")}function Re(s,a){if(!s)return!0;const u=(a.label??String(a.value??"")).toLowerCase(),f=(a.hint??"").toLowerCase(),v=String(a.value).toLowerCase(),E=s.toLowerCase();return u.includes(E)||f.includes(E)||v.includes(E)}function dist_tt(s,a){const u=[];for(const f of a)s.includes(f.value)&&u.push(f);return u}const Ae=s=>new ve({options:s.options,initialValue:s.initialValue?[s.initialValue]:void 0,initialUserInput:s.initialUserInput,placeholder:s.placeholder,filter:s.filter??((s,a)=>Re(s,a)),signal:s.signal,input:s.input,output:s.output,validate:s.validate,render(){const a=s.withGuide??I.withGuide,u=a?[`${t("gray",kt)}`,`${dist_V(this.state)} ${s.message}`]:[`${dist_V(this.state)} ${s.message}`],f=this.userInput,v=this.options,E=s.placeholder,D=f===""&&E!==void 0,c=(s,a)=>{const u=Me(s),f=s.hint&&s.value===this.focusedValue?t("dim",` (${s.hint})`):"";switch(a){case"active":return`${t("green",Bt)} ${u}${f}`;case"inactive":return`${t("dim",Rt)} ${t("dim",u)}`;case"disabled":return`${t("gray",Rt)} ${t(["strikethrough","gray"],u)}`}};switch(this.state){case"submit":{const s=dist_tt(this.selectedValues,v),f=s.length>0?` ${t("dim",s.map(Me).join(", "))}`:"",E=a?t("gray",kt):"";return`${u.join(`\n`)}\n${E}${f}`}case"cancel":{const s=f?` ${t(["strikethrough","dim"],f)}`:"",v=a?t("gray",kt):"";return`${u.join(`\n`)}\n${v}${s}`}default:{const I=this.state==="error"?"yellow":"cyan",N=a?`${t(I,kt)} `:"",P=a?t(I,jt):"";let B="";if(this.isNavigating||D){const s=D?E:f;B=s!==""?` ${t("dim",s)}`:""}else B=` ${this.userInputWithCursor}`;const _=this.filteredOptions.length!==v.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",U=this.filteredOptions.length===0&&f?[`${N}${t("yellow","No matches found")}`]:[],q=this.state==="error"?[`${N}${t("yellow",this.error)}`]:[];a&&u.push(`${N.trimEnd()}`),u.push(`${N}${t("dim","Search:")}${B}${_}`,...U,...q);const H=[`${t("dim","↑/↓")} to select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],Y=[`${N}${H.join(" • ")}`,P],X=this.filteredOptions.length===0?[]:dist_Y({cursor:this.cursor,options:this.filteredOptions,columnPadding:a?3:0,rowPadding:u.length+Y.length,style:(s,a)=>c(s,s.disabled?"disabled":a?"active":"inactive"),maxItems:s.maxItems,output:s.output});return[...u,...X.map((s=>`${N}${s}`)),...Y].join(`\n`)}}}}).prompt(),dist_st=s=>{const i=(s,a,u,f)=>{const v=u.includes(s.value),E=s.label??String(s.value??""),I=s.hint&&f!==void 0&&s.value===f?t("dim",` (${s.hint})`):"",D=v?t("green",Ut):t("dim",Ft);return s.disabled?`${t("gray",Ft)} ${t(["strikethrough","gray"],E)}`:a?`${D} ${E}${I}`:`${D} ${t("dim",E)}`},a=new ve({options:s.options,multiple:!0,placeholder:s.placeholder,filter:s.filter??((s,a)=>Re(s,a)),validate:()=>{if(s.required&&a.selectedValues.length===0)return"Please select at least one item"},initialValue:s.initialValues,signal:s.signal,input:s.input,output:s.output,render(){const a=s.withGuide??I.withGuide,u=`${a?`${t("gray",kt)}\n`:""}${dist_V(this.state)} ${s.message}\n`,f=this.userInput,v=s.placeholder,E=f===""&&v!==void 0,D=this.isNavigating||E?t("dim",E?v:f):this.userInputWithCursor,N=this.options,P=this.filteredOptions.length!==N.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${u}${a?`${t("gray",kt)} `:""}${t("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${u}${a?`${t("gray",kt)} `:""}${t(["strikethrough","dim"],f)}`;default:{const v=this.state==="error"?"yellow":"cyan",E=a?`${t(v,kt)} `:"",I=a?t(v,jt):"",N=[`${t("dim","↑/↓")} to navigate`,`${t("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],B=this.filteredOptions.length===0&&f?[`${E}${t("yellow","No matches found")}`]:[],_=this.state==="error"?[`${E}${t("yellow",this.error)}`]:[],U=[...`${u}${a?t(v,kt):""}`.split(`\n`),`${E}${t("dim","Search:")} ${D}${P}`,...B,..._],q=[`${E}${N.join(" • ")}`,I],H=dist_Y({cursor:this.cursor,options:this.filteredOptions,style:(s,a)=>i(s,a,this.selectedValues,this.focusedValue),maxItems:s.maxItems,output:s.output,rowPadding:U.length+q.length});return[...U,...H.map((s=>`${E}${s}`)),...q].join(`\n`)}}}});return a.prompt()},en=[Yt,zt,Ht,Kt],tn=[Nt,At,jt,Pt];function Pe(s,a,u,f){let v=u,E=u;return f==="center"?v=Math.floor((a-s)/2):f==="right"&&(v=a-s-u),E=a-v-s,[v,E]}const dist_nt=s=>s,dist_at=(s="",a="",u)=>{const f=u?.output??process.stdout,v=X(f),E=2,D=u?.titlePadding??1,N=u?.contentPadding??2,P=u?.width===void 0||u.width==="auto"?1:Math.min(1,u.width),_=u?.withGuide??I.withGuide?`${kt} `:"",U=u?.formatBorder??dist_nt,H=(u?.rounded?en:tn).map(U),Y=U(Wt),ee=U(kt),te=B(_),ne=B(a),se=v-te;let oe=Math.floor(v*P)-te;if(u?.width==="auto"){const a=s.split(`\n`);let u=ne+D*2;for(const s of a){const a=B(s)+N*2;a>u&&(u=a)}const f=u+E;f<oe&&(oe=f)}oe%2!==0&&(oe<se?oe++:oe--);const ce=oe-E,le=ce-D*2,ue=ne>le?`${a.slice(0,le-3)}...`:a,[de,pe]=Pe(B(ue),ce,D,u?.titleAlign),me=q(s,ce-N*2,{hard:!0,trim:!1});f.write(`${_}${H[0]}${Y.repeat(de)}${ue}${Y.repeat(pe)}${H[1]}\n`);const he=me.split(`\n`);for(const s of he){const[a,v]=Pe(B(s),ce,N,u?.contentAlign);f.write(`${_}${ee}${" ".repeat(a)}${s}${" ".repeat(v)}${ee}\n`)}f.write(`${_}${H[2]}${Y.repeat(ce)}${H[3]}\n`)},dist_ot=s=>{const a=s.active??"Yes",u=s.inactive??"No";return new Q({active:a,inactive:u,signal:s.signal,input:s.input,output:s.output,initialValue:s.initialValue??!0,render(){const f=s.withGuide??ke.withGuide,E=`${dist_V(this.state)} `,I=f?`${(0,v.styleText)("gray",kt)} `:"",D=R(s.output,s.message,I,E),N=`${f?`${(0,v.styleText)("gray",kt)}\n`:""}${D}\n`,P=this.value?a:u;switch(this.state){case"submit":{const s=f?`${(0,v.styleText)("gray",kt)} `:"";return`${N}${s}${(0,v.styleText)("dim",P)}`}case"cancel":{const s=f?`${(0,v.styleText)("gray",kt)} `:"";return`${N}${s}${(0,v.styleText)(["strikethrough","dim"],P)}${f?`\n${(0,v.styleText)("gray",kt)}`:""}`}default:{const E=f?`${(0,v.styleText)("cyan",kt)} `:"",I=f?(0,v.styleText)("cyan",jt):"";return`${N}${E}${this.value?`${(0,v.styleText)("green",Bt)} ${a}`:`${(0,v.styleText)("dim",Rt)} ${(0,v.styleText)("dim",a)}`}${s.vertical?f?`\n${(0,v.styleText)("cyan",kt)} `:`\n`:` ${(0,v.styleText)("dim","/")} `}${this.value?`${(0,v.styleText)("dim",Rt)} ${(0,v.styleText)("dim",u)}`:`${(0,v.styleText)("green",Bt)} ${u}`}\n${I}\n`}}}}).prompt()},ut=s=>{const a=s.validate;return new De({...s,validate(u){if(u===void 0)return s.defaultValue!==void 0?void 0:a?a(u):I.date.messages.required;const r=s=>s.toISOString().slice(0,10);if(s.minDate&&r(u)<r(s.minDate))return I.date.messages.afterMin(s.minDate);if(s.maxDate&&r(u)>r(s.maxDate))return I.date.messages.beforeMax(s.maxDate);if(a)return a(u)},render(){const a=(s?.withGuide??I.withGuide)!==!1,u=`${`${a?`${t("gray",kt)}\n`:""}${dist_V(this.state)} `}${s.message}\n`,f=this.state!=="initial"?this.state:"active",v=lt(this,f),E=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{const s=this.error?` ${t("yellow",this.error)}`:"",f=a?`${t("yellow",kt)} `:"",E=a?t("yellow",jt):"";return`${u.trim()}\n${f}${v}\n${E}${s}\n`}case"submit":{const s=E?` ${t("dim",E)}`:"",f=a?t("gray",kt):"";return`${u}${f}${s}`}case"cancel":{const s=E?` ${t(["strikethrough","dim"],E)}`:"",f=a?t("gray",kt):"";return`${u}${f}${s}${E.trim()?`\n${f}`:""}`}default:{const s=a?`${t("cyan",kt)} `:"",f=a?t("cyan",jt):"",E=a?`${t("cyan",kt)} `:"",I=this.inlineError?`\n${E}${t("yellow",this.inlineError)}`:"";return`${u}${s}${v}${I}\n${f}\n`}}}}).prompt()};function lt(s,a){const u=s.segmentValues,f=s.segmentCursor;if(a==="submit"||a==="cancel")return s.formattedValue;const v=t("gray",s.separator);return s.segments.map(((s,v)=>{const E=v===f.segmentIndex&&!["submit","cancel"].includes(a),I=nn[s.type];return ct(u[s.type],{isActive:E,label:I})})).join(v)}function ct(s,a){const u=!s||s.replace(/_/g,"")==="";return a.isActive?t("inverse",u?a.label:s.replace(/_/g," ")):u?t("dim",a.label):s.replace(/_/g,t("dim"," "))}const nn={year:"yyyy",month:"mm",day:"dd"},dt=async(s,a)=>{const u={},f=Object.keys(s);for(const v of f){const f=s[v],E=await(f({results:u})?.catch((s=>{throw s})));if(typeof a?.onCancel=="function"&&We(E)){u[v]="canceled",a.onCancel({results:u});continue}u[v]=E}return u},ht=s=>{const{selectableGroups:a=!0,groupSpacing:u=0}=s,r=(s,f,v=[])=>{const E=s.label??String(s.value),I=typeof s.group=="string",D=I&&(v[v.indexOf(s)+1]??{group:!0}),N=I&&D&&D.group===!0,P=I?a?`${N?jt:kt} `:" ":"";let B="";if(u>0&&!I){const s=`\n${t("cyan",kt)}`;B=`${s.repeat(u-1)}${s} `}if(f==="active")return`${B}${t("dim",P)}${t("cyan",Lt)} ${E}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`;if(f==="group-active")return`${B}${P}${t("cyan",Lt)} ${t("dim",E)}`;if(f==="group-active-selected")return`${B}${P}${t("green",Ut)} ${t("dim",E)}`;if(f==="selected"){const u=I||a?t("green",Ut):"";return`${B}${t("dim",P)}${u} ${t("dim",E)}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`}if(f==="cancelled")return`${t(["strikethrough","dim"],E)}`;if(f==="active-selected")return`${B}${t("dim",P)}${t("green",Ut)} ${E}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`;if(f==="submitted")return`${t("dim",E)}`;const _=I||a?t("dim",Ft):"";return`${B}${t("dim",P)}${_} ${t("dim",E)}`},f=s.required??!0;return new Fe({options:s.options,signal:s.signal,input:s.input,output:s.output,initialValues:s.initialValues,required:f,cursorAt:s.cursorAt,selectableGroups:a,validate(s){if(f&&(s===void 0||s.length===0))return`Please select at least one option.\n${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){const a=s.withGuide??I.withGuide,u=`${a?`${t("gray",kt)}\n`:""}${dist_V(this.state)} ${s.message}\n`,f=this.value??[];switch(this.state){case"submit":{const s=this.options.filter((({value:s})=>f.includes(s))).map((s=>r(s,"submitted"))),v=s.length===0?"":` ${s.join(t("dim",", "))}`;return`${u}${a?t("gray",kt):""}${v}`}case"cancel":{const s=this.options.filter((({value:s})=>f.includes(s))).map((s=>r(s,"cancelled"))).join(t("dim",", "));return`${u}${a?`${t("gray",kt)} `:""}${s.trim()?`${s}${a?`\n${t("gray",kt)}`:""}`:""}`}case"error":{const s=this.error.split(`\n`).map(((s,u)=>u===0?`${a?`${t("yellow",jt)} `:""}${t("yellow",s)}`:` ${s}`)).join(`\n`);return`${u}${a?`${t("yellow",kt)} `:""}${this.options.map(((s,a,u)=>{const v=f.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),E=a===this.cursor;return!E&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?r(s,v?"group-active-selected":"group-active",u):E&&v?r(s,"active-selected",u):v?r(s,"selected",u):r(s,E?"active":"inactive",u)})).join(`\n${a?`${t("yellow",kt)} `:""}`)}\n${s}\n`}default:{const s=this.options.map(((s,a,u)=>{const v=f.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),E=a===this.cursor,I=!E&&typeof s.group=="string"&&this.options[this.cursor].value===s.group;let D="";return I?D=r(s,v?"group-active-selected":"group-active",u):E&&v?D=r(s,"active-selected",u):v?D=r(s,"selected",u):D=r(s,E?"active":"inactive",u),`${a!==0&&!D.startsWith(`\n`)?" ":""}${D}`})).join(`\n${a?t("cyan",kt):""}`),v=s.startsWith(`\n`)?"":" ";return`${u}${a?t("cyan",kt):""}${v}${s}\n${a?t("cyan",jt):""}\n`}}}}).prompt()},sn={message:(s=[],{symbol:a=(0,v.styleText)("gray",kt),secondarySymbol:u=(0,v.styleText)("gray",kt),output:f=process.stdout,spacing:E=1,withGuide:I}={})=>{const D=[],N=I??ke.withGuide,P=N?u:"",B=N?`${a} `:"",_=N?`${u} `:"";for(let s=0;s<E;s++)D.push(P);const U=Array.isArray(s)?s:s.split(`\n`);if(U.length>0){const[s,...f]=U;s.length>0?D.push(`${B}${s}`):D.push(N?a:"");for(const s of f)s.length>0?D.push(`${_}${s}`):D.push(N?u:"")}f.write(`${D.join(`\n`)}\n`)},info:(s,a)=>{sn.message(s,{...a,symbol:(0,v.styleText)("blue",Jt)})},success:(s,a)=>{sn.message(s,{...a,symbol:(0,v.styleText)("green",Zt)})},step:(s,a)=>{sn.message(s,{...a,symbol:(0,v.styleText)("green",Dt)})},warn:(s,a)=>{sn.message(s,{...a,symbol:(0,v.styleText)("yellow",Xt)})},warning:(s,a)=>{sn.warn(s,a)},error:(s,a)=>{sn.message(s,{...a,symbol:(0,v.styleText)("red",Qt)})}},pt=(s="",a)=>{const u=a?.output??process.stdout,f=a?.withGuide??ke.withGuide?`${(0,v.styleText)("gray",jt)} `:"";u.write(`${f}${(0,v.styleText)("red",s)}\n\n`)},mt=(s="",a)=>{const u=a?.output??process.stdout,f=a?.withGuide??ke.withGuide?`${(0,v.styleText)("gray",Nt)} `:"";u.write(`${f}${s}\n`)},gt=(s="",a)=>{const u=a?.output??process.stdout,f=a?.withGuide??ke.withGuide?`${(0,v.styleText)("gray",kt)}\n${(0,v.styleText)("gray",jt)} `:"";u.write(`${f}${s}\n\n`)},dist_Q=(s,a)=>s.split(`\n`).map((s=>a(s))).join(`\n`),yt=s=>{const i=(s,a)=>{const u=s.label??String(s.value);return a==="disabled"?`${t("gray",Ft)} ${dist_Q(u,(s=>t(["strikethrough","gray"],s)))}${s.hint?` ${t("dim",`(${s.hint??"disabled"})`)}`:""}`:a==="active"?`${t("cyan",Lt)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:a==="selected"?`${t("green",Ut)} ${dist_Q(u,(s=>t("dim",s)))}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:a==="cancelled"?`${dist_Q(u,(s=>t(["strikethrough","dim"],s)))}`:a==="active-selected"?`${t("green",Ut)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:a==="submitted"?`${dist_Q(u,(s=>t("dim",s)))}`:`${t("dim",Ft)} ${dist_Q(u,(s=>t("dim",s)))}`},a=s.required??!0;return new He({options:s.options,signal:s.signal,input:s.input,output:s.output,initialValues:s.initialValues,required:a,cursorAt:s.cursorAt,validate(s){if(a&&(s===void 0||s.length===0))return`Please select at least one option.\n${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t("bgWhite",t("inverse"," enter ")))} to submit`))}`},render(){const a=s.withGuide??I.withGuide,u=N(s.output,s.message,a?`${ye(this.state)} `:"",`${dist_V(this.state)} `),f=`${a?`${t("gray",kt)}\n`:""}${u}\n`,v=this.value??[],c=(s,a)=>{if(s.disabled)return i(s,"disabled");const u=v.includes(s.value);return a&&u?i(s,"active-selected"):u?i(s,"selected"):i(s,a?"active":"inactive")};switch(this.state){case"submit":{const u=this.options.filter((({value:s})=>v.includes(s))).map((s=>i(s,"submitted"))).join(t("dim",", "))||t("dim","none"),E=N(s.output,u,a?`${t("gray",kt)} `:"");return`${f}${E}`}case"cancel":{const u=this.options.filter((({value:s})=>v.includes(s))).map((s=>i(s,"cancelled"))).join(t("dim",", "));if(u.trim()==="")return`${f}${t("gray",kt)}`;const E=N(s.output,u,a?`${t("gray",kt)} `:"");return`${f}${E}${a?`\n${t("gray",kt)}`:""}`}case"error":{const u=a?`${t("yellow",kt)} `:"",v=this.error.split(`\n`).map(((s,u)=>u===0?`${a?`${t("yellow",jt)} `:""}${t("yellow",s)}`:` ${s}`)).join(`\n`),E=f.split(`\n`).length,I=v.split(`\n`).length+1;return`${f}${u}${dist_Y({output:s.output,options:this.options,cursor:this.cursor,maxItems:s.maxItems,columnPadding:u.length,rowPadding:E+I,style:c}).join(`\n${u}`)}\n${v}\n`}default:{const u=a?`${t("cyan",kt)} `:"",v=f.split(`\n`).length,E=a?2:1;return`${f}${u}${dist_Y({output:s.output,options:this.options,cursor:this.cursor,maxItems:s.maxItems,columnPadding:u.length,rowPadding:v+E,style:c}).join(`\n${u}`)}\n${a?t("cyan",jt):""}\n`}}}}).prompt()},ft=s=>t("dim",s),vt=(s,a,u)=>{const f={hard:!0,trim:!1},v=q(s,a,f).split(`\n`),E=v.reduce(((s,a)=>Math.max(B(a),s)),0),I=v.map(u).reduce(((s,a)=>Math.max(B(a),s)),0),D=a-(I-E);return q(s,D,f)},wt=(s="",a="",u)=>{const f=u?.output??P.stdout,v=u?.withGuide??I.withGuide,E=u?.format??ft,D=["",...vt(s,X(f)-6,E).split(`\n`).map(E),""],N=B(a),_=Math.max(D.reduce(((s,a)=>{const u=B(a);return u>s?u:s}),0),N)+2,U=D.map((s=>`${t("gray",kt)} ${s}${" ".repeat(_-B(s))}${t("gray",kt)}`)).join(`\n`),q=v?`${t("gray",kt)}\n`:"",H=v?qt:Ht;f.write(`${q}${t("green",Dt)} ${t("reset",a)} ${t("gray",Wt.repeat(Math.max(_-N-1,1))+zt)}\n${U}\n${t("gray",H+Wt.repeat(_+2)+Kt)}\n`)},bt=s=>new Ue({validate:s.validate,mask:s.mask??Vt,signal:s.signal,input:s.input,output:s.output,render(){const a=s.withGuide??I.withGuide,u=`${a?`${t("gray",kt)}\n`:""}${dist_V(this.state)} ${s.message}\n`,f=this.userInputWithCursor,v=this.masked;switch(this.state){case"error":{const f=a?`${t("yellow",kt)} `:"",E=a?`${t("yellow",jt)} `:"",I=v??"";return s.clearOnError&&this.clear(),`${u.trim()}\n${f}${I}\n${E}${t("yellow",this.error)}\n`}case"submit":{const s=a?`${t("gray",kt)} `:"",f=v?t("dim",v):"";return`${u}${s}${f}`}case"cancel":{const s=a?`${t("gray",kt)} `:"",f=v?t(["strikethrough","dim"],v):"";return`${u}${s}${f}${v&&a?`\n${t("gray",kt)}`:""}`}default:{const s=a?`${t("cyan",kt)} `:"",v=a?t("cyan",jt):"";return`${u}${s}${f}\n${v}\n`}}}}).prompt(),St=s=>{const a=s.validate;return Ae({...s,initialUserInput:s.initialValue??s.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(a)return a(s)}},options(){const a=this.userInput;if(a==="")return[];try{let u;Xe(a)?we(a).isDirectory()&&(!s.directory||a.endsWith("/"))?u=a:u=be(a):u=be(a);const f=a.length>1&&a.endsWith("/")?a.slice(0,-1):a;return ze(u).map((s=>{const a=Qe(u,s),f=we(a);return{name:s,path:a,isDirectory:f.isDirectory()}})).filter((({path:a,isDirectory:u})=>a.startsWith(f)&&(u||!s.directory))).map((s=>({value:s.path})))}catch{return[]}}})},Ct=s=>(0,v.styleText)("magenta",s),fe=({indicator:s="dots",onCancel:a,output:u=process.stdout,cancelMessage:f,errorMessage:E,frames:I=(Ye?["◒","◐","◓","◑"]:["•","o","O","0"]),delay:D=(Ye?80:120),signal:N,...P}={})=>{const B=ae();let _,U,q=!1,H=!1,Y="",X,ee=performance.now();const te=O(u),ne=P?.styleFrame??Ct,T=s=>{const u=s>1?E??ke.messages.error:f??ke.messages.cancel;H=s===1,q&&(W(u,s),H&&typeof a=="function"&&a())},C=()=>T(2),b=()=>T(1),x=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",T),N&&N.addEventListener("abort",b)},G=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",T),N&&N.removeEventListener("abort",b)},M=()=>{if(X===void 0)return;B&&u.write(`\n`);const s=wrapAnsi(X,te,{hard:!0,trim:!1}).split(`\n`);s.length>1&&u.write(Ee.cursor.up(s.length-1)),u.write(Ee.cursor.to(0)),u.write(Ee.erase.down())},R=s=>s.replace(/\.+$/,""),j=s=>{const a=(performance.now()-s)/1e3,u=Math.floor(a/60),f=Math.floor(a%60);return u>0?`[${u}m ${f}s]`:`[${f}s]`},se=P.withGuide??ke.withGuide,ie=(a="")=>{q=!0,_=z({output:u}),Y=R(a),ee=performance.now(),se&&u.write(`${(0,v.styleText)("gray",kt)}\n`);let f=0,E=0;x(),U=setInterval((()=>{if(B&&Y===X)return;M(),X=Y;const a=ne(I[f]);let v;if(B)v=`${a} ${Y}...`;else if(s==="timer")v=`${a} ${Y} ${j(ee)}`;else{const s=".".repeat(Math.floor(E)).slice(0,3);v=`${a} ${Y}${s}`}const D=wrapAnsi(v,te,{hard:!0,trim:!1});u.write(D),f=f+1<I.length?f+1:0,E=E<4?E+.125:0}),D)},W=(a="",f=0,E=!1)=>{if(!q)return;q=!1,clearInterval(U),M();const I=f===0?(0,v.styleText)("green",Dt):f===1?(0,v.styleText)("red",$t):(0,v.styleText)("red",Mt);Y=a??Y,E||(s==="timer"?u.write(`${I} ${Y} ${j(ee)}\n`):u.write(`${I} ${Y}\n`)),G(),_()};return{start:ie,stop:(s="")=>W(s,0),message:(s="")=>{Y=R(s??Y)},cancel:(s="")=>W(s,1),error:(s="")=>W(s,2),clear:()=>W("",0,!0),get isCancelled(){return H}}},rn={light:dist_w("─","-"),heavy:dist_w("━","="),block:dist_w("█","#")};function Tt({style:s="heavy",max:a=100,size:u=40,...f}={}){const v=fe(f);let E=0,I="";const D=Math.max(1,a),N=Math.max(1,u),l=s=>{switch(s){case"initial":case"active":return s=>t("magenta",s);case"error":case"cancel":return s=>t("red",s);case"submit":return s=>t("green",s);default:return s=>t("magenta",s)}},$=(a,u)=>{const f=Math.floor(E/D*N);return`${l(a)(rn[s].repeat(f))}${t("dim",rn[s].repeat(N-f))} ${u}`},y=(s="")=>{I=s,v.start($("initial",s))},p=(s=1,a)=>{E=Math.min(D,s+E),v.message($("active",a??I)),I=a??I};return{start:y,stop:v.stop,cancel:v.cancel,error:v.error,clear:v.clear,advance:p,isCancelled:v.isCancelled,message:s=>p(0,s)}}const re=(s,a)=>s.includes(`\n`)?s.split(`\n`).map((s=>a(s))).join(`\n`):a(s),_t=s=>{const i=(s,a)=>{const u=s.label??String(s.value);switch(a){case"disabled":return`${(0,v.styleText)("gray",Rt)} ${re(u,(s=>(0,v.styleText)("gray",s)))}${s.hint?` ${(0,v.styleText)("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${re(u,(s=>(0,v.styleText)("dim",s)))}`;case"active":return`${(0,v.styleText)("green",Bt)} ${u}${s.hint?` ${(0,v.styleText)("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${re(u,(s=>(0,v.styleText)(["strikethrough","dim"],s)))}`;default:return`${(0,v.styleText)("dim",Rt)} ${re(u,(s=>(0,v.styleText)("dim",s)))}`}};return new nt({options:s.options,signal:s.signal,input:s.input,output:s.output,initialValue:s.initialValue,render(){const a=s.withGuide??ke.withGuide,u=`${dist_V(this.state)} `,f=`${ye(this.state)} `,E=R(s.output,s.message,f,u),I=`${a?`${(0,v.styleText)("gray",kt)}\n`:""}${E}\n`;switch(this.state){case"submit":{const u=a?`${(0,v.styleText)("gray",kt)} `:"",f=R(s.output,i(this.options[this.cursor],"selected"),u);return`${I}${f}`}case"cancel":{const u=a?`${(0,v.styleText)("gray",kt)} `:"",f=R(s.output,i(this.options[this.cursor],"cancelled"),u);return`${I}${f}${a?`\n${(0,v.styleText)("gray",kt)}`:""}`}default:{const u=a?`${(0,v.styleText)("cyan",kt)} `:"",f=a?(0,v.styleText)("cyan",jt):"",E=I.split(`\n`).length,D=a?2:1;return`${I}${u}${dist_Y({output:s.output,cursor:this.cursor,options:this.options,maxItems:s.maxItems,columnPadding:u.length,rowPadding:E+D,style:(s,a)=>i(s,s.disabled?"disabled":a?"active":"inactive")}).join(`\n${u}`)}\n${f}\n`}}}}).prompt()},It=s=>{const i=(s,a="inactive")=>{const u=s.label??String(s.value);return a==="selected"?`${t("dim",u)}`:a==="cancelled"?`${t(["strikethrough","dim"],u)}`:a==="active"?`${t(["bgCyan","gray"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:`${t(["gray","bgWhite","inverse"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`};return new Je({options:s.options,signal:s.signal,input:s.input,output:s.output,initialValue:s.initialValue,caseSensitive:s.caseSensitive,render(){const a=s.withGuide??I.withGuide,u=`${a?`${t("gray",kt)}\n`:""}${dist_V(this.state)} ${s.message}\n`;switch(this.state){case"submit":{const f=a?`${t("gray",kt)} `:"",v=this.options.find((s=>s.value===this.value))??s.options[0],E=N(s.output,i(v,"selected"),f);return`${u}${E}`}case"cancel":{const f=a?`${t("gray",kt)} `:"",v=N(s.output,i(this.options[0],"cancelled"),f);return`${u}${v}${a?`\n${t("gray",kt)}`:""}`}default:{const f=a?`${t("cyan",kt)} `:"",v=a?t("cyan",jt):"",E=this.options.map(((a,u)=>N(s.output,i(a,u===this.cursor?"active":"inactive"),f))).join(`\n`);return`${u}${E}\n${v}\n`}}}}).prompt()},on=`${(0,v.styleText)("gray",kt)} `,an={message:async(s,{symbol:a=(0,v.styleText)("gray",kt)}={})=>{process.stdout.write(`${(0,v.styleText)("gray",kt)}\n${a} `);let u=3;for await(let a of s){a=a.replace(/\n/g,`\n${on}`),a.includes(`\n`)&&(u=3+(0,v.stripVTControlCharacters)(a.slice(a.lastIndexOf(`\n`))).length);const s=(0,v.stripVTControlCharacters)(a).length;u+s<process.stdout.columns?(u+=s,process.stdout.write(a)):(process.stdout.write(`\n${on}${a.trimStart()}`),u=3+(0,v.stripVTControlCharacters)(a.trimStart()).length)}process.stdout.write(`\n`)},info:s=>an.message(s,{symbol:(0,v.styleText)("blue",Jt)}),success:s=>an.message(s,{symbol:(0,v.styleText)("green",Zt)}),step:s=>an.message(s,{symbol:(0,v.styleText)("green",Dt)}),warn:s=>an.message(s,{symbol:(0,v.styleText)("yellow",Xt)}),warning:s=>an.warn(s),error:s=>an.message(s,{symbol:(0,v.styleText)("red",Qt)})},Et=async(s,a)=>{for(const u of s){if(u.enabled===!1)continue;const s=fe(a);s.start(u.title);const f=await u.task(s.message);s.stop(f||u.title)}},xt=s=>s.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),Gt=s=>{const a=s.output??process.stdout,u=X(a),f=t("gray",kt),v=s.spacing??1,E=3,I=s.retainLog===!0,D=!ae()&&Te(a);a.write(`${f}\n`),a.write(`${t("green",Dt)} ${s.title}\n`);for(let s=0;s<v;s++)a.write(`${f}\n`);const N=[{value:"",full:""}];let P=!1;const $=s=>{if(N.length===0)return;let f=0;s&&(f+=v+2);for(const s of N){const{value:a,result:v}=s;let I=v?.message??a;if(I.length===0)continue;v===void 0&&s.header!==void 0&&s.header!==""&&(I+=`\n${s.header}`);const D=I.split(`\n`).reduce(((s,a)=>a===""?s+1:s+Math.ceil((a.length+E)/u)),0);f+=D}f>0&&(f+=1,a.write(Ce.lines(f)))},y=(s,u,E)=>{const I=E?`${s.full}\n${s.value}`:s.value;s.header!==void 0&&s.header!==""&&sn.message(s.header.split(`\n`).map((s=>t("bold",s))),{output:a,secondarySymbol:f,symbol:f,spacing:0}),sn.message(I.split(`\n`).map((s=>t("dim",s))),{output:a,secondarySymbol:f,symbol:f,spacing:u??v})},p=()=>{for(const s of N){const{header:a,value:u,full:f}=s;(a===void 0||a.length===0)&&u.length===0||y(s,void 0,I===!0&&f.length>0)}},m=(a,u,f)=>{if($(!1),(f?.raw!==!0||!P)&&a.value!==""&&(a.value+=`\n`),a.value+=xt(u),P=f?.raw===!0,s.limit!==void 0){const u=a.value.split(`\n`),f=u.length-s.limit;if(f>0){const s=u.splice(0,f);I&&(a.full+=(a.full===""?"":`\n`)+s.join(`\n`))}a.value=u.join(`\n`)}D&&g()},g=()=>{for(const s of N)s.result?s.result.status==="error"?sn.error(s.result.message,{output:a,secondarySymbol:f,spacing:0}):sn.success(s.result.message,{output:a,secondarySymbol:f,spacing:0}):s.value!==""&&y(s,0)},S=(s,a)=>{$(!1),s.result=a,D&&g()};return{message(s,a){m(N[0],s,a)},group(s){const a={header:s,value:"",full:""};return N.push(a),{message(s,u){m(a,s,u)},error(s){S(a,{status:"error",message:s})},success(s){S(a,{status:"success",message:s})}}},error(s,u){$(!0),sn.error(s,{output:a,secondarySymbol:f,spacing:1}),u?.showLog!==!1&&p(),N.splice(1,N.length-1),N[0].value="",N[0].full=""},success(s,u){$(!0),sn.success(s,{output:a,secondarySymbol:f,spacing:1}),u?.showLog===!0&&p(),N.splice(1,N.length-1),N[0].value="",N[0].full=""}}},Ot=s=>new at({validate:s.validate,placeholder:s.placeholder,defaultValue:s.defaultValue,initialValue:s.initialValue,output:s.output,signal:s.signal,input:s.input,render(){const a=s?.withGuide??ke.withGuide,u=`${`${a?`${(0,v.styleText)("gray",kt)}\n`:""}${dist_V(this.state)} `}${s.message}\n`,f=s.placeholder?(0,v.styleText)("inverse",s.placeholder[0])+(0,v.styleText)("dim",s.placeholder.slice(1)):(0,v.styleText)(["inverse","hidden"],"_"),E=this.userInput?this.userInputWithCursor:f,I=this.value??"";switch(this.state){case"error":{const s=this.error?` ${(0,v.styleText)("yellow",this.error)}`:"",f=a?`${(0,v.styleText)("yellow",kt)} `:"",I=a?(0,v.styleText)("yellow",jt):"";return`${u.trim()}\n${f}${E}\n${I}${s}\n`}case"submit":{const s=I?` ${(0,v.styleText)("dim",I)}`:"",f=a?(0,v.styleText)("gray",kt):"";return`${u}${f}${s}`}case"cancel":{const s=I?` ${(0,v.styleText)(["strikethrough","dim"],I)}`:"",f=a?(0,v.styleText)("gray",kt):"";return`${u}${f}${s}${I.trim()?`\n${f}`:""}`}default:{const s=a?`${(0,v.styleText)("cyan",kt)} `:"",f=a?(0,v.styleText)("cyan",jt):"";return`${u}${s}${E}\n${f}\n`}}}}).prompt()},880:(a,u,f)=>{f.d(u,{Ho:()=>Vs});function isPlainObject(s){if(typeof s!=="object"||s===null){return false}const a=Object.getPrototypeOf(s);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)}var v=f(136);const safeNormalizeFileUrl=(s,a)=>{const u=normalizeFileUrl(normalizeDenoExecPath(s));if(typeof u!=="string"){throw new TypeError(`${a} must be a string or a file URL: ${u}.`)}return u};const normalizeDenoExecPath=s=>isDenoExecPath(s)?s.toString():s;const isDenoExecPath=s=>typeof s!=="string"&&s&&Object.getPrototypeOf(s)===String.prototype;const normalizeFileUrl=s=>s instanceof URL?(0,v.fileURLToPath)(s):s;const normalizeParameters=(s,a=[],u={})=>{const f=safeNormalizeFileUrl(s,"First argument");const[v,E]=isPlainObject(a)?[[],a]:[a,u];if(!Array.isArray(v)){throw new TypeError(`Second argument must be either an array of arguments or an options object: ${v}`)}if(v.some((s=>typeof s==="object"&&s!==null))){throw new TypeError(`Second argument must be an array of strings: ${v}`)}const I=v.map(String);const D=I.find((s=>s.includes("\0")));if(D!==undefined){throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${D}`)}if(!isPlainObject(E)){throw new TypeError(`Last argument must be an options object: ${E}`)}return[f,I,E]};const E=s(import.meta.url)("node:child_process");const I=s(import.meta.url)("node:string_decoder");const{toString:D}=Object.prototype;const isArrayBuffer=s=>D.call(s)==="[object ArrayBuffer]";const isUint8Array=s=>D.call(s)==="[object Uint8Array]";const bufferToUint8Array=s=>new Uint8Array(s.buffer,s.byteOffset,s.byteLength);const N=new TextEncoder;const stringToUint8Array=s=>N.encode(s);const P=new TextDecoder;const uint8ArrayToString=s=>P.decode(s);const joinToString=(s,a)=>{const u=uint8ArraysToStrings(s,a);return u.join("")};const uint8ArraysToStrings=(s,a)=>{if(a==="utf8"&&s.every((s=>typeof s==="string"))){return s}const u=new I.StringDecoder(a);const f=s.map((s=>typeof s==="string"?stringToUint8Array(s):s)).map((s=>u.write(s)));const v=u.end();return v===""?f:[...f,v]};const joinToUint8Array=s=>{if(s.length===1&&isUint8Array(s[0])){return s[0]}return concatUint8Arrays(stringsToUint8Arrays(s))};const stringsToUint8Arrays=s=>s.map((s=>typeof s==="string"?stringToUint8Array(s):s));const concatUint8Arrays=s=>{const a=new Uint8Array(getJoinLength(s));let u=0;for(const f of s){a.set(f,u);u+=f.length}return a};const getJoinLength=s=>{let a=0;for(const u of s){a+=u.length}return a};const isTemplateString=s=>Array.isArray(s)&&Array.isArray(s.raw);const parseTemplates=(s,a)=>{let u=[];for(const[f,v]of s.entries()){u=parseTemplate({templates:s,expressions:a,tokens:u,index:f,template:v})}if(u.length===0){throw new TypeError("Template script must not be empty")}const[f,...v]=u;return[f,v,{}]};const parseTemplate=({templates:s,expressions:a,tokens:u,index:f,template:v})=>{if(v===undefined){throw new TypeError(`Invalid backslash sequence: ${s.raw[f]}`)}const{nextTokens:E,leadingWhitespaces:I,trailingWhitespaces:D}=splitByWhitespaces(v,s.raw[f]);const N=concatTokens(u,E,I);if(f===a.length){return N}const P=a[f];const B=Array.isArray(P)?P.map((s=>parseExpression(s))):[parseExpression(P)];return concatTokens(N,B,D)};const splitByWhitespaces=(s,a)=>{if(a.length===0){return{nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false}}const u=[];let f=0;const v=B.has(a[0]);for(let v=0,E=0;v<s.length;v+=1,E+=1){const I=a[E];if(B.has(I)){if(f!==v){u.push(s.slice(f,v))}f=v+1}else if(I==="\\"){const s=a[E+1];if(s==="\n"){v-=1;E+=1}else if(s==="u"&&a[E+2]==="{"){E=a.indexOf("}",E+3)}else{E+=_[s]??1}}}const E=f===s.length;if(!E){u.push(s.slice(f))}return{nextTokens:u,leadingWhitespaces:v,trailingWhitespaces:E}};const B=new Set([" ","\t","\r","\n"]);const _={x:3,u:5};const concatTokens=(s,a,u)=>u||s.length===0||a.length===0?[...s,...a]:[...s.slice(0,-1),`${s.at(-1)}${a[0]}`,...a.slice(1)];const parseExpression=s=>{const a=typeof s;if(a==="string"){return s}if(a==="number"){return String(s)}if(isPlainObject(s)&&("stdout"in s||"isMaxBuffer"in s)){return getSubprocessResult(s)}if(s instanceof E.ChildProcess||Object.prototype.toString.call(s)==="[object Promise]"){throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.")}throw new TypeError(`Unexpected "${a}" in template expression`)};const getSubprocessResult=({stdout:s})=>{if(typeof s==="string"){return s}if(isUint8Array(s)){return uint8ArrayToString(s)}if(s===undefined){throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.')}throw new TypeError(`Unexpected "${typeof s}" stdout in template expression`)};var U=f(975);var q=f(708);const isStandardStream=s=>H.includes(s);const H=[q.stdin,q.stdout,q.stderr];const Y=["stdin","stdout","stderr"];const getStreamName=s=>Y[s]??`stdio[${s}]`;const normalizeFdSpecificOptions=s=>{const a={...s};for(const u of ne){a[u]=normalizeFdSpecificOption(s,u)}return a};const normalizeFdSpecificOption=(s,a)=>{const u=Array.from({length:getStdioLength(s)+1});const f=normalizeFdSpecificValue(s[a],u,a);return addDefaultValue(f,a)};const getStdioLength=({stdio:s})=>Array.isArray(s)?Math.max(s.length,Y.length):Y.length;const normalizeFdSpecificValue=(s,a,u)=>isPlainObject(s)?normalizeOptionObject(s,a,u):a.fill(s);const normalizeOptionObject=(s,a,u)=>{for(const f of Object.keys(s).sort(compareFdName)){for(const v of parseFdName(f,u,a)){a[v]=s[f]}}return a};const compareFdName=(s,a)=>getFdNameOrder(s)<getFdNameOrder(a)?1:-1;const getFdNameOrder=s=>{if(s==="stdout"||s==="stderr"){return 0}return s==="all"?2:1};const parseFdName=(s,a,u)=>{if(s==="ipc"){return[u.length-1]}const f=parseFd(s);if(f===undefined||f===0){throw new TypeError(`"${a}.${s}" is invalid.\nIt must be "${a}.stdout", "${a}.stderr", "${a}.all", "${a}.ipc", or "${a}.fd3", "${a}.fd4" (and so on).`)}if(f>=u.length){throw new TypeError(`"${a}.${s}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}return f==="all"?[1,2]:[f]};const parseFd=s=>{if(s==="all"){return s}if(Y.includes(s)){return Y.indexOf(s)}const a=X.exec(s);if(a!==null){return Number(a[1])}};const X=/^fd(\d+)$/;const addDefaultValue=(s,a)=>s.map((s=>s===undefined?te[a]:s));const ee=(0,U.debuglog)("execa").enabled?"full":"none";const te={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:ee,stripFinalNewline:true};const ne=["lines","buffer","maxBuffer","verbose","stripFinalNewline"];const getFdSpecificValue=(s,a)=>a==="ipc"?s.at(-1):s[a];const isVerbose=({verbose:s},a)=>getFdVerbose(s,a)!=="none";const isFullVerbose=({verbose:s},a)=>!["none","short"].includes(getFdVerbose(s,a));const getVerboseFunction=({verbose:s},a)=>{const u=getFdVerbose(s,a);return isVerboseFunction(u)?u:undefined};const getFdVerbose=(s,a)=>a===undefined?getFdGenericVerbose(s):getFdSpecificValue(s,a);const getFdGenericVerbose=s=>s.find((s=>isVerboseFunction(s)))??se.findLast((a=>s.includes(a)));const isVerboseFunction=s=>typeof s==="function";const se=["none","short","full"];const joinCommand=(s,a)=>{const u=[s,...a];const f=u.join(" ");const v=u.map((s=>quoteString(escapeControlCharacters(s)))).join(" ");return{command:f,escapedCommand:v}};const escapeLines=s=>(0,U.stripVTControlCharacters)(s).split("\n").map((s=>escapeControlCharacters(s))).join("\n");const escapeControlCharacters=s=>s.replaceAll(oe,(s=>escapeControlCharacter(s)));const escapeControlCharacter=s=>{const a=ce[s];if(a!==undefined){return a}const u=s.codePointAt(0);const f=u.toString(16);return u<=le?`\\u${f.padStart(4,"0")}`:`\\U${f}`};const getSpecialCharRegExp=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}};const oe=getSpecialCharRegExp();const ce={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};const le=65535;const quoteString=s=>{if(ue.test(s)){return s}return q.platform==="win32"?`"${s.replaceAll('"','""')}"`:`'${s.replaceAll("'","'\\''")}'`};const ue=/^[\w./-]+$/;function isUnicodeSupported(){const{env:s}=q;const{TERM:a,TERM_PROGRAM:u}=s;if(q.platform!=="win32"){return a!=="linux"}return Boolean(s.WT_SESSION)||Boolean(s.TERMINUS_SUBLIME)||s.ConEmuTask==="{cmd::Cmder}"||u==="Terminus-Sublime"||u==="vscode"||a==="xterm-256color"||a==="alacritty"||a==="rxvt-unicode"||a==="rxvt-unicode-256color"||s.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const de={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:"╱"};const pe={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:"⅒"};const me={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"};const he={...de,...pe};const ge={...de,...me};const be=isUnicodeSupported();const we=be?he:ge;const $e=we;const ve=Object.entries(pe);const replaceSymbols=(s,{useFallback:a=!be}={})=>{if(a){for(const[a,u]of ve){s=s.replaceAll(u,ge[a])}}return s};var Se=f(66);const xe=Se?.WriteStream?.prototype?.hasColors?.()??false;const format=(s,a)=>{if(!xe){return s=>s}const u=`[${s}m`;const f=`[${a}m`;return s=>{const v=s+"";let E=v.indexOf(f);if(E===-1){return u+v+f}let I=u;let D=0;const N=a===22;const P=(N?f:"")+u;while(E!==-1){I+=v.slice(D,E)+P;D=E+f.length;E=v.indexOf(f,D)}I+=v.slice(D)+f;return I}};const Ee=format(0,0);const Ie=format(1,22);const De=format(2,22);const Oe=format(3,23);const Ce=format(4,24);const Ne=format(53,55);const ke=format(7,27);const je=format(8,28);const Be=format(9,29);const _e=format(30,39);const Le=format(31,39);const Ue=format(32,39);const Fe=format(33,39);const Ge=format(34,39);const Ve=format(35,39);const We=format(36,39);const ze=format(37,39);const qe=format(90,39);const Ke=format(40,49);const He=format(41,49);const Ye=format(42,49);const Je=format(43,49);const Xe=format(44,49);const Qe=format(45,49);const it=format(46,49);const $t=format(47,49);const Mt=format(100,49);const Dt=format(91,39);const Nt=format(92,39);const kt=format(93,39);const jt=format(94,39);const At=format(95,39);const Pt=format(96,39);const Bt=format(97,39);const Rt=format(101,49);const Lt=format(102,49);const Ut=format(103,49);const Ft=format(104,49);const Vt=format(105,49);const Wt=format(106,49);const zt=format(107,49);const defaultVerboseFunction=({type:s,message:a,timestamp:u,piped:f,commandId:v,result:{failed:E=false}={},options:{reject:I=true}})=>{const D=serializeTimestamp(u);const N=qt[s]({failed:E,reject:I,piped:f});const P=Kt[s]({reject:I});return`${qe(`[${D}]`)} ${qe(`[${v}]`)} ${P(N)} ${P(a)}`};const serializeTimestamp=s=>`${padField(s.getHours(),2)}:${padField(s.getMinutes(),2)}:${padField(s.getSeconds(),2)}.${padField(s.getMilliseconds(),3)}`;const padField=(s,a)=>String(s).padStart(a,"0");const getFinalIcon=({failed:s,reject:a})=>{if(!s){return $e.tick}return a?$e.cross:$e.warning};const qt={command:({piped:s})=>s?"|":"$",output:()=>" ",ipc:()=>"*",error:getFinalIcon,duration:getFinalIcon};const identity=s=>s;const Kt={command:()=>Ie,output:()=>identity,ipc:()=>identity,error:({reject:s})=>s?Dt:kt,duration:()=>qe};const applyVerboseOnLines=(s,a,u)=>{const f=getVerboseFunction(a,u);return s.map((({verboseLine:s,verboseObject:a})=>applyVerboseFunction(s,a,f))).filter((s=>s!==undefined)).map((s=>appendNewline(s))).join("")};const applyVerboseFunction=(s,a,u)=>{if(u===undefined){return s}const f=u(s,a);if(typeof f==="string"){return f}};const appendNewline=s=>s.endsWith("\n")?s:`${s}\n`;const verboseLog=({type:s,verboseMessage:a,fdNumber:u,verboseInfo:f,result:v})=>{const E=getVerboseObject({type:s,result:v,verboseInfo:f});const I=getPrintedLines(a,E);const D=applyVerboseOnLines(I,f,u);if(D!==""){console.warn(D.slice(0,-1))}};const getVerboseObject=({type:s,result:a,verboseInfo:{escapedCommand:u,commandId:f,rawOptions:{piped:v=false,...E}}})=>({type:s,escapedCommand:u,commandId:`${f}`,timestamp:new Date,piped:v,result:a,options:E});const getPrintedLines=(s,a)=>s.split("\n").map((s=>getPrintedLine({...a,message:s})));const getPrintedLine=s=>{const a=defaultVerboseFunction(s);return{verboseLine:a,verboseObject:s}};const serializeVerboseMessage=s=>{const a=typeof s==="string"?s:(0,U.inspect)(s);const u=escapeLines(a);return u.replaceAll("\t"," ".repeat(Ht))};const Ht=2;const logCommand=(s,a)=>{if(!isVerbose(a)){return}verboseLog({type:"command",verboseMessage:s,verboseInfo:a})};const getVerboseInfo=(s,a,u)=>{validateVerbose(s);const f=getCommandId(s);return{verbose:s,escapedCommand:a,commandId:f,rawOptions:u}};const getCommandId=s=>isVerbose({verbose:s})?Yt++:undefined;let Yt=0n;const validateVerbose=s=>{for(const a of s){if(a===false){throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".')}if(a===true){throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".')}if(!se.includes(a)&&!isVerboseFunction(a)){const s=se.map((s=>`'${s}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${a}. Allowed values are: ${s} or a function.`)}}};const getStartTime=()=>q.hrtime.bigint();const getDurationMs=s=>Number(q.hrtime.bigint()-s)/1e6;const handleCommand=(s,a,u)=>{const f=getStartTime();const{command:v,escapedCommand:E}=joinCommand(s,a);const I=normalizeFdSpecificOption(u,"verbose");const D=getVerboseInfo(I,E,{...u});logCommand(E,D);return{command:v,escapedCommand:E,startTime:f,verboseInfo:D}};var Jt=f(760);var Zt=f(348);function pathKey(s={}){const{env:a=process.env,platform:u=process.platform}=s;if(u!=="win32"){return"PATH"}return Object.keys(a).reverse().find((s=>s.toUpperCase()==="PATH"))||"Path"}const Xt=(0,U.promisify)(E.execFile);function toPath(s){return s instanceof URL?(0,v.fileURLToPath)(s):s}function rootDirectory(s){return path.parse(toPath(s)).root}function traversePathUp(s){return{*[Symbol.iterator](){let a=Jt.resolve(toPath(s));let u;while(u!==a){yield a;u=a;a=Jt.resolve(a,"..")}}}}const Qt=null&&10*1024*1024;async function execFile(s,a,u={}){return Xt(s,a,{maxBuffer:Qt,...u})}function execFileSync(s,a=[],u={}){return execFileSyncOriginal(s,a,{maxBuffer:Qt,encoding:"utf8",stdio:"pipe",...u})}const npmRunPath=({cwd:s=q.cwd(),path:a=q.env[pathKey()],preferLocal:u=true,execPath:f=q.execPath,addExecPath:v=true}={})=>{const E=Jt.resolve(toPath(s));const I=[];const D=a.split(Jt.delimiter);if(u){applyPreferLocal(I,D,E)}if(v){applyExecPath(I,D,f,E)}return a===""||a===Jt.delimiter?`${I.join(Jt.delimiter)}${a}`:[...I,a].join(Jt.delimiter)};const applyPreferLocal=(s,a,u)=>{for(const f of traversePathUp(u)){const u=Jt.join(f,"node_modules/.bin");if(!a.includes(u)){s.push(u)}}};const applyExecPath=(s,a,u,f)=>{const v=Jt.resolve(f,toPath(u),"..");if(!a.includes(v)){s.push(v)}};const npmRunPathEnv=({env:s=q.env,...a}={})=>{s={...s};const u=pathKey({env:s});a.path=s[u];s[u]=npmRunPath(a);return s};const en=s(import.meta.url)("node:timers/promises");const getFinalError=(s,a,u)=>{const f=u?ExecaSyncError:ExecaError;const v=s instanceof DiscardedError?{}:{cause:s};return new f(a,v)};class DiscardedError extends Error{}const setErrorName=(s,a)=>{Object.defineProperty(s.prototype,"name",{value:a,writable:true,enumerable:false,configurable:true});Object.defineProperty(s.prototype,tn,{value:true,writable:false,enumerable:false,configurable:false})};const isExecaError=s=>isErrorInstance(s)&&tn in s;const tn=Symbol("isExecaError");const isErrorInstance=s=>Object.prototype.toString.call(s)==="[object Error]";class ExecaError extends Error{}setErrorName(ExecaError,ExecaError.name);class ExecaSyncError extends Error{}setErrorName(ExecaSyncError,ExecaSyncError.name);const nn=s(import.meta.url)("node:os");const getRealtimeSignals=()=>{const s=rn-sn+1;return Array.from({length:s},getRealtimeSignal)};const getRealtimeSignal=(s,a)=>({name:`SIGRT${a+1}`,number:sn+a,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"});const sn=34;const rn=64;const on=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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"}];const getSignals=()=>{const s=getRealtimeSignals();const a=[...on,...s].map(normalizeSignal);return a};const normalizeSignal=({name:s,number:a,description:u,action:f,forced:v=false,standard:E})=>{const{signals:{[s]:I}}=nn.constants;const D=I!==undefined;const N=D?I:a;return{name:s,number:N,description:u,supported:D,action:f,forced:v,standard:E}};const getSignalsByName=()=>{const s=getSignals();return Object.fromEntries(s.map(getSignalByName))};const getSignalByName=({name:s,number:a,description:u,supported:f,action:v,forced:E,standard:I})=>[s,{name:s,number:a,description:u,supported:f,action:v,forced:E,standard:I}];const an=getSignalsByName();const getSignalsByNumber=()=>{const s=getSignals();const a=rn+1;const u=Array.from({length:a},((a,u)=>getSignalByNumber(u,s)));return Object.assign({},...u)};const getSignalByNumber=(s,a)=>{const u=findSignalByNumber(s,a);if(u===undefined){return{}}const{name:f,description:v,supported:E,action:I,forced:D,standard:N}=u;return{[s]:{name:f,number:s,description:v,supported:E,action:I,forced:D,standard:N}}};const findSignalByNumber=(s,a)=>{const u=a.find((({name:a})=>nn.constants.signals[a]===s));if(u!==undefined){return u}return a.find((a=>a.number===s))};const cn=getSignalsByNumber();const normalizeKillSignal=s=>{const a="option `killSignal`";if(s===0){throw new TypeError(`Invalid ${a}: 0 cannot be used.`)}return signal_normalizeSignal(s,a)};const normalizeSignalArgument=s=>s===0?s:signal_normalizeSignal(s,"`subprocess.kill()`'s argument");const signal_normalizeSignal=(s,a)=>{if(Number.isInteger(s)){return normalizeSignalInteger(s,a)}if(typeof s==="string"){return normalizeSignalName(s,a)}throw new TypeError(`Invalid ${a} ${String(s)}: it must be a string or an integer.\n${getAvailableSignals()}`)};const normalizeSignalInteger=(s,a)=>{if(ln.has(s)){return ln.get(s)}throw new TypeError(`Invalid ${a} ${s}: this signal integer does not exist.\n${getAvailableSignals()}`)};const getSignalsIntegerToName=()=>new Map(Object.entries(nn.constants.signals).reverse().map((([s,a])=>[a,s])));const ln=getSignalsIntegerToName();const normalizeSignalName=(s,a)=>{if(s in nn.constants.signals){return s}if(s.toUpperCase()in nn.constants.signals){throw new TypeError(`Invalid ${a} '${s}': please rename it to '${s.toUpperCase()}'.`)}throw new TypeError(`Invalid ${a} '${s}': this signal name does not exist.\n${getAvailableSignals()}`)};const getAvailableSignals=()=>`Available signal names: ${getAvailableSignalNames()}.\nAvailable signal numbers: ${getAvailableSignalIntegers()}.`;const getAvailableSignalNames=()=>Object.keys(nn.constants.signals).sort().map((s=>`'${s}'`)).join(", ");const getAvailableSignalIntegers=()=>[...new Set(Object.values(nn.constants.signals).sort(((s,a)=>s-a)))].join(", ");const getSignalDescription=s=>an[s].description;const normalizeForceKillAfterDelay=s=>{if(s===false){return s}if(s===true){return un}if(!Number.isFinite(s)||s<0){throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${s}\` (${typeof s})`)}return s};const un=1e3*5;const subprocessKill=({kill:s,options:{forceKillAfterDelay:a,killSignal:u},onInternalError:f,context:v,controller:E},I,D)=>{const{signal:N,error:P}=parseKillArguments(I,D,u);emitKillError(P,f);const B=s(N);setKillTimeout({kill:s,signal:N,forceKillAfterDelay:a,killSignal:u,killResult:B,context:v,controller:E});return B};const parseKillArguments=(s,a,u)=>{const[f=u,v]=isErrorInstance(s)?[undefined,s]:[s,a];if(typeof f!=="string"&&!Number.isInteger(f)){throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(f)}`)}if(v!==undefined&&!isErrorInstance(v)){throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${v}`)}return{signal:normalizeSignalArgument(f),error:v}};const emitKillError=(s,a)=>{if(s!==undefined){a.reject(s)}};const setKillTimeout=async({kill:s,signal:a,forceKillAfterDelay:u,killSignal:f,killResult:v,context:E,controller:I})=>{if(a===f&&v){killOnTimeout({kill:s,forceKillAfterDelay:u,context:E,controllerSignal:I.signal})}};const killOnTimeout=async({kill:s,forceKillAfterDelay:a,context:u,controllerSignal:f})=>{if(a===false){return}try{await(0,en.setTimeout)(a,undefined,{signal:f});if(s("SIGKILL")){u.isForcefullyTerminated??=true}}catch{}};const dn=s(import.meta.url)("node:events");const onAbortedSignal=async(s,a)=>{if(!s.aborted){await(0,dn.once)(s,"abort",{signal:a})}};const validateCancelSignal=({cancelSignal:s})=>{if(s!==undefined&&Object.prototype.toString.call(s)!=="[object AbortSignal]"){throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(s)}`)}};const throwOnCancel=({subprocess:s,cancelSignal:a,gracefulCancel:u,context:f,controller:v})=>a===undefined||u?[]:[terminateOnCancel(s,a,f,v)];const terminateOnCancel=async(s,a,u,{signal:f})=>{await onAbortedSignal(a,f);u.terminationReason??="cancel";s.kill();throw a.reason};const validateIpcMethod=({methodName:s,isSubprocess:a,ipc:u,isConnected:f})=>{validateIpcOption(s,a,u);validateConnection(s,a,f)};const validateIpcOption=(s,a,u)=>{if(!u){throw new Error(`${getMethodName(s,a)} can only be used if the \`ipc\` option is \`true\`.`)}};const validateConnection=(s,a,u)=>{if(!u){throw new Error(`${getMethodName(s,a)} cannot be used: the ${getOtherProcessName(a)} has already exited or disconnected.`)}};const throwOnEarlyDisconnect=s=>{throw new Error(`${getMethodName("getOneMessage",s)} could not complete: the ${getOtherProcessName(s)} exited or disconnected.`)};const throwOnStrictDeadlockError=s=>{throw new Error(`${getMethodName("sendMessage",s)} failed: the ${getOtherProcessName(s)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${getMethodName("getOneMessage",s)},\n\t${getMethodName("sendMessage",s,"message, {strict: true}")},\n]);`)};const getStrictResponseError=(s,a)=>new Error(`${getMethodName("sendMessage",a)} failed when sending an acknowledgment response to the ${getOtherProcessName(a)}.`,{cause:s});const throwOnMissingStrict=s=>{throw new Error(`${getMethodName("sendMessage",s)} failed: the ${getOtherProcessName(s)} is not listening to incoming messages.`)};const throwOnStrictDisconnect=s=>{throw new Error(`${getMethodName("sendMessage",s)} failed: the ${getOtherProcessName(s)} exited without listening to incoming messages.`)};const getAbortDisconnectError=()=>new Error(`\`cancelSignal\` aborted: the ${getOtherProcessName(true)} disconnected.`);const throwOnMissingParent=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")};const handleEpipeError=({error:s,methodName:a,isSubprocess:u})=>{if(s.code==="EPIPE"){throw new Error(`${getMethodName(a,u)} cannot be used: the ${getOtherProcessName(u)} is disconnecting.`,{cause:s})}};const handleSerializationError=({error:s,methodName:a,isSubprocess:u,message:f})=>{if(isSerializationError(s)){throw new Error(`${getMethodName(a,u)}'s argument type is invalid: the message cannot be serialized: ${String(f)}.`,{cause:s})}};const isSerializationError=({code:s,message:a})=>pn.has(s)||fn.some((s=>a.includes(s)));const pn=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]);const fn=["could not be cloned","circular structure","call stack size exceeded"];const getMethodName=(s,a,u="")=>s==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${getNamespaceName(a)}${s}(${u})`;const getNamespaceName=s=>s?"":"subprocess.";const getOtherProcessName=s=>s?"parent process":"subprocess";const disconnect=s=>{if(s.connected){s.disconnect()}};const createDeferred=()=>{const s={};const a=new Promise(((a,u)=>{Object.assign(s,{resolve:a,reject:u})}));return Object.assign(a,s)};const getToStream=(s,a="stdin")=>{const u=true;const{options:f,fileDescriptors:v}=mn.get(s);const E=getFdNumber(v,a,u);const I=s.stdio[E];if(I===null){throw new TypeError(getInvalidStdioOptionMessage(E,a,f,u))}return I};const getFromStream=(s,a="stdout")=>{const u=false;const{options:f,fileDescriptors:v}=mn.get(s);const E=getFdNumber(v,a,u);const I=E==="all"?s.all:s.stdio[E];if(I===null||I===undefined){throw new TypeError(getInvalidStdioOptionMessage(E,a,f,u))}return I};const mn=new WeakMap;const getFdNumber=(s,a,u)=>{const f=parseFdNumber(a,u);validateFdNumber(f,a,u,s);return f};const parseFdNumber=(s,a)=>{const u=parseFd(s);if(u!==undefined){return u}const{validOptions:f,defaultValue:v}=a?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${getOptionName(a)}" must not be "${s}".\nIt must be ${f} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${v}".`)};const validateFdNumber=(s,a,u,f)=>{const v=f[getUsedDescriptor(s)];if(v===undefined){throw new TypeError(`"${getOptionName(u)}" must not be ${a}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`)}if(v.direction==="input"&&!u){throw new TypeError(`"${getOptionName(u)}" must not be ${a}. It must be a readable stream, not writable.`)}if(v.direction!=="input"&&u){throw new TypeError(`"${getOptionName(u)}" must not be ${a}. It must be a writable stream, not readable.`)}};const getInvalidStdioOptionMessage=(s,a,u,f)=>{if(s==="all"&&!u.all){return'The "all" option must be true to use "from: \'all\'".'}const{optionName:v,optionValue:E}=getInvalidStdioOption(s,u);return`The "${v}: ${serializeOptionValue(E)}" option is incompatible with using "${getOptionName(f)}: ${serializeOptionValue(a)}".\nPlease set this option with "pipe" instead.`};const getInvalidStdioOption=(s,{stdin:a,stdout:u,stderr:f,stdio:v})=>{const E=getUsedDescriptor(s);if(E===0&&a!==undefined){return{optionName:"stdin",optionValue:a}}if(E===1&&u!==undefined){return{optionName:"stdout",optionValue:u}}if(E===2&&f!==undefined){return{optionName:"stderr",optionValue:f}}return{optionName:`stdio[${E}]`,optionValue:v[E]}};const getUsedDescriptor=s=>s==="all"?1:s;const getOptionName=s=>s?"to":"from";const serializeOptionValue=s=>{if(typeof s==="string"){return`'${s}'`}return typeof s==="number"?`${s}`:"Stream"};const incrementMaxListeners=(s,a,u)=>{const f=s.getMaxListeners();if(f===0||f===Number.POSITIVE_INFINITY){return}s.setMaxListeners(f+a);(0,dn.addAbortListener)(u,(()=>{s.setMaxListeners(s.getMaxListeners()-a)}))};const addReference=(s,a)=>{if(a){addReferenceCount(s)}};const addReferenceCount=s=>{s.refCounted()};const removeReference=(s,a)=>{if(a){removeReferenceCount(s)}};const removeReferenceCount=s=>{s.unrefCounted()};const undoAddedReferences=(s,a)=>{if(a){removeReferenceCount(s);removeReferenceCount(s)}};const redoAddedReferences=(s,a)=>{if(a){addReferenceCount(s);addReferenceCount(s)}};const onMessage=async({anyProcess:s,channel:a,isSubprocess:u,ipcEmitter:f},v)=>{if(handleStrictResponse(v)||handleAbort(v)){return}if(!hn.has(s)){hn.set(s,[])}const E=hn.get(s);E.push(v);if(E.length>1){return}while(E.length>0){await waitForOutgoingMessages(s,f,v);await en.scheduler.yield();const I=await handleStrictRequest({wrappedMessage:E[0],anyProcess:s,channel:a,isSubprocess:u,ipcEmitter:f});E.shift();f.emit("message",I);f.emit("message:done")}};const onDisconnect=async({anyProcess:s,channel:a,isSubprocess:u,ipcEmitter:f,boundOnMessage:v})=>{abortOnDisconnect();const E=hn.get(s);while(E?.length>0){await(0,dn.once)(f,"message:done")}s.removeListener("message",v);redoAddedReferences(a,u);f.connected=false;f.emit("disconnect")};const hn=new WeakMap;const getIpcEmitter=(s,a,u)=>{if(gn.has(s)){return gn.get(s)}const f=new dn.EventEmitter;f.connected=true;gn.set(s,f);forwardEvents({ipcEmitter:f,anyProcess:s,channel:a,isSubprocess:u});return f};const gn=new WeakMap;const forwardEvents=({ipcEmitter:s,anyProcess:a,channel:u,isSubprocess:f})=>{const v=onMessage.bind(undefined,{anyProcess:a,channel:u,isSubprocess:f,ipcEmitter:s});a.on("message",v);a.once("disconnect",onDisconnect.bind(undefined,{anyProcess:a,channel:u,isSubprocess:f,ipcEmitter:s,boundOnMessage:v}));undoAddedReferences(u,f)};const isConnected=s=>{const a=gn.get(s);return a===undefined?s.channel!==null:a.connected};const handleSendStrict=({anyProcess:s,channel:a,isSubprocess:u,message:f,strict:v})=>{if(!v){return f}const E=getIpcEmitter(s,a,u);const I=hasMessageListeners(s,E);return{id:bn++,type:wn,message:f,hasListeners:I}};let bn=0n;const validateStrictDeadlock=(s,a)=>{if(a?.type!==wn||a.hasListeners){return}for(const{id:a}of s){if(a!==undefined){yn[a].resolve({isDeadlock:true,hasListeners:false})}}};const handleStrictRequest=async({wrappedMessage:s,anyProcess:a,channel:u,isSubprocess:f,ipcEmitter:v})=>{if(s?.type!==wn||!a.connected){return s}const{id:E,message:I}=s;const D={id:E,type:$n,message:hasMessageListeners(a,v)};try{await sendMessage({anyProcess:a,channel:u,isSubprocess:f,ipc:true},D)}catch(s){v.emit("strict:error",s)}return I};const handleStrictResponse=s=>{if(s?.type!==$n){return false}const{id:a,message:u}=s;yn[a]?.resolve({isDeadlock:false,hasListeners:u});return true};const waitForStrictResponse=async(s,a,u)=>{if(s?.type!==wn){return}const f=createDeferred();yn[s.id]=f;const v=new AbortController;try{const{isDeadlock:s,hasListeners:E}=await Promise.race([f,throwOnDisconnect(a,u,v)]);if(s){throwOnStrictDeadlockError(u)}if(!E){throwOnMissingStrict(u)}}finally{v.abort();delete yn[s.id]}};const yn={};const throwOnDisconnect=async(s,a,{signal:u})=>{incrementMaxListeners(s,1,u);await(0,dn.once)(s,"disconnect",{signal:u});throwOnStrictDisconnect(a)};const wn="execa:ipc:request";const $n="execa:ipc:response";const startSendMessage=(s,a,u)=>{if(!vn.has(s)){vn.set(s,new Set)}const f=vn.get(s);const v=createDeferred();const E=u?a.id:undefined;const I={onMessageSent:v,id:E};f.add(I);return{outgoingMessages:f,outgoingMessage:I}};const endSendMessage=({outgoingMessages:s,outgoingMessage:a})=>{s.delete(a);a.onMessageSent.resolve()};const waitForOutgoingMessages=async(s,a,u)=>{while(!hasMessageListeners(s,a)&&vn.get(s)?.size>0){const a=[...vn.get(s)];validateStrictDeadlock(a,u);await Promise.all(a.map((({onMessageSent:s})=>s)))}};const vn=new WeakMap;const hasMessageListeners=(s,a)=>a.listenerCount("message")>getMinListenerCount(s);const getMinListenerCount=s=>mn.has(s)&&!getFdSpecificValue(mn.get(s).options.buffer,"ipc")?1:0;const sendMessage=({anyProcess:s,channel:a,isSubprocess:u,ipc:f},v,{strict:E=false}={})=>{const I="sendMessage";validateIpcMethod({methodName:I,isSubprocess:u,ipc:f,isConnected:s.connected});return sendMessageAsync({anyProcess:s,channel:a,methodName:I,isSubprocess:u,message:v,strict:E})};const sendMessageAsync=async({anyProcess:s,channel:a,methodName:u,isSubprocess:f,message:v,strict:E})=>{const I=handleSendStrict({anyProcess:s,channel:a,isSubprocess:f,message:v,strict:E});const D=startSendMessage(s,I,E);try{await sendOneMessage({anyProcess:s,methodName:u,isSubprocess:f,wrappedMessage:I,message:v})}catch(a){disconnect(s);throw a}finally{endSendMessage(D)}};const sendOneMessage=async({anyProcess:s,methodName:a,isSubprocess:u,wrappedMessage:f,message:v})=>{const E=getSendMethod(s);try{await Promise.all([waitForStrictResponse(f,s,u),E(f)])}catch(s){handleEpipeError({error:s,methodName:a,isSubprocess:u});handleSerializationError({error:s,methodName:a,isSubprocess:u,message:v});throw s}};const getSendMethod=s=>{if(Sn.has(s)){return Sn.get(s)}const a=(0,U.promisify)(s.send.bind(s));Sn.set(s,a);return a};const Sn=new WeakMap;const sendAbort=(s,a)=>{const u="cancelSignal";validateConnection(u,false,s.connected);return sendOneMessage({anyProcess:s,methodName:u,isSubprocess:false,wrappedMessage:{type:Tn,message:a},message:a})};const getCancelSignal=async({anyProcess:s,channel:a,isSubprocess:u,ipc:f})=>{await startIpc({anyProcess:s,channel:a,isSubprocess:u,ipc:f});return En.signal};const startIpc=async({anyProcess:s,channel:a,isSubprocess:u,ipc:f})=>{if(xn){return}xn=true;if(!f){throwOnMissingParent();return}if(a===null){abortOnDisconnect();return}getIpcEmitter(s,a,u);await en.scheduler.yield()};let xn=false;const handleAbort=s=>{if(s?.type!==Tn){return false}En.abort(s.message);return true};const Tn="execa:ipc:cancel";const abortOnDisconnect=()=>{En.abort(getAbortDisconnectError())};const En=new AbortController;const validateGracefulCancel=({gracefulCancel:s,cancelSignal:a,ipc:u,serialization:f})=>{if(!s){return}if(a===undefined){throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.")}if(!u){throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.")}if(f==="json"){throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}};const throwOnGracefulCancel=({subprocess:s,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:f,context:v,controller:E})=>u?[sendOnAbort({subprocess:s,cancelSignal:a,forceKillAfterDelay:f,context:v,controller:E})]:[];const sendOnAbort=async({subprocess:s,cancelSignal:a,forceKillAfterDelay:u,context:f,controller:{signal:v}})=>{await onAbortedSignal(a,v);const E=getReason(a);await sendAbort(s,E);killOnTimeout({kill:s.kill,forceKillAfterDelay:u,context:f,controllerSignal:v});f.terminationReason??="gracefulCancel";throw a.reason};const getReason=({reason:s})=>{if(!(s instanceof DOMException)){return s}const a=new Error(s.message);Object.defineProperty(a,"stack",{value:s.stack,enumerable:false,configurable:true,writable:true});return a};const validateTimeout=({timeout:s})=>{if(s!==undefined&&(!Number.isFinite(s)||s<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${s}\` (${typeof s})`)}};const throwOnTimeout=(s,a,u,f)=>a===0||a===undefined?[]:[killAfterTimeout(s,a,u,f)];const killAfterTimeout=async(s,a,u,{signal:f})=>{await(0,en.setTimeout)(a,undefined,{signal:f});u.terminationReason??="timeout";s.kill();throw new DiscardedError};const mapNode=({options:s})=>{if(s.node===false){throw new TypeError('The "node" option cannot be false with `execaNode()`.')}return{options:{...s,node:true}}};const handleNodeOption=(s,a,{node:u=false,nodePath:f=q.execPath,nodeOptions:v=q.execArgv.filter((s=>!s.startsWith("--inspect"))),cwd:E,execPath:I,...D})=>{if(I!==undefined){throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.')}const N=safeNormalizeFileUrl(f,'The "nodePath" option');const P=Jt.resolve(E,N);const B={...D,nodePath:P,node:u,cwd:E};if(!u){return[s,a,B]}if(Jt.basename(s,".exe")==="node"){throw new TypeError('When the "node" option is true, the first argument does not need to be "node".')}return[P,[...v,s,...a],{ipc:true,...B,shell:false}]};const In=s(import.meta.url)("node:v8");const validateIpcInputOption=({ipcInput:s,ipc:a,serialization:u})=>{if(s===undefined){return}if(!a){throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.")}Mn[u](s)};const validateAdvancedInput=s=>{try{(0,In.serialize)(s)}catch(s){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:s})}};const validateJsonInput=s=>{try{JSON.stringify(s)}catch(s){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:s})}};const Mn={advanced:validateAdvancedInput,json:validateJsonInput};const sendIpcInput=async(s,a)=>{if(a===undefined){return}await s.sendMessage(a)};const validateEncoding=({encoding:s})=>{if(Cn.has(s)){return}const a=getCorrectEncoding(s);if(a!==undefined){throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(s)}\`.\nPlease rename it to ${serializeEncoding(a)}.`)}const u=[...Cn].map((s=>serializeEncoding(s))).join(", ");throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(s)}\`.\nPlease rename it to one of: ${u}.`)};const Dn=new Set(["utf8","utf16le"]);const On=new Set(["buffer","hex","base64","base64url","latin1","ascii"]);const Cn=new Set([...Dn,...On]);const getCorrectEncoding=s=>{if(s===null){return"buffer"}if(typeof s!=="string"){return}const a=s.toLowerCase();if(a in Nn){return Nn[a]}if(Cn.has(a)){return a}};const Nn={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"};const serializeEncoding=s=>typeof s==="string"?`"${s}"`:String(s);var kn=f(24);const normalizeCwd=(s=getDefaultCwd())=>{const a=safeNormalizeFileUrl(s,'The "cwd" option');return Jt.resolve(a)};const getDefaultCwd=()=>{try{return q.cwd()}catch(s){s.message=`The current directory does not exist.\n${s.message}`;throw s}};const fixCwdError=(s,a)=>{if(a===getDefaultCwd()){return s}let u;try{u=(0,kn.statSync)(a)}catch(u){return`The "cwd" option is invalid: ${a}.\n${u.message}\n${s}`}if(!u.isDirectory()){return`The "cwd" option is not a directory: ${a}.\n${s}`}return s};const normalizeOptions=(s,a,u)=>{u.cwd=normalizeCwd(u.cwd);const[f,v,E]=handleNodeOption(s,a,u);const{command:I,args:D,options:N}=Zt._parse(f,v,E);const P=normalizeFdSpecificOptions(N);const B=addDefaultOptions(P);validateTimeout(B);validateEncoding(B);validateIpcInputOption(B);validateCancelSignal(B);validateGracefulCancel(B);B.shell=normalizeFileUrl(B.shell);B.env=getEnv(B);B.killSignal=normalizeKillSignal(B.killSignal);B.forceKillAfterDelay=normalizeForceKillAfterDelay(B.forceKillAfterDelay);B.lines=B.lines.map(((s,a)=>s&&!On.has(B.encoding)&&B.buffer[a]));if(q.platform==="win32"&&Jt.basename(I,".exe")==="cmd"){D.unshift("/q")}return{file:I,commandArguments:D,options:B}};const addDefaultOptions=({extendEnv:s=true,preferLocal:a=false,cwd:u,localDir:f=u,encoding:v="utf8",reject:E=true,cleanup:I=true,all:D=false,windowsHide:N=true,killSignal:P="SIGTERM",forceKillAfterDelay:B=true,gracefulCancel:_=false,ipcInput:U,ipc:q=U!==undefined||_,serialization:H="advanced",...Y})=>({...Y,extendEnv:s,preferLocal:a,cwd:u,localDirectory:f,encoding:v,reject:E,cleanup:I,all:D,windowsHide:N,killSignal:P,forceKillAfterDelay:B,gracefulCancel:_,ipcInput:U,ipc:q,serialization:H});const getEnv=({env:s,extendEnv:a,preferLocal:u,node:f,localDirectory:v,nodePath:E})=>{const I=a?{...q.env,...s}:s;if(u||f){return npmRunPathEnv({env:I,cwd:v,execPath:E,preferLocal:u,addExecPath:f})}return I};const concatenateShell=(s,a,u)=>u.shell&&a.length>0?[[s,...a].join(" "),[],u]:[s,a,u];function strip_final_newline_stripFinalNewline(s){if(typeof s==="string"){return stripFinalNewlineString(s)}if(!(ArrayBuffer.isView(s)&&s.BYTES_PER_ELEMENT===1)){throw new Error("Input must be a string or a Uint8Array")}return stripFinalNewlineBinary(s)}const stripFinalNewlineString=s=>s.at(-1)===jn?s.slice(0,s.at(-2)===Pn?-2:-1):s;const stripFinalNewlineBinary=s=>s.at(-1)===An?s.subarray(0,s.at(-2)===Bn?-2:-1):s;const jn="\n";const An=jn.codePointAt(0);const Pn="\r";const Bn=Pn.codePointAt(0);function isStream(s,{checkOpen:a=true}={}){return s!==null&&typeof s==="object"&&(s.writable||s.readable||!a||s.writable===undefined&&s.readable===undefined)&&typeof s.pipe==="function"}function isWritableStream(s,{checkOpen:a=true}={}){return isStream(s,{checkOpen:a})&&(s.writable||!a)&&typeof s.write==="function"&&typeof s.end==="function"&&typeof s.writable==="boolean"&&typeof s.writableObjectMode==="boolean"&&typeof s.destroy==="function"&&typeof s.destroyed==="boolean"}function isReadableStream(s,{checkOpen:a=true}={}){return isStream(s,{checkOpen:a})&&(s.readable||!a)&&typeof s.read==="function"&&typeof s.readable==="boolean"&&typeof s.readableObjectMode==="boolean"&&typeof s.destroy==="function"&&typeof s.destroyed==="boolean"}function isDuplexStream(s,a){return isWritableStream(s,a)&&isReadableStream(s,a)}function isTransformStream(s,a){return isDuplexStream(s,a)&&typeof s._transform==="function"}const _n=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class c{#n;#s;#a=!1;#e=void 0;constructor(s,a){this.#n=s,this.#s=a}next(){const e=()=>this.#o();return this.#e=this.#e?this.#e.then(e,e):e(),this.#e}return(s){const t=()=>this.#i(s);return this.#e?this.#e.then(t,t):t()}async#o(){if(this.#a)return{done:!0,value:void 0};let s;try{s=await this.#n.read()}catch(s){throw this.#e=void 0,this.#a=!0,this.#n.releaseLock(),s}return s.done&&(this.#e=void 0,this.#a=!0,this.#n.releaseLock()),s}async#i(s){if(this.#a)return{done:!0,value:s};if(this.#a=!0,!this.#s){const a=this.#n.cancel(s);return this.#n.releaseLock(),await a,{done:!0,value:s}}return this.#n.releaseLock(),{done:!0,value:s}}}const Rn=Symbol();function i(){return this[Rn].next()}Object.defineProperty(i,"name",{value:"next"});function o(s){return this[Rn].return(s)}Object.defineProperty(o,"name",{value:"return"});const Ln=Object.create(_n,{next:{enumerable:!0,configurable:!0,writable:!0,value:i},return:{enumerable:!0,configurable:!0,writable:!0,value:o}});function h({preventCancel:s=!1}={}){const a=this.getReader(),u=new c(a,s),f=Object.create(Ln);return f[Rn]=u,f}const getAsyncIterable=s=>{if(isReadableStream(s,{checkOpen:false})&&Fn.on!==undefined){return getStreamIterable(s)}if(typeof s?.[Symbol.asyncIterator]==="function"){return s}if(Un.call(s)==="[object ReadableStream]"){return h.call(s)}throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")};const{toString:Un}=Object.prototype;const getStreamIterable=async function*(s){const a=new AbortController;const u={};handleStreamEnd(s,a,u);try{for await(const[u]of Fn.on(s,"data",{signal:a.signal})){yield u}}catch(s){if(u.error!==undefined){throw u.error}else if(!a.signal.aborted){throw s}}finally{s.destroy()}};const handleStreamEnd=async(s,a,u)=>{try{await Fn.finished(s,{cleanup:true,readable:true,writable:false,error:false})}catch(s){u.error=s}finally{a.abort()}};const Fn={};const getStreamContents=async(s,{init:a,convertChunk:u,getSize:f,truncateChunk:v,addChunk:E,getFinalChunk:I,finalize:D},{maxBuffer:N=Number.POSITIVE_INFINITY}={})=>{const P=getAsyncIterable(s);const B=a();B.length=0;try{for await(const s of P){const a=getChunkType(s);const I=u[a](s,B);appendChunk({convertedChunk:I,state:B,getSize:f,truncateChunk:v,addChunk:E,maxBuffer:N})}appendFinalChunk({state:B,convertChunk:u,getSize:f,truncateChunk:v,addChunk:E,getFinalChunk:I,maxBuffer:N});return D(B)}catch(s){const a=typeof s==="object"&&s!==null?s:new Error(s);a.bufferedData=D(B);throw a}};const appendFinalChunk=({state:s,getSize:a,truncateChunk:u,addChunk:f,getFinalChunk:v,maxBuffer:E})=>{const I=v(s);if(I!==undefined){appendChunk({convertedChunk:I,state:s,getSize:a,truncateChunk:u,addChunk:f,maxBuffer:E})}};const appendChunk=({convertedChunk:s,state:a,getSize:u,truncateChunk:f,addChunk:v,maxBuffer:E})=>{const I=u(s);const D=a.length+I;if(D<=E){addNewChunk(s,a,v,D);return}const N=f(s,E-a.length);if(N!==undefined){addNewChunk(N,a,v,E)}throw new MaxBufferError};const addNewChunk=(s,a,u,f)=>{a.contents=u(s,a,f);a.length=f};const getChunkType=s=>{const a=typeof s;if(a==="string"){return"string"}if(a!=="object"||s===null){return"others"}if(globalThis.Buffer?.isBuffer(s)){return"buffer"}const u=Gn.call(s);if(u==="[object ArrayBuffer]"){return"arrayBuffer"}if(u==="[object DataView]"){return"dataView"}if(Number.isInteger(s.byteLength)&&Number.isInteger(s.byteOffset)&&Gn.call(s.buffer)==="[object ArrayBuffer]"){return"typedArray"}return"others"};const{toString:Gn}=Object.prototype;class MaxBufferError extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const handleMaxBuffer=({error:s,stream:a,readableObjectMode:u,lines:f,encoding:v,fdNumber:E})=>{if(!(s instanceof MaxBufferError)){throw s}if(E==="all"){return s}const I=getMaxBufferUnit(u,f,v);s.maxBufferInfo={fdNumber:E,unit:I};a.destroy();throw s};const getMaxBufferUnit=(s,a,u)=>{if(s){return"objects"}if(a){return"lines"}if(u==="buffer"){return"bytes"}return"characters"};const checkIpcMaxBuffer=(s,a,u)=>{if(a.length!==u){return}const f=new MaxBufferError;f.maxBufferInfo={fdNumber:"ipc"};throw f};const getMaxBufferMessage=(s,a)=>{const{streamName:u,threshold:f,unit:v}=getMaxBufferInfo(s,a);return`Command's ${u} was larger than ${f} ${v}`};const getMaxBufferInfo=(s,a)=>{if(s?.maxBufferInfo===undefined){return{streamName:"output",threshold:a[1],unit:"bytes"}}const{maxBufferInfo:{fdNumber:u,unit:f}}=s;delete s.maxBufferInfo;const v=getFdSpecificValue(a,u);if(u==="ipc"){return{streamName:"IPC output",threshold:v,unit:"messages"}}return{streamName:getStreamName(u),threshold:v,unit:f}};const isMaxBufferSync=(s,a,u)=>s?.code==="ENOBUFS"&&a!==null&&a.some((s=>s!==null&&s.length>getMaxBufferSync(u)));const truncateMaxBufferSync=(s,a,u)=>{if(!a){return s}const f=getMaxBufferSync(u);return s.length>f?s.slice(0,f):s};const getMaxBufferSync=([,s])=>s;const createMessages=({stdio:s,all:a,ipcOutput:u,originalError:f,signal:v,signalDescription:E,exitCode:I,escapedCommand:D,timedOut:N,isCanceled:P,isGracefullyCanceled:B,isMaxBuffer:_,isForcefullyTerminated:U,forceKillAfterDelay:q,killSignal:H,maxBuffer:Y,timeout:X,cwd:ee})=>{const te=f?.code;const ne=getErrorPrefix({originalError:f,timedOut:N,timeout:X,isMaxBuffer:_,maxBuffer:Y,errorCode:te,signal:v,signalDescription:E,exitCode:I,isCanceled:P,isGracefullyCanceled:B,isForcefullyTerminated:U,forceKillAfterDelay:q,killSignal:H});const se=getOriginalMessage(f,ee);const oe=se===undefined?"":`\n${se}`;const ce=`${ne}: ${D}${oe}`;const le=a===undefined?[s[2],s[1]]:[a];const ue=[ce,...le,...s.slice(3),u.map((s=>serializeIpcMessage(s))).join("\n")].map((s=>escapeLines(strip_final_newline_stripFinalNewline(serializeMessagePart(s))))).filter(Boolean).join("\n\n");return{originalMessage:se,shortMessage:ce,message:ue}};const getErrorPrefix=({originalError:s,timedOut:a,timeout:u,isMaxBuffer:f,maxBuffer:v,errorCode:E,signal:I,signalDescription:D,exitCode:N,isCanceled:P,isGracefullyCanceled:B,isForcefullyTerminated:_,forceKillAfterDelay:U,killSignal:q})=>{const H=getForcefulSuffix(_,U);if(a){return`Command timed out after ${u} milliseconds${H}`}if(B){if(I===undefined){return`Command was gracefully canceled with exit code ${N}`}return _?`Command was gracefully canceled${H}`:`Command was gracefully canceled with ${I} (${D})`}if(P){return`Command was canceled${H}`}if(f){return`${getMaxBufferMessage(s,v)}${H}`}if(E!==undefined){return`Command failed with ${E}${H}`}if(_){return`Command was killed with ${q} (${getSignalDescription(q)})${H}`}if(I!==undefined){return`Command was killed with ${I} (${D})`}if(N!==undefined){return`Command failed with exit code ${N}`}return"Command failed"};const getForcefulSuffix=(s,a)=>s?` and was forcefully terminated after ${a} milliseconds`:"";const getOriginalMessage=(s,a)=>{if(s instanceof DiscardedError){return}const u=isExecaError(s)?s.originalMessage:String(s?.message??s);const f=escapeLines(fixCwdError(u,a));return f===""?undefined:f};const serializeIpcMessage=s=>typeof s==="string"?s:(0,U.inspect)(s);const serializeMessagePart=s=>Array.isArray(s)?s.map((s=>strip_final_newline_stripFinalNewline(serializeMessageItem(s)))).filter(Boolean).join("\n"):serializeMessageItem(s);const serializeMessageItem=s=>{if(typeof s==="string"){return s}if(isUint8Array(s)){return uint8ArrayToString(s)}return""};const makeSuccessResult=({command:s,escapedCommand:a,stdio:u,all:f,ipcOutput:v,options:{cwd:E},startTime:I})=>omitUndefinedProperties({command:s,escapedCommand:a,cwd:E,durationMs:getDurationMs(I),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:u[1],stderr:u[2],all:f,stdio:u,ipcOutput:v,pipedFrom:[]});const makeEarlyError=({error:s,command:a,escapedCommand:u,fileDescriptors:f,options:v,startTime:E,isSync:I})=>makeError({error:s,command:a,escapedCommand:u,startTime:E,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:f.length}),ipcOutput:[],options:v,isSync:I});const makeError=({error:s,command:a,escapedCommand:u,startTime:f,timedOut:v,isCanceled:E,isGracefullyCanceled:I,isMaxBuffer:D,isForcefullyTerminated:N,exitCode:P,signal:B,stdio:_,all:U,ipcOutput:q,options:{timeoutDuration:H,timeout:Y=H,forceKillAfterDelay:X,killSignal:ee,cwd:te,maxBuffer:ne},isSync:se})=>{const{exitCode:oe,signal:ce,signalDescription:le}=normalizeExitPayload(P,B);const{originalMessage:ue,shortMessage:de,message:pe}=createMessages({stdio:_,all:U,ipcOutput:q,originalError:s,signal:ce,signalDescription:le,exitCode:oe,escapedCommand:u,timedOut:v,isCanceled:E,isGracefullyCanceled:I,isMaxBuffer:D,isForcefullyTerminated:N,forceKillAfterDelay:X,killSignal:ee,maxBuffer:ne,timeout:Y,cwd:te});const me=getFinalError(s,pe,se);Object.assign(me,getErrorProperties({error:me,command:a,escapedCommand:u,startTime:f,timedOut:v,isCanceled:E,isGracefullyCanceled:I,isMaxBuffer:D,isForcefullyTerminated:N,exitCode:oe,signal:ce,signalDescription:le,stdio:_,all:U,ipcOutput:q,cwd:te,originalMessage:ue,shortMessage:de}));return me};const getErrorProperties=({error:s,command:a,escapedCommand:u,startTime:f,timedOut:v,isCanceled:E,isGracefullyCanceled:I,isMaxBuffer:D,isForcefullyTerminated:N,exitCode:P,signal:B,signalDescription:_,stdio:U,all:q,ipcOutput:H,cwd:Y,originalMessage:X,shortMessage:ee})=>omitUndefinedProperties({shortMessage:ee,originalMessage:X,command:a,escapedCommand:u,cwd:Y,durationMs:getDurationMs(f),failed:true,timedOut:v,isCanceled:E,isGracefullyCanceled:I,isTerminated:B!==undefined,isMaxBuffer:D,isForcefullyTerminated:N,exitCode:P,signal:B,signalDescription:_,code:s.cause?.code,stdout:U[1],stderr:U[2],all:q,stdio:U,ipcOutput:H,pipedFrom:[]});const omitUndefinedProperties=s=>Object.fromEntries(Object.entries(s).filter((([,s])=>s!==undefined)));const normalizeExitPayload=(s,a)=>{const u=s===null?undefined:s;const f=a===null?undefined:a;const v=f===undefined?undefined:getSignalDescription(a);return{exitCode:u,signal:f,signalDescription:v}};const toZeroIfInfinity=s=>Number.isFinite(s)?s:0;function parseNumber(s){return{days:Math.trunc(s/864e5),hours:Math.trunc(s/36e5%24),minutes:Math.trunc(s/6e4%60),seconds:Math.trunc(s/1e3%60),milliseconds:Math.trunc(s%1e3),microseconds:Math.trunc(toZeroIfInfinity(s*1e3)%1e3),nanoseconds:Math.trunc(toZeroIfInfinity(s*1e6)%1e3)}}function parseBigint(s){return{days:s/86400000n,hours:s/3600000n%24n,minutes:s/60000n%60n,seconds:s/1000n%60n,milliseconds:s%1000n,microseconds:0n,nanoseconds:0n}}function parseMilliseconds(s){switch(typeof s){case"number":{if(Number.isFinite(s)){return parseNumber(s)}break}case"bigint":{return parseBigint(s)}}throw new TypeError("Expected a finite number or bigint")}const isZero=s=>s===0||s===0n;const pluralize=(s,a)=>a===1||a===1n?s:`${s}s`;const Vn=1e-7;const Wn=24n*60n*60n*1000n;function prettyMilliseconds(s,a){const u=typeof s==="bigint";if(!u&&!Number.isFinite(s)){throw new TypeError("Expected a finite number or bigint")}a={...a};const f=s<0?"-":"";s=s<0?-s:s;if(a.colonNotation){a.compact=false;a.formatSubMilliseconds=false;a.separateMilliseconds=false;a.verbose=false}if(a.compact){a.unitCount=1;a.secondsDecimalDigits=0;a.millisecondsDecimalDigits=0}let v=[];const floorDecimals=(s,a)=>{const u=Math.floor(s*10**a+Vn);const f=Math.round(u)/10**a;return f.toFixed(a)};const add=(s,u,f,E)=>{if((v.length===0||!a.colonNotation)&&isZero(s)&&!(a.colonNotation&&f==="m")){return}E??=String(s);if(a.colonNotation){const s=E.includes(".")?E.split(".")[0].length:E.length;const a=v.length>0?2:1;E="0".repeat(Math.max(0,a-s))+E}else{E+=a.verbose?" "+pluralize(u,s):f}v.push(E)};const E=parseMilliseconds(s);const I=BigInt(E.days);if(a.hideYearAndDays){add(BigInt(I)*24n+BigInt(E.hours),"hour","h")}else{if(a.hideYear){add(I,"day","d")}else{add(I/365n,"year","y");add(I%365n,"day","d")}add(Number(E.hours),"hour","h")}add(Number(E.minutes),"minute","m");if(!a.hideSeconds){if(a.separateMilliseconds||a.formatSubMilliseconds||!a.colonNotation&&s<1e3&&!a.subSecondsAsDecimals){const s=Number(E.seconds);const u=Number(E.milliseconds);const f=Number(E.microseconds);const v=Number(E.nanoseconds);add(s,"second","s");if(a.formatSubMilliseconds){add(u,"millisecond","ms");add(f,"microsecond","µs");add(v,"nanosecond","ns")}else{const s=u+f/1e3+v/1e6;const E=typeof a.millisecondsDecimalDigits==="number"?a.millisecondsDecimalDigits:0;const I=s>=1?Math.round(s):Math.ceil(s);const D=E?s.toFixed(E):I;add(Number.parseFloat(D),"millisecond","ms",D)}}else{const f=(u?Number(s%Wn):s)/1e3%60;const v=typeof a.secondsDecimalDigits==="number"?a.secondsDecimalDigits:1;const E=floorDecimals(f,v);const I=a.keepDecimalsOnWholeSeconds?E:E.replace(/\.0+$/,"");add(Number.parseFloat(I),"second","s",I)}}if(v.length===0){return f+"0"+(a.verbose?" milliseconds":"ms")}const D=a.colonNotation?":":" ";if(typeof a.unitCount==="number"){v=v.slice(0,Math.max(a.unitCount,1))}return f+v.join(D)}const logError=(s,a)=>{if(s.failed){verboseLog({type:"error",verboseMessage:s.shortMessage,verboseInfo:a,result:s})}};const logResult=(s,a)=>{if(!isVerbose(a)){return}logError(s,a);logDuration(s,a)};const logDuration=(s,a)=>{const u=`(done in ${prettyMilliseconds(s.durationMs)})`;verboseLog({type:"duration",verboseMessage:u,verboseInfo:a,result:s})};const handleResult=(s,a,{reject:u})=>{logResult(s,a);if(s.failed&&u){throw s}return s};const getStdioItemType=(s,a)=>{if(isAsyncGenerator(s)){return"asyncGenerator"}if(isSyncGenerator(s)){return"generator"}if(isUrl(s)){return"fileUrl"}if(isFilePathObject(s)){return"filePath"}if(isWebStream(s)){return"webStream"}if(isStream(s,{checkOpen:false})){return"native"}if(isUint8Array(s)){return"uint8Array"}if(isAsyncIterableObject(s)){return"asyncIterable"}if(isIterableObject(s)){return"iterable"}if(type_isTransformStream(s)){return getTransformStreamType({transform:s},a)}if(isTransformOptions(s)){return getTransformObjectType(s,a)}return"native"};const getTransformObjectType=(s,a)=>{if(isDuplexStream(s.transform,{checkOpen:false})){return getDuplexType(s,a)}if(type_isTransformStream(s.transform)){return getTransformStreamType(s,a)}return getGeneratorObjectType(s,a)};const getDuplexType=(s,a)=>{validateNonGeneratorType(s,a,"Duplex stream");return"duplex"};const getTransformStreamType=(s,a)=>{validateNonGeneratorType(s,a,"web TransformStream");return"webTransform"};const validateNonGeneratorType=({final:s,binary:a,objectMode:u},f,v)=>{checkUndefinedOption(s,`${f}.final`,v);checkUndefinedOption(a,`${f}.binary`,v);checkBooleanOption(u,`${f}.objectMode`)};const checkUndefinedOption=(s,a,u)=>{if(s!==undefined){throw new TypeError(`The \`${a}\` option can only be defined when using a generator, not a ${u}.`)}};const getGeneratorObjectType=({transform:s,final:a,binary:u,objectMode:f},v)=>{if(s!==undefined&&!isGenerator(s)){throw new TypeError(`The \`${v}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`)}if(isDuplexStream(a,{checkOpen:false})){throw new TypeError(`The \`${v}.final\` option must not be a Duplex stream.`)}if(type_isTransformStream(a)){throw new TypeError(`The \`${v}.final\` option must not be a web TransformStream.`)}if(a!==undefined&&!isGenerator(a)){throw new TypeError(`The \`${v}.final\` option must be a generator.`)}checkBooleanOption(u,`${v}.binary`);checkBooleanOption(f,`${v}.objectMode`);return isAsyncGenerator(s)||isAsyncGenerator(a)?"asyncGenerator":"generator"};const checkBooleanOption=(s,a)=>{if(s!==undefined&&typeof s!=="boolean"){throw new TypeError(`The \`${a}\` option must use a boolean.`)}};const isGenerator=s=>isAsyncGenerator(s)||isSyncGenerator(s);const isAsyncGenerator=s=>Object.prototype.toString.call(s)==="[object AsyncGeneratorFunction]";const isSyncGenerator=s=>Object.prototype.toString.call(s)==="[object GeneratorFunction]";const isTransformOptions=s=>isPlainObject(s)&&(s.transform!==undefined||s.final!==undefined);const isUrl=s=>Object.prototype.toString.call(s)==="[object URL]";const isRegularUrl=s=>isUrl(s)&&s.protocol!=="file:";const isFilePathObject=s=>isPlainObject(s)&&Object.keys(s).length>0&&Object.keys(s).every((s=>zn.has(s)))&&isFilePathString(s.file);const zn=new Set(["file","append"]);const isFilePathString=s=>typeof s==="string";const isUnknownStdioString=(s,a)=>s==="native"&&typeof a==="string"&&!qn.has(a);const qn=new Set(["ipc","ignore","inherit","overlapped","pipe"]);const type_isReadableStream=s=>Object.prototype.toString.call(s)==="[object ReadableStream]";const type_isWritableStream=s=>Object.prototype.toString.call(s)==="[object WritableStream]";const isWebStream=s=>type_isReadableStream(s)||type_isWritableStream(s);const type_isTransformStream=s=>type_isReadableStream(s?.readable)&&type_isWritableStream(s?.writable);const isAsyncIterableObject=s=>isObject(s)&&typeof s[Symbol.asyncIterator]==="function";const isIterableObject=s=>isObject(s)&&typeof s[Symbol.iterator]==="function";const isObject=s=>typeof s==="object"&&s!==null;const Kn=new Set(["generator","asyncGenerator","duplex","webTransform"]);const Hn=new Set(["fileUrl","filePath","fileNumber"]);const Yn=new Set(["fileUrl","filePath"]);const Jn=new Set([...Yn,"webStream","nodeStream"]);const Zn=new Set(["webTransform","duplex"]);const Xn={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"};const getTransformObjectModes=(s,a,u,f)=>f==="output"?getOutputObjectModes(s,a,u):getInputObjectModes(s,a,u);const getOutputObjectModes=(s,a,u)=>{const f=a!==0&&u[a-1].value.readableObjectMode;const v=s??f;return{writableObjectMode:f,readableObjectMode:v}};const getInputObjectModes=(s,a,u)=>{const f=a===0?s===true:u[a-1].value.readableObjectMode;const v=a!==u.length-1&&(s??f);return{writableObjectMode:f,readableObjectMode:v}};const getFdObjectMode=(s,a)=>{const u=s.findLast((({type:s})=>Kn.has(s)));if(u===undefined){return false}return a==="input"?u.value.writableObjectMode:u.value.readableObjectMode};const normalizeTransforms=(s,a,u,f)=>[...s.filter((({type:s})=>!Kn.has(s))),...getTransforms(s,a,u,f)];const getTransforms=(s,a,u,{encoding:f})=>{const v=s.filter((({type:s})=>Kn.has(s)));const E=Array.from({length:v.length});for(const[s,I]of Object.entries(v)){E[s]=normalizeTransform({stdioItem:I,index:Number(s),newTransforms:E,optionName:a,direction:u,encoding:f})}return sortTransforms(E,u)};const normalizeTransform=({stdioItem:s,stdioItem:{type:a},index:u,newTransforms:f,optionName:v,direction:E,encoding:I})=>{if(a==="duplex"){return normalizeDuplex({stdioItem:s,optionName:v})}if(a==="webTransform"){return normalizeTransformStream({stdioItem:s,index:u,newTransforms:f,direction:E})}return normalizeGenerator({stdioItem:s,index:u,newTransforms:f,direction:E,encoding:I})};const normalizeDuplex=({stdioItem:s,stdioItem:{value:{transform:a,transform:{writableObjectMode:u,readableObjectMode:f},objectMode:v=f}},optionName:E})=>{if(v&&!f){throw new TypeError(`The \`${E}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`)}if(!v&&f){throw new TypeError(`The \`${E}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`)}return{...s,value:{transform:a,writableObjectMode:u,readableObjectMode:f}}};const normalizeTransformStream=({stdioItem:s,stdioItem:{value:a},index:u,newTransforms:f,direction:v})=>{const{transform:E,objectMode:I}=isPlainObject(a)?a:{transform:a};const{writableObjectMode:D,readableObjectMode:N}=getTransformObjectModes(I,u,f,v);return{...s,value:{transform:E,writableObjectMode:D,readableObjectMode:N}}};const normalizeGenerator=({stdioItem:s,stdioItem:{value:a},index:u,newTransforms:f,direction:v,encoding:E})=>{const{transform:I,final:D,binary:N=false,preserveNewlines:P=false,objectMode:B}=isPlainObject(a)?a:{transform:a};const _=N||On.has(E);const{writableObjectMode:U,readableObjectMode:q}=getTransformObjectModes(B,u,f,v);return{...s,value:{transform:I,final:D,binary:_,preserveNewlines:P,writableObjectMode:U,readableObjectMode:q}}};const sortTransforms=(s,a)=>a==="input"?s.reverse():s;const getStreamDirection=(s,a,u)=>{const f=s.map((s=>getStdioItemDirection(s,a)));if(f.includes("input")&&f.includes("output")){throw new TypeError(`The \`${u}\` option must not be an array of both readable and writable values.`)}return f.find(Boolean)??ts};const getStdioItemDirection=({type:s,value:a},u)=>Qn[u]??es[s](a);const Qn=["input","output","output"];const anyDirection=()=>undefined;const alwaysInput=()=>"input";const es={generator:anyDirection,asyncGenerator:anyDirection,fileUrl:anyDirection,filePath:anyDirection,iterable:alwaysInput,asyncIterable:alwaysInput,uint8Array:alwaysInput,webStream:s=>type_isWritableStream(s)?"output":"input",nodeStream(s){if(!isReadableStream(s,{checkOpen:false})){return"output"}return isWritableStream(s,{checkOpen:false})?undefined:"input"},webTransform:anyDirection,duplex:anyDirection,native(s){const a=getStandardStreamDirection(s);if(a!==undefined){return a}if(isStream(s,{checkOpen:false})){return es.nodeStream(s)}}};const getStandardStreamDirection=s=>{if([0,q.stdin].includes(s)){return"input"}if([1,2,q.stdout,q.stderr].includes(s)){return"output"}};const ts="output";const normalizeIpcStdioArray=(s,a)=>a&&!s.includes("ipc")?[...s,"ipc"]:s;const normalizeStdioOption=({stdio:s,ipc:a,buffer:u,...f},v,E)=>{const I=getStdioArray(s,f).map(((s,a)=>stdio_option_addDefaultValue(s,a)));return E?normalizeStdioSync(I,u,v):normalizeIpcStdioArray(I,a)};const getStdioArray=(s,a)=>{if(s===undefined){return Y.map((s=>a[s]))}if(hasAlias(a)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Y.map((s=>`\`${s}\``)).join(", ")}`)}if(typeof s==="string"){return[s,s,s]}if(!Array.isArray(s)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``)}const u=Math.max(s.length,Y.length);return Array.from({length:u},((a,u)=>s[u]))};const hasAlias=s=>Y.some((a=>s[a]!==undefined));const stdio_option_addDefaultValue=(s,a)=>{if(Array.isArray(s)){return s.map((s=>stdio_option_addDefaultValue(s,a)))}if(s===null||s===undefined){return a>=Y.length?"ignore":"pipe"}return s};const normalizeStdioSync=(s,a,u)=>s.map(((s,f)=>!a[f]&&f!==0&&!isFullVerbose(u,f)&&isOutputPipeOnly(s)?"ignore":s));const isOutputPipeOnly=s=>s==="pipe"||Array.isArray(s)&&s.every((s=>s==="pipe"));const handleNativeStream=({stdioItem:s,stdioItem:{type:a},isStdioArray:u,fdNumber:f,direction:v,isSync:E})=>{if(!u||a!=="native"){return s}return E?handleNativeStreamSync({stdioItem:s,fdNumber:f,direction:v}):handleNativeStreamAsync({stdioItem:s,fdNumber:f})};const handleNativeStreamSync=({stdioItem:s,stdioItem:{value:a,optionName:u},fdNumber:f,direction:v})=>{const E=getTargetFd({value:a,optionName:u,fdNumber:f,direction:v});if(E!==undefined){return E}if(isStream(a,{checkOpen:false})){throw new TypeError(`The \`${u}: Stream\` option cannot both be an array and include a stream with synchronous methods.`)}return s};const getTargetFd=({value:s,optionName:a,fdNumber:u,direction:f})=>{const v=getTargetFdNumber(s,u);if(v===undefined){return}if(f==="output"){return{type:"fileNumber",value:v,optionName:a}}if(Se.isatty(v)){throw new TypeError(`The \`${a}: ${serializeOptionValue(s)}\` option is invalid: it cannot be a TTY with synchronous methods.`)}return{type:"uint8Array",value:bufferToUint8Array((0,kn.readFileSync)(v)),optionName:a}};const getTargetFdNumber=(s,a)=>{if(s==="inherit"){return a}if(typeof s==="number"){return s}const u=H.indexOf(s);if(u!==-1){return u}};const handleNativeStreamAsync=({stdioItem:s,stdioItem:{value:a,optionName:u},fdNumber:f})=>{if(a==="inherit"){return{type:"nodeStream",value:getStandardStream(f,a,u),optionName:u}}if(typeof a==="number"){return{type:"nodeStream",value:getStandardStream(a,a,u),optionName:u}}if(isStream(a,{checkOpen:false})){return{type:"nodeStream",value:a,optionName:u}}return s};const getStandardStream=(s,a,u)=>{const f=H[s];if(f===undefined){throw new TypeError(`The \`${u}: ${a}\` option is invalid: no such standard stream.`)}return f};const handleInputOptions=({input:s,inputFile:a},u)=>u===0?[...handleInputOption(s),...handleInputFileOption(a)]:[];const handleInputOption=s=>s===undefined?[]:[{type:getInputType(s),value:s,optionName:"input"}];const getInputType=s=>{if(isReadableStream(s,{checkOpen:false})){return"nodeStream"}if(typeof s==="string"){return"string"}if(isUint8Array(s)){return"uint8Array"}throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")};const handleInputFileOption=s=>s===undefined?[]:[{...getInputFileType(s),optionName:"inputFile"}];const getInputFileType=s=>{if(isUrl(s)){return{type:"fileUrl",value:s}}if(isFilePathString(s)){return{type:"filePath",value:{file:s}}}throw new Error("The `inputFile` option must be a file path string or a file URL.")};const filterDuplicates=s=>s.filter(((a,u)=>s.every(((s,f)=>a.value!==s.value||u>=f||a.type==="generator"||a.type==="asyncGenerator"))));const getDuplicateStream=({stdioItem:{type:s,value:a,optionName:u},direction:f,fileDescriptors:v,isSync:E})=>{const I=getOtherStdioItems(v,s);if(I.length===0){return}if(E){validateDuplicateStreamSync({otherStdioItems:I,type:s,value:a,optionName:u,direction:f});return}if(Jn.has(s)){return getDuplicateStreamInstance({otherStdioItems:I,type:s,value:a,optionName:u,direction:f})}if(Zn.has(s)){validateDuplicateTransform({otherStdioItems:I,type:s,value:a,optionName:u})}};const getOtherStdioItems=(s,a)=>s.flatMap((({direction:s,stdioItems:u})=>u.filter((s=>s.type===a)).map((a=>({...a,direction:s})))));const validateDuplicateStreamSync=({otherStdioItems:s,type:a,value:u,optionName:f,direction:v})=>{if(Yn.has(a)){getDuplicateStreamInstance({otherStdioItems:s,type:a,value:u,optionName:f,direction:v})}};const getDuplicateStreamInstance=({otherStdioItems:s,type:a,value:u,optionName:f,direction:v})=>{const E=s.filter((s=>hasSameValue(s,u)));if(E.length===0){return}const I=E.find((s=>s.direction!==v));throwOnDuplicateStream(I,f,a);return v==="output"?E[0].stream:undefined};const hasSameValue=({type:s,value:a},u)=>{if(s==="filePath"){return a.file===u.file}if(s==="fileUrl"){return a.href===u.href}return a===u};const validateDuplicateTransform=({otherStdioItems:s,type:a,value:u,optionName:f})=>{const v=s.find((({value:{transform:s}})=>s===u.transform));throwOnDuplicateStream(v,f,a)};const throwOnDuplicateStream=(s,a,u)=>{if(s!==undefined){throw new TypeError(`The \`${s.optionName}\` and \`${a}\` options must not target ${Xn[u]} that is the same.`)}};const handleStdio=(s,a,u,f)=>{const v=normalizeStdioOption(a,u,f);const E=v.map(((s,u)=>getFileDescriptor({stdioOption:s,fdNumber:u,options:a,isSync:f})));const I=getFinalFileDescriptors({initialFileDescriptors:E,addProperties:s,options:a,isSync:f});a.stdio=I.map((({stdioItems:s})=>forwardStdio(s)));return I};const getFileDescriptor=({stdioOption:s,fdNumber:a,options:u,isSync:f})=>{const v=getStreamName(a);const{stdioItems:E,isStdioArray:I}=initializeStdioItems({stdioOption:s,fdNumber:a,options:u,optionName:v});const D=getStreamDirection(E,a,v);const N=E.map((s=>handleNativeStream({stdioItem:s,isStdioArray:I,fdNumber:a,direction:D,isSync:f})));const P=normalizeTransforms(N,v,D,u);const B=getFdObjectMode(P,D);validateFileObjectMode(P,B);return{direction:D,objectMode:B,stdioItems:P}};const initializeStdioItems=({stdioOption:s,fdNumber:a,options:u,optionName:f})=>{const v=Array.isArray(s)?s:[s];const E=[...v.map((s=>initializeStdioItem(s,f))),...handleInputOptions(u,a)];const I=filterDuplicates(E);const D=I.length>1;validateStdioArray(I,D,f);validateStreams(I);return{stdioItems:I,isStdioArray:D}};const initializeStdioItem=(s,a)=>({type:getStdioItemType(s,a),value:s,optionName:a});const validateStdioArray=(s,a,u)=>{if(s.length===0){throw new TypeError(`The \`${u}\` option must not be an empty array.`)}if(!a){return}for(const{value:a,optionName:u}of s){if(ns.has(a)){throw new Error(`The \`${u}\` option must not include \`${a}\`.`)}}};const ns=new Set(["ignore","ipc"]);const validateStreams=s=>{for(const a of s){validateFileStdio(a)}};const validateFileStdio=({type:s,value:a,optionName:u})=>{if(isRegularUrl(a)){throw new TypeError(`The \`${u}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`)}if(isUnknownStdioString(s,a)){throw new TypeError(`The \`${u}: { file: '...' }\` option must be used instead of \`${u}: '...'\`.`)}};const validateFileObjectMode=(s,a)=>{if(!a){return}const u=s.find((({type:s})=>Hn.has(s)));if(u!==undefined){throw new TypeError(`The \`${u.optionName}\` option cannot use both files and transforms in objectMode.`)}};const getFinalFileDescriptors=({initialFileDescriptors:s,addProperties:a,options:u,isSync:f})=>{const v=[];try{for(const E of s){v.push(getFinalFileDescriptor({fileDescriptor:E,fileDescriptors:v,addProperties:a,options:u,isSync:f}))}return v}catch(s){cleanupCustomStreams(v);throw s}};const getFinalFileDescriptor=({fileDescriptor:{direction:s,objectMode:a,stdioItems:u},fileDescriptors:f,addProperties:v,options:E,isSync:I})=>{const D=u.map((a=>addStreamProperties({stdioItem:a,addProperties:v,direction:s,options:E,fileDescriptors:f,isSync:I})));return{direction:s,objectMode:a,stdioItems:D}};const addStreamProperties=({stdioItem:s,addProperties:a,direction:u,options:f,fileDescriptors:v,isSync:E})=>{const I=getDuplicateStream({stdioItem:s,direction:u,fileDescriptors:v,isSync:E});if(I!==undefined){return{...s,stream:I}}return{...s,...a[u][s.type](s,f)}};const cleanupCustomStreams=s=>{for(const{stdioItems:a}of s){for(const{stream:s}of a){if(s!==undefined&&!isStandardStream(s)){s.destroy()}}}};const forwardStdio=s=>{if(s.length>1){return s.some((({value:s})=>s==="overlapped"))?"overlapped":"pipe"}const[{type:a,value:u}]=s;return a==="native"?u:"pipe"};const handleStdioSync=(s,a)=>handleStdio(rs,s,a,true);const forbiddenIfSync=({type:s,optionName:a})=>{throwInvalidSyncValue(a,Xn[s])};const forbiddenNativeIfSync=({optionName:s,value:a})=>{if(a==="ipc"||a==="overlapped"){throwInvalidSyncValue(s,`"${a}"`)}return{}};const throwInvalidSyncValue=(s,a)=>{throw new TypeError(`The \`${s}\` option cannot be ${a} with synchronous methods.`)};const ss={generator(){},asyncGenerator:forbiddenIfSync,webStream:forbiddenIfSync,nodeStream:forbiddenIfSync,webTransform:forbiddenIfSync,duplex:forbiddenIfSync,asyncIterable:forbiddenIfSync,native:forbiddenNativeIfSync};const rs={input:{...ss,fileUrl:({value:s})=>({contents:[bufferToUint8Array((0,kn.readFileSync)(s))]}),filePath:({value:{file:s}})=>({contents:[bufferToUint8Array((0,kn.readFileSync)(s))]}),fileNumber:forbiddenIfSync,iterable:({value:s})=>({contents:[...s]}),string:({value:s})=>({contents:[s]}),uint8Array:({value:s})=>({contents:[s]})},output:{...ss,fileUrl:({value:s})=>({path:s}),filePath:({value:{file:s,append:a}})=>({path:s,append:a}),fileNumber:({value:s})=>({path:s}),iterable:forbiddenIfSync,string:forbiddenIfSync,uint8Array:forbiddenIfSync}};const stripNewline=(s,{stripFinalNewline:a},u)=>getStripFinalNewline(a,u)&&s!==undefined&&!Array.isArray(s)?strip_final_newline_stripFinalNewline(s):s;const getStripFinalNewline=(s,a)=>a==="all"?s[1]||s[2]:s[a];const os=s(import.meta.url)("node:stream");const getSplitLinesGenerator=(s,a,u,f)=>s||u?undefined:initializeSplitLines(a,f);const splitLinesSync=(s,a,u)=>u?s.flatMap((s=>splitLinesItemSync(s,a))):splitLinesItemSync(s,a);const splitLinesItemSync=(s,a)=>{const{transform:u,final:f}=initializeSplitLines(a,{});return[...u(s),...f()]};const initializeSplitLines=(s,a)=>{a.previousChunks="";return{transform:splitGenerator.bind(undefined,a,s),final:linesFinal.bind(undefined,a)}};const splitGenerator=function*(s,a,u){if(typeof u!=="string"){yield u;return}let{previousChunks:f}=s;let v=-1;for(let E=0;E<u.length;E+=1){if(u[E]==="\n"){const I=getNewlineLength(u,E,a,s);let D=u.slice(v+1,E+1-I);if(f.length>0){D=concatString(f,D);f=""}yield D;v=E}}if(v!==u.length-1){f=concatString(f,u.slice(v+1))}s.previousChunks=f};const getNewlineLength=(s,a,u,f)=>{if(u){return 0}f.isWindowsNewline=a!==0&&s[a-1]==="\r";return f.isWindowsNewline?2:1};const linesFinal=function*({previousChunks:s}){if(s.length>0){yield s}};const getAppendNewlineGenerator=({binary:s,preserveNewlines:a,readableObjectMode:u,state:f})=>s||a||u?undefined:{transform:appendNewlineGenerator.bind(undefined,f)};const appendNewlineGenerator=function*({isWindowsNewline:s=false},a){const{unixNewline:u,windowsNewline:f,LF:v,concatBytes:E}=typeof a==="string"?is:as;if(a.at(-1)===v){yield a;return}const I=s?f:u;yield E(a,I)};const concatString=(s,a)=>`${s}${a}`;const is={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:concatString};const concatUint8Array=(s,a)=>{const u=new Uint8Array(s.length+a.length);u.set(s,0);u.set(a,s.length);return u};const as={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:concatUint8Array};const cs=s(import.meta.url)("node:buffer");const getValidateTransformInput=(s,a)=>s?undefined:validateStringTransformInput.bind(undefined,a);const validateStringTransformInput=function*(s,a){if(typeof a!=="string"&&!isUint8Array(a)&&!cs.Buffer.isBuffer(a)){throw new TypeError(`The \`${s}\` option's transform must use "objectMode: true" to receive as input: ${typeof a}.`)}yield a};const getValidateTransformReturn=(s,a)=>s?validateObjectTransformReturn.bind(undefined,a):validateStringTransformReturn.bind(undefined,a);const validateObjectTransformReturn=function*(s,a){validateEmptyReturn(s,a);yield a};const validateStringTransformReturn=function*(s,a){validateEmptyReturn(s,a);if(typeof a!=="string"&&!isUint8Array(a)){throw new TypeError(`The \`${s}\` option's function must yield a string or an Uint8Array, not ${typeof a}.`)}yield a};const validateEmptyReturn=(s,a)=>{if(a===null||a===undefined){throw new TypeError(`The \`${s}\` option's function must not call \`yield ${a}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)}};const getEncodingTransformGenerator=(s,a,u)=>{if(u){return}if(s){return{transform:encodingUint8ArrayGenerator.bind(undefined,new TextEncoder)}}const f=new I.StringDecoder(a);return{transform:encodingStringGenerator.bind(undefined,f),final:encodingStringFinal.bind(undefined,f)}};const encodingUint8ArrayGenerator=function*(s,a){if(cs.Buffer.isBuffer(a)){yield bufferToUint8Array(a)}else if(typeof a==="string"){yield s.encode(a)}else{yield a}};const encodingStringGenerator=function*(s,a){yield isUint8Array(a)?s.write(a):a};const encodingStringFinal=function*(s){const a=s.end();if(a!==""){yield a}};const ls=(0,U.callbackify)((async(s,a,u,f)=>{a.currentIterable=s(...u);try{for await(const s of a.currentIterable){f.push(s)}}finally{delete a.currentIterable}}));const transformChunk=async function*(s,a,u){if(u===a.length){yield s;return}const{transform:f=identityGenerator}=a[u];for await(const v of f(s)){yield*transformChunk(v,a,u+1)}};const finalChunks=async function*(s){for(const[a,{final:u}]of Object.entries(s)){yield*generatorFinalChunks(u,Number(a),s)}};const generatorFinalChunks=async function*(s,a,u){if(s===undefined){return}for await(const f of s()){yield*transformChunk(f,u,a+1)}};const us=(0,U.callbackify)((async({currentIterable:s},a)=>{if(s!==undefined){await(a?s.throw(a):s.return());return}if(a){throw a}}));const identityGenerator=function*(s){yield s};const pushChunksSync=(s,a,u,f)=>{try{for(const f of s(...a)){u.push(f)}f()}catch(s){f(s)}};const runTransformSync=(s,a)=>[...a.flatMap((a=>[...transformChunkSync(a,s,0)])),...finalChunksSync(s)];const transformChunkSync=function*(s,a,u){if(u===a.length){yield s;return}const{transform:f=run_sync_identityGenerator}=a[u];for(const v of f(s)){yield*transformChunkSync(v,a,u+1)}};const finalChunksSync=function*(s){for(const[a,{final:u}]of Object.entries(s)){yield*generatorFinalChunksSync(u,Number(a),s)}};const generatorFinalChunksSync=function*(s,a,u){if(s===undefined){return}for(const f of s()){yield*transformChunkSync(f,u,a+1)}};const run_sync_identityGenerator=function*(s){yield s};const generatorToStream=({value:s,value:{transform:a,final:u,writableObjectMode:f,readableObjectMode:v},optionName:E},{encoding:I})=>{const D={};const N=addInternalGenerators(s,I,E);const P=isAsyncGenerator(a);const B=isAsyncGenerator(u);const _=P?ls.bind(undefined,transformChunk,D):pushChunksSync.bind(undefined,transformChunkSync);const U=P||B?ls.bind(undefined,finalChunks,D):pushChunksSync.bind(undefined,finalChunksSync);const q=P||B?us.bind(undefined,D):undefined;const H=new os.Transform({writableObjectMode:f,writableHighWaterMark:(0,os.getDefaultHighWaterMark)(f),readableObjectMode:v,readableHighWaterMark:(0,os.getDefaultHighWaterMark)(v),transform(s,a,u){_([s,N,0],this,u)},flush(s){U([N],this,s)},destroy:q});return{stream:H}};const runGeneratorsSync=(s,a,u,f)=>{const v=a.filter((({type:s})=>s==="generator"));const E=f?v.reverse():v;for(const{value:a,optionName:f}of E){const v=addInternalGenerators(a,u,f);s=runTransformSync(v,s)}return s};const addInternalGenerators=({transform:s,final:a,binary:u,writableObjectMode:f,readableObjectMode:v,preserveNewlines:E},I,D)=>{const N={};return[{transform:getValidateTransformInput(f,D)},getEncodingTransformGenerator(u,I,f),getSplitLinesGenerator(u,E,f,N),{transform:s,final:a},{transform:getValidateTransformReturn(v,D)},getAppendNewlineGenerator({binary:u,preserveNewlines:E,readableObjectMode:v,state:N})].filter(Boolean)};const addInputOptionsSync=(s,a)=>{for(const u of getInputFdNumbers(s)){addInputOptionSync(s,u,a)}};const getInputFdNumbers=s=>new Set(Object.entries(s).filter((([,{direction:s}])=>s==="input")).map((([s])=>Number(s))));const addInputOptionSync=(s,a,u)=>{const{stdioItems:f}=s[a];const v=f.filter((({contents:s})=>s!==undefined));if(v.length===0){return}if(a!==0){const[{type:s,optionName:a}]=v;throw new TypeError(`Only the \`stdin\` option, not \`${a}\`, can be ${Xn[s]} with synchronous methods.`)}const E=v.map((({contents:s})=>s));const I=E.map((s=>applySingleInputGeneratorsSync(s,f)));u.input=joinToUint8Array(I)};const applySingleInputGeneratorsSync=(s,a)=>{const u=runGeneratorsSync(s,a,"utf8",true);validateSerializable(u);return joinToUint8Array(u)};const validateSerializable=s=>{const a=s.find((s=>typeof s!=="string"&&!isUint8Array(s)));if(a!==undefined){throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${a}.`)}};const shouldLogOutput=({stdioItems:s,encoding:a,verboseInfo:u,fdNumber:f})=>f!=="all"&&isFullVerbose(u,f)&&!On.has(a)&&fdUsesVerbose(f)&&(s.some((({type:s,value:a})=>s==="native"&&ds.has(a)))||s.every((({type:s})=>Kn.has(s))));const fdUsesVerbose=s=>s===1||s===2;const ds=new Set(["pipe","overlapped"]);const logLines=async(s,a,u,f)=>{for await(const v of s){if(!isPipingStream(a)){logLine(v,u,f)}}};const logLinesSync=(s,a,u)=>{for(const f of s){logLine(f,a,u)}};const isPipingStream=s=>s._readableState.pipes.length>0;const logLine=(s,a,u)=>{const f=serializeVerboseMessage(s);verboseLog({type:"output",verboseMessage:f,fdNumber:a,verboseInfo:u})};const transformOutputSync=({fileDescriptors:s,syncResult:{output:a},options:u,isMaxBuffer:f,verboseInfo:v})=>{if(a===null){return{output:Array.from({length:3})}}const E={};const I=new Set([]);const D=a.map(((a,D)=>transformOutputResultSync({result:a,fileDescriptors:s,fdNumber:D,state:E,outputFiles:I,isMaxBuffer:f,verboseInfo:v},u)));return{output:D,...E}};const transformOutputResultSync=({result:s,fileDescriptors:a,fdNumber:u,state:f,outputFiles:v,isMaxBuffer:E,verboseInfo:I},{buffer:D,encoding:N,lines:P,stripFinalNewline:B,maxBuffer:_})=>{if(s===null){return}const U=truncateMaxBufferSync(s,E,_);const q=bufferToUint8Array(U);const{stdioItems:H,objectMode:Y}=a[u];const X=runOutputGeneratorsSync([q],H,N,f);const{serializedResult:ee,finalResult:te=ee}=serializeChunks({chunks:X,objectMode:Y,encoding:N,lines:P,stripFinalNewline:B,fdNumber:u});logOutputSync({serializedResult:ee,fdNumber:u,state:f,verboseInfo:I,encoding:N,stdioItems:H,objectMode:Y});const ne=D[u]?te:undefined;try{if(f.error===undefined){writeToFiles(ee,H,v)}return ne}catch(s){f.error=s;return ne}};const runOutputGeneratorsSync=(s,a,u,f)=>{try{return runGeneratorsSync(s,a,u,false)}catch(a){f.error=a;return s}};const serializeChunks=({chunks:s,objectMode:a,encoding:u,lines:f,stripFinalNewline:v,fdNumber:E})=>{if(a){return{serializedResult:s}}if(u==="buffer"){return{serializedResult:joinToUint8Array(s)}}const I=joinToString(s,u);if(f[E]){return{serializedResult:I,finalResult:splitLinesSync(I,!v[E],a)}}return{serializedResult:I}};const logOutputSync=({serializedResult:s,fdNumber:a,state:u,verboseInfo:f,encoding:v,stdioItems:E,objectMode:I})=>{if(!shouldLogOutput({stdioItems:E,encoding:v,verboseInfo:f,fdNumber:a})){return}const D=splitLinesSync(s,false,I);try{logLinesSync(D,a,f)}catch(s){u.error??=s}};const writeToFiles=(s,a,u)=>{for(const{path:f,append:v}of a.filter((({type:s})=>Hn.has(s)))){const a=typeof f==="string"?f:f.toString();if(v||u.has(a)){(0,kn.appendFileSync)(f,s)}else{u.add(a);(0,kn.writeFileSync)(f,s)}}};const getAllSync=([,s,a],u)=>{if(!u.all){return}if(s===undefined){return a}if(a===undefined){return s}if(Array.isArray(s)){return Array.isArray(a)?[...s,...a]:[...s,stripNewline(a,u,"all")]}if(Array.isArray(a)){return[stripNewline(s,u,"all"),...a]}if(isUint8Array(s)&&isUint8Array(a)){return concatUint8Arrays([s,a])}return`${s}${a}`};const waitForExit=async(s,a)=>{const[u,f]=await waitForExitOrError(s);a.isForcefullyTerminated??=false;return[u,f]};const waitForExitOrError=async s=>{const[a,u]=await Promise.allSettled([(0,dn.once)(s,"spawn"),(0,dn.once)(s,"exit")]);if(a.status==="rejected"){return[]}return u.status==="rejected"?waitForSubprocessExit(s):u.value};const waitForSubprocessExit=async s=>{try{return await(0,dn.once)(s,"exit")}catch{return waitForSubprocessExit(s)}};const waitForSuccessfulExit=async s=>{const[a,u]=await s;if(!isSubprocessErrorExit(a,u)&&isFailedExit(a,u)){throw new DiscardedError}return[a,u]};const isSubprocessErrorExit=(s,a)=>s===undefined&&a===undefined;const isFailedExit=(s,a)=>s!==0||a!==null;const getExitResultSync=({error:s,status:a,signal:u,output:f},{maxBuffer:v})=>{const E=getResultError(s,a,u);const I=E?.code==="ETIMEDOUT";const D=isMaxBufferSync(E,f,v);return{resultError:E,exitCode:a,signal:u,timedOut:I,isMaxBuffer:D}};const getResultError=(s,a,u)=>{if(s!==undefined){return s}return isFailedExit(a,u)?new DiscardedError:undefined};const execaCoreSync=(s,a,u)=>{const{file:f,commandArguments:v,command:E,escapedCommand:I,startTime:D,verboseInfo:N,options:P,fileDescriptors:B}=handleSyncArguments(s,a,u);const _=spawnSubprocessSync({file:f,commandArguments:v,options:P,command:E,escapedCommand:I,verboseInfo:N,fileDescriptors:B,startTime:D});return handleResult(_,N,P)};const handleSyncArguments=(s,a,u)=>{const{command:f,escapedCommand:v,startTime:E,verboseInfo:I}=handleCommand(s,a,u);const D=normalizeSyncOptions(u);const{file:N,commandArguments:P,options:B}=normalizeOptions(s,a,D);validateSyncOptions(B);const _=handleStdioSync(B,I);return{file:N,commandArguments:P,command:f,escapedCommand:v,startTime:E,verboseInfo:I,options:B,fileDescriptors:_}};const normalizeSyncOptions=s=>s.node&&!s.ipc?{...s,ipc:false}:s;const validateSyncOptions=({ipc:s,ipcInput:a,detached:u,cancelSignal:f})=>{if(a){throwInvalidSyncOption("ipcInput")}if(s){throwInvalidSyncOption("ipc: true")}if(u){throwInvalidSyncOption("detached: true")}if(f){throwInvalidSyncOption("cancelSignal")}};const throwInvalidSyncOption=s=>{throw new TypeError(`The "${s}" option cannot be used with synchronous methods.`)};const spawnSubprocessSync=({file:s,commandArguments:a,options:u,command:f,escapedCommand:v,verboseInfo:E,fileDescriptors:I,startTime:D})=>{const N=runSubprocessSync({file:s,commandArguments:a,options:u,command:f,escapedCommand:v,fileDescriptors:I,startTime:D});if(N.failed){return N}const{resultError:P,exitCode:B,signal:_,timedOut:U,isMaxBuffer:q}=getExitResultSync(N,u);const{output:H,error:Y=P}=transformOutputSync({fileDescriptors:I,syncResult:N,options:u,isMaxBuffer:q,verboseInfo:E});const X=H.map(((s,a)=>stripNewline(s,u,a)));const ee=stripNewline(getAllSync(H,u),u,"all");return getSyncResult({error:Y,exitCode:B,signal:_,timedOut:U,isMaxBuffer:q,stdio:X,all:ee,options:u,command:f,escapedCommand:v,startTime:D})};const runSubprocessSync=({file:s,commandArguments:a,options:u,command:f,escapedCommand:v,fileDescriptors:I,startTime:D})=>{try{addInputOptionsSync(I,u);const f=normalizeSpawnSyncOptions(u);return(0,E.spawnSync)(...concatenateShell(s,a,f))}catch(s){return makeEarlyError({error:s,command:f,escapedCommand:v,fileDescriptors:I,options:u,startTime:D,isSync:true})}};const normalizeSpawnSyncOptions=({encoding:s,maxBuffer:a,...u})=>({...u,encoding:"buffer",maxBuffer:getMaxBufferSync(a)});const getSyncResult=({error:s,exitCode:a,signal:u,timedOut:f,isMaxBuffer:v,stdio:E,all:I,options:D,command:N,escapedCommand:P,startTime:B})=>s===undefined?makeSuccessResult({command:N,escapedCommand:P,stdio:E,all:I,ipcOutput:[],options:D,startTime:B}):makeError({error:s,command:N,escapedCommand:P,timedOut:f,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:v,isForcefullyTerminated:false,exitCode:a,signal:u,stdio:E,all:I,ipcOutput:[],options:D,startTime:B,isSync:true});const getOneMessage=({anyProcess:s,channel:a,isSubprocess:u,ipc:f},{reference:v=true,filter:E}={})=>{validateIpcMethod({methodName:"getOneMessage",isSubprocess:u,ipc:f,isConnected:isConnected(s)});return getOneMessageAsync({anyProcess:s,channel:a,isSubprocess:u,filter:E,reference:v})};const getOneMessageAsync=async({anyProcess:s,channel:a,isSubprocess:u,filter:f,reference:v})=>{addReference(a,v);const E=getIpcEmitter(s,a,u);const I=new AbortController;try{return await Promise.race([getMessage(E,f,I),get_one_throwOnDisconnect(E,u,I),throwOnStrictError(E,u,I)])}catch(a){disconnect(s);throw a}finally{I.abort();removeReference(a,v)}};const getMessage=async(s,a,{signal:u})=>{if(a===undefined){const[a]=await(0,dn.once)(s,"message",{signal:u});return a}for await(const[f]of(0,dn.on)(s,"message",{signal:u})){if(a(f)){return f}}};const get_one_throwOnDisconnect=async(s,a,{signal:u})=>{await(0,dn.once)(s,"disconnect",{signal:u});throwOnEarlyDisconnect(a)};const throwOnStrictError=async(s,a,{signal:u})=>{const[f]=await(0,dn.once)(s,"strict:error",{signal:u});throw getStrictResponseError(f,a)};const getEachMessage=({anyProcess:s,channel:a,isSubprocess:u,ipc:f},{reference:v=true}={})=>loopOnMessages({anyProcess:s,channel:a,isSubprocess:u,ipc:f,shouldAwait:!u,reference:v});const loopOnMessages=({anyProcess:s,channel:a,isSubprocess:u,ipc:f,shouldAwait:v,reference:E})=>{validateIpcMethod({methodName:"getEachMessage",isSubprocess:u,ipc:f,isConnected:isConnected(s)});addReference(a,E);const I=getIpcEmitter(s,a,u);const D=new AbortController;const N={};stopOnDisconnect(s,I,D);abortOnStrictError({ipcEmitter:I,isSubprocess:u,controller:D,state:N});return iterateOnMessages({anyProcess:s,channel:a,ipcEmitter:I,isSubprocess:u,shouldAwait:v,controller:D,state:N,reference:E})};const stopOnDisconnect=async(s,a,u)=>{try{await(0,dn.once)(a,"disconnect",{signal:u.signal});u.abort()}catch{}};const abortOnStrictError=async({ipcEmitter:s,isSubprocess:a,controller:u,state:f})=>{try{const[v]=await(0,dn.once)(s,"strict:error",{signal:u.signal});f.error=getStrictResponseError(v,a);u.abort()}catch{}};const iterateOnMessages=async function*({anyProcess:s,channel:a,ipcEmitter:u,isSubprocess:f,shouldAwait:v,controller:E,state:I,reference:D}){try{for await(const[s]of(0,dn.on)(u,"message",{signal:E.signal})){throwIfStrictError(I);yield s}}catch{throwIfStrictError(I)}finally{E.abort();removeReference(a,D);if(!f){disconnect(s)}if(v){await s}}};const throwIfStrictError=({error:s})=>{if(s){throw s}};const addIpcMethods=(s,{ipc:a})=>{Object.assign(s,getIpcMethods(s,false,a))};const getIpcExport=()=>{const s=q;const a=true;const u=q.channel!==undefined;return{...getIpcMethods(s,a,u),getCancelSignal:getCancelSignal.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:u})}};const getIpcMethods=(s,a,u)=>({sendMessage:sendMessage.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:u}),getOneMessage:getOneMessage.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:u}),getEachMessage:getEachMessage.bind(undefined,{anyProcess:s,channel:s.channel,isSubprocess:a,ipc:u})});const handleEarlyError=({error:s,command:a,escapedCommand:u,fileDescriptors:f,options:v,startTime:I,verboseInfo:D})=>{cleanupCustomStreams(f);const N=new E.ChildProcess;createDummyStreams(N,f);Object.assign(N,{readable:readable,writable:writable,duplex:duplex});const P=makeEarlyError({error:s,command:a,escapedCommand:u,fileDescriptors:f,options:v,startTime:I,isSync:false});const B=handleDummyPromise(P,D,v);return{subprocess:N,promise:B}};const createDummyStreams=(s,a)=>{const u=createDummyStream();const f=createDummyStream();const v=createDummyStream();const E=Array.from({length:a.length-3},createDummyStream);const I=createDummyStream();const D=[u,f,v,...E];Object.assign(s,{stdin:u,stdout:f,stderr:v,all:I,stdio:D})};const createDummyStream=()=>{const s=new os.PassThrough;s.end();return s};const readable=()=>new os.Readable({read(){}});const writable=()=>new os.Writable({write(){}});const duplex=()=>new os.Duplex({read(){},write(){}});const handleDummyPromise=async(s,a,u)=>handleResult(s,a,u);const handleStdioAsync=(s,a)=>handleStdio(fs,s,a,false);const forbiddenIfAsync=({type:s,optionName:a})=>{throw new TypeError(`The \`${a}\` option cannot be ${Xn[s]}.`)};const ps={fileNumber:forbiddenIfAsync,generator:generatorToStream,asyncGenerator:generatorToStream,nodeStream:({value:s})=>({stream:s}),webTransform({value:{transform:s,writableObjectMode:a,readableObjectMode:u}}){const f=a||u;const v=os.Duplex.fromWeb(s,{objectMode:f});return{stream:v}},duplex:({value:{transform:s}})=>({stream:s}),native(){}};const fs={input:{...ps,fileUrl:({value:s})=>({stream:(0,kn.createReadStream)(s)}),filePath:({value:{file:s}})=>({stream:(0,kn.createReadStream)(s)}),webStream:({value:s})=>({stream:os.Readable.fromWeb(s)}),iterable:({value:s})=>({stream:os.Readable.from(s)}),asyncIterable:({value:s})=>({stream:os.Readable.from(s)}),string:({value:s})=>({stream:os.Readable.from(s)}),uint8Array:({value:s})=>({stream:os.Readable.from(cs.Buffer.from(s))})},output:{...ps,fileUrl:({value:s})=>({stream:(0,kn.createWriteStream)(s)}),filePath:({value:{file:s,append:a}})=>({stream:(0,kn.createWriteStream)(s,a?{flags:"a"}:{})}),webStream:({value:s})=>({stream:os.Writable.fromWeb(s)}),iterable:forbiddenIfAsync,asyncIterable:forbiddenIfAsync,string:forbiddenIfAsync,uint8Array:forbiddenIfAsync}};const ms=s(import.meta.url)("node:stream/promises");function mergeStreams(s){if(!Array.isArray(s)){throw new TypeError(`Expected an array, got \`${typeof s}\`.`)}for(const a of s){validateStream(a)}const a=s.some((({readableObjectMode:s})=>s));const u=getHighWaterMark(s,a);const f=new MergedStream({objectMode:a,writableHighWaterMark:u,readableHighWaterMark:u});for(const a of s){f.add(a)}return f}const getHighWaterMark=(s,a)=>{if(s.length===0){return(0,os.getDefaultHighWaterMark)(a)}const u=s.filter((({readableObjectMode:s})=>s===a)).map((({readableHighWaterMark:s})=>s));return Math.max(...u)};class MergedStream extends os.PassThrough{#b=new Set([]);#y=new Set([]);#w=new Set([]);#$;#v=Symbol("unpipe");#S=new WeakMap;add(s){validateStream(s);if(this.#b.has(s)){return}this.#b.add(s);this.#$??=onMergedStreamFinished(this,this.#b,this.#v);const a=endWhenStreamsDone({passThroughStream:this,stream:s,streams:this.#b,ended:this.#y,aborted:this.#w,onFinished:this.#$,unpipeEvent:this.#v});this.#S.set(s,a);s.pipe(this,{end:false})}async remove(s){validateStream(s);if(!this.#b.has(s)){return false}const a=this.#S.get(s);if(a===undefined){return false}this.#S.delete(s);s.unpipe(this);await a;return true}}const onMergedStreamFinished=async(s,a,u)=>{updateMaxListeners(s,hs);const f=new AbortController;try{await Promise.race([onMergedStreamEnd(s,f),onInputStreamsUnpipe(s,a,u,f)])}finally{f.abort();updateMaxListeners(s,-hs)}};const onMergedStreamEnd=async(s,{signal:a})=>{try{await(0,ms.finished)(s,{signal:a,cleanup:true})}catch(a){errorOrAbortStream(s,a);throw a}};const onInputStreamsUnpipe=async(s,a,u,{signal:f})=>{for await(const[v]of(0,dn.on)(s,"unpipe",{signal:f})){if(a.has(v)){v.emit(u)}}};const validateStream=s=>{if(typeof s?.pipe!=="function"){throw new TypeError(`Expected a readable stream, got: \`${typeof s}\`.`)}};const endWhenStreamsDone=async({passThroughStream:s,stream:a,streams:u,ended:f,aborted:v,onFinished:E,unpipeEvent:I})=>{updateMaxListeners(s,gs);const D=new AbortController;try{await Promise.race([afterMergedStreamFinished(E,a,D),onInputStreamEnd({passThroughStream:s,stream:a,streams:u,ended:f,aborted:v,controller:D}),onInputStreamUnpipe({stream:a,streams:u,ended:f,aborted:v,unpipeEvent:I,controller:D})])}finally{D.abort();updateMaxListeners(s,-gs)}if(u.size>0&&u.size===f.size+v.size){if(f.size===0&&v.size>0){abortStream(s)}else{endStream(s)}}};const afterMergedStreamFinished=async(s,a,{signal:u})=>{try{await s;if(!u.aborted){abortStream(a)}}catch(s){if(!u.aborted){errorOrAbortStream(a,s)}}};const onInputStreamEnd=async({passThroughStream:s,stream:a,streams:u,ended:f,aborted:v,controller:{signal:E}})=>{try{await(0,ms.finished)(a,{signal:E,cleanup:true,readable:true,writable:false});if(u.has(a)){f.add(a)}}catch(f){if(E.aborted||!u.has(a)){return}if(isAbortError(f)){v.add(a)}else{errorStream(s,f)}}};const onInputStreamUnpipe=async({stream:s,streams:a,ended:u,aborted:f,unpipeEvent:v,controller:{signal:E}})=>{await(0,dn.once)(s,v,{signal:E});if(!s.readable){return(0,dn.once)(E,"abort",{signal:E})}a.delete(s);u.delete(s);f.delete(s)};const endStream=s=>{if(s.writable){s.end()}};const errorOrAbortStream=(s,a)=>{if(isAbortError(a)){abortStream(s)}else{errorStream(s,a)}};const isAbortError=s=>s?.code==="ERR_STREAM_PREMATURE_CLOSE";const abortStream=s=>{if(s.readable||s.writable){s.destroy()}};const errorStream=(s,a)=>{if(!s.destroyed){s.once("error",noop);s.destroy(a)}};const noop=()=>{};const updateMaxListeners=(s,a)=>{const u=s.getMaxListeners();if(u!==0&&u!==Number.POSITIVE_INFINITY){s.setMaxListeners(u+a)}};const hs=2;const gs=1;const pipeStreams=(s,a)=>{s.pipe(a);onSourceFinish(s,a);onDestinationFinish(s,a)};const onSourceFinish=async(s,a)=>{if(isStandardStream(s)||isStandardStream(a)){return}try{await(0,ms.finished)(s,{cleanup:true,readable:true,writable:false})}catch{}endDestinationStream(a)};const endDestinationStream=s=>{if(s.writable){s.end()}};const onDestinationFinish=async(s,a)=>{if(isStandardStream(s)||isStandardStream(a)){return}try{await(0,ms.finished)(a,{cleanup:true,readable:false,writable:true})}catch{}abortSourceStream(s)};const abortSourceStream=s=>{if(s.readable){s.destroy()}};const pipeOutputAsync=(s,a,u)=>{const f=new Map;for(const[v,{stdioItems:E,direction:I}]of Object.entries(a)){for(const{stream:a}of E.filter((({type:s})=>Kn.has(s)))){pipeTransform(s,a,I,v)}for(const{stream:a}of E.filter((({type:s})=>!Kn.has(s)))){pipeStdioItem({subprocess:s,stream:a,direction:I,fdNumber:v,pipeGroups:f,controller:u})}}for(const[s,a]of f.entries()){const u=a.length===1?a[0]:mergeStreams(a);pipeStreams(u,s)}};const pipeTransform=(s,a,u,f)=>{if(u==="output"){pipeStreams(s.stdio[f],a)}else{pipeStreams(a,s.stdio[f])}const v=bs[f];if(v!==undefined){s[v]=a}s.stdio[f]=a};const bs=["stdin","stdout","stderr"];const pipeStdioItem=({subprocess:s,stream:a,direction:u,fdNumber:f,pipeGroups:v,controller:E})=>{if(a===undefined){return}setStandardStreamMaxListeners(a,E);const[I,D]=u==="output"?[a,s.stdio[f]]:[s.stdio[f],a];const N=v.get(I)??[];v.set(I,[...N,D])};const setStandardStreamMaxListeners=(s,{signal:a})=>{if(isStandardStream(s)){incrementMaxListeners(s,ys,a)}};const ys=2;const ws=[];ws.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32"){ws.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){ws.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")}const processOk=s=>!!s&&typeof s==="object"&&typeof s.removeListener==="function"&&typeof s.emit==="function"&&typeof s.reallyExit==="function"&&typeof s.listeners==="function"&&typeof s.kill==="function"&&typeof s.pid==="number"&&typeof s.on==="function";const $s=Symbol.for("signal-exit emitter");const vs=globalThis;const Ss=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vs[$s]){return vs[$s]}Ss(vs,$s,{value:this,writable:false,enumerable:false,configurable:false})}on(s,a){this.listeners[s].push(a)}removeListener(s,a){const u=this.listeners[s];const f=u.indexOf(a);if(f===-1){return}if(f===0&&u.length===1){u.length=0}else{u.splice(f,1)}}emit(s,a,u){if(this.emitted[s]){return false}this.emitted[s]=true;let f=false;for(const v of this.listeners[s]){f=v(a,u)===true||f}if(s==="exit"){f=this.emit("afterExit",a,u)||f}return f}}class SignalExitBase{}const signalExitWrap=s=>({onExit(a,u){return s.onExit(a,u)},load(){return s.load()},unload(){return s.unload()}});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#x=xs.platform==="win32"?"SIGINT":"SIGHUP";#T=new Emitter;#E;#I;#M;#D={};#O=false;constructor(s){super();this.#E=s;this.#D={};for(const a of ws){this.#D[a]=()=>{const u=this.#E.listeners(a);let{count:f}=this.#T;const v=s;if(typeof v.__signal_exit_emitter__==="object"&&typeof v.__signal_exit_emitter__.count==="number"){f+=v.__signal_exit_emitter__.count}if(u.length===f){this.unload();const u=this.#T.emit("exit",null,a);const f=a==="SIGHUP"?this.#x:a;if(!u)s.kill(s.pid,f)}}}this.#M=s.reallyExit;this.#I=s.emit}onExit(s,a){if(!processOk(this.#E)){return()=>{}}if(this.#O===false){this.load()}const u=a?.alwaysLast?"afterExit":"exit";this.#T.on(u,s);return()=>{this.#T.removeListener(u,s);if(this.#T.listeners["exit"].length===0&&this.#T.listeners["afterExit"].length===0){this.unload()}}}load(){if(this.#O){return}this.#O=true;this.#T.count+=1;for(const s of ws){try{const a=this.#D[s];if(a)this.#E.on(s,a)}catch(s){}}this.#E.emit=(s,...a)=>this.#C(s,...a);this.#E.reallyExit=s=>this.#N(s)}unload(){if(!this.#O){return}this.#O=false;ws.forEach((s=>{const a=this.#D[s];if(!a){throw new Error("Listener not defined for signal: "+s)}try{this.#E.removeListener(s,a)}catch(s){}}));this.#E.emit=this.#I;this.#E.reallyExit=this.#M;this.#T.count-=1}#N(s){if(!processOk(this.#E)){return 0}this.#E.exitCode=s||0;this.#T.emit("exit",this.#E.exitCode,null);return this.#M.call(this.#E,this.#E.exitCode)}#C(s,...a){const u=this.#I;if(s==="exit"&&processOk(this.#E)){if(typeof a[0]==="number"){this.#E.exitCode=a[0]}const f=u.call(this.#E,s,...a);this.#T.emit("exit",this.#E.exitCode,null);return f}else{return u.call(this.#E,s,...a)}}}const xs=globalThis.process;const{onExit:Ts,load:Es,unload:Is}=signalExitWrap(processOk(xs)?new SignalExit(xs):new SignalExitFallback);const cleanupOnExit=(s,{cleanup:a,detached:u},{signal:f})=>{if(!a||u){return}const v=Ts((()=>{s.kill()}));(0,dn.addAbortListener)(f,(()=>{v()}))};const normalizePipeArguments=({source:s,sourcePromise:a,boundOptions:u,createNested:f},...v)=>{const E=getStartTime();const{destination:I,destinationStream:D,destinationError:N,from:P,unpipeSignal:B}=getDestinationStream(u,f,v);const{sourceStream:_,sourceError:U}=getSourceStream(s,P);const{options:q,fileDescriptors:H}=mn.get(s);return{sourcePromise:a,sourceStream:_,sourceOptions:q,sourceError:U,destination:I,destinationStream:D,destinationError:N,unpipeSignal:B,fileDescriptors:H,startTime:E}};const getDestinationStream=(s,a,u)=>{try{const{destination:f,pipeOptions:{from:v,to:E,unpipeSignal:I}={}}=getDestination(s,a,...u);const D=getToStream(f,E);return{destination:f,destinationStream:D,from:v,unpipeSignal:I}}catch(s){return{destinationError:s}}};const getDestination=(s,a,u,...f)=>{if(Array.isArray(u)){const v=a(mapDestinationArguments,s)(u,...f);return{destination:v,pipeOptions:s}}if(typeof u==="string"||u instanceof URL||isDenoExecPath(u)){if(Object.keys(s).length>0){throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).')}const[v,E,I]=normalizeParameters(u,...f);const D=a(mapDestinationArguments)(v,E,I);return{destination:D,pipeOptions:I}}if(mn.has(u)){if(Object.keys(s).length>0){throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).")}return{destination:u,pipeOptions:f[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${u}`)};const mapDestinationArguments=({options:s})=>({options:{...s,stdin:"pipe",piped:true}});const getSourceStream=(s,a)=>{try{const u=getFromStream(s,a);return{sourceStream:u}}catch(s){return{sourceError:s}}};const handlePipeArgumentsError=({sourceStream:s,sourceError:a,destinationStream:u,destinationError:f,fileDescriptors:v,sourceOptions:E,startTime:I})=>{const D=getPipeArgumentsError({sourceStream:s,sourceError:a,destinationStream:u,destinationError:f});if(D!==undefined){throw createNonCommandError({error:D,fileDescriptors:v,sourceOptions:E,startTime:I})}};const getPipeArgumentsError=({sourceStream:s,sourceError:a,destinationStream:u,destinationError:f})=>{if(a!==undefined&&f!==undefined){return f}if(f!==undefined){abortSourceStream(s);return f}if(a!==undefined){endDestinationStream(u);return a}};const createNonCommandError=({error:s,fileDescriptors:a,sourceOptions:u,startTime:f})=>makeEarlyError({error:s,command:Ms,escapedCommand:Ms,fileDescriptors:a,options:u,startTime:f,isSync:false});const Ms="source.pipe(destination)";const waitForBothSubprocesses=async s=>{const[{status:a,reason:u,value:f=u},{status:v,reason:E,value:I=E}]=await s;if(!I.pipedFrom.includes(f)){I.pipedFrom.push(f)}if(v==="rejected"){throw I}if(a==="rejected"){throw f}return I};const pipeSubprocessStream=(s,a,u)=>{const f=Ds.has(a)?pipeMoreSubprocessStream(s,a):pipeFirstSubprocessStream(s,a);incrementMaxListeners(s,Os,u.signal);incrementMaxListeners(a,Cs,u.signal);cleanupMergedStreamsMap(a);return f};const pipeFirstSubprocessStream=(s,a)=>{const u=mergeStreams([s]);pipeStreams(u,a);Ds.set(a,u);return u};const pipeMoreSubprocessStream=(s,a)=>{const u=Ds.get(a);u.add(s);return u};const cleanupMergedStreamsMap=async s=>{try{await(0,ms.finished)(s,{cleanup:true,readable:false,writable:true})}catch{}Ds.delete(s)};const Ds=new WeakMap;const Os=2;const Cs=1;const unpipeOnAbort=(s,a)=>s===undefined?[]:[unpipeOnSignalAbort(s,a)];const unpipeOnSignalAbort=async(s,{sourceStream:a,mergedStream:u,fileDescriptors:f,sourceOptions:v,startTime:E})=>{await(0,U.aborted)(s,a);await u.remove(a);const I=new Error("Pipe canceled by `unpipeSignal` option.");throw createNonCommandError({error:I,fileDescriptors:f,sourceOptions:v,startTime:E})};const pipeToSubprocess=(s,...a)=>{if(isPlainObject(a[0])){return pipeToSubprocess.bind(undefined,{...s,boundOptions:{...s.boundOptions,...a[0]}})}const{destination:u,...f}=normalizePipeArguments(s,...a);const v=handlePipePromise({...f,destination:u});v.pipe=pipeToSubprocess.bind(undefined,{...s,source:u,sourcePromise:v,boundOptions:{}});return v};const handlePipePromise=async({sourcePromise:s,sourceStream:a,sourceOptions:u,sourceError:f,destination:v,destinationStream:E,destinationError:I,unpipeSignal:D,fileDescriptors:N,startTime:P})=>{const B=getSubprocessPromises(s,v);handlePipeArgumentsError({sourceStream:a,sourceError:f,destinationStream:E,destinationError:I,fileDescriptors:N,sourceOptions:u,startTime:P});const _=new AbortController;try{const s=pipeSubprocessStream(a,E,_);return await Promise.race([waitForBothSubprocesses(B),...unpipeOnAbort(D,{sourceStream:a,mergedStream:s,sourceOptions:u,fileDescriptors:N,startTime:P})])}finally{_.abort()}};const getSubprocessPromises=(s,a)=>Promise.allSettled([s,a]);const utils_identity=s=>s;const utils_noop=()=>undefined;const getContentsProperty=({contents:s})=>s;const throwObjectStream=s=>{throw new Error(`Streams in object mode are not supported: ${String(s)}`)};const getLengthProperty=s=>s.length;async function getStreamAsArray(s,a){return getStreamContents(s,Ns,a)}const initArray=()=>({contents:[]});const increment=()=>1;const addArrayChunk=(s,{contents:a})=>{a.push(s);return a};const Ns={init:initArray,convertChunk:{string:utils_identity,buffer:utils_identity,arrayBuffer:utils_identity,dataView:utils_identity,typedArray:utils_identity,others:utils_identity},getSize:increment,truncateChunk:utils_noop,addChunk:addArrayChunk,getFinalChunk:utils_noop,finalize:getContentsProperty};async function getStreamAsArrayBuffer(s,a){return getStreamContents(s,As,a)}const initArrayBuffer=()=>({contents:new ArrayBuffer(0)});const useTextEncoder=s=>ks.encode(s);const ks=new TextEncoder;const useUint8Array=s=>new Uint8Array(s);const useUint8ArrayWithOffset=s=>new Uint8Array(s.buffer,s.byteOffset,s.byteLength);const truncateArrayBufferChunk=(s,a)=>s.slice(0,a);const addArrayBufferChunk=(s,{contents:a,length:u},f)=>{const v=hasArrayBufferResize()?resizeArrayBuffer(a,f):resizeArrayBufferSlow(a,f);new Uint8Array(v).set(s,u);return v};const resizeArrayBufferSlow=(s,a)=>{if(a<=s.byteLength){return s}const u=new ArrayBuffer(getNewContentsLength(a));new Uint8Array(u).set(new Uint8Array(s),0);return u};const resizeArrayBuffer=(s,a)=>{if(a<=s.maxByteLength){s.resize(a);return s}const u=new ArrayBuffer(a,{maxByteLength:getNewContentsLength(a)});new Uint8Array(u).set(new Uint8Array(s),0);return u};const getNewContentsLength=s=>js**Math.ceil(Math.log(s)/Math.log(js));const js=2;const finalizeArrayBuffer=({contents:s,length:a})=>hasArrayBufferResize()?s:s.slice(0,a);const hasArrayBufferResize=()=>"resize"in ArrayBuffer.prototype;const As={init:initArrayBuffer,convertChunk:{string:useTextEncoder,buffer:useUint8Array,arrayBuffer:useUint8Array,dataView:useUint8ArrayWithOffset,typedArray:useUint8ArrayWithOffset,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateArrayBufferChunk,addChunk:addArrayBufferChunk,getFinalChunk:utils_noop,finalize:finalizeArrayBuffer};async function getStreamAsString(s,a){return getStreamContents(s,Ps,a)}const initString=()=>({contents:"",textDecoder:new TextDecoder});const useTextDecoder=(s,{textDecoder:a})=>a.decode(s,{stream:true});const addStringChunk=(s,{contents:a})=>a+s;const truncateStringChunk=(s,a)=>s.slice(0,a);const getFinalStringChunk=({textDecoder:s})=>{const a=s.decode();return a===""?undefined:a};const Ps={init:initString,convertChunk:{string:utils_identity,buffer:useTextDecoder,arrayBuffer:useTextDecoder,dataView:useTextDecoder,typedArray:useTextDecoder,others:throwObjectStream},getSize:getLengthProperty,truncateChunk:truncateStringChunk,addChunk:addStringChunk,getFinalChunk:getFinalStringChunk,finalize:getContentsProperty};const iterateOnSubprocessStream=({subprocessStdout:s,subprocess:a,binary:u,shouldEncode:f,encoding:v,preserveNewlines:E})=>{const I=new AbortController;stopReadingOnExit(a,I);return iterateOnStream({stream:s,controller:I,binary:u,shouldEncode:!s.readableObjectMode&&f,encoding:v,shouldSplit:!s.readableObjectMode,preserveNewlines:E})};const stopReadingOnExit=async(s,a)=>{try{await s}catch{}finally{a.abort()}};const iterateForResult=({stream:s,onStreamEnd:a,lines:u,encoding:f,stripFinalNewline:v,allMixed:E})=>{const I=new AbortController;stopReadingOnStreamEnd(a,I,s);const D=s.readableObjectMode&&!E;return iterateOnStream({stream:s,controller:I,binary:f==="buffer",shouldEncode:!D,encoding:f,shouldSplit:!D&&u,preserveNewlines:!v})};const stopReadingOnStreamEnd=async(s,a,u)=>{try{await s}catch{u.destroy()}finally{a.abort()}};const iterateOnStream=({stream:s,controller:a,binary:u,shouldEncode:f,encoding:v,shouldSplit:E,preserveNewlines:I})=>{const D=(0,dn.on)(s,"data",{signal:a.signal,highWaterMark:_s,highWatermark:_s});return iterateOnData({onStdoutChunk:D,controller:a,binary:u,shouldEncode:f,encoding:v,shouldSplit:E,preserveNewlines:I})};const Bs=(0,os.getDefaultHighWaterMark)(true);const _s=Bs;const iterateOnData=async function*({onStdoutChunk:s,controller:a,binary:u,shouldEncode:f,encoding:v,shouldSplit:E,preserveNewlines:I}){const D=getGenerators({binary:u,shouldEncode:f,encoding:v,shouldSplit:E,preserveNewlines:I});try{for await(const[a]of s){yield*transformChunkSync(a,D,0)}}catch(s){if(!a.signal.aborted){throw s}}finally{yield*finalChunksSync(D)}};const getGenerators=({binary:s,shouldEncode:a,encoding:u,shouldSplit:f,preserveNewlines:v})=>[getEncodingTransformGenerator(s,u,!a),getSplitLinesGenerator(s,v,!f,{})].filter(Boolean);const getStreamOutput=async({stream:s,onStreamEnd:a,fdNumber:u,encoding:f,buffer:v,maxBuffer:E,lines:I,allMixed:D,stripFinalNewline:N,verboseInfo:P,streamInfo:B})=>{const _=logOutputAsync({stream:s,onStreamEnd:a,fdNumber:u,encoding:f,allMixed:D,verboseInfo:P,streamInfo:B});if(!v){await Promise.all([resumeStream(s),_]);return}const U=getStripFinalNewline(N,u);const q=iterateForResult({stream:s,onStreamEnd:a,lines:I,encoding:f,stripFinalNewline:U,allMixed:D});const[H]=await Promise.all([contents_getStreamContents({stream:s,iterable:q,fdNumber:u,encoding:f,maxBuffer:E,lines:I}),_]);return H};const logOutputAsync=async({stream:s,onStreamEnd:a,fdNumber:u,encoding:f,allMixed:v,verboseInfo:E,streamInfo:{fileDescriptors:I}})=>{if(!shouldLogOutput({stdioItems:I[u]?.stdioItems,encoding:f,verboseInfo:E,fdNumber:u})){return}const D=iterateForResult({stream:s,onStreamEnd:a,lines:true,encoding:f,stripFinalNewline:true,allMixed:v});await logLines(D,s,u,E)};const resumeStream=async s=>{await(0,en.setImmediate)();if(s.readableFlowing===null){s.resume()}};const contents_getStreamContents=async({stream:s,stream:{readableObjectMode:a},iterable:u,fdNumber:f,encoding:v,maxBuffer:E,lines:I})=>{try{if(a||I){return await getStreamAsArray(u,{maxBuffer:E})}if(v==="buffer"){return new Uint8Array(await getStreamAsArrayBuffer(u,{maxBuffer:E}))}return await getStreamAsString(u,{maxBuffer:E})}catch(u){return handleBufferedData(handleMaxBuffer({error:u,stream:s,readableObjectMode:a,lines:I,encoding:v,fdNumber:f}))}};const getBufferedData=async s=>{try{return await s}catch(s){return handleBufferedData(s)}};const handleBufferedData=({bufferedData:s})=>isArrayBuffer(s)?new Uint8Array(s):s;const waitForStream=async(s,a,u,{isSameDirection:f,stopOnExit:v=false}={})=>{const E=handleStdinDestroy(s,u);const I=new AbortController;try{await Promise.race([...v?[u.exitPromise]:[],(0,ms.finished)(s,{cleanup:true,signal:I.signal})])}catch(s){if(!E.stdinCleanedUp){handleStreamError(s,a,u,f)}}finally{I.abort()}};const handleStdinDestroy=(s,{originalStreams:[a],subprocess:u})=>{const f={stdinCleanedUp:false};if(s===a){spyOnStdinDestroy(s,u,f)}return f};const spyOnStdinDestroy=(s,a,u)=>{const{_destroy:f}=s;s._destroy=(...v)=>{setStdinCleanedUp(a,u);f.call(s,...v)}};const setStdinCleanedUp=({exitCode:s,signalCode:a},u)=>{if(s!==null||a!==null){u.stdinCleanedUp=true}};const handleStreamError=(s,a,u,f)=>{if(!shouldIgnoreStreamError(s,a,u,f)){throw s}};const shouldIgnoreStreamError=(s,a,u,f=true)=>{if(u.propagating){return isStreamEpipe(s)||isStreamAbort(s)}u.propagating=true;return isInputFileDescriptor(u,a)===f?isStreamEpipe(s):isStreamAbort(s)};const isInputFileDescriptor=({fileDescriptors:s},a)=>a!=="all"&&s[a].direction==="input";const isStreamAbort=s=>s?.code==="ERR_STREAM_PREMATURE_CLOSE";const isStreamEpipe=s=>s?.code==="EPIPE";const waitForStdioStreams=({subprocess:s,encoding:a,buffer:u,maxBuffer:f,lines:v,stripFinalNewline:E,verboseInfo:I,streamInfo:D})=>s.stdio.map(((s,N)=>waitForSubprocessStream({stream:s,fdNumber:N,encoding:a,buffer:u[N],maxBuffer:f[N],lines:v[N],allMixed:false,stripFinalNewline:E,verboseInfo:I,streamInfo:D})));const waitForSubprocessStream=async({stream:s,fdNumber:a,encoding:u,buffer:f,maxBuffer:v,lines:E,allMixed:I,stripFinalNewline:D,verboseInfo:N,streamInfo:P})=>{if(!s){return}const B=waitForStream(s,a,P);if(isInputFileDescriptor(P,a)){await B;return}const[_]=await Promise.all([getStreamOutput({stream:s,onStreamEnd:B,fdNumber:a,encoding:u,buffer:f,maxBuffer:v,lines:E,allMixed:I,stripFinalNewline:D,verboseInfo:N,streamInfo:P}),B]);return _};const makeAllStream=({stdout:s,stderr:a},{all:u})=>u&&(s||a)?mergeStreams([s,a].filter(Boolean)):undefined;const waitForAllStream=({subprocess:s,encoding:a,buffer:u,maxBuffer:f,lines:v,stripFinalNewline:E,verboseInfo:I,streamInfo:D})=>waitForSubprocessStream({...getAllStream(s,u),fdNumber:"all",encoding:a,maxBuffer:f[1]+f[2],lines:v[1]||v[2],allMixed:getAllMixed(s),stripFinalNewline:E,verboseInfo:I,streamInfo:D});const getAllStream=({stdout:s,stderr:a,all:u},[,f,v])=>{const E=f||v;if(!E){return{stream:u,buffer:E}}if(!f){return{stream:a,buffer:E}}if(!v){return{stream:s,buffer:E}}return{stream:u,buffer:E}};const getAllMixed=({all:s,stdout:a,stderr:u})=>s&&a&&u&&a.readableObjectMode!==u.readableObjectMode;const shouldLogIpc=s=>isFullVerbose(s,"ipc");const logIpcOutput=(s,a)=>{const u=serializeVerboseMessage(s);verboseLog({type:"ipc",verboseMessage:u,fdNumber:"ipc",verboseInfo:a})};const waitForIpcOutput=async({subprocess:s,buffer:a,maxBuffer:u,ipc:f,ipcOutput:v,verboseInfo:E})=>{if(!f){return v}const I=shouldLogIpc(E);const D=getFdSpecificValue(a,"ipc");const N=getFdSpecificValue(u,"ipc");for await(const a of loopOnMessages({anyProcess:s,channel:s.channel,isSubprocess:false,ipc:f,shouldAwait:false,reference:true})){if(D){checkIpcMaxBuffer(s,v,N);v.push(a)}if(I){logIpcOutput(a,E)}}return v};const getBufferedIpcOutput=async(s,a)=>{await Promise.allSettled([s]);return a};const waitForSubprocessResult=async({subprocess:s,options:{encoding:a,buffer:u,maxBuffer:f,lines:v,timeoutDuration:E,cancelSignal:I,gracefulCancel:D,forceKillAfterDelay:N,stripFinalNewline:P,ipc:B,ipcInput:_},context:U,verboseInfo:q,fileDescriptors:H,originalStreams:Y,onInternalError:X,controller:ee})=>{const te=waitForExit(s,U);const ne={originalStreams:Y,fileDescriptors:H,subprocess:s,exitPromise:te,propagating:false};const se=waitForStdioStreams({subprocess:s,encoding:a,buffer:u,maxBuffer:f,lines:v,stripFinalNewline:P,verboseInfo:q,streamInfo:ne});const oe=waitForAllStream({subprocess:s,encoding:a,buffer:u,maxBuffer:f,lines:v,stripFinalNewline:P,verboseInfo:q,streamInfo:ne});const ce=[];const le=waitForIpcOutput({subprocess:s,buffer:u,maxBuffer:f,ipc:B,ipcOutput:ce,verboseInfo:q});const ue=waitForOriginalStreams(Y,s,ne);const de=waitForCustomStreamsEnd(H,ne);try{return await Promise.race([Promise.all([{},waitForSuccessfulExit(te),Promise.all(se),oe,le,sendIpcInput(s,_),...ue,...de]),X,throwOnSubprocessError(s,ee),...throwOnTimeout(s,E,U,ee),...throwOnCancel({subprocess:s,cancelSignal:I,gracefulCancel:D,context:U,controller:ee}),...throwOnGracefulCancel({subprocess:s,cancelSignal:I,gracefulCancel:D,forceKillAfterDelay:N,context:U,controller:ee})])}catch(s){U.terminationReason??="other";return Promise.all([{error:s},te,Promise.all(se.map((s=>getBufferedData(s)))),getBufferedData(oe),getBufferedIpcOutput(le,ce),Promise.allSettled(ue),Promise.allSettled(de)])}};const waitForOriginalStreams=(s,a,u)=>s.map(((s,f)=>s===a.stdio[f]?undefined:waitForStream(s,f,u)));const waitForCustomStreamsEnd=(s,a)=>s.flatMap((({stdioItems:s},u)=>s.filter((({value:s,stream:a=s})=>isStream(a,{checkOpen:false})&&!isStandardStream(a))).map((({type:s,value:f,stream:v=f})=>waitForStream(v,u,a,{isSameDirection:Kn.has(s),stopOnExit:s==="native"})))));const throwOnSubprocessError=async(s,{signal:a})=>{const[u]=await(0,dn.once)(s,"error",{signal:a});throw u};const initializeConcurrentStreams=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap});const addConcurrentStream=(s,a,u)=>{const f=s[u];if(!f.has(a)){f.set(a,[])}const v=f.get(a);const E=createDeferred();v.push(E);const I=E.resolve.bind(E);return{resolve:I,promises:v}};const waitForConcurrentStreams=async({resolve:s,promises:a},u)=>{s();const[f]=await Promise.race([Promise.allSettled([true,u]),Promise.all([false,...a])]);return!f};const safeWaitForSubprocessStdin=async s=>{if(s===undefined){return}try{await waitForSubprocessStdin(s)}catch{}};const safeWaitForSubprocessStdout=async s=>{if(s===undefined){return}try{await waitForSubprocessStdout(s)}catch{}};const waitForSubprocessStdin=async s=>{await(0,ms.finished)(s,{cleanup:true,readable:false,writable:true})};const waitForSubprocessStdout=async s=>{await(0,ms.finished)(s,{cleanup:true,readable:true,writable:false})};const waitForSubprocess=async(s,a)=>{await s;if(a){throw a}};const destroyOtherStream=(s,a,u)=>{if(u&&!isStreamAbort(u)){s.destroy(u)}else if(a){s.destroy()}};const createReadable=({subprocess:s,concurrentStreams:a,encoding:u},{from:f,binary:v=true,preserveNewlines:E=true}={})=>{const I=v||On.has(u);const{subprocessStdout:D,waitReadableDestroy:N}=getSubprocessStdout(s,f,a);const{readableEncoding:P,readableObjectMode:B,readableHighWaterMark:_}=getReadableOptions(D,I);const{read:q,onStdoutDataDone:H}=getReadableMethods({subprocessStdout:D,subprocess:s,binary:I,encoding:u,preserveNewlines:E});const Y=new os.Readable({read:q,destroy:(0,U.callbackify)(onReadableDestroy.bind(undefined,{subprocessStdout:D,subprocess:s,waitReadableDestroy:N})),highWaterMark:_,objectMode:B,encoding:P});onStdoutFinished({subprocessStdout:D,onStdoutDataDone:H,readable:Y,subprocess:s});return Y};const getSubprocessStdout=(s,a,u)=>{const f=getFromStream(s,a);const v=addConcurrentStream(u,f,"readableDestroy");return{subprocessStdout:f,waitReadableDestroy:v}};const getReadableOptions=({readableEncoding:s,readableObjectMode:a,readableHighWaterMark:u},f)=>f?{readableEncoding:s,readableObjectMode:a,readableHighWaterMark:u}:{readableEncoding:s,readableObjectMode:true,readableHighWaterMark:Bs};const getReadableMethods=({subprocessStdout:s,subprocess:a,binary:u,encoding:f,preserveNewlines:v})=>{const E=createDeferred();const I=iterateOnSubprocessStream({subprocessStdout:s,subprocess:a,binary:u,shouldEncode:!u,encoding:f,preserveNewlines:v});return{read(){onRead(this,I,E)},onStdoutDataDone:E}};const onRead=async(s,a,u)=>{try{const{value:f,done:v}=await a.next();if(v){u.resolve()}else{s.push(f)}}catch{}};const onStdoutFinished=async({subprocessStdout:s,onStdoutDataDone:a,readable:u,subprocess:f,subprocessStdin:v})=>{try{await waitForSubprocessStdout(s);await f;await safeWaitForSubprocessStdin(v);await a;if(u.readable){u.push(null)}}catch(s){await safeWaitForSubprocessStdin(v);destroyOtherReadable(u,s)}};const onReadableDestroy=async({subprocessStdout:s,subprocess:a,waitReadableDestroy:u},f)=>{if(await waitForConcurrentStreams(u,a)){destroyOtherReadable(s,f);await waitForSubprocess(a,f)}};const destroyOtherReadable=(s,a)=>{destroyOtherStream(s,s.readable,a)};const createWritable=({subprocess:s,concurrentStreams:a},{to:u}={})=>{const{subprocessStdin:f,waitWritableFinal:v,waitWritableDestroy:E}=getSubprocessStdin(s,u,a);const I=new os.Writable({...getWritableMethods(f,s,v),destroy:(0,U.callbackify)(onWritableDestroy.bind(undefined,{subprocessStdin:f,subprocess:s,waitWritableFinal:v,waitWritableDestroy:E})),highWaterMark:f.writableHighWaterMark,objectMode:f.writableObjectMode});onStdinFinished(f,I);return I};const getSubprocessStdin=(s,a,u)=>{const f=getToStream(s,a);const v=addConcurrentStream(u,f,"writableFinal");const E=addConcurrentStream(u,f,"writableDestroy");return{subprocessStdin:f,waitWritableFinal:v,waitWritableDestroy:E}};const getWritableMethods=(s,a,u)=>({write:onWrite.bind(undefined,s),final:(0,U.callbackify)(onWritableFinal.bind(undefined,s,a,u))});const onWrite=(s,a,u,f)=>{if(s.write(a,u)){f()}else{s.once("drain",f)}};const onWritableFinal=async(s,a,u)=>{if(await waitForConcurrentStreams(u,a)){if(s.writable){s.end()}await a}};const onStdinFinished=async(s,a,u)=>{try{await waitForSubprocessStdin(s);if(a.writable){a.end()}}catch(s){await safeWaitForSubprocessStdout(u);destroyOtherWritable(a,s)}};const onWritableDestroy=async({subprocessStdin:s,subprocess:a,waitWritableFinal:u,waitWritableDestroy:f},v)=>{await waitForConcurrentStreams(u,a);if(await waitForConcurrentStreams(f,a)){destroyOtherWritable(s,v);await waitForSubprocess(a,v)}};const destroyOtherWritable=(s,a)=>{destroyOtherStream(s,s.writable,a)};const createDuplex=({subprocess:s,concurrentStreams:a,encoding:u},{from:f,to:v,binary:E=true,preserveNewlines:I=true}={})=>{const D=E||On.has(u);const{subprocessStdout:N,waitReadableDestroy:P}=getSubprocessStdout(s,f,a);const{subprocessStdin:B,waitWritableFinal:_,waitWritableDestroy:q}=getSubprocessStdin(s,v,a);const{readableEncoding:H,readableObjectMode:Y,readableHighWaterMark:X}=getReadableOptions(N,D);const{read:ee,onStdoutDataDone:te}=getReadableMethods({subprocessStdout:N,subprocess:s,binary:D,encoding:u,preserveNewlines:I});const ne=new os.Duplex({read:ee,...getWritableMethods(B,s,_),destroy:(0,U.callbackify)(onDuplexDestroy.bind(undefined,{subprocessStdout:N,subprocessStdin:B,subprocess:s,waitReadableDestroy:P,waitWritableFinal:_,waitWritableDestroy:q})),readableHighWaterMark:X,writableHighWaterMark:B.writableHighWaterMark,readableObjectMode:Y,writableObjectMode:B.writableObjectMode,encoding:H});onStdoutFinished({subprocessStdout:N,onStdoutDataDone:te,readable:ne,subprocess:s,subprocessStdin:B});onStdinFinished(B,ne,N);return ne};const onDuplexDestroy=async({subprocessStdout:s,subprocessStdin:a,subprocess:u,waitReadableDestroy:f,waitWritableFinal:v,waitWritableDestroy:E},I)=>{await Promise.all([onReadableDestroy({subprocessStdout:s,subprocess:u,waitReadableDestroy:f},I),onWritableDestroy({subprocessStdin:a,subprocess:u,waitWritableFinal:v,waitWritableDestroy:E},I)])};const createIterable=(s,a,{from:u,binary:f=false,preserveNewlines:v=false}={})=>{const E=f||On.has(a);const I=getFromStream(s,u);const D=iterateOnSubprocessStream({subprocessStdout:I,subprocess:s,binary:E,shouldEncode:true,encoding:a,preserveNewlines:v});return iterateOnStdoutData(D,I,s)};const iterateOnStdoutData=async function*(s,a,u){try{yield*s}finally{if(a.readable){a.destroy()}await u}};const addConvertedStreams=(s,{encoding:a})=>{const u=initializeConcurrentStreams();s.readable=createReadable.bind(undefined,{subprocess:s,concurrentStreams:u,encoding:a});s.writable=createWritable.bind(undefined,{subprocess:s,concurrentStreams:u});s.duplex=createDuplex.bind(undefined,{subprocess:s,concurrentStreams:u,encoding:a});s.iterable=createIterable.bind(undefined,s,a);s[Symbol.asyncIterator]=createIterable.bind(undefined,s,a,{})};const mergePromise=(s,a)=>{for(const[u,f]of Ls){const v=f.value.bind(a);Reflect.defineProperty(s,u,{...f,value:v})}};const Rs=(async()=>{})().constructor.prototype;const Ls=["then","catch","finally"].map((s=>[s,Reflect.getOwnPropertyDescriptor(Rs,s)]));const execaCoreAsync=(s,a,u,f)=>{const{file:v,commandArguments:E,command:I,escapedCommand:D,startTime:N,verboseInfo:P,options:B,fileDescriptors:_}=handleAsyncArguments(s,a,u);const{subprocess:U,promise:q}=spawnSubprocessAsync({file:v,commandArguments:E,options:B,startTime:N,verboseInfo:P,command:I,escapedCommand:D,fileDescriptors:_});U.pipe=pipeToSubprocess.bind(undefined,{source:U,sourcePromise:q,boundOptions:{},createNested:f});mergePromise(U,q);mn.set(U,{options:B,fileDescriptors:_});return U};const handleAsyncArguments=(s,a,u)=>{const{command:f,escapedCommand:v,startTime:E,verboseInfo:I}=handleCommand(s,a,u);const{file:D,commandArguments:N,options:P}=normalizeOptions(s,a,u);const B=handleAsyncOptions(P);const _=handleStdioAsync(B,I);return{file:D,commandArguments:N,command:f,escapedCommand:v,startTime:E,verboseInfo:I,options:B,fileDescriptors:_}};const handleAsyncOptions=({timeout:s,signal:a,...u})=>{if(a!==undefined){throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.')}return{...u,timeoutDuration:s}};const spawnSubprocessAsync=({file:s,commandArguments:a,options:u,startTime:f,verboseInfo:v,command:I,escapedCommand:D,fileDescriptors:N})=>{let P;try{P=(0,E.spawn)(...concatenateShell(s,a,u))}catch(s){return handleEarlyError({error:s,command:I,escapedCommand:D,fileDescriptors:N,options:u,startTime:f,verboseInfo:v})}const B=new AbortController;(0,dn.setMaxListeners)(Number.POSITIVE_INFINITY,B.signal);const _=[...P.stdio];pipeOutputAsync(P,N,B);cleanupOnExit(P,u,B);const U={};const q=createDeferred();P.kill=subprocessKill.bind(undefined,{kill:P.kill.bind(P),options:u,onInternalError:q,context:U,controller:B});P.all=makeAllStream(P,u);addConvertedStreams(P,u);addIpcMethods(P,u);const H=handlePromise({subprocess:P,options:u,startTime:f,verboseInfo:v,fileDescriptors:N,originalStreams:_,command:I,escapedCommand:D,context:U,onInternalError:q,controller:B});return{subprocess:P,promise:H}};const handlePromise=async({subprocess:s,options:a,startTime:u,verboseInfo:f,fileDescriptors:v,originalStreams:E,command:I,escapedCommand:D,context:N,onInternalError:P,controller:B})=>{const[_,[U,q],H,Y,X]=await waitForSubprocessResult({subprocess:s,options:a,context:N,verboseInfo:f,fileDescriptors:v,originalStreams:E,onInternalError:P,controller:B});B.abort();P.resolve();const ee=H.map(((s,u)=>stripNewline(s,a,u)));const te=stripNewline(Y,a,"all");const ne=getAsyncResult({errorInfo:_,exitCode:U,signal:q,stdio:ee,all:te,ipcOutput:X,context:N,options:a,command:I,escapedCommand:D,startTime:u});return handleResult(ne,f,a)};const getAsyncResult=({errorInfo:s,exitCode:a,signal:u,stdio:f,all:v,ipcOutput:E,context:I,options:D,command:N,escapedCommand:P,startTime:B})=>"error"in s?makeError({error:s.error,command:N,escapedCommand:P,timedOut:I.terminationReason==="timeout",isCanceled:I.terminationReason==="cancel"||I.terminationReason==="gracefulCancel",isGracefullyCanceled:I.terminationReason==="gracefulCancel",isMaxBuffer:s.error instanceof MaxBufferError,isForcefullyTerminated:I.isForcefullyTerminated,exitCode:a,signal:u,stdio:f,all:v,ipcOutput:E,options:D,startTime:B,isSync:false}):makeSuccessResult({command:N,escapedCommand:P,stdio:f,all:v,ipcOutput:E,options:D,startTime:B});const mergeOptions=(s,a)=>{const u=Object.fromEntries(Object.entries(a).map((([a,u])=>[a,mergeOption(a,s[a],u)])));return{...s,...u}};const mergeOption=(s,a,u)=>{if(Us.has(s)&&isPlainObject(a)&&isPlainObject(u)){return{...a,...u}}return u};const Us=new Set(["env",...ne]);const createExeca=(s,a,u,f)=>{const createNested=(s,a,f)=>createExeca(s,a,u,f);const boundExeca=(...v)=>callBoundExeca({mapArguments:s,deepOptions:u,boundOptions:a,setBoundExeca:f,createNested:createNested},...v);if(f!==undefined){f(boundExeca,createNested,a)}return boundExeca};const callBoundExeca=({mapArguments:s,deepOptions:a={},boundOptions:u={},setBoundExeca:f,createNested:v},E,...I)=>{if(isPlainObject(E)){return v(s,mergeOptions(u,E),f)}const{file:D,commandArguments:N,options:P,isSync:B}=parseArguments({mapArguments:s,firstArgument:E,nextArguments:I,deepOptions:a,boundOptions:u});return B?execaCoreSync(D,N,P):execaCoreAsync(D,N,P,v)};const parseArguments=({mapArguments:s,firstArgument:a,nextArguments:u,deepOptions:f,boundOptions:v})=>{const E=isTemplateString(a)?parseTemplates(a,u):[a,...u];const[I,D,N]=normalizeParameters(...E);const P=mergeOptions(mergeOptions(f,v),N);const{file:B=I,commandArguments:_=D,options:U=P,isSync:q=false}=s({file:I,commandArguments:D,options:P});return{file:B,commandArguments:_,options:U,isSync:q}};const mapCommandAsync=({file:s,commandArguments:a})=>parseCommand(s,a);const mapCommandSync=({file:s,commandArguments:a})=>({...parseCommand(s,a),isSync:true});const parseCommand=(s,a)=>{if(a.length>0){throw new TypeError(`The command and its arguments must be passed as a single string: ${s} ${a}.`)}const[u,...f]=parseCommandString(s);return{file:u,commandArguments:f}};const parseCommandString=s=>{if(typeof s!=="string"){throw new TypeError(`The command must be a string: ${String(s)}.`)}const a=s.trim();if(a===""){return[]}const u=[];for(const s of a.split(Fs)){const a=u.at(-1);if(a&&a.endsWith("\\")){u[u.length-1]=`${a.slice(0,-1)} ${s}`}else{u.push(s)}}return u};const Fs=/ +/g;const setScriptSync=(s,a,u)=>{s.sync=a(mapScriptSync,u);s.s=s.sync};const mapScriptAsync=({options:s})=>getScriptOptions(s);const mapScriptSync=({options:s})=>({...getScriptOptions(s),isSync:true});const getScriptOptions=s=>({options:{...getScriptStdinOption(s),...s}});const getScriptStdinOption=({input:s,inputFile:a,stdio:u})=>s===undefined&&a===undefined&&u===undefined?{stdin:"inherit"}:{};const Gs={preferLocal:true};const Vs=createExeca((()=>({})));const Ws=createExeca((()=>({isSync:true})));const zs=createExeca(mapCommandAsync);const qs=createExeca(mapCommandSync);const Ks=createExeca(mapNode);const Hs=createExeca(mapScriptAsync,{},Gs,setScriptSync);const{sendMessage:Ys,getOneMessage:Js,getEachMessage:Zs,getCancelSignal:Xs}=getIpcExport()}};var u={};function __nccwpck_require__(s){var f=u[s];if(f!==undefined){return f.exports}var v=u[s]={exports:{}};var E=true;try{a[s](v,v.exports,__nccwpck_require__);E=false}finally{if(E)delete u[s]}return v.exports}(()=>{var s=typeof Symbol==="function"?Symbol("webpack queues"):"__webpack_queues__";var a=typeof Symbol==="function"?Symbol("webpack exports"):"__webpack_exports__";var u=typeof Symbol==="function"?Symbol("webpack error"):"__webpack_error__";var resolveQueue=s=>{if(s&&s.d<1){s.d=1;s.forEach((s=>s.r--));s.forEach((s=>s.r--?s.r++:s()))}};var wrapDeps=f=>f.map((f=>{if(f!==null&&typeof f==="object"){if(f[s])return f;if(f.then){var v=[];v.d=0;f.then((s=>{E[a]=s;resolveQueue(v)}),(s=>{E[u]=s;resolveQueue(v)}));var E={};E[s]=s=>s(v);return E}}var I={};I[s]=s=>{};I[a]=f;return I}));__nccwpck_require__.a=(f,v,E)=>{var I;E&&((I=[]).d=-1);var D=new Set;var N=f.exports;var P;var B;var _;var U=new Promise(((s,a)=>{_=a;B=s}));U[a]=N;U[s]=s=>(I&&s(I),D.forEach(s),U["catch"]((s=>{})));f.exports=U;v((f=>{P=wrapDeps(f);var v;var getResult=()=>P.map((s=>{if(s[u])throw s[u];return s[a]}));var E=new Promise((a=>{v=()=>a(getResult);v.r=0;var fnQueue=s=>s!==I&&!D.has(s)&&(D.add(s),s&&!s.d&&(v.r++,s.push(v)));P.map((a=>a[s](fnQueue)))}));return v.r?E:getResult()}),(s=>(s?_(U[u]=s):B(N),resolveQueue(I))));I&&I.d<0&&(I.d=0)}})();(()=>{__nccwpck_require__.d=(s,a)=>{for(var u in a){if(__nccwpck_require__.o(a,u)&&!__nccwpck_require__.o(s,u)){Object.defineProperty(s,u,{enumerable:true,get:a[u]})}}}})();(()=>{__nccwpck_require__.o=(s,a)=>Object.prototype.hasOwnProperty.call(s,a)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var f=__nccwpck_require__(657);f=await f;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sv-router",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Modern Svelte Routing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svelte",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"templates"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@clack/prompts": "^
|
|
27
|
-
"execa": "^9.6.
|
|
26
|
+
"@clack/prompts": "^1.1.0",
|
|
27
|
+
"execa": "^9.6.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@vercel/ncc": "^0.38.
|
|
30
|
+
"@vercel/ncc": "^0.38.4"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"dev": "node src",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"sv-router": "latest"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
16
|
-
"svelte": "^5.
|
|
17
|
-
"svelte-check": "^4.
|
|
18
|
-
"typescript": "^
|
|
19
|
-
"vite": "^
|
|
15
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
16
|
+
"svelte": "^5.55.3",
|
|
17
|
+
"svelte-check": "^4.4.6",
|
|
18
|
+
"typescript": "^6.0.2",
|
|
19
|
+
"vite": "^8.0.8"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"sv-router": "latest"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
16
|
-
"svelte": "^5.
|
|
17
|
-
"svelte-check": "^4.
|
|
18
|
-
"typescript": "^
|
|
19
|
-
"vite": "^
|
|
15
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
16
|
+
"svelte": "^5.55.3",
|
|
17
|
+
"svelte-check": "^4.4.6",
|
|
18
|
+
"typescript": "^6.0.2",
|
|
19
|
+
"vite": "^8.0.8"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"sv-router": "latest"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
17
|
-
"svelte": "^5.
|
|
18
|
-
"svelte-check": "^4.
|
|
19
|
-
"typescript": "^
|
|
20
|
-
"vite": "^
|
|
16
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
17
|
+
"svelte": "^5.55.3",
|
|
18
|
+
"svelte-check": "^4.4.6",
|
|
19
|
+
"typescript": "^6.0.2",
|
|
20
|
+
"vite": "^8.0.8"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"sv-router": "latest"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
17
|
-
"svelte": "^5.
|
|
18
|
-
"svelte-check": "^4.
|
|
19
|
-
"typescript": "^
|
|
20
|
-
"vite": "^
|
|
16
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
17
|
+
"svelte": "^5.55.3",
|
|
18
|
+
"svelte-check": "^4.4.6",
|
|
19
|
+
"typescript": "^6.0.2",
|
|
20
|
+
"vite": "^8.0.8"
|
|
21
21
|
}
|
|
22
22
|
}
|