"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"))}`;}}}),V.register("3GPt4",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=V("21Qsr"),l=V("3GPt4");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}`;};}),V.register("21Qsr",function(e,t){M(e.exports,"default",()=>i);varr=V("lr0KB"),n=V("671Sw"),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);};}),V.register("lr0KB",function(e,t){M(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;};}),V.register("bfNI0",function(e,t){M(e.exports,"default",()=>n);varr=V("k4edj"),n=function(e){return"string"==typeofe&&(0,r.default).test(e);};}),V.register("k4edj",function(e,t){M(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;}),V.register("cxUw3",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=V("kZ2GT"),i=V("2Ey1j"),o=V("2heqc");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;}),V.register("kZ2GT",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(g),p=c(y),f=c(V("1kBrV")),h=c(V("j6C2A"));(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),{});}),V.register("1kBrV",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;}),V.register("j6C2A",function(e,t){e.exports=V("3axfE");}),V.register("3axfE",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||g.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;}M(e.exports,"httpOverHttp",()=>r,e=>r=e),M(e.exports,"httpsOverHttp",()=>n,e=>n=e),M(e.exports,"httpOverHttps",()=>i,e=>i=e),M(e.exports,"httpsOverHttps",()=>o,e=>o=e),M(e.exports,"debug",()=>s,e=>s=e),r=function(e){vart=newl(e);returnt.request=g.request,t;},n=function(e){vart=newl(e);returnt.request=g.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(){};}),V.register("2Ey1j",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};}),V.register("3abeg",function(e,t){e.exports=V("ljv3o");}),V.register("aaJ7t",function(e,t){e.exports=!!("undefined"!=typeofprocess&&process.versions&&process.versions.node);}),V.register("gRK0M",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);};}),V.register("9ZovO",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);};}),V.register("2dWxz",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");}),V.register("lqN0l",function(e,t){// just pre-load all the stuff that index.js lazily exports
varr=V("eDlr8"),n=V("6fF7q"),i=V("fYigo"),o=V("hQh8e"),s=V("5DLUR"),a=V("eO4vc"),l=V("5Pwcn"),c=V("4dfSx"),u=V("7cpCI"),d=V("7GceF"),p=V("k4OKF"),f=V("lL63q"),h=V("lhsZL"),m=V("eSzHt"),v=V("1yexC"),g=V("gI1Tk"),y=V("bn7NB"),w=V("4yuO6"),x=V("iea9H"),E=V("gtqtv"),b=V("3Nc7w"),S=V("auc5a"),$=V("caa1L"),O=V("1Ucjm"),_=V("fAXcL"),C=V("2ImCS"),I=V("255mi"),T=V("7BD2X"),R=V("bGbOH"),A=V("eLOWZ"),P=V("lCDwg"),N=V("iLpkq"),L=V("gEzC5"),k=V("kOEjN"),D=V("lSCGC"),U=V("kRbmr"),j=V("jjglH"),F=V("52D05"),M=V("3lRwj"),G=V("ahb6l"),B=V("bfmht");e.exports={parse:s,valid:a,clean:l,inc:c,diff:u,major:d,minor:p,patch:f,prerelease:h,compare:m,rcompare:v,compareLoose:g,compareBuild:y,sort:w,rsort:x,gt:E,lt:b,eq:S,neq:$,gte:O,lte:_,cmp:C,coerce:I,Comparator:T,Range:R,satisfies:A,toComparators:P,maxSatisfying:N,minSatisfying:L,minVersion:k,validRange:D,outside:U,gtr:j,ltr:F,intersects:M,simplifyRange:G,subset:B,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};}),V.register("eDlr8",function(e,t){varr=V("6fF7q"),n=r.MAX_SAFE_COMPONENT_LENGTH,i=r.MAX_SAFE_BUILD_LENGTH,o=r.MAX_LENGTH,s=V("23sN8");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*$");}),V.register("6fF7q",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};}),V.register("23sN8",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;}),V.register("fYigo",function(e,t){varr=V("23sN8"),n=V("6fF7q"),i=n.MAX_LENGTH,o=n.MAX_SAFE_INTEGER,s=V("eDlr8"),a=s.safeRe,l=s.t,c=V("kR8wQ"),u=V("hQh8e").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;}),V.register("kR8wQ",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;}),V.register("hQh8e",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)};}),V.register("5DLUR",function(e,t){varr=V("fYigo");e.exports=(e,t,n=!1)=>{if(einstanceofr)returne;try{returnnewr(e,t);}catch(e){if(!n)returnnull;throwe;}};}),V.register("eO4vc",function(e,t){varr=V("5DLUR");e.exports=(e,t)=>{letn=r(e,t);returnn?n.version:null;};}),V.register("5Pwcn",function(e,t){varr=V("5DLUR");e.exports=(e,t)=>{letn=r(e.trim().replace(/^[=v]+/,""),t);returnn?n.version:null;};}),V.register("4dfSx",function(e,t){varr=V("fYigo");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;}};}),V.register("7cpCI",function(e,t){varr=V("5DLUR");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";};}),V.register("7GceF",function(e,t){varr=V("fYigo");e.exports=(e,t)=>newr(e,t).major;}),V.register("k4OKF",function(e,t){varr=V("fYigo");e.exports=(e,t)=>newr(e,t).minor;}),V.register("lL63q",function(e,t){varr=V("fYigo");e.exports=(e,t)=>newr(e,t).patch;}),V.register("lhsZL",function(e,t){varr=V("5DLUR");e.exports=(e,t)=>{letn=r(e,t);returnn&&n.prerelease.length?n.prerelease:null;};}),V.register("eSzHt",function(e,t){varr=V("fYigo");e.exports=(e,t,n)=>newr(e,n).compare(newr(t,n));}),V.register("1yexC",function(e,t){varr=V("eSzHt");e.exports=(e,t,n)=>r(t,e,n);}),V.register("gI1Tk",function(e,t){varr=V("eSzHt");e.exports=(e,t)=>r(e,t,!0);}),V.register("bn7NB",function(e,t){varr=V("fYigo");e.exports=(e,t,n)=>{leti=newr(e,n),o=newr(t,n);returni.compare(o)||i.compareBuild(o);};}),V.register("4yuO6",function(e,t){varr=V("bn7NB");e.exports=(e,t)=>e.sort((e,n)=>r(e,n,t));}),V.register("iea9H",function(e,t){varr=V("bn7NB");e.exports=(e,t)=>e.sort((e,n)=>r(n,e,t));}),V.register("gtqtv",function(e,t){varr=V("eSzHt");e.exports=(e,t,n)=>r(e,t,n)>0;}),V.register("3Nc7w",function(e,t){varr=V("eSzHt");e.exports=(e,t,n)=>0>r(e,t,n);}),V.register("auc5a",function(e,t){varr=V("eSzHt");e.exports=(e,t,n)=>0===r(e,t,n);}),V.register("caa1L",function(e,t){varr=V("eSzHt");e.exports=(e,t,n)=>0!==r(e,t,n);}),V.register("1Ucjm",function(e,t){varr=V("eSzHt");e.exports=(e,t,n)=>r(e,t,n)>=0;}),V.register("fAXcL",function(e,t){varr=V("eSzHt");e.exports=(e,t,n)=>0>=r(e,t,n);}),V.register("2ImCS",function(e,t){varr=V("auc5a"),n=V("caa1L"),i=V("gtqtv"),o=V("1Ucjm"),s=V("3Nc7w"),a=V("fAXcL");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}`);}};}),V.register("255mi",function(e,t){varr=V("fYigo"),n=V("5DLUR"),i=V("eDlr8"),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);};}),V.register("7BD2X",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=V("kR8wQ"),o=V("eDlr8"),s=o.safeRe,a=o.t,l=V("2ImCS"),c=V("23sN8"),u=V("fYigo"),d=V("bGbOH");}),V.register("bGbOH",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(P(this.set[t],e,this.options))return!0;return!1;}}e.exports=r;varn=V("kS84i");leti=newn({max:1e3});varo=V("kR8wQ"),s=V("7BD2X"),a=V("23sN8"),l=V("fYigo"),c=V("eDlr8"),u=c.safeRe,d=c.t,p=c.comparatorTrimReplace,f=c.tildeTrimReplace,h=c.caretTrimReplace,m=V("6fF7q"),v=m.FLAG_INCLUDE_PRERELEASE,g=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=O(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;});},O=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(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],"")),A=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(),P=(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;};}),V.register("kS84i",function(e,t){varr=V("7o5x0");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(g(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];},v=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;g(e,t),t=r;}},g=(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)&&(g(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,v(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,v(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;})),v(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])returng(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),v(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),v(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?(g(this,e),e.value):null;}del(e){g(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));}};}),V.register("7o5x0",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;};}),V.register("kOEjN",function(e,t){varr=V("fYigo"),n=V("bGbOH"),i=V("gtqtv");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;};}),V.register("lSCGC",function(e,t){varr=V("bGbOH");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;}};}),V.register("kRbmr",function(e,t){varr=V("fYigo"),n=V("7BD2X");let{ANY:i}=n;varo=V("bGbOH"),s=V("eLOWZ"),a=V("gtqtv"),l=V("3Nc7w"),c=V("fAXcL"),u=V("1Ucjm");e.exports=(e,t,d,p)=>{letf,h,m,v,g;switch(e=newr(e,p),t=newo(t,p),d){case">":f=a,h=c,m=l,v=">",g=">=";break;case"<":f=l,h=u,m=a,v="<",g="<=";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===v||s.operator===g||(!a.operator||a.operator===v)&&h(e,a.semver)||a.operator===g&&m(e,a.semver))return!1;}return!0;};}),V.register("jjglH",function(e,t){// Determine if version is greater than all the versions possible in the range.
varr=V("kRbmr");e.exports=(e,t,n)=>r(e,t,">",n);}),V.register("52D05",function(e,t){varr=V("kRbmr");e.exports=(e,t,n)=>r(e,t,"<",n);}),V.register("3lRwj",function(e,t){varr=V("bGbOH");e.exports=(e,t,n)=>(e=newr(e,n),t=newr(t,n),e.intersects(t,n));}),V.register("ahb6l",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=V("eLOWZ"),n=V("eSzHt");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;};}),V.register("bfmht",function(e,t){varr=V("bGbOH"),n=V("7BD2X");let{ANY:i}=n;varo=V("eLOWZ"),s=V("eSzHt");leta=[newn(">=0.0.0-0")],l=[newn(">=0.0.0")],c=(e,t,r)=>{letn,c,p,f,h,m,v;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;}letg=newSet();for(lettofe)">"===t.operator||">="===t.operator?n=u(n,t,r):"<"===t.operator||"<="===t.operator?c=d(c,t,r):g.add(t.semver);if(g.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(leteofg){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(v=v||">"===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||!v||!!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;};}),V.register("eaZtc",function(e,t){varr=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if("string"!=typeofe)throwTypeError("Expected a string");returne.replace(r,"\\$&");};}),V.register("3WkGD",function(e,t){M(e.exports,"pathExists",()=>r);asyncfunctionr(e){try{returnawait(0,S.promises).access(e),!0;}catch{return!1;}}}),V.register("A8hFE",function(e,t){M(e.exports,"addExeExt",()=>l),M(e.exports,"addShExt",()=>d),M(e.exports,"addShRelativePrefix",()=>p),M(e.exports,"dirname",()=>h.dirname),M(e.exports,"join",()=>h.join);varr=V("9O4vc"),n=V("eVYO7");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__*/G(n)(e,t);}functionv(e,t){letr=(0,h.relative)(t,e);return!(!r||".."===r||r.startsWith(".."+h.sep)||r===(0,h.resolve)(e));}varg={},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);varO={};o(O,"removeExt",()=>f);var_={};o(_,"replaceExt",()=>m);varC={};o(C,"isPathInside",()=>v),i(g,y),i(g,w),i(g,x),i(g,E),i(g,b),i(g,S),i(g,$),i(g,O),i(g,_),i(g,C);}),V.register("9O4vc",function(e,t){M(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");}}),V.register("eVYO7",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;}),V.register("11Ly6",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";};}),V.register("8kgpT",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(V("lqN0l"));vara=V("2heqc");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;};}),V.register("bxsAi",function(e,t){varr=V("lyWSC"),n=V("2cprb");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);};}),V.register("lyWSC",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(){returnv.randomBytes(16);};}),V.register("2cprb",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=newv(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 v 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=_.setTimeout(v.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();}}}}),V.register("dDAlR",function(e,t){e.exports=Promise.resolve(require("./actions_python.c2017515.js")).then(()=>V("8L9T2"));});varz=V("cLprm"),W=V("hHq4F"),X=V("3abeg"),K={};(function(){V("ljv3o").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(K);varY={};Y=V("kAOmP");varQ={};Q={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"}}}};varJ={};constZ=f.homedir();J=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||B.TESTING_WINDOWS?V("gRK0M"):V("9ZovO"),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;varev={},eg={},ey={};ey=/^#!(.*)/,eg=(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;},ev=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&&ev(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:eO,verifyENOENTSync:function(e,t){returneS&&1===e&&!t.file?e$(t.original,"spawnSync"):null;},notFoundError:e$},(ec=e_).spawn=e_,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={},eA={};consteP=(e,t)=>{for(letrofReflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));returne;};// TODO: Remove this for the next major release
(eA=eP).default=eP;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;};returneA(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=[g,t,e].filter(Boolean).join("\n");return v?(n.originalMessage=n.message,n.message=y):n=Error(y),n.shortMessage=g,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;};var eQ={};const eJ=["stdin","stdout","stderr"],eZ=e=>eJ.some(t=>void 0!==e[t]),e0=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return eJ.map(t=>e[t]);if(eZ(e))throw Error(`It'snotpossibletoprovide\`stdio\` in combination with one of ${eJ.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,eJ.length);returnArray.from({length:r},(e,r)=>t[r]);};// `ipc` is pushed unless it is already present
(eQ=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=B.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,e8,e5=V("2dWxz"),e7=/^win/i.test(e4.platform),e9=x;"function"!=typeofe9&&(e9=e9.EventEmitter),e4.__signal_exit_emitter__?e8=e4.__signal_exit_emitter__:((e8=e4.__signal_exit_emitter__=newe9()).count=0,e8.emitted={}),e8.infinite||(e8.setMaxListeners(1/0),e8.infinite=!0);varte=function(){tn&&e3(B.process)&&(tn=!1,e5.forEach(function(e){try{e4.removeListener(e,tr[e]);}catch(e){}}),e4.emit=ta,e4.reallyExit=to,e8.count-=1);};(e2=function(e,t){/* istanbul ignore if */if(!e3(B.process))returnfunction(){};E.equal(typeofe,"function","a callback must be provided for exit handler"),!1===tn&&ti();varr="exit";returnt&&t.alwaysLast&&(r="afterexit"),e8.on(r,e),function(){e8.removeListener(r,e),0===e8.listeners("exit").length&&0===e8.listeners("afterexit").length&&te();};}).unload=te;vartt=function(e,t,r){e8.emitted[e]||(e8.emitted[e]=!0,e8.emit(e,t,r));},tr={};e5.forEach(function(e){tr[e]=function(){e3(B.process)&&e4.listeners(e).length===e8.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(){returne5;};vartn=!1,ti=function(){!tn&&e3(B.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.
e8.count+=1,e5=e5.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(B.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(B.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,tv=e1.spawnedCancel,tg=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,tO=b.promisify,t_={},tC=I.PassThrough;t_=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=tO(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=t_(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;vartA={},tP=I.PassThrough;tA=function(){vare=[],t=newtP({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=tA();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,tF=tx.validateInputSync,tM={};consttG=(async()=>{})().constructor.prototype,tB=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(tG,e)]);vartH=(tM={mergePromise:(e,t)=>{for(let[r,n]oftB){// 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,tq=tM.getSpawnedPromise,tV={};consttz=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],tW=/^[\w.-]+$/,tX=/"/g,tK=e=>"string"!=typeofe||tW.test(e)?e:`"${e.replace(tX,'\\"')}"`,tY=/ +/g;vartQ=(tV={joinCommand:(e,t)=>tz(e,t).join(" "),getEscapedCommand:(e,t)=>tz(e,t).map(e=>tK(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,tJ=tV.parseCommand,tZ=tV.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=eQ(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=tQ(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=tq(n),l=tg(n,i.options,a),c=tw(n,i.options,l),u={isCanceled:!1};n.kill=tm.bind(null,n.kill.bind(n)),n.cancel=tv.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(){vare;return((null===(e=process.getuid)||void0===e?void0:e.call(process))===0||!!process.env.CI)&&null!==/*@__PURE__*/G(ee).sync("sudo",{nothrow:!0});}functiont6(e,t=[],r={stdio:"inherit",shell:!0}){returnt3()?/*@__PURE__*/G(el).commandSync(`sudo ${[e,...t].map(e=>`'${e}'`).join(" ")}`,r):/*@__PURE__*/G(el).sync(e,t,r);}functiont8(e,t=[],r={stdio:"inherit",shell:!0}){returnt3()?/*@__PURE__*/G(el).command(`sudo ${[e,...t].map(e=>`'${e}'`).join(" ")}`,r):/*@__PURE__*/G(el)(e,t,r);}functiont5(e){returnt3()&&"string"==typeofprocess.env.SUDO_USER?// use the user profile even if root
${t}`,rO=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),r_=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",r_),Object.defineProperty(e,"toString",{...rO,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-rP+1},rA),rA=(e,t)=>({name:`SIGRT${t+1}`,number:rP+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),rP=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}`:v,w=[y,t,e].filter(Boolean).join("\n");return g?(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"],rq=e=>rH.some(t=>void 0!==e[t]),rV=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return rH.map(t=>e[t]);if(rq(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]);},rz=(e,t="SIGTERM",r={})=>{let n=e(t);return rW(e,t,r,n),n;},rW=(e,t,r,n)=>{if(!rX(t,r,n))return;let i=rY(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},rX=(e,{forceKillAfterTimeout:t},r)=>rK(e)&&!1!==t&&r,rK=e=>e===G(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;},rQ=(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},rJ=(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(()=>{rJ(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__*/G(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 P.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;},r8=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"));},r5=e=>{if(void 0!==e)throw TypeError("The`input`and`inputFile`optionscannotbebothset.");},r7=({input:e,inputFile:t})=>"string"!=typeof t?e:(r5(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:(r5(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__*/G(tA)();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__*/G(tS)(e,{encoding:t,maxBuffer:n}):/*@__PURE__*/G(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(" "),nv=/ +/g,ng=e=>{lett=typeofe;if("string"===t)returne;if("number"===t)returnString(e);if("object"===t&&null!==e&&!(einstanceofP.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=null!=i?i:e.raw[n],s=o.split(nv).filter(Boolean),a=ny(r,s,o.startsWith(" "));if(n===t.length)returna;letl=t[n],c=Array.isArray(l)?l.map(e=>ng(e)):[ng(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&&G(N).stderr.write(`[${nS()}] ${e}
`);},nO=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...G(N).env,...e}:e;return r?function({env:e=G(N).env,...t}={}){e={...e};let r=rx({env:e});return t.path=e[r],e[r]=function(e={}){let t;let{cwd:r=G(N).cwd(),path:n=G(N).env[rx()],execPath:i=G(N).execPath}=e,o=r instanceof URL?G(L).fileURLToPath(r):r,s=G(A).resolve(o),a=[];for(;t!==s;)a.push(G(A).join(s,"node_modules/.bin")),t=s,s=G(A).resolve(s,"..");return(// Ensure the running `node` binary is used.
a.push(G(A).resolve(o,i,"..")),[...a,n].join(G(A).delimiter));}(t),e;}({env:o,cwd:n,execPath:i}):o;},n_=(e,t,r={})=>{letn=/*@__PURE__*/G(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||G(N).cwd(),execPath:G(N).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:nE,...r}).env=nO(r),r.stdio=rV(r),"win32"===G(N).platform&&"cmd"===G(A).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=n_(e,t,r),o=nh(e,t),s=nm(e,t);n$(s,i.options),r0(i.options);try{n=G(P).spawn(i.file,i.args,i.options);}catch(r){// Ensure the returned error is always both a promise and a child process
lete=new(G(P).ChildProcess)(),t=Promise.reject(rB({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=rz.bind(null,n.kill.bind(n)),n.cancel=rQ.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=rB({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),r8(n),nl(n,p),n;}functionnT(e,t,r){letn;leti=n_(e,t,r),o=nh(e,t),s=nm(e,t);n$(s,i.options);leta=r9(i.options);try{n=G(P).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throwrB({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=rB({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"}:{},nA=(e={})=>({preferLocal:!0,...nR(e),...e});functionnP(t,r=["-NoProfile","-NoLogo","-NonInteractive"],n={stdio:"inherit"}){returnnI(function(){if(void0===e){lett=/*@__PURE__*/G(ee).sync("pwsh",{nothrow:!0});null!==t&&(e=t);letr=/*@__PURE__*/G(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,nA(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,nA(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");};varnF={};// Generated by CoffeeScript 1.10.0
(function(){vare,t;e=V("eaZtc"),t=function(e){returne.split("").reverse().join("");},nF=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(nF);varnM=V("3WkGD");constnG={shouldEscapeSpace:!1,shouldAddOnlyIfNotDefined:!1};asyncfunctionnB(e,t,r=nG){letn=function(e,t=!1){letr=t?/*@__PURE__*/G(nN)(e):e;return/*@__PURE__*/G(nF)(r,'"',"\\");}(null!=t?t:"",r.shouldEscapeSpace);try{if(z.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,W.error)(t),awaitnz(e,n,r);}elseawaitnz(e,n,r);}catch(t){(0,W.error)(t),(0,ry.setFailed)(`Failed to export environment variable ${e}=${n}. You should add it manually.`);}}constnH=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];asyncfunctionnq(e){if(!/** Skip adding /usr/bin to PATH if it is already there */function(e){if(nH.some(t=>t.test(e))){vart,r;letn=null!==(r=null===(t=process.env.PATH)||void0===t?void0:t.split(h.delimiter))&&void0!==r?r:[];returnn.includes(e);}return!1;}(e)){process.env.PATH=`${e}${h.delimiter}${process.env.PATH}`;try{if(z.GITHUB_ACTIONS)try{(0,ry.addPath)(e);}catch(t){(0,W.error)(t),awaitnW(e);}elseawaitnW(e);}catch(t){(0,W.error)(t),(0,ry.setFailed)(`Failed to add ${e} to the percistent PATH. You should add it manually.`);}}}constnV=t5(".cpprc");asyncfunctionnz(e,t,r){letn=null!=t?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
awaitnP(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),(0,ry.info)(`${e}='${n}' was set in the environment.`);return;case"linux":case"darwin":awaitnK(),r.shouldAddOnlyIfNotDefined?((0,m.appendFileSync)(nV,`
`),(0,ry.info)(`${e}="${n}"wasaddedto"${nV}`));return;}process.env[e]=n;}async function nW(e){switch(process.platform){case"win32":// We do not use `execaSync(`setx PATH "${path};%PATH%"`)`becauseofitscharacterlimitandalsobecause%PATH%isdifferentforuserandsystem
awaitnP(`$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":awaitnK(),(0,m.appendFileSync)(nV,`
`),(0,ry.info)(`"${e}"wasaddedto"${nV}"`);return;default:return;}}/* eslint-disable require-atomic-updates */let nX=!1;async function nK(){if(nX)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,nM.pathExists)(nV)){lett=(0,m.readFileSync)(nV,"utf8");if(t.includes(e))return;}(0,m.appendFileSync)(nV,`
lete=t5(".profile");(0,m.appendFileSync)(e,t),(0,ry.info)(`${t} was added to ${e}`);// source cpprc in .bashrc too
letr=t5(".bashrc");(0,m.appendFileSync)(r,t),(0,ry.info)(`${t} was added to ${r}`);}catch(e){(0,W.warning)(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${e}`);}nX=!0;}asyncfunctionnY(){if(await(0,nM.pathExists)(nV)){lete=(0,m.readFileSync)(nV,"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;}},n8=(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;}},n5=(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()&&n5(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);};nJ=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:iv}=m.promises;/* eslint-disable require-atomic-updates */letig=!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){varr;letn=iS()?"nala":"apt-get";for(let{name:t,version:r}ofe)(0,W.info)(`Installing ${t}${null!=r?r:""} via ${n}`);process.env.DEBIAN_FRONTEND="noninteractive",(!ig||t)&&(i$(n),ig=!0),iy||(awaitiO(n),iy=!0);leti=[...newSet(e.flatMap(e=>null!==(r=e.repositories)&&void0!==r?r:[]))];if(0!==i.length){for(leteofi)t6("add-apt-repository",["-y",e]);i$(n);}leto=awaitPromise.all(e.map(e=>ib(e.name,e.version)));try{t6(n,["install","--fix-broken","-y",...o]);}catch(e){if("stderr"ine){lett=e.stderr;iw.some(e=>t.includes(e))&&((0,W.warning)(`Failed to install packages ${o}. Retrying...`),t6(n,["install","--fix-broken","-y",...o]));}elsethrowe;}return{binDir:"/usr/bin/"};}asyncfunctioniE(e,t){if(void0!==t&&""!==t){let{stdout:r}=awaitnI("apt-cache",["search","--names-only",`^${(0,nQ.default)(e)}-${(0,nQ.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}${null!=t?t:""}`);}}functioniS(){returnnull!==/*@__PURE__*/G(nJ).sync("nala",{nothrow:!0});}functioni$(e){t6(e,"nala"!==e?["update","-y"]:["update"]);}/** Install apt utils and certificates (usually missing from docker containers) */asyncfunctioniO(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(nB("LANG","C.UTF-8",{shouldAddOnlyIfNotDefined:!0}),nB("LC_ALL","C.UTF-8",{shouldAddOnlyIfNotDefined:!0})),awaitPromise.all(t);}functioni_(){t6("gpg",["-k"]);}asyncfunctioniC(e,t,r="keyserver.ubuntu.com"){try{letn=`/etc/apt/trusted.gpg.d/${t}`;return(await(0,nM.pathExists)(n))||(i_(),awaitPromise.all(e.map(asynce=>{awaitt8("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--keyserver",r,"--recv-keys",e]),awaitt8("chmod",["644",n]);}))),n;}catch(e){(0,W.warning)(`Failed to add apt key via server ${r}: ${e}`);return;}}asyncfunctioniI(e,t){letr=`/etc/apt/trusted.gpg.d/${e}`;return(await(0,nM.pathExists)(r))||(i_(),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){returnz.GITHUB_ACTIONS?t8("update-alternatives",["--install",`/usr/bin/${e}`,e,t,"40"]):(awaitnK(),iv(nV,`
`));}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=V("2heqc"),iA=(V("A8hFE"),V("A8hFE")),iP=V("kSdX3");asyncfunctioniN(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeoft)return{binDir:t};leti=/*@__PURE__*/G(nJ).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,iA.dirname)(i)};// brew is not thread-safe
leti=process.env.PATH,o={...process.env};if(deleteo.TMP,deleteo.TEMP,deleteo.Path,o.PATH=i,void0!==t&&""!==t)nT("choco",["install","-y",e,`--version=${t}`,...r],{env:o,extendEnv:!1,stdio:"inherit"});elsetry{nT("choco",["install","-y",e,...r],{env:o,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,W.info)(`${e} might require a reboot for the completion of the installation.`);elsethrowt;}lets=`${null!==(n=process.env.ChocolateyInstall)&&void0!==n?n:"C:/ProgramData/chocolatey"}/bin`;returnawaitnq(s),{binDir:s};}functioniM(){return"linux"===process.platform&&(void0===o&&(o=null!==/*@__PURE__*/G(nJ).sync("pacman",{nothrow:!0})),o);}functioniG(){return"linux"===process.platform&&(void0===s&&(s=null!==/*@__PURE__*/G(nJ).sync("dnf",{nothrow:!0})),s);}asyncfunctioniB(e){for(let{name:t,version:r}ofe)(0,W.info)(`Installing ${t}${null!=r?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}`;(0,W.warning)(`Failed to install ${e}${t} via dnf, trying without version`);}}returne;}functioniq(){return"linux"===process.platform&&(void0===a&&(a=null!==/*@__PURE__*/G(nJ).sync("apt-get",{nothrow:!0})),a);}asyncfunctioniV(e,t,r){switch(process.platform){case"win32":// install bazelisk because it contains both
returniF("bazelisk",e);case"darwin":// install bazelisk because it contains both
returniD("bazelisk",e);case"linux":if(iM())throwError("installing bazel on Arch linux is not supported yet");if(iG())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");}}varW=(V("hHq4F"),V("hHq4F"));/* eslint-disable require-atomic-updates */letiz=!1,iW=!1;asyncfunctioniX(e,t,r){(0,W.info)(`Installing ${e}${null!=t?t:""} via pacman`);letn="pacman";if("yay"===r&&null===/*@__PURE__*/G(nJ).sync("yay",{nothrow:!0}))throwError(`yay is needed for ${e}, but it is not installed, please install it manually first`);iz||"yay"===r||(t6(n,["-Sy","--noconfirm"]),iz=!0),iW||"yay"===r||(t6(n,["-S","--noconfirm","base-devel"]),iW=!0);leti=e=>"yay"===r?nT(r,["-S","--noconfirm",e]):t6(null!=r?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,W.info)(`Failed to install ${e}${t} via pacman, trying without version`),i(e);}elsei(e);return{binDir:"/usr/bin/"};}constiK=/Version\s*:\s*(.*)/g;/** Query pacman for available versions */asyncfunctioniY(e,t){letr=[];try{let{stdout:n}=awaitnI(e,["-Si",t]);for(leteofn.matchAll(iK))r.push(e[1]);}catch(e){(0,W.warning)(`Failed to get available versions for ${t}: ${e}`);}returnr;}variQ={},iJ=h.resolve(__dirname,"../../node_modules/.pnpm/@actions+tool-cache@2.0.1/node_modules/@actions/tool-cache/lib"),iZ=iQ&&iQ.__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=iQ&&iQ.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i1=iQ&&iQ.__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=iQ&&iQ.__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=iQ&&iQ.__importDefault||function(e){returne&&e.__esModule?e:{default:e};};Object.defineProperty(iQ,"__esModule",{value:!0}),iQ.evaluateVersions=iQ.isExplicitVersion=iQ.findFromManifest=iQ.getManifestFromRepo=iQ.findAllVersions=iQ.find=iQ.cacheFile=iQ.cacheDir=iQ.extractZip=iQ.extractXar=iQ.extractTar=iQ.extract7z=iQ.downloadTool=iQ.HTTPError=void0;consti3=i1(V("2heqc")),i6=i1(V("kSdX3")),i8=i1(m),i5=i1(V("8kgpT")),i7=i1(f),i9=i1(h),oe=i1(V("kZ2GT")),ot=i1(V("lqN0l")),or=i1(I),on=i1(b),oi=i4(V("bxsAi"));varoo=V("2mVwa"),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(V("2heqc"));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,i8.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);});},iQ.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 ov(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(iJ,"..","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=yieldov(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}`),!i8.statSync(e).isDirectory())throw Error("sourceDir is not a directory");//Createthetooldir
leti=yieldog(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}`),!i8.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}`),i8.existsSync(i)&&i8.existsSync(`${i}.complete`)?(i3.debug(`Found tool in cache ${e}${t}${r}`),n=i):i3.debug("not found");}returnn;},iQ.findAllVersions=om,iQ.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;});},iQ.findFromManifest=function(e,t,r,n=i7.arch()){returni2(this,void0,void0,function*(){// wrap the internal impl
leti=yieldi5._findMatch(e,t,r,n);returni;});},iQ.isExplicitVersion=ow,iQ.evaluateVersions=ox;varo$=V("fAXcL"),oO=V("255mi"),iA=V("A8hFE"),W=V("hHq4F"),z=V("cLprm"),nM=V("3WkGD"),o_={};Object.defineProperty(o_,"__esModule",{value:!0}),o_.retryAsPromised=o_.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);});});}o_.TimeoutError=oC,o_.retryAsPromised=oI,o_.default=oI;letoT=!1;asyncfunctionoR(e,t,r,n,i){varo,s;(0,W.info)(`Installing ${e}${t}${i} via direct downloading`),process.env.RUNNER_TEMP=null!==(o=process.env.RUNNER_TEMP)&&void0!==o?o:(0,f.tmpdir)(),process.env.RUNNER_TOOL_CACHE=null!==(s=process.env.RUNNER_TOOL_CACHE)&&void0!==s?s:(0,iA.join)((0,f.tmpdir)(),"setup-cpp","hostedtoolcache");let{url:a,binRelativeDir:l,binFileName:c,extractedFolderName:u,extractFunction:d}=awaitr(t,process.platform,i);// Restore from cache (if found).
if(z.GITHUB_ACTIONS)try{letr=(0,iQ.find)(e,t);if(r){letn=(0,iA.join)(r,u),i=(0,iA.join)(n,l);if(await(0,nM.pathExists)((0,iA.join)(i,c)))return(0,W.info)(`${e}${t} was found in the cache at ${i}.`),awaitnq(i),{installDir:n,binDir:i};}}catch{// fails on a local machine?
}letp=(0,iA.join)(n,u),h=(0,iA.join)(p,l),m=(0,iA.join)(h,c);// download ane extract the package into the installation directory.
if((awaitPromise.all([(0,nM.pathExists)(h),(0,nM.pathExists)(m)])).includes(!1))try{(0,W.info)(`Download ${e}${t}`);// try to download the package 4 times with 2 seconds delay
oT=!0),(0,W.info)(`Extracting ${r} to ${n}`),await(null==d?void0:d(r,n));// if (typeof extractedBinDir === "string") {
// binDir = extractedBinDir
// installDir = extractedBinDir
// }
}catch(r){throwError(`Failed to download ${e}${t}${i} from ${a}: ${r}`);}return(// Adding the bin dir to the path
/** The directory which the tool is installed to */(0,W.info)(`Add ${h} to PATH`),awaitnq(h),z.GITHUB_ACTIONS&&"string"==typeofprocess.env.RUNNER_TOOL_CACHE&&(await(0,iQ.cacheDir)(n,e,t)),{installDir:p,binDir:h});}variA=V("A8hFE"),iP=V("kSdX3");functionoA(e,t,r){switch(process.platform){case"win32":returniF("7zip",e);case"darwin":returniD("p7zip",e);case"linux":if(iM())returniX("p7zip",e);if(iG())returniB([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(iq())returnix([{name:"p7zip-full",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}varW=V("hHq4F");asyncfunctionoP(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,W.warning)(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`);}returnnj(t),t;}/** Get the platform data for cmake */functionoU(e,t,r){varn;leti=null!==(n=/*@__PURE__*/G(oO)(e))&&void0!==n?n:e;switch(t){case"win32":{lett;letn=/*@__PURE__*/G(o$)(i,"v3.19.6");t=["ia32","x86","i386","x32"].includes(r)?n?"win32-x86":"windows-i386":n?"win64-x64":"windows-x86_64";leto=`cmake-${e}-${t}`;return{binRelativeDir:"bin/",binFileName:(0,iA.addExeExt)("cmake"),extractedFolderName:o,extractFunction:ok,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${o}.zip`};}case"darwin":{lett=/*@__PURE__*/G(o$)(i,"v3.19.1"),r=`cmake-${e}-${t?"Darwin-x86_64":"macos-universal"}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:(0,iA.addExeExt)("cmake"),extractedFolderName:r,extractFunction:iQ.extractTar,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${r}.tar.gz`};}case"linux":{lett;letn=/*@__PURE__*/G(o$)(i,"v3.19.8");t=["aarch64"].includes(r)?n?"Linux-aarch64":"linux-aarch64":n?"Linux-x86_64":"linux-x86_64";leto=`cmake-${e}-${t}`;return{binRelativeDir:"bin/",binFileName:(0,iA.addExeExt)("cmake"),extractedFolderName:o,extractFunction:iQ.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=V("2heqc"),nM=V("3WkGD"),iA=V("A8hFE"),oo=V("2mVwa"),z=V("cLprm"),W=V("hHq4F"),oF={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},oM=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 oV(e,t){if(void 0===t&&(t={}),"function"==typeof e&&e.isMemoized)return oV(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?oB: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)oF[r]||(t[r]=e[r]);/*eslint-enable*/return t;}(t)),p=new oq(d),f=p.keys,h=p.values,m=p.canTransformKey,v=p.shouldCloneArguments,g=p.shouldUpdateOnAdd,y=p.shouldUpdateOnChange,w=p.shouldUpdateOnHit,x=function(){var t=v?oG(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=v?t:oG(arguments);p.orderByLru(i,n,f.length),o&&p.updateAsyncCache(x),g&&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 iA=V("A8hFE");function oz(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 oW=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;}},oX=async e=>{let t=oW(e);if(!t)return!1;let r=await oz(e,"HEAD");return!!r||!!(r=await oz(e,"GET"));},oK=V("eSzHt"),oO=V("255mi"),oY=V("eO4vc"),oo=V("2mVwa"),W=V("hHq4F");function oQ(e,t){return Array.from(e).filter(e=>/^\d+\.\d+\.\d+$/.test(e)&&e.startsWith(t)).sort((e,t)=>{try{return/*@__PURE__*/G(oK)(e,t);}catch(r){returne.localeCompare(t);}}).reverse();}asyncfunctionoJ(e,t,r,n){// specific ubuntu version
if(null!==e&&(awaitoX(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(awaitoX(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{varr,n;leti=await(0,oo.getExecOutput)(e,["--version"]),o=i.stdout||i.stderr||"",s=null===(r=o.trim().match(t))||void0===r?void0:r[1];returnnull!==(n=/*@__PURE__*/G(oO)(s))&&void0!==n?n:void0;}catch(e){console.error(e);return;}}asyncfunctiono1(e,t,r=oZ){letn=awaito0(e,r);returnvoid0!==n&&""!==t&&-1!==/*@__PURE__*/G(oK)(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:iM()?"1.9.8-1":"1.9.8",gcc:iM()?"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"}};varnM=V("3WkGD");asyncfunctiono8(e,t,r){letn=awaito9(e,t,r);G(E)(void0!==n.bin);leti=n.bin,o=awaitsn(i);if(void0===o)throwError("pip was not installed correctly");returnawaito5(i),awaito7(i),n;}asyncfunctiono5(e){try{(awaitsw(e))||(awaitsy(e,"pipx",void0,{upgrade:!0,usePipx:!1})),awaitnI(e,["-m","pipx","ensurepath"],{stdio:"inherit"}),awaitsy(e,"venv",void0,{upgrade:!1,usePipx:!1});}catch(e){(0,W.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,W.warning)(`Failed to install setuptools or wheel: ${e.toString()}. Ignoring...`);}}asyncfunctiono9(e,t,r){letn;leti=awaitst(t);if(void0!==i){lete=(0,iA.dirname)(i);n={bin:i,installDir:e,binDir:e};}else{// if python is not found, try to install it
if(z.GITHUB_ACTIONS)try{(0,W.info)("Installing python in GitHub Actions");let{setupActionsPython:o}=awaitV("dDAlR");awaito(e,t,r),i=awaitst(t);lets=(0,iA.dirname)(i);n={bin:i,installDir:s,binDir:s};}catch(e){(0,W.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?awaitiF("python3",t,[`--params=/InstallDir:${e}`]):awaitiF("python3",t);// Adding the bin dir to the path
letn=awaitst(e),i=(0,iA.dirname)(n);/** The directory which the tool is installed to */awaitnq(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,iA.join)(e.stdout,"libexec","bin");awaitnq(n);break;}case"linux":if(iM())r=awaitiX("python",t);elseif(iG())r=awaitiB([{name:"python3",version:t}]);elseif(iq())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
awaitsa(e));}asyncfunctionsa(e){try{returnawaitnI(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0;}catch(n){vart,r;(0,W.info)(null==n?void0:null===(t=n.toString)||void0===t?void0:t.call(n));try{return(// ensure pip is disabled on Ubuntu
awaitnI(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0);}catch(e){(0,W.info)(null==e?void0:null===(r=e.toString)||void0===r?void0:r.call(e));// 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,iA.join)(r,"Scripts"),(0,iA.join)(r,"Scripts","bin"),(0,iA.join)(r,"bin")),[...newSet(t)]);}constsc=oV(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?"":null!=t?t:"";}functionsd(e){return"true"===e||void0===e;}varW=V("hHq4F"),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(!iq())returnnull;{try{null===/*@__PURE__*/G(nJ).sync("lsb_release",{nothrow:!0})&&(awaitix([{name:"lsb-release"}]));}catch{returnsv();}lete=await(0,sp.getUbuntuVersion)();if(0===e.length)returnsv();returne;}}catch(e){return(0,W.warning)(e.toString()),null;}}Object.defineProperty(sp,"__esModule",{value:!0}),sp.getUbuntuVersion=void0,sp.getUbuntuVersion=sf;constsm=oV(sh);/** Detect Ubuntu version using os.version() for Ubuntu based distros */functionsv(){// #46~22.04.1-Ubuntu SMP ...
lete=G(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];}asyncfunctionsg(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}${null!=r?r:""} via ${c}`);letu=awaitsb(e,t);if(u)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((0,ry.info)(`Failed to install ${t} via ${c}: ${e}.`),(awaits$(t))===null)throwError(`Failed to install ${t} via ${c}: ${e}.`);}elseif((awaits$(t))===null)throwError(`Failed to install ${t} as it was not found via ${c} or the system package manager`);letd=awaitsc(e),p=awaitsS(d,t);returnawaitnq(p),{binDir:p};}asyncfunctionsw(e){return0===(awaitnI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}asyncfunctionsx(){lete=(awaito8(su("python",void0,awaitsm()),"",process.arch)).bin;if(void0===e)throwError("Python binary was not found");returne;}constsE=oV(sx);asyncfunctionsb(e,t){letr=awaitnI(e,["-m","pip","show",t],{stdio:"ignore",reject:!1});return0===r.exitCode;}asyncfunctionsS(e,t){letr=awaitPromise.all(e.map(e=>(0,nM.pathExists)((0,iA.join)(e,(0,iA.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){lett=e[n];returnt;}leti=/*@__PURE__*/G(nJ).sync((0,iA.addExeExt)(t),{nothrow:!0});returnnull!==i?(0,iA.dirname)(i):e[e.length-1];}functions$(e){if("linux"===process.platform){if((0,ry.info)(`Installing ${e} via the system package manager`),iM())returniX(`python-${e}`);if(iG())returniB([{name:`python3-${e}`}]);if(iq())returnix([{name:`python3-${e}`}]);}returnnull;}asyncfunctionsO(e,t,r){switch(process.platform){case"win32":{awaitiF("cppcheck",e);lett=awaits_();return{binDir:t};}case"darwin":returniD("cppcheck",e);case"linux":if(iM())returniX("cppcheck",e);if(iG())returniB([{name:"ccache",version:e}]);if(iq())returnix([{name:"cppcheck",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}asyncfunctions_(){lete="C:/Program Files/Cppcheck";returnawaitnq(e),e;}variA=V("A8hFE"),W=V("hHq4F");asyncfunctionsC(e,t,r){switch(process.platform){case"win32":returnawaitiF("graphviz",e),sI();case"darwin":returniD("graphviz",e);case"linux":if(iM())returniX("graphviz",e);if(iG())returniB([{name:"graphviz",version:e}]);if(iq())returnix([{name:"graphviz",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}asyncfunctionsI(){if("win32"===process.platform){lete="C:/Program Files/Graphviz/bin";returnawaitnq(e),{binDir:e};}throwError("Unsupported platform");}varnM=V("3WkGD");/** Get the platform data for cmake */// eslint-disable-next-line @typescript-eslint/no-unused-vars
functionsT(e,t,r){switch(t){case"linux":{lett=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:(0,iA.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:iQ.extractTar,url:`https://www.doxygen.nl/files/${t}.linux.bin.tar.gz`};}case"win32":{lett=`doxygen-${e}`;return{binRelativeDir:"",binFileName:(0,iA.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:ok,url:`https://www.doxygen.nl/files/${t}.windows.x64.bin.zip`};}default:throwError(`Unsupported platform '${t}'`);}}asyncfunctionsR(e,t,r){switch(process.platform){case"win32":{// try to download the package 4 times with 2 seconds delay
await/*@__PURE__*/G(o_)(()=>iF("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:e=>(0,W.info)(e)});lett=awaitsA();returnawaitsC(su("graphviz",void0),"",r),{binDir:t};}case"darwin":{lete=awaitiD("doxygen",void0);returnawaitsC(su("graphviz",void0),"",r),e;}case"linux":{letn;if(""===e||iM()||iG()){if(iM())n=awaitiX("doxygen",e);elseif(iG())returniB([{name:"doxygen",version:e}]);elseif(iq())n=awaitix([{name:"doxygen",version:e}]);elsethrowError("Unsupported linux distributions");}elseif(iq())try{// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
n=awaitoR("doxygen",e,sT,t,r),awaitix([{name:"libclang-cpp9"}]);}catch(e){(0,W.notice)(`Failed to download doxygen binary. ${e}. Falling back to apt-get.`),n=awaitix([{name:"doxygen"}]);}elsethrowError("Unsupported linux distributions");returnawaitsC(su("graphviz",void0,awaitsm()),"",r),n;}default:throwError("Unsupported platform");}}asyncfunctionsA(){if("win32"===process.platform){for(leteof["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await(0,nM.pathExists)((0,iA.join)(e,"doxygen.exe")))return(// eslint-disable-next-line no-await-in-loop
awaitnq(e),e);throwError("Failed to find doxygen binary");}throwError("Unsupported platform");}varsP=V("7GceF"),oO=V("255mi"),oo=V("2mVwa"),W=V("hHq4F");asyncfunctionsN(){if("darwin"===process.platform)try{lete=await(0,oo.getExecOutput)("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?awaitnB("SDKROOT",t.trim()):(0,W.error)("SDKROOT not set");}catch(e){(0,W.error)(e);}}variA=V("A8hFE"),W=V("hHq4F"),z=V("cLprm"),nM=V("3WkGD"),sL=h.resolve(__dirname,"../../src/gcc");// https://github.com/brechtsanders/winlibs_mingw/releases
constsk={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"}};functionsD(e,t,r){if("win32"===t){lett=sk[e];if(void0===t)throwError(`mingw version ${e} is not supported`);return{binRelativeDir:"bin/",binFileName:(0,iA.addExeExt)("g++"),extractedFolderName:"mingw64",extractFunction:oP,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}'`);}asyncfunctionsU(e,t,r){letn;switch(process.platform){case"win32":("arm"===r||"arm64"===r)&&(awaitiF("gcc-arm-embedded",e));try{n=awaitoR("g++",e,sD,t,r);}catch(t){(0,W.info)(`Failed to download g++ binary. ${t}. Falling back to chocolatey.`),n=awaitsF(e,r);}break;case"darwin":n=awaitiD("gcc",e);break;case"linux":"x64"===r?iM()?n=awaitiX("gcc",e):iG()?n=awaitiB([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]):iq()&&(n=awaitix([{name:"gcc",version:e,repositories:["ppa:ubuntu-toolchain-r/test"]},{name:"g++",version:e,repositories:["ppa:ubuntu-toolchain-r/test"]}])):((0,W.info)(`Install g++-multilib because gcc for ${r} was requested`),iM()?awaitiX("gcc-multilib",e):iq()&&(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)
default:throwError(`Unsupported platform for ${r}`);}if(void0!==n)returnawaitsM(e,n.binDir),n;}asyncfunctionsj(e,t,r){letn;switch(process.platform){case"win32":case"darwin":returnsU(e,t,r);case"linux":iM()?n=awaitiX("mingw-w64-gcc",e):iG()?n=awaitiB([{name:"mingw64-gcc",version:e}]):iq()&&(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) ...
returnn;}asyncfunctionsF(e,t){varr,n;leti;if(awaitiF("mingw",e),"x64"===t&&(await(0,nM.pathExists)("C:/tools/mingw64/bin"))?(i="C:/tools/mingw64/bin",awaitnq(i)):"ia32"===t&&(await(0,nM.pathExists)("C:/tools/mingw32/bin"))?(i="C:/tools/mingw32/bin",awaitnq(i)):(await(0,nM.pathExists)(`${null!==(r=process.env.ChocolateyInstall)&&void0!==r?r:"C:/ProgramData/chocolatey"}/bin/g++.exe`))&&(i=`${null!==(n=process.env.ChocolateyInstall)&&void0!==n?n:"C:/ProgramData/chocolatey"}/bin`),void0!==i)return{binDir:i};}asyncfunctionsM(e,t){letr=[];// Setup gcc as the compiler
if("win32"===process.platform)r.push(nB("CC",(0,iA.addExeExt)(`${t}/gcc`)),nB("CXX",(0,iA.addExeExt)(`${t}/g++`)));else{varn;leti=/*@__PURE__*/G(sP)(null!==(n=/*@__PURE__*/G(oO)(e))&&void0!==n?n:e);i>=5?(r.push(nB("CC",`${t}/gcc-${i}`),nB("CXX",`${t}/g++-${i}`)),iq()&&r.push(iT("cc",`${t}/gcc-${i}`),iT("cxx",`${t}/g++-${i}`),iT("gcc",`${t}/gcc-${i}`),iT("g++",`${t}/g++-${i}`))):(r.push(nB("CC",`${t}/gcc-${e}`),nB("CXX",`${t}/g++-${e}`)),iq()&&r.push(iT("cc",`${t}/gcc-${e}`),iT("cxx",`${t}/g++-${e}`),iT("gcc",`${t}/gcc-${e}`),iT("g++",`${t}/g++-${e}`)));}r.push(sN()),z.GITHUB_ACTIONS&&(awaitsG()),awaitPromise.all(r);}asyncfunctionsG(){lete=(0,iA.join)(sL,"gcc_matcher.json");if(!(await(0,nM.pathExists)(e)))return(0,W.warning)("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");(0,W.info)(`::add-matcher::${e}`);}varoY=V("eO4vc"),sP=V("7GceF"),iA=V("A8hFE"),W=V("hHq4F"),iA=V("A8hFE");/** 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,iA.addExeExt)("ninja"),extractedFolderName:"",extractFunction:ok,url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`};}functionsH(e,t,r){returnoR("ninja",e,sB,t,r);}varsq=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,iA.addExeExt)("kcov"),extractFunction:oD};}functionsz(e){return{url:`https://github.com/SimonKagstrom/kcov/archive/refs/tags/${e}.tar.gz`,extractedFolderName:"",binRelativeDir:"build/src",binFileName:(0,iA.addExeExt)("kcov"),extractFunction:sW};}asyncfunctionsW(e,t){letr=awaitoD(e,t,["--strip-components=1"]),n=awaitsX();"linux"===process.platform&&(iM()?awaitPromise.all([iX("libdwarf"),iX("libcurl-openssl")]):iG()?awaitiB([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):iq()&&(awaitix([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}])));// apply gcc13.patch
try{if(null!==/*@__PURE__*/G(nJ).sync("patch",{nothrow:!0})){lete=(0,iA.join)(sq,"gcc13.patch");awaitnI("patch",["-N","-p1","-i",e],{cwd:r,stdio:"inherit"});}else(0,W.info)("`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13");}catch{// ignore
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;}asyncfunctionsX(){lete=/*@__PURE__*/G(nJ).sync("cmake",{nothrow:!0});if(null===e){let{binDir:t}=awaitoj(su("cmake",void0,awaitsm()),(0,iA.join)(t5(""),"cmake"),"");e=(0,iA.join)(t,"cmake");}lett=/*@__PURE__*/G(nJ).sync("ninja",{nothrow:!0});returnnull===t&&(awaitsH(su("ninja",void0,awaitsm()),(0,iA.join)(t5(""),"ninja"),"")),e;}asyncfunctionsK(e,t,r){varn;leti;if("linux"!==process.platform){(0,W.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);},sZ.issueCommand=s4,sZ.issue=function(e,t=""){s4(e,{},t);};class s3{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}=${s2.toCommandValue(n).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return t+`::${(e=this.message,s2.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A"))}`;}}var s6={},s8=s6&&s6.__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(s6,"__esModule",{value:!0});// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */consts5=s8(m),s7=s8(f);s6.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,`${s2.toCommandValue(t)}${s7.EOL}`,{encoding:"utf8"});};consts9=sJ(f),ae=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();},sY.setOutput=/**
letn=function(e,t){try{return$.execSync(`vswhere -products * ${t} -prerelease -property installationPath`).toString().trim()+"\\"+e;}catch(e){sY.warning(`vswhere failed: ${e}`);}returnnull;}("VC\\Auxiliary\\Build\\vcvarsall.bat",t);if(n&&m.existsSync(n))returnsY.info(`Found with vswhere: ${n}`),n;sY.info("Not found with vswhere");// If that does not work, try the standard installation locations,
leti=e?[function(e){if(Object.keys(al).includes(e));elsefor(let[t,r]ofObject.entries(al))if(r===e)returnt;returne;}(e)]:aa;for(leteofao)for(lettofi)for(letrofas)if(n=`${e}\\Microsoft Visual Studio\\${t}\\${r}\\VC\\Auxiliary\\Build\\vcvarsall.bat`,sY.info(`Trying standard location: ${n}`),m.existsSync(n))returnsY.info(`Found standard location: ${n}`),n;if(sY.info("Not found in standard locations"),// Special case for Visual Studio 2015 (and maybe earlier), try it out too.
n=`${ai}\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat`,m.existsSync(n))returnsY.info(`Found VS 2015: ${n}`),n;throwsY.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){sY.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+au;// 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.
if(!e.includes("="))continue;let[t,r]=e.split("=");r!==v[t]&&(sY.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.
*/const am=e=>void 0===globalThis.DOMException?new ah(e):new DOMException(e),av=e=>{let t=void 0===e.reason?am("This operation was aborted."):e.reason;return t instanceof Error?t:am(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(av(e)),e.addEventListener("abort",()=>{l(av(e));});}if(n===Number.POSITIVE_INFINITY){e.then(a,l);return;}// We create the error outside of `setTimeout` to preserve the stack trace.
letc=newaf();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=null!=o?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;}(ay(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,W.error)(t),s.push(`${e} failed to install`);}return(0,ry.endGroup)(),l;}asyncfunctionay(e,t,r,n,i,o,s){leta;if("vcvarsall"===e)awaitap(su(e,t,r),void0,n,void0,void0,!1,!1);else{// get the setup function
s.push(a7(e,a)),i);}const{readFile:aw,writeFile:ax,chmod:aE}=m.promises;asyncfunctionab(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=awaitaS("/tmp/llvm.sh","/tmp/llvm-setup-cpp.sh");returnawaitix(r),awaitaE("/tmp/llvm-setup-cpp.sh","755"),awaitt8("bash",["/tmp/llvm-setup-cpp.sh",`${e}`,"all"],{stdio:"inherit",shell:!0,timeout:12e5}),awaitnq(`${t}/bin`),{installDir:`${t}`,binDir:`${t}/bin`,bin:`${t}/bin/clang++`};}asyncfunctionaS(e,t){varr,n;leti=awaitaw(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=awaita$(i),i=// use nala if it is available
iS()?n.replace(/apt-get/g,"nala"):n,awaitax(t,i),[{name:"lsb-release"},{name:"wget"},{name:"software-properties-common"},{name:"gnupg"}];}asyncfunctiona$(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"]),aI=newMap(),aT={"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. */functionaA(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. */asyncfunctionaN(e){lett;if(a_.has(e))returnnull;letr="LLVM-",n=/*@__PURE__*/G(o$)(e,"3.7.0")?"-win32.exe":"-win64.exe",i=/*@__PURE__*/G(o$)(e,"9.0.1"),o=!1;returni&&(t=aP(e,r,n),(awaitoX(t))||(o=!0// fallback to github
)),(o||!i)&&(t=aA(e,r,n)),t;}functionaL(e,t){switch(e){case"darwin":return(/** Gets an LLVM download URL for the Darwin platform. */function(e){if(aC.has(e))returnnull;lett="9.0.0"===e?"-darwin-apple":"-apple-darwin",r="clang+llvm-",n=`-x86_64${t}.tar.xz`;return/*@__PURE__*/G(o$)(e,"9.0.1")?aP(e,r,n):aA(e,r,n);}(t));case"linux":returnfunction(e){lett,r,n=e,i=aI.get(n);// ubuntu-version is specified
if(void0!==i&&(n=i),n.includes("ubuntu")){lete=n.replace(/-ubuntu-.*/,"");if(!aO.has(e))throwError(`Unsupported Ubuntu version: ${e}`);t=n.replace(e,""),n=oQ(aO,e)[0];}else""!==n&&ninaT?t=aT[n]:(// default to the maximum version
t=aT[aR],(0,W.warning)(`Falling back to LLVM version ${aR}${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__*/G(o$)(n,"9.0.1"))?aP(n,o,r):aA(n,o,r);}(t);case"win32":returnaN(t);default:returnnull;}}asyncfunctionak(e,t,r){let[n,i]=awaitoJ(aO,t,e,aL);return(0,W.info)(`specific llvm version: ${n}`),{url:i,extractedFolderName:"",binRelativeDir:"bin",binFileName:(0,iA.addExeExt)("clang"),extractFunction:"win32"===t?oL:(e,t)=>oD(e,t,["--strip-components=1"])};}varaD=h.resolve(__dirname,"../../src/llvm");asyncfunctionaU(e,t,r){varn;leti=awaitaF(e,t,r);returnawaitaz(null!==(n=i.installDir)&&void0!==n?n:t),i;}asyncfunctionaj(e,t,r){// install LLVM and its dependencies in parallel
let[n,i,o]=awaitPromise.all([aG(e,t,r),aV(r),aW()]);returnn;}constaF=oV(aj,{isPromise:!0});functionaM(e,t,r){returnaG(e,t,r);}asyncfunctionaG(e,t,r){letn=function(e){if(null===/*@__PURE__*/G(oY)(e))try{// find the semver version of an integer
}returne;}(e),i=parseInt(n.split(".")[0],10);try{if(iq())returnawaitab(i);}catch(e){(0,W.info)(`Failed to install llvm via system package manager ${e}`);}leto=awaitoR("llvm",e,ak,t,r);returnawaitaH(i),o;}asyncfunctionaB(e){iq()&&(e<=10?awaitix([{name:"libtinfo5"}]):awaitix([{name:"libtinfo-dev"}]));}constaH=oV(aB,{isPromise:!0});asyncfunctionaq(e){"linux"===process.platform&&(awaitsU(su("gcc",void0,awaitsm()),"",e));}constaV=oV(aq,{isPromise:!0});asyncfunctionaz(e){vart,r;letn=null!==(t=process.env.LD_LIBRARY_PATH)&&void0!==t?t:"",i=null!==(r=process.env.DYLD_LIBRARY_PATH)&&void0!==r?r:"",o=[nB("LLVM_PATH",e),nB("LD_LIBRARY_PATH",`${e}/lib${h.delimiter}${n}`),nB("DYLD_LIBRARY_PATH",`${e}/lib${h.delimiter}${i}`),nB("LDFLAGS",`-L"${e}/lib"`),nB("CPPFLAGS",`-I"${e}/include"`),nB("CC",(0,iA.addExeExt)(`${e}/bin/clang`)),nB("CXX",(0,iA.addExeExt)(`${e}/bin/clang++`)),nB("LIBRARY_PATH",`${e}/lib`),sN()];iq()&&o.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(o);}asyncfunctionaW(){if(z.GITHUB_ACTIONS){lete=(0,iA.join)(aD,"llvm_matcher.json");if(!(await(0,nM.pathExists)(e)))return(0,W.warning)("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");(0,W.info)(`::add-matcher::${e}`);}}asyncfunctionaX(e,t,r){switch(process.platform){case"win32":returniF("make",e);case"darwin":returnawaitiD("make",e),awaitnq("/usr/local/opt/make/libexec/gnubin"),{binDir:"/usr/local/opt/make/libexec/gnubin"};case"linux":if(iM())returniX("make",e);if(iG())returniB([{name:"make",version:e}]);if(iq())returnix([{name:"make",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}}varz=V("cLprm"),iA=V("A8hFE"),W=V("hHq4F"),nM=V("3WkGD"),aK=h.resolve(__dirname,"../../src/msvc");asyncfunctionaY(e,t,r,n,i,o){lets,a;if("win32"!==process.platform)return;letl=ac(e);// check if the given version is already installed
(0,W.info)(`Checking if MSVC ${l} is already installed`);letc=!1;try{lete=ad(l);c=!0,(0,W.info)(`Found the pre-installed version of MSVC at ${e}`);}catch{// not installed, try installing
if(!c)try{"14.0"===l?(s="14.0",awaitiF("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",awaitiF("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",awaitiF("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,awaitiF("visualstudio2022buildtools","117.0.5.0",[]),a=void0):(0,W.error)(`The given MSVC versions ${e} is not supported yet.`);}catch(e){(0,W.error)(e);}// run vcvarsall.bat environment variables
awaitap(l,a,r,s,n,i,o),z.GITHUB_ACTIONS&&(awaitaQ());}asyncfunctionaQ(){lete=(0,iA.join)(aK,"msvc_matcher.json");if(!(await(0,nM.pathExists)(e)))return(0,W.warning)("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");(0,W.info)(`::add-matcher::${e}`);}asyncfunctionaJ(e,t,r){if(!iq())return;if("string"==typeofi)return{binDir:i};letn=/*@__PURE__*/G(nJ).sync("nala",{nothrow:!0});if(null!==n)return{binDir:i=(0,iA.dirname)(n)};// https://github.com/volitank/nala#-installation
};}asyncfunctionaZ(e,t,r){if("win32"!==process.platform)return;awaitiF("opencppcoverage",e);letn=awaita0();return{binDir:n};}asyncfunctiona0(){lete="C:/Program Files/OpenCppCoverage";returnawaitnq(e),e;}asyncfunctiona1(e,t,r){switch(process.platform){case"win32":{awaitiF("powershell-core",e);lett="C:/Program Files/PowerShell/7";returnawaitnq(t),{binDir:t};}case"darwin":returniD("powershell",e,["--cask"]);case"linux":if(iM())returniX("powershell-bin",e,"yay");if(iG())returniB([{name:"curl"}]),t6("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),iB([{name:"powershell",version:e}]);if(iq()){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");}}variA=(V("A8hFE"),V("A8hFE"));/** Get the platform data for task */functiona2(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,iA.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"}`};}varW=V("hHq4F"),nM=V("3WkGD"),iA=V("A8hFE");leta4=!1;asyncfunctiona3(e,t,r){returna4&&null!==/*@__PURE__*/G(nJ).sync("vcpkg",{nothrow:!0})?{binDir:(0,iA.dirname)(/*@__PURE__*/G(nJ).sync("vcpkg"))}:("linux"===process.platform&&(iM()?awaitPromise.all([iX("curl"),iX("zip"),iX("unzip"),iX("tar"),iX("git"),iX("pkg-config")]):iG()?awaitiB([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}]):iq()&&(awaitix([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"git"},{name:"pkg-config"}]))),(await(0,nM.pathExists)((0,iA.join)(t,(0,iA.addShExt)("bootstrap-vcpkg",".bat"))))?(0,W.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,iA.dirname)(t),stdio:"inherit"}),nT((0,iA.addShExt)((0,iA.addShRelativePrefix)("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),nj(t),awaitnq(t),// eslint-disable-next-line require-atomic-updates
a4=!0,{binDir:t});}consta6={nala:aJ,cmake:oj,ninja:sH,python:o8,vcpkg:a3,bazel:iV,conan:function(e,t,r){returnsg("conan",e);},meson:function(e,t,r){returnsg("meson",e);},gcovr:function(e,t,r){returnsg("gcovr",e);},opencppcoverage:aZ,llvm:aU,gcc:sU,choco:iU,brew:iN,powershell:a1,ccache:function(e,t,r){switch(process.platform){case"win32":returniF("ccache",e);case"darwin":returniD("ccache",e);case"linux":if(iM())returniX("ccache",e);if(iG())returniB([{name:"ccache",version:e}]);if(iq())returnix([{name:"ccache",version:e}]);throwError("Unsupported linux distribution");default:throwError("Unsupported platform");}},sccache:function(e,t,r){switch(process.platform){case"win32":returniF("sccache",e);case"linux":case"darwin":returniD("sccache",e);default:throwError("Unsupported platform");}},doxygen:sR,graphviz:sC,cppcheck:sO,clangtidy:aM,clangformat:aM,msvc:aY,vcvarsall:ap,kcov:sK,make:aX,task:function(e,t,r){returnoR("task",e,a2,t,r);},sevenzip:oA},a8=Object.keys(a6),a5=["compiler","architecture","timeout",...a8];functiona7(e,t){letr=`✅ ${e} was installed successfully:`;returnvoid0===t||("installDir"int&&(r+=`
-Thebinarydirectoryis${t.binDir}`)),r;}var ry=V("2heqc"),W=V("hHq4F"),oY=V("eO4vc");async function a9(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__*/G(oY)(e)||(0,W.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}${null!=l?l:""}`),a){case"llvm":case"clang":case"clang++":{lete=awaitaU(su("llvm",l,t),(0,h.join)(r,"llvm"),n);awaitnB("GCOV","llvm-cov gcov"),i.push(a7("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?awaitsj(e,(0,h.join)(r,"gcc"),n):awaitsU(e,(0,h.join)(r,"gcc"),n);o&&(awaitnB("CPPFLAGS","")),awaitfunction(e){lett=/*@__PURE__*/G(oY)(e),r=null!==t?/*@__PURE__*/G(sP)(t):e,n=""!==r?`gcov-${r}`:"gcov";returnnB("GCOV",n);}(e),i.push(a7("gcc",s));break;}case"cl":case"msvc":case"msbuild":case"vs":case"visualstudio":case"visualcpp":case"visualc++":{lete=awaitaY(su("msvc",l,t),(0,h.join)(r,"msvc"),n);o&&(awaitnB("CPPFLAGS","")),i.push(a7("msvc",e));break;}case"appleclang":case"applellvm":(0,ry.notice)("Assuming apple-clang is already installed"),awaitPromise.all([nB("CC","clang"),nB("CXX","clang++")]),i.push(a7("apple-clang",void0));break;default:s.push(`Unsupported compiler ${a}`);}}catch(t){(0,W.error)(t),s.push(`Failed to install the ${e}`);}(0,ry.endGroup)();}// Run main
/** The main entry function */(asyncfunction(e){vart,r,n;leti,o,s=Promise.resolve();z.GITHUB_ACTIONS||(s=rg(),process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS="true");// parse options using mri or github actions
letl=null!==(t=a.architecture)&&void0!==t?t:process.arch,c=null!==(r=process.env.SETUP_CPP_DIR)&&void0!==r?r:t5(""),u=[],d=[],p=Y.create({autoloadLocales:!0});Y.addLocale(/*@__PURE__*/G(Q)),X.addLocale(/*@__PURE__*/G(K));// installing the specified tools
letf=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);}(a,["llvm","clangtidy","clangformat"]))return(0,W.error)("The same version must be used for llvm, clangformat and clangtidy"),1;iM()&&"string"==typeofa.cppcheck&&"string"==typeofa.gcovr&&((0,W.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),awaitiX("python-pygments"));/** Used to unset CPPFLAGS of LLVM when other compilers are used as the main compiler */leth=!1,m=!1;for(leteofa8){// fail fast inside CI when any tool fails
h=awaitag(e,t,f,l,c,u,d,6e4*parseFloat(null!==(n=a.timeout)&&void0!==n?n:"20")),o=Date.now(),(0,W.info)(`took ${p.format(i,o)||"0 seconds"}`));}if(!m){// installing the specified compiler
lete=a.compiler;if(void0!==e){lett=Date.now();awaita9(e,f,c,l,u,h,d);letr=Date.now();(0,W.info)(`took ${p.format(t,r)||"0 seconds"}`);}}if(awaitnY(),0===u.length&&0===d.length)return(0,W.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(// report the messages in the end
u.forEach(e=>(0,W.success)(e)),d.forEach(e=>(0,W.error)(e)),(0,W.info)("setup-cpp finished"),!z.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,W.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,W.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}returnawaits,0===d.length?0:1;// exit with non-zero if any error message