create-sv-router 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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("",""),bold:a("","",""),dim:a("","",""),italic:a("",""),underline:a("",""),inverse:a("",""),hidden:a("",""),strikethrough:a("",""),black:a("",""),red:a("",""),green:a("",""),yellow:a("",""),blue:a("",""),magenta:a("",""),cyan:a("",""),white:a("",""),gray:a("",""),bgBlack:a("",""),bgRed:a("",""),bgGreen:a("",""),bgYellow:a("",""),bgBlue:a("",""),bgMagenta:a("",""),bgCyan:a("",""),bgWhite:a("",""),blackBright:a("",""),redBright:a("",""),greenBright:a("",""),yellowBright:a("",""),blueBright:a("",""),magentaBright:a("",""),cyanBright:a("",""),whiteBright:a("",""),bgBlackBright:a("",""),bgRedBright:a("",""),bgGreenBright:a("",""),bgYellowBright:a("",""),bgBlueBright:a("",""),bgMagentaBright:a("",""),bgCyanBright:a("",""),bgWhiteBright:a("","")}};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(942);var F=l(940);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 template.",options:[{value:"file-based",label:"File-based routing"},{value:"code-based",label:"Code-based routing"}]});checkCancel(M);const _=d.join(process.cwd(),A);if(A){D.mkdirSync(_,{recursive:true})}D.cpSync(d.join(C,"../templates",M),_,{recursive:true});const G=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(G);if(G){const X=y.u1();X.start("Installing dependencies with "+G);try{await(0,F.Ho)(G,["install"],{cwd:_});X.stop("Dependencies installed with "+G)}catch(ee){X.stop("Failed to install dependencies with "+G);console.error(ee);process.exit(1)}}const W=await y.lJ({message:"Initialize a git repository?"});checkCancel(W);if(W){try{await(0,F.Ho)("git",["init"],{cwd:_});y.Rm.step("Git repository initialized")}catch(te){y.Rm.error("Failed to initialize git repository");console.error(te);process.exit(1)}}y.Md("You're all set! You can now run:");const V=[...A?[`cd ${A}`]:[],...G?[]:["npm install"],(G||"npm")+" run dev"].map(((s,a)=>{const l=`${a+1}.`;const D=`${s}`;return`${l} ${D}`}));console.log([...V,""].join("\n"));a()}catch(ne){a(ne)}}),1)},942:(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 CD(){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="",ee.bgColor.close="",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=CD(),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.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),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("└","—"),Ze=u("●",">"),Je=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(Ze)} ${a}`:`${C.dim(Je)} ${C.dim(a)}`} ${C.dim("/")} ${this.value?`${C.dim(Je)} ${C.dim(l)}`:`${C.green(Ze)} ${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(Ze)} ${l} ${s.hint?C.dim(`(${s.hint})`):""}`;case"cancelled":return`${C.strikethrough(C.dim(l))}`;default:return`${C.dim(Je)} ${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)}}},940:(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 Ze=format(40,49);const Je=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:Zt,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 Jt.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!==Zt){return false}Jt.abort(s.message);return true};const Zt="execa:ipc:cancel";const abortOnDisconnect=()=>{Jt.abort(getAbortDisconnectError())};const Jt=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};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)(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=Zn.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 Zn=globalThis.process;const{onExit:Jn,load:Xn,unload:Qn}=signalExitWrap(processOk(Zn)?new SignalExit(Zn):new SignalExitFallback);const cleanupOnExit=(s,{cleanup:a,detached:l},{signal:D})=>{if(!a||l){return}const d=Jn((()=>{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)(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={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("",""),bold:a("","",""),dim:a("","",""),italic:a("",""),underline:a("",""),inverse:a("",""),hidden:a("",""),strikethrough:a("",""),black:a("",""),red:a("",""),green:a("",""),yellow:a("",""),blue:a("",""),magenta:a("",""),cyan:a("",""),white:a("",""),gray:a("",""),bgBlack:a("",""),bgRed:a("",""),bgGreen:a("",""),bgYellow:a("",""),bgBlue:a("",""),bgMagenta:a("",""),bgCyan:a("",""),bgWhite:a("",""),blackBright:a("",""),redBright:a("",""),greenBright:a("",""),yellowBright:a("",""),blueBright:a("",""),magentaBright:a("",""),cyanBright:a("",""),whiteBright:a("",""),bgBlackBright:a("",""),bgRedBright:a("",""),bgGreenBright:a("",""),bgYellowBright:a("",""),bgBlueBright:a("",""),bgMagentaBright:a("",""),bgCyanBright:a("",""),bgWhiteBright:a("","")}};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(942);var F=l(940);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 template.",options:[{value:"file-based",label:"File-based routing"},{value:"code-based",label:"Code-based routing"}]});checkCancel(M);const _=d.join(process.cwd(),A);if(A){D.mkdirSync(_,{recursive:true})}D.cpSync(d.join(C,"../templates",M),_,{recursive:true});D.renameSync(d.join(_,"gitignore"),d.join(_,".gitignore"));const G=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(G);if(G){const X=y.u1();X.start("Installing dependencies with "+G);try{await(0,F.Ho)(G,["install"],{cwd:_});X.stop("Dependencies installed with "+G)}catch(ee){X.stop("Failed to install dependencies with "+G);console.error(ee);process.exit(1)}}const W=await y.lJ({message:"Initialize a git repository?"});checkCancel(W);if(W){try{await(0,F.Ho)("git",["init"],{cwd:_});y.Rm.step("Git repository initialized")}catch(te){y.Rm.error("Failed to initialize git repository");console.error(te);process.exit(1)}}y.Md("You're all set! You can now run:");const V=[...A?[`cd ${A}`]:[],...G?[]:["npm install"],(G||"npm")+" run dev"].map(((s,a)=>{const l=`${a+1}.`;const D=`${s}`;return`${l} ${D}`}));console.log([...V,""].join("\n"));a()}catch(ne){a(ne)}}),1)},942:(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 CD(){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="",ee.bgColor.close="",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=CD(),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.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),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("└","—"),Ze=u("●",">"),Je=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(Ze)} ${a}`:`${C.dim(Je)} ${C.dim(a)}`} ${C.dim("/")} ${this.value?`${C.dim(Je)} ${C.dim(l)}`:`${C.green(Ze)} ${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(Ze)} ${l} ${s.hint?C.dim(`(${s.hint})`):""}`;case"cancelled":return`${C.strikethrough(C.dim(l))}`;default:return`${C.dim(Je)} ${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)}}},940:(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 Ze=format(40,49);const Je=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:Zt,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 Jt.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!==Zt){return false}Jt.abort(s.message);return true};const Zt="execa:ipc:cancel";const abortOnDisconnect=()=>{Jt.abort(getAbortDisconnectError())};const Jt=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};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)(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=Zn.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 Zn=globalThis.process;const{onExit:Jn,load:Xn,unload:Qn}=signalExitWrap(processOk(Zn)?new SignalExit(Zn):new SignalExitFallback);const cleanupOnExit=(s,{cleanup:a,detached:l},{signal:D})=>{if(!a||l){return}const d=Jn((()=>{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)(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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sv-router",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Modern Svelte Routing",
5
5
  "keywords": [
6
6
  "svelte",
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -13,7 +13,6 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
16
- "@tsconfig/svelte": "^5.0.4",
17
16
  "svelte": "^5.20.2",
18
17
  "svelte-check": "^4.1.4",
19
18
  "typescript": "~5.7.2",
@@ -0,0 +1,26 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
25
+
26
+ .router
@@ -14,7 +14,6 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
17
- "@tsconfig/svelte": "^5.0.4",
18
17
  "svelte": "^5.20.2",
19
18
  "svelte-check": "^4.1.4",
20
19
  "typescript": "~5.7.2",