${n.message}`:m,v=[g,t,e].filter(Boolean).join("\n");return h?(n.originalMessage=n.message,n.message=v):n=Error(v),n.shortMessage=g,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=u&&!c,n;};var e9={};const e7=["stdin","stdout","stderr"],te=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return e7.map(t=>e[t]);if(e7.some(t=>void 0!==e[t]))throw Error("It's not possible to provide `stdio` in combination with one of "+e7.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,e7.length)},(e,r)=>t[r]);};(e9=te).node=e=>{lett=te(e);return"ipc"===t?"ipc":void0===t||"string"==typeoft?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];};vartt,tr={},tn=ep.process;constti=e=>e&&"object"==typeofe&&"function"==typeofe.removeListener&&"function"==typeofe.emit&&"function"==typeofe.reallyExit&&"function"==typeofe.listeners&&"function"==typeofe.kill&&"number"==typeofe.pid&&"function"==typeofe.on;if(ti(tn)){varto,ts=eh("4c98W"),ta=/^win/i.test(tn.platform),tc=y;"function"!=typeoftc&&(tc=tc.EventEmitter),tn.__signal_exit_emitter__?to=tn.__signal_exit_emitter__:((to=tn.__signal_exit_emitter__=newtc()).count=0,to.emitted={}),to.infinite||(to.setMaxListeners(1/0),to.infinite=!0);vartl=()=>{tp&&ti(ep.process)&&(tp=!1,ts.forEach(e=>{try{tn.removeListener(e,td[e]);}catch(e){}}),tn.emit=tg,tn.reallyExit=tm,to.count-=1);};(tr=(e,t)=>{if(!ti(ep.process))return()=>{};x.equal(typeofe,"function","a callback must be provided for exit handler"),!1===tp&&tf();varr="exit";returnt&&t.alwaysLast&&(r="afterexit"),to.on(r,e),()=>{to.removeListener(r,e),0===to.listeners("exit").length&&0===to.listeners("afterexit").length&&tl();};}).unload=tl;vartu=(e,t,r)=>{to.emitted[e]||(to.emitted[e]=!0,to.emit(e,t,r));},td={};ts.forEach(e=>{td[e]=()=>{ti(ep.process)&&tn.listeners(e).length===to.count&&(tl(),tu("exit",null,e),tu("afterexit",null,e),ta&&"SIGHUP"===e&&(e="SIGINT"),tn.kill(tn.pid,e));};}),tr.signals=()=>ts;vartp=!1,tf=()=>{!tp&&ti(ep.process)&&(tp=!0,to.count+=1,ts=ts.filter(e=>{try{returntn.on(e,td[e]),!0;}catch(e){return!1;}}),tn.emit=tv,tn.reallyExit=th);};tr.load=tf;vartm=tn.reallyExit,th=e=>{ti(ep.process)&&(tn.exitCode=e||0,tu("exit",tn.exitCode,null),tu("afterexit",tn.exitCode,null),tm.call(tn,tn.exitCode));},tg=tn.emit,tv=function(e,t){if("exit"===e&&ti(ep.process)){void0!==t&&(tn.exitCode=t);varr=tg.apply(this,arguments);returntu("exit",tn.exitCode,null),tu("afterexit",tn.exitCode,null),r;}returntg.apply(this,arguments);};}elsetr=()=>()=>{};consttE=e=>e===p.constants.signals.SIGTERM||"string"==typeofe&&"SIGTERM"===e.toUpperCase();varty,tx=(tt={spawnedKill(e,t="SIGTERM",r={}){letn=e(t);return((e,t,r,n)=>{if(!((e,{forceKillAfterTimeout:t},r)=>tE(e)&&!1!==t&&r)(t,r,n))return;leti=(({forceKillAfterTimeout:e=!0})=>{if(!0===e)return5e3;if(!Number.isFinite(e)||0>e)throwTypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);returne;})(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();})(e,t,r,n),n;},spawnedCancel(e,t){e.kill()&&(t.isCanceled=!0);},setupTimeout(e,{timeout:t,killSignal:r="SIGTERM"},n){leti;if(0===t||void0===t)returnn;leto=newPromise((n,o)=>{i=setTimeout(()=>{e.kill(r),o(Object.assign(Error("Timed out"),{timedOut:!0,signal:r}));},t);}),s=n.finally(()=>{clearTimeout(i);});returnPromise.race([o,s]);},validateTimeout({timeout:e}){if(void0!==e&&(!Number.isFinite(e)||0>e))throwTypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);},asyncsetExitHandler(e,{cleanup:t,detached:r},n){if(!t||r)returnn;leti=tr(()=>{e.kill();});returnn.finally(()=>{i();});}}).spawnedKill,tw=tt.spawnedCancel,tb=tt.setupTimeout,tS=tt.validateTimeout,tI=tt.setExitHandler,tO={};consttR=e=>n
${n.message}`:h,E=[v,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=u&&!c,n;};var nv={};"use strict";const nE=["stdin","stdout","stderr"],ny=e=>nE.some(t=>void 0!==e[t]),nx=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return nE.map(t=>e[t]);if(ny(e))throw Error(`It'snotpossibletoprovide\`stdio\` in combination with one of ${nE.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeoft)returnt;if(!Array.isArray(t))throwTypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeoft}\``);letr=Math.max(t.length,nE.length);returnArray.from({length:r},(e,r)=>t[r]);};(nv=nx).node=e=>{lett=nx(e);return"ipc"===t?"ipc":void0===t||"string"==typeoft?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];};varnw={},nb={},nS=M.process;constnI=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(nI(nS)){varnO,nR,nT=B("5AOH8"),nC=/^win/i.test(nS.platform),n_=y;"function"!=typeofn_&&(n_=n_.EventEmitter),nS.__signal_exit_emitter__?nR=nS.__signal_exit_emitter__:((nR=nS.__signal_exit_emitter__=newn_()).count=0,nR.emitted={}),nR.infinite||(nR.setMaxListeners(1/0),nR.infinite=!0);varn$=function(){nN&&nI(M.process)&&(nN=!1,nT.forEach(function(e){try{nS.removeListener(e,nA[e]);}catch(e){}}),nS.emit=nU,nS.reallyExit=nD,nR.count-=1);};(nb=function(e,t){if(!nI(M.process))returnfunction(){};x.equal(typeofe,"function","a callback must be provided for exit handler"),!1===nN&&nL();varr="exit";returnt&&t.alwaysLast&&(r="afterexit"),nR.on(r,e),function(){nR.removeListener(r,e),0===nR.listeners("exit").length&&0===nR.listeners("afterexit").length&&n$();};}).unload=n$;varnP=function(e,t,r){nR.emitted[e]||(nR.emitted[e]=!0,nR.emit(e,t,r));},nA={};nT.forEach(function(e){nA[e]=function(){nI(M.process)&&nS.listeners(e).length===nR.count&&(n$(),nP("exit",null,e),nP("afterexit",null,e),nC&&"SIGHUP"===e&&(e="SIGINT"),nS.kill(nS.pid,e));};}),nb.signals=function(){returnnT;};varnN=!1,nL=function(){!nN&&nI(M.process)&&(nN=!0,nR.count+=1,nT=nT.filter(function(e){try{returnnS.on(e,nA[e]),!0;}catch(e){return!1;}}),nS.emit=nj,nS.reallyExit=nk);};nb.load=nL;varnD=nS.reallyExit,nk=function(e){nI(M.process)&&(nS.exitCode=e||0,nP("exit",nS.exitCode,null),nP("afterexit",nS.exitCode,null),nD.call(nS,nS.exitCode));},nU=nS.emit,nj=function(e,t){if(!("exit"===e&&nI(M.process)))returnnU.apply(this,arguments);void0!==t&&(nS.exitCode=t);varr=nU.apply(this,arguments);returnnP("exit",nS.exitCode,null),nP("afterexit",nS.exitCode,null),r;};}elsenb=function(){returnfunction(){};};"use strict";"use strict";constnM=(e,t,r,n)=>{if(!nG(t,r,n))return;leti=nB(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},nG=(e,{forceKillAfterTimeout:t},r)=>nF(e)&&!1!==t&&r,nF=e=>e===p.constants.signals.SIGTERM||"string"==typeofe&&"SIGTERM"===e.toUpperCase(),nB=({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;},nH=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},nq=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)returnn;leti=nb(()=>{e.kill();});returnn.finally(()=>{i();});};varnV=(nw={spawnedKill:(e,t="SIGTERM",r={})=>{letn=e(t);returnnM(e,t,r,n),n;},spawnedCancel:(e,t)=>{letr=e.kill();r&&(t.isCanceled=!0);},setupTimeout:(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{leti;if(0===t||void0===t)returnn;leto=newPromise((n,o)=>{i=setTimeout(()=>{nH(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});returnPromise.race([o,s]);},validateTimeout:({timeout:e})=>{if(void0!==e&&(!Number.isFin
${t}`,iH=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),iq=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),iV=(e,t,r)=>{let n=""===r?"":`with${r.trim()}()`,i=iB.bind(null,n,t.toString());Object.defineProperty(i,"name",iq),Object.defineProperty(e,"toString",{...iH,value:i});},iX=new WeakMap(),iW=(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(iX.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;};returnfunction(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(letnofReflect.ownKeys(t))iM(e,t,n,r);iF(e,t),iV(e,t,n);}(o,e),iX.set(o,n),o;};iW.callCount=e=>{if(!iX.has(e))throwError(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);returniX.get(e);};constiz=()=>Array.from({length:iQ-iY+1},iK),iK=(e,t)=>({name:`SIGRT${t+1}`,number:iY+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),iY=34,iQ=64,iJ=[{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:"termina
${n.message}`:h,E=[v,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=u&&!c,n;},i8=["stdin","stdout","stderr"],i9=e=>i8.some(t=>void 0!==e[t]),i7=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return i8.map(t=>e[t]);if(i9(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${i8.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,i8.length);return Array.from({length:r},(e,r)=>t[r]);},oe=(e,t="SIGTERM",r={})=>{let n=e(t);return ot(e,t,r,n),n;},ot=(e,t,r,n)=>{if(!or(t,r,n))return;let i=oi(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},or=(e,{forceKillAfterTimeout:t},r)=>on(e)&&!1!==t&&r,on=e=>e===j(L).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),oi=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},oo=(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},os=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},oa=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{os(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},oc=({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);},ol=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=j(nb)(()=>{e.kill();});return n.finally(()=>{i();});};function ou(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe;}function od(e){return ou(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState;}const op=e=>e instanceof P.ChildProcess&&"function"==typeof e.then,of=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,b.createWriteStream)(r)),e;if(od(r))return e[t].pipe(r),e;if(!op(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!od(r.stdin))throw TypeError("The target child process'sstdinmustbeavailable.");return e[t].pipe(r.stdin),r;},om=e=>{null!==e.stdout&&(e.pipeStdout=of.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=of.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=of.bind(void 0,e,"all"));},oh=e=>{if(void 0!==e)throw TypeError("The`input`and`inputFile`optionscannotbebothset.");},og=({input:e,inputFile:t})=>"string"!=typeof t?e:(oh(e),(0,b.readFileSync)(t)),ov=e=>{let t=og(e);if(ou(t))throw TypeError("The`input`optioncannotbeastreaminsyncmode");return t;},oE=({input:e,inputFile:t})=>"string"!=typeof t?e:(oh(e),(0,b.createReadStream)(t)),oy=(e,t)=>{let r=oE(t);void 0!==r&&(ou(r)?r.pipe(e.stdin):e.stdin.end(r));},ox=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=j(n8)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},ow=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},ob=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?j(nZ)(e,{encoding:t,maxBuffer:n}):j(nZ).buffer(e,{maxBuffer:n});},oS=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=ob(e,{encoding:n,buffer:i,maxBuffer:o}),c=ob(t,{encoding:n,buffer:i,maxBuffer:o}),l=ob(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([s,a,c,l]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},ow(e,a),ow(t,c),ow(r,l)]);}},oI=(async()=>{})().constructor.prototype,oO=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(oI,e)]),oR=(e,t)=>{for(let[r,n]of oO){let i="function"==typ
`),(0,rT.info)(`${e}="${r}"wasaddedto"${o8}`);return;}process.env[e]=r;}async function o7(e){switch(process.platform){case"win32":await oY(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,rT.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":awaitst(),(0,m.appendFileSync)(o8,`
`;try{let e=t5(".profile");(0,m.appendFileSync)(e,t),(0,rT.info)(`${t}wasaddedto${e}`);let r=t5(".bashrc");(0,m.appendFileSync)(r,t),(0,rT.info)(`${t}wasaddedto${r}`);}catch(e){(0,q.warning)(`Failedtoadd${t}to.profileor.bashrc.Youshouldadditmanually:${e}`);}se=!0;}async function sr(){if(await(0,o3.pathExists)(o8)){let e=(0,m.readFileSync)(o8,"utf-8").split("\n"),t=[...new Set(e.reverse())].reverse();(0,m.writeFileSync)(o8,t.join("\n"));try{o2(o8);}catch{}}}var sn={},si=f.join,so=f.delimiter,ss=f.sep,sa=f.posix;const sc="win32"===process.platform,sl=new RegExp(`[${sa.sep}${ss===sa.sep?"":ss}]`.replace(/(\\)/g,"\\$1")),su=RegExp(`^\\.${sl.source}`),sd=e=>Object.assign(Error(`notfound:${e}`),{code:"ENOENT"}),sp=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=so})=>{let i=e.match(sl)?[""]:[...(sc?[process.cwd()]:[]),...(t||"").split(n)];if(sc){let t=r||[".EXE",".CMD",".BAT",".COM"].join(n),o=t.split(n).reduce((e,t)=>(e.push(t),e.push(t.toLowerCase()),e),[]);return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t};}return{pathEnv:i,pathExt:[""]};},sf=(e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e,n=!r&&su.test(t)?t.slice(0,2):"";return n+si(r,t);},sm=async(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=sp(e,t),o=[];for(let s of r){let r=sf(s,e);for(let e of n){let n=r+e,s=await rN(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)return n;o.push(n);}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sd(e);};sn=sm,sm.sync=(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=sp(e,t),o=[];for(let s of r){let r=sf(s,e);for(let e of n){let n=r+e,s=rN.sync(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)return n;o.push(n);}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sd(e);};var o3=B("bOuKS"),sh=B("3cGqJ"),q=B("7Lz0k");const{appendFile:sg}=m.promises;let sv=!1,sE=!1;async function sy(e,t=!1){let r=null!==j(sn).sync("nala",{nothrow:!0})?"nala":"apt-get";for(let{name:t,version:n}of e)(0,q.info)(`Installing${t}${n??""}via${r}`);process.env.DEBIAN_FRONTEND="noninteractive",(!sv||t)&&(sw(r),sv=!0),sE||(await sb(r),sE=!0);let n=[...new Set(e.flatMap(e=>e.repositories??[]))];if(0!==n.length){for(let e of n)iP("add-apt-repository",["-y",e]);sw(r);}let i=await Promise.all(e.map(e=>sx(e.name,e.version)));return iP(r,["install","--fix-broken","-y",...i]),{binDir:"/usr/bin/"};}async function sx(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await oX("apt-cache",["search","--names-only",`^${(0,sh.default)(e)}-${(0,sh.default)(t)}$`]);if(""!==r.trim())return`${e}-${t}`;try{let{stdout:r}=await oX("apt-cache",["show",`${e}=${t}`]);if(""===r.trim())return`${e}=${t}`;}catch{}(0,q.warning)(`Failedtoinstall${e}${t}viaapt,tryingwithoutversion`);}return e;}function sw(e){iP(e,"nala"!==e?["update","-y"]:["update"]);}async function sb(e){iP(e,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]);let t=[sI(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),sI(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(o6("LANG","C.UTF-8"),o6("LC_ALL","C.UTF-8")),await Promise.all(t);}function sS(){iP("gpg",["-k"]);}async function sI(e,t,r="keyserver.ubuntu.com"){let n=`/etc/apt/trusted.gpg.d/${t}`;return(await(0,o3.pathExists)(n))||(sS(),await Promise.all(e.map(async e=>{await iA("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--keyserver",r,"--recv-keys",e]),await iA("chmod",["644",n]);}))),n;}async function sO(e,t){let r=`/etc/apt/trusted.gpg.d/${e}`;return(await(0,o3.pathExists)(r))||(sS(),await sy([{name:"curl"}],void 0),iP("bash",["-c",`curl-s${t}|gpg--no-default-keyring--keyringgnupg-ring:${r}--import`]),iP("chmod",["644",r])),r;}async function sR(e,t){return H.GITHUB_ACTIONS?iA("update-alternatives",["--install",`/usr/bin/${e}`,e,t,"40"]):(await st(),sg(o8,`
`),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??t5(""),a=[],c=[],l=W.create({autoloadLocales:!0});W.addLocale(j(z)),V.addLocale(j(X));let u=await c_();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!aW(e[t],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,q.error)("The same version must be used for llvm, clangformat and clangtidy"),1;sD()&&"string"==typeof i.cppcheck&&"string"==typeof i.gcovr&&((0,q.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await sB("python-pygments"));let d=!1;for(let e of lm){let n=i[e];void 0!==n&&(t=Date.now(),d=await lp(e,n,u,o,s,a,c),r=Date.now(),(0,q.info)(`took${l.format(t,r)||"0 seconds"}`));}let p=i.compiler;if(void 0!==p){let e=Date.now();await lv(p,u,s,o,a,d,c);let t=Date.now();(0,q.info)(`took${l.format(e,t)||"0 seconds"}`);}if(await sr(),0===a.length&&0===c.length)return(0,q.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(a.forEach(e=>(0,q.success)(e)),c.forEach(e=>(0,q.error)(e)),(0,q.info)("setup-cpp finished"),!H.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,q.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,q.warning)("Run `source~/.cpprc`orrestartyourshelltoupdatetheenvironment.");}returnawaitn,0===c.length?0:1;})(process.argv).then(e=>{process.exitCode=e;}).catch(e=>{(0,q.error)("main()panicked!"),(0,q.error)(e),process.exitCode=1;});