mirror of https://github.com/aminya/setup-cpp.git
82 lines
378 KiB
JavaScript
82 lines
378 KiB
JavaScript
#!/usr/bin/env node
|
||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ut=require("process"),le=require("os"),F=require("path"),oe=require("fs"),pr=require("https"),$_=require("perf_hooks"),jr=require("http");require("net");const O_=require("tls"),mr=require("events"),_r=require("util"),I_=require("string_decoder"),xt=require("child_process"),Ur=require("assert"),P_=require("timers"),ap=require("buffer"),We=require("url"),Mr=require("stream"),T_=require("constants"),yn=require("console");var we=typeof document<"u"?document.currentScript:null;function Ya(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Dr=Ya(oe),Fu=Ya(pr),zn=Ya(jr),up=Object.freeze(Object.defineProperty({__proto__:null,get default(){return up},get randomUUID(){return cy}},Symbol.toStringTag,{value:"Module"}));function Hn(e){return e==null?[]:Array.isArray(e)?e:[e]}function N_(e,t,r,n){var i,a=e[t],s=~n.string.indexOf(t)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(t)?r==="false"?!1:r==="true"||(e._.push((i=+r,i*0===0?i:r)),!!r):(i=+r,i*0===0?i:r);e[t]=a==null?s:Array.isArray(a)?a.concat(s):[a,s]}function A_(e,t){e=e||[],t=t||{};var r,n,i,a,s,l={_:[]},c=0,u=0,o=0,m=e.length;const _=t.alias!==void 0,S=t.unknown!==void 0,R=t.default!==void 0;if(t.alias=t.alias||{},t.string=Hn(t.string),t.boolean=Hn(t.boolean),_)for(r in t.alias)for(n=t.alias[r]=Hn(t.alias[r]),c=0;c<n.length;c++)(t.alias[n[c]]=n.concat(r)).splice(c,1);for(c=t.boolean.length;c-- >0;)for(n=t.alias[t.boolean[c]]||[],u=n.length;u-- >0;)t.boolean.push(n[u]);for(c=t.string.length;c-- >0;)for(n=t.alias[t.string[c]]||[],u=n.length;u-- >0;)t.string.push(n[u]);if(R){for(r in t.default)if(a=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],t[a]!==void 0)for(t[a].push(r),c=0;c<n.length;c++)t[a].push(n[c])}const p=S?Object.keys(t.alias):[];for(c=0;c<m;c++){if(i=e[c],i==="--"){l._=l._.concat(e.slice(++c));break}for(u=0;u<i.length&&i.charCodeAt(u)===45;u++);if(u===0)l._.push(i);else if(i.substring(u,u+3)==="no-"){if(a=i.substring(u+3),S&&!~p.indexOf(a))return t.unknown(i);l[a]=!1}else{for(o=u+1;o<i.length&&i.charCodeAt(o)!==61;o++);for(a=i.substring(u,o),s=i.substring(++o)||c+1===m||(""+e[c+1]).charCodeAt(0)===45||e[++c],n=u===2?[a]:a,o=0;o<n.length;o++){if(a=n[o],S&&!~p.indexOf(a))return t.unknown("-".repeat(u)+a);N_(l,a,o+1<n.length||s,t)}}}if(R)for(r in t.default)l[r]===void 0&&(l[r]=t.default[r]);if(_)for(r in l)for(n=t.alias[r]||[];n.length>0;)l[n.shift()]=l[r];return l}var tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Hr={exports:{}},Wn,qu;function Tn(){if(qu)return Wn;qu=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=t-6;return Wn={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Wn}var Xn,ku;function Nn(){return ku||(ku=1,Xn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Xn}var ju;function Gr(){return ju||(ju=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Tn(),a=Nn();t=e.exports={};const s=t.re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],o=t.t={};let m=0;const _="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",i],[_,n]],R=h=>{for(const[y,v]of S)h=h.split(`${y}*`).join(`${y}{0,${v}}`).split(`${y}+`).join(`${y}{1,${v}}`);return h},p=(h,y,v)=>{const g=R(y),E=m++;a(h,E,y),o[h]=E,c[E]=y,u[E]=g,s[E]=new RegExp(y,v?"g":void 0),l[E]=new RegExp(g,v?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_}*`),p("MAINVERSION",`(${c[o.NUMERICIDENTIFIER]})\\.(${c[o.NUMERICIDENTIFIER]})\\.(${c[o.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[o.NUMERICIDENTIFIERLOOSE]})\\.(${c[o.NUMERICIDENTIFIERLOOSE]})\\.(${c[o.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[o.NONNUMERICIDENTIFIER]}|${c[o.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[o.NONNUMERICIDENTIFIER]}|${c[o.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[o.PRERELEASEIDENTIFIER]}(?:\\.${c[o.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[o.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${_}+`),p("BUILD",`(?:\\+(${c[o.BUILDIDENTIFIER]}(?:\\.${c[o.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[o.MAINVERSION]}${c[o.PRERELEASE]}?${c[o.BUILD]}?`),p("FULL",`^${c[o.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[o.MAINVERSIONLOOSE]}${c[o.PRERELEASELOOSE]}?${c[o.BUILD]}?`),p("LOOSE",`^${c[o.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[o.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[o.XRANGEIDENTIFIER]})(?:\\.(${c[o.XRANGEIDENTIFIER]})(?:\\.(${c[o.XRANGEIDENTIFIER]})(?:${c[o.PRERELEASE]})?${c[o.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[o.XRANGEIDENTIFIERLOOSE]})(?:${c[o.PRERELEASELOOSE]})?${c[o.BUILD]}?)?)?`),p("XRANGE",`^${c[o.GTLT]}\\s*${c[o.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[o.GTLT]}\\s*${c[o.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[o.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[o.COERCEPLAIN]+`(?:${c[o.PRERELEASE]})?(?:${c[o.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[o.COERCE],!0),p("COERCERTLFULL",c[o.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[o.LONETILDE]}${c[o.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[o.LONETILDE]}${c[o.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[o.LONECARET]}${c[o.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[o.LONECARET]}${c[o.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[o.GTLT]}\\s*(${c[o.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[o.GTLT]}\\s*(${c[o.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[o.GTLT]}\\s*(${c[o.LOOSEPLAIN]}|${c[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[o.XRANGEPLAIN]})\\s+-\\s+(${c[o.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[o.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Hr,Hr.exports)),Hr.exports}var Kn,Uu;function Ja(){if(Uu)return Kn;Uu=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Kn=n=>n?typeof n!="object"?e:n:t,Kn}var Yn,Mu;function cp(){if(Mu)return Yn;Mu=1;const e=/^[0-9]+$/,t=(n,i)=>{const a=e.test(n),s=e.test(i);return a&&s&&(n=+n,i=+i),n===i?0:a&&!s?-1:s&&!a?1:n<i?-1:1};return Yn={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},Yn}var Jn,Gu;function He(){if(Gu)return Jn;Gu=1;const e=Nn(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Tn(),{safeRe:n,t:i}=Gr(),a=Ja(),{compareIdentifiers:s}=cp();class l{constructor(u,o){if(o=a(o),u instanceof l){if(u.loose===!!o.loose&&u.includePrerelease===!!o.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;const m=u.trim().match(o.loose?n[i.LOOSE]:n[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(_=>{if(/^[0-9]+$/.test(_)){const S=+_;if(S>=0&&S<r)return S}return _}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof l)){if(typeof u=="string"&&u===this.version)return 0;u=new l(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof l||(u=new l(u,this.options)),s(this.major,u.major)||s(this.minor,u.minor)||s(this.patch,u.patch)}comparePre(u){if(u instanceof l||(u=new l(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let o=0;do{const m=this.prerelease[o],_=u.prerelease[o];if(e("prerelease compare",o,m,_),m===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(m===void 0)return-1;if(m===_)continue;return s(m,_)}while(++o)}compareBuild(u){u instanceof l||(u=new l(u,this.options));let o=0;do{const m=this.build[o],_=u.build[o];if(e("build compare",o,m,_),m===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(m===void 0)return-1;if(m===_)continue;return s(m,_)}while(++o)}inc(u,o,m){if(u.startsWith("pre")){if(!o&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(o){const _=`-${o}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!_||_[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,m),this.inc("pre",o,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,m),this.inc("pre",o,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const _=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[_];else{let S=this.prerelease.length;for(;--S>=0;)typeof this.prerelease[S]=="number"&&(this.prerelease[S]++,S=-2);if(S===-1){if(o===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(_)}}if(o){let S=[o,_];m===!1&&(S=[o]),s(this.prerelease[0],o)===0?isNaN(this.prerelease[1])&&(this.prerelease=S):this.prerelease=S}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Jn=l,Jn}var Qn,Vu;function yr(){if(Vu)return Qn;Vu=1;const e=He();return Qn=(r,n,i=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(a){if(!i)return null;throw a}},Qn}var Zn,Bu;function L_(){if(Bu)return Zn;Bu=1;const e=yr();return Zn=(r,n)=>{const i=e(r,n);return i?i.version:null},Zn}var ei,zu;function x_(){if(zu)return ei;zu=1;const e=yr();return ei=(r,n)=>{const i=e(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},ei}var ti,Hu;function C_(){if(Hu)return ti;Hu=1;const e=He();return ti=(r,n,i,a,s)=>{typeof i=="string"&&(s=a,a=i,i=void 0);try{return new e(r instanceof e?r.version:r,i).inc(n,a,s).version}catch{return null}},ti}var ri,Wu;function D_(){if(Wu)return ri;Wu=1;const e=yr();return ri=(r,n)=>{const i=e(r,null,!0),a=e(n,null,!0),s=i.compare(a);if(s===0)return null;const l=s>0,c=l?i:a,u=l?a:i,o=!!c.prerelease.length;if(!!u.prerelease.length&&!o){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const _=o?"pre":"";return i.major!==a.major?_+"major":i.minor!==a.minor?_+"minor":i.patch!==a.patch?_+"patch":"prerelease"},ri}var ni,Xu;function F_(){if(Xu)return ni;Xu=1;const e=He();return ni=(r,n)=>new e(r,n).major,ni}var ii,Ku;function q_(){if(Ku)return ii;Ku=1;const e=He();return ii=(r,n)=>new e(r,n).minor,ii}var si,Yu;function k_(){if(Yu)return si;Yu=1;const e=He();return si=(r,n)=>new e(r,n).patch,si}var oi,Ju;function j_(){if(Ju)return oi;Ju=1;const e=yr();return oi=(r,n)=>{const i=e(r,n);return i&&i.prerelease.length?i.prerelease:null},oi}var ai,Qu;function wt(){if(Qu)return ai;Qu=1;const e=He();return ai=(r,n,i)=>new e(r,i).compare(new e(n,i)),ai}var ui,Zu;function U_(){if(Zu)return ui;Zu=1;const e=wt();return ui=(r,n,i)=>e(n,r,i),ui}var ci,ec;function M_(){if(ec)return ci;ec=1;const e=wt();return ci=(r,n)=>e(r,n,!0),ci}var li,tc;function Qa(){if(tc)return li;tc=1;const e=He();return li=(r,n,i)=>{const a=new e(r,i),s=new e(n,i);return a.compare(s)||a.compareBuild(s)},li}var fi,rc;function G_(){if(rc)return fi;rc=1;const e=Qa();return fi=(r,n)=>r.sort((i,a)=>e(i,a,n)),fi}var di,nc;function V_(){if(nc)return di;nc=1;const e=Qa();return di=(r,n)=>r.sort((i,a)=>e(a,i,n)),di}var hi,ic;function An(){if(ic)return hi;ic=1;const e=wt();return hi=(r,n,i)=>e(r,n,i)>0,hi}var pi,sc;function Za(){if(sc)return pi;sc=1;const e=wt();return pi=(r,n,i)=>e(r,n,i)<0,pi}var mi,oc;function lp(){if(oc)return mi;oc=1;const e=wt();return mi=(r,n,i)=>e(r,n,i)===0,mi}var _i,ac;function fp(){if(ac)return _i;ac=1;const e=wt();return _i=(r,n,i)=>e(r,n,i)!==0,_i}var yi,uc;function eu(){if(uc)return yi;uc=1;const e=wt();return yi=(r,n,i)=>e(r,n,i)>=0,yi}var vi,cc;function tu(){if(cc)return vi;cc=1;const e=wt();return vi=(r,n,i)=>e(r,n,i)<=0,vi}var wi,lc;function dp(){if(lc)return wi;lc=1;const e=lp(),t=fp(),r=An(),n=eu(),i=Za(),a=tu();return wi=(l,c,u,o)=>{switch(c){case"===":return typeof l=="object"&&(l=l.version),typeof u=="object"&&(u=u.version),l===u;case"!==":return typeof l=="object"&&(l=l.version),typeof u=="object"&&(u=u.version),l!==u;case"":case"=":case"==":return e(l,u,o);case"!=":return t(l,u,o);case">":return r(l,u,o);case">=":return n(l,u,o);case"<":return i(l,u,o);case"<=":return a(l,u,o);default:throw new TypeError(`Invalid operator: ${c}`)}},wi}var gi,fc;function B_(){if(fc)return gi;fc=1;const e=He(),t=yr(),{safeRe:r,t:n}=Gr();return gi=(a,s)=>{if(a instanceof e)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;s=s||{};let l=null;if(!s.rtl)l=a.match(s.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const S=s.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let R;for(;(R=S.exec(a))&&(!l||l.index+l[0].length!==a.length);)(!l||R.index+R[0].length!==l.index+l[0].length)&&(l=R),S.lastIndex=R.index+R[1].length+R[2].length;S.lastIndex=-1}if(l===null)return null;const c=l[2],u=l[3]||"0",o=l[4]||"0",m=s.includePrerelease&&l[5]?`-${l[5]}`:"",_=s.includePrerelease&&l[6]?`+${l[6]}`:"";return t(`${c}.${u}.${o}${m}${_}`,s)},gi}var Ei,dc;function z_(){if(dc)return Ei;dc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(r,n)}return this}}return Ei=e,Ei}var Si,hc;function gt(){if(hc)return Si;hc=1;const e=/\s+/g;class t{constructor(I,A){if(A=i(A),I instanceof t)return I.loose===!!A.loose&&I.includePrerelease===!!A.includePrerelease?I:new t(I.raw,A);if(I instanceof a)return this.raw=I.value,this.set=[[I]],this.formatted=void 0,this;if(this.options=A,this.loose=!!A.loose,this.includePrerelease=!!A.includePrerelease,this.raw=I.trim().replace(e," "),this.set=this.raw.split("||").map(D=>this.parseRange(D.trim())).filter(D=>D.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const D=this.set[0];if(this.set=this.set.filter(C=>!p(C[0])),this.set.length===0)this.set=[D];else if(this.set.length>1){for(const C of this.set)if(C.length===1&&h(C[0])){this.set=[C];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let I=0;I<this.set.length;I++){I>0&&(this.formatted+="||");const A=this.set[I];for(let D=0;D<A.length;D++)D>0&&(this.formatted+=" "),this.formatted+=A[D].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(I){const D=((this.options.includePrerelease&&S)|(this.options.loose&&R))+":"+I,C=n.get(D);if(C)return C;const q=this.options.loose,x=q?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];I=I.replace(x,B(this.options.includePrerelease)),s("hyphen replace",I),I=I.replace(c[u.COMPARATORTRIM],o),s("comparator trim",I),I=I.replace(c[u.TILDETRIM],m),s("tilde trim",I),I=I.replace(c[u.CARETTRIM],_),s("caret trim",I);let z=I.split(" ").map(X=>v(X,this.options)).join(" ").split(/\s+/).map(X=>k(X,this.options));q&&(z=z.filter(X=>(s("loose invalid filter",X,this.options),!!X.match(c[u.COMPARATORLOOSE])))),s("range list",z);const V=new Map,Q=z.map(X=>new a(X,this.options));for(const X of Q){if(p(X))return[X];V.set(X.value,X)}V.size>1&&V.has("")&&V.delete("");const se=[...V.values()];return n.set(D,se),se}intersects(I,A){if(!(I instanceof t))throw new TypeError("a Range is required");return this.set.some(D=>y(D,A)&&I.set.some(C=>y(C,A)&&D.every(q=>C.every(x=>q.intersects(x,A)))))}test(I){if(!I)return!1;if(typeof I=="string")try{I=new l(I,this.options)}catch{return!1}for(let A=0;A<this.set.length;A++)if(G(this.set[A],I,this.options))return!0;return!1}}Si=t;const r=z_(),n=new r,i=Ja(),a=Ln(),s=Nn(),l=He(),{safeRe:c,t:u,comparatorTrimReplace:o,tildeTrimReplace:m,caretTrimReplace:_}=Gr(),{FLAG_INCLUDE_PRERELEASE:S,FLAG_LOOSE:R}=Tn(),p=P=>P.value==="<0.0.0-0",h=P=>P.value==="",y=(P,I)=>{let A=!0;const D=P.slice();let C=D.pop();for(;A&&D.length;)A=D.every(q=>C.intersects(q,I)),C=D.pop();return A},v=(P,I)=>(s("comp",P,I),P=w(P,I),s("caret",P),P=E(P,I),s("tildes",P),P=b(P,I),s("xrange",P),P=T(P,I),s("stars",P),P),g=P=>!P||P.toLowerCase()==="x"||P==="*",E=(P,I)=>P.trim().split(/\s+/).map(A=>d(A,I)).join(" "),d=(P,I)=>{const A=I.loose?c[u.TILDELOOSE]:c[u.TILDE];return P.replace(A,(D,C,q,x,z)=>{s("tilde",P,D,C,q,x,z);let V;return g(C)?V="":g(q)?V=`>=${C}.0.0 <${+C+1}.0.0-0`:g(x)?V=`>=${C}.${q}.0 <${C}.${+q+1}.0-0`:z?(s("replaceTilde pr",z),V=`>=${C}.${q}.${x}-${z} <${C}.${+q+1}.0-0`):V=`>=${C}.${q}.${x} <${C}.${+q+1}.0-0`,s("tilde return",V),V})},w=(P,I)=>P.trim().split(/\s+/).map(A=>f(A,I)).join(" "),f=(P,I)=>{s("caret",P,I);const A=I.loose?c[u.CARETLOOSE]:c[u.CARET],D=I.includePrerelease?"-0":"";return P.replace(A,(C,q,x,z,V)=>{s("caret",P,C,q,x,z,V);let Q;return g(q)?Q="":g(x)?Q=`>=${q}.0.0${D} <${+q+1}.0.0-0`:g(z)?q==="0"?Q=`>=${q}.${x}.0${D} <${q}.${+x+1}.0-0`:Q=`>=${q}.${x}.0${D} <${+q+1}.0.0-0`:V?(s("replaceCaret pr",V),q==="0"?x==="0"?Q=`>=${q}.${x}.${z}-${V} <${q}.${x}.${+z+1}-0`:Q=`>=${q}.${x}.${z}-${V} <${q}.${+x+1}.0-0`:Q=`>=${q}.${x}.${z}-${V} <${+q+1}.0.0-0`):(s("no pr"),q==="0"?x==="0"?Q=`>=${q}.${x}.${z}${D} <${q}.${x}.${+z+1}-0`:Q=`>=${q}.${x}.${z}${D} <${q}.${+x+1}.0-0`:Q=`>=${q}.${x}.${z} <${+q+1}.0.0-0`),s("caret return",Q),Q})},b=(P,I)=>(s("replaceXRanges",P,I),P.split(/\s+/).map(A=>$(A,I)).join(" ")),$=(P,I)=>{P=P.trim();const A=I.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return P.replace(A,(D,C,q,x,z,V)=>{s("xRange",P,D,C,q,x,z,V);const Q=g(q),se=Q||g(x),X=se||g(z),ie=X;return C==="="&&ie&&(C=""),V=I.includePrerelease?"-0":"",Q?C===">"||C==="<"?D="<0.0.0-0":D="*":C&&ie?(se&&(x=0),z=0,C===">"?(C=">=",se?(q=+q+1,x=0,z=0):(x=+x+1,z=0)):C==="<="&&(C="<",se?q=+q+1:x=+x+1),C==="<"&&(V="-0"),D=`${C+q}.${x}.${z}${V}`):se?D=`>=${q}.0.0${V} <${+q+1}.0.0-0`:X&&(D=`>=${q}.${x}.0${V} <${q}.${+x+1}.0-0`),s("xRange return",D),D})},T=(P,I)=>(s("replaceStars",P,I),P.trim().replace(c[u.STAR],"")),k=(P,I)=>(s("replaceGTE0",P,I),P.trim().replace(c[I.includePrerelease?u.GTE0PRE:u.GTE0],"")),B=P=>(I,A,D,C,q,x,z,V,Q,se,X,ie)=>(g(D)?A="":g(C)?A=`>=${D}.0.0${P?"-0":""}`:g(q)?A=`>=${D}.${C}.0${P?"-0":""}`:x?A=`>=${A}`:A=`>=${A}${P?"-0":""}`,g(Q)?V="":g(se)?V=`<${+Q+1}.0.0-0`:g(X)?V=`<${Q}.${+se+1}.0-0`:ie?V=`<=${Q}.${se}.${X}-${ie}`:P?V=`<${Q}.${se}.${+X+1}-0`:V=`<=${V}`,`${A} ${V}`.trim()),G=(P,I,A)=>{for(let D=0;D<P.length;D++)if(!P[D].test(I))return!1;if(I.prerelease.length&&!A.includePrerelease){for(let D=0;D<P.length;D++)if(s(P[D].semver),P[D].semver!==a.ANY&&P[D].semver.prerelease.length>0){const C=P[D].semver;if(C.major===I.major&&C.minor===I.minor&&C.patch===I.patch)return!0}return!1}return!0};return Si}var Ri,pc;function Ln(){if(pc)return Ri;pc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(o,m){if(m=r(m),o instanceof t){if(o.loose===!!m.loose)return o;o=o.value}o=o.trim().split(/\s+/).join(" "),s("comparator",o,m),this.options=m,this.loose=!!m.loose,this.parse(o),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(o){const m=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=o.match(m);if(!_)throw new TypeError(`Invalid comparator: ${o}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new l(_[2],this.options.loose):this.semver=e}toString(){return this.value}test(o){if(s("Comparator.test",o,this.options.loose),this.semver===e||o===e)return!0;if(typeof o=="string")try{o=new l(o,this.options)}catch{return!1}return a(o,this.operator,this.semver,this.options)}intersects(o,m){if(!(o instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(o.value,m).test(this.value):o.operator===""?o.value===""?!0:new c(this.value,m).test(o.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||o.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||o.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&o.operator.startsWith(">")||this.operator.startsWith("<")&&o.operator.startsWith("<")||this.semver.version===o.semver.version&&this.operator.includes("=")&&o.operator.includes("=")||a(this.semver,"<",o.semver,m)&&this.operator.startsWith(">")&&o.operator.startsWith("<")||a(this.semver,">",o.semver,m)&&this.operator.startsWith("<")&&o.operator.startsWith(">")))}}Ri=t;const r=Ja(),{safeRe:n,t:i}=Gr(),a=dp(),s=Nn(),l=He(),c=gt();return Ri}var bi,mc;function xn(){if(mc)return bi;mc=1;const e=gt();return bi=(r,n,i)=>{try{n=new e(n,i)}catch{return!1}return n.test(r)},bi}var $i,_c;function H_(){if(_c)return $i;_c=1;const e=gt();return $i=(r,n)=>new e(r,n).set.map(i=>i.map(a=>a.value).join(" ").trim().split(" ")),$i}var Oi,yc;function W_(){if(yc)return Oi;yc=1;const e=He(),t=gt();return Oi=(n,i,a)=>{let s=null,l=null,c=null;try{c=new t(i,a)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||l.compare(u)===-1)&&(s=u,l=new e(s,a))}),s},Oi}var Ii,vc;function X_(){if(vc)return Ii;vc=1;const e=He(),t=gt();return Ii=(n,i,a)=>{let s=null,l=null,c=null;try{c=new t(i,a)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||l.compare(u)===1)&&(s=u,l=new e(s,a))}),s},Ii}var Pi,wc;function K_(){if(wc)return Pi;wc=1;const e=He(),t=gt(),r=An();return Pi=(i,a)=>{i=new t(i,a);let s=new e("0.0.0");if(i.test(s)||(s=new e("0.0.0-0"),i.test(s)))return s;s=null;for(let l=0;l<i.set.length;++l){const c=i.set[l];let u=null;c.forEach(o=>{const m=new e(o.semver.version);switch(o.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!u||r(m,u))&&(u=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),u&&(!s||r(s,u))&&(s=u)}return s&&i.test(s)?s:null},Pi}var Ti,gc;function Y_(){if(gc)return Ti;gc=1;const e=gt();return Ti=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Ti}var Ni,Ec;function ru(){if(Ec)return Ni;Ec=1;const e=He(),t=Ln(),{ANY:r}=t,n=gt(),i=xn(),a=An(),s=Za(),l=tu(),c=eu();return Ni=(o,m,_,S)=>{o=new e(o,S),m=new n(m,S);let R,p,h,y,v;switch(_){case">":R=a,p=l,h=s,y=">",v=">=";break;case"<":R=s,p=c,h=a,y="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(o,m,S))return!1;for(let g=0;g<m.set.length;++g){const E=m.set[g];let d=null,w=null;if(E.forEach(f=>{f.semver===r&&(f=new t(">=0.0.0")),d=d||f,w=w||f,R(f.semver,d.semver,S)?d=f:h(f.semver,w.semver,S)&&(w=f)}),d.operator===y||d.operator===v||(!w.operator||w.operator===y)&&p(o,w.semver))return!1;if(w.operator===v&&h(o,w.semver))return!1}return!0},Ni}var Ai,Sc;function J_(){if(Sc)return Ai;Sc=1;const e=ru();return Ai=(r,n,i)=>e(r,n,">",i),Ai}var Li,Rc;function Q_(){if(Rc)return Li;Rc=1;const e=ru();return Li=(r,n,i)=>e(r,n,"<",i),Li}var xi,bc;function Z_(){if(bc)return xi;bc=1;const e=gt();return xi=(r,n,i)=>(r=new e(r,i),n=new e(n,i),r.intersects(n,i)),xi}var Ci,$c;function ey(){if($c)return Ci;$c=1;const e=xn(),t=wt();return Ci=(r,n,i)=>{const a=[];let s=null,l=null;const c=r.sort((_,S)=>t(_,S,i));for(const _ of c)e(_,n,i)?(l=_,s||(s=_)):(l&&a.push([s,l]),l=null,s=null);s&&a.push([s,null]);const u=[];for(const[_,S]of a)_===S?u.push(_):!S&&_===c[0]?u.push("*"):S?_===c[0]?u.push(`<=${S}`):u.push(`${_} - ${S}`):u.push(`>=${_}`);const o=u.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return o.length<m.length?o:n},Ci}var Di,Oc;function ty(){if(Oc)return Di;Oc=1;const e=gt(),t=Ln(),{ANY:r}=t,n=xn(),i=wt(),a=(m,_,S={})=>{if(m===_)return!0;m=new e(m,S),_=new e(_,S);let R=!1;e:for(const p of m.set){for(const h of _.set){const y=c(p,h,S);if(R=R||y!==null,y)continue e}if(R)return!1}return!0},s=[new t(">=0.0.0-0")],l=[new t(">=0.0.0")],c=(m,_,S)=>{if(m===_)return!0;if(m.length===1&&m[0].semver===r){if(_.length===1&&_[0].semver===r)return!0;S.includePrerelease?m=s:m=l}if(_.length===1&&_[0].semver===r){if(S.includePrerelease)return!0;_=l}const R=new Set;let p,h;for(const b of m)b.operator===">"||b.operator===">="?p=u(p,b,S):b.operator==="<"||b.operator==="<="?h=o(h,b,S):R.add(b.semver);if(R.size>1)return null;let y;if(p&&h){if(y=i(p.semver,h.semver,S),y>0)return null;if(y===0&&(p.operator!==">="||h.operator!=="<="))return null}for(const b of R){if(p&&!n(b,String(p),S)||h&&!n(b,String(h),S))return null;for(const $ of _)if(!n(b,String($),S))return!1;return!0}let v,g,E,d,w=h&&!S.includePrerelease&&h.semver.prerelease.length?h.semver:!1,f=p&&!S.includePrerelease&&p.semver.prerelease.length?p.semver:!1;w&&w.prerelease.length===1&&h.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(const b of _){if(d=d||b.operator===">"||b.operator===">=",E=E||b.operator==="<"||b.operator==="<=",p){if(f&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===f.major&&b.semver.minor===f.minor&&b.semver.patch===f.patch&&(f=!1),b.operator===">"||b.operator===">="){if(v=u(p,b,S),v===b&&v!==p)return!1}else if(p.operator===">="&&!n(p.semver,String(b),S))return!1}if(h){if(w&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===w.major&&b.semver.minor===w.minor&&b.semver.patch===w.patch&&(w=!1),b.operator==="<"||b.operator==="<="){if(g=o(h,b,S),g===b&&g!==h)return!1}else if(h.operator==="<="&&!n(h.semver,String(b),S))return!1}if(!b.operator&&(h||p)&&y!==0)return!1}return!(p&&E&&!h&&y!==0||h&&d&&!p&&y!==0||f||w)},u=(m,_,S)=>{if(!m)return _;const R=i(m.semver,_.semver,S);return R>0?m:R<0||_.operator===">"&&m.operator===">="?_:m},o=(m,_,S)=>{if(!m)return _;const R=i(m.semver,_.semver,S);return R<0?m:R>0||_.operator==="<"&&m.operator==="<="?_:m};return Di=a,Di}var Fi,Ic;function ry(){if(Ic)return Fi;Ic=1;const e=Gr(),t=Tn(),r=He(),n=cp(),i=yr(),a=L_(),s=x_(),l=C_(),c=D_(),u=F_(),o=q_(),m=k_(),_=j_(),S=wt(),R=U_(),p=M_(),h=Qa(),y=G_(),v=V_(),g=An(),E=Za(),d=lp(),w=fp(),f=eu(),b=tu(),$=dp(),T=B_(),k=Ln(),B=gt(),G=xn(),P=H_(),I=W_(),A=X_(),D=K_(),C=Y_(),q=ru(),x=J_(),z=Q_(),V=Z_(),Q=ey(),se=ty();return Fi={parse:i,valid:a,clean:s,inc:l,diff:c,major:u,minor:o,patch:m,prerelease:_,compare:S,rcompare:R,compareLoose:p,compareBuild:h,sort:y,rsort:v,gt:g,lt:E,eq:d,neq:w,gte:f,lte:b,cmp:$,coerce:T,Comparator:k,Range:B,satisfies:G,toComparators:P,maxSatisfying:I,minSatisfying:A,minVersion:D,validRange:C,outside:q,gtr:x,ltr:z,intersects:V,simplifyRange:Q,subset:se,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Fi}var qi,Pc;function ny(){if(Pc)return qi;Pc=1;var e=ut,t=ry(),r=le,n=F,i=oe,a=pr;function s($,T,k,B){function G(P){return P instanceof k?P:new k(function(I){I(P)})}return new(k||(k=Promise))(function(P,I){function A(q){try{C(B.next(q))}catch(x){I(x)}}function D(q){try{C(B.throw(q))}catch(x){I(x)}}function C(q){q.done?P(q.value):G(q.value).then(A,D)}C((B=B.apply($,[])).next())})}function l($,T){var k={label:0,sent:function(){if(P[0]&1)throw P[1];return P[1]},trys:[],ops:[]},B,G,P,I;return I={next:A(0),throw:A(1),return:A(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function A(C){return function(q){return D([C,q])}}function D(C){if(B)throw new TypeError("Generator is already executing.");for(;I&&(I=0,C[0]&&(k=0)),k;)try{if(B=1,G&&(P=C[0]&2?G.return:C[0]?G.throw||((P=G.return)&&P.call(G),0):G.next)&&!(P=P.call(G,C[1])).done)return P;switch(G=0,P&&(C=[C[0]&2,P.value]),C[0]){case 0:case 1:P=C;break;case 4:return k.label++,{value:C[1],done:!1};case 5:k.label++,G=C[1],C=[0];continue;case 7:C=k.ops.pop(),k.trys.pop();continue;default:if(P=k.trys,!(P=P.length>0&&P[P.length-1])&&(C[0]===6||C[0]===2)){k=0;continue}if(C[0]===3&&(!P||C[1]>P[0]&&C[1]<P[3])){k.label=C[1];break}if(C[0]===6&&k.label<P[1]){k.label=P[1],P=C;break}if(P&&k.label<P[2]){k.label=P[2],k.ops.push(C);break}P[2]&&k.ops.pop(),k.trys.pop();continue}C=T.call($,k)}catch(q){C=[6,q],G=0}finally{B=P=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}}var c=e.env.npm_package_json,u=e.env.npm_config_user_agent,o=!!(u&&u.startsWith("npm")),m=!!(c&&c.endsWith("package.json")),_=o||m,S=!!(u&&u.startsWith("yarn")),R=_||S,p=r.homedir(),h=process.env.XDG_CONFIG_HOME||n.join(p,".config","simple-update-notifier"),y=function($){return n.join(h,"".concat($.replace("@","").replace("/","__"),".json"))},v=function(){i.existsSync(h)||i.mkdirSync(h,{recursive:!0})},g=function($){var T=y($);try{if(!i.existsSync(T))return;var k=JSON.parse(i.readFileSync(T,"utf8"));return k.lastUpdateCheck}catch{return}},E=function($){var T=y($);i.writeFileSync(T,JSON.stringify({lastUpdateCheck:new Date().getTime()}))},d=function($,T){return s(void 0,void 0,void 0,function(){var k;return l(this,function(B){return k="https://registry.npmjs.org/-/package/".concat($,"/dist-tags"),[2,new Promise(function(G,P){a.get(k,function(I){var A="";I.on("data",function(D){return A+=D}),I.on("end",function(){try{var D=JSON.parse(A),C=D[T];C||P(new Error("Error getting version")),G(C)}catch{P(new Error("Could not parse version response"))}})}).on("error",function(I){return P(I)})})]})})},w=function($){var T=$.pkg,k=$.updateCheckInterval,B=k===void 0?1e3*60*60*24:k,G=$.distTag,P=G===void 0?"latest":G,I=$.alwaysRun,A=$.debug;return s(void 0,void 0,void 0,function(){var D,C;return l(this,function(q){switch(q.label){case 0:return v(),D=g(T.name),I||!D||D<new Date().getTime()-B?[4,d(T.name,P)]:[3,2];case 1:return C=q.sent(),E(T.name),t.gt(C,T.version)?[2,C]:(A&&console.error("Latest version (".concat(C,") not newer than current version (").concat(T.version,")")),[3,3]);case 2:A&&console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(B,"ms but only ").concat(new Date().getTime()-D,"ms since last check.")),q.label=3;case 3:return[2,!1]}})})},f=function($){for(var T=$.split(`
|
||
`),k=Math.max.apply(Math,T.map(function(A){return A.length})),B=["┌".concat("─".repeat(k+2),"┐")],G=0,P=T;G<P.length;G++){var I=P[G];B.push("│ ".concat(I.padEnd(k)," │"))}return B.push("└".concat("─".repeat(k+2),"┘")),B.join(`
|
||
`)},b=function($){return s(void 0,void 0,void 0,function(){var T,k;return l(this,function(B){switch(B.label){case 0:if(!$.alwaysRun&&(!process.stdout.isTTY||R&&!$.shouldNotifyInNpmScript))return $.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];B.label=1;case 1:return B.trys.push([1,3,,4]),[4,w($)];case 2:return T=B.sent(),T&&console.error(f("New version of ".concat($.pkg.name,` available!
|
||
Current Version: `).concat($.pkg.version,`
|
||
Latest Version: `).concat(T))),[3,4];case 3:return k=B.sent(),$.debug&&k instanceof Error&&console.error("Unexpected error in simpleUpdateNotifier():",k),[3,4];case 4:return[2]}})})};return qi=b,qi}var iy=ny();const sy=$e(iy),oy="setup-cpp",ay="1.8.0",nu={name:oy,version:ay};var ft={},Je={},Mt={},Tc;function iu(){if(Tc)return Mt;Tc=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.toCommandProperties=Mt.toCommandValue=void 0;function e(r){return r==null?"":typeof r=="string"||r instanceof String?r:JSON.stringify(r)}Mt.toCommandValue=e;function t(r){return Object.keys(r).length?{title:r.title,file:r.file,line:r.startLine,endLine:r.endLine,col:r.startColumn,endColumn:r.endColumn}:{}}return Mt.toCommandProperties=t,Mt}var Nc;function uy(){if(Nc)return Je;Nc=1;var e=Je&&Je.__createBinding||(Object.create?function(m,_,S,R){R===void 0&&(R=S);var p=Object.getOwnPropertyDescriptor(_,S);(!p||("get"in p?!_.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return _[S]}}),Object.defineProperty(m,R,p)}:function(m,_,S,R){R===void 0&&(R=S),m[R]=_[S]}),t=Je&&Je.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),r=Je&&Je.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var S in m)S!=="default"&&Object.prototype.hasOwnProperty.call(m,S)&&e(_,m,S);return t(_,m),_};Object.defineProperty(Je,"__esModule",{value:!0}),Je.issue=Je.issueCommand=void 0;const n=r(le),i=iu();function a(m,_,S){const R=new c(m,_,S);process.stdout.write(R.toString()+n.EOL)}Je.issueCommand=a;function s(m,_=""){a(m,{},_)}Je.issue=s;const l="::";class c{constructor(_,S,R){_||(_="missing.command"),this.command=_,this.properties=S,this.message=R}toString(){let _=l+this.command;if(this.properties&&Object.keys(this.properties).length>0){_+=" ";let S=!0;for(const R in this.properties)if(this.properties.hasOwnProperty(R)){const p=this.properties[R];p&&(S?S=!1:_+=",",_+=`${R}=${o(p)}`)}}return _+=`${l}${u(this.message)}`,_}}function u(m){return(0,i.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function o(m){return(0,i.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}return Je}var Qe={},op;(op=global.crypto)!=null&&op.randomUUID||(global.crypto||(global.crypto={}),global.crypto.randomUUID=()=>{let e=new Date().getTime(),t=$_.performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})});const cy=global.crypto.randomUUID.bind(global.crypto),su=Pn(up);var Ac;function ly(){if(Ac)return Qe;Ac=1;var e=Qe&&Qe.__createBinding||(Object.create?function(u,o,m,_){_===void 0&&(_=m);var S=Object.getOwnPropertyDescriptor(o,m);(!S||("get"in S?!o.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return o[m]}}),Object.defineProperty(u,_,S)}:function(u,o,m,_){_===void 0&&(_=m),u[_]=o[m]}),t=Qe&&Qe.__setModuleDefault||(Object.create?function(u,o){Object.defineProperty(u,"default",{enumerable:!0,value:o})}:function(u,o){u.default=o}),r=Qe&&Qe.__importStar||function(u){if(u&&u.__esModule)return u;var o={};if(u!=null)for(var m in u)m!=="default"&&Object.prototype.hasOwnProperty.call(u,m)&&e(o,u,m);return t(o,u),o};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.prepareKeyValueMessage=Qe.issueFileCommand=void 0;const n=r(su),i=r(oe),a=r(le),s=iu();function l(u,o){const m=process.env[`GITHUB_${u}`];if(!m)throw new Error(`Unable to find environment variable for file command ${u}`);if(!i.existsSync(m))throw new Error(`Missing file at path: ${m}`);i.appendFileSync(m,`${(0,s.toCommandValue)(o)}${a.EOL}`,{encoding:"utf8"})}Qe.issueFileCommand=l;function c(u,o){const m=`ghadelimiter_${n.randomUUID()}`,_=(0,s.toCommandValue)(o);if(u.includes(m))throw new Error(`Unexpected input: name should not contain the delimiter "${m}"`);if(_.includes(m))throw new Error(`Unexpected input: value should not contain the delimiter "${m}"`);return`${u}<<${m}${a.EOL}${_}${a.EOL}${m}`}return Qe.prepareKeyValueMessage=c,Qe}var Gt={};function Ba(e){const t=e.protocol==="https:";if(fy(e))return;const r=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new Lc(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new Lc(`http://${r}`)}else return}function fy(e){if(!e.hostname)return!1;const t=e.hostname;if(dy(t))return!0;const r=process.env.no_proxy||process.env.NO_PROXY||"";if(!r)return!1;let n;e.port?n=Number(e.port):e.protocol==="http:"?n=80:e.protocol==="https:"&&(n=443);const i=[e.hostname.toUpperCase()];typeof n=="number"&&i.push(`${i[0]}:${n}`);for(const a of r.split(",").map(s=>s.trim().toUpperCase()).filter(s=>s))if(a==="*"||i.some(s=>s===a||s.endsWith(`.${a}`)||a.startsWith(".")&&s.endsWith(`${a}`)))return!0;return!1}function dy(e){const t=e.toLowerCase();return t==="localhost"||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}class Lc extends URL{_decodedUsername;_decodedPassword;constructor(t,r){super(t,r),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var Vt={},xc;function hy(){if(xc)return Vt;xc=1;var e=O_,t=jr,r=pr,n=mr,i=_r;Vt.httpOverHttp=a,Vt.httpsOverHttp=s,Vt.httpOverHttps=l,Vt.httpsOverHttps=c;function a(R){var p=new u(R);return p.request=t.request,p}function s(R){var p=new u(R);return p.request=t.request,p.createSocket=o,p.defaultPort=443,p}function l(R){var p=new u(R);return p.request=r.request,p}function c(R){var p=new u(R);return p.request=r.request,p.createSocket=o,p.defaultPort=443,p}function u(R){var p=this;p.options=R||{},p.proxyOptions=p.options.proxy||{},p.maxSockets=p.options.maxSockets||t.Agent.defaultMaxSockets,p.requests=[],p.sockets=[],p.on("free",function(y,v,g,E){for(var d=m(v,g,E),w=0,f=p.requests.length;w<f;++w){var b=p.requests[w];if(b.host===d.host&&b.port===d.port){p.requests.splice(w,1),b.request.onSocket(y);return}}y.destroy(),p.removeSocket(y)})}i.inherits(u,n.EventEmitter),u.prototype.addRequest=function(p,h,y,v){var g=this,E=_({request:p},g.options,m(h,y,v));if(g.sockets.length>=this.maxSockets){g.requests.push(E);return}g.createSocket(E,function(d){d.on("free",w),d.on("close",f),d.on("agentRemove",f),p.onSocket(d);function w(){g.emit("free",d,E)}function f(b){g.removeSocket(d),d.removeListener("free",w),d.removeListener("close",f),d.removeListener("agentRemove",f)}})},u.prototype.createSocket=function(p,h){var y=this,v={};y.sockets.push(v);var g=_({},y.proxyOptions,{method:"CONNECT",path:p.host+":"+p.port,agent:!1,headers:{host:p.host+":"+p.port}});p.localAddress&&(g.localAddress=p.localAddress),g.proxyAuth&&(g.headers=g.headers||{},g.headers["Proxy-Authorization"]="Basic "+new Buffer(g.proxyAuth).toString("base64")),S("making CONNECT request");var E=y.request(g);E.useChunkedEncodingByDefault=!1,E.once("response",d),E.once("upgrade",w),E.once("connect",f),E.once("error",b),E.end();function d($){$.upgrade=!0}function w($,T,k){process.nextTick(function(){f($,T,k)})}function f($,T,k){if(E.removeAllListeners(),T.removeAllListeners(),$.statusCode!==200){S("tunneling socket could not be established, statusCode=%d",$.statusCode),T.destroy();var B=new Error("tunneling socket could not be established, statusCode="+$.statusCode);B.code="ECONNRESET",p.request.emit("error",B),y.removeSocket(v);return}if(k.length>0){S("got illegal response body from proxy"),T.destroy();var B=new Error("got illegal response body from proxy");B.code="ECONNRESET",p.request.emit("error",B),y.removeSocket(v);return}return S("tunneling connection has established"),y.sockets[y.sockets.indexOf(v)]=T,h(T)}function b($){E.removeAllListeners(),S(`tunneling socket could not be established, cause=%s
|
||
`,$.message,$.stack);var T=new Error("tunneling socket could not be established, cause="+$.message);T.code="ECONNRESET",p.request.emit("error",T),y.removeSocket(v)}},u.prototype.removeSocket=function(p){var h=this.sockets.indexOf(p);if(h!==-1){this.sockets.splice(h,1);var y=this.requests.shift();y&&this.createSocket(y,function(v){y.request.onSocket(v)})}};function o(R,p){var h=this;u.prototype.createSocket.call(h,R,function(y){var v=R.request.getHeader("host"),g=_({},h.options,{socket:y,servername:v?v.replace(/:.*$/,""):R.host}),E=e.connect(0,g);h.sockets[h.sockets.indexOf(y)]=E,p(E)})}function m(R,p,h){return typeof R=="string"?{host:R,port:p,localAddress:h}:R}function _(R){for(var p=1,h=arguments.length;p<h;++p){var y=arguments[p];if(typeof y=="object")for(var v=Object.keys(y),g=0,E=v.length;g<E;++g){var d=v[g];y[d]!==void 0&&(R[d]=y[d])}}return R}var S;return process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?S=function(){var R=Array.prototype.slice.call(arguments);typeof R[0]=="string"?R[0]="TUNNEL: "+R[0]:R.unshift("TUNNEL:"),console.error.apply(console,R)}:S=function(){},Vt.debug=S,Vt}var ki,Cc;function py(){return Cc||(Cc=1,ki=hy()),ki}var Wr=py(),rt;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(rt||(rt={}));var je;(function(e){e.Accept="accept",e.ContentType="content-type"})(je||(je={}));var It;(function(e){e.ApplicationJson="application/json"})(It||(It={}));function my(e){const t=Ba(new URL(e));return t?t.href:""}const _y=[rt.MovedPermanently,rt.ResourceMoved,rt.SeeOther,rt.TemporaryRedirect,rt.PermanentRedirect],yy=[rt.BadGateway,rt.ServiceUnavailable,rt.GatewayTimeout],vy=["OPTIONS","GET","DELETE","HEAD"],wy=10,gy=5;class Cn extends Error{constructor(t,r){super(t),this.name="HttpClientError",this.statusCode=r,Object.setPrototypeOf(this,Cn.prototype)}statusCode;result}class hp{constructor(t){this.message=t}message;async readBody(){return new Promise(async t=>{let r=Buffer.alloc(0);this.message.on("data",n=>{r=Buffer.concat([r,n])}),this.message.on("end",()=>{t(r.toString())})})}async readBodyBuffer(){return new Promise(async t=>{const r=[];this.message.on("data",n=>{r.push(n)}),this.message.on("end",()=>{t(Buffer.concat(r))})})}}function Ey(e){return new URL(e).protocol==="https:"}class pp{userAgent;handlers;requestOptions;_ignoreSslError=!1;_socketTimeout;_allowRedirects=!0;_allowRedirectDowngrade=!1;_maxRedirects=50;_allowRetries=!1;_maxRetries=1;_agent;_proxyAgent;_proxyAgentDispatcher;_keepAlive=!1;_disposed=!1;constructor(t,r,n){this.userAgent=t,this.handlers=r||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}async options(t,r){return this.request("OPTIONS",t,null,r||{})}async get(t,r){return this.request("GET",t,null,r||{})}async del(t,r){return this.request("DELETE",t,null,r||{})}async post(t,r,n){return this.request("POST",t,r,n||{})}async patch(t,r,n){return this.request("PATCH",t,r,n||{})}async put(t,r,n){return this.request("PUT",t,r,n||{})}async head(t,r){return this.request("HEAD",t,null,r||{})}async sendStream(t,r,n,i){return this.request(t,r,n,i)}async getJson(t,r={}){r[je.Accept]=this._getExistingOrDefaultHeader(r,je.Accept,It.ApplicationJson);const n=await this.get(t,r);return this._processResponse(n,this.requestOptions)}async postJson(t,r,n={}){const i=JSON.stringify(r,null,2);n[je.Accept]=this._getExistingOrDefaultHeader(n,je.Accept,It.ApplicationJson),n[je.ContentType]=this._getExistingOrDefaultHeader(n,je.ContentType,It.ApplicationJson);const a=await this.post(t,i,n);return this._processResponse(a,this.requestOptions)}async putJson(t,r,n={}){const i=JSON.stringify(r,null,2);n[je.Accept]=this._getExistingOrDefaultHeader(n,je.Accept,It.ApplicationJson),n[je.ContentType]=this._getExistingOrDefaultHeader(n,je.ContentType,It.ApplicationJson);const a=await this.put(t,i,n);return this._processResponse(a,this.requestOptions)}async patchJson(t,r,n={}){const i=JSON.stringify(r,null,2);n[je.Accept]=this._getExistingOrDefaultHeader(n,je.Accept,It.ApplicationJson),n[je.ContentType]=this._getExistingOrDefaultHeader(n,je.ContentType,It.ApplicationJson);const a=await this.patch(t,i,n);return this._processResponse(a,this.requestOptions)}async request(t,r,n,i){if(this._disposed)throw new Error("Client has already been disposed.");const a=new URL(r);let s=this._prepareRequest(t,a,i);const l=this._allowRetries&&vy.includes(t)?this._maxRetries+1:1;let c=0,u;do{if(u=await this.requestRaw(s,n),u&&u.message&&u.message.statusCode===rt.Unauthorized){let m;for(const _ of this.handlers)if(_.canHandleAuthentication(u)){m=_;break}return m?m.handleAuthentication(this,s,n):u}let o=this._maxRedirects;for(;u.message.statusCode&&_y.includes(u.message.statusCode)&&this._allowRedirects&&o>0;){const m=u.message.headers.location;if(!m)break;const _=new URL(m);if(a.protocol==="https:"&&a.protocol!==_.protocol&&!this._allowRedirectDowngrade)throw new Error("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.");if(await u.readBody(),_.hostname!==a.hostname)for(const S in i)S.toLowerCase()==="authorization"&&delete i[S];s=this._prepareRequest(t,_,i),u=await this.requestRaw(s,n),o--}if(!u.message.statusCode||!yy.includes(u.message.statusCode))return u;c+=1,c<l&&(await u.readBody(),await this._performExponentialBackoff(c))}while(c<l);return u}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}async requestRaw(t,r){return new Promise((n,i)=>{function a(s,l){s?i(s):l?n(l):i(new Error("Unknown error"))}this.requestRawWithCallback(t,r,a)})}requestRawWithCallback(t,r,n){typeof r=="string"&&(t.options.headers||(t.options.headers={}),t.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8"));let i=!1;function a(c,u){i||(i=!0,n(c,u))}const s=t.httpModule.request(t.options,c=>{const u=new hp(c);a(void 0,u)});let l;s.on("socket",c=>{l=c}),s.setTimeout(this._socketTimeout||3*6e4,()=>{l&&l.end(),a(new Error(`Request timeout: ${t.options.path}`))}),s.on("error",function(c){a(c)}),r&&typeof r=="string"&&s.write(r,"utf8"),r&&typeof r!="string"?(r.on("close",function(){s.end()}),r.pipe(s)):s.end()}getAgent(t){const r=new URL(t);return this._getAgent(r)}async getAgentDispatcher(t){const r=new URL(t),n=Ba(r);if(n&&n.hostname)return await this._getProxyAgentDispatcher(r,n)}_prepareRequest(t,r,n){const i={};i.parsedUrl=r;const a=i.parsedUrl.protocol==="https:";i.httpModule=a?Fu:zn;const s=a?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):s,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=t,i.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(const l of this.handlers)l.prepareRequest(i.options);return i}_mergeHeaders(t){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Xr(this.requestOptions.headers),Xr(t||{})):Xr(t||{})}_getExistingOrDefaultHeader(t,r,n){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Xr(this.requestOptions.headers)[r]),t[r]||i||n}_getAgent(t){let r;const n=Ba(t),i=n&&n.hostname;if(this._keepAlive&&i&&(r=this._proxyAgent),i||(r=this._agent),r)return r;const a=t.protocol==="https:";let s=100;if(this.requestOptions&&(s=this.requestOptions.maxSockets||zn.globalAgent.maxSockets),n&&n.hostname){const l={maxSockets:s,keepAlive:this._keepAlive,proxy:{...(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`},host:n.hostname,port:n.port}};let c;const u=n.protocol==="https:";a?c=u?Wr.httpsOverHttps:Wr.httpsOverHttp:c=u?Wr.httpOverHttps:Wr.httpOverHttp,r=c(l),this._proxyAgent=r}if(!r){const l={keepAlive:this._keepAlive,maxSockets:s};r=a?new Fu.Agent(l):new zn.Agent(l),this._agent=r}return a&&this._ignoreSslError&&(r.options=Object.assign(r.options||{},{rejectUnauthorized:!1})),r}async _getProxyAgentDispatcher(t,r){let n;if(this._keepAlive&&(n=this._proxyAgentDispatcher),n)return n;const i=t.protocol==="https:",a=await Promise.resolve().then(()=>require("./assets/proxy-agent-BKAI_6L-.js")).then(s=>s.proxyAgent);return n=new a({uri:r.href,pipelining:this._keepAlive?1:0,...(r.username||r.password)&&{token:`Basic ${Buffer.from(`${r.username}:${r.password}`).toString("base64")}`}}),this._proxyAgentDispatcher=n,i&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}async _performExponentialBackoff(t){t=Math.min(wy,t);const r=gy*Math.pow(2,t);return new Promise(n=>setTimeout(()=>n(),r))}async _processResponse(t,r){return new Promise(async(n,i)=>{const a=t.message.statusCode||0,s={statusCode:a,result:null,headers:{}};a===rt.NotFound&&n(s);function l(o,m){if(typeof m=="string"){const _=new Date(m);if(!isNaN(_.valueOf()))return _}return m}let c,u;try{u=await t.readBody(),u&&u.length>0&&(r&&r.deserializeDates?c=JSON.parse(u,l):c=JSON.parse(u),s.result=c),s.headers=t.message.headers}catch{}if(a>299){let o;c&&c.message?o=c.message:u&&u.length>0?o=u:o=`Failed request: (${a})`;const m=new Cn(o,a);m.result=s.result,i(m)}else n(s)})}}const Xr=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}),Sy=Object.freeze(Object.defineProperty({__proto__:null,get Headers(){return je},HttpClient:pp,HttpClientError:Cn,HttpClientResponse:hp,get HttpCodes(){return rt},get MediaTypes(){return It},getProxyUrl:my,isHttps:Ey},Symbol.toStringTag,{value:"Module"})),mp=Pn(Sy);var dt={},Dc;function Ry(){if(Dc)return dt;Dc=1;var e=dt&&dt.__awaiter||function(i,a,s,l){function c(u){return u instanceof s?u:new s(function(o){o(u)})}return new(s||(s=Promise))(function(u,o){function m(R){try{S(l.next(R))}catch(p){o(p)}}function _(R){try{S(l.throw(R))}catch(p){o(p)}}function S(R){R.done?u(R.value):c(R.value).then(m,_)}S((l=l.apply(i,a||[])).next())})};Object.defineProperty(dt,"__esModule",{value:!0}),dt.PersonalAccessTokenCredentialHandler=dt.BearerCredentialHandler=dt.BasicCredentialHandler=void 0;class t{constructor(a,s){this.username=a,this.password=s}prepareRequest(a){if(!a.headers)throw Error("The request has no headers");a.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}dt.BasicCredentialHandler=t;class r{constructor(a){this.token=a}prepareRequest(a){if(!a.headers)throw Error("The request has no headers");a.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}dt.BearerCredentialHandler=r;class n{constructor(a){this.token=a}prepareRequest(a){if(!a.headers)throw Error("The request has no headers");a.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}return dt.PersonalAccessTokenCredentialHandler=n,dt}var Fc;function by(){if(Fc)return Gt;Fc=1;var e=Gt&&Gt.__awaiter||function(a,s,l,c){function u(o){return o instanceof l?o:new l(function(m){m(o)})}return new(l||(l=Promise))(function(o,m){function _(p){try{R(c.next(p))}catch(h){m(h)}}function S(p){try{R(c.throw(p))}catch(h){m(h)}}function R(p){p.done?o(p.value):u(p.value).then(_,S)}R((c=c.apply(a,s||[])).next())})};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.OidcClient=void 0;const t=mp,r=Ry(),n=vr();class i{static createHttpClient(s=!0,l=10){const c={allowRetries:s,maxRetries:l};return new t.HttpClient("actions/oidc-client",[new r.BearerCredentialHandler(i.getRequestToken())],c)}static getRequestToken(){const s=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!s)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return s}static getIDTokenUrl(){const s=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!s)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return s}static getCall(s){var l;return e(this,void 0,void 0,function*(){const o=(l=(yield i.createHttpClient().getJson(s).catch(m=>{throw new Error(`Failed to get ID Token.
|
||
|
||
Error Code : ${m.statusCode}
|
||
|
||
Error Message: ${m.message}`)})).result)===null||l===void 0?void 0:l.value;if(!o)throw new Error("Response json body do not have ID Token field");return o})}static getIDToken(s){return e(this,void 0,void 0,function*(){try{let l=i.getIDTokenUrl();if(s){const u=encodeURIComponent(s);l=`${l}&audience=${u}`}(0,n.debug)(`ID token url is ${l}`);const c=yield i.getCall(l);return(0,n.setSecret)(c),c}catch(l){throw new Error(`Error message: ${l.message}`)}})}}return Gt.OidcClient=i,Gt}var Ir={},qc;function kc(){return qc||(qc=1,(function(e){var t=Ir&&Ir.__awaiter||function(u,o,m,_){function S(R){return R instanceof m?R:new m(function(p){p(R)})}return new(m||(m=Promise))(function(R,p){function h(g){try{v(_.next(g))}catch(E){p(E)}}function y(g){try{v(_.throw(g))}catch(E){p(E)}}function v(g){g.done?R(g.value):S(g.value).then(h,y)}v((_=_.apply(u,o||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;const r=le,n=oe,{access:i,appendFile:a,writeFile:s}=n.promises;e.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY",e.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class l{constructor(){this._buffer=""}filePath(){return t(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;const o=process.env[e.SUMMARY_ENV_VAR];if(!o)throw new Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield i(o,n.constants.R_OK|n.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${o}'. Check if the file has correct read/write permissions.`)}return this._filePath=o,this._filePath})}wrap(o,m,_={}){const S=Object.entries(_).map(([R,p])=>` ${R}="${p}"`).join("");return m?`<${o}${S}>${m}</${o}>`:`<${o}${S}>`}write(o){return t(this,void 0,void 0,function*(){const m=!!(o!=null&&o.overwrite),_=yield this.filePath();return yield(m?s:a)(_,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return t(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(o,m=!1){return this._buffer+=o,m?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(o,m){const _=Object.assign({},m&&{lang:m}),S=this.wrap("pre",this.wrap("code",o),_);return this.addRaw(S).addEOL()}addList(o,m=!1){const _=m?"ol":"ul",S=o.map(p=>this.wrap("li",p)).join(""),R=this.wrap(_,S);return this.addRaw(R).addEOL()}addTable(o){const m=o.map(S=>{const R=S.map(p=>{if(typeof p=="string")return this.wrap("td",p);const{header:h,data:y,colspan:v,rowspan:g}=p,E=h?"th":"td",d=Object.assign(Object.assign({},v&&{colspan:v}),g&&{rowspan:g});return this.wrap(E,y,d)}).join("");return this.wrap("tr",R)}).join(""),_=this.wrap("table",m);return this.addRaw(_).addEOL()}addDetails(o,m){const _=this.wrap("details",this.wrap("summary",o)+m);return this.addRaw(_).addEOL()}addImage(o,m,_){const{width:S,height:R}=_||{},p=Object.assign(Object.assign({},S&&{width:S}),R&&{height:R}),h=this.wrap("img",null,Object.assign({src:o,alt:m},p));return this.addRaw(h).addEOL()}addHeading(o,m){const _=`h${m}`,S=["h1","h2","h3","h4","h5","h6"].includes(_)?_:"h1",R=this.wrap(S,o);return this.addRaw(R).addEOL()}addSeparator(){const o=this.wrap("hr",null);return this.addRaw(o).addEOL()}addBreak(){const o=this.wrap("br",null);return this.addRaw(o).addEOL()}addQuote(o,m){const _=Object.assign({},m&&{cite:m}),S=this.wrap("blockquote",o,_);return this.addRaw(S).addEOL()}addLink(o,m){const _=this.wrap("a",o,{href:m});return this.addRaw(_).addEOL()}}const c=new l;e.markdownSummary=c,e.summary=c})(Ir)),Ir}var Ge={},jc;function $y(){if(jc)return Ge;jc=1;var e=Ge&&Ge.__createBinding||(Object.create?function(l,c,u,o){o===void 0&&(o=u);var m=Object.getOwnPropertyDescriptor(c,u);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,o,m)}:function(l,c,u,o){o===void 0&&(o=u),l[o]=c[u]}),t=Ge&&Ge.__setModuleDefault||(Object.create?function(l,c){Object.defineProperty(l,"default",{enumerable:!0,value:c})}:function(l,c){l.default=c}),r=Ge&&Ge.__importStar||function(l){if(l&&l.__esModule)return l;var c={};if(l!=null)for(var u in l)u!=="default"&&Object.prototype.hasOwnProperty.call(l,u)&&e(c,l,u);return t(c,l),c};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.toPlatformPath=Ge.toWin32Path=Ge.toPosixPath=void 0;const n=r(F);function i(l){return l.replace(/[\\]/g,"/")}Ge.toPosixPath=i;function a(l){return l.replace(/[/]/g,"\\")}Ge.toWin32Path=a;function s(l){return l.replace(/[/\\]/g,n.sep)}return Ge.toPlatformPath=s,Ge}var Ze={},Ve={},Be={},be={},ht={},Uc;function _p(){return Uc||(Uc=1,(function(e){var t=ht&&ht.__createBinding||(Object.create?function(p,h,y,v){v===void 0&&(v=y),Object.defineProperty(p,v,{enumerable:!0,get:function(){return h[y]}})}:function(p,h,y,v){v===void 0&&(v=y),p[v]=h[y]}),r=ht&&ht.__setModuleDefault||(Object.create?function(p,h){Object.defineProperty(p,"default",{enumerable:!0,value:h})}:function(p,h){p.default=h}),n=ht&&ht.__importStar||function(p){if(p&&p.__esModule)return p;var h={};if(p!=null)for(var y in p)y!=="default"&&Object.hasOwnProperty.call(p,y)&&t(h,p,y);return r(h,p),h},i=ht&&ht.__awaiter||function(p,h,y,v){function g(E){return E instanceof y?E:new y(function(d){d(E)})}return new(y||(y=Promise))(function(E,d){function w($){try{b(v.next($))}catch(T){d(T)}}function f($){try{b(v.throw($))}catch(T){d(T)}}function b($){$.done?E($.value):g($.value).then(w,f)}b((v=v.apply(p,h||[])).next())})},a;Object.defineProperty(e,"__esModule",{value:!0}),e.getCmdPath=e.tryGetExecutablePath=e.isRooted=e.isDirectory=e.exists=e.READONLY=e.UV_FS_O_EXLOCK=e.IS_WINDOWS=e.unlink=e.symlink=e.stat=e.rmdir=e.rm=e.rename=e.readlink=e.readdir=e.open=e.mkdir=e.lstat=e.copyFile=e.chmod=void 0;const s=n(oe),l=n(F);a=s.promises,e.chmod=a.chmod,e.copyFile=a.copyFile,e.lstat=a.lstat,e.mkdir=a.mkdir,e.open=a.open,e.readdir=a.readdir,e.readlink=a.readlink,e.rename=a.rename,e.rm=a.rm,e.rmdir=a.rmdir,e.stat=a.stat,e.symlink=a.symlink,e.unlink=a.unlink,e.IS_WINDOWS=process.platform==="win32",e.UV_FS_O_EXLOCK=268435456,e.READONLY=s.constants.O_RDONLY;function c(p){return i(this,void 0,void 0,function*(){try{yield e.stat(p)}catch(h){if(h.code==="ENOENT")return!1;throw h}return!0})}e.exists=c;function u(p,h=!1){return i(this,void 0,void 0,function*(){return(h?yield e.stat(p):yield e.lstat(p)).isDirectory()})}e.isDirectory=u;function o(p){if(p=_(p),!p)throw new Error('isRooted() parameter "p" cannot be empty');return e.IS_WINDOWS?p.startsWith("\\")||/^[A-Z]:/i.test(p):p.startsWith("/")}e.isRooted=o;function m(p,h){return i(this,void 0,void 0,function*(){let y;try{y=yield e.stat(p)}catch(g){g.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${p}': ${g}`)}if(y&&y.isFile()){if(e.IS_WINDOWS){const g=l.extname(p).toUpperCase();if(h.some(E=>E.toUpperCase()===g))return p}else if(S(y))return p}const v=p;for(const g of h){p=v+g,y=void 0;try{y=yield e.stat(p)}catch(E){E.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${p}': ${E}`)}if(y&&y.isFile()){if(e.IS_WINDOWS){try{const E=l.dirname(p),d=l.basename(p).toUpperCase();for(const w of yield e.readdir(E))if(d===w.toUpperCase()){p=l.join(E,w);break}}catch(E){console.log(`Unexpected error attempting to determine the actual case of the file '${p}': ${E}`)}return p}else if(S(y))return p}}return""})}e.tryGetExecutablePath=m;function _(p){return p=p||"",e.IS_WINDOWS?(p=p.replace(/\//g,"\\"),p.replace(/\\\\+/g,"\\")):p.replace(/\/\/+/g,"/")}function S(p){return(p.mode&1)>0||(p.mode&8)>0&&p.gid===process.getgid()||(p.mode&64)>0&&p.uid===process.getuid()}function R(){var p;return(p=process.env.COMSPEC)!==null&&p!==void 0?p:"cmd.exe"}e.getCmdPath=R})(ht)),ht}var Mc;function yp(){if(Mc)return be;Mc=1;var e=be&&be.__createBinding||(Object.create?function(h,y,v,g){g===void 0&&(g=v),Object.defineProperty(h,g,{enumerable:!0,get:function(){return y[v]}})}:function(h,y,v,g){g===void 0&&(g=v),h[g]=y[v]}),t=be&&be.__setModuleDefault||(Object.create?function(h,y){Object.defineProperty(h,"default",{enumerable:!0,value:y})}:function(h,y){h.default=y}),r=be&&be.__importStar||function(h){if(h&&h.__esModule)return h;var y={};if(h!=null)for(var v in h)v!=="default"&&Object.hasOwnProperty.call(h,v)&&e(y,h,v);return t(y,h),y},n=be&&be.__awaiter||function(h,y,v,g){function E(d){return d instanceof v?d:new v(function(w){w(d)})}return new(v||(v=Promise))(function(d,w){function f(T){try{$(g.next(T))}catch(k){w(k)}}function b(T){try{$(g.throw(T))}catch(k){w(k)}}function $(T){T.done?d(T.value):E(T.value).then(f,b)}$((g=g.apply(h,y||[])).next())})};Object.defineProperty(be,"__esModule",{value:!0}),be.findInPath=be.which=be.mkdirP=be.rmRF=be.mv=be.cp=void 0;const i=Ur,a=r(F),s=r(_p());function l(h,y,v={}){return n(this,void 0,void 0,function*(){const{force:g,recursive:E,copySourceDirectory:d}=S(v),w=(yield s.exists(y))?yield s.stat(y):null;if(w&&w.isFile()&&!g)return;const f=w&&w.isDirectory()&&d?a.join(y,a.basename(h)):y;if(!(yield s.exists(h)))throw new Error(`no such file or directory: ${h}`);if((yield s.stat(h)).isDirectory())if(E)yield R(h,f,0,g);else throw new Error(`Failed to copy. ${h} is a directory, but tried to copy without recursive flag.`);else{if(a.relative(h,f)==="")throw new Error(`'${f}' and '${h}' are the same file`);yield p(h,f,g)}})}be.cp=l;function c(h,y,v={}){return n(this,void 0,void 0,function*(){if(yield s.exists(y)){let g=!0;if((yield s.isDirectory(y))&&(y=a.join(y,a.basename(h)),g=yield s.exists(y)),g)if(v.force==null||v.force)yield u(y);else throw new Error("Destination already exists")}yield o(a.dirname(y)),yield s.rename(h,y)})}be.mv=c;function u(h){return n(this,void 0,void 0,function*(){if(s.IS_WINDOWS&&/[*"<>|]/.test(h))throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield s.rm(h,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(y){throw new Error(`File was unable to be removed ${y}`)}})}be.rmRF=u;function o(h){return n(this,void 0,void 0,function*(){i.ok(h,"a path argument must be provided"),yield s.mkdir(h,{recursive:!0})})}be.mkdirP=o;function m(h,y){return n(this,void 0,void 0,function*(){if(!h)throw new Error("parameter 'tool' is required");if(y){const g=yield m(h,!1);if(!g)throw s.IS_WINDOWS?new Error(`Unable to locate executable file: ${h}. 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.`):new Error(`Unable to locate executable file: ${h}. 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.`);return g}const v=yield _(h);return v&&v.length>0?v[0]:""})}be.which=m;function _(h){return n(this,void 0,void 0,function*(){if(!h)throw new Error("parameter 'tool' is required");const y=[];if(s.IS_WINDOWS&&process.env.PATHEXT)for(const E of process.env.PATHEXT.split(a.delimiter))E&&y.push(E);if(s.isRooted(h)){const E=yield s.tryGetExecutablePath(h,y);return E?[E]:[]}if(h.includes(a.sep))return[];const v=[];if(process.env.PATH)for(const E of process.env.PATH.split(a.delimiter))E&&v.push(E);const g=[];for(const E of v){const d=yield s.tryGetExecutablePath(a.join(E,h),y);d&&g.push(d)}return g})}be.findInPath=_;function S(h){const y=h.force==null?!0:h.force,v=!!h.recursive,g=h.copySourceDirectory==null?!0:!!h.copySourceDirectory;return{force:y,recursive:v,copySourceDirectory:g}}function R(h,y,v,g){return n(this,void 0,void 0,function*(){if(v>=255)return;v++,yield o(y);const E=yield s.readdir(h);for(const d of E){const w=`${h}/${d}`,f=`${y}/${d}`;(yield s.lstat(w)).isDirectory()?yield R(w,f,v,g):yield p(w,f,g)}yield s.chmod(y,(yield s.stat(h)).mode)})}function p(h,y,v){return n(this,void 0,void 0,function*(){if((yield s.lstat(h)).isSymbolicLink()){try{yield s.lstat(y),yield s.unlink(y)}catch(E){E.code==="EPERM"&&(yield s.chmod(y,"0666"),yield s.unlink(y))}const g=yield s.readlink(h);yield s.symlink(g,y,s.IS_WINDOWS?"junction":null)}else(!(yield s.exists(y))||v)&&(yield s.copyFile(h,y))})}return be}var Gc;function Oy(){if(Gc)return Be;Gc=1;var e=Be&&Be.__createBinding||(Object.create?function(p,h,y,v){v===void 0&&(v=y),Object.defineProperty(p,v,{enumerable:!0,get:function(){return h[y]}})}:function(p,h,y,v){v===void 0&&(v=y),p[v]=h[y]}),t=Be&&Be.__setModuleDefault||(Object.create?function(p,h){Object.defineProperty(p,"default",{enumerable:!0,value:h})}:function(p,h){p.default=h}),r=Be&&Be.__importStar||function(p){if(p&&p.__esModule)return p;var h={};if(p!=null)for(var y in p)y!=="default"&&Object.hasOwnProperty.call(p,y)&&e(h,p,y);return t(h,p),h},n=Be&&Be.__awaiter||function(p,h,y,v){function g(E){return E instanceof y?E:new y(function(d){d(E)})}return new(y||(y=Promise))(function(E,d){function w($){try{b(v.next($))}catch(T){d(T)}}function f($){try{b(v.throw($))}catch(T){d(T)}}function b($){$.done?E($.value):g($.value).then(w,f)}b((v=v.apply(p,h||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.argStringToArray=Be.ToolRunner=void 0;const i=r(le),a=r(mr),s=r(xt),l=r(F),c=r(yp()),u=r(_p()),o=P_,m=process.platform==="win32";class _ extends a.EventEmitter{constructor(h,y,v){if(super(),!h)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=h,this.args=y||[],this.options=v||{}}_debug(h){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(h)}_getCommandString(h,y){const v=this._getSpawnFileName(),g=this._getSpawnArgs(h);let E=y?"":"[command]";if(m)if(this._isCmdFile()){E+=v;for(const d of g)E+=` ${d}`}else if(h.windowsVerbatimArguments){E+=`"${v}"`;for(const d of g)E+=` ${d}`}else{E+=this._windowsQuoteCmdArg(v);for(const d of g)E+=` ${this._windowsQuoteCmdArg(d)}`}else{E+=v;for(const d of g)E+=` ${d}`}return E}_processLineBuffer(h,y,v){try{let g=y+h.toString(),E=g.indexOf(i.EOL);for(;E>-1;){const d=g.substring(0,E);v(d),g=g.substring(E+i.EOL.length),E=g.indexOf(i.EOL)}return g}catch(g){return this._debug(`error processing line. Failed with error ${g}`),""}}_getSpawnFileName(){return m&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(h){if(m&&this._isCmdFile()){let y=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const v of this.args)y+=" ",y+=h.windowsVerbatimArguments?v:this._windowsQuoteCmdArg(v);return y+='"',[y]}return this.args}_endsWith(h,y){return h.endsWith(y)}_isCmdFile(){const h=this.toolPath.toUpperCase();return this._endsWith(h,".CMD")||this._endsWith(h,".BAT")}_windowsQuoteCmdArg(h){if(!this._isCmdFile())return this._uvQuoteCmdArg(h);if(!h)return'""';const y=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let v=!1;for(const d of h)if(y.some(w=>w===d)){v=!0;break}if(!v)return h;let g='"',E=!0;for(let d=h.length;d>0;d--)g+=h[d-1],E&&h[d-1]==="\\"?g+="\\":h[d-1]==='"'?(E=!0,g+='"'):E=!1;return g+='"',g.split("").reverse().join("")}_uvQuoteCmdArg(h){if(!h)return'""';if(!h.includes(" ")&&!h.includes(" ")&&!h.includes('"'))return h;if(!h.includes('"')&&!h.includes("\\"))return`"${h}"`;let y='"',v=!0;for(let g=h.length;g>0;g--)y+=h[g-1],v&&h[g-1]==="\\"?y+="\\":h[g-1]==='"'?(v=!0,y+="\\"):v=!1;return y+='"',y.split("").reverse().join("")}_cloneExecOptions(h){h=h||{};const y={cwd:h.cwd||process.cwd(),env:h.env||process.env,silent:h.silent||!1,windowsVerbatimArguments:h.windowsVerbatimArguments||!1,failOnStdErr:h.failOnStdErr||!1,ignoreReturnCode:h.ignoreReturnCode||!1,delay:h.delay||1e4};return y.outStream=h.outStream||process.stdout,y.errStream=h.errStream||process.stderr,y}_getSpawnOptions(h,y){h=h||{};const v={};return v.cwd=h.cwd,v.env=h.env,v.windowsVerbatimArguments=h.windowsVerbatimArguments||this._isCmdFile(),h.windowsVerbatimArguments&&(v.argv0=`"${y}"`),v}exec(){return n(this,void 0,void 0,function*(){return!u.isRooted(this.toolPath)&&(this.toolPath.includes("/")||m&&this.toolPath.includes("\\"))&&(this.toolPath=l.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield c.which(this.toolPath,!0),new Promise((h,y)=>n(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(const b of this.args)this._debug(` ${b}`);const v=this._cloneExecOptions(this.options);!v.silent&&v.outStream&&v.outStream.write(this._getCommandString(v)+i.EOL);const g=new R(v,this.toolPath);if(g.on("debug",b=>{this._debug(b)}),this.options.cwd&&!(yield u.exists(this.options.cwd)))return y(new Error(`The cwd: ${this.options.cwd} does not exist!`));const E=this._getSpawnFileName(),d=s.spawn(E,this._getSpawnArgs(v),this._getSpawnOptions(this.options,E));let w="";d.stdout&&d.stdout.on("data",b=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(b),!v.silent&&v.outStream&&v.outStream.write(b),w=this._processLineBuffer(b,w,$=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline($)})});let f="";if(d.stderr&&d.stderr.on("data",b=>{g.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(b),!v.silent&&v.errStream&&v.outStream&&(v.failOnStdErr?v.errStream:v.outStream).write(b),f=this._processLineBuffer(b,f,$=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline($)})}),d.on("error",b=>{g.processError=b.message,g.processExited=!0,g.processClosed=!0,g.CheckComplete()}),d.on("exit",b=>{g.processExitCode=b,g.processExited=!0,this._debug(`Exit code ${b} received from tool '${this.toolPath}'`),g.CheckComplete()}),d.on("close",b=>{g.processExitCode=b,g.processExited=!0,g.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),g.CheckComplete()}),g.on("done",(b,$)=>{w.length>0&&this.emit("stdline",w),f.length>0&&this.emit("errline",f),d.removeAllListeners(),b?y(b):h($)}),this.options.input){if(!d.stdin)throw new Error("child process missing stdin");d.stdin.end(this.options.input)}}))})}}Be.ToolRunner=_;function S(p){const h=[];let y=!1,v=!1,g="";function E(d){v&&d!=='"'&&(g+="\\"),g+=d,v=!1}for(let d=0;d<p.length;d++){const w=p.charAt(d);if(w==='"'){v?E(w):y=!y;continue}if(w==="\\"&&v){E(w);continue}if(w==="\\"&&y){v=!0;continue}if(w===" "&&!y){g.length>0&&(h.push(g),g="");continue}E(w)}return g.length>0&&h.push(g.trim()),h}Be.argStringToArray=S;class R extends a.EventEmitter{constructor(h,y){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,!y)throw new Error("toolPath must not be empty");this.options=h,this.toolPath=y,h.delay&&(this.delay=h.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=o.setTimeout(R.HandleTimeout,this.delay,this)))}_debug(h){this.emit("debug",h)}_setResult(){let h;this.processExited&&(this.processError?h=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?h=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(h=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",h,this.processExitCode)}static HandleTimeout(h){if(!h.done){if(!h.processClosed&&h.processExited){const y=`The STDIO streams did not close within ${h.delay/1e3} seconds of the exit event from process '${h.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;h._debug(y)}h._setResult()}}}return Be}var Vc;function ou(){if(Vc)return Ve;Vc=1;var e=Ve&&Ve.__createBinding||(Object.create?function(c,u,o,m){m===void 0&&(m=o),Object.defineProperty(c,m,{enumerable:!0,get:function(){return u[o]}})}:function(c,u,o,m){m===void 0&&(m=o),c[m]=u[o]}),t=Ve&&Ve.__setModuleDefault||(Object.create?function(c,u){Object.defineProperty(c,"default",{enumerable:!0,value:u})}:function(c,u){c.default=u}),r=Ve&&Ve.__importStar||function(c){if(c&&c.__esModule)return c;var u={};if(c!=null)for(var o in c)o!=="default"&&Object.hasOwnProperty.call(c,o)&&e(u,c,o);return t(u,c),u},n=Ve&&Ve.__awaiter||function(c,u,o,m){function _(S){return S instanceof o?S:new o(function(R){R(S)})}return new(o||(o=Promise))(function(S,R){function p(v){try{y(m.next(v))}catch(g){R(g)}}function h(v){try{y(m.throw(v))}catch(g){R(g)}}function y(v){v.done?S(v.value):_(v.value).then(p,h)}y((m=m.apply(c,u||[])).next())})};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getExecOutput=Ve.exec=void 0;const i=I_,a=r(Oy());function s(c,u,o){return n(this,void 0,void 0,function*(){const m=a.argStringToArray(c);if(m.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");const _=m[0];return u=m.slice(1).concat(u||[]),new a.ToolRunner(_,u,o).exec()})}Ve.exec=s;function l(c,u,o){var m,_;return n(this,void 0,void 0,function*(){let S="",R="";const p=new i.StringDecoder("utf8"),h=new i.StringDecoder("utf8"),y=(m=o==null?void 0:o.listeners)===null||m===void 0?void 0:m.stdout,v=(_=o==null?void 0:o.listeners)===null||_===void 0?void 0:_.stderr,g=f=>{R+=h.write(f),v&&v(f)},E=f=>{S+=p.write(f),y&&y(f)},d=Object.assign(Object.assign({},o==null?void 0:o.listeners),{stdout:E,stderr:g}),w=yield s(c,u,Object.assign(Object.assign({},o),{listeners:d}));return S+=p.end(),R+=h.end(),{exitCode:w,stdout:S,stderr:R}})}return Ve.getExecOutput=l,Ve}var Bc;function Iy(){return Bc||(Bc=1,(function(e){var t=Ze&&Ze.__createBinding||(Object.create?function(_,S,R,p){p===void 0&&(p=R);var h=Object.getOwnPropertyDescriptor(S,R);(!h||("get"in h?!S.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return S[R]}}),Object.defineProperty(_,p,h)}:function(_,S,R,p){p===void 0&&(p=R),_[p]=S[R]}),r=Ze&&Ze.__setModuleDefault||(Object.create?function(_,S){Object.defineProperty(_,"default",{enumerable:!0,value:S})}:function(_,S){_.default=S}),n=Ze&&Ze.__importStar||function(_){if(_&&_.__esModule)return _;var S={};if(_!=null)for(var R in _)R!=="default"&&Object.prototype.hasOwnProperty.call(_,R)&&t(S,_,R);return r(S,_),S},i=Ze&&Ze.__awaiter||function(_,S,R,p){function h(y){return y instanceof R?y:new R(function(v){v(y)})}return new(R||(R=Promise))(function(y,v){function g(w){try{d(p.next(w))}catch(f){v(f)}}function E(w){try{d(p.throw(w))}catch(f){v(f)}}function d(w){w.done?y(w.value):h(w.value).then(g,E)}d((p=p.apply(_,S||[])).next())})},a=Ze&&Ze.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.getDetails=e.isLinux=e.isMacOS=e.isWindows=e.arch=e.platform=void 0;const s=a(le),l=n(ou()),c=()=>i(void 0,void 0,void 0,function*(){const{stdout:_}=yield l.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"',void 0,{silent:!0}),{stdout:S}=yield l.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0});return{name:S.trim(),version:_.trim()}}),u=()=>i(void 0,void 0,void 0,function*(){var _,S,R,p;const{stdout:h}=yield l.getExecOutput("sw_vers",void 0,{silent:!0}),y=(S=(_=h.match(/ProductVersion:\s*(.+)/))===null||_===void 0?void 0:_[1])!==null&&S!==void 0?S:"";return{name:(p=(R=h.match(/ProductName:\s*(.+)/))===null||R===void 0?void 0:R[1])!==null&&p!==void 0?p:"",version:y}}),o=()=>i(void 0,void 0,void 0,function*(){const{stdout:_}=yield l.getExecOutput("lsb_release",["-i","-r","-s"],{silent:!0}),[S,R]=_.trim().split(`
|
||
`);return{name:S,version:R}});e.platform=s.default.platform(),e.arch=s.default.arch(),e.isWindows=e.platform==="win32",e.isMacOS=e.platform==="darwin",e.isLinux=e.platform==="linux";function m(){return i(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield e.isWindows?c():e.isMacOS?u():o()),{platform:e.platform,arch:e.arch,isWindows:e.isWindows,isMacOS:e.isMacOS,isLinux:e.isLinux})})}e.getDetails=m})(Ze)),Ze}var zc;function vr(){return zc||(zc=1,(function(e){var t=ft&&ft.__createBinding||(Object.create?function(x,z,V,Q){Q===void 0&&(Q=V);var se=Object.getOwnPropertyDescriptor(z,V);(!se||("get"in se?!z.__esModule:se.writable||se.configurable))&&(se={enumerable:!0,get:function(){return z[V]}}),Object.defineProperty(x,Q,se)}:function(x,z,V,Q){Q===void 0&&(Q=V),x[Q]=z[V]}),r=ft&&ft.__setModuleDefault||(Object.create?function(x,z){Object.defineProperty(x,"default",{enumerable:!0,value:z})}:function(x,z){x.default=z}),n=ft&&ft.__importStar||function(x){if(x&&x.__esModule)return x;var z={};if(x!=null)for(var V in x)V!=="default"&&Object.prototype.hasOwnProperty.call(x,V)&&t(z,x,V);return r(z,x),z},i=ft&&ft.__awaiter||function(x,z,V,Q){function se(X){return X instanceof V?X:new V(function(ie){ie(X)})}return new(V||(V=Promise))(function(X,ie){function ae(U){try{M(Q.next(U))}catch(j){ie(j)}}function ge(U){try{M(Q.throw(U))}catch(j){ie(j)}}function M(U){U.done?X(U.value):se(U.value).then(ae,ge)}M((Q=Q.apply(x,z||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.platform=e.toPlatformPath=e.toWin32Path=e.toPosixPath=e.markdownSummary=e.summary=e.getIDToken=e.getState=e.saveState=e.group=e.endGroup=e.startGroup=e.info=e.notice=e.warning=e.error=e.debug=e.isDebug=e.setFailed=e.setCommandEcho=e.setOutput=e.getBooleanInput=e.getMultilineInput=e.getInput=e.addPath=e.setSecret=e.exportVariable=e.ExitCode=void 0;const a=uy(),s=ly(),l=iu(),c=n(le),u=n(F),o=by();var m;(function(x){x[x.Success=0]="Success",x[x.Failure=1]="Failure"})(m||(e.ExitCode=m={}));function _(x,z){const V=(0,l.toCommandValue)(z);if(process.env[x]=V,process.env.GITHUB_ENV||"")return(0,s.issueFileCommand)("ENV",(0,s.prepareKeyValueMessage)(x,z));(0,a.issueCommand)("set-env",{name:x},V)}e.exportVariable=_;function S(x){(0,a.issueCommand)("add-mask",{},x)}e.setSecret=S;function R(x){process.env.GITHUB_PATH||""?(0,s.issueFileCommand)("PATH",x):(0,a.issueCommand)("add-path",{},x),process.env.PATH=`${x}${u.delimiter}${process.env.PATH}`}e.addPath=R;function p(x,z){const V=process.env[`INPUT_${x.replace(/ /g,"_").toUpperCase()}`]||"";if(z&&z.required&&!V)throw new Error(`Input required and not supplied: ${x}`);return z&&z.trimWhitespace===!1?V:V.trim()}e.getInput=p;function h(x,z){const V=p(x,z).split(`
|
||
`).filter(Q=>Q!=="");return z&&z.trimWhitespace===!1?V:V.map(Q=>Q.trim())}e.getMultilineInput=h;function y(x,z){const V=["true","True","TRUE"],Q=["false","False","FALSE"],se=p(x,z);if(V.includes(se))return!0;if(Q.includes(se))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${x}
|
||
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}e.getBooleanInput=y;function v(x,z){if(process.env.GITHUB_OUTPUT||"")return(0,s.issueFileCommand)("OUTPUT",(0,s.prepareKeyValueMessage)(x,z));process.stdout.write(c.EOL),(0,a.issueCommand)("set-output",{name:x},(0,l.toCommandValue)(z))}e.setOutput=v;function g(x){(0,a.issue)("echo",x?"on":"off")}e.setCommandEcho=g;function E(x){process.exitCode=m.Failure,f(x)}e.setFailed=E;function d(){return process.env.RUNNER_DEBUG==="1"}e.isDebug=d;function w(x){(0,a.issueCommand)("debug",{},x)}e.debug=w;function f(x,z={}){(0,a.issueCommand)("error",(0,l.toCommandProperties)(z),x instanceof Error?x.toString():x)}e.error=f;function b(x,z={}){(0,a.issueCommand)("warning",(0,l.toCommandProperties)(z),x instanceof Error?x.toString():x)}e.warning=b;function $(x,z={}){(0,a.issueCommand)("notice",(0,l.toCommandProperties)(z),x instanceof Error?x.toString():x)}e.notice=$;function T(x){process.stdout.write(x+c.EOL)}e.info=T;function k(x){(0,a.issue)("group",x)}e.startGroup=k;function B(){(0,a.issue)("endgroup")}e.endGroup=B;function G(x,z){return i(this,void 0,void 0,function*(){k(x);let V;try{V=yield z()}finally{B()}return V})}e.group=G;function P(x,z){if(process.env.GITHUB_STATE||"")return(0,s.issueFileCommand)("STATE",(0,s.prepareKeyValueMessage)(x,z));(0,a.issueCommand)("save-state",{name:x},(0,l.toCommandValue)(z))}e.saveState=P;function I(x){return process.env[`STATE_${x}`]||""}e.getState=I;function A(x){return i(this,void 0,void 0,function*(){return yield o.OidcClient.getIDToken(x)})}e.getIDToken=A;var D=kc();Object.defineProperty(e,"summary",{enumerable:!0,get:function(){return D.summary}});var C=kc();Object.defineProperty(e,"markdownSummary",{enumerable:!0,get:function(){return C.markdownSummary}});var q=$y();Object.defineProperty(e,"toPosixPath",{enumerable:!0,get:function(){return q.toPosixPath}}),Object.defineProperty(e,"toWin32Path",{enumerable:!0,get:function(){return q.toWin32Path}}),Object.defineProperty(e,"toPlatformPath",{enumerable:!0,get:function(){return q.toPlatformPath}}),e.platform=n(Iy())})(ft)),ft}var Se=vr();function vp(e){const t=Se.getInput(e.toLowerCase());if(t!=="false"&&t!=="")return t}var ji={};const Py=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}];var Hc;function Ty(){return Hc||(Hc=1,(function(e){const t=Py,r=process.env;Object.defineProperty(e,"_vendors",{value:t.map(function(a){return a.constant})}),e.name=null,e.isPR=null,e.id=null,t.forEach(function(a){const l=(Array.isArray(a.env)?a.env:[a.env]).every(function(c){return n(c)});e[a.constant]=l,l&&(e.name=a.name,e.isPR=i(a),e.id=a.constant)}),e.isCI=!!(r.CI!=="false"&&(r.BUILD_ID||r.BUILD_NUMBER||r.CI||r.CI_APP_ID||r.CI_BUILD_ID||r.CI_BUILD_NUMBER||r.CI_NAME||r.CONTINUOUS_INTEGRATION||r.RUN_ID||e.name));function n(a){return typeof a=="string"?!!r[a]:"env"in a?r[a.env]&&r[a.env].includes(a.includes):"any"in a?a.any.some(function(s){return!!r[s]}):Object.keys(a).every(function(s){return r[s]===a[s]})}function i(a){switch(typeof a.pr){case"string":return!!r[a.pr];case"object":return"env"in a.pr?"any"in a.pr?a.pr.any.some(function(s){return r[a.pr.env]===s}):a.pr.env in r&&r[a.pr.env]!==a.pr.ne:"any"in a.pr?a.pr.any.some(function(s){return!!r[s]}):n(a.pr);default:return null}}})(ji)),ji}var vn=Ty();const Et=$e(vn),{GITHUB_ACTIONS:Dn}=Et;function Le(e){return Dn?Se.error(e):console.log(`\x1B[31m${e}\x1B[0m`)}function Ny(e){return console.log(`\x1B[32m${e}\x1B[0m`)}function ve(e){return Dn?Se.warning(e):console.log(`\x1B[33m${e}\x1B[0m`)}function Jt(e){return Dn?Se.notice(e):console.log(`\x1B[94m${e}\x1B[0m`)}function J(e){return Dn?Se.info(e):console.log(e)}var Bt={exports:{}},Ui,Wc;function Ay(){if(Wc)return Ui;Wc=1,Ui=n,n.sync=i;var e=oe;function t(a,s){var l=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var c=0;c<l.length;c++){var u=l[c].toLowerCase();if(u&&a.substr(-u.length).toLowerCase()===u)return!0}return!1}function r(a,s,l){return!a.isSymbolicLink()&&!a.isFile()?!1:t(s,l)}function n(a,s,l){e.stat(a,function(c,u){l(c,c?!1:r(u,a,s))})}function i(a,s){return r(e.statSync(a),a,s)}return Ui}var Mi,Xc;function Ly(){if(Xc)return Mi;Xc=1,Mi=t,t.sync=r;var e=oe;function t(a,s,l){e.stat(a,function(c,u){l(c,c?!1:n(u,s))})}function r(a,s){return n(e.statSync(a),s)}function n(a,s){return a.isFile()&&i(a,s)}function i(a,s){var l=a.mode,c=a.uid,u=a.gid,o=s.uid!==void 0?s.uid:process.getuid&&process.getuid(),m=s.gid!==void 0?s.gid:process.getgid&&process.getgid(),_=parseInt("100",8),S=parseInt("010",8),R=parseInt("001",8),p=_|S,h=l&R||l&S&&u===m||l&_&&c===o||l&p&&o===0;return h}return Mi}var Gi,Kc;function xy(){if(Kc)return Gi;Kc=1;var e;process.platform==="win32"||tt.TESTING_WINDOWS?e=Ay():e=Ly(),Gi=t,t.sync=r;function t(n,i,a){if(typeof i=="function"&&(a=i,i={}),!a){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,l){t(n,i||{},function(c,u){c?l(c):s(u)})})}e(n,i||{},function(s,l){s&&(s.code==="EACCES"||i&&i.ignoreErrors)&&(s=null,l=!1),a(s,l)})}function r(n,i){try{return e.sync(n,i||{})}catch(a){if(i&&i.ignoreErrors||a.code==="EACCES")return!1;throw a}}return Gi}var Vi,Yc;function Cy(){if(Yc)return Vi;Yc=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=F,r=e?";":":",n=xy(),i=c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),a=(c,u)=>{const o=u.colon||r,m=c.match(/\//)||e&&c.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(o)],_=e?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",S=e?_.split(o):[""];return e&&c.indexOf(".")!==-1&&S[0]!==""&&S.unshift(""),{pathEnv:m,pathExt:S,pathExtExe:_}},s=(c,u,o)=>{typeof u=="function"&&(o=u,u={}),u||(u={});const{pathEnv:m,pathExt:_,pathExtExe:S}=a(c,u),R=[],p=y=>new Promise((v,g)=>{if(y===m.length)return u.all&&R.length?v(R):g(i(c));const E=m[y],d=/^".*"$/.test(E)?E.slice(1,-1):E,w=t.join(d,c),f=!d&&/^\.[\\\/]/.test(c)?c.slice(0,2)+w:w;v(h(f,y,0))}),h=(y,v,g)=>new Promise((E,d)=>{if(g===_.length)return E(p(v+1));const w=_[g];n(y+w,{pathExt:S},(f,b)=>{if(!f&&b)if(u.all)R.push(y+w);else return E(y+w);return E(h(y,v,g+1))})});return o?p(0).then(y=>o(null,y),o):p(0)},l=(c,u)=>{u=u||{};const{pathEnv:o,pathExt:m,pathExtExe:_}=a(c,u),S=[];for(let R=0;R<o.length;R++){const p=o[R],h=/^".*"$/.test(p)?p.slice(1,-1):p,y=t.join(h,c),v=!h&&/^\.[\\\/]/.test(c)?c.slice(0,2)+y:y;for(let g=0;g<m.length;g++){const E=v+m[g];try{if(n.sync(E,{pathExt:_}))if(u.all)S.push(E);else return E}catch{}}}if(u.all&&S.length)return S;if(u.nothrow)return null;throw i(c)};return Vi=s,s.sync=l,Vi}var Kr={exports:{}},Jc;function Dy(){if(Jc)return Kr.exports;Jc=1;const e=(t={})=>{const r=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return Kr.exports=e,Kr.exports.default=e,Kr.exports}var Bi,Qc;function Fy(){if(Qc)return Bi;Qc=1;const e=F,t=Cy(),r=Dy();function n(a,s){const l=a.options.env||process.env,c=process.cwd(),u=a.options.cwd!=null,o=u&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(a.options.cwd)}catch{}let m;try{m=t.sync(a.command,{path:l[r({env:l})],pathExt:s?e.delimiter:void 0})}catch{}finally{o&&process.chdir(c)}return m&&(m=e.resolve(u?a.options.cwd:"",m)),m}function i(a){return n(a)||n(a,!0)}return Bi=i,Bi}var Yr={},Zc;function qy(){if(Zc)return Yr;Zc=1;const e=/([()\][%!^"`<>&|;, *?])/g;function t(n){return n=n.replace(e,"^$1"),n}function r(n,i){return n=`${n}`,n=n.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),n=n.replace(/(?=(\\+?)?)\1$/,"$1$1"),n=`"${n}"`,n=n.replace(e,"^$1"),i&&(n=n.replace(e,"^$1")),n}return Yr.command=t,Yr.argument=r,Yr}var zi,el;function ky(){return el||(el=1,zi=/^#!(.*)/),zi}var Hi,tl;function jy(){if(tl)return Hi;tl=1;const e=ky();return Hi=(t="")=>{const r=t.match(e);if(!r)return null;const[n,i]=r[0].replace(/#! ?/,"").split(" "),a=n.split("/").pop();return a==="env"?i:i?`${a} ${i}`:a},Hi}var Wi,rl;function Uy(){if(rl)return Wi;rl=1;const e=oe,t=jy();function r(n){const a=Buffer.alloc(150);let s;try{s=e.openSync(n,"r"),e.readSync(s,a,0,150,0),e.closeSync(s)}catch{}return t(a.toString())}return Wi=r,Wi}var Xi,nl;function My(){if(nl)return Xi;nl=1;const e=F,t=Fy(),r=qy(),n=Uy(),i=process.platform==="win32",a=/\.(?:com|exe)$/i,s=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(o){o.file=t(o);const m=o.file&&n(o.file);return m?(o.args.unshift(o.file),o.command=m,t(o)):o.file}function c(o){if(!i)return o;const m=l(o),_=!a.test(m);if(o.options.forceShell||_){const S=s.test(m);o.command=e.normalize(o.command),o.command=r.command(o.command),o.args=o.args.map(p=>r.argument(p,S));const R=[o.command].concat(o.args).join(" ");o.args=["/d","/s","/c",`"${R}"`],o.command=process.env.comspec||"cmd.exe",o.options.windowsVerbatimArguments=!0}return o}function u(o,m,_){m&&!Array.isArray(m)&&(_=m,m=null),m=m?m.slice(0):[],_=Object.assign({},_);const S={command:o,args:m,options:_,file:void 0,original:{command:o,args:m}};return _.shell?S:c(S)}return Xi=u,Xi}var Ki,il;function Gy(){if(il)return Ki;il=1;const e=process.platform==="win32";function t(a,s){return Object.assign(new Error(`${s} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${s} ${a.command}`,path:a.command,spawnargs:a.args})}function r(a,s){if(!e)return;const l=a.emit;a.emit=function(c,u){if(c==="exit"){const o=n(u,s);if(o)return l.call(a,"error",o)}return l.apply(a,arguments)}}function n(a,s){return e&&a===1&&!s.file?t(s.original,"spawn"):null}function i(a,s){return e&&a===1&&!s.file?t(s.original,"spawnSync"):null}return Ki={hookChildProcess:r,verifyENOENT:n,verifyENOENTSync:i,notFoundError:t},Ki}var sl;function Vy(){if(sl)return Bt.exports;sl=1;const e=xt,t=My(),r=Gy();function n(a,s,l){const c=t(a,s,l),u=e.spawn(c.command,c.args,c.options);return r.hookChildProcess(u,c),u}function i(a,s,l){const c=t(a,s,l),u=e.spawnSync(c.command,c.args,c.options);return u.error=u.error||r.verifyENOENTSync(u.status,c),u}return Bt.exports=n,Bt.exports.spawn=n,Bt.exports.sync=i,Bt.exports._parse=t,Bt.exports._enoent=r,Bt.exports}var By=Vy();const zy=$e(By);function Hy(e){const t=typeof e=="string"?`
|
||
`:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}function wp(e={}){const{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}const Wy=({cwd:e=ut.cwd(),path:t=ut.env[wp()],preferLocal:r=!0,execPath:n=ut.execPath,addExecPath:i=!0}={})=>{const a=e instanceof URL?We.fileURLToPath(e):e,s=F.resolve(a),l=[];return r&&Xy(l,s),i&&Ky(l,n,s),[...l,t].join(F.delimiter)},Xy=(e,t)=>{let r;for(;r!==t;)e.push(F.join(t,"node_modules/.bin")),r=t,t=F.resolve(t,"..")},Ky=(e,t,r)=>{const n=t instanceof URL?We.fileURLToPath(t):t;e.push(F.resolve(r,n,".."))},Yy=({env:e=ut.env,...t}={})=>{e={...e};const r=wp({env:e});return t.path=e[r],e[r]=Wy(t),e},Jy=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(e,r),a=Object.getOwnPropertyDescriptor(t,r);!Qy(i,a)&&n||Object.defineProperty(e,r,a)},Qy=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Zy=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},ev=(e,t)=>`/* Wrapped ${e}*/
|
||
${t}`,tv=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),rv=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),nv=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=ev.bind(null,n,t.toString());Object.defineProperty(i,"name",rv),Object.defineProperty(e,"toString",{...tv,value:i})};function iv(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const i of Reflect.ownKeys(t))Jy(e,t,i,r);return Zy(e,t),nv(e,t,n),e}const wn=new WeakMap,gp=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0;const i=e.displayName||e.name||"<anonymous>",a=function(...s){if(wn.set(a,++n),n===1)r=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return iv(a,e),wn.set(a,n),a};gp.callCount=e=>{if(!wn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return wn.get(e)};const sv=()=>{const e=Sp-Ep+1;return Array.from({length:e},ov)},ov=(e,t)=>({name:`SIGRT${t+1}`,number:Ep+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ep=34,Sp=64,av=[{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:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],Rp=()=>{const e=sv();return[...av,...e].map(uv)},uv=({name:e,number:t,description:r,action:n,forced:i=!1,standard:a})=>{const{signals:{[e]:s}}=le.constants,l=s!==void 0;return{name:e,number:l?s:t,description:r,supported:l,action:n,forced:i,standard:a}},cv=()=>{const e=Rp();return Object.fromEntries(e.map(lv))},lv=({name:e,number:t,description:r,supported:n,action:i,forced:a,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:i,forced:a,standard:s}],fv=cv(),dv=()=>{const e=Rp(),t=Sp+1,r=Array.from({length:t},(n,i)=>hv(i,e));return Object.assign({},...r)},hv=(e,t)=>{const r=pv(e,t);if(r===void 0)return{};const{name:n,description:i,supported:a,action:s,forced:l,standard:c}=r;return{[e]:{name:n,number:e,description:i,supported:a,action:s,forced:l,standard:c}}},pv=(e,t)=>{const r=t.find(({name:n})=>le.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)};dv();const mv=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:a,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",gn=({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:a,command:s,escapedCommand:l,timedOut:c,isCanceled:u,killed:o,parsed:{options:{timeout:m,cwd:_=ut.cwd()}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;const S=i===void 0?void 0:fv[i].description,R=n&&n.code,h=`Command ${mv({timedOut:c,timeout:m,errorCode:R,signal:i,signalDescription:S,exitCode:a,isCanceled:u})}: ${s}`,y=Object.prototype.toString.call(n)==="[object Error]",v=y?`${h}
|
||
${n.message}`:h,g=[v,t,e].filter(Boolean).join(`
|
||
`);return y?(n.originalMessage=n.message,n.message=g):n=new Error(g),n.shortMessage=v,n.command=s,n.escapedCommand=l,n.exitCode=a,n.signal=i,n.signalDescription=S,n.stdout=e,n.stderr=t,n.cwd=_,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=u,n.killed=o&&!c,n},un=["stdin","stdout","stderr"],_v=e=>un.some(t=>e[t]!==void 0),yv=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return un.map(n=>e[n]);if(_v(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${un.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=Math.max(t.length,un.length);return Array.from({length:r},(n,i)=>t[i])};var zt={exports:{}},Yi={exports:{}},ol;function vv(){return ol||(ol=1,(function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")})(Yi)),Yi.exports}var al;function wv(){if(al)return zt.exports;al=1;var e=tt.process;const t=function(h){return h&&typeof h=="object"&&typeof h.removeListener=="function"&&typeof h.emit=="function"&&typeof h.reallyExit=="function"&&typeof h.listeners=="function"&&typeof h.kill=="function"&&typeof h.pid=="number"&&typeof h.on=="function"};if(!t(e))zt.exports=function(){return function(){}};else{var r=Ur,n=vv(),i=/^win/i.test(e.platform),a=mr;typeof a!="function"&&(a=a.EventEmitter);var s;e.__signal_exit_emitter__?s=e.__signal_exit_emitter__:(s=e.__signal_exit_emitter__=new a,s.count=0,s.emitted={}),s.infinite||(s.setMaxListeners(1/0),s.infinite=!0),zt.exports=function(h,y){if(!t(tt.process))return function(){};r.equal(typeof h,"function","a callback must be provided for exit handler"),o===!1&&m();var v="exit";y&&y.alwaysLast&&(v="afterexit");var g=function(){s.removeListener(v,h),s.listeners("exit").length===0&&s.listeners("afterexit").length===0&&l()};return s.on(v,h),g};var l=function(){!o||!t(tt.process)||(o=!1,n.forEach(function(y){try{e.removeListener(y,u[y])}catch{}}),e.emit=R,e.reallyExit=_,s.count-=1)};zt.exports.unload=l;var c=function(y,v,g){s.emitted[y]||(s.emitted[y]=!0,s.emit(y,v,g))},u={};n.forEach(function(h){u[h]=function(){if(t(tt.process)){var v=e.listeners(h);v.length===s.count&&(l(),c("exit",null,h),c("afterexit",null,h),i&&h==="SIGHUP"&&(h="SIGINT"),e.kill(e.pid,h))}}}),zt.exports.signals=function(){return n};var o=!1,m=function(){o||!t(tt.process)||(o=!0,s.count+=1,n=n.filter(function(y){try{return e.on(y,u[y]),!0}catch{return!1}}),e.emit=p,e.reallyExit=S)};zt.exports.load=m;var _=e.reallyExit,S=function(y){t(tt.process)&&(e.exitCode=y||0,c("exit",e.exitCode,null),c("afterexit",e.exitCode,null),_.call(e,e.exitCode))},R=e.emit,p=function(y,v){if(y==="exit"&&t(tt.process)){v!==void 0&&(e.exitCode=v);var g=R.apply(this,arguments);return c("exit",e.exitCode,null),c("afterexit",e.exitCode,null),g}else return R.apply(this,arguments)}}return zt.exports}var gv=wv();const Ev=$e(gv),Sv=1e3*5,Rv=(e,t="SIGTERM",r={})=>{const n=e(t);return bv(e,t,r,n),n},bv=(e,t,r,n)=>{if(!$v(t,r,n))return;const i=Iv(r),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},$v=(e,{forceKillAfterTimeout:t},r)=>Ov(e)&&t!==!1&&r,Ov=e=>e===le.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Iv=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Sv;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Pv=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Tv=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Nv=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let i;const a=new Promise((l,c)=>{i=setTimeout(()=>{Tv(e,r,c)},t)}),s=n.finally(()=>{clearTimeout(i)});return Promise.race([a,s])},Av=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Lv=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;const i=Ev(()=>{e.kill()});return n.finally(()=>{i()})};function au(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function ul(e){return au(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const xv=e=>e instanceof xt.ChildProcess&&typeof e.then=="function",Ji=(e,t,r)=>{if(typeof r=="string")return e[t].pipe(oe.createWriteStream(r)),e;if(ul(r))return e[t].pipe(r),e;if(!xv(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!ul(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},Cv=e=>{e.stdout!==null&&(e.pipeStdout=Ji.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Ji.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Ji.bind(void 0,e,"all"))};var ar={exports:{}},Qi,cl;function Dv(){if(cl)return Qi;cl=1;const{PassThrough:e}=Mr;return Qi=t=>{t={...t};const{array:r}=t;let{encoding:n}=t;const i=n==="buffer";let a=!1;r?a=!(n||i):n=n||"utf8",i&&(n=null);const s=new e({objectMode:a});n&&s.setEncoding(n);let l=0;const c=[];return s.on("data",u=>{c.push(u),a?l=c.length:l+=u.length}),s.getBufferedValue=()=>r?c:i?Buffer.concat(c,l):c.join(""),s.getBufferedLength=()=>l,s},Qi}var ll;function Fv(){if(ll)return ar.exports;ll=1;const{constants:e}=ap,t=Mr,{promisify:r}=_r,n=Dv(),i=r(t.pipeline);class a extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function s(l,c){if(!l)throw new Error("Expected a stream");c={maxBuffer:1/0,...c};const{maxBuffer:u}=c,o=n(c);return await new Promise((m,_)=>{const S=R=>{R&&o.getBufferedLength()<=e.MAX_LENGTH&&(R.bufferedData=o.getBufferedValue()),_(R)};(async()=>{try{await i(l,o),m()}catch(R){S(R)}})(),o.on("data",()=>{o.getBufferedLength()>u&&S(new a)})}),o.getBufferedValue()}return ar.exports=s,ar.exports.buffer=(l,c)=>s(l,{...c,encoding:"buffer"}),ar.exports.array=(l,c)=>s(l,{...c,array:!0}),ar.exports.MaxBufferError=a,ar.exports}var qv=Fv();const fl=$e(qv);var Zi,dl;function kv(){if(dl)return Zi;dl=1;const{PassThrough:e}=Mr;return Zi=function(){var t=[],r=new e({objectMode:!0});return r.setMaxListeners(0),r.add=n,r.isEmpty=i,r.on("unpipe",a),Array.prototype.slice.call(arguments).forEach(n),r;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",a.bind(null,s)),s.once("error",r.emit.bind(r,"error")),s.pipe(r,{end:!1}),this)}function i(){return t.length==0}function a(s){t=t.filter(function(l){return l!==s}),!t.length&&r.readable&&r.end()}},Zi}var jv=kv();const Uv=$e(jv),bp=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Mv=({input:e,inputFile:t})=>typeof t!="string"?e:(bp(e),oe.readFileSync(t)),Gv=e=>{const t=Mv(e);if(au(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},Vv=({input:e,inputFile:t})=>typeof t!="string"?e:(bp(e),oe.createReadStream(t)),Bv=(e,t)=>{const r=Vv(t);r!==void 0&&(au(r)?r.pipe(e.stdin):e.stdin.end(r))},zv=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=Uv();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},es=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(r){return r.bufferedData}}},ts=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t?fl(e,{encoding:t,maxBuffer:n}):fl.buffer(e,{maxBuffer:n})},Hv=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:a},s)=>{const l=ts(e,{encoding:n,buffer:i,maxBuffer:a}),c=ts(t,{encoding:n,buffer:i,maxBuffer:a}),u=ts(r,{encoding:n,buffer:i,maxBuffer:a*2});try{return await Promise.all([s,l,c,u])}catch(o){return Promise.all([{error:o,signal:o.signal,timedOut:o.timedOut},es(e,l),es(t,c),es(r,u)])}},Wv=(async()=>{})().constructor.prototype,Xv=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Wv,e)]),hl=(e,t)=>{for(const[r,n]of Xv){const i=typeof t=="function"?(...a)=>Reflect.apply(n.value,t(),a):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i})}},Kv=e=>new Promise((t,r)=>{e.on("exit",(n,i)=>{t({exitCode:n,signal:i})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})}),$p=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Yv=/^[\w.-]+$/,Jv=/"/g,Qv=e=>typeof e!="string"||Yv.test(e)?e:`"${e.replace(Jv,'\\"')}"`,Op=(e,t)=>$p(e,t).join(" "),Ip=(e,t)=>$p(e,t).map(r=>Qv(r)).join(" "),Zv=/ +/g,Pp=e=>{const t=[];for(const r of e.trim().split(Zv)){const n=t[t.length-1];n&&n.endsWith("\\")?t[t.length-1]=`${n.slice(0,-1)} ${r}`:t.push(r)}return t},ew=_r.debuglog("execa").enabled,Jr=(e,t)=>String(e).padStart(t,"0"),tw=()=>{const e=new Date;return`${Jr(e.getHours(),2)}:${Jr(e.getMinutes(),2)}:${Jr(e.getSeconds(),2)}.${Jr(e.getMilliseconds(),3)}`},Tp=(e,{verbose:t})=>{t&&ut.stderr.write(`[${tw()}] ${e}
|
||
`)},rw=1e3*1e3*100,nw=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{const a=t?{...ut.env,...e}:e;return r?Yy({env:a,cwd:n,execPath:i}):a},Np=(e,t,r={})=>{const n=zy._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:rw,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||ut.cwd(),execPath:ut.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:ew,...r},r.env=nw(r),r.stdio=yv(r),ut.platform==="win32"&&F.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},Fr=(e,t,r)=>typeof t!="string"&&!ap.Buffer.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?Hy(t):t;function fe(e,t,r){const n=Np(e,t,r),i=Op(e,t),a=Ip(e,t);Tp(a,n.options),Av(n.options);let s;try{s=xt.spawn(n.file,n.args,n.options)}catch(S){const R=new xt.ChildProcess,p=Promise.reject(gn({error:S,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return hl(R,p),R}const l=Kv(s),c=Nv(s,n.options,l),u=Lv(s,n.options,c),o={isCanceled:!1};s.kill=Rv.bind(null,s.kill.bind(s)),s.cancel=Pv.bind(null,s,o);const _=gp(async()=>{const[{error:S,exitCode:R,signal:p,timedOut:h},y,v,g]=await Hv(s,n.options,u),E=Fr(n.options,y),d=Fr(n.options,v),w=Fr(n.options,g);if(S||R!==0||p!==null){const f=gn({error:S,exitCode:R,signal:p,stdout:E,stderr:d,all:w,command:i,escapedCommand:a,parsed:n,timedOut:h,isCanceled:o.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:s.killed});if(!n.options.reject)return f;throw f}return{command:i,escapedCommand:a,exitCode:0,stdout:E,stderr:d,all:w,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Bv(s,n.options),s.all=zv(s,n.options),Cv(s),hl(s,_),s}function ze(e,t,r){const n=Np(e,t,r),i=Op(e,t),a=Ip(e,t);Tp(a,n.options);const s=Gv(n.options);let l;try{l=xt.spawnSync(n.file,n.args,{...n.options,input:s})}catch(o){throw gn({error:o,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}const c=Fr(n.options,l.stdout,l.error),u=Fr(n.options,l.stderr,l.error);if(l.error||l.status!==0||l.signal!==null){const o=gn({stdout:c,stderr:u,error:l.error,signal:l.signal,exitCode:l.status,command:i,escapedCommand:a,parsed:n,timedOut:l.error&&l.error.code==="ETIMEDOUT",isCanceled:!1,killed:l.signal!==null});if(!n.options.reject)return o;throw o}return{command:i,escapedCommand:a,exitCode:0,stdout:c,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function iw(e,t){const[r,...n]=Pp(e);return fe(r,n,t)}function sw(e,t){const[r,...n]=Pp(e);return ze(r,n,t)}var pt={},Ht={};const ow=Dr.promises,{access:aw,appendFile:Ap,chmod:uu,chown:uw,copyFile:cw,lchmod:lw,lchown:fw,link:dw,lstat:hw,mkdir:pw,mkdtemp:mw,open:_w,readdir:cu,readFile:Qt,readlink:yw,realpath:vw,rename:ww,rmdir:gw,stat:Ew,symlink:Sw,truncate:Rw,unlink:bw,utimes:$w,writeFile:qr}=Dr.promises,Ow="rm"in Dr.promises?Dr.promises.rm:_r.promisify(Dr.unlink),Iw=Object.freeze(Object.defineProperty({__proto__:null,access:aw,appendFile:Ap,chmod:uu,chown:uw,copyFile:cw,default:ow,lchmod:lw,lchown:fw,link:dw,lstat:hw,mkdir:pw,mkdtemp:mw,open:_w,readFile:Qt,readdir:cu,readlink:yw,realpath:vw,rename:ww,rm:Ow,rmdir:gw,stat:Ew,symlink:Sw,truncate:Rw,unlink:bw,utimes:$w,writeFile:qr},Symbol.toStringTag,{value:"Module"})),Lp=Pn(Iw);var pl;function Pw(){if(pl)return Ht;pl=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.sync=Ht.isexe=void 0;const e=oe,t=Lp,r=async(s,l={})=>{const{ignoreErrors:c=!1}=l;try{return i(await(0,t.stat)(s),l)}catch(u){const o=u;if(c||o.code==="EACCES")return!1;throw o}};Ht.isexe=r;const n=(s,l={})=>{const{ignoreErrors:c=!1}=l;try{return i((0,e.statSync)(s),l)}catch(u){const o=u;if(c||o.code==="EACCES")return!1;throw o}};Ht.sync=n;const i=(s,l)=>s.isFile()&&a(s,l),a=(s,l)=>{var g,E,d,w,f,b,$,T;const c=(E=l.uid)!=null?E:(g=process.getuid)==null?void 0:g.call(process),u=(f=(w=l.groups)!=null?w:(d=process.getgroups)==null?void 0:d.call(process))!=null?f:[],o=(T=($=l.gid)!=null?$:(b=process.getgid)==null?void 0:b.call(process))!=null?T:u[0];if(c===void 0||o===void 0)throw new Error("cannot get uid or gid");const m=new Set([o,...u]),_=s.mode,S=s.uid,R=s.gid,p=parseInt("100",8),h=parseInt("010",8),y=parseInt("001",8),v=p|h;return!!(_&y||_&h&&m.has(R)||_&p&&S===c||_&v&&c===0)};return Ht}var Wt={},ml;function Tw(){if(ml)return Wt;ml=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.sync=Wt.isexe=void 0;const e=oe,t=Lp,r=async(s,l={})=>{const{ignoreErrors:c=!1}=l;try{return a(await(0,t.stat)(s),s,l)}catch(u){const o=u;if(c||o.code==="EACCES")return!1;throw o}};Wt.isexe=r;const n=(s,l={})=>{const{ignoreErrors:c=!1}=l;try{return a((0,e.statSync)(s),s,l)}catch(u){const o=u;if(c||o.code==="EACCES")return!1;throw o}};Wt.sync=n;const i=(s,l)=>{const{pathExt:c=process.env.PATHEXT||""}=l,u=c.split(";");if(u.indexOf("")!==-1)return!0;for(let o=0;o<u.length;o++){const m=u[o].toLowerCase(),_=s.substring(s.length-m.length).toLowerCase();if(m&&_===m)return!0}return!1},a=(s,l,c)=>s.isFile()&&i(l,c);return Wt}var rs={},_l;function Nw(){return _l||(_l=1,Object.defineProperty(rs,"__esModule",{value:!0})),rs}var yl;function Aw(){return yl||(yl=1,(function(e){var t=pt&&pt.__createBinding||(Object.create?function(u,o,m,_){_===void 0&&(_=m);var S=Object.getOwnPropertyDescriptor(o,m);(!S||("get"in S?!o.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return o[m]}}),Object.defineProperty(u,_,S)}:function(u,o,m,_){_===void 0&&(_=m),u[_]=o[m]}),r=pt&&pt.__setModuleDefault||(Object.create?function(u,o){Object.defineProperty(u,"default",{enumerable:!0,value:o})}:function(u,o){u.default=o}),n=pt&&pt.__importStar||function(u){if(u&&u.__esModule)return u;var o={};if(u!=null)for(var m in u)m!=="default"&&Object.prototype.hasOwnProperty.call(u,m)&&t(o,u,m);return r(o,u),o},i=pt&&pt.__exportStar||function(u,o){for(var m in u)m!=="default"&&!Object.prototype.hasOwnProperty.call(o,m)&&t(o,u,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;const a=n(Pw());e.posix=a;const s=n(Tw());e.win32=s,i(Nw(),e);const c=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?s:a;e.isexe=c.isexe,e.sync=c.sync})(pt)),pt}var ns,vl;function Lw(){if(vl)return ns;vl=1;const{isexe:e,sync:t}=Aw(),{join:r,delimiter:n,sep:i,posix:a}=F,s=process.platform==="win32",l=new RegExp(`[${a.sep}${i===a.sep?"":i}]`.replace(/(\\)/g,"\\$1")),c=new RegExp(`^\\.${l.source}`),u=R=>Object.assign(new Error(`not found: ${R}`),{code:"ENOENT"}),o=(R,{path:p=process.env.PATH,pathExt:h=process.env.PATHEXT,delimiter:y=n})=>{const v=R.match(l)?[""]:[...s?[process.cwd()]:[],...(p||"").split(y)];if(s){const g=h||[".EXE",".CMD",".BAT",".COM"].join(y),E=g.split(y).flatMap(d=>[d,d.toLowerCase()]);return R.includes(".")&&E[0]!==""&&E.unshift(""),{pathEnv:v,pathExt:E,pathExtExe:g}}return{pathEnv:v,pathExt:[""]}},m=(R,p)=>{const h=/^".*"$/.test(R)?R.slice(1,-1):R;return(!h&&c.test(p)?p.slice(0,2):"")+r(h,p)},_=async(R,p={})=>{const{pathEnv:h,pathExt:y,pathExtExe:v}=o(R,p),g=[];for(const E of h){const d=m(E,R);for(const w of y){const f=d+w;if(await e(f,{pathExt:v,ignoreErrors:!0})){if(!p.all)return f;g.push(f)}}}if(p.all&&g.length)return g;if(p.nothrow)return null;throw u(R)},S=(R,p={})=>{const{pathEnv:h,pathExt:y,pathExtExe:v}=o(R,p),g=[];for(const E of h){const d=m(E,R);for(const w of y){const f=d+w;if(t(f,{pathExt:v,ignoreErrors:!0})){if(!p.all)return f;g.push(f)}}}if(p.all&&g.length)return g;if(p.nothrow)return null;throw u(R)};return ns=_,_.sync=S,ns}var xw=Lw();const de=$e(xw);let Pr;function xp(e,t=["-NoProfile","-NoLogo","-NonInteractive"],r={stdio:"inherit"}){return fe(Cw(),[...t,"-c",e],r)}function Cw(){if(Pr===void 0){const e=de.sync("pwsh",{nothrow:!0});e!==null&&(Pr=e);const t=de.sync("powershell",{nothrow:!0});t!==null&&(Pr=t)}if(Pr===void 0)throw new Error("Could not find powershell");return Pr}function mt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function Cp(){return de.sync("sudo",{nothrow:!0})!==null}function wr(){var e;return((e=process.getuid)==null?void 0:e.call(process))===0||!!process.env.CI}function gr(){return wr()&&Cp()}function Dw(e){return gr()?`sudo ${e}`:e}function me(e,t=[],r=st){return gr()?sw(Dp(e,t),r):ze(e,lu(t),r)}function yt(e,t=[],r=st){return gr()?iw(Dp(e,t),r):fe(e,lu(t),r)}function Dp(e,t){return`sudo ${lu([e,...t]).join(" ")}`}function lu(e){return e.map(t=>`'${t}'`)}async function Fw(){try{return await fe("fltmc"),!0}catch{return!1}}async function qw(){var e;if(process.platform!=="win32")return!1;try{return await fe("fsutil",["dirty","query",(e=process.env.systemdrive)!=null?e:""]),!0}catch(t){return t.code==="ENOENT"?Fw():!1}}function kw(){return process.platform==="win32"?Fp():wr()}async function Er(e){if((process.platform==="linux"||process.platform==="darwin")&&gr()&&process.env.SUDO_USER!==void 0){let t=oe.statSync(e).isDirectory();await yt("chown",[...t?["-R"]:[],process.env.SUDO_USER,e],st)}}var is,Xt={};mt(Xt,"hasSudo",()=>Cp),mt(Xt,"isRoot",()=>wr),mt(Xt,"isSudo",()=>gr),mt(Xt,"prependSudo",()=>Dw),mt(Xt,"defaultExecOptions",()=>st),mt(Xt,"execRootSync",()=>me),mt(Xt,"execRoot",()=>yt);let st={stdio:"inherit",shell:!0};mt(is={},"isAdminWindows",()=>Fp),mt(is,"isAdminPosix",()=>jw),mt(is,"isAdmin",()=>kw);let Fp=qw,jw=wr;mt({},"grantUserWriteAccess",()=>Er);var ss,wl;function Uw(){return wl||(wl=1,ss=function(){}),ss}var os,gl;function er(){if(gl)return os;gl=1;var e=Uw()();return os=function(t){return t!==e&&t!==null},os}var as,El;function qp(){if(El)return as;El=1;var e=er(),t=Array.prototype.forEach,r=Object.create,n=function(i,a){var s;for(s in i)a[s]=i[s]};return as=function(i){var a=r(null);return t.call(arguments,function(s){e(s)&&n(Object(s),a)}),a},as}var us,Sl;function Mw(){return Sl||(Sl=1,us=function(){var e=Math.sign;return typeof e!="function"?!1:e(10)===1&&e(-20)===-1}),us}var cs,Rl;function Gw(){return Rl||(Rl=1,cs=function(e){return e=Number(e),isNaN(e)||e===0?e:e>0?1:-1}),cs}var ls,bl;function Vw(){return bl||(bl=1,ls=Mw()()?Math.sign:Gw()),ls}var fs,$l;function Bw(){if($l)return fs;$l=1;var e=Vw(),t=Math.abs,r=Math.floor;return fs=function(n){return isNaN(n)?0:(n=Number(n),n===0||!isFinite(n)?n:e(n)*r(t(n)))},fs}var ds,Ol;function tr(){if(Ol)return ds;Ol=1;var e=Bw(),t=Math.max;return ds=function(r){return t(0,e(r))},ds}var hs,Il;function kp(){if(Il)return hs;Il=1;var e=tr();return hs=function(t,r,n){var i;return isNaN(t)?(i=r,i>=0?n&&i?i-1:i:1):t===!1?!1:e(t)},hs}var ps,Pl;function jt(){return Pl||(Pl=1,ps=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e}),ps}var ms,Tl;function Sr(){if(Tl)return ms;Tl=1;var e=er();return ms=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t},ms}var _s,Nl;function zw(){if(Nl)return _s;Nl=1;var e=jt(),t=Sr(),r=Function.prototype.bind,n=Function.prototype.call,i=Object.keys,a=Object.prototype.propertyIsEnumerable;return _s=function(s,l){return function(c,u){var o,m=arguments[2],_=arguments[3];return c=Object(t(c)),e(u),o=i(c),_&&o.sort(typeof _=="function"?r.call(_,c):void 0),typeof s!="function"&&(s=o[s]),n.call(s,o,function(S,R){return a.call(c,S)?n.call(u,m,c[S],S,c,R):l})}},_s}var ys,Al;function Fn(){return Al||(Al=1,ys=zw()("forEach")),ys}var Ll={},xl;function rr(){return xl||(xl=1),Ll}var vs={exports:{}},ws,Cl;function Hw(){return Cl||(Cl=1,ws=function(){var e=Object.assign,t;return typeof e!="function"?!1:(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}),ws}var gs,Dl;function Ww(){return Dl||(Dl=1,gs=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gs}var Es,Fl;function Xw(){if(Fl)return Es;Fl=1;var e=er(),t=Object.keys;return Es=function(r){return t(e(r)?Object(r):r)},Es}var Ss,ql;function Kw(){return ql||(ql=1,Ss=Ww()()?Object.keys:Xw()),Ss}var Rs,kl;function Yw(){if(kl)return Rs;kl=1;var e=Kw(),t=Sr(),r=Math.max;return Rs=function(n,i){var a,s,l=r(arguments.length,2),c;for(n=Object(t(n)),c=function(u){try{n[u]=i[u]}catch(o){a||(a=o)}},s=1;s<l;++s)i=arguments[s],e(i).forEach(c);if(a!==void 0)throw a;return n},Rs}var bs,jl;function jp(){return jl||(jl=1,bs=Hw()()?Object.assign:Yw()),bs}var $s,Ul;function Jw(){if(Ul)return $s;Ul=1;var e=er(),t={function:!0,object:!0};return $s=function(r){return e(r)&&t[typeof r]||!1},$s}var Ml;function Qw(){return Ml||(Ml=1,(function(e){var t=jp(),r=Jw(),n=er(),i=Error.captureStackTrace;e.exports=function(a){var s=new Error(a),l=arguments[1],c=arguments[2];return n(c)||r(l)&&(c=l,l=null),n(c)&&t(s,c),n(l)&&(s.code=l),i&&i(s,e.exports),s}})(vs)),vs.exports}var Qr={exports:{}},Os,Gl;function Up(){if(Gl)return Os;Gl=1;var e=Sr(),t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols;return Os=function(a,s){var l,c=Object(e(s));if(a=Object(e(a)),n(c).forEach(function(u){try{t(a,u,r(s,u))}catch(o){l=o}}),typeof i=="function"&&i(c).forEach(function(u){try{t(a,u,r(s,u))}catch(o){l=o}}),l!==void 0)throw l;return a},Os}var Vl;function Mp(){if(Vl)return Qr.exports;Vl=1;var e=tr(),t=function(s,l){return l},r,n,i,a;try{Object.defineProperty(t,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch{}return t.length===1?(r={configurable:!0,writable:!1,enumerable:!1},n=Object.defineProperty,Qr.exports=function(s,l){return l=e(l),s.length===l?s:(r.value=l,n(s,"length",r))}):(a=Up(),i=(function(){var s=[];return function(l){var c,u=0;if(s[l])return s[l];for(c=[];l--;)c.push("a"+(++u).toString(36));return new Function("fn","return function ("+c.join(", ")+") { return fn.apply(this, arguments); };")}})(),Qr.exports=function(s,l){var c;if(l=e(l),s.length===l)return s;c=i(l)(s);try{a(c,s)}catch{}return c}),Qr.exports}var Is={exports:{}},Ps,Bl;function Gp(){if(Bl)return Ps;Bl=1;var e=void 0;return Ps=function(t){return t!==e&&t!==null},Ps}var Ts,zl;function Zw(){if(zl)return Ts;zl=1;var e=Gp(),t={object:!0,function:!0,undefined:!0};return Ts=function(r){return e(r)?hasOwnProperty.call(t,typeof r):!1},Ts}var Ns,Hl;function eg(){if(Hl)return Ns;Hl=1;var e=Zw();return Ns=function(t){if(!e(t))return!1;try{return t.constructor?t.constructor.prototype===t:!1}catch{return!1}},Ns}var As,Wl;function tg(){if(Wl)return As;Wl=1;var e=eg();return As=function(t){if(typeof t!="function"||!hasOwnProperty.call(t,"length"))return!1;try{if(typeof t.length!="number"||typeof t.call!="function"||typeof t.apply!="function")return!1}catch{return!1}return!e(t)},As}var Ls,Xl;function rg(){if(Xl)return Ls;Xl=1;var e=tg(),t=/^\s*class[\s{/}]/,r=Function.prototype.toString;return Ls=function(n){return!(!e(n)||t.test(r.call(n)))},Ls}var xs,Kl;function ng(){if(Kl)return xs;Kl=1;var e="razdwatrzy";return xs=function(){return typeof e.contains!="function"?!1:e.contains("dwa")===!0&&e.contains("foo")===!1},xs}var Cs,Yl;function ig(){if(Yl)return Cs;Yl=1;var e=String.prototype.indexOf;return Cs=function(t){return e.call(this,t,arguments[1])>-1},Cs}var Ds,Jl;function sg(){return Jl||(Jl=1,Ds=ng()()?String.prototype.contains:ig()),Ds}var Ql;function nr(){if(Ql)return Is.exports;Ql=1;var e=Gp(),t=rg(),r=jp(),n=qp(),i=sg(),a=Is.exports=function(s,l){var c,u,o,m,_;return arguments.length<2||typeof s!="string"?(m=l,l=s,s=null):m=arguments[2],e(s)?(c=i.call(s,"c"),u=i.call(s,"e"),o=i.call(s,"w")):(c=o=!0,u=!1),_={value:l,configurable:c,enumerable:u,writable:o},m?r(n(m),_):_};return a.gs=function(s,l,c){var u,o,m,_;return typeof s!="string"?(m=c,c=l,l=s,s=null):m=arguments[3],e(l)?t(l)?e(c)?t(c)||(m=c,c=void 0):c=void 0:(m=l,l=c=void 0):l=void 0,e(s)?(u=i.call(s,"c"),o=i.call(s,"e")):(u=!0,o=!1),_={get:l,set:c,configurable:u,enumerable:o},m?r(n(m),_):_},Is.exports}var Zr={exports:{}},Zl;function og(){return Zl||(Zl=1,(function(e,t){var r=nr(),n=jt(),i=Function.prototype.apply,a=Function.prototype.call,s=Object.create,l=Object.defineProperty,c=Object.defineProperties,u=Object.prototype.hasOwnProperty,o={configurable:!0,enumerable:!1,writable:!0},m,_,S,R,p,h,y;m=function(v,g){var E;return n(g),u.call(this,"__ee__")?E=this.__ee__:(E=o.value=s(null),l(this,"__ee__",o),o.value=null),E[v]?typeof E[v]=="object"?E[v].push(g):E[v]=[E[v],g]:E[v]=g,this},_=function(v,g){var E,d;return n(g),d=this,m.call(this,v,E=function(){S.call(d,v,E),i.call(g,this,arguments)}),E.__eeOnceListener__=g,this},S=function(v,g){var E,d,w,f;if(n(g),!u.call(this,"__ee__"))return this;if(E=this.__ee__,!E[v])return this;if(d=E[v],typeof d=="object")for(f=0;w=d[f];++f)(w===g||w.__eeOnceListener__===g)&&(d.length===2?E[v]=d[f?0:1]:d.splice(f,1));else(d===g||d.__eeOnceListener__===g)&&delete E[v];return this},R=function(v){var g,E,d,w,f;if(u.call(this,"__ee__")&&(w=this.__ee__[v],!!w))if(typeof w=="object"){for(E=arguments.length,f=new Array(E-1),g=1;g<E;++g)f[g-1]=arguments[g];for(w=w.slice(),g=0;d=w[g];++g)i.call(d,this,f)}else switch(arguments.length){case 1:a.call(w,this);break;case 2:a.call(w,this,arguments[1]);break;case 3:a.call(w,this,arguments[1],arguments[2]);break;default:for(E=arguments.length,f=new Array(E-1),g=1;g<E;++g)f[g-1]=arguments[g];i.call(w,this,f)}},p={on:m,once:_,off:S,emit:R},h={on:r(m),once:r(_),off:r(S),emit:r(R)},y=c({},h),e.exports=t=function(v){return v==null?s(y):c(Object(v),h)},t.methods=p})(Zr,Zr.exports)),Zr.exports}var Fs,ef;function ag(){return ef||(ef=1,Fs=function(){var e=Array.from,t,r;return typeof e!="function"?!1:(t=["raz","dwa"],r=e(t),!!(r&&r!==t&&r[1]==="dwa"))}),Fs}var qs,tf;function ug(){return tf||(tf=1,qs=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}),qs}var ks,rf;function cg(){if(rf)return ks;rf=1;var e=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return ks=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}})(),ks}var js,nf;function qn(){return nf||(nf=1,js=ug()()?globalThis:cg()),js}var Us,sf;function lg(){if(sf)return Us;sf=1;var e=qn(),t={object:!0,symbol:!0};return Us=function(){var r=e.Symbol,n;if(typeof r!="function")return!1;n=r("test symbol");try{String(n)}catch{return!1}return!(!t[typeof r.iterator]||!t[typeof r.toPrimitive]||!t[typeof r.toStringTag])},Us}var Ms,of;function fg(){return of||(of=1,Ms=function(e){return e?typeof e=="symbol"?!0:!e.constructor||e.constructor.name!=="Symbol"?!1:e[e.constructor.toStringTag]==="Symbol":!1}),Ms}var Gs,af;function Vp(){if(af)return Gs;af=1;var e=fg();return Gs=function(t){if(!e(t))throw new TypeError(t+" is not a symbol");return t},Gs}var Vs,uf;function dg(){if(uf)return Vs;uf=1;var e=nr(),t=Object.create,r=Object.defineProperty,n=Object.prototype,i=t(null);return Vs=function(a){for(var s=0,l,c;i[a+(s||"")];)++s;return a+=s||"",i[a]=!0,l="@@"+a,r(n,l,e.gs(null,function(u){c||(c=!0,r(this,l,e(u)),c=!1)})),l},Vs}var Bs,cf;function hg(){if(cf)return Bs;cf=1;var e=nr(),t=qn().Symbol;return Bs=function(r){return Object.defineProperties(r,{hasInstance:e("",t&&t.hasInstance||r("hasInstance")),isConcatSpreadable:e("",t&&t.isConcatSpreadable||r("isConcatSpreadable")),iterator:e("",t&&t.iterator||r("iterator")),match:e("",t&&t.match||r("match")),replace:e("",t&&t.replace||r("replace")),search:e("",t&&t.search||r("search")),species:e("",t&&t.species||r("species")),split:e("",t&&t.split||r("split")),toPrimitive:e("",t&&t.toPrimitive||r("toPrimitive")),toStringTag:e("",t&&t.toStringTag||r("toStringTag")),unscopables:e("",t&&t.unscopables||r("unscopables"))})},Bs}var zs,lf;function pg(){if(lf)return zs;lf=1;var e=nr(),t=Vp(),r=Object.create(null);return zs=function(n){return Object.defineProperties(n,{for:e(function(i){return r[i]?r[i]:r[i]=n(String(i))}),keyFor:e(function(i){var a;t(i);for(a in r)if(r[a]===i)return a})})},zs}var Hs,ff;function mg(){if(ff)return Hs;ff=1;var e=nr(),t=Vp(),r=qn().Symbol,n=dg(),i=hg(),a=pg(),s=Object.create,l=Object.defineProperties,c=Object.defineProperty,u,o,m;if(typeof r=="function")try{String(r()),m=!0}catch{}else r=null;return o=function(S){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return u(S)},Hs=u=function _(S){var R;if(this instanceof _)throw new TypeError("Symbol is not a constructor");return m?r(S):(R=s(o.prototype),S=S===void 0?"":String(S),l(R,{__description__:e("",S),__name__:e("",n(S))}))},i(u),a(u),l(o.prototype,{constructor:e(u),toString:e("",function(){return this.__name__})}),l(u.prototype,{toString:e(function(){return"Symbol ("+t(this).__description__+")"}),valueOf:e(function(){return t(this)})}),c(u.prototype,u.toPrimitive,e("",function(){var _=t(this);return typeof _=="symbol"?_:_.toString()})),c(u.prototype,u.toStringTag,e("c","Symbol")),c(o.prototype,u.toStringTag,e("c",u.prototype[u.toStringTag])),c(o.prototype,u.toPrimitive,e("c",u.prototype[u.toPrimitive])),Hs}var Ws,df;function _g(){return df||(df=1,Ws=lg()()?qn().Symbol:mg()),Ws}var Xs,hf;function yg(){if(hf)return Xs;hf=1;var e=Object.prototype.toString,t=e.call((function(){return arguments})());return Xs=function(r){return e.call(r)===t},Xs}var Ks,pf;function vg(){if(pf)return Ks;pf=1;var e=Object.prototype.toString,t=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);return Ks=function(r){return typeof r=="function"&&t(e.call(r))},Ks}var Ys,mf;function wg(){if(mf)return Ys;mf=1;var e=Object.prototype.toString,t=e.call("");return Ys=function(r){return typeof r=="string"||r&&typeof r=="object"&&(r instanceof String||e.call(r)===t)||!1},Ys}var Js,_f;function gg(){if(_f)return Js;_f=1;var e=_g().iterator,t=yg(),r=vg(),n=tr(),i=jt(),a=Sr(),s=er(),l=wg(),c=Array.isArray,u=Function.prototype.call,o={configurable:!0,enumerable:!0,writable:!0,value:null},m=Object.defineProperty;return Js=function(_){var S=arguments[1],R=arguments[2],p,h,y,v,g,E,d,w,f,b;if(_=Object(a(_)),s(S)&&i(S),!this||this===Array||!r(this)){if(!S){if(t(_))return g=_.length,g!==1?Array.apply(null,_):(v=new Array(1),v[0]=_[0],v);if(c(_)){for(v=new Array(g=_.length),h=0;h<g;++h)v[h]=_[h];return v}}v=[]}else p=this;if(!c(_)){if((f=_[e])!==void 0){for(d=i(f).call(_),p&&(v=new p),w=d.next(),h=0;!w.done;)b=S?u.call(S,R,w.value,h):w.value,p?(o.value=b,m(v,h,o)):v[h]=b,w=d.next(),++h;g=h}else if(l(_)){for(g=_.length,p&&(v=new p),h=0,y=0;h<g;++h)b=_[h],h+1<g&&(E=b.charCodeAt(0),E>=55296&&E<=56319&&(b+=_[++h])),b=S?u.call(S,R,b,y):b,p?(o.value=b,m(v,y,o)):v[y]=b,++y;g=y}}if(g===void 0)for(g=n(_.length),p&&(v=new p(g)),h=0;h<g;++h)b=S?u.call(S,R,_[h],h):_[h],p?(o.value=b,m(v,h,o)):v[h]=b;return p&&(o.value=null,v.length=g),v},Js}var Qs,yf;function fu(){return yf||(yf=1,Qs=ag()()?Array.from:gg()),Qs}var Zs,vf;function Eg(){if(vf)return Zs;vf=1;var e=fu(),t=Array.isArray;return Zs=function(r){return t(r)?r:e(r)},Zs}var eo,wf;function Sg(){if(wf)return eo;wf=1;var e=Eg(),t=er(),r=jt(),n=Array.prototype.slice,i;return i=function(a){return this.map(function(s,l){return s?s(a[l]):a[l]}).concat(n.call(a,this.length))},eo=function(a){return a=e(a),a.forEach(function(s){t(s)&&r(s)}),i.bind(a)},eo}var to,gf;function Rg(){if(gf)return to;gf=1;var e=jt();return to=function(t){var r;return typeof t=="function"?{set:t,get:t}:(r={get:e(t.get)},t.set!==void 0?(r.set=e(t.set),t.delete&&(r.delete=e(t.delete)),t.clear&&(r.clear=e(t.clear)),r):(r.set=r.get,r))},to}var ro,Ef;function bg(){if(Ef)return ro;Ef=1;var e=Qw(),t=Mp(),r=nr(),n=og().methods,i=Sg(),a=Rg(),s=Function.prototype.apply,l=Function.prototype.call,c=Object.create,u=Object.defineProperties,o=n.on,m=n.emit;return ro=function(_,S,R){var p=c(null),h,y,v,g,E,d,w,f,b,$,T,k,B,G,P;return S!==!1?y=S:isNaN(_.length)?y=1:y=_.length,R.normalizer&&($=a(R.normalizer),v=$.get,g=$.set,E=$.delete,d=$.clear),R.resolvers!=null&&(P=i(R.resolvers)),v?G=t(function(I){var A,D,C=arguments;if(P&&(C=P(C)),A=v(C),A!==null&&hasOwnProperty.call(p,A))return T&&h.emit("get",A,C,this),p[A];if(C.length===1?D=l.call(_,this,C[0]):D=s.call(_,this,C),A===null){if(A=v(C),A!==null)throw e("Circular invocation","CIRCULAR_INVOCATION");A=g(C)}else if(hasOwnProperty.call(p,A))throw e("Circular invocation","CIRCULAR_INVOCATION");return p[A]=D,k&&h.emit("set",A,null,D),D},y):S===0?G=function(){var I;if(hasOwnProperty.call(p,"data"))return T&&h.emit("get","data",arguments,this),p.data;if(arguments.length?I=s.call(_,this,arguments):I=l.call(_,this),hasOwnProperty.call(p,"data"))throw e("Circular invocation","CIRCULAR_INVOCATION");return p.data=I,k&&h.emit("set","data",null,I),I}:G=function(I){var A,D=arguments,C;if(P&&(D=P(arguments)),C=String(D[0]),hasOwnProperty.call(p,C))return T&&h.emit("get",C,D,this),p[C];if(D.length===1?A=l.call(_,this,D[0]):A=s.call(_,this,D),hasOwnProperty.call(p,C))throw e("Circular invocation","CIRCULAR_INVOCATION");return p[C]=A,k&&h.emit("set",C,null,A),A},h={original:_,memoized:G,profileName:R.profileName,get:function(I){return P&&(I=P(I)),v?v(I):String(I[0])},has:function(I){return hasOwnProperty.call(p,I)},delete:function(I){var A;hasOwnProperty.call(p,I)&&(E&&E(I),A=p[I],delete p[I],B&&h.emit("delete",I,A))},clear:function(){var I=p;d&&d(),p=c(null),h.emit("clear",I)},on:function(I,A){return I==="get"?T=!0:I==="set"?k=!0:I==="delete"&&(B=!0),o.call(this,I,A)},emit:m,updateEnv:function(){_=h.original}},v?w=t(function(I){var A,D=arguments;P&&(D=P(D)),A=v(D),A!==null&&h.delete(A)},y):S===0?w=function(){return h.delete("data")}:w=function(I){return P&&(I=P(arguments)[0]),h.delete(I)},f=t(function(){var I,A=arguments;return S===0?p.data:(P&&(A=P(A)),v?I=v(A):I=String(A[0]),p[I])}),b=t(function(){var I,A=arguments;return S===0?h.has("data"):(P&&(A=P(A)),v?I=v(A):I=String(A[0]),I===null?!1:h.has(I))}),u(G,{__memoized__:r(!0),delete:r(w),clear:r(h.clear),_get:r(f),_has:r(b)}),h},ro}var no,Sf;function $g(){if(Sf)return no;Sf=1;var e=jt(),t=Fn(),r=rr(),n=bg(),i=kp();return no=function a(s){var l,c,u;if(e(s),l=Object(arguments[1]),l.async&&l.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(s,"__memoized__")&&!l.force?s:(c=i(l.length,s.length,l.async&&r.async),u=n(s,c,l),t(r,function(o,m){l[m]&&o(l[m],u,l)}),a.__profiler__&&a.__profiler__(u),u.updateEnv(),u.memoized)},no}var io,Rf;function Og(){return Rf||(Rf=1,io=function(e){var t,r,n=e.length;if(!n)return"";for(t=String(e[r=0]);--n;)t+=""+e[++r];return t}),io}var so,bf;function Ig(){return bf||(bf=1,so=function(e){return e?function(t){for(var r=String(t[0]),n=0,i=e;--i;)r+=""+t[++n];return r}:function(){return""}}),so}var oo,$f;function Pg(){return $f||($f=1,oo=function(){var e=Number.isNaN;return typeof e!="function"?!1:!e({})&&e(NaN)&&!e(34)}),oo}var ao,Of;function Tg(){return Of||(Of=1,ao=function(e){return e!==e}),ao}var uo,If;function Ng(){return If||(If=1,uo=Pg()()?Number.isNaN:Tg()),uo}var co,Pf;function du(){if(Pf)return co;Pf=1;var e=Ng(),t=tr(),r=Sr(),n=Array.prototype.indexOf,i=Object.prototype.hasOwnProperty,a=Math.abs,s=Math.floor;return co=function(l){var c,u,o,m;if(!e(l))return n.apply(this,arguments);for(u=t(r(this).length),o=arguments[1],isNaN(o)?o=0:o>=0?o=s(o):o=t(this.length)-s(a(o)),c=o;c<u;++c)if(i.call(this,c)&&(m=this[c],e(m)))return c;return-1},co}var lo,Tf;function Ag(){if(Tf)return lo;Tf=1;var e=du(),t=Object.create;return lo=function(){var r=0,n=[],i=t(null);return{get:function(a){var s=0,l=n,c,u=a.length;if(u===0)return l[u]||null;if(l=l[u]){for(;s<u-1;){if(c=e.call(l[0],a[s]),c===-1)return null;l=l[1][c],++s}return c=e.call(l[0],a[s]),c===-1?null:l[1][c]||null}return null},set:function(a){var s=0,l=n,c,u=a.length;if(u===0)l[u]=++r;else{for(l[u]||(l[u]=[[],[]]),l=l[u];s<u-1;)c=e.call(l[0],a[s]),c===-1&&(c=l[0].push(a[s])-1,l[1].push([[],[]])),l=l[1][c],++s;c=e.call(l[0],a[s]),c===-1&&(c=l[0].push(a[s])-1),l[1][c]=++r}return i[r]=a,r},delete:function(a){var s=0,l=n,c,u=i[a],o=u.length,m=[];if(o===0)delete l[o];else if(l=l[o]){for(;s<o-1;){if(c=e.call(l[0],u[s]),c===-1)return;m.push(l,c),l=l[1][c],++s}if(c=e.call(l[0],u[s]),c===-1)return;for(a=l[1][c],l[0].splice(c,1),l[1].splice(c,1);!l[0].length&&m.length;)c=m.pop(),l=m.pop(),l[0].splice(c,1),l[1].splice(c,1)}delete i[a]},clear:function(){n=[],i=t(null)}}},lo}var fo,Nf;function Lg(){if(Nf)return fo;Nf=1;var e=du();return fo=function(){var t=0,r=[],n=[];return{get:function(i){var a=e.call(r,i[0]);return a===-1?null:n[a]},set:function(i){return r.push(i[0]),n.push(++t),t},delete:function(i){var a=e.call(n,i);a!==-1&&(r.splice(a,1),n.splice(a,1))},clear:function(){r=[],n=[]}}},fo}var ho,Af;function xg(){if(Af)return ho;Af=1;var e=du(),t=Object.create;return ho=function(r){var n=0,i=[[],[]],a=t(null);return{get:function(s){for(var l=0,c=i,u;l<r-1;){if(u=e.call(c[0],s[l]),u===-1)return null;c=c[1][u],++l}return u=e.call(c[0],s[l]),u===-1?null:c[1][u]||null},set:function(s){for(var l=0,c=i,u;l<r-1;)u=e.call(c[0],s[l]),u===-1&&(u=c[0].push(s[l])-1,c[1].push([[],[]])),c=c[1][u],++l;return u=e.call(c[0],s[l]),u===-1&&(u=c[0].push(s[l])-1),c[1][u]=++n,a[n]=s,n},delete:function(s){for(var l=0,c=i,u,o=[],m=a[s];l<r-1;){if(u=e.call(c[0],m[l]),u===-1)return;o.push(c,u),c=c[1][u],++l}if(u=e.call(c[0],m[l]),u!==-1){for(s=c[1][u],c[0].splice(u,1),c[1].splice(u,1);!c[0].length&&o.length;)u=o.pop(),c=o.pop(),c[0].splice(u,1),c[1].splice(u,1);delete a[s]}},clear:function(){i=[[],[]],a=t(null)}}},ho}var Lf={},po,xf;function Bp(){if(xf)return po;xf=1;var e=jt(),t=Fn(),r=Function.prototype.call;return po=function(n,i){var a={},s=arguments[2];return e(i),t(n,function(l,c,u,o){a[c]=r.call(i,s,l,c,u,o)}),a},po}var mo,Cf;function hu(){if(Cf)return mo;Cf=1;var e=function(r){if(typeof r!="function")throw new TypeError(r+" is not a function");return r},t=function(r){var n=document.createTextNode(""),i,a,s=0;return new r(function(){var l;if(i)a&&(i=a.concat(i));else{if(!a)return;i=a}if(a=i,i=null,typeof a=="function"){l=a,a=null,l();return}for(n.data=s=++s%2;a;)l=a.shift(),a.length||(a=null),l()}).observe(n,{characterData:!0}),function(l){if(e(l),i){typeof i=="function"?i=[i,l]:i.push(l);return}i=l,n.data=s=++s%2}};return mo=(function(){if(typeof process=="object"&&process&&typeof process.nextTick=="function")return process.nextTick;if(typeof queueMicrotask=="function")return function(r){queueMicrotask(e(r))};if(typeof document=="object"&&document){if(typeof MutationObserver=="function")return t(MutationObserver);if(typeof WebKitMutationObserver=="function")return t(WebKitMutationObserver)}return typeof setImmediate=="function"?function(r){setImmediate(e(r))}:typeof setTimeout=="function"||typeof setTimeout=="object"?function(r){setTimeout(e(r),0)}:null})(),mo}var Df;function Cg(){if(Df)return Lf;Df=1;var e=fu(),t=Bp(),r=Up(),n=Mp(),i=hu(),a=Array.prototype.slice,s=Function.prototype.apply,l=Object.create;return rr().async=function(c,u){var o=l(null),m=l(null),_=u.memoized,S=u.original,R,p,h;u.memoized=n(function(y){var v=arguments,g=v[v.length-1];return typeof g=="function"&&(R=g,v=a.call(v,0,-1)),_.apply(p=this,h=v)},_);try{r(u.memoized,_)}catch{}u.on("get",function(y){var v,g,E;if(R){if(o[y]){typeof o[y]=="function"?o[y]=[o[y],R]:o[y].push(R),R=null;return}v=R,g=p,E=h,R=p=h=null,i(function(){var d;hasOwnProperty.call(m,y)?(d=m[y],u.emit("getasync",y,E,g),s.call(v,d.context,d.args)):(R=v,p=g,h=E,_.apply(g,E))})}}),u.original=function(){var y,v,g,E;return R?(y=e(arguments),v=function d(w){var f,b,$=d.id;if($==null){i(s.bind(d,this,arguments));return}if(delete d.id,f=o[$],delete o[$],!!f)return b=e(arguments),u.has($)&&(w?u.delete($):(m[$]={context:this,args:b},u.emit("setasync",$,typeof f=="function"?1:f.length))),typeof f=="function"?E=s.call(f,this,b):f.forEach(function(T){E=s.call(T,this,b)},this),E},g=R,R=p=h=null,y.push(v),E=s.call(S,this,y),v.cb=g,R=v,E):s.call(S,this,arguments)},u.on("set",function(y){if(!R){u.delete(y);return}o[y]?typeof o[y]=="function"?o[y]=[o[y],R.cb]:o[y].push(R.cb):o[y]=R.cb,delete R.cb,R.id=y,R=null}),u.on("delete",function(y){var v;hasOwnProperty.call(o,y)||m[y]&&(v=m[y],delete m[y],u.emit("deleteasync",y,a.call(v.args,1)))}),u.on("clear",function(){var y=m;m=l(null),u.emit("clearasync",t(y,function(v){return a.call(v.args,1)}))})},Lf}var Ff={},_o,qf;function Dg(){if(qf)return _o;qf=1;var e=Array.prototype.forEach,t=Object.create;return _o=function(r){var n=t(null);return e.call(arguments,function(i){n[i]=!0}),n},_o}var yo,kf;function zp(){return kf||(kf=1,yo=function(e){return typeof e=="function"}),yo}var vo,jf;function Fg(){if(jf)return vo;jf=1;var e=zp();return vo=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{throw new TypeError("Passed argument cannot be stringifed")}},vo}var wo,Uf;function qg(){if(Uf)return wo;Uf=1;var e=Sr(),t=Fg();return wo=function(r){return t(e(r))},wo}var go,Mf;function kg(){if(Mf)return go;Mf=1;var e=zp();return go=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{return"<Non-coercible to string value>"}},go}var Eo,Gf;function jg(){if(Gf)return Eo;Gf=1;var e=kg(),t=/[\n\r\u2028\u2029]/g;return Eo=function(r){var n=e(r);return n.length>100&&(n=n.slice(0,99)+"…"),n=n.replace(t,function(i){return JSON.stringify(i).slice(1,-1)}),n},Eo}var en={exports:{}},Vf;function Hp(){if(Vf)return en.exports;Vf=1,en.exports=e,en.exports.default=e;function e(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}return en.exports}var Bf;function Ug(){if(Bf)return Ff;Bf=1;var e=Bp(),t=Dg(),r=qg(),n=jg(),i=Hp(),a=hu(),s=Object.create,l=t("then","then:finally","done","done:finally");return rr().promise=function(c,u){var o=s(null),m=s(null),_=s(null);if(c===!0)c=null;else if(c=r(c),!l[c])throw new TypeError("'"+n(c)+"' is not valid promise mode");u.on("set",function(S,R,p){var h=!1;if(!i(p)){m[S]=p,u.emit("setasync",S,1);return}o[S]=1,_[S]=p;var y=function(d){var w=o[S];if(h)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)
|
||
Consider to rely on 'then' or 'done' mode instead.`);w&&(delete o[S],m[S]=d,u.emit("setasync",S,w))},v=function(){h=!0,o[S]&&(delete o[S],delete _[S],u.delete(S))},g=c;if(g||(g="then"),g==="then"){var E=function(){a(v)};p=p.then(function(d){a(y.bind(this,d))},E),typeof p.finally=="function"&&p.finally(E)}else if(g==="done"){if(typeof p.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");p.done(y,v)}else if(g==="done:finally"){if(typeof p.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof p.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");p.done(y),p.finally(v)}}),u.on("get",function(S,R,p){var h;if(o[S]){++o[S];return}h=_[S];var y=function(){u.emit("getasync",S,R,p)};i(h)?typeof h.done=="function"?h.done(y):h.then(function(){a(y)}):y()}),u.on("delete",function(S){if(delete _[S],o[S]){delete o[S];return}if(hasOwnProperty.call(m,S)){var R=m[S];delete m[S],u.emit("deleteasync",S,[R])}}),u.on("clear",function(){var S=m;m=s(null),o=s(null),_=s(null),u.emit("clearasync",e(S,function(R){return[R]}))})},Ff}var zf={},Hf;function Mg(){if(Hf)return zf;Hf=1;var e=jt(),t=Fn(),r=rr(),n=Function.prototype.apply;return r.dispose=function(i,a,s){var l;if(e(i),s.async&&r.async||s.promise&&r.promise){a.on("deleteasync",l=function(c,u){n.call(i,null,u)}),a.on("clearasync",function(c){t(c,function(u,o){l(o,u)})});return}a.on("delete",l=function(c,u){i(u)}),a.on("clear",function(c){t(c,function(u,o){l(o,u)})})},zf}var Wf={},So,Xf;function Gg(){return Xf||(Xf=1,So=2147483647),So}var Ro,Kf;function Vg(){if(Kf)return Ro;Kf=1;var e=tr(),t=Gg();return Ro=function(r){if(r=e(r),r>t)throw new TypeError(r+" exceeds maximum possible timeout");return r},Ro}var Yf;function Bg(){if(Yf)return Wf;Yf=1;var e=fu(),t=Fn(),r=hu(),n=Hp(),i=Vg(),a=rr(),s=Function.prototype,l=Math.max,c=Math.min,u=Object.create;return a.maxAge=function(o,m,_){var S,R,p,h;o=i(o),o&&(S=u(null),R=_.async&&a.async||_.promise&&a.promise?"async":"",m.on("set"+R,function(y){S[y]=setTimeout(function(){m.delete(y)},o),typeof S[y].unref=="function"&&S[y].unref(),h&&(h[y]&&h[y]!=="nextTick"&&clearTimeout(h[y]),h[y]=setTimeout(function(){delete h[y]},p),typeof h[y].unref=="function"&&h[y].unref())}),m.on("delete"+R,function(y){clearTimeout(S[y]),delete S[y],h&&(h[y]!=="nextTick"&&clearTimeout(h[y]),delete h[y])}),_.preFetch&&(_.preFetch===!0||isNaN(_.preFetch)?p=.333:p=l(c(Number(_.preFetch),1),0),p&&(h={},p=(1-p)*o,m.on("get"+R,function(y,v,g){h[y]||(h[y]="nextTick",r(function(){var E;h[y]==="nextTick"&&(delete h[y],m.delete(y),_.async&&(v=e(v),v.push(s)),E=m.memoized.apply(g,v),_.promise&&n(E)&&(typeof E.done=="function"?E.done(s,s):E.then(s,s)))}))}))),m.on("clear"+R,function(){t(S,function(y){clearTimeout(y)}),S={},h&&(t(h,function(y){y!=="nextTick"&&clearTimeout(y)}),h={})}))},Wf}var Jf={},bo,Qf;function zg(){if(Qf)return bo;Qf=1;var e=tr(),t=Object.create,r=Object.prototype.hasOwnProperty;return bo=function(n){var i=0,a=1,s=t(null),l=t(null),c=0,u;return n=e(n),{hit:function(o){var m=l[o],_=++c;if(s[_]=o,l[o]=_,!m)return++i,i<=n?void 0:(o=s[a],u(o),o);if(delete s[m],a===m)for(;!r.call(s,++a););},delete:u=function(o){var m=l[o];if(m&&(delete s[m],delete l[o],--i,a===m)){if(!i){c=0,a=1;return}for(;!r.call(s,++a););}},clear:function(){i=0,a=1,s=t(null),l=t(null),c=0}}},bo}var Zf;function Hg(){if(Zf)return Jf;Zf=1;var e=tr(),t=zg(),r=rr();return r.max=function(n,i,a){var s,l,c;n=e(n),n&&(l=t(n),s=a.async&&r.async||a.promise&&r.promise?"async":"",i.on("set"+s,c=function(u){u=l.hit(u),u!==void 0&&i.delete(u)}),i.on("get"+s,c),i.on("delete"+s,l.delete),i.on("clear"+s,l.clear))},Jf}var ed={},td;function Wg(){if(td)return ed;td=1;var e=nr(),t=rr(),r=Object.create,n=Object.defineProperties;return t.refCounter=function(i,a,s){var l,c;l=r(null),c=s.async&&t.async||s.promise&&t.promise?"async":"",a.on("set"+c,function(u,o){l[u]=o||1}),a.on("get"+c,function(u){++l[u]}),a.on("delete"+c,function(u){delete l[u]}),a.on("clear"+c,function(){l={}}),n(a.memoized,{deleteRef:e(function(){var u=a.get(arguments);return u===null||!l[u]?null:--l[u]?!1:(a.delete(u),!0)}),getRefCount:e(function(){var u=a.get(arguments);return u===null||!l[u]?0:l[u]})})},ed}var $o,rd;function Xg(){if(rd)return $o;rd=1;var e=qp(),t=kp(),r=$g();return $o=function(n){var i=e(arguments[1]),a;return i.normalizer||(a=i.length=t(i.length,n.length,i.async),a!==0&&(i.primitive?a===!1?i.normalizer=Og():a>1&&(i.normalizer=Ig()(a)):a===!1?i.normalizer=Ag()():a===1?i.normalizer=Lg()():i.normalizer=xg()(a))),i.async&&Cg(),i.promise&&Ug(),i.dispose&&Mg(),i.maxAge&&Bg(),i.max&&Hg(),i.refCounter&&Wg(),r(n,i)},$o}var Kg=Xg();const ke=$e(Kg);async function ye(e){try{return await oe.promises.access(e),!0}catch{return!1}}function Yg(e){try{return oe.accessSync(e),!0}catch{return!1}}function Jg(){if(gr()&&typeof process.env.SUDO_USER=="string"&&process.env.SUDO_USER!=="")return process.platform==="darwin"?F.join("/Users/",process.env.SUDO_USER):F.join("/home/",process.env.SUDO_USER);{const e=le.homedir();return e===""?void 0:e}}const Qg=/^~(?=$|\/|\\)/;function nt(e){const t=Jg();return t===void 0?e:e.replace(Qg,t)}const{appendFile:Wp,readFile:pu,writeFile:Zg}=oe.promises,eE="envosman",Xp=nt("~/.envosmanrc");async function tE(e){var s;const t=nt("~/.bashrc"),r=nt("~/.profile"),n=F.resolve(e.rcPath);if(n===t||n===r)return;const i=(s=e.guard)!=null?s:eE,a=`
|
||
# ${i}
|
||
if [[ "$SOURCE_${i.toUpperCase()}RC" != 0 && -f "${n}" ]]; then source "${n}"; fi
|
||
`;try{await Promise.all([rE(e),nd(a,t),nd(a,r)])}catch(l){ve(`Failed to add ${a} to .profile or .bashrc. You should add it manually: ${l}`)}}const mu=ke(tE,{promise:!0});async function rE(e){const t=e.guard===void 0?`
|
||
# Automatically Generated by envosman
|
||
`:`
|
||
# Automatically Generated by envosman ${e.guard}
|
||
export SOURCE_${e.guard.toUpperCase()}RC=0
|
||
`;await ye(e.rcPath)&&((await pu(e.rcPath,"utf8")).includes(t)||(await Wp(e.rcPath,`
|
||
${t}
|
||
`),J(`Added ${t} to ${e.rcPath}`)))}async function nd(e,t){await ye(t)&&((await pu(t,"utf-8")).includes(e)||(await Wp(t,e),J(`${e} was added to ${t}`)))}async function nE(e){if(await ye(e.rcPath)){const t=(await pu(e.rcPath,"utf-8")).split(`
|
||
`),r=[...new Set(t.reverse())].reverse();await Zg(e.rcPath,r.join(`
|
||
`)),await Er(e.rcPath)}}var Oo,id;function iE(){if(id)return Oo;id=1;const e=le,t=e.platform()!=="win32",r=e.release(),n=/(\d+\.\d+)\.(\d+)/,i=(a="",s="")=>/1\d+\.\d+/.test(a)&&Number(s)>=17134.1184;return Oo=function(a){return t?a.replace(/(\s+)/g,"\\$1"):i(...n.exec(r).splice(1))?a:a.replace(/(\s+)/g,"%20")},Oo}var sE=iE();const oE=$e(sE);var cn={exports:{}},Io,sd;function aE(){if(sd)return Io;sd=1;var e=/[|\\{}()[\]^$+*?.]/g;return Io=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(e,"\\$&")},Io}var uE=cn.exports,od;function cE(){return od||(od=1,(function(){var e,t;e=aE(),t=function(r){return r.split("").reverse().join("")},cn.exports=function(r,n,i){var a;return n==null&&(n="'"),i==null&&(i="\\"),typeof r!="string"?r:(a=new RegExp("(["+e(n)+"])(?!"+e(i)+")","g"),t(t(r).replace(a,"$1"+i)))}}).call(uE)),cn.exports}var lE=cE();const fE=$e(lE);function dE(e,t=!1){const r=t?oE(e):e;return fE(r,'"',"\\")}const{GITHUB_ACTIONS:hE}=Et,{appendFile:ad}=oe.promises;async function Pe(e,t,r={}){const n={escapeSpace:!1,overwrite:!0,rcPath:Xp,...r},i=dE(t!=null?t:"",n.escapeSpace);try{if(hE)try{if(!n.overwrite&&process.env[e]!==void 0){J(`Environment variable ${e} is already defined. Skipping.`);return}Se.exportVariable(e,i)}catch(a){Le(a),await ud(e,i,n)}else await ud(e,i,n)}catch(a){Le(`${a}
|
||
Failed to export environment variable ${e}=${i}. You should add it manually.`)}}async function ud(e,t,r){const n=t!=null?t:"";switch(process.platform){case"win32":{if(!r.overwrite&&process.env[e]!==void 0){J(`Environment variable ${e} is already defined. Skipping.`);return}await xp(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),J(`${e}='${n}' was set in the environment.`);return}case"linux":case"darwin":{await mu(r),r.overwrite?(await ad(r.rcPath,`
|
||
export ${e}="${n}"
|
||
`),J(`${e}="${n}" was added to "${r.rcPath}`)):(await ad(r.rcPath,`
|
||
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
|
||
`),J(`if not defined ${e} then ${e}="${n}" was added to "${r.rcPath}`)),process.env[e]=n;return}}process.env[e]=n}const{GITHUB_ACTIONS:pE}=Et,{appendFile:mE}=oe.promises;async function Oe(e,t={}){const r={rcPath:Xp,...t};if(!yE(e)){process.env.PATH=`${e}${F.delimiter}${process.env.PATH}`;try{if(pE)try{Se.addPath(e)}catch(n){Le(n),await cd(e,r)}else await cd(e,r)}catch(n){Le(`${n}
|
||
Failed to add ${e} to the percistent PATH. You should add it manually.`)}}}async function cd(e,t){switch(process.platform){case"win32":{await xp(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),J(`"${e}" was added to the PATH.`);return}case"linux":case"darwin":{await mu(t),await mE(t.rcPath,`
|
||
export PATH="${e}:$PATH"
|
||
`),J(`"${e}" was added to "${t.rcPath}"`);return}default:return}}const _E=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];function yE(e){var t,r;return _E.some(n=>n.test(e))?((r=(t=process.env.PATH)==null?void 0:t.split(F.delimiter))!=null?r:[]).includes(e):!1}function _u(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ln={exports:{}},vE=ln.exports,ld;function Kp(){return ld||(ld=1,(function(e){(function(){var t={},r={create:n,addLocale:i,pluralize:a};e.exports=r;function n(u){return l(u),{pluralize:function(o,m){return a(u,o,m)}}}function i(u,o){t[u]=o}function a(u,o,m){if(l(u),typeof m!="object")throw new Error("List of variants should be specified as an object");var _=t[u](o);return typeof m[_]<"u"?m[_]:null}function s(u){return typeof t[u]<"u"}function l(u){s(u)||c(u)}function c(u){try{_u(__dirname+"/../locales/"+u+".js")}catch{throw Error("Failed to load the following locale: "+u)}}}).call(vE)})(ln)),ln.exports}var Po,fd;function Yp(){return fd||(fd=1,Po=Kp()),Po}var wE=Yp();const gE=$e(wE);var To={},dd;function EE(){return dd||(dd=1,(function(){var e=this,t;typeof _u=="function"?t=Kp():t=e.numerous,t.addLocale("en",function(n){var i=Math.floor(Math.abs(n)),a=n.toString().replace(/^[^.]*\.?/,"").length;return typeof n=="string"&&(n=parseInt(n,10)),i===1&&a===0?"one":"other"})}).call(To)),To}var SE=EE();const RE=$e(SE);var No={exports:{}},hd;function bE(){return hd||(hd=1,(function(e,t){e.exports=!!(typeof process<"u"&&process.versions&&process.versions.node)})(No)),No.exports}var Ao,pd;function $E(){if(pd)return Ao;pd=1;const e=Yp(),t=bE(),r=[["years",336*24*60*60*1e3],["months",672*60*60*1e3],["weeks",10080*60*1e3],["days",1440*60*1e3],["hours",3600*1e3],["minutes",60*1e3],["seconds",1e3]],n={locale:"en",span:2,delimiter:", ",unitType:"long",unitTypeLookupOrder:["long","short","narrow"],autoloadLocales:!0},i={};Ao={create:s,addLocale:a,defaultConfig:n};function a(p){Array.isArray(p)||(p=[p]);for(const h of p){const{id:y,data:v}=h;i[y]=v}}function s(p){return p=Object.assign({},n,p||{}),{format:function(h,y,v){return v=Object.assign({},p,v||{}),l(h,y,v)}}}function l(p,h,y){if(c(y.locale,{autoload:y.autoloadLocales}),!p)throw new Error("Missing first date argument");if(!h)throw new Error("Missing second date argument");const v=m(p,h),g=[];for(const E of v){const[d,w]=E;if(w>0&&g.push(_(d,w,y)),g.length>=y.span)break}return g.join(y.delimiter)}function c(p,h){const{autoload:y}=h;if(!u(p))if(t&&y)o(p);else throw new Error(`Missing locale: ${p}, you must load it manually before using it`)}function u(p){return!!i[p]}function o(p){try{a(_u(`../locales/${p}.js`))}catch(h){throw Error(`Failed to load locale: ${p} from ../locales/${p}.js. If using a bundled time-delta, set 'autoloadLocales: false' in the config: ${h}`)}}function m(p,h){let y=h-p;const v=[];return r.some(function(g){const E=g[0],d=g[1],w=Math.floor(y/d);if(y-=w*d,v.push([E,w]),y<=0)return!0}),v}function _(p,h,y){const v=S(y);return e.pluralize(y.locale,h,v[p]).replace("{0}",h)}function S(p){const h=i[p.locale];let y=p.unitTypeLookupOrder.slice();y.unshift(p.unitType),y=R(y);let v=null;if(y.some(function(g){if(typeof h[g]<"u")return v=h[g],!0}),v===null)throw new Error("Can not find any unit type data for locale: "+p.locale);return v}function R(p){return Array.from(new Set(p))}return Ao}var Lo,md;function OE(){return md||(md=1,Lo=$E()),Lo}var IE=OE();const _d=$e(IE);var xo,yd;function PE(){return yd||(yd=1,xo={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"}}}}),xo}var TE=PE();const NE=$e(TE);var Co,vd;function kn(){return vd||(vd=1,Co=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Co}var Do,wd;function yu(){if(wd)return Do;wd=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=t-6;return Do={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Do}var tn={exports:{}},gd;function jn(){return gd||(gd=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=yu(),a=kn();t=e.exports={};const s=t.re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],o=t.t={};let m=0;const _="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",i],[_,n]],R=h=>{for(const[y,v]of S)h=h.split(`${y}*`).join(`${y}{0,${v}}`).split(`${y}+`).join(`${y}{1,${v}}`);return h},p=(h,y,v)=>{const g=R(y),E=m++;a(h,E,y),o[h]=E,c[E]=y,u[E]=g,s[E]=new RegExp(y,v?"g":void 0),l[E]=new RegExp(g,v?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_}*`),p("MAINVERSION",`(${c[o.NUMERICIDENTIFIER]})\\.(${c[o.NUMERICIDENTIFIER]})\\.(${c[o.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[o.NUMERICIDENTIFIERLOOSE]})\\.(${c[o.NUMERICIDENTIFIERLOOSE]})\\.(${c[o.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[o.NONNUMERICIDENTIFIER]}|${c[o.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[o.NONNUMERICIDENTIFIER]}|${c[o.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[o.PRERELEASEIDENTIFIER]}(?:\\.${c[o.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[o.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${_}+`),p("BUILD",`(?:\\+(${c[o.BUILDIDENTIFIER]}(?:\\.${c[o.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[o.MAINVERSION]}${c[o.PRERELEASE]}?${c[o.BUILD]}?`),p("FULL",`^${c[o.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[o.MAINVERSIONLOOSE]}${c[o.PRERELEASELOOSE]}?${c[o.BUILD]}?`),p("LOOSE",`^${c[o.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[o.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[o.XRANGEIDENTIFIER]})(?:\\.(${c[o.XRANGEIDENTIFIER]})(?:\\.(${c[o.XRANGEIDENTIFIER]})(?:${c[o.PRERELEASE]})?${c[o.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[o.XRANGEIDENTIFIERLOOSE]})(?:${c[o.PRERELEASELOOSE]})?${c[o.BUILD]}?)?)?`),p("XRANGE",`^${c[o.GTLT]}\\s*${c[o.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[o.GTLT]}\\s*${c[o.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[o.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[o.COERCEPLAIN]+`(?:${c[o.PRERELEASE]})?(?:${c[o.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[o.COERCE],!0),p("COERCERTLFULL",c[o.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[o.LONETILDE]}${c[o.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[o.LONETILDE]}${c[o.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[o.LONECARET]}${c[o.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[o.LONECARET]}${c[o.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[o.GTLT]}\\s*(${c[o.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[o.GTLT]}\\s*(${c[o.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[o.GTLT]}\\s*(${c[o.LOOSEPLAIN]}|${c[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[o.XRANGEPLAIN]})\\s+-\\s+(${c[o.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[o.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(tn,tn.exports)),tn.exports}var Fo,Ed;function vu(){if(Ed)return Fo;Ed=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Fo=n=>n?typeof n!="object"?e:n:t,Fo}var qo,Sd;function AE(){if(Sd)return qo;Sd=1;const e=/^[0-9]+$/,t=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const a=e.test(n),s=e.test(i);return a&&s&&(n=+n,i=+i),n===i?0:a&&!s?-1:s&&!a?1:n<i?-1:1};return qo={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},qo}var ko,Rd;function Rr(){if(Rd)return ko;Rd=1;const e=kn(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=yu(),{safeRe:n,t:i}=jn(),a=vu(),{compareIdentifiers:s}=AE();class l{constructor(u,o){if(o=a(o),u instanceof l){if(u.loose===!!o.loose&&u.includePrerelease===!!o.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;const m=u.trim().match(o.loose?n[i.LOOSE]:n[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(_=>{if(/^[0-9]+$/.test(_)){const S=+_;if(S>=0&&S<r)return S}return _}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof l)){if(typeof u=="string"&&u===this.version)return 0;u=new l(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof l||(u=new l(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof l||(u=new l(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let o=0;do{const m=this.prerelease[o],_=u.prerelease[o];if(e("prerelease compare",o,m,_),m===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(m===void 0)return-1;if(m===_)continue;return s(m,_)}while(++o)}compareBuild(u){u instanceof l||(u=new l(u,this.options));let o=0;do{const m=this.build[o],_=u.build[o];if(e("build compare",o,m,_),m===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(m===void 0)return-1;if(m===_)continue;return s(m,_)}while(++o)}inc(u,o,m){if(u.startsWith("pre")){if(!o&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(o){const _=`-${o}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!_||_[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,m),this.inc("pre",o,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,m),this.inc("pre",o,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const _=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[_];else{let S=this.prerelease.length;for(;--S>=0;)typeof this.prerelease[S]=="number"&&(this.prerelease[S]++,S=-2);if(S===-1){if(o===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(_)}}if(o){let S=[o,_];m===!1&&(S=[o]),s(this.prerelease[0],o)===0?isNaN(this.prerelease[1])&&(this.prerelease=S):this.prerelease=S}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ko=l,ko}var jo,bd;function Jp(){if(bd)return jo;bd=1;const e=Rr();return jo=(r,n,i=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(a){if(!i)return null;throw a}},jo}var Uo,$d;function LE(){if($d)return Uo;$d=1;const e=Jp();return Uo=(r,n)=>{const i=e(r,n);return i?i.version:null},Uo}var xE=LE();const Un=$e(xE);function En(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Mo,Od;function CE(){if(Od)return Mo;Od=1;var e=F;function t(n,i){if(typeof n!="string"||n.length===0)return n;var a=e.basename(n,e.extname(n))+i,s=e.join(e.dirname(n),a);return r(n)?"."+e.sep+s:s}function r(n){var i=n.slice(0,2);return i==="."+e.sep||i==="./"}return Mo=t,Mo}var DE=CE();const FE=$e(DE);function bt(e,t){return Object.keys(t).forEach((r=>{r==="default"||r==="__esModule"||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get(){return t[r]}})})),e}function Nt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function qE(e,t=!0){return t?F.basename(e):F.basename(e,F.extname(e))}function kE(e){return F.normalize(e).replace(RegExp(En(F.sep)+"$"),"")}function Ee(e,t=".exe",r=""){return process.platform==="win32"?`${e}${t}`:`${e}${r}`}function jE(e,t){const r=F.extname(e),n=`${t}${F.basename(e,r)}${r}`;return F.join(F.dirname(e),n)}function UE(e,t){const r=F.extname(e),n=`${F.basename(e,r)}${t}${r}`;return F.join(F.dirname(e),n)}function za(e,t=".cmd",r=".sh"){return process.platform==="win32"?`${e}${t}`:`${e}${r}`}function Qp(e){return process.platform==="win32"?e:"./"+e}function ME(e){const t=F.extname(e).length;return e.slice(0,-t)}function GE(e,t){return FE(e,t)}function VE(e,t){const r=F.relative(t,e);return!(!r||r===".."||r.startsWith(".."+F.sep)||r===F.resolve(e))}var $t={},Zp={};Nt(Zp,"name",(()=>qE));var em={};Nt(em,"normalizeTrim",(()=>kE));var tm={};Nt(tm,"addExeExt",(()=>Ee));var rm={};Nt(rm,"addNamePrefix",(()=>jE));var nm={};Nt(nm,"addNameSuffix",(()=>UE));var im={};Nt(im,"addShExt",(()=>za));var sm={};Nt(sm,"addShRelativePrefix",(()=>Qp));var om={};Nt(om,"removeExt",(()=>ME));var am={};Nt(am,"replaceExt",(()=>GE));var Id={};Nt(Id,"isPathInside",(()=>VE)),bt($t,Zp),bt($t,em),bt($t,tm),bt($t,rm),bt($t,nm),bt($t,im),bt($t,sm),bt($t,om),bt($t,am),bt($t,Id);var Go,Pd;function BE(){if(Pd)return Go;Pd=1;const e=Rr();return Go=(r,n)=>new e(r,n).major,Go}var zE=BE();const um=$e(zE);function cm(){if(process.platform!=="linux")return!1;try{return Yg("/etc/alpine-release")}catch{return!1}}async function HE(){if(!cm())return!1;try{return await de("apk"),!0}catch{return!1}}const Ie=ke(HE,{promise:!0});async function WE(){await fe("apk",["update"],{stdio:"inherit"})}const Sn=ke(WE,{promise:!0});async function XE(e){if(!await Ie())throw new Error("apk is not available on this system");try{const t="/etc/apk/repositories";if(!await ye(t))throw new Error(`APK repositories file not found at ${t}`);return J(`Adding repository: ${e}`),await Ap(t,`${e}
|
||
`),await Sn.clear(),await Sn(),J(`Successfully added repository: ${e}`),!0}catch(t){throw new Error(`Failed to add repository ${e}: ${t}`)}}async function lm(){const e=(await KE()).split(".").slice(0,2).join(".");return XE(`https://dl-cdn.alpinelinux.org/alpine/v${e}/community/`)}async function KE(){const e="/etc/alpine-release";if(!await ye(e))throw new Error(`Alpine release file not found at ${e}`);return Qt(e,"utf8")}async function YE(e){try{const{exitCode:t}=await yt("apk",["info","-e",e.name],{reject:!1,stdio:["ignore","pipe","ignore"]});if(t!==0)return!1;if(e.version===void 0||e.version==="")return!0;const{stdout:r}=await yt("apk",["info","-v",e.name],{stdio:["ignore","pipe","ignore"]});return r.trim().split("-").slice(-1)[0]===e.version}catch{return!1}}async function fm(e){return(await Promise.all(e.map(async r=>await YE(r)?void 0:r))).filter(r=>r!==void 0).map(dm)}function dm(e){return e.version!==void 0&&e.version!==""?`${e.name}=${e.version}`:e.name}async function JE(){const e=await fm([{name:"bash"}]);e.length!==0&&me("apk",["add",...e],{...st})}const QE=ke(JE,{promise:!0});async function Fe(e,t=!1){if(!await Ie())throw new Error("apk is not available on this system");try{await QE(),t&&await Sn.clear(),await Sn();const r=await fm(e);return r.length===0?(J("All packages are already installed"),{binDir:"/usr/bin"}):(J(`Installing ${r.join(" ")}`),await yt("apk",["add",...r]),J(`Successfully installed ${r.join(" ")}`),{binDir:"/usr/bin"})}catch(r){throw ve(`Failed to install ${e.map(n=>dm(n)).join(" ")}: ${r}`),r}}const{GITHUB_ACTIONS:ZE}=Et,{appendFile:eS}=oe.promises;async function tS(e,t,r=40){await yt("update-alternatives",["--install",`/usr/bin/${e}`,e,t,r.toString()])}async function _t(e,t,r,n=40){ZE?await tS(e,t,n):(await mu(r),await eS(r.rcPath,`
|
||
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${n}; fi
|
||
`))}var Vo={},Td;function rS(){return Td||(Td=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DownloaderHelper=e.DH_STATES=void 0;var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},r=(function(){function v(g,E){for(var d,w=0;w<E.length;w++)d=E[w],d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(g,d.key,d)}return function(g,E,d){return E&&v(g.prototype,E),d&&v(g,d),g}})(),n=oe,i=S(n),a=We,s=F,l=S(s),c=jr,u=S(c),o=pr,m=S(o),_=mr;function S(v){if(v&&v.__esModule)return v;var g={};if(v!=null)for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(g[E]=v[E]);return g.default=v,g}function R(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function p(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function h(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var y=e.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"};e.DownloaderHelper=(function(v){function g(E,d){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};R(this,g);var f=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,{captureRejections:!0}));return f.__validate(E,d)?(f.url=f.requestURL=E.trim(),f.state=y.IDLE,f.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},f.__opts=Object.assign({},f.__defaultOpts),f.__pipes=[],f.__total=0,f.__downloaded=0,f.__progress=0,f.__retryCount=0,f.__retryTimeout=null,f.__resumeRetryCount=0,f.__states=y,f.__promise=null,f.__request=null,f.__response=null,f.__isAborted=!1,f.__isResumed=!1,f.__isResumable=!1,f.__isRedirected=!1,f.__destFolder=d,f.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},f.__fileName="",f.__filePath="",f.updateOptions(w),f):p(f)}return h(g,v),r(g,[{key:"start",value:function(){var d=this,w=function(){return new Promise(function(f,b){d.__promise={resolve:f,reject:b},d.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(f){var b=f.name,$=f.total,T=d.__opts.override;if(d.__opts.override=!0,d.__filePath=d.__getFilePath(b),d.__opts.override=T,d.__filePath&&i.existsSync(d.__filePath)){var k=d.__getFilesizeInBytes(d.__filePath);return k===$?w():d.resumeFromFile(d.__filePath,{total:$,fileName:b})}return w()}):w()}},{key:"pause",value:function(){var d=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(w){return w.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return d.__setState(d.__states.PAUSED),d.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var d=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var w=function(){return new Promise(function(f,b){i.access(d.__filePath,function($){return $?(d.__emitStop(),f(!0)):void i.unlink(d.__filePath,function(T){return T?(d.__setState(d.__states.FAILED),d.emit("error",T),b(T)):(d.__emitStop(),void f(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return d.__opts.removeOnStop?w():(d.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(d){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:d,options:w}),d}},{key:"unpipe",value:function(){var d=this,w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,f=function($){return d.__response?d.__response.unpipe($):$.unpipe()};if(w){var b=this.__pipes.find(function($){return $.stream===w});return void(b&&(f(w),this.__pipes=this.__pipes.filter(function($){return $.stream!==w})))}this.__pipes.forEach(function($){return f($.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(d){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,d),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=w||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var d=this;return new Promise(function(w,f){var b=function(T){d.__initProtocol(T);var k=Object.assign({},d.__headers);k.hasOwnProperty("range")&&delete k.range;var B=d.__getReqOptions("HEAD",T,k);return Object.assign({},d.__reqOptions,B)},$=function(T,k){var B=d.__protocol.request(k,function(G){if(d.__isRequireRedirect(G)){var P=/^https?:\/\//.test(G.headers.location)?G.headers.location:new a.URL(G.headers.location,T).href;return d.emit("redirected",P,T),$(P,b(P))}return G.statusCode===200?void w({name:d.__getFileNameFromHeaders(G.headers,G),total:parseInt(G.headers["content-length"])||null}):f(new Error("Response status was "+G.statusCode))});B.on("error",function(G){return f(G)}),B.on("timeout",function(){return f(new Error("timeout"))}),B.on("uncaughtException",function(G){return f(G)}),B.end()};$(d.url,b(d.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(d){var w=this,f=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=d,(f.total&&f.fileName?Promise.resolve({name:f.fileName,total:f.total}):this.getTotalSize()).then(function(b){var $=b.name,T=b.total;return w.__total=f.total||T,w.__fileName=f.fileName||$,w.__downloaded=f.downloaded||w.__getFilesizeInBytes(w.__filePath),w.__reqOptions.headers.range="bytes="+w.__downloaded+"-",w.__isResumed=!0,w.__isResumable=!0,w.__setState(w.__states.RESUMED),w.emit("resume",w.__isResumed),new Promise(function(k,B){w.__promise={resolve:k,reject:B},w.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var d=this.__promise.resolve;return this.__promise=null,d(!0)}}},{key:"__downloadRequest",value:function(d,w){var f=this;return this.__protocol.request(this.__reqOptions,function(b){if(f.__response=b,f.__isResumed||(f.__total=parseInt(b.headers["content-length"])||null,f.__resetStats()),f.__isRequireRedirect(b)){var $=/^https?:\/\//.test(b.headers.location)?b.headers.location:new a.URL(b.headers.location,f.url).href;return f.__isRedirected=!0,f.__initProtocol($),f.emit("redirected",$,f.url),f.__start()}if(b.statusCode!==200&&b.statusCode!==206){var T=new Error("Response status was "+b.statusCode);return T.status=b.statusCode||0,T.body=b.body||"",f.__setState(f.__states.FAILED),f.emit("error",T),w(T)}(f.__opts.forceResume||b.headers.hasOwnProperty("accept-ranges")&&b.headers["accept-ranges"]!=="none")&&(f.__isResumable=!0),f.__startDownload(b,d,w)})}},{key:"__startDownload",value:function(d,w,f){var b=this,$=d;if(this.__isResumed)this.__fileStream=i.createWriteStream(this.__filePath,{flags:"a"});else{var T=this.__getFileNameFromHeaders(d.headers);if(this.__filePath=this.__getFilePath(T),this.__fileName=this.__filePath.split(l.sep).pop(),i.existsSync(this.__filePath)){var k=this.__getFilesizeInBytes(this.__filePath),B=this.__total?this.__total:0;if(t(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||k>=B))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:k}),this.__setState(this.__states.SKIPPED),w(!0)}this.__fileStream=i.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,$.on("data",function(G){return b.__calculateStats(G.length)}),this.__pipes.forEach(function(G){$.pipe(G.stream,G.options),$=G.stream}),$.pipe(this.__fileStream),$.on("error",this.__onError(w,f)),this.__fileStream.on("finish",this.__onFinished(w,f)),this.__fileStream.on("error",this.__onError(w,f))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(d){return 300<d.statusCode&&400>d.statusCode&&d.headers.hasOwnProperty("location")&&d.headers.location}},{key:"__onFinished",value:function(d,w){var f=this;return function(){f.__fileStream.close(function(b){if(b)return w(b);if(f.__hasFinished()){var $=!!f.__total&&f.__downloaded!==f.__total;if($&&f.__isResumable&&f.__opts.resumeOnIncomplete&&f.__resumeRetryCount<=f.__opts.resumeOnIncompleteMaxRetry)return f.__resumeRetryCount++,f.emit("warning",new Error("uncomplete download, retrying")),f.resume();f.__setState(f.__states.FINISHED),f.__pipes=[],f.emit("end",{fileName:f.__fileName,filePath:f.__filePath,totalSize:f.__total,incomplete:$,onDiskSize:f.__getFilesizeInBytes(f.__filePath),downloadedSize:f.__downloaded})}return d(f.__downloaded===f.__total)})}}},{key:"__closeFileStream",value:function(){var d=this;return this.__fileStream?new Promise(function(w,f){d.__fileStream.close(function(b){return b?f(b):w(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(d,w){var f=this,b=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function($){return f.__pipes=[],b&&f.__requestAbort(),f.state===f.__states.STOPPED||f.state===f.__states.FAILED?void 0:f.__opts.retry?f.__retry($).catch(function(T){f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("error",T||$),w(T||$)})}):f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("error",$),w($)})}}},{key:"__retry",value:function(){var d=this,w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||t(this.__opts.retry)!=="object")return Promise.reject(w||new Error("wrong retry options"));var f=this.__opts.retry,b=f.delay,$=b===void 0?0:b,T=f.maxRetries,k=T===void 0?999:T;return this.__retryCount>=k?Promise.reject(w||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,w),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(B){return B.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(B){return d.__retryTimeout=setTimeout(function(){return B(0<d.__downloaded?d.resume():d.__start())},$)})}))}},{key:"__onTimeout",value:function(d,w){var f=this;return function(){return f.__requestAbort(),f.__opts.retry?f.__retry(new Error("timeout")).catch(function(b){f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),b?w(b):(f.emit("timeout"),w(new Error("timeout")))})}):f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("timeout"),w(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(d,w){var f="",b=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,$=/.*filename="(.*?)";?/i,T=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,k=d.hasOwnProperty("content-disposition"),B=k?d["content-disposition"].match(b):null,G=!k||B?null:d["content-disposition"].match($),P=!k||B||G?null:d["content-disposition"].match(T);return k&&(B||G||P)?(f=d["content-disposition"],f=f.trim(),B?f=B[1]:G?f=G[1]:P&&(f=P[1]),f=f.replace(/[/\\]/g,"")):0<l.basename(new a.URL(this.requestURL).pathname).length?f=l.basename(new a.URL(this.requestURL).pathname):f=new a.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(f,w):f.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(d){var w=l.join(this.__destFolder,d),f=w;return this.__opts.override||this.state===this.__states.RESUMED||(f=this.__uniqFileNameSync(f),w!==f&&this.emit("renamed",{path:f,fileName:f.split(l.sep).pop(),prevPath:w,prevFileName:w.split(l.sep).pop()})),f}},{key:"__getFileNameFromOpts",value:function(d,w){if(!this.__opts.fileName)return d;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var f=l.join(this.__destFolder,d);return w&&w.headers||this.__response&&this.__response.headers?this.__opts.fileName(d,f,(w||this.__response).headers["content-type"]):this.__opts.fileName(d,f)}if(t(this.__opts.fileName)==="object"){var b=this.__opts.fileName,$=b.name,T=!!b.hasOwnProperty("ext")&&b.ext;if(typeof T=="string")return $+"."+T;if(typeof T=="boolean"){if(T)return $;var k=d.includes(".")?d.split(".").pop():"";return k===""?$:$+"."+k}}return d}},{key:"__calculateStats",value:function(d){var w=new Date,f=w-this.__statsEstimate.time,b=w-this.__statsEstimate.throttleTime,$=this.__total||0;d&&(this.__downloaded+=d,this.__progress=$===0?0:100*(this.__downloaded/$),(this.__downloaded===$||1e3<f)&&(this.__statsEstimate.time=w,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===$||b>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=w,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(d){this.state=d,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(d,w){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},b=new a.URL(w),$={protocol:b.protocol,host:b.hostname,port:b.port,path:b.pathname+b.search,method:d};return f&&($.headers=f),$}},{key:"__getFilesizeInBytes",value:function(d){try{var w=i.statSync(d,{throwIfNoEntry:!1}),f=w.size||0;return f}catch(b){this.emit("warning",b)}return 0}},{key:"__validate",value:function(d,w){if(typeof d!="string")throw new Error("URL should be an string");if(d.trim()==="")throw new Error("URL couldn't be empty");if(typeof w!="string")throw new Error("Destination Folder should be an string");if(w.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!i.existsSync(w))throw new Error("Destination Folder must exist");var f=i.statSync(w);if(!f.isDirectory())throw new Error("Destination Folder must be a directory");try{i.accessSync(w,i.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(d){var w=this.__getReqOptions(this.__opts.method,d,this.__headers);this.requestURL=d,-1<d.indexOf("https://")?(this.__protocol=m,w.agent=new m.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},w,this.__opts.httpsRequestOptions)):(this.__protocol=u,w.agent=new u.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},w,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(d){if(typeof d!="string"||d==="")return d;try{i.accessSync(d,i.F_OK);var w=d.match(/(.*)(\([0-9]+\))(\..*)$/),f=w?w[1].trim():d,b=w?parseInt(w[2].replace(/\(|\)/,"")):0,$=d.split(".").pop();return $!==d&&0<$.length?($="."+$,f=f.replace($,"")):$="",this.__uniqFileNameSync(f+" ("+ ++b+")"+$)}catch{return d}}},{key:"__removeFile",value:function(){var d=this;return new Promise(function(w){return d.__fileStream?void d.__fileStream.close(function(f){return f&&d.emit("warning",f),d.__opts.removeOnFail?i.access(d.__filePath,function(b){return b?w():void i.unlink(d.__filePath,function($){$&&d.emit("warning",f),w()})}):void w()}):w()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),g})(_.EventEmitter)})(Vo)),Vo}var wu=rS();function hm(){return process.platform==="linux"&&de.sync("nala",{nothrow:!0})!==null}function nS(){return process.platform==="linux"&&de.sync("apt-fast",{nothrow:!0})!==null}function _e(){return process.platform==="linux"&&de.sync("apt-get",{nothrow:!0})!==null}function Vr(){if(hm())return"nala";if(nS())return"apt-fast";if(_e())return"apt-get";throw new Error("No apt command found")}function lt(e="apt-get"){const t={...process.env,DEBIAN_FRONTEND:"noninteractive"};return e==="nala"&&(t.LANG===void 0&&(t.LANG="C.UTF-8"),t.LC_ALL===void 0&&(t.LC_ALL="C.UTF-8")),t}function iS(e){return"keyUrl"in e?pm(e):oS(e)}const sS="/etc/apt/trusted.gpg.d",Nd="keyserver.ubuntu.com";async function oS({key:e,keyServer:t=Nd,fileName:r,keyStorePath:n=Nd}){try{_m(r);const i=F.join(n,r);return await ye(i)||(mm(),await yt("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${i}`,"--keyserver",t,"--recv-keys",e]),await yt("chmod",["644",i])),i}catch(i){ve(`Failed to add apt key via server ${t}: ${i}`);return}}async function pm({keyUrl:e,fileName:t,keyStorePath:r=sS}){try{_m(t);const n=F.join(r,t);if(!await ye(n)){mm(),await he([{name:"ca-certificates"}]);const i=F.join(le.tmpdir(),t),a=new wu.DownloaderHelper(e,le.tmpdir(),{fileName:t});a.on("error",s=>{throw new Error(`Failed to download ${e}: ${s}`)}),await a.start(),me("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--import",i]),me("chmod",["644",n])}return n}catch(n){ve(`Failed to add apt key via download ${e}: ${n}`);return}}function mm(){me("gpg",["-k"])}function _m(e){if(!e.endsWith(".gpg"))throw new Error(`Key file name must end with .gpg: ${e}`)}const br="Dpkg::Lock::Timeout=300";async function gu(e){try{const{stdout:t}=await fe("dpkg",["-s",e],{env:lt("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("Status: install ok installed"))}catch{return!1}}async function aS(e){try{const{stdout:t}=await fe("dpkg",["-l",e],{env:lt("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("ii"))}catch{return!1}}let ym=!1;function uS(e=Vr()){me(e,["update","-o",br],{...st,env:lt(e)}),ym=!0}const fr=ke(uS);var Pt;(function(e){e[e.NameDashVersion=0]="NameDashVersion",e[e.NameEqualsVersion=1]="NameEqualsVersion",e[e.Name=2]="Name",e[e.None=3]="None"})(Pt||(Pt={}));async function vm(e,t=Vr()){return(await Promise.all(e.map(r=>Ha(r,t)))).filter(r=>r!==void 0)}async function Ha(e,t=Vr()){const r=await lS(t,e);return await gu(r)?void 0:r}async function wm(e,t,r,n){const i=r!==void 0&&r!=="",a=!i||n;if(i){if(await cS(e,t,r))return Pt.NameDashVersion;if(await Ad(e,`${t}=${r}`))return Pt.NameEqualsVersion}const s=()=>{i&&n&&J(`Could not find package ${t} ${r}. Falling back to latest version.`)};return a&&await Ad(e,t)?(s(),Pt.Name):ym?a?(s(),Pt.Name):Pt.None:(fr(e),wm(e,t,r,n))}async function cS(e,t,r){try{const{stdout:n}=await fe("apt-cache",["search","--names-only",`^${En(t)}-${En(r)}$`],{env:lt(e),stdio:"pipe"});if(n.trim()!=="")return!0}catch{}return!1}async function Ad(e,t){try{const{stdout:r}=await fe("apt-cache",["show",t],{env:lt(e),stdio:"pipe",verbose:!0});if(r.trim()!=="")return!0}catch{}return!1}async function lS(e,t){const{name:r,version:n,fallBackToLatest:i=!1}=t;switch(await wm(e,r,n,i)){case Pt.NameDashVersion:return`${r}-${n}`;case Pt.NameEqualsVersion:return`${r}=${n}`;case Pt.Name:return r;default:throw new Error(`Could not find package '${r}' ${n!=null?n:"with unspecified version"}`)}}async function fS(e){fr(e);const t=await vm([{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}],e);t.length!==0&&me(e,["install","-y","--fix-broken","-o",br,...t],{...st,env:lt(e)})}const gm=ke(fS,{promise:!0});function dS(e="apt-get"){try{const{stdout:t}=me("add-apt-repository",["--help"],{...st,env:lt(e),stdio:"pipe"});return t.includes("--no-update")}catch{return!1}}const Em=ke(dS);async function hS(e,t=Vr()){await gm(t),await Sm();try{me("add-apt-repository",["-y",Em(t)?"--no-update":void 0,e].filter(r=>r!==void 0),{...st,env:lt(t)})}catch{me("add-apt-repository",["-y",e],{...st,env:lt(t)})}fr.clear(),fr(t)}async function Sm(){if(await gu("software-properties-common"))return;const e="apt-get";me(e,["install","-y","--fix-broken","-o",br,"software-properties-common"],{...st,env:lt(e)})}const pS=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];async function he(e,t=!1){try{const r=Vr();for(const{name:i,version:a}of e)J(`Installing ${i} ${a!=null?a:""} via ${r}`);t&&fr.clear(),fr(r),await mS(r,e);const n=await vm(e,r);if(n.length===0)return J("All packages are already installed"),{binDir:"/usr/bin/"};await gm(r);try{await _S(e),me(r,["install","--fix-broken","-y",...n],{...st,env:lt(r)})}catch(i){if(yS(i))pS.some(a=>typeof i.stderr=="string"&&i.stderr.includes(a))&&(ve(`Failed to install packages ${n}. Retrying...`),me(r,["install","--fix-broken","-y","-o",br,...n],{...st,env:lt(r)}));else throw i}return{binDir:"/usr/bin/"}}catch(r){const n=r instanceof Error?`${r.message}
|
||
${r.stack}`:String(r);throw new Error(`Failed to install apt packages: ${n}`)}}async function mS(e,t){const r=[...new Set(t.flatMap(n=>{var i;return(i=n.repository)!=null?i:[]}))];await Promise.all(r.map(n=>hS(n,e)))}async function _S(e){await Promise.all(e.map(async t=>{t.key!==void 0&&await iS(t.key)}))}function yS(e){return typeof e.stderr=="string"}let ur;async function Ld(){if(!_e())return;if(typeof ur=="string")return{binDir:ur};const e=de.sync("apt-fast",{nothrow:!0});return e!==null?(ur=F.dirname(e),{binDir:ur}):(ur="/usr/bin",await vS(),{binDir:ur})}async function vS(){const e=he([{name:"bash"},{name:"wget"}]),t=new wu.DownloaderHelper("https://raw.githubusercontent.com/ilikenwf/apt-fast/c2cd0a0420d3f2d647dc82cf749bfd58c4697dac/quick-install.sh",le.tmpdir(),{fileName:"install-apt-fast.sh"});t.on("error",c=>{throw new Error(`Failed to download install-apt-fast.sh: ${c}`)}),await t.start();const r=F.join(le.tmpdir(),"install-apt-fast.sh");let n=await Qt(r,"utf8");n=n.replace(/sudo/g,"").replace("https://raw.githubusercontent.com/ilikenwf/apt-fast/master","https://raw.githubusercontent.com/Rongronggg9/apt-fast/ac82051792f764220e5e303d4560de0f1952826b"),await qr(r,n),await e;try{me("bash",[r])}catch(c){Le(`Failed to install apt-fast via installer: ${c}`)}const i="/etc/apt-fast.conf";let a=await Qt(i,"utf8");const s=["_APTMGR","DOWNLOADBEFORE"];for(const c of s)a=a.replace(new RegExp(`^#\\s*${c}`,"m"),c);const l=F.join(le.tmpdir(),"apt-fast.conf");await qr(l,a),me("mv",[l,i])}let Dt;async function wS({version:e}={}){if(!_e())return;if(typeof Dt=="string")return{binDir:Dt};const t=de.sync("nala",{nothrow:!0});if(t!==null)return Dt=F.dirname(t),{binDir:Dt};await he([{name:"python3-apt"}]),Dt="/usr/bin";try{const r=await Ha({name:"nala",version:e});if(r!==void 0)return await he([{name:r}]),{binDir:Dt}}catch(r){J(`Failed to install nala: ${r}`)}try{const r=await Ha({name:"nala-legacy"});if(r!==void 0)return await he([{name:r}],!0),{binDir:Dt}}catch(r){J(`Failed to install nala-legacy: ${r}`)}return await gS(),{binDir:Dt}}async function gS(){const e=new wu.DownloaderHelper("https://gitlab.com/volian/volian-archive/-/raw/1939afc3f80638dca2bbedde74bbd86731703cc8/install-nala.sh",le.tmpdir(),{fileName:"install-nala.sh"});e.on("error",n=>{throw new Error(`Failed to download install-nala.sh: ${n}`)}),await e.start();const t=F.join(le.tmpdir(),"install-nala.sh"),r=await Qt(t,"utf8");await qr(t,r.replace(/sudo/g,"")),await he([{name:"wget"}]);try{me("bash",[t])}catch(n){Le(`Failed to install nala via installer: ${n}`),me("apt",["install","-y","-t","nala","nala"])}}var Bo={},xd;function ES(){return xd||(xd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DownloaderHelper=e.DH_STATES=void 0;var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},r=(function(){function v(g,E){for(var d,w=0;w<E.length;w++)d=E[w],d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(g,d.key,d)}return function(g,E,d){return E&&v(g.prototype,E),d&&v(g,d),g}})(),n=oe,i=S(n),a=We,s=F,l=S(s),c=jr,u=S(c),o=pr,m=S(o),_=mr;function S(v){if(v&&v.__esModule)return v;var g={};if(v!=null)for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(g[E]=v[E]);return g.default=v,g}function R(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function p(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function h(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var y=e.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"};e.DownloaderHelper=(function(v){function g(E,d){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};R(this,g);var f=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,{captureRejections:!0}));return f.__validate(E,d)?(f.url=f.requestURL=E.trim(),f.state=y.IDLE,f.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},f.__opts=Object.assign({},f.__defaultOpts),f.__pipes=[],f.__total=0,f.__downloaded=0,f.__progress=0,f.__retryCount=0,f.__retryTimeout=null,f.__resumeRetryCount=0,f.__states=y,f.__promise=null,f.__request=null,f.__response=null,f.__isAborted=!1,f.__isResumed=!1,f.__isResumable=!1,f.__isRedirected=!1,f.__destFolder=d,f.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},f.__fileName="",f.__filePath="",f.updateOptions(w),f):p(f)}return h(g,v),r(g,[{key:"start",value:function(){var d=this,w=function(){return new Promise(function(f,b){d.__promise={resolve:f,reject:b},d.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(f){var b=f.name,$=f.total,T=d.__opts.override;if(d.__opts.override=!0,d.__filePath=d.__getFilePath(b),d.__opts.override=T,d.__filePath&&i.existsSync(d.__filePath)){var k=d.__getFilesizeInBytes(d.__filePath);return k===$?w():d.resumeFromFile(d.__filePath,{total:$,fileName:b})}return w()}):w()}},{key:"pause",value:function(){var d=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(w){return w.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return d.__setState(d.__states.PAUSED),d.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var d=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var w=function(){return new Promise(function(f,b){i.access(d.__filePath,function($){return $?(d.__emitStop(),f(!0)):void i.unlink(d.__filePath,function(T){return T?(d.__setState(d.__states.FAILED),d.emit("error",T),b(T)):(d.__emitStop(),void f(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return d.__opts.removeOnStop?w():(d.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(d){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:d,options:w}),d}},{key:"unpipe",value:function(){var d=this,w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,f=function($){return d.__response?d.__response.unpipe($):$.unpipe()};if(w){var b=this.__pipes.find(function($){return $.stream===w});return void(b&&(f(w),this.__pipes=this.__pipes.filter(function($){return $.stream!==w})))}this.__pipes.forEach(function($){return f($.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(d){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,d),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=w||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var d=this;return new Promise(function(w,f){var b=function(T){d.__initProtocol(T);var k=Object.assign({},d.__headers);k.hasOwnProperty("range")&&delete k.range;var B=d.__getReqOptions("HEAD",T,k);return Object.assign({},d.__reqOptions,B)},$=function(T,k){var B=d.__protocol.request(k,function(G){if(d.__isRequireRedirect(G)){var P=/^https?:\/\//.test(G.headers.location)?G.headers.location:new a.URL(G.headers.location,T).href;return d.emit("redirected",P,T),$(P,b(P))}return G.statusCode===200?void w({name:d.__getFileNameFromHeaders(G.headers,G),total:parseInt(G.headers["content-length"])||null}):f(new Error("Response status was "+G.statusCode))});B.on("error",function(G){return f(G)}),B.on("timeout",function(){return f(new Error("timeout"))}),B.on("uncaughtException",function(G){return f(G)}),B.end()};$(d.url,b(d.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(d){var w=this,f=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=d,(f.total&&f.fileName?Promise.resolve({name:f.fileName,total:f.total}):this.getTotalSize()).then(function(b){var $=b.name,T=b.total;return w.__total=f.total||T,w.__fileName=f.fileName||$,w.__downloaded=f.downloaded||w.__getFilesizeInBytes(w.__filePath),w.__reqOptions.headers.range="bytes="+w.__downloaded+"-",w.__isResumed=!0,w.__isResumable=!0,w.__setState(w.__states.RESUMED),w.emit("resume",w.__isResumed),new Promise(function(k,B){w.__promise={resolve:k,reject:B},w.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var d=this.__promise.resolve;return this.__promise=null,d(!0)}}},{key:"__downloadRequest",value:function(d,w){var f=this;return this.__protocol.request(this.__reqOptions,function(b){if(f.__response=b,f.__isResumed||(f.__total=parseInt(b.headers["content-length"])||null,f.__resetStats()),f.__isRequireRedirect(b)){var $=/^https?:\/\//.test(b.headers.location)?b.headers.location:new a.URL(b.headers.location,f.url).href;return f.__isRedirected=!0,f.__initProtocol($),f.emit("redirected",$,f.url),f.__start()}if(b.statusCode!==200&&b.statusCode!==206){var T=new Error("Response status was "+b.statusCode);return T.status=b.statusCode||0,T.body=b.body||"",f.__setState(f.__states.FAILED),f.emit("error",T),w(T)}(f.__opts.forceResume||b.headers.hasOwnProperty("accept-ranges")&&b.headers["accept-ranges"]!=="none")&&(f.__isResumable=!0),f.__startDownload(b,d,w)})}},{key:"__startDownload",value:function(d,w,f){var b=this,$=d;if(this.__isResumed)this.__fileStream=i.createWriteStream(this.__filePath,{flags:"a"});else{var T=this.__getFileNameFromHeaders(d.headers);if(this.__filePath=this.__getFilePath(T),this.__fileName=this.__filePath.split(l.sep).pop(),i.existsSync(this.__filePath)){var k=this.__getFilesizeInBytes(this.__filePath),B=this.__total?this.__total:0;if(t(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||k>=B))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:k}),this.__setState(this.__states.SKIPPED),w(!0)}this.__fileStream=i.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,$.on("data",function(G){return b.__calculateStats(G.length)}),this.__pipes.forEach(function(G){$.pipe(G.stream,G.options),$=G.stream}),$.pipe(this.__fileStream),$.on("error",this.__onError(w,f)),this.__fileStream.on("finish",this.__onFinished(w,f)),this.__fileStream.on("error",this.__onError(w,f))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(d){return 300<d.statusCode&&400>d.statusCode&&d.headers.hasOwnProperty("location")&&d.headers.location}},{key:"__onFinished",value:function(d,w){var f=this;return function(){f.__fileStream.close(function(b){if(b)return w(b);if(f.__hasFinished()){var $=!!f.__total&&f.__downloaded!==f.__total;if($&&f.__isResumable&&f.__opts.resumeOnIncomplete&&f.__resumeRetryCount<=f.__opts.resumeOnIncompleteMaxRetry)return f.__resumeRetryCount++,f.emit("warning",new Error("uncomplete download, retrying")),f.resume();f.__setState(f.__states.FINISHED),f.__pipes=[],f.emit("end",{fileName:f.__fileName,filePath:f.__filePath,totalSize:f.__total,incomplete:$,onDiskSize:f.__getFilesizeInBytes(f.__filePath),downloadedSize:f.__downloaded})}return d(f.__downloaded===f.__total)})}}},{key:"__closeFileStream",value:function(){var d=this;return this.__fileStream?new Promise(function(w,f){d.__fileStream.close(function(b){return b?f(b):w(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(d,w){var f=this,b=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function($){return f.__pipes=[],b&&f.__requestAbort(),f.state===f.__states.STOPPED||f.state===f.__states.FAILED?void 0:f.__opts.retry?f.__retry($).catch(function(T){f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("error",T||$),w(T||$)})}):f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("error",$),w($)})}}},{key:"__retry",value:function(){var d=this,w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||t(this.__opts.retry)!=="object")return Promise.reject(w||new Error("wrong retry options"));var f=this.__opts.retry,b=f.delay,$=b===void 0?0:b,T=f.maxRetries,k=T===void 0?999:T;return this.__retryCount>=k?Promise.reject(w||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,w),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(B){return B.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(B){return d.__retryTimeout=setTimeout(function(){return B(0<d.__downloaded?d.resume():d.__start())},$)})}))}},{key:"__onTimeout",value:function(d,w){var f=this;return function(){return f.__requestAbort(),f.__opts.retry?f.__retry(new Error("timeout")).catch(function(b){f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),b?w(b):(f.emit("timeout"),w(new Error("timeout")))})}):f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("timeout"),w(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(d,w){var f="",b=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,$=/.*filename="(.*?)";?/i,T=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,k=d.hasOwnProperty("content-disposition"),B=k?d["content-disposition"].match(b):null,G=!k||B?null:d["content-disposition"].match($),P=!k||B||G?null:d["content-disposition"].match(T);return k&&(B||G||P)?(f=d["content-disposition"],f=f.trim(),B?f=B[1]:G?f=G[1]:P&&(f=P[1]),f=f.replace(/[/\\]/g,"")):0<l.basename(new a.URL(this.requestURL).pathname).length?f=l.basename(new a.URL(this.requestURL).pathname):f=new a.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(f,w):f.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(d){var w=l.join(this.__destFolder,d),f=w;return this.__opts.override||this.state===this.__states.RESUMED||(f=this.__uniqFileNameSync(f),w!==f&&this.emit("renamed",{path:f,fileName:f.split(l.sep).pop(),prevPath:w,prevFileName:w.split(l.sep).pop()})),f}},{key:"__getFileNameFromOpts",value:function(d,w){if(!this.__opts.fileName)return d;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var f=l.join(this.__destFolder,d);return w&&w.headers||this.__response&&this.__response.headers?this.__opts.fileName(d,f,(w||this.__response).headers["content-type"]):this.__opts.fileName(d,f)}if(t(this.__opts.fileName)==="object"){var b=this.__opts.fileName,$=b.name,T=!!b.hasOwnProperty("ext")&&b.ext;if(typeof T=="string")return $+"."+T;if(typeof T=="boolean"){if(T)return $;var k=d.includes(".")?d.split(".").pop():"";return k===""?$:$+"."+k}}return d}},{key:"__calculateStats",value:function(d){var w=new Date,f=w-this.__statsEstimate.time,b=w-this.__statsEstimate.throttleTime,$=this.__total||0;d&&(this.__downloaded+=d,this.__progress=$===0?0:100*(this.__downloaded/$),(this.__downloaded===$||1e3<f)&&(this.__statsEstimate.time=w,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===$||b>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=w,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(d){this.state=d,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(d,w){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},b=new a.URL(w),$={protocol:b.protocol,host:b.hostname,port:b.port,path:b.pathname+b.search,method:d};return f&&($.headers=f),$}},{key:"__getFilesizeInBytes",value:function(d){try{var w=i.statSync(d,{throwIfNoEntry:!1}),f=w.size||0;return f}catch(b){this.emit("warning",b)}return 0}},{key:"__validate",value:function(d,w){if(typeof d!="string")throw new Error("URL should be an string");if(d.trim()==="")throw new Error("URL couldn't be empty");if(typeof w!="string")throw new Error("Destination Folder should be an string");if(w.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!i.existsSync(w))throw new Error("Destination Folder must exist");var f=i.statSync(w);if(!f.isDirectory())throw new Error("Destination Folder must be a directory");try{i.accessSync(w,i.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(d){var w=this.__getReqOptions(this.__opts.method,d,this.__headers);this.requestURL=d,-1<d.indexOf("https://")?(this.__protocol=m,w.agent=new m.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},w,this.__opts.httpsRequestOptions)):(this.__protocol=u,w.agent=new u.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},w,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(d){if(typeof d!="string"||d==="")return d;try{i.accessSync(d,i.F_OK);var w=d.match(/(.*)(\([0-9]+\))(\..*)$/),f=w?w[1].trim():d,b=w?parseInt(w[2].replace(/\(|\)/,"")):0,$=d.split(".").pop();return $!==d&&0<$.length?($="."+$,f=f.replace($,"")):$="",this.__uniqFileNameSync(f+" ("+ ++b+")"+$)}catch{return d}}},{key:"__removeFile",value:function(){var d=this;return new Promise(function(w){return d.__fileStream?void d.__fileStream.close(function(f){return f&&d.emit("warning",f),d.__opts.removeOnFail?i.access(d.__filePath,function(b){return b?w():void i.unlink(d.__filePath,function($){$&&d.emit("warning",f),w()})}):void w()}):w()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),g})(_.EventEmitter)})(Bo)),Bo}var SS=ES();let Kt;async function Eu(e={}){if(!["darwin","linux"].includes(process.platform)||process.platform==="linux"&&process.arch!=="x64"){ve(`Brew is not supported on ${process.platform} ${process.arch}`);return}if(typeof Kt=="string")return{binDir:Kt};const t=await de("brew",{nothrow:!0});if(t!==null)return Kt=F.dirname(t),{binDir:Kt};await he([{name:"ca-certificates"}]);const r=new SS.DownloaderHelper("https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh",le.tmpdir(),{fileName:"install-brew.sh"});return r.on("error",n=>{throw new Error(`Failed to download the brew installer script: ${n}`)}),await r.start(),ze("/bin/bash",[r.getDownloadPath()],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),Kt=Su(),await Oe(Kt,e.rcOptions),{binDir:Kt}}function Su(){return F.join(Ru(),"bin")}function Rm(){return F.join(Su(),"brew")}function Ru(){if(process.platform==="darwin")return process.arch==="arm64"?"/opt/homebrew":"/usr/local";if(process.platform==="linux")return"/home/linuxbrew/.linuxbrew";throw new Error("Unsupported platform for brew")}function bm(e,t){return t!==void 0&&t!==""?`${e}@${t}`:e}async function RS(e,t){const r=bm(e,t),n=await Cd(r);if(n!==void 0)return n;const i=await Cd(e);return i!==void 0?i:bS(e,r)}async function Cd(e){try{const t=Rm();return(await fe(t,["--prefix",e],{stdio:"pipe"})).stdout}catch{return}}function bS(e,t){const r=Ru(),n=F.join(r,"opt",t);if(oe.existsSync(n))return n;const i=F.join(r,"opt",e);if(oe.existsSync(i))return i;const a=F.join(r,"Cellar",t);if(oe.existsSync(a))return a;const s=F.join(r,"Cellar",e);if(oe.existsSync(s))return s;const l=F.join(r,"lib",t);if(oe.existsSync(l))return l;const c=F.join(r,"lib",e);if(oe.existsSync(c))return c}let Dd=!1;async function Me(e,t,r={}){"overwrite"in r||(r.overwrite=!0),r.cask===!0&&(r.overwrite=!1),J(`Installing ${e} ${t!=null?t:""} via brew`),(!Dd||de.sync("brew",{nothrow:!0})===null)&&(await Eu(),Dd=!0);const n=Rm(),i=["install",bm(e,t)];for(const[c,u]of Object.entries(r))typeof u=="boolean"&&u?i.push(`--${c}`):typeof u=="string"&&i.push(`--${c}`,u);const a=ze(n,[...i,"--dry-run"],{stdio:"pipe"});a.exitCode===0&&new RegExp(`.*${e}.* is already installed and up-to-date.[\\s\\S]*`).test(a.stderr)?J(`${e} ${t!=null?t:""} is already installed and up-to-date`):ze(n,i,{stdio:"inherit"});const l=await RS(e,t);return l===void 0?(ve(`Failed to find installation directory for ${e} ${t}`),{binDir:Su(),installDir:void 0}):{installDir:l,binDir:F.join(l,"bin")}}var Mn=ou();const ne={rcPath:nt("~/.cpprc"),guard:"cpp"};async function $m(){if(process.platform==="darwin")try{const e=await Mn.getExecOutput("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?await Pe("SDKROOT",t.trim(),ne):Le("SDKROOT not set")}catch(e){Le(e)}}let zo;function Ce(){return process.platform!=="linux"?!1:(zo===void 0&&(zo=de.sync("dnf",{nothrow:!0})!==null),zo)}let Ho;function Te(){return process.platform!=="linux"?!1:(Ho===void 0&&(Ho=de.sync("pacman",{nothrow:!0})!==null),Ho)}async function xe(e){for(const{name:r,version:n}of e)J(`Installing ${r} ${n!=null?n:""} via dnf`);const t=await Promise.all(e.map(r=>$S(r.name,r.version)));return me("dnf",["-y","install",...t]),{binDir:"/usr/bin/"}}async function $S(e,t){if(t===void 0||t==="")return e;const{stdout:r}=await fe("dnf",["search","-q",`${e}-${t}`]);if(r.trim()!=="")return`${e}-${t}`;const{stdout:n}=await fe("dnf",["search","-q",`${e}${t}`]);return n.trim()!==""?`${e}${t}`:(ve(`Failed to install ${e} ${t} via dnf, trying without version`),e)}let Fd=!1,qd=!1;async function Re(e,t,r){J(`Installing ${e} ${t!=null?t:""} via pacman`);const n="pacman";r==="yay"&&PS(),!Fd&&r!=="yay"&&(me(n,["-Sy","--noconfirm"]),Fd=!0),!qd&&r!=="yay"&&(me(n,["-S","--noconfirm","base-devel"]),qd=!0);const i=a=>r==="yay"?wr()&&Om?me("su",["-","builder","-c",`yay -S --noconfirm ${a}`]):ze(r,["-S","--noconfirm",a]):me(r!=null?r:n,["-S","--noconfirm",a]);if(t!==void 0&&t!=="")if((await IS(n,e)).includes(t))try{i(`${e}=${t}`)}catch{i(`${e}${t}`)}else J(`Failed to install ${e} ${t} via pacman, trying without version`),i(e);else i(e);return{binDir:"/usr/bin/"}}const OS=/Version\s*:\s*(.*)/g;async function IS(e,t){const r=[];try{const{stdout:n}=await fe(e,["-Si",t]);for(const i of n.matchAll(OS))r.push(i[1])}catch(n){ve(`Failed to get available versions for ${t}: ${n}`)}return r}let Om=!1;function PS(){if(de.sync("yay",{nothrow:!0})===null)try{me("pacman",["-S","--noconfirm","base-devel","git"]);const e=F.join(le.tmpdir(),"yay");me("mkdir",["-p",e]),wr()?(ve("Creating a non-root user to build yay"),me("useradd",["-m","-G","wheel","builder"]),me("passwd",["-d","builder"]),me("chown",["-R","builder:builder",e]),me("bash",["-c",'echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers']),Om=!0,ze("su",["-","builder","-c",`git clone https://aur.archlinux.org/yay.git ${e}`],{stdio:"inherit"}),ze("su",["-","builder","-c",`cd ${e} && makepkg -si --noconfirm`],{stdio:"inherit"})):(ze("git",["clone","https://aur.archlinux.org/yay.git",e],{stdio:"inherit",cwd:le.tmpdir()}),ze("makepkg",["-si","--noconfirm"],{stdio:"inherit",cwd:e})),ze("rm",["-rf",e],{stdio:"inherit"})}catch(e){throw new Error(`Failed to install yay: ${e}. Install yay manually and re-run the script.`)}}var Wo,kd;function TS(){if(kd)return Wo;kd=1;const e=Rr(),t=Jp(),{safeRe:r,t:n}=jn();return Wo=(a,s)=>{if(a instanceof e)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;s=s||{};let l=null;if(!s.rtl)l=a.match(s.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const S=s.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let R;for(;(R=S.exec(a))&&(!l||l.index+l[0].length!==a.length);)(!l||R.index+R[0].length!==l.index+l[0].length)&&(l=R),S.lastIndex=R.index+R[1].length+R[2].length;S.lastIndex=-1}if(l===null)return null;const c=l[2],u=l[3]||"0",o=l[4]||"0",m=s.includePrerelease&&l[5]?`-${l[5]}`:"",_=s.includePrerelease&&l[6]?`+${l[6]}`:"";return t(`${c}.${u}.${o}${m}${_}`,s)},Wo}var NS=TS();const dr=$e(NS);var Xo,jd;function ir(){if(jd)return Xo;jd=1;const e=Rr();return Xo=(r,n,i)=>new e(r,i).compare(new e(n,i)),Xo}var AS=ir();const LS=$e(AS);var Ko,Ud;function xS(){if(Ud)return Ko;Ud=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(r,n)}return this}}return Ko=e,Ko}var Yo,Md;function CS(){if(Md)return Yo;Md=1;const e=ir();return Yo=(r,n,i)=>e(r,n,i)===0,Yo}var Jo,Gd;function DS(){if(Gd)return Jo;Gd=1;const e=ir();return Jo=(r,n,i)=>e(r,n,i)!==0,Jo}var Qo,Vd;function FS(){if(Vd)return Qo;Vd=1;const e=ir();return Qo=(r,n,i)=>e(r,n,i)>0,Qo}var Zo,Bd;function qS(){if(Bd)return Zo;Bd=1;const e=ir();return Zo=(r,n,i)=>e(r,n,i)>=0,Zo}var ea,zd;function kS(){if(zd)return ea;zd=1;const e=ir();return ea=(r,n,i)=>e(r,n,i)<0,ea}var ta,Hd;function Im(){if(Hd)return ta;Hd=1;const e=ir();return ta=(r,n,i)=>e(r,n,i)<=0,ta}var ra,Wd;function jS(){if(Wd)return ra;Wd=1;const e=CS(),t=DS(),r=FS(),n=qS(),i=kS(),a=Im();return ra=(l,c,u,o)=>{switch(c){case"===":return typeof l=="object"&&(l=l.version),typeof u=="object"&&(u=u.version),l===u;case"!==":return typeof l=="object"&&(l=l.version),typeof u=="object"&&(u=u.version),l!==u;case"":case"=":case"==":return e(l,u,o);case"!=":return t(l,u,o);case">":return r(l,u,o);case">=":return n(l,u,o);case"<":return i(l,u,o);case"<=":return a(l,u,o);default:throw new TypeError(`Invalid operator: ${c}`)}},ra}var na,Xd;function US(){if(Xd)return na;Xd=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(o,m){if(m=r(m),o instanceof t){if(o.loose===!!m.loose)return o;o=o.value}o=o.trim().split(/\s+/).join(" "),s("comparator",o,m),this.options=m,this.loose=!!m.loose,this.parse(o),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(o){const m=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=o.match(m);if(!_)throw new TypeError(`Invalid comparator: ${o}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new l(_[2],this.options.loose):this.semver=e}toString(){return this.value}test(o){if(s("Comparator.test",o,this.options.loose),this.semver===e||o===e)return!0;if(typeof o=="string")try{o=new l(o,this.options)}catch{return!1}return a(o,this.operator,this.semver,this.options)}intersects(o,m){if(!(o instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(o.value,m).test(this.value):o.operator===""?o.value===""?!0:new c(this.value,m).test(o.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||o.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||o.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&o.operator.startsWith(">")||this.operator.startsWith("<")&&o.operator.startsWith("<")||this.semver.version===o.semver.version&&this.operator.includes("=")&&o.operator.includes("=")||a(this.semver,"<",o.semver,m)&&this.operator.startsWith(">")&&o.operator.startsWith("<")||a(this.semver,">",o.semver,m)&&this.operator.startsWith("<")&&o.operator.startsWith(">")))}}na=t;const r=vu(),{safeRe:n,t:i}=jn(),a=jS(),s=kn(),l=Rr(),c=Pm();return na}var ia,Kd;function Pm(){if(Kd)return ia;Kd=1;const e=/\s+/g;class t{constructor(I,A){if(A=i(A),I instanceof t)return I.loose===!!A.loose&&I.includePrerelease===!!A.includePrerelease?I:new t(I.raw,A);if(I instanceof a)return this.raw=I.value,this.set=[[I]],this.formatted=void 0,this;if(this.options=A,this.loose=!!A.loose,this.includePrerelease=!!A.includePrerelease,this.raw=I.trim().replace(e," "),this.set=this.raw.split("||").map(D=>this.parseRange(D.trim())).filter(D=>D.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const D=this.set[0];if(this.set=this.set.filter(C=>!p(C[0])),this.set.length===0)this.set=[D];else if(this.set.length>1){for(const C of this.set)if(C.length===1&&h(C[0])){this.set=[C];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let I=0;I<this.set.length;I++){I>0&&(this.formatted+="||");const A=this.set[I];for(let D=0;D<A.length;D++)D>0&&(this.formatted+=" "),this.formatted+=A[D].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(I){const D=((this.options.includePrerelease&&S)|(this.options.loose&&R))+":"+I,C=n.get(D);if(C)return C;const q=this.options.loose,x=q?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];I=I.replace(x,B(this.options.includePrerelease)),s("hyphen replace",I),I=I.replace(c[u.COMPARATORTRIM],o),s("comparator trim",I),I=I.replace(c[u.TILDETRIM],m),s("tilde trim",I),I=I.replace(c[u.CARETTRIM],_),s("caret trim",I);let z=I.split(" ").map(X=>v(X,this.options)).join(" ").split(/\s+/).map(X=>k(X,this.options));q&&(z=z.filter(X=>(s("loose invalid filter",X,this.options),!!X.match(c[u.COMPARATORLOOSE])))),s("range list",z);const V=new Map,Q=z.map(X=>new a(X,this.options));for(const X of Q){if(p(X))return[X];V.set(X.value,X)}V.size>1&&V.has("")&&V.delete("");const se=[...V.values()];return n.set(D,se),se}intersects(I,A){if(!(I instanceof t))throw new TypeError("a Range is required");return this.set.some(D=>y(D,A)&&I.set.some(C=>y(C,A)&&D.every(q=>C.every(x=>q.intersects(x,A)))))}test(I){if(!I)return!1;if(typeof I=="string")try{I=new l(I,this.options)}catch{return!1}for(let A=0;A<this.set.length;A++)if(G(this.set[A],I,this.options))return!0;return!1}}ia=t;const r=xS(),n=new r,i=vu(),a=US(),s=kn(),l=Rr(),{safeRe:c,t:u,comparatorTrimReplace:o,tildeTrimReplace:m,caretTrimReplace:_}=jn(),{FLAG_INCLUDE_PRERELEASE:S,FLAG_LOOSE:R}=yu(),p=P=>P.value==="<0.0.0-0",h=P=>P.value==="",y=(P,I)=>{let A=!0;const D=P.slice();let C=D.pop();for(;A&&D.length;)A=D.every(q=>C.intersects(q,I)),C=D.pop();return A},v=(P,I)=>(P=P.replace(c[u.BUILD],""),s("comp",P,I),P=w(P,I),s("caret",P),P=E(P,I),s("tildes",P),P=b(P,I),s("xrange",P),P=T(P,I),s("stars",P),P),g=P=>!P||P.toLowerCase()==="x"||P==="*",E=(P,I)=>P.trim().split(/\s+/).map(A=>d(A,I)).join(" "),d=(P,I)=>{const A=I.loose?c[u.TILDELOOSE]:c[u.TILDE];return P.replace(A,(D,C,q,x,z)=>{s("tilde",P,D,C,q,x,z);let V;return g(C)?V="":g(q)?V=`>=${C}.0.0 <${+C+1}.0.0-0`:g(x)?V=`>=${C}.${q}.0 <${C}.${+q+1}.0-0`:z?(s("replaceTilde pr",z),V=`>=${C}.${q}.${x}-${z} <${C}.${+q+1}.0-0`):V=`>=${C}.${q}.${x} <${C}.${+q+1}.0-0`,s("tilde return",V),V})},w=(P,I)=>P.trim().split(/\s+/).map(A=>f(A,I)).join(" "),f=(P,I)=>{s("caret",P,I);const A=I.loose?c[u.CARETLOOSE]:c[u.CARET],D=I.includePrerelease?"-0":"";return P.replace(A,(C,q,x,z,V)=>{s("caret",P,C,q,x,z,V);let Q;return g(q)?Q="":g(x)?Q=`>=${q}.0.0${D} <${+q+1}.0.0-0`:g(z)?q==="0"?Q=`>=${q}.${x}.0${D} <${q}.${+x+1}.0-0`:Q=`>=${q}.${x}.0${D} <${+q+1}.0.0-0`:V?(s("replaceCaret pr",V),q==="0"?x==="0"?Q=`>=${q}.${x}.${z}-${V} <${q}.${x}.${+z+1}-0`:Q=`>=${q}.${x}.${z}-${V} <${q}.${+x+1}.0-0`:Q=`>=${q}.${x}.${z}-${V} <${+q+1}.0.0-0`):(s("no pr"),q==="0"?x==="0"?Q=`>=${q}.${x}.${z}${D} <${q}.${x}.${+z+1}-0`:Q=`>=${q}.${x}.${z}${D} <${q}.${+x+1}.0-0`:Q=`>=${q}.${x}.${z} <${+q+1}.0.0-0`),s("caret return",Q),Q})},b=(P,I)=>(s("replaceXRanges",P,I),P.split(/\s+/).map(A=>$(A,I)).join(" ")),$=(P,I)=>{P=P.trim();const A=I.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return P.replace(A,(D,C,q,x,z,V)=>{s("xRange",P,D,C,q,x,z,V);const Q=g(q),se=Q||g(x),X=se||g(z),ie=X;return C==="="&&ie&&(C=""),V=I.includePrerelease?"-0":"",Q?C===">"||C==="<"?D="<0.0.0-0":D="*":C&&ie?(se&&(x=0),z=0,C===">"?(C=">=",se?(q=+q+1,x=0,z=0):(x=+x+1,z=0)):C==="<="&&(C="<",se?q=+q+1:x=+x+1),C==="<"&&(V="-0"),D=`${C+q}.${x}.${z}${V}`):se?D=`>=${q}.0.0${V} <${+q+1}.0.0-0`:X&&(D=`>=${q}.${x}.0${V} <${q}.${+x+1}.0-0`),s("xRange return",D),D})},T=(P,I)=>(s("replaceStars",P,I),P.trim().replace(c[u.STAR],"")),k=(P,I)=>(s("replaceGTE0",P,I),P.trim().replace(c[I.includePrerelease?u.GTE0PRE:u.GTE0],"")),B=P=>(I,A,D,C,q,x,z,V,Q,se,X,ie)=>(g(D)?A="":g(C)?A=`>=${D}.0.0${P?"-0":""}`:g(q)?A=`>=${D}.${C}.0${P?"-0":""}`:x?A=`>=${A}`:A=`>=${A}${P?"-0":""}`,g(Q)?V="":g(se)?V=`<${+Q+1}.0.0-0`:g(X)?V=`<${Q}.${+se+1}.0-0`:ie?V=`<=${Q}.${se}.${X}-${ie}`:P?V=`<${Q}.${se}.${+X+1}-0`:V=`<=${V}`,`${A} ${V}`.trim()),G=(P,I,A)=>{for(let D=0;D<P.length;D++)if(!P[D].test(I))return!1;if(I.prerelease.length&&!A.includePrerelease){for(let D=0;D<P.length;D++)if(s(P[D].semver),P[D].semver!==a.ANY&&P[D].semver.prerelease.length>0){const C=P[D].semver;if(C.major===I.major&&C.minor===I.minor&&C.patch===I.patch)return!0}return!1}return!0};return ia}var sa,Yd;function MS(){if(Yd)return sa;Yd=1;const e=Pm();return sa=(r,n,i)=>{try{n=new e(n,i)}catch{return!1}return n.test(r)},sa}var GS=MS();const bu=$e(GS),Tm=/v?(\d\S*)/;async function Nm(e,t=Tm){var r,n;try{const i=await Mn.getExecOutput(e,["--version"]),s=(r=(i.stdout||i.stderr||"").trim().match(t))==null?void 0:r[1];return(n=dr(s))!=null?n:void 0}catch(i){console.error(i);return}}async function Wa(e,t,r=Tm){const n=await Nm(e,r);if(n!==void 0&&t!=="")try{return LS(n,t)!==-1}catch{return bu(n,t)}else return!1}function $u(e){if(Un(e)===null)try{const t=dr(e);if(t!==null)return J(`Coerced version '${e}' to '${t}'`),t.version}catch{}return e}function VS(e){if(Un(e)===null)try{const t=dr(e);if(t!==null){const r=/^[<=>^~]/.test(t.version)?t.version:`^${t.version}`;return J(`Coerced version '${e}' to '${r}'`),r}}catch{}return e}function BS(e){return Number.parseInt(e.replace(/^v/,""),10)}function zS(e){return e.match(/^v/)?e:`v${e}`}function HS(e,t){const r=dr(e),n=dr(t);return r!==null&&n!==null?n.compare(r):t.localeCompare(e)}async function Am(){const e=F.join(FR,"gcc_matcher.json");if(!await ye(e))return ve("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");J(`::add-matcher::${e}`)}async function Rn(e){const t=await Qt(e,"utf-8");return JSON.parse(t)}function bn(e,t){var l;const r=Object.keys(e),n=new Map;if(t.filterMapTag===void 0)for(const c of r)n.set(c,c);else for(const c of r){const u=t.filterMapTag(c);u!==void 0&&n.set(u,c)}if(n.size===0)return;const i=(l=t.versionSatisfies)!=null?l:bu,a=VS(t.version),s=[];for(const[c,u]of n.entries())i(c,a)&&s.push(u);if(s.length!==0)for(const c of s){let u=e[c];if(u===void 0||(t.filterName!==void 0&&(u=u.filter(t.filterName)),u.length===0))continue;const o=WS(c,u,t);if(o!==void 0)return o}}function WS(e,t,r){if((r.keywords===void 0||r.keywords.length===0)&&(r.optionalKeywords===void 0||r.optionalKeywords.length===0))return{tag:e,name:t[0]};let n=[];if(r.keywords!==void 0&&r.keywords.length!==0)for(const i of t)r.keywords.every(a=>typeof a=="string"&&i.includes(a)?!0:Array.isArray(a)&&a.some(s=>i.includes(s)))&&n.push(i);else n=t;if(n.length!==0){if(r.optionalKeywords!==void 0&&r.optionalKeywords.length!==0){const i=n.map(l=>{let c=0;for(const u of r.optionalKeywords)(typeof u=="string"&&l.includes(u)||Array.isArray(u)&&u.some(o=>l.includes(o)))&&c++;return c}),a=Math.max(...i),s=i.indexOf(a);return{tag:e,name:n[s]}}return{tag:e,name:n[0]}}}var oa={},rn={},Jd;function Ue(){return Jd||(Jd=1,rn.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,n)=>{t.push((i,a)=>i!=null?n(i):r(a)),e.apply(this,t)})},"name",{value:e.name})},rn.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(n=>r(null,n),r)},"name",{value:e.name})}),rn}var aa,Qd;function XS(){if(Qd)return aa;Qd=1;var e=T_,t=process.cwd,r=null,n=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=t.call(process)),r};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var i=process.chdir;process.chdir=function(s){r=null,i.call(process,s)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}aa=a;function a(s){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&l(s),s.lutimes||c(s),s.chown=m(s.chown),s.fchown=m(s.fchown),s.lchown=m(s.lchown),s.chmod=u(s.chmod),s.fchmod=u(s.fchmod),s.lchmod=u(s.lchmod),s.chownSync=_(s.chownSync),s.fchownSync=_(s.fchownSync),s.lchownSync=_(s.lchownSync),s.chmodSync=o(s.chmodSync),s.fchmodSync=o(s.fchmodSync),s.lchmodSync=o(s.lchmodSync),s.stat=S(s.stat),s.fstat=S(s.fstat),s.lstat=S(s.lstat),s.statSync=R(s.statSync),s.fstatSync=R(s.fstatSync),s.lstatSync=R(s.lstatSync),s.chmod&&!s.lchmod&&(s.lchmod=function(h,y,v){v&&process.nextTick(v)},s.lchmodSync=function(){}),s.chown&&!s.lchown&&(s.lchown=function(h,y,v,g){g&&process.nextTick(g)},s.lchownSync=function(){}),n==="win32"&&(s.rename=typeof s.rename!="function"?s.rename:(function(h){function y(v,g,E){var d=Date.now(),w=0;h(v,g,function f(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-d<6e4){setTimeout(function(){s.stat(g,function($,T){$&&$.code==="ENOENT"?h(v,g,f):E(b)})},w),w<100&&(w+=10);return}E&&E(b)})}return Object.setPrototypeOf&&Object.setPrototypeOf(y,h),y})(s.rename)),s.read=typeof s.read!="function"?s.read:(function(h){function y(v,g,E,d,w,f){var b;if(f&&typeof f=="function"){var $=0;b=function(T,k,B){if(T&&T.code==="EAGAIN"&&$<10)return $++,h.call(s,v,g,E,d,w,b);f.apply(this,arguments)}}return h.call(s,v,g,E,d,w,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(y,h),y})(s.read),s.readSync=typeof s.readSync!="function"?s.readSync:(function(h){return function(y,v,g,E,d){for(var w=0;;)try{return h.call(s,y,v,g,E,d)}catch(f){if(f.code==="EAGAIN"&&w<10){w++;continue}throw f}}})(s.readSync);function l(h){h.lchmod=function(y,v,g){h.open(y,e.O_WRONLY|e.O_SYMLINK,v,function(E,d){if(E){g&&g(E);return}h.fchmod(d,v,function(w){h.close(d,function(f){g&&g(w||f)})})})},h.lchmodSync=function(y,v){var g=h.openSync(y,e.O_WRONLY|e.O_SYMLINK,v),E=!0,d;try{d=h.fchmodSync(g,v),E=!1}finally{if(E)try{h.closeSync(g)}catch{}else h.closeSync(g)}return d}}function c(h){e.hasOwnProperty("O_SYMLINK")&&h.futimes?(h.lutimes=function(y,v,g,E){h.open(y,e.O_SYMLINK,function(d,w){if(d){E&&E(d);return}h.futimes(w,v,g,function(f){h.close(w,function(b){E&&E(f||b)})})})},h.lutimesSync=function(y,v,g){var E=h.openSync(y,e.O_SYMLINK),d,w=!0;try{d=h.futimesSync(E,v,g),w=!1}finally{if(w)try{h.closeSync(E)}catch{}else h.closeSync(E)}return d}):h.futimes&&(h.lutimes=function(y,v,g,E){E&&process.nextTick(E)},h.lutimesSync=function(){})}function u(h){return h&&function(y,v,g){return h.call(s,y,v,function(E){p(E)&&(E=null),g&&g.apply(this,arguments)})}}function o(h){return h&&function(y,v){try{return h.call(s,y,v)}catch(g){if(!p(g))throw g}}}function m(h){return h&&function(y,v,g,E){return h.call(s,y,v,g,function(d){p(d)&&(d=null),E&&E.apply(this,arguments)})}}function _(h){return h&&function(y,v,g){try{return h.call(s,y,v,g)}catch(E){if(!p(E))throw E}}}function S(h){return h&&function(y,v,g){typeof v=="function"&&(g=v,v=null);function E(d,w){w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),g&&g.apply(this,arguments)}return v?h.call(s,y,v,E):h.call(s,y,E)}}function R(h){return h&&function(y,v){var g=v?h.call(s,y,v):h.call(s,y);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function p(h){if(!h||h.code==="ENOSYS")return!0;var y=!process.getuid||process.getuid()!==0;return!!(y&&(h.code==="EINVAL"||h.code==="EPERM"))}}return aa}var ua,Zd;function KS(){if(Zd)return ua;Zd=1;var e=Mr.Stream;ua=t;function t(r){return{ReadStream:n,WriteStream:i};function n(a,s){if(!(this instanceof n))return new n(a,s);e.call(this);var l=this;this.path=a,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var c=Object.keys(s),u=0,o=c.length;u<o;u++){var m=c[u];this[m]=s[m]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){l._read()});return}r.open(this.path,this.flags,this.mode,function(_,S){if(_){l.emit("error",_),l.readable=!1;return}l.fd=S,l.emit("open",S),l._read()})}function i(a,s){if(!(this instanceof i))return new i(a,s);e.call(this),this.path=a,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var l=Object.keys(s),c=0,u=l.length;c<u;c++){var o=l[c];this[o]=s[o]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}return ua}var ca,eh;function YS(){if(eh)return ca;eh=1,ca=t;var e=Object.getPrototypeOf||function(r){return r.__proto__};function t(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var n={__proto__:e(r)};else var n=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))}),n}return ca}var nn,th;function Br(){if(th)return nn;th=1;var e=oe,t=XS(),r=KS(),n=YS(),i=_r,a,s;typeof Symbol=="function"&&typeof Symbol.for=="function"?(a=Symbol.for("graceful-fs.queue"),s=Symbol.for("graceful-fs.previous")):(a="___graceful-fs.queue",s="___graceful-fs.previous");function l(){}function c(h,y){Object.defineProperty(h,a,{get:function(){return y}})}var u=l;if(i.debuglog?u=i.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(u=function(){var h=i.format.apply(i,arguments);h="GFS4: "+h.split(/\n/).join(`
|
||
GFS4: `),console.error(h)}),!e[a]){var o=tt[a]||[];c(e,o),e.close=(function(h){function y(v,g){return h.call(e,v,function(E){E||R(),typeof g=="function"&&g.apply(this,arguments)})}return Object.defineProperty(y,s,{value:h}),y})(e.close),e.closeSync=(function(h){function y(v){h.apply(e,arguments),R()}return Object.defineProperty(y,s,{value:h}),y})(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){u(e[a]),Ur.equal(e[a].length,0)})}tt[a]||c(tt,e[a]),nn=m(n(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(nn=m(e),e.__patched=!0);function m(h){t(h),h.gracefulify=m,h.createReadStream=z,h.createWriteStream=V;var y=h.readFile;h.readFile=v;function v(X,ie,ae){return typeof ie=="function"&&(ae=ie,ie=null),ge(X,ie,ae);function ge(M,U,j,W){return y(M,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?_([ge,[M,U,j],Y,W||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}}var g=h.writeFile;h.writeFile=E;function E(X,ie,ae,ge){return typeof ae=="function"&&(ge=ae,ae=null),M(X,ie,ae,ge);function M(U,j,W,Y,te){return g(U,j,W,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?_([M,[U,j,W,Y],Z,te||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var d=h.appendFile;d&&(h.appendFile=w);function w(X,ie,ae,ge){return typeof ae=="function"&&(ge=ae,ae=null),M(X,ie,ae,ge);function M(U,j,W,Y,te){return d(U,j,W,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?_([M,[U,j,W,Y],Z,te||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var f=h.copyFile;f&&(h.copyFile=b);function b(X,ie,ae,ge){return typeof ae=="function"&&(ge=ae,ae=0),M(X,ie,ae,ge);function M(U,j,W,Y,te){return f(U,j,W,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?_([M,[U,j,W,Y],Z,te||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var $=h.readdir;h.readdir=k;var T=/^v[0-5]\./;function k(X,ie,ae){typeof ie=="function"&&(ae=ie,ie=null);var ge=T.test(process.version)?function(j,W,Y,te){return $(j,M(j,W,Y,te))}:function(j,W,Y,te){return $(j,W,M(j,W,Y,te))};return ge(X,ie,ae);function M(U,j,W,Y){return function(te,Z){te&&(te.code==="EMFILE"||te.code==="ENFILE")?_([ge,[U,j,W],te,Y||Date.now(),Date.now()]):(Z&&Z.sort&&Z.sort(),typeof W=="function"&&W.call(this,te,Z))}}}if(process.version.substr(0,4)==="v0.8"){var B=r(h);D=B.ReadStream,q=B.WriteStream}var G=h.ReadStream;G&&(D.prototype=Object.create(G.prototype),D.prototype.open=C);var P=h.WriteStream;P&&(q.prototype=Object.create(P.prototype),q.prototype.open=x),Object.defineProperty(h,"ReadStream",{get:function(){return D},set:function(X){D=X},enumerable:!0,configurable:!0}),Object.defineProperty(h,"WriteStream",{get:function(){return q},set:function(X){q=X},enumerable:!0,configurable:!0});var I=D;Object.defineProperty(h,"FileReadStream",{get:function(){return I},set:function(X){I=X},enumerable:!0,configurable:!0});var A=q;Object.defineProperty(h,"FileWriteStream",{get:function(){return A},set:function(X){A=X},enumerable:!0,configurable:!0});function D(X,ie){return this instanceof D?(G.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var X=this;se(X.path,X.flags,X.mode,function(ie,ae){ie?(X.autoClose&&X.destroy(),X.emit("error",ie)):(X.fd=ae,X.emit("open",ae),X.read())})}function q(X,ie){return this instanceof q?(P.apply(this,arguments),this):q.apply(Object.create(q.prototype),arguments)}function x(){var X=this;se(X.path,X.flags,X.mode,function(ie,ae){ie?(X.destroy(),X.emit("error",ie)):(X.fd=ae,X.emit("open",ae))})}function z(X,ie){return new h.ReadStream(X,ie)}function V(X,ie){return new h.WriteStream(X,ie)}var Q=h.open;h.open=se;function se(X,ie,ae,ge){return typeof ae=="function"&&(ge=ae,ae=null),M(X,ie,ae,ge);function M(U,j,W,Y,te){return Q(U,j,W,function(Z,qe){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?_([M,[U,j,W,Y],Z,te||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}return h}function _(h){u("ENQUEUE",h[0].name,h[1]),e[a].push(h),p()}var S;function R(){for(var h=Date.now(),y=0;y<e[a].length;++y)e[a][y].length>2&&(e[a][y][3]=h,e[a][y][4]=h);p()}function p(){if(clearTimeout(S),S=void 0,e[a].length!==0){var h=e[a].shift(),y=h[0],v=h[1],g=h[2],E=h[3],d=h[4];if(E===void 0)u("RETRY",y.name,v),y.apply(null,v);else if(Date.now()-E>=6e4){u("TIMEOUT",y.name,v);var w=v.pop();typeof w=="function"&&w.call(null,g)}else{var f=Date.now()-d,b=Math.max(d-E,1),$=Math.min(b*1.2,100);f>=$?(u("RETRY",y.name,v),y.apply(null,v.concat([E]))):e[a].push(h)}S===void 0&&(S=setTimeout(p,0))}}return nn}var rh;function Xe(){return rh||(rh=1,(function(e){const t=Ue().fromCallback,r=Br(),n=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(i=>typeof r[i]=="function");Object.assign(e,r),n.forEach(i=>{e[i]=t(r[i])}),e.exists=function(i,a){return typeof a=="function"?r.exists(i,a):new Promise(s=>r.exists(i,s))},e.read=function(i,a,s,l,c,u){return typeof u=="function"?r.read(i,a,s,l,c,u):new Promise((o,m)=>{r.read(i,a,s,l,c,(_,S,R)=>{if(_)return m(_);o({bytesRead:S,buffer:R})})})},e.write=function(i,a,...s){return typeof s[s.length-1]=="function"?r.write(i,a,...s):new Promise((l,c)=>{r.write(i,a,...s,(u,o,m)=>{if(u)return c(u);l({bytesWritten:o,buffer:m})})})},e.readv=function(i,a,...s){return typeof s[s.length-1]=="function"?r.readv(i,a,...s):new Promise((l,c)=>{r.readv(i,a,...s,(u,o,m)=>{if(u)return c(u);l({bytesRead:o,buffers:m})})})},e.writev=function(i,a,...s){return typeof s[s.length-1]=="function"?r.writev(i,a,...s):new Promise((l,c)=>{r.writev(i,a,...s,(u,o,m)=>{if(u)return c(u);l({bytesWritten:o,buffers:m})})})},typeof r.realpath.native=="function"?e.realpath.native=t(r.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")})(oa)),oa}var sn={},la={},nh;function JS(){if(nh)return la;nh=1;const e=F;return la.checkPath=function(r){if(process.platform==="win32"&&/[<>:"|?*]/.test(r.replace(e.parse(r).root,""))){const i=new Error(`Path contains invalid characters: ${r}`);throw i.code="EINVAL",i}},la}var ih;function QS(){if(ih)return sn;ih=1;const e=Xe(),{checkPath:t}=JS(),r=n=>{const i={mode:511};return typeof n=="number"?n:{...i,...n}.mode};return sn.makeDir=async(n,i)=>(t(n),e.mkdir(n,{mode:r(i),recursive:!0})),sn.makeDirSync=(n,i)=>(t(n),e.mkdirSync(n,{mode:r(i),recursive:!0})),sn}var fa,sh;function At(){if(sh)return fa;sh=1;const e=Ue().fromPromise,{makeDir:t,makeDirSync:r}=QS(),n=e(t);return fa={mkdirs:n,mkdirsSync:r,mkdirp:n,mkdirpSync:r,ensureDir:n,ensureDirSync:r},fa}var da,oh;function sr(){if(oh)return da;oh=1;const e=Ue().fromPromise,t=Xe();function r(n){return t.access(n).then(()=>!0).catch(()=>!1)}return da={pathExists:e(r),pathExistsSync:t.existsSync},da}var ha,ah;function Lm(){if(ah)return ha;ah=1;const e=Xe(),t=Ue().fromPromise;async function r(i,a,s){const l=await e.open(i,"r+");let c=null;try{await e.futimes(l,a,s)}finally{try{await e.close(l)}catch(u){c=u}}if(c)throw c}function n(i,a,s){const l=e.openSync(i,"r+");return e.futimesSync(l,a,s),e.closeSync(l)}return ha={utimesMillis:t(r),utimesMillisSync:n},ha}var pa,uh;function $r(){if(uh)return pa;uh=1;const e=Xe(),t=F,r=Ue().fromPromise;function n(_,S,R){const p=R.dereference?h=>e.stat(h,{bigint:!0}):h=>e.lstat(h,{bigint:!0});return Promise.all([p(_),p(S).catch(h=>{if(h.code==="ENOENT")return null;throw h})]).then(([h,y])=>({srcStat:h,destStat:y}))}function i(_,S,R){let p;const h=R.dereference?v=>e.statSync(v,{bigint:!0}):v=>e.lstatSync(v,{bigint:!0}),y=h(_);try{p=h(S)}catch(v){if(v.code==="ENOENT")return{srcStat:y,destStat:null};throw v}return{srcStat:y,destStat:p}}async function a(_,S,R,p){const{srcStat:h,destStat:y}=await n(_,S,p);if(y){if(u(h,y)){const v=t.basename(_),g=t.basename(S);if(R==="move"&&v!==g&&v.toLowerCase()===g.toLowerCase())return{srcStat:h,destStat:y,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(h.isDirectory()&&!y.isDirectory())throw new Error(`Cannot overwrite non-directory '${S}' with directory '${_}'.`);if(!h.isDirectory()&&y.isDirectory())throw new Error(`Cannot overwrite directory '${S}' with non-directory '${_}'.`)}if(h.isDirectory()&&o(_,S))throw new Error(m(_,S,R));return{srcStat:h,destStat:y}}function s(_,S,R,p){const{srcStat:h,destStat:y}=i(_,S,p);if(y){if(u(h,y)){const v=t.basename(_),g=t.basename(S);if(R==="move"&&v!==g&&v.toLowerCase()===g.toLowerCase())return{srcStat:h,destStat:y,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(h.isDirectory()&&!y.isDirectory())throw new Error(`Cannot overwrite non-directory '${S}' with directory '${_}'.`);if(!h.isDirectory()&&y.isDirectory())throw new Error(`Cannot overwrite directory '${S}' with non-directory '${_}'.`)}if(h.isDirectory()&&o(_,S))throw new Error(m(_,S,R));return{srcStat:h,destStat:y}}async function l(_,S,R,p){const h=t.resolve(t.dirname(_)),y=t.resolve(t.dirname(R));if(y===h||y===t.parse(y).root)return;let v;try{v=await e.stat(y,{bigint:!0})}catch(g){if(g.code==="ENOENT")return;throw g}if(u(S,v))throw new Error(m(_,R,p));return l(_,S,y,p)}function c(_,S,R,p){const h=t.resolve(t.dirname(_)),y=t.resolve(t.dirname(R));if(y===h||y===t.parse(y).root)return;let v;try{v=e.statSync(y,{bigint:!0})}catch(g){if(g.code==="ENOENT")return;throw g}if(u(S,v))throw new Error(m(_,R,p));return c(_,S,y,p)}function u(_,S){return S.ino&&S.dev&&S.ino===_.ino&&S.dev===_.dev}function o(_,S){const R=t.resolve(_).split(t.sep).filter(h=>h),p=t.resolve(S).split(t.sep).filter(h=>h);return R.every((h,y)=>p[y]===h)}function m(_,S,R){return`Cannot ${R} '${_}' to a subdirectory of itself, '${S}'.`}return pa={checkPaths:r(a),checkPathsSync:s,checkParentPaths:r(l),checkParentPathsSync:c,isSrcSubdir:o,areIdentical:u},pa}var ma,ch;function ZS(){if(ch)return ma;ch=1;const e=Xe(),t=F,{mkdirs:r}=At(),{pathExists:n}=sr(),{utimesMillis:i}=Lm(),a=$r();async function s(p,h,y={}){typeof y=="function"&&(y={filter:y}),y.clobber="clobber"in y?!!y.clobber:!0,y.overwrite="overwrite"in y?!!y.overwrite:y.clobber,y.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");const{srcStat:v,destStat:g}=await a.checkPaths(p,h,"copy",y);if(await a.checkParentPaths(p,v,h,"copy"),!await l(p,h,y))return;const d=t.dirname(h);await n(d)||await r(d),await c(g,p,h,y)}async function l(p,h,y){return y.filter?y.filter(p,h):!0}async function c(p,h,y,v){const E=await(v.dereference?e.stat:e.lstat)(h);if(E.isDirectory())return S(E,p,h,y,v);if(E.isFile()||E.isCharacterDevice()||E.isBlockDevice())return u(E,p,h,y,v);if(E.isSymbolicLink())return R(p,h,y,v);throw E.isSocket()?new Error(`Cannot copy a socket file: ${h}`):E.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${h}`):new Error(`Unknown file: ${h}`)}async function u(p,h,y,v,g){if(!h)return o(p,y,v,g);if(g.overwrite)return await e.unlink(v),o(p,y,v,g);if(g.errorOnExist)throw new Error(`'${v}' already exists`)}async function o(p,h,y,v){if(await e.copyFile(h,y),v.preserveTimestamps){m(p.mode)&&await _(y,p.mode);const g=await e.stat(h);await i(y,g.atime,g.mtime)}return e.chmod(y,p.mode)}function m(p){return(p&128)===0}function _(p,h){return e.chmod(p,h|128)}async function S(p,h,y,v,g){h||await e.mkdir(v);const E=[];for await(const d of await e.opendir(y)){const w=t.join(y,d.name),f=t.join(v,d.name);E.push(l(w,f,g).then(b=>{if(b)return a.checkPaths(w,f,"copy",g).then(({destStat:$})=>c($,w,f,g))}))}await Promise.all(E),h||await e.chmod(v,p.mode)}async function R(p,h,y,v){let g=await e.readlink(h);if(v.dereference&&(g=t.resolve(process.cwd(),g)),!p)return e.symlink(g,y);let E=null;try{E=await e.readlink(y)}catch(d){if(d.code==="EINVAL"||d.code==="UNKNOWN")return e.symlink(g,y);throw d}if(v.dereference&&(E=t.resolve(process.cwd(),E)),a.isSrcSubdir(g,E))throw new Error(`Cannot copy '${g}' to a subdirectory of itself, '${E}'.`);if(a.isSrcSubdir(E,g))throw new Error(`Cannot overwrite '${E}' with '${g}'.`);return await e.unlink(y),e.symlink(g,y)}return ma=s,ma}var _a,lh;function eR(){if(lh)return _a;lh=1;const e=Br(),t=F,r=At().mkdirsSync,n=Lm().utimesMillisSync,i=$r();function a(d,w,f){typeof f=="function"&&(f={filter:f}),f=f||{},f.clobber="clobber"in f?!!f.clobber:!0,f.overwrite="overwrite"in f?!!f.overwrite:f.clobber,f.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");const{srcStat:b,destStat:$}=i.checkPathsSync(d,w,"copy",f);if(i.checkParentPathsSync(d,b,w,"copy"),f.filter&&!f.filter(d,w))return;const T=t.dirname(w);return e.existsSync(T)||r(T),s($,d,w,f)}function s(d,w,f,b){const T=(b.dereference?e.statSync:e.lstatSync)(w);if(T.isDirectory())return p(T,d,w,f,b);if(T.isFile()||T.isCharacterDevice()||T.isBlockDevice())return l(T,d,w,f,b);if(T.isSymbolicLink())return g(d,w,f,b);throw T.isSocket()?new Error(`Cannot copy a socket file: ${w}`):T.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${w}`):new Error(`Unknown file: ${w}`)}function l(d,w,f,b,$){return w?c(d,f,b,$):u(d,f,b,$)}function c(d,w,f,b){if(b.overwrite)return e.unlinkSync(f),u(d,w,f,b);if(b.errorOnExist)throw new Error(`'${f}' already exists`)}function u(d,w,f,b){return e.copyFileSync(w,f),b.preserveTimestamps&&o(d.mode,w,f),S(f,d.mode)}function o(d,w,f){return m(d)&&_(f,d),R(w,f)}function m(d){return(d&128)===0}function _(d,w){return S(d,w|128)}function S(d,w){return e.chmodSync(d,w)}function R(d,w){const f=e.statSync(d);return n(w,f.atime,f.mtime)}function p(d,w,f,b,$){return w?y(f,b,$):h(d.mode,f,b,$)}function h(d,w,f,b){return e.mkdirSync(f),y(w,f,b),S(f,d)}function y(d,w,f){const b=e.opendirSync(d);try{let $;for(;($=b.readSync())!==null;)v($.name,d,w,f)}finally{b.closeSync()}}function v(d,w,f,b){const $=t.join(w,d),T=t.join(f,d);if(b.filter&&!b.filter($,T))return;const{destStat:k}=i.checkPathsSync($,T,"copy",b);return s(k,$,T,b)}function g(d,w,f,b){let $=e.readlinkSync(w);if(b.dereference&&($=t.resolve(process.cwd(),$)),d){let T;try{T=e.readlinkSync(f)}catch(k){if(k.code==="EINVAL"||k.code==="UNKNOWN")return e.symlinkSync($,f);throw k}if(b.dereference&&(T=t.resolve(process.cwd(),T)),i.isSrcSubdir($,T))throw new Error(`Cannot copy '${$}' to a subdirectory of itself, '${T}'.`);if(i.isSrcSubdir(T,$))throw new Error(`Cannot overwrite '${T}' with '${$}'.`);return E($,f)}else return e.symlinkSync($,f)}function E(d,w){return e.unlinkSync(w),e.symlinkSync(d,w)}return _a=a,_a}var ya,fh;function Ou(){if(fh)return ya;fh=1;const e=Ue().fromPromise;return ya={copy:e(ZS()),copySync:eR()},ya}var va,dh;function Gn(){if(dh)return va;dh=1;const e=Br(),t=Ue().fromCallback;function r(i,a){e.rm(i,{recursive:!0,force:!0},a)}function n(i){e.rmSync(i,{recursive:!0,force:!0})}return va={remove:t(r),removeSync:n},va}var wa,hh;function tR(){if(hh)return wa;hh=1;const e=Ue().fromPromise,t=Xe(),r=F,n=At(),i=Gn(),a=e(async function(c){let u;try{u=await t.readdir(c)}catch{return n.mkdirs(c)}return Promise.all(u.map(o=>i.remove(r.join(c,o))))});function s(l){let c;try{c=t.readdirSync(l)}catch{return n.mkdirsSync(l)}c.forEach(u=>{u=r.join(l,u),i.removeSync(u)})}return wa={emptyDirSync:s,emptydirSync:s,emptyDir:a,emptydir:a},wa}var ga,ph;function rR(){if(ph)return ga;ph=1;const e=Ue().fromPromise,t=F,r=Xe(),n=At();async function i(s){let l;try{l=await r.stat(s)}catch{}if(l&&l.isFile())return;const c=t.dirname(s);let u=null;try{u=await r.stat(c)}catch(o){if(o.code==="ENOENT"){await n.mkdirs(c),await r.writeFile(s,"");return}else throw o}u.isDirectory()?await r.writeFile(s,""):await r.readdir(c)}function a(s){let l;try{l=r.statSync(s)}catch{}if(l&&l.isFile())return;const c=t.dirname(s);try{r.statSync(c).isDirectory()||r.readdirSync(c)}catch(u){if(u&&u.code==="ENOENT")n.mkdirsSync(c);else throw u}r.writeFileSync(s,"")}return ga={createFile:e(i),createFileSync:a},ga}var Ea,mh;function nR(){if(mh)return Ea;mh=1;const e=Ue().fromPromise,t=F,r=Xe(),n=At(),{pathExists:i}=sr(),{areIdentical:a}=$r();async function s(c,u){let o;try{o=await r.lstat(u)}catch{}let m;try{m=await r.lstat(c)}catch(R){throw R.message=R.message.replace("lstat","ensureLink"),R}if(o&&a(m,o))return;const _=t.dirname(u);await i(_)||await n.mkdirs(_),await r.link(c,u)}function l(c,u){let o;try{o=r.lstatSync(u)}catch{}try{const S=r.lstatSync(c);if(o&&a(S,o))return}catch(S){throw S.message=S.message.replace("lstat","ensureLink"),S}const m=t.dirname(u);return r.existsSync(m)||n.mkdirsSync(m),r.linkSync(c,u)}return Ea={createLink:e(s),createLinkSync:l},Ea}var Sa,_h;function iR(){if(_h)return Sa;_h=1;const e=F,t=Xe(),{pathExists:r}=sr(),n=Ue().fromPromise;async function i(s,l){if(e.isAbsolute(s)){try{await t.lstat(s)}catch(m){throw m.message=m.message.replace("lstat","ensureSymlink"),m}return{toCwd:s,toDst:s}}const c=e.dirname(l),u=e.join(c,s);if(await r(u))return{toCwd:u,toDst:s};try{await t.lstat(s)}catch(m){throw m.message=m.message.replace("lstat","ensureSymlink"),m}return{toCwd:s,toDst:e.relative(c,s)}}function a(s,l){if(e.isAbsolute(s)){if(!t.existsSync(s))throw new Error("absolute srcpath does not exist");return{toCwd:s,toDst:s}}const c=e.dirname(l),u=e.join(c,s);if(t.existsSync(u))return{toCwd:u,toDst:s};if(!t.existsSync(s))throw new Error("relative srcpath does not exist");return{toCwd:s,toDst:e.relative(c,s)}}return Sa={symlinkPaths:n(i),symlinkPathsSync:a},Sa}var Ra,yh;function sR(){if(yh)return Ra;yh=1;const e=Xe(),t=Ue().fromPromise;async function r(i,a){if(a)return a;let s;try{s=await e.lstat(i)}catch{return"file"}return s&&s.isDirectory()?"dir":"file"}function n(i,a){if(a)return a;let s;try{s=e.lstatSync(i)}catch{return"file"}return s&&s.isDirectory()?"dir":"file"}return Ra={symlinkType:t(r),symlinkTypeSync:n},Ra}var ba,vh;function oR(){if(vh)return ba;vh=1;const e=Ue().fromPromise,t=F,r=Xe(),{mkdirs:n,mkdirsSync:i}=At(),{symlinkPaths:a,symlinkPathsSync:s}=iR(),{symlinkType:l,symlinkTypeSync:c}=sR(),{pathExists:u}=sr(),{areIdentical:o}=$r();async function m(S,R,p){let h;try{h=await r.lstat(R)}catch{}if(h&&h.isSymbolicLink()){const[E,d]=await Promise.all([r.stat(S),r.stat(R)]);if(o(E,d))return}const y=await a(S,R);S=y.toDst;const v=await l(y.toCwd,p),g=t.dirname(R);return await u(g)||await n(g),r.symlink(S,R,v)}function _(S,R,p){let h;try{h=r.lstatSync(R)}catch{}if(h&&h.isSymbolicLink()){const E=r.statSync(S),d=r.statSync(R);if(o(E,d))return}const y=s(S,R);S=y.toDst,p=c(y.toCwd,p);const v=t.dirname(R);return r.existsSync(v)||i(v),r.symlinkSync(S,R,p)}return ba={createSymlink:e(m),createSymlinkSync:_},ba}var $a,wh;function aR(){if(wh)return $a;wh=1;const{createFile:e,createFileSync:t}=rR(),{createLink:r,createLinkSync:n}=nR(),{createSymlink:i,createSymlinkSync:a}=oR();return $a={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:n,ensureLink:r,ensureLinkSync:n,createSymlink:i,createSymlinkSync:a,ensureSymlink:i,ensureSymlinkSync:a},$a}var Oa,gh;function Iu(){if(gh)return Oa;gh=1;function e(r,{EOL:n=`
|
||
`,finalEOL:i=!0,replacer:a=null,spaces:s}={}){const l=i?n:"";return JSON.stringify(r,a,s).replace(/\n/g,n)+l}function t(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}return Oa={stringify:e,stripBom:t},Oa}var Ia,Eh;function uR(){if(Eh)return Ia;Eh=1;let e;try{e=Br()}catch{e=oe}const t=Ue(),{stringify:r,stripBom:n}=Iu();async function i(m,_={}){typeof _=="string"&&(_={encoding:_});const S=_.fs||e,R="throws"in _?_.throws:!0;let p=await t.fromCallback(S.readFile)(m,_);p=n(p);let h;try{h=JSON.parse(p,_?_.reviver:null)}catch(y){if(R)throw y.message=`${m}: ${y.message}`,y;return null}return h}const a=t.fromPromise(i);function s(m,_={}){typeof _=="string"&&(_={encoding:_});const S=_.fs||e,R="throws"in _?_.throws:!0;try{let p=S.readFileSync(m,_);return p=n(p),JSON.parse(p,_.reviver)}catch(p){if(R)throw p.message=`${m}: ${p.message}`,p;return null}}async function l(m,_,S={}){const R=S.fs||e,p=r(_,S);await t.fromCallback(R.writeFile)(m,p,S)}const c=t.fromPromise(l);function u(m,_,S={}){const R=S.fs||e,p=r(_,S);return R.writeFileSync(m,p,S)}return Ia={readFile:a,readFileSync:s,writeFile:c,writeFileSync:u},Ia}var Pa,Sh;function cR(){if(Sh)return Pa;Sh=1;const e=uR();return Pa={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync},Pa}var Ta,Rh;function Pu(){if(Rh)return Ta;Rh=1;const e=Ue().fromPromise,t=Xe(),r=F,n=At(),i=sr().pathExists;async function a(l,c,u="utf-8"){const o=r.dirname(l);return await i(o)||await n.mkdirs(o),t.writeFile(l,c,u)}function s(l,...c){const u=r.dirname(l);t.existsSync(u)||n.mkdirsSync(u),t.writeFileSync(l,...c)}return Ta={outputFile:e(a),outputFileSync:s},Ta}var Na,bh;function lR(){if(bh)return Na;bh=1;const{stringify:e}=Iu(),{outputFile:t}=Pu();async function r(n,i,a={}){const s=e(i,a);await t(n,s,a)}return Na=r,Na}var Aa,$h;function fR(){if($h)return Aa;$h=1;const{stringify:e}=Iu(),{outputFileSync:t}=Pu();function r(n,i,a){const s=e(i,a);t(n,s,a)}return Aa=r,Aa}var La,Oh;function dR(){if(Oh)return La;Oh=1;const e=Ue().fromPromise,t=cR();return t.outputJson=e(lR()),t.outputJsonSync=fR(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,La=t,La}var xa,Ih;function hR(){if(Ih)return xa;Ih=1;const e=Xe(),t=F,{copy:r}=Ou(),{remove:n}=Gn(),{mkdirp:i}=At(),{pathExists:a}=sr(),s=$r();async function l(o,m,_={}){const S=_.overwrite||_.clobber||!1,{srcStat:R,isChangingCase:p=!1}=await s.checkPaths(o,m,"move",_);await s.checkParentPaths(o,R,m,"move");const h=t.dirname(m);return t.parse(h).root!==h&&await i(h),c(o,m,S,p)}async function c(o,m,_,S){if(!S){if(_)await n(m);else if(await a(m))throw new Error("dest already exists.")}try{await e.rename(o,m)}catch(R){if(R.code!=="EXDEV")throw R;await u(o,m,_)}}async function u(o,m,_){return await r(o,m,{overwrite:_,errorOnExist:!0,preserveTimestamps:!0}),n(o)}return xa=l,xa}var Ca,Ph;function pR(){if(Ph)return Ca;Ph=1;const e=Br(),t=F,r=Ou().copySync,n=Gn().removeSync,i=At().mkdirpSync,a=$r();function s(m,_,S){S=S||{};const R=S.overwrite||S.clobber||!1,{srcStat:p,isChangingCase:h=!1}=a.checkPathsSync(m,_,"move",S);return a.checkParentPathsSync(m,p,_,"move"),l(_)||i(t.dirname(_)),c(m,_,R,h)}function l(m){const _=t.dirname(m);return t.parse(_).root===_}function c(m,_,S,R){if(R)return u(m,_,S);if(S)return n(_),u(m,_,S);if(e.existsSync(_))throw new Error("dest already exists.");return u(m,_,S)}function u(m,_,S){try{e.renameSync(m,_)}catch(R){if(R.code!=="EXDEV")throw R;return o(m,_,S)}}function o(m,_,S){return r(m,_,{overwrite:S,errorOnExist:!0,preserveTimestamps:!0}),n(m)}return Ca=s,Ca}var Da,Th;function mR(){if(Th)return Da;Th=1;const e=Ue().fromPromise;return Da={move:e(hR()),moveSync:pR()},Da}var Fa,Nh;function _R(){return Nh||(Nh=1,Fa={...Xe(),...Ou(),...tR(),...aR(),...dR(),...At(),...mR(),...Pu(),...sr(),...Gn()}),Fa}var Tt=_R();let Ft;async function xm(e){var s;if(process.platform!=="win32")return;if(typeof Ft=="string")return{binDir:Ft};const t=de.sync("choco",{nothrow:!0});if(t!==null)return Ft=F.dirname(t),{binDir:Ft};let r="powershell.exe";const n=de.sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});n!==null&&(r=n),ze(r,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});const i=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await Oe(i,ne);const a=de.sync("choco",{nothrow:!0});if(a!==null?Ft=F.dirname(a):Ft=`${(s=process.env.ChocolateyInstall)!=null?s:"C:/ProgramData/chocolatey"}/bin`,await ye(Ft))return{binDir:Ft}}let Ah=!1;async function De(e,t,r=[]){var s;J(`Installing ${e} ${t!=null?t:""} via chocolatey`),(!Ah||de.sync("choco",{nothrow:!0})===null)&&(await xm(),Ah=!0);const n=process.env.PATH,i={...process.env};if(i.TMP=void 0,i.TEMP=void 0,i.Path=void 0,i.PATH=n,t!==void 0&&t!=="")ze("choco",["install","-y",e,`--version=${t}`,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{ze("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"})}catch(l){if(l.message.includes("exit code 3010"))J(`${e} might require a reboot for the completion of the installation.`);else throw l}const a=`${(s=process.env.ChocolateyInstall)!=null?s:"C:/ProgramData/chocolatey"}/bin`;return await Oe(a,ne),{binDir:a}}async function fn({version:e}={}){switch(process.platform){case"win32":return De("7zip",e);case"darwin":return Me("p7zip",e);case"linux":{if(Te())return Re("p7zip",e);if(Ce())return xe([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(_e())return he([{name:"p7zip-full",version:e}]);if(await Ie())return Fe([{name:"p7zip",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var ce={},Ar={exports:{}},on={exports:{}},Lh;function Cm(){return Lh||(Lh=1,(function(e,t){t=e.exports=f;var r;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?r=function(){var O=Array.prototype.slice.call(arguments,0);O.unshift("SEMVER"),console.log.apply(console,O)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,a=16,s=n-6,l=t.re=[],c=t.safeRe=[],u=t.src=[],o=t.tokens={},m=0;function _(O){o[O]=m++}var S="[a-zA-Z0-9-]",R=[["\\s",1],["\\d",n],[S,s]];function p(O){for(var N=0;N<R.length;N++){var L=R[N][0],H=R[N][1];O=O.split(L+"*").join(L+"{0,"+H+"}").split(L+"+").join(L+"{1,"+H+"}")}return O}_("NUMERICIDENTIFIER"),u[o.NUMERICIDENTIFIER]="0|[1-9]\\d*",_("NUMERICIDENTIFIERLOOSE"),u[o.NUMERICIDENTIFIERLOOSE]="\\d+",_("NONNUMERICIDENTIFIER"),u[o.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",_("MAINVERSION"),u[o.MAINVERSION]="("+u[o.NUMERICIDENTIFIER]+")\\.("+u[o.NUMERICIDENTIFIER]+")\\.("+u[o.NUMERICIDENTIFIER]+")",_("MAINVERSIONLOOSE"),u[o.MAINVERSIONLOOSE]="("+u[o.NUMERICIDENTIFIERLOOSE]+")\\.("+u[o.NUMERICIDENTIFIERLOOSE]+")\\.("+u[o.NUMERICIDENTIFIERLOOSE]+")",_("PRERELEASEIDENTIFIER"),u[o.PRERELEASEIDENTIFIER]="(?:"+u[o.NUMERICIDENTIFIER]+"|"+u[o.NONNUMERICIDENTIFIER]+")",_("PRERELEASEIDENTIFIERLOOSE"),u[o.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[o.NUMERICIDENTIFIERLOOSE]+"|"+u[o.NONNUMERICIDENTIFIER]+")",_("PRERELEASE"),u[o.PRERELEASE]="(?:-("+u[o.PRERELEASEIDENTIFIER]+"(?:\\."+u[o.PRERELEASEIDENTIFIER]+")*))",_("PRERELEASELOOSE"),u[o.PRERELEASELOOSE]="(?:-?("+u[o.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[o.PRERELEASEIDENTIFIERLOOSE]+")*))",_("BUILDIDENTIFIER"),u[o.BUILDIDENTIFIER]=S+"+",_("BUILD"),u[o.BUILD]="(?:\\+("+u[o.BUILDIDENTIFIER]+"(?:\\."+u[o.BUILDIDENTIFIER]+")*))",_("FULL"),_("FULLPLAIN"),u[o.FULLPLAIN]="v?"+u[o.MAINVERSION]+u[o.PRERELEASE]+"?"+u[o.BUILD]+"?",u[o.FULL]="^"+u[o.FULLPLAIN]+"$",_("LOOSEPLAIN"),u[o.LOOSEPLAIN]="[v=\\s]*"+u[o.MAINVERSIONLOOSE]+u[o.PRERELEASELOOSE]+"?"+u[o.BUILD]+"?",_("LOOSE"),u[o.LOOSE]="^"+u[o.LOOSEPLAIN]+"$",_("GTLT"),u[o.GTLT]="((?:<|>)?=?)",_("XRANGEIDENTIFIERLOOSE"),u[o.XRANGEIDENTIFIERLOOSE]=u[o.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",_("XRANGEIDENTIFIER"),u[o.XRANGEIDENTIFIER]=u[o.NUMERICIDENTIFIER]+"|x|X|\\*",_("XRANGEPLAIN"),u[o.XRANGEPLAIN]="[v=\\s]*("+u[o.XRANGEIDENTIFIER]+")(?:\\.("+u[o.XRANGEIDENTIFIER]+")(?:\\.("+u[o.XRANGEIDENTIFIER]+")(?:"+u[o.PRERELEASE]+")?"+u[o.BUILD]+"?)?)?",_("XRANGEPLAINLOOSE"),u[o.XRANGEPLAINLOOSE]="[v=\\s]*("+u[o.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[o.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[o.XRANGEIDENTIFIERLOOSE]+")(?:"+u[o.PRERELEASELOOSE]+")?"+u[o.BUILD]+"?)?)?",_("XRANGE"),u[o.XRANGE]="^"+u[o.GTLT]+"\\s*"+u[o.XRANGEPLAIN]+"$",_("XRANGELOOSE"),u[o.XRANGELOOSE]="^"+u[o.GTLT]+"\\s*"+u[o.XRANGEPLAINLOOSE]+"$",_("COERCE"),u[o.COERCE]="(^|[^\\d])(\\d{1,"+a+"})(?:\\.(\\d{1,"+a+"}))?(?:\\.(\\d{1,"+a+"}))?(?:$|[^\\d])",_("COERCERTL"),l[o.COERCERTL]=new RegExp(u[o.COERCE],"g"),c[o.COERCERTL]=new RegExp(p(u[o.COERCE]),"g"),_("LONETILDE"),u[o.LONETILDE]="(?:~>?)",_("TILDETRIM"),u[o.TILDETRIM]="(\\s*)"+u[o.LONETILDE]+"\\s+",l[o.TILDETRIM]=new RegExp(u[o.TILDETRIM],"g"),c[o.TILDETRIM]=new RegExp(p(u[o.TILDETRIM]),"g");var h="$1~";_("TILDE"),u[o.TILDE]="^"+u[o.LONETILDE]+u[o.XRANGEPLAIN]+"$",_("TILDELOOSE"),u[o.TILDELOOSE]="^"+u[o.LONETILDE]+u[o.XRANGEPLAINLOOSE]+"$",_("LONECARET"),u[o.LONECARET]="(?:\\^)",_("CARETTRIM"),u[o.CARETTRIM]="(\\s*)"+u[o.LONECARET]+"\\s+",l[o.CARETTRIM]=new RegExp(u[o.CARETTRIM],"g"),c[o.CARETTRIM]=new RegExp(p(u[o.CARETTRIM]),"g");var y="$1^";_("CARET"),u[o.CARET]="^"+u[o.LONECARET]+u[o.XRANGEPLAIN]+"$",_("CARETLOOSE"),u[o.CARETLOOSE]="^"+u[o.LONECARET]+u[o.XRANGEPLAINLOOSE]+"$",_("COMPARATORLOOSE"),u[o.COMPARATORLOOSE]="^"+u[o.GTLT]+"\\s*("+u[o.LOOSEPLAIN]+")$|^$",_("COMPARATOR"),u[o.COMPARATOR]="^"+u[o.GTLT]+"\\s*("+u[o.FULLPLAIN]+")$|^$",_("COMPARATORTRIM"),u[o.COMPARATORTRIM]="(\\s*)"+u[o.GTLT]+"\\s*("+u[o.LOOSEPLAIN]+"|"+u[o.XRANGEPLAIN]+")",l[o.COMPARATORTRIM]=new RegExp(u[o.COMPARATORTRIM],"g"),c[o.COMPARATORTRIM]=new RegExp(p(u[o.COMPARATORTRIM]),"g");var v="$1$2$3";_("HYPHENRANGE"),u[o.HYPHENRANGE]="^\\s*("+u[o.XRANGEPLAIN]+")\\s+-\\s+("+u[o.XRANGEPLAIN]+")\\s*$",_("HYPHENRANGELOOSE"),u[o.HYPHENRANGELOOSE]="^\\s*("+u[o.XRANGEPLAINLOOSE]+")\\s+-\\s+("+u[o.XRANGEPLAINLOOSE]+")\\s*$",_("STAR"),u[o.STAR]="(<|>)?=?\\s*\\*";for(var g=0;g<m;g++)r(g,u[g]),l[g]||(l[g]=new RegExp(u[g]),c[g]=new RegExp(p(u[g])));t.parse=E;function E(O,N){if((!N||typeof N!="object")&&(N={loose:!!N,includePrerelease:!1}),O instanceof f)return O;if(typeof O!="string"||O.length>n)return null;var L=N.loose?c[o.LOOSE]:c[o.FULL];if(!L.test(O))return null;try{return new f(O,N)}catch{return null}}t.valid=d;function d(O,N){var L=E(O,N);return L?L.version:null}t.clean=w;function w(O,N){var L=E(O.trim().replace(/^[=v]+/,""),N);return L?L.version:null}t.SemVer=f;function f(O,N){if((!N||typeof N!="object")&&(N={loose:!!N,includePrerelease:!1}),O instanceof f){if(O.loose===N.loose)return O;O=O.version}else if(typeof O!="string")throw new TypeError("Invalid Version: "+O);if(O.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof f))return new f(O,N);r("SemVer",O,N),this.options=N,this.loose=!!N.loose;var L=O.trim().match(N.loose?c[o.LOOSE]:c[o.FULL]);if(!L)throw new TypeError("Invalid Version: "+O);if(this.raw=O,this.major=+L[1],this.minor=+L[2],this.patch=+L[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");L[4]?this.prerelease=L[4].split(".").map(function(H){if(/^[0-9]+$/.test(H)){var K=+H;if(K>=0&&K<i)return K}return H}):this.prerelease=[],this.build=L[5]?L[5].split("."):[],this.format()}f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.toString=function(){return this.version},f.prototype.compare=function(O){return r("SemVer.compare",this.version,this.options,O),O instanceof f||(O=new f(O,this.options)),this.compareMain(O)||this.comparePre(O)},f.prototype.compareMain=function(O){return O instanceof f||(O=new f(O,this.options)),k(this.major,O.major)||k(this.minor,O.minor)||k(this.patch,O.patch)},f.prototype.comparePre=function(O){if(O instanceof f||(O=new f(O,this.options)),this.prerelease.length&&!O.prerelease.length)return-1;if(!this.prerelease.length&&O.prerelease.length)return 1;if(!this.prerelease.length&&!O.prerelease.length)return 0;var N=0;do{var L=this.prerelease[N],H=O.prerelease[N];if(r("prerelease compare",N,L,H),L===void 0&&H===void 0)return 0;if(H===void 0)return 1;if(L===void 0)return-1;if(L===H)continue;return k(L,H)}while(++N)},f.prototype.compareBuild=function(O){O instanceof f||(O=new f(O,this.options));var N=0;do{var L=this.build[N],H=O.build[N];if(r("prerelease compare",N,L,H),L===void 0&&H===void 0)return 0;if(H===void 0)return 1;if(L===void 0)return-1;if(L===H)continue;return k(L,H)}while(++N)},f.prototype.inc=function(O,N){switch(O){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",N);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",N);break;case"prepatch":this.prerelease.length=0,this.inc("patch",N),this.inc("pre",N);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",N),this.inc("pre",N);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var L=this.prerelease.length;--L>=0;)typeof this.prerelease[L]=="number"&&(this.prerelease[L]++,L=-2);L===-1&&this.prerelease.push(0)}N&&(this.prerelease[0]===N?isNaN(this.prerelease[1])&&(this.prerelease=[N,0]):this.prerelease=[N,0]);break;default:throw new Error("invalid increment argument: "+O)}return this.format(),this.raw=this.version,this},t.inc=b;function b(O,N,L,H){typeof L=="string"&&(H=L,L=void 0);try{return new f(O,L).inc(N,H).version}catch{return null}}t.diff=$;function $(O,N){if(se(O,N))return null;var L=E(O),H=E(N),K="";if(L.prerelease.length||H.prerelease.length){K="pre";var ee="prerelease"}for(var re in L)if((re==="major"||re==="minor"||re==="patch")&&L[re]!==H[re])return K+re;return ee}t.compareIdentifiers=k;var T=/^[0-9]+$/;function k(O,N){var L=T.test(O),H=T.test(N);return L&&H&&(O=+O,N=+N),O===N?0:L&&!H?-1:H&&!L?1:O<N?-1:1}t.rcompareIdentifiers=B;function B(O,N){return k(N,O)}t.major=G;function G(O,N){return new f(O,N).major}t.minor=P;function P(O,N){return new f(O,N).minor}t.patch=I;function I(O,N){return new f(O,N).patch}t.compare=A;function A(O,N,L){return new f(O,L).compare(new f(N,L))}t.compareLoose=D;function D(O,N){return A(O,N,!0)}t.compareBuild=C;function C(O,N,L){var H=new f(O,L),K=new f(N,L);return H.compare(K)||H.compareBuild(K)}t.rcompare=q;function q(O,N,L){return A(N,O,L)}t.sort=x;function x(O,N){return O.sort(function(L,H){return t.compareBuild(L,H,N)})}t.rsort=z;function z(O,N){return O.sort(function(L,H){return t.compareBuild(H,L,N)})}t.gt=V;function V(O,N,L){return A(O,N,L)>0}t.lt=Q;function Q(O,N,L){return A(O,N,L)<0}t.eq=se;function se(O,N,L){return A(O,N,L)===0}t.neq=X;function X(O,N,L){return A(O,N,L)!==0}t.gte=ie;function ie(O,N,L){return A(O,N,L)>=0}t.lte=ae;function ae(O,N,L){return A(O,N,L)<=0}t.cmp=ge;function ge(O,N,L,H){switch(N){case"===":return typeof O=="object"&&(O=O.version),typeof L=="object"&&(L=L.version),O===L;case"!==":return typeof O=="object"&&(O=O.version),typeof L=="object"&&(L=L.version),O!==L;case"":case"=":case"==":return se(O,L,H);case"!=":return X(O,L,H);case">":return V(O,L,H);case">=":return ie(O,L,H);case"<":return Q(O,L,H);case"<=":return ae(O,L,H);default:throw new TypeError("Invalid operator: "+N)}}t.Comparator=M;function M(O,N){if((!N||typeof N!="object")&&(N={loose:!!N,includePrerelease:!1}),O instanceof M){if(O.loose===!!N.loose)return O;O=O.value}if(!(this instanceof M))return new M(O,N);O=O.trim().split(/\s+/).join(" "),r("comparator",O,N),this.options=N,this.loose=!!N.loose,this.parse(O),this.semver===U?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var U={};M.prototype.parse=function(O){var N=this.options.loose?c[o.COMPARATORLOOSE]:c[o.COMPARATOR],L=O.match(N);if(!L)throw new TypeError("Invalid comparator: "+O);this.operator=L[1]!==void 0?L[1]:"",this.operator==="="&&(this.operator=""),L[2]?this.semver=new f(L[2],this.options.loose):this.semver=U},M.prototype.toString=function(){return this.value},M.prototype.test=function(O){if(r("Comparator.test",O,this.options.loose),this.semver===U||O===U)return!0;if(typeof O=="string")try{O=new f(O,this.options)}catch{return!1}return ge(O,this.operator,this.semver,this.options)},M.prototype.intersects=function(O,N){if(!(O instanceof M))throw new TypeError("a Comparator is required");(!N||typeof N!="object")&&(N={loose:!!N,includePrerelease:!1});var L;if(this.operator==="")return this.value===""?!0:(L=new j(O.value,N),zr(this.value,L,N));if(O.operator==="")return O.value===""?!0:(L=new j(this.value,N),zr(O.semver,L,N));var H=(this.operator===">="||this.operator===">")&&(O.operator===">="||O.operator===">"),K=(this.operator==="<="||this.operator==="<")&&(O.operator==="<="||O.operator==="<"),ee=this.semver.version===O.semver.version,re=(this.operator===">="||this.operator==="<=")&&(O.operator===">="||O.operator==="<="),pe=ge(this.semver,"<",O.semver,N)&&(this.operator===">="||this.operator===">")&&(O.operator==="<="||O.operator==="<"),ue=ge(this.semver,">",O.semver,N)&&(this.operator==="<="||this.operator==="<")&&(O.operator===">="||O.operator===">");return H||K||ee&&re||pe||ue},t.Range=j;function j(O,N){if((!N||typeof N!="object")&&(N={loose:!!N,includePrerelease:!1}),O instanceof j)return O.loose===!!N.loose&&O.includePrerelease===!!N.includePrerelease?O:new j(O.raw,N);if(O instanceof M)return new j(O.value,N);if(!(this instanceof j))return new j(O,N);if(this.options=N,this.loose=!!N.loose,this.includePrerelease=!!N.includePrerelease,this.raw=O.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(L){return this.parseRange(L.trim())},this).filter(function(L){return L.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}j.prototype.format=function(){return this.range=this.set.map(function(O){return O.join(" ").trim()}).join("||").trim(),this.range},j.prototype.toString=function(){return this.range},j.prototype.parseRange=function(O){var N=this.options.loose,L=N?c[o.HYPHENRANGELOOSE]:c[o.HYPHENRANGE];O=O.replace(L,p_),r("hyphen replace",O),O=O.replace(c[o.COMPARATORTRIM],v),r("comparator trim",O,c[o.COMPARATORTRIM]),O=O.replace(c[o.TILDETRIM],h),O=O.replace(c[o.CARETTRIM],y),O=O.split(/\s+/).join(" ");var H=N?c[o.COMPARATORLOOSE]:c[o.COMPARATOR],K=O.split(" ").map(function(ee){return te(ee,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(K=K.filter(function(ee){return!!ee.match(H)})),K=K.map(function(ee){return new M(ee,this.options)},this),K},j.prototype.intersects=function(O,N){if(!(O instanceof j))throw new TypeError("a Range is required");return this.set.some(function(L){return W(L,N)&&O.set.some(function(H){return W(H,N)&&L.every(function(K){return H.every(function(ee){return K.intersects(ee,N)})})})})};function W(O,N){for(var L=!0,H=O.slice(),K=H.pop();L&&H.length;)L=H.every(function(ee){return K.intersects(ee,N)}),K=H.pop();return L}t.toComparators=Y;function Y(O,N){return new j(O,N).set.map(function(L){return L.map(function(H){return H.value}).join(" ").trim().split(" ")})}function te(O,N){return r("comp",O,N),O=Ke(O,N),r("caret",O),O=qe(O,N),r("tildes",O),O=Lt(O,N),r("xrange",O),O=h_(O,N),r("stars",O),O}function Z(O){return!O||O.toLowerCase()==="x"||O==="*"}function qe(O,N){return O.trim().split(/\s+/).map(function(L){return Ne(L,N)}).join(" ")}function Ne(O,N){var L=N.loose?c[o.TILDELOOSE]:c[o.TILDE];return O.replace(L,function(H,K,ee,re,pe){r("tilde",O,H,K,ee,re,pe);var ue;return Z(K)?ue="":Z(ee)?ue=">="+K+".0.0 <"+(+K+1)+".0.0":Z(re)?ue=">="+K+"."+ee+".0 <"+K+"."+(+ee+1)+".0":pe?(r("replaceTilde pr",pe),ue=">="+K+"."+ee+"."+re+"-"+pe+" <"+K+"."+(+ee+1)+".0"):ue=">="+K+"."+ee+"."+re+" <"+K+"."+(+ee+1)+".0",r("tilde return",ue),ue})}function Ke(O,N){return O.trim().split(/\s+/).map(function(L){return Ae(L,N)}).join(" ")}function Ae(O,N){r("caret",O,N);var L=N.loose?c[o.CARETLOOSE]:c[o.CARET];return O.replace(L,function(H,K,ee,re,pe){r("caret",O,H,K,ee,re,pe);var ue;return Z(K)?ue="":Z(ee)?ue=">="+K+".0.0 <"+(+K+1)+".0.0":Z(re)?K==="0"?ue=">="+K+"."+ee+".0 <"+K+"."+(+ee+1)+".0":ue=">="+K+"."+ee+".0 <"+(+K+1)+".0.0":pe?(r("replaceCaret pr",pe),K==="0"?ee==="0"?ue=">="+K+"."+ee+"."+re+"-"+pe+" <"+K+"."+ee+"."+(+re+1):ue=">="+K+"."+ee+"."+re+"-"+pe+" <"+K+"."+(+ee+1)+".0":ue=">="+K+"."+ee+"."+re+"-"+pe+" <"+(+K+1)+".0.0"):(r("no pr"),K==="0"?ee==="0"?ue=">="+K+"."+ee+"."+re+" <"+K+"."+ee+"."+(+re+1):ue=">="+K+"."+ee+"."+re+" <"+K+"."+(+ee+1)+".0":ue=">="+K+"."+ee+"."+re+" <"+(+K+1)+".0.0"),r("caret return",ue),ue})}function Lt(O,N){return r("replaceXRanges",O,N),O.split(/\s+/).map(function(L){return d_(L,N)}).join(" ")}function d_(O,N){O=O.trim();var L=N.loose?c[o.XRANGELOOSE]:c[o.XRANGE];return O.replace(L,function(H,K,ee,re,pe,ue){r("xRange",O,H,K,ee,re,pe,ue);var St=Z(ee),Rt=St||Z(re),ot=Rt||Z(pe),Ye=ot;return K==="="&&Ye&&(K=""),ue=N.includePrerelease?"-0":"",St?K===">"||K==="<"?H="<0.0.0-0":H="*":K&&Ye?(Rt&&(re=0),pe=0,K===">"?(K=">=",Rt?(ee=+ee+1,re=0,pe=0):(re=+re+1,pe=0)):K==="<="&&(K="<",Rt?ee=+ee+1:re=+re+1),H=K+ee+"."+re+"."+pe+ue):Rt?H=">="+ee+".0.0"+ue+" <"+(+ee+1)+".0.0"+ue:ot&&(H=">="+ee+"."+re+".0"+ue+" <"+ee+"."+(+re+1)+".0"+ue),r("xRange return",H),H})}function h_(O,N){return r("replaceStars",O,N),O.trim().replace(c[o.STAR],"")}function p_(O,N,L,H,K,ee,re,pe,ue,St,Rt,ot,Ye){return Z(L)?N="":Z(H)?N=">="+L+".0.0":Z(K)?N=">="+L+"."+H+".0":N=">="+N,Z(ue)?pe="":Z(St)?pe="<"+(+ue+1)+".0.0":Z(Rt)?pe="<"+ue+"."+(+St+1)+".0":ot?pe="<="+ue+"."+St+"."+Rt+"-"+ot:pe="<="+pe,(N+" "+pe).trim()}j.prototype.test=function(O){if(!O)return!1;if(typeof O=="string")try{O=new f(O,this.options)}catch{return!1}for(var N=0;N<this.set.length;N++)if(m_(this.set[N],O,this.options))return!0;return!1};function m_(O,N,L){for(var H=0;H<O.length;H++)if(!O[H].test(N))return!1;if(N.prerelease.length&&!L.includePrerelease){for(H=0;H<O.length;H++)if(r(O[H].semver),O[H].semver!==U&&O[H].semver.prerelease.length>0){var K=O[H].semver;if(K.major===N.major&&K.minor===N.minor&&K.patch===N.patch)return!0}return!1}return!0}t.satisfies=zr;function zr(O,N,L){try{N=new j(N,L)}catch{return!1}return N.test(O)}t.maxSatisfying=__;function __(O,N,L){var H=null,K=null;try{var ee=new j(N,L)}catch{return null}return O.forEach(function(re){ee.test(re)&&(!H||K.compare(re)===-1)&&(H=re,K=new f(H,L))}),H}t.minSatisfying=y_;function y_(O,N,L){var H=null,K=null;try{var ee=new j(N,L)}catch{return null}return O.forEach(function(re){ee.test(re)&&(!H||K.compare(re)===1)&&(H=re,K=new f(H,L))}),H}t.minVersion=v_;function v_(O,N){O=new j(O,N);var L=new f("0.0.0");if(O.test(L)||(L=new f("0.0.0-0"),O.test(L)))return L;L=null;for(var H=0;H<O.set.length;++H){var K=O.set[H];K.forEach(function(ee){var re=new f(ee.semver.version);switch(ee.operator){case">":re.prerelease.length===0?re.patch++:re.prerelease.push(0),re.raw=re.format();case"":case">=":(!L||V(L,re))&&(L=re);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+ee.operator)}})}return L&&O.test(L)?L:null}t.validRange=w_;function w_(O,N){try{return new j(O,N).range||"*"}catch{return null}}t.ltr=g_;function g_(O,N,L){return Bn(O,N,"<",L)}t.gtr=E_;function E_(O,N,L){return Bn(O,N,">",L)}t.outside=Bn;function Bn(O,N,L,H){O=new f(O,H),N=new j(N,H);var K,ee,re,pe,ue;switch(L){case">":K=V,ee=ae,re=Q,pe=">",ue=">=";break;case"<":K=Q,ee=ie,re=V,pe="<",ue="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(zr(O,N,H))return!1;for(var St=0;St<N.set.length;++St){var Rt=N.set[St],ot=null,Ye=null;if(Rt.forEach(function(Ct){Ct.semver===U&&(Ct=new M(">=0.0.0")),ot=ot||Ct,Ye=Ye||Ct,K(Ct.semver,ot.semver,H)?ot=Ct:re(Ct.semver,Ye.semver,H)&&(Ye=Ct)}),ot.operator===pe||ot.operator===ue||(!Ye.operator||Ye.operator===pe)&&ee(O,Ye.semver))return!1;if(Ye.operator===ue&&re(O,Ye.semver))return!1}return!0}t.prerelease=S_;function S_(O,N){var L=E(O,N);return L&&L.prerelease.length?L.prerelease:null}t.intersects=R_;function R_(O,N,L){return O=new j(O,L),N=new j(N,L),O.intersects(N)}t.coerce=b_;function b_(O,N){if(O instanceof f)return O;if(typeof O=="number"&&(O=String(O)),typeof O!="string")return null;N=N||{};var L=null;if(!N.rtl)L=O.match(c[o.COERCE]);else{for(var H;(H=c[o.COERCERTL].exec(O))&&(!L||L.index+L[0].length!==O.length);)(!L||H.index+H[0].length!==L.index+L[0].length)&&(L=H),c[o.COERCERTL].lastIndex=H.index+H[1].length+H[2].length;c[o.COERCERTL].lastIndex=-1}return L===null?null:E(L[2]+"."+(L[3]||"0")+"."+(L[4]||"0"),N)}})(on,on.exports)),on.exports}var qt=Ar.exports,xh;function yR(){return xh||(xh=1,(function(e,t){var r=qt&&qt.__createBinding||(Object.create?function(R,p,h,y){y===void 0&&(y=h);var v=Object.getOwnPropertyDescriptor(p,h);(!v||("get"in v?!p.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return p[h]}}),Object.defineProperty(R,y,v)}:function(R,p,h,y){y===void 0&&(y=h),R[y]=p[h]}),n=qt&&qt.__setModuleDefault||(Object.create?function(R,p){Object.defineProperty(R,"default",{enumerable:!0,value:p})}:function(R,p){R.default=p}),i=qt&&qt.__importStar||function(R){if(R&&R.__esModule)return R;var p={};if(R!=null)for(var h in R)h!=="default"&&Object.prototype.hasOwnProperty.call(R,h)&&r(p,R,h);return n(p,R),p},a=qt&&qt.__awaiter||function(R,p,h,y){function v(g){return g instanceof h?g:new h(function(E){E(g)})}return new(h||(h=Promise))(function(g,E){function d(b){try{f(y.next(b))}catch($){E($)}}function w(b){try{f(y.throw(b))}catch($){E($)}}function f(b){b.done?g(b.value):v(b.value).then(d,w)}f((y=y.apply(R,p||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._readLinuxVersionFile=t._getOsVersion=t._findMatch=void 0;const s=i(Cm()),l=vr(),c=le,u=xt,o=oe;function m(R,p,h,y){return a(this,void 0,void 0,function*(){const v=c.platform();let g,E,d;for(const w of h){const f=w.version;if((0,l.debug)(`check ${f} satisfies ${R}`),s.satisfies(f,R)&&(!p||w.stable===p)&&(d=w.files.find(b=>{(0,l.debug)(`${b.arch}===${y} && ${b.platform}===${v}`);let $=b.arch===y&&b.platform===v;if($&&b.platform_version){const T=e.exports._getOsVersion();T===b.platform_version?$=!0:$=s.satisfies(T,b.platform_version)}return $}),d)){(0,l.debug)(`matched ${w.version}`),E=w;break}}return E&&d&&(g=Object.assign({},E),g.files=[d]),g})}t._findMatch=m;function _(){const R=c.platform();let p="";if(R==="darwin")p=u.execSync("sw_vers -productVersion").toString();else if(R==="linux"){const h=e.exports._readLinuxVersionFile();if(h){const y=h.split(`
|
||
`);for(const v of y){const g=v.split("=");if(g.length===2&&(g[0].trim()==="VERSION_ID"||g[0].trim()==="DISTRIB_RELEASE")){p=g[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return p}t._getOsVersion=_;function S(){const R="/etc/lsb-release",p="/etc/os-release";let h="";return o.existsSync(R)?h=o.readFileSync(R).toString():o.existsSync(p)&&(h=o.readFileSync(p).toString()),h}t._readLinuxVersionFile=S})(Ar,Ar.exports)),Ar.exports}var et={},Ch;function vR(){if(Ch)return et;Ch=1;var e=et&&et.__createBinding||(Object.create?function(s,l,c,u){u===void 0&&(u=c);var o=Object.getOwnPropertyDescriptor(l,c);(!o||("get"in o?!l.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(s,u,o)}:function(s,l,c,u){u===void 0&&(u=c),s[u]=l[c]}),t=et&&et.__setModuleDefault||(Object.create?function(s,l){Object.defineProperty(s,"default",{enumerable:!0,value:l})}:function(s,l){s.default=l}),r=et&&et.__importStar||function(s){if(s&&s.__esModule)return s;var l={};if(s!=null)for(var c in s)c!=="default"&&Object.prototype.hasOwnProperty.call(s,c)&&e(l,s,c);return t(l,s),l},n=et&&et.__awaiter||function(s,l,c,u){function o(m){return m instanceof c?m:new c(function(_){_(m)})}return new(c||(c=Promise))(function(m,_){function S(h){try{p(u.next(h))}catch(y){_(y)}}function R(h){try{p(u.throw(h))}catch(y){_(y)}}function p(h){h.done?m(h.value):o(h.value).then(S,R)}p((u=u.apply(s,l||[])).next())})};Object.defineProperty(et,"__esModule",{value:!0}),et.RetryHelper=void 0;const i=r(vr());class a{constructor(l,c,u){if(l<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=l,this.minSeconds=Math.floor(c),this.maxSeconds=Math.floor(u),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(l,c){return n(this,void 0,void 0,function*(){let u=1;for(;u<this.maxAttempts;){try{return yield l()}catch(m){if(c&&!c(m))throw m;i.info(m.message)}const o=this.getSleepAmount();i.info(`Waiting ${o} seconds before trying again`),yield this.sleep(o),u++}return yield l()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(l){return n(this,void 0,void 0,function*(){return new Promise(c=>setTimeout(c,l*1e3))})}}return et.RetryHelper=a,et}var Dh;function wR(){if(Dh)return ce;Dh=1;var e=ce&&ce.__createBinding||(Object.create?function(M,U,j,W){W===void 0&&(W=j);var Y=Object.getOwnPropertyDescriptor(U,j);(!Y||("get"in Y?!U.__esModule:Y.writable||Y.configurable))&&(Y={enumerable:!0,get:function(){return U[j]}}),Object.defineProperty(M,W,Y)}:function(M,U,j,W){W===void 0&&(W=j),M[W]=U[j]}),t=ce&&ce.__setModuleDefault||(Object.create?function(M,U){Object.defineProperty(M,"default",{enumerable:!0,value:U})}:function(M,U){M.default=U}),r=ce&&ce.__importStar||function(M){if(M&&M.__esModule)return M;var U={};if(M!=null)for(var j in M)j!=="default"&&Object.prototype.hasOwnProperty.call(M,j)&&e(U,M,j);return t(U,M),U},n=ce&&ce.__awaiter||function(M,U,j,W){function Y(te){return te instanceof j?te:new j(function(Z){Z(te)})}return new(j||(j=Promise))(function(te,Z){function qe(Ae){try{Ke(W.next(Ae))}catch(Lt){Z(Lt)}}function Ne(Ae){try{Ke(W.throw(Ae))}catch(Lt){Z(Lt)}}function Ke(Ae){Ae.done?te(Ae.value):Y(Ae.value).then(qe,Ne)}Ke((W=W.apply(M,U||[])).next())})};Object.defineProperty(ce,"__esModule",{value:!0}),ce.evaluateVersions=ce.isExplicitVersion=ce.findFromManifest=ce.getManifestFromRepo=ce.findAllVersions=ce.find=ce.cacheFile=ce.cacheDir=ce.extractZip=ce.extractXar=ce.extractTar=ce.extract7z=ce.downloadTool=ce.HTTPError=void 0;const i=r(vr()),a=r(yp()),s=r(su),l=r(oe),c=r(yR()),u=r(le),o=r(F),m=r(mp),_=r(Cm()),S=r(Mr),R=r(_r),p=Ur,h=ou(),y=vR();class v extends Error{constructor(U){super(`Unexpected HTTP response: ${U}`),this.httpStatusCode=U,Object.setPrototypeOf(this,new.target.prototype)}}ce.HTTPError=v;const g=process.platform==="win32",E=process.platform==="darwin",d="actions/tool-cache";function w(M,U,j,W){return n(this,void 0,void 0,function*(){U=U||o.join(ie(),s.randomUUID()),yield a.mkdirP(o.dirname(U)),i.debug(`Downloading ${M}`),i.debug(`Destination ${U}`);const Y=3,te=ae("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),Z=ae("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new y.RetryHelper(Y,te,Z).execute(()=>n(this,void 0,void 0,function*(){return yield f(M,U||"",j,W)}),Ne=>!(Ne instanceof v&&Ne.httpStatusCode&&Ne.httpStatusCode<500&&Ne.httpStatusCode!==408&&Ne.httpStatusCode!==429))})}ce.downloadTool=w;function f(M,U,j,W){return n(this,void 0,void 0,function*(){if(l.existsSync(U))throw new Error(`Destination file path ${U} already exists`);const Y=new m.HttpClient(d,[],{allowRetries:!1});j&&(i.debug("set auth"),W===void 0&&(W={}),W.authorization=j);const te=yield Y.get(M,W);if(te.message.statusCode!==200){const Ae=new v(te.message.statusCode);throw i.debug(`Failed to download from "${M}". Code(${te.message.statusCode}) Message(${te.message.statusMessage})`),Ae}const Z=R.promisify(S.pipeline),Ne=ae("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>te.message)();let Ke=!1;try{return yield Z(Ne,l.createWriteStream(U)),i.debug("download complete"),Ke=!0,U}finally{if(!Ke){i.debug("download failed");try{yield a.rmRF(U)}catch(Ae){i.debug(`Failed to delete '${U}'. ${Ae.message}`)}}}})}function b(M,U,j){return n(this,void 0,void 0,function*(){(0,p.ok)(g,"extract7z() not supported on current OS"),(0,p.ok)(M,'parameter "file" is required'),U=yield x(U);const W=process.cwd();if(process.chdir(U),j)try{const te=["x",i.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",M],Z={silent:!0};yield(0,h.exec)(`"${j}"`,te,Z)}finally{process.chdir(W)}else{const Y=o.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),te=M.replace(/'/g,"''").replace(/"|\n|\r/g,""),Z=U.replace(/'/g,"''").replace(/"|\n|\r/g,""),Ne=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${Y}' -Source '${te}' -Target '${Z}'`],Ke={silent:!0};try{const Ae=yield a.which("powershell",!0);yield(0,h.exec)(`"${Ae}"`,Ne,Ke)}finally{process.chdir(W)}}return U})}ce.extract7z=b;function $(M,U,j="xz"){return n(this,void 0,void 0,function*(){if(!M)throw new Error("parameter 'file' is required");U=yield x(U),i.debug("Checking tar --version");let W="";yield(0,h.exec)("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:Ne=>W+=Ne.toString(),stderr:Ne=>W+=Ne.toString()}}),i.debug(W.trim());const Y=W.toUpperCase().includes("GNU TAR");let te;j instanceof Array?te=j:te=[j],i.isDebug()&&!j.includes("v")&&te.push("-v");let Z=U,qe=M;return g&&Y&&(te.push("--force-local"),Z=U.replace(/\\/g,"/"),qe=M.replace(/\\/g,"/")),Y&&(te.push("--warning=no-unknown-keyword"),te.push("--overwrite")),te.push("-C",Z,"-f",qe),yield(0,h.exec)("tar",te),U})}ce.extractTar=$;function T(M,U,j=[]){return n(this,void 0,void 0,function*(){(0,p.ok)(E,"extractXar() not supported on current OS"),(0,p.ok)(M,'parameter "file" is required'),U=yield x(U);let W;j instanceof Array?W=j:W=[j],W.push("-x","-C",U,"-f",M),i.isDebug()&&W.push("-v");const Y=yield a.which("xar",!0);return yield(0,h.exec)(`"${Y}"`,ge(W)),U})}ce.extractXar=T;function k(M,U){return n(this,void 0,void 0,function*(){if(!M)throw new Error("parameter 'file' is required");return U=yield x(U),g?yield B(M,U):yield G(M,U),U})}ce.extractZip=k;function B(M,U){return n(this,void 0,void 0,function*(){const j=M.replace(/'/g,"''").replace(/"|\n|\r/g,""),W=U.replace(/'/g,"''").replace(/"|\n|\r/g,""),Y=yield a.which("pwsh",!1);if(Y){const Z=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${j}', '${W}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${j}' -DestinationPath '${W}' -Force } else { throw $_ } } ;`].join(" ")];i.debug(`Using pwsh at path: ${Y}`),yield(0,h.exec)(`"${Y}"`,Z)}else{const Z=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${j}' -DestinationPath '${W}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${j}', '${W}', $true) }`].join(" ")],qe=yield a.which("powershell",!0);i.debug(`Using powershell at path: ${qe}`),yield(0,h.exec)(`"${qe}"`,Z)}})}function G(M,U){return n(this,void 0,void 0,function*(){const j=yield a.which("unzip",!0),W=[M];i.isDebug()||W.unshift("-q"),W.unshift("-o"),yield(0,h.exec)(`"${j}"`,W,{cwd:U})})}function P(M,U,j,W){return n(this,void 0,void 0,function*(){if(j=_.clean(j)||j,W=W||u.arch(),i.debug(`Caching tool ${U} ${j} ${W}`),i.debug(`source dir: ${M}`),!l.statSync(M).isDirectory())throw new Error("sourceDir is not a directory");const Y=yield z(U,j,W);for(const te of l.readdirSync(M)){const Z=o.join(M,te);yield a.cp(Z,Y,{recursive:!0})}return V(U,j,W),Y})}ce.cacheDir=P;function I(M,U,j,W,Y){return n(this,void 0,void 0,function*(){if(W=_.clean(W)||W,Y=Y||u.arch(),i.debug(`Caching tool ${j} ${W} ${Y}`),i.debug(`source file: ${M}`),!l.statSync(M).isFile())throw new Error("sourceFile is not a file");const te=yield z(j,W,Y),Z=o.join(te,U);return i.debug(`destination file ${Z}`),yield a.cp(M,Z),V(j,W,Y),te})}ce.cacheFile=I;function A(M,U,j){if(!M)throw new Error("toolName parameter is required");if(!U)throw new Error("versionSpec parameter is required");if(j=j||u.arch(),!Q(U)){const Y=D(M,j);U=se(Y,U)}let W="";if(U){U=_.clean(U)||"";const Y=o.join(X(),M,U,j);i.debug(`checking cache: ${Y}`),l.existsSync(Y)&&l.existsSync(`${Y}.complete`)?(i.debug(`Found tool in cache ${M} ${U} ${j}`),W=Y):i.debug("not found")}return W}ce.find=A;function D(M,U){const j=[];U=U||u.arch();const W=o.join(X(),M);if(l.existsSync(W)){const Y=l.readdirSync(W);for(const te of Y)if(Q(te)){const Z=o.join(W,te,U||"");l.existsSync(Z)&&l.existsSync(`${Z}.complete`)&&j.push(te)}}return j}ce.findAllVersions=D;function C(M,U,j,W="master"){return n(this,void 0,void 0,function*(){let Y=[];const te=`https://api.github.com/repos/${M}/${U}/git/trees/${W}`,Z=new m.HttpClient("tool-cache"),qe={};j&&(i.debug("set auth"),qe.authorization=j);const Ne=yield Z.getJson(te,qe);if(!Ne.result)return Y;let Ke="";for(const Lt of Ne.result.tree)if(Lt.path==="versions-manifest.json"){Ke=Lt.url;break}qe.accept="application/vnd.github.VERSION.raw";let Ae=yield(yield Z.get(Ke,qe)).readBody();if(Ae){Ae=Ae.replace(/^\uFEFF/,"");try{Y=JSON.parse(Ae)}catch{i.debug("Invalid json")}}return Y})}ce.getManifestFromRepo=C;function q(M,U,j,W=u.arch()){return n(this,void 0,void 0,function*(){return yield c._findMatch(M,U,j,W)})}ce.findFromManifest=q;function x(M){return n(this,void 0,void 0,function*(){return M||(M=o.join(ie(),s.randomUUID())),yield a.mkdirP(M),M})}function z(M,U,j){return n(this,void 0,void 0,function*(){const W=o.join(X(),M,_.clean(U)||U,j||"");i.debug(`destination ${W}`);const Y=`${W}.complete`;return yield a.rmRF(W),yield a.rmRF(Y),yield a.mkdirP(W),W})}function V(M,U,j){const Y=`${o.join(X(),M,_.clean(U)||U,j||"")}.complete`;l.writeFileSync(Y,""),i.debug("finished caching tool")}function Q(M){const U=_.clean(M)||"";i.debug(`isExplicit: ${U}`);const j=_.valid(U)!=null;return i.debug(`explicit? ${j}`),j}ce.isExplicitVersion=Q;function se(M,U){let j="";i.debug(`evaluating ${M.length} versions`),M=M.sort((W,Y)=>_.gt(W,Y)?1:-1);for(let W=M.length-1;W>=0;W--){const Y=M[W];if(_.satisfies(Y,U)){j=Y;break}}return j?i.debug(`matched: ${j}`):i.debug("match not found"),j}ce.evaluateVersions=se;function X(){const M=process.env.RUNNER_TOOL_CACHE||"";return(0,p.ok)(M,"Expected RUNNER_TOOL_CACHE to be defined"),M}function ie(){const M=process.env.RUNNER_TEMP||"";return(0,p.ok)(M,"Expected RUNNER_TEMP to be defined"),M}function ae(M,U){const j=tt[M];return j!==void 0?j:U}function ge(M){return Array.from(new Set(M))}return ce}var Vn=wR(),Ot={},Fh;function gR(){if(Fh)return Ot;Fh=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.retryAsPromised=Ot.applyJitter=Ot.TimeoutError=void 0;class e extends Error{constructor(a,s){super(a),this.name="TimeoutError",this.previous=s}}Ot.TimeoutError=e;function t(i,a){if(typeof i=="function")try{if(a instanceof i)return!0}catch{return!!i(a)}return i===a.toString()||i===a.message?!0:i instanceof RegExp&&(i.test(a.message)||i.test(a.toString()))}function r(i,a){const s=i+Math.random()*a*(Math.random()>.5?1:-1);return Math.max(0,s)}Ot.applyJitter=r;function n(i,a){if(!i||!a)throw new Error("retry-as-promised must be passed a callback and a options set");a=typeof a=="number"?{max:a}:a;const s={$current:"$current"in a?a.$current:1,max:a.max,timeout:a.timeout||void 0,match:a.match?Array.isArray(a.match)?a.match:[a.match]:[],backoffBase:a.backoffBase===void 0?100:a.backoffBase,backoffExponent:a.backoffExponent||1.1,backoffJitter:a.backoffJitter||0,report:a.report,name:a.name||i.name||"unknown"};return s.match&&!Array.isArray(s.match)&&(s.match=[s.match]),s.report&&s.report("Trying "+s.name+" #"+s.$current+" at "+new Date().toLocaleTimeString(),s),new Promise(function(l,c){let u,o,m;s.timeout&&(u=setTimeout(function(){o&&clearTimeout(o),c(new e(s.name+" timed out",m))},s.timeout)),Promise.resolve(i({current:s.$current})).then(l).then(function(){u&&clearTimeout(u),o&&clearTimeout(o)}).catch(function(_){u&&clearTimeout(u),o&&clearTimeout(o),m=_,s.report&&s.report(_&&_.toString()||_,s,_);var S=s.$current<s.max;if(!S||(S=s.match.length===0||s.match.some(function(h){return t(h,_)}),!S))return c(_);var R=s.backoffBase*Math.pow(s.backoffExponent,s.$current-1);const p=s.backoffJitter;p!==void 0&&(R=r(R,p)),s.$current++,s.report&&s.report(`Retrying ${s.name} (${s.$current})`,s),R?(s.report&&s.report(`Delaying retry of ${s.name} by ${R}`,s),o=setTimeout(function(){n(i,s).then(l).catch(c)},R)):n(i,s).then(l).catch(c)})})}return Ot.retryAsPromised=n,Ot.default=n,Ot}var ER=gR();const Dm=$e(ER),{GITHUB_ACTIONS:Fm}=Et;async function vt(e,t,r,n,i){var S,R;J(`Installing ${e} ${t} ${i} via direct downloading`),process.env.RUNNER_TEMP=(S=process.env.RUNNER_TEMP)!=null?S:le.tmpdir(),process.env.RUNNER_TOOL_CACHE=(R=process.env.RUNNER_TOOL_CACHE)!=null?R:F.join(le.tmpdir(),"setup-cpp","hostedtoolcache");const{url:a,binRelativeDir:s,binFileName:l,extractedFolderName:c,extractFunction:u}=await r(t,process.platform,i);if(Fm)try{const p=Vn.find(e,t);if(p){const h=F.join(p,c),y=F.join(h,s);if(await ye(F.join(y,l)))return J(`${e} ${t} was found in the cache at ${y}.`),await Oe(y,ne),{installDir:h,binDir:y}}}catch{}const o=F.join(n,c),m=F.join(o,s),_=F.join(m,l);return await SR(m,_,e,t,a,n,u,i),await bR(n,e,t),{installDir:o,binDir:m}}async function SR(e,t,r,n,i,a,s,l){if((await Promise.all([ye(e),ye(t)])).includes(!1))try{const c=await RR(r,n,i);J(`Extracting ${c} to ${a}`),await(s!=null?s:jm(km(i)))(c,a)}catch(c){throw new Error(`Failed to download ${r} ${n} ${l} from ${i}: ${c}`)}if(J(`Add ${e} to PATH`),await Oe(e,ne),!await ye(t))throw new Error(`Failed to find the binary ${t} after extracting ${r} ${n} ${l}`);if(process.platform!=="win32")try{await uu(t,"755")}catch(c){ve(`Failed to make ${t} executable: ${c}`)}}async function RR(e,t,r){return J(`Download ${e} ${t}`),await Dm(()=>{var s;const i=`${Date.now()}-setup-cpp-`,a=F.join((s=process.env.RUNNER_TEMP)!=null?s:le.tmpdir(),`${i}${F.basename(r)}`);return Vn.downloadTool(r,a)},{name:r,max:4,backoffBase:2e3,report:i=>J(i)})}async function bR(e,t,r){Fm&&typeof process.env.RUNNER_TOOL_CACHE=="string"&&(vp("cache-tools")==="true"||process.env.CACHE_TOOLS==="true")&&await Vn.cacheDir(e,t,r)}async function qm({version:e,arch:t,setupDir:r}){const n=await de("tar",{nothrow:!0});if(n!==null){J(`tar already installed at ${n}`);return}switch(process.platform){case"win32":return vt("tar",e,$R,r,t);case"darwin":return Me("gnu-tar",e);case"linux":{if(Te())return await Re("gzip"),await Re("xz"),Re("tar");if(Ce())return xe([{name:"tar"},{name:"gzip"},{name:"xz"}]);if(_e())return he([{name:"tar"},{name:"gzip"},{name:"xz-utils"}]);if(await Ie())return Fe([{name:"tar"},{name:"gzip"},{name:"xz"}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function $R(e,t,r){if(t!=="win32")throw new Error("Unsupported platform");return r!=="x64"&&ve(`Unsupported architecture ${r} for tar on Windows. Using x64.`),{url:`https://phoenixnap.dl.sourceforge.net/project/gnuwin32/tar/${e}/tar-${e}-bin.zip?viasf=1`,extractedFolderName:"",binRelativeDir:"bin",binFileName:"tar.exe"}}var dn=(e=>(e[e.Tar=0]="Tar",e[e.TarGz=1]="TarGz",e[e.TarXz=2]="TarXz",e[e.Zip=3]="Zip",e[e.SevenZip=4]="SevenZip",e))(dn||{});function km(e){const t=e.split(".").pop();return t==="tar"?0:t==="gz"||t==="tgz"?1:t==="xz"||t==="txz"?2:t==="zip"?3:(t==="7z"||t==="exe"||ve(`Unknown archive type: ${t}. Defaulting to 7z`),4)}function jm(e){switch(e){case 0:case 1:case 2:return process.platform==="win32"?hr:Tu;case 3:return TR;default:return hr}}let qa;async function hr(e,t,r=!1){const n=F.basename(e);return/.*\.tar\..+$/.test(n)?await OR(e,n,t,r):await Xa(e,t),t}async function OR(e,t,r,n){if(!/.*\.tar\..+$/.test(t))throw new Error(`Invalid tar file: ${t}`);const i=F.join(F.dirname(e),"sevenzip-temp");await Xa(e,i);const a=t.slice(0,-3),s=F.join(i,a);await Xa(s,i),await Tt.remove(s),J(`Moving ${i} to ${r}`);const l=await Tt.readdir(i);await Promise.all(l.map(async c=>{await Tt.move(F.join(i,c),F.join(r,c),{overwrite:!0})})),await Tt.remove(i),n&&await IR(r)}async function IR(e){J(`Stripping path components from ${e}`);const t=await Tt.readdir(e);if(t.length!==1)throw new Error(`Expected 1 folder in ${e}, got ${t.length}`);const r=t[0],n=F.join(e,r),i=await Tt.stat(n);if(!i.isDirectory()){ve(`Expected ${n} to be a directory, got ${i}.`);return}const a=await Tt.readdir(n);await Promise.all(a.map(s=>Tt.move(F.join(n,s),F.join(e,s),{overwrite:!0}))),await Tt.remove(n)}async function Xa(e,t){J(`7z: extracting ${e} to ${t}`),await fe(await PR(),["x",e,`-o${t}`,"-y"],{stdio:"inherit"}),await Er(t)}async function PR(){return qa===void 0&&(de.sync("7z",{nothrow:!0})===null&&await fn({version:""}),qa="7z"),qa}async function TR(e,t){return de.sync("7z",{nothrow:!0})!==null?hr(e,t):de.sync("unzip",{nothrow:!0})!==null?(await fe("unzip",["-q",e,"-d",t],{stdio:"inherit"}),await Er(t),t):hr(e,t)}async function Tu(e,t,r=0,n=[]){await qm({version:"",arch:process.arch,setupDir:nt("~/tar")});try{await Tt.mkdirp(t)}catch{}try{await fe("tar",["xf",e,"-C",t,`--strip-components=${r}`,...n],{stdio:"inherit"})}catch(i){process.platform==="win32"&&i.message.includes("Can't create '\\\\?\\C:")&&ve(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`)}return await Er(t),t}const{GITHUB_ACTIONS:NR}=Et,AR=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function Nu({version:e,setupDir:t,arch:r}){let n;switch(process.platform){case"win32":{(r==="arm"||r==="arm64")&&(n=await De("gcc-arm-embedded",e));try{n=await vt("g++",e,xR,t,r)}catch(i){J(`Failed to download g++ binary. ${i}. Falling back to chocolatey.`),n=await LR(e,r)}break}case"linux":{if(Te())n=await Re("mingw-w64-gcc",e);else if(Ce())n=await xe([{name:"mingw64-gcc",version:e}]);else if(_e())n=await he([{name:"mingw-w64",version:e}]);else if(await Ie())await lm(),n=await Fe([{name:"mingw-w64-gcc",version:e},{name:"mingw-w64-crt",version:e}]);else throw new Error(`Unsupported Linux distro for ${r}`);break}default:throw new Error(`Unsupported platform for ${r}`)}return n!==void 0&&await CR(n.binDir),n}async function LR(e,t){var n,i;await De("mingw",e);let r;if(t==="x64"&&await ye("C:/tools/mingw64/bin")?(r="C:/tools/mingw64/bin",await Oe(r,ne)):t==="ia32"&&await ye("C:/tools/mingw32/bin")?(r="C:/tools/mingw32/bin",await Oe(r,ne)):await ye(`${(n=process.env.ChocolateyInstall)!=null?n:"C:/ProgramData/chocolatey"}/bin/g++.exe`)&&(r=`${(i=process.env.ChocolateyInstall)!=null?i:"C:/ProgramData/chocolatey"}/bin`),r!==void 0)return{binDir:r}}async function xR(e,t,r){var u;if(t!=="win32")throw new Error(`Unsupported platform '${t}'`);const n=await Rn(F.join(AR,"github_brechtsanders_winlibs_mingw.json")),i={x64:"x86_64",ia32:"i386"},a=ka(e),s=ja(e),l=qh(e),c=bn(n,{version:e,keywords:[(u=i[r])!=null?u:r],filterName:o=>(a===void 0||a===ka(o))&&(s===void 0||s===ja(o))&&(l===void 0||l===qh(o)),versionSatisfies:(o,m)=>{const _=dr(o);if(_===null)throw new Error(`Invalid MinGW asset version: '${o}'`);return bu(_,m)&&(a===void 0||a===ka(o))&&(s===void 0||s===ja(o))}});if(c===void 0)throw new Error(`No asset found for version ${e} and arch ${r}`);return{binRelativeDir:"bin/",binFileName:Ee("g++"),extractedFolderName:"mingw64",extractFunction:hr,url:`https://github.com/brechtsanders/winlibs_mingw/releases/download/${c.tag}/${c.name}`}}function ka(e){const t=e.match(/(ucrt|msvcrt)/);return t!==null?t[1]:void 0}function ja(e){const t=e.match(/(posix|mcf)/);return t!==null?t[1]:void 0}function qh(e){const t=e.match(/(seh|dwarf)/);return t!==null?t[1]:void 0}async function CR(e){const t=[];process.platform==="win32"&&t.push(Pe("CC",Ee(`${e}/gcc`),ne),Pe("CXX",Ee(`${e}/g++`),ne)),NR&&await Am(),await Promise.all(t)}const{GITHUB_ACTIONS:DR}=Et,FR=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function $n({version:e,setupDir:t,arch:r,priority:n=40}){let i;switch(process.platform){case"win32":{i=await Nu({version:e,setupDir:t,arch:r});break}case"darwin":{i=await Me("gcc",e);break}case"linux":{if(Te())i=await Re("gcc",e);else if(Ce())i=await xe([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]);else if(await Ie())i=await Fe([{name:"gcc",version:e},{name:"g++",version:e}]);else if(_e())if(e==="")i=await he([{name:"gcc"},{name:"g++"}]);else try{i=await he([{name:"gcc",version:e},{name:"g++",version:e}])}catch{i=await he([{name:"gcc",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}},{name:"g++",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}])}break}default:throw new Error(`Unsupported platform for ${r}`)}if(i!==void 0)return await qR(e,i.binDir,n),i}async function qR(e,t,r=40){if(process.platform==="win32")return;const n=[];{const i=kR(e),[a,s]=await Promise.all([kh("gcc",t,i),kh("g++",t,i)]);n.push(Pe("CC",a,ne),Pe("CXX",s,ne)),_e()&&n.push(_t("cc",a,ne,r),_t("cxx",s,ne,r),_t("gcc",a,ne,r),_t("g++",s,ne,r))}n.push($m()),DR&&await Am(),await Promise.all(n)}function kR(e){try{const t=$u(e),r=um(t);return r>=5?`${r}`:e}catch{return e}}async function kh(e,t,r){var a,s;if(await ye(`${t}/${e}-${r}`))return Ee(`${t}/${e}-${r}`);const n=new RegExp(`^${En(e)}-?([\\d\\.\\-]*)(?:\\.exe)?$`),i=(await cu(t)).filter(l=>n.test(l)).sort((l,c)=>{var m,_,S,R;const u=(_=(m=l.match(n))==null?void 0:m[1])!=null?_:"",o=(R=(S=c.match(n))==null?void 0:S[1])!=null?R:"";try{return HS(u,o)}catch{return 0}});for(const l of i){const c=`${t}/${l}`;if(r===""||l.includes(r)||(s=(a=await jR(c))==null?void 0:a.includes(r))!=null&&s)return Ee(c)}return await ye(`${t}/${e}`)?Ee(`${t}/${e}`):Ee(e)}async function jR(e){try{const{stdout:t}=await fe(e,["--version"],{stdio:"pipe"}),r=t.match(/(gcc|g\+\+).* \(.*\) ([\d.]+)/);if(r!==null)return r[2];ve(`Failed to parse gcc version from: ${t}`)}catch(t){Le(`Failed to get gcc version: ${t}`)}}const Ut=e=>{if(!e)e={mode:511};else if(typeof e=="object")e={mode:511,...e};else if(typeof e=="number")e={mode:e};else if(typeof e=="string")e={mode:parseInt(e,8)};else throw new TypeError("invalid options argument");const t=e,r=e.fs||{};return e.mkdir=e.mkdir||r.mkdir||oe.mkdir,e.mkdirAsync=e.mkdirAsync?e.mkdirAsync:async(n,i)=>new Promise((a,s)=>t.mkdir(n,i,(l,c)=>l?s(l):a(c))),e.stat=e.stat||r.stat||oe.stat,e.statAsync=e.statAsync?e.statAsync:async n=>new Promise((i,a)=>t.stat(n,(s,l)=>s?a(s):i(l))),e.statSync=e.statSync||r.statSync||oe.statSync,e.mkdirSync=e.mkdirSync||r.mkdirSync||oe.mkdirSync,t},Zt=(e,t,r)=>{const n=F.dirname(e),i={...Ut(t),recursive:!1};if(n===e)try{return i.mkdirSync(e,i)}catch(a){const s=a;if(s&&s.code!=="EISDIR")throw a;return}try{return i.mkdirSync(e,i),r||e}catch(a){const s=a;if(s&&s.code==="ENOENT")return Zt(e,i,Zt(n,i,r));if(s&&s.code!=="EEXIST"&&s&&s.code!=="EROFS")throw a;try{if(!i.statSync(e).isDirectory())throw a}catch{throw a}}},cr=Object.assign(async(e,t,r)=>{const n=Ut(t);n.recursive=!1;const i=F.dirname(e);return i===e?n.mkdirAsync(e,n).catch(a=>{const s=a;if(s&&s.code!=="EISDIR")throw a}):n.mkdirAsync(e,n).then(()=>r||e,async a=>{const s=a;if(s&&s.code==="ENOENT")return cr(i,n).then(l=>cr(e,n,l));if(s&&s.code!=="EEXIST"&&s.code!=="EROFS")throw a;return n.statAsync(e).then(l=>{if(l.isDirectory())return r;throw a},()=>{throw a})})},{sync:Zt}),Um=async(e,t,r)=>{if(r!==t)return e.statAsync(t).then(n=>n.isDirectory()?r:void 0,n=>{const i=n;return i&&i.code==="ENOENT"?Um(e,F.dirname(t),t):void 0})},Mm=(e,t,r)=>{if(r!==t)try{return e.statSync(t).isDirectory()?r:void 0}catch(n){const i=n;return i&&i.code==="ENOENT"?Mm(e,F.dirname(t),t):void 0}},On=(e,t)=>{const r=Ut(t);if(r.recursive=!0,F.dirname(e)===e)return r.mkdirSync(e,r);const i=Mm(r,e);try{return r.mkdirSync(e,r),i}catch(a){const s=a;if(s&&s.code==="ENOENT")return Zt(e,r);throw a}},Ua=Object.assign(async(e,t)=>{const r={...Ut(t),recursive:!0};return F.dirname(e)===e?await r.mkdirAsync(e,r):Um(r,e).then(i=>r.mkdirAsync(e,r).then(a=>i||a).catch(a=>{const s=a;if(s&&s.code==="ENOENT")return cr(e,r);throw a}))},{sync:On}),UR=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,Gm=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=F.resolve(e),UR==="win32"){const t=/[*|"<>?:]/,{root:r}=F.parse(e);if(t.test(e.substring(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e},MR=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,Ma=MR.replace(/^v/,"").split("."),Vm=+Ma[0]>10||+Ma[0]==10&&+Ma[1]>=12,Au=Vm?e=>Ut(e).mkdirSync===oe.mkdirSync:()=>!1,jh=Object.assign(Vm?e=>Ut(e).mkdir===oe.mkdir:()=>!1,{sync:Au}),Uh=(e,t)=>{e=Gm(e);const r=Ut(t);return Au(r)?On(e,r):Zt(e,r)},Lr=Object.assign(async(e,t)=>{e=Gm(e);const r=Ut(t);return jh(r)?Ua(e,r):cr(e,r)},{mkdirpSync:Uh,mkdirpNative:Ua,mkdirpNativeSync:On,mkdirpManual:cr,mkdirpManualSync:Zt,sync:Uh,native:Ua,nativeSync:On,manual:cr,manualSync:Zt,useNative:jh,useNativeSync:Au});function it(e,t,r=null){var n;return Bm(t)?(n=Lu(e,r))!=null?n:"":t}function GR(){const e=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href)),t=F.join(e,"versions.json");return JSON.parse(oe.readFileSync(t,"utf-8"))}const VR=ke(GR);function Lu(e,t=null){var _,S,R;const n=VR()[e];if(n===void 0)return;if(typeof n=="string")return n;const i=n,a=(_=i[process.platform])!=null?_:i.else;if(a===void 0)throw new Error(`Platform "${process.platform}" not found in versions data for tool "${e}"`);if(typeof a=="string")return a;const s=a,l=_e()?"ubuntu":Te()?"archlinux":cm()?"alpine":Ce()?"fedora":"else",c=(S=s[l])!=null?S:s.else;if(c===void 0)throw new Error(`Distro "${l}" not found in versions data for tool "${e}"`);if(typeof c=="string")return c;const u=c,o=t!==null?BR(t,u):u.else;if(o===void 0)throw new Error(`Architecture "${process.arch}" not found in versions data for tool "${e}"`);if(typeof o=="string")return o;const m=o;return(R=m[process.arch])!=null?R:m.else}function BR(e,t){var i;const r=e[0],n=Object.keys(t).map(a=>Number.parseInt(a,10)).filter(a=>!Number.isNaN(a)).sort((a,s)=>s-a).find(a=>r>=a);return n!==void 0&&(i=t[n])!=null?i:t.else}function Bm(e){return e==="true"||e===void 0}function zR(e,t,r=void 0){var c,u;const n=r===void 0?!1:t.includes(r.compiler),a=(n?t:t.filter(o=>o!=="compiler")).filter(o=>e[o]!==void 0),s=a.filter(o=>{const m=n&&o==="compiler"&&r!==void 0?r.version:e[o];return!Bm(m)}),l=s.length!==0?n&&s[0]==="compiler"&&r!==void 0?(c=r.version)!=null?c:"true":(u=e[s[0]])!=null?u:"true":"true";if(s.some(o=>n&&o==="compiler"&&r!==void 0?e.compiler!==`${r.compiler}-${l}`:e[o]!==l))return!1;for(const o of a)e[o]=n&&o==="compiler"&&r!==void 0?`${r.compiler}-${l}`:l;return!0}function HR(e){return e.startsWith(">")}const{GITHUB_ACTIONS:WR}=Et;async function zm({version:e,setupDir:t,arch:r}){Se.startGroup("Setup Python");const n=await QR(e,t,r);Ur(n.bin!==void 0);const i=n.bin;Se.endGroup(),Se.startGroup("Setup venv"),await KR(i),Se.endGroup(),Se.startGroup("Setup pip");const a=await e0(i);if(Se.endGroup(),a===void 0)throw new Error("pip was not installed correctly");return Se.startGroup("Setup pipx"),await XR(i),Se.endGroup(),Se.startGroup("Setup wheel"),await JR(i),Se.endGroup(),n}async function XR(e){try{if(!await pn(e)){try{await kr("pipx")}catch(t){Jt(`pipx was not installed completely for the system-wide python: ${t}`)}try{await pn(e)||await In(e,"pipx",void 0,{upgrade:!0,usePipx:!1})}catch(t){Jt(`pipx was not installed completely for ${e}: ${t}`)}}if(await pn(e))await fe(e,["-m","pipx","ensurepath"],{stdio:"inherit"});else if(await o0())Jt(`pipx module not found for ${e}. Trying to install with pipx binary...`),await fe("pipx",["ensurepath"],{stdio:"inherit"});else throw new Error("pipx module or pipx binary not found. Corrput pipx installation.")}catch(t){Jt(`Failed to install pipx completely for ${e}: ${t.toString()}. Ignoring...`)}}async function KR(e){if(await YR(e)){J("venv module already installed.");return}try{await kr("venv")}catch(t){J(`Failed to install venv: ${t.toString()}. Ignoring...`)}}async function YR(e){try{return await fe(e,["-m","venv","-h"],{stdio:"ignore"}),_e()?gu("python3-venv"):!0}catch{}return!1}async function JR(e){try{await In(e,"setuptools",void 0,{upgrade:!0,isLibrary:!0,usePipx:!1}),await In(e,"wheel",void 0,{upgrade:!1,isLibrary:!0,usePipx:!1})}catch(t){J(`Failed to install setuptools/wheel: ${t.toString()}. Ignoring...`)}}async function QR(e,t,r){const n=HR(e)?"":e;let i,a=await hn(t);if(a!==void 0){const s=F.dirname(a);i={bin:a,installDir:s,binDir:s}}else{if(WR)try{J("Installing python in GitHub Actions");const{setupActionsPython:s}=await Promise.resolve().then(()=>require("./assets/actions_python-DDPJNGDN.js"));if(await s(n,t,r),a=await hn(t),a===void 0)throw new Error("Python binary could not be found");const l=F.dirname(a);i={bin:a,installDir:l,binDir:l}}catch(s){ve(s.toString())}i===void 0&&(i=await ZR(t,n))}if(a===void 0||i.bin===void 0){if(a=await hn(t),a===void 0)throw new Error("Python binary could not be found");i={bin:a,installDir:F.dirname(a),binDir:F.dirname(a)}}return i}async function ZR(e,t){let r;switch(process.platform){case"win32":{e?await De("python3",t,[`--params=/InstallDir:${e}`]):await De("python3",t);const n=await hn(e);if(n===void 0)throw new Error("Python binary could not be found");const i=F.dirname(n);await Oe(i,ne),r={installDir:i,binDir:i,bin:n};break}case"darwin":{r=await Me("python3",t);const n=await fe("brew",["--prefix","python"],{stdio:"pipe"}),i=F.join(n.stdout,"libexec","bin");await Oe(i,ne);break}case"linux":{if(Te())r=await Re("python",t);else if(Ce())r=await xe([{name:"python3",version:t}]);else if(_e())r=await he([{name:"python3",version:t},{name:"python-is-python3"}]);else if(await Ie())r=await Fe([{name:"python3",version:t}]);else throw new Error("Unsupported linux distributions");break}default:throw new Error("Unsupported platform")}return r}async function hn(e){for(const t of["python","python3"]){const r=await Mh(t,e);if(r!==void 0)return r}if(process.platform==="win32"){const t=F.parse(le.homedir()).root,r=(await cu(t)).filter(n=>n.startsWith("Python"));for(const n of r)for(const i of["python3","python"]){const a=await Mh(i,F.join(t,n));if(a!==void 0)return a}}}async function Mh(e,t){var r;try{const n=Lu("python");if(t!==void 0){const a=F.join(t,Ee(e));if(await ye(a)&&await Wa(a,n))return a}const i=(r=await de(e,{nothrow:!0,all:!0}))!=null?r:[];for(const a of i)if(await Wa(a,n))return a}catch{}}async function e0(e){const t=await Gh();return t===void 0?(J("pip was not found. Installing pip"),await r0(e),Gh()):t}async function Gh(){for(const e of["pip3","pip"]){const t=await t0(e);if(t!==void 0)return t}}async function t0(e){var t;try{const r=Lu("pip"),n=(t=await de(e,{nothrow:!0,all:!0}))!=null?t:[];for(const i of n)if(await Wa(i,r))return i}catch{}}async function r0(e){await Vh(e)||(await kr("pip"),await Vh(e))}async function Vh(e){if(await Km(e))return!1;try{return await fe(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0}catch(t){J(t.toString());try{return await fe(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0}catch(r){J(r.toString())}}return!1}var Tr={},Bh;function n0(){if(Bh)return Tr;Bh=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.getUbuntuVersion=void 0;const e=xt;function t(i){return"errno"in i}function r(i,a){return new Promise((s,l)=>{e.execFile(i,a,{encoding:"utf8",shell:!1},(c,u,o)=>{if(c){if(t(c)&&c.code==="ENOENT"){s(null);return}l(new Error(`Could not execute \`${i} ${a.join(" ")}\`: ${c} (stderr=${o})`));return}s(u)})})}async function n(){if(process.platform!=="linux")return[];const i=await r("lsb_release",["-a"]);if(i===null)return[];const a=/^Distributor ID:\s*(.+)$/,s=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,l=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/;let c=null,u=null,o=!1;for(const m of i.split(`
|
||
`)){const _=m.match(a);if(_!==null){if(_[1]!=="Ubuntu")return[];o=!0}const S=m.match(s);S&&(c=S);const R=m.match(l);if(R&&(u=R),o&&c&&u)break}if(!o)return[];for(const m of[c,u])if(m){const _=[m[1],m[2]];return m[3]&&_.push(m[3]),_.map(S=>parseInt(S,10))}return[]}return Tr.getUbuntuVersion=n,Tr}var Hm=n0();async function i0(){try{if(_e()){try{de.sync("lsb_release",{nothrow:!0})===null&&await he([{name:"lsb-release"}])}catch{return zh()}const e=await Hm.getUbuntuVersion();return e.length===0?zh():e}else return null}catch(e){return ve(e.toString()),null}}const kt=ke(i0,{promise:!0});function zh(){if(!("version"in le&&typeof le.version=="function"))return null;const t=le.version().match(/(\d+)\.(\d+)\.(\d+)/);if(t===null)return null;const r=Number.parseInt(t[1],10),n=Number.parseInt(t[2],10),i=Number.parseInt(t[3],10);return[r,n,i]}function s0(e){return[...new Set(e)]}function Hh(e,t='"'){return e.includes(" ")?`${t}${e}${t}`:e}async function or(e,t,r={}){return In(await l0(r.pythonVersion),e,t,r)}async function In(e,t,r,n={}){const{usePipx:i=!0,user:a=!0,upgrade:s=!1,isLibrary:l=!1}=n,c=i&&!l&&await pn(e),u=!c&&await Km(e),o=c?"pipx":"pip",m=f0(t);if(!s&&(c?await h0(e,m):await d0(e,m)))return{binDir:c?await Wh():await Xh(e,m)};if(!u&&await p0(e,m))try{Se.info(`Installing ${t} ${r!=null?r:""} via ${o}`);const S=r!==void 0&&r!==""?`${t}==${r}`:t,R=s?c?["upgrade"]:["install","--upgrade"]:["install"],p=!c&&a?["--user"]:[],h=process.env;c&&a&&(h.PIPX_HOME=await u0(),h.PIPX_BIN_DIR=await Wm()),ze(e,["-m",o,...R,...p,S],{stdio:"inherit",env:h})}catch(S){const R=S instanceof Error?`${S.message}
|
||
${S.stack}`:String(S);if(Se.info(`Failed to install ${t} via ${o}: ${R}`),await kr(t)===null)throw new Error(`Failed to install ${t} via ${o}: ${S}.`)}else if(await kr(t)===null)throw new Error(`Failed to install ${t} as it was not found via ${o} or the system package manager`);return{binDir:c?await Wh():await Xh(e,m)}}function Wh(){return Wm()}async function Xh(e,t){const r=await y0(e),n=await m0(r,t);return await Oe(n,ne),n}async function o0(){return await de("pipx",{nothrow:!0})!==null}async function pn(e){return(await fe(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode===0}async function a0(){let e=process.env.PIPX_HOME;if(e!==void 0)return e;const t=nt("~/.local/pipx");if(await ye(t))return t;switch(process.platform){case"win32":{e=nt("~/AppData/Local/pipx");break}case"darwin":{e=nt("~/Library/Application Support/pipx");break}default:{e=nt("~/.local/share/pipx");break}}return await Lr(e),await Lr(F.join(e,"trash")),await Lr(F.join(e,"shared")),await Lr(F.join(e,"venv")),e}const u0=ke(a0,{promise:!0});async function c0(){if(process.env.PIPX_BIN_DIR!==void 0)return process.env.PIPX_BIN_DIR;const e=nt("~/.local/bin");return await Oe(e,ne),await Lr(e),e}const Wm=ke(c0,{promise:!0});let an;async function l0(e){if(an!==void 0)return an;const t=e!=null?e:it("python",void 0,await kt());return an=(await zm({version:t,setupDir:"",arch:process.arch})).bin,an}function f0(e){return e.replace(/\[.*]/g,"").trim()}async function d0(e,t){try{return(await fe(e,["-m","pip","-qq","show",t],{stdio:"ignore",reject:!1})).exitCode===0}catch{return!1}}async function h0(e,t){try{const r=await fe(e,["-m","pipx","list","--json"],{stdio:"ignore",reject:!1});if(r.exitCode!==0||typeof r.stdout!="string")return!1;const n=JSON.parse(r.stdout);if(t in n.venvs)return!0;for(const i of Object.values(n.venvs))if(i.metadata.main_package.package_or_url===t||i.metadata.main_package.package===t)return!0}catch{}return!1}async function p0(e,t){return(await fe(e,["-m","pip","-qq","index","versions",t],{stdio:"ignore",reject:!1})).exitCode===0}async function m0(e,t){const n=(await Promise.all(e.map(a=>ye(F.join(a,Ee(t)))))).findIndex(a=>a);if(n!==-1)return e[n];const i=de.sync(Ee(t),{nothrow:!0});return i!==null?F.dirname(i):e[e.length-1]}async function kr(e,t){if(process.platform==="linux"){Se.info(`Installing ${e} via the system package manager`);const r=e==="pipx"?Te():!0;if(Te())return Re(r?`python-${e}`:e);if(Ce())return xe([{name:r?`python3-${e}`:e}]);if(_e())return he([{name:r?`python3-${e}`:e}]);if(await Ie())return Fe([{name:r?`py3-${e}`:e}])}else if(process.platform==="darwin")return["venv"].includes(e)?null:Me(e);return null}async function _0(e){const t=[];process.platform==="linux"?t.push("/home/runner/.local/bin/"):process.platform==="darwin"&&t.push("/usr/local/bin/");const r=await Xm(e);return t.push(F.join(r,"Scripts"),F.join(r,"Scripts","bin"),F.join(r,"bin")),s0(t)}const y0=ke(_0,{promise:!0});async function v0(e){return(await Mn.getExecOutput(`${e} -c "import sys;print(sys.base_exec_prefix);"`)).stdout.trim()}const Xm=ke(v0,{promise:!0});async function w0(e){try{const t=await Xm(e),r=await Nm(e);if(r===void 0)return ve(`Failed to get the version of ${e}`),!1;const n=F.join(t,"lib",`python${r.major}.${r.minor}`,"EXTERNALLY-MANAGED");return ye(n)}catch(t){return ve(`Failed to check if ${e} is externally managed: ${t}`),!1}}const Km=ke(w0,{promise:!0});function g0({version:e}={}){return _e()&&(e===void 0||e==="")?he([{name:"gcovr",version:e}]):or("gcovr",e)}function E0(){return Pe("GCOV","llvm-cov gcov",ne)}function Kh(e){const t=Un(e),r=t!==null?um(t):e,n=r!==""?`gcov-${r}`:"gcov";return Pe("GCOV",n,ne)}const at=["x64","amd64","x86_64","win64","64","amd64_x86","amd64_arm64"],lr=["x86","i386","ia32","win32","32","x32"],ct=["aarch64","arm64","woa64","arm"],S0=["armv7","armv7a"],R0=["powerpc64le","ppc64le"],b0=["sparc64"],$0=["sparcv9"];function Ym(e){return ct.includes(e)?"arm64":at.includes(e)?"amd64":e}async function O0({version:e}={}){switch(process.platform){case"win32":return De("bazelisk",e);case"darwin":return Me("bazelisk",e);case"linux":{if(Te())throw new Error("installing bazel on Arch linux is not supported yet");if(Ce())return await xe([{name:"dnf-plugins-core"}]),await yt("dnf",["copr","enable","vbatts/bazel"]),xe([{name:"bazel4"}]);if(_e()){const t=await pm({fileName:"bazel-archive-keyring.gpg",keyUrl:"https://bazel.build/bazel-release.pub.gpg"});return await yt("bash",["-c",`echo "deb [arch=${Ym(process.arch)} signed-by=${t}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),he([{name:"bazel",version:e}],!0)}else if(await Ie())return Fe([{name:"bazel",version:e}],!0);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function I0({version:e}={}){switch(process.platform){case"win32":return De("ccache",e);case"darwin":return Me("ccache",e);case"linux":{if(Te())return Re("ccache",e);if(Ce())return xe([{name:"ccache",version:e}]);if(_e())return he([{name:"ccache",version:e}]);if(await Ie())return Fe([{name:"ccache",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var P0=Im();const Ga=$e(P0);function T0(e,t,r){const n=e===""?"":$u(e);switch(t){case"win32":{const i=n===""?!1:Ga(n,"v3.19.6");let a;at.includes(r)?a=i?"win64-x64":"windows-x86_64":lr.includes(r)?a=i?"win32-x86":"windows-i386":ct.includes(r)?a="windows-arm64":(J(`Trying unsupported arch '${r}' for cmake on Windows`),a=`windows-${r}`);const s=`cmake-${e}-${a}`;return{binRelativeDir:"bin/",binFileName:Ee("cmake"),extractedFolderName:s,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${s}.zip`}}case"darwin":{const a=(n===""?!1:Ga(n,"v3.19.1"))?"Darwin-x86_64":"macos-universal",s=`cmake-${e}-${a}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:Ee("cmake"),extractedFolderName:s,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${s}.tar.gz`}}case"linux":{const i=n===""?!1:Ga(n,"v3.19.8");let a;ct.includes(r)?a=i?"Linux-aarch64":"linux-aarch64":at.includes(r)?a=i?"Linux-x86_64":"linux-x86_64":(J(`Trying unsupported arch '${r}' for cmake on Linux`),a=`linux-${r}`);const s=`cmake-${e}-${a}`;return{binRelativeDir:"bin/",binFileName:Ee("cmake"),extractedFolderName:s,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${s}.tar.gz`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function Jm({version:e,setupDir:t,arch:r}){return await Ie()?Fe([{name:"cmake"}]):vt("cmake",e,T0,t,r)}function Nr({version:e}={}){return or("cmakelang[YAML]",e)}function N0({version:e}={}){return or("conan",e)}async function A0({version:e}={}){switch(process.platform){case"win32":return await De("cppcheck",e),{binDir:await L0()};case"darwin":return Me("cppcheck",e);case"linux":{if(Te())return Re("cppcheck",e);if(Ce())return xe([{name:"ccache",version:e}]);if(_e())return he([{name:"cppcheck",version:e}]);if(await Ie())return Fe([{name:"cppcheck",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function L0(){const e="C:/Program Files/Cppcheck";return await Oe(e,ne),e}function x0({version:e}={}){return or("cpplint",e,{pythonVersion:">=3.8.0"})}async function mn({version:e}={}){switch(process.platform){case"win32":return await De("graphviz",e),C0();case"darwin":return Me("graphviz",e);case"linux":{if(Te())return Re("graphviz",e);if(Ce())return xe([{name:"graphviz",version:e}]);if(_e())return he([{name:"graphviz",version:e}]);if(await Ie())return Fe([{name:"graphviz",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function C0(){if(process.platform==="win32"){const e="C:/Program Files/Graphviz/bin";return await Oe(e,ne),{binDir:e}}else throw new Error("Unsupported platform")}const D0=new Map([[25,["Tahoe","26"]],[24,["Sequoia","15"]],[23,["Sonoma","14"]],[22,["Ventura","13"]],[21,["Monterey","12"]],[20,["Big Sur","11"]],[19,["Catalina","10.15"]],[18,["Mojave","10.14"]],[17,["High Sierra","10.13"]],[16,["Sierra","10.12"]],[15,["El Capitan","10.11"]],[14,["Yosemite","10.10"]],[13,["Mavericks","10.9"]],[12,["Mountain Lion","10.8"]],[11,["Lion","10.7"]],[10,["Snow Leopard","10.6"]],[9,["Leopard","10.5"]],[8,["Tiger","10.4"]],[7,["Panther","10.3"]],[6,["Jaguar","10.2"]],[5,["Puma","10.1"]]]);function F0(e){e=Number((e||le.release()).split(".")[0]);const[t,r]=D0.get(e)||["Unknown",""];return{name:t,version:r}}function q0(){if(process.platform!=="darwin")return[];const{version:e}=F0();return e.split(".").map(t=>Number.parseInt(t,10))}const k0=ke(q0);async function j0(e,t){const{ArchiveHdi:r}=await Promise.resolve().then(()=>require("./assets/index-DsNLw0ut.js"));await new r(e).read(async i=>{await i.extract(F.join(t,i.path))})}function U0(e,t,r){switch(t){case"linux":{if(process.arch==="arm64")throw new Error("Doxygen binaries are not available for Linux arm64");const n=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:Ee("doxygen"),extractedFolderName:n,url:`https://www.doxygen.nl/files/${n}.linux.bin.tar.gz`}}case"win32":{const n=`doxygen-${e}`;return{binRelativeDir:"",binFileName:Ee("doxygen"),extractedFolderName:n,url:`https://www.doxygen.nl/files/${n}.windows.x64.bin.zip`}}case"darwin":{const n=`Doxygen-${e}`;return{binRelativeDir:"Doxygen/Doxygen.app/Contents/Resources/",binFileName:Ee("doxygen"),extractedFolderName:n,extractFunction:j0,url:`https://doxygen.nl/files/${n}.dmg`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function M0({version:e,setupDir:t,arch:r}){switch(process.platform){case"win32":{await Dm(()=>De("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:a=>J(a)});const i={binDir:await V0()};return await mn({version:it("graphviz",void 0)}),i}case"darwin":{const n=await Me("doxygen",void 0,{formula:!0});return k0()[0]>11&&await mn({version:it("graphviz",void 0)}),n}case"linux":{const n=await G0({version:e,setupDir:t,arch:r});return await mn({version:it("graphviz",void 0,await kt())}),n}default:throw new Error("Unsupported platform")}}async function G0({version:e,setupDir:t,arch:r}){try{if(Te())return await Re("doxygen",e);if(Ce())return xe([{name:"doxygen",version:e}]);if(_e())return await he([{name:"doxygen",version:e,fallBackToLatest:ct.includes(r)}]);if(await Ie())return Fe([{name:"doxygen"}]);throw new Error("Unsupported linux distributions")}catch{try{const n=await vt("doxygen",e,U0,t,r);if(_e())try{await he([{name:"libclang-cpp-dev"}])}catch(i){J(`Failed to download libclang-cpp-dev that might be needed for running doxygen. ${i}`)}return n}catch(n){return Jt(`Failed to download doxygen binary. ${n}. Falling back to installing the latest version from apt-get.`),he([{name:"doxygen"}])}}}async function V0(){switch(process.platform){case"win32":{for(const e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await ye(F.join(e,"doxygen.exe")))return await Oe(e,ne),e;throw new Error("Failed to find doxygen binary")}default:throw new Error("Unsupported platform")}}function B0({version:e}={}){return or("flawfinder",e)}async function Qm({version:e}={}){const t=await de("git",{nothrow:!0});if(t!==null){J(`Git already installed at ${t}`);return}switch(process.platform){case"win32":{const r=await De("git",e),n=z0();return n!==null&&await Oe(n,ne),r}case"darwin":return Me("git",e);case"linux":{if(Te())return Re("git",e);if(Ce())return xe([{name:"git",version:e}]);if(_e())return he([{name:"git",version:e}]);if(await Ie())return Fe([{name:"git",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function z0(){const e=["C:/Program Files/Git/bin/","C:/Program Files (x86)/Git/bin/"];for(const t of e)if(oe.existsSync(F.join(t,"git.exe")))return t;return ve("Git not found in the default locations. Add git to PATH manually."),null}const H0=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function W0(e,t,r){const{keywords:n,optionalKeywords:i}=K0(t,r),a=await Rn(F.join(H0,"github_facebook_infer.json")),s=bn(a,{version:e,keywords:n,optionalKeywords:i,filterMapTag(l){return l.replace(/^v/,"")}});if(s!==void 0)return{url:`https://github.com/facebook/infer/releases/download/${s.tag}/${s.name}`,extractedFolderName:`${F.basename(s.name,".tar.xz")}`,binRelativeDir:"bin",binFileName:Ee("infer")};throw new Error(`No asset found for version ${e} matching ${n} and ${i}`)}function X0({version:e,setupDir:t,arch:r}){return vt("infer",e,W0,t,r)}function K0(e,t){const r=[],n=[];switch(e){case"linux":{r.push("linux"),at.includes(t)?(n.push("64"),n.push("x86_64")):(J(`Using arch ${t} for infer`),r.push(t));break}case"darwin":{r.push("osx"),at.includes(t)?n.push("x86_64"):ct.includes(t)?n.push("arm64"):(J(`Using arch ${t} for infer`),r.push(t));break}default:J(`Using ${e} ${t} for infer`),r.push(e,t);break}return{keywords:r,optionalKeywords:n}}function Y0(e,t){switch(e){case"win32":return at.includes(t)||lr.includes(t)?"win":ct.includes(t)?"winarm64":"win";case"darwin":return"mac";case"linux":return at.includes(t)||lr.includes(t)?"linux":ct.includes(t)?"linux-aarch64":"linux";default:throw new Error(`Unsupported platform '${e}'`)}}function J0(e,t,r){const n=Y0(t,r);return{binRelativeDir:"",binFileName:Ee("ninja"),extractedFolderName:"",url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`}}async function Zm({version:e,setupDir:t,arch:r}){return await Ie()?(await lm(),await Fe([{name:"ninja-build"},{name:"ninja-is-really-ninja"}]),await Oe("/usr/lib/ninja-build/bin",ne),{binDir:"/usr/lib/ninja-build/bin",installDir:"/usr/lib/ninja-build/",bin:"/usr/lib/ninja-build/bin/ninja"}):vt("ninja",e,J0,t,r)}const Q0=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));function Z0(e){return{url:`https://github.com/SimonKagstrom/kcov/releases/download/${e}/kcov-amd64.tar.gz`,extractedFolderName:"",binRelativeDir:"usr/local/bin",binFileName:Ee("kcov")}}function eb(e,t,r){return{url:`https://github.com/SimonKagstrom/kcov/archive/refs/tags/${e}.tar.gz`,extractedFolderName:"",binRelativeDir:"build/src",binFileName:Ee("kcov"),extractFunction:(n,i)=>tb(n,i,r)}}async function tb(e,t,r){const n=await Tu(e,t,1),i=await rb(r);process.platform==="linux"&&(Te()?await Promise.all([Re("libdwarf"),Re("libcurl-openssl")]):Ce()?await xe([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):_e()&&await he([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}]));try{if(de.sync("patch",{nothrow:!0})!==null){const s=F.join(Q0,"gcc13.patch");await fe("patch",["-N","-p1","-i",s],{cwd:n,stdio:"inherit"})}else J("`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13")}catch{}const a=F.join(n,"build");return await fe(i,["-S",n,"-B",a,"-DCMAKE_BUILD_TYPE=Release","-G","Ninja"],{cwd:n,stdio:"inherit"}),await fe(i,["--build",a,"--config","Release"],{cwd:n,stdio:"inherit"}),n}async function rb(e){let t=de.sync("cmake",{nothrow:!0});if(t===null){const{binDir:n}=await Jm({version:it("cmake",void 0,await kt()),setupDir:F.join(nt("~"),"cmake"),arch:e});t=F.join(n,"cmake")}return de.sync("ninja",{nothrow:!0})===null&&await Zm({version:it("ninja",void 0,await kt()),setupDir:F.join(nt("~"),"ninja"),arch:e}),t}async function nb({version:e,setupDir:t,arch:r}){if(process.platform!=="linux"){J("Kcov is not supported on non-linux");return}const n=e.split("-");let i=zS(n[0]);const a=n[1],s=BS(i);s===38&&(i="v38");let l;return a==="binary"&&s>=39?(l=await vt("kcov",i,Z0,t,r),Te()?await Re("binutils"):Ce()?await xe([{name:"binutils"}]):_e()&&await he([{name:"libbinutils"}]),l):(l=await vt("kcov",i,eb,t,r),l)}function ib({version:e}={}){return or("lizard",e)}async function xr(){process.platform==="darwin"&&(await de("clang",{nothrow:!0})!==null&&await de("clang++",{nothrow:!0})!==null&&(Jt("Assuming clang is an Apple Clang compiler"),await Promise.all([Pe("CC","clang",ne),Pe("CXX","clang++",ne)])),yn.error("Apple Clang automatic installation is not supported yet"))}function sb(e){const t=$u(e);return Number.parseInt(t.split(".")[0],10)}const Or=ke(sb);async function ob(e){if(await Ie())try{return await ab(e)}catch(t){J(`Failed to install llvm via system package manager ${t}.`)}}function ab(e){const t=Or(e);return Fe([{name:`llvm${t}`}])}var Va={},Yh;function ub(){return Yh||(Yh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DownloaderHelper=e.DH_STATES=void 0;var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},r=(function(){function v(g,E){for(var d,w=0;w<E.length;w++)d=E[w],d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(g,d.key,d)}return function(g,E,d){return E&&v(g.prototype,E),d&&v(g,d),g}})(),n=oe,i=S(n),a=We,s=F,l=S(s),c=jr,u=S(c),o=pr,m=S(o),_=mr;function S(v){if(v&&v.__esModule)return v;var g={};if(v!=null)for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(g[E]=v[E]);return g.default=v,g}function R(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function p(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function h(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var y=e.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"};e.DownloaderHelper=(function(v){function g(E,d){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};R(this,g);var f=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,{captureRejections:!0}));return f.__validate(E,d)?(f.url=f.requestURL=E.trim(),f.state=y.IDLE,f.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},f.__opts=Object.assign({},f.__defaultOpts),f.__pipes=[],f.__total=0,f.__downloaded=0,f.__progress=0,f.__retryCount=0,f.__retryTimeout=null,f.__resumeRetryCount=0,f.__states=y,f.__promise=null,f.__request=null,f.__response=null,f.__isAborted=!1,f.__isResumed=!1,f.__isResumable=!1,f.__isRedirected=!1,f.__destFolder=d,f.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},f.__fileName="",f.__filePath="",f.updateOptions(w),f):p(f)}return h(g,v),r(g,[{key:"start",value:function(){var d=this,w=function(){return new Promise(function(f,b){d.__promise={resolve:f,reject:b},d.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(f){var b=f.name,$=f.total,T=d.__opts.override;if(d.__opts.override=!0,d.__filePath=d.__getFilePath(b),d.__opts.override=T,d.__filePath&&i.existsSync(d.__filePath)){var k=d.__getFilesizeInBytes(d.__filePath);return k===$?w():d.resumeFromFile(d.__filePath,{total:$,fileName:b})}return w()}):w()}},{key:"pause",value:function(){var d=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(w){return w.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return d.__setState(d.__states.PAUSED),d.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var d=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var w=function(){return new Promise(function(f,b){i.access(d.__filePath,function($){return $?(d.__emitStop(),f(!0)):void i.unlink(d.__filePath,function(T){return T?(d.__setState(d.__states.FAILED),d.emit("error",T),b(T)):(d.__emitStop(),void f(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return d.__opts.removeOnStop?w():(d.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(d){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:d,options:w}),d}},{key:"unpipe",value:function(){var d=this,w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,f=function($){return d.__response?d.__response.unpipe($):$.unpipe()};if(w){var b=this.__pipes.find(function($){return $.stream===w});return void(b&&(f(w),this.__pipes=this.__pipes.filter(function($){return $.stream!==w})))}this.__pipes.forEach(function($){return f($.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(d){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,d),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=w||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var d=this;return new Promise(function(w,f){var b=function(G){d.__initProtocol(G);var P=Object.assign({},d.__headers);P.hasOwnProperty("range")&&delete P.range;var I=d.__getReqOptions("HEAD",G,P);return Object.assign({},d.__reqOptions,I)},$=0,T=null,k=function(G,P){if(!d.__opts.retry||t(d.__opts.retry)!=="object")return Promise.reject(G||new Error("wrong retry options"));T&&(clearTimeout(T),T=null);var I=d.__opts.retry,A=I.delay,D=A===void 0?0:A,C=I.maxRetries,q=C===void 0?999:C;return $>=q?Promise.reject(G||new Error("reached the maximum retries")):($++,d.__setState(d.__states.RETRY),d.emit("retry",$,d.__opts.retry,G),new Promise(function(x){T=setTimeout(function(){d.__setState(d.__states.IDLE),B(P,b(P)),x()},D)}))},B=function(G,P){T&&(clearTimeout(T),T=null);var I=d.__protocol.request(P,function(A){if(d.__isRequireRedirect(A)){var D=/^https?:\/\//.test(A.headers.location)?A.headers.location:new a.URL(A.headers.location,G).href;return d.emit("redirected",D,G),B(D,b(D))}if(200>A.statusCode||400<=A.statusCode){var C=new Error("Response status was "+A.statusCode);return d.__opts.retry&&500<=A.statusCode&&600>A.statusCode?k(C,G).catch(f):f(C)}w({name:d.__getFileNameFromHeaders(A.headers,A),total:parseInt(A.headers["content-length"])||null})});I.on("error",function(A){return d.__opts.retry?k(A,G).catch(f):void f(A)}),I.on("timeout",function(){return d.__opts.retry?k(new Error("timeout"),G).catch(f):void f(new Error("timeout"))}),I.on("uncaughtException",function(A){return d.__opts.retry?k(A,G).catch(f):void f(A)}),I.end()};B(d.url,b(d.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(d){var w=this,f=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=d,(f.total&&f.fileName?Promise.resolve({name:f.fileName,total:f.total}):this.getTotalSize()).then(function(b){var $=b.name,T=b.total;return w.__total=f.total||T,w.__fileName=f.fileName||$,w.__downloaded=f.downloaded||w.__getFilesizeInBytes(w.__filePath),w.__reqOptions.headers.range="bytes="+w.__downloaded+"-",w.__isResumed=!0,w.__isResumable=!0,w.__setState(w.__states.RESUMED),w.emit("resume",w.__isResumed),new Promise(function(k,B){w.__promise={resolve:k,reject:B},w.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var d=this.__promise.resolve;return this.__promise=null,d(!0)}}},{key:"__downloadRequest",value:function(d,w){var f=this;return this.__protocol.request(this.__reqOptions,function(b){if(f.__response=b,f.__isResumed||(f.__total=parseInt(b.headers["content-length"])||null,f.__resetStats()),f.__isRequireRedirect(b)){var $=/^https?:\/\//.test(b.headers.location)?b.headers.location:new a.URL(b.headers.location,f.url).href;return f.__isRedirected=!0,f.__initProtocol($),f.emit("redirected",$,f.url),f.__start()}if(200>b.statusCode||400<=b.statusCode){var T=new Error("Response status was "+b.statusCode);return T.status=b.statusCode||0,T.body=b.body||"",500<=b.statusCode&&600>b.statusCode?f.__onError(d,w)(T):(f.__setState(f.__states.FAILED),f.emit("error",T),w(T))}(f.__opts.forceResume||b.headers.hasOwnProperty("accept-ranges")&&b.headers["accept-ranges"]!=="none")&&(f.__isResumable=!0),f.__startDownload(b,d,w)})}},{key:"__startDownload",value:function(d,w,f){var b=this,$=d;if(this.__isResumed)this.__fileStream=i.createWriteStream(this.__filePath,{flags:"a"});else{var T=this.__getFileNameFromHeaders(d.headers);if(this.__filePath=this.__getFilePath(T),this.__fileName=this.__filePath.split(l.sep).pop(),i.existsSync(this.__filePath)){var k=this.__getFilesizeInBytes(this.__filePath),B=this.__total?this.__total:0;if(t(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||k>=B))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:k}),this.__setState(this.__states.SKIPPED),w(!0)}this.__fileStream=i.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,$.on("data",function(G){return b.__calculateStats(G.length)}),this.__pipes.forEach(function(G){$.pipe(G.stream,G.options),$=G.stream}),$.pipe(this.__fileStream),$.on("error",this.__onError(w,f)),this.__fileStream.on("finish",this.__onFinished(w,f)),this.__fileStream.on("error",this.__onError(w,f))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(d){return 300<d.statusCode&&400>d.statusCode&&d.headers.hasOwnProperty("location")&&d.headers.location}},{key:"__onFinished",value:function(d,w){var f=this;return function(){f.__fileStream.close(function(b){if(b)return w(b);if(f.__hasFinished()){var $=!!f.__total&&f.__downloaded!==f.__total;if($&&f.__isResumable&&f.__opts.resumeOnIncomplete&&f.__resumeRetryCount<=f.__opts.resumeOnIncompleteMaxRetry)return f.__resumeRetryCount++,f.emit("warning",new Error("uncomplete download, retrying")),f.resume();f.__setState(f.__states.FINISHED),f.__pipes=[],f.emit("end",{fileName:f.__fileName,filePath:f.__filePath,totalSize:f.__total,incomplete:$,onDiskSize:f.__getFilesizeInBytes(f.__filePath),downloadedSize:f.__downloaded})}return d(f.__downloaded===f.__total)})}}},{key:"__closeFileStream",value:function(){var d=this;return this.__fileStream?new Promise(function(w,f){d.__fileStream.close(function(b){return b?f(b):w(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(d,w){var f=this,b=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function($){return f.__pipes=[],b&&f.__requestAbort(),f.state===f.__states.STOPPED||f.state===f.__states.FAILED?void 0:f.__opts.retry?f.__retry($).catch(function(T){f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("error",T||$),w(T||$)})}):f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("error",$),w($)})}}},{key:"__retry",value:function(){var d=this,w=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||t(this.__opts.retry)!=="object")return Promise.reject(w||new Error("wrong retry options"));var f=this.__opts.retry,b=f.delay,$=b===void 0?0:b,T=f.maxRetries,k=T===void 0?999:T;return this.__retryCount>=k?Promise.reject(w||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,w),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(B){return B.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(B){return d.__retryTimeout=setTimeout(function(){return B(0<d.__downloaded?d.resume():d.__start())},$)})}))}},{key:"__onTimeout",value:function(d,w){var f=this;return function(){return f.__requestAbort(),f.__opts.retry?f.__retry(new Error("timeout")).catch(function(b){f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),b?w(b):(f.emit("timeout"),w(new Error("timeout")))})}):f.__removeFile().finally(function(){f.__setState(f.__states.FAILED),f.emit("timeout"),w(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(d,w){var f="",b=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,$=/.*filename="(.*?)";?/i,T=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,k=d.hasOwnProperty("content-disposition"),B=k?d["content-disposition"].match(b):null,G=!k||B?null:d["content-disposition"].match($),P=!k||B||G?null:d["content-disposition"].match(T);return k&&(B||G||P)?(f=d["content-disposition"],f=f.trim(),B?f=B[1]:G?f=G[1]:P&&(f=P[1]),f=f.replace(/[/\\]/g,"")):0<l.basename(new a.URL(this.requestURL).pathname).length?f=l.basename(new a.URL(this.requestURL).pathname):f=new a.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(f,w):f.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(d){var w=l.join(this.__destFolder,d),f=w;return this.__opts.override||this.state===this.__states.RESUMED||(f=this.__uniqFileNameSync(f),w!==f&&this.emit("renamed",{path:f,fileName:f.split(l.sep).pop(),prevPath:w,prevFileName:w.split(l.sep).pop()})),f}},{key:"__getFileNameFromOpts",value:function(d,w){if(!this.__opts.fileName)return d;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var f=l.join(this.__destFolder,d);return w&&w.headers||this.__response&&this.__response.headers?this.__opts.fileName(d,f,(w||this.__response).headers["content-type"]):this.__opts.fileName(d,f)}if(t(this.__opts.fileName)==="object"){var b=this.__opts.fileName,$=b.name,T=!!b.hasOwnProperty("ext")&&b.ext;if(typeof T=="string")return $+"."+T;if(typeof T=="boolean"){if(T)return $;var k=d.includes(".")?d.split(".").pop():"";return k===""?$:$+"."+k}}return d}},{key:"__calculateStats",value:function(d){var w=new Date,f=w-this.__statsEstimate.time,b=w-this.__statsEstimate.throttleTime,$=this.__total||0;d&&(this.__downloaded+=d,this.__progress=$===0?0:100*(this.__downloaded/$),(this.__downloaded===$||1e3<f)&&(this.__statsEstimate.time=w,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===$||b>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=w,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(d){this.state=d,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(d,w){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},b=new a.URL(w),$={protocol:b.protocol,host:b.hostname,port:b.port,path:b.pathname+b.search,method:d};return f&&($.headers=f),$}},{key:"__getFilesizeInBytes",value:function(d){try{var w=i.statSync(d,{throwIfNoEntry:!1}),f=w.size||0;return f}catch(b){this.emit("warning",b)}return 0}},{key:"__validate",value:function(d,w){if(typeof d!="string")throw new Error("URL should be an string");if(d.trim()==="")throw new Error("URL couldn't be empty");if(typeof w!="string")throw new Error("Destination Folder should be an string");if(w.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!i.existsSync(w))throw new Error("Destination Folder must exist");var f=i.statSync(w);if(!f.isDirectory())throw new Error("Destination Folder must be a directory");try{i.accessSync(w,i.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(d){var w=this.__getReqOptions(this.__opts.method,d,this.__headers);this.requestURL=d,-1<d.indexOf("https://")?(this.__protocol=m,w.agent=new m.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},w,this.__opts.httpsRequestOptions)):(this.__protocol=u,w.agent=new u.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},w,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(d){if(typeof d!="string"||d==="")return d;try{i.accessSync(d,i.F_OK);var w=d.match(/(.*)(\([0-9]+\))(\..*)$/),f=w?w[1].trim():d,b=w?parseInt(w[2].replace(/\(|\)/,"")):0,$=d.split(".").pop();return $!==d&&0<$.length?($="."+$,f=f.replace($,"")):$="",this.__uniqFileNameSync(f+" ("+ ++b+")"+$)}catch{return d}}},{key:"__removeFile",value:function(){var d=this;return new Promise(function(w){return d.__fileStream?void d.__fileStream.close(function(f){return f&&d.emit("warning",f),d.__opts.removeOnFail?i.access(d.__filePath,function(b){return b?w():void i.unlink(d.__filePath,function($){$&&d.emit("warning",f),w()})}):void w()}):w()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),g})(_.EventEmitter)})(Va)),Va}var e_=ub();const cb=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));var xu=(e=>(e[e.All=0]="All",e[e.ClangFormat=1]="ClangFormat",e[e.Core=2]="Core",e))(xu||{});async function lb(e,t=0){if(_e())try{return await fb(e,t)}catch(r){yn.info(`Failed to install llvm via system package manager ${r}. Trying to remove the repository`);try{me(F.join(cb,"llvm_repo_remove.bash"),[`${Or(e)}`])}catch(n){yn.info(`Failed to remove llvm repository ${n}`)}}}async function fb(e,t=0){const r=Or(e),n=`/usr/lib/llvm-${r}`;await he([{name:"ca-certificates"}]);const i=new e_.DownloaderHelper("https://apt.llvm.org/llvm.sh",le.tmpdir(),{fileName:"llvm.sh",override:!0});i.on("error",l=>{throw new Error(`Failed to download the LLVM installer script: ${l}`)}),await i.start();const a=await Qt(i.getDownloadPath(),"utf-8"),s=F.join(le.tmpdir(),"llvm-setup-cpp.sh");return await db(a,s,r,t),await Sm(),await he([{name:"lsb-release"},{name:"wget"},{name:"gnupg"}]),await uu(s,"755"),await yt("bash",[s,`${r}`,...t===0?["all"]:[]],{stdio:"inherit",shell:!0,timeout:c_}),await Oe(`${n}/bin`,ne),{installDir:`${n}`,binDir:`${n}/bin`,bin:`${n}/bin/clang++`}}async function db(e,t,r,n){let i=hb(e);i=pb(i),i=yb(n,i,r),i=await mb(i),i=_b(i),await qr(t,i)}function hb(e){return process.env.NODE_DEBUG!=="1"&&process.env.NODE_DEBUG!=="true"?e.replace(/set -eux/g,"set -eu"):e}function pb(e){const t=Em();return e.replace(/add-apt-repository\s*(-y)?\s*"\${REPO_NAME}"/g,`add-apt-repository -y ${t?"--no-update":""} "\${REPO_NAME}"
|
||
apt-get update -o ${br}`)}async function mb(e){let t=e.replace(/apt-get install -y/g,`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${br} -y --fix-broken`);const r=["libc++-$LLVM_VERSION-dev","libc++abi-$LLVM_VERSION-dev","libunwind-$LLVM_VERSION-dev"];return await Promise.all(r.map(async n=>{const i=n.replace("$LLVM_VERSION","*");await aS(i)&&(yn.info(`Removing conflicting package ${i}`),t=t.replace(n,""))})),t}function _b(e){return hm()?e.replace(/apt-get/g,"nala"):e}function yb(e,t,r){return e===1?t.replace(/ -y \$PKG/g,` -y clang-format-${r}`):t}const Jh=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function vb(e,t,r){const n=await wb(t,r,e);J(`Downloading LLVM from ${n}`);const i=km(n);return{url:n,extractedFolderName:"",binRelativeDir:"bin",binFileName:Ee("clang"),extractFunction:i===dn.Tar||i===dn.TarGz||i===dn.TarXz?(a,s)=>process.platform==="win32"?hr(a,s,!0):Tu(a,s,1):jm(i)}}async function wb(e,t,r){const{keywords:n,optionalKeywords:i}=await gb(e,t),a=await Rn(F.join(Jh,"github_llvm_llvm-project.json")),s=bn(a,{version:r,keywords:n,optionalKeywords:i,filterMapTag(u){return u.replace(/^llvmorg-/,"")}});if(s!==void 0)return`https://github.com/llvm/llvm-project/releases/download/${s.tag}/${s.name}`;const l=await Rn(F.join(Jh,"llvm_org_releases.json")),c=bn(l,{version:r,keywords:n,optionalKeywords:i});if(c!==void 0)return`https://releases.llvm.org/${c.tag}/${c.name}`;throw new Error(`No asset found for version ${r} matching ${n} and ${i}`)}async function gb(e,t){const r=[],n=[];switch(e){case"win32":{n.push(".tar.xz",".tar.xz");const i=[];at.includes(t)?(i.push("win64"),n.push(["x86_64","X64"])):lr.includes(t)?i.push("win32"):ct.includes(t)?i.push("woa64"):(J(`Using arch ${t} for LLVM`),i.push(t)),i.push("windows","Windows"),r.push(i);break}case"linux":{const i=["linux","Linux"];if(_e()){n.push("ubuntu");const a=await kt();if(a!==null){n.push(`${a[0]}`);const s=a[1]<10?`0${a[1]}`:`${a[1]}`;n.push(`${a[0]}.${s}`),n.push(`${a[0]}.${s}.${a[2]}`)}}else Ce()&&n.push("rhel");at.includes(t)?r.push(["x86_64","X64"]):lr.includes(t)?r.push("x86"):ct.includes(t)?r.push("aarch64"):S0.includes(t)?r.push("armv7a"):R0.includes(t)?r.push("powerpc64le"):b0.includes(t)?r.push("sparc64"):(J(`Using arch ${t} for LLVM`),r.push(t)),r.push(i);break}case"darwin":{r.push(["apple","macos","macOS"]),at.includes(t)?n.push(["x86_64","X64"]):ct.includes(t)?n.push(["arm64","ARM64"]):(J(`Using arch ${t} for LLVM`),r.push(t));break}case"freebsd":{r.push("freebsd"),at.includes(t)?r.push("amd64"):lr.includes(t)?r.push("i386"):(J(`Using arch ${t} for LLVM`),r.push(t));break}case"solaris":{r.push("solaris"),at.includes(t)?r.push("amd64"):$0.includes(t)?r.push("sparcv9"):(J(`Using arch ${t} for LLVM`),r.push(t));break}default:J(`Using ${e} ${t} for LLVM`),r.push(e,t);break}return{keywords:r,optionalKeywords:n}}async function Eb({version:e,setupDir:t,arch:r}){const n=await vt("llvm",e,vb,t,r);return await Rb(Or(e),r),n}async function Sb(e,t){if(_e())for(const r of["libtinfo5","libtinfo6"])try{await he([{name:r}])}catch{try{if(r==="libtinfo5"){J(`Failed to install ${r}
|
||
Manually installing the package`);const i=`libtinfo5_6.3-2ubuntu0.1_${Ym(t)}.deb`,a=`https://launchpad.net/ubuntu/+archive/primary/+files/${i}`,s=new e_.DownloaderHelper(a,le.tmpdir(),{fileName:i});s.on("error",async l=>{J(`Failed to download ${a}: ${l}`),await s.stop()}),await s.start(),me("dpkg",["-i",F.join(le.tmpdir(),i)])}}catch{J(`Failed to install ${r}. Ignoring`)}}else Te()?await Re("ncurses5-compat-libs",void 0,"yay"):Ce()&&await xe([{name:"ncurses-compat-libs"}])}const Rb=ke(Sb,{promise:!0});async function bb({version:e}){if(process.platform!=="darwin")return Promise.resolve(void 0);try{return await $b({version:e})}catch(t){J(`Failed to install llvm via brew: ${t}`);return}}async function $b({version:e}){const t=Or(e),r=await Me("llvm",`${t}`,{"force-bottle":!0});return await Oe(r.binDir,ne),r}const{GITHUB_ACTIONS:Ob}=Et,Ib=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function _n({version:e,setupDir:t,arch:r}){const n=await Cu(e,t,r);return await Tb(r),await Ab(),n.installDir!==void 0&&await Nb(n.installDir,e),n}async function Cu(e,t,r,n=xu.All){const i=await lb(e,n);if(i!==void 0)return i;const a=await ob(e);if(a!==void 0)return a;const s=await bb({version:e});return s!==void 0?s:Eb({version:e,setupDir:t,arch:r})}async function Pb(e){process.platform==="linux"&&await $n({version:it("gcc",void 0,await kt()),setupDir:"",arch:e,priority:40})}const Tb=ke(Pb,{promise:!0});async function Nb(e,t){var s,l;const r=(s=process.env.LD_LIBRARY_PATH)!=null?s:"",n=(l=process.env.DYLD_LIBRARY_PATH)!=null?l:"",i=Or(t),a=[Pe("CC",Ee(`${e}/bin/clang`),ne),Pe("CXX",Ee(`${e}/bin/clang++`),ne),Pe("LLVM_PATH",e,ne),Pe("LLVM_LD_LIBRARY_PATH",`${r}${F.delimiter}${e}/lib`,ne),Pe("LLVM_DYLD_LIBRARY_PATH",`${n}${F.delimiter}${e}/lib`,ne),Pe("LLVM_LDFLAGS",`-L${Hh(`${e}/lib`)}`,ne),Pe("LLVM_CPPFLAGS",`-I${Hh(`${e}/include`)}`,ne),await ye(`${e}/lib/clang/${t}/include`)?Pe("LLVM_CPATH",`${e}/lib/clang/${t}/include`,ne):await ye(`${e}/lib/clang/${i}/include`)?Pe("LLVM_CPATH",`${e}/lib/clang/${i}/include`,ne):Promise.resolve(),Pe("LLVM_LIBRARY_PATH",`${e}/lib`,ne),$m()];_e()&&a.push(_t("cc",`${e}/bin/clang`,ne,60),_t("cxx",`${e}/bin/clang++`,ne,60),_t("clang",`${e}/bin/clang`,ne),_t("clang++",`${e}/bin/clang++`,ne),_t("lld",`${e}/bin/lld`,ne),_t("ld.lld",`${e}/bin/ld.lld`,ne),_t("llvm-ar",`${e}/bin/llvm-ar`,ne)),await Promise.all(a)}async function Ab(){if(!Ob)return;const e=F.join(Ib,"llvm_matcher.json");if(!await ye(e))return ve("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");J(`::add-matcher::${e}`)}function Qh({version:e,setupDir:t,arch:r}){return Cu(e,t,r,xu.ClangFormat)}function Zh({version:e,setupDir:t,arch:r}){return Cu(e,t,r)}async function Lb({version:e}={}){switch(process.platform){case"win32":return De("make",e);case"darwin":{await Me("make",e);const t=F.join(Ru(),"opt/make/libexec/gnubin");return await Oe(t,ne),{binDir:t}}case"linux":{if(Te())return Re("make",e);if(Ce())return xe([{name:"make",version:e}]);if(_e())return he([{name:"make",version:e}]);if(await Ie())return Fe([{name:"make",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function xb({version:e}={}){return or("meson",e)}var Yt={},ep;function Cb(){if(ep)return Yt;ep=1;const e=vr(),t=xt,r=oe,n=F,i=ut,a=i.env["ProgramFiles(x86)"],s=[i.env["ProgramFiles(x86)"],i.env.ProgramFiles],l=["Enterprise","Professional","Community","BuildTools"],c=["2022","2019","2017"],u={2022:"17.0",2019:"16.0",2017:"15.0",2015:"14.0",2013:"12.0"};function o(v){return Object.values(u).includes(v)?v:v in u?u[v]:v}Yt.vsversion_to_versionnumber=o;function m(v){if(Object.keys(u).includes(v))return v;for(const[g,E]of Object.entries(u))if(E===v)return g;return v}Yt.vsversion_to_year=m;const _=`${a}\\Microsoft Visual Studio\\Installer`;function S(v,g){try{return t.execSync(`vswhere -products * ${g} -prerelease -property installationPath`).toString().trim()+"\\"+v}catch(E){e.warning(`vswhere failed: ${E}`)}return null}Yt.findWithVswhere=S;function R(v){const g=o(v);let E;if(g){const f=g.split(".")[0]+".9";E=`-version "${g},${f}"`}else E="-latest";let d=S("VC\\Auxiliary\\Build\\vcvarsall.bat",E);if(d&&r.existsSync(d))return e.info(`Found with vswhere: ${d}`),d;e.info("Not found with vswhere");const w=v?[m(v)]:c;for(const f of s)for(const b of w)for(const $ of l)if(d=`${f}\\Microsoft Visual Studio\\${b}\\${$}\\VC\\Auxiliary\\Build\\vcvarsall.bat`,e.info(`Trying standard location: ${d}`),r.existsSync(d))return e.info(`Found standard location: ${d}`),d;if(e.info("Not found in standard locations"),d=`${a}\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat`,r.existsSync(d))return e.info(`Found VS 2015: ${d}`),d;throw e.info(`Not found in VS 2015 location: ${d}`),new Error("Microsoft Visual Studio not found")}Yt.findVcvarsall=R;function p(v){return["PATH","INCLUDE","LIB","LIBPATH"].indexOf(v.toUpperCase())!=-1}function h(v){let g=v.split(";");function E(d,w,f){return f.indexOf(d)===w}return g.filter(E).join(";")}function y(v,g,E,d,w,f){if(i.platform!="win32"){e.info("This is not a Windows virtual environment, bye!");return}i.env.PATH+=n.delimiter+_;let b={win32:"x86",win64:"x64",x86_64:"x64","x86-64":"x64"};v.toLowerCase()in b&&(v=b[v.toLowerCase()]);var $=[v];d&&JSON.parse(d)===!0&&$.push("uwp"),g&&$.push(g),E&&$.push(`-vcvars_ver=${E}`),w&&JSON.parse(w)===!0&&$.push("-vcvars_spectre_libs=spectre");const T=`"${R(f)}" ${$.join(" ")}`;e.debug(`vcvars command-line: ${T}`);const B=t.execSync(`set && cls && ${T} && cls && set`,{shell:"cmd"}).toString().split("\f"),G=B[0].split(`\r
|
||
`),P=B[1].split(`\r
|
||
`),I=B[2].split(`\r
|
||
`),A=P.filter(C=>!!(C.match(/^\[ERROR.*\]/)&&!C.match(/Error in script usage. The correct usage is:$/)));if(A.length>0)throw new Error(`invalid parameters\r
|
||
`+A.join(`\r
|
||
`));let D={};for(let C of G){const[q,x]=C.split("=");D[q]=x}e.startGroup("Environment variables");for(let C of I){if(!C.includes("="))continue;let[q,x]=C.split("="),z=D[q];x!==z&&(e.info(`Setting ${q}`),p(q)&&(x=h(x)),e.exportVariable(q,x))}e.endGroup(),e.info("Configured Developer Command Prompt")}return Yt.setupMSVCDevCmd=y,Yt}var Ka=Cb();function Db(e){switch(e){case"x32":case"32":case"ia32":return"x86";case"64":return"x64";default:return e}}async function Du({vsversion:e,VCTargetsPath:t,arch:r,toolset:n,sdk:i,uwp:a,spectre:s}){t!==void 0&&await ye(t)&&(J(`Adding ${t} to PATH`),await Pe("VCTargetsPath",t,ne)),await Ka.setupMSVCDevCmd(Db(r),i,n,a,s,e)}const{GITHUB_ACTIONS:Fb}=Et,qb=typeof __dirname=="string"?__dirname:F.dirname(We.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("setup-cpp.js",document.baseURI).href));async function Cr({version:e,setupDir:t,arch:r,sdk:n,uwp:i,spectre:a}){if(process.platform!=="win32")return;const s=Ka.vsversion_to_versionnumber(e);J(`Checking if MSVC ${s} is already installed`);let l=!1;try{const o=Ka.findVcvarsall(s);l=!0,J(`Found the pre-installed version of MSVC at ${o}`)}catch{}let c,u;if(!l)try{s==="14.0"?(c="14.0",await De("visualcpp-build-tools","14.0.25420.1",["--ignore-dependencies"]),u="C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"):s==="15.0"?(c="14.16",await De("visualstudio2017buildtools","15.9.41.0",[]),u="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16"):s==="16.0"?(c="14.29",await De("visualstudio2019buildtools","16.11.7.0",[]),u="C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"):s==="17.0"?(c=void 0,await De("visualstudio2022buildtools","117.0.5.0",[]),u=void 0):Le(`The given MSVC versions ${e} is not supported yet.`)}catch(o){Le(o)}await Du({VCTargetsPath:u,arch:r,toolset:c,sdk:n,uwp:i,spectre:a}),Fb&&await kb()}async function kb(){const e=F.join(qb,"msvc_matcher.json");if(!await ye(e))return ve("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");J(`::add-matcher::${e}`)}async function tp({version:e}={}){return process.platform!=="win32"?void 0:(await De("opencppcoverage",e),{binDir:await jb()})}async function jb(){const e="C:/Program Files/OpenCppCoverage";return await Oe(e,ne),e}function Ub(e,t,r){return{url:Mb(t,r,e),binRelativeDir:"",binFileName:Ee("pwsh"),extractedFolderName:""}}function Mb(e,t,r){var n;switch(e){case"win32":{const i=["ia32","x86","i386","x32"].includes(t)?"win-x86":"win-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/PowerShell-${r}-${i}.zip`}case"darwin":{const i=["arm","arm64"].includes(t)?"osx-arm64":"osx-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${i}.tar.gz`}case"linux":{const a=(n={arm64:"linux-arm64",arm:"linux-arm64",arm32:"linux-arm32",aarch64:"linux-arm64",x64:"linux-x64"}[t])!=null?n:"linux-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${a}.tar.gz`}default:throw new Error(`Unsupported platform '${e}'`)}}async function rp({version:e,setupDir:t,arch:r}){try{return await Ie()?np({version:e}):await vt("pwsh",e,Ub,t,r)}catch(n){return Le(`Failed to setup pwsh via download: ${n}. Trying package managers...`),np({version:e})}}async function np({version:e}={}){switch(process.platform){case"win32":{await De("powershell-core",e);const t="C:/Program Files/PowerShell/7";return await Oe(t,ne),{binDir:t}}case"darwin":return Me("powershell",e,{cask:!0,overwrite:!1});case"linux":{if(Te())return Re("powershell-bin",e,"yay");if(Ce())return await xe([{name:"curl"}]),me("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),xe([{name:"powershell",version:e}]);if(_e()){await he([{name:"curl"}]);const t=await kt(),r=`${t[0]}.0${t[1]}`;return me("curl",["-LJO",`https://packages.microsoft.com/config/ubuntu/${r}/packages-microsoft-prod.deb`]),me("dpkg",["-i","packages-microsoft-prod.deb"]),he([{name:"powershell",version:e}],!0)}else if(await Ie())return Fe([{name:"powershell",version:void 0}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function Gb({version:e}={}){switch(process.platform){case"win32":return De("sccache",e);case"linux":{if(_e()){if((await Hm.getUbuntuVersion())[0]>=24)return he([{name:"sccache",version:e}])}else if(await Ie())return Fe([{name:"sccache",version:e}]);return Me("sccache",e)}case"darwin":return Me("sccache",e);default:throw new Error("Unsupported platform")}}function Vb(e){return e==="win32"?"windows":e}function Bb(e){switch(e){case"x64":return"amd64";case"ia32":case"x86":case"i386":case"x32":return"386";default:return e}}function zb(e,t,r){const n=Vb(t),i=Bb(r),a=t==="win32"?"zip":"tar.gz";return{binRelativeDir:"",binFileName:Ee("task"),extractedFolderName:"",url:`https://github.com/go-task/task/releases/download/v${e}/task_${n}_${i}.${a}`}}function Hb({version:e,setupDir:t,arch:r}){return vt("task",e,zb,t,r)}let ip=!1;async function Wb({version:e,setupDir:t,arch:r}){const n=await de("vcpkg",{nothrow:!0});if(ip&&n!==null)return{binDir:F.dirname(n)};if(await Qm(),process.platform==="linux"){if(Te())await Promise.all([Re("curl"),Re("zip"),Re("unzip"),Re("tar"),Re("pkg-config")]);else if(Ce())await xe([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(_e())await he([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(await Ie()){const i=[{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkgconf"}];ct.includes(r)&&i.push({name:"build-base"}),await Fe(i)}}return await ye(F.join(t,za("bootstrap-vcpkg",".bat")))?Jt(`Vcpkg folder already exists at ${t}. Skipping the clone`):await fe("git",["clone","https://github.com/microsoft/vcpkg"],{cwd:F.dirname(t),stdio:"inherit"}),e!==""&&e!=="true"&&(J(`Checking out vcpkg version ${e}`),await fe("git",["checkout",e],{cwd:t,stdio:"inherit"})),process.platform==="linux"&&ct.includes(r)&&await Pe("VCPKG_FORCE_SYSTEM_BINARIES","1",ne),await fe(za(Qp("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),await Er(t),await Oe(t,ne),ip=!0,{binDir:t}}const t_={llvm:_n,clang:_n,"clang++":_n},r_={gcc:$n,"g++":$n},n_={mingw:Nu},i_={msvc:Cr,cl:Cr,msbuild:Cr,visualstudio:Cr},s_={appleclang:xr,applellvm:xr,"apple-clang":xr,"apple-llvm":xr},Xb={cmakelang:Nr,"cmake-lint":Nr,"cmake-format":Nr,cmakelint:Nr,cmakeformat:Nr},o_=["llvm","clang","clang++","clang-tidy","clang-format","clangtidy","clangformat"],a_={"apt-fast":Ld,aptfast:Ld,nala:wS,git:Qm,brew:Eu,choco:xm,python:zm,powershell:rp,pwsh:rp,...t_,...r_,...n_,...i_,...s_,...Xb,cmake:Jm,ninja:Zm,vcpkg:Wb,bazel:O0,conan:N0,meson:xb,gcovr:g0,opencppcoverage:tp,OpenCppCoverage:tp,ccache:I0,sccache:Gb,doxygen:M0,graphviz:mn,cppcheck:A0,cpplint:x0,flawfinder:B0,lizard:ib,infer:X0,"clang-tidy":Zh,clangtidy:Zh,"clang-format":Qh,clangformat:Qh,vcvarsall:Du,kcov:nb,make:Lb,task:Hb,sevenzip:fn,"7zip":fn,"7z":fn,tar:qm},u_=Object.keys(a_),sp=["compiler","architecture","timeout",...u_],c_=3600*1e3;async function Kb(e,t,r,n,i,a,s,l=c_){Se.startGroup(`Installing ${e} ${t}`);try{await Yb(e,t,r,n,i,a)}catch(c){Le(c),c instanceof Error&&c.stack!==void 0&&Le(c.stack),s.push(`${e} failed to install`)}Se.endGroup()}async function Yb(e,t,r,n,i,a){const s=o_.includes(e);let l;if(e==="vcvarsall")await Du({version:it(e,t,r),arch:n,uwp:!1,spectre:!1});else if(e==="brew")l=await Eu({rcOptions:ne});else{const c=F.join(i,s?"llvm":e),u=it(e,t,r),o=a_[e];l=await o({version:u,setupDir:c,arch:n})}a.push(l_(e,l))}function l_(e,t){let r=`✅ ${e} was installed successfully:`;return t===void 0||("installDir"in t&&(r+=`
|
||
- The installation directory is ${t.installDir}`),t.binDir!==""&&(r+=`
|
||
- The binary directory is ${t.binDir}`)),r}const Jb=/[.-]((?:\d{4}|\d+(?:\.\d+)*(?:-[\w.-]+)?(?:\+[\w.-]+)?)$)/;function Qb(e){try{const t=e.match(Jb);if(t===null)return{compiler:e,version:void 0};const r=t[1],n=e.slice(0,t.index).replace(/[.-]$/,"");return!r.match(/^\d{4}$/)&&Un(r)===null&&J(`Non-semver version format: ${r}`),{compiler:n,version:r}}catch(t){return Le(`Failed to parse the compiler info ${e}: ${t}`),{compiler:e,version:void 0}}}async function Zb(e,t,r,n,i,a,s){var c;let l;try{if(Se.startGroup(`Installing ${e} ${t!=null?t:""}`),e in t_)l=await _n({version:it("llvm",t,r),setupDir:F.join(n,"llvm"),arch:i}),await E0();else if(e in r_){const u=it("gcc",t,r);l=await $n({version:u,setupDir:F.join(n,"gcc"),arch:i}),await Kh(u)}else if(e in n_){const u=it("mingw",t,r);l=await Nu({version:u,setupDir:F.join(n,"gcc"),arch:i}),await Kh(u)}else e in i_?l=await Cr({version:it("msvc",t,r),setupDir:F.join(n,"msvc"),arch:i}):e in s_?await xr():(l=null,s.push(`Unsupported compiler ${e}`))}catch(u){Le(u),u instanceof Error&&Le((c=u.stack)!=null?c:""),s.push(`Failed to install the ${e} compiler ${t}`)}l!==null&&a.push(l_(e,l)),Se.endGroup()}async function e$(e,t="npm"){try{return await de("setup-cpp",{nothrow:!0})!==null?`setup-cpp@${e} already installed`:(J(`Installing setup-cpp@${e} via ${t}...`),await fe(t,["install","-g",`setup-cpp@${e}`],{stdio:"inherit",timeout:1e3*60*1}),`setup-cpp@${e} installed successfully`)}catch(r){return new Error(`Failed to install the setup-cpp@${e} CLI: ${r}. Ignoring...`)}}async function t$(e={}){var R,p;const t=(R=e.architecture)!=null?R:process.arch,r=(p=process.env.SETUP_CPP_DIR)!=null?p:nt("~"),n=[],i=[],a=_d.create({autoloadLocales:!0});_d.addLocale(NE),gE.addLocale(RE);let s,l;const c=await kt(),u=e.compiler!==void 0?Qb(e.compiler):void 0;if(!zR(e,[...o_,"compiler"],u))return{successMessages:[],errorMessages:["The same version must be used for llvm, clang-format and clang-tidy"]};Te()&&typeof e.cppcheck=="string"&&typeof e.gcovr=="string"&&(J("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await Re("python-pygments"));const o=u_.filter(h=>{const y=e[h];return y!==void 0&&y!=="false"}),m=e["setup-cpp"]===void 0||e["setup-cpp"]?e$(nu.version,e["node-package-manager"]):Promise.resolve(void 0);let _=!1;for(const h of o){const y=e[h],v=e.timeout!==void 0?Number.parseFloat(e.timeout)*60*1e3:void 0;if(s=Date.now(),await Kb(h,y,c,t,r,n,i,v),l=Date.now(),J(`took ${a.format(s,l)||"0 seconds"}`),i.length!==0&&vn.isCI){_=!0;break}}if(!_&&u!==void 0){const h=Date.now();await Zb(u.compiler,u.version,c,r,t,n,i);const y=Date.now();J(`took ${a.format(h,y)||"0 seconds"}`)}const S=await m;return typeof S=="string"&&n.push(S),await nE(ne),{successMessages:n,errorMessages:i}}async function r$(e){const t=vn.GITHUB_ACTIONS?Promise.resolve():n$(),r=f_(e);if(r.help)return i$(),0;if(r.version)return J(`${nu.version}`),0;const{successMessages:n,errorMessages:i}=await t$(r);for(const a of n)Ny(a);for(const a of i)Le(a);if((n.length!==0||i.length!==0)&&(J("setup-cpp finished"),!vn.GITHUB_ACTIONS))switch(process.platform){case"win32":{ve("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break}case"linux":case"darwin":{ve("Run `source ~/.cpprc` or restart your shell to update the environment.");break}}return await t,i.length===0?0:1}async function n$(){try{await sy({pkg:nu})}catch(e){ve(`Failed to check for updates: ${e instanceof Error?e.message+e.stack:e}`)}}function f_(e){const t=Object.fromEntries(sp.map(r=>[r,vp(r)]));return A_(e,{string:[...sp,"timeout","node-package-manager"],default:t,alias:{h:"help",v:"version"},boolean:["help","version","setup-cpp"]})}function i$(){J(`
|
||
setup-cpp [options]
|
||
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
|
||
|
||
Install all the tools required for building and testing C++/C projects.
|
||
|
||
--architecture the cpu architecture to install the tools for. By default it uses the current CPU architecture.
|
||
--timeout the timeout for the installation of each tool in minutes. By default it is 10 minutes.
|
||
--compiler the <compiler> to install.
|
||
You can specify the version instead of specifying just the name e.g: --compiler 'llvm-13.0.0'
|
||
--tool_name pass "true" or pass the <version> you would like to install for this tool. e.g. --conan true or --conan "1.42.1"
|
||
--nodePackageManager the node package manager to use (npm/yarn/pnpm) when installing setup-cpp globally
|
||
--help show this help message
|
||
--version show the version of setup-cpp
|
||
|
||
All the available tools:
|
||
`),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --apple-clang, --vcvarsall"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --apt-fast, --nala, --git, --setup-cpp"},"analyzer/linter":{tools:"--clang-tidy, --clang-format, --cppcheck, --cpplint, --flawfinder, --lizard, --infer, , --cmakelang, --cmake-lint, --cmake-format"},cache:{tools:"--ccache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip, --tar"}},["tools"])}process.env.SETUP_CPP_SKIP_MAIN!=="true"&&r$(process.argv).then(e=>{process.exitCode=e}).catch(e=>{Le("main() panicked!"),Le(e),process.exitCode=1});exports.HttpClient=pp;exports.ciInfo=Et;exports.commonjsGlobal=tt;exports.coreExports=Se;exports.execExports=Mn;exports.getAugmentedNamespace=Pn;exports.getDefaultExportFromCjs=$e;exports.info=J;exports.parseArgs=f_;exports.pathExists=ye;exports.require$$13=su;exports.toolCacheExports=Vn;exports.warning=ve;
|
||
//# sourceMappingURL=setup-cpp.js.map
|