@sentry/craft 0.25.1 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -2
- package/dist/craft +26 -26
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.25.2
|
|
4
|
+
|
|
5
|
+
### Automated Changelog Fixups
|
|
6
|
+
|
|
7
|
+
We have fixed some edge cases and a major issue affecting GitHub release logs in our automated changelog generation. These are mostly about how we generated Markdown.
|
|
8
|
+
|
|
9
|
+
PRs: #301
|
|
10
|
+
|
|
11
|
+
### Various fixes & improvements
|
|
12
|
+
|
|
13
|
+
- docs(changelog): Fix subsections for 0.25.1 (bd1bc975)
|
|
14
|
+
|
|
3
15
|
## 0.25.1
|
|
4
16
|
|
|
5
|
-
|
|
17
|
+
### Automated Changelog Fixups
|
|
6
18
|
|
|
7
19
|
We have fixed some edge cases and a major issue affecting GitHub release logs in our automated changelog generation. These are mostly about how we generated Markdown.
|
|
8
20
|
|
|
9
21
|
PRs: #299, #298, #297, #296, #295
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
### Various fixes & improvements
|
|
12
24
|
|
|
13
25
|
- ci(release): Fetch all commits for prev version determination (eabce5ec)
|
|
14
26
|
- upgrade(ansi-regex): Upgrade ansi-regex to 5.0.1 (#300)
|
package/dist/craft
CHANGED
|
@@ -251,7 +251,7 @@ Instructions:
|
|
|
251
251
|
Filtered results for: ${this.inputValue?this.inputValue:yf.gray("Enter something to filter")}
|
|
252
252
|
`}renderOption(t,r,n){let i;return r.disabled?i=t===n?yf.gray().underline(r.title):yf.strikethrough().gray(r.title):i=t===n?yf.cyan().underline(r.title):r.title,(r.selected?yf.green(w0.radioOn):w0.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[yf.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(yf.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Oot.hide),super.render();let t=[bfe.symbol(this.done,this.aborted),yf.bold(this.msg),bfe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=yf.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=yfe(t,this.out.columns)}};vfe.exports=wfe});var Dfe=y((Fnr,_fe)=>{var xfe=mi(),qot=gf(),{style:Cfe,clear:Lot}=Lu(),{erase:Not,cursor:Sfe}=vi(),Afe=class extends qot{constructor(t={}){super(t);this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
253
253
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
254
|
-
`),this.close()}_(t,r){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Sfe.hide):this.out.write(Lot(this.outputText,this.out.columns)),super.render(),this.outputText=[Cfe.symbol(this.done,this.aborted),xfe.bold(this.msg),Cfe.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:xfe.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Not.line+Sfe.to(0)+this.outputText))}};_fe.exports=Afe});var Tfe=y((Inr,kfe)=>{"use strict";kfe.exports={TextPrompt:lle(),SelectPrompt:mle(),TogglePrompt:wle(),DatePrompt:tfe(),NumberPrompt:sfe(),MultiselectPrompt:P8(),AutocompletePrompt:gfe(),AutocompleteMultiselectPrompt:Efe(),ConfirmPrompt:Dfe()}});var Pfe=y(Rfe=>{"use strict";var Gs=Rfe,Bot=Tfe(),$A=e=>e;function Uc(e,t,r={}){return new Promise((n,i)=>{let a=new Bot[e](t),s=r.onAbort||$A,o=r.onSubmit||$A,u=r.onExit||$A;a.on("state",t.onState||$A),a.on("submit",c=>n(o(c))),a.on("exit",c=>n(u(c))),a.on("abort",c=>i(s(c)))})}Gs.text=e=>Uc("TextPrompt",e);Gs.password=e=>(e.style="password",Gs.text(e));Gs.invisible=e=>(e.style="invisible",Gs.text(e));Gs.number=e=>Uc("NumberPrompt",e);Gs.date=e=>Uc("DatePrompt",e);Gs.confirm=e=>Uc("ConfirmPrompt",e);Gs.list=e=>{let t=e.separator||",";return Uc("TextPrompt",e,{onSubmit:r=>r.split(t).map(n=>n.trim())})};Gs.toggle=e=>Uc("TogglePrompt",e);Gs.select=e=>Uc("SelectPrompt",e);Gs.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(n=>n.selected).map(n=>n.value);return Uc("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};Gs.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(n=>n.selected).map(n=>n.value);return Uc("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var Mot=(e,t)=>Promise.resolve(t.filter(r=>r.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Gs.autocomplete=e=>(e.suggest=e.suggest||Mot,e.choices=[].concat(e.choices||[]),Uc("AutocompletePrompt",e))});var Ofe=y((jnr,Ffe)=>{"use strict";var O8=Pfe(),Uot=["suggest","format","onState","validate","onRender","type"],Ife=()=>{};async function Qd(e=[],{onSubmit:t=Ife,onCancel:r=Ife}={}){let n={},i=Qd._override||{};e=[].concat(e);let a,s,o,u,c,l,f=async(d,p,h=!1)=>{if(!(!h&&d.validate&&d.validate(p)!==!0))return d.format?await d.format(p,n):p};for(s of e)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(a,m({},n),s),s.type=c),!!c){for(let d in s){if(Uot.includes(d))continue;let p=s[d];s[d]=typeof p=="function"?await p(a,m({},n),l):p}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,O8[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(a=await f(s,i[s.name]),a!==void 0)){n[u]=a;continue}try{a=Qd._injected?zot(Qd._injected,s.initial):await O8[c](s),n[u]=a=await f(s,a,!0),o=await t(s,a,n)}catch(d){o=!await r(s,n)}if(o)return n}return n}function zot(e,t){let r=e.shift();if(r instanceof Error)throw r;return r===void 0?t:r}function $ot(e){Qd._injected=(Qd._injected||[]).concat(e)}function Got(e){Qd._override=Object.assign({},e)}Ffe.exports=Object.assign(Qd,{prompt:Qd,prompts:O8,inject:$ot,override:Got})});var j8=y((qnr,jfe)=>{function Hot(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,r=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(r[t]>e[t])return!1;if(e[t]>r[t])return!0}return!1}jfe.exports=Hot("8.6.0")?zce():Ofe()});var Mfe=y((znr,Bfe)=>{Bfe.exports={name:"@sentry/craft",version:"0.25.1",description:"The universal sentry workflow CLI",main:"dist/craft",repository:"https://github.com/getsentry/craft",author:"Sentry",license:"MIT",bin:{craft:"dist/craft","sentry-craft":"dist/craft"},resolutions:{"**/set-value":">=2.0.1","**/https-proxy-agent":">=2.2.3","**/node-forge":">=0.10.0","**/dot-prop":">=4.2.1","**/kind-of":">=6.0.3","**/node-fetch":">=2.6.1","**/yargs-parser":">=18.1.2","**/parse-url":">=5.0.3","**/ansi-regex":">=5.0.1 < 6.0.0"},devDependencies:{"@aws-sdk/client-lambda":"^3.2.0","@google-cloud/storage":"^5.7.0","@octokit/plugin-retry":"^3.0.9","@octokit/rest":"^18.10.0","@sentry/node":"4.6.3","@sentry/typescript":"^5.17.0","@types/async":"^3.0.1","@types/aws4":"^1.5.1","@types/cli-table":"^0.3.0","@types/git-url-parse":"^9.0.0","@types/is-ci":"^2.0.0","@types/jest":"^26.0.14","@types/js-yaml":"^3.11.1","@types/mkdirp":"^1.0.0","@types/node":"^12.11.1","@types/node-fetch":"^2.5.10","@types/ora":"^1.3.4","@types/prompts":"^2.0.11","@types/rimraf":"^2.0.2","@types/shell-quote":"^1.6.0","@types/tar":"^4.0.0","@types/tmp":"^0.0.33","@types/unzipper":"^0.10.3","@types/yargs":"^15.0.3","@typescript-eslint/eslint-plugin":"^3.3.0","@typescript-eslint/parser":"^3.3.0",ajv:"6.6.2",async:"3.1.0",aws4:"^1.11.0",chalk:"4.1.1","cli-table":"0.3.1",consola:"2.15.3",esbuild:"^0.11.6",eslint:"^7.2.0","eslint-config-prettier":"^6.11.0","fast-xml-parser":"^3.19.0","git-url-parse":"^11.4.4","is-ci":"^2.0.0",jest:"^26.5.3","js-yaml":"3.13.1","json-schema-to-typescript":"5.7.0",mkdirp:"0.5.1",mustache:"3.0.1","node-fetch":"^2.6.1",nvar:"1.3.1",ora:"5.4.0",prettier:"^2.2.1",prompts:"2.4.1",rimraf:"2.7.1","shell-quote":"1.6.1","simple-git":"2.38.0",split:"1.0.1","string-length":"3.1.0",tar:"4.4.18",tmp:"0.1.0","ts-jest":"^26.5.5",typescript:"^4.1.3",unzipper:"0.10.11",yargs:"15.4.1"},scripts:{"build:fat":"yarn run compile-config-schema && tsc -p tsconfig.build.json","build:watch":"yarn run compile-config-schema && tsc -p tsconfig.build.json --watch",build:"yarn compile-config-schema && esbuild src/index.ts --bundle --platform=node --target=node14.17 --outfile=dist/craft --minify",precli:"yarn build",cli:"node dist/craft",clean:"rimraf dist coverage",fix:"prettier --write .",test:"jest","test:watch":"jest --watch --notify","compile-config-schema":"node ./scripts/config-json-schema-to-ts.js"},volta:{node:"14.17.6",yarn:"1.22.10"}}});var S0=y((zc,Gfe)=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});function M1(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Nu=M1(require("stream")),Hfe=M1(require("http")),L8=M1(require("url")),Yot=M1(require("https")),ym=M1(require("zlib")),Qot=Nu.Readable,bf=Symbol("buffer"),N8=Symbol("type"),bm=class{constructor(){this[N8]="";let t=arguments[0],r=arguments[1],n=[],i=0;if(t){let s=t,o=Number(s.length);for(let u=0;u<o;u++){let c=s[u],l;c instanceof Buffer?l=c:ArrayBuffer.isView(c)?l=Buffer.from(c.buffer,c.byteOffset,c.byteLength):c instanceof ArrayBuffer?l=Buffer.from(c):c instanceof bm?l=c[bf]:l=Buffer.from(typeof c=="string"?c:String(c)),i+=l.length,n.push(l)}}this[bf]=Buffer.concat(n);let a=r&&r.type!==void 0&&String(r.type).toLowerCase();a&&!/[^\u0020-\u007E]/.test(a)&&(this[N8]=a)}get size(){return this[bf].length}get type(){return this[N8]}text(){return Promise.resolve(this[bf].toString())}arrayBuffer(){let t=this[bf],r=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return Promise.resolve(r)}stream(){let t=new Qot;return t._read=function(){},t.push(this[bf]),t.push(null),t}toString(){return"[object Blob]"}slice(){let t=this.size,r=arguments[0],n=arguments[1],i,a;r===void 0?i=0:r<0?i=Math.max(t+r,0):i=Math.min(r,t),n===void 0?a=t:n<0?a=Math.max(t+n,0):a=Math.min(n,t);let s=Math.max(a-i,0),u=this[bf].slice(i,i+s),c=new bm([],{type:arguments[2]});return c[bf]=u,c}};Object.defineProperties(bm.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Object.defineProperty(bm.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0});function ss(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}ss.prototype=Object.create(Error.prototype);ss.prototype.constructor=ss;ss.prototype.name="FetchError";var B8;try{B8=require("encoding").convert}catch(e){}var wf=Symbol("Body internals"),Vfe=Nu.PassThrough;function wa(e){var t=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.size;let i=n===void 0?0:n;var a=r.timeout;let s=a===void 0?0:a;e==null?e=null:Kfe(e)?e=Buffer.from(e.toString()):U1(e)||Buffer.isBuffer(e)||(Object.prototype.toString.call(e)==="[object ArrayBuffer]"?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof Nu||(e=Buffer.from(String(e)))),this[wf]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof Nu&&e.on("error",function(o){let u=o.name==="AbortError"?o:new ss(`Invalid response body while trying to fetch ${t.url}: ${o.message}`,"system",o);t[wf].error=u})}wa.prototype={get body(){return this[wf].body},get bodyUsed(){return this[wf].disturbed},arrayBuffer(){return x0.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let e=this.headers&&this.headers.get("content-type")||"";return x0.call(this).then(function(t){return Object.assign(new bm([],{type:e.toLowerCase()}),{[bf]:t})})},json(){var e=this;return x0.call(this).then(function(t){try{return JSON.parse(t.toString())}catch(r){return wa.Promise.reject(new ss(`invalid json response body at ${e.url} reason: ${r.message}`,"invalid-json"))}})},text(){return x0.call(this).then(function(e){return e.toString()})},buffer(){return x0.call(this)},textConverted(){var e=this;return x0.call(this).then(function(t){return Xot(t,e.headers)})}};Object.defineProperties(wa.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});wa.mixIn=function(e){for(let t of Object.getOwnPropertyNames(wa.prototype))if(!(t in e)){let r=Object.getOwnPropertyDescriptor(wa.prototype,t);Object.defineProperty(e,t,r)}};function x0(){var e=this;if(this[wf].disturbed)return wa.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[wf].disturbed=!0,this[wf].error)return wa.Promise.reject(this[wf].error);let t=this.body;if(t===null)return wa.Promise.resolve(Buffer.alloc(0));if(U1(t)&&(t=t.stream()),Buffer.isBuffer(t))return wa.Promise.resolve(t);if(!(t instanceof Nu))return wa.Promise.resolve(Buffer.alloc(0));let r=[],n=0,i=!1;return new wa.Promise(function(a,s){let o;e.timeout&&(o=setTimeout(function(){i=!0,s(new ss(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))},e.timeout)),t.on("error",function(u){u.name==="AbortError"?(i=!0,s(u)):s(new ss(`Invalid response body while trying to fetch ${e.url}: ${u.message}`,"system",u))}),t.on("data",function(u){if(!(i||u===null)){if(e.size&&n+u.length>e.size){i=!0,s(new ss(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return}n+=u.length,r.push(u)}}),t.on("end",function(){if(!i){clearTimeout(o);try{a(Buffer.concat(r,n))}catch(u){s(new ss(`Could not create Buffer from response body for ${e.url}: ${u.message}`,"system",u))}}})})}function Xot(e,t){if(typeof B8!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let r=t.get("content-type"),n="utf-8",i,a;return r&&(i=/charset=([^;]*)/i.exec(r)),a=e.slice(0,1024).toString(),!i&&a&&(i=/<meta.+?charset=(['"])(.+?)\1/i.exec(a)),!i&&a&&(i=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(a),i||(i=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(a),i&&i.pop()),i&&(i=/charset=(.*)/i.exec(i.pop()))),!i&&a&&(i=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(a)),i&&(n=i.pop(),(n==="gb2312"||n==="gbk")&&(n="gb18030")),B8(e,"UTF-8",n).toString()}function Kfe(e){return typeof e!="object"||typeof e.append!="function"||typeof e.delete!="function"||typeof e.get!="function"||typeof e.getAll!="function"||typeof e.has!="function"||typeof e.set!="function"?!1:e.constructor.name==="URLSearchParams"||Object.prototype.toString.call(e)==="[object URLSearchParams]"||typeof e.sort=="function"}function U1(e){return typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.constructor=="function"&&typeof e.constructor.name=="string"&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function Jfe(e){let t,r,n=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof Nu&&typeof n.getBoundary!="function"&&(t=new Vfe,r=new Vfe,n.pipe(t),n.pipe(r),e[wf].body=t,n=r),n}function Wfe(e){return e===null?null:typeof e=="string"?"text/plain;charset=UTF-8":Kfe(e)?"application/x-www-form-urlencoded;charset=UTF-8":U1(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof Nu?null:"text/plain;charset=UTF-8"}function Yfe(e){let t=e.body;return t===null?0:U1(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length==0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}function Zot(e,t){let r=t.body;r===null?e.end():U1(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}wa.Promise=global.Promise;var Qfe=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,M8=/[^\t\x20-\x7e\x80-\xff]/;function z1(e){if(e=`${e}`,Qfe.test(e)||e==="")throw new TypeError(`${e} is not a legal HTTP header name`)}function Xfe(e){if(e=`${e}`,M8.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function C0(e,t){t=t.toLowerCase();for(let r in e)if(r.toLowerCase()===t)return r}var Li=Symbol("map"),mo=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;if(this[Li]=Object.create(null),t instanceof mo){let r=t.raw(),n=Object.keys(r);for(let i of n)for(let a of r[i])this.append(i,a);return}if(t!=null)if(typeof t=="object"){let r=t[Symbol.iterator];if(r!=null){if(typeof r!="function")throw new TypeError("Header pairs must be iterable");let n=[];for(let i of t){if(typeof i!="object"||typeof i[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");n.push(Array.from(i))}for(let i of n){if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");this.append(i[0],i[1])}}else for(let n of Object.keys(t)){let i=t[n];this.append(n,i)}}else throw new TypeError("Provided initializer must be an object")}get(t){t=`${t}`,z1(t);let r=C0(this[Li],t);return r===void 0?null:this[Li][r].join(", ")}forEach(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=U8(this),i=0;for(;i<n.length;){var a=n[i];let s=a[0],o=a[1];t.call(r,o,s,this),n=U8(this),i++}}set(t,r){t=`${t}`,r=`${r}`,z1(t),Xfe(r);let n=C0(this[Li],t);this[Li][n!==void 0?n:t]=[r]}append(t,r){t=`${t}`,r=`${r}`,z1(t),Xfe(r);let n=C0(this[Li],t);n!==void 0?this[Li][n].push(r):this[Li][t]=[r]}has(t){return t=`${t}`,z1(t),C0(this[Li],t)!==void 0}delete(t){t=`${t}`,z1(t);let r=C0(this[Li],t);r!==void 0&&delete this[Li][r]}raw(){return this[Li]}keys(){return z8(this,"key")}values(){return z8(this,"value")}[Symbol.iterator](){return z8(this,"key+value")}};mo.prototype.entries=mo.prototype[Symbol.iterator];Object.defineProperty(mo.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(mo.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});function U8(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key+value";return Object.keys(e[Li]).sort().map(t==="key"?function(n){return n.toLowerCase()}:t==="value"?function(n){return e[Li][n].join(", ")}:function(n){return[n.toLowerCase(),e[Li][n].join(", ")]})}var $8=Symbol("internal");function z8(e,t){let r=Object.create(G8);return r[$8]={target:e,kind:t,index:0},r}var G8=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==G8)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[$8];let t=e.target,r=e.kind,n=e.index,i=U8(t,r),a=i.length;return n>=a?{value:void 0,done:!0}:(this[$8].index=n+1,{value:i[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(G8,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});function eut(e){let t=Object.assign({__proto__:null},e[Li]),r=C0(e[Li],"Host");return r!==void 0&&(t[r]=t[r][0]),t}function tut(e){let t=new mo;for(let r of Object.keys(e))if(!Qfe.test(r))if(Array.isArray(e[r]))for(let n of e[r])M8.test(n)||(t[Li][r]===void 0?t[Li][r]=[n]:t[Li][r].push(n));else M8.test(e[r])||(t[Li][r]=[e[r]]);return t}var tp=Symbol("Response internals"),rut=Hfe.STATUS_CODES,Ko=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wa.call(this,t,r);let n=r.status||200,i=new mo(r.headers);if(t!=null&&!i.has("Content-Type")){let a=Wfe(t);a&&i.append("Content-Type",a)}this[tp]={url:r.url,status:n,statusText:r.statusText||rut[n],headers:i,counter:r.counter}}get url(){return this[tp].url||""}get status(){return this[tp].status}get ok(){return this[tp].status>=200&&this[tp].status<300}get redirected(){return this[tp].counter>0}get statusText(){return this[tp].statusText}get headers(){return this[tp].headers}clone(){return new Ko(Jfe(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}};wa.mixIn(Ko.prototype);Object.defineProperties(Ko.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Object.defineProperty(Ko.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});var Ef=Symbol("Request internals"),H8=L8.parse,nut=L8.format,iut="destroy"in Nu.Readable.prototype;function KA(e){return typeof e=="object"&&typeof e[Ef]=="object"}function aut(e){let t=e&&typeof e=="object"&&Object.getPrototypeOf(e);return!!(t&&t.constructor.name==="AbortSignal")}var _f=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;KA(t)?n=H8(t.url):(t&&t.href?n=H8(t.href):n=H8(`${t}`),t={});let i=r.method||t.method||"GET";if(i=i.toUpperCase(),(r.body!=null||KA(t)&&t.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let a=r.body!=null?r.body:KA(t)&&t.body!==null?Jfe(t):null;wa.call(this,a,{timeout:r.timeout||t.timeout||0,size:r.size||t.size||0});let s=new mo(r.headers||t.headers||{});if(a!=null&&!s.has("Content-Type")){let u=Wfe(a);u&&s.append("Content-Type",u)}let o=KA(t)?t.signal:null;if("signal"in r&&(o=r.signal),o!=null&&!aut(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[Ef]={method:i,redirect:r.redirect||t.redirect||"follow",headers:s,parsedURL:n,signal:o},this.follow=r.follow!==void 0?r.follow:t.follow!==void 0?t.follow:20,this.compress=r.compress!==void 0?r.compress:t.compress!==void 0?t.compress:!0,this.counter=r.counter||t.counter||0,this.agent=r.agent||t.agent}get method(){return this[Ef].method}get url(){return nut(this[Ef].parsedURL)}get headers(){return this[Ef].headers}get redirect(){return this[Ef].redirect}get signal(){return this[Ef].signal}clone(){return new _f(this)}};wa.mixIn(_f.prototype);Object.defineProperty(_f.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(_f.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});function sut(e){let t=e[Ef].parsedURL,r=new mo(e[Ef].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof Nu.Readable&&!iut)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(e.body==null&&/^(POST|PUT)$/i.test(e.method)&&(n="0"),e.body!=null){let a=Yfe(e);typeof a=="number"&&(n=String(a))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=e.agent;return typeof i=="function"&&(i=i(t)),!r.has("Connection")&&!i&&r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:eut(r),agent:i})}function $1(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}$1.prototype=Object.create(Error.prototype);$1.prototype.constructor=$1;$1.prototype.name="AbortError";var Zfe=Nu.PassThrough,out=L8.resolve;function rp(e,t){if(!rp.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return wa.Promise=rp.Promise,new rp.Promise(function(r,n){let i=new _f(e,t),a=sut(i),s=(a.protocol==="https:"?Yot:Hfe).request,o=i.signal,u=null,c=function(){let g=new $1("The user aborted a request.");n(g),i.body&&i.body instanceof Nu.Readable&&i.body.destroy(g),!(!u||!u.body)&&u.body.emit("error",g)};if(o&&o.aborted){c();return}let l=function(){c(),p()},f=s(a),d;o&&o.addEventListener("abort",l);function p(){f.abort(),o&&o.removeEventListener("abort",l),clearTimeout(d)}i.timeout&&f.once("socket",function(h){d=setTimeout(function(){n(new ss(`network timeout at: ${i.url}`,"request-timeout")),p()},i.timeout)}),f.on("error",function(h){n(new ss(`request to ${i.url} failed, reason: ${h.message}`,"system",h)),p()}),f.on("response",function(h){clearTimeout(d);let g=tut(h.headers);if(rp.isRedirect(h.statusCode)){let S=g.get("Location"),F=S===null?null:out(i.url,S);switch(i.redirect){case"error":n(new ss(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),p();return;case"manual":if(F!==null)try{g.set("Location",F)}catch(K){n(K)}break;case"follow":if(F===null)break;if(i.counter>=i.follow){n(new ss(`maximum redirect reached at: ${i.url}`,"max-redirect")),p();return}let P={headers:new mo(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout,size:i.size};if(h.statusCode!==303&&i.body&&Yfe(i)===null){n(new ss("Cannot follow redirect with body being a readable stream","unsupported-redirect")),p();return}(h.statusCode===303||(h.statusCode===301||h.statusCode===302)&&i.method==="POST")&&(P.method="GET",P.body=void 0,P.headers.delete("content-length")),r(rp(new _f(F,P))),p();return}}h.once("end",function(){o&&o.removeEventListener("abort",l)});let v=h.pipe(new Zfe),b={url:i.url,status:h.statusCode,statusText:h.statusMessage,headers:g,size:i.size,timeout:i.timeout,counter:i.counter},E=g.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||E===null||h.statusCode===204||h.statusCode===304){u=new Ko(v,b),r(u);return}let _={flush:ym.Z_SYNC_FLUSH,finishFlush:ym.Z_SYNC_FLUSH};if(E=="gzip"||E=="x-gzip"){v=v.pipe(ym.createGunzip(_)),u=new Ko(v,b),r(u);return}if(E=="deflate"||E=="x-deflate"){h.pipe(new Zfe).once("data",function(F){(F[0]&15)==8?v=v.pipe(ym.createInflate()):v=v.pipe(ym.createInflateRaw()),u=new Ko(v,b),r(u)});return}if(E=="br"&&typeof ym.createBrotliDecompress=="function"){v=v.pipe(ym.createBrotliDecompress()),u=new Ko(v,b),r(u);return}u=new Ko(v,b),r(u)}),Zot(f,i)})}rp.isRedirect=function(e){return e===301||e===302||e===303||e===307||e===308};rp.Promise=global.Promise;Gfe.exports=zc=rp;Object.defineProperty(zc,"__esModule",{value:!0});zc.default=zc;zc.Headers=mo;zc.Request=_f;zc.Response=Ko;zc.FetchError=ss});var rde=y((ede,tde)=>{var uut=require("stream");ede=tde.exports=V8;V8.through=V8;function V8(e,t,r){e=e||function(l){this.queue(l)},t=t||function(){this.queue(null)};var n=!1,i=!1,a=[],s=!1,o=new uut;o.readable=o.writable=!0,o.paused=!1,o.autoDestroy=!(r&&r.autoDestroy===!1),o.write=function(l){return e.call(this,l),!o.paused};function u(){for(;a.length&&!o.paused;){var l=a.shift();if(l===null)return o.emit("end");o.emit("data",l)}}o.queue=o.push=function(l){return s||(l===null&&(s=!0),a.push(l),u()),o},o.on("end",function(){o.readable=!1,!o.writable&&o.autoDestroy&&process.nextTick(function(){o.destroy()})});function c(){o.writable=!1,t.call(o),!o.readable&&o.autoDestroy&&o.destroy()}return o.end=function(l){if(!n)return n=!0,arguments.length&&o.write(l),c(),o},o.destroy=function(){if(!i)return i=!0,n=!0,a.length=0,o.writable=o.readable=!1,o.emit("close"),o},o.pause=function(){if(!o.paused)return o.paused=!0,o},o.resume=function(){return o.paused&&(o.paused=!1,o.emit("resume")),u(),o.paused||o.emit("drain"),o},o}});var ide=y((Hnr,nde)=>{var cut=rde(),lut=require("string_decoder").StringDecoder;nde.exports=fut;function fut(e,t,r){var n=new lut,i="",a=r&&r.maxLength,s=!(r&&r.trailing===!1);typeof e=="function"&&(t=e,e=null),e||(e=/\r?\n/);function o(c,l){if(t){try{l=t(l)}catch(f){return c.emit("error",f)}typeof l!="undefined"&&c.queue(l)}else c.queue(l)}function u(c,l){var f=((i??"")+l).split(e);if(i=f.pop(),a&&i.length>a)return c.emit("error",new Error("maximum buffer reached"));for(var d=0;d<f.length;d++){var p=f[d];o(c,p)}}return cut(function(c){u(this,n.write(c))},function(){n.end&&u(this,n.end()),s&&i!=null&&o(this,i),this.queue(null)})}});var A0=y((Knr,ade)=>{"use strict";var sde=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]),Vnr=ade.exports=e=>e?Object.keys(e).map(t=>[sde.has(t)?sde.get(t):t,e[t]]).reduce((t,r)=>(t[r[0]]=r[1],t),Object.create(null)):{}});var cde=y((K8,ode)=>{var JA=require("buffer"),$c=JA.Buffer;function ude(e,t){for(var r in e)t[r]=e[r]}$c.from&&$c.alloc&&$c.allocUnsafe&&$c.allocUnsafeSlow?ode.exports=JA:(ude(JA,K8),K8.Buffer=wm);function wm(e,t,r){return $c(e,t,r)}wm.prototype=Object.create($c.prototype);ude($c,wm);wm.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return $c(e,t,r)};wm.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=$c(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};wm.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $c(e)};wm.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return JA.SlowBuffer(e)}});var np=y((Jnr,lde)=>{"use strict";var J8=Buffer;J8.alloc||(J8=cde().Buffer);lde.exports=J8});var dde=y((Wnr,fde)=>{"use strict";fde.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var WA=y((Ynr,pde)=>{"use strict";pde.exports=bn;bn.Node=Em;bn.create=bn;function bn(e){var t=this;if(t instanceof bn||(t=new bn),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}bn.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};bn.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};bn.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};bn.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)dut(this,arguments[e]);return this.length};bn.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)put(this,arguments[e]);return this.length};bn.prototype.pop=function(){if(!!this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};bn.prototype.shift=function(){if(!!this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};bn.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};bn.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};bn.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};bn.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};bn.prototype.map=function(e,t){t=t||this;for(var r=new bn,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};bn.prototype.mapReverse=function(e,t){t=t||this;for(var r=new bn,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};bn.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};bn.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};bn.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};bn.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};bn.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new bn;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};bn.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new bn;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};bn.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,n=this.head;n!==null&&r<e;r++)n=n.next;for(var i=[],r=0;n&&r<t;r++)i.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var r=2;r<arguments.length;r++)n=hut(this,n,arguments[r]);return i};bn.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function hut(e,t,r){var n=t===e.head?new Em(r,null,t,e):new Em(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function dut(e,t){e.tail=new Em(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function put(e,t){e.head=new Em(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Em(e,t,r,n){if(!(this instanceof Em))return new Em(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{dde()(bn)}catch(e){}});var As=y((W8,hde)=>{var YA=require("buffer"),xf=YA.Buffer;function mde(e,t){for(var r in e)t[r]=e[r]}xf.from&&xf.alloc&&xf.allocUnsafe&&xf.allocUnsafeSlow?hde.exports=YA:(mde(YA,W8),W8.Buffer=D0);function D0(e,t,r){return xf(e,t,r)}mde(xf,D0);D0.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return xf(e,t,r)};D0.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=xf(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};D0.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return xf(e)};D0.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return YA.SlowBuffer(e)}});var k0=y((Qnr,gde)=>{"use strict";var vde=require("events"),G1=WA(),yde=require("string_decoder").StringDecoder,Cf=Symbol("EOF"),H1=Symbol("maybeEmitEnd"),ip=Symbol("emittedEnd"),QA=Symbol("emittingEnd"),XA=Symbol("closed"),bde=Symbol("read"),wde=Symbol("flush"),Ede=Symbol("flushChunk"),Hs=Symbol("encoding"),Sf=Symbol("decoder"),ZA=Symbol("flowing"),V1=Symbol("paused"),K1=Symbol("resume"),Vs=Symbol("bufferLength"),_de=Symbol("bufferPush"),Y8=Symbol("bufferShift"),Ks=Symbol("objectMode"),os=Symbol("destroyed"),xde=global._MP_NO_ITERATOR_SYMBOLS_!=="1",mut=xde&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),gut=xde&&Symbol.iterator||Symbol("iterator not implemented"),ap=Buffer.alloc?Buffer:As().Buffer,Cde=e=>e==="end"||e==="finish"||e==="prefinish",vut=e=>e instanceof ArrayBuffer||typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,yut=e=>!ap.isBuffer(e)&&ArrayBuffer.isView(e);gde.exports=class Sde extends vde{constructor(t){super();this[ZA]=!1,this[V1]=!1,this.pipes=new G1,this.buffer=new G1,this[Ks]=t&&t.objectMode||!1,this[Ks]?this[Hs]=null:this[Hs]=t&&t.encoding||null,this[Hs]==="buffer"&&(this[Hs]=null),this[Sf]=this[Hs]?new yde(this[Hs]):null,this[Cf]=!1,this[ip]=!1,this[QA]=!1,this[XA]=!1,this.writable=!0,this.readable=!0,this[Vs]=0,this[os]=!1}get bufferLength(){return this[Vs]}get encoding(){return this[Hs]}set encoding(t){if(this[Ks])throw new Error("cannot set encoding in objectMode");if(this[Hs]&&t!==this[Hs]&&(this[Sf]&&this[Sf].lastNeed||this[Vs]))throw new Error("cannot change encoding");this[Hs]!==t&&(this[Sf]=t?new yde(t):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[Sf].write(r)))),this[Hs]=t}setEncoding(t){this.encoding=t}get objectMode(){return this[Ks]}set objectMode(t){this[Ks]=this[Ks]||!!t}write(t,r,n){if(this[Cf])throw new Error("write after end");if(this[os])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8"),!this[Ks]&&!ap.isBuffer(t)&&(yut(t)?t=ap.from(t.buffer,t.byteOffset,t.byteLength):vut(t)?t=ap.from(t):typeof t!="string"&&(this.objectMode=!0)),!this.objectMode&&!t.length){let i=this.flowing;return this[Vs]!==0&&this.emit("readable"),n&&n(),i}typeof t=="string"&&!this[Ks]&&!(r===this[Hs]&&!this[Sf].lastNeed)&&(t=ap.from(t,r)),ap.isBuffer(t)&&this[Hs]&&(t=this[Sf].write(t));try{return this.flowing?(this.emit("data",t),this.flowing):(this[_de](t),!1)}finally{this[Vs]!==0&&this.emit("readable"),n&&n()}}read(t){if(this[os])return null;try{return this[Vs]===0||t===0||t>this[Vs]?null:(this[Ks]&&(t=null),this.buffer.length>1&&!this[Ks]&&(this.encoding?this.buffer=new G1([Array.from(this.buffer).join("")]):this.buffer=new G1([ap.concat(Array.from(this.buffer),this[Vs])])),this[bde](t||null,this.buffer.head.value))}finally{this[H1]()}}[bde](t,r){return t===r.length||t===null?this[Y8]():(this.buffer.head.value=r.slice(t),r=r.slice(0,t),this[Vs]-=t),this.emit("data",r),!this.buffer.length&&!this[Cf]&&this.emit("drain"),r}end(t,r,n){return typeof t=="function"&&(n=t,t=null),typeof r=="function"&&(n=r,r="utf8"),t&&this.write(t,r),n&&this.once("end",n),this[Cf]=!0,this.writable=!1,(this.flowing||!this[V1])&&this[H1](),this}[K1](){this[os]||(this[V1]=!1,this[ZA]=!0,this.emit("resume"),this.buffer.length?this[wde]():this[Cf]?this[H1]():this.emit("drain"))}resume(){return this[K1]()}pause(){this[ZA]=!1,this[V1]=!0}get destroyed(){return this[os]}get flowing(){return this[ZA]}get paused(){return this[V1]}[_de](t){return this[Ks]?this[Vs]+=1:this[Vs]+=t.length,this.buffer.push(t)}[Y8](){return this.buffer.length&&(this[Ks]?this[Vs]-=1:this[Vs]-=this.buffer.head.value.length),this.buffer.shift()}[wde](){do;while(this[Ede](this[Y8]()));!this.buffer.length&&!this[Cf]&&this.emit("drain")}[Ede](t){return t?(this.emit("data",t),this.flowing):!1}pipe(t,r){if(this[os])return;let n=this[ip];r=r||{},t===process.stdout||t===process.stderr?r.end=!1:r.end=r.end!==!1;let i={dest:t,opts:r,ondrain:a=>this[K1]()};return this.pipes.push(i),t.on("drain",i.ondrain),this[K1](),n&&i.opts.end&&i.dest.end(),t}addListener(t,r){return this.on(t,r)}on(t,r){try{return super.on(t,r)}finally{t==="data"&&!this.pipes.length&&!this.flowing?this[K1]():Cde(t)&&this[ip]&&(super.emit(t),this.removeAllListeners(t))}}get emittedEnd(){return this[ip]}[H1](){!this[QA]&&!this[ip]&&!this[os]&&this.buffer.length===0&&this[Cf]&&(this[QA]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[XA]&&this.emit("close"),this[QA]=!1)}emit(t,r){if(t!=="error"&&t!=="close"&&t!==os&&this[os])return;if(t==="data"){if(!r)return;this.pipes.length&&this.pipes.forEach(i=>i.dest.write(r)===!1&&this.pause())}else if(t==="end"){if(this[ip]===!0)return;this[ip]=!0,this.readable=!1,this[Sf]&&(r=this[Sf].end(),r&&(this.pipes.forEach(i=>i.dest.write(r)),super.emit("data",r))),this.pipes.forEach(i=>{i.dest.removeListener("drain",i.ondrain),i.opts.end&&i.dest.end()})}else if(t==="close"&&(this[XA]=!0,!this[ip]&&!this[os]))return;let n=new Array(arguments.length);if(n[0]=t,n[1]=r,arguments.length>2)for(let i=2;i<arguments.length;i++)n[i]=arguments[i];try{return super.emit.apply(this,n)}finally{Cde(t)?this.removeAllListeners(t):this[H1]()}}collect(){let t=[];return t.dataLength=0,this.on("data",r=>{t.push(r),t.dataLength+=r.length}),this.promise().then(()=>t)}concat(){return this[Ks]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(t=>this[Ks]?Promise.reject(new Error("cannot concat in objectMode")):this[Hs]?t.join(""):ap.concat(t,t.dataLength))}promise(){return new Promise((t,r)=>{this.on(os,()=>r(new Error("stream destroyed"))),this.on("end",()=>t()),this.on("error",n=>r(n))})}[mut](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Cf])return Promise.resolve({done:!0});let n=null,i=null,a=c=>{this.removeListener("data",s),this.removeListener("end",o),i(c)},s=c=>{this.removeListener("error",a),this.removeListener("end",o),this.pause(),n({value:c,done:!!this[Cf]})},o=()=>{this.removeListener("error",a),this.removeListener("data",s),n({done:!0})},u=()=>a(new Error("stream destroyed"));return new Promise((c,l)=>{i=l,n=c,this.once(os,u),this.once("error",a),this.once("end",o),this.once("data",s)})}}}[gut](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(t){return this[os]?(t?this.emit("error",t):this.emit(os),this):(this[os]=!0,this.buffer=new G1,this[Vs]=0,typeof this.close=="function"&&!this[XA]&&this.close(),t?this.emit("error",t):this.emit(os),this)}static isStream(t){return!!t&&(t instanceof Sde||t instanceof vde&&(typeof t.pipe=="function"||typeof t.write=="function"&&typeof t.end=="function"))}}});var Dde=y((Xnr,Ade)=>{var but=require("zlib").constants||{ZLIB_VERNUM:4736};Ade.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},but))});var a6=y(go=>{"use strict";var Q8=require("assert"),sp=require("buffer").Buffer,kde=require("zlib"),_m=go.constants=Dde(),wut=k0(),Tde=sp.concat,eD=class extends Error{constructor(t){super("zlib: "+t.message);this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},Eut=Symbol("opts"),J1=Symbol("flushFlag"),Rde=Symbol("finishFlushFlag"),X8=Symbol("fullFlushFlag"),ui=Symbol("handle"),Z8=Symbol("onError"),tD=Symbol("sawError"),e6=Symbol("level"),t6=Symbol("strategy"),r6=Symbol("ended"),Znr=Symbol("_defaultFullFlush"),n6=class extends wut{constructor(t,r){if(!t||typeof t!="object")throw new TypeError("invalid options for ZlibBase constructor");super(t);this[r6]=!1,this[Eut]=t,this[J1]=t.flush,this[Rde]=t.finishFlush;try{this[ui]=new kde[r](t)}catch(n){throw new eD(n)}this[Z8]=n=>{this[tD]=!0,this.close(),this.emit("error",n)},this[ui].on("error",n=>this[Z8](new eD(n))),this.once("end",()=>this.close)}close(){this[ui]&&(this[ui].close(),this[ui]=null,this.emit("close"))}reset(){if(!this[tD])return Q8(this[ui],"zlib binding closed"),this[ui].reset()}flush(t){this.ended||(typeof t!="number"&&(t=this[X8]),this.write(Object.assign(sp.alloc(0),{[J1]:t})))}end(t,r,n){return t&&this.write(t,r),this.flush(this[Rde]),this[r6]=!0,super.end(null,null,n)}get ended(){return this[r6]}write(t,r,n){if(typeof r=="function"&&(n=r,r="utf8"),typeof t=="string"&&(t=sp.from(t,r)),this[tD])return;Q8(this[ui],"zlib binding closed");let i=this[ui]._handle,a=i.close;i.close=()=>{};let s=this[ui].close;this[ui].close=()=>{},sp.concat=c=>c;let o;try{let c=typeof t[J1]=="number"?t[J1]:this[J1];o=this[ui]._processChunk(t,c),sp.concat=Tde}catch(c){sp.concat=Tde,this[Z8](new eD(c))}finally{this[ui]&&(this[ui]._handle=i,i.close=a,this[ui].close=s,this[ui].removeAllListeners("error"))}let u;if(o)if(Array.isArray(o)&&o.length>0){u=super.write(sp.from(o[0]));for(let c=1;c<o.length;c++)u=super.write(o[c])}else u=super.write(sp.from(o));return n&&n(),u}},op=class extends n6{constructor(t,r){t=t||{},t.flush=t.flush||_m.Z_NO_FLUSH,t.finishFlush=t.finishFlush||_m.Z_FINISH,super(t,r),this[X8]=_m.Z_FULL_FLUSH,this[e6]=t.level,this[t6]=t.strategy}params(t,r){if(!this[tD]){if(!this[ui])throw new Error("cannot switch params when binding is closed");if(!this[ui].params)throw new Error("not supported in this implementation");if(this[e6]!==t||this[t6]!==r){this.flush(_m.Z_SYNC_FLUSH),Q8(this[ui],"zlib binding closed");let n=this[ui].flush;this[ui].flush=(i,a)=>{this.flush(i),a()};try{this[ui].params(t,r)}finally{this[ui].flush=n}this[ui]&&(this[e6]=t,this[t6]=r)}}}},Pde=class extends op{constructor(t){super(t,"Deflate")}},Fde=class extends op{constructor(t){super(t,"Inflate")}},Ide=class extends op{constructor(t){super(t,"Gzip")}},Ode=class extends op{constructor(t){super(t,"Gunzip")}},jde=class extends op{constructor(t){super(t,"DeflateRaw")}},qde=class extends op{constructor(t){super(t,"InflateRaw")}},Lde=class extends op{constructor(t){super(t,"Unzip")}},i6=class extends n6{constructor(t,r){t=t||{},t.flush=t.flush||_m.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||_m.BROTLI_OPERATION_FINISH,super(t,r),this[X8]=_m.BROTLI_OPERATION_FLUSH}},Nde=class extends i6{constructor(t){super(t,"BrotliCompress")}},Bde=class extends i6{constructor(t){super(t,"BrotliDecompress")}};go.Deflate=Pde;go.Inflate=Fde;go.Gzip=Ide;go.Gunzip=Ode;go.DeflateRaw=jde;go.InflateRaw=qde;go.Unzip=Lde;typeof kde.BrotliCompress=="function"?(go.BrotliCompress=Nde,go.BrotliDecompress=Bde):go.BrotliCompress=go.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var nD=y(rD=>{"use strict";rD.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);rD.code=new Map(Array.from(rD.name).map(e=>[e[1],e[0]]))});var xm=y((rir,Mde)=>{var _ut=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;Mde.exports=_ut!=="win32"?e=>e:e=>e&&e.replace(/\\/g,"/")});var W1=y((air,Ude)=>{"use strict";var nir=nD(),xut=k0(),s6=xm(),o6=Symbol("slurp");Ude.exports=class extends xut{constructor(t,r,n){super();switch(this.pause(),this.extended=r,this.globalExtended=n,this.header=t,this.startBlockSize=512*Math.ceil(t.size/512),this.blockRemain=this.startBlockSize,this.remain=t.size,this.type=t.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=s6(t.path),this.mode=t.mode,this.mode&&(this.mode=this.mode&4095),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=t.size,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=s6(t.linkpath),this.uname=t.uname,this.gname=t.gname,r&&this[o6](r),n&&this[o6](n,!0)}write(t){let r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");let n=this.remain,i=this.blockRemain;return this.remain=Math.max(0,n-r),this.blockRemain=Math.max(0,i-r),this.ignore?!0:n>=r?super.write(t):super.write(t.slice(0,n))}[o6](t,r){for(let n in t)t[n]!==null&&t[n]!==void 0&&!(r&&n==="path")&&(this[n]=n==="path"||n==="linkpath"?s6(t[n]):t[n])}}});var Gde=y(u6=>{"use strict";var sir=u6.encode=(e,t)=>{if(Number.isSafeInteger(e))e<0?Sut(e,t):Cut(e,t);else throw TypeError("cannot encode number outside of javascript safe integer range");return t},Cut=(e,t)=>{t[0]=128;for(var r=t.length;r>1;r--)t[r-1]=e&255,e=Math.floor(e/256)},Sut=(e,t)=>{t[0]=255;var r=!1;e=e*-1;for(var n=t.length;n>1;n--){var i=e&255;e=Math.floor(e/256),r?t[n-1]=zde(i):i===0?t[n-1]=0:(r=!0,t[n-1]=$de(i))}},oir=u6.parse=e=>{var t=e[e.length-1],r=e[0],n;if(r===128)n=Dut(e.slice(1,e.length));else if(r===255)n=Aut(e);else throw TypeError("invalid base256 encoding");if(!Number.isSafeInteger(n))throw TypeError("parsed number outside of javascript safe integer range");return n},Aut=e=>{for(var t=e.length,r=0,n=!1,i=t-1;i>-1;i--){var a=e[i],s;n?s=zde(a):a===0?s=a:(n=!0,s=$de(a)),s!==0&&(r-=s*Math.pow(256,t-i-1))}return r},Dut=e=>{for(var t=e.length,r=0,n=t-1;n>-1;n--){var i=e[n];i!==0&&(r+=i*Math.pow(256,t-n-1))}return r},zde=e=>(255^e)&255,$de=e=>(255^e)+1&255});var R0=y((cir,Hde)=>{"use strict";var up=np(),c6=nD(),T0=require("path").posix,Vde=Gde(),l6=Symbol("slurp"),vo=Symbol("type"),Kde=class{constructor(t,r,n,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[vo]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,up.isBuffer(t)?this.decode(t,r||0,n,i):t&&this.set(t)}decode(t,r,n,i){if(r||(r=0),!t||!(t.length>=r+512))throw new Error("need 512 bytes for header");if(this.path=Cm(t,r,100),this.mode=cp(t,r+100,8),this.uid=cp(t,r+108,8),this.gid=cp(t,r+116,8),this.size=cp(t,r+124,12),this.mtime=f6(t,r+136,12),this.cksum=cp(t,r+148,12),this[l6](n),this[l6](i,!0),this[vo]=Cm(t,r+156,1),this[vo]===""&&(this[vo]="0"),this[vo]==="0"&&this.path.substr(-1)==="/"&&(this[vo]="5"),this[vo]==="5"&&(this.size=0),this.linkpath=Cm(t,r+157,100),t.slice(r+257,r+265).toString()==="ustar\x0000")if(this.uname=Cm(t,r+265,32),this.gname=Cm(t,r+297,32),this.devmaj=cp(t,r+329,8),this.devmin=cp(t,r+337,8),t[r+475]!==0){let s=Cm(t,r+345,155);this.path=s+"/"+this.path}else{let s=Cm(t,r+345,130);s&&(this.path=s+"/"+this.path),this.atime=f6(t,r+476,12),this.ctime=f6(t,r+488,12)}let a=8*32;for(let s=r;s<r+148;s++)a+=t[s];for(let s=r+156;s<r+512;s++)a+=t[s];this.cksumValid=a===this.cksum,this.cksum===null&&a===8*32&&(this.nullBlock=!0)}[l6](t,r){for(let n in t)t[n]!==null&&t[n]!==void 0&&!(r&&n==="path")&&(this[n]=t[n])}encode(t,r){if(t||(t=this.block=up.alloc(512),r=0),r||(r=0),!(t.length>=r+512))throw new Error("need 512 bytes for header");let n=this.ctime||this.atime?130:155,i=kut(this.path||"",n),a=i[0],s=i[1];this.needPax=i[2],this.needPax=Sm(t,r,100,a)||this.needPax,this.needPax=lp(t,r+100,8,this.mode)||this.needPax,this.needPax=lp(t,r+108,8,this.uid)||this.needPax,this.needPax=lp(t,r+116,8,this.gid)||this.needPax,this.needPax=lp(t,r+124,12,this.size)||this.needPax,this.needPax=d6(t,r+136,12,this.mtime)||this.needPax,t[r+156]=this[vo].charCodeAt(0),this.needPax=Sm(t,r+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",r+257,8),this.needPax=Sm(t,r+265,32,this.uname)||this.needPax,this.needPax=Sm(t,r+297,32,this.gname)||this.needPax,this.needPax=lp(t,r+329,8,this.devmaj)||this.needPax,this.needPax=lp(t,r+337,8,this.devmin)||this.needPax,this.needPax=Sm(t,r+345,n,s)||this.needPax,t[r+475]!==0?this.needPax=Sm(t,r+345,155,s)||this.needPax:(this.needPax=Sm(t,r+345,130,s)||this.needPax,this.needPax=d6(t,r+476,12,this.atime)||this.needPax,this.needPax=d6(t,r+488,12,this.ctime)||this.needPax);let o=8*32;for(let u=r;u<r+148;u++)o+=t[u];for(let u=r+156;u<r+512;u++)o+=t[u];return this.cksum=o,lp(t,r+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(t){for(let r in t)t[r]!==null&&t[r]!==void 0&&(this[r]=t[r])}get type(){return c6.name.get(this[vo])||this[vo]}get typeKey(){return this[vo]}set type(t){c6.code.has(t)?this[vo]=c6.code.get(t):this[vo]=t}},kut=(e,t)=>{let r=100,n=e,i="",a,s=T0.parse(e).root||".";if(up.byteLength(n)<r)a=[n,i,!1];else{i=T0.dirname(n),n=T0.basename(n);do up.byteLength(n)<=r&&up.byteLength(i)<=t?a=[n,i,!1]:up.byteLength(n)>r&&up.byteLength(i)<=t?a=[n.substr(0,r-1),i,!0]:(n=T0.join(T0.basename(i),n),i=T0.dirname(i));while(i!==s&&!a);a||(a=[e.substr(0,r-1),"",!0])}return a},Cm=(e,t,r)=>e.slice(t,t+r).toString("utf8").replace(/\0.*/,""),f6=(e,t,r)=>Tut(cp(e,t,r)),Tut=e=>e===null?null:new Date(e*1e3),cp=(e,t,r)=>e[t]&128?Vde.parse(e.slice(t,t+r)):Rut(e,t,r),Put=e=>isNaN(e)?null:e,Rut=(e,t,r)=>Put(parseInt(e.slice(t,t+r).toString("utf8").replace(/\0.*$/,"").trim(),8)),Fut={12:8589934591,8:2097151},lp=(e,t,r,n)=>n===null?!1:n>Fut[r]||n<0?(Vde.encode(n,e.slice(t,t+r)),!0):(Iut(e,t,r,n),!1),Iut=(e,t,r,n)=>e.write(Out(n,r),t,r,"ascii"),Out=(e,t)=>jut(Math.floor(e).toString(8),t),jut=(e,t)=>(e.length===t-1?e:new Array(t-e.length-1).join("0")+e+" ")+"\0",d6=(e,t,r,n)=>n===null?!1:lp(e,t,r,n.getTime()/1e3),qut=new Array(156).join("\0"),Sm=(e,t,r,n)=>n===null?!1:(e.write(n+qut,t,r,"utf8"),n.length!==up.byteLength(n)||n.length>r);Hde.exports=Kde});var sD=y((lir,Jde)=>{"use strict";var iD=np(),Lut=R0(),Nut=require("path"),aD=class{constructor(t,r){this.atime=t.atime||null,this.charset=t.charset||null,this.comment=t.comment||null,this.ctime=t.ctime||null,this.gid=t.gid||null,this.gname=t.gname||null,this.linkpath=t.linkpath||null,this.mtime=t.mtime||null,this.path=t.path||null,this.size=t.size||null,this.uid=t.uid||null,this.uname=t.uname||null,this.dev=t.dev||null,this.ino=t.ino||null,this.nlink=t.nlink||null,this.global=r||!1}encode(){let t=this.encodeBody();if(t==="")return null;let r=iD.byteLength(t),n=512*Math.ceil(1+r/512),i=iD.allocUnsafe(n);for(let a=0;a<512;a++)i[a]=0;new Lut({path:("PaxHeader/"+Nut.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(t,512,r,"utf8");for(let a=r+512;a<i.length;a++)i[a]=0;return i}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===null||this[t]===void 0)return"";let r=this[t]instanceof Date?this[t].getTime()/1e3:this[t],n=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+r+`
|
|
254
|
+
`),this.close()}_(t,r){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Sfe.hide):this.out.write(Lot(this.outputText,this.out.columns)),super.render(),this.outputText=[Cfe.symbol(this.done,this.aborted),xfe.bold(this.msg),Cfe.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:xfe.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Not.line+Sfe.to(0)+this.outputText))}};_fe.exports=Afe});var Tfe=y((Inr,kfe)=>{"use strict";kfe.exports={TextPrompt:lle(),SelectPrompt:mle(),TogglePrompt:wle(),DatePrompt:tfe(),NumberPrompt:sfe(),MultiselectPrompt:P8(),AutocompletePrompt:gfe(),AutocompleteMultiselectPrompt:Efe(),ConfirmPrompt:Dfe()}});var Pfe=y(Rfe=>{"use strict";var Gs=Rfe,Bot=Tfe(),$A=e=>e;function Uc(e,t,r={}){return new Promise((n,i)=>{let a=new Bot[e](t),s=r.onAbort||$A,o=r.onSubmit||$A,u=r.onExit||$A;a.on("state",t.onState||$A),a.on("submit",c=>n(o(c))),a.on("exit",c=>n(u(c))),a.on("abort",c=>i(s(c)))})}Gs.text=e=>Uc("TextPrompt",e);Gs.password=e=>(e.style="password",Gs.text(e));Gs.invisible=e=>(e.style="invisible",Gs.text(e));Gs.number=e=>Uc("NumberPrompt",e);Gs.date=e=>Uc("DatePrompt",e);Gs.confirm=e=>Uc("ConfirmPrompt",e);Gs.list=e=>{let t=e.separator||",";return Uc("TextPrompt",e,{onSubmit:r=>r.split(t).map(n=>n.trim())})};Gs.toggle=e=>Uc("TogglePrompt",e);Gs.select=e=>Uc("SelectPrompt",e);Gs.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(n=>n.selected).map(n=>n.value);return Uc("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};Gs.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(n=>n.selected).map(n=>n.value);return Uc("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var Mot=(e,t)=>Promise.resolve(t.filter(r=>r.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Gs.autocomplete=e=>(e.suggest=e.suggest||Mot,e.choices=[].concat(e.choices||[]),Uc("AutocompletePrompt",e))});var Ofe=y((jnr,Ffe)=>{"use strict";var O8=Pfe(),Uot=["suggest","format","onState","validate","onRender","type"],Ife=()=>{};async function Qd(e=[],{onSubmit:t=Ife,onCancel:r=Ife}={}){let n={},i=Qd._override||{};e=[].concat(e);let a,s,o,u,c,l,f=async(d,p,h=!1)=>{if(!(!h&&d.validate&&d.validate(p)!==!0))return d.format?await d.format(p,n):p};for(s of e)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(a,m({},n),s),s.type=c),!!c){for(let d in s){if(Uot.includes(d))continue;let p=s[d];s[d]=typeof p=="function"?await p(a,m({},n),l):p}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,O8[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(a=await f(s,i[s.name]),a!==void 0)){n[u]=a;continue}try{a=Qd._injected?zot(Qd._injected,s.initial):await O8[c](s),n[u]=a=await f(s,a,!0),o=await t(s,a,n)}catch(d){o=!await r(s,n)}if(o)return n}return n}function zot(e,t){let r=e.shift();if(r instanceof Error)throw r;return r===void 0?t:r}function $ot(e){Qd._injected=(Qd._injected||[]).concat(e)}function Got(e){Qd._override=Object.assign({},e)}Ffe.exports=Object.assign(Qd,{prompt:Qd,prompts:O8,inject:$ot,override:Got})});var j8=y((qnr,jfe)=>{function Hot(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,r=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(r[t]>e[t])return!1;if(e[t]>r[t])return!0}return!1}jfe.exports=Hot("8.6.0")?zce():Ofe()});var Mfe=y((znr,Bfe)=>{Bfe.exports={name:"@sentry/craft",version:"0.25.2",description:"The universal sentry workflow CLI",main:"dist/craft",repository:"https://github.com/getsentry/craft",author:"Sentry",license:"MIT",bin:{craft:"dist/craft","sentry-craft":"dist/craft"},resolutions:{"**/set-value":">=2.0.1","**/https-proxy-agent":">=2.2.3","**/node-forge":">=0.10.0","**/dot-prop":">=4.2.1","**/kind-of":">=6.0.3","**/node-fetch":">=2.6.1","**/yargs-parser":">=18.1.2","**/parse-url":">=5.0.3","**/ansi-regex":">=5.0.1 < 6.0.0"},devDependencies:{"@aws-sdk/client-lambda":"^3.2.0","@google-cloud/storage":"^5.7.0","@octokit/plugin-retry":"^3.0.9","@octokit/rest":"^18.10.0","@sentry/node":"4.6.3","@sentry/typescript":"^5.17.0","@types/async":"^3.0.1","@types/aws4":"^1.5.1","@types/cli-table":"^0.3.0","@types/git-url-parse":"^9.0.0","@types/is-ci":"^2.0.0","@types/jest":"^26.0.14","@types/js-yaml":"^3.11.1","@types/mkdirp":"^1.0.0","@types/node":"^12.11.1","@types/node-fetch":"^2.5.10","@types/ora":"^1.3.4","@types/prompts":"^2.0.11","@types/rimraf":"^2.0.2","@types/shell-quote":"^1.6.0","@types/tar":"^4.0.0","@types/tmp":"^0.0.33","@types/unzipper":"^0.10.3","@types/yargs":"^15.0.3","@typescript-eslint/eslint-plugin":"^3.3.0","@typescript-eslint/parser":"^3.3.0",ajv:"6.6.2",async:"3.1.0",aws4:"^1.11.0",chalk:"4.1.1","cli-table":"0.3.1",consola:"2.15.3",esbuild:"^0.11.6",eslint:"^7.2.0","eslint-config-prettier":"^6.11.0","fast-xml-parser":"^3.19.0","git-url-parse":"^11.4.4","is-ci":"^2.0.0",jest:"^26.5.3","js-yaml":"3.13.1","json-schema-to-typescript":"5.7.0",mkdirp:"0.5.1",mustache:"3.0.1","node-fetch":"^2.6.1",nvar:"1.3.1",ora:"5.4.0",prettier:"^2.2.1",prompts:"2.4.1",rimraf:"2.7.1","shell-quote":"1.6.1","simple-git":"2.38.0",split:"1.0.1","string-length":"3.1.0",tar:"4.4.18",tmp:"0.1.0","ts-jest":"^26.5.5",typescript:"^4.1.3",unzipper:"0.10.11",yargs:"15.4.1"},scripts:{"build:fat":"yarn run compile-config-schema && tsc -p tsconfig.build.json","build:watch":"yarn run compile-config-schema && tsc -p tsconfig.build.json --watch",build:"yarn compile-config-schema && esbuild src/index.ts --bundle --platform=node --target=node14.17 --outfile=dist/craft --minify",precli:"yarn build",cli:"node dist/craft",clean:"rimraf dist coverage",fix:"prettier --write .",test:"jest","test:watch":"jest --watch --notify","compile-config-schema":"node ./scripts/config-json-schema-to-ts.js"},volta:{node:"14.17.6",yarn:"1.22.10"}}});var S0=y((zc,Gfe)=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});function M1(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Nu=M1(require("stream")),Hfe=M1(require("http")),L8=M1(require("url")),Yot=M1(require("https")),ym=M1(require("zlib")),Qot=Nu.Readable,bf=Symbol("buffer"),N8=Symbol("type"),bm=class{constructor(){this[N8]="";let t=arguments[0],r=arguments[1],n=[],i=0;if(t){let s=t,o=Number(s.length);for(let u=0;u<o;u++){let c=s[u],l;c instanceof Buffer?l=c:ArrayBuffer.isView(c)?l=Buffer.from(c.buffer,c.byteOffset,c.byteLength):c instanceof ArrayBuffer?l=Buffer.from(c):c instanceof bm?l=c[bf]:l=Buffer.from(typeof c=="string"?c:String(c)),i+=l.length,n.push(l)}}this[bf]=Buffer.concat(n);let a=r&&r.type!==void 0&&String(r.type).toLowerCase();a&&!/[^\u0020-\u007E]/.test(a)&&(this[N8]=a)}get size(){return this[bf].length}get type(){return this[N8]}text(){return Promise.resolve(this[bf].toString())}arrayBuffer(){let t=this[bf],r=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return Promise.resolve(r)}stream(){let t=new Qot;return t._read=function(){},t.push(this[bf]),t.push(null),t}toString(){return"[object Blob]"}slice(){let t=this.size,r=arguments[0],n=arguments[1],i,a;r===void 0?i=0:r<0?i=Math.max(t+r,0):i=Math.min(r,t),n===void 0?a=t:n<0?a=Math.max(t+n,0):a=Math.min(n,t);let s=Math.max(a-i,0),u=this[bf].slice(i,i+s),c=new bm([],{type:arguments[2]});return c[bf]=u,c}};Object.defineProperties(bm.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Object.defineProperty(bm.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0});function ss(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}ss.prototype=Object.create(Error.prototype);ss.prototype.constructor=ss;ss.prototype.name="FetchError";var B8;try{B8=require("encoding").convert}catch(e){}var wf=Symbol("Body internals"),Vfe=Nu.PassThrough;function wa(e){var t=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.size;let i=n===void 0?0:n;var a=r.timeout;let s=a===void 0?0:a;e==null?e=null:Kfe(e)?e=Buffer.from(e.toString()):U1(e)||Buffer.isBuffer(e)||(Object.prototype.toString.call(e)==="[object ArrayBuffer]"?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof Nu||(e=Buffer.from(String(e)))),this[wf]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof Nu&&e.on("error",function(o){let u=o.name==="AbortError"?o:new ss(`Invalid response body while trying to fetch ${t.url}: ${o.message}`,"system",o);t[wf].error=u})}wa.prototype={get body(){return this[wf].body},get bodyUsed(){return this[wf].disturbed},arrayBuffer(){return x0.call(this).then(function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)})},blob(){let e=this.headers&&this.headers.get("content-type")||"";return x0.call(this).then(function(t){return Object.assign(new bm([],{type:e.toLowerCase()}),{[bf]:t})})},json(){var e=this;return x0.call(this).then(function(t){try{return JSON.parse(t.toString())}catch(r){return wa.Promise.reject(new ss(`invalid json response body at ${e.url} reason: ${r.message}`,"invalid-json"))}})},text(){return x0.call(this).then(function(e){return e.toString()})},buffer(){return x0.call(this)},textConverted(){var e=this;return x0.call(this).then(function(t){return Xot(t,e.headers)})}};Object.defineProperties(wa.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});wa.mixIn=function(e){for(let t of Object.getOwnPropertyNames(wa.prototype))if(!(t in e)){let r=Object.getOwnPropertyDescriptor(wa.prototype,t);Object.defineProperty(e,t,r)}};function x0(){var e=this;if(this[wf].disturbed)return wa.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[wf].disturbed=!0,this[wf].error)return wa.Promise.reject(this[wf].error);let t=this.body;if(t===null)return wa.Promise.resolve(Buffer.alloc(0));if(U1(t)&&(t=t.stream()),Buffer.isBuffer(t))return wa.Promise.resolve(t);if(!(t instanceof Nu))return wa.Promise.resolve(Buffer.alloc(0));let r=[],n=0,i=!1;return new wa.Promise(function(a,s){let o;e.timeout&&(o=setTimeout(function(){i=!0,s(new ss(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))},e.timeout)),t.on("error",function(u){u.name==="AbortError"?(i=!0,s(u)):s(new ss(`Invalid response body while trying to fetch ${e.url}: ${u.message}`,"system",u))}),t.on("data",function(u){if(!(i||u===null)){if(e.size&&n+u.length>e.size){i=!0,s(new ss(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return}n+=u.length,r.push(u)}}),t.on("end",function(){if(!i){clearTimeout(o);try{a(Buffer.concat(r,n))}catch(u){s(new ss(`Could not create Buffer from response body for ${e.url}: ${u.message}`,"system",u))}}})})}function Xot(e,t){if(typeof B8!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let r=t.get("content-type"),n="utf-8",i,a;return r&&(i=/charset=([^;]*)/i.exec(r)),a=e.slice(0,1024).toString(),!i&&a&&(i=/<meta.+?charset=(['"])(.+?)\1/i.exec(a)),!i&&a&&(i=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(a),i||(i=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(a),i&&i.pop()),i&&(i=/charset=(.*)/i.exec(i.pop()))),!i&&a&&(i=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(a)),i&&(n=i.pop(),(n==="gb2312"||n==="gbk")&&(n="gb18030")),B8(e,"UTF-8",n).toString()}function Kfe(e){return typeof e!="object"||typeof e.append!="function"||typeof e.delete!="function"||typeof e.get!="function"||typeof e.getAll!="function"||typeof e.has!="function"||typeof e.set!="function"?!1:e.constructor.name==="URLSearchParams"||Object.prototype.toString.call(e)==="[object URLSearchParams]"||typeof e.sort=="function"}function U1(e){return typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.constructor=="function"&&typeof e.constructor.name=="string"&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function Jfe(e){let t,r,n=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof Nu&&typeof n.getBoundary!="function"&&(t=new Vfe,r=new Vfe,n.pipe(t),n.pipe(r),e[wf].body=t,n=r),n}function Wfe(e){return e===null?null:typeof e=="string"?"text/plain;charset=UTF-8":Kfe(e)?"application/x-www-form-urlencoded;charset=UTF-8":U1(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof Nu?null:"text/plain;charset=UTF-8"}function Yfe(e){let t=e.body;return t===null?0:U1(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length==0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}function Zot(e,t){let r=t.body;r===null?e.end():U1(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}wa.Promise=global.Promise;var Qfe=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,M8=/[^\t\x20-\x7e\x80-\xff]/;function z1(e){if(e=`${e}`,Qfe.test(e)||e==="")throw new TypeError(`${e} is not a legal HTTP header name`)}function Xfe(e){if(e=`${e}`,M8.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function C0(e,t){t=t.toLowerCase();for(let r in e)if(r.toLowerCase()===t)return r}var Li=Symbol("map"),mo=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;if(this[Li]=Object.create(null),t instanceof mo){let r=t.raw(),n=Object.keys(r);for(let i of n)for(let a of r[i])this.append(i,a);return}if(t!=null)if(typeof t=="object"){let r=t[Symbol.iterator];if(r!=null){if(typeof r!="function")throw new TypeError("Header pairs must be iterable");let n=[];for(let i of t){if(typeof i!="object"||typeof i[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");n.push(Array.from(i))}for(let i of n){if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");this.append(i[0],i[1])}}else for(let n of Object.keys(t)){let i=t[n];this.append(n,i)}}else throw new TypeError("Provided initializer must be an object")}get(t){t=`${t}`,z1(t);let r=C0(this[Li],t);return r===void 0?null:this[Li][r].join(", ")}forEach(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=U8(this),i=0;for(;i<n.length;){var a=n[i];let s=a[0],o=a[1];t.call(r,o,s,this),n=U8(this),i++}}set(t,r){t=`${t}`,r=`${r}`,z1(t),Xfe(r);let n=C0(this[Li],t);this[Li][n!==void 0?n:t]=[r]}append(t,r){t=`${t}`,r=`${r}`,z1(t),Xfe(r);let n=C0(this[Li],t);n!==void 0?this[Li][n].push(r):this[Li][t]=[r]}has(t){return t=`${t}`,z1(t),C0(this[Li],t)!==void 0}delete(t){t=`${t}`,z1(t);let r=C0(this[Li],t);r!==void 0&&delete this[Li][r]}raw(){return this[Li]}keys(){return z8(this,"key")}values(){return z8(this,"value")}[Symbol.iterator](){return z8(this,"key+value")}};mo.prototype.entries=mo.prototype[Symbol.iterator];Object.defineProperty(mo.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(mo.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});function U8(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key+value";return Object.keys(e[Li]).sort().map(t==="key"?function(n){return n.toLowerCase()}:t==="value"?function(n){return e[Li][n].join(", ")}:function(n){return[n.toLowerCase(),e[Li][n].join(", ")]})}var $8=Symbol("internal");function z8(e,t){let r=Object.create(G8);return r[$8]={target:e,kind:t,index:0},r}var G8=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==G8)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[$8];let t=e.target,r=e.kind,n=e.index,i=U8(t,r),a=i.length;return n>=a?{value:void 0,done:!0}:(this[$8].index=n+1,{value:i[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(G8,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});function eut(e){let t=Object.assign({__proto__:null},e[Li]),r=C0(e[Li],"Host");return r!==void 0&&(t[r]=t[r][0]),t}function tut(e){let t=new mo;for(let r of Object.keys(e))if(!Qfe.test(r))if(Array.isArray(e[r]))for(let n of e[r])M8.test(n)||(t[Li][r]===void 0?t[Li][r]=[n]:t[Li][r].push(n));else M8.test(e[r])||(t[Li][r]=[e[r]]);return t}var tp=Symbol("Response internals"),rut=Hfe.STATUS_CODES,Ko=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wa.call(this,t,r);let n=r.status||200,i=new mo(r.headers);if(t!=null&&!i.has("Content-Type")){let a=Wfe(t);a&&i.append("Content-Type",a)}this[tp]={url:r.url,status:n,statusText:r.statusText||rut[n],headers:i,counter:r.counter}}get url(){return this[tp].url||""}get status(){return this[tp].status}get ok(){return this[tp].status>=200&&this[tp].status<300}get redirected(){return this[tp].counter>0}get statusText(){return this[tp].statusText}get headers(){return this[tp].headers}clone(){return new Ko(Jfe(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}};wa.mixIn(Ko.prototype);Object.defineProperties(Ko.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Object.defineProperty(Ko.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});var Ef=Symbol("Request internals"),H8=L8.parse,nut=L8.format,iut="destroy"in Nu.Readable.prototype;function KA(e){return typeof e=="object"&&typeof e[Ef]=="object"}function aut(e){let t=e&&typeof e=="object"&&Object.getPrototypeOf(e);return!!(t&&t.constructor.name==="AbortSignal")}var _f=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;KA(t)?n=H8(t.url):(t&&t.href?n=H8(t.href):n=H8(`${t}`),t={});let i=r.method||t.method||"GET";if(i=i.toUpperCase(),(r.body!=null||KA(t)&&t.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let a=r.body!=null?r.body:KA(t)&&t.body!==null?Jfe(t):null;wa.call(this,a,{timeout:r.timeout||t.timeout||0,size:r.size||t.size||0});let s=new mo(r.headers||t.headers||{});if(a!=null&&!s.has("Content-Type")){let u=Wfe(a);u&&s.append("Content-Type",u)}let o=KA(t)?t.signal:null;if("signal"in r&&(o=r.signal),o!=null&&!aut(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[Ef]={method:i,redirect:r.redirect||t.redirect||"follow",headers:s,parsedURL:n,signal:o},this.follow=r.follow!==void 0?r.follow:t.follow!==void 0?t.follow:20,this.compress=r.compress!==void 0?r.compress:t.compress!==void 0?t.compress:!0,this.counter=r.counter||t.counter||0,this.agent=r.agent||t.agent}get method(){return this[Ef].method}get url(){return nut(this[Ef].parsedURL)}get headers(){return this[Ef].headers}get redirect(){return this[Ef].redirect}get signal(){return this[Ef].signal}clone(){return new _f(this)}};wa.mixIn(_f.prototype);Object.defineProperty(_f.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(_f.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});function sut(e){let t=e[Ef].parsedURL,r=new mo(e[Ef].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof Nu.Readable&&!iut)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(e.body==null&&/^(POST|PUT)$/i.test(e.method)&&(n="0"),e.body!=null){let a=Yfe(e);typeof a=="number"&&(n=String(a))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=e.agent;return typeof i=="function"&&(i=i(t)),!r.has("Connection")&&!i&&r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:eut(r),agent:i})}function $1(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}$1.prototype=Object.create(Error.prototype);$1.prototype.constructor=$1;$1.prototype.name="AbortError";var Zfe=Nu.PassThrough,out=L8.resolve;function rp(e,t){if(!rp.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return wa.Promise=rp.Promise,new rp.Promise(function(r,n){let i=new _f(e,t),a=sut(i),s=(a.protocol==="https:"?Yot:Hfe).request,o=i.signal,u=null,c=function(){let g=new $1("The user aborted a request.");n(g),i.body&&i.body instanceof Nu.Readable&&i.body.destroy(g),!(!u||!u.body)&&u.body.emit("error",g)};if(o&&o.aborted){c();return}let l=function(){c(),p()},f=s(a),d;o&&o.addEventListener("abort",l);function p(){f.abort(),o&&o.removeEventListener("abort",l),clearTimeout(d)}i.timeout&&f.once("socket",function(h){d=setTimeout(function(){n(new ss(`network timeout at: ${i.url}`,"request-timeout")),p()},i.timeout)}),f.on("error",function(h){n(new ss(`request to ${i.url} failed, reason: ${h.message}`,"system",h)),p()}),f.on("response",function(h){clearTimeout(d);let g=tut(h.headers);if(rp.isRedirect(h.statusCode)){let S=g.get("Location"),F=S===null?null:out(i.url,S);switch(i.redirect){case"error":n(new ss(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),p();return;case"manual":if(F!==null)try{g.set("Location",F)}catch(K){n(K)}break;case"follow":if(F===null)break;if(i.counter>=i.follow){n(new ss(`maximum redirect reached at: ${i.url}`,"max-redirect")),p();return}let P={headers:new mo(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout,size:i.size};if(h.statusCode!==303&&i.body&&Yfe(i)===null){n(new ss("Cannot follow redirect with body being a readable stream","unsupported-redirect")),p();return}(h.statusCode===303||(h.statusCode===301||h.statusCode===302)&&i.method==="POST")&&(P.method="GET",P.body=void 0,P.headers.delete("content-length")),r(rp(new _f(F,P))),p();return}}h.once("end",function(){o&&o.removeEventListener("abort",l)});let v=h.pipe(new Zfe),b={url:i.url,status:h.statusCode,statusText:h.statusMessage,headers:g,size:i.size,timeout:i.timeout,counter:i.counter},E=g.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||E===null||h.statusCode===204||h.statusCode===304){u=new Ko(v,b),r(u);return}let _={flush:ym.Z_SYNC_FLUSH,finishFlush:ym.Z_SYNC_FLUSH};if(E=="gzip"||E=="x-gzip"){v=v.pipe(ym.createGunzip(_)),u=new Ko(v,b),r(u);return}if(E=="deflate"||E=="x-deflate"){h.pipe(new Zfe).once("data",function(F){(F[0]&15)==8?v=v.pipe(ym.createInflate()):v=v.pipe(ym.createInflateRaw()),u=new Ko(v,b),r(u)});return}if(E=="br"&&typeof ym.createBrotliDecompress=="function"){v=v.pipe(ym.createBrotliDecompress()),u=new Ko(v,b),r(u);return}u=new Ko(v,b),r(u)}),Zot(f,i)})}rp.isRedirect=function(e){return e===301||e===302||e===303||e===307||e===308};rp.Promise=global.Promise;Gfe.exports=zc=rp;Object.defineProperty(zc,"__esModule",{value:!0});zc.default=zc;zc.Headers=mo;zc.Request=_f;zc.Response=Ko;zc.FetchError=ss});var rde=y((ede,tde)=>{var uut=require("stream");ede=tde.exports=V8;V8.through=V8;function V8(e,t,r){e=e||function(l){this.queue(l)},t=t||function(){this.queue(null)};var n=!1,i=!1,a=[],s=!1,o=new uut;o.readable=o.writable=!0,o.paused=!1,o.autoDestroy=!(r&&r.autoDestroy===!1),o.write=function(l){return e.call(this,l),!o.paused};function u(){for(;a.length&&!o.paused;){var l=a.shift();if(l===null)return o.emit("end");o.emit("data",l)}}o.queue=o.push=function(l){return s||(l===null&&(s=!0),a.push(l),u()),o},o.on("end",function(){o.readable=!1,!o.writable&&o.autoDestroy&&process.nextTick(function(){o.destroy()})});function c(){o.writable=!1,t.call(o),!o.readable&&o.autoDestroy&&o.destroy()}return o.end=function(l){if(!n)return n=!0,arguments.length&&o.write(l),c(),o},o.destroy=function(){if(!i)return i=!0,n=!0,a.length=0,o.writable=o.readable=!1,o.emit("close"),o},o.pause=function(){if(!o.paused)return o.paused=!0,o},o.resume=function(){return o.paused&&(o.paused=!1,o.emit("resume")),u(),o.paused||o.emit("drain"),o},o}});var ide=y((Hnr,nde)=>{var cut=rde(),lut=require("string_decoder").StringDecoder;nde.exports=fut;function fut(e,t,r){var n=new lut,i="",a=r&&r.maxLength,s=!(r&&r.trailing===!1);typeof e=="function"&&(t=e,e=null),e||(e=/\r?\n/);function o(c,l){if(t){try{l=t(l)}catch(f){return c.emit("error",f)}typeof l!="undefined"&&c.queue(l)}else c.queue(l)}function u(c,l){var f=((i??"")+l).split(e);if(i=f.pop(),a&&i.length>a)return c.emit("error",new Error("maximum buffer reached"));for(var d=0;d<f.length;d++){var p=f[d];o(c,p)}}return cut(function(c){u(this,n.write(c))},function(){n.end&&u(this,n.end()),s&&i!=null&&o(this,i),this.queue(null)})}});var A0=y((Knr,ade)=>{"use strict";var sde=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]),Vnr=ade.exports=e=>e?Object.keys(e).map(t=>[sde.has(t)?sde.get(t):t,e[t]]).reduce((t,r)=>(t[r[0]]=r[1],t),Object.create(null)):{}});var cde=y((K8,ode)=>{var JA=require("buffer"),$c=JA.Buffer;function ude(e,t){for(var r in e)t[r]=e[r]}$c.from&&$c.alloc&&$c.allocUnsafe&&$c.allocUnsafeSlow?ode.exports=JA:(ude(JA,K8),K8.Buffer=wm);function wm(e,t,r){return $c(e,t,r)}wm.prototype=Object.create($c.prototype);ude($c,wm);wm.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return $c(e,t,r)};wm.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=$c(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};wm.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $c(e)};wm.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return JA.SlowBuffer(e)}});var np=y((Jnr,lde)=>{"use strict";var J8=Buffer;J8.alloc||(J8=cde().Buffer);lde.exports=J8});var dde=y((Wnr,fde)=>{"use strict";fde.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var WA=y((Ynr,pde)=>{"use strict";pde.exports=bn;bn.Node=Em;bn.create=bn;function bn(e){var t=this;if(t instanceof bn||(t=new bn),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}bn.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};bn.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};bn.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};bn.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)dut(this,arguments[e]);return this.length};bn.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)put(this,arguments[e]);return this.length};bn.prototype.pop=function(){if(!!this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};bn.prototype.shift=function(){if(!!this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};bn.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};bn.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};bn.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};bn.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};bn.prototype.map=function(e,t){t=t||this;for(var r=new bn,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};bn.prototype.mapReverse=function(e,t){t=t||this;for(var r=new bn,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};bn.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};bn.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};bn.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};bn.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};bn.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new bn;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};bn.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new bn;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};bn.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,n=this.head;n!==null&&r<e;r++)n=n.next;for(var i=[],r=0;n&&r<t;r++)i.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var r=2;r<arguments.length;r++)n=hut(this,n,arguments[r]);return i};bn.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function hut(e,t,r){var n=t===e.head?new Em(r,null,t,e):new Em(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function dut(e,t){e.tail=new Em(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function put(e,t){e.head=new Em(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Em(e,t,r,n){if(!(this instanceof Em))return new Em(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{dde()(bn)}catch(e){}});var As=y((W8,hde)=>{var YA=require("buffer"),xf=YA.Buffer;function mde(e,t){for(var r in e)t[r]=e[r]}xf.from&&xf.alloc&&xf.allocUnsafe&&xf.allocUnsafeSlow?hde.exports=YA:(mde(YA,W8),W8.Buffer=D0);function D0(e,t,r){return xf(e,t,r)}mde(xf,D0);D0.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return xf(e,t,r)};D0.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=xf(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};D0.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return xf(e)};D0.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return YA.SlowBuffer(e)}});var k0=y((Qnr,gde)=>{"use strict";var vde=require("events"),G1=WA(),yde=require("string_decoder").StringDecoder,Cf=Symbol("EOF"),H1=Symbol("maybeEmitEnd"),ip=Symbol("emittedEnd"),QA=Symbol("emittingEnd"),XA=Symbol("closed"),bde=Symbol("read"),wde=Symbol("flush"),Ede=Symbol("flushChunk"),Hs=Symbol("encoding"),Sf=Symbol("decoder"),ZA=Symbol("flowing"),V1=Symbol("paused"),K1=Symbol("resume"),Vs=Symbol("bufferLength"),_de=Symbol("bufferPush"),Y8=Symbol("bufferShift"),Ks=Symbol("objectMode"),os=Symbol("destroyed"),xde=global._MP_NO_ITERATOR_SYMBOLS_!=="1",mut=xde&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),gut=xde&&Symbol.iterator||Symbol("iterator not implemented"),ap=Buffer.alloc?Buffer:As().Buffer,Cde=e=>e==="end"||e==="finish"||e==="prefinish",vut=e=>e instanceof ArrayBuffer||typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,yut=e=>!ap.isBuffer(e)&&ArrayBuffer.isView(e);gde.exports=class Sde extends vde{constructor(t){super();this[ZA]=!1,this[V1]=!1,this.pipes=new G1,this.buffer=new G1,this[Ks]=t&&t.objectMode||!1,this[Ks]?this[Hs]=null:this[Hs]=t&&t.encoding||null,this[Hs]==="buffer"&&(this[Hs]=null),this[Sf]=this[Hs]?new yde(this[Hs]):null,this[Cf]=!1,this[ip]=!1,this[QA]=!1,this[XA]=!1,this.writable=!0,this.readable=!0,this[Vs]=0,this[os]=!1}get bufferLength(){return this[Vs]}get encoding(){return this[Hs]}set encoding(t){if(this[Ks])throw new Error("cannot set encoding in objectMode");if(this[Hs]&&t!==this[Hs]&&(this[Sf]&&this[Sf].lastNeed||this[Vs]))throw new Error("cannot change encoding");this[Hs]!==t&&(this[Sf]=t?new yde(t):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[Sf].write(r)))),this[Hs]=t}setEncoding(t){this.encoding=t}get objectMode(){return this[Ks]}set objectMode(t){this[Ks]=this[Ks]||!!t}write(t,r,n){if(this[Cf])throw new Error("write after end");if(this[os])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8"),!this[Ks]&&!ap.isBuffer(t)&&(yut(t)?t=ap.from(t.buffer,t.byteOffset,t.byteLength):vut(t)?t=ap.from(t):typeof t!="string"&&(this.objectMode=!0)),!this.objectMode&&!t.length){let i=this.flowing;return this[Vs]!==0&&this.emit("readable"),n&&n(),i}typeof t=="string"&&!this[Ks]&&!(r===this[Hs]&&!this[Sf].lastNeed)&&(t=ap.from(t,r)),ap.isBuffer(t)&&this[Hs]&&(t=this[Sf].write(t));try{return this.flowing?(this.emit("data",t),this.flowing):(this[_de](t),!1)}finally{this[Vs]!==0&&this.emit("readable"),n&&n()}}read(t){if(this[os])return null;try{return this[Vs]===0||t===0||t>this[Vs]?null:(this[Ks]&&(t=null),this.buffer.length>1&&!this[Ks]&&(this.encoding?this.buffer=new G1([Array.from(this.buffer).join("")]):this.buffer=new G1([ap.concat(Array.from(this.buffer),this[Vs])])),this[bde](t||null,this.buffer.head.value))}finally{this[H1]()}}[bde](t,r){return t===r.length||t===null?this[Y8]():(this.buffer.head.value=r.slice(t),r=r.slice(0,t),this[Vs]-=t),this.emit("data",r),!this.buffer.length&&!this[Cf]&&this.emit("drain"),r}end(t,r,n){return typeof t=="function"&&(n=t,t=null),typeof r=="function"&&(n=r,r="utf8"),t&&this.write(t,r),n&&this.once("end",n),this[Cf]=!0,this.writable=!1,(this.flowing||!this[V1])&&this[H1](),this}[K1](){this[os]||(this[V1]=!1,this[ZA]=!0,this.emit("resume"),this.buffer.length?this[wde]():this[Cf]?this[H1]():this.emit("drain"))}resume(){return this[K1]()}pause(){this[ZA]=!1,this[V1]=!0}get destroyed(){return this[os]}get flowing(){return this[ZA]}get paused(){return this[V1]}[_de](t){return this[Ks]?this[Vs]+=1:this[Vs]+=t.length,this.buffer.push(t)}[Y8](){return this.buffer.length&&(this[Ks]?this[Vs]-=1:this[Vs]-=this.buffer.head.value.length),this.buffer.shift()}[wde](){do;while(this[Ede](this[Y8]()));!this.buffer.length&&!this[Cf]&&this.emit("drain")}[Ede](t){return t?(this.emit("data",t),this.flowing):!1}pipe(t,r){if(this[os])return;let n=this[ip];r=r||{},t===process.stdout||t===process.stderr?r.end=!1:r.end=r.end!==!1;let i={dest:t,opts:r,ondrain:a=>this[K1]()};return this.pipes.push(i),t.on("drain",i.ondrain),this[K1](),n&&i.opts.end&&i.dest.end(),t}addListener(t,r){return this.on(t,r)}on(t,r){try{return super.on(t,r)}finally{t==="data"&&!this.pipes.length&&!this.flowing?this[K1]():Cde(t)&&this[ip]&&(super.emit(t),this.removeAllListeners(t))}}get emittedEnd(){return this[ip]}[H1](){!this[QA]&&!this[ip]&&!this[os]&&this.buffer.length===0&&this[Cf]&&(this[QA]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[XA]&&this.emit("close"),this[QA]=!1)}emit(t,r){if(t!=="error"&&t!=="close"&&t!==os&&this[os])return;if(t==="data"){if(!r)return;this.pipes.length&&this.pipes.forEach(i=>i.dest.write(r)===!1&&this.pause())}else if(t==="end"){if(this[ip]===!0)return;this[ip]=!0,this.readable=!1,this[Sf]&&(r=this[Sf].end(),r&&(this.pipes.forEach(i=>i.dest.write(r)),super.emit("data",r))),this.pipes.forEach(i=>{i.dest.removeListener("drain",i.ondrain),i.opts.end&&i.dest.end()})}else if(t==="close"&&(this[XA]=!0,!this[ip]&&!this[os]))return;let n=new Array(arguments.length);if(n[0]=t,n[1]=r,arguments.length>2)for(let i=2;i<arguments.length;i++)n[i]=arguments[i];try{return super.emit.apply(this,n)}finally{Cde(t)?this.removeAllListeners(t):this[H1]()}}collect(){let t=[];return t.dataLength=0,this.on("data",r=>{t.push(r),t.dataLength+=r.length}),this.promise().then(()=>t)}concat(){return this[Ks]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(t=>this[Ks]?Promise.reject(new Error("cannot concat in objectMode")):this[Hs]?t.join(""):ap.concat(t,t.dataLength))}promise(){return new Promise((t,r)=>{this.on(os,()=>r(new Error("stream destroyed"))),this.on("end",()=>t()),this.on("error",n=>r(n))})}[mut](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Cf])return Promise.resolve({done:!0});let n=null,i=null,a=c=>{this.removeListener("data",s),this.removeListener("end",o),i(c)},s=c=>{this.removeListener("error",a),this.removeListener("end",o),this.pause(),n({value:c,done:!!this[Cf]})},o=()=>{this.removeListener("error",a),this.removeListener("data",s),n({done:!0})},u=()=>a(new Error("stream destroyed"));return new Promise((c,l)=>{i=l,n=c,this.once(os,u),this.once("error",a),this.once("end",o),this.once("data",s)})}}}[gut](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(t){return this[os]?(t?this.emit("error",t):this.emit(os),this):(this[os]=!0,this.buffer=new G1,this[Vs]=0,typeof this.close=="function"&&!this[XA]&&this.close(),t?this.emit("error",t):this.emit(os),this)}static isStream(t){return!!t&&(t instanceof Sde||t instanceof vde&&(typeof t.pipe=="function"||typeof t.write=="function"&&typeof t.end=="function"))}}});var Dde=y((Xnr,Ade)=>{var but=require("zlib").constants||{ZLIB_VERNUM:4736};Ade.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},but))});var a6=y(go=>{"use strict";var Q8=require("assert"),sp=require("buffer").Buffer,kde=require("zlib"),_m=go.constants=Dde(),wut=k0(),Tde=sp.concat,eD=class extends Error{constructor(t){super("zlib: "+t.message);this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},Eut=Symbol("opts"),J1=Symbol("flushFlag"),Rde=Symbol("finishFlushFlag"),X8=Symbol("fullFlushFlag"),ui=Symbol("handle"),Z8=Symbol("onError"),tD=Symbol("sawError"),e6=Symbol("level"),t6=Symbol("strategy"),r6=Symbol("ended"),Znr=Symbol("_defaultFullFlush"),n6=class extends wut{constructor(t,r){if(!t||typeof t!="object")throw new TypeError("invalid options for ZlibBase constructor");super(t);this[r6]=!1,this[Eut]=t,this[J1]=t.flush,this[Rde]=t.finishFlush;try{this[ui]=new kde[r](t)}catch(n){throw new eD(n)}this[Z8]=n=>{this[tD]=!0,this.close(),this.emit("error",n)},this[ui].on("error",n=>this[Z8](new eD(n))),this.once("end",()=>this.close)}close(){this[ui]&&(this[ui].close(),this[ui]=null,this.emit("close"))}reset(){if(!this[tD])return Q8(this[ui],"zlib binding closed"),this[ui].reset()}flush(t){this.ended||(typeof t!="number"&&(t=this[X8]),this.write(Object.assign(sp.alloc(0),{[J1]:t})))}end(t,r,n){return t&&this.write(t,r),this.flush(this[Rde]),this[r6]=!0,super.end(null,null,n)}get ended(){return this[r6]}write(t,r,n){if(typeof r=="function"&&(n=r,r="utf8"),typeof t=="string"&&(t=sp.from(t,r)),this[tD])return;Q8(this[ui],"zlib binding closed");let i=this[ui]._handle,a=i.close;i.close=()=>{};let s=this[ui].close;this[ui].close=()=>{},sp.concat=c=>c;let o;try{let c=typeof t[J1]=="number"?t[J1]:this[J1];o=this[ui]._processChunk(t,c),sp.concat=Tde}catch(c){sp.concat=Tde,this[Z8](new eD(c))}finally{this[ui]&&(this[ui]._handle=i,i.close=a,this[ui].close=s,this[ui].removeAllListeners("error"))}let u;if(o)if(Array.isArray(o)&&o.length>0){u=super.write(sp.from(o[0]));for(let c=1;c<o.length;c++)u=super.write(o[c])}else u=super.write(sp.from(o));return n&&n(),u}},op=class extends n6{constructor(t,r){t=t||{},t.flush=t.flush||_m.Z_NO_FLUSH,t.finishFlush=t.finishFlush||_m.Z_FINISH,super(t,r),this[X8]=_m.Z_FULL_FLUSH,this[e6]=t.level,this[t6]=t.strategy}params(t,r){if(!this[tD]){if(!this[ui])throw new Error("cannot switch params when binding is closed");if(!this[ui].params)throw new Error("not supported in this implementation");if(this[e6]!==t||this[t6]!==r){this.flush(_m.Z_SYNC_FLUSH),Q8(this[ui],"zlib binding closed");let n=this[ui].flush;this[ui].flush=(i,a)=>{this.flush(i),a()};try{this[ui].params(t,r)}finally{this[ui].flush=n}this[ui]&&(this[e6]=t,this[t6]=r)}}}},Pde=class extends op{constructor(t){super(t,"Deflate")}},Fde=class extends op{constructor(t){super(t,"Inflate")}},Ide=class extends op{constructor(t){super(t,"Gzip")}},Ode=class extends op{constructor(t){super(t,"Gunzip")}},jde=class extends op{constructor(t){super(t,"DeflateRaw")}},qde=class extends op{constructor(t){super(t,"InflateRaw")}},Lde=class extends op{constructor(t){super(t,"Unzip")}},i6=class extends n6{constructor(t,r){t=t||{},t.flush=t.flush||_m.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||_m.BROTLI_OPERATION_FINISH,super(t,r),this[X8]=_m.BROTLI_OPERATION_FLUSH}},Nde=class extends i6{constructor(t){super(t,"BrotliCompress")}},Bde=class extends i6{constructor(t){super(t,"BrotliDecompress")}};go.Deflate=Pde;go.Inflate=Fde;go.Gzip=Ide;go.Gunzip=Ode;go.DeflateRaw=jde;go.InflateRaw=qde;go.Unzip=Lde;typeof kde.BrotliCompress=="function"?(go.BrotliCompress=Nde,go.BrotliDecompress=Bde):go.BrotliCompress=go.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var nD=y(rD=>{"use strict";rD.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);rD.code=new Map(Array.from(rD.name).map(e=>[e[1],e[0]]))});var xm=y((rir,Mde)=>{var _ut=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;Mde.exports=_ut!=="win32"?e=>e:e=>e&&e.replace(/\\/g,"/")});var W1=y((air,Ude)=>{"use strict";var nir=nD(),xut=k0(),s6=xm(),o6=Symbol("slurp");Ude.exports=class extends xut{constructor(t,r,n){super();switch(this.pause(),this.extended=r,this.globalExtended=n,this.header=t,this.startBlockSize=512*Math.ceil(t.size/512),this.blockRemain=this.startBlockSize,this.remain=t.size,this.type=t.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=s6(t.path),this.mode=t.mode,this.mode&&(this.mode=this.mode&4095),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=t.size,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=s6(t.linkpath),this.uname=t.uname,this.gname=t.gname,r&&this[o6](r),n&&this[o6](n,!0)}write(t){let r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");let n=this.remain,i=this.blockRemain;return this.remain=Math.max(0,n-r),this.blockRemain=Math.max(0,i-r),this.ignore?!0:n>=r?super.write(t):super.write(t.slice(0,n))}[o6](t,r){for(let n in t)t[n]!==null&&t[n]!==void 0&&!(r&&n==="path")&&(this[n]=n==="path"||n==="linkpath"?s6(t[n]):t[n])}}});var Gde=y(u6=>{"use strict";var sir=u6.encode=(e,t)=>{if(Number.isSafeInteger(e))e<0?Sut(e,t):Cut(e,t);else throw TypeError("cannot encode number outside of javascript safe integer range");return t},Cut=(e,t)=>{t[0]=128;for(var r=t.length;r>1;r--)t[r-1]=e&255,e=Math.floor(e/256)},Sut=(e,t)=>{t[0]=255;var r=!1;e=e*-1;for(var n=t.length;n>1;n--){var i=e&255;e=Math.floor(e/256),r?t[n-1]=zde(i):i===0?t[n-1]=0:(r=!0,t[n-1]=$de(i))}},oir=u6.parse=e=>{var t=e[e.length-1],r=e[0],n;if(r===128)n=Dut(e.slice(1,e.length));else if(r===255)n=Aut(e);else throw TypeError("invalid base256 encoding");if(!Number.isSafeInteger(n))throw TypeError("parsed number outside of javascript safe integer range");return n},Aut=e=>{for(var t=e.length,r=0,n=!1,i=t-1;i>-1;i--){var a=e[i],s;n?s=zde(a):a===0?s=a:(n=!0,s=$de(a)),s!==0&&(r-=s*Math.pow(256,t-i-1))}return r},Dut=e=>{for(var t=e.length,r=0,n=t-1;n>-1;n--){var i=e[n];i!==0&&(r+=i*Math.pow(256,t-n-1))}return r},zde=e=>(255^e)&255,$de=e=>(255^e)+1&255});var R0=y((cir,Hde)=>{"use strict";var up=np(),c6=nD(),T0=require("path").posix,Vde=Gde(),l6=Symbol("slurp"),vo=Symbol("type"),Kde=class{constructor(t,r,n,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[vo]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,up.isBuffer(t)?this.decode(t,r||0,n,i):t&&this.set(t)}decode(t,r,n,i){if(r||(r=0),!t||!(t.length>=r+512))throw new Error("need 512 bytes for header");if(this.path=Cm(t,r,100),this.mode=cp(t,r+100,8),this.uid=cp(t,r+108,8),this.gid=cp(t,r+116,8),this.size=cp(t,r+124,12),this.mtime=f6(t,r+136,12),this.cksum=cp(t,r+148,12),this[l6](n),this[l6](i,!0),this[vo]=Cm(t,r+156,1),this[vo]===""&&(this[vo]="0"),this[vo]==="0"&&this.path.substr(-1)==="/"&&(this[vo]="5"),this[vo]==="5"&&(this.size=0),this.linkpath=Cm(t,r+157,100),t.slice(r+257,r+265).toString()==="ustar\x0000")if(this.uname=Cm(t,r+265,32),this.gname=Cm(t,r+297,32),this.devmaj=cp(t,r+329,8),this.devmin=cp(t,r+337,8),t[r+475]!==0){let s=Cm(t,r+345,155);this.path=s+"/"+this.path}else{let s=Cm(t,r+345,130);s&&(this.path=s+"/"+this.path),this.atime=f6(t,r+476,12),this.ctime=f6(t,r+488,12)}let a=8*32;for(let s=r;s<r+148;s++)a+=t[s];for(let s=r+156;s<r+512;s++)a+=t[s];this.cksumValid=a===this.cksum,this.cksum===null&&a===8*32&&(this.nullBlock=!0)}[l6](t,r){for(let n in t)t[n]!==null&&t[n]!==void 0&&!(r&&n==="path")&&(this[n]=t[n])}encode(t,r){if(t||(t=this.block=up.alloc(512),r=0),r||(r=0),!(t.length>=r+512))throw new Error("need 512 bytes for header");let n=this.ctime||this.atime?130:155,i=kut(this.path||"",n),a=i[0],s=i[1];this.needPax=i[2],this.needPax=Sm(t,r,100,a)||this.needPax,this.needPax=lp(t,r+100,8,this.mode)||this.needPax,this.needPax=lp(t,r+108,8,this.uid)||this.needPax,this.needPax=lp(t,r+116,8,this.gid)||this.needPax,this.needPax=lp(t,r+124,12,this.size)||this.needPax,this.needPax=d6(t,r+136,12,this.mtime)||this.needPax,t[r+156]=this[vo].charCodeAt(0),this.needPax=Sm(t,r+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",r+257,8),this.needPax=Sm(t,r+265,32,this.uname)||this.needPax,this.needPax=Sm(t,r+297,32,this.gname)||this.needPax,this.needPax=lp(t,r+329,8,this.devmaj)||this.needPax,this.needPax=lp(t,r+337,8,this.devmin)||this.needPax,this.needPax=Sm(t,r+345,n,s)||this.needPax,t[r+475]!==0?this.needPax=Sm(t,r+345,155,s)||this.needPax:(this.needPax=Sm(t,r+345,130,s)||this.needPax,this.needPax=d6(t,r+476,12,this.atime)||this.needPax,this.needPax=d6(t,r+488,12,this.ctime)||this.needPax);let o=8*32;for(let u=r;u<r+148;u++)o+=t[u];for(let u=r+156;u<r+512;u++)o+=t[u];return this.cksum=o,lp(t,r+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(t){for(let r in t)t[r]!==null&&t[r]!==void 0&&(this[r]=t[r])}get type(){return c6.name.get(this[vo])||this[vo]}get typeKey(){return this[vo]}set type(t){c6.code.has(t)?this[vo]=c6.code.get(t):this[vo]=t}},kut=(e,t)=>{let r=100,n=e,i="",a,s=T0.parse(e).root||".";if(up.byteLength(n)<r)a=[n,i,!1];else{i=T0.dirname(n),n=T0.basename(n);do up.byteLength(n)<=r&&up.byteLength(i)<=t?a=[n,i,!1]:up.byteLength(n)>r&&up.byteLength(i)<=t?a=[n.substr(0,r-1),i,!0]:(n=T0.join(T0.basename(i),n),i=T0.dirname(i));while(i!==s&&!a);a||(a=[e.substr(0,r-1),"",!0])}return a},Cm=(e,t,r)=>e.slice(t,t+r).toString("utf8").replace(/\0.*/,""),f6=(e,t,r)=>Tut(cp(e,t,r)),Tut=e=>e===null?null:new Date(e*1e3),cp=(e,t,r)=>e[t]&128?Vde.parse(e.slice(t,t+r)):Rut(e,t,r),Put=e=>isNaN(e)?null:e,Rut=(e,t,r)=>Put(parseInt(e.slice(t,t+r).toString("utf8").replace(/\0.*$/,"").trim(),8)),Fut={12:8589934591,8:2097151},lp=(e,t,r,n)=>n===null?!1:n>Fut[r]||n<0?(Vde.encode(n,e.slice(t,t+r)),!0):(Iut(e,t,r,n),!1),Iut=(e,t,r,n)=>e.write(Out(n,r),t,r,"ascii"),Out=(e,t)=>jut(Math.floor(e).toString(8),t),jut=(e,t)=>(e.length===t-1?e:new Array(t-e.length-1).join("0")+e+" ")+"\0",d6=(e,t,r,n)=>n===null?!1:lp(e,t,r,n.getTime()/1e3),qut=new Array(156).join("\0"),Sm=(e,t,r,n)=>n===null?!1:(e.write(n+qut,t,r,"utf8"),n.length!==up.byteLength(n)||n.length>r);Hde.exports=Kde});var sD=y((lir,Jde)=>{"use strict";var iD=np(),Lut=R0(),Nut=require("path"),aD=class{constructor(t,r){this.atime=t.atime||null,this.charset=t.charset||null,this.comment=t.comment||null,this.ctime=t.ctime||null,this.gid=t.gid||null,this.gname=t.gname||null,this.linkpath=t.linkpath||null,this.mtime=t.mtime||null,this.path=t.path||null,this.size=t.size||null,this.uid=t.uid||null,this.uname=t.uname||null,this.dev=t.dev||null,this.ino=t.ino||null,this.nlink=t.nlink||null,this.global=r||!1}encode(){let t=this.encodeBody();if(t==="")return null;let r=iD.byteLength(t),n=512*Math.ceil(1+r/512),i=iD.allocUnsafe(n);for(let a=0;a<512;a++)i[a]=0;new Lut({path:("PaxHeader/"+Nut.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(t,512,r,"utf8");for(let a=r+512;a<i.length;a++)i[a]=0;return i}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===null||this[t]===void 0)return"";let r=this[t]instanceof Date?this[t].getTime()/1e3:this[t],n=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+r+`
|
|
255
255
|
`,i=iD.byteLength(n),a=Math.floor(Math.log(i)/Math.log(10))+1;return i+a>=Math.pow(10,a)&&(a+=1),a+i+n}};aD.parse=(e,t,r)=>new aD(But(Mut(e),t),r);var But=(e,t)=>t?Object.keys(e).reduce((r,n)=>(r[n]=e[n],r),t):e,Mut=e=>e.replace(/\n$/,"").split(`
|
|
256
256
|
`).reduce(Uut,Object.create(null)),Uut=(e,t)=>{let r=parseInt(t,10);if(r!==iD.byteLength(t)+1)return e;t=t.substr((r+" ").length);let n=t.split("="),i=n.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return e;let a=n.join("=");return e[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(a*1e3):/^[0-9]+$/.test(a)?+a:a,e};Jde.exports=aD});var P0=y((fir,Wde)=>{var zut=["/".repeat(1024),"/".repeat(512),"/".repeat(256),"/".repeat(128),"/".repeat(64),"/".repeat(32),"/".repeat(16),"/".repeat(8),"/".repeat(4),"/".repeat(2),"/"];Wde.exports=e=>{for(let t of zut)for(;e.length>=t.length&&e.slice(-1*t.length)===t;)e=e.slice(0,-1*t.length);return e}});var oD=y((dir,Yde)=>{"use strict";Yde.exports=e=>class extends e{warn(t,r){if(!this.strict)this.emit("warn",t,r);else if(r instanceof Error)this.emit("error",r);else{let n=new Error(t);n.data=r,this.emit("error",n)}}}});var h6=y((pir,Qde)=>{"use strict";var uD=["|","<",">","?",":"],p6=uD.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),$ut=new Map(uD.map((e,t)=>[e,p6[t]])),Gut=new Map(p6.map((e,t)=>[e,uD[t]]));Qde.exports={encode:e=>uD.reduce((t,r)=>t.split(r).join($ut.get(r)),e),decode:e=>p6.reduce((t,r)=>t.split(r).join(Gut.get(r)),e)}});var m6=y((hir,Xde)=>{var{isAbsolute:Hut,parse:Zde}=require("path").win32;Xde.exports=e=>{let t="",r=Zde(e);for(;Hut(e)||r.root;){let n=e.charAt(0)==="/"&&e.slice(0,4)!=="//?/"?"/":r.root;e=e.substr(n.length),t+=n,r=Zde(e)}return[t,e]}});var tpe=y((mir,epe)=>{"use strict";epe.exports=(e,t)=>(e&=4095,t&&(e&256&&(e|=64),e&32&&(e|=8),e&4&&(e|=1)),e)});var C6=y((bir,rpe)=>{"use strict";var cD=np(),npe=k0(),ipe=sD(),ape=R0(),gir=W1(),Gc=require("fs"),spe=require("path"),Af=xm(),Vut=P0(),ope=(e,t)=>t?(e=Af(e).replace(/^\.(\/|$)/,""),Vut(t)+"/"+e):e,Kut=16*1024*1024,upe=Symbol("process"),cpe=Symbol("file"),lpe=Symbol("directory"),g6=Symbol("symlink"),fpe=Symbol("hardlink"),Y1=Symbol("header"),lD=Symbol("read"),v6=Symbol("lstat"),fD=Symbol("onlstat"),y6=Symbol("onread"),b6=Symbol("onreadlink"),w6=Symbol("openfile"),E6=Symbol("onopenfile"),fp=Symbol("close"),dD=Symbol("mode"),_6=Symbol("awaitDrain"),x6=Symbol("ondrain"),Hc=Symbol("prefix"),dpe=Symbol("hadError"),ppe=oD(),Jut=h6(),hpe=m6(),mpe=tpe(),pD=ppe(class extends npe{constructor(t,r){if(r=r||{},super(r),typeof t!="string")throw new TypeError("path is required");if(this.path=Af(t),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||Kut,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=Af(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?Af(r.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn),!this.preservePaths){let n=hpe(this.path);n[0]&&(this.warn("stripping "+n[0]+" from absolute path",this.path),this.path=n[1])}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=Jut.decode(this.path.replace(/\\/g,"/")),t=t.replace(/\\/g,"/")),this.absolute=Af(r.absolute||spe.resolve(this.cwd,t)),this.path===""&&(this.path="./"),this.statCache.has(this.absolute)?this[fD](this.statCache.get(this.absolute)):this[v6]()}emit(t,...r){return t==="error"&&(this[dpe]=!0),super.emit(t,...r)}[v6](){Gc.lstat(this.absolute,(t,r)=>{if(t)return this.emit("error",t);this[fD](r)})}[fD](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=Wut(t),this.emit("stat",t),this[upe]()}[upe](){switch(this.type){case"File":return this[cpe]();case"Directory":return this[lpe]();case"SymbolicLink":return this[g6]();default:return this.end()}}[dD](t){return mpe(t,this.type==="Directory")}[Hc](t){return ope(t,this.prefix)}[Y1](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new ape({path:this[Hc](this.path),linkpath:this.type==="Link"?this[Hc](this.linkpath):this.linkpath,mode:this[dD](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new ipe({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[Hc](this.path),linkpath:this.type==="Link"?this[Hc](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[lpe](){this.path.substr(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Y1](),this.end()}[g6](){Gc.readlink(this.absolute,(t,r)=>{if(t)return this.emit("error",t);this[b6](r)})}[b6](t){this.linkpath=Af(t),this[Y1](),this.end()}[fpe](t){this.type="Link",this.linkpath=Af(spe.relative(this.cwd,t)),this.stat.size=0,this[Y1](),this.end()}[cpe](){if(this.stat.nlink>1){let t=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(t)){let r=this.linkCache.get(t);if(r.indexOf(this.cwd)===0)return this[fpe](r)}this.linkCache.set(t,this.absolute)}if(this[Y1](),this.stat.size===0)return this.end();this[w6]()}[w6](){Gc.open(this.absolute,"r",(t,r)=>{if(t)return this.emit("error",t);this[E6](r)})}[E6](t){if(this.fd=t,this[dpe])return this[fp]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let r=Math.min(this.blockLen,this.maxReadSize);this.buf=cD.allocUnsafe(r),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[lD]()}[lD](){let{fd:t,buf:r,offset:n,length:i,pos:a}=this;Gc.read(t,r,n,i,a,(s,o)=>{if(s)return this[fp](()=>this.emit("error",s));this[y6](o)})}[fp](t){Gc.close(this.fd,t)}[y6](t){if(t<=0&&this.remain>0){let i=new Error("encountered unexpected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[fp](()=>this.emit("error",i))}if(t>this.remain){let i=new Error("did not encounter expected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[fp](()=>this.emit("error",i))}if(t===this.remain)for(let i=t;i<this.length&&t<this.blockRemain;i++)this.buf[i+this.offset]=0,t++,this.remain++;let r=this.offset===0&&t===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+t);this.write(r)?this[x6]():this[_6](()=>this[x6]())}[_6](t){this.once("drain",t)}write(t){if(this.blockRemain<t.length){let r=new Error("writing more data than expected");return r.path=this.absolute,this.emit("error",r)}return this.remain-=t.length,this.blockRemain-=t.length,this.pos+=t.length,this.offset+=t.length,super.write(t)}[x6](){if(!this.remain)return this.blockRemain&&super.write(cD.alloc(this.blockRemain)),this[fp](t=>t?this.emit("error",t):this.end());this.offset>=this.length&&(this.buf=cD.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[lD]()}}),gpe=class extends pD{constructor(t,r){super(t,r)}[v6](){this[fD](Gc.lstatSync(this.absolute))}[g6](){this[b6](Gc.readlinkSync(this.absolute))}[w6](){this[E6](Gc.openSync(this.absolute,"r"))}[lD](){let t=!0;try{let{fd:r,buf:n,offset:i,length:a,pos:s}=this,o=Gc.readSync(r,n,i,a,s);this[y6](o),t=!1}finally{if(t)try{this[fp](()=>{})}catch(r){}}}[_6](t){t()}[fp](t){Gc.closeSync(this.fd),t()}},Yut=ppe(class extends npe{constructor(t,r){if(r=r||{},super(r),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.readEntry=t,this.type=t.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix||null,this.path=Af(t.path),this.mode=this[dD](t.mode),this.uid=this.portable?null:t.uid,this.gid=this.portable?null:t.gid,this.uname=this.portable?null:t.uname,this.gname=this.portable?null:t.gname,this.size=t.size,this.mtime=this.noMtime?null:r.mtime||t.mtime,this.atime=this.portable?null:t.atime,this.ctime=this.portable?null:t.ctime,this.linkpath=Af(t.linkpath),typeof r.onwarn=="function"&&this.on("warn",r.onwarn),!this.preservePaths){let n=hpe(this.path);n[0]&&(this.warn("stripping "+n[0]+" from absolute path",this.path),this.path=n[1])}this.remain=t.size,this.blockRemain=t.startBlockSize,this.header=new ape({path:this[Hc](this.path),linkpath:this.type==="Link"?this[Hc](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),this.header.encode()&&!this.noPax&&super.write(new ipe({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[Hc](this.path),linkpath:this.type==="Link"?this[Hc](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),t.pipe(this)}[Hc](t){return ope(t,this.prefix)}[dD](t){return mpe(t,this.type==="Directory")}write(t){let r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(t)}end(){return this.blockRemain&&super.write(cD.alloc(this.blockRemain)),super.end()}});pD.Sync=gpe;pD.Tar=Yut;var Wut=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";rpe.exports=pD});var ED=y((Eir,vpe)=>{"use strict";var Qut=np(),S6=class{constructor(t,r){this.path=t||"./",this.absolute=r,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},Xut=k0(),Zut=a6(),ect=W1(),A6=C6(),tct=A6.Sync,rct=A6.Tar,nct=WA(),ype=Qut.alloc(1024),hD=Symbol("onStat"),mD=Symbol("ended"),Vc=Symbol("queue"),F0=Symbol("current"),Am=Symbol("process"),gD=Symbol("processing"),bpe=Symbol("processJob"),Kc=Symbol("jobs"),D6=Symbol("jobDone"),vD=Symbol("addFSEntry"),wpe=Symbol("addTarEntry"),k6=Symbol("stat"),T6=Symbol("readdir"),yD=Symbol("onreaddir"),bD=Symbol("pipe"),Epe=Symbol("entry"),R6=Symbol("entryOpt"),P6=Symbol("writeEntryClass"),_pe=Symbol("write"),F6=Symbol("ondrain"),wD=require("fs"),xpe=require("path"),ict=oD(),I6=xm(),O6=ict(class extends Xut{constructor(t){super(t);t=t||Object.create(null),this.opt=t,this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=I6(t.prefix||""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this[P6]=A6,typeof t.onwarn=="function"&&this.on("warn",t.onwarn),this.zip=null,t.gzip?(typeof t.gzip!="object"&&(t.gzip={}),this.zip=new Zut.Gzip(t.gzip),this.zip.on("data",r=>super.write(r)),this.zip.on("end",r=>super.end()),this.zip.on("drain",r=>this[F6]()),this.on("resume",r=>this.zip.resume())):this.on("drain",this[F6]),this.portable=!!t.portable,this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.filter=typeof t.filter=="function"?t.filter:r=>!0,this[Vc]=new nct,this[Kc]=0,this.jobs=+t.jobs||4,this[gD]=!1,this[mD]=!1}[_pe](t){return super.write(t)}add(t){return this.write(t),this}end(t){return t&&this.write(t),this[mD]=!0,this[Am](),this}write(t){if(this[mD])throw new Error("write after end");return t instanceof ect?this[wpe](t):this[vD](t),this.flowing}[wpe](t){let r=I6(xpe.resolve(this.cwd,t.path));if(!this.filter(t.path,t))t.resume();else{let n=new S6(t.path,r,!1);n.entry=new rct(t,this[R6](n)),n.entry.on("end",i=>this[D6](n)),this[Kc]+=1,this[Vc].push(n)}this[Am]()}[vD](t){let r=I6(xpe.resolve(this.cwd,t));this[Vc].push(new S6(t,r)),this[Am]()}[k6](t){t.pending=!0,this[Kc]+=1;let r=this.follow?"stat":"lstat";wD[r](t.absolute,(n,i)=>{t.pending=!1,this[Kc]-=1,n?this.emit("error",n):this[hD](t,i)})}[hD](t,r){this.statCache.set(t.absolute,r),t.stat=r,this.filter(t.path,r)||(t.ignore=!0),this[Am]()}[T6](t){t.pending=!0,this[Kc]+=1,wD.readdir(t.absolute,(r,n)=>{if(t.pending=!1,this[Kc]-=1,r)return this.emit("error",r);this[yD](t,n)})}[yD](t,r){this.readdirCache.set(t.absolute,r),t.readdir=r,this[Am]()}[Am](){if(!this[gD]){this[gD]=!0;for(let t=this[Vc].head;t!==null&&this[Kc]<this.jobs;t=t.next)if(this[bpe](t.value),t.value.ignore){let r=t.next;this[Vc].removeNode(t),t.next=r}this[gD]=!1,this[mD]&&!this[Vc].length&&this[Kc]===0&&(this.zip?this.zip.end(ype):(super.write(ype),super.end()))}}get[F0](){return this[Vc]&&this[Vc].head&&this[Vc].head.value}[D6](t){this[Vc].shift(),this[Kc]-=1,this[Am]()}[bpe](t){if(!t.pending){if(t.entry){t===this[F0]&&!t.piped&&this[bD](t);return}if(t.stat||(this.statCache.has(t.absolute)?this[hD](t,this.statCache.get(t.absolute)):this[k6](t)),!!t.stat&&!t.ignore&&!(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir&&(this.readdirCache.has(t.absolute)?this[yD](t,this.readdirCache.get(t.absolute)):this[T6](t),!t.readdir))){if(t.entry=this[Epe](t),!t.entry){t.ignore=!0;return}t===this[F0]&&!t.piped&&this[bD](t)}}}[R6](t){return{onwarn:(r,n)=>{this.warn(r,n)},noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[Epe](t){this[Kc]+=1;try{return new this[P6](t.path,this[R6](t)).on("end",()=>this[D6](t)).on("error",r=>this.emit("error",r))}catch(r){this.emit("error",r)}}[F6](){this[F0]&&this[F0].entry&&this[F0].entry.resume()}[bD](t){t.piped=!0,t.readdir&&t.readdir.forEach(i=>{let a=t.path,s=a==="./"?"":a.replace(/\/*$/,"/");this[vD](s+i)});let r=t.entry,n=this.zip;n?r.on("data",i=>{n.write(i)||r.pause()}):r.on("data",i=>{super.write(i)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),Cpe=class extends O6{constructor(t){super(t);this[P6]=tct}pause(){}resume(){}[k6](t){let r=this.follow?"statSync":"lstatSync";this[hD](t,wD[r](t.absolute))}[T6](t,r){this[yD](t,wD.readdirSync(t.absolute))}[bD](t){let r=t.entry,n=this.zip;t.readdir&&t.readdir.forEach(i=>{let a=t.path,s=a==="./"?"":a.replace(/\/*$/,"/");this[vD](s+i)}),n?r.on("data",i=>{n.write(i)}):r.on("data",i=>{super[_pe](i)})}};O6.Sync=Cpe;vpe.exports=O6});var N0=y(Q1=>{"use strict";var act=k0(),sct=require("events").EventEmitter,Jo=require("fs"),_D=process.binding("fs"),_ir=_D.writeBuffers,oct=_D.FSReqWrap||_D.FSReqCallback,I0=Symbol("_autoClose"),Jc=Symbol("_close"),X1=Symbol("_ended"),Bn=Symbol("_fd"),Spe=Symbol("_finished"),Dm=Symbol("_flags"),j6=Symbol("_flush"),q6=Symbol("_handleChunk"),L6=Symbol("_makeBuf"),N6=Symbol("_mode"),xD=Symbol("_needDrain"),O0=Symbol("_onerror"),j0=Symbol("_onopen"),B6=Symbol("_onread"),km=Symbol("_onwrite"),dp=Symbol("_open"),pp=Symbol("_path"),Tm=Symbol("_pos"),Wc=Symbol("_queue"),q0=Symbol("_read"),Ape=Symbol("_readSize"),hp=Symbol("_reading"),CD=Symbol("_remain"),Dpe=Symbol("_size"),SD=Symbol("_write"),L0=Symbol("_writing"),AD=Symbol("_defaultFlag"),M6=class extends act{constructor(t,r){if(r=r||{},super(r),this.writable=!1,typeof t!="string")throw new TypeError("path must be a string");this[Bn]=typeof r.fd=="number"?r.fd:null,this[pp]=t,this[Ape]=r.readSize||16*1024*1024,this[hp]=!1,this[Dpe]=typeof r.size=="number"?r.size:Infinity,this[CD]=this[Dpe],this[I0]=typeof r.autoClose=="boolean"?r.autoClose:!0,typeof this[Bn]=="number"?this[q0]():this[dp]()}get fd(){return this[Bn]}get path(){return this[pp]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[dp](){Jo.open(this[pp],"r",(t,r)=>this[j0](t,r))}[j0](t,r){t?this[O0](t):(this[Bn]=r,this.emit("open",r),this[q0]())}[L6](){return Buffer.allocUnsafe(Math.min(this[Ape],this[CD]))}[q0](){if(!this[hp]){this[hp]=!0;let t=this[L6]();if(t.length===0)return process.nextTick(()=>this[B6](null,0,t));Jo.read(this[Bn],t,0,t.length,null,(r,n,i)=>this[B6](r,n,i))}}[B6](t,r,n){this[hp]=!1,t?this[O0](t):this[q6](r,n)&&this[q0]()}[Jc](){this[I0]&&typeof this[Bn]=="number"&&(Jo.close(this[Bn],t=>this.emit("close")),this[Bn]=null)}[O0](t){this[hp]=!0,this[Jc](),this.emit("error",t)}[q6](t,r){let n=!1;return this[CD]-=t,t>0&&(n=super.write(t<r.length?r.slice(0,t):r)),(t===0||this[CD]<=0)&&(n=!1,this[Jc](),super.end()),n}emit(t,r){switch(t){case"prefinish":case"finish":break;case"drain":typeof this[Bn]=="number"&&this[q0]();break;default:return super.emit(t,r)}}},kpe=class extends M6{[dp](){let t=!0;try{this[j0](null,Jo.openSync(this[pp],"r")),t=!1}finally{t&&this[Jc]()}}[q0](){let t=!0;try{if(!this[hp]){this[hp]=!0;do{let r=this[L6](),n=r.length===0?0:Jo.readSync(this[Bn],r,0,r.length,null);if(!this[q6](n,r))break}while(!0);this[hp]=!1}t=!1}finally{t&&this[Jc]()}}[Jc](){if(this[I0]&&typeof this[Bn]=="number"){try{Jo.closeSync(this[Bn])}catch(t){}this[Bn]=null,this.emit("close")}}},U6=class extends sct{constructor(t,r){r=r||{},super(r),this.readable=!1,this[L0]=!1,this[X1]=!1,this[xD]=!1,this[Wc]=[],this[pp]=t,this[Bn]=typeof r.fd=="number"?r.fd:null,this[N6]=r.mode===void 0?438:r.mode,this[Tm]=typeof r.start=="number"?r.start:null,this[I0]=typeof r.autoClose=="boolean"?r.autoClose:!0;let n=this[Tm]!==null?"r+":"w";this[AD]=r.flags===void 0,this[Dm]=this[AD]?n:r.flags,this[Bn]===null&&this[dp]()}get fd(){return this[Bn]}get path(){return this[pp]}[O0](t){this[Jc](),this[L0]=!0,this.emit("error",t)}[dp](){Jo.open(this[pp],this[Dm],this[N6],(t,r)=>this[j0](t,r))}[j0](t,r){this[AD]&&this[Dm]==="r+"&&t&&t.code==="ENOENT"?(this[Dm]="w",this[dp]()):t?this[O0](t):(this[Bn]=r,this.emit("open",r),this[j6]())}end(t,r){t&&this.write(t,r),this[X1]=!0,!this[L0]&&!this[Wc].length&&typeof this[Bn]=="number"&&this[km](null,0)}write(t,r){return typeof t=="string"&&(t=new Buffer(t,r)),this[X1]?(this.emit("error",new Error("write() after end()")),!1):this[Bn]===null||this[L0]||this[Wc].length?(this[Wc].push(t),this[xD]=!0,!1):(this[L0]=!0,this[SD](t),!0)}[SD](t){Jo.write(this[Bn],t,0,t.length,this[Tm],(r,n)=>this[km](r,n))}[km](t,r){t?this[O0](t):(this[Tm]!==null&&(this[Tm]+=r),this[Wc].length?this[j6]():(this[L0]=!1,this[X1]&&!this[Spe]?(this[Spe]=!0,this[Jc](),this.emit("finish")):this[xD]&&(this[xD]=!1,this.emit("drain"))))}[j6](){if(this[Wc].length===0)this[X1]&&this[km](null,0);else if(this[Wc].length===1)this[SD](this[Wc].pop());else{let t=this[Wc];this[Wc]=[],uct(this[Bn],t,this[Tm],(r,n)=>this[km](r,n))}}[Jc](){this[I0]&&typeof this[Bn]=="number"&&(Jo.close(this[Bn],t=>this.emit("close")),this[Bn]=null)}},Tpe=class extends U6{[dp](){let t;try{t=Jo.openSync(this[pp],this[Dm],this[N6])}catch(r){if(this[AD]&&this[Dm]==="r+"&&r&&r.code==="ENOENT")return this[Dm]="w",this[dp]();throw r}this[j0](null,t)}[Jc](){if(this[I0]&&typeof this[Bn]=="number"){try{Jo.closeSync(this[Bn])}catch(t){}this[Bn]=null,this.emit("close")}}[SD](t){try{this[km](null,Jo.writeSync(this[Bn],t,0,t.length,this[Tm]))}catch(r){this[km](r,0)}}},uct=(e,t,r,n)=>{let i=(s,o)=>n(s,o,t),a=new oct;a.oncomplete=i,_D.writeBuffers(e,t,r,a)};Q1.ReadStream=M6;Q1.ReadStreamSync=kpe;Q1.WriteStream=U6;Q1.WriteStreamSync=Tpe});var tE=y((Air,Rpe)=>{"use strict";var cct=oD(),Cir=require("path"),lct=R0(),fct=require("events"),dct=WA(),pct=1024*1024,hct=W1(),Ppe=sD(),mct=a6(),DD=np(),z6=DD.from([31,139]),Df=Symbol("state"),Rm=Symbol("writeEntry"),kf=Symbol("readEntry"),$6=Symbol("nextEntry"),Fpe=Symbol("processEntry"),Wo=Symbol("extendedHeader"),Z1=Symbol("globalExtendedHeader"),mp=Symbol("meta"),Ipe=Symbol("emitMeta"),ei=Symbol("buffer"),Tf=Symbol("queue"),Pm=Symbol("ended"),Ope=Symbol("emittedEnd"),B0=Symbol("emit"),Js=Symbol("unzip"),kD=Symbol("consumeChunk"),TD=Symbol("consumeChunkSub"),G6=Symbol("consumeBody"),jpe=Symbol("consumeMeta"),qpe=Symbol("consumeHeader"),RD=Symbol("consuming"),H6=Symbol("bufferConcat"),V6=Symbol("maybeEnd"),eE=Symbol("writing"),gp=Symbol("aborted"),K6=Symbol("onDone"),gct=e=>!0;Rpe.exports=cct(class extends fct{constructor(t){t=t||{},super(t),t.ondone?this.on(K6,t.ondone):this.on(K6,r=>{this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close")}),this.strict=!!t.strict,this.maxMetaEntrySize=t.maxMetaEntrySize||pct,this.filter=typeof t.filter=="function"?t.filter:gct,this.writable=!0,this.readable=!1,this[Tf]=new dct,this[ei]=null,this[kf]=null,this[Rm]=null,this[Df]="begin",this[mp]="",this[Wo]=null,this[Z1]=null,this[Pm]=!1,this[Js]=null,this[gp]=!1,typeof t.onwarn=="function"&&this.on("warn",t.onwarn),typeof t.onentry=="function"&&this.on("entry",t.onentry)}[qpe](t,r){let n;try{n=new lct(t,r,this[Wo],this[Z1])}catch(i){return this.warn("invalid entry",i)}if(n.nullBlock)this[B0]("nullBlock");else if(!n.cksumValid)this.warn("invalid entry",n);else if(!n.path)this.warn("invalid: path is required",n);else{let i=n.type;if(/^(Symbolic)?Link$/.test(i)&&!n.linkpath)this.warn("invalid: linkpath required",n);else if(!/^(Symbolic)?Link$/.test(i)&&n.linkpath)this.warn("invalid: linkpath forbidden",n);else{let a=this[Rm]=new hct(n,this[Wo],this[Z1]);a.meta?a.size>this.maxMetaEntrySize?(a.ignore=!0,this[B0]("ignoredEntry",a),this[Df]="ignore"):a.size>0&&(this[mp]="",a.on("data",s=>this[mp]+=s),this[Df]="meta"):(this[Wo]=null,a.ignore=a.ignore||!this.filter(a.path,a),a.ignore?(this[B0]("ignoredEntry",a),this[Df]=a.remain?"ignore":"begin"):(a.remain?this[Df]="body":(this[Df]="begin",a.end()),this[kf]?this[Tf].push(a):(this[Tf].push(a),this[$6]())))}}}[Fpe](t){let r=!0;return t?Array.isArray(t)?this.emit.apply(this,t):(this[kf]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",n=>this[$6]()),r=!1)):(this[kf]=null,r=!1),r}[$6](){do;while(this[Fpe](this[Tf].shift()));if(!this[Tf].length){let t=this[kf];!t||t.flowing||t.size===t.remain?this[eE]||this.emit("drain"):t.once("drain",n=>this.emit("drain"))}}[G6](t,r){let n=this[Rm],i=n.blockRemain,a=i>=t.length&&r===0?t:t.slice(r,r+i);return n.write(a),n.blockRemain||(this[Df]="begin",this[Rm]=null,n.end()),a.length}[jpe](t,r){let n=this[Rm],i=this[G6](t,r);return this[Rm]||this[Ipe](n),i}[B0](t,r,n){!this[Tf].length&&!this[kf]?this.emit(t,r,n):this[Tf].push([t,r,n])}[Ipe](t){switch(this[B0]("meta",this[mp]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[Wo]=Ppe.parse(this[mp],this[Wo],!1);break;case"GlobalExtendedHeader":this[Z1]=Ppe.parse(this[mp],this[Z1],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[Wo]=this[Wo]||Object.create(null),this[Wo].path=this[mp].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[Wo]=this[Wo]||Object.create(null),this[Wo].linkpath=this[mp].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+t.type)}}abort(t,r){this[gp]=!0,this.warn(t,r),this.emit("abort",r),this.emit("error",r)}write(t){if(this[gp])return;if(this[Js]===null&&t){if(this[ei]&&(t=DD.concat([this[ei],t]),this[ei]=null),t.length<z6.length)return this[ei]=t,!0;for(let n=0;this[Js]===null&&n<z6.length;n++)t[n]!==z6[n]&&(this[Js]=!1);if(this[Js]===null){let n=this[Pm];this[Pm]=!1,this[Js]=new mct.Unzip,this[Js].on("data",a=>this[kD](a)),this[Js].on("error",a=>this.abort(a.message,a)),this[Js].on("end",a=>{this[Pm]=!0,this[kD]()}),this[eE]=!0;let i=this[Js][n?"end":"write"](t);return this[eE]=!1,i}}this[eE]=!0,this[Js]?this[Js].write(t):this[kD](t),this[eE]=!1;let r=this[Tf].length?!1:this[kf]?this[kf].flowing:!0;return!r&&!this[Tf].length&&this[kf].once("drain",n=>this.emit("drain")),r}[H6](t){t&&!this[gp]&&(this[ei]=this[ei]?DD.concat([this[ei],t]):t)}[V6](){if(this[Pm]&&!this[Ope]&&!this[gp]&&!this[RD]){this[Ope]=!0;let t=this[Rm];if(t&&t.blockRemain){let r=this[ei]?this[ei].length:0;this.warn("Truncated input (needed "+t.blockRemain+" more bytes, only "+r+" available)",t),this[ei]&&t.write(this[ei]),t.end()}this[B0](K6)}}[kD](t){if(this[RD])this[H6](t);else if(!t&&!this[ei])this[V6]();else{if(this[RD]=!0,this[ei]){this[H6](t);let r=this[ei];this[ei]=null,this[TD](r)}else this[TD](t);for(;this[ei]&&this[ei].length>=512&&!this[gp];){let r=this[ei];this[ei]=null,this[TD](r)}this[RD]=!1}(!this[ei]||this[Pm])&&this[V6]()}[TD](t){let r=0,n=t.length;for(;r+512<=n&&!this[gp];)switch(this[Df]){case"begin":this[qpe](t,r),r+=512;break;case"ignore":case"body":r+=this[G6](t,r);break;case"meta":r+=this[jpe](t,r);break;default:throw new Error("invalid state: "+this[Df])}r<n&&(this[ei]?this[ei]=DD.concat([t.slice(r),this[ei]]):this[ei]=t.slice(r))}end(t){this[gp]||(this[Js]?this[Js].end(t):(this[Pm]=!0,this.write(t)))}})});var PD=y((kir,Lpe)=>{"use strict";var vct=np(),yct=A0(),Npe=tE(),M0=require("fs"),bct=N0(),Bpe=require("path"),J6=P0(),Dir=Lpe.exports=(e,t,r)=>{typeof e=="function"?(r=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t=="function"&&(r=t,t=null),t?t=Array.from(t):t=[];let n=yct(e);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return t.length&&Ect(n,t),n.noResume||wct(n),n.file&&n.sync?_ct(n):n.file?xct(n,r):Mpe(n)},wct=e=>{let t=e.onentry;e.onentry=t?r=>{t(r),r.resume()}:r=>r.resume()},Ect=(e,t)=>{let r=new Map(t.map(a=>[J6(a),!0])),n=e.filter,i=(a,s)=>{let o=s||Bpe.parse(a).root||".",u=a===o?!1:r.has(a)?r.get(a):i(Bpe.dirname(a),o);return r.set(a,u),u};e.filter=n?(a,s)=>n(a,s)&&i(J6(a)):a=>i(J6(a))},_ct=e=>{let t=Mpe(e),r=e.file,n=!0,i;try{let a=M0.statSync(r),s=e.maxReadSize||16*1024*1024;if(a.size<s)t.end(M0.readFileSync(r));else{let o=0,u=vct.allocUnsafe(s);for(i=M0.openSync(r,"r");o<a.size;){let c=M0.readSync(i,u,0,s,o);o+=c,t.write(u.slice(0,c))}t.end()}n=!1}finally{if(n&&i)try{M0.closeSync(i)}catch(a){}}},xct=(e,t)=>{let r=new Npe(e),n=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((s,o)=>{r.on("error",o),r.on("end",s),M0.stat(i,(u,c)=>{if(u)o(u);else{let l=new bct.ReadStream(i,{readSize:n,size:c.size});l.on("error",o),l.pipe(r)}})});return t?a.then(t,t):a},Mpe=e=>new Npe(e)});var Vpe=y((Pir,Upe)=>{"use strict";var Cct=A0(),FD=ED(),Tir=require("fs"),zpe=N0(),$pe=PD(),Gpe=require("path"),Rir=Upe.exports=(e,t,r)=>{if(typeof t=="function"&&(r=t),Array.isArray(e)&&(t=e,e={}),!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);let n=Cct(e);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return n.file&&n.sync?Sct(n,t):n.file?Act(n,t,r):n.sync?Dct(n,t):kct(n,t)},Sct=(e,t)=>{let r=new FD.Sync(e),n=new zpe.WriteStreamSync(e.file,{mode:e.mode||438});r.pipe(n),Hpe(r,t)},Act=(e,t,r)=>{let n=new FD(e),i=new zpe.WriteStream(e.file,{mode:e.mode||438});n.pipe(i);let a=new Promise((s,o)=>{i.on("error",o),i.on("close",s),n.on("error",o)});return W6(n,t),r?a.then(r,r):a},Hpe=(e,t)=>{t.forEach(r=>{r.charAt(0)==="@"?$pe({file:Gpe.resolve(e.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:n=>e.add(n)}):e.add(r)}),e.end()},W6=(e,t)=>{for(;t.length;){let r=t.shift();if(r.charAt(0)==="@")return $pe({file:Gpe.resolve(e.cwd,r.substr(1)),noResume:!0,onentry:n=>e.add(n)}).then(n=>W6(e,t));e.add(r)}e.end()},Dct=(e,t)=>{let r=new FD.Sync(e);return Hpe(r,t),r},kct=(e,t)=>{let r=new FD(e);return W6(r,t),r}});var Y6=y((Oir,Kpe)=>{"use strict";var Jpe=np(),Tct=A0(),Wpe=ED(),Fir=tE(),yo=require("fs"),Ype=N0(),Qpe=PD(),Xpe=require("path"),Zpe=R0(),Iir=Kpe.exports=(e,t,r)=>{let n=Tct(e);if(!n.file)throw new TypeError("file is required");if(n.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");return t=Array.from(t),n.sync?Rct(n,t):Pct(n,t,r)},Rct=(e,t)=>{let r=new Wpe.Sync(e),n=!0,i,a;try{try{i=yo.openSync(e.file,"r+")}catch(u){if(u.code==="ENOENT")i=yo.openSync(e.file,"w+");else throw u}let s=yo.fstatSync(i),o=Jpe.alloc(512);e:for(a=0;a<s.size;a+=512){for(let l=0,f=0;l<512;l+=f){if(f=yo.readSync(i,o,l,o.length-l,a+l),a===0&&o[0]===31&&o[1]===139)throw new Error("cannot append to compressed archives");if(!f)break e}let u=new Zpe(o);if(!u.cksumValid)break;let c=512*Math.ceil(u.size/512);if(a+c+512>s.size)break;a+=c,e.mtimeCache&&e.mtimeCache.set(u.path,u.mtime)}n=!1,Fct(e,r,a,i,t)}finally{if(n)try{yo.closeSync(i)}catch(s){}}},Fct=(e,t,r,n,i)=>{let a=new Ype.WriteStreamSync(e.file,{fd:n,start:r});t.pipe(a),Ict(t,i)},Pct=(e,t,r)=>{t=Array.from(t);let n=new Wpe(e),i=(s,o,u)=>{let c=(h,g)=>{h?yo.close(s,v=>u(h)):u(null,g)},l=0;if(o===0)return c(null,0);let f=0,d=Jpe.alloc(512),p=(h,g)=>{if(h)return c(h);if(f+=g,f<512&&g)return yo.read(s,d,f,d.length-f,l+f,p);if(l===0&&d[0]===31&&d[1]===139)return c(new Error("cannot append to compressed archives"));if(f<512)return c(null,l);let v=new Zpe(d);if(!v.cksumValid)return c(null,l);let b=512*Math.ceil(v.size/512);if(l+b+512>o||(l+=b+512,l>=o))return c(null,l);e.mtimeCache&&e.mtimeCache.set(v.path,v.mtime),f=0,yo.read(s,d,0,512,l,p)};yo.read(s,d,0,512,l,p)},a=new Promise((s,o)=>{n.on("error",o);let u="r+",c=(l,f)=>{if(l&&l.code==="ENOENT"&&u==="r+")return u="w+",yo.open(e.file,u,c);if(l)return o(l);yo.fstat(f,(d,p)=>{if(d)return yo.close(f,()=>o(d));i(f,p.size,(h,g)=>{if(h)return o(h);let v=new Ype.WriteStream(e.file,{fd:f,start:g});n.pipe(v),v.on("error",o),v.on("close",s),ehe(n,t)})})};yo.open(e.file,u,c)});return r?a.then(r,r):a},Ict=(e,t)=>{t.forEach(r=>{r.charAt(0)==="@"?Qpe({file:Xpe.resolve(e.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:n=>e.add(n)}):e.add(r)}),e.end()},ehe=(e,t)=>{for(;t.length;){let r=t.shift();if(r.charAt(0)==="@")return Qpe({file:Xpe.resolve(e.cwd,r.substr(1)),noResume:!0,onentry:n=>e.add(n)}).then(n=>ehe(e,t));e.add(r)}e.end()}});var rhe=y((qir,the)=>{"use strict";var Oct=A0(),jct=Y6(),jir=the.exports=(e,t,r)=>{let n=Oct(e);if(!n.file)throw new TypeError("file is required");if(n.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");return t=Array.from(t),qct(n),jct(n,t,r)},qct=e=>{let t=e.filter;e.mtimeCache||(e.mtimeCache=new Map),e.filter=t?(r,n)=>t(r,n)&&!(e.mtimeCache.get(r)>n.mtime):(r,n)=>!(e.mtimeCache.get(r)>n.mtime)}});var she=y((Lir,nhe)=>{var rE=require("path"),ihe=require("fs"),ahe=parseInt("0777",8);nhe.exports=U0.mkdirp=U0.mkdirP=U0;function U0(e,t,r,n){typeof t=="function"?(r=t,t={}):(!t||typeof t!="object")&&(t={mode:t});var i=t.mode,a=t.fs||ihe;i===void 0&&(i=ahe),n||(n=null);var s=r||function(){};e=rE.resolve(e),a.mkdir(e,i,function(o){if(!o)return n=n||e,s(null,n);switch(o.code){case"ENOENT":if(rE.dirname(e)===e)return s(o);U0(rE.dirname(e),t,function(u,c){u?s(u,c):U0(e,t,s,c)});break;default:a.stat(e,function(u,c){u||!c.isDirectory()?s(o,n):s(null,n)});break}})}U0.sync=function e(t,r,n){(!r||typeof r!="object")&&(r={mode:r});var i=r.mode,a=r.fs||ihe;i===void 0&&(i=ahe),n||(n=null),t=rE.resolve(t);try{a.mkdirSync(t,i),n=n||t}catch(o){switch(o.code){case"ENOENT":n=e(rE.dirname(t),r,n),e(t,r,n);break;default:var s;try{s=a.statSync(t)}catch(u){throw o}if(!s.isDirectory())throw o;break}}return n}});var phe=y((Nir,ohe)=>{"use strict";var Yo=require("fs"),Fm=require("path"),Lct=Yo.lchown?"lchown":"chown",Nct=Yo.lchownSync?"lchownSync":"chownSync",uhe=Yo.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),che=(e,t,r)=>{try{return Yo[Nct](e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},Bct=(e,t,r)=>{try{return Yo.chownSync(e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},Mct=uhe?(e,t,r,n)=>i=>{!i||i.code!=="EISDIR"?n(i):Yo.chown(e,t,r,n)}:(e,t,r,n)=>n,Q6=uhe?(e,t,r)=>{try{return che(e,t,r)}catch(n){if(n.code!=="EISDIR")throw n;Bct(e,t,r)}}:(e,t,r)=>che(e,t,r),Uct=process.version,lhe=(e,t,r)=>Yo.readdir(e,t,r),zct=(e,t)=>Yo.readdirSync(e,t);/^v4\./.test(Uct)&&(lhe=(e,t,r)=>Yo.readdir(e,r));var ID=(e,t,r,n)=>{Yo[Lct](e,t,r,Mct(e,t,r,i=>{n(i&&i.code!=="ENOENT"?i:null)}))},fhe=(e,t,r,n,i)=>{if(typeof t=="string")return Yo.lstat(Fm.resolve(e,t),(a,s)=>{if(a)return i(a.code!=="ENOENT"?a:null);s.name=t,fhe(e,s,r,n,i)});if(t.isDirectory())X6(Fm.resolve(e,t.name),r,n,a=>{if(a)return i(a);let s=Fm.resolve(e,t.name);ID(s,r,n,i)});else{let a=Fm.resolve(e,t.name);ID(a,r,n,i)}},X6=(e,t,r,n)=>{lhe(e,{withFileTypes:!0},(i,a)=>{if(i){if(i.code==="ENOENT")return n();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return n(i)}if(i||!a.length)return ID(e,t,r,n);let s=a.length,o=null,u=c=>{if(!o){if(c)return n(o=c);if(--s==0)return ID(e,t,r,n)}};a.forEach(c=>fhe(e,c,t,r,u))})},$ct=(e,t,r,n)=>{if(typeof t=="string")try{let i=Yo.lstatSync(Fm.resolve(e,t));i.name=t,t=i}catch(i){if(i.code==="ENOENT")return;throw i}t.isDirectory()&&dhe(Fm.resolve(e,t.name),r,n),Q6(Fm.resolve(e,t.name),r,n)},dhe=(e,t,r)=>{let n;try{n=zct(e,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return Q6(e,t,r);throw i}return n&&n.length&&n.forEach(i=>$ct(e,i,t,r)),Q6(e,t,r)};ohe.exports=X6;X6.sync=dhe});var vhe=y((Bir,Z6)=>{"use strict";var hhe=she(),Qo=require("fs"),OD=require("path"),mhe=phe(),Bu=xm(),eB=class extends Error{constructor(t,r){super("Cannot extract through symbolic link");this.path=r,this.symlink=t}get name(){return"SylinkError"}},tB=class extends Error{constructor(t,r){super(r+": Cannot cd into '"+t+"'");this.path=t,this.code=r}get name(){return"CwdError"}},jD=(e,t)=>e.get(Bu(t)),nE=(e,t,r)=>e.set(Bu(t),r),Gct=(e,t)=>{Qo.stat(e,(r,n)=>{(r||!n.isDirectory())&&(r=new tB(e,r&&r.code||"ENOTDIR")),t(r)})};Z6.exports=(e,t,r)=>{e=Bu(e);let n=t.umask,i=t.mode|448,a=(i&n)!=0,s=t.uid,o=t.gid,u=typeof s=="number"&&typeof o=="number"&&(s!==t.processUid||o!==t.processGid),c=t.preserve,l=t.unlink,f=t.cache,d=Bu(t.cwd),p=(v,b)=>{v?r(v):(nE(f,e,!0),b&&u?mhe(b,s,o,E=>p(E)):a?Qo.chmod(e,i,r):r())};if(f&&jD(f,e)===!0)return p();if(e===d)return Gct(e,p);if(c)return hhe(e,i,p);let g=Bu(OD.relative(d,e)).split("/");qD(d,g,i,f,l,d,null,p)};var qD=(e,t,r,n,i,a,s,o)=>{if(!t.length)return o(null,s);let u=t.shift(),c=Bu(OD.resolve(e+"/"+u));if(jD(n,c))return qD(c,t,r,n,i,a,s,o);Qo.mkdir(c,r,ghe(c,t,r,n,i,a,s,o))},ghe=(e,t,r,n,i,a,s,o)=>u=>{u?Qo.lstat(e,(c,l)=>{if(c)c.path=c.path&&Bu(c.path),o(c);else if(l.isDirectory())qD(e,t,r,n,i,a,s,o);else if(i)Qo.unlink(e,f=>{if(f)return o(f);Qo.mkdir(e,r,ghe(e,t,r,n,i,a,s,o))});else{if(l.isSymbolicLink())return o(new eB(e,e+"/"+t.join("/")));o(u)}}):(s=s||e,qD(e,t,r,n,i,a,s,o))},Hct=e=>{let t=!1,r="ENOTDIR";try{t=Qo.statSync(e).isDirectory()}catch(n){r=n.code}finally{if(!t)throw new tB(e,r)}};Z6.exports.sync=(e,t)=>{e=Bu(e);let r=t.umask,n=t.mode|448,i=(n&r)!=0,a=t.uid,s=t.gid,o=typeof a=="number"&&typeof s=="number"&&(a!==t.processUid||s!==t.processGid),u=t.preserve,c=t.unlink,l=t.cache,f=Bu(t.cwd),d=v=>{nE(l,e,!0),v&&o&&mhe.sync(v,a,s),i&&Qo.chmodSync(e,n)};if(l&&jD(l,e)===!0)return d();if(e===f)return Hct(f),d();if(u)return d(hhe.sync(e,n));let h=Bu(OD.relative(f,e)).split("/"),g=null;for(let v=h.shift(),b=f;v&&(b+="/"+v);v=h.shift())if(b=Bu(OD.resolve(b)),!jD(l,b))try{Qo.mkdirSync(b,n),g=g||b,nE(l,b,!0)}catch(E){let _=Qo.lstatSync(b);if(_.isDirectory()){nE(l,b,!0);continue}else if(c){Qo.unlinkSync(b),Qo.mkdirSync(b,n),g=g||b,nE(l,b,!0);continue}else if(_.isSymbolicLink())return new eB(b,b+"/"+h.join("/"))}return d(g)}});var _he=y((Mir,yhe)=>{var bhe=require("assert"),whe=xm(),Vct=P0(),{join:Ehe}=require("path"),Kct=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Jct=Kct==="win32";yhe.exports=()=>{let e=new Map,t=new Map,r=c=>c.split("/").slice(0,-1).reduce((f,d)=>(f.length&&(d=whe(Ehe(f[f.length-1],d))),f.push(d||"/"),f),[]),n=new Set,i=c=>{let l=t.get(c);if(!l)throw new Error("function does not have any path reservations");return{paths:l.paths.map(f=>e.get(f)),dirs:[...l.dirs].map(f=>e.get(f))}},a=c=>{let{paths:l,dirs:f}=i(c);return l.every(d=>d[0]===c)&&f.every(d=>d[0]instanceof Set&&d[0].has(c))},s=c=>n.has(c)||!a(c)?!1:(n.add(c),c(()=>o(c)),!0),o=c=>{if(!n.has(c))return!1;let{paths:l,dirs:f}=t.get(c),d=new Set;return l.forEach(p=>{let h=e.get(p);bhe.equal(h[0],c),h.length===1?e.delete(p):(h.shift(),typeof h[0]=="function"?d.add(h[0]):h[0].forEach(g=>d.add(g)))}),f.forEach(p=>{let h=e.get(p);bhe(h[0]instanceof Set),h[0].size===1&&h.length===1?e.delete(p):h[0].size===1?(h.shift(),d.add(h[0])):h[0].delete(c)}),n.delete(c),d.forEach(p=>s(p)),!0};return{check:a,reserve:(c,l)=>{c=Jct?["win32 parallelization disabled"]:c.map(d=>Vct(whe(Ehe(d))).normalize("NFKD").toLowerCase());let f=new Set(c.map(d=>r(d)).reduce((d,p)=>d.concat(p)));return t.set(l,{dirs:f,paths:c}),c.forEach(d=>{let p=e.get(d);p?p.push(l):e.set(d,[l])}),f.forEach(d=>{let p=e.get(d);p?p[p.length-1]instanceof Set?p[p.length-1].add(l):p.push(new Set([l])):e.set(d,[new Set([l])])}),s(l)}}}});var lB=y((Gir,xhe)=>{"use strict";var Wct=require("assert"),Uir=require("events").EventEmitter,Yct=tE(),wn=require("fs"),Qct=N0(),Rf=require("path"),rB=vhe(),zir=rB.sync,Che=h6(),Xct=m6(),Zct=_he(),bo=xm(),elt=P0(),She=Symbol("onEntry"),nB=Symbol("checkFs"),Ahe=Symbol("checkFs2"),LD=Symbol("pruneCache"),iB=Symbol("isReusable"),Xo=Symbol("makeFs"),aB=Symbol("file"),sB=Symbol("directory"),ND=Symbol("link"),Dhe=Symbol("symlink"),khe=Symbol("hardlink"),The=Symbol("unsupported"),$ir=Symbol("unknown"),Rhe=Symbol("checkPath"),vp=Symbol("mkdir"),us=Symbol("onError"),BD=Symbol("pending"),Phe=Symbol("pend"),z0=Symbol("unpend"),oB=Symbol("ended"),uB=Symbol("maybeClose"),cB=Symbol("skip"),iE=Symbol("doChown"),aE=Symbol("uid"),sE=Symbol("gid"),oE=Symbol("checkedCwd"),Fhe=require("crypto"),tlt=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,$0=tlt==="win32",rlt=(e,t)=>{if(!$0)return wn.unlink(e,t);let r=e+".DELETE."+Fhe.randomBytes(16).toString("hex");wn.rename(e,r,n=>{if(n)return t(n);wn.unlink(r,t)})},nlt=e=>{if(!$0)return wn.unlinkSync(e);let t=e+".DELETE."+Fhe.randomBytes(16).toString("hex");wn.renameSync(e,t),wn.unlinkSync(t)},Ihe=(e,t,r)=>e===e>>>0?e:t===t>>>0?t:r,Ohe=e=>elt(bo(e)).normalize("NFKD").toLowerCase(),ilt=(e,t)=>{t=Ohe(t);for(let r of e.keys()){let n=Ohe(r);(n===t||n.indexOf(t+"/")===0)&&e.delete(r)}},alt=e=>{for(let t of e.keys())e.delete(t)},MD=class extends Yct{constructor(t){if(t||(t={}),t.ondone=r=>{this[oB]=!0,this[uB]()},super(t),this[oE]=!1,this.reservations=Zct(),this.transform=typeof t.transform=="function"?t.transform:null,this.writable=!0,this.readable=!1,this[BD]=0,this[oB]=!1,this.dirCache=t.dirCache||new Map,typeof t.uid=="number"||typeof t.gid=="number"){if(typeof t.uid!="number"||typeof t.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;t.preserveOwner===void 0&&typeof t.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!t.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=t.forceChown===!0,this.win32=!!t.win32||$0,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=bo(Rf.resolve(t.cwd||process.cwd())),this.strip=+t.strip||0,this.processUmask=process.umask(),this.umask=typeof t.umask=="number"?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",r=>this[She](r))}[uB](){this[oB]&&this[BD]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close"))}[Rhe](t){if(this.strip){let r=bo(t.path).split("/");if(r.length<this.strip)return!1;if(t.path=r.slice(this.strip).join("/"),t.type==="Link"){let n=bo(t.linkpath).split("/");if(n.length>=this.strip)t.linkpath=n.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let r=bo(t.path),n=r.split("/");if(n.includes("..")||$0&&/^[a-z]:\.\.$/i.test(n[0]))return this.warn("path contains '..'",r),!1;let i=Xct(r);i[0]&&(t.path=i[1],this.warn(`stripping ${i[0]} from absolute path`,r))}if(Rf.isAbsolute(t.path)?t.absolute=bo(Rf.resolve(t.path)):t.absolute=bo(Rf.resolve(this.cwd,t.path)),!this.preservePaths&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:bo(t.path),resolvedPath:t.absolute,cwd:this.cwd}),!1;if(t.absolute===this.cwd&&t.type!=="Directory"&&t.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=Rf.win32.parse(t.absolute);t.absolute=r+Che.encode(t.absolute.substr(r.length));let{root:n}=Rf.win32.parse(t.path);t.path=n+Che.encode(t.path.substr(n.length))}return!0}[She](t){if(!this[Rhe](t))return t.resume();switch(Wct.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=t.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[nB](t);case"CharacterDevice":case"BlockDevice":case"FIFO":return this[The](t)}}[us](t,r){t.name==="CwdError"?this.emit("error",t):(this.warn(t.message,t),this[z0](),r.resume())}[vp](t,r,n){rB(bo(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r},n)}[iE](t){return this.forceChown||this.preserveOwner&&(typeof t.uid=="number"&&t.uid!==this.processUid||typeof t.gid=="number"&&t.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[aE](t){return Ihe(this.uid,t.uid,this.processUid)}[sE](t){return Ihe(this.gid,t.gid,this.processGid)}[aB](t,r){let n=t.mode&4095||this.fmode,i=new Qct.WriteStream(t.absolute,{mode:n,autoClose:!1});i.on("error",u=>{i.fd&&wn.close(i.fd,()=>{}),i.write=()=>!0,this[us](u,t),r()});let a=1,s=u=>{if(u){i.fd&&wn.close(i.fd,()=>{}),this[us](u,t),r();return}--a==0&&wn.close(i.fd,c=>{r(),c?this[us](c,t):this[z0]()})};i.on("finish",u=>{let c=t.absolute,l=i.fd;if(t.mtime&&!this.noMtime){a++;let f=t.atime||new Date,d=t.mtime;wn.futimes(l,f,d,p=>p?wn.utimes(c,f,d,h=>s(h&&p)):s())}if(this[iE](t)){a++;let f=this[aE](t),d=this[sE](t);wn.fchown(l,f,d,p=>p?wn.chown(c,f,d,h=>s(h&&p)):s())}s()});let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",u=>this[us](u,t)),t.pipe(o)),o.pipe(i)}[sB](t,r){let n=t.mode&4095||this.dmode;this[vp](t.absolute,n,i=>{if(i)return r(),this[us](i,t);let a=1,s=o=>{--a==0&&(r(),this[z0](),t.resume())};t.mtime&&!this.noMtime&&(a++,wn.utimes(t.absolute,t.atime||new Date,t.mtime,s)),this[iE](t)&&(a++,wn.chown(t.absolute,this[aE](t),this[sE](t),s)),s()})}[The](t){this.warn("unsupported entry type: "+t.type,t),t.resume()}[Dhe](t,r){this[ND](t,t.linkpath,"symlink",r)}[khe](t,r){let n=bo(Rf.resolve(this.cwd,t.linkpath));this[ND](t,n,"link",r)}[Phe](){this[BD]++}[z0](){this[BD]--,this[uB]()}[cB](t){this[z0](),t.resume()}[iB](t,r){return t.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!$0}[nB](t){this[Phe]();let r=[t.path];t.linkpath&&r.push(t.linkpath),this.reservations.reserve(r,n=>this[Ahe](t,n))}[LD](t){$0&&t.type==="SymbolicLink"?alt(this.dirCache):t.type!=="Directory"&&ilt(this.dirCache,t.absolute)}[Ahe](t,r){this[LD](t);let n=o=>{this[LD](t),r(o)},i=()=>{this[vp](this.cwd,this.dmode,o=>{if(o){this[us](o,t),n();return}this[oE]=!0,a()})},a=()=>{if(t.absolute!==this.cwd){let o=bo(Rf.dirname(t.absolute));if(o!==this.cwd)return this[vp](o,this.dmode,u=>{if(u){this[us](u,t),n();return}s()})}s()},s=()=>{wn.lstat(t.absolute,(o,u)=>{if(u&&(this.keep||this.newer&&u.mtime>t.mtime)){this[cB](t),n();return}if(o||this[iB](t,u))return this[Xo](null,t,n);if(u.isDirectory()){if(t.type==="Directory"){let c=!this.noChmod&&t.mode&&(u.mode&4095)!==t.mode,l=f=>this[Xo](f,t,n);return c?wn.chmod(t.absolute,t.mode,l):l()}if(t.absolute!==this.cwd)return wn.rmdir(t.absolute,c=>this[Xo](c,t,n))}if(t.absolute===this.cwd)return this[Xo](null,t,n);rlt(t.absolute,c=>this[Xo](c,t,n))})};this[oE]?a():i()}[Xo](t,r,n){if(t)return this[us](t,r);switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[aB](r,n);case"Link":return this[khe](r,n);case"SymbolicLink":return this[Dhe](r,n);case"Directory":case"GNUDumpDir":return this[sB](r,n)}}[ND](t,r,n,i){wn[n](r,t.absolute,a=>{if(a)return this[us](a,t);i(),this[z0](),t.resume()})}},UD=e=>{try{return[null,e()]}catch(t){return[t,null]}},jhe=class extends MD{[Xo](t,r){return super[Xo](t,r,()=>{})}[nB](t){if(this[LD](t),!this[oE]){let a=this[vp](this.cwd,this.dmode);if(a)return this[us](a,t);this[oE]=!0}if(t.absolute!==this.cwd){let a=bo(Rf.dirname(t.absolute));if(a!==this.cwd){let s=this[vp](a,this.dmode);if(s)return this[us](s,t)}}let[r,n]=UD(()=>wn.lstatSync(t.absolute));if(n&&(this.keep||this.newer&&n.mtime>t.mtime))return this[cB](t);if(r||this[iB](t,n))return this[Xo](null,t);if(n.isDirectory()){if(t.type==="Directory"){let s=!this.noChmod&&t.mode&&(n.mode&4095)!==t.mode,[o]=s?UD(()=>{wn.chmodSync(t.absolute,t.mode)}):[];return this[Xo](o,t)}let[a]=UD(()=>wn.rmdirSync(t.absolute));this[Xo](a,t)}let[i]=t.absolute===this.cwd?[]:UD(()=>nlt(t.absolute));this[Xo](i,t)}[aB](t,r){let n=t.mode&4095||this.fmode,i=u=>{let c;try{wn.closeSync(s)}catch(l){c=l}(u||c)&&this[us](u||c,t),r()},a,s;try{s=wn.openSync(t.absolute,"w",n)}catch(u){return i(u)}let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",u=>this[us](u,t)),t.pipe(o)),o.on("data",u=>{try{wn.writeSync(s,u,0,u.length)}catch(c){i(c)}}),o.on("end",u=>{let c=null;if(t.mtime&&!this.noMtime){let l=t.atime||new Date,f=t.mtime;try{wn.futimesSync(s,l,f)}catch(d){try{wn.utimesSync(t.absolute,l,f)}catch(p){c=d}}}if(this[iE](t)){let l=this[aE](t),f=this[sE](t);try{wn.fchownSync(s,l,f)}catch(d){try{wn.chownSync(t.absolute,l,f)}catch(p){c=c||d}}}i(c)})}[sB](t,r){let n=t.mode&4095||this.dmode,i=this[vp](t.absolute,n);if(i){this[us](i,t),r();return}if(t.mtime&&!this.noMtime)try{wn.utimesSync(t.absolute,t.atime||new Date,t.mtime)}catch(a){}if(this[iE](t))try{wn.chownSync(t.absolute,this[aE](t),this[sE](t))}catch(a){}r(),t.resume()}[vp](t,r){try{return rB.sync(bo(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r})}catch(n){return n}}[ND](t,r,n,i){try{wn[n+"Sync"](r,t.absolute),i(),t.resume()}catch(a){return this[us](a,t)}}};MD.Sync=jhe;xhe.exports=MD});var Mhe=y((Vir,qhe)=>{"use strict";var slt=A0(),zD=lB(),Lhe=require("fs"),Nhe=N0(),Bhe=require("path"),fB=P0(),Hir=qhe.exports=(e,t,r)=>{typeof e=="function"?(r=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t=="function"&&(r=t,t=null),t?t=Array.from(t):t=[];let n=slt(e);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return t.length&&olt(n,t),n.file&&n.sync?ult(n):n.file?clt(n,r):n.sync?llt(n):flt(n)},olt=(e,t)=>{let r=new Map(t.map(a=>[fB(a),!0])),n=e.filter,i=(a,s)=>{let o=s||Bhe.parse(a).root||".",u=a===o?!1:r.has(a)?r.get(a):i(Bhe.dirname(a),o);return r.set(a,u),u};e.filter=n?(a,s)=>n(a,s)&&i(fB(a)):a=>i(fB(a))},ult=e=>{let t=new zD.Sync(e),r=e.file,n=!0,i,a=Lhe.statSync(r),s=e.maxReadSize||16*1024*1024;new Nhe.ReadStreamSync(r,{readSize:s,size:a.size}).pipe(t)},clt=(e,t)=>{let r=new zD(e),n=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((s,o)=>{r.on("error",o),r.on("close",s),Lhe.stat(i,(u,c)=>{if(u)o(u);else{let l=new Nhe.ReadStream(i,{readSize:n,size:c.size});l.on("error",o),l.pipe(r)}})});return t?a.then(t,t):a},llt=e=>new zD.Sync(e),flt=e=>new zD(e)});var Uhe=y(oa=>{"use strict";oa.c=oa.create=Vpe();oa.r=oa.replace=Y6();oa.t=oa.list=PD();oa.u=oa.update=rhe();oa.x=oa.extract=Mhe();oa.Pack=ED();oa.Unpack=lB();oa.Parse=tE();oa.ReadEntry=W1();oa.WriteEntry=C6();oa.Header=R0();oa.Pax=sD();oa.types=nD()});var $he=y((Jir,zhe)=>{"use strict";var dB=require("events").listenerCount;dB=dB||function(e,t){var r=e&&e._events&&e._events[t];return Array.isArray(r)?r.length:typeof r=="function"?1:0};zhe.exports=dB});var Hhe=y((Wir,Ghe)=>{Ghe.exports=function(t){var r=process&&process.version?process.version:"v5.0.0",n=r.split(".")[0].replace("v","");return n<6?new Buffer(t):Buffer.from(t)}});var Khe=y(()=>{"use strict";var uE=Hhe();Buffer.prototype.indexOf||(Buffer.prototype.indexOf=function(e,t){t=t||0,typeof e=="string"||e instanceof String?e=uE(e):(typeof e=="number"||e instanceof Number)&&(e=uE([e]));for(var r=e.length,n=t;n<=this.length-r;n++){for(var i=!1,a=0;a<r;a++)if(this[n+a]!=e[a]){i=!0;break}if(!i)return n}return-1});function Vhe(e,t){typeof e=="string"||e instanceof String?e=uE(e):(typeof e=="number"||e instanceof Number)&&(e=uE([e]));var r=e.length;t=t||this.length-r;for(var n=t;n>=0;n--){for(var i=!1,a=0;a<r;a++)if(this[n+a]!=e[a]){i=!0;break}if(!i)return n}return-1}Buffer.prototype.lastIndexOf?uE("ABC").lastIndexOf("ABC")===-1&&(Buffer.prototype.lastIndexOf=Vhe):Buffer.prototype.lastIndexOf=Vhe});var Whe=y(Jhe=>{(function(e,t){"use strict";if(e.setImmediate)return;var r=1,n={},i=!1,a=e.document,s;function o(E){typeof E!="function"&&(E=new Function(""+E));for(var _=new Array(arguments.length-1),S=0;S<_.length;S++)_[S]=arguments[S+1];var F={callback:E,args:_};return n[r]=F,s(r),r++}function u(E){delete n[E]}function c(E){var _=E.callback,S=E.args;switch(S.length){case 0:_();break;case 1:_(S[0]);break;case 2:_(S[0],S[1]);break;case 3:_(S[0],S[1],S[2]);break;default:_.apply(t,S);break}}function l(E){if(i)setTimeout(l,0,E);else{var _=n[E];if(_){i=!0;try{c(_)}finally{u(E),i=!1}}}}function f(){s=function(E){process.nextTick(function(){l(E)})}}function d(){if(e.postMessage&&!e.importScripts){var E=!0,_=e.onmessage;return e.onmessage=function(){E=!1},e.postMessage("","*"),e.onmessage=_,E}}function p(){var E="setImmediate$"+Math.random()+"$",_=function(S){S.source===e&&typeof S.data=="string"&&S.data.indexOf(E)===0&&l(+S.data.slice(E.length))};e.addEventListener?e.addEventListener("message",_,!1):e.attachEvent("onmessage",_),s=function(S){e.postMessage(E+S,"*")}}function h(){var E=new MessageChannel;E.port1.onmessage=function(_){var S=_.data;l(S)},s=function(_){E.port2.postMessage(_)}}function g(){var E=a.documentElement;s=function(_){var S=a.createElement("script");S.onreadystatechange=function(){l(_),S.onreadystatechange=null,E.removeChild(S),S=null},E.appendChild(S)}}function v(){s=function(E){setTimeout(l,0,E)}}var b=Object.getPrototypeOf&&Object.getPrototypeOf(e);b=b&&b.setTimeout?b:e,{}.toString.call(e.process)==="[object process]"?f():d()?p():e.MessageChannel?h():a&&"onreadystatechange"in a.createElement("script")?g():v(),b.setImmediate=o,b.clearImmediate=u})(typeof self=="undefined"?typeof global=="undefined"?Jhe:global:self)});var Zhe=y((Zir,Yhe)=>{Yhe.exports=cs;function cs(e){if(!(this instanceof cs))return new cs(e);this.value=e}cs.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var n=e[r];if(!Object.hasOwnProperty.call(t,n)){t=void 0;break}t=t[n]}return t};cs.prototype.set=function(e,t){for(var r=this.value,n=0;n<e.length-1;n++){var i=e[n];Object.hasOwnProperty.call(r,i)||(r[i]={}),r=r[i]}return r[e[n]]=t,t};cs.prototype.map=function(e){return Qhe(this.value,e,!0)};cs.prototype.forEach=function(e){return this.value=Qhe(this.value,e,!1),this.value};cs.prototype.reduce=function(e,t){var r=arguments.length===1,n=r?this.value:t;return this.forEach(function(i){(!this.isRoot||!r)&&(n=e.call(this,n,i))}),n};cs.prototype.deepEqual=function(e){if(arguments.length!==1)throw new Error("deepEqual requires exactly one object to compare against");var t=!0,r=e;return this.forEach(function(n){var i=function(){t=!1}.bind(this);if(!this.isRoot){if(typeof r!="object")return i();r=r[this.key]}var a=r;this.post(function(){r=a});var s=function(f){return Object.prototype.toString.call(f)};if(this.circular)cs(e).get(this.circular.path)!==a&&i();else if(typeof a!=typeof n)i();else if(a===null||n===null||a===void 0||n===void 0)a!==n&&i();else if(a.__proto__!==n.__proto__)i();else if(a!==n){if(typeof a=="function")a instanceof RegExp?a.toString()!=n.toString()&&i():a!==n&&i();else if(typeof a=="object")if(s(n)==="[object Arguments]"||s(a)==="[object Arguments]")s(a)!==s(n)&&i();else if(a instanceof Date||n instanceof Date)(!(a instanceof Date)||!(n instanceof Date)||a.getTime()!==n.getTime())&&i();else{var o=Object.keys(a),u=Object.keys(n);if(o.length!==u.length)return i();for(var c=0;c<o.length;c++){var l=o[c];Object.hasOwnProperty.call(n,l)||i()}}}}),t};cs.prototype.paths=function(){var e=[];return this.forEach(function(t){e.push(this.path)}),e};cs.prototype.nodes=function(){var e=[];return this.forEach(function(t){e.push(this.node)}),e};cs.prototype.clone=function(){var e=[],t=[];return function r(n){for(var i=0;i<e.length;i++)if(e[i]===n)return t[i];if(typeof n=="object"&&n!==null){var a=Xhe(n);return e.push(n),t.push(a),Object.keys(n).forEach(function(s){a[s]=r(n[s])}),e.pop(),t.pop(),a}else return n}(this.value)};function Qhe(e,t,r){var n=[],i=[],a=!0;return function s(o){var u=r?Xhe(o):o,c={},l={node:u,node_:o,path:[].concat(n),parent:i.slice(-1)[0],key:n.slice(-1)[0],isRoot:n.length===0,level:n.length,circular:null,update:function(h){l.isRoot||(l.parent.node[l.key]=h),l.node=h},delete:function(){delete l.parent.node[l.key]},remove:function(){Array.isArray(l.parent.node)?l.parent.node.splice(l.key,1):delete l.parent.node[l.key]},before:function(h){c.before=h},after:function(h){c.after=h},pre:function(h){c.pre=h},post:function(h){c.post=h},stop:function(){a=!1}};if(!a)return l;if(typeof u=="object"&&u!==null){l.isLeaf=Object.keys(u).length==0;for(var f=0;f<i.length;f++)if(i[f].node_===o){l.circular=i[f];break}}else l.isLeaf=!0;l.notLeaf=!l.isLeaf,l.notRoot=!l.isRoot;var d=t.call(l,l.node);if(d!==void 0&&l.update&&l.update(d),c.before&&c.before.call(l,l.node),typeof l.node=="object"&&l.node!==null&&!l.circular){i.push(l);var p=Object.keys(l.node);p.forEach(function(h,g){n.push(h),c.pre&&c.pre.call(l,l.node[h],h);var v=s(l.node[h]);r&&Object.hasOwnProperty.call(l.node,h)&&(l.node[h]=v.node),v.isLast=g==p.length-1,v.isFirst=g==0,c.post&&c.post.call(l,v),n.pop()}),i.pop()}return c.after&&c.after.call(l,l.node),l}(e).node}Object.keys(cs.prototype).forEach(function(e){cs[e]=function(t){var r=[].slice.call(arguments,1),n=cs(t);return n[e].apply(n,r)}});function Xhe(e){if(typeof e=="object"&&e!==null){var t;return Array.isArray(e)?t=[]:e instanceof Date?t=new Date(e):e instanceof Boolean?t=new Boolean(e):e instanceof Number?t=new Number(e):e instanceof String?t=new String(e):t=Object.create(Object.getPrototypeOf(e)),Object.keys(e).forEach(function(r){t[r]=e[r]}),t}else return e}});var tme=y((ear,eme)=>{var dlt=Zhe(),plt=require("events").EventEmitter;eme.exports=G0;function G0(e){var t=G0.saw(e,{}),r=e.call(t.handlers,t);return r!==void 0&&(t.handlers=r),t.record(),t.chain()}G0.light=function(t){var r=G0.saw(t,{}),n=t.call(r.handlers,r);return n!==void 0&&(r.handlers=n),r.chain()};G0.saw=function(e,t){var r=new plt;return r.handlers=t,r.actions=[],r.chain=function(){var n=dlt(r.handlers).map(function(i){if(this.isRoot)return i;var a=this.path;typeof i=="function"&&this.update(function(){return r.actions.push({path:a,args:[].slice.call(arguments)}),n})});return process.nextTick(function(){r.emit("begin"),r.next()}),n},r.pop=function(){return r.actions.shift()},r.next=function(){var n=r.pop();if(!n)r.emit("end");else if(!n.trap){var i=r.handlers;n.path.forEach(function(a){i=i[a]}),i.apply(r.handlers,n.args)}},r.nest=function(n){var i=[].slice.call(arguments,1),a=!0;if(typeof n=="boolean"){var a=n;n=i.shift()}var s=G0.saw(e,{}),o=e.call(s.handlers,s);o!==void 0&&(s.handlers=o),typeof r.step!="undefined"&&s.record(),n.apply(s.chain(),i),a!==!1&&s.on("end",r.next)},r.record=function(){hlt(r)},["trap","down","jump"].forEach(function(n){r[n]=function(){throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.")}}),r};function hlt(e){e.step=0,e.pop=function(){return e.actions[e.step++]},e.trap=function(t,r){var n=Array.isArray(t)?t:[t];e.actions.push({path:n,step:e.step,cb:r,trap:!0})},e.down=function(t){var r=(Array.isArray(t)?t:[t]).join("/"),n=e.actions.slice(e.step).map(function(a){return a.trap&&a.step<=e.step?!1:a.path.join("/")==r}).indexOf(!0);n>=0?e.step+=n:e.step=e.actions.length;var i=e.actions[e.step-1];i&&i.trap?(e.step=i.step,i.cb()):e.next()},e.jump=function(t){e.step=t,e.next()}}});var nme=y((tar,rme)=>{rme.exports=Ds;function Ds(e){if(!(this instanceof Ds))return new Ds(e);this.buffers=e||[],this.length=this.buffers.reduce(function(t,r){return t+r.length},0)}Ds.prototype.push=function(){for(var e=0;e<arguments.length;e++)if(!Buffer.isBuffer(arguments[e]))throw new TypeError("Tried to push a non-buffer");for(var e=0;e<arguments.length;e++){var t=arguments[e];this.buffers.push(t),this.length+=t.length}return this.length};Ds.prototype.unshift=function(){for(var e=0;e<arguments.length;e++)if(!Buffer.isBuffer(arguments[e]))throw new TypeError("Tried to unshift a non-buffer");for(var e=0;e<arguments.length;e++){var t=arguments[e];this.buffers.unshift(t),this.length+=t.length}return this.length};Ds.prototype.copy=function(e,t,r,n){return this.slice(r,n).copy(e,t,0,n-r)};Ds.prototype.splice=function(e,t){var r=this.buffers,n=e>=0?e:this.length-e,i=[].slice.call(arguments,2);t===void 0?t=this.length-n:t>this.length-n&&(t=this.length-n);for(var e=0;e<i.length;e++)this.length+=i[e].length;for(var a=new Ds,s=0,o=0,u=0;u<r.length&&o+r[u].length<n;u++)o+=r[u].length;if(n-o>0){var c=n-o;if(c+t<r[u].length){a.push(r[u].slice(c,c+t));for(var l=r[u],f=new Buffer(c),e=0;e<c;e++)f[e]=l[e];for(var d=new Buffer(l.length-c-t),e=c+t;e<l.length;e++)d[e-t-c]=l[e];if(i.length>0){var p=i.slice();p.unshift(f),p.push(d),r.splice.apply(r,[u,1].concat(p)),u+=p.length,i=[]}else r.splice(u,1,f,d),u+=2}else a.push(r[u].slice(c)),r[u]=r[u].slice(0,c),u++}for(i.length>0&&(r.splice.apply(r,[u,0].concat(i)),u+=i.length);a.length<t;){var h=r[u],g=h.length,v=Math.min(g,t-a.length);v===g?(a.push(h),r.splice(u,1)):(a.push(h.slice(0,v)),r[u]=r[u].slice(v))}return this.length-=a.length,a};Ds.prototype.slice=function(e,t){var r=this.buffers;t===void 0&&(t=this.length),e===void 0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=0;i<r.length&&n+r[i].length<=e;i++)n+=r[i].length;for(var a=new Buffer(t-e),s=0,o=i;s<t-e&&o<r.length;o++){var u=r[o].length,c=s===0?e-n:0,l=s+u>=t-e?Math.min(c+(t-e)-s,u):u;r[o].copy(a,s,c,l),s+=l-c}return a};Ds.prototype.pos=function(e){if(e<0||e>=this.length)throw new Error("oob");for(var t=e,r=0,n=null;;){if(n=this.buffers[r],t<n.length)return{buf:r,offset:t};t-=n.length,r++}};Ds.prototype.get=function(t){var r=this.pos(t);return this.buffers[r.buf].get(r.offset)};Ds.prototype.set=function(t,r){var n=this.pos(t);return this.buffers[n.buf].set(n.offset,r)};Ds.prototype.indexOf=function(e,t){if(typeof e=="string")e=new Buffer(e);else if(!(e instanceof Buffer))throw new Error("Invalid type for a search string");if(!e.length)return 0;if(!this.length)return-1;var r=0,n=0,i=0,a,s=0;if(t){var o=this.pos(t);r=o.buf,n=o.offset,s=t}for(;;){for(;n>=this.buffers[r].length;)if(n=0,r++,r>=this.buffers.length)return-1;var u=this.buffers[r][n];if(u==e[i]){if(i==0&&(a={i:r,j:n,pos:s}),i++,i==e.length)return a.pos}else i!=0&&(r=a.i,n=a.j,s=a.pos,i=0);n++,s++}};Ds.prototype.toBuffer=function(){return this.slice()};Ds.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)}});var ame=y((rar,ime)=>{ime.exports=function(e){function t(n,i){var a=r.store,s=n.split(".");s.slice(0,-1).forEach(function(u){a[u]===void 0&&(a[u]={}),a=a[u]});var o=s[s.length-1];return arguments.length==1?a[o]:a[o]=i}var r={get:function(n){return t(n)},set:function(n,i){return t(n,i)},store:e||{}};return r}});var cE=y((Im,sme)=>{var mlt=tme(),ome=require("events").EventEmitter,glt=nme(),$D=ame(),vlt=require("stream").Stream;Im=sme.exports=function(e,t){if(Buffer.isBuffer(e))return Im.parse(e);var r=Im.stream();return e&&e.pipe?e.pipe(r):e&&(e.on(t||"data",function(n){r.write(n)}),e.on("end",function(){r.end()})),r};Im.stream=function(e){if(e)return Im.apply(null,arguments);var t=null;function r(f,d,p){t={bytes:f,skip:p,cb:function(h){t=null,d(h)}},i()}var n=null;function i(){if(!t){l&&(c=!0);return}if(typeof t=="function")t();else{var f=n+t.bytes;if(o.length>=f){var d;n==null?(d=o.splice(0,f),t.skip||(d=d.slice())):(t.skip||(d=o.slice(n,f)),n=f),t.skip?t.cb():t.cb(d)}}}function a(f){function d(){c||f.next()}var p=ume(function(h,g){return function(v){r(h,function(b){u.set(v,g(b)),d()})}});return p.tap=function(h){f.nest(h,u.store)},p.into=function(h,g){u.get(h)||u.set(h,{});var v=u;u=$D(v.get(h)),f.nest(function(){g.apply(this,arguments),this.tap(function(){u=v})},u.store)},p.flush=function(){u.store={},d()},p.loop=function(h){var g=!1;f.nest(!1,function v(){this.vars=u.store,h.call(this,function(){g=!0,d()},u.store),this.tap(function(){g?f.next():v.call(this)}.bind(this))},u.store)},p.buffer=function(h,g){typeof g=="string"&&(g=u.get(g)),r(g,function(v){u.set(h,v),d()})},p.skip=function(h){typeof h=="string"&&(h=u.get(h)),r(h,function(){d()})},p.scan=function(g,v){if(typeof v=="string")v=new Buffer(v);else if(!Buffer.isBuffer(v))throw new Error("search must be a Buffer or a string");var b=0;t=function(){var E=o.indexOf(v,n+b),_=E-n-b;E!==-1?(t=null,n!=null?(u.set(g,o.slice(n,n+b+_)),n+=b+_+v.length):(u.set(g,o.slice(0,b+_)),o.splice(0,b+_+v.length)),d(),i()):_=Math.max(o.length-v.length-n-b,0),b+=_},i()},p.peek=function(h){n=0,f.nest(function(){h.call(this,u.store),this.tap(function(){n=null})})},p}var s=mlt.light(a);s.writable=!0;var o=glt();s.write=function(f){o.push(f),i()};var u=$D(),c=!1,l=!1;return s.end=function(){l=!0},s.pipe=vlt.prototype.pipe,Object.getOwnPropertyNames(ome.prototype).forEach(function(f){s[f]=ome.prototype[f]}),s};Im.parse=function(t){var r=ume(function(a,s){return function(o){if(n+a<=t.length){var u=t.slice(n,n+a);n+=a,i.set(o,s(u))}else i.set(o,null);return r}}),n=0,i=$D();return r.vars=i.store,r.tap=function(a){return a.call(r,i.store),r},r.into=function(a,s){i.get(a)||i.set(a,{});var o=i;return i=$D(o.get(a)),s.call(r,i.store),i=o,r},r.loop=function(a){for(var s=!1,o=function(){s=!0};s===!1;)a.call(r,o,i.store);return r},r.buffer=function(a,s){typeof s=="string"&&(s=i.get(s));var o=t.slice(n,Math.min(t.length,n+s));return n+=s,i.set(a,o),r},r.skip=function(a){return typeof a=="string"&&(a=i.get(a)),n+=a,r},r.scan=function(a,s){if(typeof s=="string")s=new Buffer(s);else if(!Buffer.isBuffer(s))throw new Error("search must be a Buffer or a string");i.set(a,null);for(var o=0;o+n<=t.length-s.length+1;o++){for(var u=0;u<s.length&&t[n+o+u]===s[u];u++);if(u===s.length)break}return i.set(a,t.slice(n,n+o)),n+=o+s.length,r},r.peek=function(a){var s=n;return a.call(r,i.store),n=s,r},r.flush=function(){return i.store={},r},r.eof=function(){return n>=t.length},r};function cme(e){for(var t=0,r=0;r<e.length;r++)t+=Math.pow(256,r)*e[r];return t}function lme(e){for(var t=0,r=0;r<e.length;r++)t+=Math.pow(256,e.length-r-1)*e[r];return t}function ylt(e){var t=lme(e);return(e[0]&128)==128&&(t-=Math.pow(256,e.length)),t}function blt(e){var t=cme(e);return(e[e.length-1]&128)==128&&(t-=Math.pow(256,e.length)),t}function ume(e){var t={};return[1,2,4,8].forEach(function(r){var n=r*8;t["word"+n+"le"]=t["word"+n+"lu"]=e(r,cme),t["word"+n+"ls"]=e(r,blt),t["word"+n+"be"]=t["word"+n+"bu"]=e(r,lme),t["word"+n+"bs"]=e(r,ylt)}),t.word8=t.word8u=t.word8be,t.word8s=t.word8bs,t}});var Om=y((nar,pB)=>{var hB=function(){"use strict";return this===void 0}();hB?pB.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:hB,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!!(!r||r.writable||r.set)}}:(fme={}.hasOwnProperty,dme={}.toString,pme={}.constructor.prototype,mB=function(e){var t=[];for(var r in e)fme.call(e,r)&&t.push(r);return t},hme=function(e,t){return{value:e[t]}},mme=function(e,t,r){return e[t]=r.value,e},gme=function(e){return e},vme=function(e){try{return Object(e).constructor.prototype}catch(t){return pme}},yme=function(e){try{return dme.call(e)==="[object Array]"}catch(t){return!1}},pB.exports={isArray:yme,keys:mB,names:mB,defineProperty:mme,getDescriptor:hme,freeze:gme,getPrototypeOf:vme,isES5:hB,propertyIsWritable:function(){return!0}});var fme,dme,pme,mB,hme,mme,gme,vme,yme});var Un=y((exports,module)=>{"use strict";var es5=Om(),canEvaluate=typeof navigator=="undefined",errorObj={e:{}},tryCatchTarget,globalObject=typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:exports!==void 0?exports:null;function tryCatcher(){try{var e=tryCatchTarget;return tryCatchTarget=null,e.apply(this,arguments)}catch(t){return errorObj.e=t,errorObj}}function tryCatch(e){return tryCatchTarget=e,tryCatcher}var inherits=function(e,t){var r={}.hasOwnProperty;function n(){this.constructor=e,this.constructor$=t;for(var i in t.prototype)r.call(t.prototype,i)&&i.charAt(i.length-1)!=="$"&&(this[i+"$"]=t.prototype[i])}return n.prototype=t.prototype,e.prototype=new n,e.prototype};function isPrimitive(e){return e==null||e===!0||e===!1||typeof e=="string"||typeof e=="number"}function isObject(e){return typeof e=="function"||typeof e=="object"&&e!==null}function maybeWrapAsError(e){return isPrimitive(e)?new Error(safeToString(e)):e}function withAppended(e,t){var r=e.length,n=new Array(r+1),i;for(i=0;i<r;++i)n[i]=e[i];return n[i]=t,n}function getDataPropertyOrDefault(e,t,r){if(es5.isES5){var n=Object.getOwnPropertyDescriptor(e,t);if(n!=null)return n.get==null&&n.set==null?n.value:r}else return{}.hasOwnProperty.call(e,t)?e[t]:void 0}function notEnumerableProp(e,t,r){if(isPrimitive(e))return e;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return es5.defineProperty(e,t,n),e}function thrower(e){throw e}var inheritedDataKeys=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(i){for(var a=0;a<e.length;++a)if(e[a]===i)return!0;return!1};if(es5.isES5){var r=Object.getOwnPropertyNames;return function(i){for(var a=[],s=Object.create(null);i!=null&&!t(i);){var o;try{o=r(i)}catch(f){return a}for(var u=0;u<o.length;++u){var c=o[u];if(!s[c]){s[c]=!0;var l=Object.getOwnPropertyDescriptor(i,c);l!=null&&l.get==null&&l.set==null&&a.push(c)}}i=es5.getPrototypeOf(i)}return a}}else{var n={}.hasOwnProperty;return function(i){if(t(i))return[];var a=[];e:for(var s in i)if(n.call(i,s))a.push(s);else{for(var o=0;o<e.length;++o)if(n.call(e[o],s))continue e;a.push(s)}return a}}}(),thisAssignmentPattern=/this\s*\.\s*\S+\s*=/;function isClass(e){try{if(typeof e=="function"){var t=es5.names(e.prototype),r=es5.isES5&&t.length>1,n=t.length>0&&!(t.length===1&&t[0]==="constructor"),i=thisAssignmentPattern.test(e+"")&&es5.names(e).length>0;if(r||n||i)return!0}return!1}catch(a){return!1}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;for(var l=8;l--;)new FakeConstructor;return obj}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(e){return rident.test(e)}function filledRange(e,t,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=t+i+r;return n}function safeToString(e){try{return e+""}catch(t){return"[no string representation]"}}function isError(e){return e!==null&&typeof e=="object"&&typeof e.message=="string"&&typeof e.name=="string"}function markAsOriginatingFromRejection(e){try{notEnumerableProp(e,"isOperational",!0)}catch(t){}}function originatesFromRejection(e){return e==null?!1:e instanceof Error.__BluebirdErrorTypes__.OperationalError||e.isOperational===!0}function canAttachTrace(e){return isError(e)&&es5.propertyIsWritable(e,"stack")}var ensureErrorObject=function(){return"stack"in new Error?function(e){return canAttachTrace(e)?e:new Error(safeToString(e))}:function(e){if(canAttachTrace(e))return e;try{throw new Error(safeToString(e))}catch(t){return t}}}();function classString(e){return{}.toString.call(e)}function copyDescriptors(e,t,r){for(var n=es5.names(e),i=0;i<n.length;++i){var a=n[i];if(r(a))try{es5.defineProperty(t,a,es5.getDescriptor(e,a))}catch(s){}}}var asArray=function(e){return es5.isArray(e)?e:null};typeof Symbol!="undefined"&&Symbol.iterator&&(ArrayFrom=typeof Array.from=="function"?function(e){return Array.from(e)}:function(e){for(var t=[],r=e[Symbol.iterator](),n;!(n=r.next()).done;)t.push(n.value);return t},asArray=function(e){return es5.isArray(e)?e:e!=null&&typeof e[Symbol.iterator]=="function"?ArrayFrom(e):null});var ArrayFrom,isNode=typeof process!="undefined"&&classString(process).toLowerCase()==="[object process]",hasEnvVariables=typeof process!="undefined"&&typeof process.env!="undefined";function env(e){return hasEnvVariables?process.env[e]:void 0}function getNativePromise(){if(typeof Promise=="function")try{var e=new Promise(function(){});if({}.toString.call(e)==="[object Promise]")return Promise}catch(t){}}function domainBind(e,t){return e.bind(t)}var ret={isClass,isIdentifier,inheritedDataKeys,getDataPropertyOrDefault,thrower,isArray:es5.isArray,asArray,notEnumerableProp,isPrimitive,isObject,isError,canEvaluate,errorObj,tryCatch,inherits,withAppended,maybeWrapAsError,toFastProperties,filledRange,toString:safeToString,canAttachTrace,ensureErrorObject,originatesFromRejection,markAsOriginatingFromRejection,classString,copyDescriptors,hasDevTools:typeof chrome!="undefined"&&chrome&&typeof chrome.loadTimes=="function",isNode,hasEnvVariables,env,global:globalObject,getNativePromise,domainBind};ret.isRecentNode=ret.isNode&&function(){var e=process.versions.node.split(".").map(Number);return e[0]===0&&e[1]>10||e[0]>0}();ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(e){ret.lastLineError=e}module.exports=ret});var xme=y((iar,bme)=>{"use strict";var gB=Un(),jm,wlt=function(){throw new Error(`No async scheduler available
|
|
257
257
|
|
|
@@ -635,39 +635,39 @@ ${u}`}else a=zH(fC,t.name);let s=`${n}${a}
|
|
|
635
635
|
|
|
636
636
|
${i.replace(/^/gm,n)}
|
|
637
637
|
|
|
638
|
-
`,o=r?.index??e.length;return e.slice(0,o)+s+e.slice(o)}var YLt=8;function QLt(e){let t=`- ${e.title}`;if(!e.hasPRinTitle){let r=e.pr?`#${e.pr}`:e.hash.slice(0,YLt);t=`${t} (${r})`}return t}async function ELe(e,t){let r=(await gLe(e,t)).filter(({body:l})=>!l.includes(vLe)),n=await XLt(r.map(({hash:l})=>l)),i={},a={},s=[],o=[];for(let l of r){let f=l.hash,d=n[f];if(d?.prBody?.includes(vLe))continue;let p=a[f]=m({hash:f,title:l.title,hasPRinTitle:Boolean(l.pr)},d);if(d||o.push(p),!p.milestone)s.push(p);else{let h=i[p.milestone]||{prs:[]};h.prs.push(p.pr),i[p.milestone]=h}}o.length>0&&ke.warn("The following commits were not found on GitHub:",o.map(l=>`${l.hash.slice(0,8)} ${l.title}`));let u=await ZLt(Object.keys(i)),c=[];for(let l of Object.keys(i)){let f=u[l];if(f==null)throw new Error(`Cannot get information for milestone #${l}`);c.push(zH(UH,`${f.title}${f.state==="OPEN"?" (ongoing)":""}`)),f.description
|
|
638
|
+
`,o=r?.index??e.length;return e.slice(0,o)+s+e.slice(o)}var YLt=8;function QLt(e){let t=`- ${e.title}`;if(!e.hasPRinTitle){let r=e.pr?`#${e.pr}`:e.hash.slice(0,YLt);t=`${t} (${r})`}return t}async function ELe(e,t){let r=(await gLe(e,t)).filter(({body:l})=>!l.includes(vLe)),n=await XLt(r.map(({hash:l})=>l)),i={},a={},s=[],o=[];for(let l of r){let f=l.hash,d=n[f];if(d?.prBody?.includes(vLe))continue;let p=a[f]=m({hash:f,title:l.title,hasPRinTitle:Boolean(l.pr)},d);if(d||o.push(p),!p.milestone)s.push(p);else{let h=i[p.milestone]||{prs:[]};h.prs.push(p.pr),i[p.milestone]=h}}o.length>0&&ke.warn("The following commits were not found on GitHub:",o.map(l=>`${l.hash.slice(0,8)} ${l.title}`));let u=await ZLt(Object.keys(i)),c=[];for(let l of Object.keys(i)){let f=u[l];if(f==null)throw new Error(`Cannot get information for milestone #${l}`);c.push(zH(UH,`${f.title}${f.state==="OPEN"?" (ongoing)":""}`)),f.description&&c.push(yLe(f.description)),c.push(`PRs: ${i[l].prs.map(d=>`#${d}`).join(", ")}`)}return s.length>0&&(c.push(zH(UH,"Various fixes & improvements")),c.push(s.map(QLt).join(`
|
|
639
639
|
`))),c.join(`
|
|
640
640
|
|
|
641
|
-
`)}async function XLt(e){if(e.length===0)return{};let t=e.map(
|
|
642
|
-
`),{repo:r,owner:n}=await Su(),i
|
|
643
|
-
|
|
644
|
-
|
|
641
|
+
`)}async function XLt(e){if(e.length===0)return{};let t=e.map(s=>`C${s}: object(oid: "${s}") {...PRFragment}`).join(`
|
|
642
|
+
`),{repo:r,owner:n}=await Su(),i=`{
|
|
643
|
+
repository(name: "${r}", owner: "${n}") {
|
|
644
|
+
${t}
|
|
645
|
+
}
|
|
645
646
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
nodes {
|
|
651
|
-
number
|
|
652
|
-
body
|
|
653
|
-
milestone {
|
|
647
|
+
|
|
648
|
+
fragment PRFragment on Commit {
|
|
649
|
+
associatedPullRequests(first: 1) {
|
|
650
|
+
nodes {
|
|
654
651
|
number
|
|
652
|
+
body
|
|
653
|
+
milestone {
|
|
654
|
+
number
|
|
655
|
+
}
|
|
655
656
|
}
|
|
656
657
|
}
|
|
658
|
+
}`;ke.trace("Running graphql query:",i);let a=(await Ni().graphql(i)).repository;return ke.trace("Query result:",a),Object.fromEntries(Object.entries(a).map(([s,o])=>{let u=o?.associatedPullRequests.nodes[0];return[s.slice(1),u?{pr:u.number,prBody:u.body,milestone:u.milestone?.number??null}:{pr:null,prBody:null,milestone:null}]}))}async function ZLt(e){if(e.length===0)return{};let t=e.map(s=>`M${s}: milestone(number: ${s}) {...MilestoneFragment}`).join(`
|
|
659
|
+
`),{repo:r,owner:n}=await Su(),i=`{
|
|
660
|
+
repository(name: "${r}", owner: "${n}") {
|
|
661
|
+
${t}
|
|
662
|
+
}
|
|
657
663
|
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
664
|
+
|
|
665
|
+
fragment MilestoneFragment on Milestone {
|
|
666
|
+
title
|
|
667
|
+
description
|
|
668
|
+
state
|
|
662
669
|
}
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
fragment MilestoneFragment on Milestone {
|
|
666
|
-
title
|
|
667
|
-
description
|
|
668
|
-
state
|
|
669
|
-
}
|
|
670
|
-
`)).repository;return Object.fromEntries(Object.entries(i).map(([a,s])=>[a.slice(1),s]))}var EJ={};Nh(EJ,{aliases:()=>HWt,builder:()=>JWt,command:()=>GWt,description:()=>VWt,handler:()=>xJ,publishMain:()=>fUe,runPostReleaseCommand:()=>lUe});var sUe=Ct(iI()),Fh=Ct(require("fs")),oUe=Ct(require("path")),uUe=Ct(NH()),cUe=Ct(kLe());var RLe=Ct(HH());var jr=class{static getId(t){return t.id?`${t.name}[${t.id}]`:t.name||"__undefined__"}constructor(t,r,n){this.logger=ke.withScope(`[target/${t.name}]`),this.artifactProvider=r,this.config=t,this.id=jr.getId(t),this.githubRepo=n,this.filterOptions={},this.config.includeNames&&(this.filterOptions.includeNames=Ws(this.config.includeNames)),this.config.excludeNames&&(this.filterOptions.excludeNames=Ws(this.config.excludeNames))}async publish(t,r){throw new Error("Not implemented")}async getArtifactsForRevision(t,r={}){let n=m(m({},abe(r)),this.filterOptions);return this.logger.debug(`Getting artifact list for revision "${t}", filtering options: {includeNames: ${String(n.includeNames)}, excludeNames:${String(n.excludeNames)}}`),this.artifactProvider.filterArtifactsForRevision(t,n)}};var n5t=/^([a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/([-_.\w\d]+)$/i,VH=class extends jr{constructor(t,r,n){super(t,r,n);this.name="brew";this.brewConfig=this.getBrewConfig(),this.github=Ni(),this.githubRepo=n}getBrewConfig(){let t=this.config.template;if(!t)throw new Rt('Please specify Formula template in the "brew" target configuration.');let{formula:r,path:n}=this.config;return{formula:r,path:n,tapRepo:this.getTapRepo(),template:t}}getTapRepo(){let{tap:t}=this.config;if(!t)return{owner:"homebrew",repo:"homebrew-core"};let r=n5t.exec(t);if(!r)throw new Rt(`Invalid tap name: ${t}`);return{owner:r[1],repo:`homebrew-${r[2]}`}}async getFormulaSha(t){try{let r=this.brewConfig.tapRepo;this.logger.debug(`Loading SHA for ${r.owner}/${r.repo}:${t}`);let n=await this.github.repos.getContent(m(m({},r),{path:t}));return n.data instanceof Array?void 0:n.data.sha}catch(r){if(r.status===404)return;throw r}}async publish(t,r){let{formula:n,path:i,template:a,tapRepo:s}=this.brewConfig,{owner:o,repo:u}=this.githubRepo,c=n||u,l=i?`${i}/${c}.rb`:`Formula/${c}.rb`,f=await this.getArtifactsForRevision(r);this.logger.debug("Downloading artifacts for the revision"),this.logger.trace(f.map(v=>v.filename));let d={};await(0,RLe.mapLimit)(f,jk,async v=>{d[v.filename]=await this.artifactProvider.getChecksum(v,Km.SHA256,Lf.Hex)});let p=dc(a,{checksums:d,revision:r,version:t});if(this.logger.debug(`Homebrew formula for ${c}:
|
|
670
|
+
`;ke.trace("Running graphql query:",i);let a=(await Ni().graphql(i)).repository;return ke.trace("Query result:",a),Object.fromEntries(Object.entries(a).map(([s,o])=>[s.slice(1),o]))}var EJ={};Nh(EJ,{aliases:()=>HWt,builder:()=>JWt,command:()=>GWt,description:()=>VWt,handler:()=>xJ,publishMain:()=>fUe,runPostReleaseCommand:()=>lUe});var sUe=Ct(iI()),Fh=Ct(require("fs")),oUe=Ct(require("path")),uUe=Ct(NH()),cUe=Ct(kLe());var RLe=Ct(HH());var jr=class{static getId(t){return t.id?`${t.name}[${t.id}]`:t.name||"__undefined__"}constructor(t,r,n){this.logger=ke.withScope(`[target/${t.name}]`),this.artifactProvider=r,this.config=t,this.id=jr.getId(t),this.githubRepo=n,this.filterOptions={},this.config.includeNames&&(this.filterOptions.includeNames=Ws(this.config.includeNames)),this.config.excludeNames&&(this.filterOptions.excludeNames=Ws(this.config.excludeNames))}async publish(t,r){throw new Error("Not implemented")}async getArtifactsForRevision(t,r={}){let n=m(m({},abe(r)),this.filterOptions);return this.logger.debug(`Getting artifact list for revision "${t}", filtering options: {includeNames: ${String(n.includeNames)}, excludeNames:${String(n.excludeNames)}}`),this.artifactProvider.filterArtifactsForRevision(t,n)}};var n5t=/^([a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38})\/([-_.\w\d]+)$/i,VH=class extends jr{constructor(t,r,n){super(t,r,n);this.name="brew";this.brewConfig=this.getBrewConfig(),this.github=Ni(),this.githubRepo=n}getBrewConfig(){let t=this.config.template;if(!t)throw new Rt('Please specify Formula template in the "brew" target configuration.');let{formula:r,path:n}=this.config;return{formula:r,path:n,tapRepo:this.getTapRepo(),template:t}}getTapRepo(){let{tap:t}=this.config;if(!t)return{owner:"homebrew",repo:"homebrew-core"};let r=n5t.exec(t);if(!r)throw new Rt(`Invalid tap name: ${t}`);return{owner:r[1],repo:`homebrew-${r[2]}`}}async getFormulaSha(t){try{let r=this.brewConfig.tapRepo;this.logger.debug(`Loading SHA for ${r.owner}/${r.repo}:${t}`);let n=await this.github.repos.getContent(m(m({},r),{path:t}));return n.data instanceof Array?void 0:n.data.sha}catch(r){if(r.status===404)return;throw r}}async publish(t,r){let{formula:n,path:i,template:a,tapRepo:s}=this.brewConfig,{owner:o,repo:u}=this.githubRepo,c=n||u,l=i?`${i}/${c}.rb`:`Formula/${c}.rb`,f=await this.getArtifactsForRevision(r);this.logger.debug("Downloading artifacts for the revision"),this.logger.trace(f.map(v=>v.filename));let d={};await(0,RLe.mapLimit)(f,jk,async v=>{d[v.filename]=await this.artifactProvider.getChecksum(v,Km.SHA256,Lf.Hex)});let p=dc(a,{checksums:d,revision:r,version:t});if(this.logger.debug(`Homebrew formula for ${c}:
|
|
671
671
|
${p}`),s.owner!==o){this.logger.warn("Skipping homebrew release: PRs not supported yet");return}let h={content:Buffer.from(p).toString("base64"),message:`release: ${c} ${t}`,owner:s.owner,path:l,repo:s.repo,sha:await this.getFormulaSha(l)||""};this.logger.info(`Releasing ${o}/${u} tag ${t} to homebrew tap ${s.owner}/${s.repo} formula ${c}`);let g=h.sha?"Updating":"Creating";this.logger.debug(`${g} file ${h.owner}/${h.repo}:${h.path} (${h.sha})`),Vr()?this.logger.info(`[dry-run] Skipping file action: ${g}`):await this.github.repos.createOrUpdateFileContents(h),this.logger.info("Homebrew release complete")}};var PLe=Ct(require("fs")),UI=Ct(require("path")),FLe=Ct(require("util"));var i5t=(0,FLe.promisify)(PLe.writeFile),a5t="pod",KH=process.env.COCOAPODS_BIN||a5t,JH=class extends jr{constructor(t,r,n){super(t,r,n);this.name="cocoapods";this.cocoapodsConfig=this.getCocoapodsConfig(),this.github=Ni(),this.githubRepo=n,xa(KH)}getCocoapodsConfig(){let t=this.config.specPath;if(!t)throw new Rt("No podspec path provided!");return{specPath:t}}async publish(t,r){let{owner:n,repo:i}=this.githubRepo,a=this.cocoapodsConfig.specPath;this.logger.info(`Loading podspec from ${n}/${i}:${a}`);let s=await hwe(this.github,n,i,a,r);if(!s){pr(`Podspec not found at ${n}/${i}:${a}`);return}let o=(0,UI.basename)(a);await Ki(async u=>{let c=(0,UI.join)(u,o);await i5t(c,s,"utf8"),this.logger.info(`Pushing podspec "${o}" to cocoapods...`),await zn(KH,["setup"]),await zn(KH,["trunk","push",o,"--allow-warnings"],{cwd:u,env:m({},process.env)})},!0,"craft-cocoapods-"),this.logger.info("Cocoapods release complete")}};var ILe=Ct(require("fs")),OLe=Ct(require("path")),jLe=Ct(Kd());var s5t="cargo",WH=process.env.CARGO_BIN||s5t,o5t="failed to select a version for the requirement",u5t=5,c5t=2,l5t=2,YH=class extends jr{constructor(t,r,n){super(t,r,n);this.name="crates";this.cratesConfig=this.getCratesConfig(),xa(WH),this.githubRepo=n}getCratesConfig(){if(!process.env.CRATES_IO_TOKEN)throw new Rt(`Cannot publish to Crates.io: missing credentials.
|
|
672
672
|
Please use CRATES_IO_TOKEN environment variable to pass the API token.`);return{apiToken:process.env.CRATES_IO_TOKEN,noDevDeps:!!this.config.noDevDeps}}async getCrateMetadata(t){let r=["metadata","--manifest-path",`${t}/Cargo.toml`,"--no-deps","--format-version=1"];this.logger.info(`Loading workspace information from ${t}/Cargo.toml`);let n=await zn(WH,r,{},{enableInDryRunMode:!0});if(!n)throw new Rt("Empty Cargo metadata!");return JSON.parse(n.toString())}getPublishOrder(t){let r=t.reduce((a,s)=>(a[s.name]=s,a),{}),n=[],i=a=>this.cratesConfig.noDevDeps&&a.kind==="dev"?!1:!!r[a.name];for(;Object.keys(r).length>0;){let a=Object.values(r).filter(s=>s.dependencies.filter(i).length===0);if(a.length===0)throw new Error("Circular dependency detected!");a.forEach(s=>{n.push(s),delete r[s.name]})}return n}async publishWorkspace(t){let r=await this.getCrateMetadata(t),n=r.packages.filter(a=>r.workspace_members.indexOf(a.id)>-1).filter(a=>!a.publish||a.publish.length),i=this.getPublishOrder(n);return this.logger.debug(`Publishing packages in the following order: ${i.map(a=>a.name).join(", ")}`),Gk(i,async a=>this.publishPackage(a))}async publishPackage(t){let r=this.cratesConfig.noDevDeps?["hack","publish","--allow-dirty","--no-dev-deps"]:["publish"];r.push("--no-verify","--manifest-path",t.manifest_path);let n=m(m({},process.env),{CARGO_REGISTRY_TOKEN:this.cratesConfig.apiToken}),i=c5t;this.logger.info(`Publishing ${t.name}`),await WE(()=>zn(WH,r,{env:n}),u5t,async a=>a.message.includes(o5t)?(this.logger.warn(`Publish failed, trying again in ${i}s...`),await Ym(i*1e3),i*=l5t,!0):!1)}async cloneWithSubmodules(t,r,n){let{owner:i,repo:a}=t,s=(0,jLe.default)(n),o=`https://github.com/${i}/${a}.git`;this.logger.info(`Cloning ${i}/${a} into ${n}`),await s.clone(o,n),await s.checkout(r),this.logger.info("Checking out submodules"),await s.submoduleUpdate(["--init"]);let u=OLe.join(n,".git");ILe.renameSync(u,`${u}.bak`)}async publish(t,r){await Ki(async n=>{await this.cloneWithSubmodules(this.githubRepo,r,n),await this.publishWorkspace(n)},!0,"craft-crates-"),this.logger.info("Crates release complete")}};var f5t="docker",dC=process.env.DOCKER_BIN||f5t,QH=class extends jr{constructor(t,r){super(t,r);this.name="docker";this.dockerConfig=this.getDockerConfig(),xa(dC)}getDockerConfig(){if(!process.env.DOCKER_USERNAME||!process.env.DOCKER_PASSWORD)throw new Rt(`Cannot perform Docker release: missing credentials.
|
|
673
673
|
Please use DOCKER_USERNAME and DOCKER_PASSWORD environment variables.`.replace(/^\s+/gm,""));return{password:process.env.DOCKER_PASSWORD,source:this.config.source,target:this.config.target,sourceTemplate:this.config.sourceFormat||"{{{source}}}:{{{revision}}}",targetTemplate:this.config.targetFormat||"{{{target}}}:{{{version}}}",username:process.env.DOCKER_USERNAME}}async login(){let{username:t,password:r}=this.dockerConfig;return zn(dC,["login",`--username=${t}`,`--password=${r}`])}async pull(t){this.logger.debug("Pulling source image...");let r=dc(this.dockerConfig.sourceTemplate,m(m({},this.dockerConfig),{revision:t}));return zn(dC,["pull",r],{},{enableInDryRunMode:!0})}async push(t,r){let n=dc(this.dockerConfig.sourceTemplate,m(m({},this.dockerConfig),{revision:t})),i=dc(this.dockerConfig.targetTemplate,m(m({},this.dockerConfig),{version:r}));return this.logger.debug("Tagging target image..."),await zn(dC,["tag",n,i]),zn(dC,["push",i],{},{showStdout:!0})}async publish(t,r){await this.login(),await this.pull(r),await this.push(r,t),this.logger.info("Docker release complete")}};var XH=class extends jr{constructor(t,r){super(t,r);this.name="gcs";this.targetConfig=this.getGCSTargetConfig(),this.gcsClient=new Wx(this.targetConfig)}getGCSTargetConfig(){let{project_id:t,client_email:r,private_key:n}=ZF({name:"CRAFT_GCS_TARGET_CREDS_JSON",legacyName:"CRAFT_GCS_CREDENTIALS_JSON"},{name:"CRAFT_GCS_TARGET_CREDS_PATH",legacyName:"CRAFT_GCS_CREDENTIALS_PATH"}),i=this.config.bucket;i||pr("No GCS bucket provided!");let a=this.parseRawPathConfig(this.config.paths);return{bucketName:i,credentials:{client_email:r,private_key:n},pathTemplates:a,projectId:t}}parseRawPathConfig(t){let r=[];return!t||t.length&&t.length===0?pr("No bucket paths provided!"):typeof t=="string"?r=[{template:t}]:Array.isArray(t)?t.forEach(n=>{typeof n!="object"&&pr(`Invalid bucket destination: ${JSON.stringify(n)}. Use object notation to specify bucket paths!`);let{path:i,metadata:a}=n;i||pr(`Invalid bucket path template: ${i}`),a&&typeof a!="object"&&pr(`Invalid metadata for path "${i}": "${JSON.stringify(a)}. Use object notation to specify metadata!"`),r.push({metadata:a,template:i})}):pr("Cannot parse GCS target's path configuration!"),r}materializePathTemplate(t,r,n){let{template:i,metadata:a}=t;if(!i)throw new Error(`Invalid path template \`${i}\`!`);let s=dc(i.trim(),{revision:n,version:r});return s[0]!=="/"&&(s=`/${s}`),this.logger.debug(`Processed path template \`${i}\` and got \`${s}\``),{path:s,metadata:a}}async publish(t,r){let n=await this.getArtifactsForRevision(r);if(!n.length)throw new Rt("No artifacts to publish: please check your configuration!");let{bucketName:i}=this.targetConfig;this.logger.info(`Uploading to GCS bucket: "${i}"`);let a=await Promise.all(n.map(async s=>this.artifactProvider.downloadArtifact(s)));await Gk(this.targetConfig.pathTemplates,async s=>{let o=this.materializePathTemplate(s,t,r);return this.logger.info(`Uploading files to ${o.path}.`),this.logger.debug("Upload options:",{gzip:!0,metadata:o.metadata||GG}),Promise.all(a.map(async u=>this.gcsClient.uploadArtifact(u,o)))}),this.logger.info("Upload to GCS complete.")}};var d5t="gem",qLe=process.env.GEM_BIN||d5t,p5t=/^.*(\.gem)$/,ZH=class extends jr{constructor(t,r){super(t,r);this.name="gem";xa(qLe)}async pushGem(t){return zn(qLe,["push",t])}async publish(t,r){this.logger.debug("Fetching artifact list...");let n=await this.getArtifactsForRevision(r,{includeNames:p5t});if(!n.length){pr("Cannot push gem: no packages found");return}await Promise.all(n.map(async i=>{let a=await this.artifactProvider.downloadArtifact(i);return this.logger.info(`Pushing gem "${i.filename}"`),this.pushGem(a)})),this.logger.info("Successfully registered gem")}};var Ll=Ct(require("fs")),pC=Ct(require("path")),eV=Ct(Kd());var h5t=/^(?:.+-)?gh-pages\.zip$/,m5t="gh-pages",tV=class extends jr{constructor(t,r,n){super(t,r,n);this.name="gh-pages";this.github=Ni(),this.githubRepo=n,this.ghPagesConfig=this.getGhPagesConfig()}getGhPagesConfig(){let t,r;if(this.config.githubOwner&&this.config.githubRepo)t=this.config.githubOwner,r=this.config.githubRepo;else if(!this.config.githubOwner&&!this.config.githubRepo)t=this.githubRepo.owner,r=this.githubRepo.repo;else throw new Rt("[gh-pages] Invalid repository configuration: check repo owner and name");return{branch:this.config.branch||m5t,githubOwner:t,githubRepo:r}}async extractAssets(t,r){if(Ll.readdirSync(r).filter(a=>a!==".git").length>0)throw new Error("Destination directory is not empty: cannot extract the acrhive!");this.logger.info(`Extracting "${t}" to "${r}"...`),await Pp(t,r);let i=Ll.readdirSync(r).filter(a=>a!==".git");if(i.length===1&&Ll.statSync(pC.join(r,i[0])).isDirectory()){this.logger.debug("Single top-level directory found, moving files from it...");let a=pC.join(r,i[0]);Ll.readdirSync(a).forEach(s=>{let o=pC.join(a,s),u=pC.join(r,s);Ll.renameSync(o,u)}),Ll.rmdirSync(a)}}async commitArchiveToBranch(t,r,n,i,a){this.logger.info(`Cloning "${r.getRemoteString()}" to "${t}"...`),await(0,eV.default)().clone(r.getRemoteStringWithAuth(),t);let s=(0,eV.default)(t);this.logger.debug(`Checking out branch: "${n}"`);try{await s.checkout([n])}catch(u){if(!u.message.match(/pathspec .* did not match any file/))throw u;this.logger.debug(`Branch ${n} does not exist, creating a new orphaned branch...`),await s.checkout(["--orphan",n])}let o=await s.status();if(o.current!=="No"&&o.current!==n)throw new Error(`Something went very wrong: cannot switch to branch "${n}"`);this.logger.debug("Removing existing files from the working tree..."),await s.rm(["-r","-f","."]),await this.extractAssets(i,t),await s.add(["."]),await s.commit(`craft(gh-pages): update, version "${a}"`),this.logger.info(`Pushing branch "${n}"...`),Vr()?this.logger.info("[dry-run] Not pushing the branch."):await s.push("origin",n,["--set-upstream"])}async publish(t,r){let{githubOwner:n,githubRepo:i,branch:a}=this.ghPagesConfig;this.logger.debug("Fetching artifact list...");let s=await this.getArtifactsForRevision(r,{includeNames:h5t});if(s.length){if(s.length>1){pr(`Not implemented: more than one gh-pages archive found
|