setup-cpp/dist/modern/setup-cpp.js

78 lines
701 KiB
JavaScript
Raw Normal View History

#!/usr/bin/env node
function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e);}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a);}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object");}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a));}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r;}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object");}let e,A,t,r,o,n,i,s;function a(e,A,t,r){Object.defineProperty(e,A,{get:t,set:r,enumerable:!0,configurable:!0});}function l(e){return e&&e.__esModule?e.default:e;}function c(e,A,t){if("function"==typeof A&&(t=A,A={}),!t){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(t,r){c(e,A||{},function(e,A){e?r(e):t(A);});});}tb(e,A||{},function(e,r){e&&("EACCES"===e.code||A&&A.ignoreErrors)&&(e=null,r=!1),t(e,r);});}function E(e,A){let t;let r=e.options.env||process.env,o=process.cwd(),n=null!=e.options.cwd,i=n&&void 0!==process.chdir&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd);}catch(e){}try{t=tm.sync(e.command,{path:r[tR({env:r})],pathExt:A?r3.delimiter:void 0});}catch(e){}finally{i&&process.chdir(o);}return t&&(t=r3.resolve(n?e.options.cwd:"",t)),t;}function g(e,A){return Object.assign(Error(`${A} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${A} ${e.command}`,path:e.command,spawnargs:e.args});}function u(e,A){return oG&&1===e&&!A.file?g(A.original,"spawn"):null;}function h(e,A,t){let r=tp(e,A,t),o=of.spawn(r.command,r.args,r.options);return tF.hookChildProcess(o,r),o;}function Q(e={}){let{env:A=process.env,platform:t=process.platform}=e;return"win32"!==t?"PATH":Object.keys(A).reverse().find(e=>"PATH"===e.toUpperCase())||"Path";}function C(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe;}function I(e){return C(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState;}async function d(e,A){if(!e)throw Error("Expected a stream");let{maxBuffer:t}=A={maxBuffer:1/0,...A},r=tO(A);return await new Promise((A,o)=>{let n=e=>{e&&r.getBufferedLength()<=tx.MAX_LENGTH&&(e.bufferedData=r.getBufferedValue()),o(e);};(async()=>{try{await nF(e,r),A();}catch(e){n(e);}})(),r.on("data",()=>{r.getBufferedLength()>t&&n(new nL());});}),r.getBufferedValue();}function B(e,A,t){let r;let o=n5(e,A,t),n=nX(e,A),i=n$(e,A);n8(i,o.options),nD(o.options);try{r=l(ow).spawn(o.file,o.args,o.options);}catch(A){let e=new(l(ow).ChildProcess)();return nV(e,Promise.reject(nA({error:A,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:o,timedOut:!1,isCanceled:!1,killed:!1}))),e;}let s=nq(r),a=nR(r,o.options,s),c=nS(r,o.options,a),E={isCanceled:!1};r.kill=nB.bind(null,r.kill.bind(r)),r.cancel=nw.bind(null,r,E);let g=tL(async()=>{let[{error:e,exitCode:A,signal:t,timedOut:s},a,l,g]=await nP(r,o.options,c),u=n6(o.options,a),h=n6(o.options,l),Q=n6(o.options,g);if(e||0!==A||null!==t){let a=nA({error:e,exitCode:A,signal:t,stdout:u,stderr:h,all:Q,command:n,escapedCommand:i,parsed:o,timedOut:s,isCanceled:E.isCanceled||!!o.options.signal&&o.options.signal.aborted,killed:r.killed});if(!o.options.reject)return a;throw a;}return{command:n,escapedCommand:i,exitCode:0,stdout:u,stderr:h,all:Q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};});return nM(r,o.options),r.all=nO(r,o.options),nN(r),nV(r,g),r;}function f(e,A,t){let r;let o=n5(e,A,t),n=nX(e,A),i=n$(e,A);n8(i,o.options);let s=nT(o.options);try{r=l(ow).spawnSync(o.file,o.args,{...o.options,input:s});}catch(e){throw nA({error:e,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:o,timedOut:!1,isCanceled:!1,killed:!1});}let a=n6(o.options,r.stdout,r.error),c=n6(o.options,r.stderr,r.error);if(r.error||0!==r.status||null!==r.signal){let e=nA({stdout:a,stderr:c,error:r.error,signal:r.signal,exitCode:r.status,command:n,escapedCommand:i,parsed:o,timedOut:r.error&
source "${e.rcPath}"
`:`
# ${e.guard}
if [[ "$SOURCE_${e.guard.toUpperCase()}RC" != 0 && -f "${e.rcPath}" ]]; then source "${e.rcPath}"; fi
`;try{await Promise.all([U(e),_(A,F("~/.bashrc")),_(A,F("~/.profile"))]);}catch(e){(0,td.warning)(`Failed to add ${A} to .profile or .bashrc. You should add it manually: ${e}`);}}async function U(e){let A=void 0===e.guard?"\n# Automatically Generated by envosman\n":`
# Automatically Generated by envosman ${e.guard}
export SOURCE_${e.guard.toUpperCase()}RC=0
`;(await(0,t0.pathExists)(e.rcPath))&&!(await iw(e.rcPath,"utf8")).includes(A)&&(await im(e.rcPath,`
${A}
`),(0,td.info)(`Added ${A} to ${e.rcPath}`));}async function _(e,A){(await(0,t0.pathExists)(A))&&!(await iw(A,"utf-8")).includes(e)&&(await im(A,e),(0,td.info)(`${e} was added to ${A}`));}async function T(e){if(await(0,t0.pathExists)(e.rcPath)){let A=[...new Set((await iw(e.rcPath,"utf-8")).split("\n").reverse())].reverse();await ib(e.rcPath,A.join("\n")),await D(e.rcPath);}}async function x(e,A,t={}){let r={escapeSpace:!1,overwrite:!0,rcPath:iR,...t},o=function(e,A=!1){let t=A?l(t1)(e):e;return l(t2)(t,'"',"\\");}(A??"",r.escapeSpace);try{if(tI.GITHUB_ACTIONS)try{if(!r.overwrite&&void 0!==process.env[e]){(0,td.info)(`Environment variable ${e} is already defined. Skipping.`);return;}(0,tB.exportVariable)(e,o);}catch(A){(0,td.error)(A),await M(e,o,r);}else await M(e,o,r);}catch(A){(0,td.error)(`${A}
Failed to export environment variable ${e}=${o}. You should add it manually.`);}}async function M(e,A,t){let r=A??"";switch(process.platform){case"win32":if(!t.overwrite&&void 0!==process.env[e]){(0,td.info)(`Environment variable ${e} is already defined. Skipping.`);return;}await p(`[Environment]::SetEnvironmentVariable('${e}', '${r}', "User")`),(0,td.info)(`${e}='${r}' was set in the environment.`);return;case"linux":case"darwin":await iD(t),t.overwrite?(await iN(t.rcPath,`
export ${e}="${r}"
`),(0,td.info)(`${e}="${r}" was added to "${t.rcPath}`)):(await iN(t.rcPath,`
if [ -z "\${${e}}" ]; then export ${e}="${r}"; fi
`),(0,td.info)(`if not defined ${e} then ${e}="${r}" was added to "${t.rcPath}`));return;}process.env[e]=r;}async function O(e,A={}){var t;let r={rcPath:iR,...A};if(t=e,!(iL.some(e=>e.test(t))&&(process.env.PATH?.split(r3.delimiter)??[]).includes(t))){process.env.PATH=`${e}${r3.delimiter}${process.env.PATH}`;try{if(tI.GITHUB_ACTIONS)try{(0,tB.addPath)(e);}catch(A){(0,td.error)(A),await G(e,r);}else await G(e,r);}catch(A){(0,td.error)(`${A}
Failed to add ${e} to the percistent PATH. You should add it manually.`);}}}async function G(e,A){switch(process.platform){case"win32":await p(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,td.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":await iD(A),await iF(A.rcPath,`
export PATH="${e}:$PATH"
`),(0,td.info)(`"${e}" was added to "${A.rcPath}"`);return;default:return;}}function Y(e,A,t,r){return new(t||(t=Promise))(function(o,n){function i(e){try{a(r.next(e));}catch(e){n(e);}}function s(e){try{a(r.throw(e));}catch(e){n(e);}}function a(e){var A;e.done?o(e.value):((A=e.value)instanceof t?A:new t(function(e){e(A);})).then(i,s);}a((r=r.apply(e,A||[])).next());});}function P(e,A){function t(t){return function(a){return function(t){if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,t[0]&&(s=0)),s;)try{if(r=1,o&&(n=2&t[0]?o.return:t[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,t[1])).done)return n;switch(o=0,n&&(t=[2&t[0],n.value]),t[0]){case 0:case 1:n=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===t[0]||2===t[0])){s=0;continue;}if(3===t[0]&&(!n||t[1]>n[0]&&t[1]<n[3])){s.label=t[1];break;}if(6===t[0]&&s.label<n[1]){s.label=n[1],n=t;break;}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(t);break;}n[2]&&s.ops.pop(),s.trys.pop();continue;}t=A.call(e,s);}catch(e){t=[6,e],o=0;}finally{r=n=0;}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0};}([t,a]);};}var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1];},trys:[],ops:[]};return i={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this;}),i;}async function J(){try{await l(t5)({pkg:l(rQ)});}catch(e){(0,td.warning)("Failed to check for updates: "+(e instanceof Error?e.message+e.stack:e));}}function H(e){return null==e?[]:Array.isArray(e)?e:[e];}function V(e){if(e&&e.__esModule)return e;var A={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t]);return A.default=e,A;}function q(e,A){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&("object"==typeof A||"function"==typeof A)?A:e;}async function W(e,A,t=40){await w("update-alternatives",["--install","/usr/bin/"+e,e,A,t.toString()]);}async function j(e,A,t,r=40){tI.GITHUB_ACTIONS?await W(e,A,r):(await iD(t),await iU(t.rcPath,`
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${A} ${r}; fi
`));}async function X(e){try{let{stdout:A}=await B("dpkg",["-s",e],{env:et("apt-get"),stdio:"pipe"});if("string"!=typeof A)return!1;return A.split("\n").some(e=>e.startsWith("Status: install ok installed"));}catch{return!1;}}async function $(e){try{let{stdout:A}=await B("dpkg",["-l",e],{env:et("apt-get"),stdio:"pipe"});if("string"!=typeof A)return!1;return A.split("\n").some(e=>e.startsWith("ii"));}catch{return!1;}}function z(e=eA()){m(e,"nala"!==e?["update","-y","-o",ix]:["update","-o",ix],{...ip,env:et(e)});}async function Z(e,A=!1){let t=eA();for(let{name:A,version:r}of e)(0,td.info)(`Installing ${A} ${r??""} via ${t}`);A&&(z(t),i_=!0),await en(t,e);let r=await er(t,e);if(0===r.length)return(0,td.info)("All packages are already installed"),{binDir:"/usr/bin/"};iT||(await el(t),iT=!0);try{await K(e),m(t,["install","--fix-broken","-y",...r],{...ip,env:et(t)});}catch(e){if("string"==typeof e.stderr)iM.some(A=>e.stderr.includes(A))&&((0,td.warning)(`Failed to install packages ${r}. Retrying...`),m(t,["install","--fix-broken","-y","-o",ix,...r],{...ip,env:et(t)}));else throw e;}return{binDir:"/usr/bin/"};}async function K(e){await Promise.all(e.map(async e=>{var A;void 0!==e.key&&(await("keyUrl"in(A=e.key)?eE(A):ec(A)));}));}function ee(){return null!==l(tJ).sync("nala",{nothrow:!0});}function eA(){let e;return ee()?"nala":"apt-get";}function et(e){let A={...process.env,DEBIAN_FRONTEND:"noninteractive"};return"nala"===e&&(void 0===A.LANG&&(A.LANG="C.UTF-8"),void 0===A.LC_ALL&&(A.LC_ALL="C.UTF-8")),A;}async function er(e,A){return(await Promise.all(A.map(A=>eo(e,A)))).filter(e=>void 0!==e);}async function eo(e,A){let t=await es(e,A.name,A.version);return(await X(t))?void 0:t;}async function en(e,A){let t=[...new Set(A.flatMap(e=>e.repository??[]))];if(0!==t.length){for(let A of(iT||(await el(e),iT=!0),await ea(e),t))m("add-apt-repository",["-y","--no-update",A],{...ip,env:et(e)});z(e),i_=!0;}}async function ei(e,A,t){if(void 0!==t&&""!==t){let{stdout:r}=await B("apt-cache",["search","--names-only",`^${(0,rw.default)(A)}-${(0,rw.default)(t)}$`],{env:et(e),stdio:"pipe"});if(""!==r.trim())return 0;try{let{stdout:r}=await B("apt-cache",["show",`${A}=${t}`],{env:et(e)});if(""===r.trim())return 1;}catch{}}try{let{stdout:t}=await B("apt-cache",["show",A],{env:et(e),stdio:"pipe"});if(""!==t.trim())return 2;}catch{}return i_?3:(z(eA()),i_=!0,ei(e,A,t));}async function es(e,A,t){switch(await ei(e,A,t)){case 0:return`${A}-${t}`;case 1:return`${A}=${t}`;case 2:return void 0!==t&&""!==t&&(0,td.warning)(`Could not find package ${A} with version ${t}. Installing the latest version.`),A;default:throw Error(`Could not find package ${A} ${t??""}`);}}async function ea(e){(await X("software-properties-common"))||m(e,["install","-y","--fix-broken","-o",ix,"software-properties-common"],{...ip,env:et(e)});}async function el(e){i_||(z(e),i_=!0);let A=await er(e,[{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}]);0!==A.length&&m(e,["install","-y","--fix-broken","-o",ix,...A],{...ip,env:et(e)});}async function ec({key:e,keyServer:A=iG,fileName:t,keyStorePath:r=iG}){try{eu(t);let o=(0,r3.join)(r,t);return(await(0,t0.pathExists)(o))||(eg(),await w("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+o,"--keyserver",A,"--recv-keys",e]),await w("chmod",["644",o])),o;}catch(e){(0,td.warning)(`Failed to add apt key via server ${A}: ${e}`);return;}}async function eE({keyUrl:e,fileName:A,keyStorePath:t=iO}){try{eu(A);let r=(0,r3.join)(t,A);if(!(await(0,t0.pathExists)(r))){eg(),await Z([{name:"ca-certificates"}]);let t=(0,r3.join)((0,r8.tmpdir)(),A),o=new rC.DownloaderHelper(e,(0,r8.tmpdir)(),{fileName:A});o.on("error",A=>{throw Error(`Failed to download ${e}: ${A}`);}),await o.start(),m("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+r,"--import",t]),m("chmod",["644",r]);}return r;}catch(A){(0,td.warning)(`Failed to add apt key via download ${e}: ${A}`);return;}}function eg(){m("gpg",["-k"]);}function eu(e){if(!e.endsWith(".gpg"))throw Error("Key file name must end with .gpg: "+e);}async function eh(e={}){if(!["darwin","linux"].include
apt-get update -o ${ix} -y`),s=t,l=1===n?i.replace(/ -y \$PKG/g," -y clang-format-"+s):i,a=l=await AX(l),l=ee()?a.replace(/apt-get/g,"nala"):a,await(0,tV.writeFile)(A,l),[{name:"lsb-release"},{name:"wget"},{name:"software-properties-common"},{name:"gnupg"}];}async function AX(e){let A=e.replace(/apt-get install -y/g,`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${ix} -y --fix-broken`);return await Promise.all(["libc++-$LLVM_VERSION-dev","libc++abi-$LLVM_VERSION-dev","libunwind-$LLVM_VERSION-dev"].map(async e=>{let t=e.replace("$LLVM_VERSION","*");(await $(t))&&((0,oQ.info)("Removing conflicting package "+t),A=A.replace(e,""));})),A;}function A$(e,A,t){let r=`${A}${e}${t}`;return`https://github.com/llvm/llvm-project/releases/download/llvmorg-${e}/${r}`;}function Az(e,A,t){let r=`${A}${e}${t}`;return`https://releases.llvm.org/${e}/${r}`;}async function AZ(e){let A;if(sx.has(e))return null;let t="LLVM-",r=l(rS)(e,"3.7.0")?"-win32.exe":"-win64.exe",o=l(rS)(e,"9.0.1"),n=!1;return o&&(A=Az(e,t,r),(await rq(A))||(n=!0)),(n||!o)&&(A=A$(e,t,r)),A;}function AK(e,A){switch(e){case"darwin":return function(e){if(sM.has(e))return null;let A="9.0.0"===e?"-darwin-apple":"-apple-darwin",t="clang+llvm-",r=`-x86_64${A}.tar.xz`;return l(rS)(e,"9.0.1")?Az(e,t,r):A$(e,t,r);}(A);case"linux":return function(e){let A,t,r=e,o=sO.get(r);if(void 0!==o&&(r=o),r.includes("ubuntu")){let e=r.replace(/-ubuntu-.*/,"");if(!sT.has(e))throw Error("Unsupported Ubuntu version: "+e);A=r.replace(e,""),r=eZ(sT,e)[0];}else""!==r&&r in sG?A=sG[r]:(A=sG[sY],(0,td.warning)(`Falling back to LLVM version ${sY} ${A} for the Ubuntu.`));let n="clang+llvm-";return(t="5.0.0"===r?`-linux-x86_64${A}.tar.xz`:A.includes("-rhel86")?`-x86_64-unknown-linux-gnu${A}.tar.xz`:`-x86_64-linux-gnu${A}.tar.xz`,l(rS)(r,"9.0.1"))?Az(r,n,t):A$(r,n,t);}(A);case"win32":return AZ(A);default:return null;}}async function A0(e,A,t){let[r,o]=await eK(sT,A,e,AK);return(0,td.info)("specific llvm version: "+r),{url:o,extractedFolderName:"",binRelativeDir:"bin",binFileName:(0,rR.addExeExt)("clang"),extractFunction:"win32"===A?eY:(e,A)=>eJ(e,A,1)};}async function A1(e,A,t){let r=await sP(e,A,t);return await A3(r.installDir??A),r;}async function A2(e,A,t){let[r,o]=await Promise.all([A4(e,A,t),A5()]);return await sH(t),r;}async function A4(e,A,t,r=r2.All){let o=Number.parseInt(function(e){if(null===l(rj)(e))try{let A=l(rD)(e);if(null!==A)return(0,td.info)(`Coerced version '${e}' to '${A}'`),A.version;}catch(e){}return e;}(e).split(".")[0],10);try{if(eB())return await AW(o,r);}catch(e){(0,td.info)("Failed to install llvm via system package manager "+e);}let n=await eV("llvm",e,A0,A,t);return await sJ(o),n;}async function A9(e){eB()&&(e<=10?await Z([{name:"libtinfo5"}]):await Z([{name:"libtinfo-dev"}]));}async function A8(e){"linux"===process.platform&&(await Av(Ai("gcc",void 0,await sd()),"",e,40));}async function A3(e){let A=process.env.LD_LIBRARY_PATH??"",t=process.env.DYLD_LIBRARY_PATH??"",r=[x("LLVM_PATH",e,sX),x("LD_LIBRARY_PATH",`${e}/lib${r3.delimiter}${A}`,sX),x("DYLD_LIBRARY_PATH",`${e}/lib${r3.delimiter}${t}`,sX),x("LDFLAGS",`-L"${e}/lib"`,sX),x("CPPFLAGS",`-I"${e}/include"`,sX),x("CC",(0,rR.addExeExt)(`${e}/bin/clang`),sX),x("CXX",(0,rR.addExeExt)(`${e}/bin/clang++`),sX),x("LIBRARY_PATH",`${e}/lib`,sX),AS()];eB()&&r.push(j("cc",`${e}/bin/clang`,sX,60),j("cxx",`${e}/bin/clang++`,sX,60),j("clang",`${e}/bin/clang`,sX),j("clang++",`${e}/bin/clang++`,sX),j("lld",`${e}/bin/lld`,sX),j("ld.lld",`${e}/bin/ld.lld`,sX),j("llvm-ar",`${e}/bin/llvm-ar`,sX)),await Promise.all(r);}async function A5(){if(tI.GITHUB_ACTIONS){let e=(0,rR.join)(r4,"llvm_matcher.json");if(!(await(0,t0.pathExists)(e)))return(0,td.warning)("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");(0,td.info)("::add-matcher::"+e);}}async function A6(e,A,t){switch(process.platform){case"win32":return ep("make",e);case"darwin":return await eC("make",e),await O("/usr/local/opt/make/libexec/gnubin",sX),{binDir:"/usr/local/opt/make/libexec/gnubin"};case"linux":if(ed())return eb("make",e);if(eI())return e
setup-cpp [options]
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
Install all the tools required for building and testing C++/C projects.
--architecture the cpu architecture to install the tools for. By default it uses the current CPU architecture.
--timeout the timeout for the installation of each tool in minutes. By default it is 10 minutes.
--compiler the <compiler> to install.
You can specify the version instead of specifying just the name e.g: --compiler 'llvm-13.0.0'
--$tool_name pass "true" or pass the <version> you would like to install for this tool. e.g. --conan true or --conan "1.42.1"
All the available tools:
`),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:"--ccache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));let n=o.architecture??process.arch,i=process.env.SETUP_CPP_DIR??F("~"),s=[],a=[],c=t8.create({autoloadLocales:!0});t8.addLocale(l(t3)),t4.addLocale(l(t9));let E=await sd();if(!function(e,A){let t=A.filter(A=>void 0!==e[A]),r=t.filter(A=>!As(e[A])),o=r.length>=1?e[r[0]]:"true";if(r.some(A=>e[A]!==o))return!1;for(let A of t)e[A]=o;return!0;}(o,["llvm","clangtidy","clangformat"]))return(0,td.error)("The same version must be used for llvm, clangformat and clangtidy"),1;ed()&&"string"==typeof o.cppcheck&&"string"==typeof o.gcovr&&((0,td.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await eb("python-pygments"));let g=!1,u=!1;for(let e of sW){if(tI.isCI&&0!==a.length){u=!0;break;}let r=o[e];void 0!==r&&(A=Date.now(),g=await AV(e,r,E,n,i,s,a,6e4*Number.parseFloat(o.timeout??"20")),t=Date.now(),(0,td.info)("took "+(c.format(A,t)||"0 seconds")));}if(!u){let e=o.compiler;if(void 0!==e){let A=Date.now();await tE(e,E,i,n,s,g,a);let t=Date.now();(0,td.info)("took "+(c.format(A,t)||"0 seconds"));}}if(await T(sX),0===s.length&&0===a.length)return(0,td.warning)("setup-cpp was called without any arguments. Nothing to do."),0;for(let e of s)(0,td.success)(e);for(let e of a)(0,td.error)(e);if((0,td.info)("setup-cpp finished"),!tI.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,td.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,td.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}return await r,0===a.length?0:1;}var tu,th,tQ,tC,tI,td,tB,tf,tp,ty,tm,tw,tb,tR,tD,tS,tk,tv,tN,tF,tL,tU,t_,tT,tx,tM,tO,tG,tY,tP,tJ,tH,tV,tq,tW,tj,tX,t$,tz,tZ,tK,t0,t1,t2,t4,t9,t8,t3,t5,t6,t7,re,rA,rt,rr,ro,rn,ri,rs,ra,rl,rc,rE,rg,ru,rh,rQ,rC,rI,rd,rB,rf,rp,ry,rm,rw,rb,rR,rD,rS,rk,rv,rN,rF,rL,rU,r_,rT,rx,rM,rO,rG,rY,rP,rJ,rH,rV,rq,rW,rj,rX,r$,rz,rZ,rK,r0,r1,r2,r4,r9,r8=require("os"),r3=require("path"),r5=require("fs"),r6=require("crypto"),r7=require("http"),oe=require("https"),oA=require("net"),ot=require("tls"),or=require("events"),oo=require("assert"),on=require("util"),oi=require("stream"),os=require("buffer"),oa=require("querystring"),ol=require("stream"),oc=require("util"),oE=require("events"),og=require("perf_hooks"),ou=require("worker_threads"),oh=require("async_hooks"),oQ=require("console"),oC=require("url"),oI=require("zlib"),od=require("string_decoder"),oB=require("fs"),of=require("child_process"),op=require("timers"),oy=require("buffer"),om=require("path"),ow=require("child_process"),ob=require("process"),oR=require("url"),oD=require("os"),oS=require("process"),ok=globalThis,ov={},oN={},oF=ok.parcelRequire94c2;null==oF&&((oF=function(e){if(e in ov)return ov[e].exports;if(e in oN){var A=oN[e];delete oN[e];var t={id:e,exports:{}};return ov[e]=t,A.call(t.exports,t,t.exports),t.exports;}var r=Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r;}).register=function(e,A){oN[e]=A;},ok.parcelRequire94c2=oF),(tC=oF.register)("9ne19",function(e,A){var t;function r(e){return"string"==typeof e?!!o[e]:"env"in e?o[e.env]&&o[e.env].includes(e.includes):"any"in e?e.any.some(function(e){return!!o[e];}):Object.keys(e).every(function(A){return o[A]===e[A];});}t=oF("elk84");let o=process.env;Object.defineProperty(e.exports,"_vendors",{value:t.map(function(e){return e.constant;})}),e.exports.name=null,e.exports.isPR=null,t.forEach(function(A){let t=(Array.isArray(A.env)?A.env:[A.env]).every(function(e){return r(e);});if(e.exports[A.constant]=t,t)switch(e.exports.name=A.name,typeof A.pr){case"string":e.exports.isPR=!!o[A.pr];break;case"object"
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);},e.exports.setOutput=function(e,A){if(process.env.GITHUB_OUTPUT)return s.issueFileCommand("OUTPUT",s.prepareKeyValueMessage(e,A));process.stdout.write(d.EOL),i.issueCommand("set-output",{name:e},a.toCommandValue(A));},e.exports.setCommandEcho=function(e){i.issue("echo",e?"on":"off");},e.exports.setFailed=function(e){process.exitCode=c.Failure,Q(e);},e.exports.isDebug=function(){return"1"===process.env.RUNNER_DEBUG;},e.exports.debug=function(e){i.issueCommand("debug",{},e);},e.exports.error=Q,e.exports.warning=function(e,A={}){i.issueCommand("warning",a.toCommandProperties(A),e instanceof Error?e.toString():e);},e.exports.notice=function(e,A={}){i.issueCommand("notice",a.toCommandProperties(A),e instanceof Error?e.toString():e);},e.exports.info=function(e){process.stdout.write(e+d.EOL);},e.exports.startGroup=C,e.exports.endGroup=I,e.exports.group=function(e,A){return n(this,void 0,void 0,function*(){let t;C(e);try{t=yield A();}finally{I();}return t;});},e.exports.saveState=function(e,A){if(process.env.GITHUB_STATE)return s.issueFileCommand("STATE",s.prepareKeyValueMessage(e,A));i.issueCommand("save-state",{name:e},a.toCommandValue(A));},e.exports.getState=function(e){return process.env["STATE_"+e]||"";},e.exports.getIDToken=function(e){return n(this,void 0,void 0,function*(){return yield l.OidcClient.getIDToken(e);});},E=oF("kPBPC"),Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return E.summary;}}),E=oF("kPBPC"),Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return E.markdownSummary;}}),g=oF("fv8Nn"),Object.defineProperty(e.exports,"toPosixPath",{enumerable:!0,get:function(){return g.toPosixPath;}}),Object.defineProperty(e.exports,"toWin32Path",{enumerable:!0,get:function(){return g.toWin32Path;}}),Object.defineProperty(e.exports,"toPlatformPath",{enumerable:!0,get:function(){return g.toPlatformPath;}});}),tC("lffbf",function(e,A){var t,r,o,n;function i(e,A,t){let r=new a(e,A,t);process.stdout.write(r.toString()+s.EOL);}t=e.exports&&e.exports.__createBinding||(Object.create?function(e,A,t,r){void 0===r&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return A[t];}});}:function(e,A,t,r){void 0===r&&(r=t),e[r]=A[t];}),r=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,A){Object.defineProperty(e,"default",{enumerable:!0,value:A});}:function(e,A){e.default=A;}),o=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var A={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&t(A,e,o);return r(A,e),A;},Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.issue=e.exports.issueCommand=void 0;let s=o(r8);n=oF("h6Xqd"),e.exports.issueCommand=i,e.exports.issue=function(e,A=""){i(e,{},A);};class a{constructor(e,A,t){e||(e="missing.command"),this.command=e,this.properties=A,this.message=t;}toString(){var e;let A="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){A+=" ";let e=!0;for(let t in this.properties)if(this.properties.hasOwnProperty(t)){let r=this.properties[t];r&&(e?e=!1:A+=",",A+=`${t}=${n.toCommandValue(r).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return A+("::"+(e=this.message,n.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")));}}}),tC("h6Xqd",function(e,A){Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.toCommandProperties=e.exports.toCommandValue=void 0,e.exports.toCommandValue=function(e){return null==e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e);},e.exports.toCommandProperties=function(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{};};}),tC("60EQk",function(e,A){var t,r,o,n,i;t=e.exports&&e.exports.__createBinding||(Object.create?function(e,A,t,r){void 0===r&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return A[t];}});}:function(e,
Error Code : ${e.statusCode}
Error Message: ${e.message}`);})).result)||void 0===A?void 0:A.value;if(!r)throw Error("Response json body do not have ID Token field");return r;});}static getIDToken(e){return t(this,void 0,void 0,function*(){try{let A=i.getIDTokenUrl();if(e){let t=encodeURIComponent(e);A=`${A}&audience=${t}`;}n.debug("ID token url is "+A);let t=yield i.getCall(A);return n.setSecret(t),t;}catch(e){throw Error("Error message: "+e.message);}});}}e.exports.OidcClient=i;}),tC("jgesS",function(e,A){var t,r,o,n,i,s,a,l,c,E;t=e.exports&&e.exports.__createBinding||(Object.create?function(e,A,t,r){void 0===r&&(r=t);var o=Object.getOwnPropertyDescriptor(A,t);(!o||("get"in o?!A.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return A[t];}}),Object.defineProperty(e,r,o);}:function(e,A,t,r){void 0===r&&(r=t),e[r]=A[t];}),r=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,A){Object.defineProperty(e,"default",{enumerable:!0,value:A});}:function(e,A){e.default=A;}),o=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var A={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(A,e,o);return r(A,e),A;},n=e.exports&&e.exports.__awaiter||function(e,A,t,r){return new(t||(t=Promise))(function(o,n){function i(e){try{a(r.next(e));}catch(e){n(e);}}function s(e){try{a(r.throw(e));}catch(e){n(e);}}function a(e){var A;e.done?o(e.value):((A=e.value)instanceof t?A:new t(function(e){e(A);})).then(i,s);}a((r=r.apply(e,A||[])).next());});},Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.HttpClient=e.exports.isHttps=e.exports.HttpClientResponse=e.exports.HttpClientError=e.exports.getProxyUrl=e.exports.MediaTypes=e.exports.Headers=e.exports.HttpCodes=void 0;let g=o(r7),u=o(oe),h=o(oF("GX2ei")),Q=o(oF("eYDoL"));i=oF("4rVGe"),(c=s||(e.exports.HttpCodes=s={}))[c.OK=200]="OK",c[c.MultipleChoices=300]="MultipleChoices",c[c.MovedPermanently=301]="MovedPermanently",c[c.ResourceMoved=302]="ResourceMoved",c[c.SeeOther=303]="SeeOther",c[c.NotModified=304]="NotModified",c[c.UseProxy=305]="UseProxy",c[c.SwitchProxy=306]="SwitchProxy",c[c.TemporaryRedirect=307]="TemporaryRedirect",c[c.PermanentRedirect=308]="PermanentRedirect",c[c.BadRequest=400]="BadRequest",c[c.Unauthorized=401]="Unauthorized",c[c.PaymentRequired=402]="PaymentRequired",c[c.Forbidden=403]="Forbidden",c[c.NotFound=404]="NotFound",c[c.MethodNotAllowed=405]="MethodNotAllowed",c[c.NotAcceptable=406]="NotAcceptable",c[c.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",c[c.RequestTimeout=408]="RequestTimeout",c[c.Conflict=409]="Conflict",c[c.Gone=410]="Gone",c[c.TooManyRequests=429]="TooManyRequests",c[c.InternalServerError=500]="InternalServerError",c[c.NotImplemented=501]="NotImplemented",c[c.BadGateway=502]="BadGateway",c[c.ServiceUnavailable=503]="ServiceUnavailable",c[c.GatewayTimeout=504]="GatewayTimeout",(E=a||(e.exports.Headers=a={})).Accept="accept",E.ContentType="content-type",(l||(e.exports.MediaTypes=l={})).ApplicationJson="application/json",e.exports.getProxyUrl=function(e){let A=h.getProxyUrl(new URL(e));return A?A.href:"";};let C=[s.MovedPermanently,s.ResourceMoved,s.SeeOther,s.TemporaryRedirect,s.PermanentRedirect],I=[s.BadGateway,s.ServiceUnavailable,s.GatewayTimeout],d=["OPTIONS","GET","DELETE","HEAD"];class B extends Error{constructor(e,A){super(e),this.name="HttpClientError",this.statusCode=A,Object.setPrototypeOf(this,B.prototype);}}e.exports.HttpClientError=B;class f{constructor(e){this.message=e;}readBody(){return n(this,void 0,void 0,function*(){return new Promise(e=>n(this,void 0,void 0,function*(){let A=Buffer.alloc(0);this.message.on("data",e=>{A=Buffer.concat([A,e]);}),this.message.on("end",()=>{e(A.toString());});}));});}readBodyBuffer(){return n(this,void 0,void 0,function*(){return new Promise(e=>n(this,void 0,void 0,function*(){let A=[];this.message.on("data",e=>{A.push(e);}),this.message.on("end",()=>{e(Buffer.concat(A));});}));});}}e.exports.HttpClientResponse=f,e.exports.isHttps=function(e){return"https:"===new URL(e).protocol;},e.exports.HttpCl
`;return"string"==typeof s?B+=`host: ${s}\r
`:B+=e[Y],l?B+=`connection: upgrade\r
upgrade: ${l}\r
`:e[V]&&!d[m]?B+="connection: keep-alive\r\n":B+="connection: close\r\n",c&&(B+=c),eX.sendHeaders.hasSubscribers&&eX.sendHeaders.publish({request:A,headers:B,socket:d}),t&&0!==C?r.isBuffer(t)?(oo(I===t.byteLength,"buffer body must have content length"),d.cork(),d.write(`${B}content-length: ${I}\r
\r
`,"latin1"),d.write(t),d.uncork(),A.onBodySent(t),A.onRequestSent(),h||(d[m]=!0)):r.isBlobLike(t)?"function"==typeof t.stream?ex({body:t.stream(),client:e,request:A,socket:d,contentLength:I,header:B,expectsPayload:h}):eT({body:t,client:e,request:A,socket:d,contentLength:I,header:B,expectsPayload:h}):r.isStream(t)?e_({body:t,client:e,request:A,socket:d,contentLength:I,header:B,expectsPayload:h}):r.isIterable(t)?ex({body:t,client:e,request:A,socket:d,contentLength:I,header:B,expectsPayload:h}):oo(!1):(0===I?d.write(`${B}content-length: 0\r
\r
`,"latin1"):(oo(null===I,"no body must not have content length"),d.write(`${B}\r
`,"latin1")),A.onRequestSent()),!0;}(e,o)?e[P]++:e[_].splice(e[P],1);}}(e,A),e[v]=0,e[J]>256&&(e[_].splice(0,e[J]),e[P]-=e[J],e[J]=0));}function eU(e){return"GET"!==e&&"HEAD"!==e&&"OPTIONS"!==e&&"TRACE"!==e&&"CONNECT"!==e;}function e_({h2stream:e,body:A,client:o,request:n,socket:i,contentLength:s,header:a,expectsPayload:l}){if(oo(0!==s||0===o[N],"stream body cannot be pipelined"),"h2"===o[ec]){function c(e){n.onBodySent(e);}let o=t(A,e,t=>{t?(r.destroy(A,t),r.destroy(e,t)):n.onRequestSent();});o.on("data",c),o.once("end",()=>{o.removeListener("data",c),r.destroy(o);});return;}let g=!1,u=new e5({socket:i,request:n,contentLength:s,client:o,expectsPayload:l,header:a}),h=function(e){if(!g)try{!u.write(e)&&this.pause&&this.pause();}catch(e){r.destroy(this,e);}},Q=function(){!g&&A.resume&&A.resume();},C=function(){if(g)return;let e=new E();queueMicrotask(()=>I(e));},I=function(e){if(!g){if(g=!0,oo(i.destroyed||i[U]&&o[N]<=1),i.off("drain",Q).off("error",I),A.removeListener("data",h).removeListener("end",I).removeListener("error",I).removeListener("close",C),!e)try{u.end();}catch(A){e=A;}u.destroy(e),e&&("UND_ERR_INFO"!==e.code||"reset"!==e.message)?r.destroy(A,e):r.destroy(A);}};A.on("data",h).on("end",I).on("error",I).on("close",C),A.resume&&A.resume(),i.on("drain",Q).on("error",I);}async function eT({h2stream:e,body:A,client:t,request:o,socket:n,contentLength:i,header:s,expectsPayload:l}){oo(i===A.size,"blob body must have content length");let c="h2"===t[ec];try{if(null!=i&&i!==A.size)throw new a();let r=Buffer.from(await A.arrayBuffer());c?(e.cork(),e.write(r),e.uncork()):(n.cork(),n.write(`${s}content-length: ${i}\r
\r
`,"latin1"),n.write(r),n.uncork()),o.onBodySent(r),o.onRequestSent(),l||(n[m]=!0),eL(t);}catch(A){r.destroy(c?e:n,A);}}async function ex({h2stream:e,body:A,client:t,request:r,socket:o,contentLength:n,header:i,expectsPayload:s}){function a(){if(l){let e=l;l=null,e();}}oo(0!==n||0===t[N],"iterator body cannot be pipelined");let l=null,c=()=>new Promise((e,A)=>{oo(null===l),o[H]?A(o[H]):l=e;});if("h2"===t[ec]){e.on("close",a).on("drain",a);try{for await(let t of A){if(o[H])throw o[H];let A=e.write(t);r.onBodySent(t),A||(await c());}}catch(A){e.destroy(A);}finally{r.onRequestSent(),e.end(),e.off("close",a).off("drain",a);}return;}o.on("close",a).on("drain",a);let E=new e5({socket:o,request:r,contentLength:n,client:t,expectsPayload:s,header:i});try{for await(let e of A){if(o[H])throw o[H];E.write(e)||(await c());}E.end();}catch(e){E.destroy(e);}finally{o.off("close",a).off("drain",a);}}function eM(e,A,t){try{A.onError(t),oo(A.aborted);}catch(A){e.emit("error",A);}}t=oi.pipeline,r=oF("jqWlt"),o=oF("8zzvT"),n=oF("8XvZr"),i=oF("8jk4s"),a=(s=oF("eCuXV")).RequestContentLengthMismatchError,l=s.ResponseContentLengthMismatchError,c=s.InvalidArgumentError,E=s.RequestAbortedError,g=s.HeadersTimeoutError,u=s.HeadersOverflowError,h=s.SocketError,Q=s.InformationalError,C=s.BodyTimeoutError,I=s.HTTPParserError,d=s.ResponseExceededMaxSizeError,B=s.ClientDestroyedError,f=oF("8fhlK"),y=(p=oF("heqcE")).kUrl,m=p.kReset,w=p.kServerName,b=p.kClient,R=p.kBusy,D=p.kParser,S=p.kConnect,k=p.kBlocking,v=p.kResuming,N=p.kRunning,F=p.kPending,L=p.kSize,U=p.kWriting,_=p.kQueue,T=p.kConnected,x=p.kConnecting,M=p.kNeedDrain,O=p.kNoRef,G=p.kKeepAliveDefaultTimeout,Y=p.kHostHeader,P=p.kPendingIdx,J=p.kRunningIdx,H=p.kError,V=p.kPipelining,q=p.kSocket,W=p.kKeepAliveTimeoutValue,j=p.kMaxHeadersSize,X=p.kKeepAliveMaxTimeout,$=p.kKeepAliveTimeoutThreshold,z=p.kHeadersTimeout,Z=p.kBodyTimeout,K=p.kStrictContentLength,ee=p.kConnector,eA=p.kMaxRedirections,et=p.kMaxRequests,er=p.kCounter,eo=p.kClose,en=p.kDestroy,ei=p.kDispatch,es=p.kInterceptors,ea=p.kLocalAddress,el=p.kMaxResponseSize,ec=p.kHTTPConnVersion,eE=p.kHost,eg=p.kHTTP2Session,eu=p.kHTTP2SessionState,eh=p.kHTTP2BuildRequest,eQ=p.kHTTP2CopyHeaders,eC=p.kHTTP1BuildRequest;try{eB=$2321944cfe4ffd56$import$44c8f355160d282b;}catch{eB={constants:{}};}let{constants:{HTTP2_HEADER_AUTHORITY:eO,HTTP2_HEADER_METHOD:eG,HTTP2_HEADER_PATH:eY,HTTP2_HEADER_SCHEME:eP,HTTP2_HEADER_CONTENT_LENGTH:eJ,HTTP2_HEADER_EXPECT:eH,HTTP2_HEADER_STATUS:eV}}=eB,eq=!1,eW=Buffer[Symbol.species],ej=Symbol(),eX={};try{let e=oF("dfobN");eX.sendHeaders=e.channel("undici:client:sendHeaders"),eX.beforeConnect=e.channel("undici:client:beforeConnect"),eX.connectError=e.channel("undici:client:connectError"),eX.connected=e.channel("undici:client:connected");}catch{eX.sendHeaders={hasSubscribers:!1},eX.beforeConnect={hasSubscribers:!1},eX.connectError={hasSubscribers:!1},eX.connected={hasSubscribers:!1};}eI=oF("51KgU"),ed=oF("lx1W2");let e$=Buffer.alloc(0),ez=null,eZ=ew();eZ.catch();let eK=null,e0=null,e1=0,e2=null,e4=1,e9=2,e8=3;class e3{constructor(e,A,{exports:t}){oo(Number.isFinite(e[j])&&e[j]>0),this.llhttp=t,this.ptr=this.llhttp.llhttp_alloc(eI.TYPE.RESPONSE),this.client=e,this.socket=A,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[j],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[el];}setTimeout(e,A){this.timeoutType=A,e!==this.timeoutValue?(o.clearTimeout(this.timeout),e?(this.timeout=o.setTimeout(eb,e,this),this.timeout.unref&&this.timeout.unref()):this.timeout=null,this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh();}resume(){!this.socket.destroyed&&this.paused&&(oo(null!=this.ptr),oo(null==eK),this.llhttp.llhttp_resume(this.ptr),oo(this.timeoutType===e9),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()
`,"latin1"):A.write(`${s}content-length: ${r}\r
\r
`,"latin1")),null===r&&A.write(`\r
${l.toString(16)}\r
`,"latin1"),this.bytesWritten+=l;let c=A.write(e);return A.uncork(),t.onBodySent(e),!c&&A[D].timeout&&A[D].timeoutType===e4&&A[D].timeout.refresh&&A[D].timeout.refresh(),c;}end(){let{socket:e,contentLength:A,client:t,bytesWritten:r,expectsPayload:o,header:n,request:i}=this;if(i.onRequestSent(),e[U]=!1,e[H])throw e[H];if(!e.destroyed){if(0===r?o?e.write(`${n}content-length: 0\r
\r
`,"latin1"):e.write(`${n}\r
`,"latin1"):null===A&&e.write("\r\n0\r\n\r\n","latin1"),null!==A&&r!==A){if(t[K])throw new a();process.emitWarning(new a());}e[D].timeout&&e[D].timeoutType===e4&&e[D].timeout.refresh&&e[D].timeout.refresh(),eL(t);}}destroy(e){let{socket:A,client:t}=this;A[U]=!1,e&&(oo(t[N]<=1,"pipeline should only contain this request"),r.destroy(A,e));}}e.exports=class extends i{constructor(e,{interceptors:A,maxHeaderSize:t,headersTimeout:o,socketTimeout:n,requestTimeout:i,connectTimeout:s,bodyTimeout:a,idleTimeout:l,keepAlive:E,keepAliveTimeout:g,maxKeepAliveTimeout:u,keepAliveMaxTimeout:h,keepAliveTimeoutThreshold:Q,socketPath:C,pipelining:I,tls:d,strictContentLength:B,maxCachedSessions:p,maxRedirections:m,connect:b,maxRequestsPerClient:R,localAddress:D,maxResponseSize:S,autoSelectFamily:k,autoSelectFamilyAttemptTimeout:N,allowH2:F,maxConcurrentStreams:L}={}){if(super(),void 0!==E)throw new c("unsupported keepAlive, use pipelining=0 instead");if(void 0!==n)throw new c("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==i)throw new c("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==l)throw new c("unsupported idleTimeout, use keepAliveTimeout instead");if(void 0!==u)throw new c("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(null!=t&&!Number.isFinite(t))throw new c("invalid maxHeaderSize");if(null!=C&&"string"!=typeof C)throw new c("invalid socketPath");if(null!=s&&(!Number.isFinite(s)||s<0))throw new c("invalid connectTimeout");if(null!=g&&(!Number.isFinite(g)||g<=0))throw new c("invalid keepAliveTimeout");if(null!=h&&(!Number.isFinite(h)||h<=0))throw new c("invalid keepAliveMaxTimeout");if(null!=Q&&!Number.isFinite(Q))throw new c("invalid keepAliveTimeoutThreshold");if(null!=o&&(!Number.isInteger(o)||o<0))throw new c("headersTimeout must be a positive integer or zero");if(null!=a&&(!Number.isInteger(a)||a<0))throw new c("bodyTimeout must be a positive integer or zero");if(null!=b&&"function"!=typeof b&&"object"!=typeof b)throw new c("connect must be a function or an object");if(null!=m&&(!Number.isInteger(m)||m<0))throw new c("maxRedirections must be a positive number");if(null!=R&&(!Number.isInteger(R)||R<0))throw new c("maxRequestsPerClient must be a positive number");if(null!=D&&("string"!=typeof D||0===oA.isIP(D)))throw new c("localAddress must be valid string IP address");if(null!=S&&(!Number.isInteger(S)||S<-1))throw new c("maxResponseSize must be a positive number");if(null!=N&&(!Number.isInteger(N)||N<-1))throw new c("autoSelectFamilyAttemptTimeout must be a positive number");if(null!=F&&"boolean"!=typeof F)throw new c("allowH2 must be a valid boolean value");if(null!=L&&("number"!=typeof L||L<1))throw new c("maxConcurrentStreams must be a possitive integer, greater than 0");"function"!=typeof b&&(b=f({...d,maxCachedSessions:p,allowH2:F,socketPath:C,timeout:s,...(r.nodeHasAutoSelectFamily&&k?{autoSelectFamily:k,autoSelectFamilyAttemptTimeout:N}:void 0),...b})),this[es]=A&&A.Client&&Array.isArray(A.Client)?A.Client:[ed({maxRedirections:m})],this[y]=r.parseOrigin(e),this[ee]=b,this[q]=null,this[V]=null!=I?I:1,this[j]=t||r7.maxHeaderSize,this[G]=null==g?4e3:g,this[X]=null==h?6e5:h,this[$]=null==Q?1e3:Q,this[W]=this[G],this[w]=null,this[ea]=null!=D?D:null,this[v]=0,this[M]=0,this[Y]=`host: ${this[y].hostname}${this[y].port?":"+this[y].port:""}\r
`,this[Z]=null!=a?a:3e5,this[z]=null!=o?o:3e5,this[K]=null==B||B,this[eA]=m,this[et]=R,this[ej]=null,this[el]=S>-1?S:-1,this[ec]="h1",this[eg]=null,this[eu]=F?{openStreams:0,maxConcurrentStreams:null!=L?L:100}:null,this[eE]=`${this[y].hostname}${this[y].port?":"+this[y].port:""}`,this[_]=[],this[J]=0,this[P]=0;}get pipelining(){return this[V];}set pipelining(e){this[V]=e,eL(this,!0);}get[F](){return this[_].length-this[P];}get[N](){return this[P]-this[J];}get[L](){return this[_].length-this[J];}get[T](){return!!this[q]&&!this[x]&&!this[q].destroyed;}get[R](){let e=this[q];return e&&(e[m]||e[U]||e[k])||this[L]>=(this[V]||1)||this[F]>0;}[S](e){eN(this),this.once("connect",e);}[ei](e,A){let t=e.origin||this[y].origin,o="h2"===this[ec]?n[eh](t,e,A):n[eC](t,e,A);return this[_].push(o),this[v]||(null==r.bodyLength(o.body)&&r.isIterable(o.body)?(this[v]=1,process.nextTick(eL,this)):eL(this,!0)),this[v]&&2!==this[M]&&this[R]&&(this[M]=2),this[M]<2;}async[eo](){return new Promise(e=>{this[L]?this[ej]=e:e(null);});}async[en](e){return new Promise(A=>{let t=this[_].splice(this[P]);for(let A=0;A<t.length;A++)eM(this,t[A],e);let o=()=>{this[ej]&&(this[ej](),this[ej]=null),A();};null!=this[eg]&&(r.destroy(this[eg],e),this[eg]=null,this[eu]=null),this[q]?r.destroy(this[q].on("close",o),e):queueMicrotask(o),eL(this);});}};}),tC("jqWlt",function(e,A){var t,r,o,n,i,s,a,l;let c;function E(e){return e&&"object"==typeof e&&"function"==typeof e.pipe&&"function"==typeof e.on;}function g(e){return s&&e instanceof s||e&&"object"==typeof e&&("function"==typeof e.stream||"function"==typeof e.arrayBuffer)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]);}function u(e){if("string"==typeof e){if(e=new URL(e),!/^https?:/.test(e.origin||e.protocol))throw new i("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e;}if(!e||"object"!=typeof e)throw new i("Invalid URL: The URL argument must be a non-null object.");if(!/^https?:/.test(e.origin||e.protocol))throw new i("Invalid URL protocol: the URL must start with `http:` or `https:`.");if(!(e instanceof URL)){if(null!=e.port&&""!==e.port&&!Number.isFinite(parseInt(e.port)))throw new i("Invalid URL: port must be a valid integer or a string representation of an integer.");if(null!=e.path&&"string"!=typeof e.path)throw new i("Invalid URL path: the path must be a string or null/undefined.");if(null!=e.pathname&&"string"!=typeof e.pathname)throw new i("Invalid URL pathname: the pathname must be a string or null/undefined.");if(null!=e.hostname&&"string"!=typeof e.hostname)throw new i("Invalid URL hostname: the hostname must be a string or null/undefined.");if(null!=e.origin&&"string"!=typeof e.origin)throw new i("Invalid URL origin: the origin must be a string or null/undefined.");let A=null!=e.port?e.port:"https:"===e.protocol?443:80,t=null!=e.origin?e.origin:`${e.protocol}//${e.hostname}:${A}`,r=null!=e.path?e.path:`${e.pathname||""}${e.search||""}`;t.endsWith("/")&&(t=t.substring(0,t.length-1)),r&&!r.startsWith("/")&&(r="/"+r),e=new URL(t+r);}return e;}function h(e){return!e||!!(e.destroyed||e[r]);}function Q(e){let A=e&&e._readableState;return h(e)&&A&&!A.endEmitted;}function C(e){return e instanceof Uint8Array||Buffer.isBuffer(e);}async function*I(e){for await(let A of e)yield Buffer.isBuffer(A)?A:Buffer.from(A);}r=(t=oF("heqcE")).kDestroyed,o=t.kBodyUsed,n=r7.IncomingMessage,i=oF("eCuXV").InvalidArgumentError,s=os.Blob,a=oa.stringify,l=oF("9yhov").headerNameLowerCasedRecord;let[d,B]=process.versions.node.split(".").map(e=>+e),f=!!String.prototype.toWellFormed,p=Object.create(null);p.enumerable=!0,e.exports={kEnumerableProperty:p,nop:function(){},isDisturbed:function(e){return!!(e&&(oi.isDisturbed?oi.isDisturbed(e)||e[o]:e[o]||e.readableDidRead||e._readableState&&e._readableState.dataEmitted||Q(e)));},isErrored:function(e){return!!(e&&(oi.isErrored?oi.isErrored(e):/state: 'errored'/.test(on.inspect(e))));},isReadable:function(e){return!!(e&&(oi.isReadable?oi.isReadable(e):/state: 'readable'/.test(on.inspect(e))));},toUSVString:function(e){return f?(""+e).toWellFormed():on.toUSVString?
`;}function g(e,A,t,n=!1){if(t&&"object"==typeof t&&!Array.isArray(t))throw new r(`invalid ${A} header`);if(void 0!==t){if(null===e.host&&4===A.length&&"host"===A.toLowerCase()){if(null!==h.exec(t))throw new r(`invalid ${A} header`);e.host=t;}else if(null===e.contentLength&&14===A.length&&"content-length"===A.toLowerCase()){if(e.contentLength=parseInt(t,10),!Number.isFinite(e.contentLength))throw new r("invalid content-length header");}else if(null===e.contentType&&12===A.length&&"content-type"===A.toLowerCase())e.contentType=t,n?e.headers[A]=E(A,t,n):e.headers+=E(A,t);else if(17===A.length&&"transfer-encoding"===A.toLowerCase())throw new r("invalid transfer-encoding header");else if(10===A.length&&"connection"===A.toLowerCase()){let A="string"==typeof t?t.toLowerCase():null;if("close"!==A&&"keep-alive"!==A)throw new r("invalid connection header");"close"===A&&(e.reset=!0);}else if(10===A.length&&"keep-alive"===A.toLowerCase())throw new r("invalid keep-alive header");else if(7===A.length&&"upgrade"===A.toLowerCase())throw new r("invalid upgrade header");else if(6===A.length&&"expect"===A.toLowerCase())throw new o("expect header not supported");else if(null===u.exec(A))throw new r("invalid header key");else if(Array.isArray(t))for(let r=0;r<t.length;r++)n?e.headers[A]?e.headers[A]+=","+E(A,t[r],n):e.headers[A]=E(A,t[r],n):e.headers+=E(A,t[r]);else n?e.headers[A]=E(A,t,n):e.headers+=E(A,t);}}r=(t=oF("eCuXV")).InvalidArgumentError,o=t.NotSupportedError,i=(n=oF("heqcE")).kHTTP2BuildRequest,s=n.kHTTP2CopyHeaders,a=n.kHTTP1BuildRequest,l=oF("jqWlt");let u=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,h=/[^\t\x20-\x7e\x80-\xff]/,Q=Symbol(),C={};try{let e=oF("dfobN");C.create=e.channel("undici:request:create"),C.bodySent=e.channel("undici:request:bodySent"),C.headers=e.channel("undici:request:headers"),C.trailers=e.channel("undici:request:trailers"),C.error=e.channel("undici:request:error");}catch{C.create={hasSubscribers:!1},C.bodySent={hasSubscribers:!1},C.headers={hasSubscribers:!1},C.trailers={hasSubscribers:!1},C.error={hasSubscribers:!1};}class I{constructor(e,{path:A,method:t,body:o,headers:n,query:i,idempotent:s,blocking:a,upgrade:E,headersTimeout:h,bodyTimeout:I,reset:d,throwOnError:B,expectContinue:f},p){if("string"!=typeof A)throw new r("path must be a string");if("/"===A[0]||A.startsWith("http://")||A.startsWith("https://")||"CONNECT"===t){if(null!==/[^\u0021-\u00ff]/.exec(A))throw new r("invalid request path");}else throw new r("path must be an absolute URL or start with a slash");if("string"!=typeof t)throw new r("method must be a string");if(null===u.exec(t))throw new r("invalid request method");if(E&&"string"!=typeof E)throw new r("upgrade must be a string");if(null!=h&&(!Number.isFinite(h)||h<0))throw new r("invalid headersTimeout");if(null!=I&&(!Number.isFinite(I)||I<0))throw new r("invalid bodyTimeout");if(null!=d&&"boolean"!=typeof d)throw new r("invalid reset");if(null!=f&&"boolean"!=typeof f)throw new r("invalid expectContinue");if(this.headersTimeout=h,this.bodyTimeout=I,this.throwOnError=!0===B,this.method=t,this.abort=null,null==o)this.body=null;else if(l.isStream(o)){this.body=o;let e=this.body._readableState;e&&e.autoDestroy||(this.endHandler=function(){l.destroy(this);},this.body.on("end",this.endHandler)),this.errorHandler=e=>{this.abort?this.abort(e):this.error=e;},this.body.on("error",this.errorHandler);}else if(l.isBuffer(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if("string"==typeof o)this.body=o.length?Buffer.from(o):null;else if(l.isFormDataLike(o)||l.isIterable(o)||l.isBlobLike(o))this.body=o;else throw new r("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=E||null,this.path=i?l.buildURL(A,i):A,this.origin=e,this.idempotent=null==s?"HEAD"===t||"GET"===t:s,this.blocking=null!=a&&a,this.reset=null==d?null:d,this.host=null,this.contentLen
`),this.body=e.stream,this.contentLength=e.length;}else l.isBlobLike(o)&&null==this.contentType&&o.type&&(this.contentType=o.type,this.headers+=`content-type: ${o.type}\r
`);l.validateHandler(p,t,E),this.servername=l.getServerName(this.host),this[Q]=p,C.create.hasSubscribers&&C.create.publish({request:this});}onBodySent(e){if(this[Q].onBodySent)try{return this[Q].onBodySent(e);}catch(e){this.abort(e);}}onRequestSent(){if(C.bodySent.hasSubscribers&&C.bodySent.publish({request:this}),this[Q].onRequestSent)try{return this[Q].onRequestSent();}catch(e){this.abort(e);}}onConnect(e){if(oo(!this.aborted),oo(!this.completed),!this.error)return this.abort=e,this[Q].onConnect(e);e(this.error);}onHeaders(e,A,t,r){oo(!this.aborted),oo(!this.completed),C.headers.hasSubscribers&&C.headers.publish({request:this,response:{statusCode:e,headers:A,statusText:r}});try{return this[Q].onHeaders(e,A,t,r);}catch(e){this.abort(e);}}onData(e){oo(!this.aborted),oo(!this.completed);try{return this[Q].onData(e);}catch(e){return this.abort(e),!1;}}onUpgrade(e,A,t){return oo(!this.aborted),oo(!this.completed),this[Q].onUpgrade(e,A,t);}onComplete(e){this.onFinally(),oo(!this.aborted),this.completed=!0,C.trailers.hasSubscribers&&C.trailers.publish({request:this,trailers:e});try{return this[Q].onComplete(e);}catch(e){this.onError(e);}}onError(e){if(this.onFinally(),C.error.hasSubscribers&&C.error.publish({request:this,error:e}),!this.aborted)return this.aborted=!0,this[Q].onError(e);}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null);}addHeader(e,A){return g(this,e,A),this;}static[a](e,A,t){return new I(e,A,t);}static[i](e,A,t){let o=A.headers,n=new I(e,A={...A,headers:null},t);if(n.headers={},Array.isArray(o)){if(o.length%2!=0)throw new r("headers array must be even");for(let e=0;e<o.length;e+=2)g(n,o[e],o[e+1],!0);}else if(o&&"object"==typeof o){let e=Object.keys(o);for(let A=0;A<e.length;A++){let t=e[A];g(n,t,o[t],!0);}}else if(null!=o)throw new r("headers must be an object or an array");return n;}static[s](e){let A=e.split("\r\n"),t={};for(let e of A){let[A,r]=e.split(": ");null!=r&&0!==r.length&&(t[A]?t[A]+=","+r:t[A]=r);}return t;}}e.exports=I;}),tC("dfobN",function(e,A){class t extends TypeError{constructor(e,A){if(super(),null==A)e+=". Received "+A;else if("function"==typeof A&&A.name)e+=". Received function "+A.name;else if("object"==typeof A)A.constructor&&A.constructor.name?e+=". Received an instance of "+A.constructor.name:e+=". Received "+on.inspect(A,{depth:-1});else{let t=on.inspect(A,{colors:!1});t.length>25&&(t=`${t.slice(0,25)}...`),e+=`. Received type ${typeof A} (${t})`;}this.code=this.constructor.name,Object.defineProperties(this,{message:{value:e,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${this.code}]: ${this.message}`;},enumerable:!1,writable:!0,configurable:!0}});}}class r{subscribe(e){if("function"!=typeof e)throw new t('The "subscription" argument must be of type function',e);this._subscribers.push(e);}unsubscribe(e){let A=this._subscribers.indexOf(e);return-1!==A&&(this._subscribers.splice(A,1),this._subscribers.length||Object.setPrototypeOf(this,o.prototype),!0);}get hasSubscribers(){return!0;}publish(e){for(let A=0;A<this._subscribers.length;A++)try{(0,this._subscribers[A])(e,this.name);}catch(e){process.nextTick(()=>{throw e;});}}}class o{constructor(e){this._subscribers=void 0,this.name=e;}static[Symbol.hasInstance](e){let A=Object.getPrototypeOf(e);return A===o.prototype||A===r.prototype;}subscribe(e){Object.setPrototypeOf(this,r.prototype),this._subscribers=[],this.subscribe(e);}unsubscribe(){return!1;}get hasSubscribers(){return!1;}publish(){}}let n={};e.exports={channel:function(e){let A=n[e];if(A)return A;if("string"!=typeof e&&"symbol"!=typeof e)throw new t('The "channel" argument must be one of type string or symbol',e);return n[e]=new o(e);},hasSubscribers:function(e){let A=n[e];return!!A&&A.hasSubscribers;},Channel:o,deleteChannel:function(e){return!!n[e]&&(n[e]=null,!0);}};}),tC("8oEYI",function(e,A){var t,r,o,n,i,s,a,l,c,E,g,u,h,Q,C,I,d,B,f,p,y,m,w,b,R,D;function S(e,A=!1){U||(U=oF("j5cOJ").ReadableStream);let t=null;t=e
Content-Disposition: form-data`,r=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),n=e=>e.replace(/\r?\n|\r/g,"\r\n"),i=[],s=new Uint8Array([13,10]);c=0;let a=!1;for(let[A,o]of e)if("string"==typeof o){let e=T.encode(t+`; name="${r(n(A))}"`+`\r
\r
${n(o)}\r
`);i.push(e),c+=e.byteLength;}else{let e=T.encode(`${t}; name="${r(n(A))}"`+(o.name?`; filename="${r(o.name)}"`:"")+"\r\n"+`Content-Type: ${o.type||"application/octet-stream"}\r
\r
`);i.push(e,o,s),"number"==typeof o.size?c+=e.byteLength+o.size+s.byteLength:a=!0;}let g=T.encode(`--${A}--`);i.push(g),c+=g.byteLength,a&&(c=null),l=e,o=async function*(){for(let e of i)e.stream?yield*e.stream():yield e;},E="multipart/form-data; boundary="+A;}else if(i(e))l=e,c=e.size,e.type&&(E=e.type);else if("function"==typeof e[Symbol.asyncIterator]){if(A)throw TypeError("keepalive");if(r.isDisturbed(e)||e.locked)throw TypeError("Response body object should not be disturbed or locked");t=e instanceof U?e:n(e);}if(("string"==typeof l||r.isBuffer(l))&&(c=Buffer.byteLength(l)),null!=o){let A;t=new U({async start(){A=o(e)[Symbol.asyncIterator]();},async pull(e){let{value:r,done:o}=await A.next();return o?queueMicrotask(()=>{e.close();}):f(t)||e.enqueue(new Uint8Array(r)),e.desiredSize>0;},async cancel(e){await A.return();},type:void 0});}return[{stream:t,source:l,length:c},E];}async function*k(e){if(e){if(y(e))yield e;else{let A=e.stream;if(r.isDisturbed(A))throw TypeError("The body has already been consumed.");if(A.locked)throw TypeError("The stream is locked.");A[B]=!0,yield*A;}}}function v(e){if(e.aborted)throw new Q("The operation was aborted.","AbortError");}async function N(e,A,t){var o;if(u.brandCheck(e,t),v(e[g]),null!=(o=e[g].body)&&(o.stream.locked||r.isDisturbed(o.stream)))throw TypeError("Body is unusable");let n=l(),i=e=>n.reject(e),s=e=>{try{n.resolve(A(e));}catch(e){i(e);}};return null==e[g].body?s(new Uint8Array()):await c(e[g].body,s,i),n.promise;}function F(e){return 0===e.length?"":(239===e[0]&&187===e[1]&&191===e[2]&&(e=e.subarray(3)),x.decode(e));}function L(e){return JSON.parse(F(e));}t=oF("l16hu"),r=oF("jqWlt"),n=(o=oF("2Ib5S")).ReadableStreamFrom,i=o.isBlobLike,s=o.isReadableStreamLike,a=o.readableStreamClose,l=o.createDeferredPromise,c=o.fullyReadBody,E=oF("6moLW").FormData,g=oF("cZP2a").kState,u=oF("cACdG").webidl,Q=(h=oF("7M1Hs")).DOMException,C=h.structuredClone,I=os.Blob,d=os.File,B=oF("heqcE").kBodyUsed,f=(r=oF("jqWlt")).isErrored,y=(p=oF("jq6Nm")).isUint8Array,m=p.isArrayBuffer,w=oF("9qyC1").File,R=(b=oF("dyddI")).parseMIMEType,D=b.serializeAMimeType;let U=globalThis.ReadableStream,_=d??w,T=new TextEncoder(),x=new TextDecoder();e.exports={extractBody:S,safelyExtractBody:function(e,A=!1){return U||(U=oF("j5cOJ").ReadableStream),e instanceof U&&(oo(!r.isDisturbed(e),"The body has already been consumed."),oo(!e.locked,"The stream is locked.")),S(e,A);},cloneBody:function(e){let[A,t]=e.stream.tee(),[,r]=C(t,{transfer:[t]}).tee();return e.stream=A,{stream:r,length:e.length,source:e.source};},mixinBody:function(e){Object.assign(e.prototype,{blob(){return N(this,e=>{let A=function(e){let{headersList:A}=e[g],t=A.get("content-type");return null===t?"failure":R(t);}(this);return"failure"===A?A="":A&&(A=D(A)),new I([e],{type:A});},e);},arrayBuffer(){return N(this,e=>new Uint8Array(e).buffer,e);},text(){return N(this,F,e);},json(){return N(this,L,e);},async formData(){u.brandCheck(this,e),v(this[g]);let A=this.headers.get("Content-Type");if(/multipart\/form-data/.test(A)){let e;let A={};for(let[e,t]of this.headers)A[e.toLowerCase()]=t;let r=new E();try{e=new t({headers:A,preservePath:!0});}catch(e){throw new Q(""+e,"AbortError");}e.on("field",(e,A)=>{r.append(e,A);}),e.on("file",(e,A,t,o,n)=>{let i=[];if("base64"===o||"base64"===o.toLowerCase()){let o="";A.on("data",e=>{let A=(o+=e.toString().replace(/[\r\n]/gm,"")).length-o.length%4;i.push(Buffer.from(o.slice(0,A),"base64")),o=o.slice(A);}),A.on("end",()=>{i.push(Buffer.from(o,"base64")),r.append(e,new _(i,t,{type:n}));});}else A.on("data",e=>{i.push(e);}),A.on("end",()=>{r.append(e,new _(i,t,{type:n}));});});let o=new Promise((A,t)=>{e.on("finish",A),e.on("error",e=>t(TypeError(e)));});if(null!==this.body)for await(let A of k(this[g].body))e.write(A);return e.end(),await o,r;}if(/application\/x-www-form-urlencoded/.test(A)){let e;try{let A="",t=new TextDecoder("utf-8",{ignoreBOM:!0});for await(let e of k(this[g].body)){if(!y(e))throw TypeError("Expected Uint8Array chunk");A+=t.decode(e,{stream:!0});}A+=t.decode(),e=new URLSearchParams(A);}catch(e){
${t.count} ${t.noun} ${t.is} pending:
${e.format(A)}
`.trim());}};}),tC("ePqFr",function(e,A){var t=on.promisify,r=oF("5gSoc"),o=oF("9djUj").buildMockDispatch,n=oF("2L1yJ"),i=n.kDispatches,s=n.kMockAgent,a=n.kClose,l=n.kOriginalClose,c=n.kOrigin,E=n.kOriginalDispatch,g=n.kConnected,u=oF("2Xd7P").MockInterceptor,h=oF("heqcE"),Q=oF("eCuXV").InvalidArgumentError;class C extends r{constructor(e,A){if(super(e,A),!A||!A.agent||"function"!=typeof A.agent.dispatch)throw new Q("Argument opts.agent must implement Agent");this[s]=A.agent,this[c]=e,this[i]=[],this[g]=1,this[E]=this.dispatch,this[l]=this.close.bind(this),this.dispatch=o.call(this),this.close=this[a];}get[h.kConnected](){return this[g];}intercept(e){return new u(e,this[i]);}async[a](){await t(this[l])(),this[g]=0,this[s][h.kClients].delete(this[c]);}}e.exports=C;}),tC("6vw0D",function(e,A){let t={pronoun:"it",is:"is",was:"was",this:"this"},r={pronoun:"they",is:"are",was:"were",this:"these"};e.exports=class{constructor(e,A){this.singular=e,this.plural=A;}pluralize(e){let A=1===e,o=A?this.singular:this.plural;return{...(A?t:r),count:e,noun:o};}};}),tC("6hFpT",function(e,A){var t=oi.Transform,r=oQ.Console;e.exports=class{constructor({disableColors:e}={}){this.transform=new t({transform(e,A,t){t(null,e);}}),this.logger=new r({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}});}format(e){let A=e.map(({method:e,path:A,data:{statusCode:t},persist:r,times:o,timesInvoked:n,origin:i})=>({Method:e,Origin:i,Path:A,"Status code":t,Persistent:r?"✅":"❌",Invocations:n,Remaining:r?1/0:o-n}));return this.logger.table(A),this.transform.read().toString();}};}),tC("3z4gn",function(e,A){var t,r,o,n,i,s,a,l,c,E,g,u,h;function Q(e,A){return new l(e,A);}r=(t=oF("heqcE")).kProxy,o=t.kClose,n=t.kDestroy,i=t.kInterceptors,s=oC.URL,a=oF("iOr8X"),l=oF("5gSoc"),c=oF("8jk4s"),g=(E=oF("eCuXV")).InvalidArgumentError,u=E.RequestAbortedError,h=oF("8fhlK");let C=Symbol(),I=Symbol(),d=Symbol(),B=Symbol(),f=Symbol(),p=Symbol();e.exports=class extends c{constructor(e){if(super(e),this[r]=function(e){if("string"==typeof e&&(e={uri:e}),!e||!e.uri)throw new g("Proxy opts.uri is mandatory");return{uri:e.uri,protocol:e.protocol||"https"};}(e),this[C]=new a(e),this[i]=e.interceptors&&e.interceptors.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],"string"==typeof e&&(e={uri:e}),!e||!e.uri)throw new g("Proxy opts.uri is mandatory");let{clientFactory:A=Q}=e;if("function"!=typeof A)throw new g("Proxy opts.clientFactory must be a function.");this[B]=e.requestTls,this[f]=e.proxyTls,this[d]=e.headers||{};let t=new s(e.uri),{origin:o,port:n,host:l,username:c,password:E}=t;if(e.auth&&e.token)throw new g("opts.auth cannot be used in combination with opts.token");e.auth?this[d]["proxy-authorization"]="Basic "+e.auth:e.token?this[d]["proxy-authorization"]=e.token:c&&E&&(this[d]["proxy-authorization"]="Basic "+Buffer.from(`${decodeURIComponent(c)}:${decodeURIComponent(E)}`).toString("base64"));let y=h({...e.proxyTls});this[p]=h({...e.requestTls}),this[I]=A(t,{connect:y}),this[C]=new a({...e,connect:async(e,A)=>{let t=e.host;!e.port&&(t+=":"+("https:"===e.protocol?443:80));try{let r;let{socket:i,statusCode:s}=await this[I].connect({origin:o,port:n,path:t,signal:e.signal,headers:{...this[d],host:l}});if(200!==s&&(i.on("error",()=>{}).destroy(),A(new u(`Proxy response (${s}) !== 200 when HTTP Tunneling`))),"https:"!==e.protocol){A(null,i);return;}r=this[B]?this[B].servername:e.servername,this[p]({...e,servername:r,httpSocket:i},A);}catch(e){A(e);}}});}dispatch(e,A){let{host:t}=new s(e.origin),r=function(e){if(Array.isArray(e)){let A={};for(let t=0;t<e.length;t+=2)A[e[t]]=e[t+1];return A;}return e;}(e.headers);return function(e){if(e&&Object.keys(e).find(e=>"proxy-authorization"===e.toLowerCase()))throw new g("Proxy-Authorization should be sent in ProxyAgent constructor");}(r),this[C].dispatch({...e,headers:{...r,host:t}},A);}async[o](){await this[C].close(),await this[I].close();}async[n](){await this[C].destroy(),await this[I].destroy();}};}),tC("aOu0z",function(e,A){var t=oF("heqcE").kRetryHandlerDefaultRetry,r=oF("eCuXV").
${A}`,oX=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),o$=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),oz=(e,A,t)=>{let r=""===t?"":`with ${t.trim()}() `,o=oj.bind(null,r,A.toString());Object.defineProperty(o,"name",o$),Object.defineProperty(e,"toString",{...oX,value:o});},oZ=new WeakMap(),oK=(e,A={})=>{let t;if("function"!=typeof e)throw TypeError("Expected a function");let r=0,o=e.displayName||e.name||"<anonymous>",n=function(...i){if(oZ.set(n,++r),1===r)t=e.apply(this,i),e=null;else if(!0===A.throw)throw Error(`Function \`${o}\` can only be called once`);return t;};return!function(e,A,{ignoreNonConfigurable:t=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(A))oV(e,A,r,t);oW(e,A),oz(e,A,r);}(n,e),oZ.set(n,r),n;};oK.callCount=e=>{if(!oZ.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return oZ.get(e);},tL=oK;const o0=()=>Array.from({length:o4-o2+1},o1),o1=(e,A)=>({name:"SIGRT"+(A+1),number:o2+A,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),o2=34,o4=64,o9=[{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
${r.message}`:C,B=[d,A,e].filter(Boolean).join("\n");return I?(r.originalMessage=r.message,r.message=B):r=Error(B),r.shortMessage=d,r.command=i,r.escapedCommand=s,r.exitCode=n,r.signal=o,r.signalDescription=h,r.stdout=e,r.stderr=A,r.cwd=u,void 0!==t&&(r.all=t),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!a,r.isCanceled=c,r.killed=E&&!a,r;},nt=["stdin","stdout","stderr"],nr=e=>nt.some(A=>void 0!==e[A]),no=e=>{if(!e)return;let{stdio:A}=e;if(void 0===A)return nt.map(A=>e[A]);if(nr(e))throw Error("It's not possible to provide `stdio` in combination with one of "+nt.map(e=>`\`${e}\``).join(", "));if("string"==typeof A)return A;if(!Array.isArray(A))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof A}\``);return Array.from({length:Math.max(A.length,nt.length)},(e,t)=>A[t]);};tU={};const nn=function(e){return e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on;};if(nn(t_=ok.process)){var ni,ns=oF("1YMV0"),na=/^win/i.test(t_.platform),nl=or;"function"!=typeof nl&&(nl=nl.EventEmitter),t_.__signal_exit_emitter__?ni=t_.__signal_exit_emitter__:((ni=t_.__signal_exit_emitter__=new nl()).count=0,ni.emitted={}),ni.infinite||(ni.setMaxListeners(1/0),ni.infinite=!0);var nc=function(){nu&&nn(ok.process)&&(nu=!1,ns.forEach(function(e){try{t_.removeListener(e,ng[e]);}catch(e){}}),t_.emit=nI,t_.reallyExit=nQ,ni.count-=1);};(tU=function(e,A){if(!nn(ok.process))return function(){};oo.equal(typeof e,"function","a callback must be provided for exit handler"),!1===nu&&nh();var t="exit";return A&&A.alwaysLast&&(t="afterexit"),ni.on(t,e),function(){ni.removeListener(t,e),0===ni.listeners("exit").length&&0===ni.listeners("afterexit").length&&nc();};}).unload=nc;var nE=function(e,A,t){ni.emitted[e]||(ni.emitted[e]=!0,ni.emit(e,A,t));},ng={};ns.forEach(function(e){ng[e]=function(){nn(ok.process)&&t_.listeners(e).length===ni.count&&(nc(),nE("exit",null,e),nE("afterexit",null,e),na&&"SIGHUP"===e&&(e="SIGINT"),t_.kill(t_.pid,e));};}),tU.signals=function(){return ns;};var nu=!1,nh=function(){!nu&&nn(ok.process)&&(nu=!0,ni.count+=1,ns=ns.filter(function(e){try{return t_.on(e,ng[e]),!0;}catch(e){return!1;}}),t_.emit=nd,t_.reallyExit=nC);};tU.load=nh;var nQ=t_.reallyExit,nC=function(e){nn(ok.process)&&(t_.exitCode=e||0,nE("exit",t_.exitCode,null),nE("afterexit",t_.exitCode,null),nQ.call(t_,t_.exitCode));},nI=t_.emit,nd=function(e,A){if(!("exit"===e&&nn(ok.process)))return nI.apply(this,arguments);void 0!==A&&(t_.exitCode=A);var t=nI.apply(this,arguments);return nE("exit",t_.exitCode,null),nE("afterexit",t_.exitCode,null),t;};}else tU=function(){return function(){};};const nB=(e,A="SIGTERM",t={})=>{let r=e(A);return nf(e,A,t,r),r;},nf=(e,A,t,r)=>{if(!np(A,t,r))return;let o=setTimeout(()=>{e("SIGKILL");},nm(t));o.unref&&o.unref();},np=(e,{forceKillAfterTimeout:A},t)=>ny(e)&&!1!==A&&t,ny=e=>e===l(oD).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),nm=({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;},nw=(e,A)=>{e.kill()&&(A.isCanceled=!0);},nb=(e,A,t)=>{e.kill(A),t(Object.assign(Error("Timed out"),{timedOut:!0,signal:A}));},nR=(e,{timeout:A,killSignal:t="SIGTERM"},r)=>{let o;return 0===A||void 0===A?r:Promise.race([new Promise((r,n)=>{o=setTimeout(()=>{nb(e,t,n);},A);}),r.finally(()=>{clearTimeout(o);})]);},nD=({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})`);},nS=async(e,{cleanup:A,detached:t},r)=>{if(!A||t)return r;let o=l(tU)(()=>{e.kill();});return r.finally(()=>{o();});},nk=e=>e instanceof ow.ChildProcess&&"function"==typeof e.then,nv=(e,A,t)=>{if("string"==typeof t)return e[A].pipe((0,oB.createWriteStream)(t)),e;if(I(t))re
`);},n3=({env:e,extendEnv:A,preferLocal:t,localDir:r,execPath:o})=>{let n=A?{...l(ob).env,...e}:e;return t?oH({env:n,cwd:r,execPath:o}):n;},n5=(e,A,t={})=>{let r=l(tf)._parse(e,A,t);return e=r.command,A=r.args,(t={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(t=r.options).cwd||l(ob).cwd(),execPath:l(ob).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:n2,...t}).env=n3(t),t.stdio=no(t),"win32"===l(ob).platform&&"cmd"===l(om).basename(e,".exe")&&A.unshift("/q"),{file:e,args:A,options:t,parsed:r};},n6=(e,A,t)=>"string"==typeof A||(0,oy.Buffer).isBuffer(A)?e.stripFinalNewline?function(e){let A="string"==typeof e?"\n":"\n".charCodeAt(),t="string"==typeof e?"\r":"\r".charCodeAt();return e[e.length-1]===A&&(e=e.slice(0,-1)),e[e.length-1]===t&&(e=e.slice(0,-1)),e;}(A):A:void 0===t?void 0:"",n7=({input:e,inputFile:A,stdio:t})=>void 0===e&&void 0===A&&void 0===t?{stdin:"inherit"}:{},ie=(e={})=>({preferLocal:!0,...n7(e),...e});!function e(A){function t(r,...o){if(!Array.isArray(r))return e({...A,...r});let[n,...i]=n1(r,o);return B(n,i,ie(A));}return t.sync=(e,...t)=>{if(!Array.isArray(e))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[r,...o]=n1(e,t);return f(r,o,ie(A));},t;}(),tJ={},a(tH={},"isexe",()=>iA),a(tH,"sync",()=>it),tV=oF("4oHc1");const iA=async(e,A={})=>{let{ignoreErrors:t=!1}=A;try{return ir(await(0,tV.stat)(e),A);}catch(e){if(t||"EACCES"===e.code)return!1;throw e;}},it=(e,A={})=>{let{ignoreErrors:t=!1}=A;try{return ir((0,r5.statSync)(e),A);}catch(e){if(t||"EACCES"===e.code)return!1;throw e;}},ir=(e,A)=>e.isFile()&&io(e,A),io=(e,A)=>{let t=A.uid??process.getuid?.(),r=A.groups??process.getgroups?.()??[],o=A.gid??process.getgid?.()??r[0];if(void 0===t||void 0===o)throw Error("cannot get uid or gid");let n=new Set([o,...r]),i=e.mode,s=e.uid,a=e.gid,l=parseInt("100",8),c=parseInt("010",8);return!!(i&parseInt("001",8)||i&c&&n.has(a)||i&l&&s===t||i&(l|c)&&0===t);};a(tq={},"isexe",()=>ii),a(tq,"sync",()=>is),tV=oF("4oHc1");const ii=async(e,A={})=>{let{ignoreErrors:t=!1}=A;try{return il(await(0,tV.stat)(e),e,A);}catch(e){if(t||"EACCES"===e.code)return!1;throw e;}},is=(e,A={})=>{let{ignoreErrors:t=!1}=A;try{return il((0,r5.statSync)(e),e,A);}catch(e){if(t||"EACCES"===e.code)return!1;throw e;}},ia=(e,A)=>{let{pathExt:t=process.env.PATHEXT||""}=A,r=t.split(";");if(-1!==r.indexOf(""))return!0;for(let A=0;A<r.length;A++){let t=r[A].toLowerCase(),o=e.substring(e.length-t.length).toLowerCase();if(t&&o===t)return!0;}return!1;},il=(e,A,t)=>e.isFile()&&ia(A,t),ic="win32"===(process.env._ISEXE_TEST_PLATFORM_||process.platform)?tq:tH,iE=ic.isexe,ig=ic.sync;tW=r3.join,tj=r3.delimiter,tX=r3.sep,t$=r3.posix;const iu="win32"===process.platform,ih=new RegExp(`[${t$.sep}${tX===t$.sep?"":tX}]`.replace(/(\\)/g,"\\$1")),iQ=RegExp("^\\."+ih.source),iC=e=>Object.assign(Error("not found: "+e),{code:"ENOENT"}),iI=(e,{path:A=process.env.PATH,pathExt:t=process.env.PATHEXT,delimiter:r=tj})=>{let o=e.match(ih)?[""]:[...(iu?[process.cwd()]:[]),...(A||"").split(r)];if(iu){let A=t||[".EXE",".CMD",".BAT",".COM"].join(r),n=A.split(r).flatMap(e=>[e,e.toLowerCase()]);return e.includes(".")&&""!==n[0]&&n.unshift(""),{pathEnv:o,pathExt:n,pathExtExe:A};}return{pathEnv:o,pathExt:[""]};},id=(e,A)=>{let t=/^".*"$/.test(e)?e.slice(1,-1):e;return(!t&&iQ.test(A)?A.slice(0,2):"")+tW(t,A);},iB=async(e,A={})=>{let{pathEnv:t,pathExt:r,pathExtExe:o}=iI(e,A),n=[];for(let i of t){let t=id(i,e);for(let e of r){let r=t+e;if(await iE(r,{pathExt:o,ignoreErrors:!0})){if(!A.all)return r;n.push(r);}}}if(A.all&&n.length)return n;if(A.nothrow)return null;throw iC(e);};tJ=iB,iB.sync=(e,A={})=>{let{pathEnv:t,pathExt:r,pathExtExe:o}=iI(e,A),n=[];for(let i of t){let t=id(i,e);for(let e of r){let r=t+e;if(ig(r,{pathExt:o,ignoreErrors:!0})){if(!A.all)return r;n.push(r);}}}if(A.all&&n.length)return n;if(A.nothrow)return null;throw iC(e);};const ip={stdio:"inherit",shell:!0};td=oF("ER74K"),tz={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheH
//# sourceMappingURL=setup-cpp.js.map