lete,t,r,n,i,o,s,a;functionl(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}functionc(e){returne&&e.__esModule?e.default:e;}functionu(e,t,r){if("function"==typeoft&&(r=t,t={}),!r){if("function"!=typeofPromise)throwTypeError("callback not provided");returnnewPromise(function(r,n){u(e,t||{},function(e,t){e?n(e):r(t);});});}rH(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n);});}functionp(e,t){letr;letn=e.options.env||process.env,i=process.cwd(),o=null!=e.options.cwd,s=o&&void0!==process.chdir&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd);}catch(e){}try{r=rG.sync(e.command,{path:n[rV({env:n})],pathExt:t?n3.delimiter:void0});}catch(e){}finally{s&&process.chdir(i);}returnr&&(r=n3.resolve(o?e.options.cwd:"",r)),r;}functiond(e,t){returnObject.assign(Error(`${t}${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t}${e.command}`,path:e.command,spawnargs:e.args});}functionf(e,t){returniO&&1===e&&!t.file?d(t.original,"spawn"):null;}functionh(e,t,r){letn=rF(e,t,r),i=ri.spawn(n.command,n.args,n.options);returnrY.hookChildProcess(i,n),i;}functionm(e){lett="string"==typeofe?"\n":"\n".charCodeAt(),r="string"==typeofe?"\r":"\r".charCodeAt();returne[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e;}functionv(e={}){let{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path";}functiong({env:e=c(ru).env,...t}={}){letr=v({env:e={...e}});returnt.path=e[r],e[r]=function(e={}){lett;let{cwd:r=c(ru).cwd(),path:n=c(ru).env[v()],execPath:i=c(ru).execPath}=e,o=iinstanceofURL?c(rp).fileURLToPath(i):i,s=rinstanceofURL?c(rp).fileURLToPath(r):r,a=c(rl).resolve(s),l=[];for(;t!==a;)l.push(c(rl).join(a,"node_modules/.bin")),t=a,a=c(rl).resolve(a,"..");returnl.push(c(rl).resolve(s,o,"..")),[...l,n].join(c(rl).delimiter);}(t),e;}functionE(e){returnnull!==e&&"object"==typeofe&&"function"==typeofe.pipe;}functiony(e){returnE(e)&&!1!==e.writable&&"function"==typeofe._write&&"object"==typeofe._writableState;}asyncfunctionw(e,t){if(!e)throwError("Expected a stream");let{maxBuffer:r}=t={maxBuffer:1/0,...t},n=r4(t);returnawaitnewPromise((t,i)=>{leto=e=>{e&&n.getBufferedLength()<=r1.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{awaitom(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(newov());});}),n.getBufferedValue();}functionx(e,t,r){letn;leti=oV(e,t,r),o=oN(e,t),s=oP(e,t);oB(s,i.options),ou(i.options);try{n=c(rc).spawn(i.file,i.args,i.options);}catch(t){lete=new(c(rc).ChildProcess)();returnoC(e,Promise.reject(iX({error:t,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}))),e;}leta=oA(n),l=oc(n,i.options,a),u=op(n,i.options,l),p={isCanceled:!1};n.kill=or.bind(null,n.kill.bind(n)),n.cancel=oa.bind(null,n,p);letd=rJ(async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},l,c,d]=awaitoS(n,i.options,u),f=oq(i.options,l),h=oq(i.options,c),m=oq(i.options,d);if(e||0!==t||null!==r){letl=iX({error:e,exitCode:t,signal:r,stdout:f,stderr:h,all:m,command:o,escapedCommand:s,parsed:i,timedOut:a,isCanceled:p.isCanceled||!!i.options.signal&&i.options.signal.aborted,killed:n.killed});if(!i.options.reject)returnl;throwl;}return{command:o,escapedCommand:s,exitCode:0,stdout:f,stderr:h,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};});returnox(n,i.options),n.all=ob(n,i.options),oh(n),oC(n,d),n;}functionb(e,t,r){letn;leti=oV(e,t,r),o=oN(e,t),s=oP(e,t);oB(s,i.options);leta=oy(i.options);try{n=c(rc).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throwiX({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}letl=oq(i.options,n.stdout,n.error),u=oq(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){lete=iX({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.er
`),(0,nv.info)(`${e}="${n}"wasaddedto"${sF}`));return;}process.env[e]=n;}async function B(e){switch(process.platform){case"win32":await j(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,nv.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":awaitH(),await(0,rN.appendFile)(sF,`
`;try{await Promise.all([V(),z(e),q(e)]);}catch(t){(0,rS.warning)(`Failedtoadd${e}to.profileor.bashrc.Youshouldadditmanually:${t}`);}sM=!0;}async function V(){let e="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";(await(0,nE.pathExists)(sF))&&!(await(0,rN.readFile)(sF,"utf8")).includes(e)&&(await(0,rN.appendFile)(sF,`
`),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --vcvarsall, --cppcheck, --clangtidy, --clangformat"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --nala"},cache:{tools:"--cppcache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));let o=i.architecture??process.arch,s=process.env.SETUP_CPP_DIR??A("~"),a=[],l=[],u=rC.create({autoloadLocales:!0});rC.addLocale(c(rA)),rO.addLocale(c(rT));let p=await ab();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!e3(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(i,["llvm","clangtidy","clangformat"]))return(0,rS.error)("The same version must be used for llvm, clangformat and clangtidy"),1;D()&&"string"==typeof i.cppcheck&&"string"==typeof i.gcovr&&((0,rS.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await ef("python-pygments"));let d=!1,f=!1;for(let e of aJ){if(rI.isCI&&0!==l.length){f=!0;break;}let n=i[e];void 0!==n&&(t=Date.now(),d=await tN(e,n,p,o,s,a,l,6e4*parseFloat(i.timeout??"20")),r=Date.now(),(0,rS.info)("took "+(u.format(t,r)||"0 seconds")));}if(!f){let e=i.compiler;if(void 0!==e){let t=Date.now();await t6(e,p,s,o,a,d,l);let r=Date.now();(0,rS.info)("took "+(u.format(t,r)||"0 seconds"));}}if(await X(),0===a.length&&0===l.length)return(0,rS.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(a.forEach(e=>(0,rS.success)(e)),l.forEach(e=>(0,rS.error)(e)),(0,rS.info)("setup-cpp finished"),!rI.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,rS.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,rS.warning)("Run `source~/.cpprc`orrestartyourshelltoupdatetheenvironment.");}returnawaitn,0===l.length?0:1;}vart5,t7,t9,re,rt,rr,rn,ri,ro,rs,ra,rl,rc,ru,rp,rd,rf,rh,rm,rv,rg,rE,ry,rw,rx,rb,rR,rI,rS,rO,rT,rC,rA,r$,r_,rN,rP,rL,rD,rk,rU,rj,rF,rM,rG,rB,rH,rV,rq,rz,rX,rK,rW,rY,rJ,rQ,rZ,r0,r1,r2,r4,r3,r6,r8,r5,r7,r9,ne,nt,nr,nn,ni,no,ns,na,nl,nc,nu,np,nd,nf,nh,nm,nv,ng,nE,ny,nw,nx,nb,nR,nI,nS,nO,nT,nC,nA,n$,n_,nN,nP,nL,nD,nk,nU,nj,nF,nM,nG,nB,nH,nV,nq,nz,nX,nK,nW,nY,nJ,nQ,nZ,n0,n1,n2,n4=require("os"),n3=require("path"),n6=require("fs"),n8=require("crypto"),n5=require("http"),n7=require("https");require("net"),t9=require("tls"),re=require("events"),rt=require("assert"),rr=require("util"),rn=require("fs"),ri=require("child_process"),ro=require("string_decoder"),rs=require("timers"),ra=require("buffer"),rl=require("path"),rc=require("child_process"),ru=require("process"),rp=require("url"),rd=require("os"),rf=require("buffer"),rh=require("stream"),rm=require("util"),rv=require("process"),rg=require("url"),rE=require("console"),rw={},rx={},null==(rb=(ry=globalThis).parcelRequire810d)&&((rb=function(e){if(einrw)returnrw[e].exports;if(einrx){vart=rx[e];deleterx[e];varr={id:e,exports:{}};returnrw[e]=r,t.call(r.exports,r,r.exports),r.exports;}varn=Error("Cannotfindmodule'"+e+"'");thrown.code="MODULE_NOT_FOUND",n;}).register=function(e,t){rx[e]=t;},ry.parcelRequire810d=rb),(rR=rb.register)("52cQ1",function(e,t){varr;functionn(e){return"string"==typeofe?!!i[e]:"env"ine?i[e.env]&&i[e.env].includes(e.includes):"any"ine?e.any.some(function(e){return!!i[e];}):Object.keys(e).every(function(t){returni[t]===e[t];});}r=rb("jgqtC");leti=process.env;Object.defineProperty(e.exports,"_vendors",{value:r.map(function(e){returne.constant;})}),e.exports.name=null,e.exports.isPR=null,r.forEach(function(t){letr=(Array.isArray(t.env)?t.env:[t.env]).every(function(e){returnn(e);});if(e.exports[t.constant]=r,r)switch(e.exports.name=t.name,typeoft.pr){case"string":e.exports.isPR=!!i[t.pr];break;case"object":"env"int.pr?e.exports.isPR=t.pr.envini&&i[t.pr.env]!==t.pr.ne:"any"int.pr?e.exports.isPR=t.pr.any.some(function(e){return!!i[e];}):e.exports.
${t}`,i_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),iN=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),iP=(e,t,r)=>{let n=""===r?"":`with${r.trim()}()`,i=i$.bind(null,n,t.toString());Object.defineProperty(i,"name",iN),Object.defineProperty(e,"toString",{...i_,value:i});},iL=new WeakMap(),iD=(e,t={})=>{let r;if("function"!=typeof e)throw TypeError("Expected a function");let n=0,i=e.displayName||e.name||"<anonymous>",o=function(...s){if(iL.set(o,++n),1===n)r=e.apply(this,s),e=null;else if(!0===t.throw)throw Error(`Function\`${i}\` can only be called once`);returnr;};return!function(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(letnofReflect.ownKeys(t))iT(e,t,n,r);iA(e,t),iP(e,t,n);}(o,e),iL.set(o,n),o;};iD.callCount=e=>{if(!iL.has(e))throwError(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);returniL.get(e);},rJ=iD;constik=()=>Array.from({length:iF-ij+1},iU),iU=(e,t)=>({name:"SIGRT"+(t+1),number:ij+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ij=34,iF=64,iM=[{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:"t
${n.message}`:v,y=[E,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=y):n=Error(y),n.shortMessage=E,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=h,n.stdout=e,n.stderr=t,n.cwd=f,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=u,n.killed=p&&!l,n;},iK=["stdin","stdout","stderr"],iW=e=>iK.some(t=>void 0!==e[t]),iY=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return iK.map(t=>e[t]);if(iW(e))throw Error("It's not possible to provide `stdio` in combination with one of "+iK.map(e=>`\`${e}\``).join(", "));if("string"==typeoft)returnt;if(!Array.isArray(t))throwTypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeoft}\``);returnArray.from({length:Math.max(t.length,iK.length)},(e,r)=>t[r]);};rQ={};constiJ=function(e){returne&&"object"==typeofe&&"function"==typeofe.removeListener&&"function"==typeofe.emit&&"function"==typeofe.reallyExit&&"function"==typeofe.listeners&&"function"==typeofe.kill&&"number"==typeofe.pid&&"function"==typeofe.on;};if(iJ(rZ=ry.process)){variQ,iZ=rt,i0=rb("e1Rfe"),i1=/^win/i.test(rZ.platform),i2=re;"function"!=typeofi2&&(i2=i2.EventEmitter),rZ.__signal_exit_emitter__?iQ=rZ.__signal_exit_emitter__:((iQ=rZ.__signal_exit_emitter__=newi2()).count=0,iQ.emitted={}),iQ.infinite||(iQ.setMaxListeners(1/0),iQ.infinite=!0);vari4=function(){i8&&iJ(ry.process)&&(i8=!1,i0.forEach(function(e){try{rZ.removeListener(e,i6[e]);}catch(e){}}),rZ.emit=oe,rZ.reallyExit=i7,iQ.count-=1);};(rQ=function(e,t){if(!iJ(ry.process))returnfunction(){};iZ.equal(typeofe,"function","a callback must be provided for exit handler"),!1===i8&&i5();varr="exit";returnt&&t.alwaysLast&&(r="afterexit"),iQ.on(r,e),function(){iQ.removeListener(r,e),0===iQ.listeners("exit").length&&0===iQ.listeners("afterexit").length&&i4();};}).unload=i4;vari3=function(e,t,r){iQ.emitted[e]||(iQ.emitted[e]=!0,iQ.emit(e,t,r));},i6={};i0.forEach(function(e){i6[e]=function(){iJ(ry.process)&&rZ.listeners(e).length===iQ.count&&(i4(),i3("exit",null,e),i3("afterexit",null,e),i1&&"SIGHUP"===e&&(e="SIGINT"),rZ.kill(rZ.pid,e));};}),rQ.signals=function(){returni0;};vari8=!1,i5=function(){!i8&&iJ(ry.process)&&(i8=!0,iQ.count+=1,i0=i0.filter(function(e){try{returnrZ.on(e,i6[e]),!0;}catch(e){return!1;}}),rZ.emit=ot,rZ.reallyExit=i9);};rQ.load=i5;vari7=rZ.reallyExit,i9=function(e){iJ(ry.process)&&(rZ.exitCode=e||0,i3("exit",rZ.exitCode,null),i3("afterexit",rZ.exitCode,null),i7.call(rZ,rZ.exitCode));},oe=rZ.emit,ot=function(e,t){if(!("exit"===e&&iJ(ry.process)))returnoe.apply(this,arguments);void0!==t&&(rZ.exitCode=t);varr=oe.apply(this,arguments);returni3("exit",rZ.exitCode,null),i3("afterexit",rZ.exitCode,null),r;};}elserQ=function(){returnfunction(){};};constor=(e,t="SIGTERM",r={})=>{letn=e(t);returnon(e,t,r,n),n;},on=(e,t,r,n)=>{if(!oi(t,r,n))return;leti=setTimeout(()=>{e("SIGKILL");},os(r));i.unref&&i.unref();},oi=(e,{forceKillAfterTimeout:t},r)=>oo(e)&&!1!==t&&r,oo=e=>e===c(rd).constants.signals.SIGTERM||"string"==typeofe&&"SIGTERM"===e.toUpperCase(),os=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return5e3;if(!Number.isFinite(e)||e<0)throwTypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);returne;},oa=(e,t)=>{e.kill()&&(t.isCanceled=!0);},ol=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},oc=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{leti;return0===t||void0===t?n:Promise.race([newPromise((n,o)=>{i=setTimeout(()=>{ol(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},ou=({timeout:e})=>{if(void0!==e&&(!Number.isFinite(e)||e<0))throwTypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);},op=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)returnn;leti=c(rQ)(()=>{e.kill();});returnn.finally(()=>{i();});},od=e=>einstanceofrc.ChildProcess&&"function"==typeofe.then,of=(e,t,r)=>{if("string"==typeofr)returne[t].pipe((0,rn.createWriteStream)(r)),e;if(y
${n.message}`:h,g=[v,t,e].filter(Boolean).join("\n");return m?(n.originalMessage=n.message,n.message=g):n=Error(g),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;},o1=["stdin","stdout","stderr"],o2=e=>o1.some(t=>void 0!==e[t]),o4=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return o1.map(t=>e[t]);if(o2(e))throw Error("It's not possible to provide `stdio` in combination with one of "+o1.map(e=>`\`${e}\``).join(", "));if("string"==typeoft)returnt;if(!Array.isArray(t))throwTypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeoft}\``);returnArray.from({length:Math.max(t.length,o1.length)},(e,r)=>t[r]);},o3=(e,t="SIGTERM",r={})=>{letn=e(t);returno6(e,t,r,n),n;},o6=(e,t,r,n)=>{if(!o8(t,r,n))return;leti=setTimeout(()=>{e("SIGKILL");},o7(r));i.unref&&i.unref();},o8=(e,{forceKillAfterTimeout:t},r)=>o5(e)&&!1!==t&&r,o5=e=>e===c(rd).constants.signals.SIGTERM||"string"==typeofe&&"SIGTERM"===e.toUpperCase(),o7=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return5e3;if(!Number.isFinite(e)||e<0)throwTypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);returne;},o9=(e,t)=>{e.kill()&&(t.isCanceled=!0);},se=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},st=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{leti;return0===t||void0===t?n:Promise.race([newPromise((n,o)=>{i=setTimeout(()=>{se(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},sr=({timeout:e})=>{if(void0!==e&&(!Number.isFinite(e)||e<0))throwTypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);},sn=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)returnn;leti=c(rQ)(()=>{e.kill();});returnn.finally(()=>{i();});},si=e=>einstanceofrc.ChildProcess&&"function"==typeofe.then,so=(e,t,r)=>{if("string"==typeofr)returne[t].pipe((0,rn.createWriteStream)(r)),e;if(y(r))returne[t].pipe(r),e;if(!si(r))throwTypeError("The second argument must be a string, a stream or an Execa child process.");if(!y(r.stdin))throwTypeError("The target child process's stdin must be available.");returne[t].pipe(r.stdin),r;},ss=e=>{null!==e.stdout&&(e.pipeStdout=so.bind(void0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=so.bind(void0,e,"stderr")),void0!==e.all&&(e.pipeAll=so.bind(void0,e,"all"));},sa=e=>{if(void0!==e)throwTypeError("The `input` and `inputFile` options cannot be both set.");},sl=({input:e,inputFile:t})=>"string"!=typeoft?e:(sa(e),(0,rn.readFileSync)(t)),sc=e=>{lett=sl(e);if(E(t))throwTypeError("The `input` option cannot be a stream in sync mode");returnt;},su=({input:e,inputFile:t})=>"string"!=typeoft?e:(sa(e),(0,rn.createReadStream)(t)),sp=(e,t)=>{letr=su(t);void0!==r&&(E(r)?r.pipe(e.stdin):e.stdin.end(r));},sd=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;letr=c(r6)();returne.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},sf=async(e,t)=>{if(e&&void0!==t){e.destroy();try{returnawaitt;}catch(e){returne.bufferedData;}}},sh=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)returnt?c(r0)(e,{encoding:t,maxBuffer:n}):c(r0).buffer(e,{maxBuffer:n});},sm=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{leta=sh(e,{encoding:n,buffer:i,maxBuffer:o}),l=sh(t,{encoding:n,buffer:i,maxBuffer:o}),c=sh(r,{encoding:n,buffer:i,maxBuffer:2*o});try{returnawaitPromise.all([s,a,l,c]);}catch(n){returnPromise.all([{error:n,signal:n.signal,timedOut:n.timedOut},sf(e,a),sf(t,l),sf(r,c)]);}},sv=(async()=>{})().constructor.prototype,sg=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(sv,e)]),sE=(e,t)=>{for(let[r,n]ofsg){leti="function"==typeoft?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},sy=e=>newPromise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error",e=>{r(e);}),e.stdin&&e.stdin.on("error",e=>{r(e)