"string"==typeofe?!!n[e]:"env"ine?n[e.env]&&n[e.env].includes(e.includes):"any"ine?e.any.some(function(e){return!!n[e];}):Object.keys(e).every(function(t){returnn[t]===e[t];}));}// Used for testing only
e.exports.isPR=!!n[t.pr];break;case"object":"env"int.pr?e.exports.isPR=t.pr.envinn&&n[t.pr.env]!==t.pr.ne:"any"int.pr?e.exports.isPR=t.pr.any.some(function(e){return!!n[e];}):e.exports.isPR=i(t.pr);break;default:// PR detection not supported for this vendor
e.exports.isPR=null;}}),e.exports.isCI=!!("false"!==n.CI&&(// Bypass all checks if CI env is explicitly set to 'false'
*/function a(e,t,r){let n=new l(e,t,r);process.stdout.write(n.toString()+o.EOL);}e.exports.issueCommand=a,e.exports.issue=function(e,t=""){a(e,{},t);};class l{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r;}toString(){var e;let t="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let e=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let n=this.properties[r];n&&(e?e=!1:t+=",",t+=`${r}=${s.toCommandValue(n).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return t+`::${(e=this.message,s.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A"))}`;}}}),q.register("6L1x9",function(e,t){// We use any as a valid input type
varr=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){returnt[r];}});}:function(e,t,r,n){void0===n&&(n=r),e[n]=t[r];}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(variine)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);returnn(t,e),t;};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.prepareKeyValueMessage=e.exports.issueFileCommand=void0;// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */leto=i(m),s=i(f);vara=q("4dndm"),l=q("6L1x9");e.exports.issueFileCommand=function(e,t){letr=process.env[`GITHUB_${e}`];if(!r)throwError(`Unable to find environment variable for file command ${e}`);if(!o.existsSync(r))throwError(`Missing file at path: ${r}`);o.appendFileSync(r,`${l.toCommandValue(t)}${s.EOL}`,{encoding:"utf8"});},e.exports.prepareKeyValueMessage=function(e,t){letr=`ghadelimiter_${a.default()}`,n=l.toCommandValue(t);// These should realistically never happen, but just in case someone finds a
// way to exploit uuid generation let's not allow keys or values that contain
// the delimiter.
if(e.includes(r))throwError(`Unexpected input: name should not contain the delimiter "${r}"`);if(n.includes(r))throwError(`Unexpected input: value should not contain the delimiter "${r}"`);return`${e}<<${r}${s.EOL}${n}${s.EOL}${r}`;};}),q.register("4dndm",function(e,t){F(e.exports,"default",()=>i);varr=q("5SVBN"),n=q("38Etc"),i=function(e,t,i){e=e||{};leto=e.random||(e.rng||(0,r.default))();// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){i=i||0;for(lete=0;e<16;++e)t[i+e]=o[e];returnt;}return(0,n.default)(o);};}),q.register("5SVBN",function(e,t){F(e.exports,"default",()=>i);letr=newUint8Array(256),n=r.length;// # of random values to pre-allocate
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
leti=(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+"-"+n[e[t+4]]+n[e[t+5]]+"-"+n[e[t+6]]+n[e[t+7]]+"-"+n[e[t+8]]+n[e[t+9]]+"-"+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase();// Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if(!(0,r.default)(i))throwTypeError("Stringified UUID is invalid");returni;};}),q.register("f9HAa",function(e,t){F(e.exports,"default",()=>n);varr=q("bpRYF"),n=function(e){return"string"==typeofe&&(0,r.default).test(e);};}),q.register("bpRYF",function(e,t){F(e.exports,"default",()=>r);varr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;}),q.register("5n2X4",function(e,t){varr=e.exports&&e.exports.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(i,o){functions(e){try{l(n.next(e));}catch(e){o(e);}}functiona(e){try{l(n.throw(e));}catch(e){o(e);}}functionl(e){vart;e.done?i(e.value):((t=e.value)instanceofr?t:newr(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.OidcClient=void0;varn=q("iC7fc"),i=q("gaCjs"),o=q("lcRzN");classs{staticcreateHttpClient(e=!0,t=10){returnnewn.HttpClient("actions/oidc-client",[newi.BearerCredentialHandler(s.getRequestToken())],{allowRetries:e,maxRetries:t});}staticgetRequestToken(){lete=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!e)throwError("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");returne;}staticgetIDTokenUrl(){lete=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!e)throwError("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");returne;}staticgetCall(e){vart;returnr(this,void0,void0,function*(){letr=s.createHttpClient(),n=yieldr.getJson(e).catch(e=>{throwError(`Failed to get ID Token.
ErrorMessage:${e.result.message}`);}),i=null===(t=n.result)||void 0===t?void 0:t.value;if(!i)throw Error("Response json body do not have ID Token field");return i;});}static getIDToken(e){return r(this,void 0,void 0,function*(){try{// New ID Token is requested from action service
lett=s.getIDTokenUrl();if(e){letr=encodeURIComponent(e);t=`${t}&audience=${r}`;}o.debug(`ID token url is ${t}`);letr=yields.getCall(t);returno.setSecret(r),r;}catch(e){throwError(`Error message: ${e.message}`);}});}}e.exports.OidcClient=s;}),q.register("iC7fc",function(e,t){/* eslint-disable @typescript-eslint/no-explicit-any */varr,n,i,o,s,a=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){returnt[r];}});}:function(e,t,r,n){void0===n&&(n=r),e[n]=t[r];}),l=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),c=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varrine)"default"!==r&&Object.hasOwnProperty.call(e,r)&&a(t,e,r);returnl(t,e),t;},u=e.exports&&e.exports.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(i,o){functions(e){try{l(n.next(e));}catch(e){o(e);}}functiona(e){try{l(n.throw(e));}catch(e){o(e);}}functionl(e){vart;e.done?i(e.value):((t=e.value)instanceofr?t:newr(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).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=void0;letd=c(v),p=c(y),f=c(q("9ws9E")),h=c(q("eYDoL"));(r=i=e.exports.HttpCodes||(e.exports.HttpCodes={}))[r.OK=200]="OK",r[r.MultipleChoices=300]="MultipleChoices",r[r.MovedPermanently=301]="MovedPermanently",r[r.ResourceMoved=302]="ResourceMoved",r[r.SeeOther=303]="SeeOther",r[r.NotModified=304]="NotModified",r[r.UseProxy=305]="UseProxy",r[r.SwitchProxy=306]="SwitchProxy",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",r[r.BadRequest=400]="BadRequest",r[r.Unauthorized=401]="Unauthorized",r[r.PaymentRequired=402]="PaymentRequired",r[r.Forbidden=403]="Forbidden",r[r.NotFound=404]="NotFound",r[r.MethodNotAllowed=405]="MethodNotAllowed",r[r.NotAcceptable=406]="NotAcceptable",r[r.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",r[r.RequestTimeout=408]="RequestTimeout",r[r.Conflict=409]="Conflict",r[r.Gone=410]="Gone",r[r.TooManyRequests=429]="TooManyRequests",r[r.InternalServerError=500]="InternalServerError",r[r.NotImplemented=501]="NotImplemented",r[r.BadGateway=502]="BadGateway",r[r.ServiceUnavailable=503]="ServiceUnavailable",r[r.GatewayTimeout=504]="GatewayTimeout",(n=o=e.exports.Headers||(e.exports.Headers={})).Accept="accept",n.ContentType="content-type",(s=e.exports.MediaTypes||(e.exports.MediaTypes={})).ApplicationJson="application/json",e.exports.getProxyUrl=/**
*/request(e,t,r,n){return u(this,void 0,void 0,function*(){let o;if(this._disposed)throw Error("Client has already been disposed.");let s=new URL(t),a=this._prepareRequest(e,s,n),l=this._allowRetries&&w.includes(e)?this._maxRetries+1:1,c=0;do{//Checkifit'sanauthenticationchallenge
if((o=yieldthis.requestRaw(a,r))&&o.message&&o.message.statusCode===i.Unauthorized){lete;for(lettofthis.handlers)if(t.canHandleAuthentication(o)){e=t;break;}if(e)returne.handleAuthentication(this,a,r);break;}lett=this._maxRedirects;for(;o.message.statusCode&&m.includes(o.message.statusCode)&&this._allowRedirects&&t>0;){leti=o.message.headers.location;if(!i)break;letl=newURL(i);if("https:"===s.protocol&&s.protocol!==l.protocol&&!this._allowRedirectDowngrade)throwError("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");// strip authorization header if redirected to a different hostname
if(// we need to finish reading the response before reassigning response
// which will leak the open socket.
yieldo.readBody(),l.hostname!==s.hostname)for(leteinn)"authorization"===e.toLowerCase()&&deleten[e];// let's make the request with the new redirectUrl
if(n.httpModule=i?p:d,n.options={},n.options.host=n.parsedUrl.hostname,n.options.port=n.parsedUrl.port?parseInt(n.parsedUrl.port):i?443:80,n.options.path=(n.parsedUrl.pathname||"")+(n.parsedUrl.search||""),n.options.method=e,n.options.headers=this._mergeHeaders(r),null!=this.userAgent&&(n.options.headers["user-agent"]=this.userAgent),n.options.agent=this._getAgent(n.parsedUrl),this.handlers)for(leteofthis.handlers)e.prepareRequest(n.options);returnn;}_mergeHeaders(e){returnthis.requestOptions&&this.requestOptions.headers?Object.assign({},b(this.requestOptions.headers),b(e||{})):b(e||{});}_getExistingOrDefaultHeader(e,t,r){letn;returnthis.requestOptions&&this.requestOptions.headers&&(n=b(this.requestOptions.headers)[t]),e[t]||n||r;}_getAgent(e){lett;letr=f.getProxyUrl(e),n=r&&r.hostname;// if agent is already assigned use that agent.
if(this._keepAlive&&n&&(t=this._proxyAgent),this._keepAlive&&!n&&(t=this._agent),t)returnt;leti="https:"===e.protocol,o=100;// This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
if(this.requestOptions&&(o=this.requestOptions.maxSockets||d.globalAgent.maxSockets),r&&r.hostname){lete={maxSockets:o,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(r.username||r.password)&&{proxyAuth:`${r.username}:${r.password}`}),{host:r.hostname,port:r.port})},n="https:"===r.protocol;t=(i?n?h.httpsOverHttps:h.httpsOverHttp:n?h.httpOverHttps:h.httpOverHttp)(e),this._proxyAgent=t;}// if reusing agent across request and tunneling agent isn't assigned create a new agent
if(this._keepAlive&&!t){lete={keepAlive:this._keepAlive,maxSockets:o};t=i?newp.Agent(e):newd.Agent(e),this._agent=t;}returnt||(t=i?p.globalAgent:d.globalAgent),i&&this._ignoreSslError&&(// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
// we have to cast it to any and change it directly
t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),t;}_performExponentialBackoff(e){returnu(this,void0,void0,function*(){e=Math.min(10,e);lett=5*Math.pow(2,e);returnnewPromise(e=>setTimeout(()=>e(),t));});}_processResponse(e,t){returnu(this,void0,void0,function*(){returnnewPromise((r,n)=>u(this,void0,void0,function*(){leto,s;leta=e.message.statusCode||0,l={statusCode:a,result:null,headers:{}};a===i.NotFound&&r(l);try{(s=yielde.readBody())&&s.length>0&&(o=t&&t.deserializeDates?JSON.parse(s,// get the result from the body
function(e,t){if("string"==typeoft){lete=newDate(t);if(!isNaN(e.valueOf()))returne;}returnt;}):JSON.parse(s),l.result=o),l.headers=e.message.headers;}catch(e){// Invalid resource (contents not json); leaving result obj null
}// note that 3xx redirects are handled by the http layer.
if(a>299){lete;e=o&&o.message?o.message:s&&s.length>0?s:`Failed request: (${a})`;lett=newx(e,a);t.result=l.result,n(t);}elser(l);}));});}};letb=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});}),q.register("9ws9E",function(e,t){functionr(e){lett;if(!e.hostname)return!1;letr=e.hostname;if(function(e){lett=e.toLowerCase();return"localhost"===t||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]");}(r))return!0;letn=process.env.no_proxy||process.env.NO_PROXY||"";if(!n)return!1;e.port?t=Number(e.port):"http:"===e.protocol?t=80:"https:"===e.protocol&&(t=443);// Format the request hostname and hostname with port
leti=[e.hostname.toUpperCase()];// Compare request host against noproxy
for(leteof("number"==typeoft&&i.push(`${i[0]}:${t}`),n.split(",").map(e=>e.trim().toUpperCase()).filter(e=>e)))if("*"===e||i.some(t=>t===e||t.endsWith(`.${e}`)||e.startsWith(".")&&t.endsWith(`${e}`)))return!0;return!1;}Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.checkBypass=e.exports.getProxyUrl=void0,e.exports.getProxyUrl=function(e){lett="https:"===e.protocol;if(r(e))return;letn=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(n)try{returnnewURL(n);}catch(e){if(!n.startsWith("http://")&&!n.startsWith("https://"))returnnewURL(`http://${n}`);}},e.exports.checkBypass=r;}),q.register("eYDoL",function(e,t){e.exports=q("gBbBa");}),q.register("gBbBa",function(e,t){varr,n,i,o,s,a;functionl(e){vart=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||v.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",function(e,r,n,i){for(varo=u(r,n,i),s=0,a=t.requests.length;s<a;++s){varl=t.requests[s];if(l.host===o.host&&l.port===o.port){// Detect the request to connect same origin server,
// reuse the connection.
t.requests.splice(s,1),l.request.onSocket(e);return;}}e.destroy(),t.removeSocket(e);});}functionc(e,t){varr=this;l.prototype.createSocket.call(r,e,function(n){vari=e.request.getHeader("host"),o=d({},r.options,{socket:n,servername:i?i.replace(/:.*$/,""):e.host}),s=w.connect(0,o);r.sockets[r.sockets.indexOf(n)]=s,t(s);});}functionu(e,t,r){return"string"==typeofe?{host:e,port:t,localAddress:r}:e;}functiond(e){for(vart=1,r=arguments.length;t<r;++t){varn=arguments[t];if("object"==typeofn)for(vari=Object.keys(n),o=0,s=i.length;o<s;++o){vara=i[o];void0!==n[a]&&(e[a]=n[a]);}}returne;}F(e.exports,"httpOverHttp",()=>r,e=>r=e),F(e.exports,"httpsOverHttp",()=>n,e=>n=e),F(e.exports,"httpOverHttps",()=>i,e=>i=e),F(e.exports,"httpsOverHttps",()=>o,e=>o=e),F(e.exports,"debug",()=>s,e=>s=e),r=function(e){vart=newl(e);returnt.request=v.request,t;},n=function(e){vart=newl(e);returnt.request=v.request,t.createSocket=c,t.defaultPort=443,t;},i=function(e){vart=newl(e);returnt.request=y.request,t;},o=function(e){vart=newl(e);returnt.request=y.request,t.createSocket=c,t.defaultPort=443,t;},b.inherits(l,x.EventEmitter),l.prototype.addRequest=function(e,t,r,n){vari=this,o=d({request:e},i.options,u(t,r,n));if(i.sockets.length>=this.maxSockets){// We are over limit so we'll add it to the queue.
i.requests.push(o);return;}// If we are under maxSockets create a new one.
i.createSocket(o,function(t){functionr(){i.emit("free",t,o);}functionn(e){i.removeSocket(t),t.removeListener("free",r),t.removeListener("close",n),t.removeListener("agentRemove",n);}t.on("free",r),t.on("close",n),t.on("agentRemove",n),e.onSocket(t);});},l.prototype.createSocket=function(e,t){varr=this,n={};r.sockets.push(n);vari=d({},r.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+newBuffer(i.proxyAuth).toString("base64")),a("making CONNECT request");varo=r.request(i);functions(i,s,l){if(o.removeAllListeners(),s.removeAllListeners(),200!==i.statusCode){a("tunneling socket could not be established, statusCode=%d",i.statusCode),s.destroy();varc=Error("tunneling socket could not be established, statusCode="+i.statusCode);c.code="ECONNRESET",e.request.emit("error",c),r.removeSocket(n);return;}if(l.length>0){a("got illegal response body from proxy"),s.destroy();varc=Error("got illegal response body from proxy");c.code="ECONNRESET",e.request.emit("error",c),r.removeSocket(n);return;}returna("tunneling connection has established"),r.sockets[r.sockets.indexOf(n)]=s,t(s);}o.useChunkedEncodingByDefault=!1,o.once("response",function(e){// Very hacky. This is necessary to avoid http-parser leaks.
process.nextTick(function(){s(e,t,r);});}),o.once("connect",s),o.once("error",function(t){o.removeAllListeners(),a("tunneling socket could not be established, cause=%s\n",t.message,t.stack);vari=Error("tunneling socket could not be established, cause="+t.message);i.code="ECONNRESET",e.request.emit("error",i),r.removeSocket(n);}),o.end();},l.prototype.removeSocket=function(e){vart=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);varr=this.requests.shift();r&&// needs to be created to take over in the pool for the one that closed.
this.createSocket(r,function(e){r.request.onSocket(e);});}},s=a=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){vare=Array.prototype.slice.call(arguments);"string"==typeofe[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e);}:function(){};}),q.register("gaCjs",function(e,t){varr=e.exports&&e.exports.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(i,o){functions(e){try{l(n.next(e));}catch(e){o(e);}}functiona(e){try{l(n.throw(e));}catch(e){o(e);}}functionl(e){vart;e.done?i(e.value):((t=e.value)instanceofr?t:newr(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.PersonalAccessTokenCredentialHandler=e.exports.BearerCredentialHandler=e.exports.BasicCredentialHandler=void0,e.exports.BasicCredentialHandler=class{constructor(e,t){this.username=e,this.password=t;}prepareRequest(e){if(!e.headers)throwError("The request has no headers");e.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`;}// This handler cannot handle 401
canHandleAuthentication(){return!1;}handleAuthentication(){returnr(this,void0,void0,function*(){throwError("not implemented");});}},e.exports.BearerCredentialHandler=class{constructor(e){this.token=e;}// currently implements pre-authorization
// TODO: support preAuth = false where it hooks on 401
prepareRequest(e){if(!e.headers)throwError("The request has no headers");e.headers.Authorization=`Bearer ${this.token}`;}// This handler cannot handle 401
canHandleAuthentication(){return!1;}handleAuthentication(){returnr(this,void0,void0,function*(){throwError("not implemented");});}},e.exports.PersonalAccessTokenCredentialHandler=class{constructor(e){this.token=e;}// currently implements pre-authorization
// TODO: support preAuth = false where it hooks on 401
prepareRequest(e){if(!e.headers)throwError("The request has no headers");e.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`;}// This handler cannot handle 401
*/function i(e,r,n){if(o(e),"object"!=typeof n)throw Error("List of variants should be specified as an object");var i=t[e](r);return void 0!==n[i]?n[i]:null;}/**
n.unshift(e.unitType),t=n;leti=null;if(// Making sure only unique items are present.
(n=Array.from(newSet(t))).some(function(e){if(void0!==r[e])// Breaking the loop.
returni=r[e],!0;}),null===i)throwError("Can not find any unit type data for locale: "+e.locale);returni;}(n),o=r.pluralize(n.locale,t,i[e]);returno.replace("{0}",t);}(t,n,o)),c.length>=o.span)break;}// Returning the string value
returnc.join(o.delimiter);}(t,o,// Allowing to override config with each individual call
l=Object.assign({},e,l||{})));}});},addLocale:a,defaultConfig:o};}),q.register("ggaxg",function(e,t){e.exports=q("fXZh0");}),q.register("crMMK",function(e,t){e.exports=!!("undefined"!=typeofprocess&&process.versions&&process.versions.node);}),q.register("a3PNV",function(e,t){functionr(e,t,r){return!!(e.isSymbolicLink()||e.isFile())&&function(e,t){varr=void0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!r||-1!==(r=r.split(";")).indexOf(""))return!0;for(varn=0;n<r.length;n++){vari=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0;}return!1;}(t,r);}functionn(e,t,n){m.stat(e,function(i,o){n(i,!i&&r(o,e,t));});}e.exports=n,n.sync=function(e,t){returnr(m.statSync(e),e,t);};}),q.register("7gw6J",function(e,t){functionr(e,t,r){m.stat(e,function(e,i){r(e,!e&&n(i,t));});}functionn(e,t){varr,n,i,o,s,a,l;returne.isFile()&&(r=e.mode,n=e.uid,i=e.gid,o=void0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),r&parseInt("001",8)||r&l&&i===s||r&a&&n===o||r&(a|l)&&0===o);}e.exports=r,r.sync=function(e,t){returnn(m.statSync(e),t);};}),q.register("1YMV0",function(e,t){// This is not the set of all possible signals.
//
// It IS, however, the set of all signals that trigger
// an exit on either Linux or BSD systems. Linux is a
// superset of the signal names supported on BSD, and
// the unknown signals just fail to register, so we can
// catch that easily enough.
//
// Don't bother with SIGKILL. It's uncatchable, which
// means that we can't fire any callbacks anyway.
//
// If a user does happen to register a handler on a non-
// fatal signal like SIGWINCH or something, and then
// exit, it'll end up firing `process.emit('exit')`, so
// the handler will be fired anyway.
//
// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
// artificially, inherently leave the process in a
// state from which it is not safe to try and enter JS
// listeners.
e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");}),q.register("lJEXJ",function(e,t){// just pre-load all the stuff that index.js lazily exports
varr=q("fB52W"),n=q("juUXZ"),i=q("kxoMX"),o=q("eT4Gq"),s=q("6moLM"),a=q("eJTZB"),l=q("e3PGr"),c=q("dqKDW"),u=q("gPIs5"),d=q("bX9Em"),p=q("iAJEE"),f=q("fHTYs"),h=q("8PQ4n"),m=q("3Z6CK"),g=q("6WviK"),v=q("8cCiP"),y=q("2JTVo"),w=q("bizdR"),x=q("2lHfL"),E=q("9XGBY"),b=q("2zuiw"),S=q("bDcXu"),$=q("lvpAe"),_=q("1um22"),O=q("1ndHP"),C=q("7Dt1t"),I=q("9hSY8"),T=q("ge7Lx"),R=q("gBfHp"),P=q("gxgIF"),A=q("eRxC5"),N=q("aWpPt"),L=q("gGB3p"),k=q("hnV3l"),D=q("3sVLb"),U=q("iqmnd"),j=q("bl7vX"),M=q("1K9I5"),F=q("2qx0f"),B=q("k8BEA"),G=q("4B26j");e.exports={parse:s,valid:a,clean:l,inc:c,diff:u,major:d,minor:p,patch:f,prerelease:h,compare:m,rcompare:g,compareLoose:v,compareBuild:y,sort:w,rsort:x,gt:E,lt:b,eq:S,neq:$,gte:_,lte:O,cmp:C,coerce:I,Comparator:T,Range:R,satisfies:P,toComparators:A,maxSatisfying:N,minSatisfying:L,minVersion:k,validRange:D,outside:U,gtr:j,ltr:M,intersects:F,simplifyRange:B,subset:G,SemVer:i,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers};}),q.register("fB52W",function(e,t){varr=q("juUXZ"),n=r.MAX_SAFE_COMPONENT_LENGTH,i=r.MAX_SAFE_BUILD_LENGTH,o=r.MAX_LENGTH,s=q("3Zcn3");t=e.exports={};// The actual regexps go on exports.re
leta=t.re=[],l=t.safeRe=[],c=t.src=[],u=t.t={},d=0,p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[p,i]],h=e=>{for(let[t,r]off)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);returne;},m=(e,t,r)=>{letn=h(t),i=d++;s(e,i,t),u[e]=i,c[i]=t,a[i]=newRegExp(t,r?"g":void0),l[i]=newRegExp(n,r?"g":void0);};// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.
// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.
m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),// ## Main Version
// Three dot-separated numeric identifiers.
m("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
m("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// Any combination of digits, letters, or hyphens.
m("BUILDIDENTIFIER",`${p}+`),// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.
m("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.
// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups. The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.
m("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),m("FULL",`^${c[u.FULLPLAIN]}$`),// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
m("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),m("LOOSE",`^${c[u.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Meaning is "at least and backwards compatible with"
m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),// A simple gt/lt/eq thing, or just "" to indicate "any version"
m("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
m("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
m("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),// Star ranges basically just allow anything at all.
m("STAR","(<|>)?=?\\s*\\*"),// >=0.0.0 is like a star
m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$");}),q.register("juUXZ",function(e,t){letr=Number.MAX_SAFE_INTEGER||/* istanbul ignore next */9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};}),q.register("3Zcn3",function(e,t){letr="object"==typeofprocess&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r;}),q.register("kxoMX",function(e,t){varr=q("3Zcn3"),n=q("juUXZ"),i=n.MAX_LENGTH,o=n.MAX_SAFE_INTEGER,s=q("fB52W"),a=s.safeRe,l=s.t,c=q("ifDVe"),u=q("eT4Gq").compareIdentifiers;classd{constructor(e,t){if(t=c(t),einstanceofd){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)returne;e=e.version;}elseif("string"!=typeofe)throwTypeError(`Invalid version. Must be a string. Got type "${typeofe}".`);if(e.length>i)throwTypeError(`version is longer than ${i} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,// this isn't actually relevant for versions, but keep it so that we
// don't run into trouble passing this.options around.
this.includePrerelease=!!t.includePrerelease;letn=e.trim().match(t.loose?a[l.LOOSE]:a[l.FULL]);if(!n)throwTypeError(`Invalid Version: ${e}`);if(this.raw=e,// these are actually numbers
this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throwTypeError("Invalid major version");if(this.minor>o||this.minor<0)throwTypeError("Invalid minor version");if(this.patch>o||this.patch<0)throwTypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){lett=+e;if(t>=0&&t<o)returnt;}returne;}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format();}format(){returnthis.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version;}toString(){returnthis.version;}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(einstanceofd)){if("string"==typeofe&&e===this.version)return0;e=newd(e,this.options);}returne.version===this.version?0:this.compareMain(e)||this.comparePre(e);}compareMain(e){returneinstanceofd||(e=newd(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch);}comparePre(e){// NOT having a prerelease is > having one
if(einstanceofd||(e=newd(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return1;if(!this.prerelease.length&&!e.prerelease.length)return0;lett=0;do{letn=this.prerelease[t],i=e.prerelease[t];if(r("prerelease compare",t,n,i),void0===n&&void0===i)return0;if(void0===i)return1;if(void0===n)return-1;if(n===i)continue;elsereturnu(n,i);}while(++t);}compareBuild(e){einstanceofd||(e=newd(e,this.options));lett=0;do{letn=this.build[t],i=e.build[t];if(r("prerelease compare",t,n,i),void0===n&&void0===i)return0;if(void0===i)return1;if(void0===n)return-1;if(n===i)continue;elsereturnu(n,i);}while(++t);}// preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way.
inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":// If this is already a prerelease, it will bump to the next version
// drop any prereleases that might already exist, since they are not
// relevant at this point.
this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;// If the input is a non-prerelease version, this acts the same as
// prepatch.
case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;// This probably shouldn't be used publicly.
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
case"pre":{lete=Number(r)?1:0;if(!t&&!1===r)throwError("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{letn=this.prerelease.length;for(;--n>=0;)"number"==typeofthis.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){// didn't increment anything
if(t===this.prerelease.join(".")&&!1===r)throwError("invalid increment argument: identifier already exists");this.prerelease.push(e);}}if(t){// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
letn=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n;}break;}default:throwError(`invalid increment argument: ${e}`);}returnthis.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this;}}e.exports=d;}),q.register("ifDVe",function(e,t){// parse out just the options we care about
letr=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeofe?r:e:n;}),q.register("eT4Gq",function(e,t){letr=/^[0-9]+$/,n=(e,t)=>{letn=r.test(e),i=r.test(t);returnn&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1;};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)};}),q.register("6moLM",function(e,t){varr=q("kxoMX");e.exports=(e,t,n=!1)=>{if(einstanceofr)returne;try{returnnewr(e,t);}catch(e){if(!n)returnnull;throwe;}};}),q.register("eJTZB",function(e,t){varr=q("6moLM");e.exports=(e,t)=>{letn=r(e,t);returnn?n.version:null;};}),q.register("e3PGr",function(e,t){varr=q("6moLM");e.exports=(e,t)=>{letn=r(e.trim().replace(/^[=v]+/,""),t);returnn?n.version:null;};}),q.register("dqKDW",function(e,t){varr=q("kxoMX");e.exports=(e,t,n,i,o)=>{"string"==typeofn&&(o=i,i=n,n=void0);try{returnnewr(einstanceofr?e.version:e,n).inc(t,i,o).version;}catch(e){returnnull;}};}),q.register("gPIs5",function(e,t){varr=q("6moLM");e.exports=(e,t)=>{letn=r(e,null,!0),i=r(t,null,!0),o=n.compare(i);if(0===o)returnnull;lets=o>0,a=s?n:i,l=s?i:n,c=!!a.prerelease.length,u=!!l.prerelease.length;if(u&&!c)return(// Going from prerelease -> no prerelease requires some special casing
// If the low version has only a major, then it will always be a major
// Some examples:
// 1.0.0-1 -> 1.0.0
// 1.0.0-1 -> 1.1.1
// 1.0.0-1 -> 2.0.0
l.patch||l.minor?a.patch?"patch":a.minor?"minor":"major":"major");// add the `pre` prefix if we are going to a prerelease version
letd=c?"pre":"";returnn.major!==i.major?d+"major":n.minor!==i.minor?d+"minor":n.patch!==i.patch?d+"patch":"prerelease";};}),q.register("bX9Em",function(e,t){varr=q("kxoMX");e.exports=(e,t)=>newr(e,t).major;}),q.register("iAJEE",function(e,t){varr=q("kxoMX");e.exports=(e,t)=>newr(e,t).minor;}),q.register("fHTYs",function(e,t){varr=q("kxoMX");e.exports=(e,t)=>newr(e,t).patch;}),q.register("8PQ4n",function(e,t){varr=q("6moLM");e.exports=(e,t)=>{letn=r(e,t);returnn&&n.prerelease.length?n.prerelease:null;};}),q.register("3Z6CK",function(e,t){varr=q("kxoMX");e.exports=(e,t,n)=>newr(e,n).compare(newr(t,n));}),q.register("6WviK",function(e,t){varr=q("3Z6CK");e.exports=(e,t,n)=>r(t,e,n);}),q.register("8cCiP",function(e,t){varr=q("3Z6CK");e.exports=(e,t)=>r(e,t,!0);}),q.register("2JTVo",function(e,t){varr=q("kxoMX");e.exports=(e,t,n)=>{leti=newr(e,n),o=newr(t,n);returni.compare(o)||i.compareBuild(o);};}),q.register("bizdR",function(e,t){varr=q("2JTVo");e.exports=(e,t)=>e.sort((e,n)=>r(e,n,t));}),q.register("2lHfL",function(e,t){varr=q("2JTVo");e.exports=(e,t)=>e.sort((e,n)=>r(n,e,t));}),q.register("9XGBY",function(e,t){varr=q("3Z6CK");e.exports=(e,t,n)=>r(e,t,n)>0;}),q.register("2zuiw",function(e,t){varr=q("3Z6CK");e.exports=(e,t,n)=>0>r(e,t,n);}),q.register("bDcXu",function(e,t){varr=q("3Z6CK");e.exports=(e,t,n)=>0===r(e,t,n);}),q.register("lvpAe",function(e,t){varr=q("3Z6CK");e.exports=(e,t,n)=>0!==r(e,t,n);}),q.register("1um22",function(e,t){varr=q("3Z6CK");e.exports=(e,t,n)=>r(e,t,n)>=0;}),q.register("1ndHP",function(e,t){varr=q("3Z6CK");e.exports=(e,t,n)=>0>=r(e,t,n);}),q.register("7Dt1t",function(e,t){varr=q("bDcXu"),n=q("lvpAe"),i=q("9XGBY"),o=q("1um22"),s=q("2zuiw"),a=q("1ndHP");e.exports=(e,t,l,c)=>{switch(t){case"===":return"object"==typeofe&&(e=e.version),"object"==typeofl&&(l=l.version),e===l;case"!==":return"object"==typeofe&&(e=e.version),"object"==typeofl&&(l=l.version),e!==l;case"":case"=":case"==":returnr(e,l,c);case"!=":returnn(e,l,c);case">":returni(e,l,c);case">=":returno(e,l,c);case"<":returns(e,l,c);case"<=":returna(e,l,c);default:throwTypeError(`Invalid operator: ${t}`);}};}),q.register("9hSY8",function(e,t){varr=q("kxoMX"),n=q("6moLM"),i=q("fB52W"),o=i.safeRe,s=i.t;e.exports=(e,t)=>{if(einstanceofr)returne;if("number"==typeofe&&(e=String(e)),"string"!=typeofe)returnnull;leti=null;if((t=t||{}).rtl){// Find the right-most coercible string that does not share
// a terminus with a more left-ward coercible string.
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
//
// Walk through the string checking with a /g regexp
// Manually set the index so as to pick up overlapping matches.
// Stop when we get a match that ends at the string end, since no
// coercible string can be more right-ward without the same terminus.
lett;for(;(t=o[s.COERCERTL].exec(e))&&(!i||i.index+i[0].length!==e.length);)i&&t.index+t[0].length===i.index+i[0].length||(i=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;// leave it in a clean state
o[s.COERCERTL].lastIndex=-1;}elsei=e.match(o[s.COERCE]);returnnull===i?null:n(`${i[2]}.${i[3]||"0"}.${i[4]||"0"}`,t);};}),q.register("ge7Lx",function(e,t){letr=Symbol("SemVer ANY");// hoisted class for cyclic dependency
classn{staticgetANY(){returnr;}constructor(e,t){if(t=i(t),einstanceofn){if(!!t.loose===e.loose)returne;e=e.value;}c("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,c("comp",this);}parse(e){lett=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],n=e.match(t);if(!n)throwTypeError(`Invalid comparator: ${e}`);this.operator=void0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=newu(n[2],this.options.loose):this.semver=r;}toString(){returnthis.value;}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeofe)try{e=newu(e,this.options);}catch(e){return!1;}returnl(e,this.operator,this.semver,this.options);}intersects(e,t){if(!(einstanceofn))throwTypeError("a Comparator is required");return""===this.operator?""===this.value||newd(e.value,t).test(this.value):""===e.operator?""===e.value||newd(this.value,t).test(e.semver):// Special cases where nothing can possibly be lower
!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"));}}e.exports=n;vari=q("ifDVe"),o=q("fB52W"),s=o.safeRe,a=o.t,l=q("7Dt1t"),c=q("3Zcn3"),u=q("kxoMX"),d=q("gBfHp");}),q.register("gBfHp",function(e,t){// hoisted class for cyclic dependency
classr{constructor(e,t){if(t=o(t),einstanceofr){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)returne;returnnewr(e.raw,t);}if(einstanceofs)return(// just put it in the set and return
this.raw=e.value,this.set=[[e]],this.format(),this);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,// First reduce all whitespace as much as possible so we do not have to rely
// on potentially slow regexes like \s*. This is then stored and used for
// future error messages as well.
this.raw=e.trim().split(/\s+/).join(" "),// First, split on ||
this.set=this.raw.split("||")// map the range to a 2d array of comparators
.map(e=>this.parseRange(e.trim()))// throw out any comparator lists that are empty
// this generally means that it was not a valid range, which is allowed
// in loose mode, but will still throw if the WHOLE range is invalid.
.filter(e=>e.length),!this.set.length)throwTypeError(`Invalid SemVer Range: ${this.raw}`);// if we have any that are not the null set, throw out null sets.
if(this.set.length>1){// keep the first one, in case they're all null sets
lete=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];elseif(this.set.length>1)// if we have any that are *, then the range is just *
{for(leteofthis.set)if(1===e.length&&w(e[0])){this.set=[e];break;}}}this.format();}format(){returnthis.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range;}toString(){returnthis.range;}parseRange(e){// memoize range parsing for performance.
// this is a very hot path, and fully deterministic.
e=e.replace(u[d.CARETTRIM],h));// At this point, the range is completely trimmed and
// ready to be split into comparators.
letc=e.split(" ").map(e=>E(e,this.options)).join(" ").split(/\s+/)// >=0.0.0 is equivalent to *
.map(e=>R(e,this.options));o&&(c=c.filter(e=>(a("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),a("range list",c);// if any comparators are the null set, then replace with JUST null set
// if more than one comparator, remove any * comparators
// also, don't include the same comparator more than once
letm=newMap(),w=c.map(e=>news(e,this.options));for(leteofw){if(y(e))return[e];m.set(e.value,e);}m.size>1&&m.has("")&&m.delete("");letx=[...m.values()];returni.set(r,x),x;}intersects(e,t){if(!(einstanceofr))throwTypeError("a Range is required");returnthis.set.some(r=>x(r,t)&&e.set.some(e=>x(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))));}// if ANY of the sets match ALL of its comparators, then pass
test(e){if(!e)return!1;if("string"==typeofe)try{e=newl(e,this.options);}catch(e){return!1;}for(lett=0;t<this.set.length;t++)if(A(this.set[t],e,this.options))return!0;return!1;}}e.exports=r;varn=q("l6u7r");leti=newn({max:1e3});varo=q("ifDVe"),s=q("ge7Lx"),a=q("3Zcn3"),l=q("kxoMX"),c=q("fB52W"),u=c.safeRe,d=c.t,p=c.comparatorTrimReplace,f=c.tildeTrimReplace,h=c.caretTrimReplace,m=q("juUXZ"),g=m.FLAG_INCLUDE_PRERELEASE,v=m.FLAG_LOOSE;lety=e=>"<0.0.0-0"===e.value,w=e=>""===e.value,x=(e,t)=>{letr=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();returnr;},E=(e,t)=>(a("comp",e,t),a("caret",e=_(e,t)),a("tildes",e=S(e,t)),a("xrange",e=C(e,t)),a("stars",e=T(e,t)),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,S=(e,t)=>e.trim().split(/\s+/).map(e=>$(e,t)).join(" "),$=(e,t)=>{letr=t.loose?u[d.TILDELOOSE]:u[d.TILDE];returne.replace(r,(t,r,n,i,o)=>{lets;returna("tilde",e,t,r,n,i,o),b(r)?s="":b(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:b(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",s),s;});},_=(e,t)=>e.trim().split(/\s+/).map(e=>O(e,t)).join(" "),O=(e,t)=>{a("caret",e,t);letr=t.loose?u[d.CARETLOOSE]:u[d.CARET],n=t.includePrerelease?"-0":"";returne.replace(r,(t,r,i,o,s)=>{letl;returna("caret",e,t,r,i,o,s),b(r)?l="":b(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:b(o)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),l="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),a("caret return",l),l;});},C=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>I(e,t)).join(" ")),I=(e,t)=>{e=e.trim();letr=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];returne.replace(r,(r,n,i,o,s,l)=>{a("xRange",e,r,n,i,o,s,l);letc=b(i),u=c||b(o),d=u||b(s);return"="===n&&d&&(n=""),// if we're including prereleases in the match, then we need
// to fix this to -0, the lowest possible prerelease value
n=">=",u?(i=+i+1,o=0):o=+o+1,s=0):"<="===n&&(// <=0.7.x is actually <0.8.0, since any 0.7.x should
// pass. Similarly, <=7.x is actually <8.0.0, etc.
n="<",u?i=+i+1:o=+o+1),"<"===n&&(l="-0"),r=`${n+i}.${o}.${s}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),a("xRange return",r),r;});},T=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),R=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),P=e=>(t,r,n,i,o,s,a,l,c,u,d,p,f)=>`${r=b(n)?"":b(i)?`>=${n}.0.0${e?"-0":""}`:b(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`}${l=b(c)?"":b(u)?`<${+c+1}.0.0-0`:b(d)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${d}-${p}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),A=(e,t,r)=>{for(letr=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){// Find the set of versions that are allowed to have prereleases
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
// That should allow `1.2.3-pr.2` to pass.
// However, `1.2.4-alpha.notready` should NOT be allowed,
// even though it's within the range set by the comparators.
for(letr=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){letn=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0;}// Version has a -pre, but it's not one of the ones we like.
return!1;}return!0;};}),q.register("l6u7r",function(e,t){varr=q("hDmTp");letn=Symbol("max"),i=Symbol("length"),o=Symbol("lengthCalculator"),s=Symbol("allowStale"),a=Symbol("maxAge"),l=Symbol("dispose"),c=Symbol("noDisposeOnSet"),u=Symbol("lruList"),d=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,h=(e,t,r)=>{letn=e[d].get(t);if(n){lett=n.value;if(m(e,t)){if(v(e,n),!e[s])return;}elser&&(e[p]&&(n.value.now=Date.now()),e[u].unshiftNode(n));returnt.value;}},m=(e,t)=>{if(!t||!t.maxAge&&!e[a])return!1;letr=Date.now()-t.now;returnt.maxAge?r>t.maxAge:e[a]&&r>e[a];},g=e=>{if(e[i]>e[n])for(lett=e[u].tail;e[i]>e[n]&&null!==t;){// We know that we're about to delete this one, and also
// what the next least recently used key will be, so just
// go ahead and set it now.
letr=t.prev;v(e,t),t=r;}},v=(e,t)=>{if(t){letr=t.value;e[l]&&e[l](r.key,r.value),e[i]-=r.length,e[d].delete(r.key),e[u].removeNode(t);}};classy{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0;}}letw=(e,t,r,n)=>{leti=r.value;m(e,i)&&(v(e,r),e[s]||(i=void0)),i&&t.call(n,i.value,i.key,e);};e.exports=// lruList is a yallist where the head is the youngest
// item, and the tail is the oldest. the list contains the Hit
// objects as the entries.
// Each Hit object has a reference to its Yallist.Node. This
// never changes.
//
// cache is a Map (or PseudoMap) that matches the keys to
// the Yallist.Node object.
class{constructor(e){if("number"==typeofe&&(e={max:e}),e||(e={}),e.max&&("number"!=typeofe.max||e.max<0))throwTypeError("max must be a non-negative number");this[n]=e.max||1/0;lett=e.length||f;if(this[o]="function"!=typeoft?f:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeofe.maxAge)throwTypeError("maxAge must be a number");this[a]=e.maxAge||0,this[l]=e.dispose,this[c]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset();}// resize the cache when the max changes.
setmax(e){if("number"!=typeofe||e<0)throwTypeError("max must be a non-negative number");this[n]=e||1/0,g(this);}getmax(){returnthis[n];}setallowStale(e){this[s]=!!e;}getallowStale(){returnthis[s];}setmaxAge(e){if("number"!=typeofe)throwTypeError("maxAge must be a non-negative number");this[a]=e,g(this);}getmaxAge(){returnthis[a];}// resize the cache when the lengthCalculator changes.
setlengthCalculator(e){"function"!=typeofe&&(e=f),e!==this[o]&&(this[o]=e,this[i]=0,this[u].forEach(e=>{e.length=this[o](e.value,e.key),this[i]+=e.length;})),g(this);}getlengthCalculator(){returnthis[o];}getlength(){returnthis[i];}getitemCount(){returnthis[u].length;}rforEach(e,t){t=t||this;for(letr=this[u].tail;null!==r;){letn=r.prev;w(this,e,r,t),r=n;}}forEach(e,t){t=t||this;for(letr=this[u].head;null!==r;){letn=r.next;w(this,e,r,t),r=n;}}keys(){returnthis[u].toArray().map(e=>e.key);}values(){returnthis[u].toArray().map(e=>e.value);}reset(){this[l]&&this[u]&&this[u].length&&this[u].forEach(e=>this[l](e.key,e.value)),this[d]=newMap()// hash of items by key
,this[u]=newr()// list of items in order of use recency
,this[i]=0;// length of items in the list
}dump(){returnthis[u].map(e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e);}dumpLru(){returnthis[u];}set(e,t,r){if((r=r||this[a])&&"number"!=typeofr)throwTypeError("maxAge must be a number");lets=r?Date.now():0,p=this[o](t,e);if(this[d].has(e)){if(p>this[n])returnv(this,this[d].get(e)),!1;leto=this[d].get(e),a=o.value;returnthis[l]&&!this[c]&&this[l](e,a.value),a.now=s,a.maxAge=r,a.value=t,this[i]+=p-a.length,a.length=p,this.get(e),g(this),!0;}letf=newy(e,t,p,s,r);return(// oversized objects fall out of cache automatically.
f.length>this[n]?(this[l]&&this[l](e,t),!1):(this[i]+=f.length,this[u].unshift(f),this[d].set(e,this[u].head),g(this),!0));}has(e){if(!this[d].has(e))return!1;lett=this[d].get(e).value;return!m(this,t);}get(e){returnh(this,e,!0);}peek(e){returnh(this,e,!1);}pop(){lete=this[u].tail;returne?(v(this,e),e.value):null;}del(e){v(this,this[d].get(e));}load(e){// reset the cache
this.reset();lett=Date.now();// A previous serialized cache has the most recent items first
for(letr=e.length-1;r>=0;r--){letn=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{lete=i-t;e>0&&this.set(n.k,n.v,e);}}}prune(){this[d].forEach((e,t)=>h(this,t,!1));}};}),q.register("hDmTp",function(e,t){functionr(e){vart=this;if(tinstanceofr||(t=newr()),t.tail=null,t.head=null,t.length=0,e&&"function"==typeofe.forEach)e.forEach(function(e){t.push(e);});elseif(arguments.length>0)for(varn=0,i=arguments.length;n<i;n++)t.push(arguments[n]);returnt;}functionn(e,t,r,i){if(!(thisinstanceofn))returnnewn(e,t,r,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null;}e.exports=r,r.Node=n,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throwError("removing node which does not belong to this list");vart=e.next,r=e.prev;returnt&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t;},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);vart=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++;}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);vart=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++;}},r.prototype.push=function(){for(vare,t=0,r=arguments.length;t<r;t++)e=arguments[t],this.tail=newn(e,this.tail,null,this),this.head||(this.head=this.tail),this.length++;returnthis.length;},r.prototype.unshift=function(){for(vare,t=0,r=arguments.length;t<r;t++)e=arguments[t],this.head=newn(e,null,this.head,this),this.tail||(this.tail=this.head),this.length++;returnthis.length;},r.prototype.pop=function(){if(this.tail){vare=this.tail.value;returnthis.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e;}},r.prototype.shift=function(){if(this.head){vare=this.head.value;returnthis.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e;}},r.prototype.forEach=function(e,t){t=t||this;for(varr=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next;},r.prototype.forEachReverse=function(e,t){t=t||this;for(varr=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev;},r.prototype.get=function(e){for(vart=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)returnr.value;},r.prototype.getReverse=function(e){for(vart=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)returnr.value;},r.prototype.map=function(e,t){t=t||this;for(varn=newr(),i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;returnn;},r.prototype.mapReverse=function(e,t){t=t||this;for(varn=newr(),i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;returnn;},r.prototype.reduce=function(e,t){varr,n=this.head;if(arguments.length>1)r=t;elseif(this.head)n=this.head.next,r=this.head.value;elsethrowTypeError("Reduce of empty list with no initial value");for(vari=0;null!==n;i++)r=e(r,n.value,i),n=n.next;returnr;},r.prototype.reduceReverse=function(e,t){varr,n=this.tail;if(arguments.length>1)r=t;elseif(this.tail)n=this.tail.prev,r=this.tail.value;elsethrowTypeError("Reduce of empty list with no initial value");for(vari=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;returnr;},r.prototype.toArray=function(){for(vare=Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;returne;},r.prototype.toArrayReverse=function(){for(vare=Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;returne;},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);varn=newr();if(t<e||t<0)returnn;e<0&&(e=0),t>this.length&&(t=this.length);for(vari=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)n.push(o.value);returnn;},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);varn=newr();if(t<e||t<0)returnn;e<0&&(e=0),t>this.length&&(t=this.length);for(vari=this.length,o=this.tail;null!==o
o=e,s=newr(o,i));}),o;};}),q.register("hnV3l",function(e,t){varr=q("kxoMX"),n=q("gBfHp"),i=q("9XGBY");e.exports=(e,t)=>{e=newn(e,t);leto=newr("0.0.0");if(e.test(o)||(o=newr("0.0.0-0"),e.test(o)))returno;o=null;for(lett=0;t<e.set.length;++t){letn=e.set[t],s=null;n.forEach(e=>{// Clone to avoid manipulating the comparator's semver object.
lett=newr(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();/* fallthrough */case"":case">=":(!s||i(t,s))&&(s=t);break;case"<":case"<=":break;/* istanbul ignore next */default:throwError(`Unexpected operation: ${e.operator}`);}}),s&&(!o||i(o,s))&&(o=s);}returno&&e.test(o)?o:null;};}),q.register("3sVLb",function(e,t){varr=q("gBfHp");e.exports=(e,t)=>{try{// Return '*' instead of '' so that truthiness works.
// This will throw if it's invalid anyway
returnnewr(e,t).range||"*";}catch(e){returnnull;}};}),q.register("iqmnd",function(e,t){varr=q("kxoMX"),n=q("ge7Lx");let{ANY:i}=n;varo=q("gBfHp"),s=q("gxgIF"),a=q("9XGBY"),l=q("2zuiw"),c=q("1ndHP"),u=q("1um22");e.exports=(e,t,d,p)=>{letf,h,m,g,v;switch(e=newr(e,p),t=newo(t,p),d){case">":f=a,h=c,m=l,g=">",v=">=";break;case"<":f=l,h=u,m=a,g="<",v="<=";break;default:throwTypeError('Must provide a hilo val of "<" or ">"');}// If it satisfies the range it is not outside
if(s(e,t,p))return!1;// From now on, variable terms are as if we're in "gtr" mode.
// but note that everything is flipped for the "ltr" function.
for(letr=0;r<t.set.length;++r){leto=t.set[r],s=null,a=null;// If the edge version comparator has a operator then our version
// isn't outside it
if(o.forEach(e=>{e.semver===i&&(e=newn(">=0.0.0")),s=s||e,a=a||e,f(e.semver,s.semver,p)?s=e:m(e.semver,a.semver,p)&&(a=e);}),s.operator===g||s.operator===v||(!a.operator||a.operator===g)&&h(e,a.semver)||a.operator===v&&m(e,a.semver))return!1;}return!0;};}),q.register("bl7vX",function(e,t){// Determine if version is greater than all the versions possible in the range.
varr=q("iqmnd");e.exports=(e,t,n)=>r(e,t,">",n);}),q.register("1K9I5",function(e,t){varr=q("iqmnd");e.exports=(e,t,n)=>r(e,t,"<",n);}),q.register("2qx0f",function(e,t){varr=q("gBfHp");e.exports=(e,t,n)=>(e=newr(e,n),t=newr(t,n),e.intersects(t,n));}),q.register("k8BEA",function(e,t){// given a set of versions and a range, create a "simplified" range
// that includes the same versions that the original range does
// If the original range is shorter than the simplified one, return that.
varr=q("gxgIF"),n=q("3Z6CK");e.exports=(e,t,i)=>{leto=[],s=null,a=null,l=e.sort((e,t)=>n(e,t,i));for(leteofl){letn=r(e,t,i);n?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null);}s&&o.push([s,null]);letc=[];for(let[e,t]ofo)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");letu=c.join(" || "),d="string"==typeoft.raw?t.raw:String(t);returnu.length<d.length?u:t;};}),q.register("4B26j",function(e,t){varr=q("gBfHp"),n=q("ge7Lx");let{ANY:i}=n;varo=q("gxgIF"),s=q("3Z6CK");leta=[newn(">=0.0.0-0")],l=[newn(">=0.0.0")],c=(e,t,r)=>{letn,c,p,f,h,m,g;if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?a:l;}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=l;}letv=newSet();for(lettofe)">"===t.operator||">="===t.operator?n=u(n,t,r):"<"===t.operator||"<="===t.operator?c=d(c,t,r):v.add(t.semver);if(v.size>1||n&&c&&((p=s(n.semver,c.semver,r))>0||0===p&&(">="!==n.operator||"<="!==c.operator)))returnnull;// will iterate one or zero times
for(leteofv){if(n&&!o(e,String(n),r)||c&&!o(e,String(c),r))returnnull;for(letnoft)if(!o(e,String(n),r))return!1;return!0;}// if the subset has a prerelease, we need a comparator in the superset
// with the same tuple and a prerelease, or it's not a subset
lety=!!c&&!r.includePrerelease&&!!c.semver.prerelease.length&&c.semver,w=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(leteof(y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1),t)){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,n){if(w&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===w.major&&e.semver.minor===w.minor&&e.semver.patch===w.patch&&(w=!1),">"===e.operator||">="===e.operator){if((f=u(n,e,r))===e&&f!==n)return!1;}elseif(">="===n.operator&&!o(n.semver,String(e),r))return!1;}if(c){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if((h=d(c,e,r))===e&&h!==c)return!1;}elseif("<="===c.operator&&!o(c.semver,String(e),r))return!1;}if(!e.operator&&(c||n)&&0!==p)return!1;}return(!n||!m||!!c||0===p)&&(!c||!g||!!n||0===p)&&!w&&!y;},u=(e,t,r)=>{if(!e)returnt;letn=s(e.semver,t.semver,r);returnn>0?e:n<0?t:">"===t.operator&&">="===e.operator?t:e;},d=(e,t,r)=>{if(!e)returnt;letn=s(e.semver,t.semver,r);returnn<0?e:n>0?t:"<"===t.operator&&"<="===e.operator?t:e;};e.exports=(e,t,n={})=>{if(e===t)return!0;e=newr(e,n),t=newr(t,n);leti=!1;e:for(letrofe.set){for(leteoft.set){lett=c(r,e,n);if(i=i||null!==t,t)continuee;}// the null set is a subset of everything, but null simple ranges in
// a complex range should be ignored. so if we saw a non-null range,
// then we know this isn't a subset, but if EVERY simple range was null,
// then it is a subset.
if(i)return!1;}return!0;};}),q.register("awj79",function(e,t){varr=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if("string"!=typeofe)throwTypeError("Expected a string");returne.replace(r,"\\$&");};}),q.register("dOmbL",function(e,t){F(e.exports,"pathExists",()=>r);asyncfunctionr(e){try{returnawait(0,S.promises).access(e),!0;}catch{return!1;}}}),q.register("ceI0e",function(e,t){F(e.exports,"addExeExt",()=>l),F(e.exports,"addShExt",()=>d),F(e.exports,"addShRelativePrefix",()=>p),F(e.exports,"dirname",()=>h.dirname),F(e.exports,"join",()=>h.join);varr=q("9ag04"),n=q("923E2");functioni(e,t){returnObject.keys(t).forEach(r=>{"default"===r||"__esModule"===r||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get:()=>t[r]});}),e;}functiono(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}functions(e,t=!0){returnt?(0,h.basename)(e):(0,h.basename)(e,(0,h.extname)(e));}functiona(e){return(0,h.normalize)(e).replace(RegExp((0,r.default)(h.sep)+"$"),"");}functionl(e,t=".exe",r=""){return"win32"===process.platform?`${e}${t}`:`${e}${r}`;}functionc(e,t){letr=(0,h.extname)(e),n=`${t}${(0,h.basename)(e,r)}${r}`;return(0,h.join)((0,h.dirname)(e),n);}functionu(e,t){letr=(0,h.extname)(e),n=`${(0,h.basename)(e,r)}${t}${r}`;return(0,h.join)((0,h.dirname)(e),n);}functiond(e,t=".cmd",r=".sh"){return"win32"===process.platform?`${e}${t}`:`${e}${r}`;}functionp(e){return"win32"===process.platform?e:"./"+e;}functionf(e){lett=(0,h.extname)(e).length;returne.slice(0,-t);}functionm(e,t){return/*@__PURE__*/B(n)(e,t);}functiong(e,t){letr=(0,h.relative)(t,e);return!(!r||".."===r||r.startsWith(".."+h.sep)||r===(0,h.resolve)(e));}varv={},y={};o(y,"name",()=>s);varw={};o(w,"normalizeTrim",()=>a);varx={};o(x,"addExeExt",()=>l);varE={};o(E,"addNamePrefix",()=>c);varb={};o(b,"addNameSuffix",()=>u);varS={};o(S,"addShExt",()=>d);var$={};o($,"addShRelativePrefix",()=>p);var_={};o(_,"removeExt",()=>f);varO={};o(O,"replaceExt",()=>m);varC={};o(C,"isPathInside",()=>g),i(v,y),i(v,w),i(v,x),i(v,E),i(v,b),i(v,S),i(v,$),i(v,_),i(v,O),i(v,C);}),q.register("9ag04",function(e,t){F(e.exports,"default",()=>r);functionr(e){if("string"!=typeofe)throwTypeError("Expected a string");// Escape characters with special meaning either inside or outside character sets.
// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
returne.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d");}}),q.register("923E2",function(e,t){e.exports=function(e,t){if("string"!=typeofe||0===e.length)returne;varr,n=h.basename(e,h.extname(e))+t,i=h.join(h.dirname(e),n);return(// Because `path.join` removes the head './' from the given path.
// This removal can cause a problem when passing the result to `require` or
*/function l(e){return o(this,void 0,void 0,function*(){if(a.IS_WINDOWS&&/[*"<>|]/.test(e))throw Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{// note if path does not exist, error is silent
yielda.rm(e,{force:!0,maxRetries:3,recursive:!0,retryDelay:300});}catch(e){throwError(`File was unable to be removed ${e}`);}});}/**
*/function u(e){return o(this,void 0,void 0,function*(){if(!e)throw Error("parameter 'tool' is required");//buildthelistofextensionstotry
lett=[];if(a.IS_WINDOWS&&process.env.PATHEXT)for(leteofprocess.env.PATHEXT.split(s.delimiter))e&&t.push(e);// if it's rooted, return it if exists. otherwise return empty.
if(a.isRooted(e)){letr=yielda.tryGetExecutablePath(e,t);returnr?[r]:[];}// if any path separators, return empty
if(e.includes(s.sep))return[];// build the list of directories
//
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
// it feels like we should not do this. Checking the current directory seems like more of a use
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
// across platforms.
letr=[];if(process.env.PATH)for(leteofprocess.env.PATH.split(s.delimiter))e&&r.push(e);// find all matches
functiond(e,t,r){returno(this,void0,void0,function*(){if((yielda.lstat(e)).isSymbolicLink()){// unlink/re-link it
try{yielda.lstat(t),yielda.unlink(t);}catch(e){"EPERM"===e.code&&(yielda.chmod(t,"0666"),yielda.unlink(t));// other errors = it doesn't exist, no work to do
if(u&&u.isFile()&&!n)return;// If dest is an existing directory, should copy inside.
letp=u&&u.isDirectory()&&l?s.join(t,s.basename(e)):t;if(!(yielda.exists(e)))throwError(`no such file or directory: ${e}`);letf=yielda.stat(e);if(f.isDirectory()){if(i)yieldfunctione(t,r,n,i){returno(this,void0,void0,function*(){// Ensure there is not a run away recursive copy
if(n>=255)return;n++,yieldc(r);leto=yielda.readdir(t);for(letsofo){leto=`${t}/${s}`,l=`${r}/${s}`,c=yielda.lstat(o);c.isDirectory()?yielde(o,l,n,i):yieldd(o,l,i);}// Change the mode for the newly created directory
yielda.chmod(r,(yielda.stat(t)).mode);});}(e,p,0,n);elsethrowError(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`);}else{if(""===s.relative(e,p))throwError(`'${p}' and '${e}' are the same file`);yieldd(e,p,n);}});},e.exports.mv=/**
*/function e(t,r){return o(this,void 0,void 0,function*(){if(!t)throw Error("parameter 'tool' is required");//recursivewhencheck=true
if(r){letr=yielde(t,!1);if(!r){if(a.IS_WINDOWS)throwError(`Unable to locate executable file: ${t}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);throwError(`Unable to locate executable file: ${t}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);}returnr;}letn=yieldu(t);returnn&&n.length>0?n[0]:"";});},e.exports.findInPath=u;}),q.register("ejt9m",function(e,t){varr,n=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){returnt[r];}});}:function(e,t,r,n){void0===n&&(n=r),e[n]=t[r];}),i=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),o=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varrine)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);returni(t,e),t;},s=e.exports&&e.exports.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(i,o){functions(e){try{l(n.next(e));}catch(e){o(e);}}functiona(e){try{l(n.throw(e));}catch(e){o(e);}}functionl(e){vart;e.done?i(e.value):((t=e.value)instanceofr?t:newr(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.getCmdPath=e.exports.tryGetExecutablePath=e.exports.isRooted=e.exports.isDirectory=e.exports.exists=e.exports.READONLY=e.exports.UV_FS_O_EXLOCK=e.exports.IS_WINDOWS=e.exports.unlink=e.exports.symlink=e.exports.stat=e.exports.rmdir=e.exports.rm=e.exports.rename=e.exports.readlink=e.exports.readdir=e.exports.open=e.exports.mkdir=e.exports.lstat=e.exports.copyFile=e.exports.chmod=void0;leta=o(m),l=o(h);// on Mac/Linux, test the execute bit
e.exports.IS_WINDOWS="win32"===process.platform,// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
(r=r.replace(/\//g,"\\")).replace(/\\\\+/g,"\\"):r.replace(/\/\/+/g,"/")))throwError('isRooted() parameter "p" cannot be empty');returne.exports.IS_WINDOWS?t.startsWith("\\")||/^[A-Z]:/i.test(t)// e.g. \ or \hello or \\hello
n=yielde.exports.stat(t);}catch(e){"ENOENT"!==e.code&&console.log(`Unexpected error attempting to determine if executable file exists '${t}': ${e}`);}if(n&&n.isFile()){if(e.exports.IS_WINDOWS){// on Windows, test for valid extension
lete=l.extname(t).toUpperCase();if(r.some(t=>t.toUpperCase()===e))returnt;}elseif(c(n))returnt;}// try each extension
leti=t;for(letoofr){t=i+o,n=void0;try{n=yielde.exports.stat(t);}catch(e){"ENOENT"!==e.code&&console.log(`Unexpected error attempting to determine if executable file exists '${t}': ${e}`);}if(n&&n.isFile()){if(e.exports.IS_WINDOWS){// preserve the case of the actual file (since an extension was appended)
console.log(`Unexpected error attempting to determine the actual case of the file '${t}': ${e}`);}returnt;}if(c(n))returnt;}}return"";});},e.exports.getCmdPath=// Get the path of cmd.exe in windows
function(){vare;returnnull!==(e=process.env.COMSPEC)&&void0!==e?e:"cmd.exe";};}),q.register("ktIRP",function(e,t){varr=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){returnt[r];}});}:function(e,t,r,n){void0===n&&(n=r),e[n]=t[r];}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(variine)"default"!==i&&Object.hasOwnProperty.call(e,i)&&r(t,e,i);returnn(t,e),t;},o=e.exports&&e.exports.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(i,o){functions(e){try{l(n.next(e));}catch(e){o(e);}}functiona(e){try{l(n.throw(e));}catch(e){o(e);}}functionl(e){vart;e.done?i(e.value):((t=e.value)instanceofr?t:newr(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports._readLinuxVersionFile=e.exports._getOsVersion=e.exports._findMatch=void0;lets=i(q("lJEXJ"));vara=q("lcRzN");e.exports._findMatch=function(t,r,n,i){returno(this,void0,void0,function*(){leto,l,c;letu=f.platform();for(letoofn){letn=o.version;if(a.debug(`check ${n} satisfies ${t}`),s.satisfies(n,t)&&(!r||o.stable===r)&&(c=o.files.find(t=>{a.debug(`${t.arch}===${i} && ${t.platform}===${u}`);letr=t.arch===i&&t.platform===u;if(r&&t.platform_version){letn=e.exports._getOsVersion();r=n===t.platform_version||s.satisfies(n,t.platform_version);}returnr;}))){a.debug(`matched ${o.version}`),l=o;break;}}returnl&&c&&(// clone since we're mutating the file list to be only the file that matches
(o=Object.assign({},l)).files=[c]),o;});},e.exports._getOsVersion=function(){// TODO: add windows and other linux, arm variants
// right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
lett=f.platform(),r="";if("darwin"===t)r=$.execSync("sw_vers -productVersion").toString();elseif("linux"===t){// lsb_release process not in some containers, readfile
// Run cat /etc/lsb-release
// DISTRIB_ID=Ubuntu
// DISTRIB_RELEASE=18.04
// DISTRIB_CODENAME=bionic
// DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
lett=e.exports._readLinuxVersionFile();if(t){lete=t.split("\n");for(lettofe){lete=t.split("=");if(2===e.length&&("VERSION_ID"===e[0].trim()||"DISTRIB_RELEASE"===e[0].trim())){r=e[1].trim().replace(/^"/,"").replace(/"$/,"");break;}}}}returnr;},e.exports._readLinuxVersionFile=function(){lete="/etc/lsb-release",t="/etc/os-release",r="";returnm.existsSync(e)?r=m.readFileSync(e).toString():m.existsSync(t)&&(r=m.readFileSync(t).toString()),r;};}),q.register("dGCqI",function(e,t){varr=q("fVQSr"),n=q("3MZit");e.exports=function(e,t,i){varo=t&&i||0;"string"==typeofe&&(t="binary"===e?Array(16):null,e=null);vars=(e=e||{}).random||(e.rng||r)();// Copy bytes to buffer, if provided
if(// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(vara=0;a<16;++a)t[o+a]=s[a];returnt||n(s);};}),q.register("fVQSr",function(e,t){// Unique ID creation requires a high quality random # generator. In node.js
// this is pretty straight-forward - we use the crypto API.
e.exports=function(){returng.randomBytes(16);};}),q.register("3MZit",function(e,t){for(varr=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){varn=t||0;// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
*/class m extends a.EventEmitter{constructor(e,t,r){if(super(),!e)throw Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=e,this.args=t||[],this.options=r||{};}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e);}_getCommandString(e,t){let r=this._getSpawnFileName(),n=this._getSpawnArgs(e),i=t?"":"[command]";if(p){//Windows+cmdfile
if(this._isCmdFile())for(leteof(i+=r,n))i+=`${e}`;elseif(e.windowsVerbatimArguments)for(leteof(i+=`"${r}"`,n))i+=`${e}`;elsefor(leteof(i+=this._windowsQuoteCmdArg(r),n))i+=`${this._windowsQuoteCmdArg(e)}`;}elsefor(leteof(// OSX/Linux - this can likely be improved with some form of quoting.
// creating processes on Unix is fundamentally different than Windows.
// on Unix, execvp() takes an arg array.
i+=r,n))i+=`${e}`;returni;}_processLineBuffer(e,t,r){try{letn=t+e.toString(),i=n.indexOf(s.EOL);for(;i>-1;){lete=n.substring(0,i);r(e),i=// the rest of the string ...
(n=n.substring(i+s.EOL.length)).indexOf(s.EOL);}returnn;}catch(e){return(// streaming lines to console is best effort. Don't fail a build.
this._debug(`error processing line. Failed with error ${e}`),"");}}_getSpawnFileName(){returnp&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath;}_getSpawnArgs(e){if(p&&this._isCmdFile()){lett=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(letrofthis.args)t+=" "+(e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r));return[t+='"'];}returnthis.args;}_endsWith(e,t){returne.endsWith(t);}_isCmdFile(){lete=this.toolPath.toUpperCase();returnthis._endsWith(e,".CMD")||this._endsWith(e,".BAT");}_windowsQuoteCmdArg(e){// for .exe, apply the normal quoting rules that libuv applies
if(!this._isCmdFile())returnthis._uvQuoteCmdArg(e);// otherwise apply quoting rules specific to the cmd.exe command line parser.
// the libuv rules are generic and are not designed specifically for cmd.exe
// command line parser.
//
// for a detailed description of the cmd.exe command line parser, refer to
if(!e)return'""';// determine whether the arg needs to be quoted
lett=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'],r=!1;for(letnofe)if(t.some(e=>e===n)){r=!0;break;}// short-circuit if quotes not needed
if(!r)returne;// the following quoting rules are very similar to the rules that by libuv applies.
//
// 1) wrap the string in quotes
//
// 2) double-up quotes - i.e. " => ""
//
// this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
// doesn't work well with a cmd.exe command line.
//
// note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
// for example, the command line:
// foo.exe "myarg:""my val"""
// is parsed by a .NET console app into an arg array:
// [ "myarg:\"my val\"" ]
// which is the same end result when applying libuv quoting rules. although the actual
// command line from libuv quoting rules would look like:
// foo.exe "myarg:\"my val\""
//
// 3) double-up slashes that precede a quote,
// e.g. hello \world => "hello \world"
// hello\"world => "hello\\""world"
// hello\\"world => "hello\\\\""world"
// hello world\ => "hello world\\"
//
// technically this is not required for a cmd.exe command line, or the batch argument parser.
// the reasons for including this as a .cmd quoting rule are:
//
// a) this is optimized for the scenario where the argument is passed from the .cmd file to an
// external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
//
// b) it's what we've been doing previously (by deferring to node default behavior) and we
// haven't heard any complaints about that aspect.
//
// note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
// escaped when used on the command line directly - even though within a .cmd file % can be escaped
// by using %%.
//
// the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
// the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
//
// one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
// often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
// variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
// to an external program.
//
// an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
// % can be escaped within a .cmd file.
letn='"',i=!0;for(lett=e.length;t>0;t--)// walk the string in reverse
n+=e[t-1],i&&"\\"===e[t-1]?n+="\\":'"'===e[t-1]?(i=!0,n+='"'):i=!1;return(n+='"').split("").reverse().join("");}_uvQuoteCmdArg(e){// Tool runner wraps child_process.spawn() and needs to apply the same quoting as
// Node in certain cases where the undocumented spawn option windowsVerbatimArguments
// is used.
//
// Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
// see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
// pasting copyright notice from Node within this function:
//
// Copyright Joyent, Inc. and other Node contributors. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
if(!e)return'""';if(!e.includes(" ")&&!e.includes(" ")&&!e.includes('"'))returne;if(!e.includes('"')&&!e.includes("\\"))// quote marks around the whole thing.
return`"${e}"`;// Expected input/output:
// input : hello"world
// output: "hello\"world"
// input : hello""world
// output: "hello\"\"world"
// input : hello\world
// output: hello\world
// input : hello\\world
// output: hello\\world
// input : hello\"world
// output: "hello\\\"world"
// input : hello\\"world
// output: "hello\\\\\"world"
// input : hello world\
// output: "hello world\\" - note the comment in libuv actually reads "hello world\"
// but it appears the comment is wrong, it should be "hello world\\"
lett='"',r=!0;for(letn=e.length;n>0;n--)// walk the string in reverse
*/exec(){return o(this,void 0,void 0,function*(){return!d.isRooted(this.toolPath)&&(this.toolPath.includes("/")||p&&this.toolPath.includes("\\"))&&(this.toolPath=c.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),// if the tool is only a file name, then resolve it from the PATH
// otherwise verify it exists (add extension on Windows if necessary)
this.toolPath=yieldu.which(this.toolPath,!0),newPromise((e,t)=>o(this,void0,void0,function*(){for(leteof(this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:"),this.args))this._debug(`${e}`);letr=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+s.EOL);letn=newg(r,this.toolPath);if(n.on("debug",e=>{this._debug(e);}),this.options.cwd&&!(yieldd.exists(this.options.cwd)))returnt(Error(`The cwd: ${this.options.cwd} does not exist!`));leti=this._getSpawnFileName(),o=l.spawn(i,this._getSpawnArgs(r),this._getSpawnOptions(this.options,i)),a="";o.stdout&&o.stdout.on("data",e=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(e),!r.silent&&r.outStream&&r.outStream.write(e),a=this._processLineBuffer(e,a,e=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(e);});});letc="";if(o.stderr&&o.stderr.on("data",e=>{if(n.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(e),!r.silent&&r.errStream&&r.outStream){lett=r.failOnStdErr?r.errStream:r.outStream;t.write(e);}c=this._processLineBuffer(e,c,e=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(e);});}),o.on("error",e=>{n.processError=e.message,n.processExited=!0,n.processClosed=!0,n.CheckComplete();}),o.on("exit",e=>{n.processExitCode=e,n.processExited=!0,this._debug(`Exit code ${e} received from tool '${this.toolPath}'`),n.CheckComplete();}),o.on("close",e=>{n.processExitCode=e,n.processExited=!0,n.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),n.CheckComplete();}),n.on("done",(r,n)=>{a.length>0&&this.emit("stdline",a),c.length>0&&this.emit("errline",c),o.removeAllListeners(),r?t(r):e(n);}),this.options.input){if(!o.stdin)throwError("child process missing stdin");o.stdin.end(this.options.input);}}));});}}e.exports.ToolRunner=m,e.exports.argStringToArray=/**
*/function(e){let t=[],r=!1,n=!1,i="";function o(e){n&&'"'!==e&&(i+="\\"),i+=e,n=!1;}for(let s=0;s<e.length;s++){let a=e.charAt(s);if('"'===a){n?o(a):r=!r;continue;}if("\\"===a&&n){o(a);continue;}if("\\"===a&&r){n=!0;continue;}if(" "===a&&!r){i.length>0&&(t.push(i),i="");continue;}o(a);}return i.length>0&&t.push(i.trim()),t;};class g extends a.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw Error("toolPath must not be empty");this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay);}CheckComplete(){!this.done&&(this.processClosed?this._setResult():this.processExited&&(this.timeout=O.setTimeout(g.HandleTimeout,this.delay,this)));}_debug(e){this.emit("debug",e);}_setResult(){//determinewhetherthereisanerror
lete;this.processExited&&(this.processError?e=Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):0===this.processExitCode||this.options.ignoreReturnCode?this.processStderr&&this.options.failOnStdErr&&(e=Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)):e=Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",e,this.processExitCode);}staticHandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){lett=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t);}e._setResult();}}}}),q.register("5fF9z",function(e,t){e.exports=Promise.resolve(require("./actions_python.945fba47.js")).then(()=>q("4kQHk"));});varX=q("dTX7a"),K=q("ER74K"),z=q("ggaxg"),W={};(function(){q("fXZh0").addLocale("en",function(e/*``*/){vart=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return("string"==typeofe&&(e=parseInt(e,10)),1===t&&0===r)?"one":"other";});}).call(W);varY={};Y=q("25uEY");varJ={};J={id:"en",data:{long:{years:{one:"{0} year",other:"{0} years"},months:{one:"{0} month",other:"{0} months"},weeks:{one:"{0} week",other:"{0} weeks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hour",other:"{0} hours"},minutes:{one:"{0} minute",other:"{0} minutes"},seconds:{one:"{0} second",other:"{0} seconds"}},narrow:{years:{one:"{0}y",other:"{0}y"},months:{one:"{0}m",other:"{0}m"},weeks:{one:"{0}w",other:"{0}w"},days:{one:"{0}d",other:"{0}d"},hours:{one:"{0}h",other:"{0}h"},minutes:{one:"{0}m",other:"{0}m"},seconds:{one:"{0}s",other:"{0}s"}},short:{years:{one:"{0} yr",other:"{0} yrs"},months:{one:"{0} mth",other:"{0} mths"},weeks:{one:"{0} wk",other:"{0} wks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hr",other:"{0} hr"},minutes:{one:"{0} min",other:"{0} min"},seconds:{one:"{0} sec",other:"{0} sec"}}}};varQ={};constZ=f.homedir();Q=e=>{if("string"!=typeofe)throwTypeError(`Expected a string, got ${typeofe}`);returnZ?e.replace(/^~(?=$|\/|\\)/,Z):e;};varee={};constet="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,er=et?";":":";varen={};functionei(e,t,r){if("function"==typeoft&&(r=t,t={}),!r){if("function"!=typeofPromise)throwTypeError("callback not provided");returnnewPromise(function(r,n){ei(e,t||{},function(e,t){e?n(e):r(t);});});}e6(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n);});}e6="win32"===process.platform||G.TESTING_WINDOWS?q("a3PNV"):q("7gw6J"),en=ei,ei.sync=function(e,t){// my kingdom for a filtered catch
try{returne6.sync(e,t||{});}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throwe;}};consteo=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),es=(e,t)=>{letr=t.colon||er,n=e.match(/\//)||et&&e.match(/\\/)?[""]:[// windows always checks the cwd first
...(et?[process.cwd()]:[]),...(t.path||process.env.PATH||/* istanbul ignore next: very unusual */"").split(r)],i=et?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=et?i.split(r):[""];returnet&&-1!==e.indexOf(".")&&""!==o[0]&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i};},ea=(e,t,r)=>{"function"==typeoft&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=es(e,t),s=[],a=r=>newPromise((i,o)=>{if(r===n.length)returnt.all&&s.length?i(s):o(eo(e));leta=n[r],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=h.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;i(l(d,r,0));}),l=(e,r,n)=>newPromise((c,u)=>{if(n===i.length)returnc(a(r+1));letd=i[n];en(e+d,{pathExt:o},(i,o)=>{if(!i&&o){if(!t.all)returnc(e+d);s.push(e+d);}returnc(l(e,r,n+1));});});returnr?a(0).then(e=>r(null,e),r):a(0);};ee=ea,ea.sync=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=es(e,t),o=[];for(lets=0;s<r.length;s++){leta=r[s],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=h.join(l,e),u=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(lete=0;e<n.length;e++){letr=u+n[e];try{lete=en.sync(r,{pathExt:i});if(e){if(!t.all)returnr;o.push(r);}}catch(e){}}}if(t.all&&o.length)returno;if(t.nothrow)returnnull;throweo(e);};varel={},ec={},eu={},ed={},ep={};constef=(e={})=>{lett=e.env||process.env,r=e.platform||process.platform;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path";};functioneh(e,t){letr;letn=e.options.env||process.env,i=process.cwd(),o=null!=e.options.cwd,s=o&&void0!==process.chdir&&!process.chdir.disabled;// If a custom `cwd` was specified, we need to change the process cwd
// because `which` will do stat calls but does not support a custom cwd
if(s)try{process.chdir(e.options.cwd);}catch(e){/* Empty */}try{r=ee.sync(e.command,{path:n[ep({env:n})],pathExt:t?h.delimiter:void0});}catch(e){/* Empty */}finally{s&&process.chdir(i);}returnr&&(r=h.resolve(o?e.options.cwd:"",r)),r;}// TODO: Remove this for the next major release
(ep=ef).default=ef,ed=function(e){returneh(e)||eh(e,!0);};// See http://www.robvanderwoude.com/escapechars.php
constem=/([()\][%!^"`<>&|;, *?])/g;vareg={},ev={},ey={};ey=/^#!(.*)/,ev=(e="")=>{lett=e.match(ey);if(!t)returnnull;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?n:n?`${i}${n}`:i;},eg=function(e){lett;letr=Buffer.alloc(150);try{t=m.openSync(e,"r"),m.readSync(t,r,0,150,0),m.closeSync(t);}catch(e){}// Attempt to extract shebang (null is returned if not a shebang)
letn={command:e,args:t,options:r,file:void0,original:{command:e,args:t}};// Delegate further parsing to shell or non-shell
returnr.shell?n:function(e){if(!ew)returne;// Detect & add support for shebangs
lett=function(e){e.file=ed(e);lett=e.file&&eg(e.file);returnt?(e.args.unshift(e.file),e.command=t,ed(e)):e.file;}(e),r=!ex.test(t);// If a shell is required, use cmd.exe and take care of escaping everything correctly
// Note that `forceShell` is an hidden option used only in tests
if(e.options.forceShell||r){// Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
// The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
// Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
// we need to double escape them
letr=eE.test(t);// Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
// This is necessary otherwise it will always fail with ENOENT in those cases
letn=eu(e,t,r),i=$.spawn(n.command,n.args,n.options);return(// Hook into child process "exit" event to emit an error if the command
// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
eb.hookChildProcess(i,n),i);}eb={hookChildProcess:function(e,t){if(!eS)return;letr=e.emit;e.emit=function(n,i){// If emitting "exit" event and exit code is 1, we need to check if
// the command exists and emit an "error" instead
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
};},verifyENOENT:e_,verifyENOENTSync:function(e,t){returneS&&1===e&&!t.file?e$(t.original,"spawnSync"):null;},notFoundError:e$},(ec=eO).spawn=eO,ec.sync=function(e,t,r){// Parse the arguments
letn=eu(e,t,r),i=$.spawnSync(n.command,n.args,n.options);return(// Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
i.error=i.error||eb.verifyENOENTSync(i.status,n),i);},ec._parse=eu,ec._enoent=eb;vareC={};eC=e=>{lett="string"==typeofe?"\n":"\n".charCodeAt(),r="string"==typeofe?"\r":"\r".charCodeAt();returne[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e;};vareI={};consteT=e=>{lett;e={cwd:process.cwd(),path:process.env[ep()],execPath:process.execPath,...e};letr=h.resolve(e.cwd),n=[];for(;t!==r;)n.push(h.join(r,"node_modules/.bin")),t=r,r=h.resolve(r,"..");// Ensure the running `node` binary is used
leti=h.resolve(e.cwd,e.execPath,"..");returnn.push(i),n.concat(e.path).join(h.delimiter);};// TODO: Remove this for the next major release
(eI=eT).default=eT,eI.env=e=>{e={env:process.env,...e};lett={...e.env},r=ep({env:t});returne.path=t[r],t[r]=eI(e),t;};vareR={},eP={};consteA=(e,t)=>{for(letrofReflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));returne;};// TODO: Remove this for the next major release
(eP=eA).default=eA;consteN=newWeakMap(),eL=(e,t={})=>{letr;if("function"!=typeofe)throwTypeError("Expected a function");letn=0,i=e.displayName||e.name||"<anonymous>",o=function(...s){if(eN.set(o,++n),1===n)r=e.apply(this,s),e=null;elseif(!0===t.throw)throwError(`Function \`${i}\` can only be called once`);returnr;};returneP(o,e),eN.set(o,n),o;};// TODO: Remove this for the next major release
(eR=eL).default=eL,eR.callCount=e=>{if(!eN.has(e))throwError(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);returneN.get(e);};varek={},eD={};Object.defineProperty(eD,"__esModule",{value:!0}),eD.signalsByNumber=eD.signalsByName=void0;vareU={};Object.defineProperty(eU,"__esModule",{value:!0}),eU.getSignals=void0;varej={};Object.defineProperty(ej,"__esModule",{value:!0}),ej.SIGNALS=void0,ej.SIGNALS=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:3
${n.message}`:m,y=[v,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=y):n=Error(y),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=!!l,n.isCanceled=c,n.killed=u&&!l,n;};var eJ={};const eQ=["stdin","stdout","stderr"],eZ=e=>eQ.some(t=>void 0!==e[t]),e0=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return eQ.map(t=>e[t]);if(eZ(e))throw Error(`It'snotpossibletoprovide\`stdio\` in combination with one of ${eQ.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,eQ.length);returnArray.from({length:r},(e,r)=>t[r]);};// `ipc` is pushed unless it is already present
(eJ=e0).node=e=>{lett=e0(e);return"ipc"===t?"ipc":void0===t||"string"==typeoft?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];};vare1={},e2={},e4=G.process;conste3=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;};// some kind of non-node environment, just no-op
/* istanbul ignore if */if(e3(e4)){vare6,e5,e8=q("1YMV0"),e7=/^win/i.test(e4.platform),e9=x;"function"!=typeofe9&&(e9=e9.EventEmitter),e4.__signal_exit_emitter__?e5=e4.__signal_exit_emitter__:((e5=e4.__signal_exit_emitter__=newe9()).count=0,e5.emitted={}),e5.infinite||(e5.setMaxListeners(1/0),e5.infinite=!0);varte=function(){tn&&e3(G.process)&&(tn=!1,e8.forEach(function(e){try{e4.removeListener(e,tr[e]);}catch(e){}}),e4.emit=ta,e4.reallyExit=to,e5.count-=1);};(e2=function(e,t){/* istanbul ignore if */if(!e3(G.process))returnfunction(){};E.equal(typeofe,"function","a callback must be provided for exit handler"),!1===tn&&ti();varr="exit";returnt&&t.alwaysLast&&(r="afterexit"),e5.on(r,e),function(){e5.removeListener(r,e),0===e5.listeners("exit").length&&0===e5.listeners("afterexit").length&&te();};}).unload=te;vartt=function(e,t,r){e5.emitted[e]||(e5.emitted[e]=!0,e5.emit(e,t,r));},tr={};e8.forEach(function(e){tr[e]=function(){e3(G.process)&&e4.listeners(e).length===e5.count&&(te(),tt("exit",null,e),/* istanbul ignore next */tt("afterexit",null,e),e7&&"SIGHUP"===e&&(// so use a supported signal instead
e="SIGINT"),/* istanbul ignore next */e4.kill(e4.pid,e));};}),e2.signals=function(){returne8;};vartn=!1,ti=function(){!tn&&e3(G.process)&&(tn=!0,// This is the number of onSignalExit's that are in play.
// It's important so that we can count the correct number of
// listeners on signals, and don't wait for the other one to
// handle it instead of us.
e5.count+=1,e8=e8.filter(function(e){try{returne4.on(e,tr[e]),!0;}catch(e){return!1;}}),e4.emit=tl,e4.reallyExit=ts);};e2.load=ti;varto=e4.reallyExit,ts=function(e){e3(G.process)&&(e4.exitCode=e||/* istanbul ignore next */0,tt("exit",e4.exitCode,null),/* istanbul ignore next */tt("afterexit",e4.exitCode,null),/* istanbul ignore next */to.call(e4,e4.exitCode));},ta=e4.emit,tl=function(e,t){if(!("exit"===e&&e3(G.process)))returnta.apply(this,arguments);void0!==t&&(e4.exitCode=t);varr=ta.apply(this,arguments);/* istanbul ignore next */return(/* istanbul ignore next */tt("exit",e4.exitCode,null),/* istanbul ignore next */tt("afterexit",e4.exitCode,null),r);};}elsee2=function(){returnfunction(){};};consttc=(e,t,r,n)=>{if(!tu(t,r,n))return;leti=tp(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},tu=(e,{forceKillAfterTimeout:t},r)=>td(e)&&!1!==t&&r,td=e=>e===f.constants.signals.SIGTERM||"string"==typeofe&&"SIGTERM"===e.toUpperCase(),tp=({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;},tf=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},th=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)returnn;leti=e2(()=>{e.kill();});returnn.finally(()=>{i();});};vartm=(e1={spawnedKill:(e,t="SIGTERM",r={})=>{letn=e(t);returntc(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(()=>{tf(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});returnPromise.race([o,s]);},validateTimeout:({timeout:e})=>{if(void0!==e&&(!Number.isFinite(e)||e<0))throwTypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);},setExitHandler:th}).spawnedKill,tg=e1.spawnedCancel,tv=e1.setupTimeout,ty=e1.validateTimeout,tw=e1.setExitHandler,tx={},tE={};consttb=e=>null!==e&&"object"==typeofe&&"function"==typeofe.pipe;tb.writable=e=>tb(e)&&!1!==e.writable&&"function"==typeofe._write&&"object"==typeofe._writableState,tb.readable=e=>tb(e)&&!1!==e.readable&&"function"==typeofe._read&&"object"==typeofe._readableState,tb.duplex=e=>tb.writable(e)&&tb.readable(e),tb.transform=e=>tb.duplex(e)&&"function"==typeofe._transform,tE=tb;vartS={},t$=C.constants,t_=b.promisify,tO={},tC=I.PassThrough;tO=e=>{e={...e};let{array:t}=e,{encoding:r}=e,n="buffer"===r,i=!1;t?i=!(r||n):r=r||"utf8",n&&(r=null);leto=newtC({objectMode:i});r&&o.setEncoding(r);lets=0,a=[];returno.on("data",e=>{a.push(e),i?s=a.length:s+=e.length;}),o.getBufferedValue=()=>t?a:n?Buffer.concat(a,s):a.join(""),o.getBufferedLength=()=>s,o;};consttI=t_(I.pipeline);classtTextendsError{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError";}}asyncfunctiontR(e,t){if(!e)throwError("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:r}=t,n=tO(t);returnawaitnewPromise((t,i)=>{leto=e=>{e&&n.getBufferedLength()<=t$.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{awaittI(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(newtT());});}),n.getBufferedValue();}(tS=tR).buffer=(e,t)=>tR(e,{...t,encoding:"buffer"}),tS.array=(e,t)=>tR(e,{...t,array:!0}),tS.MaxBufferError=tT;vartP={},tA=I.PassThrough;tP=function(){vare=[],t=newtA({objectMode:!0});returnt.setMaxListeners(0),t.add=r,t.isEmpty=function(){return0==e.length;},t.on("unpipe",n),Array.prototype.slice.call(arguments).forEach(r),t;functionr(i){returnArray.isArray(i)?i.forEach(r):(e.push(i),i.once("end",n.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1})),this;}functionn(r){!(e=e.filter(function(e){returne!==r;})).length&&t.readable&&t.end();}};// On failure, `result.stdout|stderr|all` should contain the currently buffered stream
consttN=async(e,t)=>{if(e){e.destroy();try{returnawaitt;}catch(e){returne.bufferedData;}}},tL=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)returnt?tS(e,{encoding:t,maxBuffer:n}):tS.buffer(e,{maxBuffer:n});},tk=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{leta=tL(e,{encoding:n,buffer:i,maxBuffer:o}),l=tL(t,{encoding:n,buffer:i,maxBuffer:o}),c=tL(r,{encoding:n,buffer:i,maxBuffer:2*o});try{returnawaitPromise.all([s,a,l,c]);}catch(n){returnPromise.all([{error:n,signal:n.signal,timedOut:n.timedOut},tN(e,a),tN(t,l),tN(r,c)]);}};vartD=(tx={handleInput:(e,t)=>{void0!==t&&void0!==e.stdin&&(tE(t)?t.pipe(e.stdin):e.stdin.end(t));},makeAllStream:(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;letr=tP();returne.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},getSpawnedResult:tk,validateInputSync:({input:e})=>{if(tE(e))throwTypeError("The `input` option cannot be a stream in sync mode");}}).handleInput,tU=tx.getSpawnedResult,tj=tx.makeAllStream,tM=tx.validateInputSync,tF={};consttB=(async()=>{})().constructor.prototype,tG=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(tB,e)]);vartH=(tF={mergePromise:(e,t)=>{for(let[r,n]oftG){// Starting the main `promise` is deferred to avoid consuming streams
leti="function"==typeoft?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}returne;},getSpawnedPromise:e=>newPromise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error",e=>{r(e);}),e.stdin&&e.stdin.on("error",e=>{r(e);});})}).mergePromise,tV=tF.getSpawnedPromise,tq={};consttX=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],tK=/^[\w.-]+$/,tz=/"/g,tW=e=>"string"!=typeofe||tK.test(e)?e:`"${e.replace(tz,'\\"')}"`,tY=/ +/g;vartJ=(tq={joinCommand:(e,t)=>tX(e,t).join(" "),getEscapedCommand:(e,t)=>tX(e,t).map(e=>tW(e)).join(" "),parseCommand:e=>{lett=[];for(letrofe.trim().split(tY)){// Allow spaces to be escaped by a backslash if not meant as a delimiter
lete=t[t.length-1];e&&e.endsWith("\\")?t[t.length-1]=`${e.slice(0,-1)}${r}`:t.push(r);}returnt;}}).joinCommand,tQ=tq.parseCommand,tZ=tq.getEscapedCommand;constt0=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{leto=t?{...process.env,...e}:e;returnr?eI.env({env:o,cwd:n,execPath:i}):o;},t1=(e,t,r={})=>{letn=ec._parse(e,t,r);returne=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r}).env=t0(r),r.stdio=eJ(r),"win32"===process.platform&&"cmd"===h.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},t2=(e,t,r)=>"string"==typeoft||Buffer.isBuffer(t)?e.stripFinalNewline?eC(t):t:void0===r?void0:"",t4=(e,t,r)=>{letn;leti=t1(e,t,r),o=tJ(e,t),s=tZ(e,t);ty(i.options);try{n=$.spawn(i.file,i.args,i.options);}catch(r){// Ensure the returned error is always both a promise and a child process
lete=new$.ChildProcess(),t=Promise.reject(ek({error:r,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));returntH(e,t);}leta=tV(n),l=tv(n,i.options,a),c=tw(n,i.options,l),u={isCanceled:!1};n.kill=tm.bind(null,n.kill.bind(n)),n.cancel=tg.bind(null,n,u);letd=async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},l,d,p]=awaittU(n,i.options,c),f=t2(i.options,l),h=t2(i.options,d),m=t2(i.options,p);if(e||0!==t||null!==r){letl=ek({error:e,exitCode:t,signal:r,stdout:f,stderr:h,all:m,command:o,escapedCommand:s,parsed:i,timedOut:a,isCanceled:u.isCanceled,killed:n.killed});if(!i.options.reject)returnl;throwl;}return{command:o,escapedCommand:s,exitCode:0,stdout:f,stderr:h,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};},p=eR(d);returntD(n,i.options.input),n.all=tj(n,i.options),tH(n,p);};functiont3(){return(process.getuid?.()===0||!!process.env.CI)&&null!==/*@__PURE__*/B(ee).sync("sudo",{nothrow:!0});}functiont6(e,t=[],r={stdio:"inherit",shell:!0}){returnt3()?/*@__PURE__*/B(el).commandSync(`sudo ${[e,...t].map(e=>`'${e}'`).join(" ")}`,r):/*@__PURE__*/B(el).sync(e,t,r);}functiont5(e,t=[],r={stdio:"inherit",shell:!0}){returnt3()?/*@__PURE__*/B(el).command(`sudo ${[e,...t].map(e=>`'${e}'`).join(" ")}`,r):/*@__PURE__*/B(el)(e,t,r);}functiont8(e){returnt3()&&"string"==typeofprocess.env.SUDO_USER?// use the user profile even if root
${t}`,r_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),rO=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),rC=(e,t,r)=>{let n=""===r?"":`with${r.trim()}()`,i=r$.bind(null,n,t.toString());// Ensure `to.toString.toString` is non-enumerable and has the same `same`
Object.defineProperty(i,"name",rO),Object.defineProperty(e,"toString",{...r_,value:i});},rI=newWeakMap(),rT=(e,t={})=>{letr;if("function"!=typeofe)throwTypeError("Expected a function");letn=0,i=e.displayName||e.name||"<anonymous>",o=function(...s){if(rI.set(o,++n),1===n)r=e.apply(this,s),e=null;elseif(!0===t.throw)throwError(`Function \`${i}\` can only be called once`);returnr;};return!function(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(letnofReflect.ownKeys(t))rE(e,t,n,r);rS(e,t),rC(e,t,n);}(o,e),rI.set(o,n),o;};rT.callCount=e=>{if(!rI.has(e))throwError(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);returnrI.get(e);};constrR=()=>Array.from({length:rN-rA+1},rP),rP=(e,t)=>({name:`SIGRT${t+1}`,number:rA+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),rA=34,rN=64,rL=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminalwindowsizechang
${n.message}`:g,w=[y,t,e].filter(Boolean).join("\n");return v?(n.originalMessage=n.message,n.message=w):n=Error(w),n.shortMessage=y,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=f,n.stdout=e,n.stderr=t,n.cwd=p,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;},rH=["stdin","stdout","stderr"],rV=e=>rH.some(t=>void 0!==e[t]),rq=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return rH.map(t=>e[t]);if(rV(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${rH.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,rH.length);return Array.from({length:r},(e,r)=>t[r]);},rX=(e,t="SIGTERM",r={})=>{let n=e(t);return rK(e,t,r,n),n;},rK=(e,t,r,n)=>{if(!rz(t,r,n))return;let i=rY(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},rz=(e,{forceKillAfterTimeout:t},r)=>rW(e)&&!1!==t&&r,rW=e=>e===B(k).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),rY=({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;},rJ=(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},rQ=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},rZ=(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(()=>{rQ(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},r0=({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})`);},r1=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=/*@__PURE__*/B(e2)(()=>{e.kill();});return n.finally(()=>{i();});};function r2(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe;}function r4(e){return r2(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState;}const r3=e=>e instanceof A.ChildProcess&&"function"==typeof e.then,r6=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,S.createWriteStream)(r)),e;if(r4(r))return e[t].pipe(r),e;if(!r3(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!r4(r.stdin))throw TypeError("The target child process'sstdinmustbeavailable.");return e[t].pipe(r.stdin),r;},r5=e=>{null!==e.stdout&&(e.pipeStdout=r6.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=r6.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=r6.bind(void 0,e,"all"));},r8=e=>{if(void 0!==e)throw TypeError("The`input`and`inputFile`optionscannotbebothset.");},r7=({input:e,inputFile:t})=>"string"!=typeof t?e:(r8(e),(0,S.readFileSync)(t)),r9=e=>{let t=r7(e);if(r2(t))throw TypeError("The`input`optioncannotbeastreaminsyncmode");return t;},ne=({input:e,inputFile:t})=>"string"!=typeoft?e:(r8(e),(0,S.createReadStream)(t)),nt=(e,t)=>{letr=ne(t);void0!==r&&(r2(r)?r.pipe(e.stdin):e.stdin.end(r));},nr=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;letr=/*@__PURE__*/B(tP)();returne.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},nn=async(e,t)=>{// When `buffer` is `false`, `streamPromise` is `undefined` and there is no buffered data to retrieve
if(e&&void0!==t){e.destroy();try{returnawaitt;}catch(e){returne.bufferedData;}}},ni=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)returnt?/*@__PURE__*/B(tS)(e,{encoding:t,maxBuffer:n}):/*@__PURE__*/B(tS).buffer(e,{maxBuffer:n});},no=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{leta=ni(e,{encoding:n,buffer:i,maxBuffer:o}),l=ni(t,{encoding:n,buffer:i,maxBuffer:o}),c=ni(r,{encoding:n,buffer:i,maxBuffer:2*o});try{returnawaitPromise.all([s,a,l,c]);}catch(n){returnPromise.all([{error:n,signal:n.signal,timedOut:n.timedOut},nn(e,a),nn(t,l),nn(r,c)]);}},ns=(async()=>{})().constructor.prototype,na=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ns,e)]),nl=(e,t)=>{for(let[r,n]ofna){// Starting the main `promise` is deferred to avoid consuming streams
leti="function"==typeoft?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},nc=e=>newPromise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error",e=>{r(e);}),e.stdin&&e.stdin.on("error",e=>{r(e);});}),nu=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],nd=/^[\w.-]+$/,np=/"/g,nf=e=>"string"!=typeofe||nd.test(e)?e:`"${e.replace(np,'\\"')}"`,nh=(e,t)=>nu(e,t).join(" "),nm=(e,t)=>nu(e,t).map(e=>nf(e)).join(" "),ng=/ +/g,nv=e=>{lett=typeofe;if("string"===t)returne;if("number"===t)returnString(e);if("object"===t&&null!==e&&!(einstanceofA.ChildProcess)&&"stdout"ine){lett=typeofe.stdout;if("string"===t)returne.stdout;if((0,R.Buffer).isBuffer(e.stdout))returne.stdout.toString();throwTypeError(`Unexpected "${t}" stdout in template expression`);}throwTypeError(`Unexpected "${t}" in template expression`);},ny=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e[e.length-1]}${t[0]}`,...t.slice(1)],nw=({templates:e,expressions:t,tokens:r,index:n,template:i})=>{leto=i??e.raw[n],s=o.split(ng).filter(Boolean),a=ny(r,s,o.startsWith(" "));if(n===t.length)returna;letl=t[n],c=Array.isArray(l)?l.map(e=>nv(e)):[nv(l)];returnny(a,c,o.endsWith(" "));},nx=(e,t)=>{letr=[];for(let[n,i]ofe.entries())r=nw({templates:e,expressions:t,tokens:r,index:n,template:i});returnr;},nE=(0,D.debuglog)("execa").enabled,nb=(e,t)=>String(e).padStart(t,"0"),nS=()=>{lete=newDate();return`${nb(e.getHours(),2)}:${nb(e.getMinutes(),2)}:${nb(e.getSeconds(),2)}.${nb(e.getMilliseconds(),3)}`;},n$=(e,{verbose:t})=>{t&&B(N).stderr.write(`[${nS()}] ${e}
`);},n_=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...B(N).env,...e}:e;return r?function({env:e=B(N).env,...t}={}){e={...e};let r=rx({env:e});return t.path=e[r],e[r]=function(e={}){let t;let{cwd:r=B(N).cwd(),path:n=B(N).env[rx()],execPath:i=B(N).execPath}=e,o=r instanceof URL?B(L).fileURLToPath(r):r,s=B(P).resolve(o),a=[];for(;t!==s;)a.push(B(P).join(s,"node_modules/.bin")),t=s,s=B(P).resolve(s,"..");return(// Ensure the running `node` binary is used.
a.push(B(P).resolve(o,i,"..")),[...a,n].join(B(P).delimiter));}(t),e;}({env:o,cwd:n,execPath:i}):o;},nO=(e,t,r={})=>{letn=/*@__PURE__*/B(ec)._parse(e,t,r);returne=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||B(N).cwd(),execPath:B(N).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:nE,...r}).env=n_(r),r.stdio=rq(r),"win32"===B(N).platform&&"cmd"===B(P).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},nC=(e,t,r)=>"string"==typeoft||(0,R.Buffer).isBuffer(t)?e.stripFinalNewline?function(e){lett="string"==typeofe?"\n":"\n".charCodeAt(),r="string"==typeofe?"\r":"\r".charCodeAt();returne[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e;}(t):t:void0===r?void0:"";functionnI(e,t,r){letn;leti=nO(e,t,r),o=nh(e,t),s=nm(e,t);n$(s,i.options),r0(i.options);try{n=B(A).spawn(i.file,i.args,i.options);}catch(r){// Ensure the returned error is always both a promise and a child process
lete=new(B(A).ChildProcess)(),t=Promise.reject(rG({error:r,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));returnnl(e,t),e;}leta=nc(n),l=rZ(n,i.options,a),c=r1(n,i.options,l),u={isCanceled:!1};n.kill=rX.bind(null,n.kill.bind(n)),n.cancel=rJ.bind(null,n,u);letd=async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},l,d,p]=awaitno(n,i.options,c),f=nC(i.options,l),h=nC(i.options,d),m=nC(i.options,p);if(e||0!==t||null!==r){letl=rG({error:e,exitCode:t,signal:r,stdout:f,stderr:h,all:m,command:o,escapedCommand:s,parsed:i,timedOut:a,isCanceled:u.isCanceled||!!i.options.signal&&i.options.signal.aborted,killed:n.killed});if(!i.options.reject)returnl;throwl;}return{command:o,escapedCommand:s,exitCode:0,stdout:f,stderr:h,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};},p=rT(d);returnnt(n,i.options),n.all=nr(n,i.options),r5(n),nl(n,p),n;}functionnT(e,t,r){letn;leti=nO(e,t,r),o=nh(e,t),s=nm(e,t);n$(s,i.options);leta=r9(i.options);try{n=B(A).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throwrG({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}letl=nC(i.options,n.stdout,n.error),c=nC(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){lete=rG({stdout:l,stderr:c,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.error&&"ETIMEDOUT"===n.error.code,isCanceled:!1,killed:null!==n.signal});if(!i.options.reject)returne;throwe;}return{command:o,escapedCommand:s,exitCode:0,stdout:l,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};}constnR=({input:e,inputFile:t,stdio:r})=>void0===e&&void0===t&&void0===r?{stdin:"inherit"}:{},nP=(e={})=>({preferLocal:!0,...nR(e),...e});functionnA(t,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){returnnI(function(){if(void0===e){lett=/*@__PURE__*/B(ee).sync("pwsh",{nothrow:!0});null!==t&&(e=t);letr=/*@__PURE__*/B(ee).sync("powershell",{nothrow:!0});null!==r&&(e=r);}if(void0===e)throwError("Could not find powershell");returne;}(),[...r,"-c",t],n);}!functione(t){functionr(n,...i){if(!Array.isArray(n))returne({...t,...n});let[o,...s]=nx(n,i);returnnI(o,s,nP(t));}returnr.sync=(e,...r)=>{if(!Array.isArray(e))throwTypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...i]=nx(e,r);returnnT(n,i,nP(t));},r;}();varnN={};// to detect on with os user had used path.resolve(...)
constnL="win32"!==f.platform(),nk=f.release(),nD=/(\d+\.\d+)\.(\d+)/,nU=(e="",t="")=>/1\d+\.\d+/.test(e)&&Number(t)>=17134.1184;function nj(e){if(("linux"===process.platform||"darwin"===process.platform)&&t3()&&void 0!==process.env.SUDO_USER){let t=(0,m.statSync)(e).isDirectory();t6("chown",[...(t?["-R"]:[]),process.env.SUDO_USER,e],{cwd:e,stdio:"inherit",shell:!0});}}nN=function(e){return nL?e.replace(/(\s+)/g,"\\$1"):nU(...nD.exec(nk).splice(1))?e:e.replace(/(\s+)/g,"%20");};varnM={};// Generated by CoffeeScript 1.10.0
(function(){vare,t;e=q("awj79"),t=function(e){returne.split("").reverse().join("");},nM=function(r,n,i){varo;return(null==n&&(n="'"),null==i&&(i="\\"),"string"!=typeofr)?r:(o=RegExp("(["+e(n)+"])(?!"+e(i)+")","g"),t(t(r).replace(o,"$1"+i)));};}).call(nM);varnF=q("dOmbL");constnB={shouldEscapeSpace:!1,shouldAddOnlyIfNotDefined:!1};asyncfunctionnG(e,t,r=nB){letn=function(e,t=!1){letr=t?/*@__PURE__*/B(nN)(e):e;return/*@__PURE__*/B(nM)(r,'"',"\\");}(t??"",r.shouldEscapeSpace);try{if(X.GITHUB_ACTIONS)try{if(r.shouldAddOnlyIfNotDefined&&void0!==process.env[e]){(0,ry.info)(`Environment variable ${e} is already defined. Skipping.`);return;}(0,ry.exportVariable)(e,n);}catch(t){(0,K.error)(t),awaitnX(e,n,r);}elseawaitnX(e,n,r);}catch(t){(0,K.error)(t),(0,ry.setFailed)(`Failed to export environment variable ${e}=${n}. You should add it manually.`);}}constnH=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];asyncfunctionnV(e){if(!/** Skip adding /usr/bin to PATH if it is already there */function(e){if(nH.some(t=>t.test(e))){lett=process.env.PATH?.split(h.delimiter)??[];returnt.includes(e);}return!1;}(e)){process.env.PATH=`${e}${h.delimiter}${process.env.PATH}`;try{if(X.GITHUB_ACTIONS)try{(0,ry.addPath)(e);}catch(t){(0,K.error)(t),awaitnK(e);}elseawaitnK(e);}catch(t){(0,K.error)(t),(0,ry.setFailed)(`Failed to add ${e} to the percistent PATH. You should add it manually.`);}}}constnq=t8(".cpprc");asyncfunctionnX(e,t,r){letn=t??"";switch(process.platform){case"win32":if(r.shouldAddOnlyIfNotDefined&&void0!==process.env[e]){(0,ry.info)(`Environment variable ${e} is already defined. Skipping.`);return;}// We do not use `execaSync(`setx PATH "${path};%PATH%"`)` because of its character limit
awaitnA(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),(0,ry.info)(`${e}='${n}' was set in the environment.`);return;case"linux":case"darwin":awaitnW(),r.shouldAddOnlyIfNotDefined?((0,m.appendFileSync)(nq,`
`),(0,ry.info)(`${e}="${n}"wasaddedto"${nq}`));return;}process.env[e]=n;}async function nK(e){switch(process.platform){case"win32":// We do not use `execaSync(`setx PATH "${path};%PATH%"`)`becauseofitscharacterlimitandalsobecause%PATH%isdifferentforuserandsystem
awaitnA(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,ry.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":awaitnW(),(0,m.appendFileSync)(nq,`
`),(0,ry.info)(`"${e}"wasaddedto"${nq}"`);return;default:return;}}/* eslint-disable require-atomic-updates */let nz=!1;async function nW(){if(nz)return;// a variable that prevents source_cpprc from being called from .bashrc and .profile
lete="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";if(await(0,nF.pathExists)(nq)){lett=(0,m.readFileSync)(nq,"utf8");if(t.includes(e))return;}(0,m.appendFileSync)(nq,`
lete=t8(".profile");(0,m.appendFileSync)(e,t),(0,ry.info)(`${t} was added to ${e}`);// source cpprc in .bashrc too
letr=t8(".bashrc");(0,m.appendFileSync)(r,t),(0,ry.info)(`${t} was added to ${r}`);}catch(e){(0,K.warning)(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${e}`);}nz=!0;}asyncfunctionnY(){if(await(0,nF.pathExists)(nq)){lete=(0,m.readFileSync)(nq,"utf-8").split("\n"),t=[...newSet(e.reverse())].reverse()// remove duplicates, keeping the latest entry
*/const n6=async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return n7(await(0,U.stat)(e),e,t);}catch(e){if(r||"EACCES"===e.code)return!1;throw e;}},n5=(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return n7((0,m.statSync)(e),e,t);}catch(e){if(r||"EACCES"===e.code)return!1;throw e;}},n8=(e,t)=>{let{pathExt:r=process.env.PATHEXT||""}=t,n=r.split(";");if(-1!==n.indexOf(""))return!0;for(let t=0;t<n.length;t++){let r=n[t].toLowerCase(),i=e.substring(e.length-r.length).toLowerCase();if(r&&i===r)return!0;}return!1;},n7=(e,t,r)=>e.isFile()&&n8(t,r),n9=process.env._ISEXE_TEST_PLATFORM_||process.platform,ie="win32"===n9?n3:nZ,it=ie.isexe,ir=ie.sync;var ii=h.join,io=h.delimiter,is=h.sep,ia=h.posix;const il="win32"===process.platform,ic=new RegExp(`[${ia.sep}${is===ia.sep?"":is}]`.replace(/(\\)/g,"\\$1")),iu=RegExp(`^\\.${ic.source}`),id=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),ip=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=io})=>{// If it has a slash, then we don't bother searching the pathenv.
// just check the file itself, and that's it.
leti=e.match(ic)?[""]:[// windows always checks the cwd first
...(il?[process.cwd()]:[]),...(t||/* istanbul ignore next: very unusual */"").split(n)];if(il){lett=r||[".EXE",".CMD",".BAT",".COM"].join(n),o=t.split(n).flatMap(e=>[e,e.toLowerCase()]);returne.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t};}return{pathEnv:i,pathExt:[""]};},ih=(e,t)=>{letr=/^".*"$/.test(e)?e.slice(1,-1):e,n=!r&&iu.test(t)?t.slice(0,2):"";returnn+ii(r,t);},im=async(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=ip(e,t),o=[];for(letsofr){letr=ih(s,e);for(leteofn){letn=r+e,s=awaitit(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)returnn;o.push(n);}}}if(t.all&&o.length)returno;if(t.nothrow)returnnull;throwid(e);};nQ=im,im.sync=(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=ip(e,t),o=[];for(letsofr){letr=ih(s,e);for(leteofn){letn=r+e,s=ir(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)returnn;o.push(n);}}}if(t.all&&o.length)returno;if(t.nothrow)returnnull;throwid(e);};const{appendFile:ig}=m.promises;/* eslint-disable require-atomic-updates */letiv=!1,iy=!1;constiw=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];asyncfunctionix(e,t=!1){letr=iS()?"nala":"apt-get";for(let{name:t,version:n}ofe)(0,K.info)(`Installing ${t}${n??""} via ${r}`);process.env.DEBIAN_FRONTEND="noninteractive",(!iv||t)&&(i$(r),iv=!0),iy||(awaiti_(r),iy=!0);letn=[...newSet(e.flatMap(e=>e.repositories??[]))];if(0!==n.length){for(leteofn)t6("add-apt-repository",["-y",e]);i$(r);}leti=awaitPromise.all(e.map(e=>ib(e.name,e.version)));try{t6(r,["install","--fix-broken","-y",...i]);}catch(e){if("stderr"ine){lett=e.stderr;iw.some(e=>t.includes(e))&&((0,K.warning)(`Failed to install packages ${i}. Retrying...`),t6(r,["install","--fix-broken","-y",...i]));}elsethrowe;}return{binDir:"/usr/bin/"};}asyncfunctioniE(e,t){if(void0!==t&&""!==t){let{stdout:r}=awaitnI("apt-cache",["search","--names-only",`^${(0,nJ.default)(e)}-${(0,nJ.default)(t)}$`]);if(""!==r.trim())returnu.NameDashVersion;try{// check if apt-get show can find the version
}returnu.None;}asyncfunctionib(e,t){letr=awaitiE(e,t);switch(r){caseu.NameDashVersion:return`${e}-${t}`;caseu.NameEqualsVersion:return`${e}=${t}`;caseu.Name:returne;caseu.None:default:throwError(`Could not find package ${e}${t??""}`);}}functioniS(){returnnull!==/*@__PURE__*/B(nQ).sync("nala",{nothrow:!0});}functioni$(e){t6(e,"nala"!==e?["update","-y"]:["update"]);}/** Install apt utils and certificates (usually missing from docker containers) */asyncfunctioni_(e){t6(e,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]);lett=[iC(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),iC(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(nG("LANG","C.UTF-8",{shouldAddOnlyIfNotDefined:!0}),nG("LC_ALL","C.UTF-8",{shouldAddOnlyIfNotDefined:!0})),awaitPromise.all(t);}functioniO(){t6("gpg",["-k"]);}asyncfunctioniC(e,t,r="keyserver.ubuntu.com"){try{letn=`/etc/apt/trusted.gpg.d/${t}`;return(await(0,nF.pathExists)(n))||(iO(),awaitPromise.all(e.map(asynce=>{awaitt5("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--keyserver",r,"--recv-keys",e]),awaitt5("chmod",["644",n]);}))),n;}catch(e){(0,K.warning)(`Failed to add apt key via server ${r}: ${e}`);return;}}asyncfunctioniI(e,t){letr=`/etc/apt/trusted.gpg.d/${e}`;return(await(0,nF.pathExists)(r))||(iO(),awaitix([{name:"curl"},{name:"ca-certificates"}],void0),awaitnI("curl",["-s",t,"-o",`/tmp/${e}`]),t6("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${r}`,"--import",`/tmp/${e}`]),t6("chmod",["644",r])),r;}asyncfunctioniT(e,t){returnX.GITHUB_ACTIONS?t5("update-alternatives",["--install",`/usr/bin/${e}`,e,t,"40"]):(awaitnW(),ig(nq,`
`));}async function iR(e){try{// check if a package matching the regexp is installed
let{stdout:t}=awaitnI("dpkg",["-l",e]),r=t.split("\n");// check if the output contains any lines that start with "ii"
returnr.some(e=>e.startsWith("ii"));}catch{return!1;}}(l=u||(u={}))[l.NameDashVersion=0]="NameDashVersion",l[l.NameEqualsVersion=1]="NameEqualsVersion",l[l.Name=2]="Name",l[l.None=3]="None";/* eslint-disable require-atomic-updates */varry=q("lcRzN"),iP=(q("ceI0e"),q("ceI0e")),iA=q("fcBgE");asyncfunctioniN(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeoft)return{binDir:t};leti=/*@__PURE__*/B(nQ).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,iP.dirname)(i)};// brew is not thread-safe
leto=B(h).join((0,f.tmpdir)(),"setup-cpp","brew");await(0,iA.mkdirP)(o),nT("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});lets=(0,h.join)(o,"install.sh");if("linux"===process.platform){lete=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}returnnT("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=iL(),awaitnV(t),{binDir:t};}functioniL(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}letik=!1;asyncfunctioniD(e,t,r=[]){(0,ry.info)(`Installing ${e}${t??""} via brew`),ik&&null!==/*@__PURE__*/B(nQ).sync("brew",{nothrow:!0})||(awaitiN("","",process.arch),ik=!0);letn=iL();returnnT((0,iP.join)(n,"brew"),["install",void0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}/* eslint-disable require-atomic-updates *//* eslint-disable require-atomic-updates */varnF=q("dOmbL"),iP=q("ceI0e");asyncfunctioniU(e,t,n){if("win32"!==process.platform)return;if("string"==typeofr)return{binDir:r};leti=/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0});if(null!==i)return{binDir:r=(0,iP.dirname)(i)};leto="powershell.exe",s=/*@__PURE__*/B(nQ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==s&&(o=s),nT(o,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});leta=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;awaitnV(a);letl=/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0});if(r=null!==l?(0,iP.dirname)(l):`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await(0,nF.pathExists)(r))return{binDir:r};}varry=q("lcRzN"),K=q("ER74K");letij=!1;asyncfunctioniM(e,t,r=[]){(0,ry.info)(`Installing ${e}${t??""} via chocolatey`),ij&&null!==/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0})||(awaitiU("","",process.arch),ij=!0);// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
letn=process.env.PATH,i={...process.env};if(deletei.TMP,deletei.TEMP,deletei.Path,i.PATH=n,void0!==t&&""!==t)nT("choco",["install","-y",e,`--version=${t}`,...r],{env:i,extendEnv:!1,stdio:"inherit"});elsetry{nT("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"});}catch(t){// if the package requires a reboot, downgrade the error to a notice
if(t.message.includes("exit code 3010"))(0,K.notice)(`${e} might require a reboot for the completion of the installation.`);elsethrowt;}leto=`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`;returnawaitnV(o),{binDir:o};}functioniF(){return"linux"===process.platform&&(void0===o&&(o=null!==/*@__PURE__*/B(nQ).sync("pacman",{nothrow:!0})),o);}functioniB(){return"linux"===process.platform&&(void0===s&&(s=null!==/*@__PURE__*/B(nQ).sync("dnf",{nothrow:!0})),s);}asyncfunctioniG(e){for(let{name:t,version:r}ofe)(0,K.info)(`Installing ${t}${r??""} via dnf`);lett=awaitPromise.all(e.map(e=>iH(e.name,e.version)));returnt6("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}asyncfunctioniH(e,t){if(void0!==t&&""!==t){// check if name-version is available
let{stdout:r}=awaitnI("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{// try with ${name}${version}
let{stdout:r}=awaitnI("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;(0,K.warning)(`Failed to install ${e}${t} via dnf, trying without version`);}}returne;}functioniV(){return"linux"===process.platform&&(void0===a&&(a=null!==/*@__PURE__*/B(nQ).sync("apt-get",{nothrow:!0})),a);}asyncfunctioniq(e,t,r){switch(process.platform){case"win32":// install bazelisk because it contains both
returniM("bazelisk",e);case"darwin":// install bazelisk because it contains both
returniD("bazelisk",e);case"linux":if(iF())throwError("installing bazel on Arch linux is not supported yet");if(iB())return(// https://bazel.build/install/redhat
lett=awaitiI("bazel-archive-keyring.gpg","https://bazel.build/bazel-release.pub.gpg");returnt6("bash",["-c",`echo "deb [arch=amd64 signed-by=${t}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),ix([{name:"bazel",version:e}],!0);}throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}varK=(q("ER74K"),q("ER74K"));/* eslint-disable require-atomic-updates */letiX=!1,iK=!1;asyncfunctioniz(e,t,r){(0,K.info)(`Installing ${e}${t??""} via pacman`);letn="pacman";if("yay"===r&&null===/*@__PURE__*/B(nQ).sync("yay",{nothrow:!0}))throwError(`yay is needed for ${e}, but it is not installed, please install it manually first`);iX||"yay"===r||(t6(n,["-Sy","--noconfirm"]),iX=!0),iK||"yay"===r||(t6(n,["-S","--noconfirm","base-devel"]),iK=!0);leti=e=>"yay"===r?nT(r,["-S","--noconfirm",e]):t6(r??n,["-S","--noconfirm",e]);if(void0!==t&&""!==t){// check if version is available
letr=awaitiY(n,e);if(r.includes(t))try{i(`${e}=${t}`);}catch{i(`${e}${t}`);}else// try without version
(0,K.info)(`Failed to install ${e}${t} via pacman, trying without version`),i(e);}elsei(e);return{binDir:"/usr/bin/"};}constiW=/Version\s*:\s*(.*)/g;/** Query pacman for available versions */asyncfunctioniY(e,t){letr=[];try{let{stdout:n}=awaitnI(e,["-Si",t]);for(leteofn.matchAll(iW))r.push(e[1]);}catch(e){(0,K.warning)(`Failed to get available versions for ${t}: ${e}`);}returnr;}variJ={},iQ=h.resolve(__dirname,"../../node_modules/.pnpm/@actions+tool-cache@2.0.1/node_modules/@actions/tool-cache/lib"),iZ=iJ&&iJ.__createBinding||(Object.create?function(e,t,r,n){void0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){returnt[r];}});}:function(e,t,r,n){void0===n&&(n=r),e[n]=t[r];}),i0=iJ&&iJ.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i1=iJ&&iJ.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varrine)"default"!==r&&Object.hasOwnProperty.call(e,r)&&iZ(t,e,r);returni0(t,e),t;},i2=iJ&&iJ.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(i,o){functions(e){try{l(n.next(e));}catch(e){o(e);}}functiona(e){try{l(n.throw(e));}catch(e){o(e);}}functionl(e){vart;e.done?i(e.value):((t=e.value)instanceofr?t:newr(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});},i4=iJ&&iJ.__importDefault||function(e){returne&&e.__esModule?e:{default:e};};Object.defineProperty(iJ,"__esModule",{value:!0}),iJ.evaluateVersions=iJ.isExplicitVersion=iJ.findFromManifest=iJ.getManifestFromRepo=iJ.findAllVersions=iJ.find=iJ.cacheFile=iJ.cacheDir=iJ.extractZip=iJ.extractXar=iJ.extractTar=iJ.extract7z=iJ.downloadTool=iJ.HTTPError=void0;consti3=i1(q("lcRzN")),i6=i1(q("fcBgE")),i5=i1(m),i8=i1(q("ktIRP")),i7=i1(f),i9=i1(h),oe=i1(q("iC7fc")),ot=i1(q("lJEXJ")),or=i1(I),on=i1(b),oi=i4(q("dGCqI"));varoo=q("jlr6Q"),os={},oa=os&&os.__createBinding||(Object.create?function(e,t,r,n){void0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){returnt[r];}});}:function(e,t,r,n){void0===n&&(n=r),e[n]=t[r];}),ol=os&&os.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),oc=os&&os.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varrine)"default"!==r&&Object.hasOwnProperty.call(e,r)&&oa(t,e,r);returnol(t,e),t;},ou=os&&os.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(i,o){functions(e){try{l(n.next(e));}catch(e){o(e);}}functiona(e){try{l(n.throw(e));}catch(e){o(e);}}functionl(e){vart;e.done?i(e.value):((t=e.value)instanceofr?t:newr(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});};Object.defineProperty(os,"__esModule",{value:!0}),os.RetryHelper=void0;constod=oc(q("lcRzN"));os.RetryHelper=/**
*Internalclassforretries
*/class{constructor(e,t,r){if(e<1)throw Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw Error("min seconds should be less than or equal to max seconds");}execute(e,t){return ou(this,void 0,void 0,function*(){let r=1;for(;r<this.maxAttempts;){//Try
leti=newoe.HttpClient("actions/tool-cache",[],{allowRetries:!1});r&&(i3.debug("set auth"),void0===n&&(n={}),n.authorization=r);leto=yieldi.get(e,n);if(200!==o.message.statusCode){lett=newop(o.message.statusCode);throwi3.debug(`Failed to download from "${e}". Code(${o.message.statusCode}) Message(${o.message.statusMessage})`),t;}// Download the response body
lets=on.promisify(or.pipeline),a=oS("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>o.message),l=a(),c=!1;try{returnyields(l,i5.createWriteStream(t)),i3.debug("download complete"),c=!0,t;}finally{// Error, delete dest before retry
if(!c){i3.debug("download failed");try{yieldi6.rmRF(t);}catch(e){i3.debug(`Failed to delete '${t}'. ${e.message}`);}}}});}(e,t||"",r,n);}),e=>!(einstanceofop)||!e.httpStatusCode||!(e.httpStatusCode<500)||408===e.httpStatusCode||429===e.httpStatusCode);});},iJ.extract7z=/**
*/function(e,t,r){return i2(this,void 0,void 0,function*(){E.ok(of,"extract7z() not supported on current OS"),E.ok(e,'parameter "file" is required'),t=yield og(t);let n=process.cwd();if(process.chdir(t),r)try{let t=i3.isDebug()?"-bb1":"-bb0",n=["x",t,"-bd","-sccUTF-8",e];yield oo.exec(`"${r}"`,n,{silent:!0});}finally{process.chdir(n);}else{let r=i9.join(iQ,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),i=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),s=`& '${r}' -Source '${i}' -Target '${o}'`;// double-up single quotes, remove double quotes and newlines
*/function(e,t,r="xz"){return i2(this,void 0,void 0,function*(){let n;if(!e)throw Error("parameter 'file' is required");//Createdest
t=yieldog(t),// Determine whether GNU tar
i3.debug("Checking tar --version");leti="";yieldoo.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:e=>i+=e.toString(),stderr:e=>i+=e.toString()}}),i3.debug(i.trim());leto=i.toUpperCase().includes("GNU TAR");n=rinstanceofArray?r:[r],i3.isDebug()&&!r.includes("v")&&n.push("-v");lets=t,a=e;returnof&&o&&(n.push("--force-local"),s=t.replace(/\\/g,"/"),// Technically only the dest needs to have `/` but for aesthetic consistency
// convert slashes in the file arg too.
a=e.replace(/\\/g,"/")),o&&(// Suppress warnings when using GNU tar to extract archives created by BSD tar
letr=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),n=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=yieldi6.which("pwsh",!1);// double-up single quotes, remove double quotes and newlines
//To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
//and the -Force flag for Expand-Archive as a fallback
if(i){//attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
*/function(e,t,r,n){return i2(this,void 0,void 0,function*(){if(r=ot.clean(r)||r,n=n||i7.arch(),i3.debug(`Caching tool ${t} ${r} ${n}`),i3.debug(`source dir: ${e}`),!i5.statSync(e).isDirectory())throw Error("sourceDir is not a directory");//Createthetooldir
leti=yieldov(t,r,n);// copy each child item. do not move. move can fail on Windows
// due to anti-virus software having an open handle on a file.
*/function(e,t,r,n,i){return i2(this,void 0,void 0,function*(){if(n=ot.clean(n)||n,i=i||i7.arch(),i3.debug(`Caching tool ${r} ${n} ${i}`),i3.debug(`source file: ${e}`),!i5.statSync(e).isFile())throw Error("sourceFile is not a file");//createthetooldir
*/function(e,t,r){if(!e)throw Error("toolName parameter is required");if(!t)throw Error("versionSpec parameter is required");//attempttoresolveanexplicitversion
if(r=r||i7.arch(),!ow(t)){letn=om(e,r),i=ox(n,t);t=i;}// check for the explicit version in the cache
letn="";if(t){t=ot.clean(t)||"";leti=i9.join(oE(),e,t,r);i3.debug(`checking cache: ${i}`),i5.existsSync(i)&&i5.existsSync(`${i}.complete`)?(i3.debug(`Found tool in cache ${e}${t}${r}`),n=i):i3.debug("not found");}returnn;},iJ.findAllVersions=om,iJ.getManifestFromRepo=function(e,t,r,n="master"){returni2(this,void0,void0,function*(){leti=[],o=`https://api.github.com/repos/${e}/${t}/git/trees/${n}`,s=newoe.HttpClient("tool-cache"),a={};r&&(i3.debug("set auth"),a.authorization=r);letl=yields.getJson(o,a);if(!l.result)returni;letc="";for(leteofl.result.tree)if("versions-manifest.json"===e.path){c=e.url;break;}a.accept="application/vnd.github.VERSION.raw";letu=yield(yields.get(c,a)).readBody();if(u){// shouldn't be needed but protects against invalid json saved with BOM
u=u.replace(/^\uFEFF/,"");try{i=JSON.parse(u);}catch(e){i3.debug("Invalid json");}}returni;});},iJ.findFromManifest=function(e,t,r,n=i7.arch()){returni2(this,void0,void0,function*(){// wrap the internal impl
leti=yieldi8._findMatch(e,t,r,n);returni;});},iJ.isExplicitVersion=ow,iJ.evaluateVersions=ox;varo$=q("1ndHP"),o_=q("9hSY8"),iP=q("ceI0e"),K=q("ER74K"),X=q("dTX7a"),nF=q("dOmbL"),oO={};Object.defineProperty(oO,"__esModule",{value:!0}),oO.retryAsPromised=oO.TimeoutError=void0;classoCextendsError{constructor(e,t){super(e),this.name="TimeoutError",this.previous=t;}}functionoI(e,t){if(!e||!t)throwError("retry-as-promised must be passed a callback and a options set");t="number"==typeoft?{max:t}:t;letr={$current:"$current"int?t.$current:1,max:t.max,timeout:t.timeout||void0,match:t.match?Array.isArray(t.match)?t.match:[t.match]:[],backoffBase:void0===t.backoffBase?100:t.backoffBase,backoffExponent:t.backoffExponent||1.1,report:t.report,name:t.name||e.name||"unknown"};returnr.match&&!Array.isArray(r.match)&&(r.match=[r.match]),r.report&&r.report("Trying "+r.name+" #"+r.$current+" at "+newDate().toLocaleTimeString(),r),newPromise(function(t,n){leti,o,s;r.timeout&&(i=setTimeout(function(){o&&clearTimeout(o),n(newoC(r.name+" timed out",s));},r.timeout)),Promise.resolve(e({current:r.$current})).then(t).then(function(){i&&clearTimeout(i),o&&clearTimeout(o);}).catch(function(a){i&&clearTimeout(i),o&&clearTimeout(o),s=a,r.report&&r.report(a&&a.toString()||a,r,a);// Should not retry if max has been reached
varl=r.$current<r.max;if(!l||!(l=0===r.match.length||r.match.some(function(e){returnfunction(e,t){if("function"==typeofe)try{if(tinstanceofe)return!0;}catch(r){return!!e(t);}returne===t.toString()||e===t.message||einstanceofRegExp&&(e.test(t.message)||e.test(t.toString()));}(e,a);})))returnn(a);varc=r.backoffBase*Math.pow(r.backoffExponent,r.$current-1);// Do some accounting
r.$current++,r.report&&r.report(`Retrying ${r.name} (${r.$current})`,r),c?(r.report&&r.report(`Delaying retry of ${r.name} by ${c}`,r),o=setTimeout(function(){oI(e,r).then(t).catch(n);},c)):oI(e,r).then(t).catch(n);});});}oO.TimeoutError=oC,oO.retryAsPromised=oI,oO.default=oI;letoT=!1;asyncfunctionoR(e,t,r,n,i){(0,K.info)(`Installing ${e}${t}${i} via direct downloading`),process.env.RUNNER_TEMP=process.env.RUNNER_TEMP??(0,f.tmpdir)(),process.env.RUNNER_TOOL_CACHE=process.env.RUNNER_TOOL_CACHE??(0,iP.join)((0,f.tmpdir)(),"setup-cpp","hostedtoolcache");let{url:o,binRelativeDir:s,binFileName:a,extractedFolderName:l,extractFunction:c}=awaitr(t,process.platform,i);// Restore from cache (if found).
if(X.GITHUB_ACTIONS)try{letr=(0,iJ.find)(e,t);if(r){letn=(0,iP.join)(r,l),i=(0,iP.join)(n,s);if(await(0,nF.pathExists)((0,iP.join)(i,a)))return(0,K.info)(`${e}${t} was found in the cache at ${i}.`),awaitnV(i),{installDir:n,binDir:i};}}catch{// fails on a local machine?
}letu=(0,iP.join)(n,l),d=(0,iP.join)(u,s),p=(0,iP.join)(d,a);// download ane extract the package into the installation directory.
if((awaitPromise.all([(0,nF.pathExists)(d),(0,nF.pathExists)(p)])).includes(!1))try{(0,K.info)(`Download ${e}${t}`);// try to download the package 4 times with 2 seconds delay
oT=!0),(0,K.info)(`Extracting ${r} to ${n}`),awaitc?.(r,n);// if (typeof extractedBinDir === "string") {
// binDir = extractedBinDir
// installDir = extractedBinDir
// }
}catch(r){throwError(`Failed to download ${e}${t}${i} from ${o}: ${r}`);}return(// Adding the bin dir to the path
/** The directory which the tool is installed to */(0,K.info)(`Add ${d} to PATH`),awaitnV(d),X.GITHUB_ACTIONS&&"string"==typeofprocess.env.RUNNER_TOOL_CACHE&&(await(0,iJ.cacheDir)(n,e,t)),{installDir:u,binDir:d});}variP=q("ceI0e"),iA=q("fcBgE");functionoP(e,t,r){switch(process.platform){case"win32":returniM("7zip",e);case"darwin":returniD("p7zip",e);case"linux":if(iF())returniz("p7zip",e);if(iB())returniG([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(iV())returnix([{name:"p7zip-full",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}varK=q("ER74K");asyncfunctionoA(e,t){returnawaitnI(awaitoN(),["x",e,`-o${t}`,"-y"],{stdio:"inherit"}),nj(t),t;}/// install 7z if needed
try{awaitnI("tar",["xf",e,"-C",t,...r],{stdio:"inherit"});}catch(r){"win32"===process.platform&&r.message.includes("Can't create '\\\\?\\C:")&&(0,K.warning)(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`);}returnnj(t),t;}/** Get the platform data for cmake */functionoU(e,t,r){letn=/*@__PURE__*/B(o_)(e)??e;switch(t){case"win32":{lett;leti=/*@__PURE__*/B(o$)(n,"v3.19.6");t=["ia32","x86","i386","x32"].includes(r)?i?"win32-x86":"windows-i386":i?"win64-x64":"windows-x86_64";leto=`cmake-${e}-${t}`;return{binRelativeDir:"bin/",binFileName:(0,iP.addExeExt)("cmake"),extractedFolderName:o,extractFunction:ok,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${o}.zip`};}case"darwin":{lett=/*@__PURE__*/B(o$)(n,"v3.19.1"),r=`cmake-${e}-${t?"Darwin-x86_64":"macos-universal"}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:(0,iP.addExeExt)("cmake"),extractedFolderName:r,extractFunction:iJ.extractTar,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${r}.tar.gz`};}case"linux":{lett;leti=/*@__PURE__*/B(o$)(n,"v3.19.8");t=["aarch64"].includes(r)?i?"Linux-aarch64":"linux-aarch64":i?"Linux-x86_64":"linux-x86_64";leto=`cmake-${e}-${t}`;return{binRelativeDir:"bin/",binFileName:(0,iP.addExeExt)("cmake"),extractedFolderName:o,extractFunction:iJ.extractTar,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${o}.tar.gz`};}default:throwError(`Unsupported platform '${t}'`);}}functionoj(e,t,r){returnoR("cmake",e,oU,t,r);}varry=q("lcRzN"),nF=q("dOmbL"),iP=q("ceI0e"),oo=q("jlr6Q"),X=q("dTX7a"),K=q("ER74K"),oM={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},oF=Array.prototype.slice;/**
*/e.prototype.updateAsyncCache=function(e){var t=this,r=this.options,n=r.onCacheChange,i=r.onCacheHit,o=this.keys[0],s=this.values[0];this.values[0]=s.then(function(r){return t.shouldUpdateOnHit&&i(t,t.options,e),t.shouldUpdateOnChange&&n(t,t.options,e),r;},function(e){var r=t.getKeyIndex(o);throw-1!==r&&(t.keys.splice(r,1),t.values.splice(r,1)),e;});},e;}();function oq(e,t){if(void 0===t&&(t={}),"function"==typeof e&&e.isMemoized)return oq(e.fn,oH(e.options,t));if("function"!=typeof e)throw TypeError("You must pass a function to `memoize`.");var r=t.isEqual,n=t.isMatchingKey,i=t.isPromise,o=void 0!==i&&i,s=t.maxSize,a=t.onCacheAdd,l=t.onCacheChange,c=t.onCacheHit,u=t.transformKey,d=oH({isEqual:void 0===r?oG:r,isMatchingKey:n,isPromise:o,maxSize:void 0===s?1:s,onCacheAdd:a,onCacheChange:l,onCacheHit:c,transformKey:u},/**
*@functiongetCustomOptions
*
*@description
*getthecustomoptionsontheobjectpassed
*
*@paramoptionsthememoizationoptionspassed
*@returnsthecustomoptionspassed
*/function(e){var t={};/*eslint-disableno-restricted-syntax*/for(var r in e)oM[r]||(t[r]=e[r]);/*eslint-enable*/return t;}(t)),p=new oV(d),f=p.keys,h=p.values,m=p.canTransformKey,g=p.shouldCloneArguments,v=p.shouldUpdateOnAdd,y=p.shouldUpdateOnChange,w=p.shouldUpdateOnHit,x=function(){var t=g?oB(arguments):arguments;m&&(t=u(t));var r=f.length?p.getKeyIndex(t):-1;if(-1!==r)w&&c(p,d,x),r&&(p.orderByLru(f[r],h[r],r),y&&l(p,d,x));else{var n=e.apply(this,arguments),i=g?t:oB(arguments);p.orderByLru(i,n,f.length),o&&p.updateAsyncCache(x),v&&a(p,d,x),y&&l(p,d,x);}return h[0];};return x.cache=p,x.fn=e,x.isMemoized=!0,x.options=d,x;}var iP=q("ceI0e");function oX(e,t){return new Promise(r=>{try{let n=(0,y.request)(e,{method:t},e=>{r(void 0!==e.statusCode&&e.statusCode>=200&&e.statusCode<=399);});n.on("error",e=>{r(!1);}),n.end();}catch{r(!1);}});}var oK=e=>{if("string"!=typeof e)return!1;let t=e.trim();if(t.includes(" "))return!1;try{return new j.URL(t),!0;}catch{return!1;}},oz=async e=>{let t=oK(e);if(!t)return!1;let r=await oX(e,"HEAD");return!!r||!!(r=await oX(e,"GET"));},oW=q("3Z6CK"),o_=q("9hSY8"),oY=q("eJTZB"),oo=q("jlr6Q"),K=q("ER74K");function oJ(e,t){return Array.from(e).filter(e=>/^\d+\.\d+\.\d+$/.test(e)&&e.startsWith(t)).sort((e,t)=>{try{return/*@__PURE__*/B(oW)(e,t);}catch(r){returne.localeCompare(t);}}).reverse();}asyncfunctionoQ(e,t,r,n){// specific ubuntu version
if(null!==e&&(awaitoz(e)))return[r,e];}// if the given set doesn't include the version, throw an error
if(!e.has(r))throwError(`Unsupported target! (platform='${t}', version='${r}'). Try one of the following: ${JSON.stringify(e)}`);leti=[];// TODO use Promise.any
if(awaitoz(e))return[o,e];i.push(e);}}throwError(`Unsupported target! (platform='${t}', version='${r}'). Try one of the following: ${JSON.stringify(e)}`);}constoZ=/v?(\d\S*)/;asyncfunctiono0(e,t=oZ){try{letr=await(0,oo.getExecOutput)(e,["--version"]),n=r.stdout||r.stderr||"",i=n.trim().match(t)?.[1];return/*@__PURE__*/B(o_)(i)??void0;}catch(e){console.error(e);return;}}asyncfunctiono1(e,t,r=oZ){letn=awaito0(e,r);returnvoid0!==n&&""!==t&&-1!==/*@__PURE__*/B(oW)(n,t);}// passing "" to a tool installed by a package manager (apt, brew, choco) will result in the default version of that package manager.
// the directly downloaded tools require a given version ("" doesn't work).
functiono2(){switch(process.platform){case"win32":default:return"16.0.6";case"linux":// used for non-ubuntu (Fedora, Arch)
return"16.0.4-ubuntu-22.04";case"darwin":return"15.0.3";}}consto4={llvm:o2(),clangtidy:o2(),clangformat:o2(),ninja:"1.11.1",cmake:"3.27.4",gcovr:"6.0",conan:"1.60.2",meson:"1.2.1",kcov:"42",task:"3.29.1",doxygen:iF()?"1.9.8-1":"1.9.8",gcc:iF()?"13.2.1-3":"13"},o3={pip:"22.2.0",python:"3.7.9"},o6={gcc:{22:"13",20:"11",18:"11",16:"11",14:"11"},mingw:{22:"8.0.0-1",20:"7.0.0-2"},llvm:{22:"16.0.4-ubuntu-22.04",20:"16.0.4-ubuntu-22.04",18:"15.0.6-ubuntu-18.04",16:"15.0.6-ubuntu-18.04",14:"13.0.0-ubuntu-16.04"},clangtidy:{22:"16.0.4-ubuntu-22.04",20:"16.0.4-ubuntu-22.04",18:"15.0.6-ubuntu-18.04",16:"15.0.6-ubuntu-18.04",14:"13.0.0-ubuntu-16.04"},clangformat:{22:"16.0.4-ubuntu-22.04",20:"16.0.4-ubuntu-22.04",18:"15.0.6-ubuntu-18.04",16:"15.0.6-ubuntu-18.04",14:"13.0.0-ubuntu-16.04"},gcovr:{22:"6.0",20:"6.0",18:"5.0"},meson:{20:"1.0.0",18:"0.61.4"},nala:{22:"",21:"legacy",20:"legacy",18:"legacy",16:"legacy",14:"legacy"},kcov:{22:"42-binary",20:"40-binary",18:"40",16:"40",14:"40"}};varnF=q("dOmbL");asyncfunctiono5(e,t,r){letn=awaito9(e,t,r);B(E)(void0!==n.bin);leti=n.bin,o=awaitsn(i);if(void0===o)throwError("pip was not installed correctly");returnawaito8(i),awaito7(i),n;}asyncfunctiono8(e){try{(awaitsw(e))||(awaitsy(e,"pipx",void0,{upgrade:!0,usePipx:!1})),awaitnI(e,["-m","pipx","ensurepath"],{stdio:"inherit"});}catch(e){(0,K.warning)(`Failed to install pipx: ${e.toString()}. Ignoring...`);}}/** Setup wheel and setuptools */asyncfunctiono7(e){try{awaitsy(e,"setuptools",void0,{upgrade:!0,isLibrary:!0,usePipx:!1}),awaitsy(e,"wheel",void0,{upgrade:!0,isLibrary:!0,usePipx:!1});}catch(e){(0,K.warning)(`Failed to install setuptools or wheel: ${e.toString()}. Ignoring...`);}}asyncfunctiono9(e,t,r){letn;leti=awaitst(t);if(void0!==i){lete=(0,iP.dirname)(i);n={bin:i,installDir:e,binDir:e};}else{// if python is not found, try to install it
if(X.GITHUB_ACTIONS)try{(0,K.info)("Installing python in GitHub Actions");let{setupActionsPython:o}=awaitq("5fF9z");awaito(e,t,r),i=awaitst(t);lets=(0,iP.dirname)(i);n={bin:i,installDir:s,binDir:s};}catch(e){(0,K.warning)(e.toString());}void0===n&&(n=awaitse(t,e));}return(void0===i||void0===n.bin)&&(i=awaitst(t),n.bin=i),n;}asyncfunctionse(e,t){letr;switch(process.platform){case"win32":{e?awaitiM("python3",t,[`--params=/InstallDir:${e}`]):awaitiM("python3",t);// Adding the bin dir to the path
letn=awaitst(e),i=(0,iP.dirname)(n);/** The directory which the tool is installed to */awaitnV(i),r={installDir:i,binDir:i,bin:n};break;}case"darwin":{r=awaitiD("python3",t);// add the python and pip binaries to the path
lete=awaitnI("brew",["--prefix","python"],{stdio:"pipe"}),n=(0,iP.join)(e.stdout,"libexec","bin");awaitnV(n);break;}case"linux":if(iF())r=awaitiz("python",t);elseif(iB())r=awaitiG([{name:"python3",version:t}]);elseif(iV())r=awaitix([{name:"python3",version:t},{name:"python-is-python3"}]);elsethrowError("Unsupported linux distributions");break;default:throwError("Unsupported platform");}returnr;}asyncfunctionst(e){for(lettof["python3","python"]){// eslint-disable-next-line no-await-in-loop
if(null!==e&&(awaito1(e,o3.pip)))returne;}catch{// fall through
}}asyncfunctionss(e){lett=awaitsa(e);t||(// ensure that pip is installed on Linux (happens when python is found but pip not installed)
awaitsS("pip"),// upgrade pip
awaitsa(e));}asyncfunctionsa(e){try{returnawaitnI(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0;}catch(t){(0,K.info)(t?.toString?.());try{return(// ensure pip is disabled on Ubuntu
awaitnI(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0);}catch(e){(0,K.info)(e?.toString?.());// pip module not found
}}// all methods failed
return!1;}asyncfunctionsl(e){lett=[];"linux"===process.platform?t.push("/home/runner/.local/bin/"):"darwin"===process.platform&&t.push("/usr/local/bin/");// detection using python.sys
return(// any of these are possible depending on the operating system!
t.push((0,iP.join)(r,"Scripts"),(0,iP.join)(r,"Scripts","bin"),(0,iP.join)(r,"bin")),[...newSet(t)]);}constsc=oq(sl);functionsu(e,t,r=null){returnsd(t)&&"linux"===process.platform&&null!==r&&eino6?/// choose the default linux version based on ubuntu version
function(e,t){letr=e[0],n=Object.keys(t).map(e=>parseInt(e,10)).sort((e,t)=>t-e)// sort in descending order
.find(e=>r>=e);returnvoid0===n?"":t[n];}(r,o6[e]):sd(t)&&eino4?o4[e]:"true"===t?"":t??"";}functionsd(e){return"true"===e||void0===e;}varK=q("ER74K"),sp={};asyncfunctionsf(){vare,t;if("linux"!==process.platform)return[];letr=await(e="lsb_release",t=["-a"],newPromise((r,n)=>{$.execFile(e,t,{encoding:"utf8",shell:!1},(i,o,s)=>{if(i){if("errno"ini&&"ENOENT"===i.code){r(null);// When lsb_release is not found
return;}n(Error(`Could not execute \`${e}${t.join(" ")}\`: ${i} (stderr=${s})`));return;}r(o);});}));if(null===r)return[];letn=/^Distributor ID:\s*(.+)$/,i=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,o=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/,s=null,a=null,l=!1;for(leteofr.split("\n")){lett=e.match(n);if(null!==t){lete=t[1];if("Ubuntu"!==e)return[];l=!0;}letr=e.match(i);r&&(s=r);letc=e.match(o);if(c&&(a=c),l&&s&&a)break;}if(!l)return[];for(leteof[s,a])if(e){lett=[e[1],e[2]];returne[3]&&t.push(e[3]),t.map(e=>parseInt(e,10));}return[];}asyncfunctionsh(){try{if(!iV())returnnull;{try{null===/*@__PURE__*/B(nQ).sync("lsb_release",{nothrow:!0})&&(awaitix([{name:"lsb-release"}]));}catch{returnsg();}lete=await(0,sp.getUbuntuVersion)();if(0===e.length)returnsg();returne;}}catch(e){return(0,K.warning)(e.toString()),null;}}Object.defineProperty(sp,"__esModule",{value:!0}),sp.getUbuntuVersion=void0,sp.getUbuntuVersion=sf;constsm=oq(sh);/** Detect Ubuntu version using os.version() for Ubuntu based distros */functionsg(){// #46~22.04.1-Ubuntu SMP ...
lete=B(f).version(),t=e.split("."),r=parseInt(t[0].replace("#",""),10),n=parseInt(t[1].replace("~",""),10),i=parseInt(t[2].split("-")[0],10);return[r,n,i];}asyncfunctionsv(e,t,r={}){returnsy(awaitsE(),e,t,r);}asyncfunctionsy(e,t,r,n={}){let{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:a=!1}=n,l=i&&!a&&(awaitsw(e)),c=l?"pipx":"pip";(0,ry.info)(`Installing ${t}${r??""} via ${c}`);try{letn=void0!==r&&""!==r?`${t}==${r}`:t,i=!l&&o?["--user"]:[];nT(e,["-m",c,...(s?l?["upgrade"]:["install","--upgrade"]:["install"]),...i,n],{stdio:"inherit"});}catch(e){if((awaitsS(t))===null)throwError(`Failed to install ${t} via ${c}${e}`);}letu=awaitsc(e),d=awaitsb(u,t);returnawaitnV(d),{binDir:d};}asyncfunctionsw(e){return0===(awaitnI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}asyncfunctionsx(){lete=(awaito5(su("python",void0,awaitsm()),"",process.arch)).bin;if(void0===e)throwError("Python binary was not found");returne;}constsE=oq(sx);asyncfunctionsb(e,t){letr=awaitPromise.all(e.map(e=>(0,nF.pathExists)((0,iP.join)(e,(0,iP.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){lett=e[n];returnt;}leti=/*@__PURE__*/B(nQ).sync((0,iP.addExeExt)(t),{nothrow:!0});returnnull!==i?(0,iP.dirname)(i):e[e.length-1];}functionsS(e){if("linux"===process.platform){if(iF())returniz(`python-${e}`);if(iB())returniG([{name:`python3-${e}`}]);if(iV())returnix([{name:`python3-${e}`}]);}returnnull;}asyncfunctions$(e,t,r){switch(process.platform){case"win32":{awaitiM("cppcheck",e);lett=awaits_();return{binDir:t};}case"darwin":returniD("cppcheck",e);case"linux":if(iF())returniz("cppcheck",e);if(iB())returniG([{name:"ccache",version:e}]);if(iV())returnix([{name:"cppcheck",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}asyncfunctions_(){lete="C:/Program Files/Cppcheck";returnawaitnV(e),e;}variP=q("ceI0e"),K=q("ER74K");asyncfunctionsO(e,t,r){switch(process.platform){case"win32":returnawaitiM("graphviz",e),sC();case"darwin":returniD("graphviz",e);case"linux":if(iF())returniz("graphviz",e);if(iB())returniG([{name:"graphviz",version:e}]);if(iV())returnix([{name:"graphviz",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}asyncfunctionsC(){if("win32"===process.platform){lete="C:/Program Files/Graphviz/bin";returnawaitnV(e),{binDir:e};}throwError("Unsupported platform");}varnF=q("dOmbL");/** Get the platform data for cmake */// eslint-disable-next-line @typescript-eslint/no-unused-vars
functionsI(e,t,r){switch(t){case"linux":{lett=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:(0,iP.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:iJ.extractTar,url:`https://www.doxygen.nl/files/${t}.linux.bin.tar.gz`};}case"win32":{lett=`doxygen-${e}`;return{binRelativeDir:"",binFileName:(0,iP.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:ok,url:`https://www.doxygen.nl/files/${t}.windows.x64.bin.zip`};}default:throwError(`Unsupported platform '${t}'`);}}asyncfunctionsT(e,t,r){switch(process.platform){case"win32":{// try to download the package 4 times with 2 seconds delay
await/*@__PURE__*/B(oO)(()=>iM("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:e=>(0,K.info)(e)});lett=awaitsR();returnawaitsO(su("graphviz",void0),"",r),{binDir:t};}case"darwin":{lete=awaitiD("doxygen",void0);returnawaitsO(su("graphviz",void0),"",r),e;}case"linux":{letn;if(""===e||iF()||iB()){if(iF())n=awaitiz("doxygen",e);elseif(iB())returniG([{name:"doxygen",version:e}]);elseif(iV())n=awaitix([{name:"doxygen",version:e}]);elsethrowError("Unsupported linux distributions");}elseif(iV())try{// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
n=awaitoR("doxygen",e,sI,t,r),awaitix([{name:"libclang-cpp9"}]);}catch(e){(0,K.notice)(`Failed to download doxygen binary. ${e}. Falling back to apt-get.`),n=awaitix([{name:"doxygen"}]);}elsethrowError("Unsupported linux distributions");returnawaitsO(su("graphviz",void0,awaitsm()),"",r),n;}default:throwError("Unsupported platform");}}asyncfunctionsR(){if("win32"===process.platform){for(leteof["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await(0,nF.pathExists)((0,iP.join)(e,"doxygen.exe")))return(// eslint-disable-next-line no-await-in-loop
awaitnV(e),e);throwError("Failed to find doxygen binary");}throwError("Unsupported platform");}varsP=q("bX9Em"),o_=q("9hSY8"),oo=q("jlr6Q"),K=q("ER74K");asyncfunctionsA(){if("darwin"===process.platform)try{lete=await(0,oo.getExecOutput)("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?awaitnG("SDKROOT",t.trim()):(0,K.error)("SDKROOT not set");}catch(e){(0,K.error)(e);}}variP=q("ceI0e"),K=q("ER74K"),X=q("dTX7a"),nF=q("dOmbL"),sN=h.resolve(__dirname,"../../src/gcc");// https://github.com/brechtsanders/winlibs_mingw/releases
constsL={13:{releaseName:"13.2.0-16.0.6-11.0.0-ucrt-r1",fileSuffix:"13.2.0-mingw-w64ucrt-11.0.0-r1"},"13.2-ucrt":{releaseName:"13.2.0-16.0.6-11.0.0-ucrt-r1",fileSuffix:"13.2.0-mingw-w64ucrt-11.0.0-r1"},"13.2-ucrt-mcf":{releaseName:"13.2.0mcf-16.0.6-11.0.1-ucrt-r2",fileSuffix:"13.2.0-mingw-w64ucrt-11.0.1-r2"},"13.2-msvcrt":{releaseName:"13.2.0-16.0.6-11.0.1-msvcrt-r1",fileSuffix:"13.2.0-mingw-w64msvcrt-11.0.1-r1"},"13.1-ucrt":{releaseName:"13.1.0posix-16.0.3-11.0.0-ucrt-r1",fileSuffix:"13.1.0-mingw-w64ucrt-11.0.0-r1"},"13.1-msvcrt":{releaseName:"13.1.0posix-16.0.3-11.0.0-msvcrt-r1",fileSuffix:"13.1.0-mingw-w64msvcrt-11.0.0-r1"},12:{releaseName:"12.3.0-16.0.4-11.0.0-ucrt-r1",fileSuffix:"12.3.0-mingw-w64ucrt-11.0.0-r1"},"12.3.0-ucrt":{releaseName:"12.3.0-16.0.4-11.0.0-ucrt-r1",fileSuffix:"12.3.0-mingw-w64ucrt-11.0.0-r1"},"12.3.0-msvcrt":{releaseName:"12.3.0-16.0.4-11.0.0-msvcrt-r1",fileSuffix:"12.3.0-mingw-w64msvcrt-11.0.0-r1"},"12.2.0-ucrt":{releaseName:"12.2.0-14.0.6-10.0.0-ucrt-r2",fileSuffix:"12.2.0-mingw-w64ucrt-10.0.0-r2"},"12.2.0-msvcrt":{releaseName:"12.2.0-14.0.6-10.0.0-msvcrt-r2",fileSuffix:"12.2.0-mingw-w64msvcrt-10.0.0-r2"},"12.1.0-ucrt":{releaseName:"12.1.0-14.0.4-10.0.0-ucrt-r2",fileSuffix:"12.1.0-mingw-w64ucrt-10.0.0-r2"},"12.1.0-msvcrt":{releaseName:"12.1.0-14.0.6-10.0.0-msvcrt-r3",fileSuffix:"12.1.0-llvm-14.0.6-mingw-w64msvcrt-10.0.0-r3"},11:{releaseName:"11.3.0-14.0.3-10.0.0-ucrt-r3",fileSuffix:"11.3.0-mingw-w64ucrt-10.0.0-r3"},"11.3.0-ucrt":{releaseName:"11.3.0-14.0.3-10.0.0-ucrt-r3",fileSuffix:"11.3.0-mingw-w64ucrt-10.0.0-r3"},"11.3.0-msvcrt":{releaseName:"11.3.0-14.0.3-10.0.0-msvcrt-r3",fileSuffix:"11.3.0-mingw-w64msvcrt-10.0.0-r3"},"11.2.0-ucrt":{releaseName:"11.2.0-9.0.0-ucrt-r5",fileSuffix:"11.2.0-mingw-w64ucrt-9.0.0-r5"},"11.2.0-msvcrt":{releaseName:"11.2.0-9.0.0-msvcrt-r5",fileSuffix:"11.2.0-mingw-w64msvcrt-9.0.0-r5"},10:{releaseName:"10.5.0-11.0.1-msvcrt-r1",fileSuffix:"10.5.0-mingw-w64msvcrt-11.0.1-r1"},"10.5.0-msvcrt":{releaseName:"10.5.0-11.0.1-msvcrt-r1",fileSuffix:"10.5.0-mingw-w64msvcrt-11.0.1-r1"},"10.3.0":{releaseName:"10.3.0-12.0.0-9.0.0-r2",fileSuffix:"10.3.0-llvm-12.0.0-mingw-w64-9.0.0-r2"},"10.2.0":{releaseName:"10.2.0-7.0.0-r4",fileSuffix:"10.2.0-llvm-10.0.1-mingw-w64-7.0.0-r4"},9:{releaseName:"9.4.0-9.0.0-r1",fileSuffix:"9.4.0-mingw-w64-9.0.0-r1"},"9.4.0":{releaseName:"9.4.0-9.0.0-r1",fileSuffix:"9.4.0-mingw-w64-9.0.0-r1"}};functionsk(e,t,r){if("win32"===t){lett=sL[e];if(void0===t)throwError(`mingw version ${e} is not supported`);return{binRelativeDir:"bin/",binFileName:(0,iP.addExeExt)("g++"),extractedFolderName:"mingw64",extractFunction:oA,url:`https://github.com/brechtsanders/winlibs_mingw/releases/download/${t.releaseName}/winlibs-${"ia32"===r?"i686":"x86_64"}-posix-seh-gcc-${t.fileSuffix}.7z`};}throwError(`Unsupported platform '${t}'`);}asyncfunctionsD(e,t,r){letn;switch(process.platform){case"win32":("arm"===r||"arm64"===r)&&(awaitiM("gcc-arm-embedded",e));try{n=awaitoR("g++",e,sk,t,r);}catch(t){(0,K.info)(`Failed to download g++ binary. ${t}. Falling back to chocolatey.`),n=awaitsj(e,r);}break;case"darwin":n=awaitiD("gcc",e);break;case"linux":"x64"===r?iF()?n=awaitiz("gcc",e):iB()?n=awaitiG([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]):iV()&&(n=awaitix([{name:"gcc",version:e,repositories:["ppa:ubuntu-toolchain-r/test"]},{name:"g++",version:e,repositories:["ppa:ubuntu-toolchain-r/test"]}])):((0,K.info)(`Install g++-multilib because gcc for ${r} was requested`),iF()?awaitiz("gcc-multilib",e):iV()&&(awaitix([{name:"gcc-multilib",version:e,repositories:["ppa:ubuntu-toolchain-r/test"]}])));break;// TODO support bare-metal (need to support passing it as the input)
// throw new Error(`Unsupported platform for ${arch}`)
// }
// }
default:throwError(`Unsupported platform for ${r}`);}if(void0!==n)returnawaitsM(e,n.binDir),n;}asyncfunctionsU(e,t,r){letn;switch(process.platform){case"win32":case"darwin":returnsD(e,t,r);case"linux":iF()?n=awaitiz("mingw-w64-gcc",e):iB()?n=awaitiG([{name:"mingw64-gcc",version:e}]):iV()&&(n=awaitix([{name:"mingw-w64",version:e,repositories:["ppa:ubuntu-toolchain-r/test"]}]));break;default:throwError(`Unsupported platform for ${r}`);}if(void0!==n)//Setting up g++-mingw-w64-i686-win32 (10.3.0-14ubuntu1+24.3) ...
// update-alternatives: using /usr/bin/i686-w64-mingw32-g++-win32 to provide /usr/bin/i686-w64-mingw32-g++ (i686-w64-mingw32-g++) in auto mode
//Setting up g++-mingw-w64-x86-64-win32 (10.3.0-14ubuntu1+24.3) ...
// update-alternatives: using /usr/bin/x86_64-w64-mingw32-g++-win32 to provide /usr/bin/x86_64-w64-mingw32-g++ (x86_64-w64-mingw32-g++) in auto mode
returnn;}asyncfunctionsj(e,t){letr;if(awaitiM("mingw",e),"x64"===t&&(await(0,nF.pathExists)("C:/tools/mingw64/bin"))?(r="C:/tools/mingw64/bin",awaitnV(r)):"ia32"===t&&(await(0,nF.pathExists)("C:/tools/mingw32/bin"))?(r="C:/tools/mingw32/bin",awaitnV(r)):(await(0,nF.pathExists)(`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin/g++.exe`))&&(r=`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`),void0!==r)return{binDir:r};}asyncfunctionsM(e,t){letr=[];// Setup gcc as the compiler
if("win32"===process.platform)r.push(nG("CC",(0,iP.addExeExt)(`${t}/gcc`)),nG("CXX",(0,iP.addExeExt)(`${t}/g++`)));else{letn=/*@__PURE__*/B(sP)(/*@__PURE__*/B(o_)(e)??e);n>=5?(r.push(nG("CC",`${t}/gcc-${n}`),nG("CXX",`${t}/g++-${n}`)),iV()&&r.push(iT("cc",`${t}/gcc-${n}`),iT("cxx",`${t}/g++-${n}`),iT("gcc",`${t}/gcc-${n}`),iT("g++",`${t}/g++-${n}`))):(r.push(nG("CC",`${t}/gcc-${e}`),nG("CXX",`${t}/g++-${e}`)),iV()&&r.push(iT("cc",`${t}/gcc-${e}`),iT("cxx",`${t}/g++-${e}`),iT("gcc",`${t}/gcc-${e}`),iT("g++",`${t}/g++-${e}`)));}r.push(sA()),X.GITHUB_ACTIONS&&(awaitsF()),awaitPromise.all(r);}asyncfunctionsF(){lete=(0,iP.join)(sN,"gcc_matcher.json");if(!(await(0,nF.pathExists)(e)))return(0,K.warning)("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");(0,K.info)(`::add-matcher::${e}`);}varoY=q("eJTZB"),sP=q("bX9Em"),iP=q("ceI0e"),K=q("ER74K"),iP=q("ceI0e");/** Get the platform data for ninja */// eslint-disable-next-line @typescript-eslint/no-unused-vars
functionsB(e,t,r){letn=/** Get the platform name Ninja uses in their download links */function(e){switch(e){case"win32":return"win";case"darwin":return"mac";case"linux":return"linux";default:throwError(`Unsupported platform '${e}'`);}}(t);return{binRelativeDir:"",binFileName:(0,iP.addExeExt)("ninja"),extractedFolderName:"",extractFunction:ok,url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`};}functionsG(e,t,r){returnoR("ninja",e,sB,t,r);}varsH=h.resolve(__dirname,"../../src/kcov");functionsV(e){return{url:`https://github.com/SimonKagstrom/kcov/releases/download/${e}/kcov-amd64.tar.gz`,extractedFolderName:"",binRelativeDir:"usr/local/bin",binFileName:(0,iP.addExeExt)("kcov"),extractFunction:oD};}functionsq(e){return{url:`https://github.com/SimonKagstrom/kcov/archive/refs/tags/${e}.tar.gz`,extractedFolderName:"",binRelativeDir:"build/src",binFileName:(0,iP.addExeExt)("kcov"),extractFunction:sX};}asyncfunctionsX(e,t){letr=awaitoD(e,t,["--strip-components=1"]),n=awaitsK();"linux"===process.platform&&(iF()?awaitPromise.all([iz("libdwarf"),iz("libcurl-openssl")]):iB()?awaitiG([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):iV()&&(awaitix([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}])));// apply gcc13.patch
try{if(null!==/*@__PURE__*/B(nQ).sync("patch",{nothrow:!0})){lete=(0,iP.join)(sH,"gcc13.patch");awaitnI("patch",["-N","-p1","-i",e],{cwd:r,stdio:"inherit"});}else(0,K.info)("`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13");}catch{// ignore
// return "user/local/bin" // the cmake install prefix
returnawaitnI(n,["-S",r,"-B",i,"-DCMAKE_BUILD_TYPE=Release","-G","Ninja"],{cwd:r,stdio:"inherit"}),awaitnI(n,["--build",i,"--config","Release"],{cwd:r,stdio:"inherit"}),r;}asyncfunctionsK(){lete=/*@__PURE__*/B(nQ).sync("cmake",{nothrow:!0});if(null===e){let{binDir:t}=awaitoj(su("cmake",void0,awaitsm()),(0,iP.join)(t8(""),"cmake"),"");e=(0,iP.join)(t,"cmake");}lett=/*@__PURE__*/B(nQ).sync("ninja",{nothrow:!0});returnnull===t&&(awaitsG(su("ninja",void0,awaitsm()),(0,iP.join)(t8(""),"ninja"),"")),e;}asyncfunctionsz(e,t,r){varn;leti;if("linux"!==process.platform){(0,K.info)("Kcov is not supported on non-linux");return;}// parse version
*/function(e){return null==e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e);},sQ.issueCommand=s2,sQ.issue=function(e,t=""){s2(e,{},t);};class s4{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r;}toString(){var e;let t="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let e=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let n=this.properties[r];n&&(e?e=!1:t+=",",t+=`${r}=${s1.toCommandValue(n).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return t+`::${(e=this.message,s1.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A"))}`;}}var s3={},s6=s3&&s3.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t;};Object.defineProperty(s3,"__esModule",{value:!0});// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */consts5=s6(m),s8=s6(f);s3.issueCommand=function(e,t){letr=process.env[`GITHUB_${e}`];if(!r)throwError(`Unable to find environment variable for file command ${e}`);if(!s5.existsSync(r))throwError(`Missing file at path: ${r}`);s5.appendFileSync(r,`${s1.toCommandValue(t)}${s8.EOL}`,{encoding:"utf8"});};consts7=sJ(f),s9=sJ(h);/**
*/function(e,t){let r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r)throw Error(`Input required and not supplied: ${e}`);return r.trim();},sW.setOutput=/**
letn=function(e,t){try{return$.execSync(`vswhere -products * ${t} -prerelease -property installationPath`).toString().trim()+"\\"+e;}catch(e){sW.warning(`vswhere failed: ${e}`);}returnnull;}("VC\\Auxiliary\\Build\\vcvarsall.bat",t);if(n&&m.existsSync(n))returnsW.info(`Found with vswhere: ${n}`),n;sW.info("Not found with vswhere");// If that does not work, try the standard installation locations,
// starting with the latest and moving to the oldest.
leti=e?[function(e){if(Object.keys(aa).includes(e));elsefor(let[t,r]ofObject.entries(aa))if(r===e)returnt;returne;}(e)]:as;for(leteofai)for(lettofi)for(letrofao)if(n=`${e}\\Microsoft Visual Studio\\${t}\\${r}\\VC\\Auxiliary\\Build\\vcvarsall.bat`,sW.info(`Trying standard location: ${n}`),m.existsSync(n))returnsW.info(`Found standard location: ${n}`),n;if(sW.info("Not found in standard locations"),// Special case for Visual Studio 2015 (and maybe earlier), try it out too.
n=`${an}\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat`,m.existsSync(n))returnsW.info(`Found VS 2015: ${n}`),n;throwsW.info(`Not found in VS 2015 location: ${n}`),Error("Microsoft Visual Studio not found");}d=/** See https://github.com/ilammy/msvc-dev-cmd#inputs */function(e,t,r,n,i,o){if("win32"!=T.platform){sW.info("This is not a Windows virtual environment, bye!");return;}// Add standard location of "vswhere" to PATH, in case it's not there.
T.env.PATH+=h.delimiter+ac;// There are all sorts of way the architectures are called. In addition to
// values supported by Microsoft Visual C++, recognize some common aliases.
lets={win32:"x86",win64:"x64",x86_64:"x64","x86-64":"x64"};e.toLowerCase()ins&&(e=s[e.toLowerCase()]);// Due to the way Microsoft Visual C++ is configured, we have to resort to the following hack:
// Call the configuration batch file and then output *all* the environment variables.
vara=[e];"true"==n&&a.push("uwp"),t&&a.push(t),r&&a.push(`-vcvars_ver=${r}`),"true"==i&&a.push("-vcvars_spectre_libs=spectre");letl=`"${au(o)}" ${a.join(" ")}`;sW.debug(`vcvars command-line: ${l}`);letc=$.execSync(`set && cls && ${l} && cls && set`,{shell:"cmd"}).toString(),u=c.split("\f"),d=u[0].split("\r\n"),p=u[1].split("\r\n"),f=u[2].split("\r\n"),m=p.filter(e=>!!e.match(/^\[ERROR.*\]/)&&!e.match(/Error in script usage. The correct usage is:$/));if(m.length>0)throwError("invalid parameters\r\n"+m.join("\r\n"));// Convert old environment lines into a dictionary for easier lookup.
letg={};for(leteofd){let[t,r]=e.split("=");g[t]=r;}for(leteof(// Now look at the new environment and export everything that changed.
// These are the variables set by vsvars.bat. Also export everything
// that was not there during the first sweep: those are new variables.
sW.startGroup("Environment variables"),f)){// vsvars.bat likes to print some fluff at the beginning.
// Skip lines that don't look like environment variables.
if(!e.includes("="))continue;let[t,r]=e.split("=");r!==g[t]&&(sW.info(`Setting ${t}`),-1!=["PATH","INCLUDE","LIB","LIBPATH"].indexOf(t.toUpperCase())&&(r=r.split(";").filter(// Remove duplicates by keeping the first occurance and preserving order.
// This keeps path shadowing working as intended.
function(e,t,r){returnr.indexOf(e)===t;}).join(";")),sW.exportVariable(t,r));}sW.endGroup(),sW.info("Configured Developer Command Prompt");};varK=q("ER74K"),nF=q("dOmbL");asyncfunctionad(e,t,r,n,i,o,s){void0!==t&&(await(0,nF.pathExists)(t))&&((0,K.info)(`Adding ${t} to PATH`),awaitnG("VCTargetsPath",t)),d(function(e){switch(e){case"x32":case"32":case"ia32":return"x86";case"64":return"x64";default:returne;}}(r),i,n,o,s,e);}classapextendsError{constructor(e){super(e),this.name="TimeoutError";}}classafextendsError{constructor(e){super(),this.name="AbortError",this.message=e;}}/**
*/const ah=e=>void 0===globalThis.DOMException?new af(e):new DOMException(e),am=e=>{let t=void 0===e.reason?ah("This operation was aborted."):e.reason;return t instanceof Error?t:ah(t);};async function ag(e,t,r,n,i,o,s,a=12e5//20minutes
){(0,ry.startGroup)(`Installing ${e}${t}`);letl=!1;try{l=awaitfunction(e,t){letr;let{milliseconds:n,fallback:i,message:o,customTimers:s={setTimeout:setTimeout,clearTimeout:clearTimeout}}=t,a=newPromise((a,l)=>{if("number"!=typeofn||1!==Math.sign(n))throwTypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(t.signal){let{signal:e}=t;e.aborted&&l(am(e)),e.addEventListener("abort",()=>{l(am(e));});}if(n===Number.POSITIVE_INFINITY){e.then(a,l);return;}// We create the error outside of `setTimeout` to preserve the stack trace.
letc=newap();r=s.setTimeout.call(void0,()=>{if(i){try{a(i());}catch(e){l(e);}return;}"function"==typeofe.cancel&&e.cancel(),!1===o?a():oinstanceofError?l(o):(c.message=o??`Promise timed out after ${n} milliseconds`,l(c));},n),(async()=>{try{a(awaite);}catch(e){l(e);}})();}),l=a.finally(()=>{l.clear();});returnl.clear=()=>{s.clearTimeout.call(void0,r),r=void0;},l;}(av(e,t,r,n,l,i,o),{milliseconds:a,message:`Timeout while installing ${e}${t}. You can increase the timeout from options`});}catch(t){// push error message to the logger
(0,K.error)(t),s.push(`${e} failed to install`);}return(0,ry.endGroup)(),l;}asyncfunctionav(e,t,r,n,i,o,s){leta;if("vcvarsall"===e)awaitad(su(e,t,r),void0,n,void0,void0,!1,!1);else{// get the setup function
a=awaits(su(e,t,r),l,n);}return(// preparing a report string
s.push(a8(e,a)),i);}const{readFile:ay,writeFile:aw,chmod:ax}=m.promises;asyncfunctionaE(e){// TODO for older versions, this also includes the minor version
lett=`/usr/lib/llvm-${e}`;awaitix([{name:"curl"}]),awaitnI("curl",["-LJO","https://apt.llvm.org/llvm.sh"],{cwd:"/tmp"});letr=awaitab("/tmp/llvm.sh","/tmp/llvm-setup-cpp.sh");returnawaitix(r),awaitax("/tmp/llvm-setup-cpp.sh","755"),awaitt5("bash",["/tmp/llvm-setup-cpp.sh",`${e}`,"all"],{stdio:"inherit",shell:!0,timeout:12e5}),awaitnV(`${t}/bin`),{installDir:`${t}`,binDir:`${t}/bin`,bin:`${t}/bin/clang++`};}asyncfunctionab(e,t){varr,n;leti=awaitay(e,"utf-8");// the packages needed by the script
returni=(r=i,i=process.env.NODE_DEBUG?r:r.replace(/set -eux/g,"set -eu")).replace(/add-apt-repository "\${REPO_NAME}"/g,'add-apt-repository -y "${REPO_NAME}"'),n=i=awaitaS(i),i=// use nala if it is available
iS()?n.replace(/apt-get/g,"nala"):n,awaitaw(t,i),[{name:"lsb-release"},{name:"wget"},{name:"software-properties-common"},{name:"gnupg"}];}asyncfunctionaS(e){// fix conflicts between libclang-rt and libclang
"15.0.4","15.0.5","15.0.6","16.0.0","16.0.1","16.0.2","16.0.3","16.0.4","16.0.5","16.0.6"]),aC=newMap(),aI={"3.5.0":"-ubuntu-14.04","3.5.1":"","3.5.2":"-ubuntu-14.04","3.6.0":"-ubuntu-14.04","3.6.1":"-ubuntu-14.04","3.6.2":"-ubuntu-14.04","3.7.0":"-ubuntu-14.04","3.7.1":"-ubuntu-14.04","3.8.0":"-ubuntu-16.04","3.8.1":"-ubuntu-16.04","3.9.0":"-ubuntu-16.04","3.9.1":"-ubuntu-16.04","4.0.0":"-ubuntu-16.04","5.0.0":"-ubuntu16.04","5.0.1":"-ubuntu-16.04","5.0.2":"-ubuntu-16.04","6.0.0":"-ubuntu-16.04","6.0.1":"-ubuntu-16.04","7.0.0":"-ubuntu-16.04","7.0.1":"-ubuntu-18.04","7.1.0":"-ubuntu-14.04","8.0.0":"-ubuntu-18.04","9.0.0":"-ubuntu-18.04","9.0.1":"-ubuntu-16.04","10.0.0":"-ubuntu-18.04","10.0.1":"-ubuntu-16.04","11.0.0":"-ubuntu-20.04","11.0.1":"-ubuntu-16.04","11.1.0":"-ubuntu-16.04","12.0.0":"-ubuntu-20.04","12.0.1":"-ubuntu-16.04","13.0.0":"-ubuntu-20.04","13.0.0-ubuntu-16.04":"-ubuntu-16.04","13.0.0-ubuntu-20.04":"-ubuntu-20.04","13.0.1":"-ubuntu-18.04","13.0.1-ubuntu-18.04":"-ubuntu-18.04","14.0.0":"-ubuntu-18.04",// "14.0.1": "-ubuntu-18.04", // only available for powerpc64le
/** Gets a LLVM download URL for GitHub. */functionaR(e,t,r){letn=`${t}${e}${r}`;return`https://github.com/llvm/llvm-project/releases/download/llvmorg-${e}/${n}`;}/** Gets a LLVM download URL for https://releases.llvm.org. */functionaP(e,t,r){letn=`${t}${e}${r}`;return`https://releases.llvm.org/${e}/${n}`;}/** Gets an LLVM download URL for the Windows platform. */asyncfunctionaA(e){lett;if(a_.has(e))returnnull;letr="LLVM-",n=/*@__PURE__*/B(o$)(e,"3.7.0")?"-win32.exe":"-win64.exe",i=/*@__PURE__*/B(o$)(e,"9.0.1"),o=!1;returni&&(t=aP(e,r,n),(awaitoz(t))||(o=!0// fallback to github
)),(o||!i)&&(t=aR(e,r,n)),t;}functionaN(e,t){switch(e){case"darwin":return(/** Gets an LLVM download URL for the Darwin platform. */function(e){if(aO.has(e))returnnull;lett="9.0.0"===e?"-darwin-apple":"-apple-darwin",r="clang+llvm-",n=`-x86_64${t}.tar.xz`;return/*@__PURE__*/B(o$)(e,"9.0.1")?aP(e,r,n):aR(e,r,n);}(t));case"linux":returnfunction(e){lett,r,n=e,i=aC.get(n);// ubuntu-version is specified
if(void0!==i&&(n=i),n.includes("ubuntu")){lete=n.replace(/-ubuntu-.*/,"");if(!a$.has(e))throwError(`Unsupported Ubuntu version: ${e}`);t=n.replace(e,""),n=oJ(a$,e)[0];}else""!==n&&ninaI?t=aI[n]:(// default to the maximum version
t=aI[aT],(0,K.warning)(`Falling back to LLVM version ${aT}${t} for the Ubuntu.`));leto="clang+llvm-";return(r="5.0.0"===n?`-linux-x86_64${t}.tar.xz`:t.includes("-rhel86")?`-x86_64-unknown-linux-gnu${t}.tar.xz`:`-x86_64-linux-gnu${t}.tar.xz`,/*@__PURE__*/B(o$)(n,"9.0.1"))?aP(n,o,r):aR(n,o,r);}(t);case"win32":returnaA(t);default:returnnull;}}asyncfunctionaL(e,t,r){let[n,i]=awaitoQ(a$,t,e,aN);return(0,K.info)(`specific llvm version: ${n}`),{url:i,extractedFolderName:"",binRelativeDir:"bin",binFileName:(0,iP.addExeExt)("clang"),extractFunction:"win32"===t?oL:(e,t)=>oD(e,t,["--strip-components=1"])};}varak=h.resolve(__dirname,"../../src/llvm");asyncfunctionaD(e,t,r){letn=awaitaj(e,t,r);returnawaitaq(n.installDir??t),n;}asyncfunctionaU(e,t,r){// install LLVM and its dependencies in parallel
let[n,i,o]=awaitPromise.all([aF(e,t,r),aV(r),aX()]);returnn;}constaj=oq(aU,{isPromise:!0});functionaM(e,t,r){returnaF(e,t,r);}asyncfunctionaF(e,t,r){letn=function(e){if(null===/*@__PURE__*/B(oY)(e))try{// find the semver version of an integer
lett=/*@__PURE__*/B(o_)(e);if(null!==t)return(0,K.info)(`Coerced version '${e}' to '${t}'`),t.version;}catch(e){// handled below
}returne;}(e),i=parseInt(n.split(".")[0],10);try{if(iV())returnawaitaE(i);}catch(e){(0,K.info)(`Failed to install llvm via system package manager ${e}`);}leto=awaitoR("llvm",e,aL,t,r);returnawaitaG(i),o;}asyncfunctionaB(e){iV()&&(e<=10?awaitix([{name:"libtinfo5"}]):awaitix([{name:"libtinfo-dev"}]));}constaG=oq(aB,{isPromise:!0});asyncfunctionaH(e){"linux"===process.platform&&(awaitsD(su("gcc",void0,awaitsm()),"",e));}constaV=oq(aH,{isPromise:!0});asyncfunctionaq(e){lett=process.env.LD_LIBRARY_PATH??"",r=process.env.DYLD_LIBRARY_PATH??"",n=[nG("LLVM_PATH",e),nG("LD_LIBRARY_PATH",`${e}/lib${h.delimiter}${t}`),nG("DYLD_LIBRARY_PATH",`${e}/lib${h.delimiter}${r}`),nG("LDFLAGS",`-L"${e}/lib"`),nG("CPPFLAGS",`-I"${e}/include"`),nG("CC",(0,iP.addExeExt)(`${e}/bin/clang`)),nG("CXX",(0,iP.addExeExt)(`${e}/bin/clang++`)),nG("LIBRARY_PATH",`${e}/lib`),sA()];iV()&&n.push(iT("cc",`${e}/bin/clang`),iT("cxx",`${e}/bin/clang++`),iT("clang",`${e}/bin/clang`),iT("clang++",`${e}/bin/clang++`),iT("lld",`${e}/bin/lld`),iT("ld.lld",`${e}/bin/ld.lld`),iT("llvm-ar",`${e}/bin/llvm-ar`)),awaitPromise.all(n);}asyncfunctionaX(){if(X.GITHUB_ACTIONS){lete=(0,iP.join)(ak,"llvm_matcher.json");if(!(await(0,nF.pathExists)(e)))return(0,K.warning)("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");(0,K.info)(`::add-matcher::${e}`);}}asyncfunctionaK(e,t,r){switch(process.platform){case"win32":returniM("make",e);case"darwin":returnawaitiD("make",e),awaitnV("/usr/local/opt/make/libexec/gnubin"),{binDir:"/usr/local/opt/make/libexec/gnubin"};case"linux":if(iF())returniz("make",e);if(iB())returniG([{name:"make",version:e}]);if(iV())returnix([{name:"make",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}varX=q("dTX7a"),iP=q("ceI0e"),K=q("ER74K"),nF=q("dOmbL"),az=h.resolve(__dirname,"../../src/msvc");asyncfunctionaW(e,t,r,n,i,o){lets,a;if("win32"!==process.platform)return;letl=al(e);// check if the given version is already installed
(0,K.info)(`Checking if MSVC ${l} is already installed`);letc=!1;try{lete=au(l);c=!0,(0,K.info)(`Found the pre-installed version of MSVC at ${e}`);}catch{// not installed, try installing
}// https://github.com/aminya/setup-cpp/issues/1
if(!c)try{"14.0"===l?(s="14.0",awaitiM("visualcpp-build-tools","14.0.25420.1",["--ignore-dependencies"]),a="C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"):"15.0"===l?(s="14.16",awaitiM("visualstudio2017buildtools","15.9.41.0",[]),a="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16"// TODO verify path
):"16.0"===l?(s="14.29",awaitiM("visualstudio2019buildtools","16.11.7.0",[]),a="C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"):"17.0"===l?(s=void0,awaitiM("visualstudio2022buildtools","117.0.5.0",[]),a=void0):(0,K.error)(`The given MSVC versions ${e} is not supported yet.`);}catch(e){(0,K.error)(e);}// run vcvarsall.bat environment variables
awaitad(l,a,r,s,n,i,o),X.GITHUB_ACTIONS&&(awaitaY());}asyncfunctionaY(){lete=(0,iP.join)(az,"msvc_matcher.json");if(!(await(0,nF.pathExists)(e)))return(0,K.warning)("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");(0,K.info)(`::add-matcher::${e}`);}asyncfunctionaJ(e,t,r){if(!iV())return;if("string"==typeofi)return{binDir:i};letn=/*@__PURE__*/B(nQ).sync("nala",{nothrow:!0});if(null!==n)return{binDir:i=(0,iP.dirname)(n)};// https://github.com/volitank/nala#-installation
};}asyncfunctionaQ(e,t,r){if("win32"!==process.platform)return;awaitiM("opencppcoverage",e);letn=awaitaZ();return{binDir:n};}asyncfunctionaZ(){lete="C:/Program Files/OpenCppCoverage";returnawaitnV(e),e;}asyncfunctiona0(e,t,r){switch(process.platform){case"win32":{awaitiM("powershell-core",e);lett="C:/Program Files/PowerShell/7";returnawaitnV(t),{binDir:t};}case"darwin":returniD("powershell",e,["--cask"]);case"linux":if(iF())returniz("powershell-bin",e,"yay");if(iB())returniG([{name:"curl"}]),t6("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),iG([{name:"powershell",version:e}]);if(iV()){awaitix([{name:"curl"}]);lett=awaitsm(),r=`${t[0]}.0${t[1]}`;// TODO Debian
returnt6("curl",["-LJO",`https://packages.microsoft.com/config/ubuntu/${r}/packages-microsoft-prod.deb`]),t6("dpkg",["-i","packages-microsoft-prod.deb"]),ix([{name:"powershell",version:e}],!0);}throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}variP=(q("ceI0e"),q("ceI0e"));/** Get the platform data for task */functiona1(e,t,r){letn=/** Get the arch name task uses in their download links */function(e){switch(e){case"x64":return"amd64";case"ia32":case"x86":case"i386":case"x32":return"386";default:returne;}}(r),i="win32"===t;return{binRelativeDir:"",binFileName:(0,iP.addExeExt)("task"),extractedFolderName:"",extractFunction:i?ok:oD,url:`https://github.com/go-task/task/releases/download/v${e}/task_${"win32"===t?"windows":t}_${n}.${i?"zip":"tar.gz"}`};}varK=q("ER74K"),nF=q("dOmbL"),iP=q("ceI0e");leta2=!1;asyncfunctiona4(e,t,r){returna2&&null!==/*@__PURE__*/B(nQ).sync("vcpkg",{nothrow:!0})?{binDir:(0,iP.dirname)(/*@__PURE__*/B(nQ).sync("vcpkg"))}:("linux"===process.platform&&(iF()?awaitPromise.all([iz("curl"),iz("zip"),iz("unzip"),iz("tar"),iz("git"),iz("pkg-config")]):iB()?awaitiG([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}]):iV()&&(awaitix([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}]))),(await(0,nF.pathExists)((0,iP.join)(t,(0,iP.addShExt)("bootstrap-vcpkg",".bat"))))?(0,K.notice)(`Vcpkg folder already exists at ${t}. This might mean that ~/vcpkg is restored from the cache.`):nT("git",["clone","https://github.com/microsoft/vcpkg"],{cwd:(0,iP.dirname)(t),stdio:"inherit"}),nT((0,iP.addShExt)((0,iP.addShRelativePrefix)("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),nj(t),awaitnV(t),// eslint-disable-next-line require-atomic-updates
a2=!0,{binDir:t});}consta3={nala:aJ,cmake:oj,ninja:sG,python:o5,vcpkg:a4,bazel:iq,conan:function(e,t,r){returnsv("conan",e);},meson:function(e,t,r){returnsv("meson",e);},gcovr:function(e,t,r){returnsv("gcovr",e);},opencppcoverage:aQ,llvm:aD,gcc:sD,choco:iU,brew:iN,powershell:a0,ccache:function(e,t,r){switch(process.platform){case"win32":returniM("ccache",e);case"darwin":returniD("ccache",e);case"linux":if(iF())returniz("ccache",e);if(iB())returniG([{name:"ccache",version:e}]);if(iV())returnix([{name:"ccache",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}},sccache:function(e,t,r){switch(process.platform){case"win32":returniM("sccache",e);case"linux":case"darwin":returniD("sccache",e);default:throwError("Unsupported platform");}},doxygen:sT,graphviz:sO,cppcheck:s$,clangtidy:aM,clangformat:aM,msvc:aW,vcvarsall:ad,kcov:sz,make:aK,task:function(e,t,r){returnoR("task",e,a1,t,r);},sevenzip:oP},a6=Object.keys(a3),a5=["compiler","architecture","timeout",...a6];functiona8(e,t){letr=`✅ ${e} was installed successfully:`;returnvoid0===t||("installDir"int&&(r+=`
-Thebinarydirectoryis${t.binDir}`)),r;}var ry=q("lcRzN"),K=q("ER74K"),oY=q("eJTZB");async function a7(e,t,r,n,i,o,s){try{let{compiler:a,version:l}=function(e){let t=e.split("-"),r=t[0];if(1 in t){let e=t[1];return null!==/*@__PURE__*/B(oY)(e)||(0,K.info)(`Invalidsemverversion${e}usedforthecompiler.`),{compiler:r,version:e};}return{compiler:r,version:void 0};}(e);switch(// install the compiler. We allow some aliases for the compiler name
(0,ry.startGroup)(`Installing ${a}${l??""}`),a){case"llvm":case"clang":case"clang++":{lete=awaitaD(su("llvm",l,t),(0,h.join)(r,"llvm"),n);awaitnG("GCOV","llvm-cov gcov"),i.push(a8("llvm",e));break;}case"gcc":case"mingw":case"cygwin":case"msys":{lete="mingw"===a?su("mingw",l,t):su("gcc",l,t),s="mingw"===a?awaitsU(e,(0,h.join)(r,"gcc"),n):awaitsD(e,(0,h.join)(r,"gcc"),n);o&&(awaitnG("CPPFLAGS","")),awaitfunction(e){lett=/*@__PURE__*/B(oY)(e),r=null!==t?/*@__PURE__*/B(sP)(t):e,n=""!==r?`gcov-${r}`:"gcov";returnnG("GCOV",n);}(e),i.push(a8("gcc",s));break;}case"cl":case"msvc":case"msbuild":case"vs":case"visualstudio":case"visualcpp":case"visualc++":{lete=awaitaW(su("msvc",l,t),(0,h.join)(r,"msvc"),n);o&&(awaitnG("CPPFLAGS","")),i.push(a8("msvc",e));break;}case"appleclang":case"applellvm":(0,ry.notice)("Assuming apple-clang is already installed"),awaitPromise.all([nG("CC","clang"),nG("CXX","clang++")]),i.push(a8("apple-clang",void0));break;default:s.push(`Unsupported compiler ${a}`);}}catch(t){(0,K.error)(t),s.push(`Failed to install the ${e}`);}(0,ry.endGroup)();}// Run main
/** The main entry function */(asyncfunction(e){lett,r,n=Promise.resolve();X.GITHUB_ACTIONS||(n=rv(),process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS="true");// parse options using mri or github actions
leto=i.architecture??process.arch,s=process.env.SETUP_CPP_DIR??t8(""),a=[],l=[],c=Y.create({autoloadLocales:!0});Y.addLocale(/*@__PURE__*/B(J)),z.addLocale(/*@__PURE__*/B(W));// installing the specified tools
letu=awaitsm();// sync the version for the llvm tools
if(!function(e,t){letr=t.filter(t=>void0!==e[t]),n=r.filter(t=>!sd(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(i,["llvm","clangtidy","clangformat"]))return(0,K.error)("The same version must be used for llvm, clangformat and clangtidy"),1;iF()&&"string"==typeofi.cppcheck&&"string"==typeofi.gcovr&&((0,K.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),awaitiz("python-pygments"));/** Used to unset CPPFLAGS of LLVM when other compilers are used as the main compiler */letd=!1,p=!1;for(leteofa6){// fail fast inside CI when any tool fails
if(X.isCI&&0!==l.length){p=!0;break;}// get the version or "true" or undefined for this tool from the options
letn=i[e];void0!==n&&(// running the setup function for this tool
d=awaitag(e,n,u,o,s,a,l,6e4*parseFloat(i.timeout??"20")),r=Date.now(),(0,K.info)(`took ${c.format(t,r)||"0 seconds"}`));}if(!p){// installing the specified compiler
lete=i.compiler;if(void0!==e){lett=Date.now();awaita7(e,u,s,o,a,d,l);letr=Date.now();(0,K.info)(`took ${c.format(t,r)||"0 seconds"}`);}}if(awaitnY(),0===a.length&&0===l.length)return(0,K.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(// report the messages in the end
a.forEach(e=>(0,K.success)(e)),l.forEach(e=>(0,K.error)(e)),(0,K.info)("setup-cpp finished"),!X.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,K.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,K.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}returnawaitn,0===l.length?0:1;// exit with non-zero if any error message