UNPKG

chromatic

Version:

Automate visual testing across browsers. Gather UI feedback. Versioned documentation.

26 lines (24 loc) 112 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b5586c13-1da7-5ace-b8b9-d308ca995738")}catch(e){}}(); const e=require(`./chunk-gGpyby2o.cjs`);let t=require(`node:util`),n=require(`node:child_process`),r=require(`node:fs`),i=require(`node:os`),a=require(`node:path`);a=e.a(a,1);let o=require(`node:stream`),s=require(`node:process`);s=e.a(s,1);let c=require(`node:url`),l=require(`node:buffer`),u=require(`node:timers/promises`),d=require(`node:string_decoder`),f=require(`node:tty`);f=e.a(f,1);let p=require(`node:events`),m=require(`node:v8`),h=require(`node:stream/promises`);var g=e.t(((e,t)=>{t.exports=a,a.sync=o;var n=require(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}})),_=e.t(((e,t)=>{t.exports=r,r.sync=i;var n=require(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),v=e.t(((e,t)=>{require(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?g():_();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),y=e.t(((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=require(`path`),i=n?`;`:`:`,a=v(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}})),b=e.t(((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),x=e.t(((e,t)=>{let n=require(`path`),r=y(),i=b();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o})),S=e.t(((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),C=e.t(((e,t)=>{t.exports=/^#!(.*)/})),ee=e.t(((e,t)=>{let n=C();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),te=e.t(((e,t)=>{let n=require(`fs`),r=ee();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i})),ne=e.t(((e,t)=>{let n=require(`path`),r=x(),i=S(),a=te(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d})),re=e.t(((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}})),ie=e.t(((e,t)=>{let n=require(`child_process`),r=ne(),i=re();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})),ae=e.a(ie(),1);const w=[];w.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&w.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&w.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const oe=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,se=Symbol.for(`signal-exit emitter`),ce=globalThis,le=Object.defineProperty.bind(Object);var ue=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(ce[se])return ce[se];le(ce,se,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},de=class{};const fe=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var pe=class extends de{onExit(){return()=>{}}load(){}unload(){}},me=class extends de{#e=he.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new ue;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of w)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!oe(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of w)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,w.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return oe(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&oe(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const he=globalThis.process,{onExit:ge,load:_e,unload:ve}=fe(oe(he)?new me(he):new pe);function T(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const ye=(e,t)=>{let n=Se(be(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},be=e=>xe(e)?e.toString():e,xe=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Se=e=>e instanceof URL?(0,c.fileURLToPath)(e):e,Ce=(e,t=[],n={})=>{let r=ye(e,`First argument`),[i,a]=T(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!T(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]},{toString:we}=Object.prototype,Te=e=>we.call(e)===`[object ArrayBuffer]`,E=e=>we.call(e)===`[object Uint8Array]`,D=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ee=new TextEncoder,De=e=>Ee.encode(e),Oe=new TextDecoder,ke=e=>Oe.decode(e),Ae=(e,t)=>je(e,t).join(``),je=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new d.StringDecoder(t),r=e.map(e=>typeof e==`string`?De(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Me=e=>e.length===1&&E(e[0])?e[0]:Pe(Ne(e)),Ne=e=>e.map(e=>typeof e==`string`?De(e):e),Pe=e=>{let t=new Uint8Array(Fe(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Fe=e=>{let t=0;for(let n of e)t+=n.length;return t},Ie=e=>Array.isArray(e)&&Array.isArray(e.raw),Le=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Re({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Re=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=ze(i,e.raw[r]),c=He(n,a,o);if(r===t.length)return c;let l=t[r];return He(c,Array.isArray(l)?l.map(e=>Ue(e)):[Ue(l)],s)},ze=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Be.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Be.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===` `?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=Ve[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Be=new Set([` `,` `,`\r`,` `]),Ve={x:3,u:5},He=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ue=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(T(e)&&(`stdout`in e||`isMaxBuffer`in e))return We(e);throw e instanceof n.ChildProcess||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},We=({stdout:e})=>{if(typeof e==`string`)return e;if(E(e))return ke(e);throw TypeError(e===void 0?`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`:`Unexpected "${typeof e}" stdout in template expression`)},O=e=>Ge.includes(e),Ge=[s.default.stdin,s.default.stdout,s.default.stderr],k=[`stdin`,`stdout`,`stderr`],Ke=e=>k[e]??`stdio[${e}]`,qe=e=>{let t={...e};for(let n of at)t[n]=Je(e,n);return t},Je=(e,t)=>{let n=Array.from({length:Ye(e)+1});return rt(Xe(e[t],n,t),t)},Ye=({stdio:e})=>Array.isArray(e)?Math.max(e.length,k.length):k.length,Xe=(e,t,n)=>T(e)?Ze(e,t,n):t.fill(e),Ze=(e,t,n)=>{for(let r of Object.keys(e).sort(Qe))for(let i of et(r,n,t))t[i]=e[r];return t},Qe=(e,t)=>$e(e)<$e(t)?1:-1,$e=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,et=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=tt(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid. It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist. Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},tt=e=>{if(e===`all`)return e;if(k.includes(e))return k.indexOf(e);let t=nt.exec(e);if(t!==null)return Number(t[1])},nt=/^fd(\d+)$/,rt=(e,t)=>e.map(e=>e===void 0?it[t]:e),it={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:(0,t.debuglog)(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},at=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],A=(e,t)=>t===`ipc`?e.at(-1):e[t],ot=({verbose:e},t)=>lt(e,t)!==`none`,st=({verbose:e},t)=>![`none`,`short`].includes(lt(e,t)),ct=({verbose:e},t)=>{let n=lt(e,t);return dt(n)?n:void 0},lt=(e,t)=>t===void 0?ut(e):A(e,t),ut=e=>e.find(e=>dt(e))??ft.findLast(t=>e.includes(t)),dt=e=>typeof e==`function`,ft=[`none`,`short`,`full`],pt=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>bt(ht(e))).join(` `)}},mt=e=>(0,t.stripVTControlCharacters)(e).split(` `).map(e=>ht(e)).join(` `),ht=e=>e.replaceAll(_t,e=>gt(e)),gt=e=>{let t=vt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=yt?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},_t=(()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),vt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},yt=65535,bt=e=>xt.test(e)?e:s.platform===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,xt=/^[\w./-]+$/;function St(){let{env:e}=s.default,{TERM:t,TERM_PROGRAM:n}=e;return s.default.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const Ct={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:`╱`},wt={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:`⅒`},Tt={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`},Et={...Ct,...wt},Dt={...Ct,...Tt},Ot=St()?Et:Dt;Object.entries(wt);const kt=f.default?.WriteStream?.prototype?.hasColors?.()??!1,j=(e,t)=>{if(!kt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};j(0,0);const At=j(1,22);j(2,22),j(3,23),j(4,24),j(53,55),j(7,27),j(8,28),j(9,29),j(30,39),j(31,39),j(32,39),j(33,39),j(34,39),j(35,39),j(36,39),j(37,39);const jt=j(90,39);j(40,49),j(41,49),j(42,49),j(43,49),j(44,49),j(45,49),j(46,49),j(47,49),j(100,49);const Mt=j(91,39);j(92,39);const Nt=j(93,39);j(94,39),j(95,39),j(96,39),j(97,39),j(101,49),j(102,49),j(103,49),j(104,49),j(105,49),j(106,49),j(107,49);const Pt=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=Ft(n),c=Rt[e]({failed:a,reject:o,piped:r}),l=Bt[e]({reject:o});return`${jt(`[${s}]`)} ${jt(`[${i}]`)} ${l(c)} ${l(t)}`},Ft=e=>`${It(e.getHours(),2)}:${It(e.getMinutes(),2)}:${It(e.getSeconds(),2)}.${It(e.getMilliseconds(),3)}`,It=(e,t)=>String(e).padStart(t,`0`),Lt=({failed:e,reject:t})=>e?t?Ot.cross:Ot.warning:Ot.tick,Rt={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Lt,duration:Lt},zt=e=>e,Bt={command:()=>At,output:()=>zt,ipc:()=>zt,error:({reject:e})=>e?Mt:Nt,duration:()=>jt},Vt=(e,t,n)=>{let r=ct(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Ht(e,t,r)).filter(e=>e!==void 0).map(e=>Ut(e)).join(``)},Ht=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Ut=e=>e.endsWith(` `)?e:`${e}\n`,M=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Vt(Gt(t,Wt({type:e,result:i,verboseInfo:r})),r,n);a!==``&&console.warn(a.slice(0,-1))},Wt=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...a}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:a}),Gt=(e,t)=>e.split(` `).map(e=>Kt({...t,message:e})),Kt=e=>({verboseLine:Pt(e),verboseObject:e}),qt=e=>mt(typeof e==`string`?e:(0,t.inspect)(e)).replaceAll(` `,` `.repeat(Jt)),Jt=2,Yt=(e,t)=>{ot(t)&&M({type:`command`,verboseMessage:e,verboseInfo:t})},Xt=(e,t,n)=>($t(e),{verbose:e,escapedCommand:t,commandId:Zt(e),rawOptions:n}),Zt=e=>ot({verbose:e})?Qt++:void 0;let Qt=0n;const $t=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!ft.includes(t)&&!dt(t)){let e=ft.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},en=()=>s.hrtime.bigint(),tn=e=>Number(s.hrtime.bigint()-e)/1e6,nn=(e,t,n)=>{let r=en(),{command:i,escapedCommand:a}=pt(e,t),o=Xt(Je(n,`verbose`),a,{...n});return Yt(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}};function rn(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}(0,t.promisify)(n.execFile);function an(e){return e instanceof URL?(0,c.fileURLToPath)(e):e}function on(e){return{*[Symbol.iterator](){let t=a.default.resolve(an(e)),n;for(;n!==t;)yield t,n=t,t=a.default.resolve(t,`..`)}}}const sn=({cwd:e=s.default.cwd(),path:t=s.default.env[rn()],preferLocal:n=!0,execPath:r=s.default.execPath,addExecPath:i=!0}={})=>{let o=a.default.resolve(an(e)),c=[],l=t.split(a.default.delimiter);return n&&cn(c,l,o),i&&ln(c,l,r,o),t===``||t===a.default.delimiter?`${c.join(a.default.delimiter)}${t}`:[...c,t].join(a.default.delimiter)},cn=(e,t,n)=>{for(let r of on(n)){let n=a.default.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},ln=(e,t,n,r)=>{let i=a.default.resolve(r,an(n),`..`);t.includes(i)||e.push(i)},un=({env:e=s.default.env,...t}={})=>{e={...e};let n=rn({env:e});return t.path=e[n],e[n]=sn(t),e},dn=(e,t,n)=>new(n?_n:gn)(t,e instanceof N?{}:{cause:e});var N=class extends Error{};const fn=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,mn,{value:!0,writable:!1,enumerable:!1,configurable:!1})},pn=e=>hn(e)&&mn in e,mn=Symbol(`isExecaError`),hn=e=>Object.prototype.toString.call(e)===`[object Error]`;var gn=class extends Error{};fn(gn,gn.name);var _n=class extends Error{};fn(_n,_n.name);const vn=()=>{let e=64-bn+1;return Array.from({length:e},yn)},yn=(e,t)=>({name:`SIGRT${t+1}`,number:bn+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),bn=34,xn=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}],Sn=()=>{let e=vn();return[...xn,...e].map(Cn)},Cn=({name:e,number:t,description:n,action:r,forced:a=!1,standard:o})=>{let{signals:{[e]:s}}=i.constants,c=s!==void 0;return{name:e,number:c?s:t,description:n,supported:c,action:r,forced:a,standard:o}},wn=()=>{let e=Sn();return Object.fromEntries(e.map(Tn))},Tn=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],En=wn(),Dn=()=>{let e=Sn(),t=Array.from({length:65},(t,n)=>On(n,e));return Object.assign({},...t)},On=(e,t)=>{let n=kn(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},kn=(e,t)=>{let n=t.find(({name:t})=>i.constants.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Dn();const An=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Mn(e,t)},jn=e=>e===0?e:Mn(e,"`subprocess.kill()`'s argument"),Mn=(e,t)=>{if(Number.isInteger(e))return Nn(e,t);if(typeof e==`string`)return Fn(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${In()}`)},Nn=(e,t)=>{if(Pn.has(e))return Pn.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${In()}`)},Pn=new Map(Object.entries(i.constants.signals).reverse().map(([e,t])=>[t,e])),Fn=(e,t)=>{if(e in i.constants.signals)return e;throw e.toUpperCase()in i.constants.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${In()}`)},In=()=>`Available signal names: ${Ln()}. Available signal numbers: ${Rn()}.`,Ln=()=>Object.keys(i.constants.signals).sort().map(e=>`'${e}'`).join(`, `),Rn=()=>[...new Set(Object.values(i.constants.signals).sort((e,t)=>e-t))].join(`, `),zn=e=>En[e].description,Bn=e=>{if(e===!1)return e;if(e===!0)return Vn;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Vn=1e3*5,Hn=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Un(o,s,n);Wn(l,r);let u=e(c);return Gn({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Un=(e,t,n)=>{let[r=n,i]=hn(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!hn(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:jn(r),error:i}},Wn=(e,t)=>{e!==void 0&&t.reject(e)},Gn=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&Kn({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},Kn=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await(0,u.setTimeout)(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},qn=async(e,t)=>{e.aborted||await(0,p.once)(e,`abort`,{signal:t})},Jn=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Yn=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Xn(e,t,r,i)],Xn=async(e,t,n,{signal:r})=>{throw await qn(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},Zn=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{Qn(e,t,n),$n(e,t,r)},Qn=(e,t,n)=>{if(!n)throw Error(`${P(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},$n=(e,t,n)=>{if(!n)throw Error(`${P(e,t)} cannot be used: the ${F(t)} has already exited or disconnected.`)},er=e=>{throw Error(`${P(`getOneMessage`,e)} could not complete: the ${F(e)} exited or disconnected.`)},tr=e=>{throw Error(`${P(`sendMessage`,e)} failed: the ${F(e)} is sending a message too, instead of listening to incoming messages. This can be fixed by both sending a message and listening to incoming messages at the same time: const [receivedMessage] = await Promise.all([ ${P(`getOneMessage`,e)}, ${P(`sendMessage`,e,`message, {strict: true}`)}, ]);`)},nr=(e,t)=>Error(`${P(`sendMessage`,t)} failed when sending an acknowledgment response to the ${F(t)}.`,{cause:e}),rr=e=>{throw Error(`${P(`sendMessage`,e)} failed: the ${F(e)} is not listening to incoming messages.`)},ir=e=>{throw Error(`${P(`sendMessage`,e)} failed: the ${F(e)} exited without listening to incoming messages.`)},ar=()=>Error(`\`cancelSignal\` aborted: the ${F(!0)} disconnected.`),or=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},sr=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${P(t,n)} cannot be used: the ${F(n)} is disconnecting.`,{cause:e})},cr=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(lr(e))throw Error(`${P(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},lr=({code:e,message:t})=>ur.has(e)||dr.some(e=>t.includes(e)),ur=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),dr=[`could not be cloned`,`circular structure`,`call stack size exceeded`],P=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${fr(t)}${e}(${n})`,fr=e=>e?``:`subprocess.`,F=e=>e?`parent process`:`subprocess`,pr=e=>{e.connected&&e.disconnect()},I=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},mr=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=L.get(e),i=gr(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(yr(i,t,n,!0));return a},hr=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=L.get(e),i=gr(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(yr(i,t,n,!1));return a},L=new WeakMap,gr=(e,t,n)=>{let r=_r(t,n);return vr(r,t,n,e),r},_r=(e,t)=>{let n=tt(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${R(t)}" must not be "${e}". It must be ${r} or "fd3", "fd4" (and so on). It is optional and defaults to "${i}".`)},vr=(e,t,n,r)=>{let i=r[xr(e)];if(i===void 0)throw TypeError(`"${R(n)}" must not be ${t}. That file descriptor does not exist. Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${R(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${R(n)}" must not be ${t}. It must be a writable stream, not readable.`)},yr=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=br(e,n);return`The "${i}: ${Sr(a)}" option is incompatible with using "${R(r)}: ${Sr(t)}". Please set this option with "pipe" instead.`},br=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=xr(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},xr=e=>e===`all`?1:e,R=e=>e?`to`:`from`,Sr=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,z=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),(0,p.addAbortListener)(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},Cr=(e,t)=>{t&&wr(e)},wr=e=>{e.refCounted()},Tr=(e,t)=>{t&&Er(e)},Er=e=>{e.unrefCounted()},Dr=(e,t)=>{t&&(Er(e),Er(e))},Or=(e,t)=>{t&&(wr(e),wr(e))},kr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(zr(i)||ai(i))return;B.has(e)||B.set(e,[]);let a=B.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await qr(e,r,i),await u.scheduler.yield();let o=await Rr({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Ar=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{si();let a=B.get(e);for(;a?.length>0;)await(0,p.once)(r,`message:done`);e.removeListener(`message`,i),Or(t,n),r.connected=!1,r.emit(`disconnect`)},B=new WeakMap,jr=(e,t,n)=>{if(Mr.has(e))return Mr.get(e);let r=new p.EventEmitter;return r.connected=!0,Mr.set(e,r),Nr({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Mr=new WeakMap,Nr=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=kr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Ar.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Dr(n,r)},Pr=e=>{let t=Mr.get(e);return t===void 0?e.channel!==null:t.connected},Fr=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Jr(e,jr(e,t,n));return{id:Ir++,type:Ur,message:r,hasListeners:a}};let Ir=0n;const Lr=(e,t)=>{if(!(t?.type!==Ur||t.hasListeners))for(let{id:t}of e)t!==void 0&&Vr[t].resolve({isDeadlock:!0,hasListeners:!1})},Rr=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==Ur||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:Wr,message:Jr(t,i)};try{await Xr({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},zr=e=>{if(e?.type!==Wr)return!1;let{id:t,message:n}=e;return Vr[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Br=async(e,t,n)=>{if(e?.type!==Ur)return;let r=I();Vr[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Hr(t,n,i)]);e&&tr(n),a||rr(n)}finally{i.abort(),delete Vr[e.id]}},Vr={},Hr=async(e,t,{signal:n})=>{z(e,1,n),await(0,p.once)(e,`disconnect`,{signal:n}),ir(t)},Ur=`execa:ipc:request`,Wr=`execa:ipc:response`,Gr=(e,t,n)=>{V.has(e)||V.set(e,new Set);let r=V.get(e),i={onMessageSent:I(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},Kr=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},qr=async(e,t,n)=>{for(;!Jr(e,t)&&V.get(e)?.size>0;){let t=[...V.get(e)];Lr(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},V=new WeakMap,Jr=(e,t)=>t.listenerCount(`message`)>Yr(e),Yr=e=>L.has(e)&&!A(L.get(e).options.buffer,`ipc`)?1:0,Xr=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return Zn({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),Zr({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},Zr=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Fr({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=Gr(e,o,a);try{await Qr({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw pr(e),t}finally{Kr(s)}},Qr=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=$r(e);try{await Promise.all([Br(r,e,n),a(r)])}catch(e){throw sr({error:e,methodName:t,isSubprocess:n}),cr({error:e,methodName:t,isSubprocess:n,message:i}),e}},$r=e=>{if(ei.has(e))return ei.get(e);let n=(0,t.promisify)(e.send.bind(e));return ei.set(e,n),n},ei=new WeakMap,ti=(e,t)=>{let n=`cancelSignal`;return $n(n,!1,e.connected),Qr({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:oi,message:t},message:t})},ni=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await ri({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),ci.signal),ri=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!ii){if(ii=!0,!r){or();return}if(t===null){si();return}jr(e,t,n),await u.scheduler.yield()}};let ii=!1;const ai=e=>e?.type===oi?(ci.abort(e.message),!0):!1,oi=`execa:ipc:cancel`,si=()=>{ci.abort(ar())},ci=new AbortController,li=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},ui=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[di({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],di=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await qn(t,i),await ti(e,fi(t)),Kn({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},fi=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,`stack`,{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},pi=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},mi=(e,t,n,r)=>t===0||t===void 0?[]:[hi(e,t,n,r)],hi=async(e,t,n,{signal:r})=>{throw await(0,u.setTimeout)(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new N},gi=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},_i=(e,t,{node:n=!1,nodePath:r=s.execPath,nodeOptions:i=s.execArgv.filter(e=>!e.startsWith(`--inspect`)),cwd:o,execPath:c,...l})=>{if(c!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let u=ye(r,`The "nodePath" option`),d=a.default.resolve(o,u),f={...l,nodePath:d,node:n,cwd:o};if(!n)return[e,t,f];if(a.default.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[d,[...i,e,...t],{ipc:!0,...f,shell:!1}]},vi=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");yi[n](e)}},yi={advanced:e=>{try{(0,m.serialize)(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},bi=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},xi=({encoding:e})=>{if(Ci.has(e))return;let t=wi(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Ei(e)}\`. Please rename it to ${Ei(t)}.`);let n=[...Ci].map(e=>Ei(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Ei(e)}\`. Please rename it to one of: ${n}.`)},Si=new Set([`utf8`,`utf16le`]),H=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Ci=new Set([...Si,...H]),wi=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Ti)return Ti[t];if(Ci.has(t))return t},Ti={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Ei=e=>typeof e==`string`?`"${e}"`:String(e),Di=(e=Oi())=>{let t=ye(e,`The "cwd" option`);return a.default.resolve(t)},Oi=()=>{try{return s.default.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},ki=(e,t)=>{if(t===Oi())return e;let n;try{n=(0,r.statSync)(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`},Ai=(e,t,n)=>{n.cwd=Di(n.cwd);let[r,i,o]=_i(e,t,n),{command:c,args:l,options:u}=ae.default._parse(r,i,o),d=ji(qe(u));return pi(d),xi(d),vi(d),Jn(d),li(d),d.shell=Se(d.shell),d.env=Mi(d),d.killSignal=An(d.killSignal),d.forceKillAfterDelay=Bn(d.forceKillAfterDelay),d.lines=d.lines.map((e,t)=>e&&!H.has(d.encoding)&&d.buffer[t]),s.default.platform===`win32`&&a.default.basename(c,`.exe`)===`cmd`&&l.unshift(`/q`),{file:c,commandArguments:l,options:d}},ji=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,all:s=!1,windowsHide:c=!0,killSignal:l=`SIGTERM`,forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m=`advanced`,...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,all:s,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),Mi=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{...s.default.env,...e}:e;return n||r?un({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},Ni=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function Pi(e){if(typeof e==`string`)return Fi(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return Ii(e)}const Fi=e=>e.at(-1)===Li?e.slice(0,e.at(-2)===zi?-2:-1):e,Ii=e=>e.at(-1)===Ri?e.subarray(0,e.at(-2)===Bi?-2:-1):e,Li=` `,Ri=` `.codePointAt(0),zi=`\r`,Bi=`\r`.codePointAt(0);function U(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function Vi(e,{checkOpen:t=!0}={}){return U(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==`function`&&typeof e.end==`function`&&typeof e.writable==`boolean`&&typeof e.writableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function Hi(e,{checkOpen:t=!0}={}){return U(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==`function`&&typeof e.readable==`boolean`&&typeof e.readableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function Ui(e,t){return Vi(e,t)&&Hi(e,t)}const Wi=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var Gi=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Ki=Symbol();function qi(){return this[Ki].next()}Object.defineProperty(qi,`name`,{value:`next`});function Ji(e){return this[Ki].return(e)}Object.defineProperty(Ji,`name`,{value:`return`});const Yi=Object.create(Wi,{next:{enumerable:!0,configurable:!0,writable:!0,value:qi},return:{enumerable:!0,configurable:!0,writable:!0,value:Ji}});function Xi({preventCancel:e=!1}={}){let t=new Gi(this.getReader(),e),n=Object.create(Yi);return n[Ki]=t,n}const Zi=e=>{if(Hi(e,{checkOpen:!1})&&ta.on!==void 0)return $i(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Qi.call(e)===`[object ReadableStream]`)return Xi.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Qi}=Object.prototype,$i=async function*(e){let t=new AbortController,n={};ea(e,t,n);try{for await(let[n]of ta.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},ea=async(e,t,n)=>{try{await ta.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},ta={},na=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Zi(e),u=t();u.length=0;try{for await(let e of l)ia({convertedChunk:n[oa(e)](e,u),state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return ra({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},ra=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&ia({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},ia=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){aa(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&aa(c,t,i,a),new ca},aa=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},oa=e=>{let t=typeof e;if(t===